mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
bug 319512: Missing type arguments on managedbuilder.core
This commit is contained in:
parent
0fb92105b5
commit
e9ef2d126f
2 changed files with 20 additions and 20 deletions
|
@ -40,7 +40,7 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
|
||||||
|
|
||||||
// Parent and children
|
// Parent and children
|
||||||
private IHoldsOptions holder;
|
private IHoldsOptions holder;
|
||||||
private List children; // Note: These are logical Option Category children, not "model" children
|
private List<OptionCategory> children; // Note: These are logical Option Category children, not "model" children
|
||||||
// Managed Build model attributes
|
// Managed Build model attributes
|
||||||
private IOptionCategory owner; // The logical Option Category parent
|
private IOptionCategory owner; // The logical Option Category parent
|
||||||
private String ownerId;
|
private String ownerId;
|
||||||
|
@ -213,14 +213,14 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
|
||||||
*/
|
*/
|
||||||
public IOptionCategory[] getChildCategories() {
|
public IOptionCategory[] getChildCategories() {
|
||||||
if (children != null)
|
if (children != null)
|
||||||
return (IOptionCategory[])children.toArray(new IOptionCategory[children.size()]);
|
return children.toArray(new IOptionCategory[children.size()]);
|
||||||
else
|
else
|
||||||
return emtpyCategories;
|
return emtpyCategories;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addChildCategory(OptionCategory category) {
|
public void addChildCategory(OptionCategory category) {
|
||||||
if (children == null)
|
if (children == null)
|
||||||
children = new ArrayList();
|
children = new ArrayList<OptionCategory>();
|
||||||
children.add(category);
|
children.add(category);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ import org.eclipse.core.resources.IResource;
|
||||||
import org.eclipse.core.resources.IResourceChangeEvent;
|
import org.eclipse.core.resources.IResourceChangeEvent;
|
||||||
|
|
||||||
class ResourcePropertyHolder extends ResourceChangeHandlerBase {
|
class ResourcePropertyHolder extends ResourceChangeHandlerBase {
|
||||||
private Map fRcMap = new HashMap();
|
private Map<String, Map<String, Boolean>> fRcMap = new HashMap<String, Map<String, Boolean>>();
|
||||||
private boolean fProjectOnly;
|
private boolean fProjectOnly;
|
||||||
|
|
||||||
public ResourcePropertyHolder(boolean projectOnly){
|
public ResourcePropertyHolder(boolean projectOnly){
|
||||||
|
@ -63,26 +63,26 @@ class ResourcePropertyHolder extends ResourceChangeHandlerBase {
|
||||||
return new ResourceMoveHandler();
|
return new ResourceMoveHandler();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Object keyForResource(IResource rc){
|
protected String keyForResource(IResource rc){
|
||||||
return rc.getFullPath().toString();
|
return rc.getFullPath().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized Object getProperty(IResource rc, Object propKey) throws IllegalArgumentException {
|
public synchronized Boolean getProperty(IResource rc, String propKey) throws IllegalArgumentException {
|
||||||
if(!isValidResource(rc))
|
if(!isValidResource(rc))
|
||||||
throw new IllegalArgumentException();
|
throw new IllegalArgumentException();
|
||||||
|
|
||||||
Map map = getResourcePropertyMap(rc, false);
|
Map<String, Boolean> map = getResourcePropertyMap(rc, false);
|
||||||
if(map == null)
|
if(map == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return map.get(propKey);
|
return map.get(propKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map getResourcePropertyMap(IResource rc, boolean create){
|
private Map<String, Boolean> getResourcePropertyMap(IResource rc, boolean create){
|
||||||
Object key = keyForResource(rc);
|
String key = keyForResource(rc);
|
||||||
Map map = (Map)fRcMap.get(key);
|
Map<String, Boolean> map = fRcMap.get(key);
|
||||||
if(map == null && create){
|
if(map == null && create){
|
||||||
map = new HashMap();
|
map = new HashMap<String, Boolean>();
|
||||||
fRcMap.put(key, map);
|
fRcMap.put(key, map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,15 +90,15 @@ class ResourcePropertyHolder extends ResourceChangeHandlerBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
private synchronized void removeResourcePropertyMap(IResource rc){
|
private synchronized void removeResourcePropertyMap(IResource rc){
|
||||||
Object key = keyForResource(rc);
|
String key = keyForResource(rc);
|
||||||
fRcMap.remove(key);
|
fRcMap.remove(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
private synchronized void moveResourcePropertyMap(IResource fromRc, IResource toRc){
|
private synchronized void moveResourcePropertyMap(IResource fromRc, IResource toRc){
|
||||||
Object fromKey = keyForResource(fromRc);
|
String fromKey = keyForResource(fromRc);
|
||||||
Object toKey = keyForResource(toRc);
|
String toKey = keyForResource(toRc);
|
||||||
|
|
||||||
Map fromMap = (Map)fRcMap.remove(fromKey);
|
Map<String, Boolean> fromMap = fRcMap.remove(fromKey);
|
||||||
if(fromMap != null){
|
if(fromMap != null){
|
||||||
fRcMap.put(toKey, fromMap);
|
fRcMap.put(toKey, fromMap);
|
||||||
} else {
|
} else {
|
||||||
|
@ -106,24 +106,24 @@ class ResourcePropertyHolder extends ResourceChangeHandlerBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized Object setProperty(IResource rc, Object propKey, Object value) throws IllegalArgumentException {
|
public synchronized Boolean setProperty(IResource rc, String propKey, Boolean value) throws IllegalArgumentException {
|
||||||
if(!isValidResource(rc))
|
if(!isValidResource(rc))
|
||||||
throw new IllegalArgumentException();
|
throw new IllegalArgumentException();
|
||||||
|
|
||||||
if(value == null)
|
if(value == null)
|
||||||
return removeProperty(rc, propKey);
|
return removeProperty(rc, propKey);
|
||||||
|
|
||||||
Map map = getResourcePropertyMap(rc, true);
|
Map<String, Boolean> map = getResourcePropertyMap(rc, true);
|
||||||
return map.put(propKey, value);
|
return map.put(propKey, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
private synchronized Object removeProperty(IResource rc, Object propKey){
|
private synchronized Boolean removeProperty(IResource rc, String propKey){
|
||||||
Map map = getResourcePropertyMap(rc, false);
|
Map<String, Boolean> map = getResourcePropertyMap(rc, false);
|
||||||
|
|
||||||
if(map == null)
|
if(map == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
Object old = map.remove(propKey);
|
Boolean old = map.remove(propKey);
|
||||||
|
|
||||||
if(map.size() == 0)
|
if(map.size() == 0)
|
||||||
removeResourcePropertyMap(rc);
|
removeResourcePropertyMap(rc);
|
||||||
|
|
Loading…
Add table
Reference in a new issue