From 64883bbd0a5fc0275696e822af3a74fba394ee4b Mon Sep 17 00:00:00 2001 From: Maurizio Cimadamore Date: Thu, 5 Dec 2024 08:51:00 +0000 Subject: [PATCH] Add missing lint categories in compiler.properties Simplify some lambda expressions Simplify Lint::logIfEnabled by accepting a log parameter --- .../com/sun/tools/javac/code/Lint.java | 5 +- .../com/sun/tools/javac/comp/Attr.java | 10 +-- .../com/sun/tools/javac/comp/Check.java | 89 +++++++++---------- .../com/sun/tools/javac/comp/Flow.java | 4 +- .../sun/tools/javac/file/BaseFileManager.java | 2 +- .../tools/javac/resources/compiler.properties | 22 +++++ 6 files changed, 72 insertions(+), 60 deletions(-) diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Lint.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Lint.java index e46b58b0954ea..c55830849c88a 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Lint.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Lint.java @@ -96,7 +96,6 @@ public Lint suppress(LintCategory... lc) { return l; } - private final Log log; private final AugmentVisitor augmentor; private final EnumSet values; @@ -150,14 +149,12 @@ protected Lint(Context context) { context.put(lintKey, this); augmentor = new AugmentVisitor(context); - log = Log.instance(context); } protected Lint(Lint other) { this.augmentor = other.augmentor; this.values = other.values.clone(); this.suppressedValues = other.suppressedValues.clone(); - this.log = other.log; } @Override @@ -394,7 +391,7 @@ public boolean isSuppressed(LintCategory lc) { /** * Helper method. Log a lint warning if its lint category is enabled. */ - public void logIfEnabled(DiagnosticPosition pos, LintWarning warning) { + public void logIfEnabled(Log log, DiagnosticPosition pos, LintWarning warning) { if (isEnabled(warning.getLintCategory())) { log.warning(pos, warning); } diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java index e5a36b50de384..982d348592f7c 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java @@ -1940,7 +1940,7 @@ private Symbol enumConstant(JCTree tree, Type enumType) { public void visitSynchronized(JCSynchronized tree) { chk.checkRefType(tree.pos(), attribExpr(tree.lock, env)); if (isValueBased(tree.lock.type)) { - env.info.lint.logIfEnabled(tree.pos(), LintWarnings.AttemptToSynchronizeOnInstanceOfValueBasedClass); + env.info.lint.logIfEnabled(log, tree.pos(), LintWarnings.AttemptToSynchronizeOnInstanceOfValueBasedClass); } attribStat(tree.body, env); result = null; @@ -2047,7 +2047,7 @@ void checkAutoCloseable(DiagnosticPosition pos, Env env, Type resou if (close.kind == MTH && close.overrides(syms.autoCloseableClose, resource.tsym, types, true) && chk.isHandled(syms.interruptedExceptionType, types.memberType(resource, close).getThrownTypes())) { - env.info.lint.logIfEnabled(pos, LintWarnings.TryResourceThrowsInterruptedExc(resource)); + env.info.lint.logIfEnabled(log, pos, LintWarnings.TryResourceThrowsInterruptedExc(resource)); } } } @@ -4442,7 +4442,7 @@ public void visitSelect(JCFieldAccess tree) { sym.kind == MTH && sym.name.equals(names.close) && sym.overrides(syms.autoCloseableClose, sitesym.type.tsym, types, true)) { - env.info.lint.logIfEnabled(tree, LintWarnings.TryExplicitCloseCall); + env.info.lint.logIfEnabled(log, tree, LintWarnings.TryExplicitCloseCall); } // Disallow selecting a type from an expression @@ -4469,9 +4469,9 @@ public void visitSelect(JCFieldAccess tree) { // If the qualified item is not a type and the selected item is static, report // a warning. Make allowance for the class of an array type e.g. Object[].class) if (!sym.owner.isAnonymous()) { - chk.lint.logIfEnabled(tree, LintWarnings.StaticNotQualifiedByType(sym.kind.kindName(), sym.owner)); + chk.lint.logIfEnabled(log, tree, LintWarnings.StaticNotQualifiedByType(sym.kind.kindName(), sym.owner)); } else { - chk.lint.logIfEnabled(tree, LintWarnings.StaticNotQualifiedByType2(sym.kind.kindName())); + chk.lint.logIfEnabled(log, tree, LintWarnings.StaticNotQualifiedByType2(sym.kind.kindName())); } } diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java index fb1b852ca47ce..a1519c040db2d 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java @@ -57,7 +57,6 @@ import com.sun.tools.javac.util.JCDiagnostic.Error; import com.sun.tools.javac.util.JCDiagnostic.Fragment; import com.sun.tools.javac.util.JCDiagnostic.LintWarning; -import com.sun.tools.javac.util.JCDiagnostic.Warning; import com.sun.tools.javac.util.List; import com.sun.tools.javac.code.Lint; @@ -286,7 +285,7 @@ public void warnDeclaredUsingPreview(DiagnosticPosition pos, Symbol sym) { * @param msg A Warning describing the problem. */ public void warnRestrictedAPI(DiagnosticPosition pos, Symbol sym) { - lint.logIfEnabled(pos, LintWarnings.RestrictedMethod(sym.enclClass(), sym)); + lint.logIfEnabled(log, pos, LintWarnings.RestrictedMethod(sym.enclClass(), sym)); } /** Warn about unchecked operation. @@ -650,7 +649,7 @@ public void checkRedundantCast(Env env, final JCTypeCast tree) { && !(ignoreAnnotatedCasts && TreeInfo.containsTypeAnnotation(tree.clazz)) && !is292targetTypeCast(tree)) { deferredLintHandler.report(_l -> { - lint.logIfEnabled(tree.pos(), LintWarnings.RedundantCast(tree.clazz.type)); + lint.logIfEnabled(log, tree.pos(), LintWarnings.RedundantCast(tree.clazz.type)); }); } } @@ -955,7 +954,7 @@ void checkVarargsMethodDecl(Env env, JCMethodDecl tree) { } } else if (hasTrustMeAnno && varargElemType != null && types.isReifiable(varargElemType)) { - lint.logIfEnabled(tree, LintWarnings.VarargsRedundantTrustmeAnno( + lint.logIfEnabled(log, tree, LintWarnings.VarargsRedundantTrustmeAnno( syms.trustMeType.tsym, diags.fragment(Fragments.VarargsTrustmeOnReifiableVarargs(varargElemType)))); } @@ -1324,9 +1323,7 @@ && checkDisjoint(pos, flags, private void warnOnExplicitStrictfp(DiagnosticPosition pos) { DiagnosticPosition prevLintPos = deferredLintHandler.setPos(pos); try { - deferredLintHandler.report(_ -> { - lint.logIfEnabled(pos, LintWarnings.Strictfp); - }); + deferredLintHandler.report(_ -> lint.logIfEnabled(log, pos, LintWarnings.Strictfp)); } finally { deferredLintHandler.setPos(prevLintPos); } @@ -1545,7 +1542,7 @@ void checkRaw(JCTree tree, Env env) { !TreeInfo.isDiamond(tree) && !withinAnonConstr(env) && tree.type.isRaw()) { - lint.logIfEnabled(tree.pos(), LintWarnings.RawClassUse(tree.type, tree.type.tsym.type)); + lint.logIfEnabled(log, tree.pos(), LintWarnings.RawClassUse(tree.type, tree.type.tsym.type)); } } //where @@ -1869,7 +1866,7 @@ else if (unhandledUnerased.nonEmpty()) { // Optional warning if varargs don't agree if ((((m.flags() ^ other.flags()) & Flags.VARARGS) != 0)) { - lint.logIfEnabled(TreeInfo.diagnosticPositionFor(m, tree), + lint.logIfEnabled(log, TreeInfo.diagnosticPositionFor(m, tree), ((m.flags() & Flags.VARARGS) != 0) ? LintWarnings.OverrideVarargsMissing(varargsOverrides(m, other)) : LintWarnings.OverrideVarargsExtra(varargsOverrides(m, other))); @@ -4093,7 +4090,7 @@ void checkDivZero(final DiagnosticPosition pos, Symbol operator, Type operand) { int opc = ((OperatorSymbol)operator).opcode; if (opc == ByteCodes.idiv || opc == ByteCodes.imod || opc == ByteCodes.ldiv || opc == ByteCodes.lmod) { - deferredLintHandler.report(_ -> lint.logIfEnabled(pos, LintWarnings.DivZero)); + deferredLintHandler.report(_ -> lint.logIfEnabled(log, pos, LintWarnings.DivZero)); } } } @@ -4106,9 +4103,8 @@ void checkDivZero(final DiagnosticPosition pos, Symbol operator, Type operand) { */ void checkLossOfPrecision(final DiagnosticPosition pos, Type found, Type req) { if (found.isNumeric() && req.isNumeric() && !types.isAssignable(found, req)) { - deferredLintHandler.report(_ -> { - lint.logIfEnabled(pos, LintWarnings.PossibleLossOfPrecision(found, req)); - }); + deferredLintHandler.report(_ -> + lint.logIfEnabled(log, pos, LintWarnings.PossibleLossOfPrecision(found, req))); } } @@ -4117,7 +4113,7 @@ void checkLossOfPrecision(final DiagnosticPosition pos, Type found, Type req) { */ void checkEmptyIf(JCIf tree) { if (tree.thenpart.hasTag(SKIP) && tree.elsepart == null) { - lint.logIfEnabled(tree.thenpart.pos(), LintWarnings.EmptyIf); + lint.logIfEnabled(log, tree.thenpart.pos(), LintWarnings.EmptyIf); } } @@ -4264,7 +4260,7 @@ void checkForBadAuxiliaryClassAccess(DiagnosticPosition pos, Env en rs.isAccessible(env, c) && !fileManager.isSameFile(c.sourcefile, env.toplevel.sourcefile)) { - lint.logIfEnabled(pos, + lint.logIfEnabled(log, pos, LintWarnings.AuxiliaryClassAccessedFromOutsideOfItsSourceFile(c, c.sourcefile)); } } @@ -4307,9 +4303,8 @@ void checkDefaultConstructor(ClassSymbol c, DiagnosticPosition pos) { // Warning may be suppressed by // annotations; check again for being // enabled in the deferred context. - deferredLintHandler.report(_ -> { - lint.logIfEnabled(pos, LintWarnings.MissingExplicitCtor(c, pkg, modle)); - }); + deferredLintHandler.report(_ -> + lint.logIfEnabled(log, pos, LintWarnings.MissingExplicitCtor(c, pkg, modle))); } else { return; } @@ -4345,7 +4340,7 @@ public void warn(LintCategory lint) { method.attribute(syms.trustMeType.tsym) != null && isTrustMeAllowedOnMethod(method) && !types.isReifiable(method.type.getParameterTypes().last())) { - Check.this.lint.logIfEnabled(pos(), LintWarnings.VarargsUnsafeUseVarargsParam(method.params.last())); + Check.this.lint.logIfEnabled(log, pos(), LintWarnings.VarargsUnsafeUseVarargsParam(method.params.last())); } break; default: @@ -4643,18 +4638,16 @@ private void checkVisible(DiagnosticPosition pos, Symbol what, PackageSymbol inP void checkModuleExists(final DiagnosticPosition pos, ModuleSymbol msym) { if (msym.kind != MDL) { - deferredLintHandler.report(_ -> { - lint.logIfEnabled(pos, LintWarnings.ModuleNotFound(msym)); - }); + deferredLintHandler.report(_ -> + lint.logIfEnabled(log, pos, LintWarnings.ModuleNotFound(msym))); } } void checkPackageExistsForOpens(final DiagnosticPosition pos, PackageSymbol packge) { if (packge.members().isEmpty() && ((packge.flags() & Flags.HAS_RESOURCE) == 0)) { - deferredLintHandler.report(_ -> { - lint.logIfEnabled(pos, LintWarnings.PackageEmptyOrNotFound(packge)); - }); + deferredLintHandler.report(_ -> + lint.logIfEnabled(log, pos, LintWarnings.PackageEmptyOrNotFound(packge))); } } @@ -4664,7 +4657,7 @@ void checkModuleRequires(final DiagnosticPosition pos, final RequiresDirective r if (rd.isTransitive() && lint.isEnabled(LintCategory.REQUIRES_TRANSITIVE_AUTOMATIC)) { log.warning(pos, LintWarnings.RequiresTransitiveAutomatic); } else { - lint.logIfEnabled(pos, LintWarnings.RequiresAutomatic); + lint.logIfEnabled(log, pos, LintWarnings.RequiresAutomatic); } }); } @@ -4962,7 +4955,7 @@ public Void visitTypeAsClass(TypeElement e, } if (svuidSym == null) { - log.warning(p.pos(), Warnings.MissingSVUID(c)); + log.warning(p.pos(), LintWarnings.MissingSVUID(c)); } // Check for serialPersistentFields to gate checks for @@ -4991,7 +4984,7 @@ public Void visitTypeAsClass(TypeElement e, // component type is not. log.warning( TreeInfo.diagnosticPositionFor(enclosed, tree), - Warnings.NonSerializableInstanceField); + LintWarnings.NonSerializableInstanceField); } else if (varType.hasTag(ARRAY)) { ArrayType arrayType = (ArrayType)varType; Type elementType = arrayType.elemtype; @@ -5002,7 +4995,7 @@ public Void visitTypeAsClass(TypeElement e, if (!canBeSerialized(elementType)) { log.warning( TreeInfo.diagnosticPositionFor(enclosed, tree), - Warnings.NonSerializableInstanceFieldArray(elementType)); + LintWarnings.NonSerializableInstanceFieldArray(elementType)); } } } @@ -5086,7 +5079,7 @@ private void checkCtorAccess(JCClassDecl tree, ClassSymbol c) { } } log.warning(tree.pos(), - Warnings.ExternalizableMissingPublicNoArgCtor); + LintWarnings.ExternalizableMissingPublicNoArgCtor); } else { // Approximate access to the no-arg constructor up in // the superclass chain by checking that the @@ -5114,7 +5107,7 @@ private void checkCtorAccess(JCClassDecl tree, ClassSymbol c) { (supertype.getNestingKind() == NestingKind.MEMBER && ((supertype.flags() & STATIC) == 0))) log.warning(tree.pos(), - Warnings.SerializableMissingAccessNoArgCtor(supertype.getQualifiedName())); + LintWarnings.SerializableMissingAccessNoArgCtor(supertype.getQualifiedName())); } } } @@ -5134,20 +5127,20 @@ private void checkSerialVersionUID(JCClassDecl tree, Element e, VarSymbol svuid) (STATIC | FINAL)) { log.warning( TreeInfo.diagnosticPositionFor(svuid, tree), - Warnings.ImproperSVUID((Symbol)e)); + LintWarnings.ImproperSVUID((Symbol)e)); } // check svuid has type long if (!svuid.type.hasTag(LONG)) { log.warning( TreeInfo.diagnosticPositionFor(svuid, tree), - Warnings.LongSVUID((Symbol)e)); + LintWarnings.LongSVUID((Symbol)e)); } if (svuid.getConstValue() == null) log.warning( TreeInfo.diagnosticPositionFor(svuid, tree), - Warnings.ConstantSVUID((Symbol)e)); + LintWarnings.ConstantSVUID((Symbol)e)); } private void checkSerialPersistentFields(JCClassDecl tree, Element e, VarSymbol spf) { @@ -5156,19 +5149,19 @@ private void checkSerialPersistentFields(JCClassDecl tree, Element e, VarSymbol (PRIVATE | STATIC | FINAL)) { log.warning( TreeInfo.diagnosticPositionFor(spf, tree), - Warnings.ImproperSPF); + LintWarnings.ImproperSPF); } if (!types.isSameType(spf.type, OSF_TYPE)) { log.warning( TreeInfo.diagnosticPositionFor(spf, tree), - Warnings.OSFArraySPF); + LintWarnings.OSFArraySPF); } if (isExternalizable((Type)(e.asType()))) { log.warning( TreeInfo.diagnosticPositionFor(spf, tree), - Warnings.IneffectualSerialFieldExternalizable); + LintWarnings.IneffectualSerialFieldExternalizable); } // Warn if serialPersistentFields is initialized to a @@ -5179,7 +5172,7 @@ private void checkSerialPersistentFields(JCClassDecl tree, Element e, VarSymbol JCExpression initExpr = variableDef.init; if (initExpr != null && TreeInfo.isNull(initExpr)) { log.warning(initExpr.pos(), - Warnings.SPFNullInit); + LintWarnings.SPFNullInit); } } } @@ -5259,7 +5252,7 @@ private void checkExternMethodRecord(JCClassDecl tree, Element e, MethodSymbol m if (isExtern && isExternMethod(tree, e, method, argType)) { log.warning( TreeInfo.diagnosticPositionFor(method, tree), - Warnings.IneffectualExternalizableMethodRecord(method.getSimpleName().toString())); + LintWarnings.IneffectualExternalizableMethodRecord(method.getSimpleName().toString())); } } @@ -5299,7 +5292,7 @@ public Void visitTypeAsEnum(TypeElement e, if (serialFieldNames.contains(name)) { log.warning( TreeInfo.diagnosticPositionFor(field, tree), - Warnings.IneffectualSerialFieldEnum(name)); + LintWarnings.IneffectualSerialFieldEnum(name)); } } @@ -5308,7 +5301,7 @@ public Void visitTypeAsEnum(TypeElement e, if (serialMethodNames.contains(name)) { log.warning( TreeInfo.diagnosticPositionFor(method, tree), - Warnings.IneffectualSerialMethodEnum(name)); + LintWarnings.IneffectualSerialMethodEnum(name)); } if (isExtern) { @@ -5348,7 +5341,7 @@ private void checkExternMethodEnum(JCClassDecl tree, Element e, MethodSymbol met if (isExternMethod(tree, e, method, argType)) { log.warning( TreeInfo.diagnosticPositionFor(method, tree), - Warnings.IneffectualExternMethodEnum(method.getSimpleName().toString())); + LintWarnings.IneffectualExternMethodEnum(method.getSimpleName().toString())); } } @@ -5380,7 +5373,7 @@ public Void visitTypeAsInterface(TypeElement e, case "serialPersistentFields" -> { log.warning( TreeInfo.diagnosticPositionFor(field, tree), - Warnings.IneffectualSerialFieldInterface); + LintWarnings.IneffectualSerialFieldInterface); } case "serialVersionUID" -> { @@ -5420,7 +5413,7 @@ private void checkPrivateMethod(JCClassDecl tree, if ((method.flags() & PRIVATE) == 0) { log.warning( TreeInfo.diagnosticPositionFor(method, tree), - Warnings.NonPrivateMethodWeakerAccess); + LintWarnings.NonPrivateMethodWeakerAccess); } } @@ -5430,7 +5423,7 @@ private void checkDefaultIneffective(JCClassDecl tree, if ((method.flags() & DEFAULT) == DEFAULT) { log.warning( TreeInfo.diagnosticPositionFor(method, tree), - Warnings.DefaultIneffective); + LintWarnings.DefaultIneffective); } } @@ -5477,7 +5470,7 @@ public Void visitTypeAsRecord(TypeElement e, case "serialPersistentFields" -> { log.warning( TreeInfo.diagnosticPositionFor(field, tree), - Warnings.IneffectualSerialFieldRecord); + LintWarnings.IneffectualSerialFieldRecord); } case "serialVersionUID" -> { @@ -5501,7 +5494,7 @@ public Void visitTypeAsRecord(TypeElement e, if (serialMethodNames.contains(name)) { log.warning( TreeInfo.diagnosticPositionFor(method, tree), - Warnings.IneffectualSerialMethodRecord(name)); + LintWarnings.IneffectualSerialMethodRecord(name)); } }} }}}); @@ -5586,7 +5579,7 @@ private void checkExternalizable(JCClassDecl tree, Element enclosing, MethodSymb if (isExternalizable((Type)enclosing.asType())) { log.warning( TreeInfo.diagnosticPositionFor(method, tree), - Warnings.IneffectualSerialMethodExternalizable(method.getSimpleName())); + LintWarnings.IneffectualSerialMethodExternalizable(method.getSimpleName())); } return; } diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java index abcca6fe3aea2..e167b81272b70 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java @@ -725,7 +725,7 @@ public void visitSwitch(JCSwitch tree) { // Warn about fall-through if lint switch fallthrough enabled. if (alive == Liveness.ALIVE && c.stats.nonEmpty() && l.tail.nonEmpty()) - lint.logIfEnabled(l.tail.head.pos(), + lint.logIfEnabled(log, l.tail.head.pos(), LintWarnings.PossibleFallThroughIntoCase); } tree.isExhaustive = tree.hasUnconditionalPattern || @@ -1233,7 +1233,7 @@ public void visitTry(JCTry tree) { scanStat(tree.finalizer); tree.finallyCanCompleteNormally = alive != Liveness.DEAD; if (alive == Liveness.DEAD) { - lint.logIfEnabled(TreeInfo.diagEndPos(tree.finalizer), + lint.logIfEnabled(log, TreeInfo.diagEndPos(tree.finalizer), LintWarnings.FinallyCannotComplete); } else { while (exits.nonEmpty()) { diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/file/BaseFileManager.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/file/BaseFileManager.java index f2f8eb0f0df42..646db6a6bf333 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/file/BaseFileManager.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/file/BaseFileManager.java @@ -525,6 +525,6 @@ synchronized void newOutputToPath(Path path) throws IOException { // Check whether we've already opened this file for output if (!outputFilesWritten.add(realPath)) - log.warning(LintWarnings.OutputFileClash(path)); // @@@: shouldn't we check for suppression? + log.warning(LintWarnings.OutputFileClash(path)); } } diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties index 866bc30f3d569..ca9c254cf8665 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties @@ -1879,6 +1879,7 @@ compiler.warn.lintOption=\ [{0}]\u0020 # 0: symbol +# lint: serial compiler.warn.constant.SVUID=\ serialVersionUID must be constant in class {0} @@ -1968,12 +1969,15 @@ compiler.warn.illegal.char.for.encoding=\ unmappable character for encoding {0} # 0: symbol +# lint: serial compiler.warn.improper.SVUID=\ serialVersionUID must be declared static final in class {0} +# lint: serial compiler.warn.improper.SPF=\ serialPersistentFields must be declared private static final to be effective +# lint: serial compiler.warn.SPF.null.init=\ serialPersistentFields ineffective if initialized to null.\n\ Initialize to an empty array to indicate no fields @@ -1996,17 +2000,21 @@ compiler.warn.unreachable.catch.1=\ thrown types {0} have already been caught # 0: symbol +# lint: serial compiler.warn.long.SVUID=\ serialVersionUID must be of type long in class {0} +# lint: serial compiler.warn.OSF.array.SPF=\ serialPersistentFields must be of type java.io.ObjectStreamField[] to be effective # 0: symbol +# lint: serial compiler.warn.missing.SVUID=\ serializable class {0} has no definition of serialVersionUID # 0: name +# lint: serial compiler.warn.serializable.missing.access.no.arg.ctor=\ cannot access a no-arg constructor in first non-serializable superclass {0} @@ -2051,53 +2059,67 @@ compiler.warn.serial.method.unexpected.return.type=\ compiler.warn.serial.method.unexpected.exception=\ serialization-related method {0} declared to throw an unexpected type {1} +# lint: serial compiler.warn.ineffectual.serial.field.interface=\ serialPersistentFields is not effective in an interface # 0: string +# lint: serial compiler.warn.ineffectual.serial.field.enum=\ serialization-related field {0} is not effective in an enum class # 0: string +# lint: serial compiler.warn.ineffectual.serial.method.enum=\ serialization-related method {0} is not effective in an enum class # 0: string +# lint: serial compiler.warn.ineffectual.extern.method.enum=\ externalization-related method {0} is not effective in an enum class +# lint: serial compiler.warn.ineffectual.serial.field.record=\ serialPersistentFields is not effective in a record class # 0: string +# lint: serial compiler.warn.ineffectual.serial.method.record=\ serialization-related method {0} is not effective in a record class # 0: string +# lint: serial compiler.warn.ineffectual.externalizable.method.record=\ externalization-related method {0} is not effective in a record class # 0: name +# lint: serial compiler.warn.ineffectual.serial.method.externalizable=\ serialization-related method {0} is not effective in an Externalizable class +# lint: serial compiler.warn.ineffectual.serial.field.externalizable=\ serialPersistentFields is not effective in an Externalizable class +# lint: serial compiler.warn.externalizable.missing.public.no.arg.ctor=\ an Externalizable class needs a public no-arg constructor +# lint: serial compiler.warn.non.serializable.instance.field=\ non-transient instance field of a serializable class declared with a non-serializable type # 0: type +# lint: serial compiler.warn.non.serializable.instance.field.array=\ non-transient instance field of a serializable class declared with an array having a non-serializable base component type {0} +# lint: serial compiler.warn.non.private.method.weaker.access=\ serialization-related method declared non-private in an interface will prevent\n\ classes implementing the interface from declaring the method as private +# lint: serial compiler.warn.default.ineffective=\ serialization-related default method from an interface will not be run by serialization for an implementing class