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
pruner = newSingleThreadScheduledExecutor(minPriority(groupedThreads("onos/events", "history-pruner")));
pruner.scheduleWithFixedDelay(this::pruneEventHistoryTask,
pruneInterval , pruneInterval, TimeUnit.SECONDS);
pruneInterval, pruneInterval, TimeUnit.SECONDS);
listeners = new ListenerTracker();
listeners.addListener(mastershipService, new InternalMastershipListener())
......
......@@ -48,7 +48,7 @@ public class OduSignalId {
public OduSignalId(int tributaryPortNumber, int tributarySlotLen,
byte[] tributarySlotBitmap) {
checkArgument(tributaryPortNumber <= 80 ,
checkArgument(tributaryPortNumber <= 80,
"tributaryPortNumber %s must be <= 80 ",
tributaryPortNumber);
......@@ -56,7 +56,7 @@ public class OduSignalId {
"number of elements in list " + HexString.toHexString(tributarySlotBitmap)
+ " must be equal to " + TRIBUTARY_SLOT_BITMAP_SIZE);
checkArgument(tributarySlotLen <= 80 ,
checkArgument(tributarySlotLen <= 80,
"tributarySlotLen %s must be <= 80 ",
tributarySlotLen);
......
......@@ -37,7 +37,7 @@ public class DefaultFlowRuleTest {
private static final IntentTestsMocks.MockTreatment TREATMENT =
new IntentTestsMocks.MockTreatment();
private static byte [] b = new byte[3];
private static byte[] b = new byte[3];
private static FlowRuleExtPayLoad payLoad = FlowRuleExtPayLoad.flowRuleExtPayLoad(b);
final FlowRule flowRule1 = new IntentTestsMocks.MockFlowRule(1, payLoad);
final FlowRule sameAsFlowRule1 = new IntentTestsMocks.MockFlowRule(1, payLoad);
......
......@@ -541,7 +541,7 @@ public class FlowRuleCodecTest {
is(80));
assertThat(((OduSignalIdCriterion) criterion).oduSignalId().tributarySlotBitmap(),
is(new byte [] {1, 1, 1, 1, 1, 1, 1, 1, 1, 1}));
is(new byte[] {1, 1, 1, 1, 1, 1, 1, 1, 1, 1}));
}
/**
......
......@@ -127,7 +127,7 @@ public class InstructionCodecTest {
*/
@Test
public void modOduSignalIdInstructionTest() {
OduSignalId oduSignalId = OduSignalId.oduSignalId(1, 8, new byte [] {8, 0, 0, 0, 0, 0, 0, 0, 0, 0});
OduSignalId oduSignalId = OduSignalId.oduSignalId(1, 8, new byte[] {8, 0, 0, 0, 0, 0, 0, 0, 0, 0});
L1ModificationInstruction.ModOduSignalIdInstruction instruction =
(L1ModificationInstruction.ModOduSignalIdInstruction)
Instructions.modL1OduSignalId(oduSignalId);
......
......@@ -230,7 +230,7 @@ public final class InstructionJsonMatcher extends TypeSafeDiagnosingMatcher<Json
final JsonNode jsonOduSignal = instructionJson.get("oduSignalId");
int jsonTpn = jsonOduSignal.get("tributaryPortNumber").intValue();
int jsonTsLen = jsonOduSignal.get("tributarySlotLength").intValue();
byte [] tributaryBitMap = HexString.fromHexString(jsonOduSignal.get("tributarySlotBitmap").asText());
byte[] tributaryBitMap = HexString.fromHexString(jsonOduSignal.get("tributarySlotBitmap").asText());
OduSignalId jsonOduSignalId = OduSignalId.oduSignalId(jsonTpn, jsonTsLen, tributaryBitMap);
if (!instructionToMatch.oduSignalId().equals(jsonOduSignalId)) {
description.appendText("oduSignalId was " + instructionToMatch);
......
......@@ -206,8 +206,7 @@ public class SimpleDeviceStore
// FIXME: Is the enclosing if required here?
verify(replaced,
"Replacing devices cache failed. PID:%s [expected:%s, found:%s, new=%s]",
providerId, oldDevice, devices.get(newDevice.id())
, newDevice);
providerId, oldDevice, devices.get(newDevice.id()), newDevice);
}
if (!providerId.isAncillary()) {
availableDevices.add(newDevice.id());
......
......@@ -439,8 +439,7 @@ public class GossipDeviceStore
if (!replaced) {
verify(replaced,
"Replacing devices cache failed. PID:%s [expected:%s, found:%s, new=%s]",
providerId, oldDevice, devices.get(newDevice.id())
, newDevice);
providerId, oldDevice, devices.get(newDevice.id()), newDevice);
}
event = new DeviceEvent(DeviceEvent.Type.DEVICE_UPDATED, newDevice, null);
......
......@@ -215,7 +215,7 @@ public class ECLinkStore
if (internalLinkKey == null) {
return null;
}
linkDescriptions.compute(internalLinkKey, (k, v) -> createOrUpdateLinkInternal(v , linkDescription));
linkDescriptions.compute(internalLinkKey, (k, v) -> createOrUpdateLinkInternal(v, linkDescription));
return refreshLinkCache(linkKey);
} else {
// Only forward for ConfigProvider
......
......@@ -112,8 +112,8 @@ public class OFOpticalSwitch13 extends AbstractOpenFlowSwitch implements OpenFlo
return;
}
} catch (ClassCastException e) {
log.error("Unexspected Experimenter Multipart message type {} "
, stats.getClass().getName());
log.error("Unexspected Experimenter Multipart message type {} ",
stats.getClass().getName());
}
}
}
......
......@@ -698,7 +698,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.16</version>
<version>2.17</version>
<dependencies>
<dependency>
<groupId>org.onosproject</groupId>
......
......@@ -110,7 +110,7 @@ public class IPv4AddressTlv implements BgpValueType {
* @param type says Ipv4 address of interface/neighbor tlv type
* @return object of this class
*/
public static IPv4AddressTlv of(final Ip4Address address , final short type) {
public static IPv4AddressTlv of(final Ip4Address address, final short type) {
return new IPv4AddressTlv(address, type);
}
......
......@@ -110,7 +110,7 @@ public class IPv6AddressTlv implements BgpValueType {
* @param type says Ipv6 address of interface/neighbor tlv type
* @return object of this class
*/
public static IPv6AddressTlv of(final Ip6Address address , final short type) {
public static IPv6AddressTlv of(final Ip6Address address, final short type) {
return new IPv6AddressTlv(address, type);
}
......
......@@ -221,7 +221,7 @@ public class BgpUpdateMsgTest {
*/
@Test
public void bgpUpdateMessageTest07() throws BgpParseException {
byte[] updateMsg = new byte [] {(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
byte[] updateMsg = new byte[] {(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
(byte) 0xff, (byte) 0xff, 0x00, 0x3f, 0x02, 0x00, 0x00, 0x00, 0x1c, 0x40, 0x01, 0x01,
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 {
* @return object of RemoteTENodeDescriptorsTLV
* @throws PcepParseException if mandatory fields are missing
*/
public static PcepValueType read(ChannelBuffer c , short length) throws PcepParseException {
public static PcepValueType read(ChannelBuffer c, short length) throws PcepParseException {
// Node Descriptor Sub-TLVs (variable)
LinkedList<PcepValueType> llRemoteTENodeDescriptorSubTLVs = new LinkedList<>();
......
......@@ -88,7 +88,7 @@ public class OpenFlowPacketProviderTest {
private static final TrafficTreatment TR = treatment(INST1, INST2);
private static final TrafficTreatment TR_MISSING = treatment(INST1, INST3);
private static final byte[] ANY = new byte [] {0, 0, 0, 0};
private static final byte[] ANY = new byte[] {0, 0, 0, 0};
private final OpenFlowPacketProvider provider = new OpenFlowPacketProvider();
private final TestPacketRegistry registry = new TestPacketRegistry();
......
......@@ -125,7 +125,7 @@ public class PcepTunnelApiMapper {
int value = tunnelIdMap.get(pcepTunnelData.tunnel().tunnelId());
tunnelDB.put(new Integer(value), pcepTunnelData);
tunnelRequestQueue.remove(new Integer(srpId), pcepTunnelData);
log.debug("Tunnel Added to TunnelDBQueue and removed from TunnelRequestQueue. tunnel id {}" ,
log.debug("Tunnel Added to TunnelDBQueue and removed from TunnelRequestQueue. tunnel id {}",
(new Integer(value)).toString());
} else {
pcepTunnelData.setRptFlag(true);
......
......@@ -159,7 +159,7 @@ public class IGMP extends BasePacket {
@java.lang.SuppressWarnings(SONAR_SWITCH_FALLTHROUGH) // suppress switch fall through warning
@Override
public byte[] serialize() {
byte [] data = new byte[8915];
byte[] data = new byte[8915];
ByteBuffer bb = ByteBuffer.wrap(data);
bb.put(this.getIgmpType());
......@@ -193,7 +193,7 @@ public class IGMP extends BasePacket {
int size = bb.position();
bb.position(0);
byte [] rdata = new byte[size];
byte[] rdata = new byte[size];
bb.get(rdata, 0, size);
return rdata;
}
......
......@@ -131,7 +131,7 @@ public class PIMHelloOption {
return opt;
}
public byte [] serialize() {
public byte[] serialize() {
int len = 4 + this.optLength;
ByteBuffer bb = ByteBuffer.allocate(len);
bb.putShort(this.optType);
......
......@@ -73,7 +73,7 @@ public class IGMPTest {
@Test
public void testDeserializeTruncated() throws Exception {
byte [] bits = igmpQuery.serialize();
byte[] bits = igmpQuery.serialize();
PacketTestUtils.testDeserializeTruncated(deserializer, bits);
bits = igmpMembership.serialize();
......@@ -82,14 +82,14 @@ public class IGMPTest {
@Test
public void testDeserializeQuery() throws Exception {
byte [] data = igmpQuery.serialize();
byte[] data = igmpQuery.serialize();
IGMP igmp = deserializer.deserialize(data, 0, data.length);
assertTrue(igmp.equals(igmpQuery));
}
@Test
public void testDeserializeMembership() throws Exception {
byte [] data = igmpMembership.serialize();
byte[] data = igmpMembership.serialize();
IGMP igmp = deserializer.deserialize(data, 0, data.length);
assertTrue(igmp.equals(igmpMembership));
}
......
......@@ -101,7 +101,7 @@ public final class PIMTest {
*/
@Test
public void testDeserializeTruncated() throws Exception {
byte [] bits = pimJoinPrune.serialize();
byte[] bits = pimJoinPrune.serialize();
PacketTestUtils.testDeserializeTruncated(deserializer, bits);
}
......@@ -112,7 +112,7 @@ public final class PIMTest {
*/
@Test
public void testDeserializeHello() throws Exception {
byte [] data = pimHello.serialize();
byte[] data = pimHello.serialize();
PIM pim = deserializer.deserialize(data, 0, data.length);
assertTrue(pim.equals(pimHello));
}
......@@ -124,7 +124,7 @@ public final class PIMTest {
*/
@Test
public void testDeserializeJoinPrune() throws Exception {
byte [] data = pimJoinPrune.serialize();
byte[] data = pimJoinPrune.serialize();
PIM pim = deserializer.deserialize(data, 0, data.length);
assertTrue(pim.equals(pimJoinPrune));
}
......