[153150] reflection and flushing of not found classes that are now found before notification caused the reflected state to be set and not allow further reflection later when the class is tried to be reflected.
diff --git a/plugins/org.eclipse.jem.workbench/workbench/org/eclipse/jem/internal/adapters/jdom/JavaClassJDOMAdaptor.java b/plugins/org.eclipse.jem.workbench/workbench/org/eclipse/jem/internal/adapters/jdom/JavaClassJDOMAdaptor.java
index 02ed381..67f2ba3 100644
--- a/plugins/org.eclipse.jem.workbench/workbench/org/eclipse/jem/internal/adapters/jdom/JavaClassJDOMAdaptor.java
+++ b/plugins/org.eclipse.jem.workbench/workbench/org/eclipse/jem/internal/adapters/jdom/JavaClassJDOMAdaptor.java
@@ -11,7 +11,7 @@
 package org.eclipse.jem.internal.adapters.jdom;
 /*
  *  $RCSfile: JavaClassJDOMAdaptor.java,v $
- *  $Revision: 1.25 $  $Date: 2006/05/17 20:13:58 $ 
+ *  $Revision: 1.26 $  $Date: 2006/08/08 18:54:51 $ 
  */
 
 import java.util.*;
@@ -354,6 +354,15 @@
 		if (sourceType == null) {
 			JavaClassImpl javaClass = (JavaClassImpl) getTarget();
 			sourceType = JDOMSearchHelper.findType(javaClass.getJavaPackage().getName(), javaClass.primGetName(), getSourceProject());
+			/*
+			 * If the sourceType was found and we are not in the middle of
+			 * reflecting it is necessary to ensure that the hasReflected
+			 * is set back to false.  If this is not done then the system
+			 * assumes that the content in the target model object has been
+			 * reflected from this found sourceType which is not the case.
+			 */
+			if (hasValidReflection())
+				flushReflectedValuesIfNecessaryNoNotification(false);
 		}
 		return sourceType;
 	}
@@ -700,4 +709,17 @@
 			}
 		}
 	}
+	
+	/**
+	 * Test if we have a valid source and has been reflected. This is to only
+	 * to be used by this adapter and by the JDOM adapter factory. It has a 
+	 * very specific meaning and may change as needed. It should not be used
+	 * for any other purpose. It is not an API.
+	 * @return
+	 * 
+	 * @since 1.2.0
+	 */
+	synchronized boolean hasValidReflection() {
+		return sourceType != null && hasReflected && !isReflecting;
+	}
 }
diff --git a/plugins/org.eclipse.jem.workbench/workbench/org/eclipse/jem/internal/adapters/jdom/JavaJDOMAdapterFactory.java b/plugins/org.eclipse.jem.workbench/workbench/org/eclipse/jem/internal/adapters/jdom/JavaJDOMAdapterFactory.java
index f0f7da0..17ee271 100644
--- a/plugins/org.eclipse.jem.workbench/workbench/org/eclipse/jem/internal/adapters/jdom/JavaJDOMAdapterFactory.java
+++ b/plugins/org.eclipse.jem.workbench/workbench/org/eclipse/jem/internal/adapters/jdom/JavaJDOMAdapterFactory.java
@@ -11,7 +11,7 @@
 package org.eclipse.jem.internal.adapters.jdom;
 /*
  *  $RCSfile: JavaJDOMAdapterFactory.java,v $
- *  $Revision: 1.7 $  $Date: 2005/12/02 18:41:27 $ 
+ *  $Revision: 1.8 $  $Date: 2006/08/08 18:54:51 $ 
  */
 import java.util.*;
 
@@ -92,7 +92,12 @@
 			while (it.hasNext()) {
 				entry = (Map.Entry) it.next();
 				adaptor = (JavaClassJDOMAdaptor) entry.getValue();
-				if (filterFoundTypes && adaptor.sourceType != null)
+				/*
+				 * Ensure that the the adaptor is only filtered out if it has
+				 * actually reflected the content.  It is not good enough just
+				 * to test for the sourceType.
+				 */
+				if (filterFoundTypes && adaptor.hasValidReflection())
 					continue;
 				key = (String) entry.getKey();
 				if (key.startsWith(packageName) && key.indexOf('.', packageName.length() + 1) < 0) {