Version: svn - 563616 (using KDE KDE 3.5.0) Installed from: Slackware Packages Compiler: gcc 3.4.4 OS: Linux steps to reproduce: - import the class Int3 first - then import Int1 results: - Int1 is treated as a class and not an interface --------------- package test; public interface Int3{ public void update(Int1 value); } ------------------- package test; public interface Int1{ public void update(); }
The patch below seems to fix this bug: diff -c svn/kdesdk/umbrello/umbrello/codeimport/javaimport.cpp kdesdk/umbrello/umbrello/codeimport/javaimport.cpp *** svn/kdesdk/umbrello/umbrello/codeimport/javaimport.cpp 2006-07-17 20:35:57.000000000 -0400 --- kdesdk/umbrello/umbrello/codeimport/javaimport.cpp 2006-07-17 20:55:51.000000000 -0400 *************** *** 156,161 **** --- 156,164 ---- m_klass->setAbstract(m_isAbstract); m_klass->setStatic(m_isStatic); m_klass->setVisibility(m_currentAccess); + // the UMLObject found by createUMLObject might originally have been created as a placeholder + // with a type of class but if is really an interface, then we need to change it + m_klass->setInterface( keyword == "interface" ); m_isAbstract = m_isStatic = false; if (advance() == ";") // forward declaration return true;
SVN commit 563652 by okellogg: parseStmt(): The UMLObject found by createUMLObject might originally have been created as a placeholder with a type of ot_Class but if is really an interface, then we need to change it. Thanks to JP Fournier for the fix. BUG:131006 M +1 -0 ChangeLog M +4 -0 umbrello/codeimport/javaimport.cpp --- branches/KDE/3.5/kdesdk/umbrello/ChangeLog #563651:563652 @@ -12,6 +12,7 @@ * Java import: method and class visibility ignored (130794) * Java import - static not handled correctly (130926) * Java import - package visibility incorrectly represented (130932) +* Java import - random import order can result in interface being teated as class (131006) Version 1.5.3 --- branches/KDE/3.5/kdesdk/umbrello/umbrello/codeimport/javaimport.cpp #563651:563652 @@ -156,6 +156,10 @@ m_klass->setAbstract(m_isAbstract); m_klass->setStatic(m_isStatic); m_klass->setVisibility(m_currentAccess); + // The UMLObject found by createUMLObject might originally have been created as a + // placeholder with a type of class but if is really an interface, then we need to + // change it. + m_klass->setInterface(keyword == "interface"); m_isAbstract = m_isStatic = false; if (advance() == ";") // forward declaration return true;