-
Bug
-
Resolution: Fixed
-
P1
-
8
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8036587 | 9 | Vladimir Ivanov | P1 | Resolved | Fixed | b06 |
JDK-8037290 | 8u20 | Vladimir Ivanov | P1 | Closed | Fixed | b07 |
JDK-8037128 | 8u11 | Vladimir Ivanov | P1 | Resolved | Fixed | b01 |
JDK-8036638 | 8u5 | Vladimir Ivanov | P1 | Resolved | Fixed | b12 |
JDK-8036558 | 8 | Vladimir Ivanov | P1 | Closed | Fixed | b132 |
JDK-8037124 | emb-8u6 | Vladimir Ivanov | P1 | Closed | Fixed | b09 |
java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b129)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b69, mixed mode)
FULL OS VERSION :
Microsoft Windows [Version 6.3.9600]
A DESCRIPTION OF THE PROBLEM :
For the description, refer to: http://stackoverflow.com/questions/22096052/method-returns-true-for-a-while-and-then-returns-false-possible-jvm-bug
I have noticed the https://bugs.openjdk.java.net/browse/JDK-8031695
-> However there it is claimed that the bug has been fixed before the build that I am running, which is not the case.
THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: Did not try
THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Did not try
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the code outlined in the description, and the bug will appear.
EXPECTED VERSUS ACTUAL BEHAVIOR :
Expected behaviour is that the output for drawable.isShadowReceiver() and drawable.isShadowCaster() is always true.
Actual behaviour is that it becomes false after a certain number of iterations/invokes.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public abstract class Drawable implements DrawableInterface {
}
interface DrawableInterface {
default public boolean isShadowReceiver() {
return false;
}
default public boolean isShadowCaster() {
return false;
}
}
public interface ShadowDrawable extends DrawableInterface {
@Override
default public boolean isShadowReceiver() {
return true;
}
@Override
default public boolean isShadowCaster() {
return true;
}
}
public class Box extends Drawable implements ShadowDrawable {
}
public class IsolatedBug {
private final Box box;
private final List<Drawable> drawables;
public IsolatedBug() {
this.box = new Box();
this.drawables = new ArrayList<>();
drawables.add(box);
drawables.forEach(drawable -> System.out.println(drawable + " C=" + drawable.isShadowCaster() + "/R=" + drawable.isShadowReceiver()));
}
private void init() throws InterruptedException {
while (true) {
drawables.forEach(drawable -> System.out.println(drawable + " C=" + drawable.isShadowCaster() + "/R=" + drawable.isShadowReceiver()));
Thread.sleep(1000);
}
}
public static void main(String[] args) throws InterruptedException {
new IsolatedBug().init();
}
}
---------- END SOURCE ----------
- backported by
-
JDK-8036587 Default method returns true for a while, and then returns false
- Resolved
-
JDK-8036638 Default method returns true for a while, and then returns false
- Resolved
-
JDK-8037128 Default method returns true for a while, and then returns false
- Resolved
-
JDK-8036558 Default method returns true for a while, and then returns false
- Closed
-
JDK-8037124 Default method returns true for a while, and then returns false
- Closed
-
JDK-8037290 Default method returns true for a while, and then returns false
- Closed
- relates to
-
JDK-8036153 Default method returns true for a while, and then returns false
- Closed
-
JDK-8036580 CHA: Improve default method support
- Resolved