50 lines better be okay. I post a lot longer than that sometimes.
But now that you know the problem isn't in the code shown here, start a new thread with the appropriate question and code in the JAVA forum, instead.
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.