Skip to content

Improve overloadings check in generated code #370 #503

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

Vassiliy-Kudryashov
Copy link
Member

@Vassiliy-Kudryashov Vassiliy-Kudryashov commented Jul 12, 2022

Description

Check for classId was added

Fixes #370

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Manual Scenario

The example:

public interface I1 {
}
public interface I2 {
}
public class E implements I1, I2 {
    public E() {
    }
}
public class A {
    public void foo(I1 i1) {
        System.out.println("I1@A : " + i1);
    }
}
import java.util.Objects;

public class B extends A {
    @Override
    public void foo(I1 i1) {
        Objects.requireNonNull(i1);
        System.out.println("I1@B");
    }
}

Observed code in generated tests for class B:
b.foo(((I1) e));
Here you can see redundant casting that affects readability

Expected code in generated tests for class B:
b.foo(e);

Checklist (remove irrelevant options):

  • The change followed the style guidelines of the UTBot project
  • Self-review of the code is passed
  • No new warnings

@Vassiliy-Kudryashov Vassiliy-Kudryashov linked an issue Jul 12, 2022 that may be closed by this pull request
@Vassiliy-Kudryashov Vassiliy-Kudryashov enabled auto-merge (squash) July 12, 2022 11:42
@Vassiliy-Kudryashov Vassiliy-Kudryashov merged commit b7bc926 into main Jul 13, 2022
@Vassiliy-Kudryashov Vassiliy-Kudryashov deleted the Vassiliy-Kudryashov/370-improve-overloadings-check-in-generated-code branch July 13, 2022 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Improve overloadings check in generated code
2 participants