Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Thun2011-04-06 20:29:34 +0000
committerMatthias Sohn2011-04-06 20:29:34 +0000
commitdfb50da14addc638080c8b72d8fe91d82d5f287d (patch)
tree288e63da7f36f20939f0f1fe45e6237bea0583d0 /org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GenerateHistoryJob.java
parent4c89add514a32ffaebb668222f8bf0bc62f3e245 (diff)
downloadegit-dfb50da14addc638080c8b72d8fe91d82d5f287d.tar.gz
egit-dfb50da14addc638080c8b72d8fe91d82d5f287d.tar.xz
egit-dfb50da14addc638080c8b72d8fe91d82d5f287d.zip
Fix NPE in history view
This change fixes a possible NPE caused by memory inconsistencies. See bug 340831 for more details. Bug: 340831 Change-Id: I72a0e842876332fb602319bc03fcd3cd6a2cffe6 Signed-off-by: Philipp Thun <philipp.thun@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GenerateHistoryJob.java')
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GenerateHistoryJob.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GenerateHistoryJob.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GenerateHistoryJob.java
index b0eaac0416..a4af857d8b 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GenerateHistoryJob.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GenerateHistoryJob.java
@@ -64,7 +64,11 @@ class GenerateHistoryJob extends Job {
GitTraceLocation.getTrace().trace(
GitTraceLocation.HISTORYVIEW.getLocation(),
"Filling commit list"); //$NON-NLS-1$
- allCommits.fillTo(oldsz + BATCH_SIZE - 1);
+ // ensure that filling (here) and reading (CommitGraphTable)
+ // the commit list is thread safe
+ synchronized (allCommits) {
+ allCommits.fillTo(oldsz + BATCH_SIZE - 1);
+ }
if (monitor.isCanceled()) {
page.setErrorMessage(NLS.bind(
UIText.GenerateHistoryJob_CancelMessage, page

Back to the top