ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Matèrne (jhm) <apa...@materne.de>
Subject AW: ant git commit: Arrays.copyOf is Java 1.6 only
Date Wed, 21 Jan 2015 10:03:55 GMT
right, we are tied to Java1.5
http://ant.apache.org/faq.html#java-version


http://www.oracle.com/technetwork/java/eol-135779.html
End of public updates:
Java5: Oct 2009
Java6: Feb 2013
Java7: Apr 2015 (maybe later)
Java8: Mar 2017 (maybe later)

Extended support:
Java5: May 2015 !!!
Java6: Dec 2018
Java7: Jul 2022
Java8: Mar 2025


I think after ending the extended support for Java5 we could update here
this year ...
WDYT?


Jan

> -----Urspr√ľngliche Nachricht-----
> Von: bodewig@apache.org [mailto:bodewig@apache.org]
> Gesendet: Dienstag, 20. Januar 2015 22:00
> An: notifications@ant.apache.org
> Betreff: ant git commit: Arrays.copyOf is Java 1.6 only
> 
> Repository: ant
> Updated Branches:
>   refs/heads/master 0903005b8 -> 66b5f3f06
> 
> 
> Arrays.copyOf is Java 1.6 only
> 
> 
> Project: http://git-wip-us.apache.org/repos/asf/ant/repo
> Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/66b5f3f0
> Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/66b5f3f0
> Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/66b5f3f0
> 
> Branch: refs/heads/master
> Commit: 66b5f3f06ba641ffd22428b8da4f8b14ff45db53
> Parents: 0903005
> Author: Stefan Bodewig <bodewig@apache.org>
> Authored: Tue Jan 20 21:59:36 2015 +0100
> Committer: Stefan Bodewig <bodewig@apache.org>
> Committed: Tue Jan 20 21:59:36 2015 +0100
> 
> ----------------------------------------------------------------------
>  src/main/org/apache/tools/zip/ZipEntry.java | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
> ----------------------------------------------------------------------
> 
> 
> http://git-wip-
> us.apache.org/repos/asf/ant/blob/66b5f3f0/src/main/org/apache/tools/zip
> /ZipEntry.java
> ----------------------------------------------------------------------
> diff --git a/src/main/org/apache/tools/zip/ZipEntry.java
> b/src/main/org/apache/tools/zip/ZipEntry.java
> index f463757..f66baf2 100644
> --- a/src/main/org/apache/tools/zip/ZipEntry.java
> +++ b/src/main/org/apache/tools/zip/ZipEntry.java
> @@ -349,12 +349,18 @@ public class ZipEntry extends
> java.util.zip.ZipEntry implements Cloneable {
>      }
> 
>      private ZipExtraField[] copyOf(ZipExtraField[] src){
> -        return Arrays.copyOf(src, src.length);
> +        return copyOf(src, src.length);
> +    }
> +
> +    private ZipExtraField[] copyOf(ZipExtraField[] src, int length){
> +        ZipExtraField[] cpy = new ZipExtraField[length];
> +        System.arraycopy(src, 0, cpy, 0, Math.min(src.length,
> length));
> +        return cpy;
>      }
> 
>      private ZipExtraField[] getMergedFields() {
>          final ZipExtraField[] zipExtraFields =
> -            Arrays.copyOf(extraFields, extraFields.length + 1);
> +            copyOf(extraFields, extraFields.length + 1);
>          zipExtraFields[zipExtraFields.length] = unparseableExtra;
>          return zipExtraFields;
>      }
> @@ -367,7 +373,7 @@ public class ZipEntry extends
> java.util.zip.ZipEntry implements Cloneable {
>      private ZipExtraField[] getAllExtraFields() {
>          final ZipExtraField[] allExtraFieldsNoCopy =
> getAllExtraFieldsNoCopy();
>          return (allExtraFieldsNoCopy == extraFields)
> -            ? copyOf( allExtraFieldsNoCopy) : allExtraFieldsNoCopy;
> +            ? copyOf(allExtraFieldsNoCopy) : allExtraFieldsNoCopy;
>      }
> 
>      /**
> @@ -401,7 +407,7 @@ public class ZipEntry extends
> java.util.zip.ZipEntry implements Cloneable {
>                      removeExtraField(ze.getHeaderId());
>                  }
>                  final ZipExtraField[] zipExtraFields =
> -                    Arrays.copyOf(extraFields, extraFields.length +
> 1);
> +                    copyOf(extraFields, extraFields.length + 1);
>                  zipExtraFields[extraFields.length] = ze;
>                  extraFields = zipExtraFields;
>              }



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


Mime
View raw message