You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bo...@apache.org on 2004/12/13 10:06:19 UTC

cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/ssh ScpFromMessage.java ScpToMessage.java

bodewig     2004/12/13 01:06:19

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional ANTLR.java
               src/main/org/apache/tools/ant/taskdefs/optional/jdepend
                        JDependTask.java
               src/main/org/apache/tools/ant/taskdefs/optional/script
                        ScriptDef.java
               src/main/org/apache/tools/ant/taskdefs/optional/ssh
                        ScpFromMessage.java ScpToMessage.java
  Log:
  Make Jikes happy - shadowing and some non-static private finals
  
  Revision  Changes    Path
  1.41      +10 -10    ant/src/main/org/apache/tools/ant/taskdefs/optional/ANTLR.java
  
  Index: ANTLR.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/ANTLR.java,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- ANTLR.java	28 Jun 2004 21:51:59 -0000	1.40
  +++ ANTLR.java	13 Dec 2004 09:06:18 -0000	1.41
  @@ -47,7 +47,7 @@
       private CommandlineJava commandline = new CommandlineJava();
   
       /** the file to process */
  -    private File target;
  +    private File targetFile;
   
       /** where to output the result */
       private File outputDirectory;
  @@ -97,7 +97,7 @@
        */
       public void setTarget(File target) {
           log("Setting target to: " + target.toString(), Project.MSG_VERBOSE);
  -        this.target = target;
  +        this.targetFile = target;
       }
   
       /**
  @@ -262,19 +262,19 @@
           //TODO: use ANTLR to parse the grammar file to do this.
           File generatedFile = getGeneratedFile();
           boolean targetIsOutOfDate =
  -            target.lastModified() > generatedFile.lastModified();
  +            targetFile.lastModified() > generatedFile.lastModified();
           boolean superGrammarIsOutOfDate  = superGrammar != null
                   && (superGrammar.lastModified() > generatedFile.lastModified());
           if (targetIsOutOfDate || superGrammarIsOutOfDate) {
               if (targetIsOutOfDate) {
  -                log("Compiling " + target + " as it is newer than "
  +                log("Compiling " + targetFile + " as it is newer than "
                       + generatedFile, Project.MSG_VERBOSE);
               } else if (superGrammarIsOutOfDate) {
  -                log("Compiling " + target + " as " + superGrammar
  +                log("Compiling " + targetFile + " as " + superGrammar
                       + " is newer than " + generatedFile, Project.MSG_VERBOSE);
               }
               populateAttributes();
  -            commandline.createArgument().setValue(target.toString());
  +            commandline.createArgument().setValue(targetFile.toString());
   
               log(commandline.describeCommand(), Project.MSG_VERBOSE);
               int err = run(commandline.getCommandline());
  @@ -332,13 +332,13 @@
       }
   
       private void validateAttributes() throws BuildException {
  -        if (target == null || !target.isFile()) {
  -            throw new BuildException("Invalid target: " + target);
  +        if (targetFile == null || !targetFile.isFile()) {
  +            throw new BuildException("Invalid target: " + targetFile);
           }
   
           // if no output directory is specified, used the target's directory
           if (outputDirectory == null) {
  -            setOutputdirectory(new File(target.getParent()));
  +            setOutputdirectory(new File(targetFile.getParent()));
           }
           if (!outputDirectory.isDirectory()) {
               throw new BuildException("Invalid output directory: " + outputDirectory);
  @@ -348,7 +348,7 @@
       private File getGeneratedFile() throws BuildException {
           String generatedFileName = null;
           try {
  -            BufferedReader in = new BufferedReader(new FileReader(target));
  +            BufferedReader in = new BufferedReader(new FileReader(targetFile));
               String line;
               while ((line = in.readLine()) != null) {
                   int extendsIndex = line.indexOf(" extends ");
  
  
  
  1.33      +12 -12    ant/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java
  
  Index: JDependTask.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- JDependTask.java	23 Apr 2004 16:56:20 -0000	1.32
  +++ JDependTask.java	13 Dec 2004 09:06:19 -0000	1.33
  @@ -474,9 +474,9 @@
                   // of sourcespath.  The code is currently the same - you
                   // need class files in a directory to use this - jar files
                   // coming soon....
  -                String[] classesPath = getClassespath().list();
  -                for (int i = 0; i < classesPath.length; i++) {
  -                    File f = new File(classesPath[i]);
  +                String[] cP = getClassespath().list();
  +                for (int i = 0; i < cP.length; i++) {
  +                    File f = new File(cP[i]);
                       // not necessary as JDepend would fail, but why loose
                       // some time?
                       if (!f.exists() || !f.isDirectory()) {
  @@ -502,9 +502,9 @@
   
                   // This is the old way and is deprecated - classespath is
                   // the right way to do this and is above
  -                String[] sourcesPath = getSourcespath().list();
  -                for (int i = 0; i < sourcesPath.length; i++) {
  -                    File f = new File(sourcesPath[i]);
  +                String[] sP = getSourcespath().list();
  +                for (int i = 0; i < sP.length; i++) {
  +                    File f = new File(sP[i]);
   
                       // not necessary as JDepend would fail, but why loose
                       // some time?
  @@ -618,9 +618,9 @@
   
           if (getSourcespath() != null) {
               // This is deprecated - use classespath in the future
  -            String[] sourcesPath = getSourcespath().list();
  -            for (int i = 0; i < sourcesPath.length; i++) {
  -                File f = new File(sourcesPath[i]);
  +            String[] sP = getSourcespath().list();
  +            for (int i = 0; i < sP.length; i++) {
  +                File f = new File(sP[i]);
   
                   // not necessary as JDepend would fail, but why loose
                   // some time?
  @@ -637,9 +637,9 @@
           if (getClassespath() != null) {
               // This is the new way - use classespath - code is the
               // same for now
  -            String[] classesPath = getClassespath().list();
  -            for (int i = 0; i < classesPath.length; i++) {
  -                File f = new File(classesPath[i]);
  +            String[] cP = getClassespath().list();
  +            for (int i = 0; i < cP.length; i++) {
  +                File f = new File(cP[i]);
                   // not necessary as JDepend would fail, but why loose
                   // some time?
                   if (!f.exists() || !f.isDirectory()) {
  
  
  
  1.16      +4 -4      ant/src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDef.java
  
  Index: ScriptDef.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDef.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- ScriptDef.java	7 Jul 2004 15:16:40 -0000	1.15
  +++ ScriptDef.java	13 Dec 2004 09:06:19 -0000	1.16
  @@ -223,13 +223,13 @@
   
           // find the script repository - it is stored in the project
           Map scriptRepository = null;
  -        Project project = getProject();
  -        synchronized (project) {
  +        Project p = getProject();
  +        synchronized (p) {
               scriptRepository =
  -                (Map) project.getReference(MagicNames.SCRIPT_REPOSITORY);
  +                (Map) p.getReference(MagicNames.SCRIPT_REPOSITORY);
               if (scriptRepository == null) {
                   scriptRepository = new HashMap();
  -                project.addReference(MagicNames.SCRIPT_REPOSITORY,
  +                p.addReference(MagicNames.SCRIPT_REPOSITORY,
                       scriptRepository);
               }
           }
  
  
  
  1.11      +2 -2      ant/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpFromMessage.java
  
  Index: ScpFromMessage.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpFromMessage.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ScpFromMessage.java	22 Nov 2004 09:23:34 -0000	1.10
  +++ ScpFromMessage.java	13 Dec 2004 09:06:19 -0000	1.11
  @@ -31,8 +31,8 @@
   
   public class ScpFromMessage extends AbstractSshMessage {
   
  -    private final byte LINE_FEED = 0x0a;
  -    private final int BUFFER_SIZE = 1024;
  +    private static final byte LINE_FEED = 0x0a;
  +    private static final int BUFFER_SIZE = 1024;
   
       private String remoteFile;
       private File localFile;
  
  
  
  1.11      +1 -1      ant/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpToMessage.java
  
  Index: ScpToMessage.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpToMessage.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ScpToMessage.java	22 Nov 2004 09:23:34 -0000	1.10
  +++ ScpToMessage.java	13 Dec 2004 09:06:19 -0000	1.11
  @@ -30,7 +30,7 @@
   
   public class ScpToMessage extends AbstractSshMessage {
   
  -    private final int BUFFER_SIZE = 1024;
  +    private static final int BUFFER_SIZE = 1024;
   
       private File localFile;
       private String remotePath;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org