Moved xpath into boostrap java

And removed complex-find while at it.

Submitting to @bootstraponline for review.

I'm working now on changing the getPageSource code to reuse the same code here.
Since there's something special here, can we add a comment explaining what
it is?

Cool, would love to talk.  Email me and we can set up a call.


On Tue, Aug 19, 2014 at 3:48 PM, bootstraponline <notifications@github.com>
wrote:

> In
> lib/devices/android/bootstrap/src/io/appium/android/bootstrap/utils/XMLHierarchy.java:
>
> > +      if (children.item(i).getNodeType() == Node.ELEMENT_NODE) {
> > +        visitNode(children.item(i), instances);
> > +        annotateNodes(children.item(i), instances);
> > +      }
> > +    }
> > +  }
> > +
> > +  private static void visitNode(Node node, HashMap<String, Integer> instances) {
> > +
> > +    Document doc = node.getOwnerDocument();
> > +    NamedNodeMap attributes = node.getAttributes();
> > +
> > +    String androidClass;
> > +    try {
> > +      androidClass = attributes.getNamedItem("class").getNodeValue();
> > +    } catch (Exception e) {
>
> Eric, we should talk. The exception is generic for a reason.
> … <#147efd07218a771a_>
> On Aug 19, 2014 2:27 PM, "Eric Millin" <notifications@github.com> wrote:
> In
> lib/devices/android/bootstrap/src/io/appium/android/bootstrap/utils/XMLHierarchy.java:
> > + if (children.item(i).getNodeType() == Node.ELEMENT_NODE) { > +
> visitNode(children.item(i), instances); > + annotateNodes(children.item(i),
> instances); > + } > + } > + } > + > + private static void visitNode(Node
> node, HashMap<String, Integer> instances) { > + > + Document doc =
> node.getOwnerDocument(); > + NamedNodeMap attributes =
> node.getAttributes(); > + > + String androidClass; > + try { > +
> androidClass = attributes.getNamedItem("class").getNodeValue(); > + } catch
> (Exception e) { can you make this more specific? — Reply to this email
> directly or view it on GitHub <
> https://github.com/appium/appium/pull/3428/files#r16433502>.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/appium/appium/pull/3428/files#r16438651>.
>