6

I am maintaining an old code base. One of the classes has this method :

someMethod(Param1 a, Param2 b, Param3 c, Param4 d){...};

This method is widely used in many java classes. Like so :

foo.someMethod(valueA, null, valueC, null); 

How can I find which java classes in my code base are using this method where the last parameter is not being passed in as null ?

happybuddha
  • 1,271
  • 2
  • 20
  • 40
  • 2
    This link could help you http://stackoverflow.com/questions/1372748/eclipse-regular-expression-search-and-replace – Ahmet Karakaya Sep 12 '13 at 16:59
  • 2
    @mmc18 this won't do if you split the method call into two or three lines =\ – Luiggi Mendoza Sep 12 '13 at 17:02
  • @LuiggiMendoza exactly :( any one has any ideas ? – happybuddha Sep 12 '13 at 19:03
  • I'm not sure if you can find in eclipse if the method is called with a `null` argument. I would go to the method definition and press Ctrl + Alt + H to find all the places where the method is called, then start doing the refactoring. – Luiggi Mendoza Sep 12 '13 at 19:26
  • 1
    You cannot. You will just have to "View all Usages" and go through each one individually. – ninnemannk Sep 12 '13 at 23:49
  • Going via "View all usages" can be impossible. I'm currently having the same task.. refactoring old code. The method I'm searching for is used 5835 times, but I only care about the ones with a specific parameter... – Korashen Jul 19 '14 at 11:13

0 Answers0