-
Notifications
You must be signed in to change notification settings - Fork 55
Release 0.1.5 #185
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
Merged
Merged
Release 0.1.5 #185
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…/dev Release 0.1.3
…/release Release 0.1.3
…/dev Release 0.1.4
…/release Release 0.1.4
Introduced static methods iterate and forEach to IterableUtils for applying a Consumer to each element of an Iterable. These methods provide convenient and null-safe iteration, with forEach serving as an alias for iterate.
Added unit tests to cover the iterate and forEach utility methods in IterableUtils, including cases with null elements. This improves test coverage and ensures correct handling of null and non-null iterables.
Introduces a new overload of the addAll method in CollectionUtils to support adding elements from an Iterable to a Collection. Also renames the varargs parameter in the existing addAll method for clarity.
Split and reorganized addAll tests for better clarity and coverage. Added new test cases for addAll with different collection types, null collections, and iterables to improve test completeness.
Introduced ArrayStack, a non-thread-safe stack implementation based on ArrayList. Provides standard stack operations such as push, pop, peek, empty, and search.
Introduces ArrayStackTest to verify push, pop, peek, empty, and search operations, including edge cases such as popping or peeking from an empty stack.
Feature 0.1.5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Changed buildSignature to a public static method and added detailed Javadoc, including usage examples. Also replaced direct array length access with ArrayUtils.length for consistency.
Introduced a new test case to verify the buildSignature method with various String class methods and parameter types.
Introduces an internal copy of system properties to improve performance when accessing properties multiple times. Adds methods to copy, retrieve, and reset the cached system properties, and updates getSystemProperty to use the cached copy if available.
Introduced tests for copying and resetting system properties, including setup and teardown methods to ensure isolation. Added assertions for property retrieval from the copied properties and default value handling.
Updated ClassLoaderUtils to attempt resolving primitive classes by name if standard class loading fails. This improves compatibility when loading class names that refer to Java primitives.
Introduces a new test method to verify doLoadClass with class, primitive type, and primitive type name inputs. This enhances test coverage for the doLoadClass utility.
Introduces a mechanism to ban specific methods from being discovered by MethodUtils.findMethod, based on a configurable system property. Adds initBannedMethods and clearBannedMethods for managing the banned methods cache, and updates findMethod to return null for banned methods. This allows dynamic control over method availability for security or policy reasons.
Removed unused Map imports and refactored the banned methods initialization to use a new addBannedMethod utility method. Introduced the public addBannedMethod method to allow banning methods programmatically and updated initBannedMethods to use it for improved clarity and reusability.
Introduces unit tests for the addBannedMethod function to verify that banned methods are correctly excluded from lookup. Adds helper method assertAddBannedMethod for test clarity.
Removed empty 'targets' arrays from existing property definitions for clarity. Added a new configuration property 'microsphere.reflect.banned-methods' for specifying banned methods in MethodUtils.
Introduced a static escape method to JSONUtils for escaping special characters in strings according to JSON and JavaScript requirements. This includes handling control characters, quotes, backslashes, and Unicode line/paragraph separators, improving JSON string safety and compatibility.
Introduced comprehensive test cases for the JSONUtils.escape method, covering null, empty, normal strings, and various special characters such as newline, carriage return, tab, double quote, backslash, and Unicode line separators. These tests ensure correct escaping behavior for JSON string values.
Description attribute now falls back to the field's doc comment if the annotation value is blank. This improves the completeness of generated configuration property metadata.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces several enhancements and new features across the codebase, with a focus on improving JSON string escaping, extending collection utilities, and adding a new stack implementation. It also includes minor refactors and test updates to support these changes.
JSON Handling Improvements:
JSONUtils
, including a newescape(String)
method that properly escapes control characters, quotation marks, backslashes, and Unicode line/paragraph separators (\u2028
,\u2029
). This ensures JSON output is safe for JavaScript consumption and prevents syntax errors. Theappend(StringBuilder, String, String)
method now uses this escaping. [1] [2] [3]JSONUtils
for code cleanliness. [1] [2] [3]Collection Utilities:
addAll(Collection<T>, Iterable<T>)
method toCollectionUtils
, enabling bulk addition from anyIterable
with proper null and empty checks. Also renamed the varargs parameter fromvalues
tonewValues
for clarity. [1] [2]New Data Structure:
ArrayStack<E>
class, a non-thread-safe stack implementation based onArrayList
, providing standard stack operations (push
,pop
,peek
,empty
, andsearch
).Reflection Utilities and Configuration:
BANNED_METHODS_PROPERTY_NAME
) toMethodUtils
for supporting method banning via system properties, improving flexibility in reflective operations. [1] [2] [3] [4]Annotation Processor Enhancements:
ConfigurationPropertyJSONElementVisitor
by falling back to Javadoc comments when the annotation value is blank. [1] [2] [3]ConfigurationPropertyAnnotationProcessorTest
to includeMethodUtils
in the compiled classes, ensuring coverage of new utility features. [1] [2]