From 6bb4640f0ab3a94181c8601d026f3f3b28571733 Mon Sep 17 00:00:00 2001 From: ray Date: Mon, 21 Aug 2006 21:35:54 +0000 Subject: [PATCH] This notation appears to be legal in jdk1.5. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1889 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- src/java/com/samskivert/util/ValueMarshaller.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/java/com/samskivert/util/ValueMarshaller.java b/src/java/com/samskivert/util/ValueMarshaller.java index 24f267c6..b5550972 100644 --- a/src/java/com/samskivert/util/ValueMarshaller.java +++ b/src/java/com/samskivert/util/ValueMarshaller.java @@ -41,11 +41,6 @@ public class ValueMarshaller protected static HashMap _parsers; - protected static final byte[] BYTE_ARRAY_PROTOTYPE = new byte[0]; - protected static final int[] INT_ARRAY_PROTOTYPE = new int[0]; - protected static final float[] FLOAT_ARRAY_PROTOTYPE = new float[0]; - protected static final String[] STRING_ARRAY_PROTOTYPE = new String[0]; - static { _parsers = new HashMap(); @@ -106,7 +101,7 @@ public class ValueMarshaller }); // and byte arrays - _parsers.put(BYTE_ARRAY_PROTOTYPE.getClass(), new Parser() { + _parsers.put(byte[].class, new Parser() { public Object parse (String source) throws Exception { int[] values = StringUtil.parseIntArray(source); int vcount = values.length; @@ -119,21 +114,21 @@ public class ValueMarshaller }); // and int arrays - _parsers.put(INT_ARRAY_PROTOTYPE.getClass(), new Parser() { + _parsers.put(int[].class, new Parser() { public Object parse (String source) throws Exception { return StringUtil.parseIntArray(source); } }); // and float arrays - _parsers.put(FLOAT_ARRAY_PROTOTYPE.getClass(), new Parser() { + _parsers.put(float[].class, new Parser() { public Object parse (String source) throws Exception { return StringUtil.parseFloatArray(source); } }); // and string arrays, oh my! - _parsers.put(STRING_ARRAY_PROTOTYPE.getClass(), new Parser() { + _parsers.put(String[].class, new Parser() { public Object parse (String source) throws Exception { return StringUtil.parseStringArray(source); }