From 33f2e0edda8bcdf4bbc856a5c7fc2398fedf4cef Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Thu, 26 Apr 2018 13:26:16 -0400 Subject: [PATCH] Optimize imports. --- .../com/lyndir/masterpassword/MPAlgorithm.java | 3 +-- .../com/lyndir/masterpassword/MPAlgorithmV0.java | 8 +++++--- .../java/com/lyndir/masterpassword/MPTemplate.java | 2 +- .../lyndir/masterpassword/model/MPFileUser.java | 9 ++++++--- .../masterpassword/model/MPFileUserManager.java | 5 ++--- .../masterpassword/model/MPFlatMarshaller.java | 4 ++-- .../com/lyndir/masterpassword/model/MPSite.java | 2 +- .../lyndir/masterpassword/model/MPSiteResult.java | 2 +- .../masterpassword/model/MPUnmarshaller.java | 3 ++- .../com/lyndir/masterpassword/model/MPUser.java | 5 +++-- .../lyndir/masterpassword/model/MPUserManager.java | 4 ++-- .../java/com/lyndir/masterpassword/MPTests.java | 6 +++--- .../com/lyndir/masterpassword/MPMasterKeyTest.java | 1 - .../lyndir/masterpassword/EmergencyActivity.java | 7 ++++--- .../lyndir/masterpassword/MainThreadExecutor.java | 3 ++- .../main/java/com/lyndir/masterpassword/Res.java | 1 - .../com/lyndir/masterpassword/TestActivity.java | 14 ++++++++------ .../java/com/lyndir/masterpassword/gui/GUI.java | 10 ++++++---- .../masterpassword/gui/model/IncognitoSite.java | 2 +- .../masterpassword/gui/platform/mac/AppleGUI.java | 4 ---- .../gui/view/AuthenticationPanel.java | 2 +- .../gui/view/ModelAuthenticationPanel.java | 6 +++--- .../masterpassword/gui/view/PasswordFrame.java | 2 +- .../masterpassword/gui/view/UnlockFrame.java | 4 ++-- 24 files changed, 57 insertions(+), 52 deletions(-) diff --git a/core/java/algorithm/src/main/java/com/lyndir/masterpassword/MPAlgorithm.java b/core/java/algorithm/src/main/java/com/lyndir/masterpassword/MPAlgorithm.java index 2b52c7d6..c5021ef4 100644 --- a/core/java/algorithm/src/main/java/com/lyndir/masterpassword/MPAlgorithm.java +++ b/core/java/algorithm/src/main/java/com/lyndir/masterpassword/MPAlgorithm.java @@ -22,8 +22,7 @@ import com.google.common.base.Charsets; import com.google.common.primitives.UnsignedInteger; import com.lyndir.lhunath.opal.system.MessageAuthenticationDigests; import com.lyndir.lhunath.opal.system.MessageDigests; -import java.io.Serializable; -import java.nio.*; +import java.nio.ByteOrder; import java.nio.charset.Charset; import javax.annotation.Nullable; diff --git a/core/java/algorithm/src/main/java/com/lyndir/masterpassword/MPAlgorithmV0.java b/core/java/algorithm/src/main/java/com/lyndir/masterpassword/MPAlgorithmV0.java index 8678911c..c9d0835e 100644 --- a/core/java/algorithm/src/main/java/com/lyndir/masterpassword/MPAlgorithmV0.java +++ b/core/java/algorithm/src/main/java/com/lyndir/masterpassword/MPAlgorithmV0.java @@ -18,15 +18,17 @@ package com.lyndir.masterpassword; -import com.google.common.base.*; +import com.google.common.base.Preconditions; +import com.google.common.base.Throwables; import com.google.common.primitives.Bytes; import com.google.common.primitives.UnsignedInteger; import com.lambdaworks.crypto.SCrypt; import com.lyndir.lhunath.opal.crypto.CryptUtils; -import com.lyndir.lhunath.opal.system.*; +import com.lyndir.lhunath.opal.system.CodeUtils; import com.lyndir.lhunath.opal.system.logging.Logger; import com.lyndir.lhunath.opal.system.util.ConversionUtils; -import java.nio.*; +import java.nio.ByteBuffer; +import java.nio.CharBuffer; import java.security.GeneralSecurityException; import java.util.Arrays; import javax.annotation.Nullable; diff --git a/core/java/algorithm/src/main/java/com/lyndir/masterpassword/MPTemplate.java b/core/java/algorithm/src/main/java/com/lyndir/masterpassword/MPTemplate.java index e82fa65b..c19029d7 100644 --- a/core/java/algorithm/src/main/java/com/lyndir/masterpassword/MPTemplate.java +++ b/core/java/algorithm/src/main/java/com/lyndir/masterpassword/MPTemplate.java @@ -18,7 +18,7 @@ package com.lyndir.masterpassword; -import static com.lyndir.lhunath.opal.system.util.StringUtils.strf; +import static com.lyndir.lhunath.opal.system.util.StringUtils.*; import com.google.common.collect.ImmutableList; import com.lyndir.lhunath.opal.system.util.MetaObject; diff --git a/core/java/model/src/main/java/com/lyndir/masterpassword/model/MPFileUser.java b/core/java/model/src/main/java/com/lyndir/masterpassword/model/MPFileUser.java index f3770bd6..d88c83af 100755 --- a/core/java/model/src/main/java/com/lyndir/masterpassword/model/MPFileUser.java +++ b/core/java/model/src/main/java/com/lyndir/masterpassword/model/MPFileUser.java @@ -18,13 +18,16 @@ package com.lyndir.masterpassword.model; -import com.google.common.collect.*; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Sets; import com.lyndir.lhunath.opal.system.logging.Logger; import com.lyndir.masterpassword.*; -import java.util.*; +import java.util.Arrays; +import java.util.Collection; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.joda.time.*; +import org.joda.time.Instant; +import org.joda.time.ReadableInstant; /** diff --git a/core/java/model/src/main/java/com/lyndir/masterpassword/model/MPFileUserManager.java b/core/java/model/src/main/java/com/lyndir/masterpassword/model/MPFileUserManager.java index aeca0732..95635269 100644 --- a/core/java/model/src/main/java/com/lyndir/masterpassword/model/MPFileUserManager.java +++ b/core/java/model/src/main/java/com/lyndir/masterpassword/model/MPFileUserManager.java @@ -20,8 +20,8 @@ package com.lyndir.masterpassword.model; import static com.lyndir.lhunath.opal.system.util.ObjectUtils.*; -import com.google.common.base.*; -import com.google.common.collect.*; +import com.google.common.base.Charsets; +import com.google.common.collect.ImmutableList; import com.google.common.io.CharSink; import com.lyndir.lhunath.opal.system.logging.Logger; import com.lyndir.masterpassword.*; @@ -29,7 +29,6 @@ import java.io.*; import java.util.HashMap; import java.util.Map; import javax.annotation.Nonnull; -import javax.annotation.Nullable; /** diff --git a/core/java/model/src/main/java/com/lyndir/masterpassword/model/MPFlatMarshaller.java b/core/java/model/src/main/java/com/lyndir/masterpassword/model/MPFlatMarshaller.java index cb08b9c9..fd718866 100644 --- a/core/java/model/src/main/java/com/lyndir/masterpassword/model/MPFlatMarshaller.java +++ b/core/java/model/src/main/java/com/lyndir/masterpassword/model/MPFlatMarshaller.java @@ -18,8 +18,8 @@ package com.lyndir.masterpassword.model; -import static com.lyndir.lhunath.opal.system.util.ObjectUtils.ifNotNullElse; -import static com.lyndir.lhunath.opal.system.util.StringUtils.strf; +import static com.lyndir.lhunath.opal.system.util.ObjectUtils.*; +import static com.lyndir.lhunath.opal.system.util.StringUtils.*; import com.lyndir.masterpassword.*; import javax.annotation.Nonnull; diff --git a/core/java/model/src/main/java/com/lyndir/masterpassword/model/MPSite.java b/core/java/model/src/main/java/com/lyndir/masterpassword/model/MPSite.java index 4fad0f3f..0c87e9fd 100644 --- a/core/java/model/src/main/java/com/lyndir/masterpassword/model/MPSite.java +++ b/core/java/model/src/main/java/com/lyndir/masterpassword/model/MPSite.java @@ -18,7 +18,7 @@ package com.lyndir.masterpassword.model; -import static com.lyndir.lhunath.opal.system.util.StringUtils.strf; +import static com.lyndir.lhunath.opal.system.util.StringUtils.*; import com.google.common.primitives.UnsignedInteger; import com.lyndir.masterpassword.*; diff --git a/core/java/model/src/main/java/com/lyndir/masterpassword/model/MPSiteResult.java b/core/java/model/src/main/java/com/lyndir/masterpassword/model/MPSiteResult.java index 646a0f21..b9af9ec2 100644 --- a/core/java/model/src/main/java/com/lyndir/masterpassword/model/MPSiteResult.java +++ b/core/java/model/src/main/java/com/lyndir/masterpassword/model/MPSiteResult.java @@ -18,7 +18,7 @@ package com.lyndir.masterpassword.model; -import static com.lyndir.lhunath.opal.system.util.StringUtils.strf; +import static com.lyndir.lhunath.opal.system.util.StringUtils.*; import java.util.Objects; diff --git a/core/java/model/src/main/java/com/lyndir/masterpassword/model/MPUnmarshaller.java b/core/java/model/src/main/java/com/lyndir/masterpassword/model/MPUnmarshaller.java index 85abea0a..0be1bbc9 100644 --- a/core/java/model/src/main/java/com/lyndir/masterpassword/model/MPUnmarshaller.java +++ b/core/java/model/src/main/java/com/lyndir/masterpassword/model/MPUnmarshaller.java @@ -18,7 +18,8 @@ package com.lyndir.masterpassword.model; -import java.io.*; +import java.io.File; +import java.io.IOException; import javax.annotation.Nonnull; diff --git a/core/java/model/src/main/java/com/lyndir/masterpassword/model/MPUser.java b/core/java/model/src/main/java/com/lyndir/masterpassword/model/MPUser.java index 87c0bdde..90990a8b 100755 --- a/core/java/model/src/main/java/com/lyndir/masterpassword/model/MPUser.java +++ b/core/java/model/src/main/java/com/lyndir/masterpassword/model/MPUser.java @@ -18,13 +18,14 @@ package com.lyndir.masterpassword.model; -import static com.lyndir.lhunath.opal.system.util.StringUtils.strf; +import static com.lyndir.lhunath.opal.system.util.StringUtils.*; import com.google.common.base.Preconditions; import com.lyndir.lhunath.opal.system.CodeUtils; import com.lyndir.masterpassword.MPInvalidatedException; import com.lyndir.masterpassword.MPMasterKey; -import java.util.*; +import java.util.Collection; +import java.util.Objects; import javax.annotation.Nonnull; import javax.annotation.Nullable; diff --git a/core/java/model/src/main/java/com/lyndir/masterpassword/model/MPUserManager.java b/core/java/model/src/main/java/com/lyndir/masterpassword/model/MPUserManager.java index 8e821e53..e84fd9bc 100644 --- a/core/java/model/src/main/java/com/lyndir/masterpassword/model/MPUserManager.java +++ b/core/java/model/src/main/java/com/lyndir/masterpassword/model/MPUserManager.java @@ -19,8 +19,8 @@ package com.lyndir.masterpassword.model; import com.google.common.collect.*; -import com.lyndir.masterpassword.MPInvalidatedException; -import java.util.*; +import java.util.Map; +import java.util.SortedSet; /** diff --git a/core/java/tests/src/main/java/com/lyndir/masterpassword/MPTests.java b/core/java/tests/src/main/java/com/lyndir/masterpassword/MPTests.java index 54670904..0cec07e1 100644 --- a/core/java/tests/src/main/java/com/lyndir/masterpassword/MPTests.java +++ b/core/java/tests/src/main/java/com/lyndir/masterpassword/MPTests.java @@ -18,13 +18,13 @@ package com.lyndir.masterpassword; -import static com.google.common.base.Preconditions.checkNotNull; +import static com.google.common.base.Preconditions.*; import static com.lyndir.lhunath.opal.system.util.ObjectUtils.*; -import static com.lyndir.lhunath.opal.system.util.StringUtils.strf; +import static com.lyndir.lhunath.opal.system.util.StringUtils.*; import com.google.common.primitives.UnsignedInteger; import com.lyndir.lhunath.opal.system.logging.Logger; -import com.lyndir.lhunath.opal.system.util.*; +import com.lyndir.lhunath.opal.system.util.NNSupplier; import java.util.List; import javax.annotation.Nonnull; import javax.annotation.Nullable; diff --git a/core/java/tests/src/test/java/com/lyndir/masterpassword/MPMasterKeyTest.java b/core/java/tests/src/test/java/com/lyndir/masterpassword/MPMasterKeyTest.java index 3e7f8722..2da9be97 100644 --- a/core/java/tests/src/test/java/com/lyndir/masterpassword/MPMasterKeyTest.java +++ b/core/java/tests/src/test/java/com/lyndir/masterpassword/MPMasterKeyTest.java @@ -20,7 +20,6 @@ package com.lyndir.masterpassword; import static org.testng.Assert.*; -import com.google.common.base.Charsets; import com.lyndir.lhunath.opal.system.CodeUtils; import com.lyndir.lhunath.opal.system.logging.Logger; import java.util.Random; diff --git a/platform-android/src/main/java/com/lyndir/masterpassword/EmergencyActivity.java b/platform-android/src/main/java/com/lyndir/masterpassword/EmergencyActivity.java index fe7792db..a10631fc 100644 --- a/platform-android/src/main/java/com/lyndir/masterpassword/EmergencyActivity.java +++ b/platform-android/src/main/java/com/lyndir/masterpassword/EmergencyActivity.java @@ -18,7 +18,7 @@ package com.lyndir.masterpassword; -import static com.lyndir.lhunath.opal.system.util.StringUtils.strf; +import static com.lyndir.lhunath.opal.system.util.StringUtils.*; import android.app.*; import android.content.*; @@ -35,11 +35,12 @@ import butterknife.BindView; import butterknife.ButterKnife; import com.google.common.collect.ImmutableList; import com.google.common.primitives.UnsignedInteger; -import com.google.common.util.concurrent.*; +import com.google.common.util.concurrent.ListeningExecutorService; +import com.google.common.util.concurrent.MoreExecutors; import com.lyndir.lhunath.opal.system.logging.Logger; import java.text.MessageFormat; import java.util.*; -import java.util.concurrent.*; +import java.util.concurrent.Executors; import javax.annotation.Nullable; diff --git a/platform-android/src/main/java/com/lyndir/masterpassword/MainThreadExecutor.java b/platform-android/src/main/java/com/lyndir/masterpassword/MainThreadExecutor.java index 2d7c1769..e089673e 100644 --- a/platform-android/src/main/java/com/lyndir/masterpassword/MainThreadExecutor.java +++ b/platform-android/src/main/java/com/lyndir/masterpassword/MainThreadExecutor.java @@ -22,7 +22,8 @@ import android.os.Handler; import android.os.Looper; import com.google.common.collect.ImmutableList; import com.google.common.collect.Sets; -import java.util.*; +import java.util.List; +import java.util.Set; import java.util.concurrent.*; diff --git a/platform-android/src/main/java/com/lyndir/masterpassword/Res.java b/platform-android/src/main/java/com/lyndir/masterpassword/Res.java index 1e1fb13b..812242d5 100644 --- a/platform-android/src/main/java/com/lyndir/masterpassword/Res.java +++ b/platform-android/src/main/java/com/lyndir/masterpassword/Res.java @@ -19,7 +19,6 @@ package com.lyndir.masterpassword; import android.content.Context; -import android.content.res.Resources; import android.graphics.Typeface; diff --git a/platform-android/src/main/java/com/lyndir/masterpassword/TestActivity.java b/platform-android/src/main/java/com/lyndir/masterpassword/TestActivity.java index 9c3f22b5..26ebf069 100644 --- a/platform-android/src/main/java/com/lyndir/masterpassword/TestActivity.java +++ b/platform-android/src/main/java/com/lyndir/masterpassword/TestActivity.java @@ -18,21 +18,23 @@ package com.lyndir.masterpassword; -import static com.lyndir.lhunath.opal.system.util.StringUtils.strf; +import static com.lyndir.lhunath.opal.system.util.StringUtils.*; -import android.app.*; +import android.app.Activity; import android.content.Context; import android.content.Intent; -import android.os.*; +import android.os.Bundle; import android.view.View; import android.widget.*; import butterknife.BindView; import butterknife.ButterKnife; -import com.google.common.base.*; -import com.google.common.collect.*; +import com.google.common.base.Function; +import com.google.common.base.Predicates; +import com.google.common.collect.FluentIterable; +import com.google.common.collect.ImmutableSet; import com.google.common.util.concurrent.*; import com.lyndir.lhunath.opal.system.logging.Logger; -import java.util.concurrent.*; +import java.util.concurrent.Executors; import javax.annotation.Nullable; diff --git a/platform-independent/gui-java/src/main/java/com/lyndir/masterpassword/gui/GUI.java b/platform-independent/gui-java/src/main/java/com/lyndir/masterpassword/gui/GUI.java index cc714a2e..9691216d 100644 --- a/platform-independent/gui-java/src/main/java/com/lyndir/masterpassword/gui/GUI.java +++ b/platform-independent/gui-java/src/main/java/com/lyndir/masterpassword/gui/GUI.java @@ -18,14 +18,16 @@ package com.lyndir.masterpassword.gui; -import com.google.common.base.*; -import com.google.common.io.*; +import com.google.common.base.Charsets; +import com.google.common.base.Optional; +import com.google.common.io.CharSource; +import com.google.common.io.Resources; import com.lyndir.lhunath.opal.system.logging.Logger; import com.lyndir.lhunath.opal.system.util.TypeUtils; - import com.lyndir.masterpassword.gui.view.PasswordFrame; import com.lyndir.masterpassword.gui.view.UnlockFrame; -import java.io.*; +import java.io.IOException; +import java.io.InputStream; import java.lang.reflect.InvocationTargetException; import java.net.URI; import java.net.URL; diff --git a/platform-independent/gui-java/src/main/java/com/lyndir/masterpassword/gui/model/IncognitoSite.java b/platform-independent/gui-java/src/main/java/com/lyndir/masterpassword/gui/model/IncognitoSite.java index 4140851d..7bf56fd8 100644 --- a/platform-independent/gui-java/src/main/java/com/lyndir/masterpassword/gui/model/IncognitoSite.java +++ b/platform-independent/gui-java/src/main/java/com/lyndir/masterpassword/gui/model/IncognitoSite.java @@ -19,8 +19,8 @@ package com.lyndir.masterpassword.gui.model; import com.google.common.primitives.UnsignedInteger; -import com.lyndir.masterpassword.MPResultType; import com.lyndir.masterpassword.MPMasterKey; +import com.lyndir.masterpassword.MPResultType; import com.lyndir.masterpassword.model.MPSite; diff --git a/platform-independent/gui-java/src/main/java/com/lyndir/masterpassword/gui/platform/mac/AppleGUI.java b/platform-independent/gui-java/src/main/java/com/lyndir/masterpassword/gui/platform/mac/AppleGUI.java index 9afb7924..11d6e989 100644 --- a/platform-independent/gui-java/src/main/java/com/lyndir/masterpassword/gui/platform/mac/AppleGUI.java +++ b/platform-independent/gui-java/src/main/java/com/lyndir/masterpassword/gui/platform/mac/AppleGUI.java @@ -20,10 +20,6 @@ package com.lyndir.masterpassword.gui.platform.mac; import com.apple.eawt.*; import com.lyndir.masterpassword.gui.GUI; -import com.lyndir.masterpassword.gui.view.PasswordFrame; -import com.lyndir.masterpassword.model.MPUser; - -import javax.swing.*; /** diff --git a/platform-independent/gui-java/src/main/java/com/lyndir/masterpassword/gui/view/AuthenticationPanel.java b/platform-independent/gui-java/src/main/java/com/lyndir/masterpassword/gui/view/AuthenticationPanel.java index c01d3181..11018d79 100644 --- a/platform-independent/gui-java/src/main/java/com/lyndir/masterpassword/gui/view/AuthenticationPanel.java +++ b/platform-independent/gui-java/src/main/java/com/lyndir/masterpassword/gui/view/AuthenticationPanel.java @@ -20,8 +20,8 @@ package com.lyndir.masterpassword.gui.view; import com.google.common.collect.ImmutableList; import com.lyndir.masterpassword.gui.Res; -import com.lyndir.masterpassword.model.MPUser; import com.lyndir.masterpassword.gui.util.Components; +import com.lyndir.masterpassword.model.MPUser; import java.awt.*; import javax.annotation.Nonnull; import javax.annotation.Nullable; diff --git a/platform-independent/gui-java/src/main/java/com/lyndir/masterpassword/gui/view/ModelAuthenticationPanel.java b/platform-independent/gui-java/src/main/java/com/lyndir/masterpassword/gui/view/ModelAuthenticationPanel.java index d9992e4f..17fb3284 100644 --- a/platform-independent/gui-java/src/main/java/com/lyndir/masterpassword/gui/view/ModelAuthenticationPanel.java +++ b/platform-independent/gui-java/src/main/java/com/lyndir/masterpassword/gui/view/ModelAuthenticationPanel.java @@ -18,16 +18,16 @@ package com.lyndir.masterpassword.gui.view; -import static com.lyndir.lhunath.opal.system.util.StringUtils.strf; +import static com.lyndir.lhunath.opal.system.util.StringUtils.*; -import com.google.common.collect.*; +import com.google.common.collect.ImmutableList; import com.google.common.primitives.UnsignedInteger; import com.lyndir.lhunath.opal.system.logging.Logger; import com.lyndir.masterpassword.MPMasterKey; import com.lyndir.masterpassword.MPResultType; import com.lyndir.masterpassword.gui.Res; -import com.lyndir.masterpassword.model.*; import com.lyndir.masterpassword.gui.util.Components; +import com.lyndir.masterpassword.model.*; import java.awt.*; import java.awt.event.*; import javax.annotation.Nonnull; diff --git a/platform-independent/gui-java/src/main/java/com/lyndir/masterpassword/gui/view/PasswordFrame.java b/platform-independent/gui-java/src/main/java/com/lyndir/masterpassword/gui/view/PasswordFrame.java index e6593b98..408a9072 100755 --- a/platform-independent/gui-java/src/main/java/com/lyndir/masterpassword/gui/view/PasswordFrame.java +++ b/platform-independent/gui-java/src/main/java/com/lyndir/masterpassword/gui/view/PasswordFrame.java @@ -18,7 +18,7 @@ package com.lyndir.masterpassword.gui.view; -import static com.lyndir.lhunath.opal.system.util.ObjectUtils.ifNotNullElse; +import static com.lyndir.lhunath.opal.system.util.ObjectUtils.*; import static com.lyndir.lhunath.opal.system.util.StringUtils.*; import com.google.common.base.Predicate; diff --git a/platform-independent/gui-java/src/main/java/com/lyndir/masterpassword/gui/view/UnlockFrame.java b/platform-independent/gui-java/src/main/java/com/lyndir/masterpassword/gui/view/UnlockFrame.java index ca95aa5f..ae921515 100644 --- a/platform-independent/gui-java/src/main/java/com/lyndir/masterpassword/gui/view/UnlockFrame.java +++ b/platform-independent/gui-java/src/main/java/com/lyndir/masterpassword/gui/view/UnlockFrame.java @@ -21,10 +21,10 @@ package com.lyndir.masterpassword.gui.view; import static com.lyndir.lhunath.opal.system.util.ObjectUtils.*; import com.lyndir.masterpassword.MPIdenticon; -import com.lyndir.masterpassword.gui.*; -import com.lyndir.masterpassword.model.MPUser; +import com.lyndir.masterpassword.gui.Res; import com.lyndir.masterpassword.gui.util.Components; import com.lyndir.masterpassword.model.MPIncorrectMasterPasswordException; +import com.lyndir.masterpassword.model.MPUser; import java.awt.*; import java.awt.event.*; import java.util.concurrent.Future;