mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Cleanup (minor optimization; warnings; formatting)
GitOrigin-RevId: 242d27a188cf44981a608b08bb1d287bd3b9d540
This commit is contained in:
committed by
intellij-monorepo-bot
parent
1b6bca7f46
commit
82d0a2e6e5
@@ -114,8 +114,8 @@ public final class StubIndexImpl extends StubIndexEx implements PersistentStateC
|
||||
return new FileBasedIndexExtension<K, Void>() {
|
||||
@Override
|
||||
public @NotNull ID<K, Void> getName() {
|
||||
//noinspection unchecked
|
||||
return (ID<K, Void>)extension.getKey();
|
||||
@SuppressWarnings("unchecked") ID<K, Void> key = (ID<K, Void>)extension.getKey();
|
||||
return key;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -747,4 +747,4 @@ public final class StubIndexImpl extends StubIndexEx implements PersistentStateC
|
||||
public boolean areAllProblemsProcessedInTheCurrentThread() {
|
||||
return myStubProcessingHelper.areAllProblemsProcessedInTheCurrentThread();
|
||||
}
|
||||
}
|
||||
}
|
||||
+8
-7
@@ -592,14 +592,15 @@ public class FileDocumentManagerImpl extends FileDocumentManager implements Safe
|
||||
}
|
||||
|
||||
private void propertyChanged(@NotNull VFilePropertyChangeEvent event) {
|
||||
final VirtualFile file = event.getFile();
|
||||
if (VirtualFile.PROP_WRITABLE.equals(event.getPropertyName())) {
|
||||
final Document document = getCachedDocument(file);
|
||||
VirtualFile file = event.getFile();
|
||||
Document document = getCachedDocument(file);
|
||||
if (document != null) {
|
||||
ApplicationManager.getApplication().runWriteAction((ExternalChangeAction)() -> document.setReadOnly(!file.isWritable()));
|
||||
}
|
||||
}
|
||||
else if (VirtualFile.PROP_NAME.equals(event.getPropertyName())) {
|
||||
VirtualFile file = event.getFile();
|
||||
Document document = getCachedDocument(file);
|
||||
if (document != null) {
|
||||
if (isBinaryWithoutDecompiler(file)) {
|
||||
@@ -620,13 +621,13 @@ public class FileDocumentManagerImpl extends FileDocumentManager implements Safe
|
||||
}
|
||||
|
||||
private static boolean isBinaryWithDecompiler(@NotNull VirtualFile file) {
|
||||
final FileType ft = file.getFileType();
|
||||
return ft.isBinary() && BinaryFileTypeDecompilers.getInstance().forFileType(ft) != null;
|
||||
FileType type = file.getFileType();
|
||||
return type.isBinary() && BinaryFileTypeDecompilers.getInstance().forFileType(type) != null;
|
||||
}
|
||||
|
||||
private static boolean isBinaryWithoutDecompiler(@NotNull VirtualFile file) {
|
||||
final FileType fileType = file.getFileType();
|
||||
return fileType.isBinary() && BinaryFileTypeDecompilers.getInstance().forFileType(fileType) == null;
|
||||
FileType type = file.getFileType();
|
||||
return type.isBinary() && BinaryFileTypeDecompilers.getInstance().forFileType(type) == null;
|
||||
}
|
||||
|
||||
static final class MyAsyncFileListener implements AsyncFileListener {
|
||||
@@ -882,7 +883,7 @@ public class FileDocumentManagerImpl extends FileDocumentManager implements Safe
|
||||
|
||||
/** @deprecated another dirty Rider hack; don't use */
|
||||
@Deprecated
|
||||
@SuppressWarnings("StaticNonFinalField")
|
||||
@SuppressWarnings({"StaticNonFinalField", "DeprecatedIsStillUsed"})
|
||||
public static boolean ourConflictsSolverEnabled = true;
|
||||
|
||||
protected void cacheDocument(@NotNull VirtualFile file, @NotNull Document document) {
|
||||
|
||||
Reference in New Issue
Block a user