EA-210460: Use 'safeAllLineLocations()' instead of throwing 'allLineLocations()'
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
+1
-1
@@ -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)
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user