mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
Fix "ignored result of call" and other warnings
GitOrigin-RevId: 13ffae0c5ef1ea27b7306f4b0cc5386369717734
This commit is contained in:
committed by
intellij-monorepo-bot
parent
edec77df83
commit
2854780d0a
@@ -229,6 +229,7 @@ final class UsedIconsListingAction extends AnAction {
|
||||
PsiFile file = annotation.getContainingFile();
|
||||
if (useScope.contains(file.getVirtualFile())) {
|
||||
WriteCommandAction.writeCommandAction(project, file).run(() -> {
|
||||
//noinspection ResultOfMethodCallIgnored -- load tree?
|
||||
annotation.getNode();
|
||||
annotation.setDeclaredAttributeValue(
|
||||
"icon",
|
||||
|
||||
@@ -205,7 +205,7 @@ public class MiscPsiTest extends LightJavaCodeInsightFixtureTestCase {
|
||||
final PsiJavaFile file = (PsiJavaFile)PsiFileFactory.getInstance(getProject()).createFileFromText("D.java",
|
||||
"import java.util.Map.Entry");
|
||||
PsiImportStatement importStatement = file.getImportList().getImportStatements()[0];
|
||||
assertTrue(!importStatement.isOnDemand());
|
||||
assertFalse(importStatement.isOnDemand());
|
||||
}
|
||||
|
||||
public void testDocCommentPrecededByLineComment() {
|
||||
@@ -236,7 +236,8 @@ public class MiscPsiTest extends LightJavaCodeInsightFixtureTestCase {
|
||||
|
||||
public void testDoNotExpandNestedChameleons() {
|
||||
PsiJavaFile file = (PsiJavaFile)myFixture.addFileToProject("a.java", "class A {{{}}}");
|
||||
file.getNode();
|
||||
//noinspection ResultOfMethodCallIgnored
|
||||
file.getNode(); // load tree
|
||||
|
||||
PsiCodeBlock initializer = file.getClasses()[0].getInitializers()[0].getBody();
|
||||
assertFalse(assertInstanceOf(initializer.getNode(), LazyParseableElement.class).isParsed());
|
||||
|
||||
@@ -140,6 +140,7 @@ public class PsiConcurrencyStressTest extends DaemonAnalyzerTestCase {
|
||||
case 1 -> {
|
||||
mark("m");
|
||||
for (int offset = 0; offset < myFile.getTextLength(); offset++) {
|
||||
//noinspection ResultOfMethodCallIgnored -- performance testing
|
||||
myFile.findElementAt(offset);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,10 +15,10 @@ import com.intellij.tasks.impl.LocalTaskImpl;
|
||||
import com.intellij.tasks.impl.TaskManagerImpl;
|
||||
import com.intellij.testFramework.HeavyPlatformTestCase;
|
||||
import com.intellij.testFramework.RunAll;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@@ -239,7 +239,11 @@ public abstract class TaskBranchesTest extends HeavyPlatformTestCase {
|
||||
}
|
||||
|
||||
private List<Repository> initRepositories(String... names) {
|
||||
return ContainerUtil.map(names, this::initRepository);
|
||||
List<Repository> result = new ArrayList<>();
|
||||
for (String t : names) {
|
||||
result.add(initRepository(t));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -39,7 +39,7 @@ public class DomChildrenTest extends DomTestCase {
|
||||
|
||||
public void testGetChild() {
|
||||
final MyElement element = createElement("<a>" + "<child>foo</child>" + "</a>");
|
||||
element.toString();
|
||||
assertNotNull(element.toString());
|
||||
assertEquals("foo", element.getMyChild().getValue());
|
||||
assertEquals("foo", element.getChild().getValue());
|
||||
assertSame(element.getChild(), element.getMyChild());
|
||||
|
||||
Reference in New Issue
Block a user