32
32
private static final String ATTRIB_TOOLCHAIN_ID = "toolchainID" ; //$NON-NLS-1$
33
33
private static final String ID_COMPILATIONDATABASE = "compilationDatabase" ; //$NON-NLS-1$
34
34
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
+ */
35
39
@ 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 <>();
38
46
39
47
private class EmptyCompilationDatabaseContributor implements ICompilationDatabaseContributor {
40
48
@@ -47,8 +55,6 @@ private class EmptyCompilationDatabaseContributor implements ICompilationDatabas
47
55
private static CompilationDatabaseContributionManager instance ;
48
56
49
57
private CompilationDatabaseContributionManager () {
50
- this .factoryExtensions = new HashMap <>();
51
- this .loadedInstances = new HashMap <>();
52
58
initalise ();
53
59
}
54
60
@@ -60,8 +66,6 @@ public static synchronized CompilationDatabaseContributionManager getInstance()
60
66
}
61
67
62
68
private void initalise () {
63
- Map <String , IConfigurationElement > loadedExtension = new HashMap <>();
64
-
65
69
IExtensionPoint extension = Platform .getExtensionRegistry ().getExtensionPoint (
66
70
"org.eclipse.cdt.managedbuilder.core" , CompilationDatabaseContributionManager .EXTENSION_ID ); //$NON-NLS-1$
67
71
if (extension != null ) {
@@ -75,14 +79,12 @@ private void initalise() {
75
79
String className = configElement
76
80
.getAttribute (CompilationDatabaseContributionManager .ATTRIB_RUNNER );
77
81
if (toolchainId != null && className != null ) {
78
- loadedExtension .put (toolchainId , configElement );
82
+ factoryExtensions .put (toolchainId , configElement );
79
83
}
80
84
}
81
85
}
82
86
}
83
87
}
84
-
85
- this .factoryExtensions .putAll (loadedExtension );
86
88
}
87
89
88
90
/**
0 commit comments