mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-07-28 01:15:26 -04:00
Removing star and unused imports with checkstyle
This commit is contained in:
parent
ce05710537
commit
3b8f19c4ce
1206 changed files with 5197 additions and 6620 deletions
|
@ -17,14 +17,13 @@
|
|||
|
||||
package haveno.common;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
// Helps configure listener objects that are run by the `UserThread` each second
|
||||
// and can do per second, per minute and delayed second actions. Also detects when we were in standby, and logs it.
|
||||
@Slf4j
|
||||
|
|
|
@ -17,13 +17,12 @@
|
|||
|
||||
package haveno.common;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* We simulate a global frame rate timer similar to FXTimer to avoid creation of threads for each timer call.
|
||||
* Used only in headless apps like the seed node.
|
||||
|
|
|
@ -17,13 +17,13 @@
|
|||
|
||||
package haveno.common;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.TimerTask;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
// Runs all listener objects periodically in a short interval.
|
||||
public class MasterTimer {
|
||||
private final static Logger log = LoggerFactory.getLogger(MasterTimer.class);
|
||||
|
|
|
@ -18,19 +18,16 @@
|
|||
package haveno.common;
|
||||
|
||||
import com.google.common.util.concurrent.MoreExecutors;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.time.Duration;
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
||||
/**
|
||||
* Defines which thread is used as user thread. The user thread is the the main thread in the single threaded context.
|
||||
|
|
|
@ -20,6 +20,7 @@ package haveno.common.app;
|
|||
import com.google.inject.AbstractModule;
|
||||
import com.google.inject.Injector;
|
||||
import haveno.common.config.Config;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
package haveno.common.app;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
@ -28,9 +30,6 @@ import java.util.Objects;
|
|||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* hold a set of capabilities and offers appropriate comparison methods.
|
||||
*
|
||||
|
|
|
@ -17,8 +17,6 @@
|
|||
|
||||
package haveno.common.app;
|
||||
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import ch.qos.logback.classic.Level;
|
||||
import ch.qos.logback.classic.Logger;
|
||||
import ch.qos.logback.classic.LoggerContext;
|
||||
|
@ -28,6 +26,7 @@ import ch.qos.logback.core.rolling.FixedWindowRollingPolicy;
|
|||
import ch.qos.logback.core.rolling.RollingFileAppender;
|
||||
import ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy;
|
||||
import ch.qos.logback.core.util.FileSize;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class Log {
|
||||
private static Logger logbackLogger;
|
||||
|
|
|
@ -17,11 +17,11 @@
|
|||
|
||||
package haveno.common.app;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
|
||||
@Slf4j
|
||||
|
|
|
@ -17,13 +17,12 @@
|
|||
|
||||
package haveno.common.config;
|
||||
|
||||
import lombok.Getter;
|
||||
import org.bitcoinj.core.NetworkParameters;
|
||||
import org.bitcoinj.params.MainNetParams;
|
||||
import org.bitcoinj.params.RegTestParams;
|
||||
import org.bitcoinj.utils.MonetaryFormat;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
public enum BaseCurrencyNetwork {
|
||||
XMR_MAINNET(new XmrMainNetParams(), "XMR", "MAINNET", "Monero"), // TODO (woodser): network params are part of bitcoinj and shouldn't be needed. only used to get MonetaryFormat? replace with MonetaryFormat if so
|
||||
XMR_STAGENET(new XmrStageNetParams(), "XMR", "STAGENET", "Monero"),
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
package haveno.common.config;
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import joptsimple.ArgumentAcceptingOptionSpec;
|
||||
import joptsimple.OptionSet;
|
||||
import joptsimple.OptionSpec;
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package haveno.common.config;
|
||||
|
||||
import org.bitcoinj.core.NetworkParameters;
|
||||
|
||||
import ch.qos.logback.classic.Level;
|
||||
import joptsimple.AbstractOptionSpec;
|
||||
import joptsimple.ArgumentAcceptingOptionSpec;
|
||||
import joptsimple.HelpFormatter;
|
||||
|
@ -13,20 +12,17 @@ import joptsimple.OptionSpecBuilder;
|
|||
import joptsimple.util.PathConverter;
|
||||
import joptsimple.util.PathProperties;
|
||||
import joptsimple.util.RegexMatcher;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import org.bitcoinj.core.NetworkParameters;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.io.UncheckedIOException;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import ch.qos.logback.classic.Level;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static java.lang.String.format;
|
||||
import static java.util.stream.Collectors.toList;
|
||||
|
|
|
@ -1,17 +1,15 @@
|
|||
package haveno.common.config;
|
||||
|
||||
import ch.qos.logback.classic.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.UncheckedIOException;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import ch.qos.logback.classic.Logger;
|
||||
|
||||
public class ConfigFileEditor {
|
||||
|
||||
private static final Logger log = (Logger) LoggerFactory.getLogger(ConfigFileEditor.class);
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
package haveno.common.config;
|
||||
|
||||
import java.nio.file.Files;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.UncheckedIOException;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.util.List;
|
||||
|
||||
import static java.util.stream.Collectors.toList;
|
||||
|
|
|
@ -17,11 +17,10 @@
|
|||
|
||||
package haveno.common.config;
|
||||
|
||||
import joptsimple.ValueConverter;
|
||||
|
||||
import com.google.common.base.Enums;
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.collect.Sets;
|
||||
import joptsimple.ValueConverter;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
|
|
|
@ -17,14 +17,13 @@
|
|||
|
||||
package haveno.common.crypto;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.security.PublicKey;
|
||||
import java.security.SecureRandom;
|
||||
import java.security.spec.X509EncodedKeySpec;
|
||||
|
||||
import java.util.Base64;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
public class CryptoUtils {
|
||||
public static String pubKeyToString(PublicKey publicKey) {
|
||||
|
|
|
@ -17,6 +17,11 @@
|
|||
|
||||
package haveno.common.crypto;
|
||||
|
||||
import haveno.common.util.Hex;
|
||||
import haveno.common.util.Utilities;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.KeyGenerator;
|
||||
import javax.crypto.Mac;
|
||||
|
@ -24,7 +29,8 @@ import javax.crypto.SecretKey;
|
|||
import javax.crypto.spec.OAEPParameterSpec;
|
||||
import javax.crypto.spec.PSource;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.KeyFactory;
|
||||
import java.security.KeyPair;
|
||||
|
@ -36,16 +42,8 @@ import java.security.PublicKey;
|
|||
import java.security.spec.InvalidKeySpecException;
|
||||
import java.security.spec.MGF1ParameterSpec;
|
||||
import java.security.spec.X509EncodedKeySpec;
|
||||
import haveno.common.util.Hex;
|
||||
import haveno.common.util.Utilities;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class Encryption {
|
||||
private static final Logger log = LoggerFactory.getLogger(Encryption.class);
|
||||
|
||||
|
|
|
@ -17,19 +17,15 @@
|
|||
|
||||
package haveno.common.crypto;
|
||||
|
||||
import org.bitcoinj.core.Utils;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.bitcoinj.core.Utils;
|
||||
import org.bouncycastle.crypto.digests.RIPEMD160Digest;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
public class Hash {
|
||||
|
||||
|
|
|
@ -17,18 +17,15 @@
|
|||
|
||||
package haveno.common.crypto;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import javax.crypto.SecretKey;
|
||||
|
||||
import java.security.KeyPair;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import javax.crypto.SecretKey;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import java.security.KeyPair;
|
||||
|
||||
@Getter
|
||||
@EqualsAndHashCode
|
||||
|
|
|
@ -17,16 +17,21 @@
|
|||
|
||||
package haveno.common.crypto;
|
||||
|
||||
import static haveno.common.util.Preconditions.checkDir;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import haveno.common.config.Config;
|
||||
import haveno.common.file.FileUtil;
|
||||
import javax.inject.Named;
|
||||
import javax.inject.Singleton;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.crypto.SecretKey;
|
||||
|
||||
import javax.inject.Named;
|
||||
import javax.inject.Singleton;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.math.BigInteger;
|
||||
import java.security.Key;
|
||||
import java.security.KeyFactory;
|
||||
import java.security.KeyPair;
|
||||
|
@ -44,17 +49,7 @@ import java.security.spec.KeySpec;
|
|||
import java.security.spec.PKCS8EncodedKeySpec;
|
||||
import java.security.spec.RSAPublicKeySpec;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import static haveno.common.util.Preconditions.checkDir;
|
||||
|
||||
/**
|
||||
* KeyStorage uses password protection to save a symmetric key in PKCS#12 format.
|
||||
|
|
|
@ -17,18 +17,17 @@
|
|||
|
||||
package haveno.common.crypto;
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.google.protobuf.ByteString;
|
||||
import haveno.common.consensus.UsedForTradeContractJson;
|
||||
import haveno.common.proto.network.NetworkPayload;
|
||||
import haveno.common.util.Utilities;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
|
||||
import java.security.PublicKey;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.security.PublicKey;
|
||||
|
||||
/**
|
||||
* Same as KeyRing but with public keys only.
|
||||
* Used to send public keys over the wire to other peer.
|
||||
|
|
|
@ -22,9 +22,7 @@ import haveno.common.UserThread;
|
|||
import haveno.common.util.Utilities;
|
||||
import org.bitcoinj.crypto.KeyCrypterScrypt;
|
||||
import org.bitcoinj.wallet.Protos;
|
||||
|
||||
import org.bouncycastle.crypto.params.KeyParameter;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -49,7 +47,7 @@ public class ScryptUtil {
|
|||
.build();
|
||||
return new KeyCrypterScrypt(scryptParameters);
|
||||
}
|
||||
|
||||
|
||||
public static KeyParameter deriveKeyWithScrypt(KeyCrypterScrypt keyCrypterScrypt, String password) {
|
||||
try {
|
||||
log.debug("Doing key derivation");
|
||||
|
|
|
@ -19,10 +19,10 @@ package haveno.common.crypto;
|
|||
|
||||
import com.google.protobuf.ByteString;
|
||||
import haveno.common.proto.network.NetworkPayload;
|
||||
import java.security.PublicKey;
|
||||
|
||||
import lombok.Value;
|
||||
|
||||
import java.security.PublicKey;
|
||||
|
||||
@Value
|
||||
public final class SealedAndSigned implements NetworkPayload {
|
||||
private final byte[] encryptedSecretKey;
|
||||
|
|
|
@ -20,6 +20,9 @@ package haveno.common.crypto;
|
|||
import com.google.common.base.Charsets;
|
||||
import haveno.common.util.Base64;
|
||||
import haveno.common.util.Utilities;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.KeyFactory;
|
||||
import java.security.KeyPair;
|
||||
|
@ -32,9 +35,6 @@ import java.security.SignatureException;
|
|||
import java.security.spec.InvalidKeySpecException;
|
||||
import java.security.spec.X509EncodedKeySpec;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* StorageSignatureKeyPair/STORAGE_SIGN_KEY_ALGO: That is used for signing the data to be stored to the P2P network (by flooding).
|
||||
* The algo is selected because it originated from the TomP2P version which used DSA.
|
||||
|
|
|
@ -17,15 +17,14 @@
|
|||
|
||||
package haveno.common.file;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
@Singleton
|
||||
public class CorruptedStorageFileHandler {
|
||||
|
|
|
@ -19,26 +19,22 @@ package haveno.common.file;
|
|||
|
||||
import com.google.common.io.Files;
|
||||
import haveno.common.util.Utilities;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@Slf4j
|
||||
public class FileUtil {
|
||||
public static void rollingBackup(File dir, String fileName, int numMaxBackupFiles) {
|
||||
|
|
|
@ -17,20 +17,18 @@
|
|||
|
||||
package haveno.common.file;
|
||||
|
||||
import java.nio.file.Paths;
|
||||
import haveno.common.util.Utilities;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@Slf4j
|
||||
public class JsonFileManager {
|
||||
private final static List<JsonFileManager> INSTANCES = new ArrayList<>();
|
||||
|
|
|
@ -32,16 +32,17 @@ import haveno.common.proto.persistable.PersistableEnvelope;
|
|||
import haveno.common.proto.persistable.PersistenceProtoResolver;
|
||||
import haveno.common.util.GcUtil;
|
||||
import haveno.common.util.Utilities;
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import javax.inject.Named;
|
||||
|
||||
import java.nio.file.Path;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
|
@ -51,11 +52,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static haveno.common.util.Preconditions.checkDir;
|
||||
|
||||
|
|
|
@ -17,13 +17,15 @@
|
|||
|
||||
package haveno.common.proto;
|
||||
|
||||
import com.google.common.base.Enums;
|
||||
import com.google.protobuf.ByteString;
|
||||
import com.google.protobuf.Message;
|
||||
import com.google.protobuf.ProtocolStringList;
|
||||
import haveno.common.Proto;
|
||||
import haveno.common.util.CollectionUtils;
|
||||
import com.google.common.base.Enums;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
|
@ -33,10 +35,6 @@ import java.util.Set;
|
|||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@Slf4j
|
||||
public class ProtoUtil {
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ package haveno.common.proto.network;
|
|||
|
||||
import haveno.common.proto.ProtoResolver;
|
||||
import haveno.common.proto.ProtobufferException;
|
||||
|
||||
import java.time.Clock;
|
||||
|
||||
|
||||
|
|
|
@ -19,14 +19,14 @@ package haveno.common.proto.persistable;
|
|||
|
||||
import com.google.protobuf.Message;
|
||||
import haveno.common.util.CollectionUtils;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@EqualsAndHashCode
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
|
|
|
@ -17,14 +17,14 @@
|
|||
|
||||
package haveno.common.proto.persistable;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
public abstract class PersistableList<T extends PersistablePayload> implements PersistableEnvelope {
|
||||
|
||||
@Getter
|
||||
|
|
|
@ -17,16 +17,6 @@
|
|||
|
||||
package haveno.common.setup;
|
||||
|
||||
import org.bitcoinj.store.BlockStoreException;
|
||||
|
||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||
|
||||
import java.net.URISyntaxException;
|
||||
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import ch.qos.logback.classic.Level;
|
||||
import haveno.common.UserThread;
|
||||
import haveno.common.app.AsciiLogo;
|
||||
|
@ -37,11 +27,14 @@ import haveno.common.config.Config;
|
|||
import haveno.common.util.Profiler;
|
||||
import haveno.common.util.Utilities;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
|
||||
|
||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||
import org.bitcoinj.store.BlockStoreException;
|
||||
import sun.misc.Signal;
|
||||
|
||||
import java.net.URISyntaxException;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@Slf4j
|
||||
public class CommonSetup {
|
||||
|
||||
|
|
|
@ -19,12 +19,12 @@ package haveno.common.taskrunner;
|
|||
|
||||
import haveno.common.handlers.ErrorMessageHandler;
|
||||
import haveno.common.handlers.ResultHandler;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Queue;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
public class TaskRunner<T extends Model> {
|
||||
private final Queue<Class<? extends Task<T>>> tasks = new LinkedBlockingQueue<>();
|
||||
|
|
|
@ -17,16 +17,14 @@
|
|||
|
||||
package haveno.common.util;
|
||||
|
||||
import java.net.URI;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
// Taken form https://stackoverflow.com/questions/18004150/desktop-api-is-not-supported-on-the-current-platform,
|
||||
// originally net.mightypork.rpack.utils.DesktopApi
|
||||
@Slf4j
|
||||
|
|
|
@ -17,12 +17,11 @@
|
|||
|
||||
package haveno.common.util;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
|
||||
|
|
|
@ -18,17 +18,15 @@
|
|||
package haveno.common.util;
|
||||
|
||||
import com.google.common.math.DoubleMath;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.Deque;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
|
||||
public class MathUtils {
|
||||
|
|
|
@ -17,6 +17,9 @@
|
|||
|
||||
package haveno.common.util;
|
||||
|
||||
import lombok.NonNull;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
|
@ -24,9 +27,6 @@ import java.util.List;
|
|||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.function.BiPredicate;
|
||||
|
||||
import lombok.NonNull;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
public class PermutationUtil {
|
||||
|
||||
|
|
|
@ -18,10 +18,10 @@
|
|||
package haveno.common.util;
|
||||
|
||||
import haveno.common.UserThread;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@Slf4j
|
||||
public class Profiler {
|
||||
public static void printSystemLoadPeriodically(long delay, TimeUnit timeUnit) {
|
||||
|
|
|
@ -18,18 +18,17 @@
|
|||
package haveno.common.util;
|
||||
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import static java.lang.String.format;
|
||||
import static java.util.Arrays.stream;
|
||||
import static org.apache.commons.lang3.StringUtils.capitalize;
|
||||
|
|
|
@ -17,16 +17,14 @@
|
|||
|
||||
package haveno.common.util;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.util.List;
|
||||
|
||||
// Borrowed from: https://dzone.com/articles/programmatically-restart-java
|
||||
public class RestartUtil {
|
||||
private static final Logger log = LoggerFactory.getLogger(RestartUtil.class);
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
package haveno.common.util;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class Tuple2<A, B> implements Serializable {
|
||||
|
|
|
@ -17,37 +17,33 @@
|
|||
|
||||
package haveno.common.util;
|
||||
|
||||
import org.bitcoinj.core.Utils;
|
||||
|
||||
import com.google.common.base.Splitter;
|
||||
import com.google.common.primitives.Ints;
|
||||
import com.google.common.util.concurrent.FutureCallback;
|
||||
import com.google.common.util.concurrent.ListeningExecutorService;
|
||||
import com.google.common.util.concurrent.MoreExecutors;
|
||||
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.commons.lang3.RandomStringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.time.DurationFormatUtils;
|
||||
|
||||
import javafx.scene.input.Clipboard;
|
||||
import javafx.scene.input.ClipboardContent;
|
||||
import javafx.scene.input.KeyCode;
|
||||
import javafx.scene.input.KeyCodeCombination;
|
||||
import javafx.scene.input.KeyCombination;
|
||||
import javafx.scene.input.KeyEvent;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.commons.lang3.RandomStringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.time.DurationFormatUtils;
|
||||
import org.bitcoinj.core.Utils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.nio.file.Paths;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
|
@ -72,12 +68,6 @@ import java.util.function.Function;
|
|||
import java.util.function.Predicate;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
|
|
|
@ -16,20 +16,19 @@
|
|||
*/
|
||||
package haveno.common.util;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipInputStream;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
public class ZipUtils {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue