svn commit: r15686 - trunk/src/argouml-app/src/org/argouml/uml/reveng/java/JavaImport.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: thn
Date: 2008-09-08 23:00:11-0700
New Revision: 15686

Modified:
   trunk/src/argouml-app/src/org/argouml/uml/reveng/java/JavaImport.java

Log:
fix for Issue 5376: Java import of sources: import of method bodies broken

Modified: trunk/src/argouml-app/src/org/argouml/uml/reveng/java/JavaImport.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/reveng/java/JavaImport.java?view=diff&rev=15686&p1=trunk/src/argouml-app/src/org/argouml/uml/reveng/java/JavaImport.java&p2=trunk/src/argouml-app/src/org/argouml/uml/reveng/java/JavaImport.java&r1=15685&r2=15686
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/reveng/java/JavaImport.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/reveng/java/JavaImport.java	2008-09-08 23:00:11-0700
@@ -219,8 +219,7 @@
      * @param settings
      *            the user provided import settings
      * @param pass
-     *            current import pass - 0 = single pass, 1 = pass 1 of 2, 2 =
-     *            pass 2 of 2
+     *            current import pass - 0 = pass 1, 1 = pass 2
      */
     private void parseFile(Project p, File f, ImportSettings settings, int pass)
         throws ImportException {
@@ -265,8 +264,17 @@
             // exceptions to the file.
             LOG.info("Parsing " + f.getAbsolutePath());
 
+            // Calculate the import level
+            int level = 0;
+            int importlevel = settings.getImportLevel();
+            if (importlevel == ImportSettings.DETAIL_CLASSIFIER_FEATURE) {
+                level = 1;
+            } else if (importlevel == ImportSettings.DETAIL_FULL) {
+                // full level only needed for the second pass
+                level = (pass == 0) ? 0 : 2;
+            }
             modeller.setAttribute("level", 
-                    Integer.valueOf(pass));
+                    Integer.valueOf(level));
 
             try {
                 // start parsing at the compilationUnit rule
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.