Changes between Version 86 and Version 87 of j2p


Ignore:
Timestamp:
06/10/24 10:02:18 (5 months ago)
Author:
wouter
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • j2p

    v86 v87  
    7171Fields in Java have to be initialized in the {{{__init__}}} function in the python translation.
    7272
    73 === Overloading methods
     73=== Overloaded methods
    7474Overloaded methods can not be handled by default python. To support it, an external library {{{plum-dispatch==2.2.2}}} is used. If you use overloading, you need to have plum installed to run your code. Check also the #@NonNull section.
    7575
    7676When a method is overloaded, the translator adds {{{@dispatch}}} annotations  in the translated code as required by plum.
    7777
    78  
     78
     79{{{#!td style="background: #fee"
     80If you have two methods overloading each other, and both methods end up with the same signature in python, then plum will NOT warn you and just use the last definition only. Therefore your translated code will not work as expected. An example is if your code has both {{{get(BigInteger x)}}} and {{{get(long x)}}}, both will be translated to {{{def get(self, x:int)}}} and plum will use only the last one defined.
     81}}}
    7982
    8083