git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@579978 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -289,13 +289,14 @@ public class CvsTagDiff extends AbstractCvsTask { | |||||
| line = line.substring(FILE_STRING.length()); | line = line.substring(FILE_STRING.length()); | ||||
| } | } | ||||
| if ((index = line.indexOf(FILE_IS_NEW)) != -1) { | |||||
| index = line.indexOf(FILE_IS_NEW); | |||||
| if (index != -1) { | |||||
| // it is a new file | // it is a new file | ||||
| // set the revision but not the prevrevision | // set the revision but not the prevrevision | ||||
| String filename = line.substring(0, index); | String filename = line.substring(0, index); | ||||
| String rev = null; | String rev = null; | ||||
| int indexrev = -1; | |||||
| if ((indexrev = line.indexOf(REVISION, index)) != -1) { | |||||
| int indexrev = line.indexOf(REVISION, index); | |||||
| if (indexrev != -1) { | |||||
| rev = line.substring(indexrev + REVISION.length()); | rev = line.substring(indexrev + REVISION.length()); | ||||
| } | } | ||||
| entry = new CvsTagEntry(filename, rev); | entry = new CvsTagEntry(filename, rev); | ||||
| @@ -319,8 +320,8 @@ public class CvsTagDiff extends AbstractCvsTask { | |||||
| // it is a removed file | // it is a removed file | ||||
| String filename = line.substring(0, index); | String filename = line.substring(0, index); | ||||
| String rev = null; | String rev = null; | ||||
| int indexrev = -1; | |||||
| if ((indexrev = line.indexOf(REVISION, index)) != -1) { | |||||
| int indexrev = line.indexOf(REVISION, index); | |||||
| if (indexrev != -1) { | |||||
| rev = line.substring(indexrev + REVISION.length()); | rev = line.substring(indexrev + REVISION.length()); | ||||
| } | } | ||||
| entry = new CvsTagEntry(filename, null, rev); | entry = new CvsTagEntry(filename, null, rev); | ||||
| @@ -457,7 +457,8 @@ public class Translate extends MatchingTask { | |||||
| //Handle line continuations, if any | //Handle line continuations, if any | ||||
| while (value.endsWith("\\")) { | while (value.endsWith("\\")) { | ||||
| value = value.substring(0, value.length() - 1); | value = value.substring(0, value.length() - 1); | ||||
| if ((line = in.readLine()) != null) { | |||||
| line = in.readLine(); | |||||
| if (line != null) { | |||||
| value = value + line.trim(); | value = value + line.trim(); | ||||
| } else { | } else { | ||||
| break; | break; | ||||
| @@ -211,6 +211,7 @@ public abstract class P4Base extends org.apache.tools.ant.Task { | |||||
| //Get default P4 settings from environment - Mark would have done something cool with | //Get default P4 settings from environment - Mark would have done something cool with | ||||
| //introspection here.....:-) | //introspection here.....:-) | ||||
| String tmpprop; | String tmpprop; | ||||
| // CheckStyle:InnerAssignment OFF | |||||
| if ((tmpprop = getProject().getProperty("p4.port")) != null) { | if ((tmpprop = getProject().getProperty("p4.port")) != null) { | ||||
| setPort(tmpprop); | setPort(tmpprop); | ||||
| } | } | ||||
| @@ -220,6 +221,7 @@ public abstract class P4Base extends org.apache.tools.ant.Task { | |||||
| if ((tmpprop = getProject().getProperty("p4.user")) != null) { | if ((tmpprop = getProject().getProperty("p4.user")) != null) { | ||||
| setUser(tmpprop); | setUser(tmpprop); | ||||
| } | } | ||||
| // CheckStyle:InnerAssignment ON | |||||
| } | } | ||||
| /** | /** | ||||
| * no usages found for this method | * no usages found for this method | ||||
| @@ -140,8 +140,8 @@ public class ScpFromMessageBySftp extends ScpFromMessage { | |||||
| String remoteFile = le.getFilename(); | String remoteFile = le.getFilename(); | ||||
| if (!localFile.exists()) { | if (!localFile.exists()) { | ||||
| String path = localFile.getAbsolutePath(); | String path = localFile.getAbsolutePath(); | ||||
| int i = 0; | |||||
| if ((i = path.lastIndexOf(File.pathSeparator)) != -1) { | |||||
| int i = path.lastIndexOf(File.pathSeparator); | |||||
| if (i != -1) { | |||||
| if (path.length() > File.pathSeparator.length()) { | if (path.length() > File.pathSeparator.length()) { | ||||
| new File(path.substring(0, i)).mkdirs(); | new File(path.substring(0, i)).mkdirs(); | ||||
| } | } | ||||