Skip to content

Commit 092ecab

Browse files
committed
update Java version
1 parent d9e383c commit 092ecab

File tree

5 files changed

+50
-20
lines changed

5 files changed

+50
-20
lines changed

src/main/java/com/upokecenter/cbor/CBORJson.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ private static int SkipWhitespaceJSON(CharacterInputWithCount reader) {
3030
private String NextJSONString() {
3131
int c;
3232
this.sb = (this.sb == null) ? (new StringBuilder()) : this.sb;
33-
this.sb.delete(0, (0)+(this.sb.length()));
33+
this.sb.delete(0, this.sb.length());
3434
while (true) {
3535
c = this.reader.ReadChar();
3636
if (c == -1 || c < 0x20) {
@@ -498,7 +498,7 @@ static void WriteJSONStringUnquoted(
498498
first = false;
499499
sb.WriteString(str, 0, i);
500500
}
501-
// Replace unpaired surrogate with U + FFFD
501+
// Replace unpaired surrogate with U+FFFD
502502
c = (char)0xfffd;
503503
} else {
504504
throw new CBORException("Unpaired surrogate in String");

src/main/java/com/upokecenter/util/DataUtilities.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@ public static byte[] GetUtf8Bytes(
216216
}
217217
}
218218
try {
219-
java.io.ByteArrayOutputStream ms = null;
219+
{
220+
java.io.ByteArrayOutputStream ms = null;
220221
try {
221222
ms = new java.io.ByteArrayOutputStream();
222223

@@ -230,6 +231,7 @@ public static byte[] GetUtf8Bytes(
230231
try { if (ms != null) {
231232
ms.close();
232233
} } catch (java.io.IOException ex) {}
234+
}
233235
}
234236
} catch (IOException ex) {
235237
throw new IllegalArgumentException("I/O error occurred", ex);

src/test/java/com/upokecenter/test/BEncodingTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ private static CBORObject EncodingFromBytes(byte[] b) {
3030

3131
private static byte[] EncodingToBytes(CBORObject b) {
3232
try {
33-
java.io.ByteArrayOutputStream ms = null;
33+
{
34+
java.io.ByteArrayOutputStream ms = null;
3435
try {
3536
ms = new java.io.ByteArrayOutputStream();
3637

@@ -41,6 +42,7 @@ private static byte[] EncodingToBytes(CBORObject b) {
4142
try { if (ms != null) {
4243
ms.close();
4344
} } catch (java.io.IOException ex) {}
45+
}
4446
}
4547
} catch (IOException ex) {
4648
throw new CBORException("", ex);

src/test/java/com/upokecenter/test/CBORSupplementTest.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,8 @@ public void TestCyclicRefs() {
366366
cbor.Add(cbor);
367367
cbor.get(0).Add(cbor);
368368
try {
369-
java.io.ByteArrayOutputStream memoryStream = null;
369+
{
370+
java.io.ByteArrayOutputStream memoryStream = null;
370371
try {
371372
memoryStream = new java.io.ByteArrayOutputStream();
372373

@@ -376,6 +377,7 @@ public void TestCyclicRefs() {
376377
try { if (memoryStream != null) {
377378
memoryStream.close();
378379
} } catch (java.io.IOException ex) {}
380+
}
379381
}
380382
Assert.fail("Should have failed");
381383
} catch (IllegalArgumentException ex) {
@@ -390,7 +392,8 @@ public void TestCyclicRefs() {
390392
public void TestNestingDepth() {
391393
try {
392394
{
393-
java.io.ByteArrayOutputStream ms = null;
395+
{
396+
java.io.ByteArrayOutputStream ms = null;
394397
try {
395398
ms = new java.io.ByteArrayOutputStream();
396399

@@ -418,10 +421,12 @@ public void TestNestingDepth() {
418421
try { if (ms != null) {
419422
ms.close();
420423
} } catch (java.io.IOException ex) {}
424+
}
421425
}
422426
}
423427
{
424-
java.io.ByteArrayOutputStream ms = null;
428+
{
429+
java.io.ByteArrayOutputStream ms = null;
425430
try {
426431
ms = new java.io.ByteArrayOutputStream();
427432

@@ -445,6 +450,7 @@ public void TestNestingDepth() {
445450
try { if (ms != null) {
446451
ms.close();
447452
} } catch (java.io.IOException ex) {}
453+
}
448454
}
449455
}
450456
} catch (Exception ex) {

src/test/java/com/upokecenter/test/DataUtilitiesTest.java

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ public static void DoTestReadUtf8(
774774
Assert.assertEquals(expectedString, builder.toString());
775775
}
776776
ms.reset();
777-
builder.delete(0, (0)+(builder.length()));
777+
builder.delete(0, builder.length());
778778
ret = DataUtilities.ReadUtf8(ms, length, builder, false);
779779
Assert.assertEquals(noReplaceRet, ret);
780780
if (noReplaceRet == 0) {
@@ -791,7 +791,7 @@ public static void DoTestReadUtf8(
791791
throw new NullPointerException("bytes");
792792
}
793793
if (bytes.length >= length) {
794-
builder.delete(0, (0)+(builder.length()));
794+
builder.delete(0, builder.length());
795795
ret = DataUtilities.ReadUtf8FromBytes(
796796
bytes,
797797
0,
@@ -802,7 +802,7 @@ public static void DoTestReadUtf8(
802802
if (expectedRet == 0) {
803803
Assert.assertEquals(expectedString, builder.toString());
804804
}
805-
builder.delete(0, (0)+(builder.length()));
805+
builder.delete(0, builder.length());
806806
ret = DataUtilities.ReadUtf8FromBytes(
807807
bytes,
808808
0,
@@ -1273,7 +1273,8 @@ public void TestWriteUtf8() {
12731273
throw new IllegalStateException("", ex);
12741274
}
12751275
{
1276-
java.io.ByteArrayOutputStream ms = null;
1276+
{
1277+
java.io.ByteArrayOutputStream ms = null;
12771278
try {
12781279
ms = new java.io.ByteArrayOutputStream();
12791280

@@ -1435,11 +1436,13 @@ public void TestWriteUtf8() {
14351436
try { if (ms != null) {
14361437
ms.close();
14371438
} } catch (java.io.IOException ex) {}
1439+
}
14381440
}
14391441
}
14401442
{
14411443
{
1442-
java.io.ByteArrayOutputStream ms = null;
1444+
{
1445+
java.io.ByteArrayOutputStream ms = null;
14431446
try {
14441447
ms = new java.io.ByteArrayOutputStream();
14451448

@@ -1452,10 +1455,12 @@ public void TestWriteUtf8() {
14521455
try { if (ms != null) {
14531456
ms.close();
14541457
} } catch (java.io.IOException ex) {}
1458+
}
14551459
}
14561460
}
14571461
{
1458-
java.io.ByteArrayOutputStream ms = null;
1462+
{
1463+
java.io.ByteArrayOutputStream ms = null;
14591464
try {
14601465
ms = new java.io.ByteArrayOutputStream();
14611466

@@ -1468,10 +1473,12 @@ public void TestWriteUtf8() {
14681473
try { if (ms != null) {
14691474
ms.close();
14701475
} } catch (java.io.IOException ex) {}
1476+
}
14711477
}
14721478
}
14731479
{
1474-
java.io.ByteArrayOutputStream ms = null;
1480+
{
1481+
java.io.ByteArrayOutputStream ms = null;
14751482
try {
14761483
ms = new java.io.ByteArrayOutputStream();
14771484

@@ -1484,10 +1491,12 @@ public void TestWriteUtf8() {
14841491
try { if (ms != null) {
14851492
ms.close();
14861493
} } catch (java.io.IOException ex) {}
1494+
}
14871495
}
14881496
}
14891497
{
1490-
java.io.ByteArrayOutputStream ms = null;
1498+
{
1499+
java.io.ByteArrayOutputStream ms = null;
14911500
try {
14921501
ms = new java.io.ByteArrayOutputStream();
14931502

@@ -1500,10 +1509,12 @@ public void TestWriteUtf8() {
15001509
try { if (ms != null) {
15011510
ms.close();
15021511
} } catch (java.io.IOException ex) {}
1512+
}
15031513
}
15041514
}
15051515
{
1506-
java.io.ByteArrayOutputStream ms = null;
1516+
{
1517+
java.io.ByteArrayOutputStream ms = null;
15071518
try {
15081519
ms = new java.io.ByteArrayOutputStream();
15091520

@@ -1516,10 +1527,12 @@ public void TestWriteUtf8() {
15161527
try { if (ms != null) {
15171528
ms.close();
15181529
} } catch (java.io.IOException ex) {}
1530+
}
15191531
}
15201532
}
15211533
{
1522-
java.io.ByteArrayOutputStream ms = null;
1534+
{
1535+
java.io.ByteArrayOutputStream ms = null;
15231536
try {
15241537
ms = new java.io.ByteArrayOutputStream();
15251538

@@ -1532,10 +1545,12 @@ public void TestWriteUtf8() {
15321545
try { if (ms != null) {
15331546
ms.close();
15341547
} } catch (java.io.IOException ex) {}
1548+
}
15351549
}
15361550
}
15371551
{
1538-
java.io.ByteArrayOutputStream ms = null;
1552+
{
1553+
java.io.ByteArrayOutputStream ms = null;
15391554
try {
15401555
ms = new java.io.ByteArrayOutputStream();
15411556

@@ -1548,10 +1563,12 @@ public void TestWriteUtf8() {
15481563
try { if (ms != null) {
15491564
ms.close();
15501565
} } catch (java.io.IOException ex) {}
1566+
}
15511567
}
15521568
}
15531569
{
1554-
java.io.ByteArrayOutputStream ms = null;
1570+
{
1571+
java.io.ByteArrayOutputStream ms = null;
15551572
try {
15561573
ms = new java.io.ByteArrayOutputStream();
15571574

@@ -1564,10 +1581,12 @@ public void TestWriteUtf8() {
15641581
try { if (ms != null) {
15651582
ms.close();
15661583
} } catch (java.io.IOException ex) {}
1584+
}
15671585
}
15681586
}
15691587
{
1570-
java.io.ByteArrayOutputStream ms = null;
1588+
{
1589+
java.io.ByteArrayOutputStream ms = null;
15711590
try {
15721591
ms = new java.io.ByteArrayOutputStream();
15731592

@@ -1580,6 +1599,7 @@ public void TestWriteUtf8() {
15801599
try { if (ms != null) {
15811600
ms.close();
15821601
} } catch (java.io.IOException ex) {}
1602+
}
15831603
}
15841604
}
15851605
}

0 commit comments

Comments
 (0)