From 6d6661fe6f09be8d47c5274f4bb6f22f5c063515 Mon Sep 17 00:00:00 2001 From: Gary Benson Date: Sat, 30 Nov 2002 04:41:59 +0000 Subject: [PATCH] For PR libgcj/8759: 2002-11-29 Gary Benson For PR libgcj/8759: * java/beans/Introspector.java (flushCaches): New method. (flushFromCaches): Likewise. From-SVN: r59650 --- libjava/ChangeLog | 6 ++++++ libjava/java/beans/Introspector.java | 28 +++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index b88803fd907..9206f99b796 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,9 @@ +2002-11-29 Gary Benson + + For PR libgcj/8759: + * java/beans/Introspector.java (flushCaches): New method. + (flushFromCaches): Likewise. + 2002-11-29 Michael Koch * java/nio/channels/DatagramChannel.java diff --git a/libjava/java/beans/Introspector.java b/libjava/java/beans/Introspector.java index fa98c69ae9d..ac9e36721e4 100644 --- a/libjava/java/beans/Introspector.java +++ b/libjava/java/beans/Introspector.java @@ -1,5 +1,5 @@ /* java.beans.Introspector - Copyright (C) 1998 Free Software Foundation, Inc. + Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -209,6 +209,32 @@ public class Introspector { } } + /** + * Flush all of the Introspector's internal caches. + * + * @since 1.2 + */ + public static void flushCaches() + { + beanInfoCache.clear(); + } + + /** + * Flush the Introspector's internal cached information for a given + * class. + * + * @param clz the class to be flushed. + * @throws NullPointerException if clz is null. + * @since 1.2 + */ + public static void flushFromCaches(Class clz) + { + synchronized (clz) + { + beanInfoCache.remove(clz); + } + } + /** * Get the BeanInfo for class beanClass, * first by looking for explicit information, next by