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

Move project to Java 21 #17

Merged
merged 1 commit into from
Oct 6, 2024
Merged

Move project to Java 21 #17

merged 1 commit into from
Oct 6, 2024

Conversation

jodastephen
Copy link
Member

@jodastephen jodastephen commented Oct 6, 2024

  • Update build scripts and docs

Summary by CodeRabbit

Release Notes

  • New Features

    • Updated compatibility to support Java SE 21 or later.
    • Major version increment to 2.0.0, indicating significant enhancements.
  • Bug Fixes

    • Streamlined build process by simplifying Java version handling in workflows.
  • Documentation

    • Revised README and documentation to reflect new versioning scheme and compatibility details.
    • Updated release notes to specify the new minimum JDK requirement.
  • Chores

    • Cleaned up remote repository branches post-update.
    • Adjusted project configuration for improved management and reporting capabilities.

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

Copy link

coderabbitai bot commented Oct 6, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

The pull request introduces several updates across various files in the Joda-Collect project. Key changes include modifications to the build workflow to streamline Java version handling, updates to compatibility information in the README and release notes, and enhancements to the project configuration in the pom.xml file to support Java SE 21. Additionally, the Checkstyle configuration has been restructured, and documentation has been updated to reflect the new versioning scheme. These changes collectively align the project with modern Java practices and clarify compatibility and release processes.

Changes

File Change Summary
.github/website.sh Added commands to delete remote branches website and website2x after push, executed conditionally.
.github/workflows/build.yml Removed Java version matrix; updated java-version to 21. Simplified conditional execution for the Website step. Added permissions: security-events: write for the build job.
README.md Updated compatibility information for Joda-Collect versions; specified Java SE 21 for 2.x and Java SE 8 for 1.x. Modified release process steps, removing README update mention.
RELEASE-NOTES.txt Updated minimum required JDK version from 8 to 21.
pom.xml Updated project configuration for Java SE 21; version changed from 1.0.2-SNAPSHOT to 2.0.0-SNAPSHOT. Expanded build settings and added new project metadata.
src/changes/changes.xml Updated release version from 1.0.2 to 2.0.0. Added actions for Java SE 21 compatibility and Tidelift support. Changed default branch name from master to main.
src/main/checkstyle/checkstyle.xml Added tabWidth property, reintroduced LineLength module, removed RedundantModifier, and added MissingJavadocMethodCheck with properties.
src/main/java/module-info.java Changed Guava dependency from transitive to non-transitive. Updated comments regarding dependency management.
src/site/markdown/index.md Updated versioning scheme and compatibility information, changing dependency version from 1.0.1 to 2.0.0.
src/site/site.xml Updated href for "Test results" menu item from surefire-report.html to surefire.html.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant GitHub Actions
    participant Repository

    User->>Repository: Push changes
    Repository->>GitHub Actions: Trigger build workflow
    GitHub Actions->>GitHub Actions: Set up JDK 21
    GitHub Actions->>GitHub Actions: Execute build steps
    GitHub Actions->>Repository: Push updates
    GitHub Actions->>Repository: Delete branches (if exists)
Loading

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (18)
RELEASE-NOTES.txt (1)

6-6: Clarify JDK requirement and add context

The update to JDK 21 is correctly reflected. However, consider the following improvements:

  1. Clarify if JDK 21 is a minimum requirement or just a compatibility statement. For example: "This release requires JDK 21 or later."
  2. Add context about the previous JDK version for users who are upgrading. For instance: "Note: Previous versions required JDK 8 or later."
  3. Address any backwards compatibility implications of this change.

These additions would provide more comprehensive information for users and maintainers.

.github/website.sh (1)

24-27: Approved with suggestion for additional documentation

The new commands to delete the 'website' and 'website2x' branches are a good addition for tidying up the repository. The use of '|| true' ensures the script continues even if the branches don't exist, which is a robust approach.

