Skip to content
Permalink
Browse files
code cleanup
  • Loading branch information
Timothy A. Bish committed Sep 1, 2010
1 parent 6cf16b7 commit 53d8c677f2be1912cffee951a2f1034774fbc2f7
Showing 67 changed files with 98 additions and 250 deletions.
@@ -27,7 +27,7 @@ namespace Apache.NMS.Stomp
[Serializable]
public class BrokerException : NMSException
{
private BrokerError brokerError = null;
private readonly BrokerError brokerError;

public BrokerException()
: base("Broker failed with missing exception log")
@@ -16,7 +16,6 @@
*/

using System;
using System.Text;
using Apache.NMS.Stomp.Protocol;

namespace Apache.NMS.Stomp.Commands
@@ -69,10 +68,8 @@ public int HashCode(object value)
{
return value.GetHashCode();
}
else
{
return -1;
}

return -1;
}

public virtual Object Clone()
@@ -16,7 +16,6 @@
*/

using System;
using System.Collections;

using Apache.NMS.Util;
using Apache.NMS.Stomp.State;
@@ -15,20 +15,18 @@
* limitations under the License.
*/

using Apache.NMS;
using Apache.NMS.Util;
using System;
using System.Collections;
using System.IO;

namespace Apache.NMS.Stomp.Commands
{
public class BytesMessage : Message, IBytesMessage
{
private EndianBinaryReader dataIn = null;
private EndianBinaryWriter dataOut = null;
private MemoryStream outputBuffer = null;
private int length = 0;
private EndianBinaryReader dataIn;
private EndianBinaryWriter dataOut;
private MemoryStream outputBuffer;
private int length;

public override byte GetDataStructureType()
{
@@ -15,8 +15,6 @@
* limitations under the License.
*/

using System;
using System.Collections;
using Apache.NMS.Stomp.State;

namespace Apache.NMS.Stomp.Commands
@@ -15,9 +15,6 @@
* limitations under the License.
*/

using System;
using System.Collections;

namespace Apache.NMS.Stomp.Commands
{
public class ConnectionId : BaseDataStructure
@@ -91,12 +88,7 @@ public override bool Equals(object that)

public virtual bool Equals(ConnectionId that)
{
if(!Equals(this.Value, that.Value))
{
return false;
}

return true;
return Equals(this.Value, that.Value);
}
};
}
@@ -15,8 +15,6 @@
* limitations under the License.
*/

using System;
using System.Collections;
using Apache.NMS.Stomp.State;

namespace Apache.NMS.Stomp.Commands
@@ -16,7 +16,6 @@
*/

using System;
using System.Collections;

namespace Apache.NMS.Stomp.Commands
{
@@ -26,7 +25,7 @@ public class ConsumerId : BaseDataStructure

private string key;

private SessionId parentId = null;
private SessionId parentId;

string connectionId;
long sessionId;
@@ -15,10 +15,6 @@
* limitations under the License.
*/

using System;
using System.Collections;

using Apache.NMS;
using Apache.NMS.Stomp.State;

namespace Apache.NMS.Stomp.Commands
@@ -185,21 +185,20 @@ public static Destination CreateDestination(int type, String pyhsicalName)
{
return null;
}
else if(type == STOMP_TOPIC)
else switch (type)
{
result = new Topic(pyhsicalName);
}
else if(type == STOMP_TEMPORARY_TOPIC)
{
result = new TempTopic(pyhsicalName);
}
else if(type == STOMP_QUEUE)
{
result = new Queue(pyhsicalName);
}
else
{
result = new TempQueue(pyhsicalName);
case STOMP_TOPIC:
result = new Topic(pyhsicalName);
break;
case STOMP_TEMPORARY_TOPIC:
result = new TempTopic(pyhsicalName);
break;
case STOMP_QUEUE:
result = new Queue(pyhsicalName);
break;
default:
result = new TempQueue(pyhsicalName);
break;
}
return result;
}
@@ -15,9 +15,6 @@
* limitations under the License.
*/

using System;
using System.Collections;

namespace Apache.NMS.Stomp.Commands
{
public class ExceptionResponse : Response
@@ -15,9 +15,6 @@
* limitations under the License.
*/

using System;
using System.Collections;

using Apache.NMS.Stomp.State;

namespace Apache.NMS.Stomp.Commands
@@ -15,9 +15,6 @@
* limitations under the License.
*/

using System;
using System.IO;
using Apache.NMS;
using Apache.NMS.Util;
using Apache.NMS.Stomp.Protocol;

@@ -28,11 +25,11 @@ public class MapMessage : Message, IMapMessage
private PrimitiveMap body;
private PrimitiveMapInterceptor typeConverter;

public MapMessage() : base()
public MapMessage()
{
}

public MapMessage(PrimitiveMap body) : base()
public MapMessage(PrimitiveMap body)
{
this.body = body;
this.typeConverter = new PrimitiveMapInterceptor(this, this.body);
@@ -82,29 +79,15 @@ public IPrimitiveMap Body
set
{
this.body = value as PrimitiveMap;
if(value != null)
{
this.typeConverter = new PrimitiveMapInterceptor(this, value);
}
else
{
this.typeConverter = null;
}
this.typeConverter = value != null ? new PrimitiveMapInterceptor(this, value) : null;
}
}

public override void BeforeMarshall(StompWireFormat wireFormat)
{
base.BeforeMarshall(wireFormat);

if(body == null)
{
this.Content = null;
}
else
{
this.Content = wireFormat.MapMarshaler.Marshal(body);
}
this.Content = body == null ? null : wireFormat.MapMarshaler.Marshal(body);
}
}
}
@@ -37,10 +37,6 @@ public static Message Transform(IMessage message)
return (Message) message;
}

