1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

bug 319512: Compilation warnings

This commit is contained in:
Andrew Gvozdev 2010-07-27 01:55:19 +00:00
parent b6712569b7
commit e61e00092b
4 changed files with 18 additions and 21 deletions

View file

@ -22,7 +22,7 @@ import org.eclipse.cdt.managedbuilder.core.IOutputType;
public class BuildIOType implements IBuildIOType { public class BuildIOType implements IBuildIOType {
private BuildStep fStep; private BuildStep fStep;
private List fResources = new ArrayList(); private List<BuildResource> fResources = new ArrayList<BuildResource>();
private boolean fIsInput; private boolean fIsInput;
private boolean fIsPrimary; private boolean fIsPrimary;
private String fLinkId; private String fLinkId;
@ -52,7 +52,7 @@ public class BuildIOType implements IBuildIOType {
} }
public IBuildResource[] getResources() { public IBuildResource[] getResources() {
return (BuildResource[])fResources.toArray(new BuildResource[fResources.size()]); return fResources.toArray(new BuildResource[fResources.size()]);
} }
public IBuildStep getStep() { public IBuildStep getStep() {

View file

@ -13,7 +13,6 @@ package org.eclipse.cdt.managedbuilder.internal.core;
import org.eclipse.cdt.managedbuilder.core.IBuildObject; import org.eclipse.cdt.managedbuilder.core.IBuildObject;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.core.runtime.IStatus;
import org.osgi.framework.Version; import org.osgi.framework.Version;
public class BuildObject implements IBuildObject { public class BuildObject implements IBuildObject {
@ -90,11 +89,7 @@ public class BuildObject implements IBuildObject {
public Version getVersionFromId() { public Version getVersionFromId() {
String versionNumber; String versionNumber = ManagedBuildManager.getVersionFromIdAndVersion( getId());
IStatus status = null;
versionNumber = ManagedBuildManager.getVersionFromIdAndVersion( getId());
if( versionNumber == null) { if( versionNumber == null) {
// It means, Tool Integrator either not provided version information in 'id' or provided in wrong format, // It means, Tool Integrator either not provided version information in 'id' or provided in wrong format,

View file

@ -49,13 +49,13 @@ public class BuildObjectProperties extends BuildProperties implements
IBuildPropertyType types[] = BuildPropertyManager.getInstance().getPropertyTypes(); IBuildPropertyType types[] = BuildPropertyManager.getInstance().getPropertyTypes();
if(fRestriction != null && types.length != 0){ if(fRestriction != null && types.length != 0){
List list = new ArrayList(types.length); List<IBuildPropertyType> list = new ArrayList<IBuildPropertyType>(types.length);
for(int i = 0; i < types.length; i++){ for (IBuildPropertyType type : types) {
if(fRestriction.supportsType(types[i].getId())) if(fRestriction.supportsType(type.getId()))
list.add(types[i]); list.add(type);
} }
types = (IBuildPropertyType[])list.toArray(new IBuildPropertyType[list.size()]); types = list.toArray(new IBuildPropertyType[list.size()]);
} }
return types; return types;
@ -66,13 +66,13 @@ public class BuildObjectProperties extends BuildProperties implements
if(type != null){ if(type != null){
IBuildPropertyValue values[] = type.getSupportedValues(); IBuildPropertyValue values[] = type.getSupportedValues();
if(fRestriction != null && values.length != 0){ if(fRestriction != null && values.length != 0){
List list = new ArrayList(values.length); List<IBuildPropertyValue> list = new ArrayList<IBuildPropertyValue>(values.length);
for(int i = 0; i < values.length; i++){ for (IBuildPropertyValue value : values) {
if(fRestriction.supportsValue(type.getId(), values[i].getId())) if(fRestriction.supportsValue(type.getId(), value.getId()))
list.add(values[i]); list.add(value);
} }
return (IBuildPropertyValue[])list.toArray(new IBuildPropertyValue[list.size()]); return list.toArray(new IBuildPropertyValue[list.size()]);
} }
} }
return new IBuildPropertyValue[0]; return new IBuildPropertyValue[0];

View file

@ -17,6 +17,7 @@ import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.Set;
import org.eclipse.cdt.core.settings.model.ICStorageElement; import org.eclipse.cdt.core.settings.model.ICStorageElement;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
@ -66,6 +67,7 @@ public class MapStorageElement implements ICStorageElement {
} }
public Map<String, String> toStringMap(){ public Map<String, String> toStringMap(){
@SuppressWarnings("unchecked")
Map<String, String> map = (Map<String, String>)fMap.clone(); Map<String, String> map = (Map<String, String>)fMap.clone();
if(fName != null) if(fName != null)
map.put(getMapKey(NAME_KEY), fName); map.put(getMapKey(NAME_KEY), fName);
@ -291,9 +293,9 @@ public class MapStorageElement implements ICStorageElement {
public String[] getAttributeNames() { public String[] getAttributeNames() {
List<String> list = new ArrayList<String>(fMap.size()); List<String> list = new ArrayList<String>(fMap.size());
for(Iterator iter = fMap.entrySet().iterator(); iter.hasNext();){ Set<Entry<String, String>> entrySet = fMap.entrySet();
Map.Entry entry = (Map.Entry)iter.next(); for (Entry<String, String> entry : entrySet) {
String key = (String)entry.getKey(); String key = entry.getKey();
if(!isSystemKey(key)){ if(!isSystemKey(key)){
list.add(key); list.add(key);
} }