Uploaded image for project: 'Byteman'
  1. Byteman
  2. BYTEMAN-296

NPE thrown because type is unknown in some situations

    XMLWordPrintable

    Details

      Description

      I'm getting the following NullPointerException when runing the `maven-rulecheck-maven-plugin` on my project.

      Run "mvn clean test-compile" in order to reproduce the bug on the drools-compiler project on this commit on this branch.

      (The stack trace is being printed out because I recompiled 3.0.1 with debug statements).

      From what I've been able to debug, the `type` variable in a `CFG` instance is not always set, so it seems like a null-check should be added to the code (see associated PR).

      This seems to be happening for rules that involve references to local variables. I haven't been able to pinpoint any other causes.

      java.lang.NullPointerException
      	at org.jboss.byteman.agent.adapter.cfg.CFG.inBytemanTrigger(CFG.java:1704)
      	at org.jboss.byteman.agent.adapter.RuleTriggerMethodAdapter.inBytemanTrigger(RuleTriggerMethodAdapter.java:588)
      	at org.jboss.byteman.agent.adapter.VariableAccessTriggerAdapter$VariableAccessTriggerMethodAdapter.visitVarInsn(VariableAccessTriggerAdapter.java:136)
      	at org.jboss.byteman.objectweb.asm.tree.VarInsnNode.accept(Unknown Source)
      	at org.jboss.byteman.agent.adapter.BMInsnList.accept(BMInsnList.java:81)
      	at org.jboss.byteman.objectweb.asm.tree.MethodNode.accept(Unknown Source)
      	at org.jboss.byteman.objectweb.asm.commons.JSRInlinerAdapter.visitEnd(Unknown Source)
      	at org.jboss.byteman.objectweb.asm.ClassReader.b(Unknown Source)
      	at org.jboss.byteman.objectweb.asm.ClassReader.accept(Unknown Source)
      	at org.jboss.byteman.objectweb.asm.ClassReader.accept(Unknown Source)
      	at org.jboss.byteman.agent.TransformContext.transform(TransformContext.java:150)
      	at org.jboss.byteman.agent.Transformer.transform(Transformer.java:746)
      	at org.jboss.byteman.check.RuleCheck.checkRules(RuleCheck.java:222)
      	at org.jboss.byteman.contrib.rulecheck.RuleCheckMojo.execute(RuleCheckMojo.java:212)
      	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
      	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:120)
      	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
      	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
      	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
      	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
      	at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	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)
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                adinn Andrew Dinn
                Reporter:
                marco.rietveld Marco Rietveld
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: