question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`ExtendsObject` error message is confusing/misleading

See original GitHub issue

The ExtendsObject error message is:

T extends Object is redundant in normal Java, and does not work to describe T as non-null across compilation boundaries when the Checker Framework unless you compile users against bytecode generated by the Checker Framework javac. (If you are building this code with the Checker Framework javac, then disable this check.)”

This error message can be improved.

  • “normal Java” suggests that the Checker Framework is an incompatible variant. The Checker Framework uses standard Java.
  • “compile users” is probably a typo.
  • The message mentions nullness, but extends Object is meaningful for any type system for which the top type is not the default. Several such type systems exist.
  • Use of the “Checker Framework javac” is a red herring. This is relevant to every project that ever uses the Checker Framework, regardless of which version of javac they are running and whether the Checker Framework is run on a particular execution.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
mernstcommented, Aug 4, 2022

To check my understanding, is point that that behaviour is coming from the Checker Framework annotation processor, and occurrs regardless of which javac version it’s running on? Is there a Checker Framework manual reference with more detail on that we should cite?

Yes, that is correct.

A reference is the first paragraph of Command line, via Checker Framework javac wrapper, which says:

It is exactly the same as the OpenJDK javac compiler, with one small difference: it includes the Checker Framework jar file on its classpath.

0reactions
mernstcommented, Aug 5, 2022

BTW, there is a stray close paren and seemingly an unnecessary line break at https://errorprone.info/bugpattern/ExtendsObject .

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to error message on change of group name if it...
Hi All, I have used below script to validate group name if it is already existed or not. But its not working for...
Read more >
Google error-prone Issues - Giters
Google error-prone: Catch common Java mistakes as compile-time errors. ... `ExtendsObject` error message is confusing/misleading. Closed 4 months ago 5 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found