summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStefan Bodewig <bodewig@apache.org>2016-12-21 11:00:48 +0100
committerStefan Bodewig <bodewig@apache.org>2016-12-21 11:03:22 +0100
commit07ce505d5338388a069666e10aa4644b16798056 (patch)
tree3dfdfa12e6a8ab2d806d509641cedf430e6044c1 /src
parent23f3c9de3db9a6147ae268a4018966db521cbc7e (diff)
downloadant-07ce505d5338388a069666e10aa4644b16798056.tar.gz
extract assignment statements
Diffstat (limited to 'src')
-rw-r--r--src/main/org/apache/tools/ant/filters/UniqFilter.java7
-rw-r--r--src/main/org/apache/tools/ant/taskdefs/Sync.java3
-rw-r--r--src/main/org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer.java6
-rw-r--r--src/main/org/apache/tools/bzip2/BlockSort.java6
4 files changed, 15 insertions, 7 deletions
diff --git a/src/main/org/apache/tools/ant/filters/UniqFilter.java b/src/main/org/apache/tools/ant/filters/UniqFilter.java
index e72d5f581..2983b6c90 100644
--- a/src/main/org/apache/tools/ant/filters/UniqFilter.java
+++ b/src/main/org/apache/tools/ant/filters/UniqFilter.java
@@ -31,7 +31,10 @@ public class UniqFilter extends TokenFilter.ChainableReaderFilter {
private String lastLine = null;
public String filter(String string) {
- return lastLine == null || !lastLine.equals(string)
- ? (lastLine = string) : null;
+ if (lastLine == null || !lastLine.equals(string)) {
+ lastLine = string;
+ return lastLine;
+ }
+ return null;
}
}
diff --git a/src/main/org/apache/tools/ant/taskdefs/Sync.java b/src/main/org/apache/tools/ant/taskdefs/Sync.java
index c1c755291..bcdfd525c 100644
--- a/src/main/org/apache/tools/ant/taskdefs/Sync.java
+++ b/src/main/org/apache/tools/ant/taskdefs/Sync.java
@@ -403,7 +403,8 @@ public class Sync extends Task {
if (resources == null) {
Restrict r = new Restrict();
r.add(new Exists());
- r.add(resources = new Resources());
+ resources = new Resources();
+ r.add(resources);
myCopy.add(r);
}
resources.add(rc);
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer.java b/src/main/org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer.java
index bae3b3ca2..fd7a321eb 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer.java
@@ -239,8 +239,10 @@ public class AggregateTransformer {
* @since Ant 1.9.5
*/
public XSLTProcess.Factory createFactory() {
- return xsltFactory != null ? xsltFactory
- : (xsltFactory = xsltTask.createFactory());
+ if (xsltFactory == null) {
+ xsltFactory = xsltTask.createFactory();
+ }
+ return xsltFactory;
}
/**
diff --git a/src/main/org/apache/tools/bzip2/BlockSort.java b/src/main/org/apache/tools/bzip2/BlockSort.java
index 78ea15e31..b382470f8 100644
--- a/src/main/org/apache/tools/bzip2/BlockSort.java
+++ b/src/main/org/apache/tools/bzip2/BlockSort.java
@@ -445,8 +445,10 @@ class BlockSort {
private int[] eclass;
private int[] getEclass() {
- return eclass == null
- ? (eclass = new int[quadrant.length / 2]) : eclass;
+ if (eclass == null) {
+ eclass = new int[quadrant.length / 2];
+ }
+ return eclass;
}
/*