Skip to content

Commit becbd05

Browse files
fedejeanneiloveeclipse
authored andcommitted
Trace warning about ZIP files being constantly opened
Write it to the trace logs by default and to the system output only if TRACE_TO_STDOUT is set to true.
1 parent 6a5e1ed commit becbd05

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2942,9 +2942,8 @@ private void traceZipAccessWarning(IPath path) {
29422942
: lastInstant.until(now, java.time.temporal.ChronoUnit.MILLIS);
29432943
if (elapsedMs < 100 && elapsedWarningMs > 1000) {
29442944
this.lastWarning.set(now);
2945-
new Exception("Zipfile was opened multiple times wihtin " + elapsedMs + "ms in same thread " //$NON-NLS-1$ //$NON-NLS-2$
2946-
+ Thread.currentThread() + ", consider caching: " + path) //$NON-NLS-1$
2947-
.printStackTrace();
2945+
trace("Zipfile was opened multiple times wihtin " + elapsedMs + "ms in same thread " //$NON-NLS-1$ //$NON-NLS-2$
2946+
+ Thread.currentThread() + ", consider caching: " + path, new Exception()); //$NON-NLS-1$
29482947
}
29492948
}
29502949
}
@@ -4690,7 +4689,14 @@ public static void trace(String msg) {
46904689
}
46914690

46924691
public static void trace(String msg, Exception e) {
4693-
DEBUG_TRACE.trace(null, msg, e);
4692+
if (TRACE_TO_STDOUT) {
4693+
System.out.println(msg);
4694+
if (e != null) {
4695+
e.printStackTrace();
4696+
}
4697+
} else {
4698+
DEBUG_TRACE.trace(null, msg, e);
4699+
}
46944700
}
46954701

46964702
public static void traceDumpStack() {

0 commit comments

Comments
 (0)