GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Check if superclass or interfaces contain applicable types by Markoutte · Pull Request #2451 · UnitTestBot/UTBotJava

Conversation

@Markoutte

@Markoutte Markoutte commented Jul 26, 2023

Copy link
Copy Markdown
Collaborator

Description

Fixes #2450

How to test

Automated tests

Run org.utbot.fuzzing.JavaTypesTest

Manual tests

  1. Try run an example from a bug-report. It should work as expected.
  2. Run modified example below. It should generate 3 tests: with null and other with only BImpl type:
public class Implementations {

    public interface A<T> {
        T getValue();
    }

    public static class AImpl implements A<String> {

        private final String value;

        public AImpl(String value) {
            this.value = value;
        }

        @Override
        public String getValue() {
            return value;
        }
    }

    public static class BImpl implements A<Integer> {

        private final Integer value;

        public BImpl(Integer value) {
            this.value = value;
        }

        @Override
        public Integer getValue() {
            return value;
        }
    }

    public static int test(A<Integer> value) {
        if (value.getValue() < 0) {
            return 0;
        }
        return value.getValue();
    }
}

Self-check list

  • I've set the proper labels for my PR (at least, for category and component).
  • PR title and description are clear and intelligible.
  • I've added enough comments to my code, particularly in hard-to-understand areas.
  • The functionality I've repaired, changed or added is covered with automated tests.
  • Manual tests have been provided optionally.
  • The documentation for the functionality I've been working on is up-to-date.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Markoutte
Check if superclass or interfaces contain applicable types #2450
f9039ab
@Markoutte Markoutte added comp-fuzzing Issue is related to the fuzzing ctg-bug-fix PR is fixing a bug labels Jul 26, 2023
@Markoutte
Markoutte requested a review from Vassiliy-Kudryashov July 26, 2023 07:12
@Markoutte Markoutte mentioned this pull request Jul 26, 2023
Make fuzzer use static methods to create arbitrary objects #2440
Draft
4 of 6 tasks
@Markoutte
Markoutte requested a review from IlyaMuravjov July 26, 2023 07:38
@Markoutte
Add a comment about bad generics in some cases
3b25239
IlyaMuravjov
IlyaMuravjov approved these changes Jul 26, 2023
View reviewed changes
@Markoutte
Markoutte merged commit 339ef49 into main Jul 26, 2023
@Markoutte
Markoutte deleted the pelevin/2450-fix_wrong_implenentation_gathering branch July 26, 2023 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@IlyaMuravjov IlyaMuravjov IlyaMuravjov approved these changes
@Vassiliy-Kudryashov Vassiliy-Kudryashov Awaiting requested review from Vassiliy-Kudryashov

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

comp-fuzzing Issue is related to the fuzzing ctg-bug-fix PR is fixing a bug

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Bad test is produced when use concrete classes for implementing interface with generic

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@Markoutte @IlyaMuravjov
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.