File tree Expand file tree Collapse file tree
main/java/com/palantir/javaformat/java
test/java/com/palantir/javaformat/java Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -273,7 +273,7 @@ public static CommandLineOptions processArgs(String... args) throws UsageExcepti
273273 throw new UsageException ("--assume-filename is only supported when formatting standard input" );
274274 }
275275 if (parameters .dryRun () && parameters .inPlace ()) {
276- throw new UsageException ("cannot use --dry-run and --in-place at the same time" );
276+ throw new UsageException ("cannot use --dry-run and --replace at the same time" );
277277 }
278278 return parameters ;
279279 }
Original file line number Diff line number Diff line change @@ -102,11 +102,18 @@ public void inPlaceStdin() {
102102
103103 @ Test
104104 public void inPlaceDryRun () {
105+ try {
106+ Main .processArgs ("--replace" , "--dry-run" , "A.java" );
107+ fail ("fail" );
108+ } catch (UsageException e ) {
109+ assertThat (e ).hasMessageThat ().contains ("cannot use --dry-run and --replace at the same time" );
110+ }
111+
105112 try {
106113 Main .processArgs ("-i" , "-n" , "A.java" );
107114 fail ("fail" );
108115 } catch (UsageException e ) {
109- assertThat (e ).hasMessageThat ().contains ("cannot use --dry-run and --in-place at the same time" );
116+ assertThat (e ).hasMessageThat ().contains ("cannot use --dry-run and --replace at the same time" );
110117 }
111118 }
112119
You can’t perform that action at this time.
0 commit comments