Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2003-10-01 17:48:05 +0000
committerJean Michel-Lemieux2003-10-01 17:48:05 +0000
commit7d3b33db0fc61d1e7ffd4e2f9760f7520515c1d9 (patch)
tree218c1adca479d54e304ef625dc748b69c25f4dd1
parentbb796295a6a718469fdf4b81ec0524f59fc366f4 (diff)
downloadeclipse.platform.team-7d3b33db0fc61d1e7ffd4e2f9760f7520515c1d9.tar.gz
eclipse.platform.team-7d3b33db0fc61d1e7ffd4e2f9760f7520515c1d9.tar.xz
eclipse.platform.team-7d3b33db0fc61d1e7ffd4e2f9760f7520515c1d9.zip
Bug 43974 NPE in history view
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java33
1 files changed, 24 insertions, 9 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java
index f0cb99863..0b265cb18 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java
@@ -109,7 +109,6 @@ public class HistoryView extends ViewPart {
private IFile file;
// cached for efficiency
private ILogEntry[] entries;
- private CVSTeamProvider provider;
private HistoryTableProvider historyTableProvider;
@@ -142,6 +141,8 @@ public class HistoryView extends ViewPart {
private FetchLogEntriesJob fetchLogEntriesJob;
private JobBusyCursor jobBusyCursor;
+ private boolean shutdown = false;
+
public static final String VIEW_ID = "org.eclipse.team.ccvs.ui.HistoryView"; //$NON-NLS-1$
private IPartListener partListener = new IPartListener() {
@@ -170,9 +171,9 @@ public class HistoryView extends ViewPart {
}
public IStatus run(IProgressMonitor monitor) {
try {
- if(remoteFile != null) {
+ if(remoteFile != null && !shutdown) {
entries = remoteFile.getLogEntries(monitor);
- final String revisionId = remoteFile.getRevision();
+ final String revisionId = remoteFile.getRevision();
getSite().getShell().getDisplay().asyncExec(new Runnable() {
public void run() {
if(tableViewer != null && ! tableViewer.getTable().isDisposed()) {
@@ -546,6 +547,7 @@ public class HistoryView extends ViewPart {
return result;
}
public void dispose() {
+ shutdown = true;
if (branchImage != null) {
branchImage.dispose();
branchImage = null;
@@ -554,6 +556,18 @@ public class HistoryView extends ViewPart {
versionImage.dispose();
versionImage = null;
}
+
+ if(fetchLogEntriesJob != null) {
+ if(fetchLogEntriesJob.getState() != Job.NONE) {
+ fetchLogEntriesJob.cancel();
+ try {
+ fetchLogEntriesJob.join();
+ } catch (InterruptedException e) {
+ CVSUIPlugin.log(new CVSException(Policy.bind("HistoryView.errorFetchingEntries", ""), e)); //$NON-NLS-1$
+ }
+ }
+ }
+
getSite().getPage().removePartListener(partListener);
jobBusyCursor.dispose();
}
@@ -631,25 +645,26 @@ public class HistoryView extends ViewPart {
this.file = file;
RepositoryProvider teamProvider = RepositoryProvider.getProvider(file.getProject(), CVSProviderPlugin.getTypeId());
if (teamProvider != null) {
- this.provider = (CVSTeamProvider)teamProvider;
try {
// for a file this will return the base
ICVSRemoteFile remoteFile = (ICVSRemoteFile)CVSWorkspaceRoot.getRemoteResourceFor(file);
if(remoteFile != null) {
historyTableProvider.setFile(remoteFile);
+ // input is set asynchronously so we can't assume that the view
+ // has been populated until the job that queries for the history
+ // has completed.
tableViewer.setInput(remoteFile);
setTitle(Policy.bind("HistoryView.titleWithArgument", remoteFile.getName())); //$NON-NLS-1$
- selectRevision(remoteFile.getRevision());
}
} catch (TeamException e) {
CVSUIPlugin.openError(getViewSite().getShell(), null, null, e);
}
}
- return;
+ } else {
+ this.file = null;
+ tableViewer.setInput(null);
+ setTitle(Policy.bind("HistoryView.title")); //$NON-NLS-1$
}
- this.file = null;
- tableViewer.setInput(null);
- setTitle(Policy.bind("HistoryView.title")); //$NON-NLS-1$
}
/**

Back to the top