Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.3
    • Component/s: None
    • Labels:
      None

      Description

      Type

      Replacement of tokens.

      Approach

      The rule description suggests two alternatives, either using valueOf or a string as an argument. Both are fine when the argument is a literal, but only the first one works when it is an identifier. We can always suggest valueOf, as the message does not make the difference.

      Before

      double d = 1.1;
      
      BigDecimal bd1 = new BigDecimal(d);
      BigDecimal bd2 = new BigDecimal(1.1);
      

      After

      double d = 1.1;
      
      BigDecimal bd1 = BigDecimal.valueOf(d);
      BigDecimal bd2 = new BigDecimal("1.1");
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: