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