Skip to content

Commit bf380f3

Browse files
committed
spotless apply
1 parent a1914e7 commit bf380f3

File tree

3 files changed

+26
-16
lines changed

3 files changed

+26
-16
lines changed
Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,37 @@
1+
/*
2+
* Copyright 2024 Web3 Labs Ltd.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
* the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
* specific language governing permissions and limitations under the License.
12+
*/
113
package org.web3j.codegen;
214

3-
import javax.tools.*;
415
import java.io.IOException;
516
import java.util.Collections;
17+
import javax.tools.*;
618

719
import static org.junit.jupiter.api.Assertions.assertTrue;
820

921
public class GeneraterTestUtils {
1022

11-
public static void verifyGeneratedCode(String sourceFile) throws IOException {
12-
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
13-
DiagnosticCollector<JavaFileObject> diagnostics = new DiagnosticCollector<>();
23+
public static void verifyGeneratedCode(String sourceFile) throws IOException {
24+
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
25+
DiagnosticCollector<JavaFileObject> diagnostics = new DiagnosticCollector<>();
1426

15-
try (StandardJavaFileManager fileManager =
16-
compiler.getStandardFileManager(diagnostics, null, null)) {
17-
Iterable<? extends JavaFileObject> compilationUnits =
18-
fileManager.getJavaFileObjectsFromStrings(
19-
Collections.singletonList(sourceFile));
20-
JavaCompiler.CompilationTask task =
21-
compiler.getTask(null, fileManager, diagnostics, null, null, compilationUnits);
22-
assertTrue(task.call(), "Generated contract contains compile time error");
23-
}
24-
}
27+
try (StandardJavaFileManager fileManager =
28+
compiler.getStandardFileManager(diagnostics, null, null)) {
29+
Iterable<? extends JavaFileObject> compilationUnits =
30+
fileManager.getJavaFileObjectsFromStrings(
31+
Collections.singletonList(sourceFile));
32+
JavaCompiler.CompilationTask task =
33+
compiler.getTask(null, fileManager, diagnostics, null, null, compilationUnits);
34+
assertTrue(task.call(), "Generated contract contains compile time error");
35+
}
36+
}
2537
}

codegen/src/test/java/org/web3j/codegen/SolidityFunctionWrapperGeneratorTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import java.nio.file.Files;
2121
import java.util.ArrayList;
2222
import java.util.Arrays;
23-
import java.util.Collections;
2423
import java.util.List;
2524
import javax.tools.*;
2625

codegen/src/test/java/org/web3j/codegen/TruffleJsonFunctionWrapperGeneratorTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import org.web3j.TempFileProvider;
2323
import org.web3j.utils.Strings;
2424

25-
import static org.junit.jupiter.api.Assertions.assertTrue;
2625
import static org.web3j.codegen.FunctionWrapperGenerator.JAVA_TYPES_ARG;
2726
import static org.web3j.codegen.FunctionWrapperGenerator.SOLIDITY_TYPES_ARG;
2827

0 commit comments

Comments
 (0)