Community
Participate
Working Groups
20020418 i get this when creating ast on the attached file java.lang.IllegalArgumentException at org.eclipse.jdt.core.dom.SimpleName.setIdentifier(SimpleName.java (Compiled Code)) at org.eclipse.jdt.core.dom.AST.newSimpleName(AST.java(Compiled Code)) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:290) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1428) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:759) at org.eclipse.jdt.core.dom.ASTConverter.convertToParenthesizedExpression (ASTConverter.java:786) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:680) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1404) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:762) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1563) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:750) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1889) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1613) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:651) at org.eclipse.jdt.core.dom.ASTConverter.buildBodyDeclarations (ASTConverter.java:228) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:168) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:73) at org.eclipse.jdt.core.dom.AST.parseCompilationUnit(AST.java:234) (...)
Created attachment 686 [details] the file
The problem comes from the expression "result instanceof byte[]". The casting to a byte[] is not properly converted. It should be converted to a Type object, but this is not a possible right operand of a InfixExpression.
I need to talk with Jim, but it seems that we have to introduce a new type of node: InstanceOfExpression. Previously we used an InfixExpression to convert an instanceof expression, but this is not possible anymore. The right operand of an instanceof expression is a referenceType and not an Expression.
A new type of node InstanceofExpression has been added. We left the operator INSTANCE_OF on InfixExpression for now, but it is deprecated. Please update your code asap. Fixed and released in HEAD.