[
https://issues.apache.org/jira/browse/AXIS2-5435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495489#comment-13495489
]
Thomas Valine commented on AXIS2-5435:
--------------------------------------
I don't think I'm confusing anything. I'm well aware of the difference,
however, autoboxing (1.5) was NOT available when the JavaBeans spec was written
(1.1). It was written before autoboxing was introduced which is what the JAXB
issue states.
>This behavior is governed by the spec, and unfortunately it's just too late for
>the spec to change now.
>In terms of the user experience, thanks to auto-boxing, I don't think this will
>be a real issue for people.
It seems it's not the case here...And the real issue still exists for other
primitive types: You can get an NPE from autoboxing regardless.
Integer foo = null;
int bar = foo;
There is no built in protection for this AFAIK. And the only difference
between other primitives and the Boolean/boolean case is the method name. All
the pitfalls that arise from autoboxing apply to all these primitive types
regardless of the method name. Now, if you choose not to fix it, that's fine.
The spirit of the specification is to allow isBoolean form of getters for
'boolean' types. The spec doesn't explicitly exclude it, it is excluded by
omission perhaps because it was written before it was an issue (1.1). If you
choose to strictly adhere to that interpretation then fine. Close the bug and
we'll all move on. However, this case is inconsistent with all other wrapper
getters, whose results are autoboxed (or unautoboxed depending on what you
prefer to call it) into primitives, when it comes to the application of the
spec simply because it is a special naming case for the getter method.
Functionally, logically and w.r.t. fault modes there is no difference between:
int getIntFromWrapper()
boolean isBooleanFromWrapper()
Other than the name convention.
That being said, I'm done commenting on it. Do what you think is right w.r.t.
however you choose to interpret the spec.
> Axis2 BeanUtil doesn't appear to support is/has getter forms for fields.
> -------------------------------------------------------------------------
>
> Key: AXIS2-5435
> URL: https://issues.apache.org/jira/browse/AXIS2-5435
> Project: Axis2
> Issue Type: Bug
> Components: adb
> Affects Versions: 1.6.2
> Environment: Windows 7 64. Java 1.7
> Reporter: Thomas Valine
> Labels: adb, databinding
>
> Binding POJO's having boolean getter methods of the form isBool, hasBool
> doesn't appear to work.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]