2121 */
2222package org .scijava .jython .autocompletion ;
2323
24- import java .lang .reflect .Field ;
25- import java .lang .reflect .Method ;
26- import java .lang .reflect .Modifier ;
2724import java .util .ArrayList ;
2825import java .util .Arrays ;
2926import java .util .List ;
@@ -61,7 +58,7 @@ public List<CompletionText> get() {
6158 }
6259 // Or a java class:
6360 try {
64- fieldsAndStaticMethodsInto (Class .forName (this .className ), ac );
61+ DotAutocompletions . staticFieldsAndStaticMethodsInto (Class .forName (this .className ), ac );
6562 return ac ;
6663 } catch (ClassNotFoundException cnfe ) {
6764 msg += "\n Cannot find java class " + this .className ;
@@ -77,7 +74,7 @@ public List<CompletionText> get() {
7774 .map (m -> m .getReturnType ())
7875 .distinct ()
7976 .collect (Collectors .toList ())) {
80- fieldsAndMethodsInto (r , ac );
77+ DotAutocompletions . fieldsAndMethodsInto (r , ac );
8178 }
8279 return ac ;
8380 } catch (ClassNotFoundException cnfe ) {
@@ -94,24 +91,6 @@ public List<CompletionText> get() {
9491 }
9592 return ac ;
9693 }
97-
98- private void fieldsAndStaticMethodsInto (final Class <?> c , final List <CompletionText > ac ) {
99- for (final Field f : c .getDeclaredFields ())
100- if (Modifier .isStatic (f .getModifiers ()))
101- ac .add (new CompletionText (f .getName (), c , f ));
102- for (final Method m : c .getDeclaredMethods ())
103- if (Modifier .isStatic (m .getModifiers ()))
104- ac .add (new CompletionText (m .getName () + "()" , c , m )); // TODO could do a parameter-driven autocompletion
105- }
106-
107- private void fieldsAndMethodsInto (final Class <?> c , final List <CompletionText > ac ) {
108- for (final Field f : c .getDeclaredFields ())
109- if (!Modifier .isStatic (f .getModifiers ()))
110- ac .add (new CompletionText (f .getName (), c , f ));
111- for (final Method m : c .getDeclaredMethods ())
112- if (!Modifier .isStatic (m .getModifiers ()))
113- ac .add (new CompletionText (m .getName () + "()" , c , m )); // TODO could do a parameter-driven autocompletion
114- }
11594
11695 @ Override
11796 public String toString () {
0 commit comments