8243154: Fix deprecation warnings in failure handler

Reviewed-by: dholmes
This commit is contained in:
Magnus Ihse Bursie 2020-04-20 13:37:38 +02:00
parent ec1c111c6c
commit e8dfd8ce54
3 changed files with 5 additions and 5 deletions

View File

@ -52,7 +52,7 @@ $(eval $(call SetupJavaCompilation, BUILD_FAILURE_HANDLER, \
SETUP := GENERATE_OLDBYTECODE, \
SRC := $(FH_BASEDIR)/src/share/classes $(FH_BASEDIR)/src/share/conf, \
BIN := $(FH_SUPPORT)/classes, \
DISABLED_WARNINGS := deprecation serial try, \
DISABLED_WARNINGS := serial try, \
COPY := .properties, \
CLASSPATH := $(JTREG_JAR) $(TOOLS_JAR), \
JAR := $(FH_JAR), \

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -111,7 +111,7 @@ public class GatherProcessInfoTimeoutHandler extends TimeoutHandler {
if (HAS_NATIVE_LIBRARY && "windows".equals(OS.current().family)) {
try {
Field field = process.getClass().getDeclaredField("handle");
boolean old = field.isAccessible();
boolean old = field.canAccess(process);
try {
field.setAccessible(true);
long handle = field.getLong(process);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -86,7 +86,7 @@ public final class ValueHandler {
delimiter = delimiter == null ? " " : delimiter;
Class<? extends ValueParser> parserClass = property.parser();
try {
field.set(object, parserClass.newInstance().parse(
field.set(object, parserClass.getDeclaredConstructor().newInstance().parse(
field.getType(), value, delimiter));
} catch (ReflectiveOperationException | IllegalArgumentException e) {
throw new InvalidValueException(