sourish-rygbee / javaparser

Automatically exported from code.google.com/p/javaparser
0 stars 0 forks source link

NPE in VoidVisitorAdapter #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use the following input file:

@Deprecated()
public class Test
{
}

2. Use the following test parser:
JavaParser.parse(new File(filename)).accept(new VoidVisitorAdapter(), 
null);

What is the expected output? What do you see instead?

Expected that code would not throw any exceptions.
Observed the following exception:
Exception in thread "main" java.lang.NullPointerException
    at 
japa.parser.ast.visitor.VoidVisitorAdapter.visit(VoidVisitorAdapter.java:570)
    at 
japa.parser.ast.expr.NormalAnnotationExpr.accept(NormalAnnotationExpr.java:54)
    at 
japa.parser.ast.visitor.VoidVisitorAdapter.visit(VoidVisitorAdapter.java:234)
    at 
japa.parser.ast.body.ClassOrInterfaceDeclaration.accept(ClassOrInterfaceDeclarat
ion.java:78)
    at 
japa.parser.ast.visitor.VoidVisitorAdapter.visit(VoidVisitorAdapter.java:282)
    at japa.parser.ast.CompilationUnit.accept(CompilationUnit.java:69)

What version of the product are you using? On what operating system?

Java1.5_parser_and_AST_2008-06-09.zip 

Please provide any additional information below.

Workaround: remove () from @Deprecated() in the input file

Original issue reported on code.google.com by rya...@gmail.com on 11 Jun 2008 at 9:20

GoogleCodeExporter commented 9 years ago
This is also occurring in DumpVisitor with the same input file.

Original comment by jges...@gmail.com on 11 Jun 2008 at 11:16

GoogleCodeExporter commented 9 years ago
Thanks for your help, i've fixed the issue and uploaded a new source package
(Java1.5_parser_and_AST_2008-06-11.zip ).

Original comment by jges...@gmail.com on 12 Jun 2008 at 12:24