org.mutabilitydetector.unittesting.MutabilityAssertionError: Expected: com.github.grundlefleck.AutoValue_Car to be IMMUTABLE but: com.github.grundlefleck.AutoValue_Car is actually NOT_IMMUTABLE Reasons: Field can have an abstract type (com.github.grundlefleck.Registration) assigned to it. [Field: registration, Class: com.github.grundlefleck.AutoValue_Car] Allowed reasons: None.

GitHub | jnorthrup | 2 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    not sure what's wrong here...

    GitHub | 2 years ago | jnorthrup
    org.mutabilitydetector.unittesting.MutabilityAssertionError: Expected: com.github.grundlefleck.AutoValue_Car to be IMMUTABLE but: com.github.grundlefleck.AutoValue_Car is actually NOT_IMMUTABLE Reasons: Field can have an abstract type (com.github.grundlefleck.Registration) assigned to it. [Field: registration, Class: com.github.grundlefleck.AutoValue_Car] Allowed reasons: None.
  2. 0

    GitHub comment 33#11697514

    GitHub | 4 years ago | neomatrix369
    org.mutabilitydetector.unittesting.MutabilityAssertionError: Expected: OnlyPrivateConstructors to be IMMUTABLE but: OnlyPrivateConstructors is actually NOT_IMMUTABLE Reasons: Can be subclassed, therefore parameters declared to be this type could be mutable subclasses at runtime. [Class: OnlyPrivateConstructors] Field can have a mutable type (java.lang.String) assigned to it. [Field: field, Class: OnlyPrivateConstructors] Allowed reasons: None.
  3. 0

    GitHub comment 86#219304639

    GitHub | 9 months ago | harikrishna553
    org.mutabilitydetector.unittesting.MutabilityAssertionError: Expected: mutability.Student to be IMMUTABLE but: mutability.Student is actually NOT_IMMUTABLE Reasons: Field can have a mutable type (java.util.ArrayList) assigned to it. [Field: hobbies, Class: mutability.Student] Allowed reasons: None.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    MutabilityDetector is not thread safe

    GitHub | 1 year ago | Stephan202
    org.mutabilitydetector.unittesting.MutabilityAssertionError: Expected: com.example.Test$1DummyClass to be IMMUTABLE but: com.example.Test$1DummyClass is actually NOT_IMMUTABLE Reasons: There is a field assigned which creates a circular reference. [Field: sortedSet, Class: com.example.Test$1DummyClass] Allowed reasons: None.

    Root Cause Analysis

    1. org.mutabilitydetector.unittesting.MutabilityAssertionError

      Expected: com.github.grundlefleck.AutoValue_Car to be IMMUTABLE but: com.github.grundlefleck.AutoValue_Car is actually NOT_IMMUTABLE Reasons: Field can have an abstract type (com.github.grundlefleck.Registration) assigned to it. [Field: registration, Class: com.github.grundlefleck.AutoValue_Car] Allowed reasons: None.

      at org.mutabilitydetector.unittesting.internal.AssertionReporter.assertThat()
    2. org.mutabilitydetector.unittesting
      MutabilityAssert.assertImmutable
      1. org.mutabilitydetector.unittesting.internal.AssertionReporter.assertThat(AssertionReporter.java:43)
      2. org.mutabilitydetector.unittesting.MutabilityAsserter.assertImmutable(MutabilityAsserter.java:102)
      3. org.mutabilitydetector.unittesting.MutabilityAssert.assertImmutable(MutabilityAssert.java:629)
      3 frames
    3. com.github.grundlefleck
      CarTest.isImmutable
      1. com.github.grundlefleck.CarTest.isImmutable(CarTest.java:21)
      1 frame
    4. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:483)
      4 frames
    5. JUnit
      ParentRunner.run
      1. org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
      2. org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      3. org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
      4. org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      5. org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
      6. org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
      7. org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
      8. org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
      9. org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
      10. org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
      11. org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
      12. org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
      13. org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      13 frames
    6. JUnit4 Provider
      JUnit4Provider.invoke
      1. org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
      2. org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
      3. org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
      3 frames
    7. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:483)
      4 frames
    8. SureFire
      ForkedBooter.main
      1. org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
      2. org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
      3. org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
      4. org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
      5. org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
      5 frames