Changes between Version 70 and Version 71 of j2p


Ignore:
Timestamp:
05/15/24 15:08:03 (6 months ago)
Author:
wouter
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • j2p

    v70 v71  
    129129Java code {{{X instanceof C}}} is translated as in Java, so null/None is not an instance of C - C is not "Optional" and you do not need to write {{{X instanceof @Nonnull C}}}.
    130130
     131Also be aware of the subtleties of this notation. For instance
     132{{{@Nonnnull Set<String>}}} is a set that can not be null but that contain null values.
     133{{{@Nonnull Set<@Nonnull String>}}} is a set that can not be null and also can not contain null values.
     134
     135
    131136{{{#!td style="background: #efe"
    132137@Nonnull can be used by the java compiler to do extra checks on your code. You may need to enable this. For instance in Eclipse check Preferences/Java/Compiler/Errors/Warnings and scroll down to "Null Analysis". Note that Eclipse uses its own annotations, you have to add @Nonnull.