Skip to content

Make UtEnumConstantModel and UtClassRefModel subclasses of UtReferenceModel #414

Closed

Description

@dtim

Description

Although Enum is a reference type, UtEnumConstantModel is not currently a subtype of UtReferenceModel and does not have any id that would allow the reference comparison of Enum values. As a result, we can't use Enum values as elements of generic collections (Map<K, V>, List<E> etc).

The intended solution:

  • UtEnumConstantModel and UtClassRefModel should be subtypes of UtReferenceModel.
  • The address assigned to a UtEnumConstantModel should be equal to one and only one address assigned to models of the static fields of the corresponding Enum class, and reference equality must hold.
  • The addresses should be assigned to UtClassRefModel with respect to class equality condition: all models of the same class should have the same address, models of different classes should have different addresses,

Related issue: #230

Expected behavior

UtEnumConstantModel is a subtype of UtReferenceModel, and enum values can be used as elements of any generic collection.

Environment

The intended behavior does not depend on any specific environment.

Activity

  1. self-assigned this
    on Jul 5, 2022
  2. added
    ctg-enhancementNew feature, improvement or change request
    comp-symbolic-engineIssue is related to the symbolic execution engine
    on Jul 5, 2022
  3. moved this to Todo in UTBot Javaon Jul 5, 2022
  4. moved this from Todo to In Progress in UTBot Javaon Jul 5, 2022
  5. changed the title [-]Make UtEnumConstantModel a subclass of UtReferenceModel[/-] [+]Make UtEnumConstantModel and UtClassRefModel subclasses of UtReferenceModel[/+] on Jul 5, 2022
  6. Repository owner moved this from In Progress to Done in UTBot Javaon Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

comp-symbolic-engineIssue is related to the symbolic execution enginectg-enhancementNew feature, improvement or change request

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions