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

Javadoc says nothing about java.util.Locale.getDisplayName(null)

    Details

    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_2.5

      Description



      Name: dfC67450 Date: 08/19/98



      Javadoc says nothing about behaviour of
      java.util.Locale.getDisplayName(Locale inLocale) in case of inLocale == null.
      This behaviour is changed from jdk1.2Beta4K to jdk1.2fcs.

      Here is the test demonstrating the bug:

      -----------------Test.java------------------------
      import java.util.*;

      public class Test {

        public static void main(String args[]) {

          Locale locale = new Locale("", "", "");
          System.out.println("getDisplayName(null): \"" +
                                locale.getDisplayName(null) + "\"");
       }
          
      }
      ---------Output from the test (JDK1.2-Beta4K) ---------------------
      #> java -version
      java version "1.2beta4"
      Classic VM (build JDK-1.2beta4-K, green threads, sunwjit)
      #> java Test
      getDisplayName(null): ""
      ---------Output from the test (JDK1.2fcs) ---------------------
      #> java -version
      java version "1.2fcs"
      Classic VM (build JDK-1.2fcs-F, green threads, sunwjit)
      #> java Test
      Exception in thread "main" java.lang.NullPointerException
              at java.util.ResourceBundle.getBundle(Compiled Code)
              at java.util.ResourceBundle.getBundle(Compiled Code)
              at java.util.Locale.getDisplayName(Compiled Code)
              at Test.main(Compiled Code)
      -------------------------------------------------



      ======================================================================

      I'm reassigning this to Alan Liu at Mark Son-Bell's suggestion.


      dale.green@eng 1998-09-02

        Attachments

          Activity

            People

            • Assignee:
              aliusunw Alan Liu (Inactive)
              Reporter:
              dfazunensunw Dmitri Fazunenko (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: