mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-05 08:46:02 +02:00
cosmetics: generics
This commit is contained in:
parent
e6ffb95d44
commit
dec2ab43b5
2 changed files with 13 additions and 17 deletions
|
@ -226,7 +226,7 @@ public class SettingsSet {
|
|||
}
|
||||
|
||||
public SettingLevel[] getLevels(){
|
||||
return (SettingLevel[])fLevels.clone();
|
||||
return fLevels.clone();
|
||||
}
|
||||
|
||||
public void adjustOverrideState(){
|
||||
|
@ -317,7 +317,7 @@ public class SettingsSet {
|
|||
for(int i = 0; i < entries.length; i++){
|
||||
entry = entries[i];
|
||||
EntryNameKey key = new EntryNameKey(entry);
|
||||
Object[] o = (Object[])map.get(key);
|
||||
Object[] o = map.get(key);
|
||||
|
||||
|
||||
if(o != null && valueMatches(entry, o[1])){
|
||||
|
@ -336,7 +336,7 @@ public class SettingsSet {
|
|||
Map<EntryNameKey, EntryInfo> clearedInfo = clearedInfos[levelNum];
|
||||
Object customInfo = null;
|
||||
if(clearedInfo != null){
|
||||
EntryInfo info = (EntryInfo)clearedInfo.get(key);
|
||||
EntryInfo info = clearedInfo.get(key);
|
||||
if(info != null && entry.equalsByContents(info.getEntry()))
|
||||
customInfo = info.getCustomInfo();
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007 Intel Corporation and others.
|
||||
* Copyright (c) 2007, 2010 Intel Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -25,7 +25,7 @@ import org.eclipse.core.resources.IProject;
|
|||
import org.eclipse.core.resources.IResource;
|
||||
|
||||
public class ScannerInfoProviderProxy extends AbstractCExtensionProxy implements IScannerInfoProvider, IScannerInfoChangeListener{
|
||||
private Map listeners;
|
||||
private Map<IProject, List<IScannerInfoChangeListener>> listeners;
|
||||
private IScannerInfoProvider fProvider;
|
||||
|
||||
|
||||
|
@ -39,13 +39,9 @@ public class ScannerInfoProviderProxy extends AbstractCExtensionProxy implements
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param project
|
||||
* @param info
|
||||
*/
|
||||
protected void notifyInfoListeners(IResource rc, IScannerInfo info) {
|
||||
// Call in the cavalry
|
||||
List listeners = (List)getListeners().get(rc);
|
||||
List<IScannerInfoChangeListener> listeners = getListeners().get(rc);
|
||||
if (listeners == null) {
|
||||
return;
|
||||
}
|
||||
|
@ -69,11 +65,11 @@ public class ScannerInfoProviderProxy extends AbstractCExtensionProxy implements
|
|||
}
|
||||
IProject project = resource.getProject();
|
||||
// Get listeners for this resource
|
||||
Map map = getListeners();
|
||||
List list = (List)map.get(project);
|
||||
Map<IProject, List<IScannerInfoChangeListener>> map = getListeners();
|
||||
List<IScannerInfoChangeListener> list = map.get(project);
|
||||
if (list == null) {
|
||||
// Create a new list
|
||||
list = new ArrayList();
|
||||
list = new ArrayList<IScannerInfoChangeListener>();
|
||||
map.put(project, list);
|
||||
}
|
||||
if (!list.contains(listener)) {
|
||||
|
@ -85,9 +81,9 @@ public class ScannerInfoProviderProxy extends AbstractCExtensionProxy implements
|
|||
/*
|
||||
* @return
|
||||
*/
|
||||
private Map getListeners() {
|
||||
private Map<IProject, List<IScannerInfoChangeListener>> getListeners() {
|
||||
if (listeners == null) {
|
||||
listeners = new HashMap();
|
||||
listeners = new HashMap<IProject, List<IScannerInfoChangeListener>>();
|
||||
}
|
||||
return listeners;
|
||||
}
|
||||
|
@ -104,8 +100,8 @@ public class ScannerInfoProviderProxy extends AbstractCExtensionProxy implements
|
|||
}
|
||||
IProject project = resource.getProject();
|
||||
// Remove the listener
|
||||
Map map = getListeners();
|
||||
List list = (List)map.get(project);
|
||||
Map<IProject, List<IScannerInfoChangeListener>> map = getListeners();
|
||||
List<IScannerInfoChangeListener> list = map.get(project);
|
||||
if (list != null && !list.isEmpty()) {
|
||||
// The list is not empty so try to remove listener
|
||||
list.remove(listener);
|
||||
|
|
Loading…
Add table
Reference in a new issue