ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r593037 - in /ant/core/branches/ANT_17_BRANCH/src: main/org/apache/tools/ant/ main/org/apache/tools/ant/taskdefs/optional/ main/org/apache/tools/ant/taskdefs/optional/junit/ main/org/apache/tools/ant/util/ tests/junit/org/apache/tools/ant/t...
Date Thu, 08 Nov 2007 06:25:34 GMT
Author: jhm
Date: Wed Nov  7 22:25:32 2007
New Revision: 593037

URL: http://svn.apache.org/viewvc?rev=593037&view=rev
Log:
sync
- fix some "serialVersionUID" warnings
- use static methods in a static way
- Remove use of deprecated constructor calls: Reference(String) and Reference()
- remove some unused (internal) variables
- remove unused imports

Modified:
    ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/BuildEvent.java
    ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/BuildException.java
    ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/ExitException.java
    ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/ExitStatusException.java
    ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/optional/EchoProperties.java
    ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/optional/junit/DOMUtil.java
    ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/util/IdentityStack.java
    ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/taskdefs/CopyTest.java
    ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/AbstractFileSetTest.java
    ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/FileListTest.java
    ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/MapperTest.java
    ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/PathTest.java
    ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/PatternSetTest.java
    ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/TarFileSetTest.java
    ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/XMLCatalogTest.java
    ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/ZipFileSetTest.java
    ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/selectors/ModifiedSelectorTest.java

Modified: ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/BuildEvent.java
URL: http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/BuildEvent.java?rev=593037&r1=593036&r2=593037&view=diff
==============================================================================
--- ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/BuildEvent.java (original)
+++ ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/BuildEvent.java Wed Nov
 7 22:25:32 2007