However, it would be beneficial to add a comment explaining the purpose of these branches and why they are being deleted. This would help future maintainers understand the rationale behind these operations.

Consider adding a comment like this before the new commands:

# Delete temporary branches used for website updates
.github/workflows/build.yml (2)

31-31: Approved: Java version updated to 21

This change aligns with the PR objective of moving the project to Java 21. However, consider the following suggestion:

To ensure backwards compatibility, you might want to consider keeping a matrix strategy for testing against multiple Java versions, including 21 and at least one LTS version (e.g., 17). This approach would help identify any potential compatibility issues early in the development process.

Example implementation:

strategy:
  matrix:
    java: [17, 21]

steps:
  - name: Set up JDK ${{ matrix.java }}
    uses: actions/setup-java@v4
    with:
      java-version: ${{ matrix.java }}
      distribution: 'temurin'
      cache: 'maven'

Line range hint 1-62: Summary: Workflow updated for Java 21 transition

The changes to this workflow file successfully update the build process for Java 21, aligning with the PR objectives. The main modifications include:

  1. Updating the Java version to 21
  2. Simplifying the Website step condition

These changes streamline the workflow for the new Java version. However, consider the following points:

  1. The removal of the matrix strategy means the project is no longer tested against multiple Java versions. Consider reintroducing a matrix strategy to ensure backwards compatibility, if required.
  2. The simplified Website step condition is appropriate for the single Java version setup but may need adjustment if multiple versions are reintroduced.

Overall, the changes are consistent with the project's move to Java 21, but careful consideration of backwards compatibility testing is recommended.

src/changes/changes.xml (2)

11-15: Excellent update to reflect the major version change.

The version update to 2.0.0 and the accompanying changelog entry accurately reflect the significant change of moving to Java SE 21. This aligns well with the PR objectives.

A minor suggestion to enhance clarity:

Consider adding a brief note about any potential behavioural changes or new features that users should be aware of when upgrading from v1.x to v2.x, even if there aren't any. This can help users make informed decisions about upgrading.

For example:

 <action dev="jodastephen" type="add">
   Major version based on Java SE 21.
   Intended to be fully compatible with v1.x.
+  No breaking changes or new features introduced.
 </action>

16-18: Good addition of commercial support and security information.

The inclusion of Tidelift commercial support and a security policy is a valuable update for the project. This enhances the project's credibility and support structure.

To provide more context for users:

Consider adding a brief explanation or a link to where users can find more information about the Tidelift support and the security policy. This will make it easier for users to access these new resources.

For example:

 <action dev="jodastephen" type="add">
   Add Tidelift commercial support and security policy.
+  See project README or website for more details.
 </action>
src/site/markdown/index.md (3)

36-37: LGTM: Useful information about previous version compatibility.

The inclusion of information about the 1.x branch compatibility is helpful for users who may still be using older Java versions. It provides a clear distinction between the old and new versions.

Consider adding a brief note about the long-term support plans for the 1.x branch, if any. This could help users make informed decisions about upgrading.


38-39: LGTM: Clear explanation of version compatibility.

The information about compatibility between v2.x and v1.x releases is crucial for users considering an upgrade. It clearly states the exceptions to compatibility, which is excellent.

Consider adding a brief explanation of what the module-info.class file is and why it's an exception to compatibility. This could be helpful for less experienced users.


48-48: LGTM: Maven dependency version updated correctly.

The version number in the Maven dependency example has been correctly updated to 2.0.0, which is consistent with the information provided earlier in the document.

Consider adding a comment just above the XML snippet to indicate that this is for the latest version (Java 21+). You might also want to include a similar snippet for the 1.x version for users who are not ready to upgrade to Java 21.

README.md (2)

30-35: Excellent update to compatibility information

The changes clearly specify the compatibility requirements for different versions of the library, which aligns well with the PR objective of moving the project to Java 21. The addition of the note about compatibility between v2.x and v1.x releases is particularly helpful for users considering migration.

