Currently, the scala-mojo-support code throws an exception if it encounters a mojo parameter with a primitive type.
This change adds support for unboxing, by simply stripping out the offending type check. I did this because:
Maven already knows what the correct type is for each parameter, because it is listed in the plugin descriptor.
Java reflection handles unboxing automatically.
Java reflection will throw an exception itself, in the unlikely event that Maven hands us a value with the wrong type.
This change also adds handling for Maven passing a null value to a parameter with a primitive type. I don't think it will ever do this, but in case it does, scala-mojo-support will now react by resetting the var to the default value for its primitive type (0 for integers, floats, and characters, and false for Boolean).
Currently, the scala-mojo-support code throws an exception if it encounters a mojo parameter with a primitive type.
This change adds support for unboxing, by simply stripping out the offending type check. I did this because:
This change also adds handling for Maven passing a
null
value to a parameter with a primitive type. I don't think it will ever do this, but in case it does, scala-mojo-support will now react by resetting thevar
to the default value for its primitive type (0 for integers, floats, and characters, andfalse
for Boolean).