Fix breakpoints from Kotlin file placed in irrelevant class (KT-19429)

State that there're no locations in given file, if all locations for
line were filtered out because of wrong file name. Need this because
if we throw exception, other positions managers may return locations
without explicit check for file type or file name.

See PositionManagerImpl.java

 #KT-19429 Fixed
This commit is contained in:
Nikolay Krasko
2017-08-02 19:45:37 +03:00
parent 3ea4a7fb47
commit 1ef5362edc
5 changed files with 50 additions and 3 deletions
@@ -0,0 +1,11 @@
package stopInWrongClass
class A {
fun test() {
// Breakpoint 1
foo()
}
}
fun foo() {
}
@@ -0,0 +1,21 @@
package stopInWrongClass
class AA {
fun test() {
// Should be on the same line with Breakpoint 1
foo()
}
fun other() {
//Breakpoint!
foo()
}
}
fun main(args: Array<String>) {
// Shouldn't stop inside test()
AA().test()
AA().other()
}
// ADDITIONAL_BREAKPOINT: stopInWrongClass.Other.kt: Breakpoint 1
@@ -0,0 +1,9 @@
LineBreakpoint created at stopInWrongClass.Other.kt:6
LineBreakpoint created at stopInWrongClass.kt:11
Run Java
Connected to the target VM
stopInWrongClass.kt:11
stopInWrongClass.kt:12
Disconnected from the target VM
Process finished with exit code 0