Created
January 29, 2024 11:24
-
-
Save I-Al-Istannen/a95125d20319a999d2255a7fe086e768 to your computer and use it in GitHub Desktop.
Demo of disagreements during javadoc inheritance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
public class Test { | |
public static void main(String[] args) throws IOException { | |
SubMultiSuper multiSuper = new SubMultiSuper(); | |
multiSuper.test(0); // javadoc for the "test" method is the interesting part | |
} | |
public interface SuperInt1 { | |
/** | |
* A test. | |
*/ | |
int test(int a) throws IOException; | |
} | |
public interface SuperInt2 extends SuperInt1 { | |
/** | |
* @param a the a param | |
*/ | |
@Override | |
int test(int a) throws IOException; | |
} | |
public interface SuperInt3 { | |
/** | |
* Never used, shadowed by body in super int 1. | |
* | |
* @throws IOException never | |
*/ | |
int test(int a) throws IOException; | |
} | |
public interface SuperInt4 { | |
/** | |
* @return foo | |
*/ | |
int test(int a) throws IOException; | |
} | |
public static class SubMultiSuper implements SuperInt2, SuperInt3, SuperInt4 { | |
@Override | |
public int test(int a) throws IOException { | |
return 0; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment