mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-23 04:24:49 +02:00
6736293: OpenType checks can be bypassed through finalizer resurrection
Reviewed-by: hawtin
This commit is contained in:
parent
f6e8569c85
commit
ec41d4d0e9
3 changed files with 11 additions and 4 deletions
|
@ -3629,6 +3629,8 @@ public class Window extends Container implements Accessible {
|
|||
y + h + 2);
|
||||
|
||||
// Now make sure the warning window is visible on the screen
|
||||
GraphicsConfiguration graphicsConfig =
|
||||
getGraphicsConfiguration_NoClientCode();
|
||||
Rectangle screenBounds = graphicsConfig.getBounds();
|
||||
Insets screenInsets =
|
||||
Toolkit.getDefaultToolkit().getScreenInsets(graphicsConfig);
|
||||
|
|
|
@ -690,7 +690,7 @@ public class OpenMBeanAttributeInfoSupport
|
|||
private static <T> T convertFromString(String s, OpenType<T> openType) {
|
||||
Class<T> c;
|
||||
try {
|
||||
c = cast(Class.forName(openType.getClassName()));
|
||||
c = cast(Class.forName(openType.safeGetClassName()));
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new NoClassDefFoundError(e.toString()); // can't happen
|
||||
}
|
||||
|
@ -711,7 +711,7 @@ public class OpenMBeanAttributeInfoSupport
|
|||
} catch (Exception e) {
|
||||
final String msg =
|
||||
"Could not convert \"" + s + "\" using method: " + valueOf;
|
||||
throw new IllegalArgumentException(msg);
|
||||
throw new IllegalArgumentException(msg, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -728,7 +728,7 @@ public class OpenMBeanAttributeInfoSupport
|
|||
} catch (Exception e) {
|
||||
final String msg =
|
||||
"Could not convert \"" + s + "\" using constructor: " + con;
|
||||
throw new IllegalArgumentException(msg);
|
||||
throw new IllegalArgumentException(msg, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -757,7 +757,7 @@ public class OpenMBeanAttributeInfoSupport
|
|||
stringArrayClass =
|
||||
Class.forName(squareBrackets + "Ljava.lang.String;");
|
||||
targetArrayClass =
|
||||
Class.forName(squareBrackets + "L" + baseType.getClassName() +
|
||||
Class.forName(squareBrackets + "L" + baseType.safeGetClassName() +
|
||||
";");
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new NoClassDefFoundError(e.toString()); // can't happen
|
||||
|
|
|
@ -304,7 +304,12 @@ public abstract class OpenType<T> implements Serializable {
|
|||
* @return the class name.
|
||||
*/
|
||||
public String getClassName() {
|
||||
return className;
|
||||
}
|
||||
|
||||
// A version of getClassName() that can only be called from within this
|
||||
// package and that cannot be overridden.
|
||||
String safeGetClassName() {
|
||||
return className;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue