Author: akazakov
Date: 2011-12-19 20:41:39 -0500 (Mon, 19 Dec 2011)
New Revision: 37444
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDISuppressWarningsMap.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/validation/SolderSuppressWarningsMap.java
trunk/common/plugins/org.jboss.tools.common.validation/schema/warnings.exsd
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/IWarningNameMap.java
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationSeverityPreferences.java
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/WarningNameManager.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELSuppressWarningsMap.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamSuppressWarningsMap.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.xml
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferences.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigPreferences.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/plugin.xml
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderPreferences.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/suppresswarnings/Fish.java
trunk/common/plugins/org.jboss.tools.common.validation/plugin.xml
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationErrorManager.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/EclipseJavaUtil.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/ELSeverityPreferences.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBSeverityPreferences.java
trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java
trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF
trunk/seam/tests/org.jboss.tools.seam.ui.test/META-INF/MANIFEST.MF
Log:
https://issues.jboss.org/browse/JBIDE-10187 Add support for a @SuppressWarnings
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.xml
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.xml 2011-12-20 01:36:33 UTC (rev
37443)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.xml 2011-12-20 01:41:39 UTC (rev
37444)
@@ -163,6 +163,16 @@
</extension>
<extension
+ id="CDIWarnings"
+ point="org.jboss.tools.common.validation.warnings">
+ <map
+
class="org.jboss.tools.cdi.internal.core.validation.CDISuppressWarningsMap"
+ warningGroupID="cdi"
+
preferenceGroupID="org.jboss.tools.cdi.core.validator.problem">
+ </map>
+ </extension>
+
+ <extension
id="CDIELValidationDelegate"
point="org.jboss.tools.jst.web.kb.elValidationDelegate">
<delegate
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferences.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferences.java 2011-12-20
01:36:33 UTC (rev 37443)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferences.java 2011-12-20
01:41:39 UTC (rev 37444)
@@ -15,82 +15,85 @@
import org.eclipse.core.resources.IProject;
import org.jboss.tools.cdi.core.CDICorePlugin;
-import org.jboss.tools.common.preferences.SeverityPreferences;
+import org.jboss.tools.common.validation.ValidationSeverityPreferences;
/**
* @author Alexey Kazakov
*/
-public class CDIPreferences extends SeverityPreferences {
+public class CDIPreferences extends ValidationSeverityPreferences {
public static final Set<String> SEVERITY_OPTION_NAMES = new
HashSet<String>();
private static CDIPreferences INSTANCE = new CDIPreferences();
+ public static final String WARNING_GROUP_ID = "cdi";
+
//Name group
-
+
// - stereotype declares a non-empty @Named annotation (2.7.1.3)
- public static final String STEREOTYPE_DECLARES_NON_EMPTY_NAME =
INSTANCE.createSeverityOption("stereotypeDeclaresNonEmptyName"); //$NON-NLS-1$
+ public static final String STEREOTYPE_DECLARES_NON_EMPTY_NAME =
INSTANCE.createSeverityOption("stereotypeDeclaresNonEmptyName",
"non-empty-named"); //$NON-NLS-1$
+
// - producer field declaration specifies an EL name (together with one of
// @Resource, @PersistenceContext, @PersistenceUnit, @EJB, @WebServiceRef) (3.5.1)
- public static final String RESOURCE_PRODUCER_FIELD_SETS_EL_NAME =
INSTANCE.createSeverityOption("resourceProducerFieldSetsElName"); //$NON-NLS-1$
+ public static final String RESOURCE_PRODUCER_FIELD_SETS_EL_NAME =
INSTANCE.createSeverityOption("resourceProducerFieldSetsElName",
"named-producer"); //$NON-NLS-1$
// - injection point other than injected field declares a @Named annotation that
// does not specify the value member
- public static final String PARAM_INJECTION_DECLARES_EMPTY_NAME =
INSTANCE.createSeverityOption("paramInjectionDeclaresEmptyName"); //$NON-NLS-1$
+ public static final String PARAM_INJECTION_DECLARES_EMPTY_NAME =
INSTANCE.createSeverityOption("paramInjectionDeclaresEmptyName",
"empty-named"); //$NON-NLS-1$
// - interceptor or decorator has a name (2.5.3 non-portable)
- public static final String INTERCEPTOR_OR_DECORATOR_HAS_NAME =
INSTANCE.createSeverityOption("interceptorHasName"); //$NON-NLS-1$
+ public static final String INTERCEPTOR_OR_DECORATOR_HAS_NAME =
INSTANCE.createSeverityOption("interceptorHasName", "named");
//$NON-NLS-1$
// 5.3.1. Ambiguous EL names
// - All unresolvable ambiguous EL names are detected by the container when the
application is initialized. Suppose two beans are both available for injection in a
certain war, and either:
// • the two beans have the same EL name and the name is not resolvable, or
// • the EL name of one bean is of the form x.y, where y is a valid bean EL name, and
x is the EL name of the other bean,
// the container automatically detects the problem and treats it as a deployment
problem.
- public static final String AMBIGUOUS_EL_NAMES =
INSTANCE.createSeverityOption("ambiguousElNames"); //$NON-NLS-1$
+ public static final String AMBIGUOUS_EL_NAMES =
INSTANCE.createSeverityOption("ambiguousElNames", "ambiguous-name");
//$NON-NLS-1$
//Type group
// 5.2.1. Unsatisfied and ambiguous dependencies
// - If an unsatisfied or unresolvable ambiguous dependency exists, the container
automatically detects the problem and
// treats it as a deployment problem.
- public static final String UNSATISFIED_OR_AMBIGUOUS_INJECTION_POINTS =
INSTANCE.createSeverityOption("unsatisfiedInjectionPoints"); //$NON-NLS-1$
+ public static final String UNSATISFIED_OR_AMBIGUOUS_INJECTION_POINTS =
INSTANCE.createSeverityOption("unsatisfiedInjectionPoints",
"ambiguous-dependency"); //$NON-NLS-1$
// 5.4.1. Unproxyable bean types
// - If an injection point whose declared type cannot be proxied by the container
resolves to a bean with a normal scope,
// the container automatically detects the problem and treats it as a deployment
problem.
- public static final String UNPROXYABLE_BEAN_TYPE =
INSTANCE.createSeverityOption("unproxyableBeanType"); //$NON-NLS-1$
+ public static final String UNPROXYABLE_BEAN_TYPE =
INSTANCE.createSeverityOption("unproxyableBeanType",
"ambiguous-dependency"); //$NON-NLS-1$
// - bean class or producer method or field specifies a @Typed annotation,
// and the value member specifies a class which does not correspond to a type
// in the unrestricted set of bean types of a bean (2.2.2)
- public static final String ILLEGAL_TYPE_IN_TYPED_DECLARATION =
INSTANCE.createSeverityOption("illegalTypeInTypedDeclaration"); //$NON-NLS-1$
+ public static final String ILLEGAL_TYPE_IN_TYPED_DECLARATION =
INSTANCE.createSeverityOption("illegalTypeInTypedDeclaration",
"typed"); //$NON-NLS-1$
// - producer field/method return type contains a wildcard type parameter (3.3, 3.4)
// - producer field/method return type is a type variable (3.3, 3.4)
- public static final String PRODUCER_METHOD_RETURN_TYPE_HAS_WILDCARD_OR_VARIABLE =
INSTANCE.createSeverityOption("producerMethodReturnTypeHasWildcard");
//$NON-NLS-1$
+ public static final String PRODUCER_METHOD_RETURN_TYPE_HAS_WILDCARD_OR_VARIABLE =
INSTANCE.createSeverityOption("producerMethodReturnTypeHasWildcard",
"typed-producer"); //$NON-NLS-1$
// - an injection point of primitive type resolves to a bean that may have null values,
such as a producer method with a non-primitive return type or a producer field with a
non-primitive type
- public static final String INJECT_RESOLVES_TO_NULLABLE_BEAN =
INSTANCE.createSeverityOption("injectResolvesToNullableBean"); //$NON-NLS-1$
+ public static final String INJECT_RESOLVES_TO_NULLABLE_BEAN =
INSTANCE.createSeverityOption("injectResolvesToNullableBean",
"nullable"); //$NON-NLS-1$
// - matching object in the Java EE component environment is not of the same type
// as the producer field declaration (3.5.1)
- public static final String PRODUCER_FIELD_TYPE_DOES_NOT_MATCH_JAVA_EE_OBJECT =
INSTANCE.createSeverityOption("producerFieldTypeDoesNotMatchJavaEeObject");
//$NON-NLS-1$
+ public static final String PRODUCER_FIELD_TYPE_DOES_NOT_MATCH_JAVA_EE_OBJECT =
INSTANCE.createSeverityOption("producerFieldTypeDoesNotMatchJavaEeObject",
"not-match-object"); //$NON-NLS-1$
// - injection point type is a type variable (5.2.2)
- public static final String INJECTION_TYPE_IS_VARIABLE =
INSTANCE.createSeverityOption("injectionTypeIsVariable"); //$NON-NLS-1$
+ public static final String INJECTION_TYPE_IS_VARIABLE =
INSTANCE.createSeverityOption("injectionTypeIsVariable",
"type-variable"); //$NON-NLS-1$
// - stereotype is annotated @Typed (2.7.1.3 non-portable)
- public static final String STEREOTYPE_IS_ANNOTATED_TYPED =
INSTANCE.createSeverityOption("stereotypeIsAnnotatedTyped"); //$NON-NLS-1$
+ public static final String STEREOTYPE_IS_ANNOTATED_TYPED =
INSTANCE.createSeverityOption("stereotypeIsAnnotatedTyped", "typed");
//$NON-NLS-1$
// - array-valued or annotation-valued member of a qualifier type is not annotated
@Nonbinding (5.2.5 non-portable)
- public static final String MISSING_NONBINDING_IN_QUALIFIER_TYPE_MEMBER =
INSTANCE.createSeverityOption("missingNonbindingInQualifierTypeMember");
//$NON-NLS-1$
+ public static final String MISSING_NONBINDING_IN_QUALIFIER_TYPE_MEMBER =
INSTANCE.createSeverityOption("missingNonbindingInQualifierTypeMember",
"nonbinding"); //$NON-NLS-1$
// - array-valued or annotation-valued member of an interceptor binding type
// is not annotated @Nonbinding (9.5.2 non-portable)
- public static final String MISSING_NONBINDING_IN_INTERCEPTOR_BINDING_TYPE_MEMBER =
INSTANCE.createSeverityOption("missingNonbindingInInterceptorBindingTypeMember");
//$NON-NLS-1$
+ public static final String MISSING_NONBINDING_IN_INTERCEPTOR_BINDING_TYPE_MEMBER =
INSTANCE.createSeverityOption("missingNonbindingInInterceptorBindingTypeMember",
"nonbinding"); //$NON-NLS-1$
- public static final String MISSING_OR_INCORRECT_TARGET_OR_RETENTION_IN_ANNOTATION_TYPE =
INSTANCE.createSeverityOption("missingOrIncorrectTargetOrRetentionInAnnotationType");
//$NON-NLS-1$
+ public static final String MISSING_OR_INCORRECT_TARGET_OR_RETENTION_IN_ANNOTATION_TYPE =
INSTANCE.createSeverityOption("missingOrIncorrectTargetOrRetentionInAnnotationType",
"target"); //$NON-NLS-1$
// Section 6.6.4 - Validation of passivation capable beans and dependencies
// - If a managed bean which declares a passivating scope is not passivation capable,
then the container automatically detects the problem and treats it as a deployment
problem.
- public static final String NOT_PASSIVATION_CAPABLE_BEAN =
INSTANCE.createSeverityOption("notPassivationCapableBean"); //$NON-NLS-1$
-
+ public static final String NOT_PASSIVATION_CAPABLE_BEAN =
INSTANCE.createSeverityOption("notPassivationCapableBean",
"not-passivation-capable"); //$NON-NLS-1$
+
//Scope group
// - bean class or producer method or field specifies multiple scope type annotations
(2.4.3)
- public static final String MULTIPLE_SCOPE_TYPE_ANNOTATIONS =
INSTANCE.createSeverityOption("multipleScopeTypeAnnotations"); //$NON-NLS-1$
+ public static final String MULTIPLE_SCOPE_TYPE_ANNOTATIONS =
INSTANCE.createSeverityOption("multipleScopeTypeAnnotations",
"multiple-scopes"); //$NON-NLS-1$
// - bean does not explicitly declare a scope when there is no default scope
// (there are two different stereotypes declared by the bean that declare different
default scopes) (2.4.4)
- public static final String MISSING_SCOPE_WHEN_THERE_IS_NO_DEFAULT_SCOPE =
INSTANCE.createSeverityOption("missingScopeWhenThereIsNoDefaultScope");
//$NON-NLS-1$
+ public static final String MISSING_SCOPE_WHEN_THERE_IS_NO_DEFAULT_SCOPE =
INSTANCE.createSeverityOption("missingScopeWhenThereIsNoDefaultScope",
"default-scope"); //$NON-NLS-1$
// - stereotype declares more than one scope (2.7.1.1)
- public static final String STEREOTYPE_DECLARES_MORE_THAN_ONE_SCOPE =
INSTANCE.createSeverityOption("stereotypeDeclaresMoreThanOneScope");
//$NON-NLS-1$
+ public static final String STEREOTYPE_DECLARES_MORE_THAN_ONE_SCOPE =
INSTANCE.createSeverityOption("stereotypeDeclaresMoreThanOneScope",
"multiple-scopes"); //$NON-NLS-1$
// - managed bean with a public field declares any scope other than @Dependent (3.1)
// - managed bean with a parameterized bean class declares any scope other than
@Dependent (3.1)
//
@@ -104,101 +107,101 @@
// any scope other than @Dependent (3.3)
// - producer field with a parameterized type with a type variable declares any
// scope other than @Dependent (3.4)
- public static final String ILLEGAL_SCOPE_FOR_BEAN =
INSTANCE.createSeverityOption("illegalScopeForManagedBean"); //$NON-NLS-1$
+ public static final String ILLEGAL_SCOPE_FOR_BEAN =
INSTANCE.createSeverityOption("illegalScopeForManagedBean", "scope");
//$NON-NLS-1$
// - bean that declares any scope other than @Dependent has an injection point of type
// InjectionPoint and qualifier @Default (5.5.7)
- public static final String ILLEGAL_SCOPE_WHEN_TYPE_INJECTIONPOINT_IS_INJECTED =
INSTANCE.createSeverityOption("illegalScopeWhenTypeInjectionPointIsInjected");
//$NON-NLS-1$
+ public static final String ILLEGAL_SCOPE_WHEN_TYPE_INJECTIONPOINT_IS_INJECTED =
INSTANCE.createSeverityOption("illegalScopeWhenTypeInjectionPointIsInjected",
"scope"); //$NON-NLS-1$
// - interceptor or decorator has any scope other than @Dependent (2.4.1 non-portable)
- public static final String ILLEGAL_SCOPE_FOR_INTERCEPTOR_OR_DECORATOR =
INSTANCE.createSeverityOption("illegalScopeForInterceptor"); //$NON-NLS-1$
+ public static final String ILLEGAL_SCOPE_FOR_INTERCEPTOR_OR_DECORATOR =
INSTANCE.createSeverityOption("illegalScopeForInterceptor", "scope");
//$NON-NLS-1$
//Member group
// - producer method is annotated @Inject (3.3.2)
// - producer field is annotated @Inject (3.4.2) = - injected field is annotated
@Produces (3.8.1)
- public static final String PRODUCER_ANNOTATED_INJECT =
INSTANCE.createSeverityOption("producerAnnotatedInject"); //$NON-NLS-1$
+ public static final String PRODUCER_ANNOTATED_INJECT =
INSTANCE.createSeverityOption("producerAnnotatedInject",
"annotated-inject"); //$NON-NLS-1$
// - producer method has a parameter annotated @Disposes or @Observes (3.3.2)
- public static final String PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED =
INSTANCE.createSeverityOption("producerParameterIllegallyAnnotated");
//$NON-NLS-1$
+ public static final String PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED =
INSTANCE.createSeverityOption("producerParameterIllegallyAnnotated",
"annotated-parameter"); //$NON-NLS-1$
// - observer method is annotated [@Produces or] @Inject (10.4.2)
- public static final String OBSERVER_ANNOTATED_INJECT =
INSTANCE.createSeverityOption("observerAnnotatedInject"); //$NON-NLS-1$
+ public static final String OBSERVER_ANNOTATED_INJECT =
INSTANCE.createSeverityOption("observerAnnotatedInject",
"annotated-observer"); //$NON-NLS-1$
// - has a parameter annotated @Disposes (10.4.2)
- public static final String OBSERVER_PARAMETER_ILLEGALLY_ANNOTATED =
INSTANCE.createSeverityOption("observerParameterIllegallyAnnotated");
//$NON-NLS-1$
+ public static final String OBSERVER_PARAMETER_ILLEGALLY_ANNOTATED =
INSTANCE.createSeverityOption("observerParameterIllegallyAnnotated",
"annotated-parameter"); //$NON-NLS-1$
// - non-static method of a session bean class is annotated @Produces, and the method
// is not a business method of the session bean (3.3.2)
// - non-static field of a session bean class is annotated @Produces (3.4.2)
- public static final String ILLEGAL_PRODUCER_METHOD_IN_SESSION_BEAN =
INSTANCE.createSeverityOption("illegalProducerMethodInSessionBean");
//$NON-NLS-1$
+ public static final String ILLEGAL_PRODUCER_METHOD_IN_SESSION_BEAN =
INSTANCE.createSeverityOption("illegalProducerMethodInSessionBean",
"annotated-produces"); //$NON-NLS-1$
// - method has more than one parameter annotated @Disposes (3.3.6)
- public static final String MULTIPLE_DISPOSING_PARAMETERS =
INSTANCE.createSeverityOption("multipleDisposingParameters"); //$NON-NLS-1$
+ public static final String MULTIPLE_DISPOSING_PARAMETERS =
INSTANCE.createSeverityOption("multipleDisposingParameters",
"multiple-disposes"); //$NON-NLS-1$
// - disposer method is annotated [@Produces or] @Inject [or has a parameter annotated
@Observes] (3.3.6)
- public static final String DISPOSER_ANNOTATED_INJECT =
INSTANCE.createSeverityOption("disposerAnnotatedInject"); //$NON-NLS-1$
+ public static final String DISPOSER_ANNOTATED_INJECT =
INSTANCE.createSeverityOption("disposerAnnotatedInject",
"annotated-disposer"); //$NON-NLS-1$
// - non-static method of a session bean class has a parameter annotated @Disposes, and
// the method is not a business method of the session bean (3.3.6)
- public static final String ILLEGAL_DISPOSER_IN_SESSION_BEAN =
INSTANCE.createSeverityOption("illegalDisposerInSessionBean"); //$NON-NLS-1$
+ public static final String ILLEGAL_DISPOSER_IN_SESSION_BEAN =
INSTANCE.createSeverityOption("illegalDisposerInSessionBean",
"annotated-disposer"); //$NON-NLS-1$
// - there is no producer method declared by the (same) bean class that is assignable
// to the disposed parameter of a disposer method (3.3.7)
- public static final String NO_PRODUCER_MATCHING_DISPOSER =
INSTANCE.createSeverityOption("noProducerMatchingDisposer"); //$NON-NLS-1$
+ public static final String NO_PRODUCER_MATCHING_DISPOSER =
INSTANCE.createSeverityOption("noProducerMatchingDisposer",
"missing-producer"); //$NON-NLS-1$
// - there are multiple disposer methods for a single producer method (3.3.7)
- public static final String MULTIPLE_DISPOSERS_FOR_PRODUCER =
INSTANCE.createSeverityOption("multipleDisposersForProducer"); //$NON-NLS-1$
+ public static final String MULTIPLE_DISPOSERS_FOR_PRODUCER =
INSTANCE.createSeverityOption("multipleDisposersForProducer",
"multiple-disposers"); //$NON-NLS-1$
// - bean class has more than one constructor annotated @Inject (3.7.1)
- public static final String MULTIPLE_INJECTION_CONSTRUCTORS =
INSTANCE.createSeverityOption("multipleInjectionConstructors"); //$NON-NLS-1$
+ public static final String MULTIPLE_INJECTION_CONSTRUCTORS =
INSTANCE.createSeverityOption("multipleInjectionConstructors",
"constructor"); //$NON-NLS-1$
// - bean constructor has a parameter annotated @Disposes, or @Observes (3.7.1)
- public static final String CONSTRUCTOR_PARAMETER_ILLEGALLY_ANNOTATED =
INSTANCE.createSeverityOption("constructorParameterIllegallyAnnotated");
//$NON-NLS-1$
+ public static final String CONSTRUCTOR_PARAMETER_ILLEGALLY_ANNOTATED =
INSTANCE.createSeverityOption("constructorParameterIllegallyAnnotated",
"constructor"); //$NON-NLS-1$
// - generic method of a bean is annotated @Inject (initializer method is a non-abstract,
// non-static, non-generic method of a bean class) (3.9.1)
- public static final String GENERIC_METHOD_ANNOTATED_INJECT =
INSTANCE.createSeverityOption("genericMethodAnnotatedInject"); //$NON-NLS-1$
+ public static final String GENERIC_METHOD_ANNOTATED_INJECT =
INSTANCE.createSeverityOption("genericMethodAnnotatedInject",
"generic"); //$NON-NLS-1$
// - method has more than one parameter annotated @Observes (10.4.2)
- public static final String MULTIPLE_OBSERVING_PARAMETERS =
INSTANCE.createSeverityOption("multipleObservingParameters"); //$NON-NLS-1$
+ public static final String MULTIPLE_OBSERVING_PARAMETERS =
INSTANCE.createSeverityOption("multipleObservingParameters",
"multiple-observers"); //$NON-NLS-1$
// - non-static method of a session bean class has a parameter annotated @Observes,
// and the method is not a business method of the EJB (10.4.2)
- public static final String ILLEGAL_OBSERVER_IN_SESSION_BEAN =
INSTANCE.createSeverityOption("illegalObserverInSessionBean"); //$NON-NLS-1$
+ public static final String ILLEGAL_OBSERVER_IN_SESSION_BEAN =
INSTANCE.createSeverityOption("illegalObserverInSessionBean",
"observer"); //$NON-NLS-1$
// - bean with scope @Dependent has an observer method declared receive=IF_EXISTS
(10.4.3)
- public static final String ILLEGAL_CONDITIONAL_OBSERVER =
INSTANCE.createSeverityOption("illegalConditionalObserver"); //$NON-NLS-1$
+ public static final String ILLEGAL_CONDITIONAL_OBSERVER =
INSTANCE.createSeverityOption("illegalConditionalObserver",
"observer"); //$NON-NLS-1$
//Interceptor & Decorator group
// - the bean class of a managed bean is annotated with both
// the @Interceptor and @Decorator stereotypes (3.1)
- public static final String BOTH_INTERCEPTOR_AND_DECORATOR =
INSTANCE.createSeverityOption("bothInterceptorAndDecorator"); //$NON-NLS-1$
+ public static final String BOTH_INTERCEPTOR_AND_DECORATOR =
INSTANCE.createSeverityOption("bothInterceptorAndDecorator",
"interceptor-decorator"); //$NON-NLS-1$
// - bean class of a session bean is annotated @Interceptor or @Decorator (3.2)
- public static final String SESSION_BEAN_ANNOTATED_INTERCEPTOR_OR_DECORATOR =
INSTANCE.createSeverityOption("sessionBeanAnnotatedInterceptorOrDecorator");
//$NON-NLS-1$
+ public static final String SESSION_BEAN_ANNOTATED_INTERCEPTOR_OR_DECORATOR =
INSTANCE.createSeverityOption("sessionBeanAnnotatedInterceptorOrDecorator",
"interceptor-decorator"); //$NON-NLS-1$
// - interceptor or decorator has a method annotated @Produces (3.3.2)
// - interceptor or decorator has a field annotated @Produces (3.4.2)
- public static final String PRODUCER_IN_INTERCEPTOR_OR_DECORATOR =
INSTANCE.createSeverityOption("producerInInterceptorOrDecorator");
//$NON-NLS-1$
+ public static final String PRODUCER_IN_INTERCEPTOR_OR_DECORATOR =
INSTANCE.createSeverityOption("producerInInterceptorOrDecorator",
"producer"); //$NON-NLS-1$
// - interceptor or decorator has a method annotated @Disposes
- public static final String DISPOSER_IN_INTERCEPTOR_OR_DECORATOR =
INSTANCE.createSeverityOption("disposerInInterceptorOrDecorator");
//$NON-NLS-1$
+ public static final String DISPOSER_IN_INTERCEPTOR_OR_DECORATOR =
INSTANCE.createSeverityOption("disposerInInterceptorOrDecorator",
"disposer"); //$NON-NLS-1$
// - decorator has more than one delegate injection point, or does not have a delegate
injection point (8.1.2)
- public static final String MULTIPLE_OR_MISSING_DELEGATE =
INSTANCE.createSeverityOption("multipleDelegate"); //$NON-NLS-1$
+ public static final String MULTIPLE_OR_MISSING_DELEGATE =
INSTANCE.createSeverityOption("multipleDelegate",
"ambiguous-delegate"); //$NON-NLS-1$
// - injection point that is not an injected field, initializer method parameter
// or bean constructor method parameter is annotated @Delegate (8.1.2)
- public static final String ILLEGAL_INJECTION_POINT_DELEGATE =
INSTANCE.createSeverityOption("illegalInjectionPointDelegate"); //$NON-NLS-1$
+ public static final String ILLEGAL_INJECTION_POINT_DELEGATE =
INSTANCE.createSeverityOption("illegalInjectionPointDelegate",
"delegate"); //$NON-NLS-1$
// - bean class that is not a decorator has an injection point annotated @Delegate
(8.1.2)
- public static final String ILLEGAL_BEAN_DECLARING_DELEGATE =
INSTANCE.createSeverityOption("illegalBeanDeclaringDelegate"); //$NON-NLS-1$
+ public static final String ILLEGAL_BEAN_DECLARING_DELEGATE =
INSTANCE.createSeverityOption("illegalBeanDeclaringDelegate",
"delegate"); //$NON-NLS-1$
// - delegate type does not implement or extend a decorated type of the decorator,
// or specifies different type parameters (8.1.3)
- public static final String DELEGATE_HAS_ILLEGAL_TYPE =
INSTANCE.createSeverityOption("delegateHasIllegalType"); //$NON-NLS-1$
+ public static final String DELEGATE_HAS_ILLEGAL_TYPE =
INSTANCE.createSeverityOption("delegateHasIllegalType",
"delegate-type"); //$NON-NLS-1$
// - interceptor for lifecycle callbacks declares an interceptor binding type
// that is defined @Target({TYPE, METHOD}) (9.2)
- public static final String ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING =
INSTANCE.createSeverityOption("illegalLifecycleCallbackInterceptorBinding");
//$NON-NLS-1$
+ public static final String ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING =
INSTANCE.createSeverityOption("illegalLifecycleCallbackInterceptorBinding",
"interceptor"); //$NON-NLS-1$
// - managed bean has a class level interceptor binding and is declared final
// or has a non-static, non-private, final method (9.3)
// - non-static, non-private, final method of a managed bean has a method level
// interceptor binding (9.3)
- public static final String ILLEGAL_INTERCEPTOR_BINDING_METHOD =
INSTANCE.createSeverityOption("illegalInterceptorBindingMethod"); //$NON-NLS-1$
+ public static final String ILLEGAL_INTERCEPTOR_BINDING_METHOD =
INSTANCE.createSeverityOption("illegalInterceptorBindingMethod",
"interceptor-binding"); //$NON-NLS-1$
// - the set of interceptor bindings of a bean or interceptor, including bindings
// inherited from stereotypes and other interceptor bindings, has two instances
// of a certain interceptor binding type and the instances have different values
// of some annotation member (9.5.2)
- public static final String CONFLICTING_INTERCEPTOR_BINDINGS =
INSTANCE.createSeverityOption("conflictingInterceptorBindings"); //$NON-NLS-1$
+ public static final String CONFLICTING_INTERCEPTOR_BINDINGS =
INSTANCE.createSeverityOption("conflictingInterceptorBindings",
"ambiguous-interceptor-binding"); //$NON-NLS-1$
// - interceptor or decorator has a method with a parameter annotated @Observes (10.4.2)
- public static final String OBSERVER_IN_INTERCEPTOR_OR_DECORATOR =
INSTANCE.createSeverityOption("observerInInterceptorOrDecorator");
//$NON-NLS-1$
+ public static final String OBSERVER_IN_INTERCEPTOR_OR_DECORATOR =
INSTANCE.createSeverityOption("observerInInterceptorOrDecorator",
"observer"); //$NON-NLS-1$
// - interceptor or decorator is an alternative (2.6.1 non-portable)
- public static final String INTERCEPTOR_OR_DECORATOR_IS_ALTERNATIVE =
INSTANCE.createSeverityOption("interceptorOrDecoratorIsAlternative");
//$NON-NLS-1$
+ public static final String INTERCEPTOR_OR_DECORATOR_IS_ALTERNATIVE =
INSTANCE.createSeverityOption("interceptorOrDecoratorIsAlternative",
"alternative"); //$NON-NLS-1$
// - interceptor declared using @Interceptor does not declare any interceptor binding
(9.2 non-portable)
- public static final String MISSING_INTERCEPTOR_BINDING =
INSTANCE.createSeverityOption("missingInterceptorBinding"); //$NON-NLS-1$
+ public static final String MISSING_INTERCEPTOR_BINDING =
INSTANCE.createSeverityOption("missingInterceptorBinding",
"missing-interceptor-binding"); //$NON-NLS-1$
// 8.3. Decorator resolution
// - If a decorator matches a managed bean, and the managed bean class is declared final,
the container automatically detects
// the problem and treats it as a deployment problem.
// - If a decorator matches a managed bean with a non-static, non-private, final method,
and the decorator also implements that method, the container automatically detects the
problem and treats it as a deployment problem.
- public static final String DECORATOR_RESOLVES_TO_FINAL_BEAN =
INSTANCE.createSeverityOption("decoratorResolvesToFinalBean"); //$NON-NLS-1$
+ public static final String DECORATOR_RESOLVES_TO_FINAL_BEAN =
INSTANCE.createSeverityOption("decoratorResolvesToFinalBean",
"final"); //$NON-NLS-1$
//Specialization
@@ -209,30 +212,30 @@
// the bean class of another session bean (3.2.4)
//
// - method annotated @Specializes is static or does not directly override another
producer method (3.3.3)
- public static final String ILLEGAL_SPECIALIZING_BEAN =
INSTANCE.createSeverityOption("illegalSpecializingManagedBean"); //$NON-NLS-1$
+ public static final String ILLEGAL_SPECIALIZING_BEAN =
INSTANCE.createSeverityOption("illegalSpecializingManagedBean",
"static"); //$NON-NLS-1$
// - X specializes Y but does not have some bean type of Y (4.3.1)
- public static final String MISSING_TYPE_IN_SPECIALIZING_BEAN =
INSTANCE.createSeverityOption("missingTypeInSpecializingBean"); //$NON-NLS-1$
+ public static final String MISSING_TYPE_IN_SPECIALIZING_BEAN =
INSTANCE.createSeverityOption("missingTypeInSpecializingBean",
"specializes"); //$NON-NLS-1$
// - X specializes Y and Y has a name and X declares a name explicitly, using @Named
(4.3.1)
- public static final String CONFLICTING_NAME_IN_SPECIALIZING_BEAN =
INSTANCE.createSeverityOption("conflictingNameInSpecializingBean");
//$NON-NLS-1$
+ public static final String CONFLICTING_NAME_IN_SPECIALIZING_BEAN =
INSTANCE.createSeverityOption("conflictingNameInSpecializingBean",
"specializes-named"); //$NON-NLS-1$
// - interceptor is annotated @Specializes (4.3.1 non-portable)
// - decorator is annotated @Specializes (4.3.1 non-portable)
- public static final String INTERCEPTOR_ANNOTATED_SPECIALIZES =
INSTANCE.createSeverityOption("interceptorAnnotatedSpecializes"); //$NON-NLS-1$
+ public static final String INTERCEPTOR_ANNOTATED_SPECIALIZES =
INSTANCE.createSeverityOption("interceptorAnnotatedSpecializes",
"specializes"); //$NON-NLS-1$
// 5.1.3. Inconsistent specialization
// - Suppose an enabled bean X specializes a second bean Y. If there is another enabled
bean that specializes Y we say that inconsistent
// specialization exists. The container automatically detects inconsistent
specialization and treats it as a deployment problem.
- public static final String INCONSISTENT_SPECIALIZATION =
INSTANCE.createSeverityOption("inconsistentSpecialization"); //$NON-NLS-1$
+ public static final String INCONSISTENT_SPECIALIZATION =
INSTANCE.createSeverityOption("inconsistentSpecialization",
"inconsistent-specialization"); //$NON-NLS-1$
//Miscellaneous
// - Java EE component class has an injection point of type UserTransaction
// and qualifier @Default, and may not validly make use of the JTA UserTransaction
// according to the Java EE platform specification (3.6)
- public static final String ILLEGAL_INJECTING_USERTRANSACTION_TYPE =
INSTANCE.createSeverityOption("illegalInjectingUserTransactionType");
//$NON-NLS-1$
+ public static final String ILLEGAL_INJECTING_USERTRANSACTION_TYPE =
INSTANCE.createSeverityOption("illegalInjectingUserTransactionType",
"user-transaction"); //$NON-NLS-1$
// - Java EE component class supporting injection that is not a bean has an injection
// point of type InjectionPoint and qualifier @Default (5.5.7)
- public static final String ILLEGAL_INJECTING_INJECTIONPOINT_TYPE =
INSTANCE.createSeverityOption("illegalInjectingInjectionPointType");
//$NON-NLS-1$
+ public static final String ILLEGAL_INJECTING_INJECTIONPOINT_TYPE =
INSTANCE.createSeverityOption("illegalInjectingInjectionPointType",
"injection-point"); //$NON-NLS-1$
// - stereotype declares any qualifier annotation other than @Named (2.7.1.3
non-portable)
- public static final String ILLEGAL_QUALIFIER_IN_STEREOTYPE =
INSTANCE.createSeverityOption("illegalQualifierInStereotype"); //$NON-NLS-1$
+ public static final String ILLEGAL_QUALIFIER_IN_STEREOTYPE =
INSTANCE.createSeverityOption("illegalQualifierInStereotype",
"stereotype"); //$NON-NLS-1$
// - bean class is deployed in two different bean archives (12.1 non-portable)
// ? is it a definition problem
@@ -254,6 +257,15 @@
private CDIPreferences() {
}
+ /*
+ * (non-Javadoc)
+ * @see
org.jboss.tools.common.validation.ValidationSeverityPreferences#getWarningGroupID()
+ */
+ @Override
+ public String getWarningGroupID() {
+ return WARNING_GROUP_ID;
+ }
+
/* (non-Javadoc)
* @see
org.jboss.tools.common.preferences.SeverityPreferences#createSeverityOption(java.lang.String)
*/
@@ -295,5 +307,4 @@
public static int getMaxNumberOfProblemMarkersPerFile(IProject project) {
return INSTANCE.getMaxNumberOfProblemMarkersPerResource(project);
}
-
}
\ No newline at end of file
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDISuppressWarningsMap.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDISuppressWarningsMap.java
(rev 0)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDISuppressWarningsMap.java 2011-12-20
01:41:39 UTC (rev 37444)
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.cdi.internal.core.validation;
+
+import org.jboss.tools.cdi.core.preferences.CDIPreferences;
+import org.jboss.tools.common.validation.IWarningNameMap;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class CDISuppressWarningsMap implements IWarningNameMap {
+
+ /*
+ * (non-Javadoc)
+ * @see
org.jboss.tools.common.validation.IWarningNameMap#getWarningNames(java.lang.String)
+ */
+ @Override
+ public String[] getWarningNames(String preferenceID) {
+ return CDIPreferences.getInstance().getWarningNames(preferenceID);
+ }
+}
\ No newline at end of file
Property changes on:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDISuppressWarningsMap.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigPreferences.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigPreferences.java 2011-12-20
01:36:33 UTC (rev 37443)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigPreferences.java 2011-12-20
01:41:39 UTC (rev 37444)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.cdi.seam.config.core;
import java.util.HashSet;
@@ -42,5 +52,4 @@
protected String getPluginId() {
return CDISeamConfigCorePlugin.PLUGIN_ID;
}
-
-}
+}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/plugin.xml
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/plugin.xml 2011-12-20 01:36:33
UTC (rev 37443)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/plugin.xml 2011-12-20 01:41:39
UTC (rev 37444)
@@ -74,4 +74,14 @@
<initializer
class="org.jboss.tools.cdi.seam.solder.core.CDISeamSolderPreferenceInitializer"/>
</extension>
+ <extension
+ id="SolderWarnings"
+ point="org.jboss.tools.common.validation.warnings">
+ <map
+
class="org.jboss.tools.cdi.seam.solder.core.validation.SolderSuppressWarningsMap"
+ warningGroupID="solder"
+
preferenceGroupID="org.jboss.tools.cdi.seam.solder.core.validator.problem">
+ </map>
+ </extension>
+
</plugin>
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderPreferences.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderPreferences.java 2011-12-20
01:36:33 UTC (rev 37443)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderPreferences.java 2011-12-20
01:41:39 UTC (rev 37444)
@@ -13,25 +13,29 @@
import java.util.HashSet;
import java.util.Set;
-import org.jboss.tools.common.preferences.SeverityPreferences;
+import org.jboss.tools.cdi.core.preferences.CDIPreferences;
+import org.jboss.tools.common.validation.ValidationSeverityPreferences;
/**
*
* @author Viacheslav Kabanovich
*
*/
-public class CDISeamSolderPreferences extends SeverityPreferences {
+public class CDISeamSolderPreferences extends ValidationSeverityPreferences {
+
public static final Set<String> SEVERITY_OPTION_NAMES = new
HashSet<String>();
private static CDISeamSolderPreferences INSTANCE = new CDISeamSolderPreferences();
- public static final String AMBIGUOUS_GENERIC_CONFIGURATION_POINT =
INSTANCE.createSeverityOption("ambiguousGenericConfigurationPoint");
- public static final String WRONG_TYPE_OF_GENERIC_CONFIGURATION_POINT =
INSTANCE.createSeverityOption("wrongTypeOfGenericConfigurationPoint");
- public static final String WRONG_GENERIC_CONFIGURATION_ANNOTATION_REFERENCE =
INSTANCE.createSeverityOption("wrongGenericConfigurationAnnotationReference");
- public static final String GENERIC_CONFIGURATION_TYPE_IS_A_GENERIC_BEAN =
INSTANCE.createSeverityOption("genericConfigurationTypeIsGenericBean");
+ public static final String WARNING_GROUP_ID = "solder";
+
+ public static final String AMBIGUOUS_GENERIC_CONFIGURATION_POINT =
INSTANCE.createSeverityOption("ambiguousGenericConfigurationPoint",
"ambiguous-generic");
+ public static final String WRONG_TYPE_OF_GENERIC_CONFIGURATION_POINT =
INSTANCE.createSeverityOption("wrongTypeOfGenericConfigurationPoint",
"type");
+ public static final String WRONG_GENERIC_CONFIGURATION_ANNOTATION_REFERENCE =
INSTANCE.createSeverityOption("wrongGenericConfigurationAnnotationReference",
"annotation");
+ public static final String GENERIC_CONFIGURATION_TYPE_IS_A_GENERIC_BEAN =
INSTANCE.createSeverityOption("genericConfigurationTypeIsGenericBean",
"generic-bean");
- public static final String DEFAULT_PRODUCER_FIELD_ON_NORMAL_SCOPED_BEAN =
INSTANCE.createSeverityOption("defaultProducerFieldOnNormalScopedBean");
- public static final String IDENTICAL_DEFAULT_BEANS =
INSTANCE.createSeverityOption("identicalDefaultBeans");
+ public static final String DEFAULT_PRODUCER_FIELD_ON_NORMAL_SCOPED_BEAN =
INSTANCE.createSeverityOption("defaultProducerFieldOnNormalScopedBean",
"normal-scoped");
+ public static final String IDENTICAL_DEFAULT_BEANS =
INSTANCE.createSeverityOption("identicalDefaultBeans",
"default-bean");
public static CDISeamSolderPreferences getInstance() {
return INSTANCE;
@@ -40,6 +44,20 @@
private CDISeamSolderPreferences() {}
@Override
+ public String getWarningGroupID() {
+ return WARNING_GROUP_ID;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
org.jboss.tools.common.validation.ValidationSeverityPreferences#getParentWarningGroupIDs()
+ */
+ @Override
+ protected String[] getParentWarningGroupIDs() {
+ return new String[]{CDIPreferences.WARNING_GROUP_ID};
+ }
+
+ @Override
protected Set<String> getSeverityOptionNames() {
return SEVERITY_OPTION_NAMES;
}
@@ -55,5 +73,4 @@
protected String getPluginId() {
return CDISeamSolderCorePlugin.PLUGIN_ID;
}
-
-}
+}
\ No newline at end of file
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/validation/SolderSuppressWarningsMap.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/validation/SolderSuppressWarningsMap.java
(rev 0)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/validation/SolderSuppressWarningsMap.java 2011-12-20
01:41:39 UTC (rev 37444)
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.cdi.seam.solder.core.validation;
+
+import org.jboss.tools.cdi.seam.solder.core.CDISeamSolderPreferences;
+import org.jboss.tools.common.validation.IWarningNameMap;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class SolderSuppressWarningsMap implements IWarningNameMap {
+
+ /*
+ * (non-Javadoc)
+ * @see
org.jboss.tools.common.validation.IWarningNameMap#getWarningNames(java.lang.String)
+ */
+ @Override
+ public String[] getWarningNames(String preferenceID) {
+ return CDISeamSolderPreferences.getInstance().getWarningNames(preferenceID);
+ }
+}
\ No newline at end of file
Property changes on:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/validation/SolderSuppressWarningsMap.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/suppresswarnings/Fish.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/suppresswarnings/Fish.java 2011-12-20
01:36:33 UTC (rev 37443)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/suppresswarnings/Fish.java 2011-12-20
01:41:39 UTC (rev 37444)
@@ -4,7 +4,7 @@
import javax.inject.Inject;
import javax.inject.Named;
-(a)SuppressWarnings("org.jboss.tools.cdi.core.validator.problem.ambiguousElNames")
+@SuppressWarnings("cdi-ambiguous-name")
@Named("fishDulipcatedName")
public class Fish {
@@ -13,16 +13,16 @@
@Named("fishDulipcatedName")
@Produces Fish fish2OK;
- @SuppressWarnings("org.jboss.tools.cdi.core.validator.problem.producerAnnotatedInject")
+ @SuppressWarnings("cdi-annotated-inject")
@Inject @Produces Fish iFishOK;
@Inject @Produces Fish iFish2BROKEN;
@Produces
- public void
setFish((a)SuppressWarnings("org.jboss.tools.cdi.core.validator.problem.unsatisfiedInjectionPoints")
Fish fishOK) {
+ public void setFish(@SuppressWarnings("cdi-ambiguous-dependency") Fish fishOK)
{
}
- @SuppressWarnings({"org.jboss.tools.cdi.core.validator.problem.producerAnnotatedInject",
"org.jboss.tools.cdi.core.validator.problem.unsatisfiedInjectionPoints"})
+ @SuppressWarnings({"cdi-annotated-inject",
"cdi-ambiguous-dependency"})
@Inject @Produces
public void setFish2OK(Fish fishOK) {
}
@@ -31,11 +31,11 @@
public void setFish3(Fish fishBROKEN) {
}
- @SuppressWarnings("unsatisfiedInjectionPoints")
+ @SuppressWarnings("cdi-ambiguous-dependency")
@Inject Fish fish3OK;
- @SuppressWarnings("unknownElVariablePropertyName")
- public void useEL() {
+ @SuppressWarnings("el-unresolved")
+ public void useELOK() {
String s = "#{fishDulipcatedName.abc}";
}
}
\ No newline at end of file
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/EclipseJavaUtil.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/EclipseJavaUtil.java 2011-12-20
01:36:33 UTC (rev 37443)
+++
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/EclipseJavaUtil.java 2011-12-20
01:41:39 UTC (rev 37444)
@@ -173,24 +173,6 @@
}
/**
- * Returns annotation by the full name declared for the given java member or its
parents.
- * @param member
- * @param name
- * @param checkParents
- * @return
- * @throws JavaModelException
- */
- public static IAnnotation findAnnotationByFullName(IMember member, String name, boolean
checkParents) throws JavaModelException {
- String shortName = name;
- int i = name.lastIndexOf('.');
- if(i>-1) {
- shortName = name.substring(i+1);
- }
- IAnnotation annotation = findAnnotationByShortName(member, shortName, checkParents);
- return annotation!=null && checkAnnotationByFulltName(annotation, name) ?
annotation:null;
- }
-
- /**
* Returns true if the given annotation has the given full name
* @param annotation
* @param fullName
@@ -222,14 +204,19 @@
}
/**
- * Returns annotation by the short name declared for the given java member or its
parents.
+ * Returns annotation by the short name declared for the given java member and its
parents.
+ * Returns null if no annotation found.
* @param member
* @param name
* @param checkParents
* @return
* @throws JavaModelException
*/
- public static IAnnotation findAnnotationByShortName(IJavaElement element, String name,
boolean checkParents) throws JavaModelException {
+ public static Set<IAnnotation> findAnnotationsByShortName(IJavaElement element,
String name, boolean checkParents) throws JavaModelException {
+ return findAnnotationsByShortName(null, element, name, checkParents);
+ }
+
+ private static Set<IAnnotation> findAnnotationsByShortName(Set<IAnnotation>
result, IJavaElement element, String name, boolean checkParents) throws JavaModelException
{
if(element instanceof IAnnotatable) {
IAnnotation[] annotations = ((IAnnotatable)element).getAnnotations();
for (IAnnotation annotation : annotations) {
@@ -239,16 +226,20 @@
aName = aName.substring(i+1);
}
if(aName.equals(name)) {
- return annotation;
+ if(result==null) {
+ result = new HashSet<IAnnotation>();
+ }
+ result.add(annotation);
+ break;
}
}
}
if(checkParents) {
IJavaElement parent = element.getParent();
- if(parent instanceof IMember) {
- return findAnnotationByShortName((IMember)parent, name, true);
+ if(parent instanceof IAnnotatable) {
+ return findAnnotationsByShortName(result, parent, name, true);
}
}
- return null;
+ return result;
}
}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common.validation/plugin.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.validation/plugin.xml 2011-12-20 01:36:33
UTC (rev 37443)
+++ trunk/common/plugins/org.jboss.tools.common.validation/plugin.xml 2011-12-20 01:41:39
UTC (rev 37444)
@@ -2,6 +2,7 @@
<?eclipse version="3.0"?>
<plugin>
<extension-point id="validator" name="KB Validator"
schema="schema/validator.exsd"/>
+ <extension-point id="warnings" name="Warning names supported by
@SuppressWarnings" schema="schema/warnings.exsd"/>
<extension
point="org.eclipse.wst.validation.validator"
@@ -71,4 +72,4 @@
</persistent>
</extension>
-</plugin>
\ No newline at end of file
+</plugin>
Added: trunk/common/plugins/org.jboss.tools.common.validation/schema/warnings.exsd
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.validation/schema/warnings.exsd
(rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.validation/schema/warnings.exsd 2011-12-20
01:41:39 UTC (rev 37444)
@@ -0,0 +1,116 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.jboss.tools.common.validation"
xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.jboss.tools.common.validation"
id="warnings" name="Warning names supported by
@SuppressWarnings"/>
+ </appInfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="map" minOccurs="1"
maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string"
use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="map">
+ <complexType>
+ <attribute name="class" type="string"
use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java"
basedOn=":org.jboss.tools.common.validation.IWarningNameMap"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="warningGroupID" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="preferenceGroupID" type="string"
use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiinfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
Property changes on:
trunk/common/plugins/org.jboss.tools.common.validation/schema/warnings.exsd
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/IWarningNameMap.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/IWarningNameMap.java
(rev 0)
+++
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/IWarningNameMap.java 2011-12-20
01:41:39 UTC (rev 37444)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.common.validation;
+
+/**
+ * This interface represents a Map between the validation preference ID
+ * and all the available warning names which can be used in
@SuppressWarnings("...")
+ * to suppress the corresponding validation.
+ * @author Alexey Kazakov
+ */
+public interface IWarningNameMap {
+
+ static final String EXTENSION_POINT_ID =
"org.jboss.tools.common.validation.warnings"; //$NON-NLS-1$
+
+ /**
+ * Returns array of warning names which can be used in
@SuppressWarnings("...")
+ * which are mapped to the full preference ID of the corresponding validation rule.
+ * The first name of the result array is preferred and the rest of names are optional.
+ * Returns null if no warning name found for this preference ID.
+ * @param preferenceID
+ * @return
+ */
+ String[] getWarningNames(String preferenceID);
+}
\ No newline at end of file
Property changes on:
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/IWarningNameMap.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified:
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationErrorManager.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationErrorManager.java 2011-12-20
01:36:33 UTC (rev 37443)
+++
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationErrorManager.java 2011-12-20
01:41:39 UTC (rev 37444)
@@ -178,54 +178,64 @@
private static final String SUPPRESS_WARNINGS_ANNOTATION_FULL =
"java.lang.SuppressWarnings";
private static final String ALL_WARNINGS = "all";
- private static IAnnotation getSuppressWarningsAnnotation(String preferenceKey,
IJavaElement element) throws JavaModelException {
+ private static boolean hasSuppressWarningsAnnotation(String preferenceKey, IJavaElement
element) throws JavaModelException {
+ String[] names = WarningNameManager.getInstance().getWarningNames(preferenceKey);
+ if(names==null || names.length==1) {
+ return false;
+ }
// Does the element have @SuppressWarnings? Check it by the short name only.
- IAnnotation annotation = EclipseJavaUtil.findAnnotationByShortName(element,
SUPPRESS_WARNINGS_ANNOTATION_SHORT, true);
- IAnnotation result = null;
- if(annotation!=null) {
- IMemberValuePair[] pairs = annotation.getMemberValuePairs();
- if(pairs.length==1) {
- Object v = pairs[0].getValue();
- Object[] warnings = null;
- if(v instanceof Object[]) {
- warnings = (Object[])v;
- } else if(v instanceof String) {
- warnings = new String[]{v.toString()};
- }
- String shortKey = null;
- int dot = preferenceKey.lastIndexOf('.');
- if(dot>-1) {
- shortKey = preferenceKey.substring(dot+1);
- }
- for (Object warning : warnings) {
- String trimed = warning.toString().trim();
- if(shortKey!=null && trimed.equals(shortKey) ||
trimed.equals(preferenceKey) || trimed.equals(ALL_WARNINGS)) {
- // Ok, we seem to have such a suppress. Let's make sure the full name of
annotation is java.lang.SuppressWarnings
- if(EclipseJavaUtil.checkAnnotationByFulltName(annotation,
SUPPRESS_WARNINGS_ANNOTATION_FULL)) {
- result = annotation;
- break;
+ Set<IAnnotation> annotations =
EclipseJavaUtil.findAnnotationsByShortName(element, SUPPRESS_WARNINGS_ANNOTATION_SHORT,
true);
+ if(annotations!=null) {
+ for (IAnnotation annotation : annotations) {
+ IMemberValuePair[] pairs = annotation.getMemberValuePairs();
+ if(pairs.length==1) {
+ Object v = pairs[0].getValue();
+ Object[] warnings = null;
+ if(v instanceof Object[]) {
+ warnings = (Object[])v;
+ } else if(v instanceof String) {
+ warnings = new String[]{v.toString()};
+ }
+ for (Object warning : warnings) {
+ String trimed = warning.toString().trim();
+ boolean found = false;
+ if(trimed.equals(ALL_WARNINGS)) {
+ found = true;
+ } else {
+ for (String name : names) {
+ if(warning.equals(name)) {
+ found = true;
+ break;
+ }
+ }
}
+ if(found) {
+ // Ok, we seem to have such a suppress. Let's make sure the full name of
annotation is java.lang.SuppressWarnings
+ if(EclipseJavaUtil.checkAnnotationByFulltName(annotation,
SUPPRESS_WARNINGS_ANNOTATION_FULL)) {
+ return true;
+ }
+ }
}
}
}
}
- return result;
+ return false;
}
private static boolean hasSuppressWarningsAnnotation(String preferenceKey,
ITextSourceReference location) throws JavaModelException {
boolean result = false;
if(location instanceof IJavaSourceReference) {
IJavaElement element = ((IJavaSourceReference) location).getSourceElement();
- if(element==null) {
+ if(element!=null) {
+ result = hasSuppressWarningsAnnotation(preferenceKey, element);
+ } else {
// Check if it's really a java resource.
IResource resource = location.getResource();
if("java".equalsIgnoreCase(resource.getFileExtension())) {
throw new NullPointerException("IJavaSourceReference referenced to java source
should not return null in getSourceElement()");
}
- return result;
}
- result = getSuppressWarningsAnnotation(preferenceKey, element)!=null;
}
return result;
Added:
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationSeverityPreferences.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationSeverityPreferences.java
(rev 0)
+++
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationSeverityPreferences.java 2011-12-20
01:41:39 UTC (rev 37444)
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.common.validation;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.tools.common.preferences.SeverityPreferences;
+
+/**
+ * @author Alexey Kazakov
+ */
+public abstract class ValidationSeverityPreferences extends SeverityPreferences
implements IWarningNameMap {
+
+ private Map<String, String[]> warningNameMap = new HashMap<String,
String[]>();
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.common.validation.IWarningNameMap#getNames(java.lang.String)
+ */
+ @Override
+ public String[] getWarningNames(String preferenceID) {
+ return warningNameMap.get(preferenceID);
+ }
+
+ protected String createSeverityOption(String shortName, String... shortWarningNames) {
+ String name = createSeverityOption(shortName);
+ String[] parentIDs = getParentWarningGroupIDs();
+ String[] allNames = new String[shortWarningNames.length + parentIDs.length + 1];
+ for (int i=0; i<shortWarningNames.length; i++) {
+ allNames[i] = getWarningGroupID() + "-" + shortWarningNames[i];
+ }
+ allNames[shortWarningNames.length] = getWarningGroupID();
+ for (int i = 0; i < parentIDs.length; i++) {
+ allNames[shortWarningNames.length + 1 + i] = parentIDs[i];
+ }
+ warningNameMap.put(name, allNames);
+ return name;
+ }
+
+ private static final String[] EMPTY_IDS = new String[0];
+
+ protected String[] getParentWarningGroupIDs() {
+ return EMPTY_IDS;
+ }
+
+ /**
+ * Returns the ID of the group of warnings managed by this map.
+ * The ID may not contain '-'.
+ * @return
+ */
+ public abstract String getWarningGroupID();
+}
\ No newline at end of file
Property changes on:
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationSeverityPreferences.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/WarningNameManager.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/WarningNameManager.java
(rev 0)
+++
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/WarningNameManager.java 2011-12-20
01:41:39 UTC (rev 37444)
@@ -0,0 +1,125 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.common.validation;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.Platform;
+
+/**
+ * Represents a map between warning name supported by @SuppressWarnings
+ * and the corresponding preference ID.
+ *
+ * @author Alexey Kazakov
+ */
+public class WarningNameManager implements IWarningNameMap {
+
+ private static final WarningNameManager INSTANCE = new WarningNameManager();
+
+ private Map<String, Set<IConfigurationElement>> allExtensions;
+ private Map<String, Set<IWarningNameMap>> maps;
+ private Map<String, String[]> warnings;
+
+ public static WarningNameManager getInstance() {
+ return INSTANCE;
+ }
+
+ private WarningNameManager() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.common.validation.IWarningNameMap#getNames(java.lang.String)
+ */
+ @Override
+ public String[] getWarningNames(String preferenceID) {
+ init();
+ String[] names = null;
+ synchronized (warnings) {
+ names = warnings.get(preferenceID);
+ if(names==null) {
+ String preferenceGoupID = getPreferenceGroupID(preferenceID);
+ Set<IWarningNameMap> mapsByID = maps.get(preferenceGoupID);
+ if(mapsByID==null) {
+ mapsByID = new HashSet<IWarningNameMap>();
+ maps.put(preferenceGoupID, mapsByID);
+ Set<IConfigurationElement> extns = allExtensions.get(preferenceGoupID);
+ if(extns!=null) {
+ for (IConfigurationElement element : extns) {
+ try {
+ Object o = element.createExecutableExtension("class");
+ if(o instanceof IWarningNameMap) {
+ mapsByID.add((IWarningNameMap)o);
+ } else {
+ CommonValidationPlugin.getDefault().logError("Extension of " +
IWarningNameMap.EXTENSION_POINT_ID + " should refer to an instance of " +
IWarningNameMap.class + ". But the actuall class declared in " + element +
" refers to " + o.getClass());
+ }
+ } catch (CoreException e) {
+ CommonValidationPlugin.getDefault().logError(e);
+ }
+ }
+ }
+ }
+ if(mapsByID.size()==1) {
+ names = mapsByID.iterator().next().getWarningNames(preferenceID);
+ } else {
+ Set<String> mapNameSet = new HashSet<String>();
+ for (IWarningNameMap map : mapsByID) {
+ String[] mapNames = map.getWarningNames(preferenceID);
+ for (String n : mapNames) {
+ mapNameSet.add(n);
+ }
+ }
+ names = mapNameSet.toArray(new String[mapNameSet.size()]);
+ }
+ warnings.put(preferenceID, names);
+ }
+ }
+ return names;
+ }
+
+ private String getPreferenceGroupID(String preferenceID) {
+ int dot = preferenceID.lastIndexOf('.');
+ return dot>-1?preferenceID.substring(0, dot):preferenceID;
+ }
+
+ private synchronized void init() {
+ if(allExtensions == null) {
+ maps = new HashMap<String, Set<IWarningNameMap>>();
+ warnings = new HashMap<String, String[]>();
+ allExtensions = new HashMap<String, Set<IConfigurationElement>>();
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IExtensionPoint extensionPoint =
registry.getExtensionPoint(IWarningNameMap.EXTENSION_POINT_ID);
+ if (extensionPoint != null) {
+ IExtension[] extensions = extensionPoint.getExtensions();
+ for (int i=0; i<extensions.length; i++) {
+ IExtension extension = extensions[i];
+ IConfigurationElement[] elements = extension.getConfigurationElements();
+ for(int j=0; j<elements.length; j++) {
+ String preferenceGroupId =
elements[j].getAttribute("preferenceGroupID");
+ Set<IConfigurationElement> els = allExtensions.get(preferenceGroupId);
+ if(els==null) {
+ els = new HashSet<IConfigurationElement>();
+ allExtensions.put(preferenceGroupId, els);
+ }
+ els.add(elements[j]);
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
Property changes on:
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/WarningNameManager.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml 2011-12-20 01:36:33 UTC (rev
37443)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml 2011-12-20 01:41:39 UTC (rev
37444)
@@ -187,6 +187,16 @@
</validator>
</extension>
+ <extension
+ id="ELWarnings"
+ point="org.jboss.tools.common.validation.warnings">
+ <map
+
class="org.jboss.tools.jst.web.kb.internal.validation.ELSuppressWarningsMap"
+ warningGroupID="el"
+
preferenceGroupID="org.jboss.tools.jst.web.kb.validator.problem">
+ </map>
+ </extension>
+
<extension point="org.eclipse.wst.xml.core.catalogContributions">
<catalogContribution id="default">
<uri
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELSuppressWarningsMap.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELSuppressWarningsMap.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELSuppressWarningsMap.java 2011-12-20
01:41:39 UTC (rev 37444)
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.jst.web.kb.internal.validation;
+
+import org.jboss.tools.common.validation.IWarningNameMap;
+import org.jboss.tools.jst.web.kb.preferences.ELSeverityPreferences;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class ELSuppressWarningsMap implements IWarningNameMap {
+
+ /*
+ * (non-Javadoc)
+ * @see
org.jboss.tools.common.validation.IWarningNameMap#getWarningNames(java.lang.String)
+ */
+ @Override
+ public String[] getWarningNames(String preferenceID) {
+ return ELSeverityPreferences.getInstance().getWarningNames(preferenceID);
+ }
+}
\ No newline at end of file
Property changes on:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELSuppressWarningsMap.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/ELSeverityPreferences.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/ELSeverityPreferences.java 2011-12-20
01:36:33 UTC (rev 37443)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/ELSeverityPreferences.java 2011-12-20
01:41:39 UTC (rev 37444)
@@ -15,32 +15,35 @@
import org.eclipse.core.resources.IProject;
import org.jboss.tools.common.preferences.SeverityPreferences;
+import org.jboss.tools.common.validation.ValidationSeverityPreferences;
import org.jboss.tools.jst.web.kb.WebKbPlugin;
/**
* @author Alexey Kazakov
*/
-public class ELSeverityPreferences extends SeverityPreferences {
+public class ELSeverityPreferences extends ValidationSeverityPreferences {
public static final Set<String> SEVERITY_OPTION_NAMES = new
HashSet<String>();
private static ELSeverityPreferences INSTANCE = new ELSeverityPreferences();
+ public static final String WARNING_GROUP_ID = "el";
+
// Expression Language
// Mark EL Variable name which we can't resolve.
- public static final String UNKNOWN_EL_VARIABLE_NAME =
INSTANCE.createSeverityOption("unknownElVariableName"); //$NON-NLS-1$
+ public static final String UNKNOWN_EL_VARIABLE_NAME =
INSTANCE.createSeverityOption("unknownElVariableName", "unresolved");
//$NON-NLS-1$
// Check "var" attributes.
public static final String CHECK_VARS =
INSTANCE.createSeverityOption("checkVars"); //$NON-NLS-1$
// Re-validate unresolved ELs.
public static final String RE_VALIDATE_UNRESOLVED_EL =
INSTANCE.createSeverityOption("revalidateUnresolvedEl"); //$NON-NLS-1$
// Mark EL Variable property name which we can't resolve.
- public static final String UNKNOWN_EL_VARIABLE_PROPERTY_NAME =
INSTANCE.createSeverityOption("unknownElVariablePropertyName"); //$NON-NLS-1$
+ public static final String UNKNOWN_EL_VARIABLE_PROPERTY_NAME =
INSTANCE.createSeverityOption("unknownElVariablePropertyName",
"unresolved"); //$NON-NLS-1$
// If Expression use property of bean and this property has only setter(getter) without
getter(setter) then mark it.
- public static final String UNPAIRED_GETTER_OR_SETTER =
INSTANCE.createSeverityOption("unpairedGetterOrSetter"); //$NON-NLS-1$
+ public static final String UNPAIRED_GETTER_OR_SETTER =
INSTANCE.createSeverityOption("unpairedGetterOrSetter", "unresolved");
//$NON-NLS-1$
- public static final String EL_SYNTAX_ERROR =
INSTANCE.createSeverityOption("elSyntaxError"); //$NON-NLS-1$
-
+ public static final String EL_SYNTAX_ERROR =
INSTANCE.createSeverityOption("elSyntaxError", "syntax");
//$NON-NLS-1$
+
public static final String NON_EXTERNALIZED_STRINGS =
INSTANCE.createSeverityOption("nonExternalizedString"); //$NON-NLS-1$
/**
@@ -53,6 +56,15 @@
private ELSeverityPreferences() {
}
+ /*
+ * (non-Javadoc)
+ * @see
org.jboss.tools.common.validation.ValidationSeverityPreferences#getWarningGroupID()
+ */
+ @Override
+ public String getWarningGroupID() {
+ return WARNING_GROUP_ID;
+ }
+
/* (non-Javadoc)
* @see
org.jboss.tools.common.preferences.SeverityPreferences#createSeverityOption(java.lang.String)
*/
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBSeverityPreferences.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBSeverityPreferences.java 2011-12-20
01:36:33 UTC (rev 37443)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBSeverityPreferences.java 2011-12-20
01:41:39 UTC (rev 37444)
@@ -26,11 +26,7 @@
private static KBSeverityPreferences INSTANCE = new KBSeverityPreferences();
- // Expression Language
-
- // Mark EL Variable name which we can't resolve.
public static final String REQUIRED_KB_CAPABILITIES_ARE_MISSING =
INSTANCE.createSeverityOption("requiredKbCapabilitiesAreMissing");
//$NON-NLS-1$
- // Check "var" attributes.
public static final String KB_CAPABILITIES_ARE_NOT_ENABLED_IN_JAVA_MODULE =
INSTANCE.createSeverityOption("kbCapabilitiesAreNotEnabledInJavaModule");
//$NON-NLS-1$
/**
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2011-12-20 01:36:33 UTC (rev
37443)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2011-12-20 01:41:39 UTC (rev
37444)
@@ -528,6 +528,16 @@
</extension>
<extension
+ id="SeamWarnings"
+ point="org.jboss.tools.common.validation.warnings">
+ <map
+
class="org.jboss.tools.seam.internal.core.validation.SeamSuppressWarningsMap"
+ warningGroupID="seam"
+
preferenceGroupID="org.jboss.tools.seam.core.validator.problem">
+ </map>
+ </extension>
+
+ <extension
id="SeamELValidationDelegate"
point="org.jboss.tools.jst.web.kb.elValidationDelegate">
<delegate
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java 2011-12-20
01:36:33 UTC (rev 37443)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java 2011-12-20
01:41:39 UTC (rev 37444)
@@ -14,7 +14,7 @@
import java.util.Set;
import org.eclipse.core.resources.IProject;
-import org.jboss.tools.common.preferences.SeverityPreferences;
+import org.jboss.tools.common.validation.ValidationSeverityPreferences;
/**
* Constants for names of seam preferences.
@@ -36,76 +36,78 @@
*
* @author Viacheslav Kabanovich
*/
-public class SeamPreferences extends SeverityPreferences {
+public class SeamPreferences extends ValidationSeverityPreferences {
public static final Set<String> SEVERITY_OPTION_NAMES = new
HashSet<String>();
private static SeamPreferences INSTANCE = new SeamPreferences();
+ public static final String WARNING_GROUP_ID = "seam";
+
//Components
// Duplicate names found in @Name annotations will be marked
- public static final String NONUNIQUE_COMPONENT_NAME =
INSTANCE.createSeverityOption("nonUniqueComponentName"); //$NON-NLS-1$
+ public static final String NONUNIQUE_COMPONENT_NAME =
INSTANCE.createSeverityOption("nonUniqueComponentName",
"duplicated-component"); //$NON-NLS-1$
// Components with @Stateful and without @Remove methods will be marked
- public static final String STATEFUL_COMPONENT_DOES_NOT_CONTENT_REMOVE =
INSTANCE.createSeverityOption("statefulComponentDoesNotContainRemove");
//$NON-NLS-1$
+ public static final String STATEFUL_COMPONENT_DOES_NOT_CONTENT_REMOVE =
INSTANCE.createSeverityOption("statefulComponentDoesNotContainRemove",
"remove"); //$NON-NLS-1$
// Components with @Stateful and without @Destroy methods will be marked
- public static final String STATEFUL_COMPONENT_DOES_NOT_CONTENT_DESTROY =
INSTANCE.createSeverityOption("statefulComponentDoesNotContainDestroy");
//$NON-NLS-1$
+ public static final String STATEFUL_COMPONENT_DOES_NOT_CONTENT_DESTROY =
INSTANCE.createSeverityOption("statefulComponentDoesNotContainDestroy",
"destroy"); //$NON-NLS-1$
// Components with @Stateful can't have PAGE or STATELESS scopes. If it has wrong
scope then component will be marked.
- public static final String STATEFUL_COMPONENT_WRONG_SCOPE =
INSTANCE.createSeverityOption("statefulComponentHasWrongScope"); //$NON-NLS-1$
+ public static final String STATEFUL_COMPONENT_WRONG_SCOPE =
INSTANCE.createSeverityOption("statefulComponentHasWrongScope",
"scope"); //$NON-NLS-1$
// If className ('component' element) contains unknown class name then
component.xml will be marked.
- public static final String UNKNOWN_COMPONENT_CLASS_NAME =
INSTANCE.createSeverityOption("unknownComponentClassName"); //$NON-NLS-1$
+ public static final String UNKNOWN_COMPONENT_CLASS_NAME =
INSTANCE.createSeverityOption("unknownComponentClassName",
"unknown-component"); //$NON-NLS-1$
- public static final String UNKNOWN_COMPONENT_CLASS_NAME_GUESS =
INSTANCE.createSeverityOption("unknownComponentClassNameGuess"); //$NON-NLS-1$
+ public static final String UNKNOWN_COMPONENT_CLASS_NAME_GUESS =
INSTANCE.createSeverityOption("unknownComponentClassNameGuess",
"unknown-component"); //$NON-NLS-1$
// If component/property@name contains some property name which does not have setter
then mark it.
- public static final String UNKNOWN_COMPONENT_PROPERTY =
INSTANCE.createSeverityOption("unknownComponentProperty"); //$NON-NLS-1$
+ public static final String UNKNOWN_COMPONENT_PROPERTY =
INSTANCE.createSeverityOption("unknownComponentProperty",
"unknown-property"); //$NON-NLS-1$
//Entities
// Component marked as @Entity can't have STATELESS scope. If it has wrong scope
mark it.
- public static final String ENTITY_COMPONENT_WRONG_SCOPE =
INSTANCE.createSeverityOption("entityComponentHasWrongScope"); //$NON-NLS-1$
+ public static final String ENTITY_COMPONENT_WRONG_SCOPE =
INSTANCE.createSeverityOption("entityComponentHasWrongScope",
"entity"); //$NON-NLS-1$
// Mark any duplicated @Remove methods within one component.
- public static final String DUPLICATE_REMOVE =
INSTANCE.createSeverityOption("duplicateRemove"); //$NON-NLS-1$
+ public static final String DUPLICATE_REMOVE =
INSTANCE.createSeverityOption("duplicateRemove", "remove");
//$NON-NLS-1$
//Component life-cycle methods
// Mark duplicated @Destroy methods within one component.
- public static final String DUPLICATE_DESTROY =
INSTANCE.createSeverityOption("duplicateDestroy"); //$NON-NLS-1$
+ public static final String DUPLICATE_DESTROY =
INSTANCE.createSeverityOption("duplicateDestroy",
"duplicated-method"); //$NON-NLS-1$
// Mark duplicated @Create methods within one component.
- public static final String DUPLICATE_CREATE =
INSTANCE.createSeverityOption("duplicateCreate"); //$NON-NLS-1$
+ public static final String DUPLICATE_CREATE =
INSTANCE.createSeverityOption("duplicateCreate", "duplicated-method");
//$NON-NLS-1$
// Mark duplicated @Unwrap methods within one component.
- public static final String DUPLICATE_UNWRAP =
INSTANCE.createSeverityOption("duplicateUnwrap"); //$NON-NLS-1$
+ public static final String DUPLICATE_UNWRAP =
INSTANCE.createSeverityOption("duplicateUnwrap", "duplicated-method");
//$NON-NLS-1$
// Mark all @Destroy methods which are not declared in components' classes.
- public static final String DESTROY_METHOD_BELONGS_TO_STATELESS_SESSION_BEAN =
INSTANCE.createSeverityOption("destroyMethodBelongsToStatelessSessionBean");
//$NON-NLS-1$
+ public static final String DESTROY_METHOD_BELONGS_TO_STATELESS_SESSION_BEAN =
INSTANCE.createSeverityOption("destroyMethodBelongsToStatelessSessionBean",
"destroy"); //$NON-NLS-1$
// Mark all @Create methods which are not declared in components' classes.
- public static final String CREATE_DOESNT_BELONG_TO_COMPONENT =
INSTANCE.createSeverityOption("createDoesNotBelongToComponent"); //$NON-NLS-1$
+ public static final String CREATE_DOESNT_BELONG_TO_COMPONENT =
INSTANCE.createSeverityOption("createDoesNotBelongToComponent",
"unused-method"); //$NON-NLS-1$
// Mark all @Unwrap methods which are not declared in components' classes.
- public static final String UNWRAP_DOESNT_BELONG_TO_COMPONENT =
INSTANCE.createSeverityOption("unwrapDoesNotBelongToComponent"); //$NON-NLS-1$
+ public static final String UNWRAP_DOESNT_BELONG_TO_COMPONENT =
INSTANCE.createSeverityOption("unwrapDoesNotBelongToComponent",
"unused-method"); //$NON-NLS-1$
// Mark all @Observer methods which are not declared in components' classes.
- public static final String OBSERVER_DOESNT_BELONG_TO_COMPONENT =
INSTANCE.createSeverityOption("observerDoesNotBelongToComponent");
//$NON-NLS-1$
+ public static final String OBSERVER_DOESNT_BELONG_TO_COMPONENT =
INSTANCE.createSeverityOption("observerDoesNotBelongToComponent",
"unused-method"); //$NON-NLS-1$
//Factories
// Factory method with a void return type must have an associated @Out/Databinder. Mark
factory otherwise.
- public static final String UNKNOWN_FACTORY_NAME =
INSTANCE.createSeverityOption("unknownFactoryName"); //$NON-NLS-1$
+ public static final String UNKNOWN_FACTORY_NAME =
INSTANCE.createSeverityOption("unknownFactoryName", "factory");
//$NON-NLS-1$
//Bijections
// @DataModelSelection and @DataModelSelectionIndex without name requires the only one
@DataModel in the component. Mark @DataModelSelection or @DataModelSelectionIndex
otherwise.
- public static final String MULTIPLE_DATA_BINDER =
INSTANCE.createSeverityOption("multipleDataBinder"); //$NON-NLS-1$
+ public static final String MULTIPLE_DATA_BINDER =
INSTANCE.createSeverityOption("multipleDataBinder", "ambiguous-data");
//$NON-NLS-1$
// Mark @DataModelSelection or @DataModelSelectionIndex with unknown name. We should
have @DataModel or @Out with the same name.
- public static final String UNKNOWN_DATA_MODEL =
INSTANCE.createSeverityOption("unknownDataModel"); //$NON-NLS-1$
+ public static final String UNKNOWN_DATA_MODEL =
INSTANCE.createSeverityOption("unknownDataModel", "ambiguous-data");
//$NON-NLS-1$
//Context variables
// If factory uses a name of any components (roles) or other factories then mark all
these context variables' names.
- public static final String DUPLICATE_VARIABLE_NAME =
INSTANCE.createSeverityOption("duplicateVariableName"); //$NON-NLS-1$
+ public static final String DUPLICATE_VARIABLE_NAME =
INSTANCE.createSeverityOption("duplicateVariableName",
"duplicated-variable"); //$NON-NLS-1$
// If @In uses a unknown context variable name then mark it.
- public static final String UNKNOWN_VARIABLE_NAME =
INSTANCE.createSeverityOption("unknownVariableName"); //$NON-NLS-1$
+ public static final String UNKNOWN_VARIABLE_NAME =
INSTANCE.createSeverityOption("unknownVariableName",
"unresolved-variable"); //$NON-NLS-1$
//pages.xml
- public static final String UNRESOLVED_VIEW_ID =
INSTANCE.createSeverityOption("unresolvedViewID"); //$NON-NLS-1$
-
+ public static final String UNRESOLVED_VIEW_ID =
INSTANCE.createSeverityOption("unresolvedViewID", "unresolved-view");
//$NON-NLS-1$
+
// Seam project settings
// Mark seam project if it has any invalid seam setting.
@@ -122,6 +124,15 @@
private SeamPreferences() {
}
+ /*
+ * (non-Javadoc)
+ * @see
org.jboss.tools.common.validation.ValidationSeverityPreferences#getWarningGroupID()
+ */
+ @Override
+ public String getWarningGroupID() {
+ return WARNING_GROUP_ID;
+ }
+
/* (non-Javadoc)
* @see
org.jboss.tools.common.preferences.SeverityPreferences#createSeverityOption(java.lang.String)
*/
Added:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamSuppressWarningsMap.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamSuppressWarningsMap.java
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamSuppressWarningsMap.java 2011-12-20
01:41:39 UTC (rev 37444)
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.seam.internal.core.validation;
+
+import org.jboss.tools.common.validation.IWarningNameMap;
+import org.jboss.tools.seam.core.SeamPreferences;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class SeamSuppressWarningsMap implements IWarningNameMap {
+
+ /*
+ * (non-Javadoc)
+ * @see
org.jboss.tools.common.validation.IWarningNameMap#getWarningNames(java.lang.String)
+ */
+ @Override
+ public String[] getWarningNames(String preferenceID) {
+ return SeamPreferences.getInstance().getWarningNames(preferenceID);
+ }
+}
\ No newline at end of file
Property changes on:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamSuppressWarningsMap.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF 2011-12-20 01:36:33
UTC (rev 37443)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF 2011-12-20 01:41:39
UTC (rev 37444)
@@ -41,7 +41,8 @@
org.eclipse.jst.j2ee.web;bundle-version="1.1.500",
org.jboss.tools.common.ui,
org.jboss.tools.common.el.ui,
- org.hibernate.eclipse.libs;bundle-version="3.4.0"
+ org.hibernate.eclipse.libs;bundle-version="3.4.0",
+ org.jboss.tools.common.validation
Bundle-ActivationPolicy: lazy
Export-Package: org.jboss.tools.seam.ui,
org.jboss.tools.seam.ui.actions,
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/META-INF/MANIFEST.MF 2011-12-20 01:36:33
UTC (rev 37443)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/META-INF/MANIFEST.MF 2011-12-20 01:41:39
UTC (rev 37444)
@@ -63,7 +63,8 @@
org.eclipse.ltk.ui.refactoring;bundle-version="3.5.100",
org.jboss.ide.eclipse.as.core,
org.jboss.tools.jsf,
- org.eclipse.jst.j2ee.web;bundle-version="1.1.500"
+ org.eclipse.jst.j2ee.web;bundle-version="1.1.500",
+ org.jboss.tools.common.validation
Export-Package: org.jboss.tools.seam.ui.test,
org.jboss.tools.seam.ui.test.ca,
org.jboss.tools.seam.ui.test.hyperlink,