Author: tfmorris Date: 2008-10-14 12:28:49-0700 New Revision: 15924 Modified: trunk/src/argouml-app/src/org/argouml/profile/UserDefinedProfile.java trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/CompositeModelInterpreter.java (contents, props changed) trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/ComputeDesignMaterials.java (contents, props changed) trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/ComputeTriggers.java (contents, props changed) trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/CrOCL.java (contents, props changed) trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/DefaultOclEvaluator.java (contents, props changed) trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/EvaluateExpression.java (contents, props changed) trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/EvaluateInvariant.java (contents, props changed) trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/LambdaEvaluator.java (contents, props changed) trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/ModelInterpreter.java (contents, props changed) trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/OclExpressionEvaluator.java (contents, props changed) trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/OclInterpreter.java (contents, props changed) trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/uml14/CollectionsModelInterpreter.java (contents, props changed) trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/uml14/ModelAccessModelInterpreter.java (contents, props changed) trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/uml14/OclAPIModelInterpreter.java (contents, props changed) trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/uml14/Uml14ModelInterpreter.java (contents, props changed) trunk/src/argouml-app/src/org/argouml/ui/explorer/rules/GoProfileToCritics.java
Log: Use interfaces instead of concrete classes in public APIs. Fix warnings. Add SVN keywords & eol properties. Modified: trunk/src/argouml-app/src/org/argouml/profile/UserDefinedProfile.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/UserDefinedProfile.java?view=diff&rev=15924&p1=trunk/src/argouml-app/src/org/argouml/profile/UserDefinedProfile.java&p2=trunk/src/argouml-app/src/org/argouml/profile/UserDefinedProfile.java&r1=15923&r2=15924 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/profile/UserDefinedProfile.java (original) +++ trunk/src/argouml-app/src/org/argouml/profile/UserDefinedProfile.java 2008-10-14 12:28:49-0700 @@ -34,9 +34,10 @@ import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.Set; import java.util.StringTokenizer; -import java.util.Vector; import javax.swing.ImageIcon; @@ -70,11 +71,11 @@ private Collection profilePackages; private UserDefinedFigNodeStrategy figNodeStrategy - = new UserDefinedFigNodeStrategy(); + = new UserDefinedFigNodeStrategy(); private class UserDefinedFigNodeStrategy implements FigNodeStrategy { - private HashMap<String, Image> images = new HashMap<String, Image>(); + private Map<String, Image> images = new HashMap<String, Image>(); public Image getIconForStereotype(Object stereotype) { return images.get(Model.getFacade().getName(stereotype)); @@ -263,7 +264,7 @@ * @return the packages in the <code>profilePackages</code> */ private Collection filterPackages() { - Vector<Object> ret = new Vector<Object>(); + Collection ret = new ArrayList(); for (Object object : profilePackages) { if (Model.getFacade().isAPackage(object)) { ret.add(object); @@ -277,8 +278,8 @@ String headline = null; String description = null; int priority = ToDoItem.HIGH_PRIORITY; - Vector<Decision> supportedDecisions = new Vector<Decision>(); - Vector<String> knowledgeTypes = new Vector<String>(); + List<Decision> supportedDecisions = new ArrayList<Decision>(); + List<String> knowledgeTypes = new ArrayList<String>(); String moreInfoURL = null; Collection tags = Model.getFacade().getTaggedValuesCollection(critique); @@ -459,8 +460,8 @@ return decision; } - private Vector<CrOCL> getAllCritiquesInModel() { - Vector<CrOCL> ret = new Vector<CrOCL>(); + private List<CrOCL> getAllCritiquesInModel() { + List<CrOCL> ret = new ArrayList<CrOCL>(); Collection<Object> comments = getAllCommentsInModel(profilePackages); @@ -479,7 +480,7 @@ @SuppressWarnings("unchecked") private Collection<Object> getAllCommentsInModel(Collection objs) { - Collection<Object> col = new Vector<Object>(); + Collection<Object> col = new ArrayList<Object>(); for (Object obj : objs) { if (Model.getFacade().isAComment(obj)) { col.add(obj); Modified: trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/CompositeModelInterpreter.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/CompositeModelInterpreter.java?view=diff&rev=15924&p1=trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/CompositeModelInterpreter.java&p2=trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/CompositeModelInterpreter.java&r1=15923&r2=15924 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/CompositeModelInterpreter.java (original) +++ trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/CompositeModelInterpreter.java 2008-10-14 12:28:49-0700 @@ -1,4 +1,4 @@ -// $Id: eclipse-argo-codetemplates.xml 11347 2006-10-26 22:37:44Z linus $ +// $Id$ // Copyright (c) 2008 The Regents of the University of California. All // Rights Reserved. Permission to use, copy, modify, and distribute this // software and its documentation without fee, and without a written @@ -24,8 +24,8 @@ package org.argouml.profile.internal.ocl; -import java.util.HashMap; import java.util.HashSet; +import java.util.Map; import java.util.Set; /** @@ -46,12 +46,12 @@ set.add(mi); } - /** + /* * @see org.argouml.profile.internal.ocl.ModelInterpreter#invokeFeature(java.util.HashMap, * java.lang.Object, java.lang.String, java.lang.String, * java.lang.Object[]) */ - public Object invokeFeature(HashMap<String, Object> vt, Object subject, + public Object invokeFeature(Map<String, Object> vt, Object subject, String feature, String type, Object[] parameters) { for (ModelInterpreter mi : set) { Object ret = mi.invokeFeature(vt, subject, feature, type, @@ -63,7 +63,7 @@ return null; } - /** + /* * @see org.argouml.profile.internal.ocl.ModelInterpreter#getBuiltInSymbol(java.lang.String) */ public Object getBuiltInSymbol(String sym) { Modified: trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/ComputeDesignMaterials.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/ComputeDesignMaterials.java?view=diff&rev=15924&p1=trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/ComputeDesignMaterials.java&p2=trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/ComputeDesignMaterials.java&r1=15923&r2=15924 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/ComputeDesignMaterials.java (original) +++ trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/ComputeDesignMaterials.java 2008-10-14 12:28:49-0700 @@ -1,4 +1,4 @@ -// $Id: eclipse-argo-codetemplates.xml 11347 2006-10-26 22:37:44Z linus $ +// $Id$ // Copyright (c) 2008 The Regents of the University of California. All // Rights Reserved. Permission to use, copy, modify, and distribute this // software and its documentation without fee, and without a written @@ -53,6 +53,7 @@ /* * @see tudresden.ocl.parser.analysis.DepthFirstAdapter#caseAClassifierContext(tudresden.ocl.parser.node.AClassifierContext) */ + @Override public void caseAClassifierContext(AClassifierContext node) { String str = ("" + node.getPathTypeName()).trim(); Modified: trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/ComputeTriggers.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/ComputeTriggers.java?view=diff&rev=15924&p1=trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/ComputeTriggers.java&p2=trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/ComputeTriggers.java&r1=15923&r2=15924 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/ComputeTriggers.java (original) +++ trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/ComputeTriggers.java 2008-10-14 12:28:49-0700 @@ -1,4 +1,4 @@ -// $Id: eclipse-argo-codetemplates.xml 11347 2006-10-26 22:37:44Z linus $ +// $Id$ // Copyright (c) 2008 The Regents of the University of California. All // Rights Reserved. Permission to use, copy, modify, and distribute this // software and its documentation without fee, and without a written @@ -24,7 +24,8 @@ package org.argouml.profile.internal.ocl; -import java.util.Vector; +import java.util.ArrayList; +import java.util.List; import tudresden.ocl.parser.analysis.DepthFirstAdapter; import tudresden.ocl.parser.node.AClassifierContext; @@ -36,11 +37,10 @@ */ public class ComputeTriggers extends DepthFirstAdapter { - private Vector<String> triggs = new Vector<String>(); + private List<String> triggs = new ArrayList<String>(); - /** - * @see tudresden.ocl.parser.analysis.DepthFirstAdapter#caseAClassifierContext(tudresden.ocl.parser.node.AClassifierContext) - */ + + @Override public void caseAClassifierContext(AClassifierContext node) { String str = "" + node.getPathTypeName(); triggs.add(str.trim().toLowerCase()); @@ -49,7 +49,7 @@ /** * @return the triggers */ - public Vector<String> getTriggers() { + public List<String> getTriggers() { return triggs; } Modified: trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/CrOCL.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/CrOCL.java?view=diff&rev=15924&p1=trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/CrOCL.java&p2=trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/CrOCL.java&r1=15923&r2=15924 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/CrOCL.java (original) +++ trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/CrOCL.java 2008-10-14 12:28:49-0700 @@ -1,4 +1,4 @@ -// $Id: eclipse-argo-codetemplates.xml 11347 2006-10-26 22:37:44Z linus $ +// $Id$ // Copyright (c) 2008 The Regents of the University of California. All // Rights Reserved. Permission to use, copy, modify, and distribute this // software and its documentation without fee, and without a written @@ -24,8 +24,8 @@ package org.argouml.profile.internal.ocl; +import java.util.List; import java.util.Set; -import java.util.Vector; import org.argouml.cognitive.Decision; import org.argouml.cognitive.Designer; @@ -42,10 +42,6 @@ public class CrOCL extends CrUML { /** - * Logger. - */ - // private static final Logger LOG = Logger.getLogger(CrOCL.class); - /** * the OCL Interpreter */ private OclInterpreter interpreter = null; @@ -71,10 +67,12 @@ * @param supportedDecisions the decisions * @param priority the priority * @throws InvalidOclException if the ocl is not valid + * + * TODO: Do these need to be Lists or can they be simple Collections? */ public CrOCL(String oclConstraint, String headline, String description, - Integer priority, Vector<Decision> supportedDecisions, - Vector<String> knowledgeTypes, String moreInfoURL) + Integer priority, List<Decision> supportedDecisions, + List<String> knowledgeTypes, String moreInfoURL) throws InvalidOclException { interpreter = new OclInterpreter(oclConstraint, new Uml14ModelInterpreter()); @@ -83,7 +81,7 @@ addSupportedDecision(UMLDecision.PLANNED_EXTENSIONS); setPriority(ToDoItem.HIGH_PRIORITY); - Vector<String> triggers = interpreter.getTriggers(); + List<String> triggers = interpreter.getTriggers(); designMaterials = interpreter.getCriticizedDesignMaterials(); for (String string : triggers) { @@ -124,10 +122,12 @@ setMoreInfoURL(moreInfoURL); } } + /* * @see org.argouml.cognitive.Critic#getCriticizedDesignMaterials() */ + @Override public Set<Object> getCriticizedDesignMaterials() { return designMaterials; } @@ -136,6 +136,7 @@ * @see org.argouml.uml.cognitive.critics.CrUML#predicate2(java.lang.Object, * org.argouml.cognitive.Designer) */ + @Override public boolean predicate2(Object dm, Designer dsgr) { if (!interpreter.applicable(dm)) { return NO_PROBLEM; Modified: trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/DefaultOclEvaluator.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/DefaultOclEvaluator.java?view=diff&rev=15924&p1=trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/DefaultOclEvaluator.java&p2=trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/DefaultOclEvaluator.java&r1=15923&r2=15924 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/DefaultOclEvaluator.java (original) +++ trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/DefaultOclEvaluator.java 2008-10-14 12:28:49-0700 @@ -1,4 +1,4 @@ -// $Id: eclipse-argo-codetemplates.xml 11347 2006-10-26 22:37:44Z linus $ +// $Id$ // Copyright (c) 2008 The Regents of the University of California. All // Rights Reserved. Permission to use, copy, modify, and distribute this // software and its documentation without fee, and without a written @@ -26,10 +26,9 @@ import java.io.PushbackReader; import java.io.StringReader; -import java.util.HashMap; +import java.util.Map; import org.apache.log4j.Logger; -import org.argouml.profile.internal.ocl.uml14.Uml14ModelInterpreter; import tudresden.ocl.parser.OclParser; import tudresden.ocl.parser.lexer.Lexer; @@ -59,20 +58,21 @@ } return instance; } - /** - * @throws InvalidOclException + + /* * @see org.argouml.profile.internal.ocl.OclExpressionEvaluator#evaluate(java.util.HashMap, org.argouml.profile.internal.ocl.ModelInterpreter, java.lang.String) */ - public Object evaluate(HashMap<String, Object> vt, ModelInterpreter mi, + public Object evaluate(Map<String, Object> vt, ModelInterpreter mi, String ocl) throws InvalidOclException { // XXX this seems to be a bug of the parser, // it always requires a context - LOG.debug("OCL: "+ocl); + LOG.debug("OCL: " + ocl); if (ocl.contains("ore")) { System.out.println("VOILA!"); } - Lexer lexer = new Lexer(new PushbackReader(new StringReader("context X inv: " + ocl), 2)); + Lexer lexer = new Lexer(new PushbackReader(new StringReader( + "context X inv: " + ocl), 2)); OclParser parser = new OclParser(lexer); Start tree = null; @@ -82,7 +82,7 @@ throw new InvalidOclException(ocl); } - EvaluateExpression ee = new EvaluateExpression(vt,mi); + EvaluateExpression ee = new EvaluateExpression(vt, mi); tree.apply(ee); return ee.getValue(); } Modified: trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/EvaluateExpression.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/EvaluateExpression.java?view=diff&rev=15924&p1=trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/EvaluateExpression.java&p2=trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/EvaluateExpression.java&r1=15923&r2=15924 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/EvaluateExpression.java (original) +++ trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/EvaluateExpression.java 2008-10-14 12:28:49-0700 @@ -1,4 +1,4 @@ -// $Id: eclipse-argo-codetemplates.xml 11347 2006-10-26 22:37:44Z linus $ +// $Id$ // Copyright (c) 2008 The Regents of the University of California. All // Rights Reserved. Permission to use, copy, modify, and distribute this // software and its documentation without fee, and without a written @@ -28,9 +28,11 @@ import java.util.Collection; import java.util.HashMap; import java.util.HashSet; -import java.util.Vector; +import java.util.List; +import java.util.Map; import org.apache.log4j.Logger; +import org.argouml.profile.internal.ocl.uml14.Bag; import org.argouml.profile.internal.ocl.uml14.HashBag; import org.argouml.profile.internal.ocl.uml14.OclEnumLiteral; @@ -98,7 +100,7 @@ /** * The Variable Table */ - private HashMap<String, Object> vt = null; + private Map<String, Object> vt = null; /** * Keeps the return value of the visitor @@ -131,7 +133,7 @@ * @param variableTable the variable table * @param modelInterpreter model interpreter */ - public EvaluateExpression(HashMap<String, Object> variableTable, + public EvaluateExpression(Map<String, Object> variableTable, ModelInterpreter modelInterpreter) { reset(variableTable, modelInterpreter); } @@ -152,7 +154,7 @@ * @param newVT the variable table * @param mi the model interpreter */ - public void reset(HashMap<String, Object> newVT, ModelInterpreter mi) { + public void reset(Map<String, Object> newVT, ModelInterpreter mi) { this.interp = mi; this.val = null; @@ -286,7 +288,7 @@ error(node); } } else { - // if one side is null we can only compare with the equality operator + // if one side is null, compare with the equality operator if (op instanceof AEqualRelationalOperator) { val = (left == right); } else if (op instanceof ANEqualRelationalOperator) { @@ -302,6 +304,7 @@ /* * @see tudresden.ocl.parser.analysis.DepthFirstAdapter#caseAAdditiveExpressionTail(tudresden.ocl.parser.node.AAdditiveExpressionTail) */ + @Override public void caseAAdditiveExpressionTail(AAdditiveExpressionTail node) { Object left = val; val = null; @@ -411,11 +414,11 @@ /* * @see tudresden.ocl.parser.analysis.DepthFirstAdapter#caseAFeaturePrimaryExpression(tudresden.ocl.parser.node.AFeaturePrimaryExpression) */ - @SuppressWarnings("unchecked") + @Override public void caseAFeaturePrimaryExpression(AFeaturePrimaryExpression node) { Object subject = val; Object feature = null; - Vector<Object> parameters = null; + List parameters = null; inAFeaturePrimaryExpression(node); if (node.getPathName() != null) { @@ -434,7 +437,7 @@ if (node.getFeatureCallParameters() != null) { val = null; node.getFeatureCallParameters().apply(this); - parameters = (Vector<Object>) val; + parameters = (List) val; } if (subject == null) { @@ -451,9 +454,10 @@ /* * @see tudresden.ocl.parser.analysis.DepthFirstAdapter#outAEmptyFeatureCallParameters(tudresden.ocl.parser.node.AEmptyFeatureCallParameters) */ + @Override public void outAEmptyFeatureCallParameters(AEmptyFeatureCallParameters node) { - val = new Vector<Object>(); + val = new ArrayList(); defaultOut(node); } @@ -461,6 +465,7 @@ * @see tudresden.ocl.parser.analysis.DepthFirstAdapter#caseAFeatureCallParameters(tudresden.ocl.parser.node.AFeatureCallParameters) */ @SuppressWarnings("unchecked") + @Override public void caseAFeatureCallParameters(AFeatureCallParameters node) { inAFeatureCallParameters(node); if (node.getLPar() != null) { @@ -473,10 +478,10 @@ hasDeclarator = true; } if (node.getActualParameterList() != null) { - Vector<String> vars = null; + List<String> vars = null; if (hasDeclarator) { - Vector<Object> ret = new Vector<Object>(); - vars = (Vector<String>) val; + List ret = new ArrayList(); + vars = (List) val; final PExpression exp = ((AActualParameterList) node .getActualParameterList()).getExpression(); @@ -491,10 +496,10 @@ ret.add(new LambdaEvaluator() { /** - * @see org.argouml.profile.internal.ocl.LambdaEvaluator#evaluate(java.util.HashMap, + * @see org.argouml.profile.internal.ocl.LambdaEvaluator#evaluate(java.util.Map, * java.lang.Object) */ - public Object evaluate(HashMap<String, Object> vti, + public Object evaluate(Map<String, Object> vti, Object expi) { Object state = EvaluateExpression.this.saveState(); @@ -527,7 +532,7 @@ @SuppressWarnings("unchecked") private void loadState(Object state) { Object[] stateArr = (Object[]) state; - this.vt = (HashMap<String, Object>) stateArr[0]; + this.vt = (Map<String, Object>) stateArr[0]; this.val = stateArr[1]; this.fwd = stateArr[2]; } @@ -540,10 +545,11 @@ * @param node * @see tudresden.ocl.parser.analysis.DepthFirstAdapter#caseAStandardDeclarator(tudresden.ocl.parser.node.AStandardDeclarator) */ + @Override public void caseAStandardDeclarator(AStandardDeclarator node) { inAStandardDeclarator(node); - Vector<String> vars = new Vector<String>(); + List<String> vars = new ArrayList<String>(); if (node.getName() != null) { node.getName().apply(this); @@ -571,15 +577,17 @@ outAStandardDeclarator(node); } + @Override public void outAIterateDeclarator(AIterateDeclarator node) { // TODO support iterate declarator - val = new Vector<String>(); + val = new ArrayList<String>(); defaultOut(node); } /* * @see tudresden.ocl.parser.analysis.DepthFirstAdapter#caseALetExpression(tudresden.ocl.parser.node.ALetExpression) */ + @Override public void caseALetExpression(ALetExpression node) { // TODO support nested let expressions ! @@ -696,9 +704,10 @@ /* * @see tudresden.ocl.parser.analysis.DepthFirstAdapter#caseAExpressionListOrRange(tudresden.ocl.parser.node.AExpressionListOrRange) */ + @Override public void caseAExpressionListOrRange(AExpressionListOrRange node) { - Vector<Object> ret = new Vector<Object>(); + List ret = new ArrayList(); inAExpressionListOrRange(node); if (node.getExpression() != null) { val = null; @@ -708,7 +717,7 @@ if (node.getExpressionListOrRangeTail() != null) { val = null; node.getExpressionListOrRangeTail().apply(this); - ret.addAll((Collection<? extends Object>) val); + ret.addAll((Collection) val); } val = ret; outAExpressionListOrRange(node); @@ -717,6 +726,7 @@ /* * @see tudresden.ocl.parser.analysis.DepthFirstAdapter#caseAListExpressionListOrRangeTail(tudresden.ocl.parser.node.AListExpressionListOrRangeTail) */ + @Override public void caseAListExpressionListOrRangeTail( AListExpressionListOrRangeTail node) { @@ -724,7 +734,7 @@ inAListExpressionListOrRangeTail(node); { - Vector<Object> ret = new Vector<Object>(); + List ret = new ArrayList(); Object temp[] = node.getExpressionListTail().toArray(); for (int i = 0; i < temp.length; i++) { val = null; @@ -740,12 +750,12 @@ /* * @see tudresden.ocl.parser.analysis.DepthFirstAdapter#caseAFeatureCall(tudresden.ocl.parser.node.AFeatureCall) */ - @SuppressWarnings("unchecked") + @Override public void caseAFeatureCall(AFeatureCall node) { Object subject = val; Object feature = null; Object type = fwd; - Vector<Object> parameters = null; + List parameters = null; inAFeatureCall(node); if (node.getPathName() != null) { @@ -766,17 +776,18 @@ val = null; node.getFeatureCallParameters().apply(this); - parameters = (Vector<Object>) val; + parameters = (List) val; } else { - parameters = new Vector<Object>(); + parameters = new ArrayList(); } val = runFeatureCall(subject, feature, type, parameters); outAFeatureCall(node); } + @Override public void caseAActualParameterList(AActualParameterList node) { - Vector<Object> list = new Vector<Object>(); + List list = new ArrayList(); inAActualParameterList(node); if (node.getExpression() != null) { val = null; @@ -816,14 +827,13 @@ } } - @SuppressWarnings("unchecked") private Object runFeatureCall(Object subject, Object feature, Object type, - Vector<Object> parameters) { + List parameters) { // LOG.debug("OCL FEATURE CALL: " + subject + ""+ type +""+ feature + "" // + parameters); if (parameters == null) { - parameters = new Vector<Object>(); + parameters = new ArrayList<Object>(); } // XXX this should be done in CollectionsModelInterpreter @@ -832,7 +842,7 @@ if ((subject instanceof Collection) && type.toString().trim().equals(".")) { Collection col = (Collection) subject; - HashBag<Object> res = new HashBag<Object>(); + Bag res = new HashBag(); for (Object obj : col) { res.add(interp.invokeFeature(vt, obj, feature.toString().trim(), ".", parameters.toArray())); Modified: trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/EvaluateInvariant.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/EvaluateInvariant.java?view=diff&rev=15924&p1=trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/EvaluateInvariant.java&p2=trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/EvaluateInvariant.java&r1=15923&r2=15924 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/EvaluateInvariant.java (original) +++ trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/EvaluateInvariant.java 2008-10-14 12:28:49-0700 @@ -1,4 +1,4 @@ -// $Id: eclipse-argo-codetemplates.xml 11347 2006-10-26 22:37:44Z linus $ +// $Id$ // Copyright (c) 2008 The Regents of the University of California. All // Rights Reserved. Permission to use, copy, modify, and distribute this // software and its documentation without fee, and without a written @@ -37,11 +37,6 @@ public class EvaluateInvariant extends DepthFirstAdapter { /** - * Logger. - */ - // private static final Logger LOG = - // Logger.getLogger(EvaluateInvariant.class); - /** * Is this invariant satified? */ private boolean ok = true; @@ -59,12 +54,12 @@ * Constructor * * @param element self - * @param mi model interpreter + * @param interpreter model interpreter */ - public EvaluateInvariant(Object element, ModelInterpreter mi) { + public EvaluateInvariant(Object element, ModelInterpreter interpreter) { this.modelElement = element; - this.mi = mi; - this.expEvaluator = new EvaluateExpression(element, mi); + this.mi = interpreter; + this.expEvaluator = new EvaluateExpression(element, interpreter); } /** @@ -76,9 +71,10 @@ /** Interpreter Code * */ - /** + /* * @see tudresden.ocl.parser.analysis.DepthFirstAdapter#caseAConstraint(tudresden.ocl.parser.node.AConstraint) */ + @Override public void caseAConstraint(AConstraint node) { inAConstraint(node); if (node.getContextDeclaration() != null) { Modified: trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/LambdaEvaluator.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/LambdaEvaluator.java?view=diff&rev=15924&p1=trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/LambdaEvaluator.java&p2=trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/LambdaEvaluator.java&r1=15923&r2=15924 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/LambdaEvaluator.java (original) +++ trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/LambdaEvaluator.java 2008-10-14 12:28:49-0700 @@ -1,4 +1,4 @@ -// $Id: eclipse-argo-codetemplates.xml 11347 2006-10-26 22:37:44Z linus $ +// $Id$ // Copyright (c) 2008 The Regents of the University of California. All // Rights Reserved. Permission to use, copy, modify, and distribute this // software and its documentation without fee, and without a written @@ -24,7 +24,7 @@ package org.argouml.profile.internal.ocl; -import java.util.HashMap; +import java.util.Map; /** * Evaluates an OCL expression given a variable table @@ -39,5 +39,5 @@ * @param exp expression * @return the return value */ - Object evaluate(HashMap<String, Object> vt, Object exp); + Object evaluate(Map<String, Object> vt, Object exp); } Modified: trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/ModelInterpreter.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/ModelInterpreter.java?view=diff&rev=15924&p1=trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/ModelInterpreter.java&p2=trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/ModelInterpreter.java&r1=15923&r2=15924 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/ModelInterpreter.java (original) +++ trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/ModelInterpreter.java 2008-10-14 12:28:49-0700 @@ -1,4 +1,4 @@ -// $Id: eclipse-argo-codetemplates.xml 11347 2006-10-26 22:37:44Z linus $ +// $Id$ // Copyright (c) 2008 The Regents of the University of California. All // Rights Reserved. Permission to use, copy, modify, and distribute this // software and its documentation without fee, and without a written @@ -24,7 +24,7 @@ package org.argouml.profile.internal.ocl; -import java.util.HashMap; +import java.util.Map; /** * Actually interprets the feature and operations in the model, in the sense @@ -48,7 +48,7 @@ * @param parameters the parameters for this invokation * @return the return value */ - Object invokeFeature(HashMap<String, Object> vt, Object subject, + Object invokeFeature(Map<String, Object> vt, Object subject, String feature, String type, Object[] parameters); /** Modified: trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/OclExpressionEvaluator.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/OclExpressionEvaluator.java?view=diff&rev=15924&p1=trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/OclExpressionEvaluator.java&p2=trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/OclExpressionEvaluator.java&r1=15923&r2=15924 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/OclExpressionEvaluator.java (original) +++ trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/OclExpressionEvaluator.java 2008-10-14 12:28:49-0700 @@ -1,4 +1,4 @@ -// $Id: eclipse-argo-codetemplates.xml 11347 2006-10-26 22:37:44Z linus $ +// $Id$ // Copyright (c) 2008 The Regents of the University of California. All // Rights Reserved. Permission to use, copy, modify, and distribute this // software and its documentation without fee, and without a written @@ -24,7 +24,7 @@ package org.argouml.profile.internal.ocl; -import java.util.HashMap; +import java.util.Map; /** * Represents a generic Ocl Expression Evaluator @@ -42,6 +42,6 @@ * @return the return value * @throws InvalidOclException if the ocl expression is not valid */ - Object evaluate(HashMap<String, Object> vt, ModelInterpreter mi, String ocl) + Object evaluate(Map<String, Object> vt, ModelInterpreter mi, String ocl) throws InvalidOclException; } Modified: trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/OclInterpreter.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/OclInterpreter.java?view=diff&rev=15924&p1=trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/OclInterpreter.java&p2=trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/OclInterpreter.java&r1=15923&r2=15924 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/OclInterpreter.java (original) +++ trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/OclInterpreter.java 2008-10-14 12:28:49-0700 @@ -1,4 +1,4 @@ -// $Id: eclipse-argo-codetemplates.xml 11347 2006-10-26 22:37:44Z linus $ +// $Id$ // Copyright (c) 2008 The Regents of the University of California. All // Rights Reserved. Permission to use, copy, modify, and distribute this // software and its documentation without fee, and without a written @@ -26,8 +26,8 @@ import java.io.PushbackReader; import java.io.StringReader; +import java.util.List; import java.util.Set; -import java.util.Vector; import tudresden.ocl.parser.OclParser; import tudresden.ocl.parser.lexer.Lexer; @@ -42,11 +42,6 @@ public class OclInterpreter { /** - * Logger. - */ - //private static final Logger LOG = Logger.getLogger(OclInterpreter.class); - - /** * Parser OCL tree */ private Start tree = null; @@ -111,7 +106,7 @@ * @see org.argouml.cognitive.Critic#addTrigger(String) * @return the set of triggers */ - public Vector<String> getTriggers() { + public List<String> getTriggers() { ComputeTriggers ct = new ComputeTriggers(); tree.apply(ct); return ct.getTriggers(); Modified: trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/uml14/CollectionsModelInterpreter.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/uml14/CollectionsModelInterpreter.java?view=diff&rev=15924&p1=trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/uml14/CollectionsModelInterpreter.java&p2=trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/uml14/CollectionsModelInterpreter.java&r1=15923&r2=15924 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/uml14/CollectionsModelInterpreter.java (original) +++ trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/uml14/CollectionsModelInterpreter.java 2008-10-14 12:28:49-0700 @@ -1,4 +1,4 @@ -// $Id: eclipse-argo-codetemplates.xml 11347 2006-10-26 22:37:44Z linus $ +// $Id$ // Copyright (c) 2008 The Regents of the University of California. All // Rights Reserved. Permission to use, copy, modify, and distribute this // software and its documentation without fee, and without a written @@ -26,11 +26,10 @@ import java.util.ArrayList; import java.util.Collection; -import java.util.HashMap; import java.util.HashSet; import java.util.List; +import java.util.Map; import java.util.Set; -import java.util.Vector; import org.argouml.profile.internal.ocl.LambdaEvaluator; import org.argouml.profile.internal.ocl.ModelInterpreter; @@ -42,13 +41,13 @@ */ public class CollectionsModelInterpreter implements ModelInterpreter { - /** + /* * @see org.argouml.profile.internal.ocl.ModelInterpreter#invokeFeature(java.util.HashMap, * java.lang.Object, java.lang.String, java.lang.String, * java.lang.Object[]) */ @SuppressWarnings("unchecked") - public Object invokeFeature(HashMap<String, Object> vt, Object subject, + public Object invokeFeature(Map<String, Object> vt, Object subject, String feature, String type, Object[] parameters) { if (subject == null) { @@ -66,15 +65,15 @@ if (subject instanceof Collection) { if (type.equals("->")) { if (feature.toString().trim().equals("select")) { - Vector<String> vars = (Vector<String>) parameters[0]; + List<String> vars = (List<String>) parameters[0]; Object exp = parameters[1]; LambdaEvaluator eval = (LambdaEvaluator) parameters[2]; Collection col = cloneCollection((Collection) subject); - Vector<Object> remove = new Vector<Object>(); + List remove = new ArrayList(); // TODO is it possible to use more than one variable? - String varName = vars.elementAt(0); + String varName = vars.get(0); Object oldVal = vt.get(varName); for (Object object : col) { @@ -94,15 +93,15 @@ return col; } else if (feature.toString().trim().equals("reject")) { - Vector<String> vars = (Vector<String>) parameters[0]; + List<String> vars = (ArrayList<String>) parameters[0]; Object exp = parameters[1]; LambdaEvaluator eval = (LambdaEvaluator) parameters[2]; Collection col = cloneCollection((Collection) subject); - Vector<Object> remove = new Vector<Object>(); + List remove = new ArrayList(); // TODO is it possible to use more than one variable? - String varName = vars.elementAt(0); + String varName = vars.get(0); Object oldVal = vt.get(varName); for (Object object : col) { @@ -120,21 +119,21 @@ return col; } else if (feature.toString().trim().equals("forAll")) { - Vector<String> vars = (Vector<String>) parameters[0]; + List<String> vars = (ArrayList<String>) parameters[0]; Object exp = parameters[1]; LambdaEvaluator eval = (LambdaEvaluator) parameters[2]; return doForAll(vt, (Collection) subject, vars, exp, eval); } else if (feature.toString().trim().equals("collect")) { - Vector<String> vars = (Vector<String>) parameters[0]; + List<String> vars = (ArrayList<String>) parameters[0]; Object exp = parameters[1]; LambdaEvaluator eval = (LambdaEvaluator) parameters[2]; Collection col = (Collection) subject; - Bag<Object> res = new HashBag<Object>(); + Bag res = new HashBag(); // TODO is it possible to use more than one variable? - String varName = vars.elementAt(0); + String varName = vars.get(0); Object oldVal = vt.get(varName); for (Object object : col) { @@ -148,14 +147,14 @@ return res; } else if (feature.toString().trim().equals("exists")) { - Vector<String> vars = (Vector<String>) parameters[0]; + List<String> vars = (ArrayList<String>) parameters[0]; Object exp = parameters[1]; LambdaEvaluator eval = (LambdaEvaluator) parameters[2]; Collection col = (Collection) subject; // TODO is it possible to use more than one variable? - String varName = vars.elementAt(0); + String varName = vars.get(0); Object oldVal = vt.get(varName); for (Object object : col) { @@ -171,7 +170,7 @@ return false; } else if (feature.toString().trim().equals("isUnique")) { - Vector<String> vars = (Vector<String>) parameters[0]; + List<String> vars = (ArrayList<String>) parameters[0]; Object exp = parameters[1]; LambdaEvaluator eval = (LambdaEvaluator) parameters[2]; @@ -179,7 +178,7 @@ Bag<Object> res = new HashBag<Object>(); // TODO is it possible to use more than one variable? - String varName = vars.elementAt(0); + String varName = vars.get(0); Object oldVal = vt.get(varName); for (Object object : col) { @@ -196,14 +195,15 @@ return true; } else if (feature.toString().trim().equals("one")) { - Vector<String> vars = (Vector<String>) parameters[0]; + // TODO: This code is cloned over and over again! - tfm + List<String> vars = (ArrayList<String>) parameters[0]; Object exp = parameters[1]; LambdaEvaluator eval = (LambdaEvaluator) parameters[2]; Collection col = (Collection) subject; // TODO is it possible to use more than one variable? - String varName = vars.elementAt(0); + String varName = vars.get(0); Object oldVal = vt.get(varName); boolean found = false; @@ -224,14 +224,14 @@ return found; } else if (feature.toString().trim().equals("any")) { - Vector<String> vars = (Vector<String>) parameters[0]; + List<String> vars = (ArrayList<String>) parameters[0]; Object exp = parameters[1]; LambdaEvaluator eval = (LambdaEvaluator) parameters[2]; Collection col = (Collection) subject; // TODO is it possible to use more than one variable? - String varName = vars.elementAt(0); + String varName = vars.get(0); Object oldVal = vt.get(varName); for (Object object : col) { @@ -342,7 +342,7 @@ if (feature.equals("prepend")) { Collection copy = cloneCollection((Collection) subject); if (copy instanceof List) { - ((List)copy).add(0, parameters[0]); + ((List) copy).add(0, parameters[0]); } else { copy.add(parameters[0]); } @@ -435,13 +435,13 @@ return null; } - private boolean doForAll(HashMap<String, Object> vt, Collection collection, - Vector<String> vars, Object exp, LambdaEvaluator eval) { + private boolean doForAll(Map<String, Object> vt, Collection collection, + List<String> vars, Object exp, LambdaEvaluator eval) { if (vars.isEmpty()) { return (Boolean) eval.evaluate(vt, exp); } else { - String var = vars.firstElement(); - vars.removeElement(var); + String var = vars.get(0); + vars.remove(var); Object oldval = vt.get(var); for (Object element : collection) { @@ -472,7 +472,7 @@ } } - /** + /* * @see org.argouml.profile.internal.ocl.ModelInterpreter#getBuiltInSymbol(java.lang.String) */ public Object getBuiltInSymbol(String sym) { Modified: trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/uml14/ModelAccessModelInterpreter.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/uml14/ModelAccessModelInterpreter.java?view=diff&rev=15924&p1=trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/uml14/ModelAccessModelInterpreter.java&p2=trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/uml14/ModelAccessModelInterpreter.java&r1=15923&r2=15924 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/uml14/ModelAccessModelInterpreter.java (original) +++ trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/uml14/ModelAccessModelInterpreter.java 2008-10-14 12:28:49-0700 @@ -1,4 +1,4 @@ -// $Id: eclipse-argo-codetemplates.xml 11347 2006-10-26 22:37:44Z linus $ +// $Id$ // Copyright (c) 2008 The Regents of the University of California. All // Rights Reserved. Permission to use, copy, modify, and distribute this // software and its documentation without fee, and without a written @@ -26,8 +26,8 @@ import java.lang.reflect.Method; import java.util.ArrayList; -import java.util.HashMap; import java.util.HashSet; +import java.util.Map; import org.apache.log4j.Logger; import org.argouml.model.Facade; @@ -52,12 +52,12 @@ private static Uml14ModelInterpreter uml14mi = new Uml14ModelInterpreter(); /* - * @see org.argouml.profile.internal.ocl.ModelInterpreter#invokeFeature(java.util.HashMap, + * @see org.argouml.profile.internal.ocl.ModelInterpreter#invokeFeature(java.util.Map, * java.lang.Object, java.lang.String, java.lang.String, * java.lang.Object[]) */ @SuppressWarnings("unchecked") - public Object invokeFeature(HashMap<String, Object> vt, Object subject, + public Object invokeFeature(Map<String, Object> vt, Object subject, String feature, String type, Object[] parameters) { if (subject == null) { @@ -103,6 +103,7 @@ if (feature.equals("multiplicity")) { return Model.getFacade().getMultiplicity(subject); } + // TODO: isStatic in UML 2.x if (feature.equals("targetScope")) { return Model.getFacade().getTargetScope(subject); } @@ -680,6 +681,7 @@ if (feature.equals("ordering")) { return Model.getFacade().getOrdering(subject); } + // TODO: Removed from UML 2.x if (feature.equals("targetScope")) { return Model.getFacade().getTargetScope(subject); } @@ -787,7 +789,7 @@ return null; } - private Object internalOcl(Object subject, HashMap<String, Object> vt, + private Object internalOcl(Object subject, Map<String, Object> vt, String ocl) { try { Object oldSelf = vt.get("self"); Modified: trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/uml14/OclAPIModelInterpreter.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/uml14/OclAPIModelInterpreter.java?view=diff&rev=15924&p1=trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/uml14/OclAPIModelInterpreter.java&p2=trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/uml14/OclAPIModelInterpreter.java&r1=15923&r2=15924 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/uml14/OclAPIModelInterpreter.java (original) +++ trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/uml14/OclAPIModelInterpreter.java 2008-10-14 12:28:49-0700 @@ -1,4 +1,4 @@ -// $Id: eclipse-argo-codetemplates.xml 11347 2006-10-26 22:37:44Z linus $ +// $Id$ // Copyright (c) 2008 The Regents of the University of California. All // Rights Reserved. Permission to use, copy, modify, and distribute this // software and its documentation without fee, and without a written @@ -25,7 +25,7 @@ package org.argouml.profile.internal.ocl.uml14; import java.lang.reflect.Method; -import java.util.HashMap; +import java.util.Map; import org.apache.log4j.Logger; import org.argouml.model.Facade; @@ -45,12 +45,12 @@ private static final Logger LOG = Logger .getLogger(OclAPIModelInterpreter.class); - /** - * @see org.argouml.profile.internal.ocl.ModelInterpreter#invokeFeature(java.util.HashMap, + /* + * @see org.argouml.profile.internal.ocl.ModelInterpreter#invokeFeature(java.util.Map, * java.lang.Object, java.lang.String, java.lang.String, * java.lang.Object[]) */ - public Object invokeFeature(HashMap<String, Object> vt, Object subject, + public Object invokeFeature(Map<String, Object> vt, Object subject, String feature, String type, Object[] parameters) { if (type.equals(".")) { // TODO implement the difference between oclIsKindOf and oclIsTypeOf @@ -119,7 +119,7 @@ return null; } - /** + /* * @see org.argouml.profile.internal.ocl.ModelInterpreter#getBuiltInSymbol(java.lang.String) */ public Object getBuiltInSymbol(String sym) { Modified: trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/uml14/Uml14ModelInterpreter.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/uml14/Uml14ModelInterpreter.java?view=diff&rev=15924&p1=trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/uml14/Uml14ModelInterpreter.java&p2=trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/uml14/Uml14ModelInterpreter.java&r1=15923&r2=15924 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/uml14/Uml14ModelInterpreter.java (original) +++ trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/uml14/Uml14ModelInterpreter.java 2008-10-14 12:28:49-0700 @@ -1,4 +1,4 @@ -// $Id: eclipse-argo-codetemplates.xml 11347 2006-10-26 22:37:44Z linus $ +// $Id$ // Copyright (c) 2008 The Regents of the University of California. All // Rights Reserved. Permission to use, copy, modify, and distribute this // software and its documentation without fee, and without a written @@ -25,7 +25,7 @@ package org.argouml.profile.internal.ocl.uml14; import java.util.Collection; -import java.util.HashMap; +import java.util.Map; import org.apache.log4j.Logger; import org.argouml.model.Model; @@ -53,12 +53,14 @@ addModelInterpreter(new CollectionsModelInterpreter()); } - public Object invokeFeature(HashMap<String, Object> vt, Object subject, + @Override + public Object invokeFeature(Map<String, Object> vt, Object subject, String feature, String type, Object[] parameters) { - Object ret = super.invokeFeature(vt, subject, feature, type, parameters); - + Object ret = super + .invokeFeature(vt, subject, feature, type, parameters); + LOG.debug(toString(subject) + type + feature + " ==> " + toString(ret)); - + return ret; } @@ -66,16 +68,16 @@ if (Model.getFacade().isAModelElement(obj)) { return Model.getFacade().getName(obj); } else if (obj instanceof Collection) { - return colToString((Collection)obj); + return colToString((Collection) obj); } else { - return ""+obj; + return "" + obj; } } private String colToString(Collection collection) { String ret = "["; for (Object object : collection) { - ret += toString(object) +","; + ret += toString(object) + ","; } return ret + "]"; } Modified: trunk/src/argouml-app/src/org/argouml/ui/explorer/rules/GoProfileToCritics.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/ui/explorer/rules/GoProfileToCritics.java?view=diff&rev=15924&p1=trunk/src/argouml-app/src/org/argouml/ui/explorer/rules/GoProfileToCritics.java&p2=trunk/src/argouml-app/src/org/argouml/ui/explorer/rules/GoProfileToCritics.java&r1=15923&r2=15924 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/ui/explorer/rules/GoProfileToCritics.java (original) +++ trunk/src/argouml-app/src/org/argouml/ui/explorer/rules/GoProfileToCritics.java 2008-10-14 12:28:49-0700 @@ -24,10 +24,10 @@ package org.argouml.ui.explorer.rules; +import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Set; -import java.util.Vector; import org.argouml.cognitive.Critic; import org.argouml.i18n.Translator; @@ -38,7 +38,7 @@ * * @author maurelio1234 */ -public class GoProfileToCritics extends AbstractPerspectiveRule{ +public class GoProfileToCritics extends AbstractPerspectiveRule { /* * @see org.argouml.ui.explorer.rules.PerspectiveRule#getRuleName() @@ -52,20 +52,18 @@ */ public Collection getChildren(final Object parent) { if (parent instanceof Profile) { - Object critics = new Vector<Critic>() { + Object critics = new ArrayList<Critic>() { { addAll(((Profile) parent).getCritics()); } - /* - * @see java.util.Vector#toString() - */ + @Override public String toString() { return Translator.localize("misc.profile.explorer.critic"); } }; - Vector<Object> ret = new Vector<Object>(); + Collection ret = new ArrayList<Object>(); ret.add(critics); return ret; } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
