@@ -83,61 +83,6 @@ public int getOrder() {
83
83
return 42 ;
84
84
}
85
85
}
86
-
87
- @ Test // gh-25706
88
- void defaultMethodInvocation () {
89
- SpelParserConfiguration config = new SpelParserConfiguration (SpelCompilerMode .IMMEDIATE , null );
90
- SpelExpressionParser parser = new SpelExpressionParser (config );
91
-
92
- StandardEvaluationContext context = new StandardEvaluationContext ();
93
- Item item = new Item ();
94
- context .setRootObject (item );
95
-
96
- Expression expression = parser .parseExpression ("#root.isEditable2()" );
97
- assertThat (SpelCompiler .compile (expression )).isFalse ();
98
- assertThat (expression .getValue (context )).isEqualTo (false );
99
- assertThat (SpelCompiler .compile (expression )).isTrue ();
100
- SpelCompilationCoverageTests .assertIsCompiled (expression );
101
- assertThat (expression .getValue (context )).isEqualTo (false );
102
-
103
- context .setVariable ("user" , new User ());
104
- expression = parser .parseExpression ("#root.isEditable(#user)" );
105
- assertThat (SpelCompiler .compile (expression )).isFalse ();
106
- assertThat (expression .getValue (context )).isEqualTo (true );
107
- assertThat (SpelCompiler .compile (expression )).isTrue ();
108
- SpelCompilationCoverageTests .assertIsCompiled (expression );
109
- assertThat (expression .getValue (context )).isEqualTo (true );
110
- }
111
-
112
- public static class User {
113
- boolean isAdmin () {
114
- return true ;
115
- }
116
- }
117
-
118
- public static class Item implements Editable {
119
- // some fields
120
- private String someField = "" ;
121
-
122
- // some getters and setters
123
-
124
- @ Override
125
- public boolean hasSomeProperty () {
126
- return someField != null ;
127
- }
128
- }
129
-
130
- public interface Editable {
131
- default boolean isEditable (User user ) {
132
- return user .isAdmin () && hasSomeProperty ();
133
- }
134
-
135
- default boolean isEditable2 () {
136
- return false ;
137
- }
138
-
139
- boolean hasSomeProperty ();
140
- }
141
86
142
87
143
88
public static class User {
0 commit comments