diff --git a/build.gradle b/build.gradle index f69a78179..e02602d83 100644 --- a/build.gradle +++ b/build.gradle @@ -103,12 +103,9 @@ tasks.withType(JavaCompile).configureEach { // Uncomment the next two lines and the disable line to generate a patch. //options.errorprone.errorproneArgs = ['-XepPatchChecks:MissingOverride', // '-XepPatchLocation:' + buildscript.sourceFile.getParent()] - options.errorprone.disable('AddressSelection') - options.errorprone.disable('AlmostJavadoc') options.errorprone.disable('AnnotateFormatMethod') options.errorprone.disable('ByteBufferBackingArray') options.errorprone.disable('CatchAndPrintStackTrace') - options.errorprone.disable('ComparisonOutOfRange') options.errorprone.disable('DefaultCharset') options.errorprone.disable('DoubleCheckedLocking') options.errorprone.disable('EmptyBlockTag') @@ -123,26 +120,19 @@ tasks.withType(JavaCompile).configureEach { options.errorprone.disable('ImmutableEnumChecker') options.errorprone.disable('InconsistentCapitalization') options.errorprone.disable('InlineMeSuggester') - options.errorprone.disable('InvalidBlockTag') - options.errorprone.disable('JavaTimeDefaultTimeZone') options.errorprone.disable('JavaUtilDate') options.errorprone.disable('JdkObsolete') options.errorprone.disable('MissingCasesInEnumSwitch') - options.errorprone.disable('MissingOverride') options.errorprone.disable('MissingSummary') options.errorprone.disable('MutablePublicArray') - options.errorprone.disable('NarrowCalculation') options.errorprone.disable('NarrowingCompoundAssignment') options.errorprone.disable('NonApiType') options.errorprone.disable('OperatorPrecedence') options.errorprone.disable('ReferenceEquality') - options.errorprone.disable('ShortCircuitBoolean') options.errorprone.disable('StaticAssignmentInConstructor') - options.errorprone.disable('StringCaseLocaleUsage') options.errorprone.disable('StringSplitter') options.errorprone.disable('ThreadPriorityCheck') options.errorprone.disable('UnnecessaryLambda') - options.errorprone.disable('UnnecessaryParentheses') options.errorprone.disable('UnusedMethod') options.errorprone.disable('UnusedVariable') options.compilerArgs += ['-Werror', '--enable-preview', diff --git a/java/org/contikios/cooja/dialogs/SerialUI.java b/java/org/contikios/cooja/dialogs/SerialUI.java index 9b953425e..a83644071 100644 --- a/java/org/contikios/cooja/dialogs/SerialUI.java +++ b/java/org/contikios/cooja/dialogs/SerialUI.java @@ -284,7 +284,7 @@ protected static void appendToTextArea(JTextArea textArea, String text) { } private static String trim(String text) { - return (text != null) && (!(text = text.trim()).isEmpty()) ? text : null; + return (text != null) && !(text = text.trim()).isEmpty() ? text : null; } @Override diff --git a/java/org/contikios/cooja/mspmote/interfaces/GCRCoder.java b/java/org/contikios/cooja/mspmote/interfaces/GCRCoder.java index f0137a6e4..0954de31b 100644 --- a/java/org/contikios/cooja/mspmote/interfaces/GCRCoder.java +++ b/java/org/contikios/cooja/mspmote/interfaces/GCRCoder.java @@ -107,7 +107,7 @@ boolean gcr_valid() { if (gcr_bits >= 10) { int val = gcr_val & 0x3ff; return (GCR_decode[val >> 5] << 4) != 0xff - && (GCR_decode[val & 0x1f]) != 0xff; + && GCR_decode[val & 0x1f] != 0xff; } return true; } @@ -116,7 +116,7 @@ boolean gcr_valid() { boolean gcr_get_decoded(int[] raw_data, int current_pos) { if (gcr_bits >= 10) { int val = gcr_val & 0x3ff; - raw_data[current_pos] = ((GCR_decode[val >> 5] << 4) | (GCR_decode[val & 0x1f])); + raw_data[current_pos] = ((GCR_decode[val >> 5] << 4) | GCR_decode[val & 0x1f]); gcr_val = gcr_val >> 10; gcr_bits = gcr_bits - 10; return true; diff --git a/java/org/contikios/cooja/mspmote/plugins/MspCLI.java b/java/org/contikios/cooja/mspmote/plugins/MspCLI.java index 9cd2ee533..c60c1fee9 100644 --- a/java/org/contikios/cooja/mspmote/plugins/MspCLI.java +++ b/java/org/contikios/cooja/mspmote/plugins/MspCLI.java @@ -185,7 +185,7 @@ public void closePlugin() { } private static String trim(String text) { - return (text != null) && (!(text = text.trim()).isEmpty()) ? text : null; + return (text != null) && !(text = text.trim()).isEmpty() ? text : null; } @Override diff --git a/java/org/contikios/cooja/plugins/LogListener.java b/java/org/contikios/cooja/plugins/LogListener.java index 5565623d5..f1023e7bd 100644 --- a/java/org/contikios/cooja/plugins/LogListener.java +++ b/java/org/contikios/cooja/plugins/LogListener.java @@ -839,7 +839,7 @@ public boolean appendToFile(File file, String text) { /* Append to file */ if (!appendToFileWroteHeader) { appendStream.println("-- Log Listener [" + simulation.getTitle() + "]: Started at " + - (ZonedDateTime.now(ZoneId.systemDefault()).format(DateTimeFormatter.RFC_1123_DATE_TIME))); + ZonedDateTime.now(ZoneId.systemDefault()).format(DateTimeFormatter.RFC_1123_DATE_TIME)); appendToFileWroteHeader = true; } appendStream.print(text); diff --git a/java/org/contikios/cooja/plugins/Visualizer.java b/java/org/contikios/cooja/plugins/Visualizer.java index 045436a7d..441523bec 100644 --- a/java/org/contikios/cooja/plugins/Visualizer.java +++ b/java/org/contikios/cooja/plugins/Visualizer.java @@ -1213,13 +1213,13 @@ protected void resetViewport() { scaleX = 1; } else { - scaleX = (bigX - smallX) / (canvas.getWidth()); + scaleX = (bigX - smallX) / canvas.getWidth(); } if (smallY == bigY) { scaleY = 1; } else { - scaleY = (bigY - smallY) / (canvas.getHeight()); + scaleY = (bigY - smallY) / canvas.getHeight(); } viewportTransform.setToIdentity(); diff --git a/java/org/contikios/cooja/plugins/skins/AddressVisualizerSkin.java b/java/org/contikios/cooja/plugins/skins/AddressVisualizerSkin.java index 3ad5c7dec..bb466bc1e 100644 --- a/java/org/contikios/cooja/plugins/skins/AddressVisualizerSkin.java +++ b/java/org/contikios/cooja/plugins/skins/AddressVisualizerSkin.java @@ -93,7 +93,7 @@ public void paintBeforeMotes(Graphics g) { private static String getMoteString(Mote mote) { IPAddress ipAddr = mote.getInterfaces().getIPAddress(); - if ((ipAddr != null) && (ipAddr.hasIP())) { + if ((ipAddr != null) && ipAddr.hasIP()) { if (ipAddr.getLocalIP() == null) { return ""; } diff --git a/java/org/contikios/mrm/AreaViewer.java b/java/org/contikios/mrm/AreaViewer.java index 101680b96..6bfbbda84 100644 --- a/java/org/contikios/mrm/AreaViewer.java +++ b/java/org/contikios/mrm/AreaViewer.java @@ -614,7 +614,7 @@ private boolean analyzeBitmapForObstacles() { int foundObstacles = 0; for (int x = 0; x < obstacleArray.length; x++) { - for (int y = 0; y < (obstacleArray[0]).length; y++) { + for (int y = 0; y < obstacleArray[0].length; y++) { if (obstacleArray[x][y]) { // Register obstacle. double realWidth = (boxSize * backgroundWidth) / backgroundImage.getWidth(null); double realHeight = (boxSize * backgroundHeight) / backgroundImage.getHeight(null); @@ -904,8 +904,8 @@ public void mouseDragged(MouseEvent e) { // Pan relative to mouse movement and current zoom // This way the mouse "lock" to the canvas - currentPanX += ((e.getX() - lastHandledPosition.x)) / currentZoomX; - currentPanY += ((e.getY() - lastHandledPosition.y)) / currentZoomY; + currentPanX += (e.getX() - lastHandledPosition.x) / currentZoomX; + currentPanY += (e.getY() - lastHandledPosition.y) / currentZoomY; lastHandledPosition = e.getPoint(); canvas.repaint(); @@ -927,7 +927,7 @@ public void mouseDragged(MouseEvent e) { } // Zoom relative to mouse movement (keep XY-proportions) - currentZoomY += 0.005 * currentZoomY * ((lastHandledPosition.y - e.getY())); + currentZoomY += 0.005 * currentZoomY * (lastHandledPosition.y - e.getY()); currentZoomY = Math.max(0.05, currentZoomY); currentZoomX = currentZoomY = Math.min(1500, currentZoomY); diff --git a/java/org/contikios/mrm/MRM.java b/java/org/contikios/mrm/MRM.java index 4c69da53c..8b0ae043b 100644 --- a/java/org/contikios/mrm/MRM.java +++ b/java/org/contikios/mrm/MRM.java @@ -274,7 +274,7 @@ protected void updateSignalStrengths() { /* Reset: Background noise */ double background = - currentChannelModel.getParameterDoubleValue((Parameter.bg_noise_mean)); + currentChannelModel.getParameterDoubleValue(Parameter.bg_noise_mean); for (Radio radio : getRegisteredRadios()) { radio.setCurrentSignalStrength(background); } diff --git a/java/se/sics/mspsim/chip/Beeper.java b/java/se/sics/mspsim/chip/Beeper.java index a26e5396b..f2255852b 100644 --- a/java/se/sics/mspsim/chip/Beeper.java +++ b/java/se/sics/mspsim/chip/Beeper.java @@ -90,7 +90,7 @@ private void initSound() { for (int i = 0; i < WAVE_LEN; i++) { double f1 = Math.sin(i * 3.141592 * 2 / WAVE_LEN) * 40; f1 += Math.sin(i * 3.141592 * 4 / WAVE_LEN) * 30; - buf[i] = (byte) (f1); + buf[i] = (byte) f1; } buffer = buf; } diff --git a/java/se/sics/mspsim/chip/CC1101.java b/java/se/sics/mspsim/chip/CC1101.java index 605b3628c..f5cc579a2 100644 --- a/java/se/sics/mspsim/chip/CC1101.java +++ b/java/se/sics/mspsim/chip/CC1101.java @@ -532,7 +532,7 @@ void txNext() { if (txSendSynchByteCnt < NUM_PREAMBLE) { txSendSynchByteCnt++; if (rfListener != null) { - rfListener.receivedByte((byte) (0xaa)); + rfListener.receivedByte((byte) 0xaa); } cpu.scheduleTimeEventMillis(sendEvent, getInterByteDelayMs()); return; @@ -564,7 +564,7 @@ void txNext() { if (txSentFirstCRC) { /* send second CRC byte */ if (rfListener != null) { - rfListener.receivedByte((byte) (0xef)); + rfListener.receivedByte((byte) 0xef); } if (!txfifo.isEmpty()) { System.out.println("Warning: TXFIFO not empty after sending CRC bytes"); @@ -581,7 +581,7 @@ void txNext() { if (txFooterCountdown == 0) { /* countdown is zero, send first CRC byte */ if (rfListener != null) { - rfListener.receivedByte((byte) (0xee)); + rfListener.receivedByte((byte) 0xee); } txSentFirstCRC = true; cpu.scheduleTimeEventMillis(sendEvent, getInterByteDelayMs()); @@ -601,7 +601,7 @@ void txNext() { } if (rfListener != null) { - rfListener.receivedByte((byte) (txfifo.get(0).intValue())); + rfListener.receivedByte((byte) txfifo.get(0).intValue()); } txfifo.remove(0); cpu.scheduleTimeEventMillis(sendEvent, getInterByteDelayMs()); diff --git a/java/se/sics/mspsim/chip/CC1120.java b/java/se/sics/mspsim/chip/CC1120.java index 0de4ce603..b780769c8 100644 --- a/java/se/sics/mspsim/chip/CC1120.java +++ b/java/se/sics/mspsim/chip/CC1120.java @@ -727,7 +727,7 @@ void txNext() { if (txSendSynchByteCnt < NUM_PREAMBLE) { txSendSynchByteCnt++; if (rfListener != null) { - rfListener.receivedByte((byte) (0xaa)); + rfListener.receivedByte((byte) 0xaa); } cpu.scheduleTimeEventMillis(sendEvent, BITRATE_BYTE_DURATION); return; @@ -759,7 +759,7 @@ void txNext() { if (txSentFirstCRC) { /* send second CRC byte */ if (rfListener != null) { - rfListener.receivedByte((byte) (0xef)); + rfListener.receivedByte((byte) 0xef); } if (!txfifo.isEmpty()) { System.out.println("Warning: TXFIFO not empty after sending CRC bytes"); @@ -777,7 +777,7 @@ void txNext() { if (txFooterCountdown == 0) { /* countdown is zero, send first CRC byte */ if (rfListener != null) { - rfListener.receivedByte((byte) (0xee)); + rfListener.receivedByte((byte) 0xee); } txSentFirstCRC = true; cpu.scheduleTimeEventMillis(sendEvent, BITRATE_BYTE_DURATION); @@ -795,7 +795,7 @@ void txNext() { } if (rfListener != null) { - rfListener.receivedByte((byte) (txfifo.get(0).intValue())); + rfListener.receivedByte((byte) txfifo.get(0).intValue()); } txfifo.remove(0); cpu.scheduleTimeEventMillis(sendEvent, BITRATE_BYTE_DURATION); @@ -869,7 +869,7 @@ boolean setState(final CC1120RadioState newState) { && newState == CC1120RadioState.CC1120_STATE_RX || newState == CC1120RadioState.CC1120_STATE_TX) { changeFrequencyNextState = false; - frequency = ((0xff & nextFreq0)) + ((0xff & nextFreq1) << 8) + frequency = (0xff & nextFreq0) + ((0xff & nextFreq1) << 8) + ((0xff & nextFreq2) << 16); frequency *= 32; /* frequency oscillator */ diff --git a/java/se/sics/mspsim/chip/CC2520.java b/java/se/sics/mspsim/chip/CC2520.java index 9265f2075..6f5ec498d 100644 --- a/java/se/sics/mspsim/chip/CC2520.java +++ b/java/se/sics/mspsim/chip/CC2520.java @@ -265,7 +265,7 @@ public void setPolarity(boolean polarity) { // public static final int CCAMUX_XOSC16M_STABLE = 24; // FRMFILT0/FRMCTRL0 values - public static final int FRAME_FILTER = (1); + public static final int FRAME_FILTER = 1; public static final int AUTOCRC = (1 << 6); public static final int AUTOACK = (1 << 5); diff --git a/java/se/sics/mspsim/chip/M25P80.java b/java/se/sics/mspsim/chip/M25P80.java index 98fc15109..3a25f8728 100644 --- a/java/se/sics/mspsim/chip/M25P80.java +++ b/java/se/sics/mspsim/chip/M25P80.java @@ -193,7 +193,7 @@ public void dataReceived(USARTSource source, int data) { } else { // Do the programming!!! source.byteReceived(0); - writeBuffer((readAddress++) & 0xff, data); + writeBuffer(readAddress++ & 0xff, data); } return; } diff --git a/java/se/sics/mspsim/core/AES128.java b/java/se/sics/mspsim/core/AES128.java index 197d28ca2..a47a1c6e4 100644 --- a/java/se/sics/mspsim/core/AES128.java +++ b/java/se/sics/mspsim/core/AES128.java @@ -349,7 +349,7 @@ protected void log(final String format, final Object... arguments) { @Override public void write(int address, int value, boolean word, long cycles) { log("write @ %x <-- %x (word=%b)\n", address, value, word); - int lo = (value) & 0xff; // low byte + int lo = value & 0xff; // low byte int hi = (value >> 8) & 0xff; // high byte switch (address - offset) { diff --git a/java/se/sics/mspsim/core/CRC16.java b/java/se/sics/mspsim/core/CRC16.java index 9d78dbdc4..81fe6507c 100644 --- a/java/se/sics/mspsim/core/CRC16.java +++ b/java/se/sics/mspsim/core/CRC16.java @@ -211,7 +211,7 @@ public void write(int address, int value, boolean word, long cycles) { case CRC16.CRCDI: if (word) { int hi = (value >> 8) & 0x00ff; - int lo = (value) & 0x00ff; + int lo = value & 0x00ff; crc.processRb((byte) lo); crc.processRb((byte) hi); } else { @@ -221,7 +221,7 @@ public void write(int address, int value, boolean word, long cycles) { case CRC16.CRCDIRB: if (word) { int hi = (value >> 8) & 0x00ff; - int lo = (value) & 0x00ff; + int lo = value & 0x00ff; crc.process((byte) hi); crc.process((byte) lo); } else { diff --git a/java/se/sics/mspsim/core/IOPort.java b/java/se/sics/mspsim/core/IOPort.java index 19d9cfd13..455b6ffab 100644 --- a/java/se/sics/mspsim/core/IOPort.java +++ b/java/se/sics/mspsim/core/IOPort.java @@ -256,7 +256,7 @@ private void writePort(PortReg function, int data, long cycles) { out = data; PortListener listener = portListener; if (listener != null) { - listener.portWrite(this, out | (~dir) & 0xff); + listener.portWrite(this, out | ~dir & 0xff); } break; } @@ -269,7 +269,7 @@ private void writePort(PortReg function, int data, long cycles) { PortListener listener = portListener; if (listener != null) { // Any output configured pin (pin-bit = 0) should have 1 here?! - listener.portWrite(this, out | (~dir) & 0xff); + listener.portWrite(this, out | ~dir & 0xff); } break; } @@ -404,7 +404,7 @@ public void setPinState(int pin, PinState state) { @Override public void reset(int type) { - int oldValue = out | (~dir) & 0xff; + int oldValue = out | ~dir & 0xff; Arrays.fill(pinState, PinState.LOW); in = 0; @@ -416,7 +416,7 @@ public void reset(int type) { cpu.flagInterrupt(interrupt, this, (ifg & ie) > 0); PortListener listener = portListener; - int newValue = out | (~dir) & 0xff; + int newValue = out | ~dir & 0xff; if (oldValue != newValue && listener != null) { listener.portWrite(this, newValue); } diff --git a/java/se/sics/mspsim/core/MSP430Core.java b/java/se/sics/mspsim/core/MSP430Core.java index be2501ca5..714fcaab9 100644 --- a/java/se/sics/mspsim/core/MSP430Core.java +++ b/java/se/sics/mspsim/core/MSP430Core.java @@ -1261,7 +1261,7 @@ public int emulateOP(long maxCycles) throws EmulationException { nxtCarry = (dst & (1 << (count + 1))) > 0? CARRY: 0; /* Rotate dst. */ - dst = dst >> (count); + dst = dst >> count; /* Rotate the high bits, insert into dst. */ if (rrword) { @@ -2013,7 +2013,7 @@ public int emulateOP(long maxCycles) throws EmulationException { break; case BIC: // BIC // No status reg change - dst = (~src) & dst; + dst = ~src & dst; write = true; updateStatus = false; diff --git a/java/se/sics/mspsim/core/RF1A.java b/java/se/sics/mspsim/core/RF1A.java index 9a664b369..328053d93 100644 --- a/java/se/sics/mspsim/core/RF1A.java +++ b/java/se/sics/mspsim/core/RF1A.java @@ -143,13 +143,13 @@ public void write(int address, int value, boolean word, long cycles) { ioRead = false; ioWrite = false; expectingDummyWrite = true; - cc1101.strobe(value & (~CC1101.SPI_READ_BIT) & (~CC1101.SPI_BURST_BIT)); + cc1101.strobe(value & ~CC1101.SPI_READ_BIT & ~CC1101.SPI_BURST_BIT); } else { /* Store address */ ioRead = CC1101.spiIsRead(value); ioWrite = !ioRead; cc1101.setLastInstructionWasRead(ioRead); - ioAddress = value & (~CC1101.SPI_READ_BIT) & (~CC1101.SPI_BURST_BIT); + ioAddress = value & ~CC1101.SPI_READ_BIT & ~CC1101.SPI_BURST_BIT; if (DEBUG) { if (ioAddress == CC1101.CC1101_RXFIFO) { } else if (ioAddress == CC1101.CC1101_MARCSTATE) { diff --git a/java/se/sics/mspsim/core/RTC.java b/java/se/sics/mspsim/core/RTC.java index bcc7e4571..e0cfdd00f 100644 --- a/java/se/sics/mspsim/core/RTC.java +++ b/java/se/sics/mspsim/core/RTC.java @@ -302,7 +302,7 @@ private void updateCounters() { } else { rtcCount += 1; - long overflow = ((1L << ((rtcEvent + 1) * 8))); + long overflow = (1L << ((rtcEvent + 1) * 8)); overflow -= 1; if ((rtcCount & overflow) == 0) { generateInterrupt(); @@ -486,7 +486,7 @@ public void write(int address, int value, boolean word, long cycles) { logw(WarningType.MISALIGNED_WRITE, "byte access not implemented"); } - int lo = (value) & 0xff; // low byte + int lo = value & 0xff; // low byte int hi = (value >> 8) & 0xff; // high byte switch (address - offset) { diff --git a/java/se/sics/mspsim/core/Timer.java b/java/se/sics/mspsim/core/Timer.java index 6ef9577db..c5a1106af 100644 --- a/java/se/sics/mspsim/core/Timer.java +++ b/java/se/sics/mspsim/core/Timer.java @@ -813,7 +813,7 @@ void resetCounter(long cycles) { // counterAcc - represent the value of the counter at the last reset. long cycctr = cycles - counterStart; double tick = cycctr / divider; - counterPassed = (int) (divider * (tick - (long) (tick))); + counterPassed = (int) (divider * (tick - (long) tick)); counterStart = cycles - counterPassed; // set counterACC to the last returned value (which is the same @@ -851,7 +851,7 @@ private int updateCounter(long cycles) { // counterAcc - represent the value of the counter at the last reset. long cycctr = cycles - counterStart; double tick = cycctr / divider; - counterPassed = (int) (divider * (tick - (long) (tick))); + counterPassed = (int) (divider * (tick - (long) tick)); long bigCounter = (long) (tick + counterAcc); switch (mode) { diff --git a/java/se/sics/mspsim/core/UnifiedClockSystem.java b/java/se/sics/mspsim/core/UnifiedClockSystem.java index 98b98fcbc..65689b657 100644 --- a/java/se/sics/mspsim/core/UnifiedClockSystem.java +++ b/java/se/sics/mspsim/core/UnifiedClockSystem.java @@ -368,7 +368,7 @@ private void setConfiguration(long cycles) { int dcoTap = ((read(UCSCTL0, true, cycles) >> DCO_BITPOS) & ((1 << DCO_BITWIDTH) - 1)); // Read modulation disable bit (currently unused) - int disableModulation = ((read(UCSCTL1, true, cycles) & DISMOD)); + int disableModulation = read(UCSCTL1, true, cycles) & DISMOD; // Read DCO range selection from UCSCTL1 register int dcoRange = ((read(UCSCTL1, true, cycles) >> DCORSEL_BITPOS) & ((1 << DCORSEL_BITWIDTH) - 1)); diff --git a/java/se/sics/mspsim/extutil/highlight/LineNumberedBorder.java b/java/se/sics/mspsim/extutil/highlight/LineNumberedBorder.java index 6868c098e..09e4ef9f9 100644 --- a/java/se/sics/mspsim/extutil/highlight/LineNumberedBorder.java +++ b/java/se/sics/mspsim/extutil/highlight/LineNumberedBorder.java @@ -217,7 +217,7 @@ public void paintBorder(Component c, Graphics g, int x, int y, int width, // loop until out of the "visible" region... // int length = - (String.valueOf(Math.max(jta.getRows(), jta.getLineCount() + 1))).length(); + String.valueOf(Math.max(jta.getRows(), jta.getLineCount() + 1)).length(); while (ybaseline < yend) { // // options: diff --git a/java/se/sics/mspsim/platform/ti/Exp1101Node.java b/java/se/sics/mspsim/platform/ti/Exp1101Node.java index 2591480ed..8bf3c19f2 100644 --- a/java/se/sics/mspsim/platform/ti/Exp1101Node.java +++ b/java/se/sics/mspsim/platform/ti/Exp1101Node.java @@ -18,7 +18,7 @@ public class Exp1101Node extends GenericNode implements PortListener, USARTListe public static final int CC1101_GDO0 = 7; /* 1.7 */ public static final int CC1101_GDO2 = 3; /* 1.3 */ - public static final int CC1101_CHIP_SELECT = (1); // 3.0 + public static final int CC1101_CHIP_SELECT = 1; // 3.0 private final IOPort port1; private final IOPort port3; @@ -27,7 +27,7 @@ public class Exp1101Node extends GenericNode implements PortListener, USARTListe private final IOPort port7; private final IOPort port8; - public static final int LEDS_CONF_RED = (1); // 1.0 + public static final int LEDS_CONF_RED = 1; // 1.0 public static final int LEDS_CONF_YELLOW = (1 << 1); // 1.1 private final CC1101 radio; diff --git a/java/se/sics/mspsim/platform/ti/Exp1120Node.java b/java/se/sics/mspsim/platform/ti/Exp1120Node.java index 50c4094ee..bf971459e 100644 --- a/java/se/sics/mspsim/platform/ti/Exp1120Node.java +++ b/java/se/sics/mspsim/platform/ti/Exp1120Node.java @@ -17,7 +17,7 @@ public class Exp1120Node extends GenericNode implements PortListener, USARTListe public static final int CC1120_GDO0 = 7; /* 1.7 */ public static final int CC1120_GDO2 = 3; /* 1.3 */ - public static final int CC1120_CHIP_SELECT = (1); // 3.0 + public static final int CC1120_CHIP_SELECT = 1; // 3.0 private final IOPort port1; private final IOPort port3; @@ -26,7 +26,7 @@ public class Exp1120Node extends GenericNode implements PortListener, USARTListe private final IOPort port7; private final IOPort port8; - public static final int LEDS_CONF_RED = (1); // 1.0 + public static final int LEDS_CONF_RED = 1; // 1.0 public static final int LEDS_CONF_YELLOW = (1 << 1); // 1.1 private final CC1120 radio; diff --git a/java/se/sics/mspsim/platform/ti/Exp5438Node.java b/java/se/sics/mspsim/platform/ti/Exp5438Node.java index cef5003e2..209aa0505 100644 --- a/java/se/sics/mspsim/platform/ti/Exp5438Node.java +++ b/java/se/sics/mspsim/platform/ti/Exp5438Node.java @@ -22,7 +22,7 @@ public class Exp5438Node extends GenericNode implements PortListener, USARTListe /* Output: VREG_EN to CC2420 */ public static final int CC2420_VREG = (1 << 4); // 1.4 /* Output: SPI Chip Select (CS_N) */ - public static final int CC2420_CHIP_SELECT = (1); // 3.0 + public static final int CC2420_CHIP_SELECT = 1; // 3.0 public static final int CC2420_RESET = (1 << 2); // 1.2 private final IOPort port1; @@ -32,7 +32,7 @@ public class Exp5438Node extends GenericNode implements PortListener, USARTListe private final IOPort port7; private final IOPort port8; - public static final int LEDS_CONF_RED = (1); // 1.0 + public static final int LEDS_CONF_RED = 1; // 1.0 public static final int LEDS_CONF_YELLOW = (1 << 1); // 1.1 private final CC2420 radio; diff --git a/java/se/sics/mspsim/platform/ti/Trxeb1120Node.java b/java/se/sics/mspsim/platform/ti/Trxeb1120Node.java index 6736d487c..1e9b5deb4 100644 --- a/java/se/sics/mspsim/platform/ti/Trxeb1120Node.java +++ b/java/se/sics/mspsim/platform/ti/Trxeb1120Node.java @@ -16,7 +16,7 @@ public class Trxeb1120Node extends GenericNode implements PortListener, USARTLis public static final int CC1120_GDO0 = 7; /* 1.7 */ public static final int CC1120_GDO2 = 3; /* 1.3 */ - public static final int CC1120_CHIP_SELECT = (1); // 3.0 + public static final int CC1120_CHIP_SELECT = 1; // 3.0 public static final int ENC28J60_CLK = 2; /* 10.2 */ public static final int ENC28J60_MOSI = 1; /* 10.1 */ diff --git a/java/se/sics/mspsim/platform/ti/Trxeb2520Node.java b/java/se/sics/mspsim/platform/ti/Trxeb2520Node.java index ec1de9051..7d924d5aa 100644 --- a/java/se/sics/mspsim/platform/ti/Trxeb2520Node.java +++ b/java/se/sics/mspsim/platform/ti/Trxeb2520Node.java @@ -23,8 +23,8 @@ public class Trxeb2520Node extends GenericNode implements PortListener, USARTLis /* Output: VREG_EN to CC2520 */ public static final int CC2520_VREG = (1 << 7); /* 1.7 */ /* Output: SPI Chip Select (CS_N) */ - public static final int CC2520_CHIP_SELECT = (1); /* 3.0 */ - public static final int CC2520_RESET = (1); /* 8.0 */ + public static final int CC2520_CHIP_SELECT = 1; /* 3.0 */ + public static final int CC2520_RESET = 1; /* 8.0 */ private final IOPort port1; private final IOPort port3; diff --git a/java/se/sics/mspsim/ui/ChartPanel.java b/java/se/sics/mspsim/ui/ChartPanel.java index ae632651e..8232462d7 100644 --- a/java/se/sics/mspsim/ui/ChartPanel.java +++ b/java/se/sics/mspsim/ui/ChartPanel.java @@ -298,7 +298,7 @@ public static void main(String[] args) { int[] data = new int[40]; for (int i = 0, n = data.length; i < n; i++) { - data[i] = (int) ((Math.random() * 300)); + data[i] = (int) (Math.random() * 300); } bc.setConfig("color", new Color(0xffb0b0b0)); bc.setData(data);