What about deprecating methods that return useless codes? I can't think it's a good idea to let them live on (certainly with respect to future development and where consistency is compromized). Unfortunately that would mean you would also have to change the method name slightly (can't override with the exact same method name even if the return type might be different).

Ultimately I'd prefer to see return codes that aren't doing anything removed.

On 4/13/2010 10:20 AM, Peter Cao wrote:
Hi all,

As you may know already, we added over 100 HDF5 1.8 APIs to HDF-Java JNI.

For the functions with a return error code,  e.g. "herr_t H5Oclose(
hid_t oid)", we
replace them with "void" in Java, e.g. "void H5Oclose( int oid)" because
the return
code is useless in java:
1) when there is an error, the Java call will throw an exception before
you  can reach
     the error code.
2) when the function call succeed (no exception),  you know the error
code has a
     non-negative value.

My question is what to do with the old functions with a return error
code, e.g.
//C function    -- herr_t H5Fclose( hid_t fid);
Java function -- int H5Fclose( hid_t fid);

Should we also change the Java function to "void H5Fclose( hid_t fid)"
to make it
consistent with the new Java functions? The down side is that it may
break users
code if they use the error code even if the error code is useless.

Thanks
--pc



_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org


_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

Reply via email to