Commit Graph

21 Commits

Author SHA1 Message Date
Olly Betts 1a31e9dc0c [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
2023-05-12 08:48:20 +12:00
William S Fulton c10a84c775 Cosmetic stray semi-colon removal after %typemap using quotes 2022-08-31 19:40:13 +01:00
William S Fulton bf761998ed SWIGTYPE && input typemaps now assume object has been moved
Change these typemaps to assume that after a function call,
the parameter has been moved. The parameter's proxy class
that owns the C++ object thus has the underlying pointer set
to null so the object cannot be used again and the object is deleted.

Scrap new javarelease typemap and move contents into javabody typemap.
2022-07-17 15:15:24 +01:00
William S Fulton 6b361bf050 Add Java support for std::unique<T> for input parameters.
This works by transferring ownership of the underlying C++ memory
from the target language proxy class to an instance of the unique_ptr
which is passed to the wrapped function via std::move.

The proxy class has a new swigRelease() method which sets the
underlying C++ pointer for the proxy class to null, so working
in much the same way as std::unique_ptr::release(). Any attempt at
using the proxy class will be the same as if the delete() function
has been called on the proxy class. That is, using a C++ null pointer,
when a non-null pointer is usually expected.

This commit relies on the previous commit that uses std::move
on the temporary variable used for the wrapped function's input parameter
as std::unique_ptr is not copyable, it has move-only semantics.
2022-07-17 15:15:24 +01:00
William S Fulton 6d8c1c47f3 Merge branch 'java9_finalize_warnings'
* java9_finalize_warnings:
  [Java] Suppress deprecation warning on finalize method
2019-02-21 13:46:59 -08:00
William S Fulton 196a965067 test-suite fixes for compilers that don't support vararg macros
Split TESTCASE_THROW into multiple macros taking different number of arguments.
Fixes Visual Studio compiler errors.
2018-05-06 09:46:37 +01:00
William S Fulton 35b792daed test-suite support for C++17: exception specification throw removal 2018-05-04 20:02:13 +01:00
Sylvain Joubert db34df38f3 [Java] Suppress deprecation warning on finalize method
Java 9 deprecates the finalize method.
For now just suppress the deprecation warning.
Fixes #1237
2018-04-23 13:57:19 +02:00
William S Fulton af8d176c40 java_throws testcase warning fix 2018-01-12 23:10:02 +00:00
William S Fulton 49af1907b8 Add missing Java throws clause for interfaces when using the %interface family of macros.
Fixes #1156.
2018-01-12 07:34:32 +00:00
William S Fulton 760c008311 Warning fixes for gcc-7
warning: dynamic exception specifications are deprecated in C++11; use 'noexcept' instead [-Wdeprecated]
2017-02-06 20:30:09 +00:00
William S Fulton c7b7078dd0 Fix classes not being added into Java method's throws clause when %catches is used
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11584 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-16 00:04:29 +00:00
William S Fulton 9db99bfb3e comment correction
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11010 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-12-28 20:36:21 +00:00
William S Fulton e6f5cdac9f Fix #2153773 - %nojavaexception - disabling and clearing Java checked exceptions
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10998 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-12-23 07:44:59 +00:00
William S Fulton d98658d30b Suppress ecj warnings
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10226 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-01-31 22:58:43 +00:00
William S Fulton 16d0216061 forgotten checkin - warning fixes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8574 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-27 23:22:27 +00:00
William S Fulton ff32791e3d redundant comment removed
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6330 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-10-05 22:32:27 +00:00
William S Fulton de4c1d3322 Various warning fixes for Visual Studio 2003 C++ compiler
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6204 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-09-01 22:24:24 +00:00
William S Fulton 24f91357f2 Test for %javaexception classes being added to a method's throws clause
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6003 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-06-27 21:07:15 +00:00
William S Fulton ebffad0ba2 Added javain, javout and newfree throws attributes tests
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4931 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-06-27 13:17:20 +00:00
Dave Beazley 12a43edc2d The great merge
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4141 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2002-11-30 22:01:28 +00:00