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

Remove references to Date and Calendar from Lambda samples

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • None
    • 8
    • docs

      From a comment regarding the Java Tutorials:

      Subject: bad returned value from get(Calendar.MONTH)
      Date: Sun, 30 Jun 2013 17:10:18 +0200

      Hello,

      I'm learning java today from

      http://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html

      and I have problem with age of Fred from RosterTest.java

      http://docs.oracle.com/javase/tutorial/displayCode.html?code=http://docs.oracle.com/javase/tutorial/java/javaOO/examples/RosterTest.java

      Returned value from method

      today.get(Calendar.MONTH)

      is 5 and today is June.

      // used in Member class
      http://docs.oracle.com/javase/tutorial/displayCode.html?code=http://docs.oracle.com/javase/tutorial/java/javaOO/examples/Member.java

      According to Sharon, the Date and Calendar classes are being obsoleted in JDK8. It might be best to either change the example to use the new Date-Time APIs or to use something else altogether.

            rgallard Raymond Gallardo
            rgallard Raymond Gallardo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: