Update IntervalShardingAlgorithm.java to fix an exception caused by polymorphism#20255
Closed
cowboysync wants to merge 8 commits into
Closed
Update IntervalShardingAlgorithm.java to fix an exception caused by polymorphism#20255cowboysync wants to merge 8 commits into
cowboysync wants to merge 8 commits into
Conversation
the method private String getDateTimeText(final Comparable<?> endpoint) will throws an java.lang.UnsupportedOperationException if the parameter endpoint's type is java.sql.Date, because of java.sql.Date values do not have a time component, so it's mehtod public Instant toInstant() always throws an java.lang.UnsupportedOperationException.
lwclover
previously approved these changes
Aug 18, 2022
Codecov Report
@@ Coverage Diff @@
## master #20255 +/- ##
============================================
+ Coverage 60.87% 60.90% +0.02%
Complexity 2422 2422
============================================
Files 3876 3876
Lines 54690 54692 +2
Branches 9310 9311 +1
============================================
+ Hits 33295 33311 +16
+ Misses 18542 18529 -13
+ Partials 2853 2852 -1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
linghengqian
left a comment
Member
There was a problem hiding this comment.
-
The CI bug was fixed by #20274, this PR should merge the master branch.
-
It is better to add a test case of
java.sql.Dateto the corresponding unit test class of this class. Previous tests missed this class.
use Java 8 Date Time API to construct java.sql.Date instance
fix the missed import statement
linghengqian
approved these changes
Aug 27, 2022
Member
|
This was referenced Nov 29, 2022
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
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.
the method private String getDateTimeText(final Comparable<?> endpoint) will throws an java.lang.UnsupportedOperationException if the parameter endpoint's type is java.sql.Date, because of java.sql.Date values do not have a time component, so it's mehtod public Instant toInstant() always throws an java.lang.UnsupportedOperationException.
Reproduction example: examples/shardingsphere-jdbc-example/single-feature-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/ShardingRawYamlIntervalConfigurationExample.java
Changes proposed in this pull request: