[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[List Home]
|
[stp-commits] r3310 - org.eclipse.stp.sca/trunk/org.eclipse.stp.sca.introspection/src/org/eclipse/stp/sca/introspection
|
- From: genie@xxxxxxxxxxx
- Date: Fri, 11 Sep 2009 09:54:32 -0400 (EDT)
- Delivered-to: stp-commits@eclipse.org
Author: sdrapeau
Date: 2009-09-11 09:54:32 -0400 (Fri, 11 Sep 2009)
New Revision: 3310
Modified:
org.eclipse.stp.sca/trunk/org.eclipse.stp.sca.introspection/src/org/eclipse/stp/sca/introspection/JavaInterfaceResolver.java
Log:
Fix for bug #289213
Modified: org.eclipse.stp.sca/trunk/org.eclipse.stp.sca.introspection/src/org/eclipse/stp/sca/introspection/JavaInterfaceResolver.java
===================================================================
--- org.eclipse.stp.sca/trunk/org.eclipse.stp.sca.introspection/src/org/eclipse/stp/sca/introspection/JavaInterfaceResolver.java 2009-09-07 16:15:54 UTC (rev 3309)
+++ org.eclipse.stp.sca/trunk/org.eclipse.stp.sca.introspection/src/org/eclipse/stp/sca/introspection/JavaInterfaceResolver.java 2009-09-11 13:54:32 UTC (rev 3310)
@@ -20,6 +20,8 @@
import java.util.Set;
import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.util.FeatureMap;
+import org.eclipse.emf.ecore.util.FeatureMapUtil;
import org.eclipse.stp.sca.Component;
import org.eclipse.stp.sca.ComponentReference;
import org.eclipse.stp.sca.ComponentService;
@@ -165,7 +167,14 @@
else {
JavaInterface i = ScaFactory.eINSTANCE.createJavaInterface();
i.setInterface(interfaces[0].getCanonicalName());
- componentService.setInterface(i);
+ // Set the Java interface - use interfaceGroup
+ //componentService.setInterface(i);
+ ((FeatureMap.Internal) componentService.getInterfaceGroup()).clear();
+ ((FeatureMap.Internal) componentService.getInterfaceGroup()).add(
+ ScaPackage.Literals.BASE_SERVICE__INTERFACE_GROUP,
+ FeatureMapUtil.createEntry(
+ ScaPackage.Literals.DOCUMENT_ROOT__INTERFACE_JAVA,
+ i));
// register since just added
serviceMap.put(componentService.getName(), interfaces[0]
.getCanonicalName());
@@ -188,7 +197,14 @@
JavaInterface i = ScaFactory.eINSTANCE.createJavaInterface();
i.setInterface(missingServiceMap.get(key));
c.setName(key);
- c.setInterface(i);
+ // Set the Java interface - use interfaceGroup
+ //c.setInterface(i);
+ ((FeatureMap.Internal) c.getInterfaceGroup()).clear();
+ ((FeatureMap.Internal) c.getInterfaceGroup()).add(
+ ScaPackage.Literals.BASE_SERVICE__INTERFACE_GROUP,
+ FeatureMapUtil.createEntry(
+ ScaPackage.Literals.DOCUMENT_ROOT__INTERFACE_JAVA,
+ i));
// add component service to the model
component.getService().add(c);
}
@@ -230,16 +246,16 @@
// HashMap<String, AccessibleObject>();
// register reference annotated fields and methods in map
- for (AccessibleObject object : o) {
+ for (AccessibleObject object : o) {
- // Create key
- String key = IntrospectionUtils.getReferenceName(object);
- // Only register this reference if returned key is not null
- if (key != null)
- referenceDecMap.put(key, getReferenceClassName(object));
+ // Create key
+ String key = IntrospectionUtils.getReferenceName(object);
+ // Only register this reference if returned key is not null
+ if (key != null)
+ referenceDecMap.put(key, getReferenceClassName(object));
- // TODO Not Currently used
- // referenceObjectMap.put(getReferenceName(object), object);
+ // TODO Not Currently used
+ // referenceObjectMap.put(getReferenceName(object), object);
}
// register references already defined in the model for this
@@ -267,7 +283,14 @@
JavaInterface newJavaItf = ScaFactory.eINSTANCE
.createJavaInterface();
newJavaItf.setInterface(interfaceClass);
- componentReference.setInterface(newJavaItf);
+ // Set the Java interface - use interfaceGroup
+ //componentReference.setInterface(newJavaItf);
+ ((FeatureMap.Internal) componentReference.getInterfaceGroup()).clear();
+ ((FeatureMap.Internal) componentReference.getInterfaceGroup()).add(
+ ScaPackage.Literals.BASE_REFERENCE__INTERFACE_GROUP,
+ FeatureMapUtil.createEntry(
+ ScaPackage.Literals.DOCUMENT_ROOT__INTERFACE_JAVA,
+ newJavaItf));
// put to list of registered references
referenceMap.put(referenceName, interfaceClass);
}
@@ -289,7 +312,14 @@
.createJavaInterface();
i.setInterface(referenceDecMap.get(key));
c.setName(key);
- c.setInterface(i);
+ // Set the Java interface - use interfaceGroup
+ //c.setInterface(i);
+ ((FeatureMap.Internal) c.getInterfaceGroup()).clear();
+ ((FeatureMap.Internal) c.getInterfaceGroup()).add(
+ ScaPackage.Literals.BASE_REFERENCE__INTERFACE_GROUP,
+ FeatureMapUtil.createEntry(
+ ScaPackage.Literals.DOCUMENT_ROOT__INTERFACE_JAVA,
+ i));
// add component service to the model
component.getReference().add(c);
@@ -321,7 +351,7 @@
if (classe.length > 0)
return classe[0].getCanonicalName();
else {
- return method.getReturnType().getCanonicalName();
+ return method.getReturnType().getCanonicalName();
}
}