File tree 2 files changed +10
-2
lines changed
marker/jvm-marker/src/main/kotlin/spp/jetbrains/marker/jvm/detect/endpoint
2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,11 @@ class SkywalkingTraceEndpoint : JVMEndpointNameDetector {
67
67
override fun determineEndpointName (element : KtNamedFunction ): Future <List <DetectedEndpoint >> {
68
68
val promise = Promise .promise<List <DetectedEndpoint >>()
69
69
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
+ }
71
75
if (annotation != null ) {
72
76
val operationNameExpr = getAttributeValue(annotation, " operationName" )
73
77
val value = if (operationNameExpr is KtStringTemplateExpression ) {
Original file line number Diff line number Diff line change @@ -80,7 +80,11 @@ class SpringMVCEndpoint : JVMEndpointNameDetector {
80
80
val promise = Promise .promise<List <DetectedEndpoint >>()
81
81
ApplicationManager .getApplication().runReadAction {
82
82
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
+ }
84
88
if (annotation != null ) {
85
89
val detectedEndpoint = handleAnnotation(false , annotation, annotationName)
86
90
val classRequestMapping = element.containingClass()
You can’t perform that action at this time.
0 commit comments