Fix array out of bound bug in UnitOfWork purpose discovery logic.
This commit is contained in:
parent
9d94e865b6
commit
6788cea1a0
1 changed files with 8 additions and 8 deletions
|
@ -131,14 +131,14 @@ public class UnitOfWork implements AutoCloseable {
|
||||||
StackTraceElement[] trace = Thread.currentThread().getStackTrace();
|
StackTraceElement[] trace = Thread.currentThread().getStackTrace();
|
||||||
String targetClassName = HelenusSession.class.getSimpleName();
|
String targetClassName = HelenusSession.class.getSimpleName();
|
||||||
String stackClassName = null;
|
String stackClassName = null;
|
||||||
do {
|
while (!stackClassName.equals(targetClassName) && frame < trace.length) {
|
||||||
frame++;
|
|
||||||
stackClassName = extractClassNameFromStackFrame(trace[frame].getClassName());
|
stackClassName = extractClassNameFromStackFrame(trace[frame].getClassName());
|
||||||
} while (!stackClassName.equals(targetClassName) && frame < trace.length);
|
|
||||||
do {
|
|
||||||
frame++;
|
frame++;
|
||||||
|
}
|
||||||
|
while (stackClassName.equals(targetClassName) && frame < trace.length) {
|
||||||
stackClassName = extractClassNameFromStackFrame(trace[frame].getClassName());
|
stackClassName = extractClassNameFromStackFrame(trace[frame].getClassName());
|
||||||
} while (stackClassName.equals(targetClassName) && frame < trace.length);
|
frame++;
|
||||||
|
}
|
||||||
if (frame < trace.length) {
|
if (frame < trace.length) {
|
||||||
purpose =
|
purpose =
|
||||||
new StringBuilder()
|
new StringBuilder()
|
||||||
|
|
Loading…
Reference in a new issue