Jian Li
Committed by Gerrit Code Review

[ONOS-3737] Bump up checkstyle version from 2.16 to 2.17 with some compilation fixes

Change-Id: I3ade52ff15b3114f5748ab3151c02c8c74af38f0
Showing 21 changed files with 28 additions and 30 deletions
...@@ -118,7 +118,7 @@ public class EventHistoryManager ...@@ -118,7 +118,7 @@ public class EventHistoryManager
118 pruner = newSingleThreadScheduledExecutor(minPriority(groupedThreads("onos/events", "history-pruner"))); 118 pruner = newSingleThreadScheduledExecutor(minPriority(groupedThreads("onos/events", "history-pruner")));
119 119
120 pruner.scheduleWithFixedDelay(this::pruneEventHistoryTask, 120 pruner.scheduleWithFixedDelay(this::pruneEventHistoryTask,
121 - pruneInterval , pruneInterval, TimeUnit.SECONDS); 121 + pruneInterval, pruneInterval, TimeUnit.SECONDS);
122 122
123 listeners = new ListenerTracker(); 123 listeners = new ListenerTracker();
124 listeners.addListener(mastershipService, new InternalMastershipListener()) 124 listeners.addListener(mastershipService, new InternalMastershipListener())
......
...@@ -48,7 +48,7 @@ public class OduSignalId { ...@@ -48,7 +48,7 @@ public class OduSignalId {
48 public OduSignalId(int tributaryPortNumber, int tributarySlotLen, 48 public OduSignalId(int tributaryPortNumber, int tributarySlotLen,
49 byte[] tributarySlotBitmap) { 49 byte[] tributarySlotBitmap) {
50 50
51 - checkArgument(tributaryPortNumber <= 80 , 51 + checkArgument(tributaryPortNumber <= 80,
52 "tributaryPortNumber %s must be <= 80 ", 52 "tributaryPortNumber %s must be <= 80 ",
53 tributaryPortNumber); 53 tributaryPortNumber);
54 54
...@@ -56,7 +56,7 @@ public class OduSignalId { ...@@ -56,7 +56,7 @@ public class OduSignalId {
56 "number of elements in list " + HexString.toHexString(tributarySlotBitmap) 56 "number of elements in list " + HexString.toHexString(tributarySlotBitmap)
57 + " must be equal to " + TRIBUTARY_SLOT_BITMAP_SIZE); 57 + " must be equal to " + TRIBUTARY_SLOT_BITMAP_SIZE);
58 58
59 - checkArgument(tributarySlotLen <= 80 , 59 + checkArgument(tributarySlotLen <= 80,
60 "tributarySlotLen %s must be <= 80 ", 60 "tributarySlotLen %s must be <= 80 ",
61 tributarySlotLen); 61 tributarySlotLen);
62 62
......
...@@ -37,7 +37,7 @@ public class DefaultFlowRuleTest { ...@@ -37,7 +37,7 @@ public class DefaultFlowRuleTest {
37 private static final IntentTestsMocks.MockTreatment TREATMENT = 37 private static final IntentTestsMocks.MockTreatment TREATMENT =
38 new IntentTestsMocks.MockTreatment(); 38 new IntentTestsMocks.MockTreatment();
39 39
40 - private static byte [] b = new byte[3]; 40 + private static byte[] b = new byte[3];
41 private static FlowRuleExtPayLoad payLoad = FlowRuleExtPayLoad.flowRuleExtPayLoad(b); 41 private static FlowRuleExtPayLoad payLoad = FlowRuleExtPayLoad.flowRuleExtPayLoad(b);
42 final FlowRule flowRule1 = new IntentTestsMocks.MockFlowRule(1, payLoad); 42 final FlowRule flowRule1 = new IntentTestsMocks.MockFlowRule(1, payLoad);
43 final FlowRule sameAsFlowRule1 = new IntentTestsMocks.MockFlowRule(1, payLoad); 43 final FlowRule sameAsFlowRule1 = new IntentTestsMocks.MockFlowRule(1, payLoad);
......
...@@ -541,7 +541,7 @@ public class FlowRuleCodecTest { ...@@ -541,7 +541,7 @@ public class FlowRuleCodecTest {
541 is(80)); 541 is(80));
542 542
543 assertThat(((OduSignalIdCriterion) criterion).oduSignalId().tributarySlotBitmap(), 543 assertThat(((OduSignalIdCriterion) criterion).oduSignalId().tributarySlotBitmap(),
544 - is(new byte [] {1, 1, 1, 1, 1, 1, 1, 1, 1, 1})); 544 + is(new byte[] {1, 1, 1, 1, 1, 1, 1, 1, 1, 1}));
545 } 545 }
546 546
547 /** 547 /**
......
...@@ -127,7 +127,7 @@ public class InstructionCodecTest { ...@@ -127,7 +127,7 @@ public class InstructionCodecTest {
127 */ 127 */
128 @Test 128 @Test
129 public void modOduSignalIdInstructionTest() { 129 public void modOduSignalIdInstructionTest() {
130 - OduSignalId oduSignalId = OduSignalId.oduSignalId(1, 8, new byte [] {8, 0, 0, 0, 0, 0, 0, 0, 0, 0}); 130 + OduSignalId oduSignalId = OduSignalId.oduSignalId(1, 8, new byte[] {8, 0, 0, 0, 0, 0, 0, 0, 0, 0});
131 L1ModificationInstruction.ModOduSignalIdInstruction instruction = 131 L1ModificationInstruction.ModOduSignalIdInstruction instruction =
132 (L1ModificationInstruction.ModOduSignalIdInstruction) 132 (L1ModificationInstruction.ModOduSignalIdInstruction)
133 Instructions.modL1OduSignalId(oduSignalId); 133 Instructions.modL1OduSignalId(oduSignalId);
......
...@@ -230,7 +230,7 @@ public final class InstructionJsonMatcher extends TypeSafeDiagnosingMatcher<Json ...@@ -230,7 +230,7 @@ public final class InstructionJsonMatcher extends TypeSafeDiagnosingMatcher<Json
230 final JsonNode jsonOduSignal = instructionJson.get("oduSignalId"); 230 final JsonNode jsonOduSignal = instructionJson.get("oduSignalId");
231 int jsonTpn = jsonOduSignal.get("tributaryPortNumber").intValue(); 231 int jsonTpn = jsonOduSignal.get("tributaryPortNumber").intValue();
232 int jsonTsLen = jsonOduSignal.get("tributarySlotLength").intValue(); 232 int jsonTsLen = jsonOduSignal.get("tributarySlotLength").intValue();
233 - byte [] tributaryBitMap = HexString.fromHexString(jsonOduSignal.get("tributarySlotBitmap").asText()); 233 + byte[] tributaryBitMap = HexString.fromHexString(jsonOduSignal.get("tributarySlotBitmap").asText());
234 OduSignalId jsonOduSignalId = OduSignalId.oduSignalId(jsonTpn, jsonTsLen, tributaryBitMap); 234 OduSignalId jsonOduSignalId = OduSignalId.oduSignalId(jsonTpn, jsonTsLen, tributaryBitMap);
235 if (!instructionToMatch.oduSignalId().equals(jsonOduSignalId)) { 235 if (!instructionToMatch.oduSignalId().equals(jsonOduSignalId)) {
236 description.appendText("oduSignalId was " + instructionToMatch); 236 description.appendText("oduSignalId was " + instructionToMatch);
......
...@@ -206,8 +206,7 @@ public class SimpleDeviceStore ...@@ -206,8 +206,7 @@ public class SimpleDeviceStore
206 // FIXME: Is the enclosing if required here? 206 // FIXME: Is the enclosing if required here?
207 verify(replaced, 207 verify(replaced,
208 "Replacing devices cache failed. PID:%s [expected:%s, found:%s, new=%s]", 208 "Replacing devices cache failed. PID:%s [expected:%s, found:%s, new=%s]",
209 - providerId, oldDevice, devices.get(newDevice.id()) 209 + providerId, oldDevice, devices.get(newDevice.id()), newDevice);
210 - , newDevice);
211 } 210 }
212 if (!providerId.isAncillary()) { 211 if (!providerId.isAncillary()) {
213 availableDevices.add(newDevice.id()); 212 availableDevices.add(newDevice.id());
......
...@@ -439,8 +439,7 @@ public class GossipDeviceStore ...@@ -439,8 +439,7 @@ public class GossipDeviceStore
439 if (!replaced) { 439 if (!replaced) {
440 verify(replaced, 440 verify(replaced,
441 "Replacing devices cache failed. PID:%s [expected:%s, found:%s, new=%s]", 441 "Replacing devices cache failed. PID:%s [expected:%s, found:%s, new=%s]",
442 - providerId, oldDevice, devices.get(newDevice.id()) 442 + providerId, oldDevice, devices.get(newDevice.id()), newDevice);
443 - , newDevice);
444 } 443 }
445 444
446 event = new DeviceEvent(DeviceEvent.Type.DEVICE_UPDATED, newDevice, null); 445 event = new DeviceEvent(DeviceEvent.Type.DEVICE_UPDATED, newDevice, null);
......
...@@ -215,7 +215,7 @@ public class ECLinkStore ...@@ -215,7 +215,7 @@ public class ECLinkStore
215 if (internalLinkKey == null) { 215 if (internalLinkKey == null) {
216 return null; 216 return null;
217 } 217 }
218 - linkDescriptions.compute(internalLinkKey, (k, v) -> createOrUpdateLinkInternal(v , linkDescription)); 218 + linkDescriptions.compute(internalLinkKey, (k, v) -> createOrUpdateLinkInternal(v, linkDescription));
219 return refreshLinkCache(linkKey); 219 return refreshLinkCache(linkKey);
220 } else { 220 } else {
221 // Only forward for ConfigProvider 221 // Only forward for ConfigProvider
......
...@@ -112,8 +112,8 @@ public class OFOpticalSwitch13 extends AbstractOpenFlowSwitch implements OpenFlo ...@@ -112,8 +112,8 @@ public class OFOpticalSwitch13 extends AbstractOpenFlowSwitch implements OpenFlo
112 return; 112 return;
113 } 113 }
114 } catch (ClassCastException e) { 114 } catch (ClassCastException e) {
115 - log.error("Unexspected Experimenter Multipart message type {} " 115 + log.error("Unexspected Experimenter Multipart message type {} ",
116 - , stats.getClass().getName()); 116 + stats.getClass().getName());
117 } 117 }
118 } 118 }
119 } 119 }
......
...@@ -698,7 +698,7 @@ ...@@ -698,7 +698,7 @@
698 <plugin> 698 <plugin>
699 <groupId>org.apache.maven.plugins</groupId> 699 <groupId>org.apache.maven.plugins</groupId>
700 <artifactId>maven-checkstyle-plugin</artifactId> 700 <artifactId>maven-checkstyle-plugin</artifactId>
701 - <version>2.16</version> 701 + <version>2.17</version>
702 <dependencies> 702 <dependencies>
703 <dependency> 703 <dependency>
704 <groupId>org.onosproject</groupId> 704 <groupId>org.onosproject</groupId>
......
...@@ -110,7 +110,7 @@ public class IPv4AddressTlv implements BgpValueType { ...@@ -110,7 +110,7 @@ public class IPv4AddressTlv implements BgpValueType {
110 * @param type says Ipv4 address of interface/neighbor tlv type 110 * @param type says Ipv4 address of interface/neighbor tlv type
111 * @return object of this class 111 * @return object of this class
112 */ 112 */
113 - public static IPv4AddressTlv of(final Ip4Address address , final short type) { 113 + public static IPv4AddressTlv of(final Ip4Address address, final short type) {
114 return new IPv4AddressTlv(address, type); 114 return new IPv4AddressTlv(address, type);
115 } 115 }
116 116
......
...@@ -110,7 +110,7 @@ public class IPv6AddressTlv implements BgpValueType { ...@@ -110,7 +110,7 @@ public class IPv6AddressTlv implements BgpValueType {
110 * @param type says Ipv6 address of interface/neighbor tlv type 110 * @param type says Ipv6 address of interface/neighbor tlv type
111 * @return object of this class 111 * @return object of this class
112 */ 112 */
113 - public static IPv6AddressTlv of(final Ip6Address address , final short type) { 113 + public static IPv6AddressTlv of(final Ip6Address address, final short type) {
114 return new IPv6AddressTlv(address, type); 114 return new IPv6AddressTlv(address, type);
115 } 115 }
116 116
......
...@@ -221,7 +221,7 @@ public class BgpUpdateMsgTest { ...@@ -221,7 +221,7 @@ public class BgpUpdateMsgTest {
221 */ 221 */
222 @Test 222 @Test
223 public void bgpUpdateMessageTest07() throws BgpParseException { 223 public void bgpUpdateMessageTest07() throws BgpParseException {
224 - byte[] updateMsg = new byte [] {(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, 224 + byte[] updateMsg = new byte[] {(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
225 (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, 225 (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
226 (byte) 0xff, (byte) 0xff, 0x00, 0x3f, 0x02, 0x00, 0x00, 0x00, 0x1c, 0x40, 0x01, 0x01, 226 (byte) 0xff, (byte) 0xff, 0x00, 0x3f, 0x02, 0x00, 0x00, 0x00, 0x1c, 0x40, 0x01, 0x01,
227 0x00, 0x40, 0x02, 0x00, 0x40, 0x03, 0x04, 0x03, 0x03, 0x03, 0x03, (byte) 0x80, 0x04, 0x04, 0x00, 0x00, 227 0x00, 0x40, 0x02, 0x00, 0x40, 0x03, 0x04, 0x03, 0x03, 0x03, 0x03, (byte) 0x80, 0x04, 0x04, 0x00, 0x00,
......
...@@ -185,7 +185,7 @@ public class RemoteTENodeDescriptorsTlv implements PcepValueType { ...@@ -185,7 +185,7 @@ public class RemoteTENodeDescriptorsTlv implements PcepValueType {
185 * @return object of RemoteTENodeDescriptorsTLV 185 * @return object of RemoteTENodeDescriptorsTLV
186 * @throws PcepParseException if mandatory fields are missing 186 * @throws PcepParseException if mandatory fields are missing
187 */ 187 */
188 - public static PcepValueType read(ChannelBuffer c , short length) throws PcepParseException { 188 + public static PcepValueType read(ChannelBuffer c, short length) throws PcepParseException {
189 189
190 // Node Descriptor Sub-TLVs (variable) 190 // Node Descriptor Sub-TLVs (variable)
191 LinkedList<PcepValueType> llRemoteTENodeDescriptorSubTLVs = new LinkedList<>(); 191 LinkedList<PcepValueType> llRemoteTENodeDescriptorSubTLVs = new LinkedList<>();
......
...@@ -88,7 +88,7 @@ public class OpenFlowPacketProviderTest { ...@@ -88,7 +88,7 @@ public class OpenFlowPacketProviderTest {
88 private static final TrafficTreatment TR = treatment(INST1, INST2); 88 private static final TrafficTreatment TR = treatment(INST1, INST2);
89 private static final TrafficTreatment TR_MISSING = treatment(INST1, INST3); 89 private static final TrafficTreatment TR_MISSING = treatment(INST1, INST3);
90 90
91 - private static final byte[] ANY = new byte [] {0, 0, 0, 0}; 91 + private static final byte[] ANY = new byte[] {0, 0, 0, 0};
92 92
93 private final OpenFlowPacketProvider provider = new OpenFlowPacketProvider(); 93 private final OpenFlowPacketProvider provider = new OpenFlowPacketProvider();
94 private final TestPacketRegistry registry = new TestPacketRegistry(); 94 private final TestPacketRegistry registry = new TestPacketRegistry();
......
...@@ -125,7 +125,7 @@ public class PcepTunnelApiMapper { ...@@ -125,7 +125,7 @@ public class PcepTunnelApiMapper {
125 int value = tunnelIdMap.get(pcepTunnelData.tunnel().tunnelId()); 125 int value = tunnelIdMap.get(pcepTunnelData.tunnel().tunnelId());
126 tunnelDB.put(new Integer(value), pcepTunnelData); 126 tunnelDB.put(new Integer(value), pcepTunnelData);
127 tunnelRequestQueue.remove(new Integer(srpId), pcepTunnelData); 127 tunnelRequestQueue.remove(new Integer(srpId), pcepTunnelData);
128 - log.debug("Tunnel Added to TunnelDBQueue and removed from TunnelRequestQueue. tunnel id {}" , 128 + log.debug("Tunnel Added to TunnelDBQueue and removed from TunnelRequestQueue. tunnel id {}",
129 (new Integer(value)).toString()); 129 (new Integer(value)).toString());
130 } else { 130 } else {
131 pcepTunnelData.setRptFlag(true); 131 pcepTunnelData.setRptFlag(true);
......
...@@ -159,7 +159,7 @@ public class IGMP extends BasePacket { ...@@ -159,7 +159,7 @@ public class IGMP extends BasePacket {
159 @java.lang.SuppressWarnings(SONAR_SWITCH_FALLTHROUGH) // suppress switch fall through warning 159 @java.lang.SuppressWarnings(SONAR_SWITCH_FALLTHROUGH) // suppress switch fall through warning
160 @Override 160 @Override
161 public byte[] serialize() { 161 public byte[] serialize() {
162 - byte [] data = new byte[8915]; 162 + byte[] data = new byte[8915];
163 163
164 ByteBuffer bb = ByteBuffer.wrap(data); 164 ByteBuffer bb = ByteBuffer.wrap(data);
165 bb.put(this.getIgmpType()); 165 bb.put(this.getIgmpType());
...@@ -193,7 +193,7 @@ public class IGMP extends BasePacket { ...@@ -193,7 +193,7 @@ public class IGMP extends BasePacket {
193 193
194 int size = bb.position(); 194 int size = bb.position();
195 bb.position(0); 195 bb.position(0);
196 - byte [] rdata = new byte[size]; 196 + byte[] rdata = new byte[size];
197 bb.get(rdata, 0, size); 197 bb.get(rdata, 0, size);
198 return rdata; 198 return rdata;
199 } 199 }
......
...@@ -131,7 +131,7 @@ public class PIMHelloOption { ...@@ -131,7 +131,7 @@ public class PIMHelloOption {
131 return opt; 131 return opt;
132 } 132 }
133 133
134 - public byte [] serialize() { 134 + public byte[] serialize() {
135 int len = 4 + this.optLength; 135 int len = 4 + this.optLength;
136 ByteBuffer bb = ByteBuffer.allocate(len); 136 ByteBuffer bb = ByteBuffer.allocate(len);
137 bb.putShort(this.optType); 137 bb.putShort(this.optType);
......
...@@ -73,7 +73,7 @@ public class IGMPTest { ...@@ -73,7 +73,7 @@ public class IGMPTest {
73 73
74 @Test 74 @Test
75 public void testDeserializeTruncated() throws Exception { 75 public void testDeserializeTruncated() throws Exception {
76 - byte [] bits = igmpQuery.serialize(); 76 + byte[] bits = igmpQuery.serialize();
77 PacketTestUtils.testDeserializeTruncated(deserializer, bits); 77 PacketTestUtils.testDeserializeTruncated(deserializer, bits);
78 78
79 bits = igmpMembership.serialize(); 79 bits = igmpMembership.serialize();
...@@ -82,14 +82,14 @@ public class IGMPTest { ...@@ -82,14 +82,14 @@ public class IGMPTest {
82 82
83 @Test 83 @Test
84 public void testDeserializeQuery() throws Exception { 84 public void testDeserializeQuery() throws Exception {
85 - byte [] data = igmpQuery.serialize(); 85 + byte[] data = igmpQuery.serialize();
86 IGMP igmp = deserializer.deserialize(data, 0, data.length); 86 IGMP igmp = deserializer.deserialize(data, 0, data.length);
87 assertTrue(igmp.equals(igmpQuery)); 87 assertTrue(igmp.equals(igmpQuery));
88 } 88 }
89 89
90 @Test 90 @Test
91 public void testDeserializeMembership() throws Exception { 91 public void testDeserializeMembership() throws Exception {
92 - byte [] data = igmpMembership.serialize(); 92 + byte[] data = igmpMembership.serialize();
93 IGMP igmp = deserializer.deserialize(data, 0, data.length); 93 IGMP igmp = deserializer.deserialize(data, 0, data.length);
94 assertTrue(igmp.equals(igmpMembership)); 94 assertTrue(igmp.equals(igmpMembership));
95 } 95 }
......
...@@ -101,7 +101,7 @@ public final class PIMTest { ...@@ -101,7 +101,7 @@ public final class PIMTest {
101 */ 101 */
102 @Test 102 @Test
103 public void testDeserializeTruncated() throws Exception { 103 public void testDeserializeTruncated() throws Exception {
104 - byte [] bits = pimJoinPrune.serialize(); 104 + byte[] bits = pimJoinPrune.serialize();
105 PacketTestUtils.testDeserializeTruncated(deserializer, bits); 105 PacketTestUtils.testDeserializeTruncated(deserializer, bits);
106 } 106 }
107 107
...@@ -112,7 +112,7 @@ public final class PIMTest { ...@@ -112,7 +112,7 @@ public final class PIMTest {
112 */ 112 */
113 @Test 113 @Test
114 public void testDeserializeHello() throws Exception { 114 public void testDeserializeHello() throws Exception {
115 - byte [] data = pimHello.serialize(); 115 + byte[] data = pimHello.serialize();
116 PIM pim = deserializer.deserialize(data, 0, data.length); 116 PIM pim = deserializer.deserialize(data, 0, data.length);
117 assertTrue(pim.equals(pimHello)); 117 assertTrue(pim.equals(pimHello));
118 } 118 }
...@@ -124,7 +124,7 @@ public final class PIMTest { ...@@ -124,7 +124,7 @@ public final class PIMTest {
124 */ 124 */
125 @Test 125 @Test
126 public void testDeserializeJoinPrune() throws Exception { 126 public void testDeserializeJoinPrune() throws Exception {
127 - byte [] data = pimJoinPrune.serialize(); 127 + byte[] data = pimJoinPrune.serialize();
128 PIM pim = deserializer.deserialize(data, 0, data.length); 128 PIM pim = deserializer.deserialize(data, 0, data.length);
129 assertTrue(pim.equals(pimJoinPrune)); 129 assertTrue(pim.equals(pimJoinPrune));
130 } 130 }
......