[Uml-devel] branches/KDE/3.5/kdesdk/umbrello/umbrello/codeimport
Oliver Kellogg
okellogg at users.sourceforge.net
Sun Aug 6 00:36:54 UTC 2006
SVN commit 570178 by okellogg:
>From JP Fournier 2006/08/05 16:09:31
>
> Umbrello 1.5.4 svn hangs when I try to import the class below.
> It gets confused on the code block within a static block:
>
> package pack1;
> public class PackStatic {
> private static int count;
> static {
> for (int counter=0; counter < 7; counter ++ ) {
> count+=counter;
> }
> }
> PackStatic() {
> }
> private int getInt() {
> return 7;
> }
> }
>
> This patch fixes this problem.
M +6 -0 javaimport.cpp
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/codeimport/javaimport.cpp #570177:570178
@@ -375,6 +375,12 @@
m_isStatic = true;
return true;
}
+ // if we detected static previously and keyword is { then this is a static block
+ if (m_isStatic && keyword == "{") {
+ // reset static flag and jump to end of static block
+ m_isStatic = false;
+ return skipToClosing('{');
+ }
if (keyword == "abstract") {
m_isAbstract = true;
return true;
More information about the umbrello-devel
mailing list