Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2008-03-04 10:32:56 -0500
committerDarin Wright2008-03-04 10:32:56 -0500
commitdb655be9cf07a7c648d11595db527241e30e02ab (patch)
treea22bfc1e668586a785918d9103e71f5c9d31081f /org.eclipse.ui.console
parentd51467d670f2fe2ec161310698bf796bf573fbbd (diff)
downloadeclipse.platform.debug-db655be9cf07a7c648d11595db527241e30e02ab.tar.gz
eclipse.platform.debug-db655be9cf07a7c648d11595db527241e30e02ab.tar.xz
eclipse.platform.debug-db655be9cf07a7c648d11595db527241e30e02ab.zip
Bug 219794 - NPE in console MatchJob
Diffstat (limited to 'org.eclipse.ui.console')
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsolePatternMatcher.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsolePatternMatcher.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsolePatternMatcher.java
index 0a69d5fd9..5d8287467 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsolePatternMatcher.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsolePatternMatcher.java
@@ -78,11 +78,15 @@ public class ConsolePatternMatcher implements IDocumentListener {
// perhaps the buffer was re-set
return Status.OK_STATUS;
}
- for (int i = 0; i < fPatterns.size(); i++) {
+ Object[] patterns = null;
+ synchronized (fPatterns) {
+ patterns = fPatterns.toArray();
+ }
+ for (int i = 0; i < patterns.length; i++) {
if (monitor.isCanceled()) {
break;
}
- CompiledPatternMatchListener notifier = (CompiledPatternMatchListener) fPatterns.get(i);
+ CompiledPatternMatchListener notifier = (CompiledPatternMatchListener) patterns[i];
int baseOffset = notifier.end;
int lengthToSearch = endOfSearch - baseOffset;
if (lengthToSearch > 0) {

Back to the top