8344575: Examine usage of ReflectUtil.forName() in java.sql.rowset - XmlReaderContentHandler

Reviewed-by: lancea, mchung, alanb, liach
This commit is contained in:
Brent Christian 2024-12-06 21:18:35 +00:00
parent 470701f0bb
commit e0d6398783
3 changed files with 8 additions and 14 deletions

View file

@ -315,8 +315,7 @@ module java.base {
java.desktop;
exports sun.reflect.misc to
java.desktop,
java.management,
java.sql.rowset;
java.management;
exports sun.security.internal.interfaces to
jdk.crypto.cryptoki;
exports sun.security.internal.spec to

View file

@ -32,10 +32,6 @@ public final class ReflectUtil {
private ReflectUtil() {
}
public static Class<?> forName(String name) throws ClassNotFoundException {
return Class.forName(name);
}
/**
* Ensures that access to a method or field is granted and throws
* IllegalAccessException if not. This method is not suitable for checking

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2024, 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
@ -659,13 +659,12 @@ public class XmlReaderContentHandler extends DefaultHandler {
case PropClassTag:
//Added the handling for Class tags to take care of maps
//Makes an entry into the map upon end of class tag
try{
typeMap.put(Key_map,sun.reflect.misc.ReflectUtil.forName(Value_map));
}catch(ClassNotFoundException ex) {
throw new SAXException(MessageFormat.format(resBundle.handleGetObject("xmlrch.errmap").toString(), ex.getMessage()));
}
break;
try {
typeMap.put(Key_map, Class.forName(Value_map, true, null));
} catch (ClassNotFoundException ex) {
throw new SAXException(MessageFormat.format(resBundle.handleGetObject("xmlrch.errmap").toString(), ex.getMessage()));
}
break;
case MapTag:
//Added the handling for Map to take set the typeMap