eclipse-cs
                                
                                 eclipse-cs copied to clipboard
                                
                                    eclipse-cs copied to clipboard
                            
                            
                            
                        Cannot easily delete / fix an incorrect link to a checkstyle.xml file
Configuration
Using Eclipse IDE for Java 2024-03 (4.31.0) Build id: 20240307-1437
- A brand new installation in a brand new workspace
- I only installed the Checkstyle plugin: 10.14.2.202403262245 net.sf.eclipsecs.feature.group
- Imported only one existing java/maven root project with 2 sub-projects
Running on Apple MacBook Pro, Apple M1 Pro chip, macOS Sonoma 14.4.1
Description / Steps to Reproduce
I accidentally inserted an incorrect location for a checkstyle.xml file, which I discovered later. But it is incredibly difficult to fix it.
Steps to Reproduce:
- First insert an invalid path to a custom checkstyle.xml file in Local Check Configurations, Apply and close.
- Right-click on project, select Properties / Checkstyle
- The "Location" box at the top has a red X (of course) with the incorrect location listed
 
- Select "Local Check Configurations"
- Select the bad "Check Configuration" / Remove
- First I get a Confirm Delete pop-up, click "Yes"
- Then I get this error message:
The Check Configuration "<file name>" is currently in use by a project. It must be removed from all project configurations before it can be deleted.
I tried deactivating checkstyle in the two projects (the only two). I also unclicked the box "Checkstyle active for each project". None of this allowed me to simply correct the path to the xml file. I didn't know what else to do to remove Checkstyle from being used.
Finally, after trying all kinds of things I tried this:
- In Local Check ConfigurationsI added a new correct entry with a different name.
- Then returned to the "Main" menu and selected it instead of the bad one.
- IN the "Main" menu, I Hit "Apply and Close" -  This closed me all the way out.
- Note: If there was an "Apply" button it would allow me to easily return to the Local Config dialog.
 
- Then I re-entered into Checkstyle / Local Check Configurations
- Now I could delete the incorrect entry.
Yes, I did finally figure out how to fix it. So what is the problem?
- 
It is inordinately complicated to simply fix an incorrect path! 
- 
The error message words: "The Check Configuration "<file name>" is currently in use by a project" led me down a rat-hole trying to "deactivate" its use at the project level. 
- 
The error message words "It must be removed from all project configurations before it can be deleted." also led me to look at where at the project level I activated checkstyle. 
- 
What I would suggest is when the checkstyle code figures out that the path is incorrect display an error message something like this: 
The current configuration file <blah> cannot be found. Correct this by choosing and applying any valid configuration (e.g, default) from the Main dialog and then return to the Local Check Configuration menu to delete the incorrect one, and then create a new Check Configuration.
Even better: find an even easier way to fix a broken or invalid path to the xml file!