forked from spotbugs/spotbugs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix for issue 1313, do not report volatile problems in synthetic code With the fix for Eclipse bug 544521, https://bugs.eclipse.org/bugs/show_bug.cgi?id=544521, the Eclipse 4.17+ Java compiler will generate synthetic code for switch expressions. spotbugs reports VO_VOLATILE_REFERENCE_TO_ARRAY issues in this synthetic code. This changes makes spotbugs ignore synthetic fields during VO_VOLATILE_REFERENCE_TO_ARRAY analysis.
- Loading branch information
1 parent
753ae58
commit 3d047b9
Showing
3 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
spotbugsTestCases/src/java/ghIssues/issue1313/Issue1313.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package ghIssues.issue1313; | ||
|
||
/** | ||
* Manual test snippet for issue 1313. | ||
*/ | ||
public class Issue1313 { | ||
|
||
enum TestEnum { | ||
TEST_ENUM_VALUE1, TEST_ENUM_VALUE2, | ||
} | ||
|
||
static void println(TestEnum testEnum) { | ||
switch (testEnum) { | ||
case TEST_ENUM_VALUE1: | ||
System.out.println("TEST_ENUM_VALUE1"); | ||
break; | ||
case TEST_ENUM_VALUE2: | ||
System.out.println("TEST_ENUM_VALUE2"); | ||
break; | ||
default: | ||
System.out.println("unknown enum value"); | ||
} | ||
} | ||
} |