-
Notifications
You must be signed in to change notification settings - Fork 221
Add Converters for Additional Types #47
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
Conversation
melloware
left a comment
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.
Very nice additions!
|
Definitely submit your PR of your other changes. I would like to see it and I did some of these converters and wasn't quite sure the best way to handle so i will be interested to see what you have done. |
|
Also rebase this one please. |
bf8beb1 to
f4b8eac
Compare
src/main/java/org/apache/commons/beanutils2/converters/ColorConverter.java
Outdated
Show resolved
Hide resolved
src/main/java/org/apache/commons/beanutils2/converters/ColorConverter.java
Outdated
Show resolved
Hide resolved
f4b8eac to
b74c7be
Compare
|
Thanks for the comments, I believe both should be resolved now. |
garydgregory
left a comment
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.
Hi @SethFalco
Thank you for your PR.
Please rebase on master and see my comments scattered throughout which apply to the whole PR.
G
src/main/java/org/apache/commons/beanutils2/converters/ColorConverter.java
Outdated
Show resolved
Hide resolved
src/main/java/org/apache/commons/beanutils2/converters/DimensionConverter.java
Outdated
Show resolved
Hide resolved
src/main/java/org/apache/commons/beanutils2/converters/DimensionConverter.java
Outdated
Show resolved
Hide resolved
src/main/java/org/apache/commons/beanutils2/converters/DimensionConverter.java
Outdated
Show resolved
Hide resolved
src/main/java/org/apache/commons/beanutils2/converters/DimensionConverter.java
Outdated
Show resolved
Hide resolved
src/main/java/org/apache/commons/beanutils2/converters/DimensionConverter.java
Outdated
Show resolved
Hide resolved
src/main/java/org/apache/commons/beanutils2/converters/InetAddressConverter.java
Outdated
Show resolved
Hide resolved
src/main/java/org/apache/commons/beanutils2/converters/LocaleConverter.java
Outdated
Show resolved
Hide resolved
src/main/java/org/apache/commons/beanutils2/converters/PatternConverter.java
Outdated
Show resolved
Hide resolved
src/main/java/org/apache/commons/beanutils2/converters/PointConverter.java
Outdated
Show resolved
Hide resolved
src/main/java/org/apache/commons/beanutils2/converters/ColorConverter.java
Outdated
Show resolved
Hide resolved
src/main/java/org/apache/commons/beanutils2/converters/PatternConverter.java
Outdated
Show resolved
Hide resolved
| // @formatter:off | ||
| register(Class.class, throwException ? new ClassConverter() : new ClassConverter(null)); | ||
| register(ColorConverter.class, throwException ? new ColorConverter() : new ColorConverter(null)); | ||
| register(Enum.class, throwException ? new EnumConverter() : new EnumConverter(null)); |
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.
Isn't the first argument supposed to be Color? If so, how are the tests passing?
b74c7be to
77162f5
Compare
|
Sorry for the delay in coming back to this.
High hopes everything is cool, but I'll be available if you have any further feedback. |
13263b3 to
9505402
Compare
|
@garydgregory If this PR it too large to review at once, would you prefer if I split it up into smaller ones? I could do one PR per converter for example? |
|
I'm sure it's fine for now (13 files).
Gary
…On Mon, Apr 25, 2022, 07:28 Seth Falco ***@***.***> wrote:
@garydgregory <https://github.com/garydgregory> If this PR it too large
to review at once, would you prefer if I split it up into smaller ones?
I could do one PR per converter for example?
—
Reply to this email directly, view it on GitHub
<#47 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJB6N6CVEQW2JMEWHTDT6LVGZ6VDANCNFSM4TIZJIZA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
e475de6 to
2d058ef
Compare
|
This is OK BUT I think we need to spit up this project into a multi-module Maven project because we are going to want to split out of module for code that depends on java.desktop at least. I know that's been a complaint in other Commons projects. I'll have a look in a couple of days. |
2d058ef to
a3159ab
Compare
|
Thanks for taking a look! And makes sense, in DeltaSpike there were also comments regarding the awt packages. Feel free to let me know how you want to proceed, and I don't mind dropping some of the converters from this PR. (The last push just amends some of the comments/Javadocs btw.) |
|
I don't think you need to do anything. I'll take a look later at how to best split things up. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #47 +/- ##
============================================
- Coverage 65.33% 65.11% -0.22%
- Complexity 1488 1515 +27
============================================
Files 105 111 +6
Lines 5504 5645 +141
Branches 1068 1086 +18
============================================
+ Hits 3596 3676 +80
- Misses 1449 1490 +41
- Partials 459 479 +20 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@SethFalco |
a3159ab to
4babb4d
Compare
|
My bad, I didn't realize |
This adds the following converters, with test cases:
You can see the test cases for example inputs/outputs.
I've just taken my PR from DeltaSpike (apache/deltaspike#109) and converted the converters that didn't exist here to work with this project instead. This is just me acting on a comment in the PR (apache/deltaspike#109 (comment)) in case it does happen, I figured I could have the PR here already.
This does not port all changes from my other PR, for example I implemented some existing converters differently, but I'll PR those separately, so they can just be closed if they're unfavorable.