Author: scabanovich
Date: 2011-04-15 16:27:13 -0400 (Fri, 15 Apr 2011)
New Revision: 30604
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/CDIElement.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/definition/ParametedTypeFactory.java
Log:
JBIDE-8736
https://issues.jboss.org/browse/JBIDE-8736
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 2011-04-15
20:26:37 UTC (rev 30603)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AbstractBeanElement.java 2011-04-15
20:27:13 UTC (rev 30604)
@@ -305,8 +305,10 @@
if(!s1.equals(s2) && Signature.getArrayCount(s1) ==
Signature.getArrayCount(s2)) {
p.setSignature(s2);
}
+ result.add(new TypeDeclaration((ParametedType)other, offset, length));
+ } else {
+ result.add(new TypeDeclaration(p, offset, length));
}
- result.add(new TypeDeclaration(p, offset, length));
}
}
} else if(value != null) {
@@ -331,8 +333,10 @@
if(!s1.equals(s2) && Signature.getArrayCount(s1) ==
Signature.getArrayCount(s2)) {
p.setSignature(s2);
}
+ result.add(new TypeDeclaration((ParametedType)other, offset, length));
+ } else {
+ result.add(new TypeDeclaration(p, offset, length));
}
- result.add(new TypeDeclaration(p, offset, length));
}
}
} catch (CoreException e) {
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIElement.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIElement.java 2011-04-15
20:26:37 UTC (rev 30603)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIElement.java 2011-04-15
20:27:13 UTC (rev 30604)
@@ -18,6 +18,7 @@
import org.jboss.tools.cdi.core.CDICorePlugin;
import org.jboss.tools.cdi.core.ICDIElement;
import org.jboss.tools.cdi.core.extension.CDIExtensionManager;
+import org.jboss.tools.cdi.internal.core.impl.definition.ParametedTypeFactory;
/**
*
@@ -39,7 +40,7 @@
protected ParametedType getObjectType(IMember context) {
try {
- return getCDIProject().getNature().getTypeFactory().getParametedType(context,
"QObject;");
+ return getCDIProject().getNature().getTypeFactory().getParametedType(context,
ParametedTypeFactory.OBJECT);
} catch (JavaModelException e) {
CDICorePlugin.getDefault().logError(e);
return null;
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 2011-04-15
20:26:37 UTC (rev 30603)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ParametedType.java 2011-04-15
20:27:13 UTC (rev 30604)
@@ -176,10 +176,10 @@
CDICorePlugin.getDefault().logError(e);
}
} else if(!"java.lang.Object".equals(type.getFullyQualifiedName())) {
- sc = "QObject;";
+ sc = ParametedTypeFactory.OBJECT;
} else if("java.lang.Object".equals(type.getFullyQualifiedName())
&& arrayPrefix.length() > 0) {
objectArray = true;
- sc = "QObject;";
+ sc = ParametedTypeFactory.OBJECT;
}
if(!objectArray && arrayPrefix.length() > 0) {
sc = arrayPrefix + sc;
@@ -240,7 +240,7 @@
}
int i = typeSignature.indexOf('<');
if(i < 0) {
- if(( typeSignature.startsWith("T") ||
typeSignature.startsWith("Q")) && typeSignature.endsWith(";"))
{
+ if(( typeSignature.startsWith("T") ||
typeSignature.startsWith("Q") || typeSignature.startsWith("L"))
&& typeSignature.endsWith(";")) {
String param = typeSignature.substring(1, typeSignature.length() - 1);
String s = findParameterSignature(param);
return s == null ? typeSignature : s;
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 2011-04-15
20:26:37 UTC (rev 30603)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/ParametedTypeFactory.java 2011-04-15
20:27:13 UTC (rev 30604)
@@ -30,14 +30,16 @@
// I S J C F D Z
static HashMap<String,String> primitives = new HashMap<String, String>();
static {
- primitives.put("I", "Qjava.lang.Integer;");
- primitives.put("S", "Qjava.lang.Short;");
- primitives.put("J", "Qjava.lang.Long;");
- primitives.put("C", "Qjava.lang.Character;");
- primitives.put("F", "Qjava.lang.Float;");
- primitives.put("D", "Qjava.lang.Double;");
- primitives.put("Z", "Qjava.lang.Boolean;");
+ primitives.put("I", "Ljava.lang.Integer;");
+ primitives.put("S", "Ljava.lang.Short;");
+ primitives.put("J", "Ljava.lang.Long;");
+ primitives.put("C", "Ljava.lang.Character;");
+ primitives.put("F", "Ljava.lang.Float;");
+ primitives.put("D", "Ljava.lang.Double;");
+ primitives.put("Z", "Ljava.lang.Boolean;");
}
+ //unresolved Object signature
+ public static String OBJECT = "QObject;";
Map<String, ParametedType> cache = new HashMap<String, ParametedType>();
public ParametedType newParametedType(IType type) {
@@ -55,7 +57,7 @@
}
parametedType.setFactory(this);
parametedType.setType(type);
- if(type != null) parametedType.setSignature("Q" +
type.getFullyQualifiedName() + ";");
+ if(type != null) parametedType.setSignature("L" +
type.getFullyQualifiedName() + ";");
String[] ps = null;
try {
ps = type.getTypeParameterSignatures();
@@ -83,7 +85,7 @@
IType contextType = context instanceof IType ? (IType)context :
context.getDeclaringType();
- String key = context == null || context.isBinary() ||
"QObject;".equals(typeSignature) ? typeSignature :
contextType.getFullyQualifiedName() + "+" + typeSignature;
+ String key = context == null || context.isBinary() || OBJECT.equals(typeSignature) ?
typeSignature : contextType.getFullyQualifiedName() + "+" + typeSignature;
if(cache.containsKey(key)) return cache.get(key);
ParametedType result = new ParametedType();
result.setFactory(this);
@@ -112,7 +114,7 @@
ns.append(result.getArrayPrefix());
if(result.isLower()) ns.append('-');
if(result.isUpper()) ns.append('+');
- ns.append('Q').append(resovedTypeName).append(";");
+ ns.append('L').append(resovedTypeName).append(";");
result.setSignature(ns.toString());
}
IType type = EclipseJavaUtil.findType(context.getJavaProject(), resovedTypeName);
@@ -169,7 +171,7 @@
ns.append(result.getArrayPrefix());
if(result.isLower()) ns.append('-');
if(result.isUpper()) ns.append('+');
- ns.append('Q').append(resovedTypeName).append('<').append(newParams).append(">;");
+ ns.append('L').append(resovedTypeName).append('<').append(newParams).append(">;");
result.setSignature(ns.toString());
}
return result;
@@ -185,7 +187,7 @@
String t = Signature.getTypeVariable(typeParameterSignature);
String[] bounds = Signature.getTypeParameterBounds(typeParameterSignature);
- t = "Q" + t + ";";
+ t = "L" + t + ";";
if(result == null || t.equals(result.getSignature())) {
String sts = bounds.length > 0 ? bounds[0] : "";
if(sts.length() > 0) {