Skip to content

Conversation

@Damtev
Copy link
Member

@Damtev Damtev commented Jan 20, 2023

Description

For now, resulted symbolic model for java.util.List#iterator, java.util.List#listIterator, and java.util.Set#iterator are assemble models for our own classes Ut*Iterator that could not be constructed in child process or purely returned to the end user. This PR adds proper symbolic wrappers for these internal iterators to make able to construct the real classes in the result.

How to test

Automated tests

org.utbot.examples.collections.ListIteratorsTest#testReturnIterator
org.utbot.examples.collections.ListIteratorsTest#testReturnListIterator
org.utbot.examples.collections.SetIteratorsTest#testReturnIterator

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, particularly in hard-to-understand areas.
  • The functionality I've repaired, changed or added is covered with automated tests.
  • The documentation for the functionality I've been working on is up-to-date.

@Damtev Damtev added comp-symbolic-engine Issue is related to the symbolic execution engine ctg-bug-fix PR is fixing a bug labels Jan 20, 2023
@Damtev Damtev requested a review from CaelmBleidd January 20, 2023 09:18

class ReverseIteratorWrapper :CollectionIteratorWrapper(UtReverseIterator::class) {
override val modelName: String = "reverseIterator"
override val javaCollectionClassId: ClassId = java.util.Deque::class.id
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is ReverseIteratorWrapper corresponds to Deque?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because descendingIterator is a method of java.util.Deque

@Damtev Damtev merged commit c9d2fd5 into main Jan 20, 2023
@Damtev Damtev deleted the damtev/iterator_wrappers branch January 20, 2023 12:24
@alisevych alisevych added this to the 2023.03 Release milestone Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-symbolic-engine Issue is related to the symbolic execution engine ctg-bug-fix PR is fixing a bug

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants