Uploaded image for project: 'SonarJava'
  1. SonarJava
  2. SONARJAVA-3539

FP in S5845 when BigDecimal and BigInteger are compared with string

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.9
    • Component/s: Rules
    • Labels:

      Description

      AssertJ supports the comparison of BigDecimal and BigInteger with a String.

          BigDecimal myBigDecimal = BigDecimal.valueOf(1.001);
          assertThat(myBigDecimal).isEqualTo("1.001"); // Compliant, FP
      
          BigInteger myBigInt = BigInteger.valueOf(1231);
          assertThat(myBigInt).isEqualTo("1231"); // Compliant, FP
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                quentin.jaquier Quentin Jaquier
                Reporter:
                quentin.jaquier Quentin Jaquier
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: