#56 Checkstyle Crash

release_2.3
closed
Oliver Burn
Other (70)
5
2012-10-10
2002-07-18
Anonymous
No

Hello Everybody!

When using CheckStyle with the attached little Program
it crashed with the following Error Message:

Exception in thread "main" java.lang.NullPointerException
at
com.puppycrawl.tools.checkstyle.Verifier.reportInstantiation(Verifier.java:922)
at
com.puppycrawl.tools.checkstyle.GeneratedJava14Recognizer.newExpression(GeneratedJava14Recognizer.java:5386)
at
com.puppycrawl.tools.checkstyle.GeneratedJava14Recognizer.primaryExpression(GeneratedJava14Recognizer.java:3029)
at
com.puppycrawl.tools.checkstyle.GeneratedJava14Recognizer.postfixExpression(GeneratedJava14Recognizer.java:5115)
at
com.puppycrawl.tools.checkstyle.GeneratedJava14Recognizer.unaryExpressionNotPlusMinus(GeneratedJava14Recognizer.java:5078)
at
com.puppycrawl.tools.checkstyle.GeneratedJava14Recognizer.unaryExpression(GeneratedJava14Recognizer.java:4912)
at
com.puppycrawl.tools.checkstyle.GeneratedJava14Recognizer.multiplicativeExpression(GeneratedJava14Recognizer.java:4743)
at
com.puppycrawl.tools.checkstyle.GeneratedJava14Recognizer.additiveExpression(GeneratedJava14Recognizer.java:4678)
at
com.puppycrawl.tools.checkstyle.GeneratedJava14Recognizer.shiftExpression(GeneratedJava14Recognizer.java:4607)
at
com.puppycrawl.tools.checkstyle.GeneratedJava14Recognizer.relationalExpression(GeneratedJava14Recognizer.java:4475)
at
com.puppycrawl.tools.checkstyle.GeneratedJava14Recognizer.equalityExpression(GeneratedJava14Recognizer.java:4418)
at
com.puppycrawl.tools.checkstyle.GeneratedJava14Recognizer.andExpression(GeneratedJava14Recognizer.java:4383)
at
com.puppycrawl.tools.checkstyle.GeneratedJava14Recognizer.exclusiveOrExpression(GeneratedJava14Recognizer.java:4348)
at
com.puppycrawl.tools.checkstyle.GeneratedJava14Recognizer.inclusiveOrExpression(GeneratedJava14Recognizer.java:4313)
at
com.puppycrawl.tools.checkstyle.GeneratedJava14Recognizer.logicalAndExpression(GeneratedJava14Recognizer.java:4278)
at
com.puppycrawl.tools.checkstyle.GeneratedJava14Recognizer.logicalOrExpression(GeneratedJava14Recognizer.java:4243)
at
com.puppycrawl.tools.checkstyle.GeneratedJava14Recognizer.conditionalExpression(GeneratedJava14Recognizer.java:4173)
at
com.puppycrawl.tools.checkstyle.GeneratedJava14Recognizer.assignmentExpression(GeneratedJava14Recognizer.java:3993)
at
com.puppycrawl.tools.checkstyle.GeneratedJava14Recognizer.assignmentExpression(GeneratedJava14Recognizer.java:4140)
at
com.puppycrawl.tools.checkstyle.GeneratedJava14Recognizer.expression(GeneratedJava14Recognizer.java:822)
at
com.puppycrawl.tools.checkstyle.GeneratedJava14Recognizer.traditionalStatement(GeneratedJava14Recognizer.java:670)
at
com.puppycrawl.tools.checkstyle.GeneratedJava14Recognizer.statement(GeneratedJava14Recognizer.java:125)
at
com.puppycrawl.tools.checkstyle.GeneratedJava14Recognizer.constructorBody(GeneratedJava14Recognizer.java:2534)
at
com.puppycrawl.tools.checkstyle.GeneratedJava14Recognizer.field(GeneratedJava14Recognizer.java:2226)
at
com.puppycrawl.tools.checkstyle.GeneratedJava14Recognizer.classBlock(GeneratedJava14Recognizer.java:2050)
at
com.puppycrawl.tools.checkstyle.GeneratedJava14Recognizer.classDefinition(GeneratedJava14Recognizer.java:1301)
at
com.puppycrawl.tools.checkstyle.GeneratedJava14Recognizer.typeDefinition(GeneratedJava14Recognizer.java:1031)
at
com.puppycrawl.tools.checkstyle.GeneratedJava14Recognizer.compilationUnit(GeneratedJava14Recognizer.java:899)
at
com.puppycrawl.tools.checkstyle.Checker.process(Checker.java:198)
at
com.puppycrawl.tools.checkstyle.Checker.process(Checker.java:149)
at com.puppycrawl.tools.checkstyle.Main.main(Main.java:115)

We start Checkstyle with this little Shell-Script which
shows activated options/used JDK:

CP=/.../checkstyle-2.3
JAVA_HOME=/.../j2sdk1.4.0_01/

exec $JAVA_HOME/bin/java \ -cp $CP/checkstyle-all-2.3.jar\ -Dcheckstyle.allow.tabs=yes \ -Dcheckstyle.allow.protected=yes \ -Dcheckstyle.pattern.publicmember=.\ -Dcheckstyle.pattern.parameter=. \ -Dcheckstyle.pattern.static=. \ -Dcheckstyle.pattern.const=. \ -Dcheckstyle.pattern.member=. \ -Dcheckstyle.pattern.method=. \ -Dcheckstyle.pattern.type=. \ -Dcheckstyle.pattern.localvar=. \ -Dcheckstyle.javadoc.scope=nothing \ -Dcheckstyle.ignore.imports=yes \ -Dcheckstyle.ignore.whitespace.cast=yes \ com.puppycrawl.tools.checkstyle.Main \ *.java

As the Program compiles and works I assume there is a
bug in
Checkstyle, I hope the provided information will help
to find it.
We use Red Hat 7.3.

Yours,

Maximilian Störzer

Discussion

  • Program Checkstyle crashes with.

     
    Attachments
  • Oliver Burn
    Oliver Burn
    2002-07-21

    Logged In: YES
    user_id=218824

    Thanks for attaching a sample file. It makes things a lot
    easier. I was able to reproduce the bug with Checkstyle 2.3.
    The problem has been fixed in 2.4 (beta).

    Please let me know if want me to send you a JAR file.