EA-210460: Use 'safeAllLineLocations()' instead of throwing 'allLineLocations()'

This commit is contained in:
Yan Zhulanow
2019-11-15 01:13:54 +09:00
parent aaa45425da
commit ffeef6c18d
3 changed files with 3 additions and 3 deletions
@@ -306,7 +306,7 @@ private fun DebugProcess.findTargetClasses(outerClass: ReferenceType, lineAt: In
val targetClasses = ArrayList<ReferenceType>(1)
try {
for (location in outerClass.allLineLocations()) {
for (location in outerClass.safeAllLineLocations()) {
val locationLine = location.lineNumber() - 1
if (locationLine < 0) {
// such locations are not correspond to real lines in code
@@ -127,7 +127,7 @@ class KotlinSourcePositionProvider : SourcePositionProvider() {
val debugProcess = context.debugProcess
if (debugProcess != null) {
try {
val locations = type.allLineLocations()
val locations = type.safeAllLineLocations()
if (!locations.isEmpty()) {
val lastLocation = locations.get(locations.size - 1)
return debugProcess.positionManager.getSourcePosition(lastLocation)
@@ -47,7 +47,7 @@ abstract class KotlinSyntheticTypeComponentProviderBase: SyntheticTypeComponentP
return false
}
return !typeComponent.declaringType().allLineLocations().any { it.lineNumber() != 1 }
return !typeComponent.declaringType().safeAllLineLocations().any { it.lineNumber() != 1 }
}
catch(e: AbsentInformationException) {
return false