You should be able to figure this out yourself by EITHER running the application under a debugger OR adding some diagnostic trace prints; e.g. something like this at the appropriate point(s).
System.out.println("any is ==>'" + any + "'<==");
(I bet that this will show that any
doesn't contain what you expect it to ...)
I strongly recommend that you learn to debug your own code rather than asking other people to help. This is a critical skill for a professional software engineer.