Skip to content

Java package taking 100% CPU under very specific conditions #4052

Open

Description

@ipkiss42

Here are the minimal conditions needed to reproduce this issue:

  • A Java package has a dependency on Lombok.
  • A method uses Lombok's @NonNull on a parameter.
  • The first line of the method is a comment.
  • The line after the comment is NOT empty.
  • The lombok.nonNull.exceptionType = JDK option is set in a lombok.config file.

If you open this project in VS Code with the redhat.java extension, any modification in that same file that does not break the above criteria (such as adding a comment on the last line and saving) will take 100% of one CPU core. Do it 5 times, and it will take 5 cores!

This high CPU usage stops after a while, but it makes the whole machine unresponsive if you make several modifications quickly.

You can use this minimal repo to reproduce the bug: ipkiss42/vscode-java-4052.

Activity

  1. self-assigned this
    on Jun 26, 2025
  2. snjeza commented on Dec 23, 2025

    @snjeza
    Collaborator

    This is an upstream jdt.core issue.
    The related issue - eclipse-jdt/eclipse.jdt.core#4712

  3. assigned and unassigned on Jan 30, 2026
  4. stephan-herrmann commented on Aug 9, 2026

    @stephan-herrmann

    This is an upstream jdt.core issue. The related issue - eclipse-jdt/eclipse.jdt.core#4712

    Upstream yes, but the culprit appears to be lombok illegally creating instances of internal classes with illegal / missing values, see eclipse-jdt/eclipse.jdt.core#4713 (review)

    Even if JDT might add extra resilience for this case, it would be good to report this to lombok. The bottom line would probably be: any internal AST generated by lombok must have suitable source locations throughout. As this internal AST is not intended to be accessed by clients, it's entirely lombok's responsibility to create these things in a way that doesn't blow up in any way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions