Skip to content

Commit e0d6398

Browse files
author
Brent Christian
committed
8344575: Examine usage of ReflectUtil.forName() in java.sql.rowset - XmlReaderContentHandler
Reviewed-by: lancea, mchung, alanb, liach
1 parent 470701f commit e0d6398

File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed

src/java.base/share/classes/module-info.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,7 @@
315315
java.desktop;
316316
exports sun.reflect.misc to
317317
java.desktop,
318-
java.management,
319-
java.sql.rowset;
318+
java.management;
320319
exports sun.security.internal.interfaces to
321320
jdk.crypto.cryptoki;
322321
exports sun.security.internal.spec to

src/java.base/share/classes/sun/reflect/misc/ReflectUtil.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ public final class ReflectUtil {
3232
private ReflectUtil() {
3333
}
3434

35-
public static Class<?> forName(String name) throws ClassNotFoundException {
36-
return Class.forName(name);
37-
}
38-
3935
/**
4036
* Ensures that access to a method or field is granted and throws
4137
* IllegalAccessException if not. This method is not suitable for checking

src/java.sql.rowset/share/classes/com/sun/rowset/internal/XmlReaderContentHandler.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -659,13 +659,12 @@ public void endElement(String uri, String lName, String qName) throws SAXExcepti
659659
case PropClassTag:
660660
//Added the handling for Class tags to take care of maps
661661
//Makes an entry into the map upon end of class tag
662-
try{
663-
typeMap.put(Key_map,sun.reflect.misc.ReflectUtil.forName(Value_map));
664-
665-
}catch(ClassNotFoundException ex) {
666-
throw new SAXException(MessageFormat.format(resBundle.handleGetObject("xmlrch.errmap").toString(), ex.getMessage()));
667-
}
668-
break;
662+
try {
663+
typeMap.put(Key_map, Class.forName(Value_map, true, null));
664+
} catch (ClassNotFoundException ex) {
665+
throw new SAXException(MessageFormat.format(resBundle.handleGetObject("xmlrch.errmap").toString(), ex.getMessage()));
666+
}
667+
break;
669668

670669
case MapTag:
671670
//Added the handling for Map to take set the typeMap

0 commit comments

Comments
 (0)