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

Align Java code with new Code Style #1952

Merged
merged 16 commits into from
Feb 22, 2018
Merged

Align Java code with new Code Style #1952

merged 16 commits into from
Feb 22, 2018

Conversation

tdonohue
Copy link
Member

@tdonohue tdonohue commented Feb 12, 2018

This PR aligns our Java code (on master only) with the new Code Style rules detailed in #1895.

(NOTE: It is built off a shared branch based on the #1895 branch, so it does include the commits also in #1895)

This PR only changes the following:

  • code alignment (e.g. alignment of brackets/braces)
  • line wrapping (all lines of code now <=120 chars)
  • whitespace (e.g. no trailing spaces, no tabs)
  • occasionally, comments may need minor modification as well to align with code style
  • occasionally, add private, empty default constructors for Utility classes (per this rule: http://checkstyle.sourceforge.net/config_design.html#HideUtilityClassConstructor)
  • occasionally, add in missing default clause to switch statements (per new code style)
  • occasionally, split up multiple variable declarations in a single line to multiple lines (per new code style)

No code changes/refactoring are made in this PR (only exceptions are minor fixes noted above)

Please note the majority of the code fixes in this PR are being automated via IntelliJ IDEA bulk "Reformat Code" tools. For details of the process, please see: https://wiki.duraspace.org/pages/viewpage.action?pageId=90967266#CodeStyleGuide(WIP)-Fixingthecodebase

STATUS: Each module will be cleaned/fixed in a separate commit. As modules are considered "fixed", they will be added to the below list:

  • dspace (no changes needed)
  • dspace-spring-rest (See c5cd807)
  • dspace-oai (See df63281)
  • dspace-rdf (See baa2238)
  • dspace-rest (See 425ed01)
  • dspace-services (See 02f6da9)
  • dspace-solr (See 654f9d2)
  • dspace-sword (See fdbfa24)
  • dspace-swordv2 (See 8110062)
  • dspace-api (See 7140242)
  • dspace-parent (i.e. Root directory files) - No changes needed
  • enable checkstyle validation on all builds

@tdonohue tdonohue added work in progress PR is still being worked on & is not currently ready for review code task Code cleanup task labels Feb 12, 2018
@tdonohue tdonohue added high priority interface: REST API v7+ REST API for v7 and later (dspace-server-webapp module) labels Feb 12, 2018
@tdonohue
Copy link
Member Author

tdonohue commented Feb 14, 2018

After completing all of the above, I just realized that I neglected to fix our test source code (/src/test/java), as maven-checkstyle-plugin excludes that directory by default. However, as this PR is already massive, I'd recommend merging this as-is, and fixing tests in a separate PR.

So, this PR should be considered "complete" (once Travis finishes approving one last time) and is ready for review/merger.

@tdonohue tdonohue removed the work in progress PR is still being worked on & is not currently ready for review label Feb 14, 2018
@tdonohue tdonohue changed the title [WIP] Align Java code with new Code Style Align Java code with new Code Style Feb 14, 2018
@pnbecker
Copy link
Member

👍

Copy link
Member

@kshepherd kshepherd left a comment

Choose a reason for hiding this comment

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

looks good to me (as much as one can look through so many lines!) and builds fine

@abollini
Copy link
Member

I'm fine with merging that as soon as the recent introduced conflicts are solved. Thanks to take care of that @tdonohue

@tdonohue
Copy link
Member Author

I've just finished rebasing this PR on the latest master code. Will wait for Travis CI approval/verification before proceeding.

@tdonohue
Copy link
Member Author

Approved in DSpace 7 meeting today. Merging.

@tdonohue tdonohue merged commit fa6dc2d into master Feb 22, 2018
@tdonohue tdonohue deleted the code-style-fixes branch February 22, 2018 15:27
@tdonohue tdonohue modified the milestones: 7.0, 7.0preview Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code task Code cleanup task high priority interface: REST API v7+ REST API for v7 and later (dspace-server-webapp module)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants