diff --git a/ethereumj-core/build.gradle b/ethereumj-core/build.gradle index 5b2e794e..95eabfbb 100644 --- a/ethereumj-core/build.gradle +++ b/ethereumj-core/build.gradle @@ -50,7 +50,6 @@ dependencies { compile "org.iq80.leveldb:leveldb:${leveldbVersion}" compile "com.cedarsoftware:java-util:1.8.0" // for deep equals compile "org.antlr:antlr4-runtime:4.3" // for serpent compilation - compile "org.antlr:antlr4-maven-plugin:4.3" compile "com.yuvalshavit:antlr-denter:1.1" compile "org.javassist:javassist:3.15.0-GA" compile "commons-logging:commons-logging:1.0" // TODO: provided scope diff --git a/ethereumj-core/src/main/java/org/ethereum/core/BlockchainImpl.java b/ethereumj-core/src/main/java/org/ethereum/core/BlockchainImpl.java index 9eda0728..02700f35 100644 --- a/ethereumj-core/src/main/java/org/ethereum/core/BlockchainImpl.java +++ b/ethereumj-core/src/main/java/org/ethereum/core/BlockchainImpl.java @@ -1,6 +1,5 @@ package org.ethereum.core; -import org.codehaus.plexus.util.FileUtils; import org.ethereum.db.BlockStore; import org.ethereum.facade.Blockchain; import org.ethereum.facade.Repository; @@ -15,6 +14,7 @@ import org.slf4j.LoggerFactory; import org.spongycastle.util.encoders.Hex; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import org.springframework.util.FileSystemUtils; import java.io.BufferedWriter; import java.io.File; @@ -473,10 +473,7 @@ public class BlockchainImpl implements Blockchain { if (!CONFIG.recordBlocks()) return; if (bestBlock.isGenesis()) { - try { - FileUtils.deleteDirectory(CONFIG.dumpDir()); - } catch (IOException e) { - } + FileSystemUtils.deleteRecursively(new File(CONFIG.dumpDir())); } String dir = CONFIG.dumpDir() + "/"; diff --git a/ethereumj-core/src/main/java/org/ethereum/db/RepositoryDummy.java b/ethereumj-core/src/main/java/org/ethereum/db/RepositoryDummy.java index 2afd04f9..59e9b810 100644 --- a/ethereumj-core/src/main/java/org/ethereum/db/RepositoryDummy.java +++ b/ethereumj-core/src/main/java/org/ethereum/db/RepositoryDummy.java @@ -2,7 +2,6 @@ package org.ethereum.db; import com.fasterxml.jackson.databind.node.JsonNodeFactory; import com.fasterxml.jackson.databind.node.ObjectNode; -import org.codehaus.plexus.util.FileUtils; import org.ethereum.core.AccountState; import org.ethereum.core.Block; import org.ethereum.facade.Repository; diff --git a/ethereumj-core/src/main/java/org/ethereum/db/RepositoryImpl.java b/ethereumj-core/src/main/java/org/ethereum/db/RepositoryImpl.java index 8bef8db0..aba25d2d 100644 --- a/ethereumj-core/src/main/java/org/ethereum/db/RepositoryImpl.java +++ b/ethereumj-core/src/main/java/org/ethereum/db/RepositoryImpl.java @@ -2,7 +2,6 @@ package org.ethereum.db; import com.fasterxml.jackson.databind.node.JsonNodeFactory; import com.fasterxml.jackson.databind.node.ObjectNode; -import org.codehaus.plexus.util.FileUtils; import org.ethereum.core.AccountState; import org.ethereum.core.Block; import org.ethereum.facade.Repository; @@ -16,6 +15,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.spongycastle.util.encoders.Hex; import org.springframework.stereotype.Component; +import org.springframework.util.FileSystemUtils; import java.io.BufferedWriter; import java.io.File; @@ -161,10 +161,7 @@ public class RepositoryImpl implements Repository { if (block.getNumber() == 0 && txNumber == 0) if (CONFIG.dumpCleanOnRestart()) { - try { - FileUtils.deleteDirectory(CONFIG.dumpDir()); - } catch (IOException e) { - } + FileSystemUtils.deleteRecursively(new File(CONFIG.dumpDir())); } String dir = CONFIG.dumpDir() + "/"; diff --git a/ethereumj-core/src/main/java/org/ethereum/serpent/ParserGenerator.java b/ethereumj-core/src/main/java/org/ethereum/serpent/ParserGenerator.java deleted file mode 100644 index 2209efcc..00000000 --- a/ethereumj-core/src/main/java/org/ethereum/serpent/ParserGenerator.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.ethereum.serpent; - -import org.antlr.v4.Tool; -import org.apache.maven.plugin.MojoExecutionException; -import org.apache.maven.plugin.MojoFailureException; - -/** - * @author Roman Mandeleil - * @since 25.04.14 - */ -public class ParserGenerator { - - public static void main(String args[]) throws MojoFailureException, MojoExecutionException { - - String userDir = System.getProperty("user.dir"); - - String grammarName = userDir + "\\src\\main\\antlr4\\org\\ethereum\\serpent\\Serpent.g4"; - - String options[] = {grammarName, "-visitor", "-package", "org.ethereum.serpent"}; - Tool tool = new Tool(options); - tool.outputDirectory = userDir + "\\src\\main\\java\\org\\ethereum\\serpent\\"; - tool.processGrammarsOnCommandLine(); - -// org.antlr.Tool.main(new String[]{userDir + "\\src\\main\\antlr4\\org\\ethereum\\serpent\\Serpent.g4"}); - } -}