Skip to content

Commit

Permalink
516612: IllegalArgumentException below MissingNatureDetector.<init> (…
Browse files Browse the repository at this point in the history
…thrown in InternalJobGroup.<init>)

Move JobGroup initialization into early startup to avoid nested bundle
activation from class loading. 

Bug: 516612
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=516612
  • Loading branch information
creckord committed May 15, 2017
1 parent d9747de commit ffb3282
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class MissingNatureDetector implements IStartup, IPropertyChangeListener

public static final String ENABLEMENT_PROPERTY = "org.eclipse.epp.mpc.naturelookup"; //$NON-NLS-1$

private final JobGroup allJobs = new JobGroup(Messages.MissingNatureDetector_Title, 3, 0);
private JobGroup allJobs;

private final Set<String> detectedNatures = new HashSet<String>();

Expand Down Expand Up @@ -66,6 +66,10 @@ public void resourceChanged(IResourceChangeEvent event) {
}
};

public MissingNatureDetector() {
super();
}

private void triggerNatureLookup(final String natureId) {
synchronized (lookupJobs) {
if (detectedNatures.contains(natureId)) {
Expand Down Expand Up @@ -111,13 +115,13 @@ private void showProposalsIfReady() {
}

public void earlyStartup() {
allJobs = new JobGroup(Messages.MissingNatureDetector_Title, 3, 0);
IPreferenceStore preferenceStore = MarketplaceClientUiPlugin.getInstance().getPreferenceStore();
preferenceStore.addPropertyChangeListener(this);
boolean preferenceValue = preferenceStore.getBoolean(ENABLEMENT_PROPERTY);
if (preferenceValue) {
ResourcesPlugin.getWorkspace().addResourceChangeListener(projectOpenListener);
}

}

public void propertyChange(PropertyChangeEvent event) {
Expand Down

0 comments on commit ffb3282

Please sign in to comment.