Martinho0330 / javaparser

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

ConstructorDeclaration constructor problem #31

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I've created a new ConstructorDeclaration with the constructor
ConstructorDeclaration(int modifiers, String name)

I think it should create an empty constructor. But it's block field is not
initialized so it crashes with NullPointerException in VoidVisitorAdapter.

My workaround for the problem:
 public ConstructorDeclaration(int modifiers, String name) {
        this.modifiers = modifiers;
        this.name = name;
        block=new BlockStmt(null);//Added line
    }

I think the same should be done with MethodDeclaration

Original issue reported on code.google.com by veg...@gmail.com on 24 Jan 2010 at 1:46