donaldp 01/12/15 16:39:05
Modified: proposal/myrmidon/src/main/org/apache/tools/ant/util
DOMElementWriter.java FileUtils.java
FlatFileNameMapper.java GlobPatternMapper.java
IdentityMapper.java MergingMapper.java
RegexpPatternMapper.java SourceFileScanner.java
StringUtils.java
proposal/myrmidon/src/main/org/apache/tools/ant/util/depend
Dependencies.java Filter.java
proposal/myrmidon/src/main/org/apache/tools/ant/util/regexp
JakartaOroMatcher.java JakartaOroRegexp.java
JakartaRegexpMatcher.java JakartaRegexpRegexp.java
Jdk14RegexpMatcher.java Jdk14RegexpRegexp.java
Regexp.java RegexpFactory.java RegexpMatcher.java
RegexpMatcherFactory.java
Log:
BuildException -> TaskException
Removed uneeded imports.
Processed code through style formatter.
Revision Changes Path
1.2 +64 -63
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/DOMElementWriter.java
Index: DOMElementWriter.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/DOMElementWriter.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DOMElementWriter.java 2001/12/15 12:06:32 1.1
+++ DOMElementWriter.java 2001/12/16 00:39:05 1.2
@@ -6,6 +6,7 @@
* the LICENSE file.
*/
package org.apache.tools.ant.util;
+
import java.io.IOException;
import java.io.Writer;
import org.w3c.dom.Attr;
@@ -81,7 +82,7 @@
String name = ent.substring( 1, ent.length() - 1 );
for( int i = 0; i < knownEntities.length; i++ )
{
- if( name.equals( knownEntities[i] ) )
+ if( name.equals( knownEntities[ i ] ) )
{
return true;
}
@@ -101,35 +102,35 @@
for( int i = 0; i < value.length(); i++ )
{
char c = value.charAt( i );
- switch ( c )
+ switch( c )
{
- case '<':
- sb.append( "<" );
- break;
- case '>':
- sb.append( ">" );
- break;
- case '\'':
- sb.append( "'" );
- break;
- case '\"':
- sb.append( """ );
- break;
- case '&':
- int nextSemi = value.indexOf( ";", i );
- if( nextSemi < 0
- || !isReference( value.substring( i, nextSemi + 1 ) ) )
- {
- sb.append( "&" );
- }
- else
- {
- sb.append( '&' );
- }
- break;
- default:
- sb.append( c );
- break;
+ case '<':
+ sb.append( "<" );
+ break;
+ case '>':
+ sb.append( ">" );
+ break;
+ case '\'':
+ sb.append( "'" );
+ break;
+ case '\"':
+ sb.append( """ );
+ break;
+ case '&':
+ int nextSemi = value.indexOf( ";", i );
+ if( nextSemi < 0
+ || !isReference( value.substring( i, nextSemi + 1 )
) )
+ {
+ sb.append( "&" );
+ }
+ else
+ {
+ sb.append( '&' );
+ }
+ break;
+ default:
+ sb.append( c );
+ break;
}
}
return sb.toString();
@@ -164,7 +165,7 @@
NamedNodeMap attrs = element.getAttributes();
for( int i = 0; i < attrs.getLength(); i++ )
{
- Attr attr = ( Attr )attrs.item( i );
+ Attr attr = (Attr)attrs.item( i );
out.write( " " );
out.write( attr.getName() );
out.write( "=\"" );
@@ -180,41 +181,41 @@
{
Node child = children.item( i );
- switch ( child.getNodeType() )
+ switch( child.getNodeType() )
{
- case Node.ELEMENT_NODE:
- if( !hasChildren )
- {
- out.write( lSep );
- hasChildren = true;
- }
- write( ( Element )child, out, indent + 1, indentWith );
- break;
- case Node.TEXT_NODE:
- out.write( encode( child.getNodeValue() ) );
- break;
- case Node.CDATA_SECTION_NODE:
- out.write( "<![CDATA[" );
- out.write( ( ( Text )child ).getData() );
- out.write( "]]>" );
- break;
- case Node.ENTITY_REFERENCE_NODE:
- out.write( '&' );
- out.write( child.getNodeName() );
- out.write( ';' );
- break;
- case Node.PROCESSING_INSTRUCTION_NODE:
- out.write( "<?" );
- out.write( child.getNodeName() );
- String data = child.getNodeValue();
- if( data != null && data.length() > 0 )
- {
- out.write( ' ' );
- out.write( data );
- }
- out.write( "?>" );
- break;
+ case Node.ELEMENT_NODE:
+ if( !hasChildren )
+ {
+ out.write( lSep );
+ hasChildren = true;
+ }
+ write( (Element)child, out, indent + 1, indentWith );
+ break;
+ case Node.TEXT_NODE:
+ out.write( encode( child.getNodeValue() ) );
+ break;
+ case Node.CDATA_SECTION_NODE:
+ out.write( "<![CDATA[" );
+ out.write( ( (Text)child ).getData() );
+ out.write( "]]>" );
+ break;
+ case Node.ENTITY_REFERENCE_NODE:
+ out.write( '&' );
+ out.write( child.getNodeName() );
+ out.write( ';' );
+ break;
+ case Node.PROCESSING_INSTRUCTION_NODE:
+ out.write( "<?" );
+ out.write( child.getNodeName() );
+ String data = child.getNodeValue();
+ if( data != null && data.length() > 0 )
+ {
+ out.write( ' ' );
+ out.write( data );
+ }
+ out.write( "?>" );
+ break;
}
}
1.3 +2 -2
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/FileUtils.java
Index: FileUtils.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/FileUtils.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- FileUtils.java 2001/12/15 14:56:00 1.2
+++ FileUtils.java 2001/12/16 00:39:05 1.3
@@ -34,7 +34,7 @@
* @author [EMAIL PROTECTED]
* @author <a href="mailto:[EMAIL PROTECTED]">Conor MacNeill</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Stefan Bodewig</a>
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class FileUtils
@@ -65,7 +65,7 @@
*
* @param file The new FileLastModified value
* @param time The new FileLastModified value
- * @exception BuildException Description of Exception
+ * @exception TaskException Description of Exception
*/
public void setFileLastModified( File file, long time )
throws TaskException
1.2 +6 -2
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/FlatFileNameMapper.java
Index: FlatFileNameMapper.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/FlatFileNameMapper.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- FlatFileNameMapper.java 2001/12/15 12:06:32 1.1
+++ FlatFileNameMapper.java 2001/12/16 00:39:05 1.2
@@ -24,14 +24,18 @@
*
* @param from The new From value
*/
- public void setFrom( String from ) { }
+ public void setFrom( String from )
+ {
+ }
/**
* Ignored.
*
* @param to The new To value
*/
- public void setTo( String to ) { }
+ public void setTo( String to )
+ {
+ }
/**
* Returns an one-element array containing the source file name without
any
1.2 +5 -5
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/GlobPatternMapper.java
Index: GlobPatternMapper.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/GlobPatternMapper.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- GlobPatternMapper.java 2001/12/15 12:06:32 1.1
+++ GlobPatternMapper.java 2001/12/16 00:39:05 1.2
@@ -103,14 +103,14 @@
public String[] mapFileName( String sourceFileName )
{
if( fromPrefix == null
- || !sourceFileName.startsWith( fromPrefix )
- || !sourceFileName.endsWith( fromPostfix ) )
+ || !sourceFileName.startsWith( fromPrefix )
+ || !sourceFileName.endsWith( fromPostfix ) )
{
return null;
}
return new String[]{toPrefix
- + extractVariablePart( sourceFileName )
- + toPostfix};
+ + extractVariablePart( sourceFileName )
+ + toPostfix};
}
/**
@@ -123,6 +123,6 @@
protected String extractVariablePart( String name )
{
return name.substring( prefixLength,
- name.length() - postfixLength );
+ name.length() - postfixLength );
}
}
1.2 +6 -2
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/IdentityMapper.java
Index: IdentityMapper.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/IdentityMapper.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- IdentityMapper.java 2001/12/15 12:06:32 1.1
+++ IdentityMapper.java 2001/12/16 00:39:05 1.2
@@ -23,14 +23,18 @@
*
* @param from The new From value
*/
- public void setFrom( String from ) { }
+ public void setFrom( String from )
+ {
+ }
/**
* Ignored.
*
* @param to The new To value
*/
- public void setTo( String to ) { }
+ public void setTo( String to )
+ {
+ }
/**
* Returns an one-element array containing the source file name.
1.2 +3 -1
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/MergingMapper.java
Index: MergingMapper.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/MergingMapper.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- MergingMapper.java 2001/12/15 12:06:32 1.1
+++ MergingMapper.java 2001/12/16 00:39:05 1.2
@@ -24,7 +24,9 @@
*
* @param from The new From value
*/
- public void setFrom( String from ) { }
+ public void setFrom( String from )
+ {
+ }
/**
* Sets the name of the merged file.
1.2 +13 -12
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/RegexpPatternMapper.java
Index: RegexpPatternMapper.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/RegexpPatternMapper.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- RegexpPatternMapper.java 2001/12/15 12:06:32 1.1
+++ RegexpPatternMapper.java 2001/12/16 00:39:05 1.2
@@ -6,8 +6,9 @@
* the LICENSE file.
*/
package org.apache.tools.ant.util;
+
import java.util.Vector;
-import org.apache.tools.ant.BuildException;
+import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.util.regexp.RegexpMatcher;
import org.apache.tools.ant.util.regexp.RegexpMatcherFactory;
@@ -23,7 +24,7 @@
protected StringBuffer result = new StringBuffer();
public RegexpPatternMapper()
- throws BuildException
+ throws TaskException
{
reg = ( new RegexpMatcherFactory() ).newRegexpMatcher();
}
@@ -32,10 +33,10 @@
* Sets the "from" pattern. Required.
*
* @param from The new From value
- * @exception BuildException Description of Exception
+ * @exception TaskException Description of Exception
*/
public void setFrom( String from )
- throws BuildException
+ throws TaskException
{
try
{
@@ -45,8 +46,8 @@
{
// depending on the implementation the actual RE won't
// get instantiated in the constructor.
- throw new BuildException( "Cannot load regular expression
matcher",
- e );
+ throw new TaskException( "Cannot load regular expression
matcher",
+ e );
}
}
@@ -70,7 +71,7 @@
public String[] mapFileName( String sourceFileName )
{
if( reg == null || to == null
- || !reg.matches( sourceFileName ) )
+ || !reg.matches( sourceFileName ) )
{
return null;
}
@@ -91,18 +92,18 @@
result.setLength( 0 );
for( int i = 0; i < to.length; i++ )
{
- if( to[i] == '\\' )
+ if( to[ i ] == '\\' )
{
if( ++i < to.length )
{
- int value = Character.digit( to[i], 10 );
+ int value = Character.digit( to[ i ], 10 );
if( value > -1 )
{
- result.append( ( String )v.elementAt( value ) );
+ result.append( (String)v.elementAt( value ) );
}
else
{
- result.append( to[i] );
+ result.append( to[ i ] );
}
}
else
@@ -113,7 +114,7 @@
}
else
{
- result.append( to[i] );
+ result.append( to[ i ] );
}
}
return result.toString();
1.2 +21 -20
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/SourceFileScanner.java
Index: SourceFileScanner.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/SourceFileScanner.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SourceFileScanner.java 2001/12/15 12:06:32 1.1
+++ SourceFileScanner.java 2001/12/16 00:39:05 1.2
@@ -6,11 +6,12 @@
* the LICENSE file.
*/
package org.apache.tools.ant.util;
+
import java.io.File;
import java.util.Vector;
+import org.apache.myrmidon.framework.Os;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
-import org.apache.myrmidon.framework.Os;
/**
* Utility class that collects the functionality of the various scanDir
methods
@@ -74,40 +75,40 @@
for( int i = 0; i < files.length; i++ )
{
- String[] targets = mapper.mapFileName( files[i] );
+ String[] targets = mapper.mapFileName( files[ i ] );
if( targets == null || targets.length == 0 )
{
- task.log( files[i] + " skipped - don\'t know how to handle
it",
- Project.MSG_VERBOSE );
+ task.log( files[ i ] + " skipped - don\'t know how to handle
it",
+ Project.MSG_VERBOSE );
continue;
}
- File src = fileUtils.resolveFile( srcDir, files[i] );
+ File src = fileUtils.resolveFile( srcDir, files[ i ] );
if( src.lastModified() > now )
{
- task.log( "Warning: " + files[i] + " modified in the
future.",
- Project.MSG_WARN );
+ task.log( "Warning: " + files[ i ] + " modified in the
future.",
+ Project.MSG_WARN );
}
boolean added = false;
targetList.setLength( 0 );
for( int j = 0; !added && j < targets.length; j++ )
{
- File dest = fileUtils.resolveFile( destDir, targets[j] );
+ File dest = fileUtils.resolveFile( destDir, targets[ j ] );
if( !dest.exists() )
{
- task.log( files[i] + " added as " +
dest.getAbsolutePath() + " doesn\'t exist.",
- Project.MSG_VERBOSE );
- v.addElement( files[i] );
+ task.log( files[ i ] + " added as " +
dest.getAbsolutePath() + " doesn\'t exist.",
+ Project.MSG_VERBOSE );
+ v.addElement( files[ i ] );
added = true;
}
else if( src.lastModified() > dest.lastModified() )
{
- task.log( files[i] + " added as " +
dest.getAbsolutePath() + " is outdated.",
- Project.MSG_VERBOSE );
- v.addElement( files[i] );
+ task.log( files[ i ] + " added as " +
dest.getAbsolutePath() + " is outdated.",
+ Project.MSG_VERBOSE );
+ v.addElement( files[ i ] );
added = true;
}
else
@@ -122,13 +123,13 @@
if( !added )
{
- task.log( files[i] + " omitted as " + targetList.toString()
- + ( targets.length == 1 ? " is" : " are " )
- + " up to date.", Project.MSG_VERBOSE );
+ task.log( files[ i ] + " omitted as " + targetList.toString()
+ + ( targets.length == 1 ? " is" : " are " )
+ + " up to date.", Project.MSG_VERBOSE );
}
}
- String[] result = new String[v.size()];
+ String[] result = new String[ v.size() ];
v.copyInto( result );
return result;
}
@@ -147,10 +148,10 @@
FileNameMapper mapper )
{
String[] res = restrict( files, srcDir, destDir, mapper );
- File[] result = new File[res.length];
+ File[] result = new File[ res.length ];
for( int i = 0; i < res.length; i++ )
{
- result[i] = new File( srcDir, res[i] );
+ result[ i ] = new File( srcDir, res[ i ] );
}
return result;
}
1.2 +1 -0
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/StringUtils.java
Index: StringUtils.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/StringUtils.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- StringUtils.java 2001/12/15 12:06:32 1.1
+++ StringUtils.java 2001/12/16 00:39:05 1.2
@@ -6,6 +6,7 @@
* the LICENSE file.
*/
package org.apache.tools.ant.util;
+
import java.io.PrintWriter;
import java.io.StringWriter;
1.2 +102 -45
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/depend/Dependencies.java
Index: Dependencies.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/depend/Dependencies.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Dependencies.java 2001/12/15 12:06:32 1.1
+++ Dependencies.java 2001/12/16 00:39:05 1.2
@@ -6,12 +6,17 @@
* the LICENSE file.
*/
package org.apache.tools.ant.util.depend;
-import java.io.*;
-import java.util.*;
+
+import java.io.File;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.StringTokenizer;
+import java.util.TreeSet;
import org.apache.bcel.*;
import org.apache.bcel.classfile.*;
-
public class Dependencies implements Visitor
{
private boolean verbose = false;
@@ -44,9 +49,9 @@
int o = 0;
String arg = null;
- if( "-base".equals( args[0] ) )
+ if( "-base".equals( args[ 0 ] ) )
{
- arg = args[1];
+ arg = args[ 1 ];
if( !arg.endsWith( File.separator ) )
{
arg = arg + File.separator;
@@ -57,7 +62,7 @@
for( int i = o; i < args.length; i++ )
{
- String fileName = args[i].substring( 0, args[i].length() -
".class".length() );
+ String fileName = args[ i ].substring( 0, args[ i ].length()
- ".class".length() );
if( base != null && fileName.startsWith( base ) )
fileName = fileName.substring( base.length() );
newSet.add( fileName );
@@ -84,19 +89,19 @@
visitor.clearDependencies();
applyFilter( newSet,
- new Filter()
- {
- public boolean accept( Object object )
- {
- String fileName = object + ".class";
- if( base != null )
- fileName = base + fileName;
- return new File( fileName ).exists();
- }
- } );
+ new Filter()
+ {
+ public boolean accept( Object object )
+ {
+ String fileName = object + ".class";
+ if( base != null )
+ fileName = base + fileName;
+ return new File( fileName ).exists();
+ }
+ } );
newSet.removeAll( set );
set.addAll( newSet );
- }while ( newSet.size() > 0 );
+ } while( newSet.size() > 0 );
Iterator i = set.iterator();
while( i.hasNext() )
@@ -121,9 +126,13 @@
dependencies.clear();
}
- public void visitCode( Code obj ) { }
+ public void visitCode( Code obj )
+ {
+ }
- public void visitCodeException( CodeException obj ) { }
+ public void visitCodeException( CodeException obj )
+ {
+ }
public void visitConstantClass( ConstantClass obj )
{
@@ -135,21 +144,37 @@
dependencies.add( "" + obj.getConstantValue( constantPool ) );
}
- public void visitConstantDouble( ConstantDouble obj ) { }
+ public void visitConstantDouble( ConstantDouble obj )
+ {
+ }
- public void visitConstantFieldref( ConstantFieldref obj ) { }
+ public void visitConstantFieldref( ConstantFieldref obj )
+ {
+ }
- public void visitConstantFloat( ConstantFloat obj ) { }
+ public void visitConstantFloat( ConstantFloat obj )
+ {
+ }
- public void visitConstantInteger( ConstantInteger obj ) { }
+ public void visitConstantInteger( ConstantInteger obj )
+ {
+ }
- public void visitConstantInterfaceMethodref( ConstantInterfaceMethodref
obj ) { }
+ public void visitConstantInterfaceMethodref( ConstantInterfaceMethodref
obj )
+ {
+ }
- public void visitConstantLong( ConstantLong obj ) { }
+ public void visitConstantLong( ConstantLong obj )
+ {
+ }
- public void visitConstantMethodref( ConstantMethodref obj ) { }
+ public void visitConstantMethodref( ConstantMethodref obj )
+ {
+ }
- public void visitConstantNameAndType( ConstantNameAndType obj ) { }
+ public void visitConstantNameAndType( ConstantNameAndType obj )
+ {
+ }
public void visitConstantPool( ConstantPool obj )
{
@@ -168,15 +193,25 @@
}
}
- public void visitConstantString( ConstantString obj ) { }
+ public void visitConstantString( ConstantString obj )
+ {
+ }
- public void visitConstantUtf8( ConstantUtf8 obj ) { }
+ public void visitConstantUtf8( ConstantUtf8 obj )
+ {
+ }
- public void visitConstantValue( ConstantValue obj ) { }
+ public void visitConstantValue( ConstantValue obj )
+ {
+ }
- public void visitDeprecated( Deprecated obj ) { }
+ public void visitDeprecated( Deprecated obj )
+ {
+ }
- public void visitExceptionTable( ExceptionTable obj ) { }
+ public void visitExceptionTable( ExceptionTable obj )
+ {
+ }
public void visitField( Field obj )
{
@@ -188,9 +223,13 @@
addClasses( obj.getSignature() );
}
- public void visitInnerClass( InnerClass obj ) { }
+ public void visitInnerClass( InnerClass obj )
+ {
+ }
- public void visitInnerClasses( InnerClasses obj ) { }
+ public void visitInnerClasses( InnerClasses obj )
+ {
+ }
public void visitJavaClass( JavaClass obj )
{
@@ -209,24 +248,32 @@
Field[] fields = obj.getFields();
for( int i = 0; i < fields.length; i++ )
{
- fields[i].accept( this );
+ fields[ i ].accept( this );
}
// visit methods
Method[] methods = obj.getMethods();
for( int i = 0; i < methods.length; i++ )
{
- methods[i].accept( this );
+ methods[ i ].accept( this );
}
}
- public void visitLineNumber( LineNumber obj ) { }
+ public void visitLineNumber( LineNumber obj )
+ {
+ }
- public void visitLineNumberTable( LineNumberTable obj ) { }
+ public void visitLineNumberTable( LineNumberTable obj )
+ {
+ }
- public void visitLocalVariable( LocalVariable obj ) { }
+ public void visitLocalVariable( LocalVariable obj )
+ {
+ }
- public void visitLocalVariableTable( LocalVariableTable obj ) { }
+ public void visitLocalVariableTable( LocalVariableTable obj )
+ {
+ }
public void visitMethod( Method obj )
{
@@ -241,15 +288,25 @@
addClasses( signature.substring( pos + 1 ) );
}
- public void visitSourceFile( SourceFile obj ) { }
+ public void visitSourceFile( SourceFile obj )
+ {
+ }
- public void visitStackMap( StackMap obj ) { }
+ public void visitStackMap( StackMap obj )
+ {
+ }
- public void visitStackMapEntry( StackMapEntry obj ) { }
+ public void visitStackMapEntry( StackMapEntry obj )
+ {
+ }
- public void visitSynthetic( Synthetic obj ) { }
+ public void visitSynthetic( Synthetic obj )
+ {
+ }
- public void visitUnknown( Unknown obj ) { }
+ public void visitUnknown( Unknown obj )
+ {
+ }
void addClass( String string )
{
1.2 +0 -1
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/depend/Filter.java
Index: Filter.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/depend/Filter.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Filter.java 2001/12/15 12:06:32 1.1
+++ Filter.java 2001/12/16 00:39:05 1.2
@@ -6,7 +6,6 @@
* the LICENSE file.
*/
package org.apache.tools.ant.util.depend;
-import java.util.*;
public interface Filter
{
1.3 +16 -13
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/regexp/JakartaOroMatcher.java
Index: JakartaOroMatcher.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/regexp/JakartaOroMatcher.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- JakartaOroMatcher.java 2001/12/15 14:56:00 1.2
+++ JakartaOroMatcher.java 2001/12/16 00:39:05 1.3
@@ -6,12 +6,13 @@
* the LICENSE file.
*/
package org.apache.tools.ant.util.regexp;
+
import java.util.Vector;
+import org.apache.myrmidon.api.TaskException;
import org.apache.oro.text.regex.MatchResult;
import org.apache.oro.text.regex.Pattern;
import org.apache.oro.text.regex.Perl5Compiler;
import org.apache.oro.text.regex.Perl5Matcher;
-import org.apache.tools.ant.BuildException;
/**
* Implementation of RegexpMatcher for Jakarta-ORO.
@@ -26,7 +27,9 @@
private String pattern;
- public JakartaOroMatcher() { }
+ public JakartaOroMatcher()
+ {
+ }
/**
* Set the regexp pattern from the String description.
@@ -46,10 +49,10 @@
*
* @param argument Description of Parameter
* @return The Groups value
- * @exception BuildException Description of Exception
+ * @exception TaskException Description of Exception
*/
public Vector getGroups( String argument )
- throws BuildException
+ throws TaskException
{
return getGroups( argument, MATCH_DEFAULT );
}
@@ -63,10 +66,10 @@
* @param input Description of Parameter
* @param options Description of Parameter
* @return The Groups value
- * @exception BuildException Description of Exception
+ * @exception TaskException Description of Exception
*/
public Vector getGroups( String input, int options )
- throws BuildException
+ throws TaskException
{
if( !matches( input, options ) )
{
@@ -97,10 +100,10 @@
*
* @param argument Description of Parameter
* @return Description of the Returned Value
- * @exception BuildException Description of Exception
+ * @exception TaskException Description of Exception
*/
public boolean matches( String argument )
- throws BuildException
+ throws TaskException
{
return matches( argument, MATCH_DEFAULT );
}
@@ -111,10 +114,10 @@
* @param input Description of Parameter
* @param options Description of Parameter
* @return Description of the Returned Value
- * @exception BuildException Description of Exception
+ * @exception TaskException Description of Exception
*/
public boolean matches( String input, int options )
- throws BuildException
+ throws TaskException
{
Pattern p = getCompiledPattern( options );
return matcher.contains( input, p );
@@ -125,10 +128,10 @@
*
* @param options Description of Parameter
* @return The CompiledPattern value
- * @exception BuildException Description of Exception
+ * @exception TaskException Description of Exception
*/
protected Pattern getCompiledPattern( int options )
- throws BuildException
+ throws TaskException
{
try
{
@@ -138,7 +141,7 @@
}
catch( Exception e )
{
- throw new BuildException( "Error", e );
+ throw new TaskException( "Error", e );
}
}
1.2 +8 -8
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/regexp/JakartaOroRegexp.java
Index: JakartaOroRegexp.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/regexp/JakartaOroRegexp.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- JakartaOroRegexp.java 2001/12/15 12:06:32 1.1
+++ JakartaOroRegexp.java 2001/12/16 00:39:05 1.2
@@ -6,11 +6,11 @@
* the LICENSE file.
*/
package org.apache.tools.ant.util.regexp;
+
+import org.apache.myrmidon.api.TaskException;
import org.apache.oro.text.regex.Perl5Substitution;
import org.apache.oro.text.regex.Substitution;
import org.apache.oro.text.regex.Util;
-import org.apache.tools.ant.BuildException;
-
/**
* Regular expression implementation using the Jakarta Oro package
@@ -27,7 +27,7 @@
}
public String substitute( String input, String argument, int options )
- throws BuildException
+ throws TaskException
{
// translate \1 to $1 so that the Perl5Substitution will work
StringBuffer subst = new StringBuffer();
@@ -64,12 +64,12 @@
// Do the substitution
Substitution s =
new Perl5Substitution( subst.toString(),
- Perl5Substitution.INTERPOLATE_ALL );
+ Perl5Substitution.INTERPOLATE_ALL );
return Util.substitute( matcher,
- getCompiledPattern( options ),
- s,
- input,
- getSubsOptions( options ) );
+ getCompiledPattern( options ),
+ s,
+ input,
+ getSubsOptions( options ) );
}
protected int getSubsOptions( int options )
1.2 +11 -10
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/regexp/JakartaRegexpMatcher.java
Index: JakartaRegexpMatcher.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/regexp/JakartaRegexpMatcher.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- JakartaRegexpMatcher.java 2001/12/15 12:06:32 1.1
+++ JakartaRegexpMatcher.java 2001/12/16 00:39:05 1.2
@@ -6,10 +6,11 @@
* the LICENSE file.
*/
package org.apache.tools.ant.util.regexp;
+
import java.util.Vector;
+import org.apache.myrmidon.api.TaskException;
import org.apache.regexp.RE;
import org.apache.regexp.RESyntaxException;
-import org.apache.tools.ant.BuildException;
/**
* Implementation of RegexpMatcher for Jakarta-Regexp.
@@ -41,16 +42,16 @@
*
* @param argument Description of Parameter
* @return The Groups value
- * @exception BuildException Description of Exception
+ * @exception TaskException Description of Exception
*/
public Vector getGroups( String argument )
- throws BuildException
+ throws TaskException
{
return getGroups( argument, MATCH_DEFAULT );
}
public Vector getGroups( String input, int options )
- throws BuildException
+ throws TaskException
{
RE reg = getCompiledPattern( options );
if( !matches( input, reg ) )
@@ -81,10 +82,10 @@
*
* @param argument Description of Parameter
* @return Description of the Returned Value
- * @exception BuildException Description of Exception
+ * @exception TaskException Description of Exception
*/
public boolean matches( String argument )
- throws BuildException
+ throws TaskException
{
return matches( argument, MATCH_DEFAULT );
}
@@ -95,16 +96,16 @@
* @param input Description of Parameter
* @param options Description of Parameter
* @return Description of the Returned Value
- * @exception BuildException Description of Exception
+ * @exception TaskException Description of Exception
*/
public boolean matches( String input, int options )
- throws BuildException
+ throws TaskException
{
return matches( input, getCompiledPattern( options ) );
}
protected RE getCompiledPattern( int options )
- throws BuildException
+ throws TaskException
{
int cOptions = getCompilerOptions( options );
try
@@ -115,7 +116,7 @@
}
catch( RESyntaxException e )
{
- throw new BuildException( e );
+ throw new TaskException( e );
}
}
1.2 +4 -3
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/regexp/JakartaRegexpRegexp.java
Index: JakartaRegexpRegexp.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/regexp/JakartaRegexpRegexp.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- JakartaRegexpRegexp.java 2001/12/15 12:06:32 1.1
+++ JakartaRegexpRegexp.java 2001/12/16 00:39:05 1.2
@@ -6,9 +6,10 @@
* the LICENSE file.
*/
package org.apache.tools.ant.util.regexp;
+
import java.util.Vector;
+import org.apache.myrmidon.api.TaskException;
import org.apache.regexp.RE;
-import org.apache.tools.ant.BuildException;
/**
* Regular expression implementation using the Jakarta Regexp package
@@ -25,7 +26,7 @@
}
public String substitute( String input, String argument, int options )
- throws BuildException
+ throws TaskException
{
Vector v = getGroups( input, options );
@@ -42,7 +43,7 @@
int value = Character.digit( c, 10 );
if( value > -1 )
{
- result.append( ( String )v.elementAt( value ) );
+ result.append( (String)v.elementAt( value ) );
}
else
{
1.3 +16 -13
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/regexp/Jdk14RegexpMatcher.java
Index: Jdk14RegexpMatcher.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/regexp/Jdk14RegexpMatcher.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Jdk14RegexpMatcher.java 2001/12/15 14:56:00 1.2
+++ Jdk14RegexpMatcher.java 2001/12/16 00:39:05 1.3
@@ -6,11 +6,12 @@
* the LICENSE file.
*/
package org.apache.tools.ant.util.regexp;
+
import java.util.Vector;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
-import org.apache.tools.ant.BuildException;
+import org.apache.myrmidon.api.TaskException;
/**
* Implementation of RegexpMatcher for the built-in regexp matcher of JDK
1.4.
@@ -24,7 +25,9 @@
private String pattern;
- public Jdk14RegexpMatcher() { }
+ public Jdk14RegexpMatcher()
+ {
+ }
/**
* Set the regexp pattern from the String description.
@@ -44,10 +47,10 @@
*
* @param argument Description of Parameter
* @return The Groups value
- * @exception BuildException Description of Exception
+ * @exception TaskException Description of Exception
*/
public Vector getGroups( String argument )
- throws BuildException
+ throws TaskException
{
return getGroups( argument, MATCH_DEFAULT );
}
@@ -61,10 +64,10 @@
* @param input Description of Parameter
* @param options Description of Parameter
* @return The Groups value
- * @exception BuildException Description of Exception
+ * @exception TaskException Description of Exception
*/
public Vector getGroups( String input, int options )
- throws BuildException
+ throws TaskException
{
Pattern p = getCompiledPattern( options );
Matcher matcher = p.matcher( input );
@@ -96,10 +99,10 @@
*
* @param argument Description of Parameter
* @return Description of the Returned Value
- * @exception BuildException Description of Exception
+ * @exception TaskException Description of Exception
*/
public boolean matches( String argument )
- throws BuildException
+ throws TaskException
{
return matches( argument, MATCH_DEFAULT );
}
@@ -110,10 +113,10 @@
* @param input Description of Parameter
* @param options Description of Parameter
* @return Description of the Returned Value
- * @exception BuildException Description of Exception
+ * @exception TaskException Description of Exception
*/
public boolean matches( String input, int options )
- throws BuildException
+ throws TaskException
{
try
{
@@ -122,12 +125,12 @@
}
catch( Exception e )
{
- throw new BuildException( "Error", e );
+ throw new TaskException( "Error", e );
}
}
protected Pattern getCompiledPattern( int options )
- throws BuildException
+ throws TaskException
{
int cOptions = getCompilerOptions( options );
try
@@ -137,7 +140,7 @@
}
catch( PatternSyntaxException e )
{
- throw new BuildException( e );
+ throw new TaskException( e );
}
}
1.2 +3 -3
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/regexp/Jdk14RegexpRegexp.java
Index: Jdk14RegexpRegexp.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/regexp/Jdk14RegexpRegexp.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Jdk14RegexpRegexp.java 2001/12/15 12:06:32 1.1
+++ Jdk14RegexpRegexp.java 2001/12/16 00:39:05 1.2
@@ -6,10 +6,10 @@
* the LICENSE file.
*/
package org.apache.tools.ant.util.regexp;
+
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import org.apache.tools.ant.BuildException;
-
+import org.apache.myrmidon.api.TaskException;
/**
* Regular expression implementation using the JDK 1.4 regular expression
@@ -27,7 +27,7 @@
}
public String substitute( String input, String argument, int options )
- throws BuildException
+ throws TaskException
{
// translate \1 to $(1) so that the Matcher will work
StringBuffer subst = new StringBuffer();
1.2 +4 -3
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/regexp/Regexp.java
Index: Regexp.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/regexp/Regexp.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Regexp.java 2001/12/15 12:06:32 1.1
+++ Regexp.java 2001/12/16 00:39:05 1.2
@@ -6,8 +6,9 @@
* the LICENSE file.
*/
package org.apache.tools.ant.util.regexp;
-import org.apache.tools.ant.BuildException;
+import org.apache.myrmidon.api.TaskException;
+
/**
* Interface which represents a regular expression, and the operations that
can
* be performed on it.
@@ -35,8 +36,8 @@
* @param options The list of options for the match and replace. See the
* MATCH_ and REPLACE_ constants above.
* @return Description of the Returned Value
- * @exception BuildException Description of Exception
+ * @exception TaskException Description of Exception
*/
String substitute( String input, String argument, int options )
- throws BuildException;
+ throws TaskException;
}
1.2 +26 -20
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/regexp/RegexpFactory.java
Index: RegexpFactory.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/regexp/RegexpFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- RegexpFactory.java 2001/12/15 12:06:32 1.1
+++ RegexpFactory.java 2001/12/16 00:39:05 1.2
@@ -6,7 +6,8 @@
* the LICENSE file.
*/
package org.apache.tools.ant.util.regexp;
-import org.apache.tools.ant.BuildException;
+
+import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
/**
@@ -16,22 +17,24 @@
*
* @author Matthew Inger <a href="mailto:[EMAIL PROTECTED]">
* [EMAIL PROTECTED]</a>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class RegexpFactory extends RegexpMatcherFactory
{
- public RegexpFactory() { }
+ public RegexpFactory()
+ {
+ }
/**
* Create a new regular expression matcher instance.
*
* @return Description of the Returned Value
- * @exception BuildException Description of Exception
+ * @exception TaskException Description of Exception
*/
public Regexp newRegexp()
- throws BuildException
+ throws TaskException
{
- return ( Regexp )newRegexp( null );
+ return (Regexp)newRegexp( null );
}
/**
@@ -39,10 +42,10 @@
*
* @param p Project whose ant.regexp.regexpimpl property will be used.
* @return Description of the Returned Value
- * @exception BuildException Description of Exception
+ * @exception TaskException Description of Exception
*/
public Regexp newRegexp( Project p )
- throws BuildException
+ throws TaskException
{
String systemDefault = null;
if( p == null )
@@ -51,7 +54,7 @@
}
else
{
- systemDefault = ( String )p.getProperties().get(
"ant.regexp.regexpimpl" );
+ systemDefault = (String)p.getProperties().get(
"ant.regexp.regexpimpl" );
}
if( systemDefault != null )
@@ -64,25 +67,28 @@
try
{
return createRegexpInstance(
"org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp" );
+ }
+ catch( TaskException be )
+ {
}
- catch( BuildException be )
- {}
try
{
return createRegexpInstance(
"org.apache.tools.ant.util.regexp.JakartaOroRegexp" );
}
- catch( BuildException be )
- {}
+ catch( TaskException be )
+ {
+ }
try
{
return createRegexpInstance(
"org.apache.tools.ant.util.regexp.JakartaRegexpRegexp" );
+ }
+ catch( TaskException be )
+ {
}
- catch( BuildException be )
- {}
- throw new BuildException( "No supported regular expression matcher
found" );
+ throw new TaskException( "No supported regular expression matcher
found" );
}
/**
@@ -91,21 +97,21 @@
*
* @param classname Description of Parameter
* @return Description of the Returned Value
- * @exception BuildException Description of Exception
+ * @exception TaskException Description of Exception
* @since 1.3
*/
protected Regexp createRegexpInstance( String classname )
- throws BuildException
+ throws TaskException
{
RegexpMatcher m = createInstance( classname );
if( m instanceof Regexp )
{
- return ( Regexp )m;
+ return (Regexp)m;
}
else
{
- throw new BuildException( classname + " doesn't implement the
Regexp interface" );
+ throw new TaskException( classname + " doesn't implement the
Regexp interface" );
}
}
1.2 +14 -14
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/regexp/RegexpMatcher.java
Index: RegexpMatcher.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/regexp/RegexpMatcher.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- RegexpMatcher.java 2001/12/15 12:06:32 1.1
+++ RegexpMatcher.java 2001/12/16 00:39:05 1.2
@@ -6,8 +6,9 @@
* the LICENSE file.
*/
package org.apache.tools.ant.util.regexp;
+
import java.util.Vector;
-import org.apache.tools.ant.BuildException;
+import org.apache.myrmidon.api.TaskException;
/**
* Interface describing a regular expression matcher.
@@ -39,34 +40,33 @@
*/
int MATCH_SINGLELINE = 0x00010000;
-
/**
* Set the regexp pattern from the String description.
*
* @param pattern The new Pattern value
- * @exception BuildException Description of Exception
+ * @exception TaskException Description of Exception
*/
void setPattern( String pattern )
- throws BuildException;
+ throws TaskException;
/**
* Get a String representation of the regexp pattern
*
* @return The Pattern value
- * @exception BuildException Description of Exception
+ * @exception TaskException Description of Exception
*/
String getPattern()
- throws BuildException;
+ throws TaskException;
/**
* Does the given argument match the pattern?
*
* @param argument Description of Parameter
* @return Description of the Returned Value
- * @exception BuildException Description of Exception
+ * @exception TaskException Description of Exception
*/
boolean matches( String argument )
- throws BuildException;
+ throws TaskException;
/**
* Returns a Vector of matched groups found in the argument. <p>
@@ -76,10 +76,10 @@
*
* @param argument Description of Parameter
* @return The Groups value
- * @exception BuildException Description of Exception
+ * @exception TaskException Description of Exception
*/
Vector getGroups( String argument )
- throws BuildException;
+ throws TaskException;
/**
* Does this regular expression match the input, given certain options
@@ -88,10 +88,10 @@
* @param options The list of options for the match. See the MATCH_
* constants above.
* @return Description of the Returned Value
- * @exception BuildException Description of Exception
+ * @exception TaskException Description of Exception
*/
boolean matches( String input, int options )
- throws BuildException;
+ throws TaskException;
/**
* Get the match groups from this regular expression. The return type of
the
@@ -101,9 +101,9 @@
* @param options The list of options for the match. See the MATCH_
* constants above.
* @return The Groups value
- * @exception BuildException Description of Exception
+ * @exception TaskException Description of Exception
*/
Vector getGroups( String input, int options )
- throws BuildException;
+ throws TaskException;
}
1.3 +23 -17
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/regexp/RegexpMatcherFactory.java
Index: RegexpMatcherFactory.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/regexp/RegexpMatcherFactory.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- RegexpMatcherFactory.java 2001/12/15 14:56:00 1.2
+++ RegexpMatcherFactory.java 2001/12/16 00:39:05 1.3
@@ -6,7 +6,8 @@
* the LICENSE file.
*/
package org.apache.tools.ant.util.regexp;
-import org.apache.tools.ant.BuildException;
+
+import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
/**
@@ -22,16 +23,18 @@
public class RegexpMatcherFactory
{
- public RegexpMatcherFactory() { }
+ public RegexpMatcherFactory()
+ {
+ }
/**
* Create a new regular expression instance.
*
* @return Description of the Returned Value
- * @exception BuildException Description of Exception
+ * @exception TaskException Description of Exception
*/
public RegexpMatcher newRegexpMatcher()
- throws BuildException
+ throws TaskException
{
return newRegexpMatcher( null );
}
@@ -41,10 +44,10 @@
*
* @param p Project whose ant.regexp.regexpimpl property will be used.
* @return Description of the Returned Value
- * @exception BuildException Description of Exception
+ * @exception TaskException Description of Exception
*/
public RegexpMatcher newRegexpMatcher( Project p )
- throws BuildException
+ throws TaskException
{
String systemDefault = null;
if( p == null )
@@ -53,7 +56,7 @@
}
else
{
- systemDefault = ( String )p.getProperties().get(
"ant.regexp.regexpimpl" );
+ systemDefault = (String)p.getProperties().get(
"ant.regexp.regexpimpl" );
}
if( systemDefault != null )
@@ -66,38 +69,41 @@
try
{
return createInstance(
"org.apache.tools.ant.util.regexp.Jdk14RegexpMatcher" );
+ }
+ catch( TaskException be )
+ {
}
- catch( BuildException be )
- {}
try
{
return createInstance(
"org.apache.tools.ant.util.regexp.JakartaOroMatcher" );
}
- catch( BuildException be )
- {}
+ catch( TaskException be )
+ {
+ }
try
{
return createInstance(
"org.apache.tools.ant.util.regexp.JakartaRegexpMatcher" );
+ }
+ catch( TaskException be )
+ {
}
- catch( BuildException be )
- {}
- throw new BuildException( "No supported regular expression matcher
found" );
+ throw new TaskException( "No supported regular expression matcher
found" );
}
protected RegexpMatcher createInstance( String className )
- throws BuildException
+ throws TaskException
{
try
{
Class implClass = Class.forName( className );
- return ( RegexpMatcher )implClass.newInstance();
+ return (RegexpMatcher)implClass.newInstance();
}
catch( Throwable t )
{
- throw new BuildException( "Error", t );
+ throw new TaskException( "Error", t );
}
}
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>