[archstudio-commits] svn commit: r7125 - in /archstudio4/branches/enhancements/edu.uci.isr.archstudio4: ./ src/edu/uci/isr/archstudio4/comp/archipelago/generic/logics/hints/XAdlHintRepository.java

archstudio-commits-owner at uci.edu archstudio-commits-owner at uci.edu
Tue May 20 11:57:48 PDT 2008


Author: ssubrama
Date: Tue May 20 11:57:48 2008
New Revision: 7125

Log:
Merged revisions 7101 via svnmerge from =

http://tps.ics.uci.edu/svn/projects/archstudio4/trunk/edu.uci.isr.archstudi=
o4

........
  r7101 | shendric | 2008-05-07 16:05:46 -0700 (Wed, 07 May 2008) | 1 line
  =

  Work towards addressing a hint bug when an imported architecture has abso=
lute but not relative hints
........
Merged revisions 7101 via svnmerge from =

http://tps.ics.uci.edu/svn/projects/archstudio4/trunk/edu.uci.isr.archstudi=
o4

........
  r7101 | shendric | 2008-05-07 16:05:46 -0700 (Wed, 07 May 2008) | 1 line
  =

  Work towards addressing a hint bug when an imported architecture has abso=
lute but not relative hints
........

Modified:
    archstudio4/branches/enhancements/edu.uci.isr.archstudio4/   (props cha=
nged)
    archstudio4/branches/enhancements/edu.uci.isr.archstudio4/src/edu/uci/i=
sr/archstudio4/comp/archipelago/generic/logics/hints/XAdlHintRepository.java

Propchange: archstudio4/branches/enhancements/edu.uci.isr.archstudio4/
---------------------------------------------------------------------------=
---
Binary property 'svnmerge-integrated' - no diff available.

Modified: archstudio4/branches/enhancements/edu.uci.isr.archstudio4/src/edu=
/uci/isr/archstudio4/comp/archipelago/generic/logics/hints/XAdlHintReposito=
ry.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- archstudio4/branches/enhancements/edu.uci.isr.archstudio4/src/edu/uci/i=
sr/archstudio4/comp/archipelago/generic/logics/hints/XAdlHintRepository.jav=
a (original)
+++ archstudio4/branches/enhancements/edu.uci.isr.archstudio4/src/edu/uci/i=
sr/archstudio4/comp/archipelago/generic/logics/hints/XAdlHintRepository.jav=
a Tue May 20 11:57:48 2008
@@ -32,7 +32,7 @@
 import edu.uci.isr.xarchflat.utils.XArchRelativePathTracker;
 =

 public class XAdlHintRepository
-    implements IHintRepository, XArchFlatListener{
+	implements IHintRepository, XArchFlatListener{
 =

 	private static final boolean DEBUG =3D false;
 =

@@ -270,32 +270,23 @@
 		}
 	}
 =

-	private ObjRef getPropertyRef(String id, String[] names, boolean create){
+	private ObjRef getPropertyRef(String id, String name, boolean create){
 		synchronized(hintedElementRefNameToPropertyRefs){
 			ObjRef hintedElementRef =3D getHintedElementRef(id, create);
 			if(hintedElementRef !=3D null){
-				Tuple key =3D new Tuple(hintedElementRef, names[0]);
+
+				//TODO: remove following line once synchronous flat listeners are enab=
led
+				propertyRefTracker.rescan(hintedElementRef);
+
+				Tuple key =3D new Tuple(hintedElementRef, name);
 				ObjRef propertyRef =3D hintedElementRefNameToPropertyRefs.get(key);
 				if(propertyRef !=3D null && xarch.hasAncestor(propertyRef, propertyRef=
Tracker.getRootObjRef())){
 					return propertyRef;
 				}
 =

-				/*
-				 * We check for new values since we may not have gotten the flat
-				 * event yet that would inform us that the property is
-				 * available.
-				 */
-				propertyRefTracker.rescan(hintedElementRef);
-				for(String name: names){
-					propertyRef =3D hintedElementRefNameToPropertyRefs.get(new Tuple(hint=
edElementRef, name));
-					if(propertyRef !=3D null && xarch.hasAncestor(propertyRef, propertyRe=
fTracker.getRootObjRef())){
-						return propertyRef;
-					}
-				}
-
 				if(create){
 					propertyRef =3D xarch.create(hintsContextRef, "Property");
-					xarch.set(propertyRef, "name", names[0]);
+					xarch.set(propertyRef, "name", name);
 					hintedElementRefNameToPropertyRefs.put(key, propertyRef);
 					xarch.add(hintedElementRef, "property", propertyRef);
 					return propertyRef;
@@ -305,7 +296,7 @@
 		}
 	}
 =

-	private Object getValue(String xArchID, String[] name) throws PropertyDec=
odeException{
+	private Object getValue(String xArchID, String name) throws PropertyDecod=
eException{
 		ObjRef propertyRef =3D getPropertyRef(xArchID, name, false);
 		if(propertyRef !=3D null){
 			ObjRef valueRef =3D (ObjRef)xarch.get(propertyRef, "value");
@@ -319,7 +310,7 @@
 	}
 =

 	private boolean setValue(String xArchID, String name, Object value){
-		ObjRef propertyRef =3D getPropertyRef(xArchID, new String[]{name}, true);
+		ObjRef propertyRef =3D getPropertyRef(xArchID, name, true);
 		if(propertyRef !=3D null){
 			ObjRef valueRef =3D (ObjRef)xarch.get(propertyRef, "value");
 			if(valueRef =3D=3D null){
@@ -373,10 +364,9 @@
 		return hintNames.toArray(new String[hintNames.size()]);
 	}
 =

-	@SuppressWarnings("unchecked")
-	public synchronized <T>T getHint(Object xArchID, String... hintName){
+	public synchronized Object getHint(Object xArchID, String hintName){
 		try{
-			return (T)getValue((String)xArchID, hintName);
+			return getValue((String)xArchID, hintName);
 		}
 		catch(PropertyDecodeException e){
 			e.printStackTrace();




More information about the archstudio-commits mailing list