-
Bug
-
Resolution: Fixed
-
P3
-
8
-
b86
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8142250 | emb-9 | Srikanth Adayapalam | P3 | Resolved | Fixed | team |
There are some cases, in which deprecated warnings are expected but are missing.
First mini case:
Method reference of void method:
class A {
@Deprecated
public static int foo(){ return 1;}
public void run(){
Func b = A::foo;
}
}
@FunctionalInterface
interface Func{
int meth();
}
Second mini case:
Method reference of constructor:
class A {
public void run(){
Func b = Deprec::new;
}
}
@FunctionalInterface
interface Func{
Deprec meth();
}
class Deprec {
@Deprecated
public Deprec(){}
}
First case works only if method foo() and run() are in the same class,
but second works only if constructor and run() are from different classes.
First mini case:
Method reference of void method:
class A {
@Deprecated
public static int foo(){ return 1;}
public void run(){
Func b = A::foo;
}
}
@FunctionalInterface
interface Func{
int meth();
}
Second mini case:
Method reference of constructor:
class A {
public void run(){
Func b = Deprec::new;
}
}
@FunctionalInterface
interface Func{
Deprec meth();
}
class Deprec {
@Deprecated
public Deprec(){}
}
First case works only if method foo() and run() are in the same class,
but second works only if constructor and run() are from different classes.
- backported by
-
JDK-8142250 Deprecated warning in method reference are missing in some cases.
-
- Resolved
-