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.
Some legacy code I've been patching up contains lots of: if( myString.equalsIgnoreCase("") ) { ... } (I really have no idea what the original coder was thinking, but they did this *everywhere*). It seems that the .equals("") hint/rewriter could trivially be extended to catch these too.
You can create your own hint for this. Here is guide how to create and run your own hint with transformation: http://services.netbeans.org/synergy/client/app/#/case/2637/suite/1175/v/1 Here is code of the hint: $1.equalsIgnoreCase("") :: $1 instanceof java.lang.String => $1.equals("") ;;
There's already a hint to convert equals("") to isEmpty or size() == 0 (for acient JREs) IMHO
Implemented as jet-main#24c71c3cf09b
Integrated into 'main-silver', will be available in build *201504230001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/24c71c3cf09b User: Svata Dedic <sdedic@netbeans.org> Log: #247872: extended String.equals hint to cover equalsIgnoreCase