Uploaded image for project: 'Couchbase Java Client'
  1. Couchbase Java Client
  2. JCBC-259

String starting with number converted to number only in setKey for views

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 1.1.3
    • Fix Version/s: None
    • Component/s: Core
    • Security Level: Public
    • Labels:
      None

      Description

      If a key of "3abc" is passed in to a setKey for a view query, it will convert this into just 3.

      Looking at /src/main/java/com/couchbase/client/protocol/views/Query.java:558
      it looks like NumberFormat.getInstance().parse(value.toString()).toString(); will convert 3abc to 3.

      This is because NumberFormat.parse is define to "Parses text from the beginning of the given string to produce a number. The method may not use the entire text of the given string." so if the string starts with a number it will not fail out and just be used as a string.

        Issue Links

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              daschl Michael Nitschinger
              Reporter:
              james.mauss James Mauss
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes