提交 e7c95c03 编写于 作者: S serb

8080541: More direct property handling

Reviewed-by: prr, alexsch
上级 115c52c7
/* /*
* 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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -28,6 +28,7 @@ package java.beans; ...@@ -28,6 +28,7 @@ package java.beans;
import java.lang.ref.Reference; import java.lang.ref.Reference;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
import sun.reflect.misc.ReflectUtil;
/** /**
* A PropertyDescriptor describes one property that a Java Bean * A PropertyDescriptor describes one property that a Java Bean
...@@ -426,8 +427,9 @@ public class PropertyDescriptor extends FeatureDescriptor { ...@@ -426,8 +427,9 @@ public class PropertyDescriptor extends FeatureDescriptor {
public PropertyEditor createPropertyEditor(Object bean) { public PropertyEditor createPropertyEditor(Object bean) {
Object editor = null; Object editor = null;
Class<?> cls = getPropertyEditorClass(); final Class<?> cls = getPropertyEditorClass();
if (cls != null) { if (cls != null && PropertyEditor.class.isAssignableFrom(cls)
&& ReflectUtil.isPackageAccessible(cls)) {
Constructor<?> ctor = null; Constructor<?> ctor = null;
if (bean != null) { if (bean != null) {
try { try {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册