@@ -24,6 +24,10 @@ _Automatic generation of the Builder pattern for Java 1.6+_
24
24
- [ Partials] ( #partials )
25
25
- [ IDEs] ( #ides )
26
26
- [ GWT] ( #gwt )
27
+ - [ Troubleshooting] ( #troubleshooting )
28
+ - [ Javac] ( #javac )
29
+ - [ Eclipse] ( #eclipse )
30
+ - [ Online resouces] ( #online-resouces )
27
31
- [ Alternatives] ( #alternatives )
28
32
- [ AutoValue vs ` @FreeBuilder ` ] ( #autovalue-vs-freebuilder )
29
33
- [ Proto vs ` @FreeBuilder ` ] ( #proto-vs-freebuilder )
@@ -335,6 +339,54 @@ and ensure all necessary types are whitelisted.
335
339
[ CustomFieldSerializer ] : http://www.gwtproject.org/javadoc/latest/com/google/gwt/user/client/rpc/CustomFieldSerializer.html
336
340
337
341
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
+
338
390
Alternatives
339
391
------------
340
392
0 commit comments