Details
-
Task
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
The interface IgniteBinary has method:
/** * 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;
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.
/** * Gets type ID for given type name. * * @param typeName Type name. * @return Type ID. */ public int typeId(String typeName);
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:
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; }
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?
Attachments
Issue Links
- links to