ReaderException.java (zxing-zxing-3.4.1) | : | ReaderException.java (zxing-zxing-3.5.0) | ||
---|---|---|---|---|
skipping to change at line 29 | skipping to change at line 29 | |||
/** | /** | |||
* The general exception class throw when something goes wrong during decoding o f a barcode. | * The general exception class throw when something goes wrong during decoding o f a barcode. | |||
* This includes, but is not limited to, failing checksums / error correction al gorithms, being | * This includes, but is not limited to, failing checksums / error correction al gorithms, being | |||
* unable to locate finder timing patterns, and so on. | * unable to locate finder timing patterns, and so on. | |||
* | * | |||
* @author Sean Owen | * @author Sean Owen | |||
*/ | */ | |||
public abstract class ReaderException extends Exception { | public abstract class ReaderException extends Exception { | |||
// disable stack traces when not running inside test units | // disable stack traces when not running inside test units | |||
protected static final boolean isStackTrace = | protected static boolean isStackTrace = | |||
System.getProperty("surefire.test.class.path") != null; | System.getProperty("surefire.test.class.path") != null; | |||
protected static final StackTraceElement[] NO_TRACE = new StackTraceElement[0] ; | protected static final StackTraceElement[] NO_TRACE = new StackTraceElement[0] ; | |||
ReaderException() { | ReaderException() { | |||
// do nothing | // do nothing | |||
} | } | |||
ReaderException(Throwable cause) { | ReaderException(Throwable cause) { | |||
super(cause); | super(cause); | |||
} | } | |||
// Prevent stack traces from being taken | // Prevent stack traces from being taken | |||
@Override | @Override | |||
public final synchronized Throwable fillInStackTrace() { | public final synchronized Throwable fillInStackTrace() { | |||
return null; | return null; | |||
} | } | |||
/** | ||||
* For testing only. Controls whether library exception classes include stack | ||||
traces or not. | ||||
* Defaults to false, unless running in the project's unit testing harness. | ||||
* | ||||
* @param enabled if true, enables stack traces in library exception classes | ||||
* @since 3.5.0 | ||||
*/ | ||||
public static void setStackTrace(boolean enabled) { | ||||
isStackTrace = enabled; | ||||
} | ||||
} | } | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 13 lines changed or added |