[Git][java-team/ant][master] Adjust the source/target level to 8 when using Java 21 or later

Emmanuel Bourg (@ebourg) gitlab at salsa.debian.org
Tue Jul 4 07:58:17 BST 2023



Emmanuel Bourg pushed to branch master at Debian Java Maintainers / ant


Commits:
5d6a30c6 by Vladimir Petko at 2023-07-04T08:58:00+02:00
Adjust the source/target level to 8 when using Java 21 or later

- - - - -


2 changed files:

- debian/changelog
- debian/patches/0013-auto-adjust-target.patch


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+ant (1.10.13-2) unstable; urgency=medium
+
+  [ Vladimir Petko ]
+  * Adjust the source/target level to 8 when using Java 21 or later
+    (Closes: #1040264)
+
+ -- Emmanuel Bourg <ebourg at apache.org>  Tue, 04 Jul 2023 08:53:40 +0200
+
 ant (1.10.13-1) unstable; urgency=medium
 
   * New upstream release


=====================================
debian/patches/0013-auto-adjust-target.patch
=====================================
@@ -55,7 +55,7 @@ Forwarded: no
  
 --- /dev/null
 +++ b/src/main/org/apache/tools/ant/taskdefs/LanguageLevel.java
-@@ -0,0 +1,76 @@
+@@ -0,0 +1,82 @@
 +package org.apache.tools.ant.taskdefs;
 +
 +import java.util.ArrayList;
@@ -88,6 +88,10 @@ Forwarded: no
 +            unsupportedLevels.add("1.6");
 +            unsupportedLevels.add("6");
 +        }
++        if (JavaEnvUtils.isAtLeastJavaVersion("21")) {
++            unsupportedLevels.add("1.7");
++            unsupportedLevels.add("7");
++        }
 +
 +        return !unsupportedLevels.contains(level);
 +    }
@@ -96,11 +100,13 @@ Forwarded: no
 +     * Returns the minimum language level supported by the current javac.
 +     */
 +    static String getMinimumLevel() {
-+        if (JavaEnvUtils.isAtLeastJavaVersion("12")) {
++        if (JavaEnvUtils.isAtLeastJavaVersion("21")) {
++            return "8";
++        } else  if (JavaEnvUtils.isAtLeastJavaVersion("12")) {
 +            return "7";
++        } else {
++            return "6";
 +        }
-+
-+        return "6";
 +    }
 +
 +    /**



View it on GitLab: https://salsa.debian.org/java-team/ant/-/commit/5d6a30c69430fb9ad6bdf31101c46655274dc8a4

-- 
View it on GitLab: https://salsa.debian.org/java-team/ant/-/commit/5d6a30c69430fb9ad6bdf31101c46655274dc8a4
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20230704/37821ef9/attachment.htm>


More information about the pkg-java-commits mailing list