Bug 132174 - java import - "final" and "comments" in method declaration not parsed correctly
Summary: java import - "final" and "comments" in method declaration not parsed correctly
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-10 02:07 UTC by JP Fournier
Modified: 2006-08-10 06:41 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
patch to ignore final an comments in method decls (771 bytes, patch)
2006-08-10 02:11 UTC, JP Fournier
Details

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

While importing Azareus java code I ran into problems importing code similar to the class below.  The problems were the "final" modifier to the argument, and the comment occuring on the same line as an argument decl.


import pack1.*;

public class Format{
	public void update(final int arg, final int[] arg2){
        }

	public void update( 
		int value1,   // a comment
		int value2   // a second comment
	) {

	}
}
Comment 1 JP Fournier 2006-08-10 02:11:24 UTC
Created attachment 17323 [details]
patch to ignore final an comments in method decls
Comment 2 Oliver Kellogg 2006-08-10 06:41:02 UTC
SVN commit 571621 by okellogg:

Attachment 17323 [details] from JP Fournier adds handling of keyword
"final" and trailing comments at argument declarations.
BUG:132174


 M  +2 -0      ChangeLog  
 M  +4 -0      umbrello/codeimport/javaimport.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/ChangeLog #571620:571621
@@ -8,6 +8,8 @@
 * Java import: unable to import AzareusCore (131961)
 * Java import: error on multidimensional arrays (132017)
 * Java import - array types not resolved correctly (132035)
+* Java import - "final" and comments in method declaration
+  not parsed correctly (132174)
 
 Version 1.5.4
 
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/codeimport/javaimport.cpp #571620:571621
@@ -502,6 +502,10 @@
         m_srcIndex++;
         while (m_srcIndex < srcLength && m_source[m_srcIndex] != ")") {
             QString typeName = m_source[m_srcIndex];
+            if ( typeName == "final" || typeName.startsWith( "//") ) {
+                // ignore the "final" keyword and any comments in method args
+                typeName = advance();
+            } 
             typeName = joinTypename(typeName);
             QString parName = advance();
             // the Class might not be resolved yet so resolve it if necessary