79765847

Date: 2025-09-16 06:37:14
Score: 3.5
Natty:
Report link

However, in all my tests, the import statement for MoreObjects is not being added. Can anyone explain why?

I was running into something similar tonight. I would say try using the fully qualified name in the JavaTemplate, so that maybeAddImport() detects the usage correctly. That worked me!

JavaTemplate template = JavaTemplate.builder("com.google.common.base.MoreObjects.toStringHelper(#{any()})")
.build();
Reasons:
  • Blacklisted phrase (0.5): why?
  • RegEx Blacklisted phrase (2.5): Can anyone explain
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (0.5):
Posted by: NaanProphet