Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-5455

org.apache.axis2.wsdl.databinding.CUtils method isCKeyword is buggy

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.6.2
    • Fix Version/s: None
    • Component/s: databinding
    • Labels:
      None

      Description

      org.apache.axis2.wsdl.databinding.CUtils has method isCKeyword which assumes that CUtils.keywords is sorted array.

      However CUtils.keywords is not sorted array and therefore Arrays.binarySearch fails for example with keyword "friend" (possibly depends on Java version/implementation used).

      It seems that originally CUtils.keywords contained only a short list of C/C++ keywords in sorter array but later there was added list of Microsoft C++ compiler's keywords, which contains also duplicates from previous list of keywords, but overall result is that full array is no longer sorted.

      Here is a JUinit test for you which fails currently if it helps:

      @Test
      public void test() {
      for (String kw : CUtils.keywords)

      { assertTrue(kw, CUtils.isCKeyword(kw)); }

      }

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              tvainika Tommi Vainikainen
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Time Tracking

                Estimated:
                Original Estimate - 24h
                24h
                Remaining:
                Remaining Estimate - 24h
                24h
                Logged:
                Time Spent - Not Specified
                Not Specified