[267688] Apply stereotype should specify resource
diff --git a/plugins/org.eclipse.uml2.common/src/org/eclipse/uml2/common/util/CacheAdapter.java b/plugins/org.eclipse.uml2.common/src/org/eclipse/uml2/common/util/CacheAdapter.java
index 2976122..8e364b2 100644
--- a/plugins/org.eclipse.uml2.common/src/org/eclipse/uml2/common/util/CacheAdapter.java
+++ b/plugins/org.eclipse.uml2.common/src/org/eclipse/uml2/common/util/CacheAdapter.java
@@ -9,7 +9,7 @@
  *   IBM - initial API and implementation
  *   Kenn Hussey (Embarcadero Technologies) - 204200, 220065
  *
- * $Id: CacheAdapter.java,v 1.25 2009/03/13 20:34:43 khussey Exp $
+ * $Id: CacheAdapter.java,v 1.26 2009/03/13 20:41:16 jbruck Exp $
  */
 package org.eclipse.uml2.common.util;
 
@@ -119,11 +119,11 @@
 	public static final CacheAdapter INSTANCE = createCacheAdapter();
 
 	private static CacheAdapter createCacheAdapter() {
-		Object cacheAdapter = UML2Util
+		CacheAdapter cacheAdapter = UML2Util
 			.loadClassFromSystemProperty("org.eclipse.uml2.common.util.CacheAdapter.INSTANCE"); //$NON-NLS-1$
 
-		if (cacheAdapter instanceof CacheAdapter) {
-			return (CacheAdapter) cacheAdapter;
+		if (cacheAdapter != null) {
+			return cacheAdapter;
 		}
 
 		return new CacheAdapter();
diff --git a/plugins/org.eclipse.uml2.common/src/org/eclipse/uml2/common/util/UML2Util.java b/plugins/org.eclipse.uml2.common/src/org/eclipse/uml2/common/util/UML2Util.java
index c6bd97c..8765fec 100644
--- a/plugins/org.eclipse.uml2.common/src/org/eclipse/uml2/common/util/UML2Util.java
+++ b/plugins/org.eclipse.uml2.common/src/org/eclipse/uml2/common/util/UML2Util.java
@@ -9,7 +9,7 @@
  *   IBM - initial API and implementation
  *   Kenn Hussey (Embarcadero Technologies) - 204200, 247980
  *
- * $Id: UML2Util.java,v 1.36 2009/03/13 20:34:43 khussey Exp $
+ * $Id: UML2Util.java,v 1.37 2009/03/13 20:41:16 jbruck Exp $
  */
 package org.eclipse.uml2.common.util;
 
@@ -1239,9 +1239,9 @@
 	 * @return
 	 * 			The loaded class.
 	 * @since 1.5
-	 */
-	public static Object loadClassFromSystemProperty(String systemProperty) {
-
+	 */	
+	@SuppressWarnings("unchecked")
+	public static <T> T loadClassFromSystemProperty(String systemProperty) {
 		String property = System.getProperty(systemProperty);
 
 		if (!isEmpty(property)) {
@@ -1250,11 +1250,11 @@
 				int index = property.indexOf(':');
 
 				if (index != -1) {
-					return org.eclipse.emf.common.CommonPlugin.loadClass(
+					return  (T) org.eclipse.emf.common.CommonPlugin.loadClass(
 						property.substring(0, index),
 						property.substring(index + 1)).newInstance();
 				} else {
-					return Class.forName(property).newInstance();
+					return (T) Class.forName(property).newInstance();
 				}
 			} catch (Exception e) {
 				CommonPlugin.INSTANCE.log(e);