JBoss Tools SVN: r20568 - in trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi: internal/core/impl and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-03-02 10:51:50 -0500 (Tue, 02 Mar 2010)
New Revision: 20568
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBean.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBeanManager.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AbstractBeanElement.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIAnnotationElement.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5972
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBean.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBean.java 2010-03-02 15:34:47 UTC (rev 20567)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBean.java 2010-03-02 15:51:50 UTC (rev 20568)
@@ -94,7 +94,7 @@
*
* @return the qualifiers
*/
- Set<IType> getQualifiers();
+ Set<IQualifier> getQualifiers();
/**
* Obtains the stereotype declarations of the bean class or producer method
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBeanManager.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBeanManager.java 2010-03-02 15:34:47 UTC (rev 20567)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBeanManager.java 2010-03-02 15:51:50 UTC (rev 20568)
@@ -172,7 +172,7 @@
* @return interceptor binding model element for fully qualified name of
* interceptor binding annotation type
*/
- InterceptorBindingElement getInterceptorBinding(String qualifiedName);
+ IInterceptorBinding getInterceptorBinding(String qualifiedName);
/**
* Returns qualifier model element for fully qualified name
@@ -181,7 +181,7 @@
* @return Returns qualifier model element for fully qualified name
* of qualifier annotation type
*/
- QualifierElement getQualifier(String qualifiedName);
+ IQualifier getQualifier(String qualifiedName);
/**
* Returns scope model element for fully qualified name of scope annotation
@@ -191,7 +191,7 @@
* @return the scope model element for fully qualified name of scope
* annotation type
*/
- ScopeElement getScope(String qualifiedName);
+ IScope getScope(String qualifiedName);
/**
* Returns the set of observers for an event which is injected by given
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AbstractBeanElement.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AbstractBeanElement.java 2010-03-02 15:34:47 UTC (rev 20567)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AbstractBeanElement.java 2010-03-02 15:51:50 UTC (rev 20568)
@@ -23,9 +23,14 @@
import org.eclipse.jdt.core.ISourceRange;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
+import org.jboss.tools.cdi.core.CDIConstants;
import org.jboss.tools.cdi.core.CDICoreNature;
import org.jboss.tools.cdi.core.CDICorePlugin;
import org.jboss.tools.cdi.core.IAnnotationDeclaration;
+import org.jboss.tools.cdi.core.IBean;
+import org.jboss.tools.cdi.core.IInjectionPoint;
+import org.jboss.tools.cdi.core.IQualifier;
+import org.jboss.tools.cdi.core.IQualifierDeclaration;
import org.jboss.tools.cdi.core.IScopeDeclaration;
import org.jboss.tools.cdi.core.IStereotype;
import org.jboss.tools.cdi.core.IStereotypeDeclaration;
@@ -100,9 +105,31 @@
return result;
}
- public Set<IType> getQualifiers() {
- Set<IType> result = new HashSet<IType>();
- // TODO
+ public Set<IQualifier> getQualifiers() {
+ IQualifier any = getCDIProject().getQualifier(CDIConstants.ANY_QUALIFIER_TYPE_NAME);
+ IQualifier def = getCDIProject().getQualifier(CDIConstants.DEFAULT_QUALIFIER_TYPE_NAME);
+ IQualifier name = getCDIProject().getQualifier(CDIConstants.NAMED_QUALIFIER_TYPE_NAME);
+
+ Set<IQualifier> result = new HashSet<IQualifier>();
+ Set<IAnnotationDeclaration> ds = getQualifierDeclarations();
+ for (IAnnotationDeclaration d: ds) {
+ if(d instanceof IQualifierDeclaration) {
+ IQualifier q = ((IQualifierDeclaration)d).getQualifier();
+ if(q != null) result.add(q);
+ }
+ }
+ if(this instanceof IInjectionPoint) {
+ if(def != null && result.isEmpty()) {
+ result.add(def);
+ }
+ } else if(this instanceof IBean) {
+ if(def != null) {
+ if(result.isEmpty() || (name != null && result.size() == 1 && result.contains(name))) {
+ result.add(def);
+ }
+ }
+ if(any != null) result.add(any);
+ }
return result;
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIAnnotationElement.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIAnnotationElement.java 2010-03-02 15:34:47 UTC (rev 20567)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIAnnotationElement.java 2010-03-02 15:51:50 UTC (rev 20568)
@@ -65,4 +65,10 @@
public IAnnotationDeclaration getAnnotationDeclaration(String typeName) {
return definition.getAnnotation(typeName);
}
+
+ public String toString() {
+ String type = getSourceType() == null ? "" : getSourceType().getFullyQualifiedName();
+ return super.toString() + " type=" + type;
+ }
+
}
\ No newline at end of file
14 years, 10 months
JBoss Tools SVN: r20567 - in trunk/cdi/tests/org.jboss.tools.cdi.core.test: src/org/jboss/tools/cdi/core/test/tck and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-03-02 10:34:47 -0500 (Tue, 02 Mar 2010)
New Revision: 20567
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/META-INF/MANIFEST.MF
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DefinitionTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5808
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/META-INF/MANIFEST.MF 2010-03-02 14:27:15 UTC (rev 20566)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/META-INF/MANIFEST.MF 2010-03-02 15:34:47 UTC (rev 20567)
@@ -12,6 +12,7 @@
org.jboss.tools.cdi.core,
org.jboss.tools.common,
org.eclipse.ui,
- org.eclipse.jdt.core
+ org.eclipse.jdt.core,
+ org.jboss.tools.common.el.core
Export-Package: org.jboss.tools.cdi.core.test,
org.jboss.tools.cdi.core.test.tck
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DefinitionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DefinitionTest.java 2010-03-02 14:27:15 UTC (rev 20566)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DefinitionTest.java 2010-03-02 15:34:47 UTC (rev 20567)
@@ -14,6 +14,7 @@
import org.eclipse.core.resources.IFile;
import org.jboss.tools.cdi.core.IBean;
+import org.jboss.tools.cdi.core.IScope;
import org.jboss.tools.cdi.core.ITypeDeclaration;
import org.jboss.tools.common.text.ITextSourceReference;
@@ -35,7 +36,6 @@
assertTrue("No legal types were found for org.jboss.jsr299.tck.tests.definition.bean.RedSnapper bean.", bean.getLegalTypes().size() > 0);
Set<ITypeDeclaration> declarations = bean.getAllTypeDeclarations();
assertEquals("There should be two type declarations in org.jboss.jsr299.tck.tests.definition.bean.RedSnapper bean.", declarations.size(), 2);
- // TODO use correct start position instead of 0.
assertLocationEquals(declarations, 936, 10);
assertLocationEquals(declarations, 958, 6);
}
@@ -49,6 +49,19 @@
assertTrue("No qualifiers were found for org.jboss.jsr299.tck.tests.definition.bean.RedSnapper bean.", beans.iterator().next().getQualifiers().size() > 0);
}
+ /**
+ * c) A bean comprises of a scope.
+ */
+ public void testHasScopeType() {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/bean/RedSnapper.java");
+ Set<IBean> beans = cdiProject.getBeans(file.getFullPath());
+ IBean bean = beans.iterator().next();
+ IScope scope = bean.getScope();
+ assertNotNull("org.jboss.jsr299.tck.tests.definition.bean.RedSnapper bean desn't have a scope.", scope);
+ assertNotNull("Scope of org.jboss.jsr299.tck.tests.definition.bean.RedSnapper bean doesn't have a link to IType.", scope.getSourceType());
+ assertEquals("Wrong scope type for org.jboss.jsr299.tck.tests.definition.bean.RedSnapper bean.", "javax.enterprise.context.RequestScoped", scope.getSourceType().getFullyQualifiedName());
+ }
+
private void assertLocationEquals(Set<? extends ITextSourceReference> references, int startPosition, int length) {
for (ITextSourceReference reference : references) {
if(reference.getStartPosition()==startPosition) {
14 years, 10 months
JBoss Tools SVN: r20566 - branches/jbosstools-3.1.x/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-03-02 09:27:15 -0500 (Tue, 02 Mar 2010)
New Revision: 20566
Modified:
branches/jbosstools-3.1.x/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossClassPathCommand.java
Log:
JBIDE-5958 3.1.x branch
Modified: branches/jbosstools-3.1.x/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossClassPathCommand.java
===================================================================
--- branches/jbosstools-3.1.x/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossClassPathCommand.java 2010-03-02 14:23:30 UTC (rev 20565)
+++ branches/jbosstools-3.1.x/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossClassPathCommand.java 2010-03-02 14:27:15 UTC (rev 20566)
@@ -77,7 +77,7 @@
IJBossESBFacetDataModelProperties.PERSISTENCE_PROPERTY_RNTIME_LOCATION,
runtimeLocation);
project.setPersistentProperty(IJBossESBFacetDataModelProperties.QNAME_ESB_CONTENT_FOLDER, esbcontentFolder);
- esbContainerPath = new Path(JBossRuntimeClassPathInitializer.JBOSS_ESB_RUNTIME_CLASSPATH_SERVER_SUPPLIED)
+ esbContainerPath = new Path(JBossRuntimeClassPathInitializer.JBOSS_ESB_RUNTIME_CLASSPATH_CONTAINER_ID)
.append(runtimeName );
}
@@ -152,4 +152,4 @@
return status;
}
-}
\ No newline at end of file
+}
14 years, 10 months
JBoss Tools SVN: r20565 - trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-03-02 09:23:30 -0500 (Tue, 02 Mar 2010)
New Revision: 20565
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DefinitionTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5973
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DefinitionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DefinitionTest.java 2010-03-02 14:21:14 UTC (rev 20564)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DefinitionTest.java 2010-03-02 14:23:30 UTC (rev 20565)
@@ -36,8 +36,8 @@
Set<ITypeDeclaration> declarations = bean.getAllTypeDeclarations();
assertEquals("There should be two type declarations in org.jboss.jsr299.tck.tests.definition.bean.RedSnapper bean.", declarations.size(), 2);
// TODO use correct start position instead of 0.
- assertLocationEquals(declarations, 0, 10);
- assertLocationEquals(declarations, 0, 6);
+ assertLocationEquals(declarations, 936, 10);
+ assertLocationEquals(declarations, 958, 6);
}
/**
14 years, 10 months
JBoss Tools SVN: r20564 - in trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl: definition and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-03-02 09:21:14 -0500 (Tue, 02 Mar 2010)
New Revision: 20564
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanMember.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ParametedType.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerField.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerMethod.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/TypeDeclaration.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractTypeDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/ParametedTypeFactory.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5973
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanMember.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanMember.java 2010-03-02 14:19:54 UTC (rev 20563)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanMember.java 2010-03-02 14:21:14 UTC (rev 20564)
@@ -14,16 +14,12 @@
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.ISourceRange;
-import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.jboss.tools.cdi.core.CDICorePlugin;
import org.jboss.tools.cdi.core.IBeanMember;
import org.jboss.tools.cdi.core.IClassBean;
import org.jboss.tools.cdi.core.IParametedType;
-import org.jboss.tools.cdi.core.ITypeDeclaration;
import org.jboss.tools.cdi.internal.core.impl.definition.BeanMemberDefinition;
-import org.jboss.tools.cdi.internal.core.impl.definition.ParametedTypeFactory;
-import org.jboss.tools.common.model.util.EclipseJavaUtil;
/**
*
@@ -47,7 +43,34 @@
if(returnType != null) {
ParametedType p = getCDIProject().getNature().getTypeFactory().getParametedType(member.getDeclaringType(), returnType);
if(p != null) {
- typeDeclaration = new TypeDeclaration(p, -1, 0);
+
+ int offset = -1;
+ int length = 0;
+ String content = getDefinition().getTypeDefinition().getContent();
+ if(content != null) {
+ ISourceRange sr = member.getSourceRange();
+ ISourceRange nr = member.getNameRange();
+ if(sr != null && nr != null && sr.getOffset() < nr.getOffset() && nr.getOffset() < content.length()) {
+ String start = content.substring(sr.getOffset(), nr.getOffset());
+ int off = -1;
+ int off0 = -1;
+ for (int i = start.length() - 1; i >= 0; i--) {
+ char ch = start.charAt(i);
+ if(Character.isWhitespace(ch)) {
+ if(off >= 0) break;
+ } else if(Character.isJavaIdentifierPart(ch) || ch == '.' || ch == '$' || ch == '<' || ch == '>') {
+ off = i;
+ if(off0 < 0) off0 = i + 1;
+ }
+ }
+ if(off >= 0) {
+ offset = sr.getOffset() + off;
+ length = off0 - off;
+ }
+ }
+ }
+
+ typeDeclaration = new TypeDeclaration(p, offset, length);
}
}
} catch (JavaModelException e) {
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java 2010-03-02 14:19:54 UTC (rev 20563)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java 2010-03-02 14:21:14 UTC (rev 20564)
@@ -198,8 +198,16 @@
Set<IParametedType> ps = getDefinition().getInheritedTypes();
Set<ITypeDeclaration> result = new HashSet<ITypeDeclaration>();
for (IParametedType p: ps) {
- result.add(new TypeDeclaration((ParametedType)p, -1, 0));
+ if(p instanceof TypeDeclaration) {
+ result.add((TypeDeclaration)p);
+ }
}
+ IParametedType p = getDefinition().getParametedType();
+ if(p != null) {
+ if(p instanceof TypeDeclaration) {
+ result.add((TypeDeclaration)p);
+ }
+ }
return result;
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ParametedType.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ParametedType.java 2010-03-02 14:19:54 UTC (rev 20563)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ParametedType.java 2010-03-02 14:21:14 UTC (rev 20564)
@@ -16,6 +16,7 @@
import java.util.Set;
import java.util.StringTokenizer;
+import org.eclipse.jdt.core.ISourceRange;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.ITypeParameter;
import org.eclipse.jdt.core.JavaModelException;
@@ -31,6 +32,7 @@
public class ParametedType implements IParametedType {
protected ParametedTypeFactory typeFactory = null;
protected IType type;
+ protected String arrayPrefix = "";
protected String signature;
protected List<ParametedType> parameterTypes = new ArrayList<ParametedType>();
@@ -39,6 +41,12 @@
protected Set<IParametedType> inheritedTypes = new HashSet<IParametedType>();
Set<IParametedType> allInheritedTypes = null;
+ public static interface PositionProvider {
+ ISourceRange getRange(String superTypeName);
+ }
+
+ PositionProvider provider = null;
+
public ParametedType() {}
public ParametedTypeFactory getFactory() {
@@ -53,6 +61,10 @@
return type;
}
+ public String getArrayPrefix() {
+ return arrayPrefix;
+ }
+
public String getSignature() {
return signature;
}
@@ -63,12 +75,21 @@
public void setSignature(String signature) {
this.signature = signature;
+ if(signature != null) {
+ for (int i = 0; i < signature.length(); i++) {
+ if(signature.charAt(i) == '[') arrayPrefix += "["; else break;
+ }
+ }
}
public void addParameter(ParametedType p) {
parameterTypes.add(p);
}
+ public void setPositionProvider(PositionProvider p) {
+ provider = p;
+ }
+
public boolean equals(Object object) {
if(!(object instanceof ParametedType)) return false;
ParametedType other = (ParametedType)object;
@@ -85,21 +106,46 @@
try {
if(!type.isInterface() && !type.isAnnotation()) {
String sc = type.getSuperclassTypeSignature();
+ boolean objectArray = false;
if(sc != null) {
sc = resolveParameters(sc);
} else if(!"java.lang.Object".equals(type.getFullyQualifiedName())) {
sc = "QObject;";
+ } else if("java.lang.Object".equals(type.getFullyQualifiedName()) && arrayPrefix.length() > 0) {
+ objectArray = true;
+ sc = "QObject;";
}
+ if(!objectArray && arrayPrefix.length() > 0) {
+ sc = arrayPrefix + sc;
+ }
+
superType = getFactory().getParametedType(type, sc);
if(superType != null) {
+ if(provider != null) {
+ String scn = type.getSuperclassName();
+ if(scn != null && provider.getRange(scn) != null) {
+ ISourceRange r = provider.getRange(scn);
+ superType = new TypeDeclaration(superType, r.getOffset(), r.getLength());
+ }
+
+ }
inheritedTypes.add(superType);
}
}
String[] is = type.getSuperInterfaceTypeSignatures();
if(is != null) for (int i = 0; i < is.length; i++) {
String p = resolveParameters(is[i]);
+ if(arrayPrefix.length() > 0) p = arrayPrefix + p;
ParametedType t = getFactory().getParametedType(type, p);
if(t != null) {
+ if(provider != null) {
+ String scn = type.getSuperInterfaceNames()[i];
+ if(scn != null && provider.getRange(scn) != null) {
+ ISourceRange r = provider.getRange(scn);
+ t = new TypeDeclaration(t, r.getOffset(), r.getLength());
+ }
+
+ }
inheritedTypes.add(t);
}
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerField.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerField.java 2010-03-02 14:19:54 UTC (rev 20563)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerField.java 2010-03-02 14:21:14 UTC (rev 20564)
@@ -43,7 +43,7 @@
public Set<ITypeDeclaration> getAllTypeDeclarations() {
Set<ITypeDeclaration> result = new HashSet<ITypeDeclaration>();
- if(typeDeclaration != null) {
+ if(typeDeclaration != null && typeDeclaration.getStartPosition() > 0) {
result.add(typeDeclaration);
}
return result;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerMethod.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerMethod.java 2010-03-02 14:19:54 UTC (rev 20563)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerMethod.java 2010-03-02 14:21:14 UTC (rev 20564)
@@ -52,7 +52,7 @@
public Set<ITypeDeclaration> getAllTypeDeclarations() {
Set<ITypeDeclaration> result = new HashSet<ITypeDeclaration>();
- if(typeDeclaration != null) {
+ if(typeDeclaration != null && typeDeclaration.getStartPosition() > 0) {
result.add(typeDeclaration);
}
return result;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/TypeDeclaration.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/TypeDeclaration.java 2010-03-02 14:19:54 UTC (rev 20563)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/TypeDeclaration.java 2010-03-02 14:21:14 UTC (rev 20564)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.tools.cdi.internal.core.impl;
-import org.eclipse.jdt.core.IType;
import org.jboss.tools.cdi.core.ITypeDeclaration;
/**
@@ -22,13 +21,20 @@
int length;
int startPosition;
- TypeDeclaration(ParametedType type, int startPosition, int length) {
+ public TypeDeclaration(ParametedType type, int startPosition, int length) {
this.setFactory(type.getFactory());
this.type = type.getType();
+ arrayPrefix = type.arrayPrefix;
this.length = length;
this.startPosition = startPosition;
- this.signature = type.signature;
- this.parameterTypes = type.parameterTypes;
+
+ signature = type.signature;
+ parameterTypes = type.parameterTypes;
+
+ allInheritedTypes = type.allInheritedTypes;
+ inheritanceIsBuilt = type.inheritanceIsBuilt;
+ inheritedTypes = type.inheritedTypes;
+ superType = type.superType;
}
public int getLength() {
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractTypeDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractTypeDefinition.java 2010-03-02 14:19:54 UTC (rev 20563)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractTypeDefinition.java 2010-03-02 14:21:14 UTC (rev 20564)
@@ -10,15 +10,20 @@
******************************************************************************/
package org.jboss.tools.cdi.internal.core.impl.definition;
+import java.util.HashMap;
import java.util.HashSet;
+import java.util.Map;
import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.ISourceRange;
import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.internal.core.SourceRange;
import org.jboss.tools.cdi.core.IParametedType;
import org.jboss.tools.cdi.internal.core.impl.CDIProject;
import org.jboss.tools.cdi.internal.core.impl.ParametedType;
+import org.jboss.tools.cdi.internal.core.impl.TypeDeclaration;
import org.jboss.tools.common.util.FileUtil;
/**
@@ -57,11 +62,25 @@
super.init(contextType, context);
qualifiedName = getType().getFullyQualifiedName();
parametedType = new ParametedType();
+ if(type != null && !type.isBinary()) {
+ ISourceRange r = type.getNameRange();
+ if(r != null) {
+ parametedType = new TypeDeclaration(parametedType, r.getOffset(), r.getLength());
+ }
+ }
parametedType.setFactory(context.getProject().getDelegate().getNature().getTypeFactory());
parametedType.setType(this.type);
parametedType.setSignature("Q" + qualifiedName + ";");
+ if(type != null && !type.isBinary()) {
+ parametedType.setPositionProvider(new PositionProviderImpl());
+ parametedType.getInheritedTypes();
+ }
}
+ public IParametedType getParametedType() {
+ return parametedType;
+ }
+
public Set<IParametedType> getInheritedTypes() {
return parametedType == null ? new HashSet<IParametedType>() : parametedType.getInheritedTypes();
}
@@ -77,5 +96,46 @@
}
return content;
}
+
+ class PositionProviderImpl implements ParametedType.PositionProvider {
+ Map<String, ISourceRange> map = null;
+ void init() throws CoreException {
+ map = new HashMap<String, ISourceRange>();
+ getContent();
+ if(content == null) return;
+
+ ISourceRange r = type.getNameRange();
+ if(r == null) return;
+ int b = r.getOffset() + r.getLength();
+ int e = content.indexOf('{', b);
+ if(e < 0) e = content.length();
+ String sup = content.substring(b, e);
+ String sc = type.getSuperclassName();
+ if(sc != null) checkRange(b, sup, sc);
+ String[] is = type.getSuperInterfaceNames();
+ if(is != null) for (int i = 0; i < is.length; i++) checkRange(b, sup, is[i]);
+ }
+
+ void checkRange(int offset, String sup, String sc) {
+ int k = sup.indexOf(sc);
+ if(k >= 0) {
+ map.put(sc, new SourceRange(offset + k, sc.length()));
+ }
+ }
+
+ public ISourceRange getRange(String superTypeName) {
+ if(map == null) {
+ try {
+ init();
+ } catch (CoreException e) {
+ //ignore
+ }
+ }
+
+ return map.get(superTypeName);
+ }
+
+ }
+
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/ParametedTypeFactory.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/ParametedTypeFactory.java 2010-03-02 14:19:54 UTC (rev 20563)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/ParametedTypeFactory.java 2010-03-02 14:21:14 UTC (rev 20564)
@@ -19,11 +19,16 @@
ParametedType result = new ParametedType();
result.setFactory(this);
result.setSignature(typeSignature);
+
+ typeSignature = typeSignature.substring(result.getArrayPrefix().length());
+
int startToken = typeSignature.indexOf('<');
if(startToken < 0) {
String resovedTypeName = EclipseJavaUtil.resolveTypeAsString(context, typeSignature);
if(resovedTypeName == null) return null;
- result.setSignature("Q" + resovedTypeName + ";");
+ if(!context.isBinary()) {
+ result.setSignature(result.getArrayPrefix() + "Q" + resovedTypeName + ";");
+ }
IType type = EclipseJavaUtil.findType(context.getJavaProject(), resovedTypeName);
if(type != null) {
result.setType(type);
@@ -53,7 +58,9 @@
if(newParams.length() > 0) newParams.append(',');
newParams.append(param.getSignature());
}
- result.setSignature("Q" + resovedTypeName + '<' + newParams + '>' + ';');
+ if(!context.isBinary()) {
+ result.setSignature(result.getArrayPrefix() + "Q" + resovedTypeName + '<' + newParams + '>' + ';');
+ }
cache.put(key, result);
return result;
}
14 years, 10 months
JBoss Tools SVN: r20563 - trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-03-02 09:19:54 -0500 (Tue, 02 Mar 2010)
New Revision: 20563
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossClassPathCommand.java
Log:
JBIDE-5958 trunk
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossClassPathCommand.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossClassPathCommand.java 2010-03-02 14:07:09 UTC (rev 20562)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossClassPathCommand.java 2010-03-02 14:19:54 UTC (rev 20563)
@@ -77,7 +77,7 @@
IJBossESBFacetDataModelProperties.PERSISTENCE_PROPERTY_RNTIME_LOCATION,
runtimeLocation);
project.setPersistentProperty(IJBossESBFacetDataModelProperties.QNAME_ESB_CONTENT_FOLDER, esbcontentFolder);
- esbContainerPath = new Path(JBossRuntimeClassPathInitializer.JBOSS_ESB_RUNTIME_CLASSPATH_SERVER_SUPPLIED)
+ esbContainerPath = new Path(JBossRuntimeClassPathInitializer.JBOSS_ESB_RUNTIME_CLASSPATH_CONTAINER_ID)
.append(runtimeName );
}
14 years, 10 months
JBoss Tools SVN: r20562 - branches/jbosstools-3.1.x/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2010-03-02 09:07:09 -0500 (Tue, 02 Mar 2010)
New Revision: 20562
Modified:
branches/jbosstools-3.1.x/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.project
Log:
JBIDE-5879: org.jboss.tools.common.text.ext.test.CommonExtAllTests still churning after 5 hours
Test project settings are fixed
Modified: branches/jbosstools-3.1.x/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.project
===================================================================
--- branches/jbosstools-3.1.x/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.project 2010-03-02 14:02:41 UTC (rev 20561)
+++ branches/jbosstools-3.1.x/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.project 2010-03-02 14:07:09 UTC (rev 20562)
@@ -15,6 +15,11 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.jboss.tools.jst.web.kb.kbbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
@@ -22,5 +27,6 @@
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.jboss.tools.jsf.jsfnature</nature>
+ <nature>org.jboss.tools.jst.web.kb.kbnature</nature>
</natures>
</projectDescription>
14 years, 10 months
JBoss Tools SVN: r20561 - trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2010-03-02 09:02:41 -0500 (Tue, 02 Mar 2010)
New Revision: 20561
Modified:
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.project
Log:
JBIDE-5879: org.jboss.tools.common.text.ext.test.CommonExtAllTests still churning after 5 hours
Test project settings are fixed
Modified: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.project
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.project 2010-03-02 13:40:28 UTC (rev 20560)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.project 2010-03-02 14:02:41 UTC (rev 20561)
@@ -15,6 +15,11 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.jboss.tools.jst.web.kb.kbbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
@@ -22,5 +27,6 @@
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.jboss.tools.jsf.jsfnature</nature>
+ <nature>org.jboss.tools.jst.web.kb.kbnature</nature>
</natures>
</projectDescription>
14 years, 10 months
JBoss Tools SVN: r20560 - branches/jbosstools-3.1.x/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2010-03-02 08:40:28 -0500 (Tue, 02 Mar 2010)
New Revision: 20560
Modified:
branches/jbosstools-3.1.x/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java
Log:
JBIDE-5947 FAILED: CommonExtAllTests
The output format for Assert is updated to be more helpful.
Modified: branches/jbosstools-3.1.x/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java
===================================================================
--- branches/jbosstools-3.1.x/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java 2010-03-02 13:15:23 UTC (rev 20559)
+++ branches/jbosstools-3.1.x/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java 2010-03-02 13:40:28 UTC (rev 20560)
@@ -544,8 +544,9 @@
links[0].open();
JobUtils.waitForIdle();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- assertTrue("java.lang.String declaration should be opened",
- editor.getTitle().startsWith("String."));
+ String title = editor.getTitle();
+ assertTrue("java.lang.String declaration should be opened, but \'" + title + "\' is actially openned in active editor",
+ title.startsWith("String."));
}
public static final String XHTML_STYLE_CLASS_NAME_TEST_FILE = OPENON_TEST_PROJECT + "/WebContent/xhtmlStyleClassHiperlinkTests.xhtml";
14 years, 10 months