This commit is contained in:
Alexey Kudravtsev
2010-11-19 14:32:36 +03:00
parent ce72e3581f
commit cbfa55a159
6 changed files with 10 additions and 20 deletions
@@ -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);
@@ -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;
}
@@ -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;
@@ -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);
@@ -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));
}
@@ -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;
}