mbien commented on code in PR #9208:
URL: https://github.com/apache/netbeans/pull/9208#discussion_r2820416358


##########
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:
   nevermind, I keep forgetting that `Character.toLowerCase` is implemented 
differently to `String.toLowerCase`. So `String.equalsIgnoreCase` would have 
the same result as `ROOT` locale comparison with `String.toLowerCase`.
   ```java
           Locale TR = Locale.forLanguageTag("tr");
           Locale.setDefault(TR);
   
           String ext = ".zip";
           String in = ".ZIP";
           
           System.out.println(in.equalsIgnoreCase(ext));                // true
           System.out.println(in.toLowerCase(Locale.ROOT).equals(ext)); // true
           System.out.println(in.toLowerCase().equals(ext));            // false
           System.out.println(in.toLowerCase(TR).equals(ext));          // false
   ```



-- 
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