You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Paul Gier (JIRA)" <ji...@codehaus.org> on 2007/01/30 17:33:44 UTC

[jira] Created: (MNG-2799) Plugin descriptor extractor crashes on certain types of Java source files

Plugin descriptor extractor crashes on certain types of Java source files
-------------------------------------------------------------------------

                 Key: MNG-2799
                 URL: http://jira.codehaus.org/browse/MNG-2799
             Project: Maven 2
          Issue Type: Improvement
          Components: Plugin Creation Tools
         Environment: Tested with Maven version 2.0.4, and 2.0.x SNAPSHOT.
            Reporter: Paul Gier
         Attachments: JavaMojoDescriptorExtractor.java

Part of my plugin includes a .java file that contains an annotation type declaration.  It looks like this:
{quote}
package org.jboss.lang.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.ANNOTATION_TYPE)
public @interface Inherited {
}
{quote}

When the JavaMojoDescriptorExtractor encounters this file it crashes because of an ArrayIndexOutOfBoundsException.  Because the code is trying to access the 1st element of a zero length array.  The attached file has a simple fix where the descriptor extractor just ignores any java source file that does not contain a valid class.



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MNG-2799) Plugin descriptor extractor crashes on certain types of Java source files

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-2799?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brett Porter updated MNG-2799:
------------------------------

    Patch Submitted: [Yes]

> Plugin descriptor extractor crashes on certain types of Java source files
> -------------------------------------------------------------------------
>
>                 Key: MNG-2799
>                 URL: http://jira.codehaus.org/browse/MNG-2799
>             Project: Maven 2
>          Issue Type: Improvement
>          Components: Plugin Creation Tools
>         Environment: Tested with Maven version 2.0.4, and 2.0.x SNAPSHOT.
>            Reporter: Paul Gier
>             Fix For: Reviewed Pending Version Assignment
>
>         Attachments: JavaMojoDescriptorExtractor.java, JavaMojoDescriptorExtractor.java
>
>
> Part of my plugin includes a .java file that contains an annotation type declaration.  It looks like this:
> {quote}
> package org.jboss.lang.annotation;
> import java.lang.annotation.ElementType;
> import java.lang.annotation.Retention;
> import java.lang.annotation.RetentionPolicy;
> import java.lang.annotation.Target;
> @Retention(RetentionPolicy.RUNTIME)
> @Target(ElementType.ANNOTATION_TYPE)
> public @interface Inherited {
> }
> {quote}
> When the JavaMojoDescriptorExtractor encounters this file it crashes because of an ArrayIndexOutOfBoundsException.  Because the code is trying to access the 1st element of a zero length array.  The attached file has a simple fix where the descriptor extractor just ignores any java source file that does not contain a valid class.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MPLUGIN-53) Plugin descriptor extractor crashes on certain types of Java source files

Posted by "Paul Gier (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MPLUGIN-53?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_120794 ] 

pgier edited comment on MPLUGIN-53 at 1/21/08 2:00 PM:
-----------------------------------------------------------

It looks like the issue went away with one of the recent changes.  I'm attaching a test case that tests for the issue in case it recurs in the future.

      was (Author: pgier):
    It looks like the issue when away with one of the recent changes.  I'm attaching a test case that tests for the issue in case it recurs in the future.
  
> Plugin descriptor extractor crashes on certain types of Java source files
> -------------------------------------------------------------------------
>
>                 Key: MPLUGIN-53
>                 URL: http://jira.codehaus.org/browse/MPLUGIN-53
>             Project: Maven 2.x Plugin Tools
>          Issue Type: Improvement
>         Environment: Tested with Maven version 2.0.4, and 2.0.x SNAPSHOT.
>            Reporter: Paul Gier
>         Attachments: JavaMojoDescriptorExtractor.java, JavaMojoDescriptorExtractor.java, maven-plugin-tools-java-MPLUGIN-53-r613932.patch
>
>
> Part of my plugin includes a .java file that contains an annotation type declaration.  It looks like this:
> {quote}
> package org.jboss.lang.annotation;
> import java.lang.annotation.ElementType;
> import java.lang.annotation.Retention;
> import java.lang.annotation.RetentionPolicy;
> import java.lang.annotation.Target;
> @Retention(RetentionPolicy.RUNTIME)
> @Target(ElementType.ANNOTATION_TYPE)
> public @interface Inherited {
> }
> {quote}
> When the JavaMojoDescriptorExtractor encounters this file it crashes because of an ArrayIndexOutOfBoundsException.  Because the code is trying to access the 1st element of a zero length array.  The attached file has a simple fix where the descriptor extractor just ignores any java source file that does not contain a valid class.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MNG-2799) Plugin descriptor extractor crashes on certain types of Java source files

