Skip to content

Commit b6c8e30

Browse files
committed
1 parent e6fb475 commit b6c8e30

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/jsoncdb/generator/CompilationDatabaseContributionManager.java

+11-9
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,17 @@
3232
private static final String ATTRIB_TOOLCHAIN_ID = "toolchainID"; //$NON-NLS-1$
3333
private static final String ID_COMPILATIONDATABASE = "compilationDatabase"; //$NON-NLS-1$
3434
private static final String EXTENSION_ID = "compilationDatabaseContributor"; //$NON-NLS-1$
35+
/**
36+
* Map of tool chain IDs (see {@link IToolChain#getId()} to
37+
* loaded instances of {@link ICompilationDatabaseContributor}
38+
*/
3539
@NonNull
36-
private final Map<String, ICompilationDatabaseContributor> loadedInstances;
37-
private final Map<String, IConfigurationElement> factoryExtensions;
40+
private final Map<String, ICompilationDatabaseContributor> loadedInstances = new HashMap<>();
41+
/**
42+
* Map of tool chain IDs (see {@link IToolChain#getId()} to
43+
* extension point information for the compilationDatabaseContributor extension.
44+
*/
45+
private final Map<String, IConfigurationElement> factoryExtensions = new HashMap<>();
3846

3947
private class EmptyCompilationDatabaseContributor implements ICompilationDatabaseContributor {
4048

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

4957
private CompilationDatabaseContributionManager() {
50-
this.factoryExtensions = new HashMap<>();
51-
this.loadedInstances = new HashMap<>();
5258
initalise();
5359
}
5460

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

6268
private void initalise() {
63-
Map<String, IConfigurationElement> loadedExtension = new HashMap<>();
64-
6569
IExtensionPoint extension = Platform.getExtensionRegistry().getExtensionPoint(
6670
"org.eclipse.cdt.managedbuilder.core", CompilationDatabaseContributionManager.EXTENSION_ID); //$NON-NLS-1$
6771
if (extension != null) {
@@ -75,14 +79,12 @@ private void initalise() {
7579
String className = configElement
7680
.getAttribute(CompilationDatabaseContributionManager.ATTRIB_RUNNER);
7781
if (toolchainId != null && className != null) {
78-
loadedExtension.put(toolchainId, configElement);
82+
factoryExtensions.put(toolchainId, configElement);
7983
}
8084
}
8185
}
8286
}
8387
}
84-
85-
this.factoryExtensions.putAll(loadedExtension);
8688
}
8789

8890
/**

0 commit comments

Comments
 (0)