posted 9 years ago
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.