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

Improve SafeDateFormat by joda DateTimeFormatter #59

Merged
merged 2 commits into from
Dec 14, 2020

Conversation

Linary
Copy link
Contributor

@Linary Linary commented Dec 9, 2020

Fix #58

@@ -45,7 +50,7 @@ public void testParse() {
Assert.assertThrows(IllegalArgumentException.class, () -> {
DateUtil.parse("2018-15-07 12:00:00");
}, e -> {
Assert.assertContains(", expect format: ", e.getMessage());
Assert.assertContains("Value 15 for monthOfYear must be in the range [1,12]", e.getMessage());
Copy link
Contributor

Choose a reason for hiding this comment

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

seems exceed 80 chars

return this.formatter.get().parse(source, pos);
public void setLenient(boolean lenient) {
// pass
}
Copy link
Contributor

Choose a reason for hiding this comment

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

remove it

*/
public class SafeDateFormat extends DateFormat {
@Deprecated
Copy link
Contributor

Choose a reason for hiding this comment

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

keep SafeDateFormat currently

@Linary Linary force-pushed the improve-safedateformat branch from eca8e82 to b0d30ef Compare December 10, 2020 05:14
@codecov
Copy link

codecov bot commented Dec 10, 2020

Codecov Report

Merging #59 (b0d30ef) into master (9f329f5) will increase coverage by 2.73%.
The diff coverage is 88.57%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #59      +/-   ##
============================================
+ Coverage     81.76%   84.49%   +2.73%     
- Complexity      686      737      +51     
============================================
  Files            57       57              
  Lines          2089     2115      +26     
  Branches        304      316      +12     
============================================
+ Hits           1708     1787      +79     
+ Misses          251      188      -63     
- Partials        130      140      +10     
Impacted Files Coverage Δ Complexity Δ
...c/main/java/com/baidu/hugegraph/util/DateUtil.java 76.00% <ø> (-12.47%) 9.00 <0.00> (ø)
...ava/com/baidu/hugegraph/version/CommonVersion.java 50.00% <ø> (ø) 1.00 <0.00> (ø)
...va/com/baidu/hugegraph/concurrent/LockManager.java 80.95% <71.42%> (+80.95%) 9.00 <4.00> (+9.00)
...a/com/baidu/hugegraph/rest/AbstractRestClient.java 85.41% <84.61%> (-2.72%) 41.00 <5.00> (+3.00) ⬇️
...ava/com/baidu/hugegraph/concurrent/AtomicLock.java 74.07% <100.00%> (+54.07%) 11.00 <2.00> (+9.00)
...n/java/com/baidu/hugegraph/concurrent/KeyLock.java 78.43% <100.00%> (+67.06%) 25.00 <18.00> (+22.00)
...n/java/com/baidu/hugegraph/concurrent/RowLock.java 92.85% <100.00%> (+16.77%) 16.00 <15.00> (+6.00)
.../java/com/baidu/hugegraph/date/SafeDateFormat.java 92.30% <100.00%> (+2.30%) 6.00 <6.00> (+1.00)
...n/java/com/baidu/hugegraph/util/OrderLimitMap.java 96.87% <100.00%> (+0.10%) 16.00 <0.00> (+1.00)
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9962e0c...b0d30ef. Read the comment docs.

@zhoney zhoney merged commit 37de7be into master Dec 14, 2020
@zhoney zhoney deleted the improve-safedateformat branch December 14, 2020 07:14
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.

The SafeDateFormat is not thread safe
3 participants