cleanup - isEmpty

GitOrigin-RevId: 100d69abb6a423556574a72e82508fdb8f5d7fa3
This commit is contained in:
Vladimir Krivosheev
2024-12-27 14:41:14 +00:00
committed by intellij-monorepo-bot
parent ddcc95124c
commit 25233df1b1
611 changed files with 1060 additions and 1380 deletions
@@ -1,4 +1,4 @@
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.rt.ant.execution;
import org.apache.tools.ant.BuildException;
@@ -26,7 +26,7 @@ public class IdeaInputHandler implements InputHandler {
if (request instanceof MultipleChoiceInputRequest) {
@SuppressWarnings("unchecked")
List<String> choices = ((MultipleChoiceInputRequest)request).getChoices();
if (choices != null && choices.size() > 0) {
if (choices != null && !choices.isEmpty()) {
int count = choices.size();
packet.appendLong(count);
for (String choice : choices) {
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.rt.execution.testFrameworks;
import java.io.*;
@@ -83,7 +69,7 @@ public abstract class ForkedByModuleSplitter {
}
builder.add("-classpath");
if (myDynamicClasspath.length() > 0) {
if (!myDynamicClasspath.isEmpty()) {
try {
if ("ARGS_FILE".equals(myDynamicClasspath)) {
File argFile = File.createTempFile("arg_file", null);
@@ -154,7 +140,7 @@ public abstract class ForkedByModuleSplitter {
final String classpath = perDirReader.readLine();
List<String> moduleOptions = new ArrayList<>();
String modulePath = perDirReader.readLine();
if (modulePath != null && modulePath.length() > 0) {
if (modulePath != null && !modulePath.isEmpty()) {
moduleOptions.add("-p");
moduleOptions.add(modulePath);
}
@@ -1,4 +1,4 @@
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.rt.execution.testFrameworks;
import com.intellij.rt.execution.junit.RepeatCount;
@@ -30,7 +30,7 @@ public abstract class ForkedSplitter<T> extends ForkedByModuleSplitter {
final String classpath = System.getProperty("java.class.path");
final String modulePath = System.getProperty("jdk.module.path");
final List<String> moduleOptions = new ArrayList<>();
if (modulePath != null && modulePath.length() > 0) {
if (modulePath != null && !modulePath.isEmpty()) {
moduleOptions.add("-p");
moduleOptions.add(modulePath);
}
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.rt.execution.testFrameworks;
import java.io.File;
@@ -67,7 +53,7 @@ public class ProcessBuilder {
//
// If either of these becomes an issue, please refer to [util] CommandLineUtil.addToWindowsCommandLine() for a possible implementation.
public Process createProcess() throws IOException {
if (myParameters.size() < 1) {
if (myParameters.isEmpty()) {
throw new IllegalArgumentException("Executable name not specified");
}
@@ -91,7 +77,7 @@ public class ProcessBuilder {
while ((pos = parameter.indexOf('\"', pos)) >= 0);
parameter = buffer.toString();
}
else if (parameter.length() == 0) {
else if (parameter.isEmpty()) {
parameter = "\"\"";
}