Skip to content

Compilation errors in Eclipse and IntelliJ #3996

@scordio

Description

@scordio

Discussed in https://github.com/orgs/assertj/discussions/3994

Originally posted by erizzo October 30, 2025
I just cloned the repo and imported into Eclipse, set the project to use Java 25.
There are compilation errors in 2 classes, AbstractObjectAssert and AbstractIterableAssert, all centered around typing errors.

In AbstractObjectAssert the same error shows up on 4 different lines. Here's one example, line 467

  public AbstractObjectAssert<?, ?> extracting(String propertyOrField) {
    return super.extracting(propertyOrField, this::newObjectAssert);
  }

The type of newObjectAssert(Object) from the type AbstractObjectAssert<SELF,ACTUAL> is AbstractObjectAssert<?,Object>, this is incompatible with the descriptor's return type: AbstractObjectAssert<AbstractObjectAssert<AbstractObjectAssert<?,Object>,Object>,Object>

In AbstractIterableAssert, there are 2 instances of a different error. One example, line 3011:

  private ELEMENT lastElement() {
    if (actual instanceof List<? extends ELEMENT> list) {
      return list.get(list.size() - 1);
    }

Type ACTUAL cannot be safely cast to List<? extends ELEMENT>

Only the AbstractIterableAssert errors show up in IntelliJ.

Has anyone else run into these compilation errors?

Metadata

Metadata

Assignees

Labels

3rd-party: EclipseAn issue related to using AssertJ with Eclipse

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions