diff options
| author | Robert Godfrey <rgodfrey@apache.org> | 2014-08-19 20:07:48 +0000 |
|---|---|---|
| committer | Robert Godfrey <rgodfrey@apache.org> | 2014-08-19 20:07:48 +0000 |
| commit | 451bda18227dccc91a08fe1ade559d0f91be932d (patch) | |
| tree | 01393f5225dfd000ace782a5b8df95eb69d5d375 /qpid/java/common/src | |
| parent | 7520eb94cd61b4ae3d31879102791182210a5302 (diff) | |
| download | qpid-python-451bda18227dccc91a08fe1ade559d0f91be932d.tar.gz | |
QPID-6022 : [Java] Fix issues highlighted by code scanning tools
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1618964 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/common/src')
5 files changed, 25 insertions, 25 deletions
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java index b490aee898..ef0da9b918 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java @@ -136,42 +136,42 @@ public class BasicContentHeaderProperties { int size = 0; - if ((_propertyFlags & (CONTENT_TYPE_MASK)) > 0) + if ((_propertyFlags & (CONTENT_TYPE_MASK)) != 0) { size += EncodingUtils.encodedShortStringLength(_contentType); } - if ((_propertyFlags & ENCODING_MASK) > 0) + if ((_propertyFlags & ENCODING_MASK) != 0) { size += EncodingUtils.encodedShortStringLength(_encoding); } - if ((_propertyFlags & HEADERS_MASK) > 0) + if ((_propertyFlags & HEADERS_MASK) != 0) { size += EncodingUtils.encodedFieldTableLength(_headers); } - if ((_propertyFlags & DELIVERY_MODE_MASK) > 0) + if ((_propertyFlags & DELIVERY_MODE_MASK) != 0) { size += 1; } - if ((_propertyFlags & PRIORITY_MASK) > 0) + if ((_propertyFlags & PRIORITY_MASK) != 0) { size += 1; } - if ((_propertyFlags & CORRELATION_ID_MASK) > 0) + if ((_propertyFlags & CORRELATION_ID_MASK) != 0) { size += EncodingUtils.encodedShortStringLength(_correlationId); } - if ((_propertyFlags & REPLY_TO_MASK) > 0) + if ((_propertyFlags & REPLY_TO_MASK) != 0) { size += EncodingUtils.encodedShortStringLength(_replyTo); } - if ((_propertyFlags & EXPIRATION_MASK) > 0) + if ((_propertyFlags & EXPIRATION_MASK) != 0) { if (_expiration == 0L) { @@ -183,32 +183,32 @@ public class BasicContentHeaderProperties } } - if ((_propertyFlags & MESSAGE_ID_MASK) > 0) + if ((_propertyFlags & MESSAGE_ID_MASK) != 0) { size += EncodingUtils.encodedShortStringLength(_messageId); } - if ((_propertyFlags & TIMESTAMP_MASK) > 0) + if ((_propertyFlags & TIMESTAMP_MASK) != 0) { size += 8; } - if ((_propertyFlags & TYPE_MASK) > 0) + if ((_propertyFlags & TYPE_MASK) != 0) { size += EncodingUtils.encodedShortStringLength(_type); } - if ((_propertyFlags & USER_ID_MASK) > 0) + if ((_propertyFlags & USER_ID_MASK) != 0) { size += EncodingUtils.encodedShortStringLength(_userId); } - if ((_propertyFlags & APPLICATION_ID_MASK) > 0) + if ((_propertyFlags & APPLICATION_ID_MASK) != 0) { size += EncodingUtils.encodedShortStringLength(_appId); } - if ((_propertyFlags & CLUSTER_ID_MASK) > 0) + if ((_propertyFlags & CLUSTER_ID_MASK) != 0) { size += EncodingUtils.encodedShortStringLength(_clusterId); } diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoReceiver.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoReceiver.java index e8499539be..b52b59aa15 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoReceiver.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoReceiver.java @@ -210,7 +210,7 @@ final class IoReceiver implements Runnable } } } - catch (Throwable t) + catch (Exception t) { if (shouldReport(t)) { diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/sasl/SASLEncryptor.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/sasl/SASLEncryptor.java index a90ea52202..2a70087c10 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/sasl/SASLEncryptor.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/sasl/SASLEncryptor.java @@ -21,13 +21,13 @@ package org.apache.qpid.transport.network.security.sasl; +import javax.security.sasl.Sasl; +import javax.security.sasl.SaslClient; + import org.apache.qpid.transport.Connection; import org.apache.qpid.transport.ConnectionException; import org.apache.qpid.transport.ConnectionListener; -import javax.security.sasl.Sasl; -import javax.security.sasl.SaslClient; - public abstract class SASLEncryptor implements ConnectionListener { private SaslClient saslClient; @@ -45,7 +45,7 @@ public abstract class SASLEncryptor implements ConnectionListener if (conn.getSaslClient() != null) { saslClient = conn.getSaslClient(); - if (saslClient.isComplete() && saslClient.getNegotiatedProperty(Sasl.QOP) == "auth-conf") + if (saslClient.isComplete() && "auth-conf".equals(saslClient.getNegotiatedProperty(Sasl.QOP))) { sendBuffSize = Integer.parseInt( (String)saslClient.getNegotiatedProperty(Sasl.RAW_SEND_SIZE)); diff --git a/qpid/java/common/src/main/java/org/apache/qpid/url/URLHelper.java b/qpid/java/common/src/main/java/org/apache/qpid/url/URLHelper.java index 8516e7fa0e..c7fea15576 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/url/URLHelper.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/url/URLHelper.java @@ -151,15 +151,15 @@ public class URLHelper } else { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append('?'); - for (String key : options.keySet()) + for (Map.Entry<String,String> entry : options.entrySet()) { - sb.append(key); + sb.append(entry.getKey()); sb.append("='"); - sb.append(options.get(key)); + sb.append(entry.getValue()); sb.append("'"); sb.append(DEFAULT_OPTION_SEPERATOR); diff --git a/qpid/java/common/src/main/java/org/apache/qpid/util/Strings.java b/qpid/java/common/src/main/java/org/apache/qpid/util/Strings.java index b7b9bf8c6e..6dd6a989cb 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/util/Strings.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/util/Strings.java @@ -323,9 +323,9 @@ public final class Strings sb.append("<"); if (map != null) { - for(String key : map.keySet()) + for(Map.Entry<String,Object> entry : map.entrySet()) { - sb.append(key).append(" = ").append(map.get(key)).append(" "); + sb.append(entry.getKey()).append(" = ").append(entry.getValue()).append(" "); } } sb.append(">"); |
