Author: rgreig
Date: Mon Dec 11 12:23:53 2006
New Revision: 485854
URL: http://svn.apache.org/viewvc?view=rev&rev=485854
Log:
QPID-102: removed some superfluous code from JMSStreamMessage.
Modified:
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSStreamMessage.java
Modified:
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSStreamMessage.java
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSStreamMessage.java?view=diff&rev=485854&r1=485853&r2=485854
==============================================================================
---
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSStreamMessage.java
(original)
+++
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSStreamMessage.java
Mon Dec 11 12:23:53 2006
@@ -27,28 +27,13 @@
import javax.jms.*;
import java.nio.charset.CharacterCodingException;
import java.nio.charset.Charset;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-import java.util.HashSet;
/**
* @author Apache Software Foundation
*/
public class JMSStreamMessage extends AbstractBytesMessage implements
StreamMessage
{
- public static final String MIME_TYPE="jms/stream-message";
-
- private static final String[] _typeNames = { "boolean",
- "byte",
- "byte array",
- "short",
- "char",
- "int",
- "long",
- "float",
- "double",
- "utf string" };
+ public static final String MIME_TYPE="jms/stream-message";
private static final byte BOOLEAN_TYPE = (byte) 1;
@@ -71,69 +56,6 @@
private static final byte STRING_TYPE = (byte) 10;
/**
- * Maps from type on the wire to set of valid types that can be converted
to
- */
- private static final Map<Byte, Set<Byte>> _typeConversionMap;
-
- static
- {
- _typeConversionMap = new HashMap<Byte, Set<Byte>>();
- Set<Byte> set = new HashSet<Byte>();
- set.add(BOOLEAN_TYPE);
- set.add(STRING_TYPE);
- _typeConversionMap.put(BOOLEAN_TYPE, set);
- set = new HashSet<Byte>();
- set.add(BYTE_TYPE);
- set.add(SHORT_TYPE);
- set.add(INT_TYPE);
- set.add(LONG_TYPE);
- set.add(STRING_TYPE);
- _typeConversionMap.put(BYTE_TYPE, set);
- set = new HashSet<Byte>();
- set.add(SHORT_TYPE);
- set.add(INT_TYPE);
- set.add(LONG_TYPE);
- set.add(STRING_TYPE);
- _typeConversionMap.put(SHORT_TYPE, set);
- set = new HashSet<Byte>();
- set.add(CHAR_TYPE);
- set.add(STRING_TYPE);
- _typeConversionMap.put(CHAR_TYPE, set);
- set = new HashSet<Byte>();
- set.add(INT_TYPE);
- set.add(LONG_TYPE);
- set.add(STRING_TYPE);
- _typeConversionMap.put(INT_TYPE, set);
- set = new HashSet<Byte>();
- set.add(LONG_TYPE);
- set.add(STRING_TYPE);
- _typeConversionMap.put(LONG_TYPE, set);
- set = new HashSet<Byte>();
- set.add(FLOAT_TYPE);
- set.add(DOUBLE_TYPE);
- set.add(STRING_TYPE);
- _typeConversionMap.put(FLOAT_TYPE, set);
- set = new HashSet<Byte>();
- set.add(DOUBLE_TYPE);
- set.add(STRING_TYPE);
- _typeConversionMap.put(DOUBLE_TYPE, set);
- set = new HashSet<Byte>();
- set.add(BOOLEAN_TYPE);
- set.add(BYTE_TYPE);
- set.add(SHORT_TYPE);
- set.add(CHAR_TYPE);
- set.add(INT_TYPE);
- set.add(LONG_TYPE);
- set.add(FLOAT_TYPE);
- set.add(DOUBLE_TYPE);
- set.add(STRING_TYPE);
- _typeConversionMap.put(STRING_TYPE, set);
- set = new HashSet<Byte>();
- set.add(BYTEARRAY_TYPE);
- _typeConversionMap.put(BYTEARRAY_TYPE, set);
- }
-
- /**
* This is set when reading a byte array. The readBytes(byte[]) method
supports multiple calls to read
* a byte array in multiple chunks, hence this is used to track how much
is left to be read
*/
@@ -184,7 +106,7 @@
public boolean readBoolean() throws JMSException
{
byte wireType = readAndCheckType();
- boolean result = false;
+ boolean result;
switch (wireType)
{
case BOOLEAN_TYPE:
@@ -209,7 +131,7 @@
public byte readByte() throws JMSException
{
byte wireType = readAndCheckType();
- byte result = (byte)0;
+ byte result;
switch (wireType)
{
case BYTE_TYPE:
@@ -234,7 +156,7 @@
public short readShort() throws JMSException
{
byte wireType = readAndCheckType();
- short result = (short) 0;
+ short result;
switch (wireType)
{
case SHORT_TYPE:
@@ -288,7 +210,7 @@
public int readInt() throws JMSException
{
byte wireType = readAndCheckType();
- int result = 0;
+ int result;
switch (wireType)
{
case INT_TYPE:
@@ -321,7 +243,7 @@
public long readLong() throws JMSException
{
byte wireType = readAndCheckType();
- long result = 0L;
+ long result;
switch (wireType)
{
case LONG_TYPE:
@@ -358,7 +280,7 @@
public float readFloat() throws JMSException
{
byte wireType = readAndCheckType();
- float result = 0f;
+ float result;
switch (wireType)
{
case FLOAT_TYPE:
@@ -383,7 +305,7 @@
public double readDouble() throws JMSException
{
byte wireType = readAndCheckType();
- double result = 0d;
+ double result;
switch (wireType)
{
case DOUBLE_TYPE:
@@ -412,7 +334,7 @@
public String readString() throws JMSException
{
byte wireType = readAndCheckType();
- String result = null;
+ String result;
switch (wireType)
{
case STRING_TYPE: