Author: xcoulon
Date: 2012-10-12 10:03:18 -0400 (Fri, 12 Oct 2012)
New Revision: 44482
Added:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/validation/
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/validation/JaxrsMetamodelValidationConstants.java
Removed:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/IMarkerResolutionDelegate.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/quickfix/
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/validation/JaxrsValidationQuickFixes.java
Modified:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/META-INF/MANIFEST.MF
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/configuration/ProjectBuilderConfigurer.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsHttpMethodValidatorDelegate.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsJavaApplicationValidatorDelegate.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsMetamodelValidator.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/facet/JaxrsFacetedProjectListener.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/quickfix/JaxrsMarkerResolutionGenerator.java
trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/MarkerUtils.java
Log:
Fixed - JBIDE-12835 - JAX-RS problem markers are not removed when JAX-RS support is
removed on project
https://issues.jboss.org/browse/JBIDE-12835
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/META-INF/MANIFEST.MF 2012-10-12
13:44:36 UTC (rev 44481)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/META-INF/MANIFEST.MF 2012-10-12
14:03:18 UTC (rev 44482)
@@ -40,7 +40,7 @@
org.jboss.tools.ws.jaxrs.core.internal.utils;x-friends:="org.jboss.tools.ws.jaxrs.core.test",
org.jboss.tools.ws.jaxrs.core.jdt,
org.jboss.tools.ws.jaxrs.core.metamodel,
- org.jboss.tools.ws.jaxrs.core.metamodel.quickfix,
+ org.jboss.tools.ws.jaxrs.core.metamodel.validation,
org.jboss.tools.ws.jaxrs.core.preferences,
org.jboss.tools.ws.jaxrs.core.pubsub
Bundle-ClassPath: .
Modified:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/configuration/ProjectBuilderConfigurer.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/configuration/ProjectBuilderConfigurer.java 2012-10-12
13:44:36 UTC (rev 44481)
+++
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/configuration/ProjectBuilderConfigurer.java 2012-10-12
14:03:18 UTC (rev 44482)
@@ -13,9 +13,11 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectNature;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder.JaxrsMetamodelBuilder;
import org.jboss.tools.ws.jaxrs.core.internal.utils.Logger;
+import
org.jboss.tools.ws.jaxrs.core.metamodel.validation.JaxrsMetamodelValidationConstants;
/**
* Class to configure (add/remove) the JAX-RS Metamodel Builder on a project.
@@ -51,6 +53,8 @@
} else {
Logger.debug("JAX-RS Metamodel Builder was not installed.");
}
+ project.deleteMarkers(JaxrsMetamodelValidationConstants.JAXRS_PROBLEM_TYPE, true,
IResource.DEPTH_INFINITE);
+ Logger.debug("JAX-RS Problem markers removed.");
}
/** {@inheritDoc} */
Modified:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsHttpMethodValidatorDelegate.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsHttpMethodValidatorDelegate.java 2012-10-12
13:44:36 UTC (rev 44481)
+++
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsHttpMethodValidatorDelegate.java 2012-10-12
14:03:18 UTC (rev 44482)
@@ -21,7 +21,7 @@
import org.jboss.tools.ws.jaxrs.core.internal.utils.Logger;
import org.jboss.tools.ws.jaxrs.core.jdt.Annotation;
import org.jboss.tools.ws.jaxrs.core.jdt.JdtUtils;
-import org.jboss.tools.ws.jaxrs.core.metamodel.quickfix.JaxrsValidationQuickFixes;
+import
org.jboss.tools.ws.jaxrs.core.metamodel.validation.JaxrsMetamodelValidationConstants;
import org.jboss.tools.ws.jaxrs.core.preferences.JaxrsPreferences;
/**
@@ -81,7 +81,7 @@
addProblem(JaxrsValidationMessages.HTTP_METHOD_MISSING_TARGET_ANNOTATION,
JaxrsPreferences.HTTP_METHOD_MISSING_TARGET_ANNOTATION, new String[0],
range.getLength(),
range.getOffset(), httpMethod.getResource(),
- JaxrsValidationQuickFixes.HTTP_METHOD_MISSING_TARGET_ANNOTATION_ID);
+ JaxrsMetamodelValidationConstants.HTTP_METHOD_MISSING_TARGET_ANNOTATION_ID);
} else {
final String annotationValue = targetAnnotation.getValue("value");
if (annotationValue == null) {
@@ -89,14 +89,14 @@
addProblem(JaxrsValidationMessages.HTTP_METHOD_INVALID_TARGET_ANNOTATION_VALUE,
JaxrsPreferences.HTTP_METHOD_INVALID_TARGET_ANNOTATION_VALUE, new String[0],
range.getLength(),
range.getOffset(), httpMethod.getResource(),
- JaxrsValidationQuickFixes.HTTP_METHOD_INVALID_TARGET_ANNOTATION_VALUE_ID);
+ JaxrsMetamodelValidationConstants.HTTP_METHOD_INVALID_TARGET_ANNOTATION_VALUE_ID);
} else if (!annotationValue.equals(ElementType.METHOD.name())) {
final ISourceRange range =
JdtUtils.resolveMemberPairValueRange(targetAnnotation.getJavaAnnotation(),
targetAnnotation.getFullyQualifiedName(), "value");
addProblem(JaxrsValidationMessages.HTTP_METHOD_INVALID_TARGET_ANNOTATION_VALUE,
JaxrsPreferences.HTTP_METHOD_INVALID_TARGET_ANNOTATION_VALUE, new String[0],
range.getLength(),
range.getOffset(), httpMethod.getResource(),
- JaxrsValidationQuickFixes.HTTP_METHOD_INVALID_TARGET_ANNOTATION_VALUE_ID);
+ JaxrsMetamodelValidationConstants.HTTP_METHOD_INVALID_TARGET_ANNOTATION_VALUE_ID);
}
}
@@ -115,7 +115,7 @@
addProblem(JaxrsValidationMessages.HTTP_METHOD_MISSING_RETENTION_ANNOTATION,
JaxrsPreferences.HTTP_METHOD_MISSING_RETENTION_ANNOTATION, new String[0],
range.getLength(),
range.getOffset(), httpMethod.getResource(),
- JaxrsValidationQuickFixes.HTTP_METHOD_MISSING_RETENTION_ANNOTATION_ID);
+ JaxrsMetamodelValidationConstants.HTTP_METHOD_MISSING_RETENTION_ANNOTATION_ID);
} else {
final String annotationValue = retentionAnnotation.getValue("value");
if (annotationValue == null) {
@@ -123,14 +123,14 @@
addProblem(JaxrsValidationMessages.HTTP_METHOD_INVALID_RETENTION_ANNOTATION_VALUE,
JaxrsPreferences.HTTP_METHOD_INVALID_RETENTION_ANNOTATION_VALUE, new String[0],
range.getLength(),
range.getOffset(), httpMethod.getResource(),
- JaxrsValidationQuickFixes.HTTP_METHOD_INVALID_RETENTION_ANNOTATION_VALUE_ID);
+ JaxrsMetamodelValidationConstants.HTTP_METHOD_INVALID_RETENTION_ANNOTATION_VALUE_ID);
} else if (!annotationValue.equals(RetentionPolicy.RUNTIME.name())) {
final ISourceRange range =
JdtUtils.resolveMemberPairValueRange(retentionAnnotation.getJavaAnnotation(),
retentionAnnotation.getFullyQualifiedName(), "value");
addProblem(JaxrsValidationMessages.HTTP_METHOD_INVALID_RETENTION_ANNOTATION_VALUE,
JaxrsPreferences.HTTP_METHOD_INVALID_RETENTION_ANNOTATION_VALUE, new String[0],
range.getLength(),
range.getOffset(), httpMethod.getResource(),
- JaxrsValidationQuickFixes.HTTP_METHOD_INVALID_RETENTION_ANNOTATION_VALUE_ID);
+ JaxrsMetamodelValidationConstants.HTTP_METHOD_INVALID_RETENTION_ANNOTATION_VALUE_ID);
}
}
Modified:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsJavaApplicationValidatorDelegate.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsJavaApplicationValidatorDelegate.java 2012-10-12
13:44:36 UTC (rev 44481)
+++
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsJavaApplicationValidatorDelegate.java 2012-10-12
14:03:18 UTC (rev 44482)
@@ -19,7 +19,7 @@
import org.jboss.tools.ws.jaxrs.core.internal.utils.Logger;
import org.jboss.tools.ws.jaxrs.core.jdt.Annotation;
import org.jboss.tools.ws.jaxrs.core.jdt.EnumJaxrsClassname;
-import org.jboss.tools.ws.jaxrs.core.metamodel.quickfix.JaxrsValidationQuickFixes;
+import
org.jboss.tools.ws.jaxrs.core.metamodel.validation.JaxrsMetamodelValidationConstants;
import org.jboss.tools.ws.jaxrs.core.preferences.JaxrsPreferences;
/**
@@ -52,14 +52,14 @@
JaxrsPreferences.JAVA_APPLICATION_MISSING_APPLICATION_PATH_ANNOTATION, new
String[0],
appJavaElement.getNameRange().getLength(),
appJavaElement.getNameRange().getOffset(),
application.getResource(),
- JaxrsValidationQuickFixes.JAVA_APPLICATION_MISSING_APPLICATION_PATH_ANNOTATION_ID);
+ JaxrsMetamodelValidationConstants.JAVA_APPLICATION_MISSING_APPLICATION_PATH_ANNOTATION_ID);
}
if (!application.isJaxrsCoreApplicationSubclass()) {
addProblem(JaxrsValidationMessages.JAVA_APPLICATION_INVALID_TYPE_HIERARCHY,
JaxrsPreferences.JAVA_APPLICATION_INVALID_TYPE_HIERARCHY,
new String[] { appJavaElement.getFullyQualifiedName() },
application.getJavaElement()
.getSourceRange().getLength(), appJavaElement.getSourceRange().getOffset(),
- application.getResource(),
JaxrsValidationQuickFixes.JAVA_APPLICATION_INVALID_TYPE_HIERARCHY_ID);
+ application.getResource(),
JaxrsMetamodelValidationConstants.JAVA_APPLICATION_INVALID_TYPE_HIERARCHY_ID);
}
if (application.getMetamodel().hasMultipleApplications()) {
Modified:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsMetamodelValidator.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsMetamodelValidator.java 2012-10-12
13:44:36 UTC (rev 44481)
+++
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsMetamodelValidator.java 2012-10-12
14:03:18 UTC (rev 44482)
@@ -49,6 +49,7 @@
import org.jboss.tools.ws.jaxrs.core.metamodel.IJaxrsApplication;
import org.jboss.tools.ws.jaxrs.core.metamodel.IJaxrsElement;
import org.jboss.tools.ws.jaxrs.core.metamodel.JaxrsMetamodelLocator;
+import
org.jboss.tools.ws.jaxrs.core.metamodel.validation.JaxrsMetamodelValidationConstants;
import org.jboss.tools.ws.jaxrs.core.preferences.JaxrsPreferences;
/**
@@ -67,13 +68,10 @@
/** The JAX-RS Validator ID. */
public static final String ID =
"org.jboss.tools.ws.jaxrs.JaxrsMetamodelValidator"; //$NON-NLS-1$
- /** The custom 'JAX-RS Problem' marker type. */
- public static final String JAXRS_PROBLEM_TYPE =
"org.jboss.tools.ws.jaxrs.metamodelMarker";
-
private static final String BUNDLE_NAME =
JaxrsMetamodelValidator.class.getPackage().getName() + ".messages";
public JaxrsMetamodelValidator() {
- super.setProblemType(JAXRS_PROBLEM_TYPE);
+ super.setProblemType(JaxrsMetamodelValidationConstants.JAXRS_PROBLEM_TYPE);
}
/*
@@ -312,7 +310,7 @@
return;
}
Logger.debug("Clearing JAX-RS markers for resource " + resource.getName());
- resource.deleteMarkers(JAXRS_PROBLEM_TYPE, true, IResource.DEPTH_ONE);
+ resource.deleteMarkers(JaxrsMetamodelValidationConstants.JAXRS_PROBLEM_TYPE, true,
IResource.DEPTH_ONE);
}
class JaxrsPreferenceInfo implements IPreferenceInfo{
Deleted:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/IMarkerResolutionDelegate.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/IMarkerResolutionDelegate.java 2012-10-12
13:44:36 UTC (rev 44481)
+++
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/IMarkerResolutionDelegate.java 2012-10-12
14:03:18 UTC (rev 44482)
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.ws.jaxrs.core.metamodel;
-
-import org.eclipse.core.runtime.CoreException;
-
-
-/**
- * @author Xavier Coulon
- *
- */
-public interface IMarkerResolutionDelegate {
-
- public static final String MARKER_RESOLUTION = "MARKER_RESOLUTION";
-
- public abstract void applyQuickFix() throws CoreException;
-
-}
Added:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/validation/JaxrsMetamodelValidationConstants.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/validation/JaxrsMetamodelValidationConstants.java
(rev 0)
+++
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/validation/JaxrsMetamodelValidationConstants.java 2012-10-12
14:03:18 UTC (rev 44482)
@@ -0,0 +1,26 @@
+package org.jboss.tools.ws.jaxrs.core.metamodel.validation;
+
+public class JaxrsMetamodelValidationConstants {
+
+ /** The custom 'JAX-RS Problem' marker type. */
+ public static final String JAXRS_PROBLEM_TYPE =
"org.jboss.tools.ws.jaxrs.metamodelMarker";
+
+ /** QuickFix for missing <code>@Retention</code> annotation.*/
+ public static final int HTTP_METHOD_MISSING_RETENTION_ANNOTATION_ID = 1;
+
+ /** QuickFix for invalid <code>@Retention</code> annotation value.*/
+ public static final int HTTP_METHOD_INVALID_RETENTION_ANNOTATION_VALUE_ID = 2;
+
+ /** QuickFix for missing <code>@Target</code> annotation.*/
+ public static final int HTTP_METHOD_MISSING_TARGET_ANNOTATION_ID = 3;
+
+ /** QuickFix for invalid <code>@Target</code> annotation value.*/
+ public static final int HTTP_METHOD_INVALID_TARGET_ANNOTATION_VALUE_ID = 4;
+
+ /** QuickFix for missing <code>@ApplicationPath</code> annotation.*/
+ public static final int JAVA_APPLICATION_MISSING_APPLICATION_PATH_ANNOTATION_ID = 5;
+
+ /** QuickFix for invalid <code>javax.ws.rs.core.Application</code> subclass
hierarchy .*/
+ public static final int JAVA_APPLICATION_INVALID_TYPE_HIERARCHY_ID = 6;
+
+}
Property changes on:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/validation/JaxrsMetamodelValidationConstants.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/validation/JaxrsValidationQuickFixes.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/quickfix/JaxrsValidationQuickFixes.java 2012-09-28
04:35:59 UTC (rev 44111)
+++
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/validation/JaxrsValidationQuickFixes.java 2012-10-12
14:03:18 UTC (rev 44482)
@@ -1,12 +0,0 @@
-package org.jboss.tools.ws.jaxrs.core.metamodel.quickfix;
-
-public class JaxrsValidationQuickFixes {
-
- public static final int HTTP_METHOD_MISSING_RETENTION_ANNOTATION_ID = 1;
- public static final int HTTP_METHOD_INVALID_RETENTION_ANNOTATION_VALUE_ID = 2;
- public static final int HTTP_METHOD_MISSING_TARGET_ANNOTATION_ID = 3;
- public static final int HTTP_METHOD_INVALID_TARGET_ANNOTATION_VALUE_ID = 4;
- public static final int JAVA_APPLICATION_MISSING_APPLICATION_PATH_ANNOTATION_ID = 5;
- public static final int JAVA_APPLICATION_INVALID_TYPE_HIERARCHY_ID = 6;
-
-}
Modified:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/facet/JaxrsFacetedProjectListener.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/facet/JaxrsFacetedProjectListener.java 2012-10-12
13:44:36 UTC (rev 44481)
+++
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/facet/JaxrsFacetedProjectListener.java 2012-10-12
14:03:18 UTC (rev 44482)
@@ -12,11 +12,13 @@
package org.jboss.tools.ws.jaxrs.ui.facet;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
import org.eclipse.wst.common.project.facet.core.events.IProjectFacetActionEvent;
import org.jboss.tools.ws.jaxrs.core.configuration.ProjectNatureUtils;
+import
org.jboss.tools.ws.jaxrs.core.metamodel.validation.JaxrsMetamodelValidationConstants;
import org.jboss.tools.ws.jaxrs.ui.internal.utils.Logger;
/**
@@ -56,6 +58,9 @@
if (ProjectNatureUtils.isProjectNatureInstalled(project,
ProjectNatureUtils.JAXRS_NATURE_ID)) {
ProjectNatureUtils.uninstallProjectNature(project,
ProjectNatureUtils.JAXRS_NATURE_ID);
}
+ project.deleteMarkers(JaxrsMetamodelValidationConstants.JAXRS_PROBLEM_TYPE, true,
IResource.DEPTH_INFINITE);
+ Logger.debug("JAX-RS Problem markers removed.");
+
break;
default:
break;
Modified:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/quickfix/JaxrsMarkerResolutionGenerator.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/quickfix/JaxrsMarkerResolutionGenerator.java 2012-10-12
13:44:36 UTC (rev 44481)
+++
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/quickfix/JaxrsMarkerResolutionGenerator.java 2012-10-12
14:03:18 UTC (rev 44482)
@@ -9,7 +9,7 @@
import org.eclipse.ui.IMarkerResolutionGenerator2;
import org.jboss.tools.common.validation.ValidationErrorManager;
import org.jboss.tools.ws.jaxrs.core.jdt.JdtUtils;
-import org.jboss.tools.ws.jaxrs.core.metamodel.quickfix.JaxrsValidationQuickFixes;
+import
org.jboss.tools.ws.jaxrs.core.metamodel.validation.JaxrsMetamodelValidationConstants;
import org.jboss.tools.ws.jaxrs.ui.internal.utils.Logger;
public class JaxrsMarkerResolutionGenerator implements IMarkerResolutionGenerator2 {
@@ -40,13 +40,13 @@
marker.getAttribute(IMarker.CHAR_START, 0), IJavaElement.TYPE);
if (type != null) {
switch (quickfixId) {
- case JaxrsValidationQuickFixes.HTTP_METHOD_MISSING_TARGET_ANNOTATION_ID:
+ case JaxrsMetamodelValidationConstants.HTTP_METHOD_MISSING_TARGET_ANNOTATION_ID:
return new IMarkerResolution[] { new AddTargetAnnotationMarkerResolution(type) };
- case JaxrsValidationQuickFixes.HTTP_METHOD_MISSING_RETENTION_ANNOTATION_ID:
+ case JaxrsMetamodelValidationConstants.HTTP_METHOD_MISSING_RETENTION_ANNOTATION_ID:
return new IMarkerResolution[] { new AddRetentionAnnotationMarkerResolution(type)
};
- case JaxrsValidationQuickFixes.HTTP_METHOD_INVALID_TARGET_ANNOTATION_VALUE_ID:
+ case
JaxrsMetamodelValidationConstants.HTTP_METHOD_INVALID_TARGET_ANNOTATION_VALUE_ID:
return new IMarkerResolution[] { new
UpdateTargetAnnotationValueMarkerResolution(type) };
- case JaxrsValidationQuickFixes.HTTP_METHOD_INVALID_RETENTION_ANNOTATION_VALUE_ID:
+ case
JaxrsMetamodelValidationConstants.HTTP_METHOD_INVALID_RETENTION_ANNOTATION_VALUE_ID:
return new IMarkerResolution[] { new
UpdateRetentionAnnotationValueMarkerResolution(type) };
}
}
Modified:
trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/MarkerUtils.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/MarkerUtils.java 2012-10-12
13:44:36 UTC (rev 44481)
+++
trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/MarkerUtils.java 2012-10-12
14:03:18 UTC (rev 44482)
@@ -15,6 +15,7 @@
import org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsBaseElement;
import org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsResourceMethod;
import org.jboss.tools.ws.jaxrs.core.metamodel.IJaxrsElement;
+import
org.jboss.tools.ws.jaxrs.core.metamodel.validation.JaxrsMetamodelValidationConstants;
/**
* @author Xavier Coulon
@@ -32,10 +33,10 @@
case APPLICATION:
case HTTP_METHOD:
case RESOURCE:
- return element.getResource().findMarkers(JaxrsMetamodelValidator.JAXRS_PROBLEM_TYPE,
true,
+ return
element.getResource().findMarkers(JaxrsMetamodelValidationConstants.JAXRS_PROBLEM_TYPE,
true,
IResource.DEPTH_INFINITE);
case RESOURCE_METHOD:
- final IMarker[] markers =
element.getResource().findMarkers(JaxrsMetamodelValidator.JAXRS_PROBLEM_TYPE,
+ final IMarker[] markers =
element.getResource().findMarkers(JaxrsMetamodelValidationConstants.JAXRS_PROBLEM_TYPE,
true, IResource.DEPTH_INFINITE);
final List<IMarker> resourceMethodMarkers = new ArrayList<IMarker>();
final ISourceRange methodSourceRange = ((JaxrsResourceMethod)
element).getJavaElement().getSourceRange();
@@ -54,7 +55,7 @@
}
public static IMarker[] findJaxrsMarkers(IProject project) throws CoreException {
- return project.findMarkers(JaxrsMetamodelValidator.JAXRS_PROBLEM_TYPE, false, 0);
+ return project.findMarkers(JaxrsMetamodelValidationConstants.JAXRS_PROBLEM_TYPE, false,
0);
}
/**
@@ -63,7 +64,7 @@
*/
public static void deleteJaxrsMarkers(final JaxrsBaseElement element) throws
CoreException {
element.getResource()
- .deleteMarkers(JaxrsMetamodelValidator.JAXRS_PROBLEM_TYPE, false,
IResource.DEPTH_INFINITE);
+ .deleteMarkers(JaxrsMetamodelValidationConstants.JAXRS_PROBLEM_TYPE, false,
IResource.DEPTH_INFINITE);
}
/**
@@ -71,7 +72,7 @@
* @throws CoreException
*/
public static void deleteJaxrsMarkers(final IProject project) throws CoreException {
- project.deleteMarkers(JaxrsMetamodelValidator.JAXRS_PROBLEM_TYPE, false,
IResource.DEPTH_INFINITE);
+ project.deleteMarkers(JaxrsMetamodelValidationConstants.JAXRS_PROBLEM_TYPE, false,
IResource.DEPTH_INFINITE);
}
public static Matcher<IMarker[]> hasPreferenceKey(String
javaApplicationInvalidTypeHierarchy) {