[
https://issues.apache.org/jira/browse/OODT-149?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13000690#comment-13000690
]
Chris A. Mattmann edited comment on OODT-149 at 3/1/11 3:49 AM:
----------------------------------------------------------------
bq. null is the default initialization value for a String in Java
(http://download.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html)
And? It's also the #1 cause of *Null*PointerExceptions. As opposed to "".
bq. this makes it is clear at any point in the code that the JobId has not been
set yet
Sorry I don't buy that. It's no more clear than setting it to "" as the
Resource Manager to date has done.
bq. also the default value for JobId in Job class is null
So? There's a big difference between default values set in a class and ways to
serialize the attribute over the wire.
bq. if the Resource Manager code where to ever be wrapped and not use the
XML-RPC service, then code would throw null pointer exceptions since all the
code would be assuming JobId to be "" and never be null
Huh? No it wouldn't what code? I believe that we can check for null && if !null
then check for .equals(""). Also hypotheticals don't solve anything. Until
someone implements another protocol layer for the Resource Manager, then we're
fine the way it already is.
bq. the only code enforcing JobId equals "" when not set is in the XML-RPC
serialization utils.
Right, which is the critical SerDe right now b/c it's the only one that exists.
was (Author: chrismattmann):
bq. null is the default initialization value for a String in Java
(http://download.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html)
And? It's also the #1 cause of *Null*PointerExceptions. As opposed to "".
bq. this makes it is clear at any point in the code that the JobId has not been
set yet
Sorry I don't buy that. It's no more clear than setting it to "" as the
Resource Manager to date has done.
bq. also the default value for JobId in Job class is null
So? There's a big difference between default values set in a class and ways to
serialize the attribute over the wire.
bq. if the Resource Manager code where to ever be wrapped and not use the
XML-RPC service, then code would throw null pointer exceptions since all the
code would be assuming JobId to be "" and never be null
Huh? No it wouldn't what code? I believe that we can check for null && if !null
then check for .equals(""). Also hypotheticals don't solve anything. Until
someone implements another protocol layer for the Resource Manager, then we're
fine the way it already is.
bq. the only code enforcing JobId equals "" when not set is in the XML-RPC
serialization utils.
Right, which is the critical SerDe right now b/c it's the only one that exists.
Right,
> XmlRpcStructFactory when creating XmlRpc Job converts a Job's JobId to empty
> String but doesn't convert it back to null
> -----------------------------------------------------------------------------------------------------------------------
>
> Key: OODT-149
> URL: https://issues.apache.org/jira/browse/OODT-149
> Project: OODT
> Issue Type: Bug
> Components: resource manager
> Affects Versions: 0.2
> Environment: none
> Reporter: Brian Foster
> Assignee: Brian Foster
> Priority: Minor
> Fix For: 0.3
>
>
> either:
> 1) change it such that when XML-RPC Job is converted back to a Job, its JobId
> is set to null if it is empty string
> 2) if null, set JobId to String "null", then convert back to null if JobId is
> "null"
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira