AvoidNotShortCircuitOperatorsForBooleanCheck: NullPointerException occurred during the analysis #354

Closed
rdiachenko opened this Issue Jun 10, 2015 · 1 comment

Projects

None yet

2 participants

@rdiachenko
Member
private void a() {
    try {} catch (IllegalArgumentException | NoSuchElementException re) {}
}
<module name="AvoidNotShortCircuitOperatorsForBoolean">
      <property name="severity" value="warning"/>
      <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="info"/>
</module>
[ERROR] NullPointerException occurred during the analysis of file /SomeClass.java.
java.lang.NullPointerException
        at com.github.sevntu.checkstyle.checks.coding.AvoidNotShortCircuitOperatorsForBooleanCheck.visitToken(AvoidNotShortCircuitOperatorsForBooleanCheck.java:119)
        at com.puppycrawl.tools.checkstyle.TreeWalker.notifyVisit(TreeWalker.java:393)
        at com.puppycrawl.tools.checkstyle.TreeWalker.processIter(TreeWalker.java:482)
        at com.puppycrawl.tools.checkstyle.TreeWalker.walk(TreeWalker.java:322)
        at com.puppycrawl.tools.checkstyle.TreeWalker.processFiltered(TreeWalker.java:195)
        at com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck.process(AbstractFileSetCheck.java:76)
        at com.puppycrawl.tools.checkstyle.Checker.process(Checker.java:260)
        at org.apache.maven.plugin.checkstyle.exec.DefaultCheckstyleExecutor.executeCheckstyle(DefaultCheckstyleExecutor.java:253)
        at org.apache.maven.plugin.checkstyle.AbstractCheckstyleReport.executeReport(AbstractCheckstyleReport.java:473)
        at org.apache.maven.plugin.checkstyle.CheckstyleReport.executeReport(CheckstyleReport.java:155)
        at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:255)
        at org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenReport.java:143)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)

Reproduced on:
checkstyle 6.7
sevntu-checkstyle 1.13.3

@rdiachenko
Member

Probable source of the problem:

@oyarzun oyarzun added a commit to oyarzun/sevntu.checkstyle that referenced this issue Jun 22, 2015
@oyarzun oyarzun Fixes #354 NullPointerException
Fixes #354 NullPointerException in AvoidNotShortCircuitOperatorsForBooleanCheck
d50b5f1
@romani romani added a commit that closed this issue Sep 7, 2015
@oyarzun @romani oyarzun + romani Fixes #354 NullPointerException
Fixes #354 NullPointerException in AvoidNotShortCircuitOperatorsForBooleanCheck
7053187
@romani romani closed this in 7053187 Sep 7, 2015
@romani romani added this to the 1.13.6 milestone Sep 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment