Author: dazarov
Date: 2011-12-15 16:30:08 -0500 (Thu, 15 Dec 2011)
New Revision: 37377
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/marker/SeamMarkerResolutionTest.java
Log:
Add @SuppressWarnings quick fix
https://issues.jboss.org/browse/JBIDE-10187
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/marker/SeamMarkerResolutionTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/marker/SeamMarkerResolutionTest.java 2011-12-15
21:28:29 UTC (rev 37376)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/marker/SeamMarkerResolutionTest.java 2011-12-15
21:30:08 UTC (rev 37377)
@@ -59,8 +59,9 @@
fail("Configure Problem Severity marker resolution not found");
}
- private void checkForAddSuppressWarnings(IFile file, IMarkerResolution[] resolutions){
- if(file.getFileExtension().equals("java")){
+ private void checkForAddSuppressWarnings(IFile file, IMarker marker, IMarkerResolution[]
resolutions){
+ int severity = marker.getAttribute(IMarker.SEVERITY, 0);
+ if(file.getFileExtension().equals("java") && severity ==
IMarker.SEVERITY_WARNING){
for(IMarkerResolution resolution : resolutions){
if(resolution.getClass().equals(AddSuppressWarningsMarkerResolution.class))
return;
@@ -346,7 +347,7 @@
IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry()
.getResolutions(marker);
checkForConfigureProblemSeverity(resolutions);
- checkForAddSuppressWarnings(file, resolutions);
+ checkForAddSuppressWarnings(file, marker, resolutions);
for (int j = 0; j < resolutions.length; j++) {
IMarkerResolution resolution = resolutions[j];
if (resolution instanceof DeleteAnnotationMarkerResolution) {
@@ -380,7 +381,7 @@
IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry()
.getResolutions(marker);
checkForConfigureProblemSeverity(resolutions);
- checkForAddSuppressWarnings(file, resolutions);
+ checkForAddSuppressWarnings(file, marker, resolutions);
for (int j = 0; j < resolutions.length; j++) {
IMarkerResolution resolution = resolutions[j];
if (resolution instanceof AddAnnotatedMethodMarkerResolution) {
@@ -410,7 +411,7 @@
IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry()
.getResolutions(marker);
checkForConfigureProblemSeverity(resolutions);
- checkForAddSuppressWarnings(file, resolutions);
+ checkForAddSuppressWarnings(file, marker, resolutions);
for (int j = 0; j < resolutions.length; j++) {
IMarkerResolution resolution = resolutions[j];
if (resolution instanceof AddAnnotatedMethodMarkerResolution) {
@@ -440,7 +441,7 @@
IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry()
.getResolutions(marker);
checkForConfigureProblemSeverity(resolutions);
- checkForAddSuppressWarnings(file, resolutions);
+ checkForAddSuppressWarnings(file, marker, resolutions);
for (int j = 0; j < resolutions.length; j++) {
IMarkerResolution resolution = resolutions[j];
if (resolution instanceof ChangeScopeMarkerResolution) {
@@ -466,7 +467,7 @@
IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry()
.getResolutions(marker);
checkForConfigureProblemSeverity(resolutions);
- checkForAddSuppressWarnings(file, resolutions);
+ checkForAddSuppressWarnings(file, marker, resolutions);
for (int j = 0; j < resolutions.length; j++) {
IMarkerResolution resolution = resolutions[j];
if (resolution instanceof ChangeScopeMarkerResolution) {
@@ -500,7 +501,7 @@
IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry()
.getResolutions(marker);
checkForConfigureProblemSeverity(resolutions);
- checkForAddSuppressWarnings(file, resolutions);
+ checkForAddSuppressWarnings(file, marker, resolutions);
for (int j = 0; j < resolutions.length; j++) {
IMarkerResolution resolution = resolutions[j];
if (resolution instanceof AddSetterMarkerResolution) {