Contributor
thuri
changed the title
normalization should not change KeyDataPair to NameValuePair Fixes #532
normalization should not change KeyDataPair to NameValuePair
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable for me, thanks for this.
Please add yourself as author to all changed files and maybe also to the pom (if you are not already in the list)
Member
sorry we are still at java8 :-)
/var/lib/jenkins/workspace/htmlunit_PR-533/src/test/java/com/gargoylesoftware/htmlunit/WebRequestTest.java:[437,42] cannot find symbol
symbol: method of(com.gargoylesoftware.htmlunit.util.NameValuePair,com.gargoylesoftware.htmlunit.util.KeyDataPair)
location: interface java.util.List
Contributor Author
Yeah I've seen that but somehow eclipse didn't warn me when i used Java 11 features.
I corrected the problematic part. At least I hope so
| public KeyDataPair normalized() { | ||
| final KeyDataPair pair = new KeyDataPair( | ||
| this.getName(), | ||
| this.fileObject_ != null ? this.fileObject_ : new File(this.getValue()), |
Member
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new File(...) might do some normalization on the file name leading in the end to some new value -> Testcase?
maybe it is better to have a private constructor that allows to pass the values 1:1?
What do you think?
this should prevent manipulation of fields and make sure that "normalized" instances are identical copies if the source object is normalized already
Contributor Author
@rbri please have a look at the additional commit. Perhaps that is what you had in mind ...
Member
i have nothing in mind ;-)
thanks a lot - will inform when the new snapshot is availble
and all the best for 2023