Wrong line numbers in error messages when using .java files

I am not sure whether it is due to the return statement. I get error for void-returning methods, as well as for statements outside methods.

public class SomeJavaCode
{
  // asdoifn;// Uncomment to get an error on line 2  
  
  public void noReturn()
  {
    // Uncomment the following line to get an error on line 3
    // sdjfas       
    System.out.println("Hello!");
  }
  
  public static int testMe()
  {
    int a = 3;
    int b = 5;
    
    // Uncomment the following line to get an error on line 3
    //asdflkj;
    
    int c = a + b;
    return c;   
  } 
  
  public static int testMeAgain()
  {
    int a = 3;
    int b = 5;
    
    // Uncomment the following line to get an error on line 3
    //asdflkj;
    
    int c = a + b;
    return c;      
  }
   //asdoifn; // Uncomment to get an error on line 3
}