Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8194701 | 11 | Jonathan Gibbons | P4 | Resolved | Fixed | b01 |
JDK-8194799 | 10.0.1 | Jonathan Gibbons | P4 | Resolved | Fixed | b01 |
FULL PRODUCT VERSION :
A DESCRIPTION OF THE PROBLEM :
As I mentioned in this link: https://stackoverflow.com/questions/47390432/functional-interface-with-default-behavior-with-serializable
I think the behavior of compiler is wrong.
When an Interface with no default method extends Serializable everythings works fine. But When a default method for that interface comes in picture we have a warning that says:
MyInterface.java: serializable class MyInterface has no definition of serialVersionUID
It got intersting when I change that interface to a abstract class. The error disappears.
To sum up the warning happening table is as below:
|----------------------------|------------------|
| Type | WARNING |
|----------------------------|------------------|
| interface with no defaults | NO |
|----------------------------|------------------|
| interface with defaults | YES |
|----------------------------|------------------|
| abstract class | NO |
|----------------------------|------------------|
Is there any reason for that or it's just a bug?
REPRODUCIBILITY :
This bug can be reproduced always.
A DESCRIPTION OF THE PROBLEM :
As I mentioned in this link: https://stackoverflow.com/questions/47390432/functional-interface-with-default-behavior-with-serializable
I think the behavior of compiler is wrong.
When an Interface with no default method extends Serializable everythings works fine. But When a default method for that interface comes in picture we have a warning that says:
MyInterface.java: serializable class MyInterface has no definition of serialVersionUID
It got intersting when I change that interface to a abstract class. The error disappears.
To sum up the warning happening table is as below:
|----------------------------|------------------|
| Type | WARNING |
|----------------------------|------------------|
| interface with no defaults | NO |
|----------------------------|------------------|
| interface with defaults | YES |
|----------------------------|------------------|
| abstract class | NO |
|----------------------------|------------------|
Is there any reason for that or it's just a bug?
REPRODUCIBILITY :
This bug can be reproduced always.
- backported by
-
JDK-8194701 Interface with defaults invalid compiler warning for Serializable
-
- Resolved
-
-
JDK-8194799 Interface with defaults invalid compiler warning for Serializable
-
- Resolved
-
- relates to
-
JDK-6356530 -Xlint:serial does not flag abstract classes with concrete methods/members
-
- Closed
-