1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-09 18:56:02 +02:00

clean warnings

This commit is contained in:
Andrew Ferguson 2008-03-13 12:01:58 +00:00
parent 83b3470a9e
commit f0495f62d0
4 changed files with 45 additions and 45 deletions

View file

@ -71,10 +71,10 @@ public class TemplateDescriptor {
*
* @return default values with keys
*/
public Map<String, String> getTemplateDefaults(Element rootElement) {
public Map<String, String> getTemplateDefaults(Element element) {
Map<String, String> templateDefaults = new HashMap<String, String>();
Element propertyGroupElement;
List<Element> children = TemplateEngine.getChildrenOfElement(rootElement);
List<Element> children = TemplateEngine.getChildrenOfElement(element);
for (int i = 0, l = children.size(); i < l; i++) {
propertyGroupElement = children.get(i);
if (isNestedElement(propertyGroupElement)) {
@ -134,24 +134,24 @@ public class TemplateDescriptor {
}
/**
* This mehtod is to get the complex property-group from template descriptor
* This method is to get the complex property-group from template descriptor
* root element. complex means a property-group contains other
* property-group(s)
*
* @param rootElement
* @param element
* root element of type JDOM Element
* @return porperty-group root element of type JDOM Element
* @return property-group root element of type JDOM Element
*/
public Element getRootPropertyGroup(Element rootElement) {
if (rootElement != null) {
String rootElementName = rootElement.getNodeName();
if (rootElementName.equalsIgnoreCase(PROPERTY_GROUP) && isNestedElement(rootElement)) {
return rootElement;
public Element getRootPropertyGroup(Element element) {
if (element != null) {
String rootElementName = element.getNodeName();
if (rootElementName.equalsIgnoreCase(PROPERTY_GROUP) && isNestedElement(element)) {
return element;
}
return rootElement;
return element;
} else {
String nextPGElementName = null;
List<Element> propertyGroupList = TemplateEngine.getChildrenOfElement(rootElement);
List<Element> propertyGroupList = TemplateEngine.getChildrenOfElement(element);
for (int i = 0, l = propertyGroupList.size(); i < l; i++) {
Element nextPGElement = propertyGroupList.get(i);
if (isNestedElement(nextPGElement))

View file

@ -43,7 +43,7 @@ public class ConditionalProcessGroup {
private String conditionString;
private String lValue;
private String rValue;
private Operator op;
private Operator operator;
private List<Process> processes;
private String id;
@ -80,13 +80,13 @@ public class ConditionalProcessGroup {
} else {
int op = conditionString.indexOf(ProcessHelper.EQUALS);
if (op != -1) {
this.op = Operator.EQUALS;
this.operator = Operator.EQUALS;
lValue = conditionString.substring(0, op);
rValue = conditionString.substring(op + ProcessHelper.EQUALS.length());
} else {
op = conditionString.indexOf(ProcessHelper.NOT_EQUALS);
if (op != -1) {
this.op = Operator.NOT_EQUALS;
this.operator = Operator.NOT_EQUALS;
lValue = conditionString.substring(0, op);
rValue = conditionString.substring(op + ProcessHelper.NOT_EQUALS.length());
}//else an unsupported operation where this condition is ignored.
@ -125,17 +125,17 @@ public class ConditionalProcessGroup {
/**
* Creates the Process from the process Elements.
* @param template
* @param templateCore
* @param processElements
*/
private void createProcessObjects(TemplateCore template, List<Element> processElements) {
this.template = template;
private void createProcessObjects(TemplateCore templateCore, List<Element> processElements) {
this.template = templateCore;
this.processes = new ArrayList<Process>(processElements.size());
for (int j = 0, l = processElements.size(); j < l; j++) {
Element processElem = processElements.get(j);
if (processElem.getNodeName().equals(TemplateDescriptor.PROCESS)) {
String processId = id + "--> Process " + (j + 1) + " (" + processElem.getAttribute(Process.ELEM_TYPE) + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
processes.add(new Process(template, processElem, processId));
processes.add(new Process(templateCore, processElem, processId));
}
}
}
@ -188,16 +188,16 @@ public class ConditionalProcessGroup {
return false;
}
Map<String, String> valueStore = template.getValueStore();
String lValue = this.lValue;
String rValue = this.rValue;
String processedLValue= lValue;
String processedRValue= rValue;
for(String value : macros) {
lValue = lValue.replaceAll(ProcessHelper.START_PATTERN + value + ProcessHelper.END_PATTERN, valueStore.get(value));
rValue = rValue.replaceAll(ProcessHelper.START_PATTERN + value + ProcessHelper.END_PATTERN, valueStore.get(value));
processedLValue = processedLValue.replaceAll(ProcessHelper.START_PATTERN + value + ProcessHelper.END_PATTERN, valueStore.get(value));
processedRValue = processedRValue.replaceAll(ProcessHelper.START_PATTERN + value + ProcessHelper.END_PATTERN, valueStore.get(value));
}
if(op.equals(Operator.EQUALS)) {
return lValue.equals(rValue);
} else if(op.equals(Operator.NOT_EQUALS)) {
return !lValue.equals(rValue);
if(operator.equals(Operator.EQUALS)) {
return processedLValue.equals(processedRValue);
} else if(operator.equals(Operator.NOT_EQUALS)) {
return !processedLValue.equals(processedRValue);
} else {
return false;
}

View file

@ -57,10 +57,10 @@ public class Process {
/**
* This method build the necessary Arguments for the process
* @param template
* @param templateCore
* @param element
*/
private void buildArgs(TemplateCore template, Element element) {
private void buildArgs(TemplateCore templateCore, Element element) {
List<Element> children = TemplateEngine.getChildrenOfElement(element);
ProcessParameter[] params = processRunner.getProcessParameters();
List<ProcessArgument> list = new ArrayList<ProcessArgument>(params.length);
@ -70,14 +70,14 @@ public class Process {
boolean childrenRemain = childIndex < children.size();
Element child = (childrenRemain ? children.get(childIndex) : null);
if (param.isExternal() && (!childrenRemain || !param.getName().equals(child.getAttribute(ProcessArgument.ELEM_NAME)))) {
list.add(new ProcessArgument(template, param));
list.add(new ProcessArgument(templateCore, param));
} else if (childrenRemain) {
list.add(new ProcessArgument(template, child));
list.add(new ProcessArgument(templateCore, child));
childIndex++;
}
}
while (childIndex < children.size()) {
list.add(new ProcessArgument(template, children.get(childIndex++)));
list.add(new ProcessArgument(templateCore, children.get(childIndex++)));
}
args = list.toArray(new ProcessArgument[list.size()]);
}

View file

@ -207,12 +207,12 @@ public class ProcessArgument {
case ProcessParameter.COMPLEX_ARRAY:
params = param.getComplexChildren();
for(int i=0; i<complexValueArray.length; i++) {
ProcessArgument[] complexValue = complexValueArray[i];
if (params.length != complexValue.length) {
ProcessArgument[] cValue = complexValueArray[i];
if (params.length != cValue.length) {
return false;
}
for (int j = 0; j < complexValue.length; j++) {
if (!complexValue[j].isOfParameterType(params[j])) {
for (int j = 0; j < cValue.length; j++) {
if (!cValue[j].isOfParameterType(params[j])) {
return false;
}
}
@ -256,9 +256,9 @@ public class ProcessArgument {
return true;
case ProcessParameter.COMPLEX_ARRAY:
for(int i=0; i<complexValueArray.length; i++) {
ProcessArgument[] complexValue =complexValueArray[i];
for(int j=0; j<complexValue.length; j++) {
ProcessArgument arg = complexValue[j];
ProcessArgument[] cValue =complexValueArray[i];
for(int j=0; j<cValue.length; j++) {
ProcessArgument arg = cValue[j];
if (!arg.areAllMacrosExpandable()) {
return false;
}
@ -297,9 +297,9 @@ public class ProcessArgument {
return null;
case ProcessParameter.COMPLEX_ARRAY:
for(int i=0; i<complexValueArray.length; i++) {
ProcessArgument[] complexValue =complexValueArray[i];
for(int j=0; j<complexValue.length; j++) {
ProcessArgument arg = complexValue[j];
ProcessArgument[] cValue =complexValueArray[i];
for(int j=0; j<cValue.length; j++) {
ProcessArgument arg = cValue[j];
if ((macro = arg.getFirstNonExpandableMacro()) != null) {
return macro;
}
@ -351,9 +351,9 @@ public class ProcessArgument {
break;
case ProcessParameter.COMPLEX_ARRAY:
for(int i=0; i<complexValueArray.length; i++) {
ProcessArgument[] complexValue =complexValueArray[i];
for(int j=0; j<complexValue.length; j++) {
ProcessArgument arg = complexValue[j];
ProcessArgument[] cValue =complexValueArray[i];
for(int j=0; j<cValue.length; j++) {
ProcessArgument arg = cValue[j];
arg.resolve();
}
}