openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1458387 - /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
Date Tue, 19 Mar 2013 16:32:46 GMT
Author: rmannibucau
Date: Tue Mar 19 16:32:45 2013
New Revision: 1458387

URL: http://svn.apache.org/r1458387
Log:
OWB-794 more explicit toString with generics - forgot a test

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java?rev=1458387&r1=1458386&r2=1458387&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
Tue Mar 19 16:32:45 2013
@@ -341,17 +341,21 @@ public abstract class AbstractOwbBean<T>
                 Class<?> rawType = (Class<?>) parameterizedType.getRawType();
                 builder.append(rawType.getName());
                 builder.append("<");
-                for (Type actualType : parameterizedType.getActualTypeArguments())
+                Type[] actualTypeArguments = parameterizedType.getActualTypeArguments();
+                if (actualTypeArguments.length > 0)
                 {
-                    if (Class.class.isInstance(actualType))
+                    for (Type actualType : actualTypeArguments)
                     {
-                        builder.append(Class.class.cast(actualType).getName().replace("java.lang.",
""));
+                        if (Class.class.isInstance(actualType))
+                        {
+                            builder.append(Class.class.cast(actualType).getName().replace("java.lang.",
""));
+                        }
+                        else
+                        {
+                            builder.append(actualType);
+                        }
+                        builder.append(",");
                     }
-                    else
-                    {
-                        builder.append(actualType);
-                    }
-                    builder.append(",");
                 }
                 builder.delete(builder.length() - 1, builder.length());
                 builder.append(">");



Mime
View raw message