Skip to content

Commit d134086

Browse files
committed
refactor: tabs -> spaces
1 parent f18c562 commit d134086

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

src/main/java/org/eclipse/yasson/internal/deserializer/types/UriDeserializer.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ class UriDeserializer extends TypeDeserializer {
3232
@Override
3333
Object deserializeStringValue(String value, DeserializationContextImpl context, Type rType) {
3434
try {
35-
return new URI(value);
36-
} catch (URISyntaxException e) {
37-
// Exception will be caught and wrapped
38-
throw new JsonbException("java.net.URI could not parse value " + value, e);
39-
}
35+
return new URI(value);
36+
} catch (URISyntaxException e) {
37+
// Exception will be caught and wrapped
38+
throw new JsonbException("java.net.URI could not parse value " + value, e);
39+
}
4040
}
4141
}

src/main/java/org/eclipse/yasson/internal/deserializer/types/UrlDeserializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Object deserializeStringValue(String value, DeserializationContextImpl context,
3434
try {
3535
return new URL(value);
3636
} catch (MalformedURLException e) {
37-
throw new JsonbException("java.net.URL could not parse value " + value, e);
37+
throw new JsonbException("java.net.URL could not parse value " + value, e);
3838
}
3939
}
4040
}

src/test/java/org/eclipse/yasson/defaultmapping/specific/UnmarshallingUnsupportedTypesTest.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public void setValue(String value) {
7272
String expected = "{\"customInterface\":{\"value\":\"value1\"}}";
7373
assertEquals(expected, defaultJsonb.toJson(unsupported));
7474
try {
75-
defaultJsonb.fromJson(expected, ClassWithUnsupportedFields.class);
75+
defaultJsonb.fromJson(expected, ClassWithUnsupportedFields.class);
7676
fail("Should report an error");
7777
} catch (JsonbException e) {
7878
assertTrue(e.getMessage().contains("Cannot infer a type"));
@@ -136,11 +136,11 @@ public void testMissingFieldDefaultNull() {
136136

137137
@Test
138138
public void testMissingFieldIgnored() {
139-
assertThrows(JsonbException.class, () -> {
140-
Jsonb defaultConfig = JsonbBuilder.create(new JsonbConfig().setProperty(FAIL_ON_UNKNOWN_PROPERTIES, true));
141-
String json = "{\"nestedPojo\":{\"integerValue\":10,\"missingField\":5},\"optionalLong\":11}";
142-
SupportedTypes result = defaultConfig.fromJson(json, SupportedTypes.class);
143-
});
139+
assertThrows(JsonbException.class, () -> {
140+
Jsonb defaultConfig = JsonbBuilder.create(new JsonbConfig().setProperty(FAIL_ON_UNKNOWN_PROPERTIES, true));
141+
String json = "{\"nestedPojo\":{\"integerValue\":10,\"missingField\":5},\"optionalLong\":11}";
142+
SupportedTypes result = defaultConfig.fromJson(json, SupportedTypes.class);
143+
});
144144
}
145145

146146
@Test
@@ -229,19 +229,19 @@ public void testEmptyStringAsOptionalLong() {
229229

230230
@Test
231231
public void testMalformedURL() {
232-
Type type = new TestTypeToken<ScalarValueWrapper<URL>>(){}.getType();
233-
assertFail("{\"value\":\"www.oracle.com\"}", type, "value", URL.class);
232+
Type type = new TestTypeToken<ScalarValueWrapper<URL>>(){}.getType();
233+
assertFail("{\"value\":\"www.oracle.com\"}", type, "value", URL.class);
234234
}
235235

236236
@Test
237237
public void testMalformedURI() {
238-
Type type = new TestTypeToken<ScalarValueWrapper<URI>>(){}.getType();
239-
assertFail("{\"value\":\"www .oracle .com\"}", type, "value", URI.class);
238+
Type type = new TestTypeToken<ScalarValueWrapper<URI>>(){}.getType();
239+
assertFail("{\"value\":\"www .oracle .com\"}", type, "value", URI.class);
240240
}
241241

242242
private void assertFail(String json, Type type, String failureProperty, Class<?> failurePropertyClass) {
243243
try {
244-
defaultJsonb.fromJson(json, type);
244+
defaultJsonb.fromJson(json, type);
245245
fail("Expected to catch JsonbException but did not");
246246
} catch (JsonbException e) {
247247
if(!e.getMessage().contains(failureProperty) || !e.getMessage().contains(failurePropertyClass.getName())) {

0 commit comments

Comments
 (0)