mirror of
https://github.com/zxing/zxing.git
synced 2024-11-09 20:44:03 -08:00
Add ReaderException.setStackTrace
This commit is contained in:
parent
ab23778d4b
commit
b30da44d01
|
@ -26,7 +26,7 @@ package com.google.zxing;
|
|||
public abstract class ReaderException extends Exception {
|
||||
|
||||
// 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;
|
||||
protected static final StackTraceElement[] NO_TRACE = new StackTraceElement[0];
|
||||
|
||||
|
@ -44,4 +44,15 @@ public abstract class ReaderException extends Exception {
|
|||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue