fork(1) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. // Selenium
  8. interface WebElement {}
  9.  
  10. interface FindsByXPath {
  11. <T extends WebElement> List<T> findElementsByXPath(String using);
  12. }
  13.  
  14. // Appium Java Client
  15. interface MobileDriver<T extends WebElement> extends FindsByXPath {
  16. List<T> findElementsByXPath(String xPath);
  17.  
  18. void execute(String driverCommand, Map<String, ?> parameters);
  19.  
  20. }
  21.  
  22.  
  23. // Our Framework
  24. interface IFrameworkBaseDriver extends FindsByXPath {}
  25.  
  26. interface IFrameworkMobileDriver extends
  27. IFrameworkBaseDriver,
  28. MobileDriver
  29. {}
  30.  
  31. class FrameworkMobileDriver implements IFrameworkMobileDriver {
  32.  
  33. @Override
  34. public List<WebElement> findElementsByXPath(String xPath) {
  35. return null;
  36. }
  37.  
  38. @Override
  39. public void execute(String driverCommand, Map<String, ?> parameters) {
  40. }
  41. }
  42.  
  43. /* Name of the class has to be "Main" only if the class is public. */
  44. class Ideone
  45. {
  46. public static void main (String[] args) throws java.lang.Exception
  47. {
  48. new FrameworkMobileDriver().findElementsByXPath("");
  49. }
  50. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:31: error: FrameworkMobileDriver is not abstract and does not override abstract method execute(String,Map) in MobileDriver
class FrameworkMobileDriver implements IFrameworkMobileDriver {
^
Main.java:39: error: name clash: execute(String,Map<String,?>) in FrameworkMobileDriver and execute(String,Map<String,?>) in MobileDriver have the same erasure, yet neither overrides the other
    public void execute(String driverCommand, Map<String, ?> parameters) {
                ^
Main.java:38: error: method does not override or implement a method from a supertype
    @Override
    ^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
3 errors
stdout
Standard output is empty