dj_frunza
dj_frunza

Reputation: 1593

Intellij break point stops execution two times even though code is executed only once

I have the below class:

package com.example;

public class Main {
    public static void main(String[] args) {
      System.out.println(Integer.toString(Math.abs(1)));
      System.out.println(Integer.toString(
            Math.abs(-2)));

    }
}

I put two break points for the first two lines after the main method declaration. For the second brake point the execution stops two times(I have to press F8 two times to resume the program) and I do not understand why.

I noticed that this happens only when the Math.abs method call is placed on the next line(So the first break point works properly).

Can someone please explain if there is any particular reason intellij stops execution two times even though, if I run this program and check the output, I can tell for sure that the code is only executed once?

I tried and did not manage to reproduce this issue in Eclipse.

Upvotes: 0

Views: 143

Answers (1)

Egor
Egor

Reputation: 2664

Please check https://youtrack.jetbrains.com/issue/IDEA-144462, it is being discussed with Oracle, but still no solution found :(

Upvotes: 3

Related Questions