To further improve clarity, consider adding a brief explanation of what the module-info.class file is and why it differs between versions.


68-70: Good additions to the release process

The new steps in the release process are valuable additions:

  1. Switching to Java 21 ensures the release is built with the correct Java version.
  2. Fetching the latest changes from Git is a good practice to ensure the local repository is up-to-date.

To further improve the process, consider adding a step to verify the Java version before proceeding with the release. This could prevent accidental releases with an incorrect Java version.

You could add a step like this:

* Verify Java version: `java -version`
src/main/checkstyle/checkstyle.xml (3)

32-32: Approved: Simplified JavadocMethod configuration

The change to only require Javadoc for public and protected methods aligns with common practices of prioritising public API documentation. However, please consider the potential impact on code maintainability due to reduced documentation for internal methods. You might want to encourage developers to document complex private methods through other means, such as inline comments.


49-51: Approved: Addition of MissingJavadocMethodCheck

The new MissingJavadocMethodCheck module complements the changes to JavadocMethod, allowing for more flexible Javadoc requirements. Permitting missing Javadoc for property methods can indeed reduce redundant documentation. However, consider encouraging developers to document non-trivial properties or those with side effects to maintain code clarity.


Line range hint 1-135: Suggestion: Update coding guidelines

The changes to the Checkstyle configuration represent a shift towards a more flexible yet structured code style. To ensure all developers are aligned with these new standards, I recommend updating the project's coding guidelines to reflect these changes. This update should cover the new Javadoc requirements, the revised line length limit, and any other significant changes in style enforcement. Additionally, consider providing rationale for major changes, such as the removal of the RedundantModifier check, to help developers understand and adhere to the new standards.

pom.xml (4)

8-13: LGTM! Project metadata updates look good.

The project metadata has been comprehensively updated to reflect the move to Java 21 and the major version change. The addition of license, organization, issue management, and developer information enhances the project's transparency and professionalism.

Consider adding a <ciManagement> section to provide information about the project's continuous integration setup, if applicable.

Also applies to: 18-50


Line range hint 54-223: Build configuration updates are comprehensive and well-structured.

The build configuration has been significantly enhanced:

  • Enforcing Maven 3.8.0 and Java 21+ ensures compatibility with the latest tools.
  • Addition of OSGi bundle configuration improves modularity.
  • Integration of Checkstyle and JaCoCo enhances code quality checks and coverage reporting.
  • Updated release plugin configuration streamlines the release process.

Consider adding the Spotbugs Maven Plugin to the build section for additional static code analysis, complementing Checkstyle.


Line range hint 387-421: Dependencies section looks good with version properties.

The use of version properties for dependencies is a positive change:

  • It centralises version management, making updates easier.
  • The Guava dependency update and refined exclusions show attention to dependency management.

Consider adding a dependency management section to further centralise and control transitive dependencies across the project.


648-708: Properties section is well-organised and comprehensive.

The properties section has been greatly expanded, which is excellent for maintainability:

  • Centralised version management for dependencies and plugins.
  • Clear specification of Java 21 as the compiler release version.
  • Detailed configuration for various plugins through properties.

Consider grouping related properties (e.g., all compiler-related properties) together with comments for better organisation.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 1a013d7 and dfcdd49.

📒 Files selected for processing (10)
  • .github/website.sh (1 hunks)
  • .github/workflows/build.yml (2 hunks)
  • README.md (2 hunks)
  • RELEASE-NOTES.txt (1 hunks)
  • pom.xml (5 hunks)
  • src/changes/changes.xml (1 hunks)
  • src/main/checkstyle/checkstyle.xml (4 hunks)
  • src/main/java/module-info.java (1 hunks)
  • src/site/markdown/index.md (1 hunks)
  • src/site/site.xml (1 hunks)
🧰 Additional context used
🔇 Additional comments (14)
src/main/java/module-info.java (1)

22-25: Approve change, but consider documenting impact

