dion 2002/07/14 09:21:33
Modified: src/java/org/apache/maven/jelly/tags/project
DirectoryList.java AddPathTag.java
SnapshotSignature.java GoalsToXML.java
Log:
Style violations
Revision Changes Path
1.2 +1 -4
jakarta-turbine-maven/src/java/org/apache/maven/jelly/tags/project/DirectoryList.java
Index: DirectoryList.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/jelly/tags/project/DirectoryList.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DirectoryList.java 3 Jul 2002 21:47:45 -0000 1.1
+++ DirectoryList.java 14 Jul 2002 16:21:32 -0000 1.2
@@ -64,9 +64,6 @@
import org.apache.commons.jelly.TagSupport;
import org.apache.commons.jelly.XMLOutput;
-import org.apache.maven.MavenUtils;
-import org.apache.maven.project.Project;
-
/**
* Maven Jelly tag that creates a POM instance that can be shared/passed around
* in Jelly scripts.
1.2 +15 -11
jakarta-turbine-maven/src/java/org/apache/maven/jelly/tags/project/AddPathTag.java
Index: AddPathTag.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/jelly/tags/project/AddPathTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AddPathTag.java 9 Jul 2002 02:41:43 -0000 1.1
+++ AddPathTag.java 14 Jul 2002 16:21:32 -0000 1.2
@@ -56,8 +56,6 @@
* ====================================================================
*/
-import java.util.Date;
-
import org.apache.maven.app.MavenJellyContext;
import org.apache.commons.jelly.TagSupport;
import org.apache.commons.jelly.XMLOutput;
@@ -66,6 +64,12 @@
import org.apache.tools.ant.Project;
import org.apache.tools.ant.types.Path;
+/**
+ * This class....
+ *
+ * @author Unknown
+ * @version $Id$
+ */
public class AddPathTag
extends TagSupport
{
@@ -80,25 +84,25 @@
public void doTag(XMLOutput output)
throws Exception
{
- System.err.println( "FOO" );
+ System.err.println("FOO");
Project project = getProject();
- System.err.println( "PROJECT " + project );
+ System.err.println("PROJECT " + project);
- if ( project == null )
+ if (project == null)
{
- throw new JellyException( "cannot find ant project" );
+ throw new JellyException("cannot find ant project");
}
- Path path = (Path) project.getReferences().get( getId() );
+ Path path = (Path) project.getReferences().get(getId());
- System.err.println( "PATH ONE(" + getId() + ") : " + path );
+ System.err.println("PATH ONE(" + getId() + ") : " + path);
- Path addPath = (Path) project.getReferences().get( getRefid() );
+ Path addPath = (Path) project.getReferences().get(getRefid());
- System.err.println( "PATH TWO(" + getRefid() + ") : " + addPath );
+ System.err.println("PATH TWO(" + getRefid() + ") : " + addPath);
- path.append( addPath );
+ path.append(addPath);
}
public void setId(String id)
1.2 +7 -7
jakarta-turbine-maven/src/java/org/apache/maven/jelly/tags/project/SnapshotSignature.java
Index: SnapshotSignature.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/jelly/tags/project/SnapshotSignature.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SnapshotSignature.java 8 Jul 2002 13:07:27 -0000 1.1
+++ SnapshotSignature.java 14 Jul 2002 16:21:32 -0000 1.2
@@ -83,7 +83,7 @@
*
* @param project Maven project.
*/
- public void setProject( Project project )
+ public void setProject(Project project)
{
this.project = project;
}
@@ -102,9 +102,9 @@
throws Exception
{
- if ( project == null )
+ if (project == null)
{
- throw new MissingAttributeException( "project" );
+ throw new MissingAttributeException("project");
}
Date now = new Date();
@@ -112,9 +112,9 @@
formatter.setTimeZone(TimeZone.getTimeZone("GMT"));
String buildNumber = formatter.format(now);
- String snapshotSignature = getProject().getId() + "-" +
- getProject().getCurrentVersion() + "." + buildNumber;
+ String snapshotSignature = getProject().getId() + "-"
+ + getProject().getCurrentVersion() + "." + buildNumber;
- context.setVariable( "snapshotSignature", snapshotSignature );
+ context.setVariable("snapshotSignature", snapshotSignature);
}
}
1.4 +34 -23
jakarta-turbine-maven/src/java/org/apache/maven/jelly/tags/project/GoalsToXML.java
Index: GoalsToXML.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/jelly/tags/project/GoalsToXML.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- GoalsToXML.java 9 Jul 2002 11:41:54 -0000 1.3
+++ GoalsToXML.java 14 Jul 2002 16:21:32 -0000 1.4
@@ -123,31 +123,36 @@
throws Exception
{
- if ( file == null ) {
- throw new MissingAttributeException( "file" );
+ if (file == null)
+ {
+ throw new MissingAttributeException("file");
}
- if ( werkzProject == null ) {
- throw new MissingAttributeException( "project" );
+ if (werkzProject == null)
+ {
+ throw new MissingAttributeException("project");
}
- try {
+ try
+ {
File f = new File(file);
- PrintStream ps = new PrintStream( new FileOutputStream(f) );
+ PrintStream ps = new PrintStream(new FileOutputStream(f));
Collection goals = werkzProject.getGoals();
- List list = new ArrayList( goals );
+ List list = new ArrayList(goals);
// sort by name
- Comparator comparator = new Comparator() {
- public int compare(Object o1, Object o2) {
- Goal g1 = (Goal) o1;
- Goal g2 = (Goal) o2;
- return g1.getName().compareTo( g2.getName() );
- }
- };
- Collections.sort( list, comparator );
+ Comparator comparator = new Comparator()
+ {
+ public int compare(Object o1, Object o2)
+ {
+ Goal g1 = (Goal) o1;
+ Goal g2 = (Goal) o2;
+ return g1.getName().compareTo(g2.getName());
+ }
+ };
+ Collections.sort(list, comparator);
Iterator goalIter = list.iterator();
Goal eachGoal = null;
@@ -155,28 +160,32 @@
int id = 0;
ps.print("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n");
- ps.print("<project default=\"" + werkzProject.getDefaultGoalName() +
"\">\n");
+ ps.print("<project default=\"" + werkzProject.getDefaultGoalName()
+ + "\">\n");
while (goalIter.hasNext())
{
eachGoal = (Goal) goalIter.next();
- ps.print(" <goal id=\"" + id + "\" name=\"" + eachGoal.getName() +
"\"\n");
- ps.print(" description=\"" + eachGoal.getDescription() +
"\">\n");
+ ps.print(" <goal id=\"" + id + "\" name=\""
+ + eachGoal.getName() + "\"\n");
+ ps.print(" description=\"" + eachGoal.getDescription()
+ + "\">\n");
Collection prerequisites = eachGoal.getPrerequisites();
- List prereqslist = new ArrayList( prerequisites );
+ List prereqslist = new ArrayList(prerequisites);
// sort by name
Comparator prereqcomparator = new Comparator() {
- public int compare(Object o1, Object o2) {
+ public int compare(Object o1, Object o2)
+ {
Goal g1 = (Goal) o1;
Goal g2 = (Goal) o2;
- return g1.getName().compareTo( g2.getName() );
+ return g1.getName().compareTo(g2.getName());
}
};
- Collections.sort( prereqslist, prereqcomparator );
+ Collections.sort(prereqslist, prereqcomparator);
Iterator prereqIterator = prereqslist.iterator();
@@ -185,7 +194,8 @@
while (prereqIterator.hasNext())
{
prereq = (Goal) prereqIterator.next();
- ps.print(" <prerequisite name=\"" + prereq.getName() +
"\"/>\n");
+ ps.print(" <prerequisite name=\"" + prereq.getName()
+ + "\"/>\n");
}
ps.print(" </goal>\n");
@@ -196,6 +206,7 @@
}
finally
{
+ // FIXME: Why?
}
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>