File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
compiler/src/main/java/io/jbock/simple/processor/util Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -14,16 +14,17 @@ public final class Printing {
1414
1515 public static final String INDENT = " " ;
1616 public static final String DOUBLE_INDENT = INDENT + INDENT ;
17-
17+
1818 public static String elementToString (Element element ) {
1919 if (element .getKind () == ElementKind .PARAMETER ) {
2020 return Visitors .PARAMETER_VISITOR .visit (element ).getSimpleName ().toString ();
2121 }
22- if (!(element instanceof ExecutableElement )) {
23- throw new IllegalArgumentException ("unexpected kind: " + element .getKind ());
22+ ExecutableElement executableElement = EXECUTABLE_ELEMENT_VISITOR .visit (element );
23+ if (executableElement == null ) {
24+ throw new UnsupportedOperationException ("Can't determine string for element " + element );
2425 }
25- StringBuilder result = enclosingTypeAndMemberName (( ExecutableElement ) element );
26- result .append (EXECUTABLE_ELEMENT_VISITOR . visit ( element ) .getParameters ().stream ()
26+ StringBuilder result = enclosingTypeAndMemberName (executableElement );
27+ result .append (executableElement .getParameters ().stream ()
2728 .map (parameter -> TypeName .get (parameter .asType ()).toString ())
2829 .collect (joining (", " , "(" , ")" )));
2930 return result .toString ();
You can’t perform that action at this time.
0 commit comments