Changeset 667

Show
Ignore:
Timestamp:
11/09/06 13:47:36 (4 years ago)
Author:
emanuel
Message:

code style

Location:
Jupe/src/org/jupe
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • Jupe/src/org/jupe/editors/classdiagram/model/nodes/MethodElement.java

    r663 r667  
    3838import org.jupe.editors.classdiagram.model.validators.ParameterListValidator; 
    3939import org.jupe.editors.classdiagram.model.validators.TypeNameValidator; 
    40 import org.jupe.plugin.JupeLog; 
    4140import org.jupe.plugin.exceptions.JupeExceptionLogOnly; 
    4241import org.jupe.synchronisation.Util; 
  • Jupe/src/org/jupe/plugin/JupeLog.java

    r582 r667  
    8080                logList.add(message); 
    8181                if (shouldBePrinted) { 
    82                         System.out.println("[debug] " + message); 
     82                        System.out.println(new StringBuffer("[debug] ").append(message)); 
    8383                } 
    8484        } 
  • Jupe/src/org/jupe/uml2model/UML2ModelRoot.java

    r662 r667  
    237237                // .uml2 
    238238                // files for synchronization 
    239                 String id; 
     239                StringBuffer id; 
    240240 
    241241                if (isConnection(element)) { 
    242                         id = element.getClass().getSimpleName() + "_" + element.hashCode() 
    243                                         + "_" + System.currentTimeMillis(); 
     242                        id = new StringBuffer(element.getClass().getSimpleName()); 
     243                        id.append("_"); 
     244                        id.append(element.hashCode()); 
     245                        id.append("_"); 
     246                        id.append(System.currentTimeMillis()); 
    244247                } else if (element instanceof NamedElement) { 
    245                         id = getAbsoluteName((NamedElement) element) + "_" 
    246                                         + element.hashCode(); 
     248                        id = new StringBuffer(getAbsoluteName((NamedElement) element)); 
     249                        id.append("_"); 
     250                        id.append(element.hashCode()); 
    247251                } else { 
    248                         id = "unnamed_element_" + element.hashCode(); 
    249                 } 
    250                 addToIDHash(id, element); 
     252                        id = new StringBuffer("unnamed_element_") 
     253                                        .append(element.hashCode()); 
     254                } 
     255                addToIDHash(id.toString(), element); 
    251256        } 
    252257 
     
    294299         *         hidden packages and noHiddenPackage is true. 
    295300         */ 
    296         public String getAbsoluteName(NamedElement element, 
     301        public String getAbsoluteName(final NamedElement element, 
    297302                        final boolean noHiddenPackages) { 
    298303                if (element.equals(model)) { 
     
    314319                } 
    315320 
    316                 while (((element = (NamedElement) element.getOwner()) != null) 
    317                                 && !element.equals(model)) { 
    318                         name = element.getName() + "." + name; 
     321                // old code: does the new one work? 
     322                /* 
     323                 * while (((element = (NamedElement) element.getOwner()) != null) && 
     324                 * !element.equals(model)) { name = element.getName() + "." + name; } 
     325                 */ 
     326 
     327                NamedElement tempElement = element; 
     328 
     329                while (true) { 
     330                        tempElement = (NamedElement) tempElement.getOwner(); 
     331                        if (tempElement == null || tempElement.equals(model)) { 
     332                                break; 
     333                        } 
     334                        name = new StringBuffer(tempElement.getName()).append(".").append( 
     335                                        name).toString(); 
    319336                } 
    320337 
     
    617634                        if (!(structuralFeature.getFeatureID() == UMLPackage.TYPED_ELEMENT__TYPE || structuralFeature 
    618635                                        .getFeatureID() == UMLPackage.INSTANCE_SPECIFICATION__CLASSIFIER)) { 
    619                                 JupePlugin.getDefault().println( 
    620                                                 "Skipping feature " + structuralFeature.getName() 
    621                                                                 + " (" + structuralFeature.getFeatureID() 
    622                                                                 + ") " + " while searching references to type"); 
     636                                JupePlugin 
     637                                                .getDefault() 
     638                                                .println( 
     639                                                                new StringBuffer("Skipping feature ") 
     640                                                                                .append(structuralFeature.getName()) 
     641                                                                                .append(" (") 
     642                                                                                .append( 
     643                                                                                                structuralFeature 
     644                                                                                                                .getFeatureID()) 
     645                                                                                .append( 
     646                                                                                                ") while searching references to type")); 
    623647                                continue; 
    624648                        }