mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 14:12:10 +02:00
Cosmetics.
Change-Id: I4022285d11267b77861cc8e4333adbea9c780ea7
This commit is contained in:
parent
de3b172c7d
commit
52432d7370
3 changed files with 21 additions and 23 deletions
|
@ -195,7 +195,7 @@ public class GCCBuildCommandParserTest extends BaseTestCase {
|
|||
ICConfigurationDescription cfgDescription = cfgDescriptions[0];
|
||||
Map<String, String> refs = cfgDescription.getReferenceInfo();
|
||||
assertEquals(1, refs.size());
|
||||
Set<String> referencedProjectsNames = new LinkedHashSet<String>(refs.keySet());
|
||||
Set<String> referencedProjectsNames = new LinkedHashSet<>(refs.keySet());
|
||||
assertEquals(projectReferenced.getName(), referencedProjectsNames.toArray()[0]);
|
||||
}
|
||||
}
|
||||
|
@ -220,11 +220,11 @@ public class GCCBuildCommandParserTest extends BaseTestCase {
|
|||
{
|
||||
// provider configured with non-null parameters
|
||||
MockBuildCommandParser provider = new MockBuildCommandParser();
|
||||
List<String> languages = new ArrayList<String>();
|
||||
List<String> languages = new ArrayList<>();
|
||||
languages.add(LANGUAGE_ID);
|
||||
Map<String, String> properties = new HashMap<String, String>();
|
||||
Map<String, String> properties = new HashMap<>();
|
||||
properties.put(ATTR_PARAMETER, CUSTOM_PARAMETER);
|
||||
List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
|
||||
List<ICLanguageSettingEntry> entries = new ArrayList<>();
|
||||
ICLanguageSettingEntry entry = new CMacroEntry("MACRO", "VALUE",
|
||||
ICSettingEntry.BUILTIN | ICSettingEntry.READONLY);
|
||||
entries.add(entry);
|
||||
|
@ -382,7 +382,7 @@ public class GCCBuildCommandParserTest extends BaseTestCase {
|
|||
public boolean processLine(String line) {
|
||||
// pretending that we parsed the line
|
||||
currentResource = file;
|
||||
List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
|
||||
List<ICLanguageSettingEntry> entries = new ArrayList<>();
|
||||
ICLanguageSettingEntry entry = new CMacroEntry("MACRO", "VALUE", ICSettingEntry.BUILTIN);
|
||||
entries.add(entry);
|
||||
setSettingEntries(entries);
|
||||
|
@ -2366,10 +2366,10 @@ public class GCCBuildCommandParserTest extends BaseTestCase {
|
|||
*/
|
||||
public void testEntriesProjectLevelGlobalProvider() throws Exception {
|
||||
// create GCCBuildCommandParser
|
||||
ILanguageSettingsProvider wspProvider = LanguageSettingsManager
|
||||
.getWorkspaceProvider(GCC_BUILD_COMMAND_PARSER_EXT);
|
||||
GCCBuildCommandParser parser = (GCCBuildCommandParser) LanguageSettingsManager
|
||||
.getRawProvider(wspProvider);
|
||||
ILanguageSettingsProvider wspProvider =
|
||||
LanguageSettingsManager.getWorkspaceProvider(GCC_BUILD_COMMAND_PARSER_EXT);
|
||||
GCCBuildCommandParser parser =
|
||||
(GCCBuildCommandParser) LanguageSettingsManager.getRawProvider(wspProvider);
|
||||
parser.setResourceScope(AbstractBuildCommandParser.ResourceScope.PROJECT);
|
||||
parser.clear();
|
||||
|
||||
|
@ -2379,7 +2379,7 @@ public class GCCBuildCommandParserTest extends BaseTestCase {
|
|||
parser.shutdown();
|
||||
|
||||
// check populated entries
|
||||
List<ICLanguageSettingEntry> expected = new ArrayList<ICLanguageSettingEntry>();
|
||||
List<ICLanguageSettingEntry> expected = new ArrayList<>();
|
||||
expected.add(new CIncludePathEntry("/path0", 0));
|
||||
assertEquals(expected, parser.getSettingEntries((IBuildConfiguration) null, null, LANG_CPP));
|
||||
}
|
||||
|
@ -2440,8 +2440,8 @@ public class GCCBuildCommandParserTest extends BaseTestCase {
|
|||
String languageId = ls.getLanguageId();
|
||||
|
||||
// create GCCBuildCommandParser
|
||||
GCCBuildCommandParser parser = (GCCBuildCommandParser) LanguageSettingsManager
|
||||
.getExtensionProviderCopy(GCC_BUILD_COMMAND_PARSER_EXT, true);
|
||||
GCCBuildCommandParser parser = (GCCBuildCommandParser) LanguageSettingsManager.getExtensionProviderCopy(
|
||||
GCC_BUILD_COMMAND_PARSER_EXT, true);
|
||||
parser.setResourceScope(AbstractBuildCommandParser.ResourceScope.PROJECT);
|
||||
|
||||
// parse line
|
||||
|
@ -2461,10 +2461,10 @@ public class GCCBuildCommandParserTest extends BaseTestCase {
|
|||
*/
|
||||
public void testFileAbsolutePath_ProjectLevelGlobalProvider() throws Exception {
|
||||
// create GCCBuildCommandParser
|
||||
ILanguageSettingsProvider wspProvider = LanguageSettingsManager
|
||||
.getWorkspaceProvider(GCC_BUILD_COMMAND_PARSER_EXT);
|
||||
GCCBuildCommandParser parser = (GCCBuildCommandParser) LanguageSettingsManager
|
||||
.getRawProvider(wspProvider);
|
||||
ILanguageSettingsProvider wspProvider =
|
||||
LanguageSettingsManager.getWorkspaceProvider(GCC_BUILD_COMMAND_PARSER_EXT);
|
||||
GCCBuildCommandParser parser =
|
||||
(GCCBuildCommandParser) LanguageSettingsManager.getRawProvider(wspProvider);
|
||||
parser.setResourceScope(AbstractBuildCommandParser.ResourceScope.PROJECT);
|
||||
parser.clear();
|
||||
|
||||
|
@ -2479,5 +2479,4 @@ public class GCCBuildCommandParserTest extends BaseTestCase {
|
|||
List<ICLanguageSettingEntry> entries = parser.getSettingEntries((IBuildConfiguration) null, null, LANG_CPP);
|
||||
assertEquals(new CIncludePathEntry("/path0", 0), entries.get(0));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -581,7 +581,7 @@ public class GCCBuiltinSpecsDetectorTest extends BaseTestCase {
|
|||
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
|
||||
assertTrue(cfgDescriptions.length > 0);
|
||||
ICConfigurationDescription cfgDescription = cfgDescriptions[0];
|
||||
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
|
||||
List<ILanguageSettingsProvider> providers = new ArrayList<>();
|
||||
providers.add(detector);
|
||||
((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
|
||||
// change the default command in all the tools of the toolchain
|
||||
|
|
|
@ -34,14 +34,14 @@ public class LanguageSettingsStorage implements Cloneable {
|
|||
/** Storage to keep settings entries. */
|
||||
protected Map<String, // languageId
|
||||
Map<String, // resource project path
|
||||
List<ICLanguageSettingEntry>>> fStorage = new HashMap<String, Map<String, List<ICLanguageSettingEntry>>>();
|
||||
List<ICLanguageSettingEntry>>> fStorage = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Pool of LSE lists implemented as WeakHashSet. That allows to gain memory savings
|
||||
* at the expense of CPU time. WeakHashSet handles garbage collection when a list is not
|
||||
* referenced anywhere else. See JavaDoc {@link java.lang.ref.WeakReference} about weak reference objects.
|
||||
*/
|
||||
private static WeakHashSet<List<ICLanguageSettingEntry>> listPool = new WeakHashSetSynchronized<List<ICLanguageSettingEntry>>();
|
||||
private static WeakHashSet<List<ICLanguageSettingEntry>> listPool = new WeakHashSetSynchronized<>();
|
||||
|
||||
/**
|
||||
* Returns the list of setting entries for the given resource and language.
|
||||
|
@ -218,13 +218,13 @@ public class LanguageSettingsStorage implements Cloneable {
|
|||
@Override
|
||||
public LanguageSettingsStorage clone() throws CloneNotSupportedException {
|
||||
LanguageSettingsStorage storageClone = (LanguageSettingsStorage) super.clone();
|
||||
storageClone.fStorage = new HashMap<String, Map<String, List<ICLanguageSettingEntry>>>();
|
||||
storageClone.fStorage = new HashMap<>();
|
||||
synchronized (fStorage) {
|
||||
Set<Entry<String, Map<String, List<ICLanguageSettingEntry>>>> entrySetLang = fStorage.entrySet();
|
||||
for (Entry<String, Map<String, List<ICLanguageSettingEntry>>> entryLang : entrySetLang) {
|
||||
String langId = entryLang.getKey();
|
||||
Map<String, List<ICLanguageSettingEntry>> mapRc = entryLang.getValue();
|
||||
Map<String, List<ICLanguageSettingEntry>> mapRcClone = new HashMap<String, List<ICLanguageSettingEntry>>();
|
||||
Map<String, List<ICLanguageSettingEntry>> mapRcClone = new HashMap<>();
|
||||
Set<Entry<String, List<ICLanguageSettingEntry>>> entrySetRc = mapRc.entrySet();
|
||||
for (Entry<String, List<ICLanguageSettingEntry>> entryRc : entrySetRc) {
|
||||
String rcProjectPath = entryRc.getKey();
|
||||
|
@ -262,5 +262,4 @@ public class LanguageSettingsStorage implements Cloneable {
|
|||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue