# HG changeset patch # User malenkov # Date 1380900182 -14400 # Node ID 8fbc2b703ae5d724096efca93f7b692d5d6bb9b9 # Parent 5df7062f4a68b20da09000c8e2f8b14131d77048 8025448: Enhance listening events Reviewed-by: art, skoivu diff -r 5df7062f4a68 -r 8fbc2b703ae5 jdk/src/share/classes/javax/swing/event/EventListenerList.java --- a/jdk/src/share/classes/javax/swing/event/EventListenerList.java Fri Oct 04 14:51:17 2013 +0100 +++ b/jdk/src/share/classes/javax/swing/event/EventListenerList.java Fri Oct 04 19:23:02 2013 +0400 @@ -27,6 +27,7 @@ import java.io.*; import java.util.*; import java.lang.reflect.Array; +import sun.reflect.misc.ReflectUtil; /** * A class that holds a list of EventListeners. A single instance @@ -271,7 +272,9 @@ while (null != (listenerTypeOrNull = s.readObject())) { ClassLoader cl = Thread.currentThread().getContextClassLoader(); EventListener l = (EventListener)s.readObject(); - add((Class)Class.forName((String)listenerTypeOrNull, true, cl), l); + String name = (String) listenerTypeOrNull; + ReflectUtil.checkPackageAccess(name); + add((Class)Class.forName(name, true, cl), l); } }