File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
lib/src/main/java/com/diffplug/spotless/gherkin Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -54,15 +54,13 @@ FormatterFunc toFormatter() {
5454
5555 Method format ;
5656 Constructor <?> constructor ;
57- Object formatter ;
5857 try {
5958 ClassLoader classLoader = jarState .getClassLoader ();
6059 Class <?> prettyFormatter = classLoader .loadClass ("me.jvt.cucumber.gherkinformatter.PrettyFormatter" );
6160 Class <?>[] constructorArguments = new Class []{int .class };
6261 constructor = prettyFormatter .getConstructor (constructorArguments );
6362 format = prettyFormatter .getMethod ("format" , String .class );
64- formatter = constructor .newInstance (indentSpaces );
65- } catch (ClassNotFoundException | NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException e ) {
63+ } catch (ClassNotFoundException | NoSuchMethodException e ) {
6664 throw new IllegalStateException (String .format ("There was a problem preparing %s dependencies" , MAVEN_COORDINATE ), e );
6765 }
6866
@@ -71,6 +69,8 @@ FormatterFunc toFormatter() {
7169 return s ;
7270 }
7371 try {
72+ Object formatter ;
73+ formatter = constructor .newInstance (indentSpaces );
7474 return (String ) format .invoke (formatter , s );
7575 } catch (InvocationTargetException ex ) {
7676 throw new AssertionError ("Unable to format Gherkin" , ex .getCause ());
You can’t perform that action at this time.
0 commit comments