[Uml-devel] [Bug 123661] New: Java import fails at abstract methods or interfaces

Harald Herres harald.herres at control.de
Thu Mar 16 05:05:02 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=123661         
           Summary: Java import fails at abstract methods or interfaces
           Product: umbrello
           Version: unspecified
          Platform: unspecified
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
        AssignedTo: umbrello-devel.kde.org
        ReportedBy: harald.herres control de


Version:           1.5.1 (using KDE 3.4.2 Level "b" , SUSE 10.0)
Compiler:          Target: x86_64-suse-linux
OS:                Linux (x86_64) release 2.6.13-15.8-smp

Importing interfaces will stop after the first method declaration.
After the import finds a method declaration it assumes that this declaration is always stopped by a '}'. But this is not true. Abstract methods are stopped with the trailing ';'.

I have a solution to provide. I'm not familiar with diff/patch so i provide the following snippet. I hope that one of the maintainers can use it.

File: javaimport.cpp Line: 313

        Import_Utils::insertMethod(m_klass, op, Uml::Visibility::Public, typeName,
                                   m_isStatic, m_isAbstract, false /*isFriend*/,
                                   false /*isConstructor*/, m_comment);
        m_isAbstract = m_isStatic = false;

// -------------------------------
// At this point we do not know wether the method has a body or not
// 15.3.2006 H. Herres

        nextToken = advance();
        while (nextToken != "{" && nextToken != ";") {
            nextToken = advance();
        }
        if (nextToken == ";") {
            // No body (interface or abstract)
            return true;
        } else {
            return skipToClosing('{');
        }
//------------------------------
    }

    // At this point we know it's some kind of attribute declaration.
    while (1) {
        while (nextToken != "," && nextToken != ";") {
            name += nextToken;  // add possible array dimensions to `name'
            nextToken = advance();
        }




More information about the umbrello-devel mailing list