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

Releases: inferred/FreeBuilder

v1.10.8

22 Nov 16:00
Compare
Choose a tag to compare

This release fixes Java 9 compiler errors by omitting the @Generated annotation if unavailable.

Note: v1.10.7 has been skipped due to build infrastructure issues.

v1.10.6

13 Nov 00:23
Compare
Choose a tag to compare

Builder.from now reuses ImmutableList and ImmutableSet instances where possible, reducing the memory overhead of the modify-rebuild pattern.

v1.10.5

05 Sep 02:14
Compare
Choose a tag to compare

This release fixes a bug where properties of a type with a Builder (which FreeBuilder treats specially) were not generating compilable code if the type was generic (issue #183).

v1.10.4

01 Jul 12:46
Compare
Choose a tag to compare

This release fixes mergeFrom to always ignore default values in the merged-in builder/value instance (issues #97, #98).

@FreeBuilder
public interface Value {
  String property;

  class Builder extends Value_Builder {
    public Value() {
      setProperty("default");
    }
  }
}

Previously, for this type, valueBuilder.setProperty("a").mergeFrom(new Value.Builder()) would incorrectly overwrite the "a" in valueBuilder with "default"; as of this release, the property will retain the value "a".

v1.10.3

23 May 22:24
Compare
Choose a tag to compare

This release now supports generic value types with bounded parameters (issue #146), and also fixes another case of unintentionally requiring Guava (issue #157).

v1.10.2

19 May 22:03
Compare
Choose a tag to compare

This release fixes an accidental dependency on Guava in code generated for values with java.lang.Optional properties when Guava is not available (issue #153).

v1.10.1

01 May 09:46
Compare
Choose a tag to compare

This release fixes a regression introduced in v1.9 where compiling with JDK 8 with a source level of 6/7 would generate illegal Java 8 constructs unless the bootstrap classpath was correctly configured (#148).

v1.10

28 Apr 15:24
Compare
Choose a tag to compare

Builder classes now contain a static from method, so you can condense new Foo.Builder().mergeFrom(foo) to the cleaner Foo.Builder.from(foo) (issue #147).

v1.9

26 Apr 17:01
Compare
Choose a tag to compare

This release adds map and mutate methods to builders when compiled with Java 8+ (issue #6), and allows builder classes to be declared abstract (#126).

Java 8+'s lambda methods allow a more fluent approach to updating properties on a Builder. For example, to increment a property:

Person olderPerson = new Person.Builder()
    .mergeFrom(person)
    .mapAge(age -> age + 1)
    .build();

To delete part of a list:

personBuilder.mutateDescendants(d -> d.subList(3, 5).clear());

To update part of a property with its own builder:

projectBuilder.mutateOwner(b -> b
    .setName("Phil")
    .setDepartment("HR"));

v1.8

15 Apr 22:00
Compare
Choose a tag to compare

This release stops FreeBuilder throwing IllegalStateExceptions when overwriting an entry in a map property, or attempting to remove an entry that is not there, bringing it in line with how the Map interface works.

FreeBuilder previously followed ImmutableMap.Builder's lead in throwing IllegalStateExceptions when putting an entry for a key already present in the map. As FreeBuilder types are frequently subject to modifications rather than always created from scratch, this has turned out to be a bad match for real-world usage. Since the behaviour is changing to be more permissive, i.e. to allow actions that would previously have thrown exceptions, this change is backwards-compatible.