1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-02 22:55:26 +02:00

[229606] - [concurrency] NegativeArraySizeException when launching with enabled assertions

This commit is contained in:
Pawel Piech 2008-05-09 17:54:10 +00:00
parent 2f40ba594e
commit 36d8ba04ce

View file

@ -167,6 +167,8 @@ public class DefaultDsfExecutor extends ScheduledThreadPoolExecutor
*/
TracingWrapper(int offset) {
StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
// guard against the offset being greater than the stack trace
offset = Math.min(offset, stackTrace.length);
fSubmittedAt = new StackTraceWrapper(new StackTraceElement[stackTrace.length - offset]);
System.arraycopy(stackTrace, offset - 1, fSubmittedAt.fStackTraceElements, 0, fSubmittedAt.fStackTraceElements.length);
if (isInExecutorThread() && fCurrentlyExecuting != null) {