Skip to content
This repository was archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
chore: Update message when annotations/interfaces are added after a c…
Browse files Browse the repository at this point in the history
…lass is compiled
  • Loading branch information
Christopher-Chianelli committed Apr 23, 2024
1 parent 1e17490 commit 60c6d53
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jpyinterpreter/src/main/python/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def add_class_annotation(annotation_type, /, **annotation_values: Any) -> Callab
def decorator(_cls: Type[T]) -> Type[T]:
from .translator import type_to_compiled_java_class, type_to_annotations
if _cls in type_to_compiled_java_class:
raise RuntimeError('Cannot add an annotation after a class been compiled.')
raise RuntimeError('Cannot add an annotation after a class has been compiled.')
annotations = type_to_annotations.get(_cls, [])
annotation = JavaAnnotation(annotation_type, annotation_values)
annotations.append(annotation)
Expand All @@ -34,7 +34,7 @@ def add_java_interface(java_interface: JClass | str, /) -> Callable[[Type[T]], T
def decorator(_cls: Type[T]) -> Type[T]:
from .translator import type_to_compiled_java_class, type_to_java_interfaces
if _cls in type_to_compiled_java_class:
raise RuntimeError('Cannot add a marker interface after a class been compiled.')
raise RuntimeError('Cannot add a interface after a class has been compiled.')
marker_interfaces = type_to_java_interfaces.get(_cls, [])
marker_interfaces.append(java_interface)
type_to_java_interfaces[_cls] = marker_interfaces
Expand Down

0 comments on commit 60c6d53

Please sign in to comment.