Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Rename parameter to avoid name clashing

Open
#114 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
devtools

Research direction

Locate the generator logic that emits assertion method parameters and inspect how a field or property named actual is handled. Use the Java example in the issue as the regression case; the work is done when generated assertions avoid the parameter clash and the example can refer to the object under test unambiguously.

Written by the indexing model from the issue text.

Description

If a class has an actual field/property, it clashes with the generated assertion actual parameter.

In this example, the actual parameter clashes with actual object under test in actual.getActual();

public S hasActual(boolean actual) {
  // check that actual Group we want to make assertions on is not null.
  isNotNull();

  // overrides the default error message with a more explicit one
  String assertjErrorMessage = "\nExpecting actual of:\n  <%s>\nto be:\n  <%s>\nbut was:\n  <%s>";

  // check
  boolean actualActual = actual.getActual();
  if (actualActual != actual) {
    failWithMessage(assertjErrorMessage, actual, actual, actualActual);
  }

  // return the current assertion for method chaining
  return myself;
}

Dominant language
Java
Stars
72
Forks
47
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from assertj/assertj-generator

All issues in assertj/assertj-generator

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.