mbien commented on a change in pull request #3240:
URL: https://github.com/apache/netbeans/pull/3240#discussion_r777224573
##########
File path: java/java.hints/src/org/netbeans/modules/java/hints/perf/Tiny.java
##########
@@ -462,36 +485,94 @@ public static ErrorDescription
redundantToString(HintContext ctx) {
suppressWarnings = "UnnecessaryTemporaryOnConversionFromString"
)
public static ErrorDescription unnecessaryTempFromString(HintContext ctx) {
- TypeMirror resType =
ctx.getInfo().getTrees().getTypeMirror(ctx.getPath());
- if (resType == null) {
- return null;
+
+ String type;
+ String method;
+
+ // determine if the destination is primitive
+ TypeMirror destType = getDestinationType(ctx, ctx.getPath());
+ TypeMirror srcType =
ctx.getInfo().getTrees().getTypeMirror(ctx.getPath());
+
+ if (destType instanceof PrimitiveType && !(srcType instanceof
PrimitiveType)) {
Review comment:
good to know -> switched everything to getKind()
--
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