Skip to content

Commit

Permalink
Show threads involved in disposing of components
Browse files Browse the repository at this point in the history
Currently we show where the component was disposed but not by what
thread. As this can be interesting for debugging the cause, this
information is now added.
  • Loading branch information
laeubi authored and HannesWell committed Jul 8, 2024
1 parent 7c27f5c commit 32ada38
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ public void dispose() {
synchronized (this) {
fManifest = null;
fBundleDescription = null;
disposeSource = new RuntimeException("Component was disposed here"); //$NON-NLS-1$
String message = String.format("Component was disposed here [%s]", Thread.currentThread().getName()); //$NON-NLS-1$
disposeSource = new RuntimeException(message);
}
}
}
Expand Down Expand Up @@ -1199,6 +1200,8 @@ public ResolverError[] getErrors() throws CoreException {
*/
protected void baselineDisposed(IApiBaseline baseline) throws CoreException {
throw new CoreException(new Status(IStatus.ERROR, ApiPlugin.PLUGIN_ID, ApiPlugin.REPORT_BASELINE_IS_DISPOSED,
NLS.bind(Messages.BundleApiComponent_baseline_disposed, getName(), baseline.getName()), disposeSource));
NLS.bind(Messages.BundleApiComponent_baseline_disposed,
new Object[] { getName(), baseline.getName(), Thread.currentThread().getName() }),
disposeSource));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ApiType_1=Unable to resolve superclass {0} for {1}
ApiType_2=Unsupported operation - API component required for resolution
ApiType_3=Unable to resolve member type {0} for {1}
ApiScope_0=Unable to visit this element type: {0}
BundleApiComponent_baseline_disposed=Component ''{0}'' in the baseline ''{1}'' is disposed
BundleApiComponent_baseline_disposed=Component ''{0}'' in the baseline ''{1}'' is disposed [{2}]
BundleComponent_failed_to_lookup_fragment=Failed to look up resolved fragment: {0}
configuring_baseline=Configuring baseline
resolving_target_definition=resolving target definition...
Expand Down

0 comments on commit 32ada38

Please sign in to comment.