Community
Participate
Working Groups
It seems that the org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled causes the compiler to ignore statement scope @SuppressWarnings annotations. > cat bad.prefs org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled org.eclipse.jdt.core.compiler.problem.rawTypeReference=error org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled org.eclipse.jdt.core.compiler.source=1.8 > cat Test.java public class Test { public static void main(String[] args) { @SuppressWarnings("rawtypes") Class<? extends Enum> enumClass = null; System.out.println(enumClass); } } > java -jar ecj-4.6.3.jar -properties bad.prefs Test.java && java Test Exception in thread "main" java.lang.Error: Unresolved compilation problem: Enum is a raw type. References to generic type Enum<E> should be parameterized at Test.main(Test.java:4) > sed 's:fatalOptionalError=enabled:fatalOptionalError=disabled:g' <bad.prefs >good.prefs > java -jar ecj-4.6.3.jar -properties good.prefs Test.java && java Test null
I can't reproduce with latest 4.7 build - I20170508-2000. Note, I had only the preferences you had specified. So not sure if there are any other factors involved. Doug, can you try the build I mentioned?
I can still reproduce with ecj-4.7M6.jar and ecj-I20170508-2000.jar: > java -version java version "1.8.0_121" Java(TM) SE Runtime Environment (build 1.8.0_121-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode) > java -jar ~/Downloads/ecj-4.7M6.jar -properties bad.prefs Test.java && java Test Exception in thread "main" java.lang.Error: Unresolved compilation problem: Enum is a raw type. References to generic type Enum<E> should be parameterized at Test.main(Test.java:4) > java -jar ~/Downloads/ecj-I20170508-2000.jar -properties bad.prefs Test.java && java Test Exception in thread "main" java.lang.Error: Unresolved compilation problem: Enum is a raw type. References to generic type Enum<E> should be parameterized at Test.main(Test.java:4)
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.
I can reproduce. Not good, suppressOptionalErrors allows to make the error invisible, but fatalOptionalError lets it crash at runtime. To be consistent, ecj should decide to either 1. disallow suppressing fatal errors, or 2. let @SW suppress optional problems even when configured as fatal Option 2. is being requested and I second that motion. It implies that only non-suppressed optional problems are fatal, of course.
(In reply to Stephan Herrmann from comment #4) > 2. let @SW suppress optional problems even when configured as fatal > > Option 2. is being requested and I second that motion. It implies that only > non-suppressed optional problems are fatal, of course. +1
Bulk move of unassigned bugs to 4.15
Bulk move to 4.16
Bulk move of unassigned bugs to 4.17
Can still reproduce. On these versions: * ecj-4.28.jar: https://download.eclipse.org/eclipse/downloads/drops4/R-4.28-202306050440/ * ecj-4.29M1.jar: https://download.eclipse.org/eclipse/downloads/drops4/S-4.29M1-202307051800/ * ecj-I20230810-1800.jar: https://download.eclipse.org/eclipse/downloads/drops4/I20230810-1800/ Updated for JDK20: > cat bad.prefs org.eclipse.jdt.core.compiler.codegen.targetPlatform=20 org.eclipse.jdt.core.compiler.compliance=20 org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled org.eclipse.jdt.core.compiler.problem.rawTypeReference=error org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled org.eclipse.jdt.core.compiler.source=20 > cat Test.java public class Test { public static void main(String[] args) { @SuppressWarnings("rawtypes") Class<? extends Enum> enumClass = null; System.out.println(enumClass); } } > java -jar ecj-4.28.jar -properties bad.prefs Test.java _No output_ > java Test Exception in thread "main" java.lang.Error: Unresolved compilation problem: Enum is a raw type. References to generic type Enum<E> should be parameterized at Test.main(Test.java:4) > java -version openjdk version "20.0.2" 2023-07-18 OpenJDK Runtime Environment (build 20.0.2+9-Ubuntu-0ubuntu123.04) OpenJDK 64-Bit Server VM (build 20.0.2+9-Ubuntu-0ubuntu123.04, mixed mode, sharing)
(In reply to Patrick Ziegler from comment #10) > Can still reproduce. Project bug tracker moved to https://github.com/eclipse-jdt/eclipse.jdt.core/issues If you are interested in a fix, please create an issue ticket with latest steps to reproduce / information from this ticket.
Opened an issue on GitHub: https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1282