manifold-systems / manifold

Manifold is a Java compiler plugin, its features include Metaprogramming, Properties, Extension Methods, Operator Overloading, Templates, a Preprocessor, and more.
http://manifold.systems/
Apache License 2.0
2.43k stars 125 forks source link

Plugin NPE on 2022.1.10 #367

Closed gudenau closed 1 year ago

gudenau commented 2 years ago

Describe the bug While writing code in Idea Ultimate 2022.1.1 with the Manifest plugin version 2022.1.10 there will be random NPEs thrown.

I am not sure what the cause is exactly, but it does interfere with syntax highlighting and inspections. It will keep inspections in commented out code or won't inspect un-commented code when the NPE is thrown, this is not consistent and does not appear to be the only way this gets triggered.

To Reproduce Steps to reproduce the behavior:

  1. Install Plugin
  2. Edit code without Manifold in the class path
  3. Randomly get NPEs

Expected behavior No NPEs and code inspections should work as intended.

Screenshots If applicable, add screenshots to help explain your problem (drag/drop them here).

Desktop (please complete the following information):

Additional context I am sorry for not being able to describe the bug better, it is fairly random.

Stack trace

java.lang.NullPointerException
    at manifold.api.host.IModule.findTypeManifoldsFor(IModule.java:134)
    at manifold.ij.core.ManModule.findTypeManifoldsForFile(ManModule.java:224)
    at manifold.ij.extensions.ManRefreshListener.notify(ManRefreshListener.java:171)
    at manifold.ij.extensions.ManRefreshListener.modified(ManRefreshListener.java:134)
    at manifold.ij.extensions.FileModificationManager.fireModifiedEvent(FileModificationManager.java:287)
    at manifold.ij.extensions.FileModificationManager.fireModifiedEvent(FileModificationManager.java:271)
    at manifold.ij.extensions.FileModificationManager.lambda$_after$2(FileModificationManager.java:216)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:907)
    at manifold.ij.extensions.FileModificationManager._after(FileModificationManager.java:216)
    at manifold.ij.extensions.FileModificationManager.lambda$after$1(FileModificationManager.java:182)
    at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:215)
    at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:22)
    at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:197)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:873)
    at com.intellij.openapi.application.impl.ApplicationImpl$3.run(ApplicationImpl.java:511)
    at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:69)
    at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:112)
    at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:42)
    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:898)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:746)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:439)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:803)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:438)
    at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)
    at com.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:604)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:436)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:873)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:484)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
rsmckinney commented 1 year ago

Cannot reproduce. Please reopen if you see this again. Thanks for reporting.