diff --git a/src/main/java/org/inferred/freebuilder/processor/excerpt/CheckedBiMap.java b/src/main/java/org/inferred/freebuilder/processor/excerpt/CheckedBiMap.java index 6e6d678f..71731dc2 100644 --- a/src/main/java/org/inferred/freebuilder/processor/excerpt/CheckedBiMap.java +++ b/src/main/java/org/inferred/freebuilder/processor/excerpt/CheckedBiMap.java @@ -50,9 +50,8 @@ public void addTo(SourceBuilder code) { .addLine(" @Override public V put(K key, V value) {") .addLine(" K oldKey = biMap.inverse().get(value);") .addLine(" %s.checkArgument(", Preconditions.class) - .addLine(" oldKey == null || %s.equals(oldKey, key)," - + " \"value already present: %%s\", value);", - Objects.class) + .addLine(" oldKey == null || %s.equals(oldKey, key),", Objects.class) + .addLine(" \"value already present: %%s\", value);") .addLine(" V oldValue = biMap.get(key);") .addLine(" forcePut.accept(key, value);") .addLine(" return oldValue;") @@ -131,9 +130,8 @@ public void addTo(SourceBuilder code) { .addLine(" @Override public V setValue(V value) {") .addLine(" K oldKey = biMap.inverse().get(value);") .addLine(" %s.checkArgument(", Preconditions.class) - .addLine(" oldKey == null || %s.equals(oldKey, key)," - + " \"value already present: %%s\", value);", - Objects.class) + .addLine(" oldKey == null || %s.equals(oldKey, key),", Objects.class) + .addLine(" \"value already present: %%s\", value);") .addLine(" V oldValue = this.value;") .addLine(" this.value = %s.requireNonNull(value);", Objects.class) .addLine(" forcePut.accept(key, value);") diff --git a/src/main/java/org/inferred/freebuilder/processor/property/BiMapProperty.java b/src/main/java/org/inferred/freebuilder/processor/property/BiMapProperty.java index 438168f7..5fdf61c7 100644 --- a/src/main/java/org/inferred/freebuilder/processor/property/BiMapProperty.java +++ b/src/main/java/org/inferred/freebuilder/processor/property/BiMapProperty.java @@ -228,9 +228,8 @@ private void addPut(SourceBuilder code) { unboxedValueType.orElse(valueType)); code.addLine(" %s oldKey = %s.inverse().get(value);", keyType, property.getField()) .addLine(" %s.checkArgument(", Preconditions.class) - .addLine(" oldKey == null || %s.equals(oldKey, key)," - + " \"value already present: %%s\", value);", - Objects.class) + .addLine(" oldKey == null || %s.equals(oldKey, key),", Objects.class) + .addLine(" \"value already present: %%s\", value);") .addLine(" %s(key, value);", forcePutMethod(property)) .addLine(" return (%s) this;", datatype.getBuilder()) .addLine("}");