[Issue 6520] New - Several log refactoring/improvement suggestions

[email protected] Tue, 25 Oct 2016 21:55:22 -0700 (PDT)
Newsgroups gmane.comp.lang.uml.argouml.issues
Message-ID <[email protected]>
http://argouml.tigris.org/issues/show_bug.cgi?id=6520
                 Issue #|6520
                 Summary|Several log refactoring/improvement suggestions
               Component|argouml
                 Version|0.35.1
                Platform|All
                     URL|
              OS/Version|All
                  Status|NEW
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|DEFECT
                Priority|P3
            Subcomponent|Other
             Assigned to|linus
             Reported by|chenfsd






------- Additional comments from [email protected] Tue Oct 25 21:55:21 -0700 2016 -------
-------------------------------------------
Method invocation replaced by variable
-------------------------------------------
file: ArgoUML-0.35.1-src/argouml/src/argouml-core-model-
mdr/src/org/argouml/model/mdr/ModelEventPumpMDRImpl.java|
line 504,
the log line contains: (RefBaseObject) event.getSource()).refMofId()
However, in above there is a line of code:
String mofId = ((RefBaseObject) event.getSource()).refMofId();
Therefore we should replace this method invocation by mofId for the sake of 
simplicity and readability.
Similar in line 518

-------------------------------------------
Method invocation in return statement
-------------------------------------------
file:ArgoUML-0.35.1-src/argouml/src/argouml-
app/src/org/argouml/kernel/ProjectImpl.java
line 543-545:
LOG.log(Level.SEVERE,"Exception when fetching models from profile " + 
profile.getDisplayName(),e);

variable profile is an instance of class Profile
in file: ArgoUML-0.35.1-src/argouml/src/argouml-
app/src/org/argouml/profile/Profile.java

We can know that toString method returns "getDisplayName"
Therefore we should change profile.getDisplayName() -> profile for the sake of 
simplicity and readability
-------------------------------------------
Check if variable is null
-------------------------------------------
file: ArgoUML-0.35.1-src/argouml/src/argouml-
app/src/org/argouml/uml/diagram/use_case/ui/UMLUseCaseDiagram.java

line 541:
LOG.log(Level.FINE,"Dropped object NOT added {0}",figNode);

"figNode" must be null in this, consider remove or replace it.

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=448&dsMessageId=3191741

To unsubscribe from this list, e-mail: [[email protected]].
Please do not reply to this mail. Instead, add your comments in the issue.