-
Enhancement
-
Resolution: Fixed
-
P3
-
7
-
b41
-
unknown
-
generic
-
Not verified
Recent work on javac diagnostics have underlined the need for better diagnostics; the diagnostics to be improved, esp. those regarding the type-system area of the compiler, would hugely benefit from some kind of multiline/tabular support.
Examples:
1) Type-system diagnostic:
Test.java:3: method test in class Foo<T #0> cannot be applied to given types
required: T #0
found: T #1
where T #0,T #1 are typevariables:
T #0 extends String
(declared in class Foo)
T #1 extends Integer
(declared in method <T>foo(T))
1 error
2) Method resolution diagnostics
Test.java:6: no suitable method m found for (String,String)
method: <T>m(T,T) in Test
(inferred type argument(s) String do not conform to bounds of type variable(s) T)
method: m(Integer) in Test
1 error
All the above diagnostics suggests the need of a more structured way of representing the contents of a diagnostic sub-elements. In both examples we have that the diagnostic is composed of subparts (where clause in the first case, list of unapplicable method in the second case) that should displayed with the correct amount of indentation. This requires some sort of basic multiline support at the level of the javac diagnostic system.
Examples:
1) Type-system diagnostic:
Test.java:3: method test in class Foo<T #0> cannot be applied to given types
required: T #0
found: T #1
where T #0,T #1 are typevariables:
T #0 extends String
(declared in class Foo)
T #1 extends Integer
(declared in method <T>foo(T))
1 error
2) Method resolution diagnostics
Test.java:6: no suitable method m found for (String,String)
method: <T>m(T,T) in Test
(inferred type argument(s) String do not conform to bounds of type variable(s) T)
method: m(Integer) in Test
1 error
All the above diagnostics suggests the need of a more structured way of representing the contents of a diagnostic sub-elements. In both examples we have that the diagnostic is composed of subparts (where clause in the first case, list of unapplicable method in the second case) that should displayed with the correct amount of indentation. This requires some sort of basic multiline support at the level of the javac diagnostic system.
- relates to
-
JDK-6722234 javac diagnostics need better integration with the type-system
-
- Closed
-
-
JDK-6769027 Source line should be displayed immediately after the first diagnostic line
-
- Closed
-
-
JDK-5088624 cannot find symbol message should be more intelligent
-
- Closed
-