For example, let's say I want to find all instances of using the == operator with any string object, so that I can replace it with .equals() instead. How can I do such a search? Otherwise I'd have to pick through all my code line-by-line... Thanks :)
+4
A:
Eclipse doesn't have any special search capabilities for operators. That doesn't mean that you can't do a file search for them though.
You're probably better off running PMD to find issues like this for you.
Kevin
2009-01-29 00:21:07
+1 PMD. Add FindBugs, too.
matt b
2009-01-29 00:31:39
PMD allows you to write your own rules very easily, using XPath or Java. Does FindBugs do that too?
erickson
2009-01-29 00:48:55
"Does FindBugs do that too?"Not *easily*. ;o)
yawmark
2009-01-29 01:15:26
A:
Do a File Search for '=="' and '== "' in all files.
CTRL-H -> File Search tab
Containing text: =="
File name patterns: *.java
And then do the same for the string == " (note there is a space between the == and the "
stephendl
2009-01-29 00:27:44
+1
A:
FindBugs may produce warning for this type of coding as well.
Peter Lawrey
2009-01-29 07:31:40