8080541: More direct property handling
Reviewed-by: prr, alexsch
diff --git a/src/share/classes/java/beans/PropertyDescriptor.java b/src/share/classes/java/beans/PropertyDescriptor.java
index 07149f9..687fff5 100644
--- a/src/share/classes/java/beans/PropertyDescriptor.java
+++ b/src/share/classes/java/beans/PropertyDescriptor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2015, 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
@@ -28,6 +28,7 @@
import java.lang.ref.Reference;
import java.lang.reflect.Method;
import java.lang.reflect.Constructor;
+import sun.reflect.misc.ReflectUtil;
/**
* A PropertyDescriptor describes one property that a Java Bean
@@ -426,8 +427,9 @@
public PropertyEditor createPropertyEditor(Object bean) {
Object editor = null;
- Class<?> cls = getPropertyEditorClass();
- if (cls != null) {
+ final Class<?> cls = getPropertyEditorClass();
+ if (cls != null && PropertyEditor.class.isAssignableFrom(cls)
+ && ReflectUtil.isPackageAccessible(cls)) {
Constructor<?> ctor = null;
if (bean != null) {
try {