From f6328835f6c13cbe0a14eb9f248aa03b2e23b19d Mon Sep 17 00:00:00 2001 From: David McKnight Date: Tue, 9 Jan 2007 20:01:24 +0000 Subject: [PATCH] remove a couple compiler warnings --- .../rse/eclipse/filesystem/Activator.java | 2 +- .../RSEFileStoreRemoteFileWrapper.java | 17 ++++++++--------- .../rse/eclipse/filesystem/RSEFileSystem.java | 9 --------- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.eclipse.filesystem/src/org/eclipse/rse/eclipse/filesystem/Activator.java b/rse/plugins/org.eclipse.rse.eclipse.filesystem/src/org/eclipse/rse/eclipse/filesystem/Activator.java index ed1ac29f78c..0b62f1adcbe 100644 --- a/rse/plugins/org.eclipse.rse.eclipse.filesystem/src/org/eclipse/rse/eclipse/filesystem/Activator.java +++ b/rse/plugins/org.eclipse.rse.eclipse.filesystem/src/org/eclipse/rse/eclipse/filesystem/Activator.java @@ -71,6 +71,6 @@ public class Activator extends AbstractUIPlugin { * @return the image descriptor */ public static ImageDescriptor getImageDescriptor(String path) { - return AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.rse.eclipse.filesystem", path); + return AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.rse.eclipse.filesystem", path); //$NON-NLS-1$ } } \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.eclipse.filesystem/src/org/eclipse/rse/eclipse/filesystem/RSEFileStoreRemoteFileWrapper.java b/rse/plugins/org.eclipse.rse.eclipse.filesystem/src/org/eclipse/rse/eclipse/filesystem/RSEFileStoreRemoteFileWrapper.java index d56f52d11b9..7714662a95c 100644 --- a/rse/plugins/org.eclipse.rse.eclipse.filesystem/src/org/eclipse/rse/eclipse/filesystem/RSEFileStoreRemoteFileWrapper.java +++ b/rse/plugins/org.eclipse.rse.eclipse.filesystem/src/org/eclipse/rse/eclipse/filesystem/RSEFileStoreRemoteFileWrapper.java @@ -190,14 +190,14 @@ public class RSEFileStoreRemoteFileWrapper extends FileStore implements IFileSto { - if (_remoteFile.getName().equals(".project") && _remoteFile.getLength() == 0) + if (_remoteFile.getName().equals(".project") && _remoteFile.getLength() == 0) //$NON-NLS-1$ { - System.out.println("reading empty .project"); + System.out.println("reading empty .project"); //$NON-NLS-1$ InputStream stream = getDummyProjectFileStream(); try { int size = stream.available(); - _subSystem.upload(stream, size, _remoteFile, "utf8", monitor); + _subSystem.upload(stream, size, _remoteFile, "utf8", monitor); //$NON-NLS-1$ _remoteFile = _subSystem.getRemoteFileObject(_remoteFile.getAbsolutePath()); } @@ -222,7 +222,6 @@ public class RSEFileStoreRemoteFileWrapper extends FileStore implements IFileSto */ } - if (file == null || !file.exists()) { file = (IFile)UniversalFileTransferUtility.copyRemoteResourceToWorkspace(_remoteFile, monitor); if (file != null && !file.isSynchronized(IResource.DEPTH_ZERO)) @@ -244,7 +243,7 @@ public class RSEFileStoreRemoteFileWrapper extends FileStore implements IFileSto { file = (IFile)UniversalFileTransferUtility.getTempFileFor(_remoteFile); } - if (!file.isSynchronized(IResource.DEPTH_ZERO) && !_remoteFile.getName().equals(".project")) + if (file != null && !file.isSynchronized(IResource.DEPTH_ZERO) && !_remoteFile.getName().equals(".project")) //$NON-NLS-1$ { try { @@ -305,7 +304,7 @@ public class RSEFileStoreRemoteFileWrapper extends FileStore implements IFileSto String path = _remoteFile.getAbsolutePath(); if (path.charAt(0) != '/') { - path = "/" + path.replace('\\', '/'); + path = "/" + path.replace('\\', '/'); //$NON-NLS-1$ } return new URI("rse", _subSystem.getHost().getHostName(), path, null); //$NON-NLS-1$ } @@ -355,7 +354,7 @@ public class RSEFileStoreRemoteFileWrapper extends FileStore implements IFileSto //checkReadOnlyParent(file, e); String message; String path = _remoteFile.getAbsolutePath(); - if (file.isDirectory()) + if (file != null && file.isDirectory()) message = NLS.bind(Messages.notAFile, path); else message = NLS.bind(Messages.couldNotWrite, path); @@ -443,7 +442,7 @@ public class RSEFileStoreRemoteFileWrapper extends FileStore implements IFileSto } else { - if (_remoteFile.getName().equals(".project")) + if (_remoteFile.getName().equals(".project")) //$NON-NLS-1$ { file = UniversalFileTransferUtility.getTempFileFor(_remoteFile); return file.getLocation().toFile(); @@ -452,7 +451,7 @@ public class RSEFileStoreRemoteFileWrapper extends FileStore implements IFileSto { try { - return File.createTempFile(_remoteFile.getName(), "empty"); + return File.createTempFile(_remoteFile.getName(), "empty"); //$NON-NLS-1$ } catch (Exception e) { diff --git a/rse/plugins/org.eclipse.rse.eclipse.filesystem/src/org/eclipse/rse/eclipse/filesystem/RSEFileSystem.java b/rse/plugins/org.eclipse.rse.eclipse.filesystem/src/org/eclipse/rse/eclipse/filesystem/RSEFileSystem.java index f6c71a43082..5213a960b33 100644 --- a/rse/plugins/org.eclipse.rse.eclipse.filesystem/src/org/eclipse/rse/eclipse/filesystem/RSEFileSystem.java +++ b/rse/plugins/org.eclipse.rse.eclipse.filesystem/src/org/eclipse/rse/eclipse/filesystem/RSEFileSystem.java @@ -23,7 +23,6 @@ import org.eclipse.core.filesystem.EFS; import org.eclipse.core.filesystem.IFileStore; import org.eclipse.core.filesystem.provider.FileSystem; import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.rse.core.SystemBasePlugin; import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.subsystems.IConnectorService; @@ -31,8 +30,6 @@ import org.eclipse.rse.subsystems.files.core.model.RemoteFileUtility; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem; import org.eclipse.rse.ui.RSEUIPlugin; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.PlatformUI; public class RSEFileSystem extends FileSystem { @@ -106,12 +103,6 @@ public class RSEFileSystem extends FileSystem IRemoteFileSubSystem ss = store.getRemoteFileSubSystem(); if (!ss.isConnected()) { - Shell shell = null; - - if (PlatformUI.isWorkbenchRunning()) - { - shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); - } try {