Posted by "Paul Gier (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-2799?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Gier updated MNG-2799:
---------------------------

    Attachment: JavaMojoDescriptorExtractor.java

Slightly simpler fix for the problem.

> Plugin descriptor extractor crashes on certain types of Java source files
> -------------------------------------------------------------------------
>
>                 Key: MNG-2799
>                 URL: http://jira.codehaus.org/browse/MNG-2799
>             Project: Maven 2
>          Issue Type: Improvement
>          Components: Plugin Creation Tools
>         Environment: Tested with Maven version 2.0.4, and 2.0.x SNAPSHOT.
>            Reporter: Paul Gier
>         Attachments: JavaMojoDescriptorExtractor.java, JavaMojoDescriptorExtractor.java
>
>
> Part of my plugin includes a .java file that contains an annotation type declaration.  It looks like this:
> {quote}
> package org.jboss.lang.annotation;
> import java.lang.annotation.ElementType;
> import java.lang.annotation.Retention;
> import java.lang.annotation.RetentionPolicy;
> import java.lang.annotation.Target;
> @Retention(RetentionPolicy.RUNTIME)
> @Target(ElementType.ANNOTATION_TYPE)
> public @interface Inherited {
> }
> {quote}
> When the JavaMojoDescriptorExtractor encounters this file it crashes because of an ArrayIndexOutOfBoundsException.  Because the code is trying to access the 1st element of a zero length array.  The attached file has a simple fix where the descriptor extractor just ignores any java source file that does not contain a valid class.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MPLUGIN-53) Plugin descriptor extractor crashes on certain types of Java source files

Posted by "Vincent Siveton (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MPLUGIN-53?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_120627 ] 

Vincent Siveton commented on MPLUGIN-53:
----------------------------------------

Could you submit a diff file instead of?

http://maven.apache.org/guides/development/guide-m2-development.html#Creating_and_submitting_a_patch

> Plugin descriptor extractor crashes on certain types of Java source files
> -------------------------------------------------------------------------
>
>                 Key: MPLUGIN-53
>                 URL: http://jira.codehaus.org/browse/MPLUGIN-53
>             Project: Maven 2.x Plugin Tools
>          Issue Type: Improvement
>         Environment: Tested with Maven version 2.0.4, and 2.0.x SNAPSHOT.
>            Reporter: Paul Gier
>         Attachments: JavaMojoDescriptorExtractor.java, JavaMojoDescriptorExtractor.java
>
>
> Part of my plugin includes a .java file that contains an annotation type declaration.  It looks like this:
> {quote}
> package org.jboss.lang.annotation;
> import java.lang.annotation.ElementType;
> import java.lang.annotation.Retention;
> import java.lang.annotation.RetentionPolicy;
> import java.lang.annotation.Target;
> @Retention(RetentionPolicy.RUNTIME)
> @Target(ElementType.ANNOTATION_TYPE)
> public @interface Inherited {
> }
> {quote}
> When the JavaMojoDescriptorExtractor encounters this file it crashes because of an ArrayIndexOutOfBoundsException.  Because the code is trying to access the 1st element of a zero length array.  The attached file has a simple fix where the descriptor extractor just ignores any java source file that does not contain a valid class.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (MPLUGIN-53) Plugin descriptor extractor crashes on certain types of Java source files

Posted by "Vincent Siveton (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MPLUGIN-53?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vincent Siveton closed MPLUGIN-53.
----------------------------------

         Assignee: Vincent Siveton
       Resolution: Fixed
    Fix Version/s: 2.4

Patch applied. Thanks!

