intellij-haxe icon indicating copy to clipboard operation
intellij-haxe copied to clipboard

java.lang.RuntimeException: java.lang.IllegalStateException: @NotNull method

Open Shaunmax opened this issue 1 year ago • 15 comments

I get this error every time, open a Haxe project :

java.lang.RuntimeException: java.lang.IllegalStateException: @NotNull method com/intellij/plugins/haxe/haxelib/HaxeLibrary.getVersionString must not return null
	at com.intellij.openapi.application.impl.LaterInvocator.invokeAndWait(LaterInvocator.java:131)
	at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:471)
	at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:490)
	at com.intellij.plugins.haxe.haxelib.HaxelibProjectUpdater.doWriteAction(HaxelibProjectUpdater.java:1068)
	at com.intellij.plugins.haxe.haxelib.HaxelibProjectUpdater.updateModule(HaxelibProjectUpdater.java:454)
	at com.intellij.plugins.haxe.haxelib.HaxelibProjectUpdater.resolveModuleLibraries(HaxelibProjectUpdater.java:241)
	at com.intellij.plugins.haxe.haxelib.HaxelibProjectUpdater.syncOneModule(HaxelibProjectUpdater.java:559)
	at com.intellij.plugins.haxe.haxelib.HaxelibProjectUpdater.syncModuleClasspaths(HaxelibProjectUpdater.java:753)
	at com.intellij.plugins.haxe.haxelib.HaxelibProjectUpdater.lambda$synchronizeClasspaths$5(HaxelibProjectUpdater.java:763)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:628)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:61)
	at com.intellij.plugins.haxe.haxelib.HaxelibProjectUpdater.synchronizeClasspaths(HaxelibProjectUpdater.java:763)
	at com.intellij.plugins.haxe.haxelib.HaxelibProjectUpdater$ProjectUpdateQueue.doUpdateWork(HaxelibProjectUpdater.java:1619)
	at com.intellij.plugins.haxe.haxelib.HaxelibProjectUpdater$ProjectUpdateQueue$2.run(HaxelibProjectUpdater.java:1603)
	at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:428)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:115)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$6(CoreProgressManager.java:478)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:251)
	at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:71)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:186)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:61)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:173)
	at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:71)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$5(ProgressRunner.java:251)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$launchTask$18(ProgressRunner.java:465)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
	at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: java.lang.IllegalStateException: @NotNull method com/intellij/plugins/haxe/haxelib/HaxeLibrary.getVersionString must not return null
	at com.intellij.plugins.haxe.haxelib.HaxeLibrary.$$$reportNull$$$0(HaxeLibrary.java)
	at com.intellij.plugins.haxe.haxelib.HaxeLibrary.getVersionString(HaxeLibrary.java:187)
	at com.intellij.plugins.haxe.haxelib.HaxeLibraryReference.getLoadedVersion(HaxeLibraryReference.java:153)
	at com.intellij.plugins.haxe.haxelib.HaxeLibraryReference.getPresentableName(HaxeLibraryReference.java:144)
	at com.intellij.plugins.haxe.haxelib.HaxelibProjectUpdater$2.processEntry(HaxelibProjectUpdater.java:362)
	at com.intellij.plugins.haxe.haxelib.HaxeLibraryList.iterate(HaxeLibraryList.java:270)
	at com.intellij.plugins.haxe.haxelib.HaxelibProjectUpdater.addLibraries(HaxelibProjectUpdater.java:335)
	at com.intellij.plugins.haxe.haxelib.HaxelibProjectUpdater.lambda$updateModule$0(HaxelibProjectUpdater.java:480)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:992)
	at com.intellij.plugins.haxe.haxelib.HaxelibProjectUpdater.lambda$doWriteAction$7(HaxelibProjectUpdater.java:1068)
	at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:208)
	at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:21)
	at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:190)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:861)
	at com.intellij.openapi.application.impl.ApplicationImpl$4.run(ApplicationImpl.java:478)
	at com.intellij.openapi.application.impl.LaterInvocator$1.run(LaterInvocator.java:100)
	at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:79)
	at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:121)
	at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:41)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:792)
	at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
	at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:733)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:761)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:690)
	at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$10(IdeEventQueue.kt:593)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWithoutImplicitRead(ApplicationImpl.java:1485)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:593)
	at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:67)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:369)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:368)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:368)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:363)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:997)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105)
	at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:997)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:363)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:861)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:405)
	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)

