-
Enhancement
-
Resolution: Unresolved
-
P4
-
None
-
None
-
generic
-
generic
ADDITIONAL SYSTEM INFORMATION :
Ubuntu 22.04.2 LTS
openjdk version "20-internal" 2023-03-21
OpenJDK Runtime Environment (build 20-internal-adhoc.admin1.jdk-jdk-20-34)
OpenJDK 64-Bit Server VM (build 20-internal-adhoc.admin1.jdk-jdk-20-34, mixed mode)
A DESCRIPTION OF THE PROBLEM :
When a static (or also private/public...) modifier is wrongly used within a function, then multiple error
messages occur instead of a single error. For example, there were 6 errors for the wrongly placed static
modifier in the attached example (and even more unnecessary error messages occur if the code is longer).
It is obvious that the static modifier should not be placed there, but the numerous unnecessary error
messages make it much harder to find the issue. This behavior can also make automatic error handling or
automatic repair approaches more difficult. Moreover, the behavior seems to be inconsistent since a wrongly
placed abstract modifier in the same position causes only a single error message.
class Test{
public static void main(String args[]){
static double d = 1.0;
final double d1 = 2.0;
System.out.println(d);
System.out.println(d1);
}
}
Ubuntu 22.04.2 LTS
openjdk version "20-internal" 2023-03-21
OpenJDK Runtime Environment (build 20-internal-adhoc.admin1.jdk-jdk-20-34)
OpenJDK 64-Bit Server VM (build 20-internal-adhoc.admin1.jdk-jdk-20-34, mixed mode)
A DESCRIPTION OF THE PROBLEM :
When a static (or also private/public...) modifier is wrongly used within a function, then multiple error
messages occur instead of a single error. For example, there were 6 errors for the wrongly placed static
modifier in the attached example (and even more unnecessary error messages occur if the code is longer).
It is obvious that the static modifier should not be placed there, but the numerous unnecessary error
messages make it much harder to find the issue. This behavior can also make automatic error handling or
automatic repair approaches more difficult. Moreover, the behavior seems to be inconsistent since a wrongly
placed abstract modifier in the same position causes only a single error message.
class Test{
public static void main(String args[]){
static double d = 1.0;
final double d1 = 2.0;
System.out.println(d);
System.out.println(d1);
}
}