1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

Fix regression of bug 217727

This commit is contained in:
Anton Leherbauer 2008-04-17 10:37:23 +00:00
parent 477fe21a13
commit c14f495a34

View file

@ -14,6 +14,7 @@
*******************************************************************************/
package org.eclipse.cdt.internal.ui.util;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.net.URI;
@ -157,7 +158,7 @@ public class EditorUtility {
}
private static IEditorPart openInEditor(IFile file, boolean activate) throws PartInitException {
if (file == null)
if (file == null)
return null;
if (!file.getProject().isAccessible()) {
closedProject(file.getProject());
@ -712,7 +713,7 @@ public class EditorUtility {
try {
IBuffer buffer = bin.getBuffer();
if (buffer != null) {
store = new EFSFileStorage (bin.getLocationURI());
store = new FileStorage (new ByteArrayInputStream(buffer.getContents().getBytes()), bin.getPath());
}
} catch (CModelException e) {
// nothing;
@ -720,10 +721,6 @@ public class EditorUtility {
return store;
}
public static IStorage getStorage(ITranslationUnit tu) {
return new EFSFileStorage (tu.getLocationURI());
}
/**
* Returns the C project for a given editor input or <code>null</code> if no corresponding
* C project exists.