svn commit: r15560 - trunk/src/argouml-app/src/org/argouml/notation/providers/java/NotationUtilityJava.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: mvw
Date: 2008-08-13 11:50:15-0700
New Revision: 15560

Modified:
   trunk/src/argouml-app/src/org/argouml/notation/providers/java/NotationUtilityJava.java

Log:
Fix for issue 5234: Changeability displayed improperly.
Patch was provided by Bogdan Szanto.

Modified: trunk/src/argouml-app/src/org/argouml/notation/providers/java/NotationUtilityJava.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/notation/providers/java/NotationUtilityJava.java?view=diff&rev=15560&p1=trunk/src/argouml-app/src/org/argouml/notation/providers/java/NotationUtilityJava.java&p2=trunk/src/argouml-app/src/org/argouml/notation/providers/java/NotationUtilityJava.java&r1=15559&r2=15560
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/notation/providers/java/NotationUtilityJava.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/notation/providers/java/NotationUtilityJava.java	2008-08-13 11:50:15-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2006-2007 The Regents of the University of California. All
+// Copyright (c) 2006-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
 // agreement is hereby granted, provided that the above copyright notice
@@ -116,7 +116,7 @@
      */
     static String generateChangeability(Object obj) {
         if (Model.getFacade().isAAttribute(obj)) {
-            if (!Model.getFacade().isReadOnly(obj)) {
+            if (Model.getFacade().isReadOnly(obj)) {
                 return "final ";
             }
         } else {
@@ -130,23 +130,26 @@
     }
     
     static String generateClassifierRef(Object cls) {
-        if (cls == null)
+        if (cls == null) {
             return "";
+        }
         return Model.getFacade().getName(cls);
     }
     
     static String generateExpression(Object expr) {
-        if (Model.getFacade().isAExpression(expr))
+        if (Model.getFacade().isAExpression(expr)) {
             return generateUninterpreted(
                     (String) Model.getFacade().getBody(expr));
-        else if (Model.getFacade().isAConstraint(expr))
+        } else if (Model.getFacade().isAConstraint(expr)) {
             return generateExpression(Model.getFacade().getBody(expr));
+        }
         return "";
     }
     
     static String generateUninterpreted(String un) {
-        if (un == null)
+        if (un == null) {
             return "";
+        }
         return un;
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.