@@ -121,10 +121,9 @@ void first_parameter_offset() {
121121 assertThat (SymbolUtils .firstParameterOffset (functionSymbol , true )).isZero ();
122122 }
123123
124-
125124 @ Test
126125 void get_overridden_method () {
127- FileInput file = PythonTestUtils .parse ( new SymbolTableBuilder ("my_package" , pythonFile ("my_module.py" )),
126+ FileInput file = PythonTestUtils .parse (new SymbolTableBuilder ("my_package" , pythonFile ("my_module.py" )),
128127 "def foo(): pass" ,
129128 "def foo2():" ,
130129 " def foo3(): pass" ,
@@ -142,15 +141,14 @@ void get_overridden_method() {
142141 "class E(foo2):" ,
143142 " def foo8(): pass" ,
144143 "class MyStr(str):" ,
145- " def capitalize(self): pass"
146- );
144+ " def capitalize(self): pass" );
147145
148146 FunctionSymbol foo = (FunctionSymbol ) descendantFunction (file , "foo" ).name ().symbol ();
149147 FunctionSymbol foo2 = (FunctionSymbol ) descendantFunction (file , "foo2" ).name ().symbol ();
150148 FunctionSymbol foo3 = (FunctionSymbol ) descendantFunction (file , "foo3" ).name ().symbol ();
151149 FunctionSymbol foo4 = (FunctionSymbol ) descendantFunction (file , "foo4" ).name ().symbol ();
152150 FunctionSymbol foo5 = (FunctionSymbol ) descendantFunction (file , "foo5" ).name ().symbol ();
153- FunctionSymbol foo5_override = (FunctionSymbol ) ((FunctionDef ) ((ClassDefImpl )file .statements ().statements ().get (4 )).body ().statements ().get (0 )).name ().symbol ();
151+ FunctionSymbol foo5_override = (FunctionSymbol ) ((FunctionDef ) ((ClassDefImpl ) file .statements ().statements ().get (4 )).body ().statements ().get (0 )).name ().symbol ();
154152 FunctionSymbol foo6 = (FunctionSymbol ) descendantFunction (file , "foo6" ).name ().symbol ();
155153 FunctionSymbol foo7 = (FunctionSymbol ) descendantFunction (file , "foo7" ).name ().symbol ();
156154 FunctionSymbol foo8 = (FunctionSymbol ) descendantFunction (file , "foo8" ).name ().symbol ();
@@ -176,8 +174,8 @@ void get_overridden_method() {
176174 assertThat (SymbolUtils .canBeAnOverridingMethod (foo8 )).isTrue ();
177175 assertThat (SymbolUtils .getOverriddenMethod (foo_int )).isEmpty ();
178176 assertThat (SymbolUtils .canBeAnOverridingMethod (foo_int )).isTrue ();
179- assertThat ( SymbolUtils . getOverriddenMethod ( capitalize , SymbolUtils :: getFirstAlternativeIfEqualArgumentNames )). isNotEmpty ( );
180-
177+ List < FunctionSymbol > overriddenMethod = SymbolUtils . getOverriddenMethods ( capitalize );
178+ assertThat ( SymbolUtils . getFirstAlternativeIfEqualArgumentNames ( overriddenMethod )). isNotEmpty ();
181179 assertThat (SymbolUtils .canBeAnOverridingMethod (null )).isTrue ();
182180 String [] strings = {
183181 "class F:" ,
@@ -207,15 +205,13 @@ void get_overridden_method() {
207205 void getFunctionSymbolsTest () {
208206 assertThat (SymbolUtils .getFunctionSymbols (null )).isEmpty ();
209207
210- var file = PythonTestUtils .parse ( new SymbolTableBuilder ("my_package" , pythonFile ("my_module.py" )),
208+ var file = PythonTestUtils .parse (new SymbolTableBuilder ("my_package" , pythonFile ("my_module.py" )),
211209 "class MyStr(str):" ,
212- " def capitalize(self): pass"
213- );
210+ " def capitalize(self): pass" );
214211 var capitalize = (FunctionSymbolImpl ) descendantFunction (file , "capitalize" ).name ().symbol ();
215212 assertThat (capitalize ).isNotNull ();
216213 assertThat (SymbolUtils .getFunctionSymbols (capitalize )).isNotEmpty ().contains (capitalize );
217214
218-
219215 var owner = (ClassSymbol ) capitalize .owner ();
220216 assertThat (SymbolUtils .getFunctionSymbols (owner )).isEmpty ();
221217 var capitalizeParentSymbol = ((ClassSymbol ) owner .superClasses ().get (0 )).resolveMember ("capitalize" ).orElse (null );
@@ -224,11 +220,11 @@ void getFunctionSymbolsTest() {
224220
225221 @ Test
226222 void getFirstAlternativeIfEqualArgumentNamesTest () {
227- var file = PythonTestUtils .parse ( new SymbolTableBuilder ("my_package" , pythonFile ("my_module.py" )),
223+ var file = PythonTestUtils .parse (new SymbolTableBuilder ("my_package" , pythonFile ("my_module.py" )),
228224 """
229225 class MyClass(dict):
230226 def get(self, key): ...
231-
227+
232228 def foo1(a, b, c): ...
233229 def foo2(a, b, c): ...
234230 def bar(b, c, a): ...
@@ -250,7 +246,7 @@ def qix(c, a, b): ...
250246
251247 @ Test
252248 void isEqualParameterCountAndNamesTest () {
253- var file = PythonTestUtils .parse ( new SymbolTableBuilder ("my_package" , pythonFile ("my_module.py" )),
249+ var file = PythonTestUtils .parse (new SymbolTableBuilder ("my_package" , pythonFile ("my_module.py" )),
254250 "class A:" ,
255251 " def foo1(self, a):" ,
256252 " ..." ,
@@ -259,8 +255,7 @@ void isEqualParameterCountAndNamesTest() {
259255 " ..." ,
260256 "class C:" ,
261257 " def foo3(self, b):" ,
262- " ..."
263- );
258+ " ..." );
264259
265260 FunctionSymbol foo1 = (FunctionSymbol ) descendantFunction (file , "foo1" ).name ().symbol ();
266261 FunctionSymbol foo2 = (FunctionSymbol ) descendantFunction (file , "foo2" ).name ().symbol ();
@@ -273,7 +268,6 @@ void isEqualParameterCountAndNamesTest() {
273268 assertThat (SymbolUtils .isEqualParameterCountAndNames (List .of (foo1 , foo3 ))).isFalse ();
274269 }
275270
276-
277271 @ Nullable
278272 private static FunctionDef descendantFunction (Tree tree , String name ) {
279273 if (tree .is (Tree .Kind .FUNCDEF )) {
@@ -288,7 +282,6 @@ private static FunctionDef descendantFunction(Tree tree, String name) {
288282 .findFirst ().orElse (null );
289283 }
290284
291-
292285 @ Test
293286 void qualifiedNameOrEmpty () {
294287 var callExpr1 = mock (CallExpression .class );
0 commit comments