forked from I2P_Developers/i2p.i2p
fix deprecations
This commit is contained in:
@ -935,8 +935,8 @@ checkLongOption()
|
||||
// +option or -option
|
||||
else
|
||||
{
|
||||
Object[] msgArgs = { progname, new
|
||||
Character(argv[optind-1].charAt(0)).toString(),
|
||||
Object[] msgArgs = { progname,
|
||||
Character.toString(argv[optind-1].charAt(0)),
|
||||
pfound.name };
|
||||
System.err.println(MessageFormat.format(
|
||||
_messages.getString("getopt.arguments2"),
|
||||
@ -1138,8 +1138,8 @@ getopt()
|
||||
}
|
||||
else
|
||||
{
|
||||
Object[] msgArgs = { progname, new
|
||||
Character(argv[optind].charAt(0)).toString(),
|
||||
Object[] msgArgs = { progname,
|
||||
Character.toString(argv[optind].charAt(0)),
|
||||
nextchar };
|
||||
System.err.println(MessageFormat.format(
|
||||
_messages.getString("getopt.unrecognized2"),
|
||||
@ -1176,15 +1176,15 @@ getopt()
|
||||
if (posixly_correct)
|
||||
{
|
||||
// 1003.2 specifies the format of this message
|
||||
Object[] msgArgs = { progname, new
|
||||
Character((char)c).toString() };
|
||||
Object[] msgArgs = { progname,
|
||||
Character.toString((char)c) };
|
||||
System.err.println(MessageFormat.format(
|
||||
_messages.getString("getopt.illegal"), msgArgs));
|
||||
}
|
||||
else
|
||||
{
|
||||
Object[] msgArgs = { progname, new
|
||||
Character((char)c).toString() };
|
||||
Object[] msgArgs = { progname,
|
||||
Character.toString((char)c) };
|
||||
System.err.println(MessageFormat.format(
|
||||
_messages.getString("getopt.invalid"), msgArgs));
|
||||
}
|
||||
@ -1208,8 +1208,8 @@ getopt()
|
||||
if (opterr)
|
||||
{
|
||||
// 1003.2 specifies the format of this message.
|
||||
Object[] msgArgs = { progname, new
|
||||
Character((char)c).toString() };
|
||||
Object[] msgArgs = { progname,
|
||||
Character.toString((char)c) };
|
||||
System.err.println(MessageFormat.format(
|
||||
_messages.getString("getopt.requires2"), msgArgs));
|
||||
}
|
||||
@ -1270,8 +1270,8 @@ getopt()
|
||||
if (opterr)
|
||||
{
|
||||
// 1003.2 specifies the format of this message
|
||||
Object[] msgArgs = { progname, new
|
||||
Character((char)c).toString() };
|
||||
Object[] msgArgs = { progname,
|
||||
Character.toString((char)c) };
|
||||
System.err.println(MessageFormat.format(
|
||||
_messages.getString("getopt.requires2"), msgArgs));
|
||||
}
|
||||
@ -1300,8 +1300,8 @@ getopt()
|
||||
if (opterr)
|
||||
{
|
||||
// 1003.2 specifies the format of this message
|
||||
Object[] msgArgs = { progname, new
|
||||
Character((char)c).toString() };
|
||||
Object[] msgArgs = { progname,
|
||||
Character.toString((char)c) };
|
||||
System.err.println(MessageFormat.format(
|
||||
_messages.getString("getopt.requires2"), msgArgs));
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ LongOpt(String name, int has_arg,
|
||||
if ((has_arg != NO_ARGUMENT) && (has_arg != REQUIRED_ARGUMENT)
|
||||
&& (has_arg != OPTIONAL_ARGUMENT))
|
||||
{
|
||||
Object[] msgArgs = { new Integer(has_arg).toString() };
|
||||
Object[] msgArgs = { Integer.toString(has_arg) };
|
||||
throw new IllegalArgumentException(MessageFormat.format(
|
||||
_messages.getString("getopt.invalidValue"), msgArgs));
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ public abstract class GettextResource extends ResourceBundle {
|
||||
String[] pluralforms = (String[])localValue;
|
||||
long i = 0;
|
||||
try {
|
||||
i = ((Long) pluralEvalMethod.invoke(catalog, new Object[] { new Long(n) })).longValue();
|
||||
i = ((Long) pluralEvalMethod.invoke(catalog, new Object[] { Long.valueOf(n) })).longValue();
|
||||
if (!(i >= 0 && i < pluralforms.length))
|
||||
i = 0;
|
||||
} catch (IllegalAccessException e) {
|
||||
|
@ -20,6 +20,8 @@ public final class I2PProvider extends Provider {
|
||||
* <code>Security.addProvider()</code> mechanism.
|
||||
*/
|
||||
public I2PProvider() {
|
||||
// following constructor deprecated in Java 9,
|
||||
// replaced by (String,String,String) added in Java 9
|
||||
super(PROVIDER_NAME, 0.1, INFO);
|
||||
|
||||
AccessController.doPrivileged(new PrivilegedAction<Void>() {
|
||||
|
@ -125,11 +125,10 @@ public final class Noise {
|
||||
static void throwBadTagException() throws BadPaddingException
|
||||
{
|
||||
try {
|
||||
// java since 1.7; android since API 19
|
||||
Class<?> c = Class.forName("javax.crypto.AEADBadTagException");
|
||||
throw (BadPaddingException)(c.newInstance());
|
||||
} catch (ClassNotFoundException e) {
|
||||
} catch (InstantiationException e) {
|
||||
} catch (IllegalAccessException e) {
|
||||
throw (BadPaddingException)(c.getDeclaredConstructor().newInstance());
|
||||
} catch (Exception e) {
|
||||
}
|
||||
throw new BadPaddingException();
|
||||
}
|
||||
|
Reference in New Issue
Block a user