package org.mutabilitydetector.benchmarks;

public class ImmutableByHavingOnlyAPrivateConstructorUsingTheBuilderPattern {

}

@@ -36,16 +36,17 @@
 hmarks;%0A
+ 
 %0Apublic 
@@ -120,7 +120,754 @@
 n %7B%0A
+  private final String field;%0A%09%0A%09// usual method of making a class immutable %0A%09// - make its constructor private: ref EffectiveJava%0A%09private ImmutableByHavingOnlyAPrivateConstructorUsingTheBuilderPattern (String field) %7B%0A%09%09this.field = field;%0A%09%7D%0A%09%0A%09public String getField() %7B%0A%09%09return field;%0A%09%7D%0A%09%0A%09// inner Builder class%0A%09public static class Builder %7B%0A%09%09public ImmutableByHavingOnlyAPrivateConstructorUsingTheBuilderPattern build() %7B%0A%09%09%09// this new OnlyPrivateConstructors() is fooling mutability detector%0A%09%09%09// it thinks OnlyPrivateConstructors() is no longer immutable due to the%0A%09%09%09// ability to call new to create an instance of OnlyPrivateConstructors.%0A%09%09%09return new ImmutableByHavingOnlyAPrivateConstructorUsingTheBuilderPattern(%22hi%22);%0A%09%09%7D%0A%09%7D
 %0A%7D
-%0A

Fix to Issue #33 - pushing the verbose ImmutableBy...