summaryrefslogtreecommitdiffstats
path: root/libjava/classpath/java/util/logging
diff options
context:
space:
mode:
authorgandalf <gandalf@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-23 15:19:26 +0000
committergandalf <gandalf@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-23 15:19:26 +0000
commit5c7411981584e487ac41794feb98a66df9fd6fcb (patch)
treefebe3d4d4c0c994db223fee8e819bde6582494c9 /libjava/classpath/java/util/logging
parent112dfe9f689af01c2dd00e0f153fc25d69095b6c (diff)
downloadppe42-gcc-5c7411981584e487ac41794feb98a66df9fd6fcb.tar.gz
ppe42-gcc-5c7411981584e487ac41794feb98a66df9fd6fcb.zip
Merge GNU Classpath 0.99 into libjava.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@185741 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/java/util/logging')
-rw-r--r--libjava/classpath/java/util/logging/LogManager.java27
1 files changed, 24 insertions, 3 deletions
diff --git a/libjava/classpath/java/util/logging/LogManager.java b/libjava/classpath/java/util/logging/LogManager.java
index dffa44d9cf0..f8c6c3393fc 100644
--- a/libjava/classpath/java/util/logging/LogManager.java
+++ b/libjava/classpath/java/util/logging/LogManager.java
@@ -211,11 +211,21 @@ public class LogManager
/**
* Registers a listener which will be notified when the
* logging properties are re-read.
+ *
+ * @param listener the event listener to register.
+ * @throws NullPointerException if the listener is {@code null}.
+ * @throws SecurityException if a security manager exists and the
+ * calling code does not have the permission
+ * {@code LoggingPermission("control")}.
*/
public synchronized void addPropertyChangeListener(PropertyChangeListener listener)
{
- /* do not register null. */
- listener.getClass();
+ if (listener == null)
+ throw new NullPointerException("Attempt to add null property change listener");
+
+ SecurityManager sm = System.getSecurityManager();
+ if (sm != null)
+ sm.checkPermission(new LoggingPermission("control", null));
pcs.addPropertyChangeListener(listener);
}
@@ -226,11 +236,22 @@ public class LogManager
* If <code>listener</code> has not been registered previously,
* nothing happens. Also, no exception is thrown if
* <code>listener</code> is <code>null</code>.
+ *
+ * @param listener the listener to remove.
+ * @throws SecurityException if a security manager exists and the
+ * calling code does not have the permission
+ * {@code LoggingPermission("control")}.
*/
public synchronized void removePropertyChangeListener(PropertyChangeListener listener)
{
if (listener != null)
- pcs.removePropertyChangeListener(listener);
+ {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm != null)
+ sm.checkPermission(new LoggingPermission("control", null));
+
+ pcs.removePropertyChangeListener(listener);
+ }
}
/**
OpenPOWER on IntegriCloud