Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8044045 | 9 | Paul Govereau | P4 | Closed | Fixed | b15 |
JDK-8045171 | 8u25 | Paul Govereau | P4 | Resolved | Fixed | b01 |
JDK-8052611 | emb-8u26 | Paul Govereau | P4 | Resolved | Fixed | b17 |
FULL PRODUCT VERSION :
java version "1.8.0_20-ea"
Java(TM) SE Runtime Environment (build 1.8.0_20-ea-b10)
Java HotSpot(TM) Client VM (build 25.20-b10, mixed mode)
A DESCRIPTION OF THE PROBLEM :
https://bugs.openjdk.java.net/browse/JDK-8030816
javac (8u20-ea-b10) does't crash but outputs a wrong error message when mixing a lambda expression and an inner class.
-----
//import java.awt.event.*;
import javax.swing.*;
public class Test {
public static void main(String[] args) {
SwingUtilities.invokeLater(() -> {
JFrame frame = new JFrame("Test");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JButton button = new JButton("Test");
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
}
});
frame.add(button);
frame.setSize(160, 160);
frame.setVisible(true);
});
}
}
-----
P.S. Without a lambda expression, javac (8u20-ea-b10) does't output the wrong error message.
-----
//import java.awt.event.*;
import javax.swing.*;
public class Test1 {
public static void main(String[] args) {
// SwingUtilities.invokeLater(() -> {
JFrame frame = new JFrame("Test1");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JButton button = new JButton("Test");
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
}
});
frame.add(button);
frame.setSize(160, 160);
frame.setVisible(true);
// });
}
}
-----
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Test.java:10: error: cannot find symbol
button.addActionListener(new ActionListener() {
^
symbol: class ActionListener
location: class Test
1 error
ACTUAL -
Test.java:12: error: missing return statement
public void actionPerformed(ActionEvent e) {
^
Test.java:10: error: cannot find symbol
button.addActionListener(new ActionListener() {
^
symbol: class ActionListener
location: class Test
2 errors
REPRODUCIBILITY :
This bug can be reproduced always.
java version "1.8.0_20-ea"
Java(TM) SE Runtime Environment (build 1.8.0_20-ea-b10)
Java HotSpot(TM) Client VM (build 25.20-b10, mixed mode)
A DESCRIPTION OF THE PROBLEM :
https://bugs.openjdk.java.net/browse/JDK-8030816
javac (8u20-ea-b10) does't crash but outputs a wrong error message when mixing a lambda expression and an inner class.
-----
//import java.awt.event.*;
import javax.swing.*;
public class Test {
public static void main(String[] args) {
SwingUtilities.invokeLater(() -> {
JFrame frame = new JFrame("Test");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JButton button = new JButton("Test");
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
}
});
frame.add(button);
frame.setSize(160, 160);
frame.setVisible(true);
});
}
}
-----
P.S. Without a lambda expression, javac (8u20-ea-b10) does't output the wrong error message.
-----
//import java.awt.event.*;
import javax.swing.*;
public class Test1 {
public static void main(String[] args) {
// SwingUtilities.invokeLater(() -> {
JFrame frame = new JFrame("Test1");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JButton button = new JButton("Test");
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
}
});
frame.add(button);
frame.setSize(160, 160);
frame.setVisible(true);
// });
}
}
-----
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Test.java:10: error: cannot find symbol
button.addActionListener(new ActionListener() {
^
symbol: class ActionListener
location: class Test
1 error
ACTUAL -
Test.java:12: error: missing return statement
public void actionPerformed(ActionEvent e) {
^
Test.java:10: error: cannot find symbol
button.addActionListener(new ActionListener() {
^
symbol: class ActionListener
location: class Test
2 errors
REPRODUCIBILITY :
This bug can be reproduced always.
- backported by
-
JDK-8045171 wrong error message when mixing lambda expression and inner class
- Resolved
-
JDK-8052611 wrong error message when mixing lambda expression and inner class
- Resolved
-
JDK-8044045 wrong error message when mixing lambda expression and inner class
- Closed
- relates to
-
JDK-8030816 javac crashes when mixing lambdas and inner classes
- Closed