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

Address Sonar major issue - "Final Class" #709

Closed
wants to merge 3 commits into from
Closed

Address Sonar major issue - "Final Class" #709

wants to merge 3 commits into from

Conversation

yinlinchen
Copy link
Contributor

  • Checks that class which has only private constructors is declared as final.

Resolves: https://jira.duraspace.org/browse/FCREPO-1322

Note that the Eclipse IDE is automatically format the source code by the defined rule in https://github.com/fcrepo4/fcrepo4/tree/3004d09f7c5bcca041736bfad6e5893e837bc720/src/site/eclipse

mvn checkstyle:check, mvn compile, mvn clean install are all passed.

- Checks that class which has only private constructors is declared as final.

Resolves: https://jira.duraspace.org/browse/FCREPO-1322
@awoods
Copy link

awoods commented Feb 11, 2015

@yinlinchen, I realize that your IDE reformatted the code and that the reformatted versions also pass the checkstyle checks. However, including unrelated format updates in pull-requests makes it very difficult to inspect git history for functional changes. Please remove the format updates as a new commit on the branch.
@ksclarke, do you have suggestions on how to tame Eclipse?

@yinlinchen
Copy link
Contributor Author

@awoods, I think the right way is to make the formatted correct. The
Eclipse IDE correctly reformatted the source code and made it right.

Take this PR as an example, the import order in RdfSerializationUtils.java
and CacheEntryFactory.java were wrong and the IDE correct the import order.

As you see the diff, github use dark red/dark green to show the indent, it
is not that difficult for you or other committers to see the formatted
changes.

Unless the source code formatted by intellij and Eclipse (or other IDE) are
different, we should make the source code formatted correct and fix the
wrong format. isn't it?

On Tue, Feb 10, 2015 at 8:32 PM, Andrew Woods notifications@github.com
wrote:

@yinlinchen https://github.com/yinlinchen, I realize that your IDE
reformatted the code and that the reformatted versions also pass the
checkstyle checks. However, including unrelated format updates in
pull-requests makes it very difficult to inspect git history for functional
changes. Please remove the format updates as a new commit on the branch.
@ksclarke https://github.com/ksclarke, do you have suggestions on how
to tame Eclipse?


Reply to this email directly or view it on GitHub
#709 (comment).

Regards,
Yinlin

@awoods
Copy link

awoods commented Feb 11, 2015

The issue is with mixing functional and non-functional (formatting) changes in a single commit.

If you want to reformat classes, you are welcome to. But if you do so, create a separate JIRA ticket for reformatting classes, and make sure that you do not include any functional updates in those commits and make sure that your commit comment clearly states that the updates are non-functional.

@ajs6f
Copy link
Contributor

ajs6f commented Feb 11, 2015

@yinlinchen I have had this conversation with @awoods before, and I think others also have. There's no point in remonstrating with him.

@yinlinchen
Copy link
Contributor Author

Ok, I agree with you.

In Eclipse, there is a function which can reformat source code whole
project/package. So I can very easily to create a JIRA and submit PR about
non-functional (formatting) changes in a couple of minutes.

However, the modified files in this PR will be a lot, do you or any others
have time to review this PR?

For now, what I can do is to disable the Eclipse save action. Which is
fine, just increasing my time to work on the tickets.

On Tue, Feb 10, 2015 at 11:34 PM, Andrew Woods notifications@github.com
wrote:

The issue is with mixing functional and non-functional (formatting)
changes in a single commit.

If you want to reformat classes, you are welcome to. But if you do so,
create a separate JIRA ticket for reformatting classes, and make sure that
you do not include any functional updates in those commits and make sure
that your commit comment clearly states that the updates are non-functional.


Reply to this email directly or view it on GitHub
#709 (comment).

- Checks that class which has only private constructors is declared as final.

Resolves: https://jira.duraspace.org/browse/FCREPO-1322
@awoods
Copy link

awoods commented Feb 11, 2015

@yinlinchen, I agree that reformatting the codebase is likely a waste of everyone's time... because the next person that comes along will want to do it all over again (you are not the first and will not be the last).
A more constructive path is to update the checkstyle rules to be more strict, if you believe there is a specific formatting pattern that should be further enforced.
see: https://github.com/fcrepo4/fcrepo-build-tools/tree/master/src/main/resources/fcrepo-checkstyle

@ajs6f
Copy link
Contributor

ajs6f commented Feb 11, 2015

Checkstyle import directives are listed here:
http://checkstyle.sourceforge.net/config_imports.html

@awoods awoods closed this Feb 16, 2015
@awoods
Copy link

awoods commented Feb 16, 2015

Resolved with: 96993ce

@yinlinchen yinlinchen deleted the fcrepo-1322 branch February 18, 2015 15:15
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