do NOT create wrapper type instance when can (#1985)

pull/2008/head
XenoAmess 3 years ago committed by GitHub
parent 863d57f57f
commit 09765b00fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -285,7 +285,7 @@ public class TelnetConsole {
}
// ctrl + c event callback
consoleReader.getKeys().bind(new Character((char) CTRL_C).toString(), new ActionListener() {
consoleReader.getKeys().bind(Character.toString((char) CTRL_C), new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
try {
@ -300,7 +300,7 @@ public class TelnetConsole {
});
// ctrl + d event call back
consoleReader.getKeys().bind(new Character(KeyMap.CTRL_D).toString(), eotEventCallback);
consoleReader.getKeys().bind(Character.toString(KeyMap.CTRL_D), eotEventCallback);
try {
telnet.connect(telnetConsole.getTargetIp(), telnetConsole.getPort());

@ -25,7 +25,7 @@ public class WordCountHandler extends StdoutHandler implements StatisticsFunctio
CommandLine commandLine = CLIs.create(NAME)
.addOption(new Option().setShortName("l").setFlag(true))
.parse(args);
Boolean lineMode = commandLine.isFlagEnabled("l");
boolean lineMode = commandLine.isFlagEnabled("l");
return new WordCountHandler(lineMode);
}

Loading…
Cancel
Save