diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java index b5c3665e3ee..c2c0e6f54c6 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java @@ -115,11 +115,11 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest * This constructor is called to create an Option whose attributes and children will be * added by separate calls. * - * @param IHoldsOptions The parent of the option, if any - * @param Option The superClass, if any - * @param String The id for the new option - * @param String The name for the new option - * @param boolean Indicates whether this is an extension element or a managed project element + * @param parent - the parent of the option, if any + * @param superClass - the superClass, if any + * @param Id - the id for the new option + * @param name - the name for the new option + * @param isExtensionElement - indicates whether this is an extension element or a managed project element */ public Option(IHoldsOptions parent, IOption superClass, String Id, String name, boolean isExtensionElement) { this.holder = parent; @@ -253,10 +253,14 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest case UNDEF_LIBRARY_FILES: case UNDEF_MACRO_FILES: if (option.value != null) { - value = new ArrayList((ArrayList)option.value); + @SuppressWarnings("unchecked") + ArrayList list = new ArrayList((ArrayList)option.value); + value = list; } if (option.defaultValue != null) { - defaultValue = new ArrayList((ArrayList)option.defaultValue); + @SuppressWarnings("unchecked") + ArrayList list = new ArrayList((ArrayList)option.defaultValue); + defaultValue = list; } break; } @@ -682,10 +686,10 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest } /** - * Persist the option to the project file. + * Persist the option to the {@link ICStorageElement}. * - * @param doc - * @param element + * @param element - storage element to persist the option + * @throws BuildException */ public void serialize(ICStorageElement element) throws BuildException { if (superClass != null) @@ -754,6 +758,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest case UNDEF_LIBRARY_FILES: case UNDEF_MACRO_FILES: if (value != null) { + @SuppressWarnings("unchecked") ArrayList stringList = (ArrayList)value; for (OptionStringValue optValue : stringList) { ICStorageElement valueElement = element.createChild(LIST_VALUE); @@ -1178,6 +1183,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest if (getValueType() != PREPROCESSOR_SYMBOLS) { throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$ } + @SuppressWarnings("unchecked") ArrayList v = (ArrayList)getValue(); if (v == null) { return EMPTY_STRING_ARRAY; @@ -1312,6 +1318,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest if (getValueType() != INCLUDE_PATH) { throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$ } + @SuppressWarnings("unchecked") ArrayList v = (ArrayList)getValue(); if (v == null) { return EMPTY_STRING_ARRAY; @@ -1328,6 +1335,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest if (getValueType() != LIBRARIES) { throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$ } + @SuppressWarnings("unchecked") ArrayList v = (ArrayList)getValue(); if (v == null) { return EMPTY_STRING_ARRAY; @@ -1345,6 +1353,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest if (getValueType() != LIBRARY_FILES) { throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$ } + @SuppressWarnings("unchecked") ArrayList v = (ArrayList)getValue(); if (v == null) { return EMPTY_STRING_ARRAY; @@ -1371,6 +1380,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest if (getValueType() != STRING_LIST) { throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$ } + @SuppressWarnings("unchecked") ArrayList v = (ArrayList)getValue(); if (v == null) { return EMPTY_STRING_ARRAY; @@ -1398,6 +1408,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$ } // This is the right puppy, so return its list value + @SuppressWarnings("unchecked") ArrayList v = (ArrayList)getValue(); if (v == null) { return EMPTY_STRING_ARRAY; @@ -1550,6 +1561,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest public Object getRawValue() { Object ev = getExactRawValue(); if(ev instanceof List) { + @SuppressWarnings("unchecked") List evList = listValueListToValueList((List)ev); return evList; } @@ -1597,6 +1609,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest public Object getDefaultValue() { Object ev = getExactDefaultValue(); if(ev instanceof List) { + @SuppressWarnings("unchecked") List evList = listValueListToValueList((List)ev); return evList; } @@ -1618,6 +1631,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest */ public void setDefaultValue(Object v) { if(v instanceof List) { + @SuppressWarnings("unchecked") List vList = valueListToListValueList((List)v, false); defaultValue = vList; } else { @@ -1849,6 +1863,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest */ public void setValue(Object v) { if(v instanceof List) { + @SuppressWarnings("unchecked") List vList = valueListToListValueList((List)v, false); value = vList; } else { @@ -2359,6 +2374,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest if (getBasicValueType() != STRING_LIST) { throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$ } + @SuppressWarnings("unchecked") ArrayList v = (ArrayList)getValue(); if (v == null) { return EMPTY_STRING_ARRAY; @@ -2371,6 +2387,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest if (getBasicValueType() != STRING_LIST) { throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$ } + @SuppressWarnings("unchecked") ArrayList v = (ArrayList)getExactValue(); if (v == null) { return EMPTY_LV_ARRAY;