From e79488cc1bd31c0e4e10b609a4d5dc97ec298db3 Mon Sep 17 00:00:00 2001 From: Stefan Karlsson <stefank@openjdk.org> Date: Tue, 19 Feb 2019 10:00:51 +0100 Subject: [PATCH] 8218731: SA: Use concrete class the as return type of VMObjectFactory.newObject Reviewed-by: eosterlund --- .../classes/sun/jvm/hotspot/runtime/VMObjectFactory.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VMObjectFactory.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VMObjectFactory.java index 7ab2c4a6d3b..ec486667979 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VMObjectFactory.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VMObjectFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2019, 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 @@ -45,14 +45,14 @@ import sun.jvm.hotspot.types.*; */ public class VMObjectFactory { - public static Object newObject(Class clazz, Address addr) + public static <T> T newObject(Class<T> clazz, Address addr) throws ConstructionException { try { if (addr == null) { return null; } - Constructor c = clazz.getConstructor(new Class[] { + Constructor<T> c = clazz.getConstructor(new Class[] { Address.class }); return c.newInstance(new Object[] { addr });