> Plugin descriptor extractor crashes on certain types of Java source files
> -------------------------------------------------------------------------
>
>                 Key: MPLUGIN-53
>                 URL: http://jira.codehaus.org/browse/MPLUGIN-53
>             Project: Maven 2.x Plugin Tools
>          Issue Type: Improvement
>         Environment: Tested with Maven version 2.0.4, and 2.0.x SNAPSHOT.
>            Reporter: Paul Gier
>            Assignee: Vincent Siveton
>             Fix For: 2.4
>
>         Attachments: JavaMojoDescriptorExtractor.java, JavaMojoDescriptorExtractor.java, maven-plugin-tools-java-MPLUGIN-53-r613932.patch
>
>
> Part of my plugin includes a .java file that contains an annotation type declaration.  It looks like this:
> {quote}
> package org.jboss.lang.annotation;
> import java.lang.annotation.ElementType;
> import java.lang.annotation.Retention;
> import java.lang.annotation.RetentionPolicy;
> import java.lang.annotation.Target;
> @Retention(RetentionPolicy.RUNTIME)
> @Target(ElementType.ANNOTATION_TYPE)
> public @interface Inherited {
> }
> {quote}
> When the JavaMojoDescriptorExtractor encounters this file it crashes because of an ArrayIndexOutOfBoundsException.  Because the code is trying to access the 1st element of a zero length array.  The attached file has a simple fix where the descriptor extractor just ignores any java source file that does not contain a valid class.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Moved: (MPLUGIN-53) Plugin descriptor extractor crashes on certain types of Java source files

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MPLUGIN-53?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brett Porter moved MNG-2799 to MPLUGIN-53:
------------------------------------------

    Fix Version/s:     (was: Reviewed Pending Version Assignment)
      Component/s:     (was: Plugin Creation Tools)
              Key: MPLUGIN-53  (was: MNG-2799)
          Project: Maven 2.x Plugin Tools  (was: Maven 2)

> Plugin descriptor extractor crashes on certain types of Java source files
> -------------------------------------------------------------------------
>
>                 Key: MPLUGIN-53
>                 URL: http://jira.codehaus.org/browse/MPLUGIN-53
>             Project: Maven 2.x Plugin Tools
>          Issue Type: Improvement
>         Environment: Tested with Maven version 2.0.4, and 2.0.x SNAPSHOT.
>            Reporter: Paul Gier
>         Attachments: JavaMojoDescriptorExtractor.java, JavaMojoDescriptorExtractor.java
>
>
> Part of my plugin includes a .java file that contains an annotation type declaration.  It looks like this:
> {quote}
> package org.jboss.lang.annotation;
> import java.lang.annotation.ElementType;
> import java.lang.annotation.Retention;
> import java.lang.annotation.RetentionPolicy;
> import java.lang.annotation.Target;
> @Retention(RetentionPolicy.RUNTIME)
> @Target(ElementType.ANNOTATION_TYPE)
> public @interface Inherited {
> }
> {quote}
> When the JavaMojoDescriptorExtractor encounters this file it crashes because of an ArrayIndexOutOfBoundsException.  Because the code is trying to access the 1st element of a zero length array.  The attached file has a simple fix where the descriptor extractor just ignores any java source file that does not contain a valid class.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MPLUGIN-53) Plugin descriptor extractor crashes on certain types of Java source files

Posted by "Paul Gier (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MPLUGIN-53?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Gier updated MPLUGIN-53:
-----------------------------

    Attachment: maven-plugin-tools-java-MPLUGIN-53-r613932.patch

It looks like the issue when away with one of the recent changes.  I'm attaching a test case that tests for the issue in case it recurs in the future.

> Plugin descriptor extractor crashes on certain types of Java source files
> -------------------------------------------------------------------------
>
>                 Key: MPLUGIN-53
>                 URL: http://jira.codehaus.org/browse/MPLUGIN-53
>             Project: Maven 2.x Plugin Tools
>          Issue Type: Improvement
>         Environment: Tested with Maven version 2.0.4, and 2.0.x SNAPSHOT.
>            Reporter: Paul Gier
>         Attachments: JavaMojoDescriptorExtractor.java, JavaMojoDescriptorExtractor.java, maven-plugin-tools-java-MPLUGIN-53-r613932.patch
>
>
> Part of my plugin includes a .java file that contains an annotation type declaration.  It looks like this:
> {quote}
> package org.jboss.lang.annotation;
> import java.lang.annotation.ElementType;
> import java.lang.annotation.Retention;
> import java.lang.annotation.RetentionPolicy;
> import java.lang.annotation.Target;
> @Retention(RetentionPolicy.RUNTIME)
> @Target(ElementType.ANNOTATION_TYPE)
> public @interface Inherited {
> }
> {quote}
> When the JavaMojoDescriptorExtractor encounters this file it crashes because of an ArrayIndexOutOfBoundsException.  Because the code is trying to access the 1st element of a zero length array.  The attached file has a simple fix where the descriptor extractor just ignores any java source file that does not contain a valid class.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira