[Uml-devel] [Bug 130735] New: Importing java files that reference their own class name (eg. singleton objects) crashes umbrello
Clinton Grant
clintgr at hotmail.com
Thu Jul 13 03:32:18 UTC 2006
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=130735
Summary: Importing java files that reference their own class name
(eg. singleton objects) crashes umbrello
Product: umbrello
Version: unspecified
Platform: Fedora RPMs
OS/Version: Linux
Status: UNCONFIRMED
Severity: crash
Priority: NOR
Component: general
AssignedTo: umbrello-devel.kde.org
ReportedBy: clintgr hotmail com
Version: 1.5.3 (using KDE KDE 3.5.3)
Installed from: Fedora RPMs
Compiler: gcc 4.1.1
OS: Linux
I have patched my version of the source to include the changes in 1.5.4 for java import issues.
However, if you import this code umbrello will crash:
public class TestClass
{
public TestClass getInstance ()
{
return instance;
}
private TestClass()
{
}
public void SomeMethod()
{
}
String aString;
String anotherString;
TestClass instance = new TestClass();
}
I debugged the crash, and it can be prevented with this change:
@ -286,7 +286,7 @
}
QString typeName = joinTypename();
QString name;
- if ( (typeName == m_klass->getName())) {
+ if ((m_klass != NULL) && (typeName == m_klass->getName())) {
// Constructor.
name = typeName;
typeName = QString::null;
If this is done, the import still doesn't work because the importer gets confused over the getInstance method and instance member. This appears to be because the class is referencing instances of itself.
More information about the umbrello-devel
mailing list