sdedic commented on code in PR #4053:
URL: https://github.com/apache/netbeans/pull/4053#discussion_r862650241


##########
enterprise/micronaut/src/org/netbeans/modules/micronaut/completion/MicronautDataCompletionTask.java:
##########
@@ -249,9 +250,16 @@ private <T> void 
resolveFinderMethods(CompilationController cc, TreePath path, S
             for (ExecutableElement method : 
ElementFilter.methodsIn(entity.getEnclosedElements())) {
                 String methodName = method.getSimpleName().toString();
                 if (methodName.startsWith(GET) && 
method.getParameters().isEmpty()) {
-                    prop2Types.put(methodName.substring(GET.length()), 
tu.getTypeName(method.getReturnType()).toString());
+                    methodName = methodName.substring(GET.length());
+                    methodName = methodName.substring(0, 1).toUpperCase() + 
methodName.substring(1);
+                    prop2Types.put(methodName, 
tu.getTypeName(method.getReturnType()).toString());

Review Comment:
   I'd check the `method.getReturnType()` to be valid / not erroneous, just in 
case - with unresolved types, generics may work / display bad



##########
enterprise/micronaut/src/org/netbeans/modules/micronaut/completion/MicronautDataCompletionTask.java:
##########
@@ -249,9 +250,16 @@ private <T> void 
resolveFinderMethods(CompilationController cc, TreePath path, S
             for (ExecutableElement method : 
ElementFilter.methodsIn(entity.getEnclosedElements())) {
                 String methodName = method.getSimpleName().toString();
                 if (methodName.startsWith(GET) && 
method.getParameters().isEmpty()) {
-                    prop2Types.put(methodName.substring(GET.length()), 
tu.getTypeName(method.getReturnType()).toString());
+                    methodName = methodName.substring(GET.length());
+                    methodName = methodName.substring(0, 1).toUpperCase() + 
methodName.substring(1);

Review Comment:
   Missing case for `get` method with no suffix -> no property defined. Use 
`toUpperCase` with locale (ENGLISH or ROOT -- just found it exists :))



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to