This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | [71cat] ClassCastException: org.netbeans.modules.cnd.utils.ui.FileChooser cannot be cast to org.netbeans.modules.remote.api.ui.FileChooserBuilder$JFileChooserEx | ||
---|---|---|---|
Product: | cnd | Reporter: | sunbiz <sunbiz> |
Component: | Remote | Assignee: | Vladimir Voskresensky <vv159170> |
Status: | VERIFIED FIXED | ||
Severity: | normal | CC: | vv159170 |
Priority: | P2 | ||
Version: | 7.1 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | 181498 |
Bug Depends on: | 203671, 203675 | ||
Bug Blocks: | |||
Attachments: |
stacktrace
stacktrace 7.0.1 proposed patch |
Description
sunbiz
2011-09-30 05:46:54 UTC
Created attachment 111335 [details]
stacktrace
Created attachment 111647 [details]
stacktrace
in services for host
Open Terminal->Other...
fixed, change set: http://hg.netbeans.org/cnd-main/rev/7d97c2698732 Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/7d97c2698732 User: Alexander Simon <alexvsimon@netbeans.org> Log: fixed Bug #202853 [71cat] ClassCastException: org.netbeans.modules.cnd.utils.ui.FileChooser cannot be cast to org.netbeans.modules.remote.api.ui.FileChooserBuilder$JFileChooserEx please, keep in lastUsedDirs locals as well to have non-null for lastUsedDirs.get(env); reworked change set: http://hg.netbeans.org/cnd-main/rev/4139546ab748 File selectedFile = fileChooser.getSelectedFile(); can return null =>FileUtil.toFileObject(selectedFile) can give NPE (In reply to comment #7) > File selectedFile = fileChooser.getSelectedFile(); can return null > =>FileUtil.toFileObject(selectedFile) can give NPE Do not agree. Try to reproduce NPE. getSelectedFile() != null after "approve" action. If you insist on checking NPE you should suggest to fix NPE in ~30 places also. Probably you mean this line: lastUsedDirs.put(env, fo.getParent().getPath()); fo.getParent() can return null ==> NPE (real, not imaginary) Reassign to author of original code to rewrite this part of code. See report http://statistics.netbeans.org/analytics/detail.do?id=181976 Too buggy code, probably best solution for patch is switch off action at all. Also see usability problem of open terminal in other folder. User going to do something in terminal. I hardly imagine that this user will select folder by file chooser. IMHO user does "cd" to needed folder in terminal. Another usability problem: - IDE support common storage for last selected folders. So file chooser invoked from any place should use previous selected folder. Open terminal in other folder violates this rule an use own storage. Why? (In reply to comment #11) > Also see usability problem of open terminal in other folder. > User going to do something in terminal. > I hardly imagine that this user will select folder by file chooser. > IMHO user does "cd" to needed folder in terminal. Agree: http://hg.netbeans.org/cnd-main/rev/72d498ee68cf Created attachment 112051 [details]
7.0.1 proposed patch
Proposed patch which removes "Other..." for terminal
Do not forget change set 48fa7a9f1ac8 from Bug #203507 patch is safe and correct. pushed on e**f as 204901:8db2af52de19 Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/4139546ab748 User: Alexander Simon <alexvsimon@netbeans.org> Log: fixed Bug #202853 [71cat] ClassCastException: org.netbeans.modules.cnd.utils.ui.FileChooser cannot be cast to org.netbeans.modules.remote.api.ui.FileChooserBuilder$JFileChooserEx verified in OSS IDE dev build #3410 (20111016) integrated into releases/release701_fixes http://hg.netbeans.org/releases/rev/8db2af52de19 Integrated into 'releases' Changeset: http://hg.netbeans.org/releases/rev/8db2af52de19 User: Vladimir Voskresensky <vv159170@netbeans.org> Log: fixed #202853 - [71cat] ClassCastException: org.netbeans.modules.cnd.utils.ui.FileChooser cannot be cast to org.netbeans.modules.remote.api.ui.FileChooserBuilder verified in Oracle Solaris Studio 12.3 (2011/10/18) build 32.0 small exception appears in messages.log if you selected Open Terminal|Remote Mirror of Local Files, but this folder doesn't exist INFO [nativeexecution.support.logger]: [181667 ms.] Error occurred: Unable to start pty process: /bin/sh[2]: cd: /home/user/.netbeans/remote/aaa/bbb-SunOS-x86_64: [No such file or directory] java.io.IOException: Unable to start pty process: /bin/sh[2]: cd: /home/user/.netbeans/remote/aaa/bbb-SunOS-x86_64: [No such file or directory] at org.netbeans.modules.nativeexecution.PtyNativeProcess.create(PtyNativeProcess.java:184) [catch] at org.netbeans.modules.nativeexecution.AbstractNativeProcess.createAndStart(AbstractNativeProcess.java:152) at org.netbeans.modules.nativeexecution.api.NativeProcessBuilder.call(NativeProcessBuilder.java:233) |