Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8160540

[macosx] file chooser removing from end of filename

XMLWordPrintable

      FULL PRODUCT VERSION :
      java version "1.8.0_92"
      Java(TM) SE Runtime Environment (build 1.8.0_92-b14)
      Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Darwin johns-air.loctest.gov 13.4.0 Darwin Kernel Version 13.4.0: Mon Jan 11 18:17:34 PST 2016; root:xnu-2422.115.15~1/RELEASE_X86_64 x86_64

      A DESCRIPTION OF THE PROBLEM :
      The BasicFileChooserUI's inner class ApproveSelectionAction incorrectly strips off a \r from the end of a filename choosen. This is problematic since Mac OS files can sometimes have \r on the end of the filename created by the OS itself.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1) create a file with a \r on the end in bash command line
      touch "Icon^M"
      2) create a java program that uses BasicFileChooserUI
      3) select the Icon^M file


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The BasicFileChooserUI does not try to modify the filename
      ACTUAL -
      The filename gets truncated to Icon

      REPRODUCIBILITY :
      This bug can be reproduced always.

            aniyogi Avik Niyogi (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: