mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
bug 319512: compilation warnings
This commit is contained in:
parent
0c966168b9
commit
459affd72f
1 changed files with 14 additions and 12 deletions
|
@ -21,8 +21,8 @@ import org.eclipse.cdt.managedbuilder.buildproperties.IBuildProperty;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
|
||||||
public class BuildProperties implements IBuildProperties {
|
public class BuildProperties implements IBuildProperties {
|
||||||
private HashMap fPropertiesMap = new HashMap();
|
private HashMap<String, IBuildProperty> fPropertiesMap = new HashMap<String, IBuildProperty>();
|
||||||
private ArrayList fInexistentProperties;
|
private ArrayList<String> fInexistentProperties;
|
||||||
|
|
||||||
public BuildProperties(){
|
public BuildProperties(){
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ public class BuildProperties implements IBuildProperties {
|
||||||
addProperty(prop);
|
addProperty(prop);
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
if(fInexistentProperties == null)
|
if(fInexistentProperties == null)
|
||||||
fInexistentProperties = new ArrayList();
|
fInexistentProperties = new ArrayList<String>();
|
||||||
|
|
||||||
fInexistentProperties.add(property);
|
fInexistentProperties.add(property);
|
||||||
}
|
}
|
||||||
|
@ -47,18 +47,19 @@ public class BuildProperties implements IBuildProperties {
|
||||||
fInexistentProperties.trimToSize();
|
fInexistentProperties.trimToSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public BuildProperties(BuildProperties properties){
|
public BuildProperties(BuildProperties properties){
|
||||||
fPropertiesMap.putAll(properties.fPropertiesMap);
|
fPropertiesMap.putAll(properties.fPropertiesMap);
|
||||||
if(properties.fInexistentProperties != null)
|
if(properties.fInexistentProperties != null)
|
||||||
fInexistentProperties = (ArrayList)properties.fInexistentProperties.clone();
|
fInexistentProperties = (ArrayList<String>)properties.fInexistentProperties.clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
public IBuildProperty[] getProperties(){
|
public IBuildProperty[] getProperties(){
|
||||||
return (BuildProperty[])fPropertiesMap.values().toArray(new BuildProperty[fPropertiesMap.size()]);
|
return fPropertiesMap.values().toArray(new BuildProperty[fPropertiesMap.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IBuildProperty getProperty(String id){
|
public IBuildProperty getProperty(String id){
|
||||||
return (BuildProperty)fPropertiesMap.get(id);
|
return fPropertiesMap.get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void addProperty(IBuildProperty property){
|
void addProperty(IBuildProperty property){
|
||||||
|
@ -79,7 +80,7 @@ public class BuildProperties implements IBuildProperties {
|
||||||
} catch (CoreException e){
|
} catch (CoreException e){
|
||||||
if(force){
|
if(force){
|
||||||
if(fInexistentProperties == null)
|
if(fInexistentProperties == null)
|
||||||
fInexistentProperties = new ArrayList(1);
|
fInexistentProperties = new ArrayList<String>(1);
|
||||||
|
|
||||||
fInexistentProperties.add(BuildProperty.toString(propertyId, propertyValue));
|
fInexistentProperties.add(BuildProperty.toString(propertyId, propertyValue));
|
||||||
fInexistentProperties.trimToSize();
|
fInexistentProperties.trimToSize();
|
||||||
|
@ -89,7 +90,7 @@ public class BuildProperties implements IBuildProperties {
|
||||||
}
|
}
|
||||||
|
|
||||||
public IBuildProperty removeProperty(String id){
|
public IBuildProperty removeProperty(String id){
|
||||||
return (IBuildProperty)fPropertiesMap.remove(id);
|
return fPropertiesMap.remove(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void removeProperty(BuildProperty property){
|
void removeProperty(BuildProperty property){
|
||||||
|
@ -100,7 +101,7 @@ public class BuildProperties implements IBuildProperties {
|
||||||
public String toString(){
|
public String toString(){
|
||||||
String props = toStringExistingProperties();
|
String props = toStringExistingProperties();
|
||||||
if(fInexistentProperties != null){
|
if(fInexistentProperties != null){
|
||||||
String inexistentProps = CDataUtil.arrayToString((String[])fInexistentProperties.toArray(new String[fInexistentProperties.size()]), BuildPropertyManager.PROPERTIES_SEPARATOR);
|
String inexistentProps = CDataUtil.arrayToString(fInexistentProperties.toArray(new String[fInexistentProperties.size()]), BuildPropertyManager.PROPERTIES_SEPARATOR);
|
||||||
if(props.length() != 0){
|
if(props.length() != 0){
|
||||||
StringBuffer buf = new StringBuffer();
|
StringBuffer buf = new StringBuffer();
|
||||||
buf.append(props).append(BuildPropertyManager.PROPERTIES_SEPARATOR).append(inexistentProps);
|
buf.append(props).append(BuildPropertyManager.PROPERTIES_SEPARATOR).append(inexistentProps);
|
||||||
|
@ -119,7 +120,7 @@ public class BuildProperties implements IBuildProperties {
|
||||||
return fPropertiesMap.values().iterator().next().toString();
|
return fPropertiesMap.values().iterator().next().toString();
|
||||||
|
|
||||||
StringBuffer buf = new StringBuffer();
|
StringBuffer buf = new StringBuffer();
|
||||||
Iterator iter = fPropertiesMap.values().iterator();
|
Iterator<IBuildProperty> iter = fPropertiesMap.values().iterator();
|
||||||
buf.append(iter.next().toString());
|
buf.append(iter.next().toString());
|
||||||
for(;iter.hasNext();){
|
for(;iter.hasNext();){
|
||||||
buf.append(BuildPropertyManager.PROPERTIES_SEPARATOR);
|
buf.append(BuildPropertyManager.PROPERTIES_SEPARATOR);
|
||||||
|
@ -128,15 +129,16 @@ public class BuildProperties implements IBuildProperties {
|
||||||
return buf.toString();
|
return buf.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public Object clone() {
|
public Object clone() {
|
||||||
try {
|
try {
|
||||||
BuildProperties clone = (BuildProperties)super.clone();
|
BuildProperties clone = (BuildProperties)super.clone();
|
||||||
|
|
||||||
if(fInexistentProperties != null)
|
if(fInexistentProperties != null)
|
||||||
clone.fInexistentProperties = (ArrayList)fInexistentProperties.clone();
|
clone.fInexistentProperties = (ArrayList<String>)fInexistentProperties.clone();
|
||||||
|
|
||||||
clone.fPropertiesMap = (HashMap)fPropertiesMap.clone();
|
clone.fPropertiesMap = (HashMap<String, IBuildProperty>)fPropertiesMap.clone();
|
||||||
/* for(Iterator iter = clone.fPropertiesMap.entrySet().iterator(); iter.hasNext();){
|
/* for(Iterator iter = clone.fPropertiesMap.entrySet().iterator(); iter.hasNext();){
|
||||||
Map.Entry entry = (Map.Entry)iter.next();
|
Map.Entry entry = (Map.Entry)iter.next();
|
||||||
BuildProperty prop = (BuildProperty)entry.getValue();
|
BuildProperty prop = (BuildProperty)entry.getValue();
|
||||||
|
|
Loading…
Add table
Reference in a new issue