New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error checker update #4042

merged 7 commits into from Oct 22, 2015


None yet
2 participants

JakubValtar commented Oct 22, 2015

Fixes #4034, does not guarantee support for all Java 7 features (only some), but warns about lambdas not being available. Lambdas are not supported, because they make ANTLR angry.

While I was at it I also simplified error checking once again and deleted lots of unused code. CompilationChecker was reduced to one method and one inner class, which I moved to error checker itself.

I enabled some warnings which should help beginners with basic programming problems:

  • no effect assignment x = x;
  • accidental boolean assignment instead of comparison boolean x = true; if (x = false) return;
  • null reference vec = null; vec.copy();
  • potential null reference (under some conditions, your code can result in NPE here)
  • redundant null check (it is guaranteed that variable is not null here, no need to check it)
  • redundant type arguments (you can use diamond here, e.g. new ArrayList<>()) ignored, ANTLR can't do diamonds
  • unused labels, unused local variables, unused parameters in functions, unused private members
  • unused object allocation new PVector(); // no assignment and no method call

benfry added a commit that referenced this pull request Oct 22, 2015

@benfry benfry merged commit d295d8c into processing:master Oct 22, 2015


This comment has been minimized.

Show comment
Hide comment

benfry Oct 22, 2015




benfry commented Oct 22, 2015


@JakubValtar JakubValtar deleted the JakubValtar:error-checker-update branch Oct 22, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment