[Android-tools-devel] Bug#1065522: android-platform-external-nist-sip: FTBFS with default Java 21

Vladimir Petko vpa1977 at gmail.com
Fri Mar 8 06:09:08 GMT 2024


Package: android-platform-external-nist-sip
Followup-For: Bug #1065522
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu noble ubuntu-patch
Control: tags -1 patch

Dear Maintainer,

The package fails to build with default Java 21 due to java.util.List API
changes.

In Ubuntu, the attached patch was applied to achieve the following:

  * d/p/java21-update-list-api.patch: add patch to workaround Java 21
    java.util.List API changes (LP: #2056086).


Thanks for considering the patch.


-- System Information:
Debian Release: trixie/sid
  APT prefers mantic-updates
  APT policy: (500, 'mantic-updates'), (500, 'mantic-security'), (500, 'mantic'), (100, 'mantic-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.5.0-21-generic (SMP w/32 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
-------------- next part --------------
diff -Nru android-platform-external-nist-sip-9.0.0+r35/debian/patches/java21-update-list-api.patch android-platform-external-nist-sip-9.0.0+r35/debian/patches/java21-update-list-api.patch
--- android-platform-external-nist-sip-9.0.0+r35/debian/patches/java21-update-list-api.patch	1970-01-01 12:00:00.000000000 +1200
+++ android-platform-external-nist-sip-9.0.0+r35/debian/patches/java21-update-list-api.patch	2024-03-06 14:00:01.000000000 +1300
@@ -0,0 +1,55 @@
+Description: workaround java.util.List changes in Java 21
+ Java 21 adds removeFirst()/removeLast() and getFirst()/getLast() methods
+ that are also defined in the class SIPHeader. Update method signatures
+ to match Java 21 API.
+Author: Vladimir Petko <vladimir.petko at canonical.com>
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/android-platform-external-nist-sip/+bug/2056086
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1065522
+Frwarded: not-needed
+Last-Update: 2024-03-06
+
+--- a/java/gov/nist/javax/sip/header/SIPHeaderList.java
++++ b/java/gov/nist/javax/sip/header/SIPHeaderList.java
+@@ -208,7 +208,7 @@
+      *
+      * @return SIPHeader first element of the list.
+      */
+-    public Header getFirst() {
++    public HDR getFirst() {
+         if (hlist == null || hlist.isEmpty())
+             return null;
+         else
+@@ -220,7 +220,7 @@
+      *
+      * @return SIPHeader last element of the list.
+      */
+-    public Header getLast() {
++    public HDR getLast() {
+         if (hlist == null || hlist.isEmpty())
+             return null;
+         return  hlist.get(hlist.size() - 1);
+@@ -277,18 +277,19 @@
+     /**
+      * Remove the first element of this list.
+      */
+-    public void removeFirst() {
++    public HDR removeFirst() {
+         if (hlist.size() != 0)
+-            hlist.remove(0);
+-
++            return hlist.remove(0);
++        return null;
+     }
+
+     /**
+      * Remove the last element of this list.
+      */
+-    public void removeLast() {
++    public HDR removeLast() {
+         if (hlist.size() != 0)
+-            hlist.remove(hlist.size() - 1);
++            return hlist.remove(hlist.size() - 1);
++        return null;
+     }
+
+     /**
diff -Nru android-platform-external-nist-sip-9.0.0+r35/debian/patches/series android-platform-external-nist-sip-9.0.0+r35/debian/patches/series
--- android-platform-external-nist-sip-9.0.0+r35/debian/patches/series	1970-01-01 12:00:00.000000000 +1200
+++ android-platform-external-nist-sip-9.0.0+r35/debian/patches/series	2024-03-06 14:00:01.000000000 +1300
@@ -0,0 +1 @@
+java21-update-list-api.patch


More information about the Android-tools-devel mailing list