Skip to content

Commit

Permalink
minor formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
essiembre committed Aug 31, 2024
1 parent d76ca76 commit c02bda5
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ private JsonXmlMapSerializer(BeanProperty currentProperty) {
@Override
public StdSerializer<?> createContextual(
SerializerProvider prov, BeanProperty property)
throws JsonMappingException {
throws JsonMappingException {
return new JsonXmlMapSerializer<>(property);
}

Expand All @@ -84,12 +84,12 @@ public void serialize(
entryName = DEFAULT_ENTRY_NAME;
}
}
gen.writeStartObject(); // outter name
gen.writeStartObject(); // outter name

for (Map.Entry<?, ?> entry : map.entrySet()) {
gen.writeFieldName(entryName);

gen.writeStartObject(); // <entry>
gen.writeStartObject(); // <entry>

// Write key
gen.writeFieldName(keyName);
Expand All @@ -100,8 +100,8 @@ public void serialize(
provider.defaultSerializeValue(entry.getValue(), gen);

// Close the entry element manually
gen.writeEndObject(); // </entry>
gen.writeEndObject(); // </entry>
}
gen.writeEndObject(); // </entry>
gen.writeEndObject(); // </entry>
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public final class DurationFormatter {
* Creates a duration with the default locale and full words for
* duration units.
*/
public DurationFormatter() { //NOSONAR Exists for javadoc
public DurationFormatter() { //NOSONAR Exists for javadoc
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ private boolean writeAttributes(Appendable w, String margin)
case AT_MAX_ALL:
yield writeAttribsWrapAtMaxAll(w, margin);
default: // ALL
{
{
writeAttribsWarpAll(w, margin);
yield true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ static void beforeAll() {
ch = new MapHolder();
ch.some = "thing";
ch.defaultEntryNames.putAll(MapUtil.toMap("k1", "v1", "k2", "v2"));
ch.specifiedEntryNames = new LinkedMap<>(MapUtil.toMap("k3", "v3", "k4", "v4"));
ch.specifiedEntryNames =
new LinkedMap<>(MapUtil.toMap("k3", "v3", "k4", "v4"));
ch.defaultType = new HashMap<>(MapUtil.toMap(5, true, 6, false));
ch.complexType.putAll(MapUtil.toMap(
new SomeKey("k7-a", "k7-b"), new SomeValue("v7-a", "b7-b"),
new SomeKey("k8-a", "k8-b"), new SomeValue("v8-a", "b8-b"),
new SomeKey("k9-a", "k9-b"), new SomeValue("v9-a", "b9-b")
));
new SomeKey("k9-a", "k9-b"), new SomeValue("v9-a", "b9-b")));
}

@Test
Expand Down Expand Up @@ -95,9 +95,10 @@ static class MapHolder {
private final Map<String, String> defaultEntryNames = new TreeMap<>();

@JsonXmlMap(
entryName = "child",
keyName = "childKey",
valueName = "childValue")
entryName = "child",
keyName = "childKey",
valueName = "childValue"
)
private Map<String, String> specifiedEntryNames;

private Map<Integer, Boolean> defaultType;
Expand All @@ -123,7 +124,6 @@ public static class SomeValue {
private String propd;
}


@Data
@JsonInclude(value = Include.ALWAYS, content = Include.ALWAYS)
static class ObjectWithNullMap {
Expand Down
114 changes: 57 additions & 57 deletions src/test/java/com/norconex/commons/lang/url/HttpURLTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,49 +43,49 @@ void tearDown() throws Exception {
@ParameterizedTest
@CsvSource(
value = {
"""
Keep protocol character case,\
HTTP://www.example.com,\
"""
Keep protocol character case,\
HTTP://www.example.com,\
HTTP://www.example.com""",
"""
'http' protocol without port,\
http://www.example.com/blah,\
"""
'http' protocol without port,\
http://www.example.com/blah,\
http://www.example.com/blah""",
"""
'http' protocol with default port,\
http://www.example.com:80/blah,\
"""
'http' protocol with default port,\
http://www.example.com:80/blah,\
http://www.example.com/blah""",
"""
'http' protocol with non-default port,\
http://www.example.com:81/blah,\
"""
'http' protocol with non-default port,\
http://www.example.com:81/blah,\
http://www.example.com:81/blah""",
"""
'https' protocol without port,\
https://www.example.com/blah,\
"""
'https' protocol without port,\
https://www.example.com/blah,\
https://www.example.com/blah""",
"""
'https' protocol with default port,\
https://www.example.com:443/blah,\
"""
'https' protocol with default port,\
https://www.example.com:443/blah,\
https://www.example.com/blah""",
"""
'https' protocol with non-default port,\
https://www.example.com:444/blah,\
"""
'https' protocol with non-default port,\
https://www.example.com:444/blah,\
https://www.example.com:444/blah""",
"""
Non 'http(s)' protocol without port,\
ftp://ftp.example.com/dir,\
"""
Non 'http(s)' protocol without port,\
ftp://ftp.example.com/dir,\
ftp://ftp.example.com/dir""",
"""
Non 'http(s)' protocol with port,\
ftp://ftp.example.com:20/dir,\
"""
Non 'http(s)' protocol with port,\
ftp://ftp.example.com:20/dir,\
ftp://ftp.example.com:20/dir""",
"""
Invalid URL,\
http://www.example.com/"path",\
"""
Invalid URL,\
http://www.example.com/"path",\
http://www.example.com/%22path%22""",
"""
URL with leading or trailing spaces,\
http://www.example.com/path ,\
"""
URL with leading or trailing spaces,\
http://www.example.com/path ,\
http://www.example.com/path""",
},
ignoreLeadingAndTrailingWhitespace = false
Expand All @@ -101,37 +101,37 @@ void testURLToStringEquals(
@ParameterizedTest
@CsvSource(
value = {
"""
Relative to protocol,\
//www.relative.com/e/f.html,\
"""
Relative to protocol,\
//www.relative.com/e/f.html,\
https://www.relative.com/e/f.html""",
"""
Relative to domain name,\
/e/f.html,\
"""
Relative to domain name,\
/e/f.html,\
https://www.example.com/e/f.html""",
"""
Relative to full page URL,\
?name=john,\
"""
Relative to full page URL,\
?name=john,\
https://www.example.com/a/b/c.html?name=john""",
"""
Relative to last directory,\
g.html,\
"""
Relative to last directory,\
g.html,\
https://www.example.com/a/b/g.html""",
"""
Absolute URL,\
http://www.sample.com/xyz.html,\
"""
Absolute URL,\
http://www.sample.com/xyz.html,\
http://www.sample.com/xyz.html""",
"""
Relative with colon in parameter,\
h/i.html?param=1:2,\
"""
Relative with colon in parameter,\
h/i.html?param=1:2,\
https://www.example.com/a/b/h/i.html?param=1:2""",
"""
Starts with valid odd scheme,\
x1+2-3.4:yz,\
"""
Starts with valid odd scheme,\
x1+2-3.4:yz,\
x1+2-3.4:yz""",
"""
Starts with invalid odd scheme,\
1+2-3.4x:yz,\
"""
Starts with invalid odd scheme,\
1+2-3.4x:yz,\
https://www.example.com/a/b/1+2-3.4x:yz""",
},
ignoreLeadingAndTrailingWhitespace = false
Expand Down

0 comments on commit c02bda5

Please sign in to comment.