Skip to content
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

Properties for Checkstyle Problem doesn't show the Correct Group #476

Closed
rnveach opened this issue Feb 6, 2023 · 3 comments
Closed

Properties for Checkstyle Problem doesn't show the Correct Group #476

rnveach opened this issue Feb 6, 2023 · 3 comments
Labels

Comments

@rnveach
Copy link
Member

rnveach commented Feb 6, 2023

Identified when working on #451 ,

I added ImportControl to the project and new violations show up. When I go to the properties dialog for the new Checkstyle Problem, I am told "Group" is "Other" for the check.

image

However, Eclipse-CS' own configuration panel says it should be under "Imports". The only thing under "Other" is "Checker" and "TreeWalker".

image

I expected that we show the same group name on the properties dialog as our configuration dialog.

@rnveach
Copy link
Member Author

rnveach commented Feb 6, 2023

RuleMetadata metaData = MetadataFactory.getRuleMetadata(error.getSourceName());
// create generic metadata if none can be found
if (metaData == null) {
Module module = new Module(error.getSourceName());
metaData = MetadataFactory.createGenericMetadata(module);
}

I find it interesting we look for the metadata and if it doesn't exist, we create fake metadata and put it under "Other". It seems odd we create a fake metadata and don't even pass it to MarkerPropertyPage to display on the dialog. It could just save a simple look up, and even still we should be able to operate without everything being faked into the metadata.

I haven't debugged to confirm, but it does look like this area is the issue. getSourceName is most likely the FQCN and metadata is looking based on the simple check name (IE: com.puppycrawl.tools.checkstyle.checks.imports.ImportControlCheck versus ImportControl).

@Bananeweizen
Copy link
Collaborator

I haven't debugged to confirm, but it does look like this area is the issue. getSourceName is most likely the FQCN and metadata is looking based on the simple check name (IE: com.puppycrawl.tools.checkstyle.checks.imports.ImportControlCheck versus ImportControl).

That sounds very similar to what I experienced here: #397 (comment), when I wrote that the metadata somehow changed over the runtime of the application.

@Bananeweizen
Copy link
Collaborator

duplicate of #397

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants