Skip to content

Commit

Permalink
8344575: Examine usage of ReflectUtil.forName() in java.sql.rowset - …
Browse files Browse the repository at this point in the history
…XmlReaderContentHandler

Reviewed-by: lancea, mchung, alanb, liach
  • Loading branch information
Brent Christian committed Dec 6, 2024
1 parent 470701f commit e0d6398
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
3 changes: 1 addition & 2 deletions src/java.base/share/classes/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,7 @@
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
Expand Down
4 changes: 0 additions & 4 deletions src/java.base/share/classes/sun/reflect/misc/ReflectUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -659,13 +659,12 @@ public void endElement(String uri, String lName, String qName) throws SAXExcepti
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
Expand Down

0 comments on commit e0d6398

Please sign in to comment.