[Uml-devel] [Bug 130932] java import - package visibility incorrectly represented

JP Fournier jfournier121 at rogers.com
Sun Jul 16 19:06:09 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=130932         




------- Additional Comments From jfournier121 rogers com  2006-07-16 21:06 -------

The patch below appears to address this bug.

regards

jp


jape puma:~$ diff -c svn/kdesdk/umbrello/umbrello/javaimport.cpp kdesdk/umbrello/umbrello/javaimport.cpp
*** svn/kdesdk/umbrello/umbrello/javaimport.cpp 2006-07-16 09:27:38.000000000 -0400
--- kdesdk/umbrello/umbrello/javaimport.cpp     2006-07-16 14:56:38.000000000 -0400
***************
*** 143,148 ****
--- 143,152 ----
              kdError() << "importJava: unexpected: " << m_source[m_srcIndex] << endl;
              skipStmt();
          }
+         // the default visibilty for java is implementation, since the absence of a  modifier (like public)
+         // means package visibility (which maps to implementation).
+         //
+         m_currentAccess = Uml::Visibility::Implementation;
          return true;
      }
      if (keyword == "class" || keyword == "interface") {
***************
*** 152,157 ****
--- 156,162 ----
          m_scope[++m_scopeIndex] = m_klass = static_cast<UMLClassifier*>(ns);
          m_klass->setAbstract(m_isAbstract);
          m_klass->setStatic(m_isStatic);
+         m_klass->setVisibility( m_currentAccess );
          m_isAbstract = m_isStatic = false;
          if (advance() == ";")   // forward declaration
              return true;
***************
*** 320,325 ****
--- 325,332 ----
                                     m_isStatic, m_isAbstract, false /*isFriend*/,
                                     false /*isConstructor*/, m_comment);
          m_isAbstract = m_isStatic = false;
+         // default visibility for java is implementation (package vis)
+         m_currentAccess = Uml::Visibility::Implementation;
          // At this point we do not know whether the method has a body or not.
          do {
              nextToken = advance();
***************
*** 365,371 ****
          name = advance();
          nextToken = advance();
      }
!     m_currentAccess = Uml::Visibility::Public;
      if (m_source[m_srcIndex] != ";") {
          kdError() << "importJava: ignoring trailing items at " << name << endl;
          skipStmt();
--- 372,379 ----
          name = advance();
          nextToken = advance();
      }
!     // reset visibility to default
!     m_currentAccess = Uml::Visibility::Implementation;
      if (m_source[m_srcIndex] != ";") {
          kdError() << "importJava: ignoring trailing items at " << name << endl;
          skipStmt();




More information about the umbrello-devel mailing list