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-21 04:42:33 +00:00
parent b64329ba17
commit 007e46e51f
7 changed files with 39 additions and 50 deletions

View file

@ -18,8 +18,6 @@ import org.eclipse.cdt.managedbuilder.internal.core.Builder;
import org.eclipse.cdt.managedbuilder.internal.core.Configuration;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.variables.IStringVariableManager;
import org.eclipse.core.variables.VariablesPlugin;
public class BuildBuildData extends CBuildData {
private Builder fBuilder;
@ -35,11 +33,11 @@ public class BuildBuildData extends CBuildData {
return new Path(fBuilder.getBuildPath());//ManagedBuildManager.getBuildLocation(fCfg, fBuilder);
}
private IPath createAbsolutePathFromWorkspacePath(IPath path){
IStringVariableManager mngr = VariablesPlugin.getDefault().getStringVariableManager();
String locationString = mngr.generateVariableExpression("workspace_loc", path.toString()); //$NON-NLS-1$
return new Path(locationString);
}
// private IPath createAbsolutePathFromWorkspacePath(IPath path){
// IStringVariableManager mngr = VariablesPlugin.getDefault().getStringVariableManager();
// String locationString = mngr.generateVariableExpression("workspace_loc", path.toString()); //$NON-NLS-1$
// return new Path(locationString);
// }
@Override
public String[] getErrorParserIDs() {

View file

@ -147,7 +147,9 @@ public class BuildEntryStorage extends AbstractEntryStorage {
uei = new UserEntryInfo(infos[i].getEntry(), null, null, null);
userInfos[i] = uei;
}
setUserEntries(userInfos, (List<EmptyEntryInfo>)level.getContext());
@SuppressWarnings("unchecked")
List<EmptyEntryInfo> context = (List<EmptyEntryInfo>)level.getContext();
setUserEntries(userInfos, context);
setUserUndefinedStringSet(level.containsOverrideInfo() ? level.getOverrideSet() : null);
}
break;
@ -193,9 +195,7 @@ public class BuildEntryStorage extends AbstractEntryStorage {
}
/**
* Return scanner discovered entries (level 2)
* @param flags
* @return
* @return scanner discovered entries (level 2)
*/
private ICLanguageSettingEntry[] getDiscoveredEntries(int flags){
ICLanguageSettingEntry[] entries = ProfileInfoProvider.getInstance().getEntryValues(fLangData, getKind(), flags);
@ -225,8 +225,6 @@ public class BuildEntryStorage extends AbstractEntryStorage {
*
* The UserEntryInfo[] is an array of all user entries from all the options
* applicable to the language setting entry kind.
* @param flags
* @param usr
* @param emptyValuesInfos list to which unresolved entries are added
* @return UserEntryInfo[] (never null)
*/
@ -236,6 +234,7 @@ public class BuildEntryStorage extends AbstractEntryStorage {
List<UserEntryInfo> entryList = new ArrayList<UserEntryInfo>();
for (IOption opt : options) {
Option option = (Option)opt;
@SuppressWarnings("unchecked")
List<OptionStringValue> list = usr ? (List<OptionStringValue>)option.getExactValue() : (List<OptionStringValue>)option.getExactBuiltinsList();
if(list != null){
SupplierBasedCdtVariableSubstitutor subst = createSubstitutor(option, false);
@ -291,6 +290,7 @@ public class BuildEntryStorage extends AbstractEntryStorage {
private HashSet<String> getUserUndefinedStringSet(){
HashSet<String> set = null;
for (IOption option : fLangData.getUndefOptionsForKind(getKind())) {
@SuppressWarnings("unchecked")
List<String> list = (List<String>)option.getValue();
if(list.size() != 0){
if(set == null)
@ -303,8 +303,6 @@ public class BuildEntryStorage extends AbstractEntryStorage {
/**
* Makes non-absolute paths relative to the build directory
* @param info
* @return
*/
private PathInfo fromBuildToProj(PathInfo info){
if(info.isAbsolute())
@ -363,9 +361,7 @@ public class BuildEntryStorage extends AbstractEntryStorage {
}
/**
* Return env envtries (level 1)
* @param flags
* @return
* @return env entries (level 1)
*/
private ICLanguageSettingEntry[] getEnvEntries(int flags){
String paths[] = null;
@ -396,11 +392,6 @@ public class BuildEntryStorage extends AbstractEntryStorage {
/**
* Create an ICLanguageSettingEntry based on the passed in Option
* @param option
* @param optionValue
* @param flags
* @param subst
* @return
*/
private ICLanguageSettingEntry createUserEntry(Option option, OptionStringValue optionValue, int flags, SupplierBasedCdtVariableSubstitutor subst){
final int kind = getKind();
@ -536,7 +527,6 @@ public class BuildEntryStorage extends AbstractEntryStorage {
}
/**
* @param option
* @return the option type for the option
*/
private static int getOptionType(IOption option) {
@ -671,8 +661,6 @@ public class BuildEntryStorage extends AbstractEntryStorage {
*
* FIXME: As far as I can see info.fSequense only ever has a single entry in it...
* see UserEntryInfo constructor => this method doesn't accomplish anything useful
* @param infos
* @return
*/
private UserEntryInfo[] combineSequenses(UserEntryInfo infos[]){
if(infos.length == 0)

View file

@ -61,7 +61,7 @@ public class BuildEnvironmentContributor implements IEnvironmentContributor {
EnvironmentCollector collector = new EnvironmentCollector();
ExternalExtensionEnvironmentSupplier extSupplier = new ExternalExtensionEnvironmentSupplier(provider);
Set set = null;
Set<String> set = null;
IEnvironmentVariable vars[] = extSupplier.getVariables(fCfg.getManagedProject());
set = processVariables(vars, collector, provider, set);
@ -89,11 +89,11 @@ public class BuildEnvironmentContributor implements IEnvironmentContributor {
return varFound;
}
private Set processVariables(IEnvironmentVariable vars[], EnvironmentCollector collector, IEnvironmentVariableManager provider, Set set){
private Set<String> processVariables(IEnvironmentVariable vars[], EnvironmentCollector collector, IEnvironmentVariableManager provider, Set<String> set){
boolean checkSet = true;
if(vars != null && vars.length != 0){
if(set == null){
set = new HashSet();
set = new HashSet<String>();
checkSet = false;
}

View file

@ -12,8 +12,8 @@ package org.eclipse.cdt.managedbuilder.internal.enablement;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
public class AdjustmentContext {
@ -49,10 +49,10 @@ public class AdjustmentContext {
// return fType;
// }
private HashMap fMap = new HashMap();
private HashMap<String, Boolean> fMap = new HashMap<String, Boolean>();
public void addAdjustedState(String attr, boolean adjusted){
Boolean b = (Boolean)fMap.get(attr);
Boolean b = fMap.get(attr);
if(b == null ||
(adjusted &&
!b.booleanValue())){
@ -64,14 +64,14 @@ public class AdjustmentContext {
if(fMap.size() == 0)
return new String[0];
ArrayList list = new ArrayList(fMap.size());
for(Iterator iter = fMap.entrySet().iterator(); iter.hasNext();){
Map.Entry entry = (Map.Entry)iter.next();
Boolean b = (Boolean)entry.getValue();
ArrayList<String> list = new ArrayList<String>(fMap.size());
Set<Entry<String, Boolean>> entrySet = fMap.entrySet();
for (Entry<String, Boolean> entry : entrySet) {
Boolean b = entry.getValue();
if(!b.booleanValue()){
list.add(entry.getKey());
}
}
return (String[])list.toArray(new String[list.size()]);
return list.toArray(new String[list.size()]);
}
}

View file

@ -123,8 +123,9 @@ public class CheckOptionExpression implements IBooleanExpression {
case IOption.UNDEF_LIBRARY_PATHS:
case IOption.UNDEF_LIBRARY_FILES:
case IOption.UNDEF_MACRO_FILES:{
List list = (List)option.getValue();
String listValue = provider.convertStringListToString((String[])list.toArray(new String[list.size()]),delimiter);
@SuppressWarnings("unchecked")
List<String> list = (List<String>)option.getValue();
String listValue = provider.convertStringListToString(list.toArray(new String[list.size()]),delimiter);
listValue = provider.resolveValue(listValue, inexVal, delimiter,
IBuildMacroProvider.CONTEXT_OPTION,
@ -188,11 +189,13 @@ public class CheckOptionExpression implements IBooleanExpression {
case IOption.UNDEF_LIBRARY_PATHS:
case IOption.UNDEF_LIBRARY_FILES:
case IOption.UNDEF_MACRO_FILES:{
List list = (List)option.getValue();
String listValue[] = (String[])list.toArray(new String[list.size()]);
@SuppressWarnings("unchecked")
List<String> list = (List<String>)option.getValue();
String listValue[] = list.toArray(new String[list.size()]);
list = (List)otherOption.getValue();
String otherValue[] = (String[])list.toArray(new String[list.size()]);
@SuppressWarnings("unchecked")
List<String> otherList = (List<String>)otherOption.getValue();
String otherValue[] = otherList.toArray(new String[otherList.size()]);
IMacroContextInfo info = provider.getMacroContextInfo(IBuildMacroProvider.CONTEXT_OPTION,
new OptionContextData(option,holder));

View file

@ -64,10 +64,10 @@ public abstract class CompositeExpression implements IBooleanExpression {
return fChildren;
}
public Map getReferencedProperties(Map map){
public Map<String, Set<String>> getReferencedProperties(Map<String, Set<String>> map){
IBooleanExpression children[] = getChildren();
if(map == null)
map = new HashMap();
map = new HashMap<String, Set<String>>();
for(int i = 0; i < children.length; i++){
IBooleanExpression child = children[i];
@ -79,9 +79,9 @@ public abstract class CompositeExpression implements IBooleanExpression {
String val = bp.getValueId();
if(prop != null && prop.length() != 0
&& val != null && val.length() != 0){
Set set = (Set)map.get(prop);
Set<String> set = map.get(prop);
if(set == null){
set = new HashSet();
set = new HashSet<String>();
map.put(prop, set);
}
set.add(val);

View file

@ -129,7 +129,7 @@ public class OptionEnablementExpression extends AndExpression{
}
public String[] convertToList(String value, String delimiter){
List list = new ArrayList();
List<String> list = new ArrayList<String>();
int delLength = delimiter.length();
int valLength = value.length();
@ -149,7 +149,7 @@ public class OptionEnablementExpression extends AndExpression{
}
}
return (String[])list.toArray(new String[list.size()]);
return list.toArray(new String[list.size()]);
}
protected int calculateFlags(String flagsString){