GitOrigin-RevId: 859c6e801073915585a5c85b875df430e26460fd
This commit is contained in:
Alexey Kudravtsev
2021-05-31 13:39:32 +00:00
committed by intellij-monorepo-bot
parent ceb911f079
commit 166bac588a
4 changed files with 17 additions and 18 deletions
@@ -105,13 +105,13 @@ public abstract class CallHierarchyBrowserBase extends HierarchyBrowserBaseEx {
}
}
@SuppressWarnings("UnresolvedPropertyKey")
public static @NotNull String getCalleeType() {
//noinspection UnresolvedPropertyKey
return IdeBundle.message("title.hierarchy.callees.of");
}
@SuppressWarnings("UnresolvedPropertyKey")
public static @NotNull String getCallerType() {
//noinspection UnresolvedPropertyKey
return IdeBundle.message("title.hierarchy.callers.of");
}
}
@@ -24,7 +24,6 @@ import org.jetbrains.annotations.Nullable;
import java.io.IOException;
@SuppressWarnings("SameParameterValue")
public class ExcludedFilesFormatterTest extends FileSetTestCase {
public static final String UNFORMATTED_SAMPLE = "<a><b></b></a>";
@@ -59,7 +58,7 @@ public class ExcludedFilesFormatterTest extends FileSetTestCase {
VirtualFile f2 = createFile("src/subdir/f2.xml", UNFORMATTED_SAMPLE);
VirtualFile f3 = createFile("src/subdir/test/f3.xml", UNFORMATTED_SAMPLE);
NamedScopesHolder localHolder = NamedScopeManager.getInstance(getProject());
@SuppressWarnings("unused") NamedScope testScope = createScope(localHolder, "testScope", "file:*2.xml");
createScope(localHolder, "testScope", "file:*2.xml");
CodeStyle.getSettings(getProject()).getExcludedFiles().addDescriptor(new NamedScopeDescriptor("testScope"));
try {
formatProjectFiles(false, false);
@@ -109,7 +108,7 @@ public class ExcludedFilesFormatterTest extends FileSetTestCase {
assertFormatted(f3);
}
private static NamedScope createScope(@NotNull NamedScopesHolder holder, @NotNull String name, @NotNull String pattern)
private static @NotNull NamedScope createScope(@NotNull NamedScopesHolder holder, @NotNull String name, @NotNull String pattern)
throws ParsingException {
PackageSet fileSet = PackageSetFactory.getInstance().compile(pattern);
NamedScope scope = holder.createScope(name, fileSet);
@@ -117,7 +116,7 @@ public class ExcludedFilesFormatterTest extends FileSetTestCase {
return scope;
}
private void addPatternExclusions(String... patterns) {
private void addPatternExclusions(String @NotNull ... patterns) {
CodeStyleSettings settings = CodeStyle.getSettings(getProject());
for (String pattern : patterns) {
settings.getExcludedFiles().addDescriptor(new GlobPatternDescriptor(pattern));
@@ -714,7 +714,7 @@ public class LocalFileSystemTest extends BareTestFixtureTestCase {
});
try {
files.forEach(f -> updateFile(new File(f.getPath()), "+++"));
files.forEach(f -> writeToFile(new File(f.getPath()), "+++"));
((NewVirtualFile)topDir).markDirtyRecursively();
RefreshSession session = RefreshQueue.getInstance().createSession(false, true, null);
@@ -59,7 +59,7 @@ public final class IoTestUtil {
return filterParts(Charset.forName(forEncoding).newEncoder()::canEncode);
}
private static String filterParts(Predicate<? super String> predicate) {
private static String filterParts(@NotNull Predicate<? super String> predicate) {
return StringUtil.nullize(Stream.of(UNICODE_PARTS).filter(predicate).collect(Collectors.joining("_")));
}
@@ -70,7 +70,8 @@ public final class IoTestUtil {
return dir;
}
private static File expandWindowsPath(File file) {
@NotNull
private static File expandWindowsPath(@NotNull File file) {
if (SystemInfo.isWindows && file.getPath().indexOf('~') > 0) {
try {
return file.getCanonicalFile();
@@ -98,8 +99,9 @@ public final class IoTestUtil {
}
}
private static File createSymLink(String target, String link, @Nullable Boolean shouldExist) {
File linkFile = getFullLinkPath(link), targetFile = new File(target);
private static @NotNull File createSymLink(String target, String link, @Nullable Boolean shouldExist) {
File linkFile = getFullLinkPath(link);
File targetFile = new File(target);
try {
if (symLinkMode == Boolean.TRUE) {
Files.createSymbolicLink(linkFile.toPath(), targetFile.toPath());
@@ -206,7 +208,7 @@ public final class IoTestUtil {
throw new RuntimeException("No free roots");
}
private static File getFullLinkPath(String link) {
private static @NotNull File getFullLinkPath(@NotNull String link) {
File linkFile = new File(link);
if (!linkFile.isAbsolute()) {
linkFile = new File(getTempDirectory(), link);
@@ -354,7 +356,7 @@ public final class IoTestUtil {
}
}
public static void delete(File... files) {
public static void delete(File @NotNull ... files) {
for (File file : files) {
if (file != null) {
FileUtil.delete(file);
@@ -362,7 +364,7 @@ public final class IoTestUtil {
}
}
public static void updateFile(@NotNull File file, String content) {
public static void writeToFile(@NotNull File file, @NotNull String content) {
try {
FileUtil.writeToFile(file, content);
}
@@ -382,8 +384,7 @@ public final class IoTestUtil {
return Boolean.TRUE;
}
catch (IOException e) {
//noinspection RedundantSuppression
Logger.getInstance("#com.intellij.openapi.util.io.IoTestUtil").debug(e);
Logger.getInstance(IoTestUtil.class).debug(e);
runCommand("cmd", "/C", "mklink", link.toString(), target.getFileName().toString());
return Boolean.FALSE;
}
@@ -397,8 +398,7 @@ public final class IoTestUtil {
}
}
catch (Throwable t) {
//noinspection RedundantSuppression
Logger.getInstance("#com.intellij.openapi.util.io.IoTestUtil").debug(t);
Logger.getInstance(IoTestUtil.class).debug(t);
return null;
}
}