Very spicy additions to the Java programming language.

Related tags

Spring Boot lombok
Overview

Project Lombok

Project Lombok is a java library that automatically plugs into your editor and build tools, spicing up your java. Never write another getter or equals method again, with one annotation your class has a fully featured builder, automate your logging variables, and much more.

See LICENSE for the Project Lombok license.

Looking for professional support of Project Lombok? Lombok is now part of a tidelift subscription!

For a list of all authors, see the AUTHORS file.

For complete project information, see projectlombok.org

You can review our security policy via SECURITY.md

Comments
  • Add jdk9 compiler support

    Add jdk9 compiler support

    Status (Updated 2018-01-09)

    • Given the right amount of --add-opens parameters, we can compile code that contains lombok annotations on build 9.0.1+11
    • 1.16.20 supports jdk9, gradle 4.2.1, maven 3.5.0 (example pom)
    • module-info.java is not present for lombok, so far lombok can only be used on the classpath, It's uncertain if you can compile modules.
    • @javax.annotation.Generated will no longer be generated by default, see below
    • We didn't even look at ecj/Eclipse support. It might just work, it might not
    • We will probably run into problems with classes compiled with jdk9 that have new contant pool entries. We will need to fix ClassFileMetaData

    Most recent information (Based on build 9.0.1+11)

    module jdk.compiler does not "opens com.sun.tools.javac.processing" to unnamed module @6b927fb

    Lombok uses non-exposed APIs. We need to instruct the jvm that that's okay.

    javac \
    -J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \
    -J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED \
    -J--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
    -J--add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED \
    -J--add-opens=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED \
    -J--add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
    -J--add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED \
    -J--add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
    -J--add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
    -cp lombok.jar \
    Test.java
    

    According to this mail by Mark Reinhold we can replace all the --add-opens clauses by --permit-illegal-access in a future version of jdk9. However, that will generate warnings on the stderr. Using --add-opens does not.

    package javax.annotation is not visible

    Since 1.16.20, this message will only occur if your explicitly turned it on in lombok.config using lombok.addJavaxGeneratedAnnotation = true.

    If specified, lombok adds @javax.annotation.Generated("lombok") to all generated methods.

    Since the new module system, this annotation is no longer standard available.

    There are two ways to fix this:

    1. Remove the following line from your project lombok.config file:

       lombok.addJavaxGeneratedAnnotation = true
      
    2. Add --add-modules=java.xml.ws.annotation to your javac command line parameters.

    This description will be updated if more information is available.

    opened by rspilker 98
  • [FEATURE] Make Lombok compatible with JDK 16

    [FEATURE] Make Lombok compatible with JDK 16

    After JDK 16 has started the rampdown phase, we could not get Lombok working any more.

    The exception reported by Maven compiler is:

    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile)
    on project syncope-wa-starter: Fatal error compiling: java.lang.IllegalAccessError: 
    class lombok.javac.apt.LombokProcessor (in unnamed module @0x3af91e7e) cannot access class
    com.sun.tools.javac.processing.JavacProcessingEnvironment (in module jdk.compiler) because module jdk.compiler
    does not export com.sun.tools.javac.processing to unnamed module @0x3af91e7e -> [Help 1]
    

    No issues with earlier JDK 16 releases.

    opened by ilgrosso 94
  • Lombok fails with JDK 10

    Lombok fails with JDK 10

    EDIT: See https://github.com/rzwitserloot/lombok/issues/1572#issuecomment-363417248 for minimal example

    I tried to build a project with JDK 10, so we could make lombok work with it sooner than it was with JDK 9. (the build works with JDK 9, so changed compiler to JDK 10)

    lombok 1.6.20

    Maven version:

    Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T09:58:13+02:00)
    Maven home: /opt/apache-maven-3.5.2
    Java version: 10-ea, vendor: Oracle Corporation
    Java home: /opt/jdk-10
    Default locale: en_DK, platform encoding: UTF-8
    OS name: "linux", version: "4.14.14", arch: "amd64", family: "unix"
    

    Java version:

    java 10-ea 2018-03-20
    Java(TM) SE Runtime Environment 18.3 (build 10-ea+42)
    Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10-ea+42, mixed mode)
    
    ...
                <plugin>                                                            
                    <artifactId>maven-compiler-plugin</artifactId>                  
                    <version>3.7.0</version>                                        
                    <configuration>                                                 
                        <source>10</source>                                         
                        <target>10</target>                                                     
                        <compilerArgs>                                              
                            <arg>-Xlint:all,-processing,-cast,-serial,-try</arg>                                                    
                        </compilerArgs>                                             
                        <showWarnings>true</showWarnings>                           
                        <showDeprecation>true</showDeprecation>                     
                    </configuration>                                                
                </plugin>                                                           
    ...
    

    And the maven build fails with:

    [INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ manager-api ---
    [INFO] Changes detected - recompiling the module!
    [INFO] Compiling 214 source files to /home/target/classes
    WARNING: An illegal reflective access operation has occurred
    WARNING: Illegal reflective access by lombok.javac.apt.LombokProcessor to field com.sun.tools.javac.processing.JavacProcessingEnvironment.discoveredProcs
    WARNING: Please consider reporting this to the maintainers of lombok.javac.apt.LombokProcessor
    WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
    WARNING: All illegal access operations will be denied in a future release
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 5.265 s
    [INFO] Finished at: 2018-02-05T10:16:24+01:00
    [INFO] Final Memory: 54M/197M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project manager-api: Fatal error compiling: java.lang.ExceptionInInitializerError: com.sun.tools.javac.code.TypeTags -> [Help 1]
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project manager-api: Fatal error compiling
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
        at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
        at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
        at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
        at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke (Method.java:564)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
    Caused by: org.apache.maven.plugin.MojoExecutionException: Fatal error compiling
        at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1086)
        at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:168)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
        at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
        at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
        at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
        at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke (Method.java:564)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
    Caused by: org.codehaus.plexus.compiler.CompilerException: java.lang.ExceptionInInitializerError
        at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess (JavaxToolsCompiler.java:173)
        at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile (JavacCompiler.java:174)
        at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1075)
        at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:168)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
        at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
        at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
        at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
        at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke (Method.java:564)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
    Caused by: java.lang.RuntimeException: java.lang.ExceptionInInitializerError
        at com.sun.tools.javac.api.JavacTaskImpl.handleExceptions (JavacTaskImpl.java:158)
        at com.sun.tools.javac.api.JavacTaskImpl.doCall (JavacTaskImpl.java:96)
        at com.sun.tools.javac.api.JavacTaskImpl.call (JavacTaskImpl.java:90)
        at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess (JavaxToolsCompiler.java:126)
        at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile (JavacCompiler.java:174)
        at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1075)
        at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:168)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
        at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
        at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
        at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
        at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke (Method.java:564)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
    Caused by: java.lang.ExceptionInInitializerError
        at lombok.javac.handlers.HandleGetter.<clinit> (HandleGetter.java:303)
        at java.lang.Class.forName0 (Native Method)
        at java.lang.Class.forName (Class.java:374)
        at lombok.core.SpiLoadUtil$1$1.next (SpiLoadUtil.java:111)
        at lombok.javac.HandlerLibrary.loadAnnotationHandlers (HandlerLibrary.java:171)
        at lombok.javac.HandlerLibrary.load (HandlerLibrary.java:156)
        at lombok.javac.JavacTransformer.<init> (JavacTransformer.java:44)
        at lombok.javac.apt.LombokProcessor.init (LombokProcessor.java:89)
        at lombok.core.AnnotationProcessor$JavacDescriptor.want (AnnotationProcessor.java:87)
        at lombok.core.AnnotationProcessor.init (AnnotationProcessor.java:140)
        at lombok.launch.AnnotationProcessorHider$AnnotationProcessor.init (AnnotationProcessor.java:69)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment$ProcessorState.<init> (JavacProcessingEnvironment.java:674)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors$ProcessorStateIterator.next (JavacProcessingEnvironment.java:771)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs (JavacProcessingEnvironment.java:866)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$2100 (JavacProcessingEnvironment.java:110)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run (JavacProcessingEnvironment.java:1202)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing (JavacProcessingEnvironment.java:1311)
        at com.sun.tools.javac.main.JavaCompiler.processAnnotations (JavaCompiler.java:1250)
        at com.sun.tools.javac.main.JavaCompiler.compile (JavaCompiler.java:928)
        at com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0 (JavacTaskImpl.java:100)
        at com.sun.tools.javac.api.JavacTaskImpl.handleExceptions (JavacTaskImpl.java:142)
        at com.sun.tools.javac.api.JavacTaskImpl.doCall (JavacTaskImpl.java:96)
        at com.sun.tools.javac.api.JavacTaskImpl.call (JavacTaskImpl.java:90)
        at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess (JavaxToolsCompiler.java:126)
        at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile (JavacCompiler.java:174)
        at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1075)
        at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:168)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
        at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
        at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
        at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
        at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke (Method.java:564)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
    Caused by: java.lang.ClassNotFoundException: com.sun.tools.javac.code.TypeTags
        at java.lang.ClassLoader.findClass (ClassLoader.java:711)
        at java.lang.ClassLoader.loadClass (ClassLoader.java:566)
        at lombok.launch.ShadowClassLoader.loadClass (ShadowClassLoader.java:422)
        at java.lang.ClassLoader.loadClass (ClassLoader.java:499)
        at java.lang.Class.forName0 (Native Method)
        at java.lang.Class.forName (Class.java:291)
        at lombok.javac.JavacTreeMaker$SchroedingerType.getFieldCached (JavacTreeMaker.java:156)
        at lombok.javac.JavacTreeMaker$TypeTag.typeTag (JavacTreeMaker.java:245)
        at lombok.javac.Javac.<clinit> (Javac.java:155)
        at lombok.javac.handlers.HandleGetter.<clinit> (HandleGetter.java:303)
        at java.lang.Class.forName0 (Native Method)
        at java.lang.Class.forName (Class.java:374)
        at lombok.core.SpiLoadUtil$1$1.next (SpiLoadUtil.java:111)
        at lombok.javac.HandlerLibrary.loadAnnotationHandlers (HandlerLibrary.java:171)
        at lombok.javac.HandlerLibrary.load (HandlerLibrary.java:156)
        at lombok.javac.JavacTransformer.<init> (JavacTransformer.java:44)
        at lombok.javac.apt.LombokProcessor.init (LombokProcessor.java:89)
        at lombok.core.AnnotationProcessor$JavacDescriptor.want (AnnotationProcessor.java:87)
        at lombok.core.AnnotationProcessor.init (AnnotationProcessor.java:140)
        at lombok.launch.AnnotationProcessorHider$AnnotationProcessor.init (AnnotationProcessor.java:69)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment$ProcessorState.<init> (JavacProcessingEnvironment.java:674)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors$ProcessorStateIterator.next (JavacProcessingEnvironment.java:771)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs (JavacProcessingEnvironment.java:866)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$2100 (JavacProcessingEnvironment.java:110)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run (JavacProcessingEnvironment.java:1202)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing (JavacProcessingEnvironment.java:1311)
        at com.sun.tools.javac.main.JavaCompiler.processAnnotations (JavaCompiler.java:1250)
        at com.sun.tools.javac.main.JavaCompiler.compile (JavaCompiler.java:928)
        at com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0 (JavacTaskImpl.java:100)
        at com.sun.tools.javac.api.JavacTaskImpl.handleExceptions (JavacTaskImpl.java:142)
        at com.sun.tools.javac.api.JavacTaskImpl.doCall (JavacTaskImpl.java:96)
        at com.sun.tools.javac.api.JavacTaskImpl.call (JavacTaskImpl.java:90)
        at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess (JavaxToolsCompiler.java:126)
        at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile (JavacCompiler.java:174)
        at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1075)
        at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:168)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
        at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
        at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
        at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
        at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke (Method.java:564)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
    
    
    opened by krzyk 88
  • Working with lombok and eclipse cleanup fails:

    Working with lombok and eclipse cleanup fails: "A save participant caused problems."

    I am using lombok 1.16.4. I can narrow down the issue to lombok. As soon as I add @Data to the class to get the getters/setters generated by lombok my eclipse cleanup is failing with the error dialog:

    The file has been saved but one of the save actions failed.
    Reason: A save participant caused problems.
    If the problem persists disable the failing participants on the Save Actions property page.
    

    And this is in the log everytime the error occurs:

    !MESSAGE The save participant 'org.eclipse.jdt.ui.postsavelistener.cleanup' caused an exception: org.eclipse.text.edits.MalformedTreeException: Overlapping text edits
    !STACK 0
    org.eclipse.text.edits.MalformedTreeException: Overlapping text edits
        at org.eclipse.text.edits.TextEdit$InsertionComparator.compare(TextEdit.java:121)
        at java.util.Collections.indexedBinarySearch(Collections.java:332)
        at java.util.Collections.binarySearch(Collections.java:320)
        at org.eclipse.text.edits.TextEdit.computeInsertionIndex(TextEdit.java:796)
        at org.eclipse.text.edits.TextEdit.internalAdd(TextEdit.java:781)
        at org.eclipse.text.edits.TextEdit.addChild(TextEdit.java:335)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.addEdit(ASTRewriteAnalyzer.java:326)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.doCopySourcePreVisit(ASTRewriteAnalyzer.java:1636)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.preVisit(ASTRewriteAnalyzer.java:1615)
        at org.eclipse.jdt.core.dom.ASTVisitor.preVisit2(ASTVisitor.java:167)
        at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2709)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.voidVisit(ASTRewriteAnalyzer.java:429)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.voidVisit(ASTRewriteAnalyzer.java:435)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.doVisitUnchangedChildren(ASTRewriteAnalyzer.java:450)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.visit(ASTRewriteAnalyzer.java:2813)
        at org.eclipse.jdt.core.dom.InfixExpression.accept0(InfixExpression.java:365)
        at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.voidVisit(ASTRewriteAnalyzer.java:429)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.voidVisit(ASTRewriteAnalyzer.java:435)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.doVisitUnchangedChildren(ASTRewriteAnalyzer.java:450)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.visit(ASTRewriteAnalyzer.java:2372)
        at org.eclipse.jdt.core.dom.Assignment.accept0(Assignment.java:309)
        at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.voidVisit(ASTRewriteAnalyzer.java:429)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.voidVisit(ASTRewriteAnalyzer.java:435)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.doVisitUnchangedChildren(ASTRewriteAnalyzer.java:450)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.visit(ASTRewriteAnalyzer.java:2621)
        at org.eclipse.jdt.core.dom.ExpressionStatement.accept0(ExpressionStatement.java:143)
        at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.doVisit(ASTRewriteAnalyzer.java:405)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.voidVisitList(ASTRewriteAnalyzer.java:443)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.voidVisit(ASTRewriteAnalyzer.java:437)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.doVisitUnchangedChildren(ASTRewriteAnalyzer.java:450)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.visit(ASTRewriteAnalyzer.java:2044)
        at org.eclipse.jdt.core.dom.Block.accept0(Block.java:135)
        at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.voidVisit(ASTRewriteAnalyzer.java:429)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.voidVisit(ASTRewriteAnalyzer.java:435)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.doVisitUnchangedChildren(ASTRewriteAnalyzer.java:450)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.visit(ASTRewriteAnalyzer.java:1985)
        at org.eclipse.jdt.core.dom.MethodDeclaration.accept0(MethodDeclaration.java:611)
        at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
        at org.eclipse.jdt.core.dom.rewrite.ASTRewrite.internalRewriteAST(ASTRewrite.java:297)
        at org.eclipse.jdt.core.dom.rewrite.ASTRewrite.rewriteAST(ASTRewrite.java:286)
        at org.eclipse.jdt.internal.corext.refactoring.structure.CompilationUnitRewrite.attachChange(CompilationUnitRewrite.java:278)
        at org.eclipse.jdt.internal.corext.refactoring.structure.CompilationUnitRewrite.createChange(CompilationUnitRewrite.java:241)
        at org.eclipse.jdt.internal.corext.fix.CompilationUnitRewriteOperationsFix.createChange(CompilationUnitRewriteOperationsFix.java:104)
        at org.eclipse.jdt.internal.corext.fix.CleanUpRefactoring.calculateChange(CleanUpRefactoring.java:816)
        at org.eclipse.jdt.internal.corext.fix.CleanUpPostSaveListener.saved(CleanUpPostSaveListener.java:396)
        at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider$5.run(CompilationUnitDocumentProvider.java:1598)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider.notifyPostSaveListeners(CompilationUnitDocumentProvider.java:1593)
        at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider.commitWorkingCopy(CompilationUnitDocumentProvider.java:1380)
        at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider$4.execute(CompilationUnitDocumentProvider.java:1458)
        at org.eclipse.ui.editors.text.TextFileDocumentProvider$DocumentProviderOperation.run(TextFileDocumentProvider.java:132)
        at org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation.execute(WorkspaceModifyDelegatingOperation.java:69)
        at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106)
        at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313)
        at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118)
        at org.eclipse.ui.internal.editors.text.WorkspaceOperationRunner.run(WorkspaceOperationRunner.java:75)
        at org.eclipse.ui.internal.editors.text.WorkspaceOperationRunner.run(WorkspaceOperationRunner.java:65)
        at org.eclipse.ui.editors.text.TextFileDocumentProvider.executeOperation(TextFileDocumentProvider.java:456)
        at org.eclipse.ui.editors.text.TextFileDocumentProvider.saveDocument(TextFileDocumentProvider.java:772)
        at org.eclipse.ui.texteditor.AbstractTextEditor.performSave(AbstractTextEditor.java:5076)
        at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.performSave(CompilationUnitEditor.java:1247)
        at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.doSave(CompilationUnitEditor.java:1301)
        at org.eclipse.ui.texteditor.AbstractTextEditor$TextEditorSavable.doSave(AbstractTextEditor.java:7209)
        at org.eclipse.ui.Saveable.doSave(Saveable.java:216)
        at org.eclipse.ui.internal.SaveableHelper.doSaveModel(SaveableHelper.java:355)
        at org.eclipse.ui.internal.SaveableHelper$3.run(SaveableHelper.java:199)
        at org.eclipse.ui.internal.SaveableHelper$5.run(SaveableHelper.java:283)
        at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:466)
        at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:374)
        at org.eclipse.ui.internal.WorkbenchWindow$13.run(WorkbenchWindow.java:2157)
        at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
        at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2153)
        at org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOperation(SaveableHelper.java:291)
        at org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOperation(SaveableHelper.java:269)
        at org.eclipse.ui.internal.SaveableHelper.saveModels(SaveableHelper.java:211)
        at org.eclipse.ui.internal.SaveableHelper.savePart(SaveableHelper.java:146)
        at org.eclipse.ui.internal.WorkbenchPage.saveSaveable(WorkbenchPage.java:3915)
        at org.eclipse.ui.internal.WorkbenchPage.saveEditor(WorkbenchPage.java:3929)
        at org.eclipse.ui.internal.handlers.SaveHandler.execute(SaveHandler.java:54)
        at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:294)
        at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90)
        at sun.reflect.GeneratedMethodAccessor123.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
        at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:247)
        at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:229)
        at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
        at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:149)
        at org.eclipse.core.commands.Command.executeWithChecks(Command.java:499)
        at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
        at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
        at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(KeyBindingDispatcher.java:286)
        at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.press(KeyBindingDispatcher.java:507)
        at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.processKeyEvent(KeyBindingDispatcher.java:558)
        at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.filterKeySequenceBindings(KeyBindingDispatcher.java:378)
        at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.access$0(KeyBindingDispatcher.java:324)
        at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher$KeyDownFilter.handleEvent(KeyBindingDispatcher.java:86)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
        at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1574)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1387)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1412)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1397)
        at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1424)
        at org.eclipse.swt.widgets.Widget.gtk_key_press_event(Widget.java:824)
        at org.eclipse.swt.widgets.Control.gtk_key_press_event(Control.java:3293)
        at org.eclipse.swt.widgets.Composite.gtk_key_press_event(Composite.java:769)
        at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:2098)
        at org.eclipse.swt.widgets.Control.windowProc(Control.java:5534)
        at org.eclipse.swt.widgets.Display.windowProc(Display.java:4668)
        at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method)
        at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:9106)
        at org.eclipse.swt.widgets.Display.eventProc(Display.java:1253)
        at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
        at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:2477)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3407)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
        at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
        at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
        at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
        at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
    

    This message is sometimes added in the log:

    !MESSAGE The save participant 'org.eclipse.jdt.ui.postsavelistener.cleanup' caused an exception: org.eclipse.text.edits.MalformedTreeException: Overlapping text edits
    !STACK 0
    org.eclipse.text.edits.MalformedTreeException: Overlapping text edits
        at org.eclipse.text.edits.TextEdit$InsertionComparator.compare(TextEdit.java:121)
        at java.util.Collections.indexedBinarySearch(Collections.java:332)
        at java.util.Collections.binarySearch(Collections.java:320)
        at org.eclipse.text.edits.TextEdit.computeInsertionIndex(TextEdit.java:796)
        at org.eclipse.text.edits.TextEdit.internalAdd(TextEdit.java:781)
        at org.eclipse.text.edits.TextEdit.addChild(TextEdit.java:335)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.addEdit(ASTRewriteAnalyzer.java:326)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.doCopySourcePreVisit(ASTRewriteAnalyzer.java:1636)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.preVisit(ASTRewriteAnalyzer.java:1615)
        at org.eclipse.jdt.core.dom.ASTVisitor.preVisit2(ASTVisitor.java:167)
        at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2709)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.voidVisit(ASTRewriteAnalyzer.java:429)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.voidVisit(ASTRewriteAnalyzer.java:435)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.doVisitUnchangedChildren(ASTRewriteAnalyzer.java:450)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.visit(ASTRewriteAnalyzer.java:2813)
        at org.eclipse.jdt.core.dom.InfixExpression.accept0(InfixExpression.java:365)
        at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.voidVisit(ASTRewriteAnalyzer.java:429)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.voidVisit(ASTRewriteAnalyzer.java:435)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.doVisitUnchangedChildren(ASTRewriteAnalyzer.java:450)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.visit(ASTRewriteAnalyzer.java:2372)
        at org.eclipse.jdt.core.dom.Assignment.accept0(Assignment.java:309)
        at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.voidVisit(ASTRewriteAnalyzer.java:429)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.voidVisit(ASTRewriteAnalyzer.java:435)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.doVisitUnchangedChildren(ASTRewriteAnalyzer.java:450)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.visit(ASTRewriteAnalyzer.java:2621)
        at org.eclipse.jdt.core.dom.ExpressionStatement.accept0(ExpressionStatement.java:143)
        at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.doVisit(ASTRewriteAnalyzer.java:405)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.voidVisitList(ASTRewriteAnalyzer.java:443)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.voidVisit(ASTRewriteAnalyzer.java:437)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.doVisitUnchangedChildren(ASTRewriteAnalyzer.java:450)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.visit(ASTRewriteAnalyzer.java:2044)
        at org.eclipse.jdt.core.dom.Block.accept0(Block.java:135)
        at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.voidVisit(ASTRewriteAnalyzer.java:429)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.voidVisit(ASTRewriteAnalyzer.java:435)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.doVisitUnchangedChildren(ASTRewriteAnalyzer.java:450)
        at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.visit(ASTRewriteAnalyzer.java:1985)
        at org.eclipse.jdt.core.dom.MethodDeclaration.accept0(MethodDeclaration.java:611)
        at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
        at org.eclipse.jdt.core.dom.rewrite.ASTRewrite.internalRewriteAST(ASTRewrite.java:297)
        at org.eclipse.jdt.core.dom.rewrite.ASTRewrite.rewriteAST(ASTRewrite.java:286)
        at org.eclipse.jdt.internal.corext.refactoring.structure.CompilationUnitRewrite.attachChange(CompilationUnitRewrite.java:278)
        at org.eclipse.jdt.internal.corext.refactoring.structure.CompilationUnitRewrite.createChange(CompilationUnitRewrite.java:241)
        at org.eclipse.jdt.internal.corext.fix.CompilationUnitRewriteOperationsFix.createChange(CompilationUnitRewriteOperationsFix.java:104)
        at org.eclipse.jdt.internal.corext.fix.CleanUpRefactoring.calculateChange(CleanUpRefactoring.java:816)
        at org.eclipse.jdt.internal.corext.fix.CleanUpPostSaveListener.saved(CleanUpPostSaveListener.java:396)
        at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider$5.run(CompilationUnitDocumentProvider.java:1598)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider.notifyPostSaveListeners(CompilationUnitDocumentProvider.java:1593)
        at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider.commitWorkingCopy(CompilationUnitDocumentProvider.java:1380)
        at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider$4.execute(CompilationUnitDocumentProvider.java:1458)
        at org.eclipse.ui.editors.text.TextFileDocumentProvider$DocumentProviderOperation.run(TextFileDocumentProvider.java:132)
        at org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation.execute(WorkspaceModifyDelegatingOperation.java:69)
        at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106)
        at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313)
        at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118)
        at org.eclipse.ui.internal.editors.text.WorkspaceOperationRunner.run(WorkspaceOperationRunner.java:75)
        at org.eclipse.ui.internal.editors.text.WorkspaceOperationRunner.run(WorkspaceOperationRunner.java:65)
        at org.eclipse.ui.editors.text.TextFileDocumentProvider.executeOperation(TextFileDocumentProvider.java:456)
        at org.eclipse.ui.editors.text.TextFileDocumentProvider.saveDocument(TextFileDocumentProvider.java:772)
        at org.eclipse.ui.texteditor.AbstractTextEditor.performSave(AbstractTextEditor.java:5076)
        at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.performSave(CompilationUnitEditor.java:1247)
        at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.doSave(CompilationUnitEditor.java:1301)
        at org.eclipse.ui.texteditor.AbstractTextEditor$TextEditorSavable.doSave(AbstractTextEditor.java:7209)
        at org.eclipse.ui.Saveable.doSave(Saveable.java:216)
        at org.eclipse.ui.internal.SaveableHelper.doSaveModel(SaveableHelper.java:355)
        at org.eclipse.ui.internal.SaveableHelper$3.run(SaveableHelper.java:199)
        at org.eclipse.ui.internal.SaveableHelper$5.run(SaveableHelper.java:283)
        at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:466)
        at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:374)
        at org.eclipse.ui.internal.WorkbenchWindow$13.run(WorkbenchWindow.java:2157)
        at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
        at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2153)
        at org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOperation(SaveableHelper.java:291)
        at org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOperation(SaveableHelper.java:269)
        at org.eclipse.ui.internal.SaveableHelper.saveModels(SaveableHelper.java:211)
        at org.eclipse.ui.internal.SaveableHelper.savePart(SaveableHelper.java:146)
        at org.eclipse.ui.internal.WorkbenchPage.saveSaveable(WorkbenchPage.java:3915)
        at org.eclipse.ui.internal.WorkbenchPage.saveEditor(WorkbenchPage.java:3929)
        at org.eclipse.ui.internal.handlers.SaveHandler.execute(SaveHandler.java:54)
        at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:294)
        at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90)
        at sun.reflect.GeneratedMethodAccessor123.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
        at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:247)
        at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:229)
        at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
        at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:149)
        at org.eclipse.core.commands.Command.executeWithChecks(Command.java:499)
        at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
        at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
        at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(KeyBindingDispatcher.java:286)
        at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.press(KeyBindingDispatcher.java:507)
        at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.processKeyEvent(KeyBindingDispatcher.java:558)
        at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.filterKeySequenceBindings(KeyBindingDispatcher.java:378)
        at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.access$0(KeyBindingDispatcher.java:324)
        at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher$KeyDownFilter.handleEvent(KeyBindingDispatcher.java:86)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
        at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1574)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1387)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1412)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1397)
        at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1424)
        at org.eclipse.swt.widgets.Widget.gtk_key_press_event(Widget.java:824)
        at org.eclipse.swt.widgets.Control.gtk_key_press_event(Control.java:3293)
        at org.eclipse.swt.widgets.Composite.gtk_key_press_event(Composite.java:769)
        at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:2098)
        at org.eclipse.swt.widgets.Control.windowProc(Control.java:5534)
        at org.eclipse.swt.widgets.Display.windowProc(Display.java:4668)
        at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method)
        at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:9106)
        at org.eclipse.swt.widgets.Display.eventProc(Display.java:1253)
        at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
        at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:2477)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3407)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
        at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
        at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
        at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
        at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
    

    Hope someone can help to get rid of the annoying error.

    opened by dpalic 73
  • Feature request: Add option to @Getter to allow Optional returns for nullable fields

    Feature request: Add option to @Getter to allow Optional returns for nullable fields

    I use Lombok's @Getter whenever possible. Almost all of the pure getters I find myself writing these days are for java.util.Optionals.

    private final String foo;
        
    public Optional<String> getFoo()
    {
        return Optional.ofNullable(foo);
    }
    

    Changing the field declaration to Optional<String> is not a great solution because any setters would expect an Optional. It's also frowned upon to use Optional as a field value (IntelliJ will give you a warning, for example).

    It would be nice if @Getter had an option which allowed me to generate this automatically. For example:

    @Getter(optional = true) private final String foo;
    

    This would obviously default to false.

    opened by michaelboyles 58
  • Builder.Default causes fields to be null when instantiating with new

    Builder.Default causes fields to be null when instantiating with new

    When using the @Builder.Default annotation on a list/set/map and instantiating the object using the new keyword, the field is null.

    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    @Entity
    public class MyClass {
        
       @OneToMany(mappedBy = "orderItem", cascade = CascadeType.ALL)
       @Builder.Default
       private List<Entitlement> entitlements = new ArrayList<>();
    
    }
    
    // entitlements is null, should be empty ArrayList
    MyClass myClass = new MyClass();
    
    opened by kevcodez 58
  • Lombok not working with JDK 11 modules (Jigsaw)

    Lombok not working with JDK 11 modules (Jigsaw)

    I'm using:

    • Java 11
    • Lombok 1.18.4 (also tried 1.18.5 edge)
    • Gradle 5.0 (also tried with 4.9)

    PS: I have requires static lombok in module-info.java and IDE does not show any error

    Error courtesy: @jython234

    [INFO] Scanning for projects...
    [INFO]                                                                         
    [INFO] ------------------------------------------------------------------------
    [INFO] Building matrix-bridge-java 1.0.0-SNAPSHOT
    [INFO] ------------------------------------------------------------------------
    [INFO] 
    [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ matrix-bridge-java ---
    [INFO] Deleting /home/alejzeis/IdeaProjects/matrix-bridge-java/target
    [INFO] 
    [INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ matrix-bridge-java ---
    [INFO] Using 'UTF-8' encoding to copy filtered resources.
    [INFO] Copying 0 resource
    [INFO] 
    [INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ matrix-bridge-java ---
    [WARNING] ********************************************************************************************************************
    [WARNING] * Required filename-based automodules detected. Please don't publish this project to a public artifact repository! *
    [WARNING] ********************************************************************************************************************
    [INFO] Changes detected - recompiling the module!
    [INFO] Compiling 6 source files to /home/alejzeis/IdeaProjects/matrix-bridge-java/target/classes
    [INFO] -------------------------------------------------------------
    [ERROR] COMPILATION ERROR : 
    [INFO] -------------------------------------------------------------
    [ERROR] /home/alejzeis/IdeaProjects/matrix-bridge-java/src/main/java/io/github/jython234/matrix/bridge/MatrixBridgeEventHandler.java:[29,32] cannot find symbol
      symbol:   method getLogger()
      location: variable bridge of type io.github.jython234.matrix.bridge.MatrixBridge
    [ERROR] /home/alejzeis/IdeaProjects/matrix-bridge-java/src/main/java/io/github/jython234/matrix/bridge/MatrixBridgeEventHandler.java:[30,32] cannot find symbol
      symbol:   method getLogger()
      location: variable bridge of type io.github.jython234.matrix.bridge.MatrixBridge
    [INFO] 2 errors 
    [INFO] -------------------------------------------------------------
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 1.826 s
    [INFO] Finished at: 2018-05-29T22:11:26-05:00
    [INFO] Final Memory: 21M/74M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project matrix-bridge-java: Compilation failure: Compilation failure:
    [ERROR] /home/alejzeis/IdeaProjects/matrix-bridge-java/src/main/java/io/github/jython234/matrix/bridge/MatrixBridgeEventHandler.java:[29,32] cannot find symbol
    [ERROR] symbol:   method getLogger()
    [ERROR] location: variable bridge of type io.github.jython234.matrix.bridge.MatrixBridge
    [ERROR] /home/alejzeis/IdeaProjects/matrix-bridge-java/src/main/java/io/github/jython234/matrix/bridge/MatrixBridgeEventHandler.java:[30,32] cannot find symbol
    [ERROR] symbol:   method getLogger()
    [ERROR] location: variable bridge of type io.github.jython234.matrix.bridge.MatrixBridge
    [ERROR] -> [Help 1]
    [ERROR] 
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR] 
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
    

    I also have included the requires static lombok; in my module-info.java

    EDIT: code can be found here: https://github.com/jython234/matrix-bridge-java

    opened by arana198 55
  • Java 9 Annotation Processing Broken

    Java 9 Annotation Processing Broken

    I am using Lombok 1.16.18 on JDK 9 and IntelliJ Idea 2017.2.4.

    When using Lombok's annotation processor it causes the compiler to throw an exception. Warning:(8, 8) java: lombok.javac.apt.LombokProcessor could not be initialized. Lombok will not run during this compilation: java.lang.IllegalArgumentException: com.sun.tools.javac.api.ClientCodeWrapper$WrappedStandardJavaFileManager extends com.sun.tools.javac.api.ClientCodeWrapper$WrappedJavaFileManager implements javax.tools.StandardJavaFileManager at lombok.javac.apt.LombokFileObjects.getCompiler(LombokFileObjects.java:130) at lombok.javac.apt.InterceptingJavaFileManager.<init>(InterceptingJavaFileManager.java:40) at lombok.javac.apt.LombokProcessor.placePostCompileAndDontMakeForceRoundDummiesHook(LombokProcessor.java:164) at lombok.javac.apt.LombokProcessor.init(LombokProcessor.java:85) at lombok.core.AnnotationProcessor$JavacDescriptor.want(AnnotationProcessor.java:87) at lombok.core.AnnotationProcessor.init(AnnotationProcessor.java:140) at lombok.launch.AnnotationProcessorHider$AnnotationProcessor.init(AnnotationProcessor.java:69) at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$ProcessorState.<init>(JavacProcessingEnvironment.java:675) at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors$ProcessorStateIterator.next(JavacProcessingEnvironment.java:774) at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:869) at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.access$2200(JavacProcessingEnvironment.java:108) at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1206) at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1315) at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1246) at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:922) at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:100) at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:142) at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:96) at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:90) at org.jetbrains.jps.javac.JavacMain.compile(JavacMain.java:190) at org.jetbrains.jps.incremental.java.JavaBuilder.compileJava(JavaBuilder.java:473) at org.jetbrains.jps.incremental.java.JavaBuilder.compile(JavaBuilder.java:328) at org.jetbrains.jps.incremental.java.JavaBuilder.doBuild(JavaBuilder.java:255) at org.jetbrains.jps.incremental.java.JavaBuilder.build(JavaBuilder.java:208) at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1260) at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:937) at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:1009) at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:900) at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:733) at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:385) at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:192) at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:138) at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:295) at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:125) at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:236) at org.jetbrains.jps.service.impl.SharedThreadPoolImpl.lambda$executeOnPooledThread$0(SharedThreadPoolImpl.java:42) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.base/java.lang.Thread.run(Thread.java:844)

    opened by gudenau 47
  • [BUG] [Regression] NetBeans integration broken in 1.18.16

    [BUG] [Regression] NetBeans integration broken in 1.18.16

    Describe the bug NetBeans "default" integration fails to process Lombok annotations, resulting in IDE errors in Lombok projects

    To Reproduce Load a Lombok project into NetBeans IDE and see that it has errors

    Expected behavior Project is error-free

    Version info (please complete the following information): Lombok 1.18.16 and 1.18.14 MacOS, Java 8 (latest) NetBeans 12 with the latest updates

    Additional context Just upgraded to .16 from .12 and seeing this error

    parked 
    opened by lprimak 44
  • As a User I want to be able to use @CopyConstructor annotation to get rid of the boilerplate code

    As a User I want to be able to use @CopyConstructor annotation to get rid of the boilerplate code

    Suppose I have a class with a copy constructor:

    @Data
    class MyEntity {
        private String column;
        private String type;
    
        public MyEntity(MyEntity entity){
            this.column = entity.getColumn();
            this.type = entity.getType();
        }
    }
    

    It's nice to get rid of boilerplate code and replace it with annotation @CopyConstructor to let Lombok autogenerate a copy constructor for me.

    @Data
    @CopyConstructor
    class MyEntity {
        private String column;
        private String type;
    }
    

    Reinier, what do you think about that?

    PS

    It's even better to provide an annotation with a value which describes the copying type:

    @Data
    @CopyConstructor(type = SHALLOW) // or DEEP
    class MyEntity {
        private String column;
        private String type;
    }
    
    opened by Krasnyanskiy 39
  • Wish: makeFinal parameter for Getter/Setter annotations

    Wish: makeFinal parameter for Getter/Setter annotations

    Add boolean makeFinal() default false to Getter and Setter.

    Though it's already discussed here (discusstion start is here) and will, probably, be "won't fix" anyway — but I consider it useful in some rare cases when getter and/or setter is needed to be explicitly final (not for marking most of getters/setters as final).

    As I haven't found this wish in this issue-tracker, I took the liberty to repost it here (at least: to group all requests in one place) — please, feel free to close it immediately, if it's still a no-way.

    opened by o-pikozh 38
  • Copy Spring @Value on fields to generated constructor parameter

    Copy Spring @Value on fields to generated constructor parameter

    Describe the feature I'm using lombok in Spring context, especially for generating constructors with @RequiredArgsConstructor for final fields (constructor injection). This replaces the @Autowired annotation on fields perfectly elegant with the Lombok constructor.

    Using the Spring @Value annotation on fields breaks this elegance, because I need to put the full constructor code with @Value annotation on the constructor parameters, see sample code https://docs.spring.io/spring-framework/docs/5.3.14/reference/html/core.html#beans-value-annotations.

    Would love Lombok would support that scenario and copy the @Value annotation from the field to the respective constructor parameter. This would make Lombok working even more smooth together with the very spread Spring framework.

    Describe the target audience Java projects using Lombok and Spring CDI together.

    Additional context n/a

    opened by camproto 0
  • [FEATURE] @EasyComparable allowing relational operators on Comparables

    [FEATURE] @EasyComparable allowing relational operators on Comparables

    Describe the feature Using the Comparable interface, programmers can implement a natural ordering for a class. However, implementing this interface does not give you any syntactical advantage when writing comparisons. You still have to compare instances as follows:

    Instant i1 = Instant.now();
    Instant i2 = Instant.now();
    if (i1.compareTo(i2) < 0) {
    	System.out.println("LT");
    } else if (i1.compareTo(i2) > 0) {
    	System.out.println("GT");
    } else /*if (i1.compareTo(i2) == 0)*/ {
    	System.out.println("EQ");
    }
    

    Compared with the equality/relational operators for primitive data types (e.g. if (i1 < i2) ...), this is more difficult to read and clutters the code.

    Proposal I propose a new lombok annotation @EasyComparable. It automatically converts equality/relational operators on non-primitives to compareTo invocations. The lombok'ized code for the example above would look like this:

    @EasyComparable
    class TestEasyComparable {
    	void autoCompare() {
    		Instant i1 = Instant.now();
    		Instant i2 = Instant.now();
    		if (i1 < i2) {
    			System.out.println("LT");
    		} else if (i1 > i2) {
    			System.out.println("GT");
    		} else /*if (i1 == i2)*/ {
    			System.out.println("EQ");
    		}
    	}
    }
    

    Describe the target audience Programmers that use Comparable classes.

    Additional context I already implemented a working PoC for javac on this branch.

    Note that this annotation only affects the usage of Comparables. It does not change anything for the comparable class. Thus, it needs to be present on every compilation unit that wants to use this feature.

    The proposed name of the annotation is obviously up to discussion (I couldn't think of a better one). Furthermore, I'm not sure whether the class is the best placement for the annotation. Maybe it's better to allow it, for instance, also on methods or even on the variables itself.

    opened by janrieke 0
  • [BUG] lombok.config does not take effect for @Data

    [BUG] lombok.config does not take effect for @Data

    I used lombok.config set lombok.toString.callSuper = CALL When I use @Data annotation, toString() did not call super, when I use @ToString, toString() called super equalsAndHashCode has the same problem

    org.projectlombok:lombok:1.18.24

    java version "17.0.5" 2022-10-18 LTS Java(TM) SE Runtime Environment (build 17.0.5+9-LTS-191) Java HotSpot(TM) 64-Bit Server VM (build 17.0.5+9-LTS-191, mixed mode, sharing)

    lombok.config:

    config.stopBubbling = true
    lombok.equalsAndHashCode.callSuper = CALL
    lombok.toString.callSuper = CALL
    lombok.sneakyThrows.flagUsage = ERROR
    

    BaseEntity.java:

    @Data
    @MappedSuperclass
    public abstract class BaseEntity<ID extends Serializable> implements Serializable {
        @Id
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        public ID id;
    }
    

    User.java

    @Data
    public class User extends BaseEntity<Integer> {
        private String username;
    }
    
    opened by renci-zz 0
  • [FEATURE] Augment @FieldNameConstants with asArray property

    [FEATURE] Augment @FieldNameConstants with asArray property

    Providing an array of the field names of a domain class is very common in Spring projects, such as Spring Batch when configuring reading or writing of flat-files (CSV, FWV). Using the Lombok @FieldNameConstants(asEnum=true) annotation makes it easier. However, the last step is still somewhat clumsy: @FieldNameConstants(asEnum=true) class MyDomainClass {...} var names = Stream.of(MyDomainClass.Fields.values()).map(Enum::name).toArray(String[]::new);

    So, my suggestion is to add the annotation property asArray, which would generate a static final String[] with the names.

    With Lombok

    @FieldNameConstants(asArray=true)
    @OtherLombokAnnotations
    class Account {
        private String accno;
        private long balance;
    }
    

    With Java

    class Account {
        private String accno;
        private long balance;
        public static final String[] Fields = {"accno", "balance"};
        //. . .
    }
    

    As an example, with the suggested property it would be a breeze to configure an CSV ItemWriter in Spring Batch:

    @Bean
    public FlatFileItemWriter<Account> itemWriter(Resource file) throws Exception {
    	return new FlatFileItemWriterBuilder<Account>()
    				.name("Account")
    				.resource(file)
    				.delimited()
    				.names(Account.Fields)    // <----here
    				.build();
    }
    
    opened by ribomation 1
  • [BUG] Custom nullable annotations are not copied to constructors and methods for Value/Data classes

    [BUG] Custom nullable annotations are not copied to constructors and methods for Value/Data classes

    Describe the bug In my project and libs I use custom nullability annotations that are almost one-to-one copies of spring ones, the purpose is to avoid depending on spring-core. I wanted to configure lombok to add them from fields to constructors and methods (getters/setters) for Value/Data annotated classes, but for some reason annotations are not added.

    At the same time, when lombok is configured to use spring or checkerframework annotations they are added correctly.

    In other words, sample class

    @Value
    public class Sample {
        @Nullable
        String prop1;
        String prop2;
    }
    

    Produce different results depending on Nullable annotation.

    For spring with (lombok.addLombokGeneratedAnnotation=true, lombok.addNullAnnotations=spring)

    import org.springframework.lang.NonNull;
    import org.springframework.lang.Nullable;
    
    public final class Sample {
        @Nullable
        private final String prop1;
        private final String prop2;
    
        @Generated
        public Sample(@Nullable String prop1, String prop2) {
            this.prop1 = prop1;
            this.prop2 = prop2;
        }
    
        @Nullable
        @Generated
        public String getProp1() {
            return this.prop1;
        }
    

    For custom (lombok.addLombokGeneratedAnnotation=true, lombok.addNullAnnotations=CUSTOM:com.example.annotations.NonNull:com.example.annotations.Nullable)

    import com.example.annotations.NonNull;
    import com.example.annotations.Nullable;
    import lombok.Generated;
    
    public final class Sample {
        @Nullable
        private final String prop1;
        private final String prop2;
    
        @Generated
        public Sample(String prop1, String prop2) {
            this.prop1 = prop1;
            this.prop2 = prop2;
        }
    
        @Generated
        public String getProp1() {
            return this.prop1;
        }
    

    To Reproduce I've prepared a sample project that shows the problem: https://github.com/zeldigas/lombok-custom-nullable-problem. In spring module you can find usage of spring annotations and in custom - custom ones that are defined in this module as well (for simplicity)

    Expected behavior Both modules in sample project are working the same way.

    Version info (please complete the following information):

    • Lombok version - 1.18.24
    • Platform - javac temurin-11.0.17 on Windows 10
    opened by zeldigas 1
Releases(v1.18.16)
  • v1.18.16(Oct 15, 2020)

    • BUGFIX: Version 1.18.14 could not be installed in Eclipse, it would break Eclipse.
    • BREAKING CHANGE: mapstruct users should now add a dependency to lombok-mapstruct-binding. This solves compiling modules with lombok (and mapstruct).
    • IMPROBABLE BREAKING CHANGE: The generated hashcode has changed for classes that include both primitive fields and reference fields.
    • FEATURE: Similar to @Builder, you can now configure a @SuperBuilder's 'setter' prefixes via @SuperBuilder(setterPrefix = "set") for example. We still discourage doing this. Pull Request #2357.
    • FEATURE: If using @Synchronized("lockVar"), if lockVar is referring to a static field, the code lombok generates no longer causes a warning about accessing a static entity incorrectly. Issue #678
    • FEATURE: @Jacksonized on a @Builder or @SuperBuilder will configure Jackson to use this builder when deserializing. Pull Request #2387 thanks to @JanRieke. @Jacksonized documentation.
    • FEATURE: The checkerframework support has been updated; the relevant annotations were renamed in checkerframework's APIs, lombok now generates the annotations according to their current API names.
    • PLATFORM: Added support for compiling projects with OpenJ9 Pull Request #2437
    • PLATFORM: Improved support for recent JVM/javac versions (14 and 15) and new language features.
    • PERFORMANCE: Several performance improvements during parsing/compilation, both using javac and Eclipse. Thanks @Rawi01!
    • PERFORMANCE: The generated equals method will first compare primitives, then primitive wrappers and then reference fields. Manual re-ordering is possible using @Include(rank=n). Pull Request #2485, Issue #1543
    • BUGFIX: Delombok prints the first this parameter. Issue #2444
    • BUGFIX: Using val in combination with values whose generics include wildcards that reference themselves would cause a StackOverflowError in javac. Issue #2358.
    • BUGFIX: Using @SuperBuilder on a class that has some fairly convoluted generics usage would fail with 'Wrong number of type arguments'. Issue #2359 Pull Request #2362
    • BUGFIX: Various lombok annotations on classes nested inside enums or interfaces would cause errors in eclipse. Issue #2369
    • BUGFIX: Trying to add @ExtensionMethods with exactly 2 arguments would fail in eclipse. Issue #1441 Pull Request #2376 thanks to @Rawi01.
    • BUGFIX: Javac sets incorrect annotated type on with methods. Issue #2463
    Source code(tar.gz)
    Source code(zip)
  • v1.18.14(Oct 15, 2020)

  • v1.18.12(Oct 15, 2020)

    • PLATFORM: Support for JDK13 (including yield in switch expressions, as well as delombok having a nicer style for arrow-style switch blocks, and text blocks).
    • PLATFORM: Support for JDK14 (including pattern match instanceof expressions).
    • FEATURE: In lombok.config it is possible to import other config files, even from a .zip or .jar.
    • FEATURE: You can now configure a builder's 'setter' prefixes via @Builder(setterPrefix = "set") for example. We discourage doing this, but if some library you use requires them, have at it. Pull Request #2174, Issue #1805.
    • FEATURE: If you use @Builder's @Singular, a plural form is also generated, which has the effect of adding all elements in the passed collection. If you pass a null reference, this would result in a message-less NullPointerException. Now, it results in that exception but with a useful message attached (uses the same config as @NonNull), or alternatively via a parameter on @Singular, you can choose to ignore such a call (add nothing, return immediately); this can be useful when deserializing (e.g. Jackson JSON) and JPA/Hibernate code. Issue #2221. singular documentation.
    • FEATURE: Tired of being unable to use @javax.annotation.ParametersAreNonnullByDefault or @org.eclipse.jdt.annotation.NonNullByDefault because then the equals method that lombok generates isn't valid? Fret no more; lombok can now add nullity annotations where relevant. Set the flavour of nullity annotation you prefer in your lombok.config. Applies to the return value of toString, withX, chainable setX, static constructors, build, builder, etcetera, and the parameter of equals, canEqual, and the plural form of @Singular marked fields for builder classes. Issue #788
    • BUGFIX: If using the sonarlint plugin in eclipse for projects bound to sonarcloud, you now no longer get internal errors on sonarlint processing. Issue #2351
    • BUGFIX: lombok.experimental.Wither has been deprecated (it has been renamed to lombok.With). However, the intent is that lombok still handles the old annotation in case you haven't updated your lombok dep yet. However, only a star import on lombok.experimental.* worked; an explicit one would cause lombok to not generate any with method. Issue #2235
    • BUGFIX: Referring to an inner class inside the generics on a class marked with @SuperBuilder would cause the error wrong number of type arguments; required 3 Issue #2262; fixed by github user @Lekanich - thank you!
    • BUGFIX: Some of the code generated by @Builder did not include this. prefixes when accessing fields. While semantically it didn't matter, if you use the 'add this prefix for field accesses' save action in eclipse, the save action would break. Issue #2327
    • BUGFIX: When lombok copies javadoc from fields to relevant methods, it should generate an appropriate @return this line if lombok copies the javadoc to a generated setter that is chainable (returns itself). It didn't do that when generating the 'setters' in a @Builder. Lombok also didn't generate an appropriate @return item for @With methods. The javadoc has also been updated slightly (the this reference in the javadoc is now rendered in a code tag).Issue #2323
    • IMPROBABLE BREAKING CHANGE: Lombok now generates qualified types (so, Outer.Inner instead of just Inner) in most type signatures that it generates; this should avoid exotic scenarios where the types lombok puts in signatures end up referring to unintended other types, which can occur if your class implements an interface that itself defines a type with the same name as one defined in your source file. I told you it was exotic. Thanks to Hunter Anderson for doing some preliminary work on this change. Issue #2268
    • IMPROBABLE BREAKING CHANGE: Running java -jar lombok.jar config -v <files> no longer shows which files do not mention the specified keys. Use --non-mentioned or -n to show them anyway.
    Source code(tar.gz)
    Source code(zip)
lazy-language-loader improves loading times when changing your language by only reloading the language instead of all the game resources!

lazy-language-loader lazy-language-loader improves loading times when changing your language by only reloading the language instead of all the game re

Shalom Ademuwagun 7 Sep 7, 2022
For Jack language. Most of codes were commented with their usage, which can be useful for beginner to realize the running principle of a compiler for object-oriented programming language.

Instructions: Download the Java source codes Store these codes into a local folder and open this folder Click the right key of mouse and click ‘Open i

gooooooood 1.1k Jan 5, 2023
Original FishHack from the very beginning of 2020 (WARNING: VERY BAD CODE)

FishHack Original FishHack from the very beginning of 2020 (when I did not know what was I doing) Credits to BleachHack for my first ever coding knowl

null 3 Dec 2, 2022
Very briefly capturing some of new/ update in API that were introduced after Java 8 that may come handy for dev folks while programming

Very briefly capturing some of new/ update in API that were introduced after Java 8 that may come handy for dev folks while programming. Also have created tests demonstrating those APIs and playaround with it.

Jayaramanan Kumar 3 Jan 24, 2022
Jamal is a macro language (JAmal MAcro Language)

Jamal Macro Language Jamal is a complex text processor with a wide variety of possible use. The first version of Jamal was developed 20 years ago in P

Peter Verhas 29 Dec 20, 2022
JurjenLang, an interpreted programming language

JurjenLang An untyped interpreted functional programming language Getting started Follow these three steps on your computer to get started git clone h

JVerbruggen 5 May 3, 2022
Create different patterns and designs using your favorite programming language for this project.

Patterns project for Hacktoberfest Create different patterns and designs using your favourite programming language weather it be a square pattern, sta

Pulkit Handa 5 Oct 5, 2022
Programming Services and Processes - 04 Secure Programming Techniques

Programación de Servicios y Procesos - 04 Técnicas de Programación Segura Tema 04. Técnicas de Programación segura. Curso 2021/2022. Contenidos Introd

José Luis González Sánchez 5 Dec 27, 2022
this repo is probs gonna die cuz idk very much java but i will update it when i learn how to actually DO SHIT

pastegod.cc shitty rename of zihasz client base rn but as i learn java i will paste-i mean add modules ;) (23/9/2021) why is everyone starring and wat

null 9 Dec 9, 2022
This is some Discord bot I made to help me learn Java. Not very useful yet.

JennyChan This is some Discord bot I made to help me learn Java. Not very useful yet. What it can do so far: Reply to mention List commands Show bot u

null 0 Sep 1, 2022
GodType is a very simple Bukkit plugin to allow the console (or a player) to chat as a defined name.

GodType GodType is a very simple Bukkit plugin to allow the console (or a player) to chat as a defined name. Config A config.yml file will be created

null 1 Dec 24, 2021
Magic Bean: A very basic library which will generate POJOs.

Magic Bean: A very basic library which will generate POJOs.

Ethan McCue 48 Dec 27, 2022
Conway's Game Of Life, but made by me in a very inefficient and unpractical way. Still, I am proud!

Conway's Game Of Life, but made by me in a very ugly and inefficient way. Still, I am proud! I want to share my appreciation to cellular automata with anyone who comes across this repo.

Ulaş Dilek 6 May 25, 2022
ActiveJ is an alternative Java platform built from the ground up. ActiveJ redefines web, high load, and cloud programming in Java, featuring ultimate performance and scalability!

Introduction ActiveJ is a full-featured modern Java platform, created from the ground up as an alternative to Spring/Micronauts/Netty/Jetty. It is des

ActiveJ LLC 579 Jan 7, 2023
A list of direct references to classes and interfaces in the Java Language Specification (3d Ed.)

A list of direct references to classes and interfaces in the Java Language Specification (3d Ed.) and a program to compute the indirectly required classes and interfaces

Joshua Bloch 12 Jun 3, 2022
A dubbo gateway based Java language.

A dubbo gateway based Java language.

老夫正年轻 19 Sep 24, 2022
Java Compiler for the MiniJava language

Java Compiler for the MiniJava language Setup Our project requires the following tools with the specified versions. Tool Version Java >= 14 Maven 3 Th

Lars 3 Dec 5, 2022
Scripting language written in, and, designed to communicate with, java

mi-lang Scripting language designed to communicate with java, to allow for easy plugins, addons, etc in any project, all without having to create an e

null 7 Dec 17, 2022
Official Java library for the DeepL language translation API.

DeepL Java Library The DeepL API is a language translation API that allows other computer programs to send texts and documents to DeepL's servers and

DeepL 26 Dec 29, 2022