Java 9 deprecation warning fixes for test-suite and examples
This commit is contained in:
parent
6d8c1c47f3
commit
e6035d625a
6 changed files with 20 additions and 12 deletions
|
|
@ -76,7 +76,7 @@ public class runme {
|
||||||
System.out.println( " Trying to set 'status'" );
|
System.out.println( " Trying to set 'status'" );
|
||||||
try {
|
try {
|
||||||
Method m = example.class.getDeclaredMethod("setStatus", new Class[] {Integer.class});
|
Method m = example.class.getDeclaredMethod("setStatus", new Class[] {Integer.class});
|
||||||
m.invoke(example.class, new Object[] {new Integer(0)} );
|
m.invoke(example.class, new Object[] {Integer.valueOf(0)} );
|
||||||
System.out.println( "Hey, what's going on?!?! This shouldn't work" );
|
System.out.println( "Hey, what's going on?!?! This shouldn't work" );
|
||||||
}
|
}
|
||||||
catch (NoSuchMethodException e) {
|
catch (NoSuchMethodException e) {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
%module doxygen_translate
|
%module doxygen_translate
|
||||||
|
|
||||||
|
#if defined(SWIGJAVA)
|
||||||
|
%javamethodmodifiers function "@Deprecated\npublic"
|
||||||
|
#endif
|
||||||
|
|
||||||
%inline %{
|
%inline %{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
%module doxygen_translate_all_tags
|
%module doxygen_translate_all_tags
|
||||||
|
|
||||||
|
#if defined(SWIGJAVA)
|
||||||
|
%javamethodmodifiers func02 "@Deprecated\npublic"
|
||||||
|
#endif
|
||||||
|
|
||||||
%inline %{
|
%inline %{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -47,11 +47,11 @@ public class li_std_list_runme {
|
||||||
} catch (java.util.NoSuchElementException e) {
|
} catch (java.util.NoSuchElementException e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (v1.remove(new Integer(123))) throw new RuntimeException("v1 test (13) failed");
|
if (v1.remove(Integer.valueOf(123))) throw new RuntimeException("v1 test (13) failed");
|
||||||
if (!v1.remove(new Integer(456))) throw new RuntimeException("v1 test (14) failed");
|
if (!v1.remove(Integer.valueOf(456))) throw new RuntimeException("v1 test (14) failed");
|
||||||
if (!v1.isEmpty()) throw new RuntimeException("v1 test (15) failed");
|
if (!v1.isEmpty()) throw new RuntimeException("v1 test (15) failed");
|
||||||
if (v1.size() != 0) throw new RuntimeException("v1 test (16) failed");
|
if (v1.size() != 0) throw new RuntimeException("v1 test (16) failed");
|
||||||
if (v1.remove(new Integer(456))) throw new RuntimeException("v1 test (17) failed");
|
if (v1.remove(Integer.valueOf(456))) throw new RuntimeException("v1 test (17) failed");
|
||||||
|
|
||||||
if (new IntList(3).size() != 3) throw new RuntimeException("constructor initial size test failed");
|
if (new IntList(3).size() != 3) throw new RuntimeException("constructor initial size test failed");
|
||||||
for (int n : new IntList(10, 999))
|
for (int n : new IntList(10, 999))
|
||||||
|
|
@ -136,7 +136,7 @@ public class li_std_list_runme {
|
||||||
v9.add(60);
|
v9.add(60);
|
||||||
v9.add(70);
|
v9.add(70);
|
||||||
if (v9.size() != 7) throw new RuntimeException("v9 test (1) failed");
|
if (v9.size() != 7) throw new RuntimeException("v9 test (1) failed");
|
||||||
if (!v9.remove(new Integer(60))) throw new RuntimeException("v9 test (2) failed");
|
if (!v9.remove(Integer.valueOf(60))) throw new RuntimeException("v9 test (2) failed");
|
||||||
if (v9.size() != 6) throw new RuntimeException("v9 test (3) failed");
|
if (v9.size() != 6) throw new RuntimeException("v9 test (3) failed");
|
||||||
v9.addFirst(-10);
|
v9.addFirst(-10);
|
||||||
v9.addLast(80);
|
v9.addLast(80);
|
||||||
|
|
|
||||||
|
|
@ -48,11 +48,11 @@ public class li_std_vector_runme {
|
||||||
} catch (java.util.NoSuchElementException e) {
|
} catch (java.util.NoSuchElementException e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (v1.remove(new Integer(123))) throw new RuntimeException("v1 test (13) failed");
|
if (v1.remove(Integer.valueOf(123))) throw new RuntimeException("v1 test (13) failed");
|
||||||
if (!v1.remove(new Integer(456))) throw new RuntimeException("v1 test (14) failed");
|
if (!v1.remove(Integer.valueOf(456))) throw new RuntimeException("v1 test (14) failed");
|
||||||
if (!v1.isEmpty()) throw new RuntimeException("v1 test (15) failed");
|
if (!v1.isEmpty()) throw new RuntimeException("v1 test (15) failed");
|
||||||
if (v1.size() != 0) throw new RuntimeException("v1 test (16) failed");
|
if (v1.size() != 0) throw new RuntimeException("v1 test (16) failed");
|
||||||
if (v1.remove(new Integer(456))) throw new RuntimeException("v1 test (17) failed");
|
if (v1.remove(Integer.valueOf(456))) throw new RuntimeException("v1 test (17) failed");
|
||||||
|
|
||||||
if (new IntVector(3).size() != 3) throw new RuntimeException("constructor initial size test failed");
|
if (new IntVector(3).size() != 3) throw new RuntimeException("constructor initial size test failed");
|
||||||
for (int n : new IntVector(10, 999))
|
for (int n : new IntVector(10, 999))
|
||||||
|
|
@ -137,7 +137,7 @@ public class li_std_vector_runme {
|
||||||
v9.add(60);
|
v9.add(60);
|
||||||
v9.add(70);
|
v9.add(70);
|
||||||
if (v9.size() != 7) throw new RuntimeException("v9 test (1) failed");
|
if (v9.size() != 7) throw new RuntimeException("v9 test (1) failed");
|
||||||
if (!v9.remove(new Integer(60))) throw new RuntimeException("v9 test (2) failed");
|
if (!v9.remove(Integer.valueOf(60))) throw new RuntimeException("v9 test (2) failed");
|
||||||
if (v9.size() != 6) throw new RuntimeException("v9 test (3) failed");
|
if (v9.size() != 6) throw new RuntimeException("v9 test (3) failed");
|
||||||
|
|
||||||
IntVector v10 = new IntVector(java.util.Arrays.asList(10, 20, 30, 40, 50));
|
IntVector v10 = new IntVector(java.util.Arrays.asList(10, 20, 30, 40, 50));
|
||||||
|
|
|
||||||
|
|
@ -84,14 +84,14 @@ public class long_long_runme {
|
||||||
|
|
||||||
ArrayList<BigInteger> bigIntegers = new ArrayList<BigInteger>();
|
ArrayList<BigInteger> bigIntegers = new ArrayList<BigInteger>();
|
||||||
for (int i=0; i<nums.length; ++i) {
|
for (int i=0; i<nums.length; ++i) {
|
||||||
BigInteger bi = new BigInteger(new Long(nums[i]).toString());
|
BigInteger bi = new BigInteger(Long.valueOf(nums[i]).toString());
|
||||||
bigIntegers.add(bi);
|
bigIntegers.add(bi);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
BigInteger bi = new BigInteger(new Long(Long.MAX_VALUE).toString());
|
BigInteger bi = new BigInteger(Long.valueOf(Long.MAX_VALUE).toString());
|
||||||
bigIntegers.add(bi.add(BigInteger.ONE));
|
bigIntegers.add(bi.add(BigInteger.ONE));
|
||||||
bi = new BigInteger(new Long(Long.MIN_VALUE).toString());
|
bi = new BigInteger(Long.valueOf(Long.MIN_VALUE).toString());
|
||||||
bigIntegers.add(bi.subtract(BigInteger.ONE));
|
bigIntegers.add(bi.subtract(BigInteger.ONE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue