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

Various typos in the Java Tutorial

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • None
    • None
    • docs
    • None

      http://docs.oracle.com/javase/tutorial/reflect/member/ctorInstance.html

      The Console character set is stored in an private field

      an => a

      https://docs.oracle.com/javase/tutorial/java/annotations/predefined.html

      The compiler generates a warning whenever a program uses a method, class, or field with the @Deprecated annotation

      JLS, https://docs.oracle.com/javase/specs/jls/se8/html/jls-9.html#jls-9.6.4.6

      A Java compiler must produce a deprecation warning when a type, method, field, or constructor whose declaration is annotated with @Deprecated is used (overridden, invoked, or referenced by name) in a construct which is explicitly or implicitly declared, unless:

      ElementType.TYPE can be applied to any element of a class.

      (This is too vague)

      JLS: https://docs.oracle.com/javase/specs/jls/se8/html/jls-9.html#jls-9.6.4.1

      Type declarations: class, interface, enum, and annotation type declarations (§8.1.1, §9.1.1, §8.5, §9.5, §8.9, §9.6)

      Corresponds to java.lang.annotation.ElementType.TYPE

      Javadoc: https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/ElementType.html#TYPE

      Class, interface (including annotation type), or enum declaration
      Additionally, annotation type declarations correspond to java.lang.annotation.ElementType.ANNOTATION_TYPE

      https://docs.oracle.com/javase/tutorial/java/annotations/QandE/questions.html

      public @interface Meal { ... }

      @Meal("breakfast", mainDish="cereal")
      @Meal("lunch", mainDish="pizza")
      @Meal("dinner", mainDish="salad")
      public void evaluateDiet() { ... }

      https://docs.oracle.com/javase/tutorial/java/annotations/QandE/answers.html

      @java.lang.annotation.Repeatable(MealContainer.class)
      public @interface Meal { ... }

      public @interface MealContainer {
          Meal[] value();
      }

      This doesn't compile. This does:

      public class AnnotationTest {

          public @interface MealContainer {
              Meal[] value();
          }

          @java.lang.annotation.Repeatable(MealContainer.class)
          Public @interface Meal {
              String value();
              String mainDish();
          }

          @Meal(value="breakfast", mainDish="cereal")
          @Meal(value="lunch", mainDish="pizza")
          @Meal(value="dinner", mainDish="salad")
          public void evaluateDiet() { }
      }

      https://docs.oracle.com/javase/tutorial/jdbc/basics/sqldatasources.html

      The system administrator creates create an

      (duplicated word)


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

              Created:
              Updated:
              Resolved: