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.
Description
This PR removes filters that prevented anonymous classes from being used. It also allows code generation to work with anonymous class instances. Not via reflection, but rather by storing these instances in variables of the anonymous class supertype. For example, instance of anonymous class implementing interface
Predicate
will be stored in a variable of typePredicate
. If we have to access any fields of methods declared in anonymous class, it will be done through reflection, but all members of the supertype will be accessed directly.This PR partly fixes issue #617. Now tests are generated, but there seems to be some problem with accessing enum constants that have corresponding anonymous classes, to be discussed.
Type of Change
Please delete options that are not relevant.
How Has This Been Tested?
Automated Testing
org.utbot.examples.objects.AnonymousClassesExampleTest
Manual Scenario
Change was tested manually on example of code from issue #617. Tests are generated, but as said in the description, they are yet not fully correct. The exact problem is unclear. To be discussed.
Checklist (remove irrelevant options):
This is the author self-check list