The modification to remove the transitive keyword from the Guava dependency is a prudent decision, given Guava's current status as an automatic module. This change aligns with best practices for module declarations.

However, this alteration may impact users of the org.joda.collect module who rely on Guava types exposed through the Joda-Collect API. To mitigate potential issues:

  1. Consider adding a note to the project's documentation (e.g., README or release notes) explaining this change and its implications for users.
  2. Advise users to explicitly declare a dependency on Guava if they use types from it via Joda-Collect.

To assess the impact of this change, please run the following script:

This script will help identify any public API elements that may be affected by the change in the Guava dependency.

✅ Verification successful

Change Verified: Guava Dependency is Internal

The removal of the transitive keyword from the Guava dependency has been verified. Guava types are not exposed in the public API of the org.joda.collect module, ensuring that this change will not impact users.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify usage of Guava types in public API

# Test: Search for Guava imports in public classes
echo "Guava imports in public API:"
rg --type java "import.*com\.google\.common" $(fd -e java -d src/main/java)

# Test: Search for Guava types used in public method signatures
echo "Guava types in public method signatures:"
ast-grep --lang java --pattern 'public $_ $_($$$) { $$$ }' | rg "com\.google\.common"

Length of output: 2935


Script:

#!/bin/bash
# Description: Verify usage of Guava types in public API

# Test: Search for Guava imports in public classes within src/main/java
echo "Guava imports in public API:"
rg --type java "import\s+com\.google\.common" $(fd -e java src/main/java)

# Test: Search for Guava types used in public method signatures within src/main/java
echo "Guava types in public method signatures:"
ast-grep --lang java --pattern 'public $_ $_($$$) { $$$ }' | rg "com\.google\.common"

Length of output: 3162


Script:

#!/bin/bash
# Description: Verify usage of Guava types in public API

# Test: Search for Guava imports in public classes within src/main/java
echo "Guava imports in public API:"
rg --type java "import\s+com\.google\.common" $(fd -e java . src/main/java)

# Test: Search for Guava types used in public method signatures within src/main/java
echo "Guava types in public method signatures:"
fd -e java . src/main/java | xargs ast-grep --lang java --pattern 'public $_ $_($$$) { $$$ }' | rg "com\.google\.common"

Length of output: 3360

.github/workflows/build.yml (1)

55-55: Approved: Website step condition simplified

The simplification of the Website step condition is appropriate given the removal of the matrix strategy for Java versions. This change ensures that the Website step will run on any push event that meets the tag conditions, regardless of the Java version.

This modification is consistent with the project's move to Java 21 and simplifies the workflow logic. It removes the unnecessary check for Java 11, which is no longer relevant in the context of this update.

src/changes/changes.xml (2)

Line range hint 19-21: Appropriate update to modern Git practices.

The switch from 'master' to 'main' as the default branch name is a positive change that aligns with current best practices in the Git community. This update promotes more inclusive language in the project.


Line range hint 11-21: Overall, excellent updates to the changelog.

The changes in this file accurately reflect the major version update to 2.0.0 and the move to Java SE 21. The additional information about Tidelift support and the update to Git practices enhance the project's professionalism and inclusivity.

A few minor suggestions have been made to improve clarity and provide more context for users. These changes effectively communicate the project's evolution and maintain transparency with the user base.

src/site/markdown/index.md (1)

34-35: LGTM: Clear and accurate version compatibility information.

The addition of this information about the 2.x branch compatibility with Java SE 21 or later is precise and aligns well with the PR objectives.

README.md (1)

66-66: Clarification needed on README.md update process

The step to update README.md has been removed from the release process. However, we are currently reviewing changes in the README.md file. Could you please clarify:

  1. Is the README.md now updated automatically as part of the release process?
  2. If not, how and when should updates to README.md be made?

This information will help maintain consistency in the project documentation.

src/site/site.xml (1)

83-83: Approve change, but verify new file name

The update to the "Test results" link appears to be in line with the PR objectives of updating documentation. However, we should ensure that the new file name is correct and consistent across the project.

