Browse Source

Checkstyle

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275180 13f79535-47bb-0310-9956-ffa450edef68
master
Jan Materne 22 years ago
parent
commit
0c42e047b2
5 changed files with 18 additions and 11 deletions
  1. +3
    -1
      src/main/org/apache/tools/ant/taskdefs/Execute.java
  2. +4
    -4
      src/main/org/apache/tools/ant/taskdefs/ExecuteJava.java
  3. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java
  4. +5
    -1
      src/main/org/apache/tools/ant/taskdefs/Exit.java
  5. +4
    -3
      src/main/org/apache/tools/ant/taskdefs/Input.java

+ 3
- 1
src/main/org/apache/tools/ant/taskdefs/Execute.java View File

@@ -307,11 +307,13 @@ public class Execute {
try { try {
return bos.toString("Cp1047"); return bos.toString("Cp1047");
} catch (java.io.UnsupportedEncodingException e) { } catch (java.io.UnsupportedEncodingException e) {
//noop default encoding used
} }
} else if (Os.isFamily("os/400")) { } else if (Os.isFamily("os/400")) {
try { try {
return bos.toString("Cp500"); return bos.toString("Cp500");
} catch (java.io.UnsupportedEncodingException e) { } catch (java.io.UnsupportedEncodingException e) {
//noop default encoding used
} }
} }
return bos.toString(); return bos.toString();
@@ -1151,4 +1153,4 @@ public class Execute {
} }


} }
}
}

+ 4
- 4
src/main/org/apache/tools/ant/taskdefs/ExecuteJava.java View File

@@ -104,7 +104,7 @@ public class ExecuteJava implements Runnable, TimeoutObserver {
public void setSystemProperties(CommandlineJava.SysProperties s) { public void setSystemProperties(CommandlineJava.SysProperties s) {
sysProperties = s; sysProperties = s;
} }
/** /**
* Permissions for the application run. * Permissions for the application run.
* @since Ant 1.6 * @since Ant 1.6
@@ -220,7 +220,7 @@ public class ExecuteJava implements Runnable, TimeoutObserver {
public void run() { public void run() {
final Object[] argument = {javaCommand.getArguments()}; final Object[] argument = {javaCommand.getArguments()};
try { try {
if(perm != null) {
if (perm != null) {
perm.setSecurityManager(); perm.setSecurityManager();
} }
main.invoke(null, argument); main.invoke(null, argument);
@@ -232,7 +232,7 @@ public class ExecuteJava implements Runnable, TimeoutObserver {
} catch (Throwable t) { } catch (Throwable t) {
caught = t; caught = t;
} finally { } finally {
if(perm != null) {
if (perm != null) {
perm.restoreSecurityManager(); perm.restoreSecurityManager();
} }
synchronized (this) { synchronized (this) {
@@ -258,4 +258,4 @@ public class ExecuteJava implements Runnable, TimeoutObserver {
public synchronized boolean killedProcess() { public synchronized boolean killedProcess() {
return timedOut; return timedOut;
} }
}
}

+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java View File

@@ -311,7 +311,7 @@ public class ExecuteOn extends ExecTask {
} }


if (!"file".equals(currentType)) { if (!"file".equals(currentType)) {
String[] s = getDirs(base, ds);;
String[] s = getDirs(base, ds);
for (int j = 0; j < s.length; j++) { for (int j = 0; j < s.length; j++) {
totalDirs++; totalDirs++;
fileNames.addElement(s[j]); fileNames.addElement(s[j]);
@@ -615,4 +615,4 @@ public class ExecuteOn extends ExecTask {
return new String[] {"file", "dir", "both"}; return new String[] {"file", "dir", "both"};
} }
} }
}
}

+ 5
- 1
src/main/org/apache/tools/ant/taskdefs/Exit.java View File

@@ -98,6 +98,9 @@ public class Exit extends Task {
unlessCondition = c; unlessCondition = c;
} }


/**
* Exits the actual build.
*/
public void execute() throws BuildException { public void execute() throws BuildException {
if (testIfCondition() && testUnlessCondition()) { if (testIfCondition() && testUnlessCondition()) {
if (message != null && message.length() > 0) { if (message != null && message.length() > 0) {
@@ -110,6 +113,7 @@ public class Exit extends Task {


/** /**
* Set a multiline message. * Set a multiline message.
* @param msg the message to display
*/ */
public void addText(String msg) { public void addText(String msg) {
if (message == null) { if (message == null) {
@@ -133,4 +137,4 @@ public class Exit extends Task {
return getProject().getProperty(unlessCondition) == null; return getProject().getProperty(unlessCondition) == null;
} }


}
}

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

@@ -121,6 +121,7 @@ public class Input extends Task {


/** /**
* Set a multiline message. * Set a multiline message.
* @param msg The message to be displayed.
*/ */
public void addText(String msg) { public void addText(String msg) {
message += getProject().replaceProperties(msg); message += getProject().replaceProperties(msg);
@@ -133,8 +134,8 @@ public class Input extends Task {
} }


/** /**
* Actual method executed by jakarta-ant.
* @exception BuildException
* Actual method executed by ant.
* @throws BuildException
*/ */
public void execute () throws BuildException { public void execute () throws BuildException {
if (addproperty != null if (addproperty != null
@@ -163,4 +164,4 @@ public class Input extends Task {
} }
} }


}
}

Loading…
Cancel
Save