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

NullPointerException @ com.sun.tools.javac.comp.Check$1AnnotationValidator.visitAnnotation(Check.java:2657)

XMLWordPrintable

    • x86_64
    • linux

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


      ADDITIONAL OS VERSION INFORMATION :
      Linux jpc-System-Product-Name 3.13.0-77-generic #121-Ubuntu SMP Wed Jan 20 10:50:42 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

      A DESCRIPTION OF THE PROBLEM :
      This error, forgetting the brackets, will crash the compiler:

      @Table(name = "customers", catalog = "pluto", uniqueConstraints = @UniqueConstraint(columnNames = { "run_id" }))
      @NamedQueries(
              @NamedQuery(name = "customer.findByIds", query = "select c from Customer c where c.id in :ids"),
              @NamedQuery(name = "customer.findAllIds", query = "select c.id from Customer c order by c.clientName")
      )

      This correct version is ok:
      @Table(name = "customers", catalog = "pluto", uniqueConstraints = @UniqueConstraint(columnNames = { "run_id" }))
      @NamedQueries({
              @NamedQuery(name = "customer.findByIds", query = "select c from Customer c where c.id in :ids"),
              @NamedQuery(name = "customer.findAllIds", query = "select c.id from Customer c order by c.clientName")
      })


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      compile

      ACTUAL -
      compiler crash

      REPRODUCIBILITY :
      This bug can be reproduced always.

            aroy Abhijit Roy (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: