Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-1192

ambiguous invocation exception for DOMCategory.getAt(Element, String)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-JSR-4
    • 1.0-RC-1
    • None
    • None

    Description

      package groovy.xml.dom.DOMCategory

      defines methods

      public static Object get(Element element, String elementName)

      { return getAt(element, elementName); }

      public static Object getAt(Element element, int i) {
      ...
      public static Object getAt(Element element, String elementName) {
      ...

      a call like

      use(DOMCategory.class){
      myelement['subelementname']
      }
      produces

      Caught: groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method org.apache.xerces.dom.DeferredElementImpl#getAt.
      Cannot resolve which method to invoke for

      {class java.lang.String} due to overlapping prototypes between:
      {class java.lang.String} {class java.lang.String}

      while

      myelement.'subelementname'
      myelement[0]

      both run fine

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            codevise Dierk König
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: