Skip to content

Commit 9df5f56

Browse files
committed
refactor: live insight kotlin support needs work
1 parent d8da26c commit 9df5f56

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

marker/jvm-marker/src/main/kotlin/spp/jetbrains/marker/jvm/detect/endpoint/SkywalkingTraceEndpoint.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ class SkywalkingTraceEndpoint : JVMEndpointNameDetector {
6767
override fun determineEndpointName(element: KtNamedFunction): Future<List<DetectedEndpoint>> {
6868
val promise = Promise.promise<List<DetectedEndpoint>>()
6969
DumbService.getInstance(element.project).runReadActionInSmartMode {
70-
val annotation = element.findAnnotation(FqName(skywalkingTraceAnnotation))
70+
val annotation = try {
71+
element.findAnnotation(FqName(skywalkingTraceAnnotation))
72+
} catch (ignored: Exception) {
73+
null
74+
}
7175
if (annotation != null) {
7276
val operationNameExpr = getAttributeValue(annotation, "operationName")
7377
val value = if (operationNameExpr is KtStringTemplateExpression) {

marker/jvm-marker/src/main/kotlin/spp/jetbrains/marker/jvm/detect/endpoint/SpringMVCEndpoint.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,11 @@ class SpringMVCEndpoint : JVMEndpointNameDetector {
8080
val promise = Promise.promise<List<DetectedEndpoint>>()
8181
ApplicationManager.getApplication().runReadAction {
8282
for (annotationName in qualifiedNameSet) {
83-
val annotation = element.findAnnotation(FqName(annotationName))
83+
val annotation = try {
84+
element.findAnnotation(FqName(annotationName))
85+
} catch (ignored: Exception) {
86+
null
87+
}
8488
if (annotation != null) {
8589
val detectedEndpoint = handleAnnotation(false, annotation, annotationName)
8690
val classRequestMapping = element.containingClass()

0 commit comments

Comments
 (0)