Skip to content
This repository was archived by the owner on Oct 16, 2024. It is now read-only.

Commit 4dc9acc

Browse files
committed
Merge pull request #43 from google/troubleshooting-docs
Add Troubleshooting section to README.md.
2 parents d4583d2 + 93110ac commit 4dc9acc

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

README.md

+52
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ _Automatic generation of the Builder pattern for Java 1.6+_
2424
- [Partials](#partials)
2525
- [IDEs](#ides)
2626
- [GWT](#gwt)
27+
- [Troubleshooting](#troubleshooting)
28+
- [Javac](#javac)
29+
- [Eclipse](#eclipse)
30+
- [Online resouces](#online-resouces)
2731
- [Alternatives](#alternatives)
2832
- [AutoValue vs `@FreeBuilder`](#autovalue-vs-freebuilder)
2933
- [Proto vs `@FreeBuilder`](#proto-vs-freebuilder)
@@ -335,6 +339,54 @@ and ensure all necessary types are whitelisted.
335339
[CustomFieldSerializer]: http://www.gwtproject.org/javadoc/latest/com/google/gwt/user/client/rpc/CustomFieldSerializer.html
336340

337341

342+
Troubleshooting
343+
---------------
344+
345+
346+
### Javac
347+
348+
If you make a mistake in your code (e.g. giving your value type a private
349+
constructor), `@FreeBuilder` is designed to output a Builder superclass anyway,
350+
with as much of the interface intact as possible, so the only errors you see
351+
are the ones output by the annotation processor.
352+
353+
Unfortunately, `javac` has a broken design: if _any_ annotation processor
354+
outputs _any error whatsoever_, *all* generated code is discarded, and all
355+
references to that generated code are flagged as broken references. Since
356+
your Builder API is generated, that means every usage of a `@FreeBuilder`
357+
builder becomes an error. This deluge of false errors swamps the actual
358+
error you need to find and fix. (See also [the related issue][issue 3].)
359+
360+
If you find yourself in this situation, search the output of `javac` for the
361+
string "@FreeBuilder type"; nearly all errors include this in their text.
362+
363+
[issue 3]: https://github.com/google/FreeBuilder/issues/3
364+
365+
### Eclipse
366+
367+
Eclipse manages, somehow, to be worse than `javac` here. It will never output
368+
annotation processor errors unless there is another error of some kind; and,
369+
even then, only after an incremental, not clean, compile. In practice, most
370+
mistakes are made while editing the `@FreeBuilder` type, which means the
371+
incremental compiler will flag the errors. If you find a generated superclass
372+
appears to be missing after a clean compile, however, try touching the
373+
relevant file to trigger the incremental compiler. (Or run javac.)
374+
375+
### Online resouces
376+
377+
* If you find yourself stuck, needing help, wondering whether a given
378+
behaviour is a feature or a bug, or just wanting to discuss `@FreeBuilder`,
379+
please join and/or post to [the `@FreeBuilder` mailing list][mailing list].
380+
* To see a list of open issues, or add a new one, see [the `@FreeBuilder`
381+
issue tracker][issue tracker].
382+
* To submit a bug fix, or land a sweet new feature, [read up on how to
383+
contribute][contributing].
384+
385+
[mailing list]: https://groups.google.com/forum/#!forum/freebuilder
386+
[issue tracker]: https://github.com/google/freebuilder/issues
387+
[contributing]: https://github.com/google/FreeBuilder/blob/master/CONTRIBUTING.md
388+
389+
338390
Alternatives
339391
------------
340392

0 commit comments

Comments
 (0)