-
Notifications
You must be signed in to change notification settings - Fork 44
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
fix: use appropriate methods to convert the numbers in XML #1171
fix: use appropriate methods to convert the numbers in XML #1171
Conversation
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.
See comment.
Additionally it would be great to have unit tests accompany the implementation to (1) verify it and (2) prevent future regressions.
...humboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/SimpleTypeUtil.java
Outdated
Show resolved
Hide resolved
dea6f93
to
4453995
Compare
...humboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/SimpleTypeUtil.java
Outdated
Show resolved
Hide resolved
...humboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/SimpleTypeUtil.java
Outdated
Show resolved
Hide resolved
2a161dd
to
4b3eb6c
Compare
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.
Generally looks good to me, but I have some doubts if the added converters are sufficient.
As mentioned previously it would be great to have unit tests to accompany your implementation to (1) verify it and (2) prevent future regressions.
Related to the conversions there could be other types of values/bindings for the XML simple types, than what you implemented now.
When we load an XML schema we here use functionality from Geotools to determine the binding. As an example, for the integer simple type a BigInteger binding is used. So I think at least the respective binding types from that class need to be supported for the conversion.
b3d6dae
to
f08c2bc
Compare
a312768
to
5e59ecd
Compare
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.
Points from my previous review comment are still open - any feedback on those?
See #1171 (review)
...l/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/BigDecimalToXmlDecimal.java
Show resolved
Hide resolved
If you refer to the points about testing, yes there are yet no test done. |
5e59ecd
to
c00a9e3
Compare
Yes, I meant that but also the other mentioned point on the conversions, which should at least cover the conversions between the bindings we use for the XML simple types and the XmlBeans classes. The example I mentioned was that for the integer XML simple type the binding BigInteger is used.
I would propose to look at |
c00a9e3
to
b33f486
Compare
Why for an integer cannot be used Integer instead of BigInteger?
So that means that StreamGmlWriter2Test doesn't help me. |
@emanuelaepure10 It would be great if you would use fixup commits while working on the PR because that makes reviews much easier.
I would guess that the reason they did that in Geotools might have been that they wanted to be able to represent numbers that are outside the range supported by integer.
Why? You can in a similar way
The main difference would be that you validate the written data in a different way.
An easy way to load and process XML is for instance the Groovy |
I'll do so. I knew that I should always squash them.
I think that all of this has been already covered. |
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.
Do you plan to still add tests?
Related to the commit message I think this is a fix
, not a feature.
...rc/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/BigIntegerToXmlBigInteger.java
Outdated
Show resolved
Hide resolved
b33f486
to
3a7b521
Compare
09826dd
to
504371e
Compare
@stempler Thank you. |
...e.io.gml.test/src/eu/esdihumboldt/hale/io/gml/reader/internal/GmlInstanceCollectionTest.java
Show resolved
Hide resolved
io/plugins/eu.esdihumboldt.hale.io.gml.test/src/data/shiporder/shiporder.xml
Show resolved
Hide resolved
...hale.io.gml.test/src/eu/esdihumboldt/hale/io/gml/writer/internal/StreamGmlWriter2Test.groovy
Show resolved
Hide resolved
...hale.io.gml.test/src/eu/esdihumboldt/hale/io/gml/writer/internal/StreamGmlWriter2Test.groovy
Outdated
Show resolved
Hide resolved
74126c2
to
b5bd614
Compare
...hale.io.gml.test/src/eu/esdihumboldt/hale/io/gml/writer/internal/StreamGmlWriter2Test.groovy
Show resolved
Hide resolved
...hale.io.gml.test/src/eu/esdihumboldt/hale/io/gml/writer/internal/StreamGmlWriter2Test.groovy
Outdated
Show resolved
Hide resolved
...hale.io.gml.test/src/eu/esdihumboldt/hale/io/gml/writer/internal/StreamGmlWriter2Test.groovy
Show resolved
Hide resolved
...hale.io.gml.test/src/eu/esdihumboldt/hale/io/gml/writer/internal/StreamGmlWriter2Test.groovy
Show resolved
Hide resolved
02e1dd2
to
0c119ef
Compare
Conversion of the numbers using appropriate methods of each different type. ING-3965
0c119ef
to
e29c074
Compare
🎉 This PR is included in version 5.2.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Conversion of the numbers using appropriate methods of each different type.
ING-3965