So, if I understand you correctly, you have a .java source file, a .properties file with some key/value pairs, and you want to search through the .java source file to see if there are keys in the .properties file that were not used? And you want to write a program in Ruby to do this?
Will you only be considering literal references to the keys? What if the keys are dynamically created, like so:
This would mean that the keys "s1", "s2", "s3", etc. are being used in this code.
You could have code that looks like:
Did you want to count references that are in comments in the .java source file? Did you only want to find matches of literals passed to the getProperty(key) method or do you also want to consider variables that can have a valid key value? What about constants that have key values?
Did you want to account for these usages, too? As you can see, there are many different variations you may need to account for.
The best ideas are the crazy ones. If you have a crazy idea and it works, it's really valuable.—Kent Beck
Thanks for your response..You are correct, i have a .java source file, a .properties file with some key/value pairs. My key value pairs are only static.I dont need to count references that are in comments in the .java source file and want to consider variables that can have a valid key value.