hablutzel1 / GenerateTestCases

Behaviour Driven Development plugin for IntelliJ IDEA
18 stars 11 forks source link

Consistent NullPointerException in IntelliJ Ultimate 11.1.2 #27

Closed akmad closed 12 years ago

akmad commented 12 years ago

I have not determined exactly what causes this exception, but it happens quite frequently. Note, this exception does not appear to keep the plugin from working as expected.

Stacktrace: java.lang.NullPointerException at com.intellij.generatetestcases.util.BddUtil.getPackageName(BddUtil.java:402) at com.intellij.generatetestcases.testframework.JUnitStrategyBase.findBackingPsiClass(JUnitStrategyBase.java:213) at com.intellij.generatetestcases.impl.TestClassImpl.reallyExists(TestClassImpl.java:103) at com.intellij.generatetestcases.inspection.MissingTestMethodInspection.checkClass(MissingTestMethodInspection.java:105) at com.intellij.codeInspection.BaseJavaLocalInspectionTool$1.visitClass(BaseJavaLocalInspectionTool.java:97) at com.intellij.psi.JavaElementVisitor.visitTypeParameter(JavaElementVisitor.java:336) at com.intellij.psi.impl.source.tree.java.PsiTypeParameterImpl.accept(PsiTypeParameterImpl.java:352) at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.a(LocalInspectionsPass.java:403) at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.access$400(LocalInspectionsPass.java:76) at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$3.process(LocalInspectionsPass.java:379) at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$3.process(LocalInspectionsPass.java:373) at com.intellij.concurrency.JobUtil$2$1.run(JobUtil.java:117) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:218) at com.intellij.concurrency.JobUtil$2.process(JobUtil.java:115) at com.intellij.concurrency.JobUtil$1.run(JobUtil.java:57) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at com.intellij.concurrency.PrioritizedFutureTask.access$101(PrioritizedFutureTask.java:31) at com.intellij.concurrency.PrioritizedFutureTask$1.run(PrioritizedFutureTask.java:70) at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1053) at com.intellij.concurrency.PrioritizedFutureTask.run(PrioritizedFutureTask.java:97) at com.intellij.concurrency.JobImpl.scheduleAndWaitForResults(JobImpl.java:136) at com.intellij.concurrency.JobUtil.a(JobUtil.java:71) at com.intellij.concurrency.JobUtil.invokeConcurrentlyUnderProgress(JobUtil.java:112) at com.intellij.psi.impl.search.PsiSearchHelperImpl.a(PsiSearchHelperImpl.java:285) at com.intellij.psi.impl.search.PsiSearchHelperImpl.a(PsiSearchHelperImpl.java:632) at com.intellij.psi.impl.search.PsiSearchHelperImpl.processRequests(PsiSearchHelperImpl.java:549) at com.intellij.find.findUsages.FindUsagesManager$3.generate(FindUsagesManager.java:402) at com.intellij.find.findUsages.FindUsagesManager.isUsed(FindUsagesManager.java:281) at com.intellij.codeInsight.daemon.impl.PostHighlightingPass.a(PostHighlightingPass.java:633) at com.intellij.codeInsight.daemon.impl.PostHighlightingPass.b(PostHighlightingPass.java:704) at com.intellij.codeInsight.daemon.impl.PostHighlightingPass.isClassUsed(PostHighlightingPass.java:691) at com.intellij.codeInsight.daemon.impl.PostHighlightingPass.a(PostHighlightingPass.java:657) at com.intellij.codeInsight.daemon.impl.PostHighlightingPass.a(PostHighlightingPass.java:320) at com.intellij.codeInsight.daemon.impl.PostHighlightingPass.a(PostHighlightingPass.java:274) at com.intellij.codeInsight.daemon.impl.PostHighlightingPass.access$000(PostHighlightingPass.java:88) at com.intellij.codeInsight.daemon.impl.PostHighlightingPass$1.run(PostHighlightingPass.java:148) at com.intellij.codeInsight.daemon.impl.RefCountHolder.retrieveUnusedReferencesInfo(RefCountHolder.java:264) at com.intellij.codeInsight.daemon.impl.PostHighlightingPass.doCollectInformation(PostHighlightingPass.java:145) at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:61) at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1$1.run(PassExecutorService.java:350) at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1053) at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1.run(PassExecutorService.java:342) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:218) at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.a(PassExecutorService.java:340) at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:316) at com.intellij.concurrency.JobUtil$3.call(JobUtil.java:134) at com.intellij.concurrency.JobUtil$3.call(JobUtil.java:131) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at com.intellij.concurrency.PrioritizedFutureTask.access$101(PrioritizedFutureTask.java:31) at com.intellij.concurrency.PrioritizedFutureTask$1.run(PrioritizedFutureTask.java:70) at com.intellij.concurrency.PrioritizedFutureTask.run(PrioritizedFutureTask.java:113) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662)

hablutzel1 commented 12 years ago

This was happening because of anonymous classes and the inspection that catches @should tags without a written test method. It was exactly happening after writting something like:

new Runnable() { <here happens the problem>

Fixed in idea11 branch 832e79c

akmad commented 12 years ago

Thanks once again for making this plugin and continuing to work on it! It really does make setting up tests a lot easier.

hablutzel1 commented 12 years ago

Thanks to you for testing and using it, I really appreciate your bug reports and if you have any other suggestion I will be greatful, by the way I have started a project where I use the plugin so given I will be using it I'll work a little bit more on it. One more thing... have you ever worked with IntelliJ IDEA plugins, would you be interested in maintaining the plugin too? I would be happy to add you as a colaborator.

Good bye

On Thu, Aug 9, 2012 at 2:05 AM, Wes notifications@github.com wrote:

Thanks once again for making this plugin and continuing to work on it! It really does make setting up tests a lot easier.

— Reply to this email directly or view it on GitHubhttps://github.com/skarootz/GenerateTestCases/issues/27#issuecomment-7606906.

Jaime Hablutzel - 9-9956-3299

(tildes omitidas intencionalmente)

akmad commented 12 years ago

Jaime,

I have never worked on IntelliJ plugins before, in fact I am relatively new to the whole java development ecosystem; for the last 10+ years I have been doing .Net (c#) development. So, while this is a very similar language to Java, the tools are all a little different and there has been a little learning curve getting used to how things are done in the Java world. Given that, if you are still interested in getting some help with the plugin I would be willing to work on an issue here and there. I don't currently have that many cycles to donate as I'm already spread quite thin, but this will change in a few months.

Thanks for the message and thanks again for creating this plugin! -Wes

On Thu, Aug 9, 2012 at 7:41 PM, Jaime Hablutzel notifications@github.comwrote:

Thanks to you for testing and using it, I really appreciate your bug reports and if you have any other suggestion I will be greatful, by the way I have started a project where I use the plugin so given I will be using it I'll work a little bit more on it. One more thing... have you ever worked with IntelliJ IDEA plugins, would you be interested in maintaining the plugin too? I would be happy to add you as a colaborator.

Good bye

On Thu, Aug 9, 2012 at 2:05 AM, Wes notifications@github.com wrote:

Thanks once again for making this plugin and continuing to work on it! It really does make setting up tests a lot easier.

— Reply to this email directly or view it on GitHub< https://github.com/skarootz/GenerateTestCases/issues/27#issuecomment-7606906>.

Jaime Hablutzel - 9-9956-3299

(tildes omitidas intencionalmente)

— Reply to this email directly or view it on GitHubhttps://github.com/skarootz/GenerateTestCases/issues/27#issuecomment-7619485.