Browse Source

Simplify single assignment and avoid redundant if conditions.

master
Arturo Bernal 3 years ago
parent
commit
0ad2609358
3 changed files with 4 additions and 13 deletions
  1. +1
    -4
      src/main/org/apache/tools/ant/taskdefs/Tar.java
  2. +2
    -5
      src/main/org/apache/tools/ant/taskdefs/XmlProperty.java
  3. +1
    -4
      src/main/org/apache/tools/ant/types/Permissions.java

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

@@ -635,10 +635,7 @@ public class Tar extends MatchingTask {
* @since Ant 1.7
*/
protected boolean check(final File basedir, final String[] files) {
boolean upToDate = true;
if (!archiveIsUpToDate(files, basedir)) {
upToDate = false;
}
boolean upToDate = archiveIsUpToDate(files, basedir);

for (String file : files) {
if (tarFile.equals(new File(basedir, file))) {


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

@@ -404,17 +404,14 @@ public class XmlProperty extends Task {
}
String nodeText = null;
boolean emptyNode = false;
boolean semanticEmptyOverride = false;
if (node.getNodeType() == Node.ELEMENT_NODE
boolean semanticEmptyOverride = node.getNodeType() == Node.ELEMENT_NODE
&& semanticAttributes
&& node.hasAttributes()
&& (node.getAttributes().getNamedItem(VALUE) != null
|| node.getAttributes().getNamedItem(LOCATION) != null
|| node.getAttributes().getNamedItem(REF_ID) != null
|| node.getAttributes().getNamedItem(PATH) != null || node.getAttributes()
.getNamedItem(PATHID) != null)) {
semanticEmptyOverride = true;
}
.getNamedItem(PATHID) != null);
if (node.getNodeType() == Node.TEXT_NODE) {
// For the text node, add a property.
nodeText = getAttributeValue(node);


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

@@ -207,10 +207,7 @@ public class Permissions {
public void checkPermission(final java.security.Permission perm) {
if (active) {
if (delegateToOldSM && !perm.getName().equals("exitVM")) {
boolean permOK = false;
if (granted.implies(perm)) {
permOK = true;
}
boolean permOK = granted.implies(perm);
checkRevoked(perm);
/*
if the permission was not explicitly granted or revoked


Loading…
Cancel
Save