changeset 12931:e803843a9a36

8080541: More direct property handling Reviewed-by: prr, alexsch
author serb
date Sat, 23 May 2015 02:49:50 +0300
parents a0e3501ef531
children 3975503a71c5
files src/java.desktop/share/classes/java/beans/PropertyDescriptor.java
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.desktop/share/classes/java/beans/PropertyDescriptor.java	Fri May 08 15:23:08 2015 -0700
+++ b/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 {