[ 
https://issues.apache.org/jira/browse/JAXME-89?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13036316#comment-13036316
 ] 

Andreas Xenos commented on JAXME-89:
------------------------------------

Hello there,

I am using JavaParser and I am having failure in multiple interfaces. I have 
replaced the code as you said but I can't build the new .class file.
Could you please send me this version of the file? I am using jaxmejs-0.5.jar 
library.

Otherwise, I would appreciate some help on how to produce the class file. With 
the command javac JavaParser.java I am getting 100 errors such as:
"JavaParser.java:191: cannot find symbol
symbol: variable JavaRecognizer
location: class org.apache.ws.jaxme.js.util.JavaParser AST classNameAST = 
findChild(pAST, JavaRecognizer.IDENT);



> Multiple "implements" clauses are not supported
> -----------------------------------------------
>
>                 Key: JAXME-89
>                 URL: https://issues.apache.org/jira/browse/JAXME-89
>             Project: JaxMe
>          Issue Type: Bug
>          Components: JaxMeJS
>    Affects Versions: 0.5
>         Environment: Win XP, J2SE 1.5_09
>            Reporter: Andreas Neumann
>            Assignee: Jochen Wiedmann
>             Fix For: 0.6
>
>         Attachments: JavaParser.java, JavaParser.java
>
>
> If you want to parse a java source file which implements more than one 
> interface, the parser recognizes them as a single interface. I.e.:
> public class TestClass implements AnInterface {
> works fine, but
> public class TestClass implements AnInterface, ASecondInterface, 
> AThirdInterface {
> fails. If you call JavaSource.getImplements() on the second example, you'll 
> get a String like "AnInterfaceASecondInterfaceAThirdInterface".
> The problem is in the JavaParser.class in the method 
> "parseImplementsOrExtends", where the implements clause is handled like the 
> extends clause and expecting only one interface.
> Replace the method with something like this to make it work:
>     private void parseImplementsOrExtends(JavaSource pSource, AST pAST, int 
> pType) {
>         AST implementsAST = findChild(pAST, pType);
>         if (implementsAST == null) {
>               throw new IllegalStateException("AST implements not found");
>         }
>         if (implementsAST.getFirstChild() != null) {
>             if (pType == JavaRecognizer.IMPLEMENTS_CLAUSE) {
>                 for (AST child = implementsAST.getFirstChild();  child != 
> null;  child = child.getNextSibling()) {
>                     String ident = parseIdentifier(child);
>                     JavaQName qName = getQName(ident);
>                   pSource.addImplements(qName);
>                 }
>             } else {
>                 String ident = parseIdentifier(implementsAST);
>                 JavaQName qName = getQName(ident);
>               pSource.addExtends(qName);
>             }
>         }
>     }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to