This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
For some Java hints it would be useful to have something like org.netbeans.modules.java.hints.errors.Utilities.isConstantString available in a public API. More generally you may need to know the constant value, and expressions of primitive (rather than String) type may be of interest too. I would suggest a signature like Object getConstantValue(CompilationInfo info, TreePath tp) which could return a String, primitive wrapper, or null, akin to the method of the same name in VariableElement. This could subsume isConstantString: boolean isConst = Whatever.getConstantValue(...) instanceof String; as well as ArithmeticUtilities.compute and probably some other code in java.hints (like the scanner in Regexp.hint).