Skip to content

Commit

Permalink
Add prefab values for java.nio.charset.Charset
Browse files Browse the repository at this point in the history
  • Loading branch information
sullis authored and jqno committed Feb 8, 2021
1 parent a7673b7 commit c23335c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
4 changes: 3 additions & 1 deletion project/checkstyle-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
<module name="EmptyCatchBlock"/>
<module name="EmptyStatement"/>
<module name="EqualsAvoidNull"/>
<module name="ExecutableStatementCount"/>
<module name="ExecutableStatementCount">
<property name="max" value="31"/>
</module>
<module name="FallThrough"/>
<module name="FinalClass"/>
<module name="HiddenField">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import java.net.*;
import java.net.InetSocketAddress;
import java.nio.*;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.text.DateFormat;
import java.text.DecimalFormat;
import java.text.NumberFormat;
Expand Down Expand Up @@ -156,6 +158,12 @@ private void addPrimitiveClasses() {
private void addCommonClasses() {
addValues(BigDecimal.class, BigDecimal.ZERO, BigDecimal.ONE, BigDecimal.ZERO);
addValues(BigInteger.class, BigInteger.ZERO, BigInteger.ONE, BigInteger.ZERO);
addValues(
Charset.class,
StandardCharsets.UTF_8,
StandardCharsets.US_ASCII,
StandardCharsets.UTF_8
);
addValues(File.class, new File(""), new File("/"), new File(""));
addValues(Formatter.class, new Formatter(), new Formatter(), new Formatter());
addValues(Locale.class, new Locale("nl"), new Locale("hu"), new Locale("nl"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.lang.reflect.Method;
import java.net.*;
import java.nio.*;
import java.nio.charset.Charset;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
Expand Down Expand Up @@ -441,6 +442,7 @@ static final class CommonClassesContainer {
private final java.sql.Timestamp sqlTimestamp;
private final Currency currency;
private final EventObject eventObject;
private final Charset charset;

public CommonClassesContainer(
String string,
Expand All @@ -466,7 +468,8 @@ public CommonClassesContainer(
java.sql.Time sqlTime,
java.sql.Timestamp sqlTimestamp,
Currency currency,
EventObject eventObject
EventObject eventObject,
Charset charset
) {
this.string = string;
this.integer = integer;
Expand All @@ -492,6 +495,7 @@ public CommonClassesContainer(
this.sqlTimestamp = sqlTimestamp;
this.currency = currency;
this.eventObject = eventObject;
this.charset = charset;
}

@Override
Expand Down

0 comments on commit c23335c

Please sign in to comment.