--- 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<EventListener>)Class.forName((String)listenerTypeOrNull, true, cl), l);
+ String name = (String) listenerTypeOrNull;
+ ReflectUtil.checkPackageAccess(name);
+ add((Class<EventListener>)Class.forName(name, true, cl), l);
}
}