git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@476582 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -189,7 +189,7 @@ public class BuildEvent extends EventObject { | |||||
| * | * | ||||
| * @return the exception associated with this exception, or | * @return the exception associated with this exception, or | ||||
| * <code>null</code> if no exception has been set. | * <code>null</code> if no exception has been set. | ||||
| * | |||||
| * | |||||
| * @see BuildListener#messageLogged(BuildEvent) | * @see BuildListener#messageLogged(BuildEvent) | ||||
| * @see BuildListener#taskFinished(BuildEvent) | * @see BuildListener#taskFinished(BuildEvent) | ||||
| * @see BuildListener#targetFinished(BuildEvent) | * @see BuildListener#targetFinished(BuildEvent) | ||||
| @@ -1217,11 +1217,14 @@ public final class IntrospectionHelper { | |||||
| * in detail for reasons of source code readability. | * in detail for reasons of source code readability. | ||||
| */ | */ | ||||
| private abstract static class NestedCreator { | private abstract static class NestedCreator { | ||||
| Method method; // the method called to add/create the nested element | |||||
| private Method method; // the method called to add/create the nested element | |||||
| NestedCreator(Method m) { | NestedCreator(Method m) { | ||||
| this.method = m; | this.method = m; | ||||
| } | } | ||||
| Method getMethod() { | |||||
| return method; | |||||
| } | |||||
| boolean isPolyMorphic() { | boolean isPolyMorphic() { | ||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -1247,7 +1250,7 @@ public final class IntrospectionHelper { | |||||
| Object create(Project project, Object parent, Object ignore) | Object create(Project project, Object parent, Object ignore) | ||||
| throws InvocationTargetException, IllegalAccessException { | throws InvocationTargetException, IllegalAccessException { | ||||
| return method.invoke(parent, new Object[] {}); | |||||
| return getMethod().invoke(parent, new Object[] {}); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1257,8 +1260,8 @@ public final class IntrospectionHelper { | |||||
| static final int ADD = 1; | static final int ADD = 1; | ||||
| static final int ADD_CONFIGURED = 2; | static final int ADD_CONFIGURED = 2; | ||||
| protected Constructor constructor; | |||||
| protected int behavior; | |||||
| private Constructor constructor; | |||||
| private int behavior; // ADD or ADD_CONFIGURED | |||||
| AddNestedCreator(Method m, Constructor c, int behavior) { | AddNestedCreator(Method m, Constructor c, int behavior) { | ||||
| super(m); | super(m); | ||||
| @@ -1299,7 +1302,7 @@ public final class IntrospectionHelper { | |||||
| private void istore(Object parent, Object child) | private void istore(Object parent, Object child) | ||||
| throws InvocationTargetException, | throws InvocationTargetException, | ||||
| IllegalAccessException, InstantiationException { | IllegalAccessException, InstantiationException { | ||||
| method.invoke(parent, new Object[] {child}); | |||||
| getMethod().invoke(parent, new Object[] {child}); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1308,7 +1311,7 @@ public final class IntrospectionHelper { | |||||
| * in detail for reasons of source code readability. | * in detail for reasons of source code readability. | ||||
| */ | */ | ||||
| private abstract static class AttributeSetter { | private abstract static class AttributeSetter { | ||||
| Method method; // the method called to set the attribute | |||||
| private Method method; // the method called to set the attribute | |||||
| AttributeSetter(Method m) { | AttributeSetter(Method m) { | ||||
| this.method = m; | this.method = m; | ||||
| } | } | ||||
| @@ -1361,8 +1364,8 @@ public final class IntrospectionHelper { | |||||
| return new NestedCreator(addMethod) { | return new NestedCreator(addMethod) { | ||||
| Object create(Project project, Object parent, Object ignore) | Object create(Project project, Object parent, Object ignore) | ||||
| throws InvocationTargetException, IllegalAccessException { | throws InvocationTargetException, IllegalAccessException { | ||||
| if (!method.getName().endsWith("Configured")) { | |||||
| method.invoke(parent, new Object[] {realObject}); | |||||
| if (!getMethod().getName().endsWith("Configured")) { | |||||
| getMethod().invoke(parent, new Object[] {realObject}); | |||||
| } | } | ||||
| return nestedObject; | return nestedObject; | ||||
| } | } | ||||
| @@ -1374,8 +1377,8 @@ public final class IntrospectionHelper { | |||||
| void store(Object parent, Object child) | void store(Object parent, Object child) | ||||
| throws InvocationTargetException, IllegalAccessException, | throws InvocationTargetException, IllegalAccessException, | ||||
| InstantiationException { | InstantiationException { | ||||
| if (method.getName().endsWith("Configured")) { | |||||
| method.invoke(parent, new Object[] {realObject}); | |||||
| if (getMethod().getName().endsWith("Configured")) { | |||||
| getMethod().invoke(parent, new Object[] {realObject}); | |||||
| } | } | ||||
| } | } | ||||
| }; | }; | ||||
| @@ -464,8 +464,6 @@ public class PropertyHelper { | |||||
| // deprecated, it is possible to use a better (more efficient) | // deprecated, it is possible to use a better (more efficient) | ||||
| // mechanism to preserve the context. | // mechanism to preserve the context. | ||||
| // TODO: do we need to delegate ? | |||||
| /** | /** | ||||
| * Returns a copy of the properties table. | * Returns a copy of the properties table. | ||||
| * @return a hashtable containing all properties | * @return a hashtable containing all properties | ||||
| @@ -337,12 +337,11 @@ public abstract class Task extends ProjectComponent { | |||||
| * @since 1.7 | * @since 1.7 | ||||
| */ | */ | ||||
| public void log(Throwable t, int msgLevel) { | public void log(Throwable t, int msgLevel) { | ||||
| if(t != null) | |||||
| { | |||||
| if (t != null) { | |||||
| log(t.getMessage(), t, msgLevel); | log(t.getMessage(), t, msgLevel); | ||||
| } | } | ||||
| } | } | ||||
| /** | /** | ||||
| * Logs a message with the given priority. This delegates | * Logs a message with the given priority. This delegates | ||||
| * the actual logging to the project. | * the actual logging to the project. | ||||
| @@ -360,7 +359,7 @@ public abstract class Task extends ProjectComponent { | |||||
| super.log(msg, msgLevel); | super.log(msg, msgLevel); | ||||
| } | } | ||||
| } | } | ||||
| /** | /** | ||||
| * Performs this task if it's still valid, or gets a replacement | * Performs this task if it's still valid, or gets a replacement | ||||
| * version and performs that otherwise. | * version and performs that otherwise. | ||||
| @@ -180,6 +180,7 @@ public class ProjectHelperImpl extends ProjectHelper { | |||||
| * control back to the parent in the endElement method. | * control back to the parent in the endElement method. | ||||
| */ | */ | ||||
| static class AbstractHandler extends HandlerBase { | static class AbstractHandler extends HandlerBase { | ||||
| // CheckStyle:VisibilityModifier OFF - bc | |||||
| /** | /** | ||||
| * Previous handler for the document. | * Previous handler for the document. | ||||
| @@ -194,6 +195,7 @@ public class ProjectHelperImpl extends ProjectHelper { | |||||
| explicitly it'll work with more compilers. | explicitly it'll work with more compilers. | ||||
| */ | */ | ||||
| ProjectHelperImpl helperImpl; | ProjectHelperImpl helperImpl; | ||||
| // CheckStyle:VisibilityModifier ON | |||||
| /** | /** | ||||
| * Creates a handler and sets the parser to use it | * Creates a handler and sets the parser to use it | ||||
| @@ -271,7 +273,9 @@ public class ProjectHelperImpl extends ProjectHelper { | |||||
| * Handler for the root element. Its only child must be the "project" element. | * Handler for the root element. Its only child must be the "project" element. | ||||
| */ | */ | ||||
| static class RootHandler extends HandlerBase { | static class RootHandler extends HandlerBase { | ||||
| // CheckStyle:VisibilityModifier OFF - bc | |||||
| ProjectHelperImpl helperImpl; | ProjectHelperImpl helperImpl; | ||||
| // CheckStyle:VisibilityModifier ON | |||||
| public RootHandler(ProjectHelperImpl helperImpl) { | public RootHandler(ProjectHelperImpl helperImpl) { | ||||
| this.helperImpl = helperImpl; | this.helperImpl = helperImpl; | ||||
| @@ -38,7 +38,7 @@ public final class Locator { | |||||
| /** | /** | ||||
| * encoding used to represent URIs | * encoding used to represent URIs | ||||
| */ | */ | ||||
| public static String URI_ENCODING = "UTF-8"; | |||||
| public static final String URI_ENCODING = "UTF-8"; | |||||
| // stolen from org.apache.xerces.impl.XMLEntityManager#getUserDir() | // stolen from org.apache.xerces.impl.XMLEntityManager#getUserDir() | ||||
| // of the Xerces-J team | // of the Xerces-J team | ||||
| // which ASCII characters need to be escaped | // which ASCII characters need to be escaped | ||||
| @@ -210,7 +210,7 @@ public final class Locator { | |||||
| String cwd = System.getProperty("user.dir"); | String cwd = System.getProperty("user.dir"); | ||||
| int posi = cwd.indexOf(":"); | int posi = cwd.indexOf(":"); | ||||
| if ((posi > 0) && path.startsWith(File.separator)) { | if ((posi > 0) && path.startsWith(File.separator)) { | ||||
| path = cwd.substring(0, posi + 1) + path; | |||||
| path = cwd.substring(0, posi + 1) + path; | |||||
| } | } | ||||
| } catch (UnsupportedEncodingException exc) { | } catch (UnsupportedEncodingException exc) { | ||||
| // not sure whether this is clean, but this method is | // not sure whether this is clean, but this method is | ||||
| @@ -290,8 +290,10 @@ public class CommonsLoggingListener implements BuildListener, BuildLogger { | |||||
| System.setErr(tmpErr); | System.setErr(tmpErr); | ||||
| } | } | ||||
| // CheckStyle:VisibilityModifier OFF - bc | |||||
| PrintStream out = System.out; | PrintStream out = System.out; | ||||
| PrintStream err = System.err; | PrintStream err = System.err; | ||||
| // CheckStyle:VisibilityModifier ON | |||||
| /** | /** | ||||
| * Set the the output level. | * Set the the output level. | ||||
| @@ -51,7 +51,7 @@ public class Quantifier extends EnumeratedAttribute { | |||||
| /** NONE instance */ | /** NONE instance */ | ||||
| public static final Quantifier NONE = new Quantifier("none"); | public static final Quantifier NONE = new Quantifier("none"); | ||||
| private static abstract class Predicate { | |||||
| private abstract static class Predicate { | |||||
| abstract boolean eval(int t, int f); | abstract boolean eval(int t, int f); | ||||
| } | } | ||||
| @@ -45,7 +45,11 @@ public class Rotate extends TransformOperation implements DrawOperation { | |||||
| } | } | ||||
| /** {@inheritDoc}. */ | |||||
| /** | |||||
| * Rotate an image. | |||||
| * @param image the image to rotate. | |||||
| * @return the rotated image. | |||||
| */ | |||||
| public PlanarImage performRotate(PlanarImage image) { | public PlanarImage performRotate(PlanarImage image) { | ||||
| float tAngle = (float) (angle * (Math.PI / HALF_CIRCLE)); | float tAngle = (float) (angle * (Math.PI / HALF_CIRCLE)); | ||||
| ParameterBlock pb = new ParameterBlock(); | ParameterBlock pb = new ParameterBlock(); | ||||
| @@ -103,7 +103,11 @@ public class Scale extends TransformOperation implements DrawOperation { | |||||
| } | } | ||||
| } | } | ||||
| /** {@inheritDoc}. */ | |||||
| /** | |||||
| * Scale an image. | |||||
| * @param image the image to scale. | |||||
| * @return the scaled image. | |||||
| */ | |||||
| public PlanarImage performScale(PlanarImage image) { | public PlanarImage performScale(PlanarImage image) { | ||||
| ParameterBlock pb = new ParameterBlock(); | ParameterBlock pb = new ParameterBlock(); | ||||
| pb.addSource(image); | pb.addSource(image); | ||||
| @@ -63,7 +63,7 @@ public class BZip2Resource extends CompressedResource { | |||||
| } | } | ||||
| /** | /** | ||||
| * Compress on the fly using {@link CBZip2OuputStream}. | |||||
| * Compress on the fly using {@link CBZip2OutputStream}. | |||||
| * @param out the stream to wrap. | * @param out the stream to wrap. | ||||
| * @return the wrapped stream. | * @return the wrapped stream. | ||||
| * @throws IOException if there is a problem. | * @throws IOException if there is a problem. | ||||
| @@ -161,7 +161,7 @@ public final class JavaEnvUtils { | |||||
| * Note that Ant now requires JDK 1.2+ so {@link #JAVA_1_0} and | * Note that Ant now requires JDK 1.2+ so {@link #JAVA_1_0} and | ||||
| * {@link #JAVA_1_1} need no longer be tested for. | * {@link #JAVA_1_1} need no longer be tested for. | ||||
| * @param version the version to check against the current version. | * @param version the version to check against the current version. | ||||
| * @return true if the version of Java is the same or higher than the | |||||
| * @return true if the version of Java is the same or higher than the | |||||
| * given version. | * given version. | ||||
| * @since Ant 1.7 | * @since Ant 1.7 | ||||
| */ | */ | ||||