Please run the following script to verify the existence of the new file and check for any remaining references to the old file name:

src/main/checkstyle/checkstyle.xml (3)

6-6: Excellent addition of tabWidth property

Setting the tabWidth property at the Checker level ensures consistent indentation across the entire project. This is a good practice for maintaining code readability.


Line range hint 1-135: Query: Removal of RedundantModifier module

I've noticed that the RedundantModifier module has been removed from the configuration. Could you please explain the rationale behind this decision? While it might reduce false positives in certain scenarios, it could also lead to inconsistent use of modifiers in the codebase. Have you considered keeping this check with a custom configuration to address specific issues?


Line range hint 1-135: Approved: Removal of redundant tabWidth property

The removal of the tabWidth property from the TreeWalker module, in conjunction with its addition at the Checker level, is a good refactoring. This change eliminates redundancy in the configuration and ensures consistent tab width application across all checks.

pom.xml (4)

225-383: Excellent plugin management setup.

The addition of a comprehensive plugin management section is a significant improvement:

  • Centralised version management for all plugins enhances maintainability.
  • Explicit configuration of the site plugin with Reflow Maven skin indicates attention to documentation quality.

This setup will make it easier to keep plugins updated and ensure consistent builds across different environments.


423-529: Comprehensive reporting configuration is a great addition.

The new reporting section significantly enhances the project's documentation and quality assurance:

  • Inclusion of various report plugins (Checkstyle, PMD, Spotbugs, JaCoCo) provides a holistic view of code quality.
  • Javadoc and changes reports improve documentation.
  • Surefire reports ensure test results are easily accessible.

This setup will greatly aid in maintaining high code quality standards and provide valuable insights for both developers and users of the library.


531-547: Distribution management setup looks correct.

The addition of the distribution management section is crucial for proper artifact deployment:

  • Correct configuration for Sonatype OSS staging and snapshot repositories.
  • Inclusion of a download URL for released artifacts.

This setup ensures that both releases and snapshots can be properly managed and distributed through Maven Central.


Line range hint 1-710: Overall, excellent updates to modernise the project and improve build management.

The changes to the POM file are comprehensive and well-executed:

  1. Updated project metadata reflects the move to Java 21 and the major version change.
  2. Enhanced build configuration with new plugins improves code quality checks and reporting.
  3. Centralised plugin and dependency management through properties and plugin management sections.
  4. Added comprehensive reporting configuration for better project insights.
  5. Proper distribution management setup for Maven Central deployment.

These changes significantly improve the project's maintainability, build process, and alignment with modern Java practices. The transition to Java 21 is well-handled, and the additional tools and configurations will help maintain high code quality standards.

src/main/checkstyle/checkstyle.xml Outdated Show resolved Hide resolved
* Update build scripts and docs
* Adjust module to remove `requires transitive` of automatic module
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (13)
.github/workflows/build.yml (2)

31-31: Approved: Java version update to 21

This change aligns with the PR objective of moving the project to Java 21. It simplifies the workflow by removing the matrix strategy for Java versions.

Consider updating the project's documentation (e.g., README.md) to clearly state that the project now requires Java 21.


Line range hint 1-62: Summary: Workflow successfully updated for Java 21

The changes to the workflow file are consistent with the PR objective of moving to Java 21. The workflow has been simplified by removing the Java version matrix and updating the Website step condition. These changes align the project with modern Java practices and streamline the build process.

Consider reviewing the entire project to ensure all components and dependencies are compatible with Java 21, and update any version-specific code or documentation accordingly.

src/changes/changes.xml (3)

11-11: Version update looks good, consider updating the release date.

The version update to 2.0.0 correctly reflects the major changes introduced in this release, particularly the move to Java SE 21. This aligns well with semantic versioning principles.

Remember to update the "SNAPSHOT" date to the actual release date when finalising this version.


12-17: Clear explanation of changes, consider adding a code example.

