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

clean up warnings

This commit is contained in:
Andrew Ferguson 2008-04-18 12:38:06 +00:00
parent 5323561c07
commit 677d68715d
7 changed files with 23 additions and 61 deletions

View file

@ -75,11 +75,8 @@ public class SharedDefaults extends HashMap<String, String> {
private static SharedDefaults SHAREDDEFAULTS = new SharedDefaults(); private static SharedDefaults SHAREDDEFAULTS = new SharedDefaults();
/** /**
* Returns static SharedDefaults Instance * @return the shared SharedDefaults Instance
*
* @return
*/ */
public static SharedDefaults getInstance() { public static SharedDefaults getInstance() {
return SHAREDDEFAULTS; return SHAREDDEFAULTS;
} }

View file

@ -81,14 +81,14 @@ public class TemplateEngine {
} }
/** /**
* Returns the TemplateCore for the first template defined for the specified parameters, or null * Returns the first template defined for the specified parameters
* if no such definition exists, or if there is an error initializing the template (the error will
* be logged).
* @param projectType may not be null * @param projectType may not be null
* @param toolChain may be null to indicate no tool-chain filtering * @param toolChain may be null to indicate no tool-chain filtering
* @param usageFilter a regex in java.util.regex.Pattern format, may be null to indicate no filtering * @param usageFilter a regex in java.util.regex.Pattern format, may be null to indicate no filtering
* @see java.util.regex.Pattern * @see java.util.regex.Pattern
* @return * @return the TemplateCore for the first template defined for the specified parameters, or null
* if no such definition exists, or if there is an error initializing the template (the error will
* be logged).
*/ */
public TemplateCore getFirstTemplate(String projectType, String toolChain, String usageFilter) { public TemplateCore getFirstTemplate(String projectType, String toolChain, String usageFilter) {
TemplateInfo[] infos= getTemplateInfos(projectType, toolChain, usageFilter); TemplateInfo[] infos= getTemplateInfos(projectType, toolChain, usageFilter);
@ -153,9 +153,7 @@ public class TemplateEngine {
} }
/** /**
* return the SharedDefaults. * @return the SharedDefaults.
*
* @return
*/ */
public static Map<String, String> getSharedDefaults() { public static Map<String, String> getSharedDefaults() {
return SharedDefaults.getInstance().getSharedDefaultsMap(); return SharedDefaults.getInstance().getSharedDefaultsMap();
@ -170,7 +168,6 @@ public class TemplateEngine {
* values of IDs in ValueStore, which are also present in PersistTrueIDs * values of IDs in ValueStore, which are also present in PersistTrueIDs
* vector. * vector.
* @param template * @param template
* @param aSharedValue
*/ */
public void updateSharedDefaults(TemplateCore template) { public void updateSharedDefaults(TemplateCore template) {
Map<String, String> tobePersisted = new HashMap<String, String>(); Map<String, String> tobePersisted = new HashMap<String, String>();
@ -333,8 +330,7 @@ public class TemplateEngine {
} }
/** /**
* Returns all TemplateInfo objects known to the TemplateEngine * @return all TemplateInfo objects known to the TemplateEngine
* @return
*/ */
public TemplateInfo[] getTemplateInfos() { public TemplateInfo[] getTemplateInfos() {
List<TemplateInfo> infoList = new ArrayList<TemplateInfo>(); List<TemplateInfo> infoList = new ArrayList<TemplateInfo>();
@ -346,9 +342,7 @@ public class TemplateEngine {
/** /**
* Getter for templateInfoMap * @return the map from project-type ID's to all associated TemplateInfo instances
*
* @return
*/ */
public Map<String, List<TemplateInfo>> getTemplateInfoMap() { public Map<String, List<TemplateInfo>> getTemplateInfoMap() {
return templateInfoMap; return templateInfoMap;

View file

@ -69,7 +69,6 @@ public class TemplateEngineHelper {
*/ */
public static File getSharedDefaultLocation(String sharedLocation) { public static File getSharedDefaultLocation(String sharedLocation) {
File sharedXMLFile = findLocation(sharedLocation); File sharedXMLFile = findLocation(sharedLocation);
return sharedXMLFile; return sharedXMLFile;
} }
@ -82,14 +81,11 @@ public class TemplateEngineHelper {
* *
* @since 4.0 * @since 4.0
*/ */
private static File findLocation(String fileLocation) { private static File findLocation(String fileLocation) {
Plugin plugin = CCorePlugin.getDefault(); Plugin plugin = CCorePlugin.getDefault();
IPath stateLoc = plugin.getStateLocation(); IPath stateLoc = plugin.getStateLocation();
fileLocation = stateLoc.toString() + File.separator + fileLocation; fileLocation = stateLoc.toString() + File.separator + fileLocation;
File file = new File(fileLocation); File file = new File(fileLocation);
return file; return file;
} }
@ -97,38 +93,23 @@ public class TemplateEngineHelper {
* Stores the shareddefaults xml file in * Stores the shareddefaults xml file in
* "${workspace}/.metadata/.plugins/${plugin.name}/shareddefaults.xml" path. * "${workspace}/.metadata/.plugins/${plugin.name}/shareddefaults.xml" path.
* *
* @param sharedLocation * @param sharedLocation the relative path within the plug-in
* @return sharedXMLFile * @return a File object corresponding to the location within the plug-in
* *
* @since 4.0 * @since 4.0
*/ */
public static File storeSharedDefaultLocation(String sharedLocation) { public static File storeSharedDefaultLocation(String sharedLocation) {
File sharedXMLFile = findLocation(sharedLocation); File sharedXMLFile = findLocation(sharedLocation);
try { try {
createNewFile(sharedXMLFile.getPath()); if(!sharedXMLFile.exists()) {
sharedXMLFile.createNewFile();
}
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); CCorePlugin.log(e);
} }
return sharedXMLFile; return sharedXMLFile;
} }
/**
* This creates a new File, in the Absolute Path given as argument. The File
* name will be part of the path argument.
*
* @param aFileName,
* absoulute File path(including File name) to be created.
*
* @since 4.0
*/
public static void createNewFile(String fileName) throws IOException {
(new File(fileName)).createNewFile();
}
/** /**
* This method returns the workspace path present in the workspace * This method returns the workspace path present in the workspace
* *
@ -146,10 +127,8 @@ public class TemplateEngineHelper {
} }
/** /**
* given a String of the form $(ID), return ID.
*
* @param markerString * @param markerString
* @return * @return the first content of a region matching $(.*) e.g. given a String of the form "foo $(ID) bar", return ID.
* *
* @since 4.0 * @since 4.0
*/ */

View file

@ -70,7 +70,6 @@ public class ConditionalProcessGroup {
/** /**
* Constructs a ConditionalProcess element from the supplied conditionElement (&lt;if&gt;) while building Process * Constructs a ConditionalProcess element from the supplied conditionElement (&lt;if&gt;) while building Process
* objects out of each of the element's &lt;process&gt; children. * objects out of each of the element's &lt;process&gt; children.
* @throws ProcessFailureException
*/ */
public ConditionalProcessGroup(TemplateCore template, Element conditionElement, int id) { public ConditionalProcessGroup(TemplateCore template, Element conditionElement, int id) {
this.id = "Condition " + id; //$NON-NLS-1$ this.id = "Condition " + id; //$NON-NLS-1$
@ -117,7 +116,6 @@ public class ConditionalProcessGroup {
* objects out of each of the supplied process elements (&lt;process&gt;). The condition in this case is evaluated to true. * objects out of each of the supplied process elements (&lt;process&gt;). The condition in this case is evaluated to true.
* *
* This Constructor is expected to be used to evaluate all those process elements that are children of the template root element. * This Constructor is expected to be used to evaluate all those process elements that are children of the template root element.
* @throws ProcessFailureException
*/ */
public ConditionalProcessGroup(TemplateCore template, Element[] processElements) { public ConditionalProcessGroup(TemplateCore template, Element[] processElements) {
id = "No Condition"; //$NON-NLS-1$ id = "No Condition"; //$NON-NLS-1$

View file

@ -143,9 +143,9 @@ public class Process {
} }
/** /**
* Constructor * Executes this process
* @param monitor * @param monitor
* @return * @return the result of executing this process
* @throws ProcessFailureException * @throws ProcessFailureException
*/ */
public IStatus process(IProgressMonitor monitor) throws ProcessFailureException { public IStatus process(IProgressMonitor monitor) throws ProcessFailureException {
@ -175,8 +175,7 @@ public class Process {
} }
/** /**
* Returns the Macros. * @return the macros defined in the context of this process
* @return
*/ */
public Set<String> getMacros() { public Set<String> getMacros() {
Set<String> set = null; Set<String> set = null;

View file

@ -120,7 +120,7 @@ public class ProcessArgument {
} }
/** /**
* Adds the marcos based on the value. * Adds the macros based on the value.
* @param value * @param value
*/ */
private void collectMacros(String value) { private void collectMacros(String value) {
@ -223,8 +223,7 @@ public class ProcessArgument {
} }
/** /**
* Returns true if All macros are Expandable. * @return true if All macros are Expandable.
* @return
*/ */
public boolean areAllMacrosExpandable() { public boolean areAllMacrosExpandable() {
switch (type) { switch (type) {
@ -311,8 +310,7 @@ public class ProcessArgument {
} }
/** /**
* Returns the Macros as Set. * @return the macros defined in the context of this argument
* @return Set, contains the Macros.
*/ */
public Set<String> getMacros() { public Set<String> getMacros() {
return macros; return macros;
@ -371,7 +369,6 @@ public class ProcessArgument {
} }
/* /*
* (non-Javadoc)
* @see java.lang.Object#toString() * @see java.lang.Object#toString()
*/ */
@Override @Override

View file

@ -81,17 +81,15 @@ public class ProcessRunnerFactory {
} }
/** /**
* Process Runners Factory instance. * @return the singleton {@link ProcessRunnerFactory}
* @return
*/ */
public static ProcessRunnerFactory getDefault() { public static ProcessRunnerFactory getDefault() {
return instance; return instance;
} }
/** /**
* Return the ProcessRunner based on the ProcessType.
* @param processType * @param processType
* @return * @return the ProcessRunner based on the ProcessType.
*/ */
public ProcessRunner getProcessRunner(String processType) { public ProcessRunner getProcessRunner(String processType) {
return processRunnerMap.get(processType); return processRunnerMap.get(processType);