Menu ▾ ▴

#1 Odd code

open
nobody
None
5
2004-11-22
2004-11-22
No

This else statement can't possibly be right
as figComponentInstance will be null

public VectorSet computeOffenders
(UMLDeploymentDiagram deploymentDiagram) {

.....

    if \(figComponentInstance \!= null\) \{
    Object coi = /\*

(MComponentInstance)*/

figComponentInstance.getOwner();
if (coi != null) {
Collection col =
ModelFacade.getClassifiers(coi);
if (col.size() > 0) continue;
}
if (offs == null) {
offs = new VectorSet();
offs.addElement
(deploymentDiagram);
}
offs.addElement
(figComponentInstance);
} else if
(figComponentInstance.getEnclosingFig() != null
&&
((ModelFacade.getNodeInstance(

figComponentInstance.getOwner()))
== null)) {
if (offs == null) {
offs = new VectorSet();
offs.addElement
(deploymentDiagram);
}
offs.addElement
(figComponentInstance);
}
}

return offs;

}

Discussion

  • Markus Klink

    Markus Klink - 2005-02-24

    Logged In: YES
    user_id=289176

    please file bug reports at argouml.tigris.org
    Unfortunately you also did not mention in which class you
    did find the code, though I had a quick look at relevant
    critic classes, but did not find the code. Might have been
    refactored in the meantime.

     
  • Dave Brosius

    Dave Brosius - 2005-02-25

    Logged In: YES
    user_id=66596

    Sorry, that was silly of me.

    I did a cvs update, and the problem seems to still be there.

    the file is

    src_new\org\argouml\uml\cognitive\critics\CrComponentInstanceWithoutClassifier.java

    in version 1.18 of this file it's on line 129
    ----------

    thanks i'll go to argouml.tigris.org

     

Log in to post a comment.