The action provides a comprehensive explanation of the major changes in version 2.0.0, particularly regarding Java SE 21 compatibility and the module definition change. The note about Guava no longer being transitively included is crucial information for users.

To enhance clarity, consider adding a brief code example showing how users might need to modify their module declaration to include Guava directly. This could help prevent potential issues during upgrade.


Line range hint 18-23: Good additions, consider providing more details or links.

The inclusion of Tidelift commercial support, a security policy, and the switch from 'master' to 'main' are all positive updates for the project.

To make these updates more actionable for users:

  1. Consider adding a link to the Tidelift commercial support page or the security policy document.
  2. If there are any specific actions users need to take regarding the 'master' to 'main' switch (e.g., updating local references), it might be helpful to mention them briefly.
README.md (3)

30-33: LGTM! Consider adding a transition note.

The compatibility information is clear and concise. Well done on updating this crucial information.

Consider adding a brief note about the transition from Java 8 to Java 21 for users who might be upgrading from 1.x to 2.x. This could help users understand the implications of the upgrade.


34-36: LGTM! Consider clarifying the Guava module note.

The compatibility information between v2.x and v1.x releases is well-explained.

The note about Guava being a required module but not declared as 'transitive' might be unclear to some users. Consider adding a brief explanation of what this means in practice, or link to documentation that explains Java modules and transitive dependencies.


67-71: LGTM! Consider adding a version check step.

The updated release process is more streamlined and includes crucial steps like switching to Java 21 and fetching the latest Git changes.

Consider adding a step to verify the Java version before starting the release process. This could prevent accidental releases with the wrong Java version. For example:

java -version

This would ensure that Java 21 is indeed being used for the release.

src/main/checkstyle/checkstyle.xml (1)

49-51: Enhanced Javadoc checks with flexibility

The addition of the MissingJavadocMethodCheck module is a good enhancement to ensure comprehensive method documentation. Allowing missing property Javadoc is a sensible compromise.

Consider adding a comment explaining the rationale behind allowing missing property Javadoc. This would help future maintainers understand the decision.

pom.xml (4)

Line range hint 1-51: LGTM! Project metadata updates are comprehensive.

The project metadata has been thoroughly updated to reflect the transition to Java 21 and the new major version. The addition of license, organization, issue management, and developer information enhances the project's documentation and compliance.

Consider adding a <url> tag for the issue management section to provide a direct link to the GitHub issues page.


Line range hint 52-223: Build configuration looks solid. Consider adding SpotBugs.

The build section has been comprehensively updated with appropriate plugins and configurations for Java 21. The enforcement of Maven and Java versions, along with the addition of code coverage, are excellent improvements.

Consider adding the SpotBugs Maven Plugin to the build section for additional static code analysis. This can help identify potential bugs early in the development process.


Line range hint 548-647: Release profile looks good. Consider adding a development profile.

The updates to the release-artifacts profile are appropriate and align with best practices for open-source projects. The inclusion of artifact signing and GitHub release creation is excellent.

Consider adding a development profile that could include additional plugins or configurations useful during development, such as enabling more verbose logging or additional test coverage reports.


648-708: Properties section is comprehensive. Consider grouping properties.

The expanded properties section is excellent for centralising configuration. The Java version is correctly set to 21, and all necessary plugin and dependency versions are defined.

Consider grouping related properties together with comments for better organisation. For example, you could group all plugin versions under a "Plugin Versions" comment.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between dfcdd49 and ae1f518.

