From b8961f235aa66c5153ea6287eb49a46960d03367 Mon Sep 17 00:00:00 2001 From: Rousos Alexandros Date: Tue, 1 Dec 2020 09:25:24 +0000 Subject: [PATCH] Unable to parse input ABI file fix (#1299) * Fix Parser * Added Message for ignored abi files --- .../web3j/codegen/SolidityFunctionWrapperGenerator.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/codegen/src/main/java/org/web3j/codegen/SolidityFunctionWrapperGenerator.java b/codegen/src/main/java/org/web3j/codegen/SolidityFunctionWrapperGenerator.java index 95e1a1ef1..fb122d59a 100644 --- a/codegen/src/main/java/org/web3j/codegen/SolidityFunctionWrapperGenerator.java +++ b/codegen/src/main/java/org/web3j/codegen/SolidityFunctionWrapperGenerator.java @@ -128,9 +128,8 @@ public final void generate() throws IOException, ClassNotFoundException { } List functionDefinitions = loadContractDefinition(abiFile); - if (functionDefinitions.isEmpty()) { - exitError("Unable to parse input ABI file"); - } else { + if (!functionDefinitions.isEmpty()) { + String className = Strings.capitaliseFirstLetter(contractName); System.out.print("Generating " + basePackageName + "." + className + " ... "); @@ -149,6 +148,8 @@ public final void generate() throws IOException, ClassNotFoundException { null); System.out.println("File written to " + destinationDirLocation.toString() + "\n"); + } else { + System.out.println("Ignoring empty ABI file: " + abiFile.getName() + ".abi" + "\n"); } }