Don't call deprecated FileUtil::preventFileChooserSymlinkTraversal#9217
Open
mbien wants to merge 1 commit intoapache:masterfrom
Open
Don't call deprecated FileUtil::preventFileChooserSymlinkTraversal#9217mbien wants to merge 1 commit intoapache:masterfrom
mbien wants to merge 1 commit intoapache:masterfrom
Conversation
Contributor
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
Member
Author
|
will do another pass since all sequences of: JFileChooser chooser = new JFileChooser();
chooser.setCurrentDirectory(null);are already redundant, since the user dir is the |
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.
14dffa1 to
346e178
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Method is non-functional since java 6 and can be inlined as simple
JFileChooser::setCurrentDirectorycall. A code template used it too.Reduces warning noise.