svn commit: r13758 - trunk/src_new/org/argouml/notation/providers/uml/OperationNotationUml.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: penyaskito
Date: 2007-11-11 07:10:52-0800
New Revision: 13758

Modified:
   trunk/src_new/org/argouml/notation/providers/uml/OperationNotationUml.java

Log:
Fix for issue 4906: A operation with no return param shows like op() instead of op():

Modified: trunk/src_new/org/argouml/notation/providers/uml/OperationNotationUml.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/notation/providers/uml/OperationNotationUml.java?view=diff&rev=13758&p1=trunk/src_new/org/argouml/notation/providers/uml/OperationNotationUml.java&p2=trunk/src_new/org/argouml/notation/providers/uml/OperationNotationUml.java&r1=13757&r2=13758
==============================================================================
--- trunk/src_new/org/argouml/notation/providers/uml/OperationNotationUml.java	(original)
+++ trunk/src_new/org/argouml/notation/providers/uml/OperationNotationUml.java	2007-11-11 07:10:52-0800
@@ -538,9 +538,17 @@
                         }
                         returnParasSb.append(",");
                     }
-                    returnParasSb.delete(
-                            returnParasSb.length() - 1,
-                            returnParasSb.length());
+                    // if we have only one return value and without type,
+                    // the return param string is ": ,", we remove it
+                    if (returnParasSb.length() == 3) {
+                        returnParasSb.delete(0, returnParasSb.length());
+                    }
+                    // else: we remove only the extra ","
+                    else {
+                        returnParasSb.delete(
+                                returnParasSb.length() - 1,
+                                returnParasSb.length());
+                    }
                 }
             }
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.