summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlly Betts <olly@survex.com>2023-04-25 12:10:35 +1200
committerOlly Betts <olly@survex.com>2023-05-12 08:48:20 +1200
commit1a31e9dc0cbcc458b241293a479123954f55f28c (patch)
treeb05fa8b992d1bb3eff1a6e7da2bf2da35d60b995
parentc67e4dd06fa2ec562a22d2feff6e1446d4476ea7 (diff)
downloadswig-1a31e9dc0cbcc458b241293a479123954f55f28c.tar.gz
[java] Suppress removal warnings for finalize()
The "deprecation" warning has been changed to a "removal" warning with newer JDK versions. This needs to be addressed, but meanwhile it makes running the testsuite unusably noisy so suppressing it seems more helpful than not. Closes: #2556
-rw-r--r--CHANGES.current6
-rw-r--r--Examples/test-suite/java_director.i2
-rw-r--r--Examples/test-suite/java_throws.i2
-rw-r--r--Lib/java/java.swg2
4 files changed, 9 insertions, 3 deletions
diff --git a/CHANGES.current b/CHANGES.current
index e970409f7..285d9e8db 100644
--- a/CHANGES.current
+++ b/CHANGES.current
@@ -7,6 +7,12 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/
Version 4.2.0 (in progress)
===========================
+2023-05-12: olly
+ [Java] #2556 Suppress Java removal warnings on finalize method.
+ SWIG will need to stop relying on finalize methods, but we know
+ that and meanwhile these warnings make the testsuite output very
+ noisy.
+
2023-05-11: olly
#302 #2079 #2474 Parse storage class more flexibly.
diff --git a/Examples/test-suite/java_director.i b/Examples/test-suite/java_director.i
index 6b2cb6dfe..adfffaa5b 100644
--- a/Examples/test-suite/java_director.i
+++ b/Examples/test-suite/java_director.i
@@ -7,7 +7,7 @@
%module(directors="1") java_director
%typemap(javafinalize) SWIGTYPE %{
- @SuppressWarnings("deprecation")
+ @SuppressWarnings({"deprecation", "removal"})
protected void finalize() {
// System.out.println("Finalizing " + this);
delete();
diff --git a/Examples/test-suite/java_throws.i b/Examples/test-suite/java_throws.i
index 67d8d4ebc..7463fee83 100644
--- a/Examples/test-suite/java_throws.i
+++ b/Examples/test-suite/java_throws.i
@@ -183,7 +183,7 @@ try {
// Need to handle the checked exception in NoExceptTest.delete()
%typemap(javafinalize) SWIGTYPE %{
- @SuppressWarnings("deprecation")
+ @SuppressWarnings({"deprecation", "removal"})
protected void finalize() {
try {
delete();
diff --git a/Lib/java/java.swg b/Lib/java/java.swg
index 1c1a56e69..c35876534 100644
--- a/Lib/java/java.swg
+++ b/Lib/java/java.swg
@@ -1304,7 +1304,7 @@ SWIG_JAVABODY_PROXY(protected, protected, SWIGTYPE)
SWIG_JAVABODY_TYPEWRAPPER(protected, protected, protected, SWIGTYPE)
%typemap(javafinalize) SWIGTYPE %{
- @SuppressWarnings("deprecation")
+ @SuppressWarnings({"deprecation", "removal"})
protected void finalize() {
delete();
}