Changes between Version 61 and Version 62 of j2p


Ignore:
Timestamp:
05/14/24 10:45:20 (7 months ago)
Author:
wouter
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • j2p

    v61 v62  
    120120All these complications around varargs, including more eg [https://github.com/mrocklin/multipledispatch/issues/72 around dispatching vararg-typed methods] led us to currently not support varargs.
    121121
     122==== @Nonnull
     123Java variables like {{{String val}}} can contain a null value, and functions like {{{String f() { ... } }}} can return null. Therefore they are translated to {{{val:Optional[str]}}} and {{{def f(self)->Optional[str]}}}.
     124You can annotate the java code with @Nonnull (from {{{javax.annotation.Nonnull}}}) to indicate the value/return value will not be null, like this
     125{{{@Nonnull String val}}} or {{{@Nonnull String f() { ... } }}}.
     126
     127Note that Nonnull is NOT inherited by subclasses. Therefore the annotation may have to be repeated in the derived classes.
     128
    122129==== More notes:
    123130* some classes like {{{Arrays}}} or {{{Override}}} do not have a direct python equivalent. calls to static functions in these classes can still be translated.