public Message() : base()
{
}

public override byte GetDataStructureType()
{
return DataStructureTypes.MessageType;
@@ -50,14 +46,7 @@ public override int GetHashCode()
{
MessageId id = this.MessageId;

if(id != null)
{
return id.GetHashCode();
}
else
{
return base.GetHashCode();
}
return id != null ? id.GetHashCode() : base.GetHashCode();
}

public override bool Equals(object that)
@@ -83,10 +72,8 @@ public void Acknowledge()
{
throw new NMSException("No Acknowledger has been associated with this message: " + this);
}
else
{
Acknowledger(this);
}

Acknowledger(this);
}

public virtual void ClearBody()
@@ -15,9 +15,6 @@
* limitations under the License.
*/

using System;
using System.Collections;

using Apache.NMS.Stomp.State;

namespace Apache.NMS.Stomp.Commands
@@ -15,9 +15,6 @@
* limitations under the License.
*/

using System;
using System.Collections;

using Apache.NMS.Stomp.State;

namespace Apache.NMS.Stomp.Commands
@@ -16,7 +16,6 @@
*/

using System;
using System.Collections;

namespace Apache.NMS.Stomp.Commands
{
@@ -16,7 +16,6 @@
*/

using System;
using System.Collections;

namespace Apache.NMS.Stomp.Commands
{
@@ -15,9 +15,6 @@
* limitations under the License.
*/

using System;
using System.Collections;

using Apache.NMS.Stomp.State;

namespace Apache.NMS.Stomp.Commands
@@ -15,8 +15,6 @@
* limitations under the License.
*/

using System;
using System.Collections;
using Apache.NMS.Stomp.State;

namespace Apache.NMS.Stomp.Commands
@@ -15,8 +15,6 @@
* limitations under the License.
*/

using System;
using System.Collections;
using Apache.NMS.Stomp.State;

namespace Apache.NMS.Stomp.Commands
@@ -15,12 +15,8 @@
* limitations under the License.
*/

using System;
using System.Collections;

namespace Apache.NMS.Stomp.Commands
{

public class Response : BaseCommand
{
int correlationId;
@@ -15,9 +15,6 @@
* limitations under the License.
*/

using System;
using System.Collections;

namespace Apache.NMS.Stomp.Commands
{
public class SessionId : BaseDataStructure
@@ -15,9 +15,6 @@
* limitations under the License.
*/

using System;
using System.Collections;

using Apache.NMS.Stomp.State;

namespace Apache.NMS.Stomp.Commands
@@ -15,9 +15,6 @@
* limitations under the License.
*/

using System;
using System.Collections;

using Apache.NMS.Stomp.State;

namespace Apache.NMS.Stomp.Commands

0 comments on commit 53d8c67

Please sign in to comment.