[forge-issues] [JBoss JIRA] (FORGE-889) Cannot parse package-info.java

Yann Albou (JIRA) jira-events at lists.jboss.org
Tue May 7 18:04:53 EDT 2013


    [ https://issues.jboss.org/browse/FORGE-889?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12772862#comment-12772862 ] 

Yann Albou commented on FORGE-889:
----------------------------------

To reproduce this issue:
* create the file src/test/resources/org/jboss/forge/grammar/java/package-info.java with the following content: {code:java}
@XmlSchema(namespace = "http://forge.org/Test", elementFormDefault = QUALIFIED, attributeFormDefault = UNQUALIFIED)
@XmlAccessorType(FIELD)
package org.jboss.forge.test.parser.java;

import static javax.xml.bind.annotation.XmlAccessType.FIELD;
import static javax.xml.bind.annotation.XmlNsForm.QUALIFIED;
import static javax.xml.bind.annotation.XmlNsForm.UNQUALIFIED;

import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlSchema;
{code}
* The just create a new test class JavaPackageInfoTest {code:java}
   @Test
   public void testCanParsePackageInfo() throws Exception
   {
      InputStream stream = JavaPackageInfoTest.class
               .getResourceAsStream("/org/jboss/forge/grammar/java/package-info.java");
      JavaClass javaClass = JavaParser.parse(JavaClass.class, stream);
      String name = javaClass.getName();
      assertEquals("MockInterface", name);
   }
{code}

I'd like to fix this issue but I don't feel confortable with AST manipulation and I don't know where to start.
If you provide me some inputs I will try to investigate...
                
> Cannot parse package-info.java
> ------------------------------
>
>                 Key: FORGE-889
>                 URL: https://issues.jboss.org/browse/FORGE-889
>             Project: Forge
>          Issue Type: Bug
>          Components: Parsers / File Manipulation
>    Affects Versions: 1.2.3.Final, 2.0.0.Alpha3
>            Reporter: Yann Albou
>
> The parsing of package-info.java file (see http://docs.oracle.com/javase/6/docs/technotes/tools/solaris/javadoc.html#sourcefiles) raises the following exeption:
> "org.jboss.forge.parser.ParserException: Could not find type declaration in Java source - is this actually code?"
>  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the forge-issues mailing list