From 81d2d986a317d035f5499181c9c95cc3b5d0dbca Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Thu, 24 Apr 2014 15:19:59 +0400 Subject: [PATCH] cleanup --- .../editor/event/EditorFactoryListener.java | 4 ++-- .../src/com/intellij/openapi/vfs/VfsUtil.java | 7 ++----- .../openapi/editor/impl/EditorFactoryImpl.java | 2 ++ .../openapi/project/CacheUpdateRunner.java | 14 +++++++------- .../com/intellij/util/io/ResizeableMappedFile.java | 8 +++++--- 5 files changed, 18 insertions(+), 17 deletions(-) diff --git a/platform/editor-ui-api/src/com/intellij/openapi/editor/event/EditorFactoryListener.java b/platform/editor-ui-api/src/com/intellij/openapi/editor/event/EditorFactoryListener.java index b855a0c5f834..b8bd41980b7c 100644 --- a/platform/editor-ui-api/src/com/intellij/openapi/editor/event/EditorFactoryListener.java +++ b/platform/editor-ui-api/src/com/intellij/openapi/editor/event/EditorFactoryListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -20,7 +20,7 @@ import org.jetbrains.annotations.NotNull; import java.util.EventListener; /** - * @see {@link com.intellij.openapi.editor.EditorFactory#addEditorFactoryListener(com.intellij.openapi.editor.event.EditorFactoryListener)} + * @see {@link com.intellij.openapi.editor.EditorFactory#addEditorFactoryListener(com.intellij.openapi.editor.event.EditorFactoryListener, com.intellij.openapi.Disposable)} */ public interface EditorFactoryListener extends EventListener { void editorCreated(@NotNull EditorFactoryEvent event); diff --git a/platform/platform-api/src/com/intellij/openapi/vfs/VfsUtil.java b/platform/platform-api/src/com/intellij/openapi/vfs/VfsUtil.java index 93831f86c865..f244155bb33f 100644 --- a/platform/platform-api/src/com/intellij/openapi/vfs/VfsUtil.java +++ b/platform/platform-api/src/com/intellij/openapi/vfs/VfsUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -492,10 +492,7 @@ public class VfsUtil extends VfsUtilCore { @Nullable public static VirtualFile createDirectoryIfMissing(@NotNull String directoryPath) throws IOException { - return doCreateDirectoriesIfMissing(FileUtil.toSystemIndependentName(directoryPath)); - } - - private static VirtualFile doCreateDirectoriesIfMissing(String path) throws IOException { + String path = FileUtil.toSystemIndependentName(directoryPath); final VirtualFile file = LocalFileSystem.getInstance().refreshAndFindFileByPath(path); if (file == null) { int pos = path.lastIndexOf('/'); diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorFactoryImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorFactoryImpl.java index 42abddccfc6b..ec0cef4e76d5 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorFactoryImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorFactoryImpl.java @@ -242,6 +242,7 @@ public class EditorFactoryImpl extends EditorFactory implements ApplicationCompo } @Override + @Deprecated public void addEditorFactoryListener(@NotNull EditorFactoryListener listener) { myEditorFactoryEventDispatcher.addListener(listener); } @@ -252,6 +253,7 @@ public class EditorFactoryImpl extends EditorFactory implements ApplicationCompo } @Override + @Deprecated public void removeEditorFactoryListener(@NotNull EditorFactoryListener listener) { myEditorFactoryEventDispatcher.removeListener(listener); } diff --git a/platform/platform-impl/src/com/intellij/openapi/project/CacheUpdateRunner.java b/platform/platform-impl/src/com/intellij/openapi/project/CacheUpdateRunner.java index bd5979e74130..7866cdec5da5 100644 --- a/platform/platform-impl/src/com/intellij/openapi/project/CacheUpdateRunner.java +++ b/platform/platform-impl/src/com/intellij/openapi/project/CacheUpdateRunner.java @@ -88,9 +88,9 @@ public class CacheUpdateRunner { } public static void processFiles(final ProgressIndicator indicator, - boolean processInReadAction, - Collection files, - Project project, Consumer processor) { + boolean processInReadAction, + Collection files, + Project project, Consumer processor) { indicator.checkCanceled(); final FileContentQueue queue = new FileContentQueue(); final double total = files.size(); @@ -139,10 +139,10 @@ public class CacheUpdateRunner { } private static boolean processSomeFilesWhileUserIsInactive(@NotNull FileContentQueue queue, - @NotNull Consumer progressUpdater, - final boolean processInReadAction, - @NotNull Project project, - @NotNull Consumer fileProcessor) { + @NotNull Consumer progressUpdater, + final boolean processInReadAction, + @NotNull Project project, + @NotNull Consumer fileProcessor) { final ProgressIndicatorBase innerIndicator = new ProgressIndicatorBase() { @Override protected boolean isCancelable() { diff --git a/platform/util/src/com/intellij/util/io/ResizeableMappedFile.java b/platform/util/src/com/intellij/util/io/ResizeableMappedFile.java index 7b508c7e3600..2aabd849d568 100644 --- a/platform/util/src/com/intellij/util/io/ResizeableMappedFile.java +++ b/platform/util/src/com/intellij/util/io/ResizeableMappedFile.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -23,6 +23,7 @@ import com.intellij.openapi.Forceable; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.util.io.FileUtilRt; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.io.*; @@ -33,12 +34,12 @@ public class ResizeableMappedFile implements Forceable { private long myLogicalSize; private final PagedFileStorage myStorage; - public ResizeableMappedFile(final File file, int initialSize, @Nullable PagedFileStorage.StorageLockContext lockContext, int pageSize, + public ResizeableMappedFile(@NotNull File file, int initialSize, @Nullable PagedFileStorage.StorageLockContext lockContext, int pageSize, boolean valuesAreBufferAligned) throws IOException { this(file, initialSize, lockContext, pageSize, valuesAreBufferAligned, false); } - public ResizeableMappedFile(final File file, + public ResizeableMappedFile(@NotNull File file, int initialSize, @Nullable PagedFileStorage.StorageLockContext lockContext, int pageSize, @@ -229,6 +230,7 @@ public class ResizeableMappedFile implements Forceable { } } + @NotNull public PagedFileStorage getPagedFileStorage() { return myStorage; }