Skip to content

Commit 02afee1

Browse files
committed
Improved code
1 parent 862738d commit 02afee1

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

config/checkstyle/checkstyle.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
<property name="charset" value="UTF-8"/>
88
<property name="fileExtensions" value="java, json, xml, properties"/>
99
<property name="severity" value="warning"/> <!-- error -->
10-
<!--<module name="SuppressionFilter">-->
11-
<!-- <property name="file" value="${config_loc}/suppressions.xml"/>-->
12-
<!--</module>-->
10+
<module name="SuppressionFilter">
11+
<property name="file" value="${config_loc}/suppressions.xml"/>
12+
</module>
1313

1414
<module name="NewlineAtEndOfFile"/>
1515
<module name="FileTabCharacter"/>

config/checkstyle/suppressions.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
55

66
<suppressions>
7-
<suppress files="TheClassToIgnore\.java" checks="[a-zA-Z0-9]*"/>
7+
<suppress files="Tutorial\.java" checks="Regexp"/>
88
</suppressions>

src/main/java/net/lenni0451/miniconnect/utils/ViaUtils.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import net.lenni0451.mcstructs.nbt.INbtTag;
55

66
import javax.annotation.Nullable;
7+
import java.util.Collections;
78
import java.util.Map;
89

910
public class ViaUtils {
@@ -21,7 +22,7 @@ public static Tag convertNbt(@Nullable final INbtTag nbt) {
2122
case BYTE_ARRAY -> new ByteArrayTag(nbt.asByteArrayTag().getValue());
2223
case STRING -> new StringTag(nbt.asStringTag().getValue());
2324
case LIST -> {
24-
ListTag<? super Tag> listTag = new ListTag<>();
25+
ListTag<? super Tag> listTag = new ListTag<>(Collections.emptyList());
2526
for (INbtTag tag : nbt.asListTag()) {
2627
listTag.add(convertNbt(tag));
2728
}

0 commit comments

Comments
 (0)