Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8193888 | 11 | Maurizio Cimadamore | P3 | Resolved | Fixed | master |
During work on JDK-8055075 for creation of golden files for negative tests, it was suggested to update error diagnostics to have an additional sub-diagnostic with more information. The suggestion came based on the golden file seen for test: langtools/test/tools/javac/InconsistentInheritedSignature.java. Golden file for this test will need updates once this issue is fixed.
Current diagnostic key:
langtools/test/tools/javac/InconsistentInheritedSignature.java:40: error: types I2 and I1 are incompatible
Quoting Maurizio's initial analysis from email:
There are 3 diagnostics of that kind:
# 0: type, 1: type, 2: string
compiler.err.types.incompatible.diff.ret=\
types {0} and {1} are incompatible; both define {2}, but with unrelated return types
# 0: kind, 1: type, 2: name, 3: list of type, 4: symbol, 5: symbol
compiler.err.types.incompatible.unrelated.defaults=\
{0} {1} inherits unrelated defaults for {2}({3}) from types {4} and {5}
# 0: kind, 1: type, 2: name, 3: list of type, 4: symbol, 5: symbol
compiler.err.types.incompatible.abstract.default=\
{0} {1} inherits abstract and default for {2}({3}) from types {4} and {5}
They are inconsistent - as they should all say: 'types ... are incompatible ; reason'. All 3 diagnostics need to made more uniform - perhaps by structuring them using a common header:
# 0: type, 1: type, 2: fragment
compiler.err.types.incompatible=\
types {0} and {1} are incompatible;
{2}
And then multiple subdiagnostics - once for each 'reason' (passed as argument #2):
# 0: string
compiler.misc.diff.ret=
both define {2}, but with unrelated return types
# 0: kind, 1: type, 2: name, 3: list of type, 4: symbol, 5: symbol
compiler.misc.incompatible.unrelated.defaults=
{0} {1} inherits unrelated defaults for {2}({3}) from types {4} and {5}
# 0: kind, 1: type, 2: name, 3: list of type, 4: symbol, 5: symbol
compiler.misc.incompatible.abstract.default=\
{0} {1} inherits abstract and default for {2}({3}) from types {4} and {5}
Current diagnostic key:
langtools/test/tools/javac/InconsistentInheritedSignature.java:40: error: types I2 and I1 are incompatible
Quoting Maurizio's initial analysis from email:
There are 3 diagnostics of that kind:
# 0: type, 1: type, 2: string
compiler.err.types.incompatible.diff.ret=\
types {0} and {1} are incompatible; both define {2}, but with unrelated return types
# 0: kind, 1: type, 2: name, 3: list of type, 4: symbol, 5: symbol
compiler.err.types.incompatible.unrelated.defaults=\
{0} {1} inherits unrelated defaults for {2}({3}) from types {4} and {5}
# 0: kind, 1: type, 2: name, 3: list of type, 4: symbol, 5: symbol
compiler.err.types.incompatible.abstract.default=\
{0} {1} inherits abstract and default for {2}({3}) from types {4} and {5}
They are inconsistent - as they should all say: 'types ... are incompatible ; reason'. All 3 diagnostics need to made more uniform - perhaps by structuring them using a common header:
# 0: type, 1: type, 2: fragment
compiler.err.types.incompatible=\
types {0} and {1} are incompatible;
{2}
And then multiple subdiagnostics - once for each 'reason' (passed as argument #2):
# 0: string
compiler.misc.diff.ret=
both define {2}, but with unrelated return types
# 0: kind, 1: type, 2: name, 3: list of type, 4: symbol, 5: symbol
compiler.misc.incompatible.unrelated.defaults=
{0} {1} inherits unrelated defaults for {2}({3}) from types {4} and {5}
# 0: kind, 1: type, 2: name, 3: list of type, 4: symbol, 5: symbol
compiler.misc.incompatible.abstract.default=\
{0} {1} inherits abstract and default for {2}({3}) from types {4} and {5}
- backported by
-
JDK-8193888 uniform error diagnostics for inconsistent inherited method signatures
-
- Resolved
-
- relates to
-
JDK-8043283 Create .out files for negative tests in langtools regression ws
-
- Resolved
-