neilcsmith-net commented on code in PR #9208:
URL: https://github.com/apache/netbeans/pull/9208#discussion_r2816316247


##########
ide/projectui/src/org/netbeans/modules/project/ui/zip/ExportZIP.java:
##########
@@ -477,7 +477,11 @@ public void actionPerformed(java.awt.event.ActionEvent 
evt) {
     private void zipButtonActionPerformed(java.awt.event.ActionEvent evt) 
{//GEN-FIRST:event_zipButtonActionPerformed
         JFileChooser fc = new JFileChooser();
         if (fc.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) {
-            zipField.setText(fc.getSelectedFile().getAbsolutePath());
+            String sf = fc.getSelectedFile().getAbsolutePath();
+            if(!sf.toLowerCase().endsWith(".zip")) {
+              sf += ".zip";
+            }

Review Comment:
   I always get slightly itchy when I see `toLowerCase()` without a `Locale`!  
Check the Javadoc - this should likely be `toLowerCase(Locale.ROOT)`.
   
   Anyway, this check might also be better using `FileUtil::getExtension` with 
`String::equalsIgnoreCase`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to