From deae01ba7f45087e38f04287661fb215cd8ea03e Mon Sep 17 00:00:00 2001 From: Michal Polkorab Date: Thu, 23 Oct 2014 12:09:49 +0200 Subject: [PATCH] Bug 2245 - Fixed 'If Stmts Must Use Braces' Change-Id: Ibef534ef02ef6058ec34dbca7ec172a03612d8d1 Signed-off-by: Michal Polkorab --- .../extensibility/EnhancedMessageCodeKey.java | 12 ++++++--- .../extensibility/EnhancedMessageTypeKey.java | 17 +++++++----- .../api/extensibility/MessageCodeKey.java | 22 +++++++++------ .../api/extensibility/MessageTypeKey.java | 21 +++++++++------ .../api/keys/ActionDeserializerKey.java | 15 +++++++---- .../api/keys/ActionSerializerKey.java | 21 ++++++++++----- .../api/keys/InstructionDeserializerKey.java | 15 +++++++---- .../api/keys/InstructionSerializerKey.java | 21 ++++++++++----- .../api/keys/MatchEntryDeserializerKey.java | 18 ++++++++----- .../api/keys/MatchEntrySerializerKey.java | 27 ++++++++++++------- .../ExperimenterActionSerializerKey.java | 16 ++++++----- .../ExperimenterIdDeserializerKey.java | 15 +++++++---- .../ExperimenterIdSerializerKey.java | 15 +++++++---- .../impl/connection/RpcResponseKey.java | 18 ++++++++----- .../deserialization/MessageTypeCodeKey.java | 18 ++++++++----- .../impl/deserialization/TypeToClassKey.java | 17 +++++++----- 16 files changed, 187 insertions(+), 101 deletions(-) diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageCodeKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageCodeKey.java index 8db03d93..08db5a01 100644 --- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageCodeKey.java +++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageCodeKey.java @@ -37,15 +37,19 @@ public class EnhancedMessageCodeKey extends MessageCodeKey { @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (!super.equals(obj)) + } + if (!super.equals(obj)) { return false; - if (getClass() != obj.getClass()) + } + if (getClass() != obj.getClass()) { return false; + } EnhancedMessageCodeKey other = (EnhancedMessageCodeKey) obj; - if (msgType2 != other.msgType2) + if (msgType2 != other.msgType2) { return false; + } return true; } diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageTypeKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageTypeKey.java index 15919e4f..a2157210 100644 --- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageTypeKey.java +++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageTypeKey.java @@ -30,19 +30,24 @@ public class EnhancedMessageTypeKey extends MessageTypeKey { @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (!super.equals(obj)) + } + if (!super.equals(obj)) { return false; - if (getClass() != obj.getClass()) + } + if (getClass() != obj.getClass()) { return false; + } @SuppressWarnings("rawtypes") EnhancedMessageTypeKey other = (EnhancedMessageTypeKey) obj; if (msgType2 == null) { - if (other.msgType2 != null) + if (other.msgType2 != null) { return false; - } else if (!msgType2.getName().equals(other.msgType2.getName())) + } + } else if (!msgType2.getName().equals(other.msgType2.getName())) { return false; + } return true; } @@ -50,4 +55,4 @@ public class EnhancedMessageTypeKey extends MessageTypeKey { public String toString() { return super.toString() + " msgType2: " + msgType2.getName(); } -} +} \ No newline at end of file diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/MessageCodeKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/MessageCodeKey.java index 86d5a4d1..56b6bb1a 100644 --- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/MessageCodeKey.java +++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/MessageCodeKey.java @@ -40,22 +40,29 @@ public class MessageCodeKey { @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (obj == null) + } + if (obj == null) { return false; - if (!(obj instanceof MessageCodeKey)) + } + if (!(obj instanceof MessageCodeKey)) { return false; + } MessageCodeKey other = (MessageCodeKey) obj; if (clazz == null) { - if (other.clazz != null) + if (other.clazz != null) { return false; - } else if (!clazz.equals(other.clazz)) + } + } else if (!clazz.equals(other.clazz)) { return false; - if (msgType != other.msgType) + } + if (msgType != other.msgType) { return false; - if (msgVersion != other.msgVersion) + } + if (msgVersion != other.msgVersion) { return false; + } return true; } @@ -63,5 +70,4 @@ public class MessageCodeKey { public String toString() { return "msgVersion: " + msgVersion + " objectClass: " + clazz.getName() + " msgType: " + msgType; } - } \ No newline at end of file diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/MessageTypeKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/MessageTypeKey.java index d5d303e4..2e1d0189 100644 --- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/MessageTypeKey.java +++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/MessageTypeKey.java @@ -45,21 +45,26 @@ public class MessageTypeKey { @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (obj == null) + } + if (obj == null) { return false; - if (!(obj instanceof MessageTypeKey)) + } + if (!(obj instanceof MessageTypeKey)) { return false; + } MessageTypeKey other = (MessageTypeKey) obj; if (msgType == null) { - if (other.msgType != null) + if (other.msgType != null) { return false; - } else if (!msgType.equals(other.msgType)) + } + } else if (!msgType.equals(other.msgType)) { return false; - if (msgVersion != other.msgVersion) + } + if (msgVersion != other.msgVersion) { return false; + } return true; } - -} +} \ No newline at end of file diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ActionDeserializerKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ActionDeserializerKey.java index db17b3b5..d7363fbb 100644 --- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ActionDeserializerKey.java +++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ActionDeserializerKey.java @@ -39,18 +39,23 @@ public class ActionDeserializerKey extends MessageCodeKey { @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (!super.equals(obj)) + } + if (!super.equals(obj)) { return false; - if (!(obj instanceof ActionDeserializerKey)) + } + if (!(obj instanceof ActionDeserializerKey)) { return false; + } ActionDeserializerKey other = (ActionDeserializerKey) obj; if (experimenterId == null) { - if (other.experimenterId != null) + if (other.experimenterId != null) { return false; - } else if (!experimenterId.equals(other.experimenterId)) + } + } else if (!experimenterId.equals(other.experimenterId)) { return false; + } return true; } diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ActionSerializerKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ActionSerializerKey.java index bf1fe7dc..4e33c56c 100644 --- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ActionSerializerKey.java +++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ActionSerializerKey.java @@ -44,23 +44,30 @@ public class ActionSerializerKey extends MessageTypeKey @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (!super.equals(obj)) + } + if (!super.equals(obj)) { return false; - if (getClass() != obj.getClass()) + } + if (getClass() != obj.getClass()) { return false; + } ActionSerializerKey other = (ActionSerializerKey) obj; if (actionType == null) { - if (other.actionType != null) + if (other.actionType != null) { return false; - } else if (!actionType.equals(other.actionType)) + } + } else if (!actionType.equals(other.actionType)) { return false; + } if (experimenterId == null) { - if (other.experimenterId != null) + if (other.experimenterId != null) { return false; - } else if (!experimenterId.equals(other.experimenterId)) + } + } else if (!experimenterId.equals(other.experimenterId)) { return false; + } return true; } diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionDeserializerKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionDeserializerKey.java index 91f8977a..c2160878 100644 --- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionDeserializerKey.java +++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionDeserializerKey.java @@ -39,18 +39,23 @@ public class InstructionDeserializerKey extends MessageCodeKey { @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (!super.equals(obj)) + } + if (!super.equals(obj)) { return false; - if (!(obj instanceof InstructionDeserializerKey)) + } + if (!(obj instanceof InstructionDeserializerKey)) { return false; + } InstructionDeserializerKey other = (InstructionDeserializerKey) obj; if (experimenterId == null) { - if (other.experimenterId != null) + if (other.experimenterId != null) { return false; - } else if (!experimenterId.equals(other.experimenterId)) + } + } else if (!experimenterId.equals(other.experimenterId)) { return false; + } return true; } diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionSerializerKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionSerializerKey.java index 899568dc..7759c0bf 100644 --- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionSerializerKey.java +++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionSerializerKey.java @@ -46,23 +46,30 @@ public class InstructionSerializerKey @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (!super.equals(obj)) + } + if (!super.equals(obj)) { return false; - if (!(obj instanceof InstructionSerializerKey)) + } + if (!(obj instanceof InstructionSerializerKey)) { return false; + } InstructionSerializerKey other = (InstructionSerializerKey) obj; if (experimenterId == null) { - if (other.experimenterId != null) + if (other.experimenterId != null) { return false; - } else if (!experimenterId.equals(other.experimenterId)) + } + } else if (!experimenterId.equals(other.experimenterId)) { return false; + } if (instructionType == null) { - if (other.instructionType != null) + if (other.instructionType != null) { return false; - } else if (!instructionType.equals(other.instructionType)) + } + } else if (!instructionType.equals(other.instructionType)) { return false; + } return true; } diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/MatchEntryDeserializerKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/MatchEntryDeserializerKey.java index 593ca8d6..d50d9fb1 100644 --- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/MatchEntryDeserializerKey.java +++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/MatchEntryDeserializerKey.java @@ -51,20 +51,26 @@ public final class MatchEntryDeserializerKey extends MessageCodeKey @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (!super.equals(obj)) + } + if (!super.equals(obj)) { return false; - if (getClass() != obj.getClass()) + } + if (getClass() != obj.getClass()) { return false; + } MatchEntryDeserializerKey other = (MatchEntryDeserializerKey) obj; if (experimenterId == null) { - if (other.experimenterId != null) + if (other.experimenterId != null) { return false; - } else if (!experimenterId.equals(other.experimenterId)) + } + } else if (!experimenterId.equals(other.experimenterId)) { return false; - if (oxmField != other.oxmField) + } + if (oxmField != other.oxmField) { return false; + } return true; } diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/MatchEntrySerializerKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/MatchEntrySerializerKey.java index c7f07f62..55d67e56 100644 --- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/MatchEntrySerializerKey.java +++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/MatchEntrySerializerKey.java @@ -58,28 +58,37 @@ public final class MatchEntrySerializerKey other = (MatchEntrySerializerKey) obj; if (experimenterId == null) { - if (other.experimenterId != null) + if (other.experimenterId != null) { return false; - } else if (!experimenterId.equals(other.experimenterId)) + } + } else if (!experimenterId.equals(other.experimenterId)) { return false; + } if (oxmClass == null) { - if (other.oxmClass != null) + if (other.oxmClass != null) { return false; - } else if (!oxmClass.equals(other.oxmClass)) + } + } else if (!oxmClass.equals(other.oxmClass)) { return false; + } if (oxmField == null) { - if (other.oxmField != null) + if (other.oxmField != null) { return false; - } else if (!oxmField.equals(other.oxmField)) + } + } else if (!oxmField.equals(other.oxmField)) { return false; + } return true; } diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterActionSerializerKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterActionSerializerKey.java index f9f3cb11..45b2d02a 100644 --- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterActionSerializerKey.java +++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterActionSerializerKey.java @@ -40,19 +40,23 @@ public final class ExperimenterActionSerializerKey extends ActionSerializerKey extends Messag @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (!super.equals(obj)) + } + if (!super.equals(obj)) { return false; - if (!(obj instanceof ExperimenterIdSerializerKey)) + } + if (!(obj instanceof ExperimenterIdSerializerKey)) { return false; + } ExperimenterIdSerializerKey other = (ExperimenterIdSerializerKey) obj; if (experimenterId == null) { - if (other.experimenterId != null) + if (other.experimenterId != null) { return false; - } else if (!experimenterId.equals(other.experimenterId)) + } + } else if (!experimenterId.equals(other.experimenterId)) { return false; + } return true; } diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/connection/RpcResponseKey.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/connection/RpcResponseKey.java index a01098d4..5ec0c0b1 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/connection/RpcResponseKey.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/connection/RpcResponseKey.java @@ -52,20 +52,25 @@ public class RpcResponseKey { @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (obj == null) + } + if (obj == null) { return false; - if (getClass() != obj.getClass()) + } + if (getClass() != obj.getClass()) { return false; + } RpcResponseKey other = (RpcResponseKey) obj; if (outputClazz == null) { - if (other.outputClazz != null) + if (other.outputClazz != null) { return false; - } else if (!outputClazz.equals(other.outputClazz)) + } + } else if (!outputClazz.equals(other.outputClazz)) { return false; // if (xid != other.xid) // return false; + } return true; } @@ -74,5 +79,4 @@ public class RpcResponseKey { return "RpcResultKey [xid=" + xid + ", outputClazz=" + outputClazz + "]"; } - -} +} \ No newline at end of file diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/MessageTypeCodeKey.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/MessageTypeCodeKey.java index bb4368ab..d623297e 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/MessageTypeCodeKey.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/MessageTypeCodeKey.java @@ -53,18 +53,22 @@ public class MessageTypeCodeKey { @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (obj == null) + } + if (obj == null) { return false; - if (getClass() != obj.getClass()) + } + if (getClass() != obj.getClass()) { return false; + } MessageTypeCodeKey other = (MessageTypeCodeKey) obj; - if (msgType != other.msgType) + if (msgType != other.msgType) { return false; - if (msgVersion != other.msgVersion) + } + if (msgVersion != other.msgVersion) { return false; + } return true; } - -} +} \ No newline at end of file diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/TypeToClassKey.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/TypeToClassKey.java index 8be2df3e..7774937b 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/TypeToClassKey.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/TypeToClassKey.java @@ -36,17 +36,22 @@ public class TypeToClassKey { @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (obj == null) + } + if (obj == null) { return false; - if (getClass() != obj.getClass()) + } + if (getClass() != obj.getClass()) { return false; + } TypeToClassKey other = (TypeToClassKey) obj; - if (type != other.type) + if (type != other.type) { return false; - if (version != other.version) + } + if (version != other.version) { return false; + } return true; } -} +} \ No newline at end of file -- 2.36.6