[
https://issues.apache.org/jira/browse/OPENEJB-2042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13794109#comment-13794109
]
Andy Gumbrecht commented on OPENEJB-2042:
-----------------------------------------
I'll fix the other NPE today.
As for final. I am a fan of final as it is an explicit statement of expectation
that cannot be modified. Non-final means 'expect this item's state to change at
some point'. Without getting all preachy about it, I believe that variables
should have been final by default and that 'mutable' would have been a much
better reversal of logic.
The 'noise' is actually there to tell me that I don't want to change the value,
and more importantly that the value cannot be changed. It is 'extremely'
important for getting things right in multi-threaded environments. I could rant
all day on it's merits.
Some preaching, but please search some more... it's an interesting subject:
http://codemonkeyism.com/all-variables-in-java-must-be-final/
http://www.javapractices.com/topic/TopicAction.do?Id=23
http://www.codeguru.com/java/tij/tij0071.shtml
http://docs.oracle.com/javase/specs/jls/se7/html/jls-4.html#jls-4.12.4
http://jcp.org/jsr/detail/133.jsp
> Possible null pointer dereference in OpenEjb2Conversion
> -------------------------------------------------------
>
> Key: OPENEJB-2042
> URL: https://issues.apache.org/jira/browse/OPENEJB-2042
> Project: OpenEJB
> Issue Type: Bug
> Affects Versions: (trunk/tomee)
> Reporter: Patrick Pfeifer
> Assignee: Andy Gumbrecht
> Original Estimate: 2h
> Remaining Estimate: 2h
>
> I experienced an NPE on a different line in the same source file while trying
> to get EJB 2.1 One-to-One Relations with <foreign-key-column-on-source> to
> work for a customer project.
> I have not achieved this yet and haven't got a small test case either.
> What I can already say for sure however, after studying the code, is that
> there is a bug on line 440/441 of
> tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/OpenEjb2Conversion.java@1529473
> ---
> if (left == null) {
> RelationField right = left.getRelatedField();
> ---
--
This message was sent by Atlassian JIRA
(v6.1#6144)