ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject [4/4] ant-antlibs-compress git commit: backwards-compatible introduction of generics
Date Sat, 06 May 2017 17:46:31 GMT
backwards-compatible introduction of generics


Project: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/commit/05aaa77a
Tree: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/tree/05aaa77a
Diff: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/diff/05aaa77a

Branch: refs/heads/master
Commit: 05aaa77a03f766789355c884da3b48fdb5982b41
Parents: f240237
Author: Stefan Bodewig <bodewig@apache.org>
Authored: Sat May 6 19:45:56 2017 +0200
Committer: Stefan Bodewig <bodewig@apache.org>
Committed: Sat May 6 19:45:56 2017 +0200

----------------------------------------------------------------------
 .../org/apache/ant/compress/resources/SevenZResource.java |  3 ++-
 .../org/apache/ant/compress/taskdefs/ArchiveBase.java     | 10 +++++-----
 src/main/org/apache/ant/compress/taskdefs/Pack200.java    |  4 ++--
 .../apache/ant/compress/taskdefs/Pack200Normalize.java    |  2 +-
 src/main/org/apache/ant/compress/taskdefs/SevenZ.java     |  4 ++--
 src/main/org/apache/ant/compress/taskdefs/UnPack200.java  |  4 ++--
 6 files changed, 14 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/blob/05aaa77a/src/main/org/apache/ant/compress/resources/SevenZResource.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/ant/compress/resources/SevenZResource.java b/src/main/org/apache/ant/compress/resources/SevenZResource.java
index d6410c7..9a5d25d 100644
--- a/src/main/org/apache/ant/compress/resources/SevenZResource.java
+++ b/src/main/org/apache/ant/compress/resources/SevenZResource.java
@@ -32,6 +32,7 @@ import org.apache.ant.compress.util.SevenZStreamFactory;
 import org.apache.commons.compress.archivers.ArchiveEntry;
 import org.apache.commons.compress.archivers.sevenz.SevenZArchiveEntry;
 import org.apache.commons.compress.archivers.sevenz.SevenZFile;
