Browse Source

checkstyle

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@476582 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 18 years ago
parent
commit
290108eb35
12 changed files with 38 additions and 24 deletions
  1. +1
    -1
      src/main/org/apache/tools/ant/BuildEvent.java
  2. +13
    -10
      src/main/org/apache/tools/ant/IntrospectionHelper.java
  3. +0
    -2
      src/main/org/apache/tools/ant/PropertyHelper.java
  4. +3
    -4
      src/main/org/apache/tools/ant/Task.java
  5. +4
    -0
      src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java
  6. +2
    -2
      src/main/org/apache/tools/ant/launch/Locator.java
  7. +2
    -0
      src/main/org/apache/tools/ant/listener/CommonsLoggingListener.java
  8. +1
    -1
      src/main/org/apache/tools/ant/types/Quantifier.java
  9. +5
    -1
      src/main/org/apache/tools/ant/types/optional/image/Rotate.java
  10. +5
    -1
      src/main/org/apache/tools/ant/types/optional/image/Scale.java
  11. +1
    -1
      src/main/org/apache/tools/ant/types/resources/BZip2Resource.java
  12. +1
    -1
      src/main/org/apache/tools/ant/util/JavaEnvUtils.java

+ 1
- 1
src/main/org/apache/tools/ant/BuildEvent.java View File

@@ -189,7 +189,7 @@ public class BuildEvent extends EventObject {
*
* @return the exception associated with this exception, or
* <code>null</code> if no exception has been set.
*
*
* @see BuildListener#messageLogged(BuildEvent)
* @see BuildListener#taskFinished(BuildEvent)
* @see BuildListener#targetFinished(BuildEvent)


+ 13
- 10
src/main/org/apache/tools/ant/IntrospectionHelper.java View File

@@ -1217,11 +1217,14 @@ public final class IntrospectionHelper {
* in detail for reasons of source code readability.
*/
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) {
this.method = m;
}
Method getMethod() {
return method;
}
boolean isPolyMorphic() {
return false;
}
@@ -1247,7 +1250,7 @@ public final class IntrospectionHelper {

Object create(Project project, Object parent, Object ignore)
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_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) {
super(m);
@@ -1299,7 +1302,7 @@ public final class IntrospectionHelper {
private void istore(Object parent, Object child)
throws InvocationTargetException,
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.
*/
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) {
this.method = m;
}
@@ -1361,8 +1364,8 @@ public final class IntrospectionHelper {
return new NestedCreator(addMethod) {
Object create(Project project, Object parent, Object ignore)
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;
}
@@ -1374,8 +1377,8 @@ public final class IntrospectionHelper {
void store(Object parent, Object child)
throws InvocationTargetException, IllegalAccessException,
InstantiationException {
if (method.getName().endsWith("Configured")) {
method.invoke(parent, new Object[] {realObject});
if (getMethod().getName().endsWith("Configured")) {
getMethod().invoke(parent, new Object[] {realObject});
}
}
};


+ 0
- 2
src/main/org/apache/tools/ant/PropertyHelper.java View File

@@ -464,8 +464,6 @@ public class PropertyHelper {
// deprecated, it is possible to use a better (more efficient)
// mechanism to preserve the context.

// TODO: do we need to delegate ?

/**
* Returns a copy of the properties table.
* @return a hashtable containing all properties


+ 3
- 4
src/main/org/apache/tools/ant/Task.java View File

@@ -337,12 +337,11 @@ public abstract class Task extends ProjectComponent {
* @since 1.7
*/
public void log(Throwable t, int msgLevel) {
if(t != null)
{
if (t != null) {
log(t.getMessage(), t, msgLevel);
}
}
/**
* Logs a message with the given priority. This delegates
* the actual logging to the project.
@@ -360,7 +359,7 @@ public abstract class Task extends ProjectComponent {
super.log(msg, msgLevel);
}
}
/**
* Performs this task if it's still valid, or gets a replacement
* version and performs that otherwise.


+ 4
- 0
src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java View File

@@ -180,6 +180,7 @@ public class ProjectHelperImpl extends ProjectHelper {
* control back to the parent in the endElement method.
*/
static class AbstractHandler extends HandlerBase {
// CheckStyle:VisibilityModifier OFF - bc

/**
* Previous handler for the document.
@@ -194,6 +195,7 @@ public class ProjectHelperImpl extends ProjectHelper {
explicitly it'll work with more compilers.
*/
ProjectHelperImpl helperImpl;
// CheckStyle:VisibilityModifier ON

/**
* 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.
*/
static class RootHandler extends HandlerBase {
// CheckStyle:VisibilityModifier OFF - bc
ProjectHelperImpl helperImpl;
// CheckStyle:VisibilityModifier ON

public RootHandler(ProjectHelperImpl helperImpl) {
this.helperImpl = helperImpl;


+ 2
- 2
src/main/org/apache/tools/ant/launch/Locator.java View File

@@ -38,7 +38,7 @@ public final class Locator {
/**
* 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()
// of the Xerces-J team
// which ASCII characters need to be escaped
@@ -210,7 +210,7 @@ public final class Locator {
String cwd = System.getProperty("user.dir");
int posi = cwd.indexOf(":");
if ((posi > 0) && path.startsWith(File.separator)) {
path = cwd.substring(0, posi + 1) + path;
path = cwd.substring(0, posi + 1) + path;
}
} catch (UnsupportedEncodingException exc) {
// not sure whether this is clean, but this method is


+ 2
- 0
src/main/org/apache/tools/ant/listener/CommonsLoggingListener.java View File

@@ -290,8 +290,10 @@ public class CommonsLoggingListener implements BuildListener, BuildLogger {
System.setErr(tmpErr);
}

// CheckStyle:VisibilityModifier OFF - bc
PrintStream out = System.out;
PrintStream err = System.err;
// CheckStyle:VisibilityModifier ON

/**
* Set the the output level.


+ 1
- 1
src/main/org/apache/tools/ant/types/Quantifier.java View File

@@ -51,7 +51,7 @@ public class Quantifier extends EnumeratedAttribute {
/** NONE instance */
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);
}



+ 5
- 1
src/main/org/apache/tools/ant/types/optional/image/Rotate.java View File

@@ -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) {
float tAngle = (float) (angle * (Math.PI / HALF_CIRCLE));
ParameterBlock pb = new ParameterBlock();


+ 5
- 1
src/main/org/apache/tools/ant/types/optional/image/Scale.java View File

@@ -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) {
ParameterBlock pb = new ParameterBlock();
pb.addSource(image);


+ 1
- 1
src/main/org/apache/tools/ant/types/resources/BZip2Resource.java View File

@@ -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.
* @return the wrapped stream.
* @throws IOException if there is a problem.


+ 1
- 1
src/main/org/apache/tools/ant/util/JavaEnvUtils.java View File

@@ -161,7 +161,7 @@ public final class JavaEnvUtils {
* Note that Ant now requires JDK 1.2+ so {@link #JAVA_1_0} and
* {@link #JAVA_1_1} need no longer be tested for.
* @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.
* @since Ant 1.7
*/


Loading…
Cancel
Save