RFR: 8202056: Expand serial warning to check for bad overloads of serial-related methods and ineffectual fields [v18]
Joe Darcy
darcy at openjdk.java.net
Fri Oct 8 04:31:08 UTC 2021
On Fri, 8 Oct 2021 03:20:45 GMT, Vicente Romero <vromero at openjdk.org> wrote:
>> Joe Darcy has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Add support for checking for serialPersistentFields initialized to a literal null.
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java line 5565:
>
>> 5563: */
>> 5564: private void checkSerialStructure(JCClassDecl tree, ClassSymbol c, Env<AttrContext> env) {
>> 5565: (new SerialTypeVisitor()).visit(c, tree);
>
> do we want to show the additional warnings regardless of the source we are compiling? I mean also for source < 18? if not then we will need to add a new feature to com.sun.tools.javac.code.Source, then check that the feature is allowed etc
Other than new constraints/conditions for new constructs like records, the semantics checks are serialization haven't changed very much since JDK 1.2-1.3. So I don't think it is necessary to gate the serial checks on the source level since the warnings are equally valid on earlier source levels too.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5709
More information about the compiler-dev
mailing list