GeoTools
  1. GeoTools
  2. GEOT-4094

Adding a bracket for multiple conditions in BindingPropertyExtractorxs

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: xsd extensions
    • Labels:
      None
    • Testcase included:
      yes

      Description

      This line of code is causing me problems:

      line 334 in BindingPropertyExtractor:

      if (child.getName().equals(partContent.getName()) &&
              child.getTargetNamespace()==null? partContent.getTargetNamespace()==null :
                   child.getTargetNamespace().equals(partContent.getTargetNamespace())) {
          notFound = false;
          break;
      }
      

      In the unit test I'm writing for app-schema, it doesn't satisfy the first condition (child.getName().equals(partContent.getName())), however it still went on to notFound = false.
      It might be the particular jdk I'm using (jdk 1.6_025 and also tried 1.6_013), or something particular in my environment.
      However, when I put the second statement after '&&' in brackets, the evaluation works fine.
      I attached the patch that wraps the second big statement in brackets.

        Activity

        Hide
        Justin Deoliveira added a comment -
        Patch looks fine to me. Commit as you please.
        Show
        Justin Deoliveira added a comment - Patch looks fine to me. Commit as you please.
        Hide
        Rini Angreani added a comment -
        Thanks Justin.
        Show
        Rini Angreani added a comment - Thanks Justin.
        Hide
        Rini Angreani added a comment -
        Committed revision 38687.
        Show
        Rini Angreani added a comment - Committed revision 38687.

          People

          • Assignee:
            Rini Angreani
            Reporter:
            Rini Angreani
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: