I have a Java program that at some point eventually creates a string that is matched by "schema.sql". I want to find where in the source code this happens. Searching "schema.sql" on the source code does not yield the location. Instead the program must create the string at runtime. I just don't know where. It happens in some library on my project. How can I find where my program creates this string?
Can I watch the heap at runtime somehow for a string that is matched by "schema.sql"? I looked at things like VisualVM but it looks like it only analyzes heap dumps, not the running state of the heap. There must be a way to do this; any ideas?