Bug 132657 - java import - static member vars ignored in interfaces
Summary: java import - static member vars ignored in interfaces
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Slackware Linux
: NOR normal
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-19 22:12 UTC by JP Fournier
Modified: 2006-08-21 21:54 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description JP Fournier 2006-08-19 22:12:13 UTC
Version:           1.5.4+ : svn 571261 (using KDE KDE 3.5.0)
Installed from:    Slackware Packages
Compiler:          gcc 
OS:                Linux

In java, interfaces can contain public static member vars.
Importing the class below into umbrello results in the loss of the member vars:



public interface StaticInterface {

	public static final String val1 = "hey";

	public void aMethod();



}
Comment 1 Oliver Kellogg 2006-08-21 21:54:38 UTC
SVN commit 575626 by okellogg:

insertAttribute(): According to JP Fournier, attributes are legitimate members
 of interfaces in Java.
BUG:132657


 M  +1 -0      ChangeLog  
 M  +2 -1      umbrello/codeimport/import_utils.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/ChangeLog #575625:575626
@@ -10,6 +10,7 @@
 * Java import - array types not resolved correctly (132035)
 * Java import - "final" and comments in method declaration
   not parsed correctly (132174)
+* Java import - static member vars ignored in interfaces (132657)
 
 Version 1.5.4
 
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/codeimport/import_utils.cpp #575625:575626
@@ -236,7 +236,8 @@
                                         UMLClassifier *attrType, QString comment /* ="" */,
                                         bool isStatic /* =false */) {
     Uml::Object_Type ot = owner->getBaseType();
-    if (ot != Uml::ot_Class) {
+    Uml::Programming_Language pl = UMLApp::app()->getActiveLanguage();
+    if (ot != Uml::ot_Class && pl != Uml::pl_Java) {
         kdDebug() << "insertAttribute: Don't know what to do with "
         << owner->getName() << " (object type " << ot << ")" << endl;
         return NULL;