From ab41c57c9f2c8beaf21fc678e890a564185b0956 Mon Sep 17 00:00:00 2001 From: Andrew Ferguson Date: Tue, 29 Apr 2008 14:15:45 +0000 Subject: [PATCH] fix more warnings --- .../templateengine/TemplateDescriptor.java | 6 ++---- .../process/ConditionalProcessGroup.java | 3 +-- .../templateengine/process/ProcessHelper.java | 20 ++++++++----------- .../process/TemplateProcessHandler.java | 3 +-- 4 files changed, 12 insertions(+), 20 deletions(-) diff --git a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/TemplateDescriptor.java b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/TemplateDescriptor.java index 38f17237106..a146be89df0 100644 --- a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/TemplateDescriptor.java +++ b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/TemplateDescriptor.java @@ -110,10 +110,8 @@ public class TemplateDescriptor { /** * This method is to get the list of property-group elements from template - * descriptor root element + * descriptor root element. * - * @param aRootElement - * root element of type JDOM Element * @return list of property-group elements */ public List getPropertyGroupList() { @@ -156,7 +154,7 @@ public class TemplateDescriptor { Element nextPGElement = propertyGroupList.get(i); if (isNestedElement(nextPGElement)) nextPGElementName = nextPGElement.getNodeName(); - if (nextPGElementName.equalsIgnoreCase(PROPERTY_GROUP) && isNestedElement(nextPGElement)) { + if (PROPERTY_GROUP.equalsIgnoreCase(nextPGElementName) && isNestedElement(nextPGElement)) { return nextPGElement; } } diff --git a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/ConditionalProcessGroup.java b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/ConditionalProcessGroup.java index 4570f795b50..6c75f520ec7 100644 --- a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/ConditionalProcessGroup.java +++ b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/ConditionalProcessGroup.java @@ -253,8 +253,7 @@ public class ConditionalProcessGroup { } /** - * Returns All Macros as a Set. - * @return Set, contains macros + * @return the union of all macros used in the child processes */ public Set getAllMacros() { Set set = null; diff --git a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/ProcessHelper.java b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/ProcessHelper.java index 2a5bd44b61c..1e6eb795ce7 100644 --- a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/ProcessHelper.java +++ b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/ProcessHelper.java @@ -43,10 +43,8 @@ public class ProcessHelper { /** * This method is to append the given contents into a file. * - * @param fileContents, - * contents which are appended to the file. - * @param toFile, - * a file to append contents. + * @param fileContents contents which are appended to the file. + * @param toFile a file to append contents. * @throws IOException, * exception while writing contents into a file * @@ -62,7 +60,9 @@ public class ProcessHelper { raf.skipBytes((int) raf.length()); raf.writeBytes(fileContents); } finally { - raf.close(); + if(raf != null) { + raf.close(); + } } } } @@ -71,8 +71,7 @@ public class ProcessHelper { * This method returns a vector of all replace marker strings. (e.g., * $(item), vector contains 'item' as one item. , ) is the end pattern. * - * @param str, - * A given string possibly containing markers. + * @param str A given string possibly containing markers. * @return the set of names occurring within markers * @since 4.0 */ @@ -172,11 +171,10 @@ public class ProcessHelper { /** - * Returns the Macro Value after expanding the Macros. * @param string * @param macros * @param valueStore - * @return + * @return the Macro Value after expanding the Macros. * * @since 4.0 */ @@ -192,10 +190,8 @@ public class ProcessHelper { } /** - * Construct and return the replacement markers - * after adding the patterns to the macro. * @param macro - * @return + * @return the replacement marker string * * @since 4.0 */ diff --git a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/TemplateProcessHandler.java b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/TemplateProcessHandler.java index e2bce626344..c46adba0631 100644 --- a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/TemplateProcessHandler.java +++ b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/TemplateProcessHandler.java @@ -71,8 +71,7 @@ public class TemplateProcessHandler { } /** - * Returns all macros - * @return + * @return the union of all macros used in this template's process groups */ public Set getAllMacros() { Set set = new HashSet();