dion 02/04/22 08:06:34
Modified: src/descriptors SliceProject.java
Log:
Fix some style violations on the way past
Revision Changes Path
1.5 +37 -19 jakarta-turbine-maven/src/descriptors/SliceProject.java
Index: SliceProject.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/descriptors/SliceProject.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- SliceProject.java 18 Apr 2002 13:25:01 -0000 1.4
+++ SliceProject.java 22 Apr 2002 15:06:34 -0000 1.5
@@ -1,4 +1,5 @@
+
/* ====================================================================
* The Apache Software License, Version 1.1
*
@@ -54,44 +55,53 @@
*/
import java.io.File;
-import java.io.FileOutputStream;
import java.io.FileWriter;
/**
* Get rid of duplicated dependencies in the gump descriptors.
+ * @todo Fix the comments above
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
- * @version $Id: SliceProject.java,v 1.4 2002/04/18 13:25:01 jvanzyl Exp $
+ * @version $Id: SliceProject.java,v 1.5 2002/04/22 15:06:34 dion Exp $
*/
public class SliceProject
{
+ /** Create a new SliceProject
+ */
public SliceProject()
{
}
-
+
+ /** @todo what is this method for?
+ * @return the string hello
+ */
public String hello()
{
return "hello";
}
-
+
+ /** Write the provided contents to the provided file
+ * @param file the name of the file
+ * @param contents text for the file
+ */
public void slice(String file, String contents)
{
try
{
- File test = new File("project-phase2");
- String basedir = null;
- if (test.exists())
- {
- basedir = ".";
- }
- else
- {
- basedir = "src/descriptors";
- }
-
- File f = new File(new File(basedir,"project-phase2"), file);
- FileWriter fw = new FileWriter(f);
- fw.write(contents);
- fw.close();
+ File test = new File("project-phase2");
+ String basedir = null;
+ if (test.exists())
+ {
+ basedir = ".";
+ }
+ else
+ {
+ basedir = "src/descriptors";
+ }
+
+ File f = new File(new File(basedir, "project-phase2"), file);
+ FileWriter fw = new FileWriter(f);
+ fw.write(contents);
+ fw.close();
}
catch (Exception e)
{
@@ -99,6 +109,14 @@
}
}
+ /** Replace all occurrences of <code>repl</code> with <code>with</code>
+ * in string <code>text</code>
+ * @param text the text to be searched
+ * @param repl the text to be replaced
+ * @param with the text to replace <code>repl</code>
+ * @return a copy of <code>text</code> in which all occurrences of
+ * <code>repl</code> have been replaced with <code>with</code>
+ */
public static String replace(String text, String repl, String with)
{
int max = -1;