@@ -29,6 +29,8 @@
  */
 public class BuildEvent extends EventObject {
 
+    private static final long serialVersionUID = 4538050075952288486L;
+
     /** Project which emitted the event. */
     private Project project;
     /** Target which emitted the event, if specified. */

Modified: ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/BuildException.java
URL: http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/BuildException.java?rev=593037&r1=593036&r2=593037&view=diff
==============================================================================
--- ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/BuildException.java (original)
+++ ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/BuildException.java Wed
Nov  7 22:25:32 2007
@@ -25,6 +25,8 @@
  */
 public class BuildException extends RuntimeException {
 
+    private static final long serialVersionUID = -5419014565354664240L;
+
     /** Exception that might have caused this one. */
     private Throwable cause;
 

Modified: ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/ExitException.java
URL: http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/ExitException.java?rev=593037&r1=593036&r2=593037&view=diff
==============================================================================
--- ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/ExitException.java (original)
+++ ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/ExitException.java Wed Nov
 7 22:25:32 2007
@@ -26,6 +26,8 @@
  */
 public class ExitException extends SecurityException {
 
+    private static final long serialVersionUID = 2772487854280543363L;
+
     /** Status code */
     private int status;
 

Modified: ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/ExitStatusException.java
URL: http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/ExitStatusException.java?rev=593037&r1=593036&r2=593037&view=diff
==============================================================================
--- ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/ExitStatusException.java
(original)
+++ ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/ExitStatusException.java
Wed Nov  7 22:25:32 2007
@@ -24,6 +24,8 @@
  */
 public class ExitStatusException extends BuildException {
 
+    private static final long serialVersionUID = 7760846806886585968L;
+
     /** Status code */
     private int status;
 

Modified: ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/optional/EchoProperties.java
URL: http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/optional/EchoProperties.java?rev=593037&r1=593036&r2=593037&view=diff
==============================================================================
--- ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/optional/EchoProperties.java
(original)
+++ ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/optional/EchoProperties.java
Wed Nov  7 22:25:32 2007
@@ -387,6 +387,7 @@
         final List keyList = new ArrayList(allProps.keySet());
         Collections.sort(keyList);
         Properties props = new Properties() {
+            private static final long serialVersionUID = 5090936442309201654L;
             public Enumeration keys() {
                 return CollectionUtils.asEnumeration(keyList.iterator());
             }

Modified: ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/optional/junit/DOMUtil.java
URL: http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/optional/junit/DOMUtil.java?rev=593037&r1=593036&r2=593037&view=diff
==============================================================================
--- ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/optional/junit/DOMUtil.java
(original)
+++ ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/optional/junit/DOMUtil.java
Wed Nov  7 22:25:32 2007
@@ -86,6 +86,8 @@
 
     /** custom implementation of a nodelist */
     public static class NodeListImpl extends Vector implements NodeList {
+        private static final long serialVersionUID = 3175749150080946423L;
+
         /**
          * Get the number of nodes in the list.
          * @return the length of the list.

Modified: ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/util/IdentityStack.java
URL: http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/util/IdentityStack.java?rev=593037&r1=593036&r2=593037&view=diff
==============================================================================
--- ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/util/IdentityStack.java
(original)
+++ ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/util/IdentityStack.java
Wed Nov  7 22:25:32 2007
@@ -25,6 +25,8 @@
  */
 public class IdentityStack extends Stack {
 
+    private static final long serialVersionUID = -5555522620060077046L;
+
     /**
      * Get an IdentityStack containing the contents of the specified Stack.
      * @param s the Stack to copy; ignored if null.

Modified: ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/taskdefs/CopyTest.java
URL: http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/taskdefs/CopyTest.java?rev=593037&r1=593036&r2=593037&view=diff
==============================================================================
--- ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/taskdefs/CopyTest.java
(original)
+++ ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/taskdefs/CopyTest.java
Wed Nov  7 22:25:32 2007
@@ -181,7 +181,7 @@
         File file1 = new File(getProjectDir(), getProject().getProperty("to.dir")+"/fileNR.txt");
         assertTrue(file1.exists());
         try {
-            String file1Content = FILE_UTILS.readFully(new FileReader(file1));
+            String file1Content = FileUtils.readFully(new FileReader(file1));
             assertEquals("This is file 42", file1Content);
         } catch (IOException e) {
             // no-op: not a real business error

Modified: ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/AbstractFileSetTest.java
URL: http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/AbstractFileSetTest.java?rev=593037&r1=593036&r2=593037&view=diff
==============================================================================
--- ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/AbstractFileSetTest.java
(original)
+++ ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/AbstractFileSetTest.java
Wed Nov  7 22:25:32 2007
@@ -55,7 +55,7 @@
         AbstractFileSet f = getInstance();
         f.setIncludes("**/*.java");
         try {
-            f.setRefid(new Reference("dummyref"));
+            f.setRefid(new Reference(getProject(), "dummyref"));
             fail("Can add reference to "
                  + f.getDataTypeName()
                  + " with elements from setIncludes");
@@ -67,7 +67,7 @@
         f = getInstance();
         f.createPatternSet();
         try {
-            f.setRefid(new Reference("dummyref"));
+            f.setRefid(new Reference(getProject(), "dummyref"));
             fail("Can add reference to "
                  + f.getDataTypeName()
                  + " with nested patternset element.");
@@ -79,7 +79,7 @@
         f = getInstance();
         f.createInclude();
         try {
-            f.setRefid(new Reference("dummyref"));
+            f.setRefid(new Reference(getProject(), "dummyref"));
             fail("Can add reference to "
                  + f.getDataTypeName()
                  + " with nested include element.");
@@ -89,7 +89,7 @@
         }
 
         f = getInstance();
-        f.setRefid(new Reference("dummyref"));
+        f.setRefid(new Reference(getProject(), "dummyref"));
         try {
             f.setIncludes("**/*.java");
             fail("Can set includes in "
@@ -185,7 +185,7 @@
     public void testCircularReferenceCheck() {
         AbstractFileSet f = getInstance();
         project.addReference("dummy", f);
-        f.setRefid(new Reference("dummy"));
+        f.setRefid(new Reference(getProject(), "dummy"));
         try {
             f.getDir(project);
             fail("Can make " + f.getDataTypeName()
@@ -206,13 +206,13 @@
         // dummy1 --> dummy2 --> dummy3 --> dummy1
         AbstractFileSet f1 = getInstance();
         project.addReference("dummy1", f1);
-        f1.setRefid(new Reference("dummy2"));
+        f1.setRefid(new Reference(getProject(), "dummy2"));
         AbstractFileSet f2 = getInstance();
         project.addReference("dummy2", f2);
-        f2.setRefid(new Reference("dummy3"));
+        f2.setRefid(new Reference(getProject(), "dummy3"));
         AbstractFileSet f3 = getInstance();
         project.addReference("dummy3", f3);
-        f3.setRefid(new Reference("dummy1"));
+        f3.setRefid(new Reference(getProject(), "dummy1"));
         try {
             f1.getDir(project);
             fail("Can make circular reference.");
@@ -232,10 +232,10 @@
         // (which has the Project's basedir as root).
         f1 = getInstance();
         project.addReference("dummy1", f1);
-        f1.setRefid(new Reference("dummy2"));
+        f1.setRefid(new Reference(getProject(), "dummy2"));
         f2 = getInstance();
         project.addReference("dummy2", f2);
-        f2.setRefid(new Reference("dummy3"));
+        f2.setRefid(new Reference(getProject(), "dummy3"));
         f3 = getInstance();
         project.addReference("dummy3", f3);
         f3.setDir(project.resolveFile("."));

Modified: ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/FileListTest.java
URL: http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/FileListTest.java?rev=593037&r1=593036&r2=593037&view=diff
==============================================================================
--- ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/FileListTest.java
(original)
+++ ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/FileListTest.java
Wed Nov  7 22:25:32 2007
@@ -41,7 +41,7 @@
         FileList f = new FileList();
         f.setDir(project.resolveFile("."));
         try {
-            f.setRefid(new Reference("dummyref"));
+            f.setRefid(new Reference(getProject(), "dummyref"));
             fail("Can add reference to FileList with directory attribute set.");
         } catch (BuildException be) {
             assertEquals("You must not specify more than one attribute when using refid",
@@ -51,7 +51,7 @@
         f = new FileList();
         f.setFiles("foo.xml,c/d/bar.xml");
         try {
-            f.setRefid(new Reference("dummyref"));
+            f.setRefid(new Reference(getProject(), "dummyref"));
             fail("Can add reference to FileList with file attribute set.");
         } catch (BuildException be) {
             assertEquals("You must not specify more than one attribute when using refid",
@@ -59,7 +59,7 @@
         }
 
         f = new FileList();
-        f.setRefid(new Reference("dummyref"));
+        f.setRefid(new Reference(getProject(), "dummyref"));
         try {
             f.setFiles("a/b/foo.java");
             fail("Can set files in FileList that is a reference.");
@@ -79,7 +79,7 @@
     public void testCircularReferenceCheck() {
         FileList f = new FileList();
         project.addReference("dummy", f);
-        f.setRefid(new Reference("dummy"));
+        f.setRefid(new Reference(getProject(), "dummy"));
         try {
             f.getDir(project);
             fail("Can make FileList a Reference to itself.");
@@ -98,13 +98,13 @@
         // dummy1 --> dummy2 --> dummy3 --> dummy1
         FileList f1 = new FileList();
         project.addReference("dummy1", f1);
-        f1.setRefid(new Reference("dummy2"));
+        f1.setRefid(new Reference(getProject(), "dummy2"));
         FileList f2 = new FileList();
         project.addReference("dummy2", f2);
-        f2.setRefid(new Reference("dummy3"));
+        f2.setRefid(new Reference(getProject(), "dummy3"));
         FileList f3 = new FileList();
         project.addReference("dummy3", f3);
-        f3.setRefid(new Reference("dummy1"));
+        f3.setRefid(new Reference(getProject(), "dummy1"));
         try {
             f1.getDir(project);
             fail("Can make circular reference.");
@@ -124,10 +124,10 @@
         // (which has the Project's basedir as root).
         f1 = new FileList();
         project.addReference("dummy1", f1);
-        f1.setRefid(new Reference("dummy2"));
+        f1.setRefid(new Reference(getProject(), "dummy2"));
         f2 = new FileList();
         project.addReference("dummy2", f2);
-        f2.setRefid(new Reference("dummy3"));
+        f2.setRefid(new Reference(getProject(), "dummy3"));
         f3 = new FileList();
         project.addReference("dummy3", f3);
         f3.setDir(project.resolveFile("."));

Modified: ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/MapperTest.java
URL: http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/MapperTest.java?rev=593037&r1=593036&r2=593037&view=diff
==============================================================================
--- ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/MapperTest.java
(original)
+++ ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/MapperTest.java
Wed Nov  7 22:25:32 2007
@@ -54,7 +54,7 @@
         Mapper m = new Mapper(project);
         m.setFrom("*.java");
         try {
-            m.setRefid(new Reference("dummyref"));
+            m.setRefid(new Reference(project, "dummyref"));
             fail("Can add reference to Mapper with from attribute set");
         } catch (BuildException be) {
             assertEquals("You must not specify more than one attribute when using refid",
@@ -62,7 +62,7 @@
         }
 
         m = new Mapper(project);
-        m.setRefid(new Reference("dummyref"));
+        m.setRefid(new Reference(project, "dummyref"));
         try {
             m.setFrom("*.java");
             fail("Can set from in Mapper that is a reference.");
@@ -72,7 +72,7 @@
         }
 
         m = new Mapper(project);
-        m.setRefid(new Reference("dummyref"));
+        m.setRefid(new Reference(project, "dummyref"));
         try {
             m.setTo("*.java");
             fail("Can set to in Mapper that is a reference.");
@@ -94,7 +94,7 @@
     public void testCircularReferenceCheck() {
         Mapper m = new Mapper(project);
         project.addReference("dummy", m);
-        m.setRefid(new Reference("dummy"));
+        m.setRefid(new Reference(project, "dummy"));
         try {
             m.getImplementation();
             fail("Can make Mapper a Reference to itself.");
@@ -106,13 +106,13 @@
         // dummy1 --> dummy2 --> dummy3 --> dummy1
         Mapper m1 = new Mapper(project);
         project.addReference("dummy1", m1);
-        m1.setRefid(new Reference("dummy2"));
+        m1.setRefid(new Reference(project, "dummy2"));
         Mapper m2 = new Mapper(project);
         project.addReference("dummy2", m2);
-        m2.setRefid(new Reference("dummy3"));
+        m2.setRefid(new Reference(project, "dummy3"));
         Mapper m3 = new Mapper(project);
         project.addReference("dummy3", m3);
-        m3.setRefid(new Reference("dummy1"));
+        m3.setRefid(new Reference(project, "dummy1"));
         try {
             m1.getImplementation();
             fail("Can make circular reference.");
@@ -125,10 +125,10 @@
         // (which holds a glob mapper from "*.java" to "*.class"
         m1 = new Mapper(project);
         project.addReference("dummy1", m1);
-        m1.setRefid(new Reference("dummy2"));
+        m1.setRefid(new Reference(project, "dummy2"));
         m2 = new Mapper(project);
         project.addReference("dummy2", m2);
-        m2.setRefid(new Reference("dummy3"));
+        m2.setRefid(new Reference(project, "dummy3"));
         m3 = new Mapper(project);
         project.addReference("dummy3", m3);
         Mapper.MapperType mt = new Mapper.MapperType();

Modified: ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/PathTest.java
URL: http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/PathTest.java?rev=593037&r1=593036&r2=593037&view=diff
==============================================================================
--- ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/PathTest.java
(original)
+++ ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/PathTest.java
Wed Nov  7 22:25:32 2007
@@ -387,7 +387,7 @@
     public void testEmptyElementIfIsReference() {
         Path p = new Path(project, "/a:/a");
         try {
-            p.setRefid(new Reference("dummyref"));
+            p.setRefid(new Reference(project, "dummyref"));
             fail("Can add reference to Path with elements from constructor");
         } catch (BuildException be) {
             assertEquals("You must not specify more than one attribute when using refid",
@@ -397,7 +397,7 @@
         p = new Path(project);
         p.setLocation(new File("/a"));
         try {
-            p.setRefid(new Reference("dummyref"));
+            p.setRefid(new Reference(project, "dummyref"));
             fail("Can add reference to Path with elements from setLocation");
         } catch (BuildException be) {
             assertEquals("You must not specify more than one attribute when using refid",
@@ -407,7 +407,7 @@
         Path another = new Path(project, "/a:/a");
         project.addReference("dummyref", another);
         p = new Path(project);
-        p.setRefid(new Reference("dummyref"));
+        p.setRefid(new Reference(project, "dummyref"));
         try {
             p.setLocation(new File("/a"));
             fail("Can set location in Path that is a reference.");
@@ -468,7 +468,7 @@
     public void testCircularReferenceCheck() {
         Path p = new Path(project);
         project.addReference("dummy", p);
-        p.setRefid(new Reference("dummy"));
+        p.setRefid(new Reference(project, "dummy"));
         try {
             p.list();
             fail("Can make Path a Reference to itself.");
@@ -484,7 +484,7 @@
         project.addReference("dummy2", p2);
         Path p3 = p2.createPath();
         project.addReference("dummy3", p3);
-        p3.setRefid(new Reference("dummy1"));
+        p3.setRefid(new Reference(project, "dummy1"));
         try {
             p1.list();
             fail("Can make circular reference.");

Modified: ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/PatternSetTest.java
URL: http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/PatternSetTest.java?rev=593037&r1=593036&r2=593037&view=diff
==============================================================================
--- ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/PatternSetTest.java
(original)
+++ ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/PatternSetTest.java
Wed Nov  7 22:25:32 2007
@@ -49,7 +49,7 @@
         PatternSet p = new PatternSet();
         p.setIncludes("**/*.java");
         try {
-            p.setRefid(new Reference("dummyref"));
+            p.setRefid(new Reference(project, "dummyref"));
             fail("Can add reference to PatternSet with elements from setIncludes");
         } catch (BuildException be) {
             assertEquals("You must not specify more than one attribute when using refid",
@@ -57,7 +57,7 @@
         }
 
         p = new PatternSet();
-        p.setRefid(new Reference("dummyref"));
+        p.setRefid(new Reference(project, "dummyref"));
         try {
             p.setIncludes("**/*.java");
             fail("Can set includes in PatternSet that is a reference.");
@@ -67,7 +67,7 @@
         }
 
         p = new PatternSet();
-        p.setRefid(new Reference("dummyref"));
+        p.setRefid(new Reference(project, "dummyref"));
         try {
             p.setIncludesfile(new File("/a"));
             fail("Can set includesfile in PatternSet that is a reference.");
@@ -122,7 +122,7 @@
     public void testCircularReferenceCheck() {
         PatternSet p = new PatternSet();
         project.addReference("dummy", p);
-        p.setRefid(new Reference("dummy"));
+        p.setRefid(new Reference(project, "dummy"));
         try {
             p.getIncludePatterns(project);
             fail("Can make PatternSet a Reference to itself.");
@@ -141,13 +141,13 @@
         // dummy1 --> dummy2 --> dummy3 --> dummy1
         PatternSet p1 = new PatternSet();
         project.addReference("dummy1", p1);
-        p1.setRefid(new Reference("dummy2"));
+        p1.setRefid(new Reference(project, "dummy2"));
         PatternSet p2 = new PatternSet();
         project.addReference("dummy2", p2);
-        p2.setRefid(new Reference("dummy3"));
+        p2.setRefid(new Reference(project, "dummy3"));
         PatternSet p3 = new PatternSet();
         project.addReference("dummy3", p3);
-        p3.setRefid(new Reference("dummy1"));
+        p3.setRefid(new Reference(project, "dummy1"));
         try {
             p1.getIncludePatterns(project);
             fail("Can make circular reference.");
@@ -167,10 +167,10 @@
         // (which holds patterns "include" and "exclude")
         p1 = new PatternSet();
         project.addReference("dummy1", p1);
-        p1.setRefid(new Reference("dummy2"));
+        p1.setRefid(new Reference(project, "dummy2"));
         p2 = new PatternSet();
         project.addReference("dummy2", p2);
-        p2.setRefid(new Reference("dummy3"));
+        p2.setRefid(new Reference(project, "dummy3"));
         p3 = new PatternSet();
         project.addReference("dummy3", p3);
         p3.setIncludes("include");

Modified: ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/TarFileSetTest.java
URL: http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/TarFileSetTest.java?rev=593037&r1=593036&r2=593037&view=diff
==============================================================================
--- ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/TarFileSetTest.java
(original)
+++ ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/TarFileSetTest.java
Wed Nov  7 22:25:32 2007
@@ -86,7 +86,7 @@
         }
         // check that reference tarfilesets cannot have specific attributes
         f = (TarFileSet)getInstance();
-        f.setRefid(new Reference("test"));
+        f.setRefid(new Reference(getProject(), "test"));
         try {
             f.setSrc(new File("example.tar"));
             fail("Can add src to "
@@ -104,7 +104,7 @@
         f.setDirMode("530");
         getProject().addReference("test",f);
         TarFileSet zid=(TarFileSet)getInstance();
-        zid.setRefid(new Reference("test"));
+        zid.setRefid(new Reference(getProject(), "test"));
         assertTrue("src attribute copied by copy constructor",zid.getSrc(getProject()).equals(f.getSrc(getProject())));
         assertTrue("prefix attribute copied by copy constructor",f.getPrefix(getProject()).equals(zid.getPrefix(getProject())));
         assertTrue("file mode attribute copied by copy constructor",f.getFileMode(getProject())==zid.getFileMode(getProject()));

Modified: ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/XMLCatalogTest.java
URL: http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/XMLCatalogTest.java?rev=593037&r1=593036&r2=593037&view=diff
==============================================================================
--- ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/XMLCatalogTest.java
(original)
+++ ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/XMLCatalogTest.java
Wed Nov  7 22:25:32 2007
@@ -136,7 +136,7 @@
         project.addReference("catalog", catalog);
 
         try {
-            catalog.setRefid(new Reference("dummyref"));
+            catalog.setRefid(new Reference(project, "dummyref"));
             fail("Can add reference to nonexistent XMLCatalog");
         } catch (BuildException be) {
             assertEquals("You must not specify more than one "
@@ -144,7 +144,7 @@
         }
 
         XMLCatalog catalog2 = newCatalog();
-        catalog2.setRefid(new Reference("catalog"));
+        catalog2.setRefid(new Reference(project, "catalog"));
 
         try {
             catalog2.addConfiguredXMLCatalog(catalog);
@@ -159,7 +159,7 @@
 
         // catalog <--> catalog
         project.addReference("catalog", catalog);
-        catalog.setRefid(new Reference("catalog"));
+        catalog.setRefid(new Reference(project, "catalog"));
 
         try {
             InputSource result = catalog.resolveEntity("PUBLIC ID ONE",
@@ -180,9 +180,9 @@
         XMLCatalog catalog3 = newCatalog();
         project.addReference("catalog3", catalog3);
 
-        catalog3.setRefid(new Reference("catalog1"));
-        catalog2.setRefid(new Reference("catalog3"));
-        catalog1.setRefid(new Reference("catalog2"));
+        catalog3.setRefid(new Reference(project, "catalog1"));
+        catalog2.setRefid(new Reference(project, "catalog3"));
+        catalog1.setRefid(new Reference(project, "catalog2"));
 
         try {
             InputSource result = catalog1.resolveEntity("PUBLIC ID ONE",
@@ -267,8 +267,8 @@
         XMLCatalog catalog2 = newCatalog();
         project.addReference("catalog2", catalog1);
 
-        catalog1.setRefid(new Reference("catalog"));
-        catalog2.setRefid(new Reference("catalog1"));
+        catalog1.setRefid(new Reference(project, "catalog"));
+        catalog2.setRefid(new Reference(project, "catalog1"));
 
         try {
             InputSource result = catalog2.resolveEntity(publicId,

Modified: ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/ZipFileSetTest.java
URL: http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/ZipFileSetTest.java?rev=593037&r1=593036&r2=593037&view=diff
==============================================================================
--- ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/ZipFileSetTest.java
(original)
+++ ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/ZipFileSetTest.java
Wed Nov  7 22:25:32 2007
@@ -86,7 +86,7 @@
         }
         // check that reference zipfilesets cannot have specific attributes
         f = (ZipFileSet)getInstance();
-        f.setRefid(new Reference("test"));
+        f.setRefid(new Reference(getProject(), "test"));
         try {
             f.setSrc(new File("example.zip"));
             fail("Can add src to "
@@ -104,7 +104,7 @@
         f.setDirMode("530");
         getProject().addReference("test",f);
         ZipFileSet zid=(ZipFileSet)getInstance();
-        zid.setRefid(new Reference("test"));
+        zid.setRefid(new Reference(getProject(), "test"));
         assertTrue("src attribute copied by copy constructor",zid.getSrc(getProject()).equals(f.getSrc(getProject())));
         assertTrue("prefix attribute copied by copy constructor",f.getPrefix(getProject()).equals(zid.getPrefix(getProject())));
         assertTrue("file mode attribute copied by copy constructor",f.getFileMode(getProject())==zid.getFileMode(getProject()));

Modified: ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/selectors/ModifiedSelectorTest.java
URL: http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/selectors/ModifiedSelectorTest.java?rev=593037&r1=593036&r2=593037&view=diff
==============================================================================
--- ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/selectors/ModifiedSelectorTest.java
(original)
+++ ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/types/selectors/ModifiedSelectorTest.java
Wed Nov  7 22:25:32 2007
@@ -152,7 +152,7 @@
 
     public void testIllegalCustomAlgorithm() {
         try {
-            String algo = getAlgoName("java.lang.Object");
+            getAlgoName("java.lang.Object");
             fail("Illegal classname used.");
         } catch (Exception e) {
             assertTrue("Wrong exception type: " + e.getClass().getName(), e instanceof BuildException);
@@ -167,7 +167,7 @@
     public void testNonExistentCustomAlgorithm() {
         boolean noExcThrown = false;
         try {
-            String algo = getAlgoName("non.existent.custom.Algorithm");
+            getAlgoName("non.existent.custom.Algorithm");
             noExcThrown = true;
         } catch (Exception e) {
             if (noExcThrown) {
@@ -367,8 +367,7 @@
 
             s.setUpdate(true);
 
-            // does the selection
-            String results = selectionString(s);
+            selectionString(s);
 
             // evaluate correctness
             assertTrue("Cache file is not created.", cachefile.exists());
@@ -404,8 +403,7 @@
             s.addParam(createParam("cache.cachefile", cachefile.getAbsolutePath()));
             s.addParam(createParam("cache", "propertyfile"));
 
-            // does the selection
-            String results = selectionString(s);
+            selectionString(s);
 
             // evaluate correctness
             assertTrue("Cache file is not created.", cachefile.exists());



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


Mime
View raw message