I am using IntelliJ IDEA 2023.2.5 (Ultimate Edition) on masOS Sonoma 14.1.1. Haxe Toolkit Version : 1.5.3

Also, there is no code completion for the project

Shaunmax avatar Jun 02 '24 05:06 Shaunmax

Sounds like you have not configure the SDK correctly. The error comes from when the plugin tries to detect and/or set the SDK version info.

m0rkeulv avatar Jun 04 '24 17:06 m0rkeulv

Sorry, i didn't look close enough, its an issue reading version from a library, not the SDK. i can make a fix to get around the problem but it would be nice to know why it fails, best guess is that you got a haxelib with a haxelib.json file that is missing version info

m0rkeulv avatar Jun 04 '24 17:06 m0rkeulv

Sorry, i didn't look close enough, its an issue reading version from a library, not the SDK. i can make a fix to get around the problem but it would be nice to know why it fails, best guess is that you got a haxelib with a haxelib.json file that is missing version info

I am sorry, I dint get you! are you asking me to check something from my side ?

Shaunmax avatar Jun 04 '24 17:06 Shaunmax

i can make a fix but it will take some time before i can make a new release, in the mean time if you need to get things working you can check your haxelib libraries and look inside each one and check the files named haxelib.json, i expect one of them is missing the version value. you can just add a dummy value like "version" : "1.2.3" to anyone who is missing that line and the plugin should work again

they normally look like this and in your case i think one is missing the "version" line:

{
  "name": "box2d",
  "url": "http://github.com/jgranick/box2d",
  "license": "MIT",
  "tags": [ "physics", "flash", "cpp" ],
  "description": "Box2D is a tremendously popular physics engine for most platforms.",
  "version": "1.2.3",
  "releasenote": "Added TestBed sample, better B2ShapeType, platform fixes",
  "contributors": [ "singmajesty" ],
  "dependencies": {}
}

m0rkeulv avatar Jun 04 '24 17:06 m0rkeulv

look inside each one and check the files named haxelib.json, i expect one of them is missing the version value.

I just went through all the haxelib.json files in my system and they all have "version" in it.

Shaunmax avatar Jun 04 '24 18:06 Shaunmax

strange.

the stacktrace more or less show the step when the plugin iterate over all libraries to read names, version etc.
it looks like it gets past syncing the overall project but fails when updating library list from each module. Its about to add a library and create the presentable name string, it looks like getting the name is no issue but the exception complains that the returned value for version is a null value. could you check your module dependencies and see if there is any dependencies that does not look like the rest ?

m0rkeulv avatar Jun 04 '24 18:06 m0rkeulv

strange.

the stacktrace more or less show the step when the plugin iterate over all libraries to read names, version etc. it looks like it gets past syncing the overall project but fails when updating library list from each module. Its about to add a library and create the presentable name string, it looks like getting the name is no issue but the exception complains that the returned value for version is a null value. could you check your module dependencies and see if there is any dependencies that does not look like the rest ?

I have 2 libraries in the project:-

image

image

Shaunmax avatar Jun 04 '24 18:06 Shaunmax

open project structures and then modules and then dependencies. I dont think you can see the issue from the main view

m0rkeulv avatar Jun 04 '24 18:06 m0rkeulv

open project structures and then modules and then dependencies. I dont think you can see the issue from the main view

that I did earlier

image

checked all these folders

Shaunmax avatar Jun 04 '24 18:06 Shaunmax

is this how your module dependencies look like ? image

m0rkeulv avatar Jun 04 '24 21:06 m0rkeulv

is this how your module dependencies look like ? image

Yes!

image

this is the project I am trying to load : https://github.com/SwazLord/Flappy-Starling-Haxe/tree/main

Shaunmax avatar Jun 05 '24 07:06 Shaunmax

i did some changes in the latest release that i hope remedies some of this issue, could you update to 1.5.4 and test again ?

m0rkeulv avatar Jun 18 '24 12:06 m0rkeulv

i did some changes in the latest release that i hope remedies some of this issue, could you update to 1.5.4 and test again ?

Yes! The error is gone now, but still no code completion

Shaunmax avatar Jun 18 '24 12:06 Shaunmax

could you try to do a prune caches and then a reload project from the project structure context menu. image

m0rkeulv avatar Jun 18 '24 15:06 m0rkeulv

prune caches

I tried that, but nothing happened

Shaunmax avatar Jun 18 '24 17:06 Shaunmax