+import org.apache.commons.compress.archivers.sevenz.SevenZMethodConfiguration;
 
 /**
  * A Resource representation of an entry in a sevenzfile.
@@ -40,7 +41,7 @@ import org.apache.commons.compress.archivers.sevenz.SevenZFile;
  */
 public final class SevenZResource extends CommonsCompressArchiveResource {
 
-    private Iterable/*<? extends SevenZMethodConfiguration>*/ contentMethods;
+    private Iterable<? extends SevenZMethodConfiguration> contentMethods;
 
     /**
      * Default constructor.

http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/blob/05aaa77a/src/main/org/apache/ant/compress/taskdefs/ArchiveBase.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/ant/compress/taskdefs/ArchiveBase.java b/src/main/org/apache/ant/compress/taskdefs/ArchiveBase.java
index 7dbc44a..74e34fc 100644
--- a/src/main/org/apache/ant/compress/taskdefs/ArchiveBase.java
+++ b/src/main/org/apache/ant/compress/taskdefs/ArchiveBase.java
@@ -82,7 +82,7 @@ public abstract class ArchiveBase extends Task {
     private EntryBuilder entryBuilder;
 
     private Resource dest;
-    private List/*<ResourceCollection>*/ sources = new ArrayList();
+    private List<ResourceCollection> sources = new ArrayList();
     private Mode mode = new Mode();
     private String encoding;
     private boolean filesOnly = true;
@@ -358,8 +358,8 @@ public abstract class ArchiveBase extends Task {
     protected Collection/*<ResourceWithFlags>*/ findSources()
         throws IOException {
 
-        List/*<ResourceWithFlags>*/ l = new ArrayList/*<ResourceWithFlags>*/();
-        Set/*<String>*/ addedNames = new HashSet/*<String>*/();
+        List<ResourceWithFlags> l = new ArrayList<>();
+        Set<String> addedNames = new HashSet<>();
         for (Iterator rcs = sources.iterator(); rcs.hasNext(); ) {
             ResourceCollection rc = (ResourceCollection) rcs.next();
             ResourceCollectionFlags rcFlags = getFlags(rc);
@@ -428,7 +428,7 @@ public abstract class ArchiveBase extends Task {
                                     existingEntries
                                     .getDirectoryScanner(getProject()));
         if (outOfDate.length > 0 && Mode.UPDATE.equals(getMode().getValue()))
{
-            HashSet/*<String>*/ oodNames = new HashSet/*<String>*/();
+            HashSet<String> oodNames = new HashSet<>();
             for (int i = 0; i < outOfDate.length; i++) {
                 oodNames.add(outOfDate[i].getName());
             }
@@ -471,7 +471,7 @@ public abstract class ArchiveBase extends Task {
                              Collection/*<ResourceWithFlags>*/ src)
         throws IOException {
 
-        List/*<ResourceWithFlags>*/ l = new ArrayList/*<ResourceWithFlags>*/();
+        List<ResourceWithFlags> l = new ArrayList<>();
         ResourceCollectionFlags rcFlags = getFlags(target);
 
         Restrict res = new Restrict();

http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/blob/05aaa77a/src/main/org/apache/ant/compress/taskdefs/Pack200.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/ant/compress/taskdefs/Pack200.java b/src/main/org/apache/ant/compress/taskdefs/Pack200.java
index 3747785..83e30d3 100644
--- a/src/main/org/apache/ant/compress/taskdefs/Pack200.java
+++ b/src/main/org/apache/ant/compress/taskdefs/Pack200.java
@@ -42,7 +42,7 @@ import org.apache.tools.ant.types.Resource;
 public final class Pack200 extends PackBase {
 
     private Pack200StrategyEnum strategy = Pack200StrategyEnum.IN_MEMORY;
-    private final Map/*<String, String>*/ properties = new HashMap();
+    private final Map<String, String> properties = new HashMap<>();
 
     public Pack200() {
         super(new PackBase.ResourceWrapper() {
@@ -115,4 +115,4 @@ public final class Pack200 extends PackBase {
             return (Pack200Strategy) STRATEGIES.get(getValue());
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/blob/05aaa77a/src/main/org/apache/ant/compress/taskdefs/Pack200Normalize.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/ant/compress/taskdefs/Pack200Normalize.java b/src/main/org/apache/ant/compress/taskdefs/Pack200Normalize.java
index 5eb08da..d071523 100644
--- a/src/main/org/apache/ant/compress/taskdefs/Pack200Normalize.java
+++ b/src/main/org/apache/ant/compress/taskdefs/Pack200Normalize.java
@@ -46,7 +46,7 @@ import org.apache.tools.ant.util.FileUtils;
 public class Pack200Normalize extends Task {
     private File src, dest;
     private boolean force = false;
-    private Map/*<String, String>*/ properties = new HashMap();
+    private Map<String, String> properties = new HashMap();
 
     /**
      * The JAR archive to normalize.

http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/blob/05aaa77a/src/main/org/apache/ant/compress/taskdefs/SevenZ.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/ant/compress/taskdefs/SevenZ.java b/src/main/org/apache/ant/compress/taskdefs/SevenZ.java
index 845ca2f..99b72de 100644
--- a/src/main/org/apache/ant/compress/taskdefs/SevenZ.java
+++ b/src/main/org/apache/ant/compress/taskdefs/SevenZ.java
@@ -44,7 +44,7 @@ public class SevenZ extends ArchiveBase {
 
     private boolean keepCompression = false;
     private String contentCompression;
-    private List/*<SevenZMethodConfiguration>*/ contentMethods;
+    private List<SevenZMethodConfiguration> contentMethods;
 
     public SevenZ() {
         setFactory(new SevenZStreamFactory() {
@@ -112,7 +112,7 @@ public class SevenZ extends ArchiveBase {
             throw new BuildException("you must not specify contentCompression and nested
contentMethod elements at the same time");
         }
         if (contentMethods == null) {
-            contentMethods = new ArrayList/*<SevenZMethodConfiguration>*/();
+            contentMethods = new ArrayList<>();
         }
         contentMethods.add(asMethodConfiguration(cm));
     }

http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/blob/05aaa77a/src/main/org/apache/ant/compress/taskdefs/UnPack200.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/ant/compress/taskdefs/UnPack200.java b/src/main/org/apache/ant/compress/taskdefs/UnPack200.java
index 0d936f3..0877f1d 100644
--- a/src/main/org/apache/ant/compress/taskdefs/UnPack200.java
+++ b/src/main/org/apache/ant/compress/taskdefs/UnPack200.java
@@ -37,7 +37,7 @@ public final class UnPack200 extends UnpackBase {
 
     private Pack200.Pack200StrategyEnum strategy =
         Pack200.Pack200StrategyEnum.IN_MEMORY;
-    private final Map/*<String, String>*/ properties = new HashMap();
+    private final Map<String, String> properties = new HashMap();
 
     public UnPack200() {
         super(".pack");
@@ -76,4 +76,4 @@ public final class UnPack200 extends UnpackBase {
         properties.put(prop.getKey(), prop.getValue());
     }
 
-}
\ No newline at end of file
+}


Mime
View raw message