diff --git a/java/java-tests/testSrc/com/intellij/compiler/notNullVerification/NotNullVerifyingInstrumenterTest.java b/java/java-tests/testSrc/com/intellij/compiler/notNullVerification/NotNullVerifyingInstrumenterTest.java index 00e2bb8433c4..8e94a2079f27 100644 --- a/java/java-tests/testSrc/com/intellij/compiler/notNullVerification/NotNullVerifyingInstrumenterTest.java +++ b/java/java-tests/testSrc/com/intellij/compiler/notNullVerification/NotNullVerifyingInstrumenterTest.java @@ -12,7 +12,6 @@ import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassWriter; import java.io.File; -import java.io.FileInputStream; import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; @@ -109,14 +108,7 @@ public class NotNullVerifyingInstrumenterTest extends UsefulTestCase { MyClassLoader classLoader = new MyClassLoader(getClass().getClassLoader()); for (File file : files) { final String fileName = file.getName(); - FileInputStream stream = new FileInputStream(file); - byte[] content; - try { - content = FileUtil.adaptiveLoadBytes(stream); - } - finally { - stream.close(); - } + byte[] content = FileUtil.loadFileBytes(file); ClassReader reader = new ClassReader(content, 0, content.length); ClassWriter writer = new PsiClassWriter(myFixture.getProject(), false); diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/CollectHighlightsUtil.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/CollectHighlightsUtil.java index 59f11b128a57..9a7dcfa37da8 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/CollectHighlightsUtil.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/CollectHighlightsUtil.java @@ -146,8 +146,10 @@ public class CollectHighlightsUtil { LOG.assertTrue(commonParent != null); LOG.assertTrue(commonParent.getTextRange() != null); - while (commonParent.getParent() != null && commonParent.getTextRange().equals(commonParent.getParent().getTextRange())) { - commonParent = commonParent.getParent(); + PsiElement parent = commonParent.getParent(); + while (parent != null && commonParent.getTextRange().equals(parent.getTextRange())) { + commonParent = parent; + parent = parent.getParent(); } return commonParent; } 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 3e6c16b5e48d..7609188eb1ad 100644 --- a/platform/platform-api/src/com/intellij/openapi/vfs/VfsUtil.java +++ b/platform/platform-api/src/com/intellij/openapi/vfs/VfsUtil.java @@ -185,7 +185,7 @@ public class VfsUtil { public static VirtualFile copyFile(Object requestor, @NotNull VirtualFile file, @NotNull VirtualFile toDir, @NotNull @NonNls String newName) throws IOException { final VirtualFile newChild = toDir.createChildData(requestor, newName); - // [jeka] TODO: to be duscussed if the copy should have the same timestamp as the original + // [jeka] TODO: to be discussed if the copy should have the same timestamp as the original //OutputStream out = newChild.getOutputStream(requestor, -1, file.getActualTimeStamp()); newChild.setBinaryContent(file.contentsToByteArray()); return newChild; diff --git a/platform/platform-api/src/com/intellij/ui/content/Content.java b/platform/platform-api/src/com/intellij/ui/content/Content.java index 56cb366cabcf..e0b134bcccd6 100644 --- a/platform/platform-api/src/com/intellij/ui/content/Content.java +++ b/platform/platform-api/src/com/intellij/ui/content/Content.java @@ -63,7 +63,7 @@ public interface Content extends UserDataHolder, ComponentContainer { Disposable getDisposer(); /** - * @param disposer a Disposable object whoes dispose() method will be invoked upon this content release. + * @param disposer a Disposable object which dispose() method will be invoked upon this content release. */ void setDisposer(Disposable disposer); diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/PersistentFS.java b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/PersistentFS.java index bb914dcb93d2..6a2722fde9c9 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/PersistentFS.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/PersistentFS.java @@ -549,10 +549,6 @@ public class PersistentFS extends ManagingFS implements ApplicationComponent { return stream; } - public void restoreContent(VirtualFile file, Object requestor, final long modStamp, final long timeStamp) { - - } - public int acquireContent(VirtualFile file) { return myRecords.acquireFileContent(getFileId(file)); } diff --git a/platform/usageView/src/com/intellij/usages/impl/UsageViewImpl.java b/platform/usageView/src/com/intellij/usages/impl/UsageViewImpl.java index 4d6961875bf2..d1a823fd425b 100644 --- a/platform/usageView/src/com/intellij/usages/impl/UsageViewImpl.java +++ b/platform/usageView/src/com/intellij/usages/impl/UsageViewImpl.java @@ -157,6 +157,7 @@ public class UsageViewImpl implements UsageView, UsageModelTracker.UsageModelTra } }; myRootPanel = new MyPanel(myTree); + Disposer.register(this, myRootPanel); myModelTracker = new UsageModelTracker(project); Disposer.register(this, myModelTracker); @@ -798,7 +799,6 @@ public class UsageViewImpl implements UsageView, UsageModelTracker.UsageModelTra ToolTipManager.sharedInstance().unregisterComponent(myTree); myModelTracker.removeListener(this); myUpdateAlarm.cancelAllRequests(); - myRootPanel.dispose(); if (myUsagePreviewPanel != null) { UsageViewSettings.getInstance().PREVIEW_USAGES_SPLITTER_PROPORTIONS = ((Splitter)myUsagePreviewPanel.getParent()).getProportion(); myUsagePreviewPanel = null; @@ -1061,7 +1061,7 @@ public class UsageViewImpl implements UsageView, UsageModelTracker.UsageModelTra return myModel.areTargetsValid(); } - private class MyPanel extends JPanel implements TypeSafeDataProvider, OccurenceNavigator { + private class MyPanel extends JPanel implements TypeSafeDataProvider, OccurenceNavigator,Disposable { @Nullable private OccurenceNavigatorSupport mySupport; private MyPanel(JTree tree) { @@ -1081,7 +1081,7 @@ public class UsageViewImpl implements UsageView, UsageModelTracker.UsageModelTra }; } - private void dispose() { + public void dispose() { mySupport = null; }