diff options
author | rkulp | 2005-08-18 21:52:25 +0000 |
---|---|---|
committer | rkulp | 2005-08-18 21:52:25 +0000 |
commit | 3015b426de02b9ebb23a8df68102f89ff62d3ecf (patch) | |
tree | 4ce55e5aeb9ac4291780216246175ed82cfb97c8 /plugins/org.eclipse.jem.beaninfo | |
parent | c0174f1cfbcbeab1fcfa29afa6362f98879b86f9 (diff) | |
download | webtools.javaee-3015b426de02b9ebb23a8df68102f89ff62d3ecf.tar.gz webtools.javaee-3015b426de02b9ebb23a8df68102f89ff62d3ecf.tar.xz webtools.javaee-3015b426de02b9ebb23a8df68102f89ff62d3ecf.zip |
Fix a problem where clean didn't cause the overrides to be removed from each
stale class so that next introspection would reget the overrides.
Diffstat (limited to 'plugins/org.eclipse.jem.beaninfo')
3 files changed, 39 insertions, 10 deletions
diff --git a/plugins/org.eclipse.jem.beaninfo/beaninfo/org/eclipse/jem/internal/beaninfo/adapters/BeaninfoAdapterFactory.java b/plugins/org.eclipse.jem.beaninfo/beaninfo/org/eclipse/jem/internal/beaninfo/adapters/BeaninfoAdapterFactory.java index 4f4e08af1..a8d4358e2 100644 --- a/plugins/org.eclipse.jem.beaninfo/beaninfo/org/eclipse/jem/internal/beaninfo/adapters/BeaninfoAdapterFactory.java +++ b/plugins/org.eclipse.jem.beaninfo/beaninfo/org/eclipse/jem/internal/beaninfo/adapters/BeaninfoAdapterFactory.java @@ -11,7 +11,7 @@ package org.eclipse.jem.internal.beaninfo.adapters; /* * $RCSfile: BeaninfoAdapterFactory.java,v $ - * $Revision: 1.6 $ $Date: 2005/02/15 22:44:20 $ + * $Revision: 1.7 $ $Date: 2005/08/18 21:52:25 $ */ import java.lang.ref.ReferenceQueue; import java.lang.ref.WeakReference; @@ -116,11 +116,23 @@ public class BeaninfoAdapterFactory extends AdapterFactoryImpl { } } } + + /** + * Mark all stale, but leave the overrides alone. The overrides aren't stale. + * + * + * @since 1.1.0.1 + */ + public void markAllStale() { + markAllStale(false); + } /** * Mark ALL adapters as stale. This occurs because we've recycled the registry. + * + * @param clearOverrides clear the overrides too. This is full-fledged stale. The overrides are stale too. */ - public void markAllStale() { + public void markAllStale(boolean clearOverrides) { ProxyFactoryRegistry fact = isRegistryCreated() ? getRegistry() : null; processQueue(); synchronized (this) { @@ -128,7 +140,7 @@ public class BeaninfoAdapterFactory extends AdapterFactoryImpl { while (i.hasNext()) { BeaninfoClassAdapter a = (BeaninfoClassAdapter) ((WeakValue) i.next()).get(); if (a != null) - a.markStaleFactory(fact); + a.markStaleFactory(fact, clearOverrides); } fInfoSupplier.closeRegistry(); // Get rid of the registry now since it is not needed. This way we won't accidentily hold onto it when not needed. } diff --git a/plugins/org.eclipse.jem.beaninfo/beaninfo/org/eclipse/jem/internal/beaninfo/adapters/BeaninfoClassAdapter.java b/plugins/org.eclipse.jem.beaninfo/beaninfo/org/eclipse/jem/internal/beaninfo/adapters/BeaninfoClassAdapter.java index 79d35668d..43ead9424 100644 --- a/plugins/org.eclipse.jem.beaninfo/beaninfo/org/eclipse/jem/internal/beaninfo/adapters/BeaninfoClassAdapter.java +++ b/plugins/org.eclipse.jem.beaninfo/beaninfo/org/eclipse/jem/internal/beaninfo/adapters/BeaninfoClassAdapter.java @@ -11,7 +11,7 @@ package org.eclipse.jem.internal.beaninfo.adapters; /* * $RCSfile: BeaninfoClassAdapter.java,v $ - * $Revision: 1.41 $ $Date: 2005/07/21 20:53:00 $ + * $Revision: 1.42 $ $Date: 2005/08/18 21:52:25 $ */ import java.io.FileNotFoundException; @@ -273,7 +273,8 @@ public class BeaninfoClassAdapter extends AdapterImpl implements IIntrospectionA protected final static int NEVER_RETRIEVED_EXTENSION_DOCUMENT = 0, RETRIEVED_ROOT_ONLY = 1, - RETRIEVED_FULL_DOCUMENT = 2; + RETRIEVED_FULL_DOCUMENT = 2, + CLEAR_EXTENSIONS = 3; protected int retrievedExtensionDocument = NEVER_RETRIEVED_EXTENSION_DOCUMENT; protected BeaninfoAdapterFactory adapterFactory; @@ -647,11 +648,12 @@ public class BeaninfoClassAdapter extends AdapterImpl implements IIntrospectionA needsIntrospection = false; } - if (retrievedExtensionDocument == RETRIEVED_FULL_DOCUMENT) { + if (retrievedExtensionDocument == RETRIEVED_FULL_DOCUMENT || retrievedExtensionDocument == CLEAR_EXTENSIONS) { // We've been defined at one point. Need to clear everything and step back // to never retrieved so that we now get the root added in. If we had been // previously defined, then we didn't have root. We will have to lose // all other updates too. But they can come back when we're defined. + // Or we've been asked to clear all. clearAll(); retrievedExtensionDocument = NEVER_RETRIEVED_EXTENSION_DOCUMENT; } @@ -681,9 +683,10 @@ public class BeaninfoClassAdapter extends AdapterImpl implements IIntrospectionA } TimerTests.basicTest.startCumulativeStep(INTROSPECT); - if (retrievedExtensionDocument == RETRIEVED_ROOT_ONLY) { + if (retrievedExtensionDocument == RETRIEVED_ROOT_ONLY || retrievedExtensionDocument == CLEAR_EXTENSIONS) { // We need to clear out EVERYTHING because we are coming from an undefined to a defined. // Nothing previous is now valid. (Particularly the root stuff). + // Or we had a Clean requested and need to clear the extensions too. clearAll(); } boolean firstTime = false; @@ -2390,9 +2393,21 @@ public class BeaninfoClassAdapter extends AdapterImpl implements IIntrospectionA } /** - * Mark this factory as the stale factory. + * Marh the factory as stale, but leave the overrides alone. They are not stale. + * @param stale + * + * @since 1.1.0.1 */ public void markStaleFactory(ProxyFactoryRegistry stale) { + markStaleFactory(stale, false); + } + + /** + * Mark this factory as the stale factory. + * + * @param clearOverriddes clear the overrides too. They are stale. + */ + public void markStaleFactory(ProxyFactoryRegistry stale, boolean clearOverriddes) { if (staleFactory == null) { // It's not stale so make it stale. // So that next access will re-introspect @@ -2415,6 +2430,8 @@ public class BeaninfoClassAdapter extends AdapterImpl implements IIntrospectionA a.notifyChanged(note); synchronized (this) { needsIntrospection = true; + if (clearOverriddes) + retrievedExtensionDocument = CLEAR_EXTENSIONS; } } } diff --git a/plugins/org.eclipse.jem.beaninfo/beaninfo/org/eclipse/jem/internal/beaninfo/core/BeanInfoCacheController.java b/plugins/org.eclipse.jem.beaninfo/beaninfo/org/eclipse/jem/internal/beaninfo/core/BeanInfoCacheController.java index 73f082f2d..a91694a2d 100644 --- a/plugins/org.eclipse.jem.beaninfo/beaninfo/org/eclipse/jem/internal/beaninfo/core/BeanInfoCacheController.java +++ b/plugins/org.eclipse.jem.beaninfo/beaninfo/org/eclipse/jem/internal/beaninfo/core/BeanInfoCacheController.java @@ -10,7 +10,7 @@ *******************************************************************************/ /* * $RCSfile: BeanInfoCacheController.java,v $ - * $Revision: 1.14 $ $Date: 2005/07/21 20:53:01 $ + * $Revision: 1.15 $ $Date: 2005/08/18 21:52:25 $ */ package org.eclipse.jem.internal.beaninfo.core; @@ -128,7 +128,7 @@ public class BeanInfoCacheController { if (nature != null) { BeaninfoAdapterFactory adapterFactory = (BeaninfoAdapterFactory) EcoreUtil.getAdapterFactory(nature.getResourceSet().getAdapterFactories(), IIntrospectionAdapter.ADAPTER_KEY); if (adapterFactory != null) { - adapterFactory.markAllStale(); + adapterFactory.markAllStale(true); // Also clear the overrides. } } } catch (CoreException e) { |