Skip to content

Unable to inherit from MobileElement class for version 3.1.0 #220

Description

@alewang

I am unable to inherit from the MobileElement class. One of the samples of the errors I see is:

- The return types are incompatible for the inherited methods
FindsByLinkText.findElementsByLinkText(String),
MobileElement.findElementsByLinkText(String)

I took a look through the source code, and it seems the cause is due to the DefaultGenericMobileElement class (MobileElement's parent class) extending from RemoteWebElements and implementing the various interfaces. The method signatures in RemoteWebElements and the Generic* interfaces match exactly, but they have different return types. RemoteWebElement's methods' return types are of the type List, while the return types for the various interfaces are List (with T being the parametrized type).

I would like to extend from the MobileElement class for some very specific functionality. I tried using the @SuppressWarnings annotation with various names (including "all"), but nothing seems to tell Eclipse that this error is not a problem.

What can I do on my end to "fix" this error?

What can I do for Appium to prevent these conflicting, overlapping methods with equivalent signatures from well.... overlapping?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions