Skip to content

Release 0.1.5#187

Merged
mercyblitz merged 12 commits intomicrosphere-projects:devfrom
mercyblitz:dev
Aug 25, 2025
Merged

Release 0.1.5#187
mercyblitz merged 12 commits intomicrosphere-projects:devfrom
mercyblitz:dev

Conversation

@mercyblitz
Copy link
Copy Markdown
Contributor

No description provided.

Braces were added to single-line if statements in the JSONUtils class to improve code readability and maintainability.
Refactored MethodUtils by renaming addBannedMethod to banMethod for clarity and updated all relevant references. Also removed unnecessary throws declaration from initBannedMethods.
Changed the type of 'properties' from raw Map to Properties in copySystemProperties, and updated the putAll call to cast Properties to Map. This improves type safety and clarity.
Updated MethodUtilsTest to use the new banMethod name instead of addBannedMethod, reflecting the method rename in MethodUtils. Adjusted related test and helper method names accordingly.
@mercyblitz mercyblitz requested a review from Copilot August 25, 2025 07:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This is a release PR for version 0.1.5 that includes code improvements and refactoring changes across the codebase.

  • Renamed addBannedMethod to banMethod for better clarity
  • Fixed thread safety issues in system properties handling
  • Improved code formatting with proper braces for single-line if statements

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
MethodUtilsTest.java Updated test method names to reflect the renamed banMethod function
SystemUtils.java Fixed thread safety by moving synchronization block and improved type safety
MethodUtils.java Renamed addBannedMethod to banMethod and removed unnecessary exception declaration
JSONUtils.java Added missing braces for single-line if statements and removed unnecessary cast

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +546 to +551
Map<String, String> copy = systemPropertiesCopy;
if (copy == null) {
copy = newHashMap(properties.size());
systemPropertiesCopy = copy;
}
copy.putAll((Map) properties);
Copy link

Copilot AI Aug 25, 2025

Choose a reason for hiding this comment

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

The variable copy is accessed outside the synchronized block on line 551. This creates a race condition where another thread could modify systemPropertiesCopy between the assignment and the putAll operation. Move the copy.putAll((Map) properties); line inside the synchronized block or ensure proper synchronization.

Copilot uses AI. Check for mistakes.
@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 25, 2025

Codecov Report

❌ Patch coverage is 91.66667% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...e/src/main/java/io/microsphere/json/JSONUtils.java 75.00% 0 Missing and 1 partial ⚠️
Files with missing lines Coverage Δ Complexity Δ
...rc/main/java/io/microsphere/convert/Converter.java 100.00% <100.00%> (ø) 8.00 <2.00> (ø)
.../main/java/io/microsphere/reflect/MethodUtils.java 94.09% <100.00%> (ø) 90.00 <0.00> (ø)
...src/main/java/io/microsphere/util/SystemUtils.java 95.58% <100.00%> (+0.06%) 10.00 <2.00> (ø)
...e/src/main/java/io/microsphere/json/JSONUtils.java 98.18% <75.00%> (ø) 170.00 <0.00> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Expanded StopWatchTest to include tests for Task equality, inequality, and hashCode. Refactored to use a constant for the test name and improved test coverage for Task-related methods.
@sonarqubecloud
Copy link
Copy Markdown

@mercyblitz mercyblitz merged commit f223d36 into microsphere-projects:dev Aug 25, 2025
5 of 14 checks passed
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.

2 participants