最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

java - Eclipse doesn't copy Lombok's @Delegate from record to generated class - Stack Overflow

programmeradmin7浏览0评论

Eclipse fails to propagate Lombok's @Delegate annotation from a record to the generated class so I end up with an error on my IDE.

For context: gradle's compileJava task is totally ok. Also ok if I turn the record into a class. Seems like it's Eclipse being picky.

Is this an Eclipse bug? (If so, where can I report it?)

Is there any way this can be solved by tweaking Eclipse preferences?

Code example:

// Bob.java
public class Bob {
  public String getStuff() {
    return "stuff";
  }
}

// BetterBob.java
public record BetterBob(@Delegate Bob bob) {}

// Main Code
public class BobApp {
  public static void main(String[] args) {
    BetterBob bb = new BetterBob(new Bob());
    bb.getStuff(); // <-- The method getStuff() is undefined for the type BetterBob
  }
}

Eclipse version: 2024-12 (4.34.0)

Lombok v.1.18.36 "Envious Ferret"

Java 21.0.6.7-hotspot

发布评论

评论列表(0)

  1. 暂无评论