phax / jcodemodel

A heavily extended fork of the com.sun.codemodel (from 2013/09)
Other
93 stars 34 forks source link

Issue with JFormatter class #45

Closed sgaurav22 closed 8 years ago

sgaurav22 commented 8 years ago

As of now i am using 2.8.3 API. But i am always getting an issue NullPointerIssue in the above mentioned class. When i am trying to open the class with decompiler i am getting issue as Internal Error as could you please look into the issue. As my final class is generated but there is no code inside my generated class.

Thanks Gaurav

phax commented 8 years ago

Can you please provide a sample class that causes the problem. Thanks.

sgaurav22 commented 8 years ago

Thanks Phax for quick reply i guess it due to the below line number. java.lang.NullPointerException at com.helger.jcodemodel.JFormatter.print(JFormatter.java:304) at com.helger.jcodemodel.JFormatter.id(JFormatter.java:375) at com.helger.jcodemodel.JMethod.declare(JMethod.java:496)

sgaurav22 commented 8 years ago

actually you are printing the value of id but i have not mentioned any id for class or method. But while printing its giving the error.

phax commented 8 years ago

It seems like you are creating a method without a name. I added null checks in the current HEAD version.

sgaurav22 commented 8 years ago

Thanks Phax issue got resolved. The method name which i am parsing is not coming properly from backend.

phax commented 8 years ago

Perfect. Happy coding :)