📒 Files selected for processing (11)
  • .github/website.sh (1 hunks)
  • .github/workflows/build.yml (2 hunks)
  • README.md (2 hunks)
  • RELEASE-NOTES.txt (1 hunks)
  • pom.xml (5 hunks)
  • src/changes/changes.xml (1 hunks)
  • src/main/checkstyle/checkstyle.xml (4 hunks)
  • src/main/java/module-info.java (1 hunks)
  • src/main/java/org/joda/collect/grid/ImmutableCell.java (1 hunks)
  • src/site/markdown/index.md (1 hunks)
  • src/site/site.xml (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/main/java/org/joda/collect/grid/ImmutableCell.java
🚧 Files skipped from review as they are similar to previous changes (5)
  • .github/website.sh
  • RELEASE-NOTES.txt
  • src/main/java/module-info.java
  • src/site/markdown/index.md
  • src/site/site.xml
🧰 Additional context used
🔇 Additional comments (8)
.github/workflows/build.yml (1)

55-55: Approved: Simplified condition for Website step

The condition for the Website step has been simplified by removing the Java version check. This change is consistent with the workflow's move to a single Java version (21).

Please verify that no website-related tasks require specific Java version checks. If you confirm this, we can proceed with the following script to check for any remaining Java version references in the workflow:

✅ Verification successful

Verified: No remaining Java version checks found

The workflow is consistently using Java version 21, and no additional Java version checks are present. The removal of the Java version condition is appropriate.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining Java version references in the workflow file

# Test: Search for Java version references
rg --type yaml 'java.*version|version.*java' .github/workflows/build.yml

Length of output: 99

src/main/checkstyle/checkstyle.xml (3)

6-6: Appropriate global tab width setting

The addition of the tabWidth property to the Checker module is a good practice. It ensures consistent tab width across all checks and improves overall code readability.


32-32: Simplified Javadoc requirements

The addition of the accessModifiers property focusing on public and protected methods is a good simplification. It aligns with common practices for API documentation.

However, could you please clarify which specific Javadoc-related properties were removed? This information would help ensure that no critical checks have been inadvertently omitted.


132-135: Improved line length limit

The re-addition of the LineLength module with a maximum of 120 characters is a significant improvement. It strikes a good balance between code readability and practical considerations. The ignore pattern for Javadoc lines is a thoughtful addition.

This change effectively addresses the concern raised in the previous review comment about the overly permissive 200-character limit.

pom.xml (4)

423-529: Excellent addition of comprehensive reporting.

The new reporting section is a significant improvement to the project. It includes a wide range of essential tools for maintaining code quality, test coverage, and project documentation. The inclusion of Checkstyle, PMD, SpotBugs, and JaCoCo will greatly assist in maintaining high code quality standards.


531-547: Distribution management configuration looks correct.

The addition of the distribution management section is appropriate and necessary for publishing to Maven Central. The configuration for both staging and snapshot repositories appears to be correct.


Line range hint 1-708: Excellent update to support Java 21 and improve project configuration.

This comprehensive update to the pom.xml file significantly improves the project's configuration:

  1. Upgraded to Java 21
  2. Enhanced project metadata
  3. Improved build configuration with additional plugins
  4. Added comprehensive reporting tools
  5. Configured distribution management for Maven Central
  6. Updated release profile for better artifact handling
  7. Centralised configuration in properties

These changes align the project with modern Java development practices and should greatly improve its maintainability, quality assurance, and release process.


Line range hint 386-421: Dependency management improved. Verify actual versions.

The use of property references for dependency versions is a good practice. It centralises version management and makes it easier to update dependencies across the project.

Please verify that the actual versions defined in the properties section are appropriate:

  • Guava: ${guava.version}
  • JUnit: ${junit.version}
✅ Verification successful

Dependency versions verified.

The actual versions defined in the properties section are:

  • Guava: 33.3.1-jre
  • JUnit: 4.13.2

These versions are appropriately managed and suitable for the project's requirements.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the versions of Guava and JUnit dependencies.

# Test: Check the actual versions defined in the properties section.
echo "Guava version:"
grep -n "guava.version" pom.xml
echo "JUnit version:"
grep -n "junit.version" pom.xml

Length of output: 329

@jodastephen jodastephen merged commit 835075f into main Oct 6, 2024
5 checks passed
@jodastephen jodastephen deleted the java21 branch October 6, 2024 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant