Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix findbugs warnings

  • Loading branch information...
commit ad5bdf76f75d382b7bf57b6e0f51f43876078f18 1 parent 87f9e68
Francisco Borges authored
View
2  ...ms/multiple-failover-failback/src/main/java/org/hornetq/jms/example/MultipleFailoverFailbackExample.java
@@ -112,7 +112,7 @@ public boolean runExample() throws Exception
for (int i = numMessages / 3; i < (numMessages / 3) * 2; i++)
{
message0 = (TextMessage)consumer.receive(5000);
- System.out.printf("Got message: %s (redelivered?: %s)\n", message0.getText(), message0.getJMSRedelivered());
+ System.out.printf("Got message: %s (redelivered?: %s)%n", message0.getText(), message0.getJMSRedelivered());
}
message0.acknowledge();
View
8 hornetq-core-client/src/main/java/org/hornetq/utils/XMLUtil.java
@@ -45,11 +45,13 @@
* @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
*/
-public class XMLUtil
+public final class XMLUtil
{
- // Constants ------------------------------------------------------------------------------------
- // Static ---------------------------------------------------------------------------------------
+ private XMLUtil()
+ {
+ // Utility class
+ }
public static Element stringToElement(final String s) throws Exception
{
View
2  hornetq-jms-server/src/main/java/org/hornetq/jms/server/recovery/HornetQRecoveryRegistry.java
@@ -165,7 +165,7 @@ public void nodeUp(String nodeID,
password);
HornetQXAResourceWrapper wrapper = new HornetQXAResourceWrapper(config);
- recoveries.put(nodeID, wrapper);
+ recoveries.putIfAbsent(nodeID, wrapper);
}
}
View
48 ...etq-server/src/main/java/org/hornetq/core/protocol/core/impl/wireformat/ReplicationPageEventMessage.java
@@ -19,10 +19,7 @@
/**
* A ReplicationPageWrite
- *
* @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- *
*/
public class ReplicationPageEventMessage extends PacketImpl
{
@@ -36,14 +33,6 @@
*/
private boolean isDelete;
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
public ReplicationPageEventMessage()
{
super(PacketImpl.REPLICATION_PAGE_EVENT);
@@ -57,8 +46,6 @@ public ReplicationPageEventMessage(final SimpleString storeName, final int pageN
this.storeName = storeName;
}
- // Public --------------------------------------------------------
-
@Override
public void encodeRest(final HornetQBuffer buffer)
{
@@ -105,4 +92,39 @@ public String toString()
return ReplicationPageEventMessage.class.getSimpleName() + "(channel=" + channelID + ", isDelete=" + isDelete +
", storeName=" + storeName + ", pageNumber=" + pageNumber + ")";
}
+
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result + (isDelete ? 1231 : 1237);
+ result = prime * result + pageNumber;
+ result = prime * result + ((storeName == null) ? 0 : storeName.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (!super.equals(obj))
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ ReplicationPageEventMessage other = (ReplicationPageEventMessage)obj;
+ if (isDelete != other.isDelete)
+ return false;
+ if (pageNumber != other.pageNumber)
+ return false;
+ if (storeName == null)
+ {
+ if (other.storeName != null)
+ return false;
+ }
+ else if (!storeName.equals(other.storeName))
+ return false;
+ return true;
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.