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)
|
val targetClasses = ArrayList<ReferenceType>(1)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
for (location in outerClass.allLineLocations()) {
|
for (location in outerClass.safeAllLineLocations()) {
|
||||||
val locationLine = location.lineNumber() - 1
|
val locationLine = location.lineNumber() - 1
|
||||||
if (locationLine < 0) {
|
if (locationLine < 0) {
|
||||||
// such locations are not correspond to real lines in code
|
// such locations are not correspond to real lines in code
|
||||||
|
|||||||
+1
-1
@@ -127,7 +127,7 @@ class KotlinSourcePositionProvider : SourcePositionProvider() {
|
|||||||
val debugProcess = context.debugProcess
|
val debugProcess = context.debugProcess
|
||||||
if (debugProcess != null) {
|
if (debugProcess != null) {
|
||||||
try {
|
try {
|
||||||
val locations = type.allLineLocations()
|
val locations = type.safeAllLineLocations()
|
||||||
if (!locations.isEmpty()) {
|
if (!locations.isEmpty()) {
|
||||||
val lastLocation = locations.get(locations.size - 1)
|
val lastLocation = locations.get(locations.size - 1)
|
||||||
return debugProcess.positionManager.getSourcePosition(lastLocation)
|
return debugProcess.positionManager.getSourcePosition(lastLocation)
|
||||||
|
|||||||
+1
-1
@@ -47,7 +47,7 @@ abstract class KotlinSyntheticTypeComponentProviderBase: SyntheticTypeComponentP
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
return !typeComponent.declaringType().allLineLocations().any { it.lineNumber() != 1 }
|
return !typeComponent.declaringType().safeAllLineLocations().any { it.lineNumber() != 1 }
|
||||||
}
|
}
|
||||||
catch(e: AbsentInformationException) {
|
catch(e: AbsentInformationException) {
|
||||||
return false
|
return false
|
||||||
|
|||||||
Reference in New Issue
Block a user