Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jonahgraham committed Feb 12, 2024
1 parent e6fb475 commit b6c8e30
Showing 1 changed file with 11 additions and 9 deletions.
Expand Up @@ -32,9 +32,17 @@
private static final String ATTRIB_TOOLCHAIN_ID = "toolchainID"; //$NON-NLS-1$
private static final String ID_COMPILATIONDATABASE = "compilationDatabase"; //$NON-NLS-1$
private static final String EXTENSION_ID = "compilationDatabaseContributor"; //$NON-NLS-1$
/**
* Map of tool chain IDs (see {@link IToolChain#getId()} to
* loaded instances of {@link ICompilationDatabaseContributor}
*/
@NonNull
private final Map<String, ICompilationDatabaseContributor> loadedInstances;
private final Map<String, IConfigurationElement> factoryExtensions;
private final Map<String, ICompilationDatabaseContributor> loadedInstances = new HashMap<>();
/**
* Map of tool chain IDs (see {@link IToolChain#getId()} to
* extension point information for the compilationDatabaseContributor extension.
*/
private final Map<String, IConfigurationElement> factoryExtensions = new HashMap<>();

private class EmptyCompilationDatabaseContributor implements ICompilationDatabaseContributor {

Expand All @@ -47,8 +55,6 @@ private class EmptyCompilationDatabaseContributor implements ICompilationDatabas
private static CompilationDatabaseContributionManager instance;

private CompilationDatabaseContributionManager() {
this.factoryExtensions = new HashMap<>();
this.loadedInstances = new HashMap<>();
initalise();
}

Expand All @@ -60,8 +66,6 @@ public static synchronized CompilationDatabaseContributionManager getInstance()
}

private void initalise() {
Map<String, IConfigurationElement> loadedExtension = new HashMap<>();

IExtensionPoint extension = Platform.getExtensionRegistry().getExtensionPoint(
"org.eclipse.cdt.managedbuilder.core", CompilationDatabaseContributionManager.EXTENSION_ID); //$NON-NLS-1$
if (extension != null) {
Expand All @@ -75,14 +79,12 @@ private void initalise() {
String className = configElement
.getAttribute(CompilationDatabaseContributionManager.ATTRIB_RUNNER);
if (toolchainId != null && className != null) {
loadedExtension.put(toolchainId, configElement);
factoryExtensions.put(toolchainId, configElement);
}
}
}
}
}

this.factoryExtensions.putAll(loadedExtension);
}

/**
Expand Down

0 comments on commit b6c8e30

Please sign in to comment.