You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for (PsiClasscurrGrpcServerClass : grpcServerClassesInFile) {
62
+
if (JavaPsiUtils.isBaseClass(currGrpcServerClass)) {
63
+
// if has no super class then it is the generated GRPC server class, we do not want it
64
+
Log.log(LOGGER::debug, "endpointDiscovery, skip bindableService GrpcServerClass fqn='{}' since it is the generated GRPC base service", currGrpcServerClass.getQualifiedName());
65
+
continue;
66
+
}
67
+
Log.log(LOGGER::debug, "endpointDiscovery, bingo - its a GRPC server class, its fqn='{}'", currGrpcServerClass.getQualifiedName());
Log.log(LOGGER::debug, "addEndpointMethods for grpcServerClass fqn='{}' with evaluated serviceName='{}'", grpcServerClass.getQualifiedName(), grpcServiceName);
Objects.requireNonNull(methodInfo, "method info " + endpointInfo.getContainingMethodId() + " must exist in DocumentInfo for " + documentInfo.getFileUri());
PsiClassgeneratedGrpcBasePsiClass = JavaPsiUtils.climbUpToBaseClass(grpcServerClass); // for example GreeterGrpc.GreeterImplBase
94
+
PsiClassgeneratedGrpcContainingPsiClass = generatedGrpcBasePsiClass.getContainingClass(); // for example GreeterGrpc
95
+
if (generatedGrpcContainingPsiClass == null) {
96
+
Log.log(LOGGER::warn, "evaluateServiceName:#PotentialBug: could not find containing (generated) class for generated GRPC ImplBase Class fqn='{}'", generatedGrpcBasePsiClass.getQualifiedName());
97
+
returnDIGMA_UNKNOWN_SERVICE_NAME; // very unlikely
98
+
}
99
+
100
+
// searching for generated field named SERVICE_NAME, for example :
101
+
// public static final String SERVICE_NAME = "helloworld.Greeter"
Log.log(LOGGER::warn, "evaluateServiceName:#PotentialBug: could not find field 'SERVICE_NAME' in containing (generated) class of GRPC fqn='{}'", generatedGrpcContainingPsiClass.getQualifiedName());
105
+
returnDIGMA_UNKNOWN_SERVICE_NAME; // very unlikely
Log.log(LOGGER::warn, "evaluateServiceName:#PotentialBug: could not evaluate value of field 'SERVICE_NAME' in containing (generated) class of GRPC fqn='{}', with field={}", generatedGrpcContainingPsiClass.getQualifiedName(), serviceNamePsiField);
111
+
returnDIGMA_UNKNOWN_SERVICE_NAME; // very unlikely
0 commit comments