Don't call deprecated FileUtil::preventFileChooserSymlinkTraversal#9217
Conversation
matthiasblaesing
left a comment
There was a problem hiding this comment.
I started looking through this and in many places the call to setCurrentDirectory is redundant. Redundant in this case means, that it is either implicitly set as a side effect of setSelectedFile or explicitly by invocations of setCurrentDirectory.
While it is good to remove the call to the "magic function" (preventFileChooserSymlinkTraversal), we get multiple calls to functions that do the same thing.
This is not a blocker, but I noticed it. The replacements themselfes look sane to me.
contrib/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/customizer/CustomizerSupport.java
Outdated
Show resolved
Hide resolved
...vc.wsitconf/src/org/netbeans/modules/websvc/wsitconf/ui/service/subpanels/KeystorePanel.java
Outdated
Show resolved
Hide resolved
....wsitconf/src/org/netbeans/modules/websvc/wsitconf/ui/service/subpanels/TruststorePanel.java
Outdated
Show resolved
Hide resolved
...clientproject/src/org/netbeans/modules/j2ee/clientproject/ui/wizards/PanelSourceFolders.java
Outdated
Show resolved
Hide resolved
...clientproject/src/org/netbeans/modules/j2ee/clientproject/ui/wizards/PanelSourceFolders.java
Outdated
Show resolved
Hide resolved
...bjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/ui/customizer/CustomizerSources.java
Outdated
Show resolved
Hide resolved
...ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/ui/wizards/PanelSourceFolders.java
Outdated
Show resolved
Hide resolved
...ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/ui/wizards/PanelSourceFolders.java
Outdated
Show resolved
Hide resolved
...server/src/org/netbeans/modules/j2ee/deployment/impl/sharability/ServerVolumeCustomizer.java
Outdated
Show resolved
Hide resolved
|
will do another pass since all sequences of: JFileChooser chooser = new JFileChooser();
chooser.setCurrentDirectory(null);are already redundant, since the user dir is the |
14dffa1 to
346e178
Compare
Method is non-functional since java 6 and can be inlined as simple JFileChooser::setCurrentDirectory call, most can be removed since the default dir after construction is the user dir already. One usage was within a template file. Reduces warning noise.
|
using this PR to test if the PR label queries via the workflow expression language still work after #9227. Just a quick rebase. edit: it worked |
346e178 to
500b47c
Compare
|
@matthiasblaesing ok to merge? I simplified it a bit by removing most of the calls entirely. |
matthiasblaesing
left a comment
There was a problem hiding this comment.
Eyeballed this and looks sane to me.
Method is non-functional since java 6 and can be inlined as simple
JFileChooser::setCurrentDirectorycall. A code template used it too.Reduces warning noise.