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

Issue #7040: spotbugs is not executed in build process #7034

Merged
merged 1 commit into from
Sep 30, 2019
Merged

Issue #7040: spotbugs is not executed in build process #7034

merged 1 commit into from
Sep 30, 2019

Conversation

krichter722
Copy link
Contributor

@krichter722 krichter722 commented Aug 30, 2019

#7040

Add exclusions to spotbugs-exclude.xml for Files.newInputStream which can be ignored

I don't know why this doesn't fail on CI, but it blocks usage of mvn clean install locally. The messages don't reveal any issues and can be ignored.

@rnveach
Copy link
Member

rnveach commented Aug 30, 2019

I assume this is another JDK12 issue.
We skip and a few things in the JDK12 run: https://github.com/checkstyle/checkstyle/blob/master/.ci/appveyor.bat#L29

@krichter722
Copy link
Contributor Author

krichter722 commented Aug 30, 2019

@rnveach Does that mean that you're in favour or opposed to this change? The issues occur on all of OpenJDK 8, 11 and 12 when I run mvn install locally. Sooner or later someone will stumbled over them again and spend time on them.

@rnveach
Copy link
Member

rnveach commented Aug 30, 2019

If we make this change, you have to remove the exclusion for spotbugs to show the change fixes it in the CI.
I do question making an exclusion for an entire method when a JDK version far beyond what we currently use requires it for the whole project. I was waiting for @romani to give his opinion.

@krichter722
Copy link
Contributor Author

Judging from the CI output of master and latest commit I pushed here spotbugs was never running for OpenJDK < 12. I suggest adding it for OpenJDK 8 and 12 which are GA and OpenJDK 11 which has only recently be deprecated.

@rnveach
Copy link
Member

rnveach commented Aug 31, 2019

spotbugs was never running for OpenJDK < 12. I suggest adding it for OpenJDK 8 and 12 which are GA and OpenJDK 11 which has only recently be deprecated.

We do run it for openjdk 8.
See https://github.com/checkstyle/checkstyle/blob/master/.travis.yml#L55-L58

@romani
Copy link
Member

romani commented Aug 31, 2019

@krichter722 , please define a problem and what problem you experience.

You can create issue on it or you can treat this PR as issue and reference in commit it's number "Pull #7034: ...".
Minor prefix is for stuff that is not a problem and just polishing of something.

@krichter722 krichter722 changed the title minor: Add exclusions to spotbugs-exclude.xml for Files.newInputStream Issue #7040: spotbugs is not executed in build process Sep 3, 2019
@romani
Copy link
Member

romani commented Sep 6, 2019

but it blocks usage of mvn clean install locally.

Is it resolved ? if yes, lets make CI to control it.

spotbugs:check -Dspotbugs.skip=false

please explain this hack

Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

items to improve:

.travis.yml Outdated Show resolved Hide resolved
.travis.yml Outdated Show resolved Hide resolved
config/spotbugs-exclude.xml Show resolved Hide resolved
@rnveach
Copy link
Member

rnveach commented Sep 18, 2019

@krichter722 ping

@krichter722
Copy link
Contributor Author

krichter722 commented Sep 19, 2019

This patch allows to run mvn clean install locally. Excluding the hole method from the check is fine afaik since it's a weakness of JDK design. I excluded all occurances since I don't see a way around it.

I updated the commit message to include the PR number.

Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Item to improve:

config/spotbugs-exclude.xml Show resolved Hide resolved
@romani
Copy link
Member

romani commented Sep 26, 2019

I can not validate this PR, because I got output of spotbugs from jdk11 and placed it to issue description, but line numbers are pointing to comments in code.
It is not that easy for me to get to non jdk8 environment, if somebody have it, please share spotbugs output again.

Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clarification is required

@@ -45,6 +45,54 @@
<Method name="main" />
<Bug pattern="DM_EXIT" />
</Match>
<Match>
<!-- this is a JDK design weakness that we can do nothing about -->
Copy link
Member

@romani romani Sep 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/checkstyle/checkstyle/blob/master/src/main/java/com/puppycrawl/tools/checkstyle/Main.java#L423-L425

Why it is JDK weakness ?
it is problem of spotbugs tool that it goes too deep in bytecode, without consideration of syntax of language, it should not report issues on this such code.
We need to report issue on spotbugs and suppress until issue on their side is resolved.

comment should be till LINK_TO_ISSUE

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already experienced this problem, here is our team member post - spotbugs/spotbugs#259 (comment)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment should be till https://github.com/spotbugs/spotbugs/issues/259

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rnveach , please finalize.

code is rebased on latest master.

@romani romani assigned rnveach and unassigned romani Sep 28, 2019
@romani romani requested a review from rnveach September 28, 2019 14:32
Copy link
Member

@rnveach rnveach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@krichter722
Copy link
Contributor Author

@rnveach good finding. This doesn't seem to be fixed by spotbugs so soon since it's open since 2017. What do you think about adding the spotbugs issue URL to the comment explaining the exclusion and enabling spotbugs for OpenJDK 11 and 12? The issue that final fields can't be mock with OpenJDK 12 is addressed in #7035.

@rnveach
Copy link
Member

rnveach commented Sep 28, 2019

@romani https://teamcity.jetbrains.com/viewLog.html?buildId=2558933&buildTypeId=Checkstyle_IdeaInspectionsPullRequest&tab=buildLog&_focus=3132

The build Checkstyle::IDEA Inspections Pull Request #12381 {buildId=2558933} has been running for more than 50 minutes. Terminating...

@romani
Copy link
Member

romani commented Sep 28, 2019

Relaunched,

@romani
Copy link
Member

romani commented Sep 28, 2019

https://github.com/checkstyle/checkstyle/blob/master/.ci/appveyor.bat#L29
Need to be updated to remove Dspotbugs.skip=true

@romani
Copy link
Member

romani commented Sep 30, 2019

appveyor is updated, @rnveach , please review.

@rnveach rnveach assigned romani and unassigned rnveach Sep 30, 2019
@romani romani merged commit 394030d into checkstyle:master Sep 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants