Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add autoformat using spotless #835

Merged
merged 2 commits into from
Mar 8, 2023
Merged

Add autoformat using spotless #835

merged 2 commits into from
Mar 8, 2023

Conversation

gnodet
Copy link
Member

@gnodet gnodet commented Mar 8, 2023

  • Add spotless
  • Reformat

@gnodet gnodet added this to the 3.23.0 milestone Mar 8, 2023
@gnodet gnodet merged commit e82b526 into jline:master Mar 8, 2023
}
catch (Exception e)
{
} catch (Exception e) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

28% of developers fix this issue

EmptyCatch: Caught exceptions should not be ignored


ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

@@ -129,7 +156,7 @@ private static Class<?> classResolver(String name) {
Class<?> out = null;
try {
out = Class.forName(name);
} catch (Exception|Error ignore) {
} catch (Exception | Error ignore) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

28% of developers fix this issue

EmptyCatch: Caught exceptions should not be ignored


ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

try {
ShellImpl.this.run(session, env);
} catch (Throwable t) {
t.printStackTrace();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

13% of developers fix this issue

CatchAndPrintStackTrace: Logging or rethrowing exceptions should usually be preferred to catching and calling printStackTrace


ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

@@ -121,7 +121,7 @@ public int readBuffered(char[] b, int off, int len, long timeout) throws IOExcep
try {
if (timeout > 0) {
if (!notEmpty.await(timeout, TimeUnit.MILLISECONDS)) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WaitNotInLoop: Because of spurious wakeups, await(long,java.util.concurrent.TimeUnit) must always be called in a loop


ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

@@ -121,7 +121,7 @@ public int readBuffered(char[] b, int off, int len, long timeout) throws IOExcep
try {
if (timeout > 0) {
if (!notEmpty.await(timeout, TimeUnit.MILLISECONDS)) {
throw new IOException( "Timeout reading" );
throw new IOException("Timeout reading");
}
} else {
notEmpty.await();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WaitNotInLoop: Because of spurious wakeups, await() must always be called in a loop


ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

@@ -574,7 +550,8 @@ public static AttributedString highlightComment(String comment, StyleResolver re
return _highlightComment(comment, resolver).toAttributedString();
}

private static AttributedStringBuilder _highlightSyntax(String syntax, StyleResolver resolver, boolean subcommand) {
private static AttributedStringBuilder _highlightSyntax(
String syntax, StyleResolver resolver, boolean subcommand) {
StringBuilder indent = new StringBuilder();
for (char c : syntax.toCharArray()) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LoopOverCharArray: toCharArray allocates a new array, using charAt is more efficient


Suggested change
for (char c : syntax.toCharArray()) {
for (int i = 0; i < syntax.length(); i++) { char c = syntax.charAt(i);if (c != ' ') {

ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

import com.sun.jna.LastErrorException;
import com.sun.jna.NativeLong;
import com.sun.jna.Structure;

public interface CLibrary extends com.sun.jna.Library {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

11% of developers fix this issue

UnnecessarilyFullyQualified: This fully qualified name is unambiguous to the compiler if imported.


Suggested change
public interface CLibrary extends com.sun.jna.Library {
public interface CLibrary extends Library {

ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

import com.sun.jna.LastErrorException;
import com.sun.jna.NativeLong;
import com.sun.jna.Structure;

public interface CLibrary extends com.sun.jna.Library {

void tcgetattr(int fd, termios termios) throws LastErrorException;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

29% of developers fix this issue

VariableNameSameAsType: Variable named termios has the type termios. Calling methods using "termios.something" are difficult to distinguish between static and instance methods.


ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

@@ -82,7 +84,7 @@ public void refresh(LineReader lineReader) {
if (currentTheme != null) {
try (BufferedReader reader = new BufferedReader(new FileReader(currentTheme.toFile()))) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

13% of developers fix this issue

DefaultCharset: Implicit use of the platform default charset, which can result in differing behaviour between JVM executions or incorrect behavior if the encoding of the data source doesn't match expectations.


Suggested change
try (BufferedReader reader = new BufferedReader(new FileReader(currentTheme.toFile()))) {
try (BufferedReader reader = Files.newBufferedReader(currentTheme.toFile().toPath(), Charset.defaultCharset())) {

ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

? new FileOutputStream(FileDescriptor.err)
: new FileOutputStream(getName());
? new FileOutputStream(FileDescriptor.err)
: new FileOutputStream(getName());
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2% of developers fix this issue

PATH_TRAVERSAL_OUT: This API (java/io/FileOutputStream.(Ljava/lang/String;)V) writes to a file whose location might be specified by user input


ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

}
Class<?> o = null;
try {
o = (Class<?>) shell.evaluate(n + ".class");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GROOVY_SHELL: Potential code injection when using GroovyShell


ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

@@ -1110,14 +1129,14 @@ private Object doc(CommandInput input) {
}
if (!done) {
String name;
if (arg instanceof String && ((String)arg).matches("([a-z]+\\.)+[A-Z][a-zA-Z]+")) {
name = (String)arg;
if (arg instanceof String && ((String) arg).matches("([a-z]+\\.)+[A-Z][a-zA-Z]+")) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

12% of developers fix this issue

REDOS: The regular expression "([a-z]+\.)+[A-Z][a-zA-Z]+" is vulnerable to a denial of service attack (ReDOS)


ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

, "java.net.*", "groovy.lang.*", "groovy.util.*"
, "java.math.BigInteger", "java.math.BigDecimal");
private final Map<String,Class<?>> defaultNameClass = new HashMap<>();
private static final Pattern PATTERN_LOAD_CLASS = Pattern.compile(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

12% of developers fix this issue

REDOS: The regular expression "(import\s+|new\s+|\s*)?(([a-z][a-z_0-9]\.))(A-Z_)(\..|\(.*)?" is vulnerable to a denial of service attack (ReDOS)


ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

Process p = new ProcessBuilder(OSUtils.TTY_COMMAND).redirectInput(input).start();
? ProcessBuilder.Redirect.INHERIT
: getRedirect(stream == Stream.Output ? FileDescriptor.out : FileDescriptor.err);
Process p =
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

COMMAND_INJECTION: This usage of java/lang/ProcessBuilder.([Ljava/lang/String;)V can be vulnerable to Command Injection


ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

out[i] = null;

// Try to convert one argument
if (in.size() == 0 || i == types.length - 1 && types[i].isArray() && in.size() > 1)
{
if (in.size() == 0 || i == types.length - 1 && types[i].isArray() && in.size() > 1) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

31% of developers fix this issue

OperatorPrecedence: Use grouping parenthesis to make the operator precedence explicit


Suggested change
if (in.size() == 0 || i == types.length - 1 && types[i].isArray() && in.size() > 1) {
if (in.size() == 0 || (i == types.length - 1 && types[i].isArray() && in.size() > 1)) {

❗❗ 2 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
terminal-jansi/src/main/java/org/jline/terminal/impl/jansi/win/JansiWinSysTerminal.java 221
terminal-jansi/src/main/java/org/jline/terminal/impl/jansi/win/JansiWinSysTerminal.java 218

Visit the Lift Web Console to find more details in your report.


ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

@@ -231,8 +237,11 @@ public Map<String, Boolean> scripts() {
for (String e : scriptExtensions()) {
String regex = pp + "/*." + e;
PathMatcher pathMatcher = FileSystems.getDefault().getPathMatcher("glob:" + regex);
Files.find(Paths.get(new File(regex).getParent()), Integer.MAX_VALUE,
(path, f) -> pathMatcher.matches(path)).forEach(scripts::add);
Files.find(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5% of developers fix this issue

PATH_TRAVERSAL_IN: This API (java/io/File.(Ljava/lang/String;)V) reads a file whose location might be specified by user input

❗❗ 11 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
demo/src/main/java/org/jline/demo/Repl.java 292
terminal/src/main/java/org/jline/terminal/impl/ExecPty.java 76
builtins/src/main/java/org/jline/builtins/Commands.java 1681
console/src/main/java/org/jline/console/impl/ConsoleEngineImpl.java 241
console/src/main/java/org/jline/console/impl/DefaultPrinter.java 415
builtins/src/main/java/org/jline/builtins/SyntaxHighlighter.java 167
builtins/src/main/java/org/jline/builtins/SyntaxHighlighter.java 154
graal/src/main/java/org/jline/demo/graal/Graal.java 56
builtins/src/main/java/org/jline/builtins/Commands.java 1680
groovy/src/main/java/org/jline/script/GroovyCommand.java 291

Showing 10 of 11 findings. Visit the Lift Web Console to see all.


ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

@@ -641,8 +640,7 @@ public String readLine(String prompt, String rightPrompt, MaskingCallback maskin

callWidget(CALLBACK_INIT);

if (!isSet(Option.DISABLE_UNDO))
undo.newState(buf.copy());
if (!isSet(Option.DISABLE_UNDO)) undo.newState(buf.copy());
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6% of developers fix this issue

THREAD_SAFETY_VIOLATION: Read/Write race. Non-private method LineReaderImpl.readLine(...) indirectly reads with synchronization from this.undo.current. Potentially races with unsynchronized write in method LineReaderImpl.readLine(...).
Reporting because this access may occur on a background thread.

❗❗ 19 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
reader/src/main/java/org/jline/reader/impl/LineReaderImpl.java 6250
reader/src/main/java/org/jline/reader/impl/LineReaderImpl.java 4905
reader/src/main/java/org/jline/reader/impl/LineReaderImpl.java 6278
reader/src/main/java/org/jline/reader/impl/LineReaderImpl.java 3139
reader/src/main/java/org/jline/reader/impl/LineReaderImpl.java 4291
reader/src/main/java/org/jline/reader/impl/LineReaderImpl.java 5835
reader/src/main/java/org/jline/reader/impl/LineReaderImpl.java 4965
reader/src/main/java/org/jline/reader/impl/LineReaderImpl.java 4959
remote-telnet/src/main/java/org/jline/builtins/telnet/Connection.java 189
remote-telnet/src/main/java/org/jline/builtins/telnet/Connection.java 119

Showing 10 of 19 findings. Visit the Lift Web Console to see all.


ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

@@ -178,7 +193,8 @@ private Map<String, List<Candidate>> sort(List<Candidate> candidates) {
Map<String, List<Candidate>> sortedCandidates = new HashMap<>();
for (Candidate candidate : candidates) {
sortedCandidates
.computeIfAbsent(AttributedString.fromAnsi(candidate.value()).toString(), s -> new ArrayList<>())
.computeIfAbsent(
AttributedString.fromAnsi(candidate.value()).toString(), s -> new ArrayList<>())
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

17% of developers fix this issue

NULL_DEREFERENCE: object returned by fromAnsi(candidate.value()) could be null and is dereferenced at line 197.

❗❗ 3 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
terminal-jansi/src/main/java/org/jline/terminal/impl/jansi/JansiTerminalProvider.java 87
groovy/src/main/java/org/jline/script/GroovyEngine.java 1067
terminal-jansi/src/main/java/org/jline/terminal/impl/jansi/JansiTerminalProvider.java 105

Visit the Lift Web Console to find more details in your report.


ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

outType,
classResolver);
} else if (connection
.getClass()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9% of developers fix this issue

RESOURCE_LEAK: resource of type java.net.HttpURLConnection acquired by call to openConnection() at line 302 is not released after line 313.

❗❗ 3 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
remote-telnet/src/main/java/org/jline/builtins/telnet/PortListener.java 180
demo/src/main/java/org/jline/demo/Repl.java 249
groovy/src/main/java/org/jline/script/PackageHelper.java 313

Visit the Lift Web Console to find more details in your report.


ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

bind(safe, SELF_INSERT, range("^@-^?"));
bind(safe, ACCEPT_LINE, "\r", "\n");
bind(safe, SEND_BREAK, ctrl('G'));
bind(safe, SELF_INSERT, range("^@-^?"));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5% of developers fix this issue

NULLPTR_DEREFERENCE: Collection KeyMap.range(String) could be null (from the call to KeyMap.range(...) on line 6258) and is dereferenced in the call to LineReaderImpl.bind(...).

❗❗ 4 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
reader/src/main/java/org/jline/reader/impl/LineReaderImpl.java 6166
reader/src/main/java/org/jline/reader/impl/LineReaderImpl.java 6041
reader/src/main/java/org/jline/reader/impl/LineReaderImpl.java 6101
groovy/src/main/java/org/jline/script/GroovyCommand.java 407

Visit the Lift Web Console to find more details in your report.


ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

@gnodet gnodet deleted the reformat branch March 8, 2023 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant