-
Bug
-
Resolution: Fixed
-
P2
-
11
-
b11
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8268357 | 11.0.13-oracle | Adam Sotona | P2 | Closed | Fixed | b02 |
JDK-8268271 | 11.0.13 | Aditya Mandaleeka | P2 | Resolved | Fixed | b01 |
There are two issues with this strategy:
1) There are cases where the client code doesn't catch the exception and doesn't report to log gracefully (e.g. uses in LambdaToMethod)
2) There are use cases where it's ok to have illegal signatures, because they won't end up in classfile.
Test case:
import java.awt.*;
import java.awt.event.*;
import java.util.List;
import java.util.function.*;
class JDK11CompilerBug {
interface IFilter {
Component getComponent();
}
static class Filter implements IFilter {
@Override
public Component getComponent() { return null; }
}
public Component buildFilter(List<? extends Filter> l, Dialog dialog) {
Panel c = new Panel();
l.stream()
.map(f -> {
Button btn = (Button) f.getComponent();
btn.addActionListener((java.io.Serializable & ActionListener)evt -> {
applyFilter(f);
dialog.setVisible(false);
});
return btn;
})
.forEach(c::add);
return c;
}
private void applyFilter(IFilter f) {}
}
bug report and discussion: http://mail.openjdk.java.net/pipermail/compiler-dev/2018-September/012372.html
- backported by
-
JDK-8268271 Compiler crashes because of illegal signature in otherwise legal code
-
- Resolved
-
-
JDK-8268357 Compiler crashes because of illegal signature in otherwise legal code
-
- Closed
-
- duplicates
-
JDK-8212750 Covariant lambda parameter causes compiler to crash
-
- Closed
-
- relates to
-
JDK-8203436 javac should fail early when emitting illegal signature attributes
-
- Closed
-
(1 links to)