diff options
Diffstat (limited to 'java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java')
-rw-r--r-- | java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java b/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java index 62a8047..6628cf5 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java @@ -39,7 +39,8 @@ public class HDF5LibraryException extends HDF5Exception { * Constructs an <code>HDF5LibraryException</code> with no specified detail * message. */ - public HDF5LibraryException() { + public HDF5LibraryException() + { super(); // this code forces the loading of the HDF-5 library @@ -52,7 +53,7 @@ public class HDF5LibraryException extends HDF5Exception { this.majorErrorNumber = _getMajorErrorNumber(); this.minorErrorNumber = _getMinorErrorNumber(); - detailMessage = getMinorError(minorErrorNumber); + detailMessage = getMinorError(minorErrorNumber); } /** @@ -62,7 +63,8 @@ public class HDF5LibraryException extends HDF5Exception { * @param s * the detail message. */ - public HDF5LibraryException(String s) { + public HDF5LibraryException(String s) + { super(s); // this code forces the loading of the HDF-5 library // to assure that the native methods are available @@ -81,10 +83,7 @@ public class HDF5LibraryException extends HDF5Exception { * * @return the major error number */ - public long getMajorErrorNumber() - { - return majorErrorNumber; - } + public long getMajorErrorNumber() { return majorErrorNumber; } private native long _getMajorErrorNumber(); /** @@ -93,10 +92,7 @@ public class HDF5LibraryException extends HDF5Exception { * * @return the minor error number */ - public long getMinorErrorNumber() - { - return minorErrorNumber; - } + public long getMinorErrorNumber() { return minorErrorNumber; } private native long _getMinorErrorNumber(); /** @@ -109,7 +105,8 @@ public class HDF5LibraryException extends HDF5Exception { * * @return the string of the minor error */ - public String getMinorError(long err_code) { + public String getMinorError(long err_code) + { if (err_code == 0) { return "special zero no error"; } @@ -356,9 +353,10 @@ public class HDF5LibraryException extends HDF5Exception { * stack, and and the Java stack trace to the standard error stream. */ @Override - public void printStackTrace() { + public void printStackTrace() + { System.err.println(this); - printStackTrace0(null); // the HDF-5 Library error stack + printStackTrace0(null); // the HDF-5 Library error stack super.printStackTrace(); // the Java stack trace } @@ -369,21 +367,21 @@ public class HDF5LibraryException extends HDF5Exception { * @param f * the file print stream. */ - public void printStackTrace(java.io.File f) { + public void printStackTrace(java.io.File f) + { if ((f == null) || !f.exists() || f.isDirectory() || !f.canWrite()) { printStackTrace(); } else { try { java.io.FileOutputStream o = new java.io.FileOutputStream(f); - java.io.PrintWriter p = new java.io.PrintWriter(o); + java.io.PrintWriter p = new java.io.PrintWriter(o); p.println(this); p.close(); } catch (Exception ex) { System.err.println(this); - } - ; + }; // the HDF-5 Library error stack printStackTrace0(f.getPath()); super.printStackTrace(); // the Java stack trace @@ -395,5 +393,4 @@ public class HDF5LibraryException extends HDF5Exception { * and error stack. */ private native void printStackTrace0(String s); - } |