8080541: More direct property handling
authorserb
Sat, 23 May 2015 02:49:50 +0300
changeset 33281 0291fb74c7b6
parent 33280 3aef4137620e
child 33282 00f3c40fd3af
8080541: More direct property handling Reviewed-by: prr, alexsch
jdk/src/java.desktop/share/classes/java/beans/PropertyDescriptor.java
--- a/jdk/src/java.desktop/share/classes/java/beans/PropertyDescriptor.java	Fri May 08 15:23:08 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/beans/PropertyDescriptor.java	Sat May 23 02:49:50 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2014, 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
@@ -30,6 +30,7 @@
 import java.util.Map.Entry;
 
 import com.sun.beans.introspect.PropertyInfo;
+import sun.reflect.misc.ReflectUtil;
 
 /**
  * A PropertyDescriptor describes one property that a Java Bean
@@ -463,8 +464,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 {