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

JShell compilation does not take Lombok's annotation processor into account

XMLWordPrintable

    • x86_64
    • generic

      A DESCRIPTION OF THE PROBLEM :
      JShell compilation does not take Lombok's annotation processor into account (possibly this isn't specific to Lombok and annotation processing during compilation simply isn't working yet)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      * download lombok.jar: https://projectlombok.org/downloads/lombok.jar
      * launch jshell as follows: jshell "-J--class-path=./lombok.jar" "-R--class-path=./lombok.jar" "-C--class-path=./lombok.jar" "-C--processor-path=./lombok.jar"
      (note that I'd expect it to work with just: jshell "-C--class-path=./lombok.jar")
      * in jshell, enter the following line:
      @lombok.Data class Test { private String name; }
      * then type "new Test()." and press tab to see the autocompletions



      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Lombok-generated methods such as getName() are available in the list of autocompletions
      ACTUAL -
      Lombok-generated methods such as getName() are *not* available in the list of autocompletions

      CUSTOMER SUBMITTED WORKAROUND :
      compile the class externally with "javac --class-path .\lombok.jar Test.java" and put it on jshell's classpath (note that this will not work for the class as given, due to JDK-8170816, but this can be worked around by specifying a package)

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: