From 23465a49091d034634a7887a05730e9885f3b001 Mon Sep 17 00:00:00 2001 From: Matthew Jason Benson Date: Tue, 27 Dec 2005 22:57:02 +0000 Subject: [PATCH] ws/javadoc/small code shrinkages git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@359316 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/tools/ant/util/ClasspathUtils.java | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/main/org/apache/tools/ant/util/ClasspathUtils.java b/src/main/org/apache/tools/ant/util/ClasspathUtils.java index e001cdf67..706547162 100644 --- a/src/main/org/apache/tools/ant/util/ClasspathUtils.java +++ b/src/main/org/apache/tools/ant/util/ClasspathUtils.java @@ -184,7 +184,6 @@ public class ClasspathUtils { throw new BuildException("The specified loader id " + loaderId + " does not reference a class loader"); } - cl = (ClassLoader) reusedLoader; } if (cl == null) { @@ -193,7 +192,6 @@ public class ClasspathUtils { p.addReference(loaderId, cl); } } - return cl; } @@ -219,7 +217,6 @@ public class ClasspathUtils { acl.setParentFirst(false); acl.addJavaLibraries(); } - return acl; } @@ -352,7 +349,7 @@ public class ClasspathUtils { *
  • attribute @classname
  • * *

    This class functions as a delegate handling the configuration - * issues for this recuring pattern. Its usage pattern, as the name + * issues for this recurring pattern. Its usage pattern, as the name * suggests, is delegation rather than inheritance.

    * * @since Ant 1.6 @@ -461,14 +458,12 @@ public class ClasspathUtils { * @return The class loader. */ public ClassLoader getClassLoader() { - ClassLoader cl; - cl = ClasspathUtils.getClassLoaderForPath( + return ClasspathUtils.getClassLoaderForPath( getContextProject(), this.classpath, getClassLoadId(), this.reverseLoader, loaderId != null || isMagicPropertySet(getContextProject())); - return cl; } /** @@ -483,11 +478,9 @@ public class ClasspathUtils { * @return a loader identifier. */ public String getClassLoadId() { - if (this.loaderId == null && this.classpathId != null) { - return ClasspathUtils.LOADER_ID_PREFIX + this.classpathId; - } else { - return this.loaderId; - } + return this.loaderId == null && this.classpathId != null + ? ClasspathUtils.LOADER_ID_PREFIX + this.classpathId + : this.loaderId; } /** @@ -497,8 +490,7 @@ public class ClasspathUtils { * @return the fresh instantiated object. */ public Object newInstance() { - ClassLoader cl = getClassLoader(); - return ClasspathUtils.newInstance(this.className, cl); + return ClasspathUtils.newInstance(this.className, getClassLoader()); } /**