JBoss Tools SVN: r34025 - branches/jbosstools-3.2.x/documentation/guides/JBDS_Release_Notes/en-US.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2011-08-17 19:50:26 -0400 (Wed, 17 Aug 2011)
New Revision: 34025
Modified:
branches/jbosstools-3.2.x/documentation/guides/JBDS_Release_Notes/en-US/Article_Info.xml
branches/jbosstools-3.2.x/documentation/guides/JBDS_Release_Notes/en-US/Component_Versions.xml
branches/jbosstools-3.2.x/documentation/guides/JBDS_Release_Notes/en-US/Fixed_Issues.xml
Log:
updated for TOOLSDOC-223
Modified: branches/jbosstools-3.2.x/documentation/guides/JBDS_Release_Notes/en-US/Article_Info.xml
===================================================================
--- branches/jbosstools-3.2.x/documentation/guides/JBDS_Release_Notes/en-US/Article_Info.xml 2011-08-17 23:49:39 UTC (rev 34024)
+++ branches/jbosstools-3.2.x/documentation/guides/JBDS_Release_Notes/en-US/Article_Info.xml 2011-08-17 23:50:26 UTC (rev 34025)
@@ -8,7 +8,7 @@
<productname>JBoss Developer Studio</productname>
<productnumber>4.1</productnumber>
<edition>0</edition>
- <pubsnumber>9</pubsnumber>
+ <pubsnumber>10</pubsnumber>
<abstract>
<para>
These release notes contain important information related to the JBoss Developer Studio. New features, known issues, resources, and other current issues are addressed here.
Modified: branches/jbosstools-3.2.x/documentation/guides/JBDS_Release_Notes/en-US/Component_Versions.xml
===================================================================
--- branches/jbosstools-3.2.x/documentation/guides/JBDS_Release_Notes/en-US/Component_Versions.xml 2011-08-17 23:49:39 UTC (rev 34024)
+++ branches/jbosstools-3.2.x/documentation/guides/JBDS_Release_Notes/en-US/Component_Versions.xml 2011-08-17 23:50:26 UTC (rev 34025)
@@ -28,7 +28,7 @@
</note>
<important>
<para>
- The Drools Rule editor has been removed from this release. For further information on why this has occurred, see <ulink url="https://issues.jboss.org/browse/JBIDE-9052">JBIDE-9052</ulink>
+ The Guided Drools Rule editor has been removed from this release. For further information on why this has occurred, see <ulink url="https://issues.jboss.org/browse/JBIDE-9052">JBIDE-9052</ulink>
</para>
</important>
</section>
Modified: branches/jbosstools-3.2.x/documentation/guides/JBDS_Release_Notes/en-US/Fixed_Issues.xml
===================================================================
--- branches/jbosstools-3.2.x/documentation/guides/JBDS_Release_Notes/en-US/Fixed_Issues.xml 2011-08-17 23:49:39 UTC (rev 34024)
+++ branches/jbosstools-3.2.x/documentation/guides/JBDS_Release_Notes/en-US/Fixed_Issues.xml 2011-08-17 23:50:26 UTC (rev 34025)
@@ -24,7 +24,7 @@
<itemizedlist>
<listitem>
<para>
- <ulink url="http://jira.jboss.com/jira/browse/JBIDE-3126">JBIDE-3126</ulink>: Validation for the serializablity of injected beans into passive-scoped beans has been added. This ensures that if a bean belongs to <property>@SessionScoped</property>, <property>@ConversationScope</property> or any <property>@NormalScope(passivating=true)</property> and it is not stateful (<property>@Stateful</property>), the bean is checked to see if it implements <classname>java.io.Serializible</classname>. If it does implement the Serializible class, then it is marked as an error.
+ <ulink url="http://jira.jboss.com/jira/browse/JBIDE-3126">JBIDE-3126</ulink>: Validation for the serializablity of injected beans into passive-scoped beans has been added. This ensures that if a bean belongs to <property>@SessionScoped</property>, <property>@ConversationScope</property> or any <property>@NormalScope(passivating=true)</property> and it is not stateful (<property>@Stateful</property>), the bean is checked to see if it implements <classname>java.io.Serializible</classname>. If it does not implement the Serializible class, then it is marked as an error.
</para>
</listitem>
</itemizedlist>
14 years, 8 months
JBoss Tools SVN: r34024 - in trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi: internal/core/impl and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-08-17 19:49:39 -0400 (Wed, 17 Aug 2011)
New Revision: 34024
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/AnnotationValidationDelegate.java
Log:
JBIDE-6517
https://issues.jboss.org/browse/JBIDE-6517
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java 2011-08-17 23:40:05 UTC (rev 34023)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java 2011-08-17 23:49:39 UTC (rev 34024)
@@ -55,6 +55,7 @@
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.jboss.tools.cdi.internal.core.impl.ClassBean;
+import org.jboss.tools.cdi.internal.core.validation.AnnotationValidationDelegate;
import org.jboss.tools.cdi.internal.core.validation.CDICoreValidator;
import org.jboss.tools.common.EclipseUtil;
import org.jboss.tools.common.java.IAnnotated;
@@ -1058,14 +1059,18 @@
for (Object q: os) {
String s = q.toString();
int i = s.lastIndexOf('.');
- if(i >= 0) s = s.substring(i + 1);
- result.add(s);
+ if(i >= 0 && AnnotationValidationDelegate.ELEMENT_TYPE_TYPE_NAME.equals(s.substring(0, i))) {
+ s = s.substring(i + 1);
+ result.add(s);
+ }
}
} else if(o != null) {
String s = o.toString();
int i = s.lastIndexOf('.');
- if(i >= 0) s = s.substring(i + 1);
- result.add(s);
+ if(i >= 0 && AnnotationValidationDelegate.ELEMENT_TYPE_TYPE_NAME.equals(s.substring(0, i))) {
+ s = s.substring(i + 1);
+ result.add(s);
+ }
}
return result;
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2011-08-17 23:40:05 UTC (rev 34023)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2011-08-17 23:49:39 UTC (rev 34024)
@@ -522,20 +522,7 @@
IMemberValuePair[] ps = d.getMemberValuePairs();
if (ps != null) for (IMemberValuePair p: ps) {
String n = p.getMemberName();
- Object o = p.getValue();
- int k = p.getValueKind();
- if(k == IMemberValuePair.K_QUALIFIED_NAME || k == IMemberValuePair.K_SIMPLE_NAME) {
- String s = o.toString();
- int dot = s.lastIndexOf('.');
- //We reduce value to simple name. That makes it not precise
- //and there must be a test that display limit of this approach.
- if(dot >= 0) {
- String s1 = s.substring(dot + 1);
- if(!"class".equals(s1)) {
- o = s1;
- }
- }
- }
+ Object o = d.getMemberValue(n);
values.put(n, o.toString());
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/AnnotationValidationDelegate.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/AnnotationValidationDelegate.java 2011-08-17 23:40:05 UTC (rev 34023)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/AnnotationValidationDelegate.java 2011-08-17 23:49:39 UTC (rev 34024)
@@ -36,10 +36,11 @@
*/
public class AnnotationValidationDelegate extends CDICoreValidationDelegate {
- static final String TARGET_METHOD = "METHOD";
- static final String TARGET_FIELD = "FIELD";
- static final String TARGET_PARAMETER = "PARAMETER";
- static final String TARGET_TYPE = "TYPE";
+ public static final String ELEMENT_TYPE_TYPE_NAME = "java.lang.annotation.ElementType";
+ public static final String TARGET_METHOD = "METHOD";
+ public static final String TARGET_FIELD = "FIELD";
+ public static final String TARGET_PARAMETER = "PARAMETER";
+ public static final String TARGET_TYPE = "TYPE";
static final String[] TMF = {TARGET_METHOD, TARGET_FIELD, TARGET_TYPE};
static final String[] MF = {TARGET_METHOD, TARGET_FIELD};
@@ -190,16 +191,8 @@
if(retention == null) {
validator.addError(message, CDIPreferences.MISSING_OR_INCORRECT_TARGET_OR_RETENTION_IN_ANNOTATION_TYPE, CDIUtil.convertToSourceReference(type.getSourceType().getNameRange(), resource), resource, message_id);
} else {
- boolean ok = false;
Object o = retention.getMemberValue(null);
- if(o != null) {
- ok = true;
- String s = o.toString();
- int i = s.lastIndexOf('.');
- if(i >= 0) s = s.substring(i + 1);
- if(!"RUNTIME".equals(s)) ok = false;
- }
- if(!ok) {
+ if(o == null || !CDIConstants.RETENTION_POLICY_RUNTIME_TYPE_NAME.equals(o.toString())) {
validator.addError(message, CDIPreferences.MISSING_OR_INCORRECT_TARGET_OR_RETENTION_IN_ANNOTATION_TYPE, retention, resource, message_id);
}
}
14 years, 8 months
JBoss Tools SVN: r34023 - in trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common: util and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-08-17 19:40:05 -0400 (Wed, 17 Aug 2011)
New Revision: 34023
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/impl/AnnotationDeclaration.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/EclipseJavaUtil.java
Log:
JBIDE-6517
https://issues.jboss.org/browse/JBIDE-6517
Modified: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/impl/AnnotationDeclaration.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/impl/AnnotationDeclaration.java 2011-08-17 23:19:12 UTC (rev 34022)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/impl/AnnotationDeclaration.java 2011-08-17 23:40:05 UTC (rev 34023)
@@ -11,14 +11,21 @@
package org.jboss.tools.common.java.impl;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.IAnnotation;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IField;
+import org.eclipse.jdt.core.IImportDeclaration;
+import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IMemberValuePair;
import org.eclipse.jdt.core.IType;
+import org.jboss.tools.common.CommonPlugin;
import org.jboss.tools.common.java.IAnnotationDeclaration;
import org.jboss.tools.common.java.IAnnotationType;
import org.jboss.tools.common.java.IJavaAnnotation;
import org.jboss.tools.common.java.impl.JavaAnnotation;
+import org.jboss.tools.common.util.EclipseJavaUtil;
/**
*
@@ -45,14 +52,14 @@
public IMemberValuePair[] getMemberValuePairs() {
return annotation.getMemberValuePairs();
}
-
+
public Object getMemberValue(String name) {
- if(name == null) name = "value";
+ if(name == null) name = "value"; //$NON-NLS-1$
IMemberValuePair[] pairs = getMemberValuePairs();
if(pairs != null) {
for (IMemberValuePair pair: pairs) {
if(name.equals(pair.getMemberName())) {
- return pair.getValue();
+ return resolveMemberValue(pair);
}
}
}
@@ -89,4 +96,70 @@
}
return null;
}
+
+ public Object resolveMemberValue(IMemberValuePair pair) {
+ Object value = pair.getValue();
+ int k = pair.getValueKind();
+ if(k == IMemberValuePair.K_QUALIFIED_NAME || k == IMemberValuePair.K_SIMPLE_NAME
+ || (value instanceof Object[] && k == IMemberValuePair.K_UNKNOWN)) {
+ IAnnotation a = getJavaAnnotation();
+ if(a != null && a.getAncestor(IJavaElement.COMPILATION_UNIT) instanceof ICompilationUnit) {
+ value = validateNamedValue(value, a);
+ }
+ }
+ return value;
+ }
+
+ private Object validateNamedValue(Object value, IAnnotation a) {
+ if(value instanceof Object[]) {
+ Object[] vs = (Object[])value;
+ for (int i = 0; i < vs.length; i++) {
+ vs[i] = validateNamedValue(vs[i], a);
+ }
+ } else {
+ ICompilationUnit u = (ICompilationUnit)a.getAncestor(IJavaElement.COMPILATION_UNIT);
+ IType type = (IType)a.getAncestor(IJavaElement.TYPE);
+ try {
+ IImportDeclaration[] is = u.getImports();
+ String stringValue = value.toString();
+ int lastDot = stringValue.lastIndexOf('.');
+ String lastToken = stringValue.substring(lastDot + 1);
+ if(lastDot < 0) {
+ IField f = (a.getParent() == type) ? type.getField(lastToken) : EclipseJavaUtil.findField(type, lastToken);
+ if(f != null && f.exists()) {
+ value = f.getDeclaringType().getFullyQualifiedName() + "." + lastToken;
+ } else {
+ String v = getFullName(is, lastToken);
+ if(v != null) {
+ value = v;
+ }
+ }
+ return value;
+ }
+ String prefix = stringValue.substring(0, lastDot);
+ String t = EclipseJavaUtil.resolveType(type, prefix);
+ if(t != null) {
+ IType q = EclipseJavaUtil.findType(type.getJavaProject(), t);
+ if(q != null && q.getField(lastToken).exists()) {
+ value = t + "." + lastToken;
+ }
+ }
+
+ } catch (CoreException e) {
+ CommonPlugin.getDefault().logError(e);
+ }
+ }
+
+ return value;
+ }
+
+ private String getFullName(IImportDeclaration[] is, String name) {
+ for (IImportDeclaration d: is) {
+ String n = d.getElementName();
+ if(n.equals(name) || n.endsWith("." + name)) {
+ return n;
+ }
+ }
+ return null;
+ }
}
\ 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-08-17 23:19:12 UTC (rev 34022)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/EclipseJavaUtil.java 2011-08-17 23:40:05 UTC (rev 34023)
@@ -13,10 +13,13 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jdt.core.IAnnotatable;
import org.eclipse.jdt.core.IAnnotation;
@@ -210,4 +213,46 @@
return null;
}
+ /**
+ * Finds field declared in the given type or its super types.
+ *
+ * @param type
+ * @param name
+ * @return
+ * @throws CoreException
+ */
+ public static IField findField(IType type, String name) throws CoreException {
+ return findField(type, name, new HashSet<IType>());
+ }
+ private static IField findField(IType type, String name, Set<IType> processed) throws CoreException {
+ if(!type.exists() || processed.contains(type)) {
+ return null;
+ }
+ processed.add(type);
+ if(type.getField(name).exists()) {
+ return type.getField(name);
+ }
+ IField f = findField(type, type.getSuperclassName(), name, processed);
+ String[] is = type.getSuperInterfaceNames();
+ for (int i = 0; f == null && i < is.length; i++) {
+ f = findField(type, is[i], name, processed);
+ }
+ if(f == null) {
+ IType d = type.getDeclaringType();
+ if(d != null && d != type && d.exists()) {
+ f = findField(d, name);
+ }
+ }
+
+ return f;
+ }
+ private static IField findField(IType context, String typeName, String fieldName, Set<IType> processed) throws CoreException {
+ typeName = resolveType(context, typeName);
+ if(typeName != null) {
+ IType s = findType(context.getJavaProject(), typeName);
+ return (s != null) ? findField(s, fieldName, processed) : null;
+ }
+ return null;
+ }
+
}
\ No newline at end of file
14 years, 8 months
JBoss Tools SVN: r34022 - trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-08-17 19:19:12 -0400 (Wed, 17 Aug 2011)
New Revision: 34022
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ContextValidationHelper.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELValidationMessages.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/messages.properties
Log:
Externalized message for Illegal Validation State
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ContextValidationHelper.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ContextValidationHelper.java 2011-08-17 22:31:52 UTC (rev 34021)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ContextValidationHelper.java 2011-08-17 23:19:12 UTC (rev 34022)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.jst.web.kb.internal.validation;
+import java.text.MessageFormat;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
@@ -143,7 +144,7 @@
for (IValidator validator : validators) {
IValidatingProjectTree tree = validator.getValidatingProjects(project);
if(tree == null) {
- WebKbPlugin.getDefault().logError(new IllegalStateException("Validator has no tree " + validator + " for project " + getProject() + ". Project exists=" + getProject().exists()));
+ WebKbPlugin.getDefault().logError(new IllegalStateException(MessageFormat.format(ELValidationMessages.ERR_ILLIGAL_VALIDATION_STATE,validator,getProject(),getProject().exists()))); //$NON-NLS-1$
} else {
projects.addAll(tree.getAllProjects());
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELValidationMessages.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELValidationMessages.java 2011-08-17 22:31:52 UTC (rev 34021)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELValidationMessages.java 2011-08-17 23:19:12 UTC (rev 34022)
@@ -15,6 +15,8 @@
public static String EL_VALIDATOR_ERROR_VALIDATING;
public static String EL_VALIDATOR_SETTER;
public static String EL_VALIDATOR_GETTER;
+
+ public static String ERR_ILLIGAL_VALIDATION_STATE;
static {
NLS.initializeMessages(BUNDLE_NAME, ELValidationMessages.class);
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/messages.properties
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/messages.properties 2011-08-17 22:31:52 UTC (rev 34021)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/messages.properties 2011-08-17 23:19:12 UTC (rev 34022)
@@ -20,4 +20,6 @@
EL_VALIDATOR_ERROR_VALIDATING=Error validating EL
EL_VALIDATOR_SETTER=Setter
-EL_VALIDATOR_GETTER=Getter
\ No newline at end of file
+EL_VALIDATOR_GETTER=Getter
+
+ERR_ILLIGAL_VALIDATION_STATE=Validator has no tree "{0}" for project "{1}" Project exists = {2}
14 years, 8 months
JBoss Tools SVN: r34021 - trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-08-17 18:31:52 -0400 (Wed, 17 Aug 2011)
New Revision: 34021
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MarkerResolutionUtils.java
Log:
https://issues.jboss.org/browse/JBIDE-7636
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java 2011-08-17 19:21:27 UTC (rev 34020)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java 2011-08-17 22:31:52 UTC (rev 34021)
@@ -36,13 +36,19 @@
import org.jboss.tools.cdi.core.CDIUtil;
import org.jboss.tools.cdi.core.IBean;
import org.jboss.tools.cdi.core.ICDIProject;
+import org.jboss.tools.cdi.core.IDecorator;
import org.jboss.tools.cdi.core.IInjectionPoint;
+import org.jboss.tools.cdi.core.IInterceptor;
+import org.jboss.tools.cdi.core.IStereotyped;
import org.jboss.tools.cdi.internal.core.impl.CDIProject;
import org.jboss.tools.cdi.internal.core.validation.CDIValidationErrorManager;
import org.jboss.tools.cdi.ui.CDIUIPlugin;
import org.jboss.tools.common.EclipseUtil;
+import org.jboss.tools.common.java.IAnnotated;
+import org.jboss.tools.common.java.IAnnotationDeclaration;
import org.jboss.tools.common.model.util.EclipseJavaUtil;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.text.ITextSourceReference;
/**
* @author Daniel Azarov
@@ -352,10 +358,29 @@
}else if(messageId == CDIValidationErrorManager.INTERCEPTOR_HAS_NAME_ID ||
messageId == CDIValidationErrorManager.DECORATOR_HAS_NAME_ID){
TypeAndAnnotation ta = findTypeAndAnnotation(file, start, CDIConstants.NAMED_QUALIFIER_TYPE_NAME);
- if(ta != null && ta.annotation != null && ta.type != null){
- return new IMarkerResolution[] {
- new DeleteAnnotationMarkerResolution(ta.type, CDIConstants.NAMED_QUALIFIER_TYPE_NAME)
- };
+ if(ta != null && ta.type != null){
+ CDICoreNature cdiNature = CDIUtil.getCDINatureWithProgress(file.getProject());
+ if(cdiNature != null){
+ ICDIProject cdiProject = cdiNature.getDelegate();
+ IType declarationType = findNamedDeclarationType(cdiProject, ta.type, messageId == CDIValidationErrorManager.DECORATOR_HAS_NAME_ID);
+ ArrayList<IMarkerResolution> resolutions = new ArrayList<IMarkerResolution>();
+ if(declarationType != null){
+ IAnnotation annotation = getAnnotation(declarationType, CDIConstants.NAMED_QUALIFIER_TYPE_NAME);
+ if(annotation != null){
+ resolutions.add(new DeleteAnnotationMarkerResolution(declarationType, CDIConstants.NAMED_QUALIFIER_TYPE_NAME));
+ }
+
+ if(!declarationType.equals(ta.type)){
+ annotation = getAnnotation(ta.type, declarationType.getFullyQualifiedName());
+ if(annotation != null){
+ resolutions.add(new DeleteAnnotationMarkerResolution(ta.type, declarationType.getFullyQualifiedName()));
+ }
+ }
+ }
+ if(!resolutions.isEmpty()){
+ return resolutions.toArray(new IMarkerResolution[]{});
+ }
+ }
}
}else if(messageId == CDIValidationErrorManager.STEREOTYPE_IS_ANNOTATED_TYPED_ID){
TypeAndAnnotation ta = findTypeAndAnnotation(file, start, CDIConstants.TYPED_ANNOTATION_TYPE_NAME);
@@ -444,6 +469,51 @@
return new IMarkerResolution[] {};
}
+ private IType findNamedDeclarationType(ICDIProject cdiProject, IType type, boolean isItDecorator){
+ IType declarationType = null;
+ IBean bean = null;
+ IAnnotationDeclaration declaration = null;
+ if(isItDecorator){
+ bean = findDecoratorByType(cdiProject.getDecorators(), type);
+ }else{
+ bean = findInterceptorByType(cdiProject.getInterceptors(), type);
+ }
+ if(bean != null){
+ declaration = findNamedDeclaration(bean);
+ if(declaration != null){
+ declarationType = declaration.getType();
+ }
+ }
+ return declarationType;
+ }
+
+ private IDecorator findDecoratorByType(IDecorator[] decorators, IType type){
+ for(IDecorator decorator : decorators){
+ if(decorator.getBeanClass().equals(type))
+ return decorator;
+ }
+ return null;
+ }
+
+ private IInterceptor findInterceptorByType(IInterceptor[] interceptors, IType type){
+ for(IInterceptor interceptor : interceptors){
+ if(interceptor.getBeanClass().equals(type))
+ return interceptor;
+ }
+ return null;
+ }
+
+ private IAnnotationDeclaration findNamedDeclaration(IStereotyped stereotyped){
+ IAnnotationDeclaration declaration = stereotyped.getAnnotation(CDIConstants.NAMED_QUALIFIER_TYPE_NAME);
+// if (declaration == null) {
+// declaration = stereotyped.getAnnotation(CDIConstants.DECORATOR_STEREOTYPE_TYPE_NAME);
+// }
+ if (declaration == null) {
+ declaration = CDIUtil.getNamedStereotypeDeclaration(stereotyped);
+ }
+ return declaration;
+ }
+
private List<IBean> findLegalBeans(IInjectionPoint injectionPoint){
IBean[] bs = injectionPoint.getCDIProject().getBeans();
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MarkerResolutionUtils.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MarkerResolutionUtils.java 2011-08-17 19:21:27 UTC (rev 34020)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MarkerResolutionUtils.java 2011-08-17 22:31:52 UTC (rev 34021)
@@ -559,7 +559,7 @@
// check and delete import
IImportDeclaration importDeclaration = compilationUnit.getImport(qualifiedName);
IImportContainer importContainer = compilationUnit.getImportContainer();
- if(importDeclaration != null && importContainer != null){
+ if(importDeclaration.exists() && importContainer.exists()){
int importSize = importContainer.getSourceRange().getOffset()+importContainer.getSourceRange().getLength();
String text = buffer.getText(importSize, buffer.getLength()-importSize);
if(checkImport(text, qualifiedName))
14 years, 8 months
JBoss Tools SVN: r34020 - trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-08-17 15:21:27 -0400 (Wed, 17 Aug 2011)
New Revision: 34020
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ContextValidationHelper.java
Log:
replaced NullPointerException with IllegalStateException. Code should never create instances of NullPointerException.
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ContextValidationHelper.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ContextValidationHelper.java 2011-08-17 18:57:39 UTC (rev 34019)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ContextValidationHelper.java 2011-08-17 19:21:27 UTC (rev 34020)
@@ -143,7 +143,7 @@
for (IValidator validator : validators) {
IValidatingProjectTree tree = validator.getValidatingProjects(project);
if(tree == null) {
- WebKbPlugin.getDefault().logError(new NullPointerException("Validator has no tree " + validator + " for project " + getProject() + ". Project exists=" + getProject().exists()));
+ WebKbPlugin.getDefault().logError(new IllegalStateException("Validator has no tree " + validator + " for project " + getProject() + ". Project exists=" + getProject().exists()));
} else {
projects.addAll(tree.getAllProjects());
}
14 years, 8 months
JBoss Tools SVN: r34019 - trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-08-17 14:57:39 -0400 (Wed, 17 Aug 2011)
New Revision: 34019
Modified:
trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util/TestProjectProvider.java
Log:
null check removed, because it is not required for result of getProject(String) method. It always return not null value.
Modified: trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util/TestProjectProvider.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util/TestProjectProvider.java 2011-08-17 18:12:39 UTC (rev 34018)
+++ trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util/TestProjectProvider.java 2011-08-17 18:57:39 UTC (rev 34019)
@@ -53,7 +53,7 @@
public TestProjectProvider(String bundleName, String projectPath, String name, boolean makeCopy) throws CoreException {
try {
project = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
- if(project==null || !project.isAccessible()) {
+ if(!project.isAccessible()) {
if( null == projectPath ) {
project = ResourcesUtils.importProject(bundleName, "projects" + Path.SEPARATOR + name, null);
} else {
14 years, 8 months
JBoss Tools SVN: r34018 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-08-17 14:12:39 -0400 (Wed, 17 Aug 2011)
New Revision: 34018
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
Log:
not needed checks for null related to IResource handlers were removed.
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-08-17 17:56:31 UTC (rev 34017)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-08-17 18:12:39 UTC (rev 34018)
@@ -177,8 +177,7 @@
*/
public boolean shouldValidate(IProject project) {
try {
- return project != null
- && project.isAccessible()
+ return project.isAccessible()
&& project.hasNature(CDICoreNature.NATURE_ID)
&& validateBuilderOrder(project)
&& isEnabled(project);
@@ -238,7 +237,7 @@
if(dd != null) {
for (IPath p: dd) {
IFile f = root.getFile(p);
- if(f != null && f.exists() && !changedFiles.contains(f)) {
+ if(f.exists() && !changedFiles.contains(f)) {
resources.add(p);
collectAllRelatedInjections(f, resources);
}
@@ -292,9 +291,9 @@
Set<IFile> filesToValidate = new HashSet<IFile>();
for (IPath linkedResource : resources) {
IFile file = root.getFile(linkedResource);
- if(file!=null && file.isAccessible()) {
+ if(file.isAccessible()) {
IProject pr = file.getProject();
- if(pr!=null && !validationHelper.getValidationContextManager().projectHasBeenValidated(this, pr)) {
+ if(!validationHelper.getValidationContextManager().projectHasBeenValidated(this, pr)) {
filesToValidate.add(file);
// removeAllMessagesFromResource(file);
}
@@ -327,9 +326,6 @@
public IStatus validateAll(IProject project, ContextValidationHelper validationHelper, IProjectValidationContext context, ValidatorManager manager, IReporter reporter)
throws ValidationException {
init(project, validationHelper, context, manager, reporter);
- if (cdiProject == null) {
- return OK_STATUS;
- }
displaySubtask(CDIValidationMessages.VALIDATING_PROJECT, new String[] { projectName });
@@ -409,7 +405,7 @@
* @param file
*/
private void validateResource(IFile file) {
- if (reporter.isCancelled() || file == null || !file.isAccessible()) {
+ if (reporter.isCancelled() || !file.isAccessible()) {
return;
}
displaySubtask(CDIValidationMessages.VALIDATING_RESOURCE, new String[] {file.getProject().getName(), file.getName()});
14 years, 8 months
JBoss Tools SVN: r34017 - in trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test: fix and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-08-17 13:56:31 -0400 (Wed, 17 Aug 2011)
New Revision: 34017
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/editor/BeansEditorTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/fix/CDIQuickFixTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/CdiATWizardTest.java
Log:
Refactoring after renaming org.jboss.tools.ui.bot.ext.config.Annotations.SWTBotTestRequires to org.jboss.tools.ui.bot.ext.config.Annotations.Require to fix compilation errors
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/editor/BeansEditorTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/editor/BeansEditorTest.java 2011-08-17 17:42:19 UTC (rev 34016)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/editor/BeansEditorTest.java 2011-08-17 17:56:31 UTC (rev 34017)
@@ -32,7 +32,7 @@
import org.jboss.tools.cdi.bot.test.uiutils.editor.BeansEditor.Item;
import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
import org.jboss.tools.ui.bot.ext.SWTTestExt;
-import org.jboss.tools.ui.bot.ext.config.Annotations.SWTBotTestRequires;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
import org.jboss.tools.ui.bot.ext.view.ProjectExplorer;
@@ -50,7 +50,7 @@
/**
* @author Lukas Jungmann
*/
-@SWTBotTestRequires(clearProjects = false, perspective = "Java EE", server = @Server(state = ServerState.NotRunning, version = "6.0", operator = ">="))
+@Require(clearProjects = false, perspective = "Java EE", server = @Server(state = ServerState.NotRunning, version = "6.0", operator = ">="))
@RunWith(RequirementAwareSuite.class)
@SuiteClasses({ BeansEditorTest.class })
public class BeansEditorTest extends SWTTestExt {
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/fix/CDIQuickFixTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/fix/CDIQuickFixTest.java 2011-08-17 17:42:19 UTC (rev 34016)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/fix/CDIQuickFixTest.java 2011-08-17 17:56:31 UTC (rev 34017)
@@ -15,7 +15,7 @@
import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
import org.jboss.tools.ui.bot.ext.SWTTestExt;
import org.jboss.tools.ui.bot.ext.Timing;
-import org.jboss.tools.ui.bot.ext.config.Annotations.SWTBotTestRequires;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
import org.jboss.tools.ui.bot.ext.entity.JavaClassEntity;
@@ -33,7 +33,7 @@
* @author Jaroslav Jankovic
*/
-@SWTBotTestRequires(perspective = "Java EE", server = @Server(state = ServerState.NotRunning, version = "6.0", operator = ">="))
+@Require(perspective = "Java EE", server = @Server(state = ServerState.NotRunning, version = "6.0", operator = ">="))
@RunWith(RequirementAwareSuite.class)
@SuiteClasses({ CDIAllBotTests.class })
public class CDIQuickFixTest extends SWTTestExt {
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/CdiATWizardTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/CdiATWizardTest.java 2011-08-17 17:42:19 UTC (rev 34016)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/CdiATWizardTest.java 2011-08-17 17:56:31 UTC (rev 34017)
@@ -26,7 +26,7 @@
import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
import org.jboss.tools.ui.bot.ext.SWTTestExt;
-import org.jboss.tools.ui.bot.ext.config.Annotations.SWTBotTestRequires;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
import org.jboss.tools.ui.bot.ext.types.ViewType;
@@ -35,7 +35,7 @@
import org.junit.runner.RunWith;
import org.junit.runners.Suite.SuiteClasses;
-@SWTBotTestRequires(perspective = "Java EE", server = @Server(state = ServerState.NotRunning, version = "6.0", operator = ">="))
+@Require(perspective = "Java EE", server = @Server(state = ServerState.NotRunning, version = "6.0", operator = ">="))
@RunWith(RequirementAwareSuite.class)
@SuiteClasses({ CdiATWizardTest.class })
public class CdiATWizardTest extends SWTTestExt {
14 years, 8 months
JBoss Tools SVN: r34016 - trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2011-08-17 13:42:19 -0400 (Wed, 17 Aug 2011)
New Revision: 34016
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/AddRemoveJSFCapabilitiesTest.java
Log:
Do not use deprecated method SWTJBTExt.isJBDSRun(SWTBot bot)
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/AddRemoveJSFCapabilitiesTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/AddRemoveJSFCapabilitiesTest.java 2011-08-17 17:39:20 UTC (rev 34015)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/AddRemoveJSFCapabilitiesTest.java 2011-08-17 17:42:19 UTC (rev 34016)
@@ -42,7 +42,7 @@
swtUtilExt = new SWTUtilExt(bot);
}
public void testAddRemoveJSFCapabilities() {
- boolean jbdsIsRunning = SWTJBTExt.isJBDSRun(bot);
+ boolean jbdsIsRunning = SWTJBTExt.isJBDSRun();
removeJSFCapabilities(jbdsIsRunning);
addJSFCapabilities();
// Test add/remove JSF capabilities after project is closed and reopened
14 years, 8 months