From e67458d55f7ba52e6ecaae38686098bef25b5ea1 Mon Sep 17 00:00:00 2001 From: ray Date: Wed, 23 Jul 2008 18:59:11 +0000 Subject: [PATCH] Patch from Charlie Groves: mdb's changes to GenUtil yesterday are causing it to choke when making type names for arrays and causing genservice to blow up in yohoho. This checks for the subclass of Type for arrays and properly generates a name for it. git-svn-id: https://samskivert.googlecode.com/svn/trunk@2341 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- src/java/com/samskivert/util/GenUtil.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/java/com/samskivert/util/GenUtil.java b/src/java/com/samskivert/util/GenUtil.java index 93bdb7a0..db2a3bbc 100644 --- a/src/java/com/samskivert/util/GenUtil.java +++ b/src/java/com/samskivert/util/GenUtil.java @@ -45,7 +45,9 @@ public class GenUtil */ public static String simpleName (Type type) { - if (type instanceof Class) { + if (type instanceof GenericArrayType) { + return simpleName(((GenericArrayType)type).getGenericComponentType()) + "[]"; + } else if (type instanceof Class) { Class clazz = (Class)type; if (clazz.isArray()) { return simpleName(clazz.getComponentType()) + "[]";