Updating the method to identify the end of file with no main method

Signed-off-by: Herbert Rocha <herberthb12@gmail.com>
Added support to java 1.5 in the java parser

Signed-off-by: Herbert Rocha <herberthb12@gmail.com>