From 304b0b46cf397b6a52c4541decba2e4dfbb3e287 Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Sun, 9 Aug 2020 16:02:39 -0700 Subject: [PATCH] Fix #663. --- .../java/com/diffplug/spotless/maven/java/ImportOrder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin-maven/src/main/java/com/diffplug/spotless/maven/java/ImportOrder.java b/plugin-maven/src/main/java/com/diffplug/spotless/maven/java/ImportOrder.java index 7d2e4f2135..9005760240 100644 --- a/plugin-maven/src/main/java/com/diffplug/spotless/maven/java/ImportOrder.java +++ b/plugin-maven/src/main/java/com/diffplug/spotless/maven/java/ImportOrder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 DiffPlug + * Copyright 2016-2020 DiffPlug * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,6 +40,8 @@ public FormatterStep newFormatterStep(FormatterStepConfig config) { } else { return ImportOrderStep.forJava().createFrom(order.split(",")); } + } else if (file == null && order == null) { + return ImportOrderStep.forJava().createFrom(); } else { throw new IllegalArgumentException("Must specify exactly one of 'file' or 'order'."); }