Wrong line numbers in error messages when using .java files

That is true, a stack frame is created when a function is executed, but that is not the case here because this compilation error will prevent the sketch being executed. If we add another error Processing reports both errors to be on line 3 :-1:

public class SomeJavaCodeWithErrors // line 1
{                                   // line 2
  public static int testMe()        // line 3
  {                                 // line 4
    // provoking an error!          // line 5
    return asdflkj;                 // line 6, variable does not exist
  }                                 // line 7
                                    // line 8 
  int xxx                           // line 9, missing semicolon
}

In Eclipse it highlights the two lines as having errors.

Screenshot 2024-02-23 at 12.09.07

This appears to be a Processing issue.

1 Like