api usage inspection: warn if old interface method was made default and class doesn't override it

This commit is contained in:
Anna Kozlova
2014-10-01 18:15:06 +02:00
parent 17cafa940d
commit 71e60700a2
5 changed files with 90 additions and 0 deletions
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<problems>
<problem>
<file>Test.java</file>
<line>3</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Usages of API documented as @since 1.5 (1.6|1.7)</problem_class>
<description>Default method 'remove' is not overridden. It would cause compilation problems with JDK 6</description>
</problem>
</problems>
@@ -0,0 +1,29 @@
import java.util.Iterator;
public class Test implements Iterator<String> {
@Override
public boolean hasNext() {
return false;
}
@Override
public String next() {
return null;
}
static class T implements Iterator<String> {
@Override
public boolean hasNext() {
return false;
}
@Override
public String next() {
return null;
}
@Override
public void remove() {}
}
}