From e9ef2d126f8759ec1648498a58f95185f678790c Mon Sep 17 00:00:00 2001 From: Andrew Gvozdev Date: Mon, 3 Jan 2011 19:50:15 +0000 Subject: [PATCH] bug 319512: Missing type arguments on managedbuilder.core --- .../internal/core/OptionCategory.java | 6 ++-- .../dataprovider/ResourcePropertyHolder.java | 34 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionCategory.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionCategory.java index 96907edab19..93592da0995 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionCategory.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionCategory.java @@ -40,7 +40,7 @@ public class OptionCategory extends BuildObject implements IOptionCategory { // Parent and children private IHoldsOptions holder; - private List children; // Note: These are logical Option Category children, not "model" children + private List children; // Note: These are logical Option Category children, not "model" children // Managed Build model attributes private IOptionCategory owner; // The logical Option Category parent private String ownerId; @@ -213,14 +213,14 @@ public class OptionCategory extends BuildObject implements IOptionCategory { */ public IOptionCategory[] getChildCategories() { if (children != null) - return (IOptionCategory[])children.toArray(new IOptionCategory[children.size()]); + return children.toArray(new IOptionCategory[children.size()]); else return emtpyCategories; } public void addChildCategory(OptionCategory category) { if (children == null) - children = new ArrayList(); + children = new ArrayList(); children.add(category); } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ResourcePropertyHolder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ResourcePropertyHolder.java index 8821d591e14..8e886ce0558 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ResourcePropertyHolder.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ResourcePropertyHolder.java @@ -19,7 +19,7 @@ import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResourceChangeEvent; class ResourcePropertyHolder extends ResourceChangeHandlerBase { - private Map fRcMap = new HashMap(); + private Map> fRcMap = new HashMap>(); private boolean fProjectOnly; public ResourcePropertyHolder(boolean projectOnly){ @@ -63,26 +63,26 @@ class ResourcePropertyHolder extends ResourceChangeHandlerBase { return new ResourceMoveHandler(); } - protected Object keyForResource(IResource rc){ + protected String keyForResource(IResource rc){ 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)) throw new IllegalArgumentException(); - Map map = getResourcePropertyMap(rc, false); + Map map = getResourcePropertyMap(rc, false); if(map == null) return null; return map.get(propKey); } - private Map getResourcePropertyMap(IResource rc, boolean create){ - Object key = keyForResource(rc); - Map map = (Map)fRcMap.get(key); + private Map getResourcePropertyMap(IResource rc, boolean create){ + String key = keyForResource(rc); + Map map = fRcMap.get(key); if(map == null && create){ - map = new HashMap(); + map = new HashMap(); fRcMap.put(key, map); } @@ -90,15 +90,15 @@ class ResourcePropertyHolder extends ResourceChangeHandlerBase { } private synchronized void removeResourcePropertyMap(IResource rc){ - Object key = keyForResource(rc); + String key = keyForResource(rc); fRcMap.remove(key); } private synchronized void moveResourcePropertyMap(IResource fromRc, IResource toRc){ - Object fromKey = keyForResource(fromRc); - Object toKey = keyForResource(toRc); + String fromKey = keyForResource(fromRc); + String toKey = keyForResource(toRc); - Map fromMap = (Map)fRcMap.remove(fromKey); + Map fromMap = fRcMap.remove(fromKey); if(fromMap != null){ fRcMap.put(toKey, fromMap); } 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)) throw new IllegalArgumentException(); if(value == null) return removeProperty(rc, propKey); - Map map = getResourcePropertyMap(rc, true); + Map map = getResourcePropertyMap(rc, true); return map.put(propKey, value); } - private synchronized Object removeProperty(IResource rc, Object propKey){ - Map map = getResourcePropertyMap(rc, false); + private synchronized Boolean removeProperty(IResource rc, String propKey){ + Map map = getResourcePropertyMap(rc, false); if(map == null) return null; - Object old = map.remove(propKey); + Boolean old = map.remove(propKey); if(map.size() == 0) removeResourcePropertyMap(rc);