Version: compiled snapshot - kdesdk-561582 - umbrello 1.5.4 (using KDE KDE 3.5.0) Installed from: Slackware Packages Compiler: gcc 3.4.4 OS: Linux importing this class causes umbrello to prompt for seversl class names and then the gui hangs. import java.io.*; public final class Visibility implements Serializable { public static final Visibility PUBLIC = new Visibility("public", "public" ); public static final Visibility PROTECTED = new Visibility("protected", "protected" ); public static final Visibility PRIVATE = new Visibility("private", "private" ); public static final Visibility PACKAGE = new Visibility ("", "package" ); private static Visibility[] all = { PUBLIC, PROTECTED, PRIVATE, PACKAGE }; private String value; private String display; private Visibility( String newValue, String newDisplay ) { value = newValue; display = newDisplay; } public String toString() { return display; } public String getValue() { return value; } public boolean isValidForClass() { return ( this != PROTECTED ); } public static Visibility[] getAllValues() { return all; } public Visibility internalize() { for (int index=0; index < all.length; index ++ ) if ( all[index].value.equals( this.value ) ) return all[index]; return PACKAGE; } // private void writeObject(java.io.ObjectOutputStream out) // throws IOException { // // out.writeUTF( name ); // } // // private void readObject(java.io.ObjectInputStream in) // throws IOException, ClassNotFoundException { // name = in.readUTF(); // } // }
The patch below seems to address the crashiness associated with this bug. regards jp jape@puma:~/tmp/uml/kdesdk-561582$ diff -c umbrello-561582/umbrello/javaimport.cpp umbrello/umbrello/javaimport.cpp *** umbrello-561582/umbrello/javaimport.cpp 2006-07-15 07:24:49.000000000 -0400 --- umbrello/umbrello/javaimport.cpp 2006-07-15 12:17:29.000000000 -0400 *************** *** 285,297 **** return false; } QString typeName = joinTypename(); ! QString name; ! if (typeName == m_klass->getName()) { // Constructor. name = typeName; typeName = QString::null; } else { ! name = advance(); } if (name.contains( QRegExp("\\W") )) { kdError() << "importJava: expecting name in " << name << endl; --- 285,299 ---- return false; } QString typeName = joinTypename(); ! QString name = advance(); ! QString nextToken ; ! if ((typeName == m_klass->getName()) && (name == "(") ) { // Constructor. + nextToken = name; name = typeName; typeName = QString::null; } else { ! nextToken = advance(); } if (name.contains( QRegExp("\\W") )) { kdError() << "importJava: expecting name in " << name << endl; *************** *** 302,308 **** kdError() << "importJava: no class set for " << name << endl; return false; } - QString nextToken = advance(); if (nextToken == "(") { // operation UMLOperation *op = Import_Utils::makeOperation(m_klass, name); --- 304,309 ----
Applied in r562848, thanks.
SVN commit 562901 by okellogg: It doesn't crash or freeze for me now, thanks again JP. BUG:130792 M +1 -0 ChangeLog M +1 -0 THANKS --- branches/KDE/3.5/kdesdk/umbrello/ChangeLog #562900:562901 @@ -4,6 +4,7 @@ * Fix crash when importing classes from a java file (129107, 130093) * Crash after single click on the "UML Model" tree window (126560/129252) * Cannot insert transition/association TO fork/join node in activity diagram (129914) +* Importing java class (enum pattern) cause umbrello to hang (130792) * Importing java subinterface before superinterface results in superinterface not being treated as an interface (130793) * Java import: method and class visibility ignored (130794) --- branches/KDE/3.5/kdesdk/umbrello/THANKS #562900:562901 @@ -29,6 +29,7 @@ Jean-Remy Falleri <jr.falleri @gmail.com> Andi Fischer <andi.fischer @hispeed.ch> Pascal Fleury <fleury @users.sourceforge.net> +JP Fournier (jfournier121 @rogers.com) Gregorio Guidi <g.guidi @sns.it> Esben Mose Hansen <esben @despammed.com> Olaf Hartig <OleBowle @gmx.de>