You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Lukas Theussl <th...@triumf.ca> on 2005/01/26 18:52:14 UTC

MPJXR-11

Hi,

I don't know if this is the right place, I hope one of the developers 
will pick it up if not. I'd like to submit a patch that solves the 
MPJXR-11 issue (http://jira.codehaus.org/browse/MPJXR-11) of the jxr 
plugin. The problem is actually worse than described in the bug report: 
any line that contains the string "package" anywhere (comment or not, 
for instance as part of a variable name) messes up the html output. This 
is because the indexOf() method was used to parse a line for the string 
"package", I simply replaced that by .trim().startsWith() (that assumes 
that the package declaration is on it's own line).

The patch is against the latest CodeTransform.java file from the cvs 
repository, it solved the problem for me.
Cheers,



--- CodeTransform.java    2005-01-26 17:45:14.000000000 +0000
+++ CodeTransform.java.patched    2005-01-25 23:43:02.000000000 +0000
@@ -1100,9 +1100,10 @@
             - that it WILL be on the disk since this is based on the 
current
             - file.
         */
-        boolean isPackage = line.indexOf("package") != -1;
+        boolean isPackage = line.trim().startsWith("package ");
+        boolean isImport = line.trim().startsWith("import ");
 
-        if (line.indexOf("import") != -1 || isPackage)
+        if (isImport || isPackage)
         {
 
             start = line.trim().indexOf(" ");


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: MPJXR-11

Posted by Brett Porter <br...@gmail.com>.
normally, create a patch file and attach it to the JIRA issue - much
easier to apply.

However, as this was only 3 lines, I've done it - thanks!

- Brett


On Wed, 26 Jan 2005 17:52:14 +0000, Lukas Theussl <th...@triumf.ca> wrote:
> 
> Hi,
> 
> I don't know if this is the right place, I hope one of the developers
> will pick it up if not. I'd like to submit a patch that solves the
> MPJXR-11 issue (http://jira.codehaus.org/browse/MPJXR-11) of the jxr
> plugin. The problem is actually worse than described in the bug report:
> any line that contains the string "package" anywhere (comment or not,
> for instance as part of a variable name) messes up the html output. This
> is because the indexOf() method was used to parse a line for the string
> "package", I simply replaced that by .trim().startsWith() (that assumes
> that the package declaration is on it's own line).
> 
> The patch is against the latest CodeTransform.java file from the cvs
> repository, it solved the problem for me.
> Cheers,
> 
> --- CodeTransform.java    2005-01-26 17:45:14.000000000 +0000
> +++ CodeTransform.java.patched    2005-01-25 23:43:02.000000000 +0000
> @@ -1100,9 +1100,10 @@
>              - that it WILL be on the disk since this is based on the
> current
>              - file.
>          */
> -        boolean isPackage = line.indexOf("package") != -1;
> +        boolean isPackage = line.trim().startsWith("package ");
> +        boolean isImport = line.trim().startsWith("import ");
> 
> -        if (line.indexOf("import") != -1 || isPackage)
> +        if (isImport || isPackage)
>          {
> 
>              start = line.trim().indexOf(" ");
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org