Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add support for arrays (and collections?) in type conversion #21
Merged your change; thank you very much. I applied the minor changes that I commented on your patch, if you have any comment regarding my changes, let me know.
Before to finalize, we need to support array of primitives (missing at the moment); and provide an additional unit test to cover lines 131 and 147, see https://aeonbits.ci.cloudbees.com/job/owner-api/lastSuccessfulBuild/artifact/target/site/emma/_files/7.html
Line 147 on my laptop looks green btw; it's strange it's green on Jenkins. I'll check that too.
I investigated (using the debugger) why the lines 131 and 147 were reported as "uncovered" by emma.
the line 131 in method findAppropriateConverter is never reached because in the if(converter.convert(...)) it finally executes UNSUPPORTED.convert() which throws the exception; and this is correct. So the line 131, is never actually reached, but it is needed by the compiler, since it needs to return something. So it is fine that the coverage is not including this line.
about the line 147 instead, it is a peculiarity of emma tool, since the method always throws an exception, emma reports that the line is not covered (I feel this is a bug in emma) since the end of the method is not reached.
So, coverage is fine.
I added some "cosmetic" minor changes on the code to appeal my taste (style), and I moved the tests related to the arrays support in a new dedicated test class called ArraySupportTest.java
Thanks for adding the primitive arrays support. I really liked a lot the implementation you did for the Arrays that now also supports primitive types. Excellent job!