mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-24 15:17:30 -04:00
Replace NOT operator with explicit false
check (#67817)
We have an in-house rule to compare explicitly against `false` instead of using the logical not operator (`!`). However, this hasn't historically been enforced, meaning that there are many violations in the source at present. We now have a Checkstyle rule that can detect these cases, but before we can turn it on, we need to fix the existing violations. This is being done over a series of PRs, since there are a lot to fix.
This commit is contained in:
parent
9a1611da80
commit
ad1f876daa
119 changed files with 264 additions and 246 deletions
|
@ -29,7 +29,7 @@ public class JavaVersion {
|
|||
public static final List<Integer> JAVA_11 = parse("11");
|
||||
|
||||
static List<Integer> parse(final String value) {
|
||||
if (!value.matches("^0*[0-9]+(\\.[0-9]+)*$")) {
|
||||
if (value.matches("^0*[0-9]+(\\.[0-9]+)*$") == false) {
|
||||
throw new IllegalArgumentException(value);
|
||||
}
|
||||
|
||||
|
|
|
@ -723,7 +723,7 @@ class InstallPluginCommand extends EnvironmentAwareCommand {
|
|||
|
||||
// be on the safe side: do not rely on that directories are always extracted
|
||||
// before their children (although this makes sense, but is it guaranteed?)
|
||||
if (!Files.isSymbolicLink(targetFile.getParent())) {
|
||||
if (Files.isSymbolicLink(targetFile.getParent()) == false) {
|
||||
Files.createDirectories(targetFile.getParent());
|
||||
}
|
||||
if (entry.isDirectory() == false) {
|
||||
|
|
|
@ -136,7 +136,7 @@ class RemovePluginCommand extends EnvironmentAwareCommand {
|
|||
|
||||
final Path pluginBinDir = env.binFile().resolve(pluginName);
|
||||
if (Files.exists(pluginBinDir)) {
|
||||
if (!Files.isDirectory(pluginBinDir)) {
|
||||
if (Files.isDirectory(pluginBinDir) == false) {
|
||||
throw new UserException(ExitCodes.IO_ERROR, "bin dir for " + pluginName + " is not a directory");
|
||||
}
|
||||
try (Stream<Path> paths = Files.list(pluginBinDir)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue