[Uml-devel] branches/KDE/3.5/kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Sat Jul 15 23:52:11 UTC 2006


SVN commit 562848 by okellogg:

parseStmt(): Patch by JP Fournier cleans up constructor detection and
token lookahead logic.
CCCBUG:130792


 M  +10 -9     javaimport.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/umbrello/javaimport.cpp #562847:562848
@@ -285,24 +285,25 @@
         return false;
     }
     QString typeName = joinTypename();
-    QString name;
-    if (m_klass != NULL && typeName == m_klass->getName()) {
+    // At this point we need a class.
+    if (m_klass == NULL) {
+        kdError() << "importJava: no class set for " << typeName << endl;
+        return false;
+    }
+    QString name = advance();
+    QString nextToken;
+    if (typeName == m_klass->getName() && name == "(") {
         // Constructor.
+        nextToken = name;
         name = typeName;
         typeName = QString::null;
     } else {
-        name = advance();
+        nextToken = advance();
     }
     if (name.contains( QRegExp("\\W") )) {
         kdError() << "importJava: expecting name in " << name << endl;
         return false;
     }
-    // At this point we need a class.
-    if (m_klass == NULL) {
-        kdError() << "importJava: no class set for " << name << endl;
-        return false;
-    }
-    QString nextToken = advance();
     if (nextToken == "(") {
         // operation
         UMLOperation *op = Import_Utils::makeOperation(m_klass, name);




More information about the umbrello-devel mailing list