incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [15/29] git commit: refs/heads/ui-plugins - Avoid using strong-type-safe in Java generics provided only by higher version JDK compilers, make it more friendly to old-fashion 1.5 javac compiler
Date Mon, 11 Feb 2013 19:48:59 GMT
Avoid using strong-type-safe in Java generics provided only by higher version JDK compilers,
make it more friendly to old-fashion 1.5 javac compiler


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/c67b9c96
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/c67b9c96
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/c67b9c96

Branch: refs/heads/ui-plugins
Commit: c67b9c96503b42e57665397ae181330961ba3fc6
Parents: 78b00f5
Author: Kelven Yang <kelveny@gmail.com>
Authored: Fri Feb 8 18:00:33 2013 -0800
Committer: Kelven Yang <kelveny@gmail.com>
Committed: Fri Feb 8 18:00:33 2013 -0800

----------------------------------------------------------------------
 .../cloud/utils/component/ComponentContext.java    |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c67b9c96/utils/src/com/cloud/utils/component/ComponentContext.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/component/ComponentContext.java b/utils/src/com/cloud/utils/component/ComponentContext.java
index 716abb3..a6affc2 100644
--- a/utils/src/com/cloud/utils/component/ComponentContext.java
+++ b/utils/src/com/cloud/utils/component/ComponentContext.java
@@ -208,9 +208,10 @@ public class ComponentContext implements ApplicationContextAware {
         return (T)instance;
     }
 
-    public static <T> T inject(Class<T> clz) {
-        T instance = s_appContext.getAutowireCapableBeanFactory().createBean(clz);
-        return inject(instance);
+    @SuppressWarnings("unchecked")
+	public static <T> T inject(Class<T> clz) {
+        Object instance = s_appContext.getAutowireCapableBeanFactory().createBean(clz);
+        return (T)inject(instance);
     }
 
     public static <T> T inject(Object instance) {


Mime
View raw message