[
https://issues.apache.org/jira/browse/IGNITE-12511?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Andrey Mashenkov updated IGNITE-12511:
--------------------------------------
Description:
The interface *IgniteBinary* has method:
{code:java}
/**
* Converts provided object to instance of {@link
org.apache.ignite.binary.BinaryObject}.
*
* @param obj Object to convert.
* @return Converted object.
* @throws org.apache.ignite.binary.BinaryObjectException In case of error.
*/
public <T> T toBinary(@Nullable Object obj) throws BinaryObjectException;
{code}
As can be seen from the method signature, the value of the parameter value can
be *null*.
But, the documentation does not say what the behavior of the method will be in
this case.
{code:java}
/**
* Gets type ID for given type name.
*
* @param typeName Type name.
* @return Type ID.
*/
public int typeId(String typeName);
{code}
It is not clear from the documentation of this method what the behavior of the
method will be if:
# *typeName* is *null*?
# for *typeName* there is no* type id*?
The class Marshaller has methods:
{code:java}
public interface Marshaller {
....
/**
* Marshals object to the output stream. This method should not close
* given output stream.
*
* @param obj Object to marshal.
* @param out Output stream to marshal into.
* @throws IgniteCheckedException If marshalling failed.
*/
public void marshal(@Nullable Object obj, OutputStream out) throws
IgniteCheckedException;
/**
* Marshals object to byte array.
*
* @param obj Object to marshal.
* @return Byte array.
* @throws IgniteCheckedException If marshalling failed.
*/
public byte[] marshal(@Nullable Object obj) throws IgniteCheckedException;
}
{code}
The method signature has the annotation @Nullable.
But, from the documentation it is completely incomprehensible:
# what happens as a result of calling the method with the passed *null* value
at the input - will be thrown *IgniteCheckedException* exception or
*NullPointerException* or something else
# what's the point of allowing *null* value?
> Fix misleading javadoc.
> ------------------------
>
> Key: IGNITE-12511
> URL: https://issues.apache.org/jira/browse/IGNITE-12511
> Project: Ignite
> Issue Type: Task
> Reporter: Andrey Mashenkov
> Assignee: Andrey Mashenkov
> Priority: Major
> Fix For: 2.9
>
>
> The interface *IgniteBinary* has method:
> {code:java}
> /**
> * Converts provided object to instance of {@link
> org.apache.ignite.binary.BinaryObject}.
> *
> * @param obj Object to convert.
> * @return Converted object.
> * @throws org.apache.ignite.binary.BinaryObjectException In case of
> error.
> */
> public <T> T toBinary(@Nullable Object obj) throws BinaryObjectException;
> {code}
> As can be seen from the method signature, the value of the parameter value
> can be *null*.
> But, the documentation does not say what the behavior of the method will be
> in this case.
> {code:java}
> /**
> * Gets type ID for given type name.
> *
> * @param typeName Type name.
> * @return Type ID.
> */
> public int typeId(String typeName);
> {code}
> It is not clear from the documentation of this method what the behavior of
> the method will be if:
> # *typeName* is *null*?
> # for *typeName* there is no* type id*?
> The class Marshaller has methods:
> {code:java}
> public interface Marshaller {
> ....
> /**
> * Marshals object to the output stream. This method should not close
> * given output stream.
> *
> * @param obj Object to marshal.
> * @param out Output stream to marshal into.
> * @throws IgniteCheckedException If marshalling failed.
> */
> public void marshal(@Nullable Object obj, OutputStream out) throws
> IgniteCheckedException;
> /**
> * Marshals object to byte array.
> *
> * @param obj Object to marshal.
> * @return Byte array.
> * @throws IgniteCheckedException If marshalling failed.
> */
> public byte[] marshal(@Nullable Object obj) throws IgniteCheckedException;
> }
> {code}
> The method signature has the annotation @Nullable.
> But, from the documentation it is completely incomprehensible:
> # what happens as a result of calling the method with the passed *null* value
> at the input - will be thrown *IgniteCheckedException* exception or
> *NullPointerException* or something else
> # what's the point of allowing *null* value?
--
This message was sent by Atlassian Jira
(v8.3.4#803005)