From 4b0fc9777ea3ce1eacf1c46c3a205c4d69487363 Mon Sep 17 00:00:00 2001 From: mdb Date: Fri, 31 Jan 2003 02:27:01 +0000 Subject: [PATCH] Support short[] in toString(). git-svn-id: https://samskivert.googlecode.com/svn/trunk@1042 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../src/java/com/samskivert/util/StringUtil.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/projects/samskivert/src/java/com/samskivert/util/StringUtil.java b/projects/samskivert/src/java/com/samskivert/util/StringUtil.java index a17aa3db..4f7880ff 100644 --- a/projects/samskivert/src/java/com/samskivert/util/StringUtil.java +++ b/projects/samskivert/src/java/com/samskivert/util/StringUtil.java @@ -1,5 +1,5 @@ // -// $Id: StringUtil.java,v 1.51 2003/01/24 00:31:50 mdb Exp $ +// $Id: StringUtil.java,v 1.52 2003/01/31 02:27:01 mdb Exp $ // // samskivert library - useful routines for java programs // Copyright (C) 2001 Michael Bayne @@ -223,6 +223,17 @@ public class StringUtil } buf.append(closeBox); + } else if (val instanceof short[]) { + buf.append(openBox); + short[] v = (short[])val; + for (short i = 0; i < v.length; i++) { + if (i > 0) { + buf.append(", "); + } + buf.append(v[i]); + } + buf.append(closeBox); + } else if (val instanceof int[]) { buf.append(openBox); int[] v = (int[])val;