Skip to content

@utbot.invokes {@link soot.dummy.InvokeDynamic in JavaDoc for test method #1869

@tyuldashev

Description

@tyuldashev

Description
Some tests have @utbot.invokes {@link soot.dummy.InvokeDynamic in JavaDocs even though there is no calls to it. This seems happens only for JDK11+ and not happens with JDK 1.8.

To Reproduce

Steps to reproduce the behavior:

  1. Create new project with JDK11 (for some reason it's not reproducible in UTBot project)
  2. Copy there org.utbot.examples.exceptions.ExceptionExamples class from UTBot project.
  3. Invoke test generation for IllegalArgumentException createException() method

Expected behavior
JavaDoc for generated tests contains actual information about invoked methods

Actual behavior
@utbot.invoke tag linked to soot method which actually is not called in test or in user code.

Visual proofs (screenshots, logs, images)

 /**
     * @utbot.classUnderTest {@link ExceptionExamples}
     * @utbot.methodUnderTest {@link ExceptionExamples#createException()}
     * @utbot.invokes {@link Math#sqrt(double)}
     * @utbot.invokes {@link soot.dummy.InvokeDynamic#makeConcatWithConstants(double)}
     * @utbot.returnsFrom {@code return new IllegalArgumentException("Here we are: " + Math.sqrt(10));}
     */
    @Test
    @DisplayName("createException: MathSqrt -> return new IllegalArgumentException(\"Here we are: \" + Math.sqrt(10))")
    public void testCreateException_InvokeDynamicMakeConcatWithConstants() throws Exception {
        ExceptionExamples exceptionExamples = new ExceptionExamples();

        IllegalArgumentException actual = exceptionExamples.createException();

        IllegalArgumentException expected = ((IllegalArgumentException) createInstance("java.lang.IllegalArgumentException"));
    }

Additional context

That's pre-existing problem, reproducible in 2022.12 release.

Metadata

Metadata

Assignees

Labels

comp-summariesSomething related to the method names, code comments and display names generationctg-bugIssue is a buglang-javaIssue is related to Java support

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions