Closed nobodyiam closed 5 months ago
In AutoUpdateConfigChangeListener.java
within the apollo-client
module, the resolvePropertyValue
method has been updated to enhance its functionality. The method now checks if springValue
is a field or a method parameter before retrieving the ApolloJsonValue
annotation. This change ensures more precise handling of JSON values and their associated date patterns, refining the way date and time strings are parsed based on custom patterns specified in @ApolloJsonValue
.
File Path | Change Summary |
---|---|
.../apollo/spring/property/AutoUpdateConfigChangeListener.java |
Updated resolvePropertyValue method to check if springValue is a field or a method parameter before retrieving ApolloJsonValue annotation. |
sequenceDiagram
participant Application
participant AutoUpdateConfigChangeListener
participant SpringValue
participant ApolloJsonValue
Application->>AutoUpdateConfigChangeListener: Initiates property value resolution
AutoUpdateConfigChangeListener->>SpringValue: Check if field or method parameter
SpringValue-->>AutoUpdateConfigChangeListener: Return type (field/parameter)
AutoUpdateConfigChangeListener->>ApolloJsonValue: Retrieve annotation (if available)
ApolloJsonValue-->>AutoUpdateConfigChangeListener: Return annotation details
AutoUpdateConfigChangeListener->>Application: Return resolved value considering date pattern
Objective | Addressed | Explanation |
---|---|---|
Implement parsing time based on pattern for @ApolloJsonValue (Issues #49, #53) |
✅ | |
Make use of Gson's way to turn a string into a date to handle time strings according to a given pattern (Issues #49, #53) | ✅ |
In code's quiet dance, a change we spell,
To parse the dates and parse them well.
WithApolloJsonValue
, new patterns we find,
Resolving fields and parameters, intricately defined.
🌟 Code evolves, as stars align,
✨ Making JSON dates truly shine.
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?
What's the purpose of this PR
53 introduced a feature that parses time based on a pattern for
@ApolloJsonValue
. However, it caused an issue with NullPointerException (NPE) when@ApolloJsonValue
is used as a method annotation. This pull request aims to resolve that issue.Which issue(s) this PR fixes:
Fixes #53
Brief changelog
@ApolloJsonValue
is applied to methods.Follow this checklist to help us incorporate your contribution quickly and easily:
mvn clean test
to make sure this pull request doesn't break anything.CHANGES
log.Summary by CodeRabbit
resolvePropertyValue
method to enhance the accuracy of JSON value handling by checking ifspringValue
is a field or a method parameter before retrieving theApolloJsonValue
annotation. This ensures correctdatePattern
retrieval for JSON values.