-
Notifications
You must be signed in to change notification settings - Fork 460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"java.lang.IllegalStateException: Workspace is closed" with eclipse('4.7.2') #191
Comments
Can you show the code of |
It's linked in my first post. |
@d1ss0nanz What "first post" are you referring to? :) |
The first "comment" in this issue. Let me know if you need anything else. |
Can you show us the eclipse config that you're using? |
Does it have So, it should be |
It's .xml, but I can't upload XML files here, so I had to change the file extension. Here's my actual config:
|
Please let me know if you need any other information. |
Sorry, I'm stumped. The |
Yes, |
Found the cause of the exception: |
Fascinating! I think the eclipse formatter is smart enough that it looks at the imports and uses them for javadoc Seems like a hard problem to track all the way down. Happy to take a PR, but unlikely to see a fix. |
Same error here with spotless 3.9.0 |
Just FYI with eclipse oxygen, spotless 3.9.0 -- in eclipse I have no issue formatting the code. spotlessApplyJava however exceptions with the same message as the OP. |
There is a formatter setting that determines whether java source code inside of a pre block gets formatted:
The default value is true, maybe false is a workaround? |
Setting this to false isn't a workaround. |
ProblemThe problem is in the JDT code formatter. Due topre it tries to created a new parser for the Java code within pre tags. The formatter requires a compilation unit (so in the end files). Since JDT now supports Java 9, it also requires a module-info.java. So what JDT now does is an assembly of fake paths. To make up these fakes, it uses the Eclipse work-space. But spotless has/requires no work-space, so the module is not initialized.
Work-AroundThe only work-around I see is to set the following properties toFALSE :
Note that both must be set to false. SolutionWill provide a fix ASAP, but it will take a while before it'll be available on Maven Central. |
Hello, |
Same error in 3.13.0 as well. FYI: For now removed tags and added // @formatter:off |
* Current spotless can not handle <pre> tags in comment section. Open issue in github: diffplug/spotless#191 Signed-off-by: Jamz <Jamz@Nerps.net>
* #49: Add proper pathfinding taking VBL into account - Total WIP POC Task-Url: #49 Signed-off-by: Jamz <Jamz@Nerps.net> * #49: Add proper pathfinding taking VBL into account - Cleaned up code a bit, Tweaked heuristic - Currently avoids any cell that has any VBL in it... to be tweaked later Task-Url: #49 Signed-off-by: Jamz <Jamz@Nerps.net> * #49: Add proper pathfinding taking VBL into account - Buildable version... Task-Url: #49 Signed-off-by: Jamz <Jamz@Nerps.net> * Bug Fix - Preference Diaglog would error if launched from JAR or IDE as it would be missing native libs for JVMPreferences. StartUp tab is now disabled if not launched from native executable/missing packager lib. Signed-off-by: Jamz <Jamz@Nerps.net> * #49: Add proper pathfinding taking VBL into account - More progress on A* - Added Terrain Modifiers calculation and option on Token properties - WIP on multi threading... Task-Url: #49 Signed-off-by: Jamz <Jamz@Nerps.net> * Bug Fix - Inno Setup - Restored iss prop so directory will always populate during windows install - Task-Url: #49 Signed-off-by: Jamz <Jamz@Nerps.net> * #49: Add proper pathfinding taking VBL into account - Token Properties UI changes Task-Url: #49 Signed-off-by: Jamz <Jamz@Nerps.net> * Enhancement - FoW optimization! - Changed circles to 'fake' circles (removing curves from geometry) for faster Area.add calculations - WIP new "GRID" vision/light type! Task-Url: #49 Signed-off-by: Jamz <Jamz@Nerps.net> * #49: Add proper pathfinding taking VBL into account - WIP A* Pathfinding - WIP new "GRID" vision/light type! Task-Url: #49 Signed-off-by: Jamz <Jamz@Nerps.net> Task-Url: #49 Signed-off-by: Jamz <Jamz@Nerps.net> * com.github.jai-imageio:jai-imageio-core bumped to 1.4.0 to support Java 9 Signed-off-by: Jamz <Jamz@Nerps.net> * Changed Sentry.IO to not log in Development envrionments. Signed-off-by: Jamz <Jamz@Nerps.net> * Fixes Z Order Violation Pulled from upstream: RPTools#179 Signed-off-by: Jamz <Jamz@Nerps.net> * Enhancement - Video Backgrounds * POC to add video as a background map 49: Add proper pathfinding taking VBL into account Task-Url: #49 Signed-off-by: Jamz <Jamz@Nerps.net> * Enhancement - #49: Add proper pathfinding taking VBL into account * Finished POC for ASTar Pathfinding, code cleanup * Spotless Applied * Had to remove grgit.branch.current().name for now, getting errors for unknown reason Signed-off-by: Jamz <Jamz@Nerps.net> * Updated Gradle Build * Removed JFX-Plugin * Updated Spotless version to 3.13 Signed-off-by: Jamz <Jamz@Nerps.net> * Updated for Spotless * Current spotless can not handle <pre> tags in comment section. Open issue in github: diffplug/spotless#191 Signed-off-by: Jamz <Jamz@Nerps.net> * Enhancement - Java 10! * Updated packaged JRE to Java 10. Signed-off-by: Jamz <Jamz@Nerps.net> * Update .appveyor.yml Added Linux build * Update .travis.yml Removed Linux from the matrix * Moving linux build to appveyor * Setting JAVA_HOME for windows only per matrix Signed-off-by: Jamz <Jamz@Nerps.net> * Moving linux build to appveyor * Setting JAVA_HOME for windows only per matrix Signed-off-by: Jamz <Jamz@Nerps.net> * Another appveyor test Signed-off-by: Jamz <Jamz@Nerps.net> * YAT Signed-off-by: Jamz <Jamz@Nerps.net> * YAT Signed-off-by: Jamz <Jamz@Nerps.net> * Update .appveyor.yml Trigger appveyor $%$@#%# * Appveyor not kicking off... Signed-off-by: Jamz <Jamz@Nerps.net> * Enhancement - AutoUpdate * Added tag name to Auto Update message * Appveyor environment var bug fix Signed-off-by: Jamz <Jamz@Nerps.net> * YAT Signed-off-by: Jamz <Jamz@Nerps.net> * YAT Appveyor not kicking off if only yml chnaged? Signed-off-by: Jamz <Jamz@Nerps.net> * YAT 2 Signed-off-by: Jamz <Jamz@Nerps.net> * WTF Signed-off-by: Jamz <Jamz@Nerps.net> * Attempt #12 Signed-off-by: Jamz <Jamz@Nerps.net> * Attempt #13 Signed-off-by: Jamz <Jamz@Nerps.net> * looking for java... Signed-off-by: Jamz <Jamz@Nerps.net> * Attempt #15 Signed-off-by: Jamz <Jamz@Nerps.net> * Attempt #16 Signed-off-by: Jamz <Jamz@Nerps.net> * Sigh... manually install jdk 10 Signed-off-by: Jamz <Jamz@Nerps.net> * Hrm Signed-off-by: Jamz <Jamz@Nerps.net> * Well, can we go with java 9 then? Signed-off-by: Jamz <Jamz@Nerps.net> * Update .appveyor.yml Adding manual install of Open JDK 10 * Update .appveyor.yml Checking gradle version * Update .appveyor.yml change to unix gradle wrapper * Update .appveyor.yml Attempting to install oracle's JDK 10... * Update .appveyor.yml sigh...will this ever work... * Update .appveyor.yml one more try, why not... * Update .appveyor.yml Getting closer... now setting JAVA_HOME * Update .appveyor.yml adding fakeroot... * Update .appveyor.yml learn to type... * Update .appveyor.yml Finally working version for linux, Final tweaks... * Update .appveyor.yml Adding windows back. * Note sh: commands should only run on linux, build scripts should run on both * Update build.gradle Updated vendor to Nerps from Nerps-BETA. * Update .appveyor.yml Attempt to fix false spotless fails on windows VM * Update .appveyor.yml Adding init stage * Update .appveyor.yml added tag: $(APPVEYOR_REPO_TAG_NAME) * Update .appveyor.yml Test if linux/windows order matters * Update .appveyor.yml Uppercased APPVEYOR_REPO_TAG for Linux * Enhancement #68 - Changing Language * Added JVM User Option to change default MapTool language via Edit -> Preferences -> Startup tab * Moved MAPTOOL_DATADIR from JvmOptions to userJvmOptions and enabled user setting in Edit -> Preferences -> Startup tab Signed-off-by: Jamz <Jamz@Nerps.net> * #49: Add proper pathfinding taking VBL into account * Pathfinding now properly works for Hex grid! * Refactored and cleaned up code for AStar Pathfinding Task-Url: #49 Signed-off-by: Jamz <Jamz@Nerps.net> * #63 Restore default behavior of spacebar+left mouse click * Spacebar functionality has been restored to it's original behavior including ctrl+spacebar & shift+spacebar as well. * A new shift+ctrl+spacebar command along with a new pointer image is now available. When this keystroke combo is pressed, and you are a GM, the pointer will center & zoom all connected clients to that point. When it is released, all clients will return to their previous view point & zoom. Task-Url: #63 Signed-off-by: Jamz <Jamz@Nerps.net> * Spotless... Signed-off-by: Jamz <Jamz@Nerps.net> * #67: New Vision/Light type: GRID * Clear gridShapeCache on grid change * Instatiante footprint field to prevent null pointer on measuring tool. Task-Url: #67 Signed-off-by: Jamz <Jamz@Nerps.net> * #49: Add proper pathfinding taking VBL into account * When token movement is done (left click released) we now wait for the final background thread for A* Pathfinding is to either finish or time out so quick or long moves get a chance to render a path. Task-Url: #49 Signed-off-by: Jamz <Jamz@Nerps.net>
Thanks to a monumental effort from @fvgh, this has been fixed in plugin-gradle 3.14.0 and plugin-maven 1.14.0. |
I still encountered issues with
They seem to be bugs in the eclipse formatter itself, and not the fault of this plugin. Thus, I could only workaround it by exporting a
P.S. I would use the eclipse formatter v4.8.x, but that version introduced various unrelated formatting bugs. Thus I'm stuck with v4.7.x or the future v4.9.x. |
Sorry @achaphiv , but a back-port of the bug-fix was never foreseen. There are known issues with 4.8.x, like reported with #263. Hence I additionally provided |
Sure, here's an example project that demonstrates one of the more annoying issues I encountered. https://github.com/achaphiv/spotless-problem/ The following simple class uses 100% CPU and seems to cause an infinite loop: public class CausesEndlessExecution {
// one
// two
{
if (
true
) {}
}
} Tested on mac (java 1.8.0_172) and linux (openjdk 1.8.0_181). Bizarre right? Those two comments combined with the multi-line It fails on any eclipse version. I.E.
I eventually just gave up and disabled all comment formatting to sidestep all these issues. |
@achaphiv Thanks for the input. Please give me some days to dig into it. Looks like some different bug. |
@achaphiv To me it seems that some other preference correlation causes the problem:
It is irritating the the Eclipse JDT preference editor does not prevent these malicious settings. If you find anything that works with your Eclipse IDE but not with Spotless, let me know. |
I only made one change to the -<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="false"/>
Hmm, probably not necessary. Definitely looks like an Eclipse issue. I made my original comment because I thought it worked in the IDE, but not spotless. But I see my test project freezing in the IDE as well. I was likely running into at least 2 separate issues:
I'll be on lookout, but Eclipse 4.9 (2018-09) still seems to have issues with line comments, so I've turned off all comment handling in both eclipse/spotless to avoid all current and future comment-related issues. |
@achaphiv |
The original bug tile is misleading. Every exception which occurs within a Spotless Eclipse implementation leads to a |
spotless 3.8.0
The text was updated successfully, but these errors were encountered: