Skip to content

Commit b8d3ea4

Browse files
committed
what a horrible failure... Era couldn't be highter than 5. Solved.
1 parent c443e80 commit b8d3ea4

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/net/sharksystem/asap/protocol/PDU_Impl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,8 @@ static void checkValidFormat(CharSequence format) throws ASAPException {
299299

300300
static void checkValidEra(int era) throws ASAPException {
301301
if(era < -1) throw new ASAPException("era cannot be smaller than -1");
302-
int maxEra = 2^8-1;
303-
if(era > maxEra) throw new ASAPException("era exceeded max limit of 2^8-1");
302+
int maxEra = Integer.MAX_VALUE;
303+
if(era > maxEra) throw new ASAPException("era exceeded max limit of " + Integer.MAX_VALUE);
304304
}
305305

306306
}

test/net/sharksystem/asap/WhiteBoxTests.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ public class WhiteBoxTests {
1717
public WhiteBoxTests() {
1818
}
1919

20+
@Test
21+
public void scratch() {
22+
int maxEra = 2^8-1;
23+
int i = 42;
24+
}
25+
2026
@Test
2127
public void writeReadByteMessages() throws IOException, ASAPException {
2228
String folder = "tests/writeReadByteMessagesTest";

0 commit comments

Comments
 (0)