mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
inline chained calls: ensure qualifiers with side effects are preserved (IDEA-199990; IDEA-147989)
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
|
||||
class MyObjBuilder {
|
||||
private NewType memberVar1;
|
||||
|
||||
public NewType convertToNewType(LegacyType arg) {
|
||||
return new NewType();
|
||||
}
|
||||
|
||||
public MyObjBuilder memberVar1(NewType arg) {
|
||||
this.memberVar1 = arg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public MyObj memberVar2() {
|
||||
return new MyObj();
|
||||
}
|
||||
}
|
||||
|
||||
class Main {
|
||||
public static void main(String[] args) {
|
||||
LegacyType lt = new LegacyType();
|
||||
MyObjBuilder myObjBuilder = MyObj.builder();
|
||||
myObjBuilder.memberVar1(myObjBuilder.convertToNewType(lt));
|
||||
MyObj obj = myObjBuilder
|
||||
.memberVar2();
|
||||
}
|
||||
}
|
||||
|
||||
class NewType {
|
||||
}
|
||||
|
||||
class MyObj {
|
||||
public static MyObjBuilder builder() {
|
||||
return new MyObjBuilder();
|
||||
}
|
||||
}
|
||||
|
||||
class LegacyType {}
|
||||
Reference in New Issue
Block a user