bodewig 02/05/27 08:15:36
Modified: src/main/org/apache/tools/ant/taskdefs Tag: ANT_15_BRANCH
Definer.java
Log:
Cosmetics.
Only real change is that I made REUSE_LOADER_REFS private.
Revision Changes Path
No revision
No revision
1.15.2.3 +22 -19
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Definer.java
Index: Definer.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Definer.java,v
retrieving revision 1.15.2.2
retrieving revision 1.15.2.3
diff -u -r1.15.2.2 -r1.15.2.3
--- Definer.java 26 May 2002 07:16:11 -0000 1.15.2.2
+++ Definer.java 27 May 2002 15:15:36 -0000 1.15.2.3
@@ -84,8 +84,10 @@
private File file;
private String resource;
private boolean reverseLoader = false;
- private String loaderId=null;
- private String classpathId=null;
+ private String loaderId = null;
+ private String classpathId = null;
+
+ private static final String REUSE_LOADER_REF = "ant.reuse.loader";
public void setReverseLoader(boolean reverseLoader) {
this.reverseLoader = reverseLoader;
@@ -119,15 +121,16 @@
}
/**
- * Use the reference to locate the loader. If the loader is not found,
taskdef will
- * use the specified classpath and register it with the specified name.
+ * Use the reference to locate the loader. If the loader is not
+ * found, taskdef will use the specified classpath and register it
+ * with the specified name.
*
* This allow multiple taskdef/typedef to use the same class loader,
* so they can be used togheter. It eliminate the need to
* put them in the CLASSPATH.
*/
- public void setLoaderRef( Reference r ) {
- loaderId=r.getRefId();
+ public void setLoaderRef(Reference r) {
+ loaderId = r.getRefId();
}
@@ -221,25 +224,23 @@
}
}
- static final String REUSE_LOADER_REF="ant.reuse.loader";
-
private AntClassLoader createLoader() {
// magic property
- if( project.getProperty( REUSE_LOADER_REF ) != null ) {
+ if (project.getProperty(REUSE_LOADER_REF) != null) {
// Generate the 'reuse' name automatically from the reference.
// This allows <taskdefs> that work on both ant1.4 and ant1.5.
// ( in 1.4 it'll require the task/type to be in classpath if
they
// are used togheter ).
- if( loaderId==null && classpathId !=null ) {
- loaderId="ant.loader." + classpathId;
+ if (loaderId == null && classpathId != null) {
+ loaderId = "ant.loader." + classpathId;
}
}
// If a loader has been set ( either by loaderRef or magic property )
- if( loaderId != null ) {
- Object reusedLoader=project.getReference( loaderId );
- if( reusedLoader != null ) {
- if( reusedLoader instanceof AntClassLoader ) {
+ if (loaderId != null) {
+ Object reusedLoader = project.getReference(loaderId);
+ if (reusedLoader != null) {
+ if(reusedLoader instanceof AntClassLoader) {
return (AntClassLoader)reusedLoader;
}
// In future the reference object may be the <loader> type
@@ -262,10 +263,12 @@
al.addSystemPackageRoot("org.apache.tools.ant");
- // If the loader is new, record it for future uses by other
task/typedefs
- if( loaderId != null ) {
- if( project.getReference( loaderId ) == null )
- project.addReference( loaderId, al );
+ // If the loader is new, record it for future uses by other
+ // task/typedefs
+ if (loaderId != null) {
+ if (project.getReference(loaderId) == null) {
+ project.addReference(loaderId, al);
+ }
}
return al;
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>