[Git][java-team/metro-policy][master] Fix the build failure with Java 21 (Closes: #1057526)

Emmanuel Bourg (@ebourg) gitlab at salsa.debian.org
Thu Jul 11 10:36:09 BST 2024



Emmanuel Bourg pushed to branch master at Debian Java Maintainers / metro-policy


Commits:
fe1c9b3e by Vladimir Petko at 2024-07-11T09:35:50+00:00
Fix the build failure with Java 21 (Closes: #1057526)

- - - - -


3 changed files:

- debian/changelog
- + debian/patches/java21-stack-offset.patch
- + debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+metro-policy (2.7.2-4) UNRELEASED; urgency=medium
+
+  * d/p/java21-stack-offset.patch: add proposed fix for Java 21 ftbfs
+    (Closes: #1057526).
+
+ -- Vladimir Petko <vladimir.petko at canonical.com>  Tue, 30 Jan 2024 14:46:29 +1300
+
 metro-policy (2.7.2-3) unstable; urgency=medium
 
   * Removed the dependency on libactivation-java


=====================================
debian/patches/java21-stack-offset.patch
=====================================
@@ -0,0 +1,23 @@
+Description: check for "invoke" in getCallerMethodName()
+ Java 21 has same "shorter" stacktrace same as Mac OS X.
+ The method name in the trace is "invoke" instead of "invoke0".
+ This is a bit brittle, but since this approach is already used
+ in the project, I have just updated the condition.
+ Probably the better way would be to check the environment.
+Author: Vladimir Petko <vladimir.petko at canonical.com>
+Bug: https://github.com/eclipse-ee4j/metro-policy/pull/29
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1057526
+Last-Update: 2024-01-30
+--- a/src/main/java/com/sun/xml/ws/policy/privateutil/PolicyUtils.java
++++ b/src/main/java/com/sun/xml/ws/policy/privateutil/PolicyUtils.java
+@@ -98,8 +98,8 @@
+          */
+         public static String getCallerMethodName() {
+             String result = getStackMethodName(5);
+-            if (result.equals("invoke0")) {
+-                // We are likely running on Mac OS X, which returns a shorter stack trace
++            if (result.equals("invoke0") || result.equals("invoke")) {
++                // We are likely running on Mac OS X or Java 21, which returns a shorter stack trace
+                 result = getStackMethodName(4);
+             }
+             return result;


=====================================
debian/patches/series
=====================================
@@ -0,0 +1 @@
+java21-stack-offset.patch



View it on GitLab: https://salsa.debian.org/java-team/metro-policy/-/commit/fe1c9b3e63d179d66536077018ef1bb6157b0ae1

-- 
This project does not include diff previews in email notifications.
View it on GitLab: https://salsa.debian.org/java-team/metro-policy/-/commit/fe1c9b3e63d179d66536077018ef1bb6157b0ae1
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/20240711/e1dd8b09/attachment.htm>


More information about the pkg-java-commits mailing list