svn commit: r12906 - trunk/src_new/org/argouml/language/java/generator/GeneratorJava.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: mvw
Date: 2007-06-24 11:05:13-0700
New Revision: 12906

Modified:
   trunk/src_new/org/argouml/language/java/generator/GeneratorJava.java

Log:
Remove a dependency by removing unused code. Java source can not contain guillemots.

Modified: trunk/src_new/org/argouml/language/java/generator/GeneratorJava.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/language/java/generator/GeneratorJava.java?view=diff&rev=12906&p1=trunk/src_new/org/argouml/language/java/generator/GeneratorJava.java&p2=trunk/src_new/org/argouml/language/java/generator/GeneratorJava.java&r1=12905&r2=12906
==============================================================================
--- trunk/src_new/org/argouml/language/java/generator/GeneratorJava.java	(original)
+++ trunk/src_new/org/argouml/language/java/generator/GeneratorJava.java	2007-06-24 11:05:13-0700
@@ -47,9 +47,6 @@
 import org.argouml.application.helpers.ApplicationVersion;
 import org.argouml.application.helpers.ResourceLoaderWrapper;
 import org.argouml.configuration.Configuration;
-import org.argouml.kernel.Project;
-import org.argouml.kernel.ProjectManager;
-import org.argouml.kernel.ProjectSettings;
 import org.argouml.model.Model;
 import org.argouml.moduleloader.ModuleInterface;
 import org.argouml.ocl.ArgoFacade;
@@ -2042,40 +2039,45 @@
     }
 
     private String generateStereotype(Object st) {
-        if (st == null)
-            return "";
-        Project project = 
-            ProjectManager.getManager().getCurrentProject();
-        ProjectSettings ps = project.getProjectSettings();
-        if (Model.getFacade().isAModelElement(st)) {
-            if (Model.getFacade().getName(st) == null)
-                return ""; // Patch by Jeremy Bennett
-            if (Model.getFacade().getName(st).length() == 0)
-                return "";
-            return ps.getLeftGuillemot()
-                + generateName(Model.getFacade().getName(st))
-                + ps.getRightGuillemot();
-        }
-        if (st instanceof Collection) {
-            Object o;
-            StringBuffer sb = new StringBuffer(10);
-            boolean first = true;
-            Iterator iter = ((Collection) st).iterator();
-            while (iter.hasNext()) {
-                if (!first)
-                    sb.append(',');
-                o = iter.next();
-                if (o != null) {
-                    sb.append(generateName(Model.getFacade().getName(o)));
-                    first = false;
-                }
-            }
-            if (!first) {
-                return ps.getLeftGuillemot()
-                    + sb.toString()
-                    + ps.getRightGuillemot();
-            }
-        }
+        /*
+         * TODO: This code is not used. Why is it here?
+         * It causes an unwanted dependency 
+         * to the org.argouml.kernel. (Project,...)
+         * */
+//        if (st == null)
+//            return "";
+//        Project project = 
+//            ProjectManager.getManager().getCurrentProject();
+//        ProjectSettings ps = project.getProjectSettings();
+//        if (Model.getFacade().isAModelElement(st)) {
+//            if (Model.getFacade().getName(st) == null)
+//                return ""; // Patch by Jeremy Bennett
+//            if (Model.getFacade().getName(st).length() == 0)
+//                return "";
+//            return ps.getLeftGuillemot()
+//                + generateName(Model.getFacade().getName(st))
+//                + ps.getRightGuillemot();
+//        }
+//        if (st instanceof Collection) {
+//            Object o;
+//            StringBuffer sb = new StringBuffer(10);
+//            boolean first = true;
+//            Iterator iter = ((Collection) st).iterator();
+//            while (iter.hasNext()) {
+//                if (!first)
+//                    sb.append(',');
+//                o = iter.next();
+//                if (o != null) {
+//                    sb.append(generateName(Model.getFacade().getName(o)));
+//                    first = false;
+//                }
+//            }
+//            if (!first) {
+//                return ps.getLeftGuillemot()
+//                    + sb.toString()
+//                    + ps.getRightGuillemot();
+//            }
+//        }
         return "";
     }
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.