Skip to content

Commit 2fc3004

Browse files
committed
edit style
1 parent 747ab34 commit 2fc3004

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+246
-246
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
import com.upokecenter.util.*;
1111

12-
class CBORBigInteger implements ICBORNumber {
13-
12+
class CBORBigInteger implements ICBORNumber
13+
{
1414
public boolean IsPositiveInfinity(Object obj) {
1515
return false;
1616
}
@@ -113,7 +113,7 @@ public int AsInt32(Object obj, int minValue, int maxValue) {
113113

114114
public Object Negate(Object obj) {
115115
BigInteger bigobj = (BigInteger)obj;
116-
bigobj = (bigobj).negate();
116+
bigobj=(bigobj).negate();
117117
return bigobj;
118118
}
119119

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ public static CBORObject ParseJSONNumber(
235235
} else {
236236
BigInteger bigmant2 = mant.AsBigInteger();
237237
if (negative) {
238-
bigmant2 = (bigmant2).negate();
238+
bigmant2=(bigmant2).negate();
239239
}
240240
return CBORObject.FromObject(bigmant2);
241241
}
@@ -245,7 +245,7 @@ public static CBORObject ParseJSONNumber(
245245
BigInteger bigexp = (newScale == null) ? (BigInteger.valueOf(newScaleInt)) :
246246
newScale.AsBigInteger();
247247
if (negative) {
248-
bigmant = (bigmant).negate();
248+
bigmant=(bigmant).negate();
249249
}
250250
return CBORObject.FromObject(ExtendedDecimal.Create(
251251
bigmant,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
import com.upokecenter.util.*;
1111

12-
class CBORDouble implements ICBORNumber {
13-
12+
class CBORDouble implements ICBORNumber
13+
{
1414
public boolean IsPositiveInfinity(Object obj) {
1515
return ((((Double)obj).doubleValue()) == Double.POSITIVE_INFINITY);
1616
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
import com.upokecenter.util.*;
1111

12-
class CBORExtendedDecimal implements ICBORNumber {
13-
12+
class CBORExtendedDecimal implements ICBORNumber
13+
{
1414
public boolean IsPositiveInfinity(Object obj) {
1515
ExtendedDecimal ed = (ExtendedDecimal)obj;
1616
return ed.IsPositiveInfinity();

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
import com.upokecenter.util.*;
1111

12-
class CBORExtendedFloat implements ICBORNumber {
13-
12+
class CBORExtendedFloat implements ICBORNumber
13+
{
1414
public boolean IsPositiveInfinity(Object obj) {
1515
ExtendedFloat ef = (ExtendedFloat)obj;
1616
return ef.IsPositiveInfinity();

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
import com.upokecenter.util.*;
1111

12-
class CBORExtendedRational implements ICBORNumber {
13-
12+
class CBORExtendedRational implements ICBORNumber
13+
{
1414
public boolean IsPositiveInfinity(Object obj) {
1515
return ((ExtendedRational)obj).IsPositiveInfinity();
1616
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
import com.upokecenter.util.*;
1111

12-
class CBORInteger implements ICBORNumber {
13-
12+
class CBORInteger implements ICBORNumber
13+
{
1414
public boolean IsPositiveInfinity(Object obj) {
1515
return false;
1616
}

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

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -334,35 +334,35 @@ public final CBORType getType() {
334334
* @return True if this value is a CBOR true value; otherwise, false.
335335
*/
336336
public final boolean isTrue() {
337-
return this.getItemType() == CBORObjectTypeSimpleValue && ((Integer)this.getThisItem()).intValue() ==
338-
21;
337+
return this.getItemType() == CBORObjectTypeSimpleValue && ((Integer)this.getThisItem()).intValue()
338+
== 21;
339339
}
340340

341341
/**
342342
* Gets a value indicating whether this value is a CBOR false value.
343343
* @return True if this value is a CBOR false value; otherwise, false.
344344
*/
345345
public final boolean isFalse() {
346-
return this.getItemType() == CBORObjectTypeSimpleValue && ((Integer)this.getThisItem()).intValue() ==
347-
20;
346+
return this.getItemType() == CBORObjectTypeSimpleValue && ((Integer)this.getThisItem()).intValue()
347+
== 20;
348348
}
349349

350350
/**
351351
* Gets a value indicating whether this value is a CBOR null value.
352352
* @return True if this value is a CBOR null value; otherwise, false.
353353
*/
354354
public final boolean isNull() {
355-
return this.getItemType() == CBORObjectTypeSimpleValue && ((Integer)this.getThisItem()).intValue() ==
356-
22;
355+
return this.getItemType() == CBORObjectTypeSimpleValue && ((Integer)this.getThisItem()).intValue()
356+
== 22;
357357
}
358358

359359
/**
360360
* Gets a value indicating whether this value is a CBOR undefined value.
361361
* @return True if this value is a CBOR undefined value; otherwise, false.
362362
*/
363363
public final boolean isUndefined() {
364-
return this.getItemType() == CBORObjectTypeSimpleValue && ((Integer)this.getThisItem()).intValue() ==
365-
23;
364+
return this.getItemType() == CBORObjectTypeSimpleValue && ((Integer)this.getThisItem()).intValue()
365+
== 23;
366366
}
367367

368368
/**
@@ -939,7 +939,7 @@ private static boolean CBORMapEquals(
939939
CBORObject valueB = null;
940940
boolean hasKey;
941941
valueB = mapB.get(kvp.getKey());
942-
hasKey = (valueB == null) ? mapB.containsKey(kvp.getKey()) : true;
942+
hasKey=(valueB == null) ? mapB.containsKey(kvp.getKey()) : true;
943943
if (hasKey) {
944944
CBORObject valueA = kvp.getValue();
945945
if (!(valueA == null ? valueB == null : valueA.equals(valueB))) {
@@ -1320,11 +1320,11 @@ public static CBORObject DecodeFromBytes(byte[] data) {
13201320
int startingAvailable = ms.available();
13211321

13221322
CBORObject o = Read(ms);
1323-
CheckCBORLength((long)data.length, (long)(startingAvailable - ms.available()));
1323+
CheckCBORLength((long)data.length, (long)(startingAvailable-ms.available()));
13241324
return o;
13251325
}
13261326
finally {
1327-
try { if (ms != null)ms.close(); } catch (java.io.IOException ex) { }
1327+
try { if (ms != null)ms.close(); } catch (java.io.IOException ex) {}
13281328
}
13291329
}
13301330

@@ -2575,7 +2575,7 @@ public static void Write(BigInteger bigint, OutputStream stream) throws java.io.
25752575
if (bigint.signum() < 0) {
25762576
datatype = 1;
25772577
bigint = bigint.add(BigInteger.ONE);
2578-
bigint = (bigint).negate();
2578+
bigint=(bigint).negate();
25792579
}
25802580
if (bigint.compareTo(Int64MaxValue) <= 0) {
25812581
// If the big integer is representable as a long and in
@@ -3018,7 +3018,7 @@ public byte[] EncodeToBytes() {
30183018
return ms.toByteArray();
30193019
}
30203020
finally {
3021-
try { if (ms != null)ms.close(); } catch (java.io.IOException ex) { }
3021+
try { if (ms != null)ms.close(); } catch (java.io.IOException ex) {}
30223022
}
30233023
} catch (IOException ex) {
30243024
throw new CBORException("I/O Error occurred", ex);
@@ -3917,8 +3917,8 @@ private void AppendOpeningTags(StringBuilder sb) {
39173917
}
39183918

39193919
static String TrimDotZero(String str) {
3920-
return (str.length() > 2 && str.charAt(str.length() - 1) == '0' && str.charAt(str.length() -
3921-
2) == '.') ? str.substring(0,str.length() - 2) :
3920+
return (str.length() > 2 && str.charAt(str.length() - 1) == '0' && str.charAt(str.length()
3921+
- 2) == '.') ? str.substring(0,str.length() - 2) :
39223922
str;
39233923
}
39243924

@@ -3990,17 +3990,17 @@ private static String ExtendedToString(ExtendedFloat ef) {
39903990
}
39913991
} else if (type == CBORObjectTypeSingle) {
39923992
float f = ((Float)this.getThisItem()).floatValue();
3993-
simvalue = ((f) == Float.NEGATIVE_INFINITY) ? "-Infinity" :
3994-
(((f) == Float.POSITIVE_INFINITY) ? "Infinity" : (Float.isNaN(f) ?
3993+
simvalue = ((f)==Float.NEGATIVE_INFINITY) ? "-Infinity" :
3994+
(((f)==Float.POSITIVE_INFINITY) ? "Infinity" : (Float.isNaN(f) ?
39953995
"NaN" : TrimDotZero(Float.toString((float)f))));
39963996
if (sb == null) {
39973997
return simvalue;
39983998
}
39993999
sb.append(simvalue);
40004000
} else if (type == CBORObjectTypeDouble) {
40014001
double f = ((Double)this.getThisItem()).doubleValue();
4002-
simvalue = ((f) == Double.NEGATIVE_INFINITY) ? "-Infinity" :
4003-
(((f) == Double.POSITIVE_INFINITY) ? "Infinity" : (Double.isNaN(f) ?
4002+
simvalue = ((f)==Double.NEGATIVE_INFINITY) ? "-Infinity" :
4003+
(((f)==Double.POSITIVE_INFINITY) ? "Infinity" : (Double.isNaN(f) ?
40044004
"NaN" : TrimDotZero(Double.toString((double)f))));
40054005
if (sb == null) {
40064006
return simvalue;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ public static CBORObject Divide(CBORObject a, CBORObject b) {
316316
BigInteger bigrem;
317317
BigInteger bigquo;
318318
{
319-
BigInteger[] divrem = (b1).divideAndRemainder(b2);
319+
BigInteger[] divrem=(b1).divideAndRemainder(b2);
320320
bigquo = divrem[0];
321321
bigrem = divrem[1]; }
322322
return bigrem.signum() == 0 ? CBORObject.FromObject(bigquo) :

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ private static byte[] ReadByteData(
146146
return ms.toByteArray();
147147
}
148148
finally {
149-
try { if (ms != null)ms.close(); } catch (java.io.IOException ex) { }
149+
try { if (ms != null)ms.close(); } catch (java.io.IOException ex) {}
150150
}
151151
}
152152
}
@@ -207,8 +207,8 @@ public CBORObject ReadForFirstByte(
207207
// will assume it exists for some head bytes
208208
data[0] = ((byte)firstbyte);
209209
if (expectedLength > 1 &&
210-
this.stream.read(data, 1, expectedLength - 1) != expectedLength -
211-
1) {
210+
this.stream.read(data, 1, expectedLength - 1) != expectedLength
211+
- 1) {
212212
throw new CBORException("Premature end of data");
213213
}
214214
CBORObject cbor = CBORObject.GetFixedLengthObject(firstbyte, data);
@@ -321,7 +321,7 @@ public CBORObject ReadForFirstByte(
321321
data);
322322
}
323323
finally {
324-
try { if (ms != null)ms.close(); } catch (java.io.IOException ex) { }
324+
try { if (ms != null)ms.close(); } catch (java.io.IOException ex) {}
325325
}
326326
} else {
327327
if (hasBigAdditional) {

0 commit comments

Comments
 (0)