From maurizio.cimadamore at oracle.com Thu Jun 18 00:46:22 2020 From: maurizio.cimadamore at oracle.com (Maurizio Cimadamore) Date: Thu, 18 Jun 2020 01:46:22 +0100 Subject: jtreg plugin for IntelliJ IDEA - report of NullPointerException In-Reply-To: References: Message-ID: <69ec27a8-477e-1064-f0a7-4690a40c5006@oracle.com> (adding ide-support) Hi, this has been reported before: https://mail.openjdk.java.net/pipermail/jtreg-dev/2020-May/000826.html John proposed a fix there which looks promising - I was also trying to find a suitable icon, but could not locate it; I will test John's fix and propose a fix. Cheers Maurizio On 17/06/2020 18:47, Chris W. Johnson wrote: > I'm using IntelliJ IDEA 2020.1.2 (Ultimate Edition), build #IU-201.7846.76. I have no idea whether the issue is specific to the version of IntelliJ, because this is my first attempt to use the jtreg plugin. > > BTW, I encountered a build problem on line 232 of "JTRegServiceConfigurable": > > return antTarget instanceof MetaTarget ? AntIcons.MetaTarget : AntIcons.Target; > > The problem is the "AntIcons" class doesn't include a "Target" field (I'm guessing it did in the past). I made the build work substituting "AntIcons.Task", on the assumption the worst effect would be an inappropriate icon appearing in the GUI. > > Unfortunately, the plugin produces the NullPointerException show below during IntelliJ startup, before I ever see its GUI. Enclosed are the logs and diagnostic data gathered by IntelliJ. > > Thanks for your efforts. > > ----Chris > > > > java.lang.IllegalArgumentException: Argument for @NotNull parameter 'module' of com/intellij/openapi/roots/ModuleRootManager.getInstance must not be null > at com.intellij.openapi.roots.ModuleRootManager.$$$reportNull$$$0(ModuleRootManager.java) > at com.intellij.openapi.roots.ModuleRootManager.getInstance(ModuleRootManager.java) > at com.oracle.plugin.jtreg.components.JTRegFileManagerListener$TestRootManager.rootModel(JTRegFileManagerListener.java:182) > at com.oracle.plugin.jtreg.components.JTRegFileManagerListener.processFileOpened(JTRegFileManagerListener.java:139) > at com.oracle.plugin.jtreg.components.JTRegFileManagerListener.lambda$fileOpened$0(JTRegFileManagerListener.java:113) > at com.intellij.openapi.project.DumbServiceImpl.lambda$smartInvokeLater$8(DumbServiceImpl.java:623) > at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:201) > at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:831) > at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLater$4(ApplicationImpl.java:310) > at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:80) > at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:128) > at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:46) > at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:184) > at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313) > at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776) > at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727) > at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721) > at java.base/java.security.AccessController.doPrivileged(Native Method) > at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) > at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746) > at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:974) > at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:847) > at com.intellij.ide.IdeEventQueue.lambda$null$8(IdeEventQueue.java:449) > at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:741) > at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:448) > at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:831) > at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:496) > at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) > at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) > at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) > at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) > at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) > at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90) > > > > Chris W. Johnson > chriswjohnson at mac.com > http://www.panojohnson.com/ > > From maurizio.cimadamore at oracle.com Thu Jun 18 10:07:28 2020 From: maurizio.cimadamore at oracle.com (Maurizio Cimadamore) Date: Thu, 18 Jun 2020 11:07:28 +0100 Subject: RFR 7902706: IntelliJ jtreg plugin crashes because of removal of deprecated icon Message-ID: <8a274892-d5b8-6be1-9488-d679ba65b9cb@oracle.com> Hi, this is a path that fixes the crash in the intellij jtreg plugin which started to occur in the latest version 2020.1. http://cr.openjdk.java.net/~mcimadamore/7902706/webrev/ This patch is based on some work submitted few weeks ago by John Rhee [1]; I sprinkled the usual reflective goop on top to make sure that the plugin keeps working against old versions too (as the new Target icon is only defined for 2019.x). I've also added an overload for a method whose implementation is deprecated, namely ConfigurationFactory::getId; this should keep things from breaking in the medium run. As a general note, I see that the IDE is giving quite a bit of warning around the plugin code - in many instances IntelliJ is trying to move towards a lazier/more declarative way to register listener to events [2]. But I think a point will come in which we won't be able to evolve the plugin in a compatible way - so at some point in the future we should probably start thinking about dropping support for older version and start using 2019 as base. Cheers Maurizio [1] - https://mail.openjdk.java.net/pipermail/jtreg-dev/2020-May/000826.html [2] - https://www.jetbrains.org/intellij/sdk/docs/basics/plugin_structure/plugin_listeners.html From maurizio.cimadamore at oracle.com Tue Jun 23 10:39:52 2020 From: maurizio.cimadamore at oracle.com (Maurizio Cimadamore) Date: Tue, 23 Jun 2020 11:39:52 +0100 Subject: RFR 7902706: IntelliJ jtreg plugin crashes because of removal of deprecated icon In-Reply-To: <8a274892-d5b8-6be1-9488-d679ba65b9cb@oracle.com> References: <8a274892-d5b8-6be1-9488-d679ba65b9cb@oracle.com> Message-ID: (ping, also adding jtreg-dev) On 18/06/2020 11:07, Maurizio Cimadamore wrote: > Hi, > this is a path that fixes the crash in the intellij jtreg plugin which > started to occur in the latest version 2020.1. > > http://cr.openjdk.java.net/~mcimadamore/7902706/webrev/ > > This patch is based on some work submitted few weeks ago by John Rhee > [1]; I sprinkled the usual reflective goop on top to make sure that > the plugin keeps working against old versions too (as the new Target > icon is only defined for 2019.x). > > I've also added an overload for a method whose implementation is > deprecated, namely ConfigurationFactory::getId; this should keep > things from breaking in the medium run. > > As a general note, I see that the IDE is giving quite a bit of warning > around the plugin code - in many instances IntelliJ is trying to move > towards a lazier/more declarative way to register listener to events > [2]. But I think a point will come in which we won't be able to evolve > the plugin in a compatible way - so at some point in the future we > should probably start thinking about dropping support for older > version and start using 2019 as base. > > Cheers > Maurizio > > > [1] - > https://mail.openjdk.java.net/pipermail/jtreg-dev/2020-May/000826.html > [2] - > https://www.jetbrains.org/intellij/sdk/docs/basics/plugin_structure/plugin_listeners.html >