Community
Participate
Working Groups
Not sure how and why, but Uwe found this NPE in his Log: !ENTRY org.eclipse.rse.ui 4 0 2007-09-04 18:58:12.443 !MESSAGE Exception resolving filters' strings !STACK 0 java.lang.NullPointerException at org.eclipse.rse.internal.services.ssh.files.SftpFileService.getUserHome(SftpFileService.java:576) at org.eclipse.rse.subsystems.files.core.servicesubsystem.FileServiceSubSystem.getUserHome(FileServiceSubSystem.java:263) at org.eclipse.rse.subsystems.files.core.servicesubsystem.FileServiceSubSystem.getRemoteFileObject(FileServiceSubSystem.java:186) at org.eclipse.rse.subsystems.files.core.subsystems.RemoteFileSubSystem.internalResolveFilterString(RemoteFileSubSystem.java:624) at org.eclipse.rse.subsystems.files.core.subsystems.RemoteFileSubSystem.internalResolveFilterStrings(RemoteFileSubSystem.java:451) at org.eclipse.rse.core.subsystems.SubSystem.resolveFilterStrings(SubSystem.java:2067) at org.eclipse.rse.internal.ui.view.SystemViewFilterReferenceAdapter.internalGetChildren(SystemViewFilterReferenceAdapter.java:416) at org.eclipse.rse.internal.ui.view.SystemViewFilterReferenceAdapter.getChildren(SystemViewFilterReferenceAdapter.java:257) at org.eclipse.rse.internal.ui.view.SystemViewFilterReferenceAdapter.getChildren(SystemViewFilterReferenceAdapter.java:265) at org.eclipse.rse.ui.operations.SystemFetchOperation.execute(SystemFetchOperation.java:265) at org.eclipse.rse.ui.operations.SystemFetchOperation.run(SystemFetchOperation.java:128) at org.eclipse.rse.ui.view.AbstractSystemViewAdapter.fetchDeferredChildren(AbstractSystemViewAdapter.java:1970) at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:196) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) -----------Enter bugs above this line----------- TM 2.0.1 Testing installation : eclipse-SDK-3.3-linux-gtk-x86_64, emf-sdo-xsd-SDK-2.3.0 Download RSE-2.0.1RC1: RSE-SDK,examples,tests,discovery,terminal java.runtime : Sun 1.5.0_12-b04 64-bit Server VM, mixed mode os.name: : OpenSUSE 10.2 64-bit uname : Linux osgiliath 2.6.18.8-0.5-default x86_64 GNU/Linux ------------------------------------------------ systemtype : Linux-local / Unix-dstore (RExec) / FTP / Ssh targetos1 : Linux RHEL4, Sun 1.5.0_11 targetos2 : Windows XP SP1, Sun 1.4.2_13 targetos3 : Solaris-sparc 5.9, Sun 1.4.2_05 targetuname : SunOS szg-anar 5.9 Generic_118558-06 sun4u sparc SUNW,Sun-Blade-1500 ------------------------------------------------
Created attachment 78471 [details] Patch fixing the issue Attached patch fixes the issue.
The fix is simple, though I'm not sure why fUserHome is null here -- perhaps pwd() returned null for the given connection. Anyways, returning the root folder in that case seems the right thing to do. DaveM can you please review this?
I'm not sure why pwd would have returned null but at least this resolves the issue.
Patch committed.
Original patch was not good because if user chose "Refresh" on the "My Home" filter while not connected, the fallback (home=="/") would be activated and not changed later. Users would not get access to their real home directory. As per bug 204710, it is better to return null in case we are not yet connected.
Created attachment 79228 [details] New patch (overriding the old one) Attached new patch fixes the issue properly for both Sftp and FTP, and also makes a minor performance improvement to SftpFileService by marking the inner classes used for Streams "static". Dave can you please review this?
The fix looks good. I ran the following scenarios: Create ssh connection. Before connect, refresh the My Home filter. Then expand the My Home filter. Got logon dialog. Logon. My home directory displayed correctly. Repeat it for FTP connection. Things are fine too.
Patch committed: [203490] Fix NPE in SftpService.getUserHome() SftpFileService 1.21 FTPService 1.39