Refactor - adding different scala object detecting#656
Refactor - adding different scala object detecting#656marcinbelicki wants to merge 10 commits intoFasterXML:2.17from
Conversation
src/main/scala/com/fasterxml/jackson/module/scala/util/ScalaObject.scala
Outdated
Show resolved
Hide resolved
|
|
||
| case object TestCaseObject | ||
|
|
||
| class TestClass |
There was a problem hiding this comment.
why not add to src/test/scala ? does this not work with scala 3?
There was a problem hiding this comment.
is it the classes with names ending in $ - maybe scala3 doesn't allow this?
It is weird to have classes ending in $ - is there any way not to use these in tests?
There was a problem hiding this comment.
I think these are not necessary in tests but they are used just to make sure ScalaObject.unapply do not detect classes with names that end with a $ as scala singleton objects
There was a problem hiding this comment.
These class names are probably legal in scala 2 but illegal in scala 3. Since I haven't seen anyone in their right mind to use such class names I'm deleting them.
|
build fails with |
|
I've corrected clazz.getSimpleName to clazz.getName - I wasn't aware that classes from inside of scala singleton objects cant produce propper simple name :/ |
|
@marcinbelicki I've started #657 - I may grab more of the changes in this PR but there I don't like all the new classes in this PR |
|
Ok, I see your point |
|
@marcinbelicki #657 is merged and will appear in v2.16.1 release - thanks for driving this |
I'm adding
ScalaObjectalong withScalaObjectTestto detect whether givenClass[_]is a scala singleton object. I'm not sure ifclazzcan be a null but I'm addingOption(clazz)inScalaObjectDeserializerResolverjust in case.