Skip to content

Incorrect line is addressed from Problems tool window for the sandboxed Socket.connect #1383

Closed
@alisevych

Description

@alisevych

Description

Problems visualizing for the sandboxed Socket.connect:
first line of user's class is addressed instead of unpermitted method call.

To Reproduce

  1. Install one of the latest plugin build from main in IDEA
  2. Run the 'UTBotJava' project in IntelliJ Idea
  3. Set defaults in Settings->Tools->UnitTestBot , delete any permissions if they were manually added in ~/.utbot/
  4. Turn on Problems tool windows
  5. Use plugin to generate tests for the following method:
    public int connect(Socket socket) throws IOException {
        socket.connect(new InetSocketAddress("0.0.0.0", 22));
        return 0;
    }
  1. Select Unexpected exception on Problems tool window after generation.

Expected behavior

Exception should be addressed to the unpermitted method call - socket.connect() in this example.

Actual behavior

Exception is addressed to the first line of the source class.

Visual proofs (screenshots, logs, images)

image

Environment

Windows 10 Pro
IntelliJ IDEA 2022.2.3

Metadata

Metadata

Assignees

Labels

ctg-bugIssue is a bug

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions