diff --git a/app/build.gradle b/app/build.gradle index cee18bede..ce5e451e1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -74,7 +74,7 @@ apply plugin: "net.ltgt.errorprone" tasks.withType(JavaCompile) { options.compilerArgs += [ - '-Xep:ClassCanBeStatic:OFF', + '-Xep:ClassCanBeStatic:ERROR', '-Xep:DefaultCharset:OFF', '-Xep:EqualsHashCode:OFF', '-Xep:FragmentInjection:OFF', diff --git a/app/src/main/java/com/keepassdroid/collections/VariantDictionary.java b/app/src/main/java/com/keepassdroid/collections/VariantDictionary.java index 473dce2a3..c1f441af6 100644 --- a/app/src/main/java/com/keepassdroid/collections/VariantDictionary.java +++ b/app/src/main/java/com/keepassdroid/collections/VariantDictionary.java @@ -35,7 +35,7 @@ public class VariantDictionary { private Map dict = new HashMap(); - private class VdType { + private static class VdType { public static final byte None = 0x00; public static final byte UInt32 = 0x04; public static final byte UInt64 =0x05; diff --git a/app/src/main/java/com/keepassdroid/database/PwDatabaseV4.java b/app/src/main/java/com/keepassdroid/database/PwDatabaseV4.java index 29e7b782d..fd4f554ac 100644 --- a/app/src/main/java/com/keepassdroid/database/PwDatabaseV4.java +++ b/app/src/main/java/com/keepassdroid/database/PwDatabaseV4.java @@ -104,7 +104,7 @@ public class PwDatabaseV4 extends PwDatabase { public String localizedAppName = "KeePassDroid"; - public class MemoryProtectionConfig { + public static class MemoryProtectionConfig { public boolean protectTitle = false; public boolean protectUserName = false; public boolean protectPassword = false; @@ -470,7 +470,7 @@ private String dbNameFromPath(String dbPath) { return filename.substring(0, lastExtDot); } - private class GroupHasCustomData extends GroupHandler { + private static class GroupHasCustomData extends GroupHandler { public boolean hasCustomData = false; @@ -489,7 +489,7 @@ public boolean operate(PwGroup group) { } } - private class EntryHasCustomData extends EntryHandler { + private static class EntryHasCustomData extends EntryHandler { public boolean hasCustomData = false; @@ -537,4 +537,4 @@ public void clearCache() { binPool.clear(); } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/keepassdroid/database/PwDbHeaderV4.java b/app/src/main/java/com/keepassdroid/database/PwDbHeaderV4.java index d93fa9640..99333a1ca 100644 --- a/app/src/main/java/com/keepassdroid/database/PwDbHeaderV4.java +++ b/app/src/main/java/com/keepassdroid/database/PwDbHeaderV4.java @@ -51,7 +51,7 @@ public class PwDbHeaderV4 extends PwDbHeader { public static final int FILE_VERSION_32_4 = 0x00040000; public static final int FILE_VERSION_32 = FILE_VERSION_32_4; - public class PwDbHeaderV4Fields { + public static class PwDbHeaderV4Fields { public static final byte EndOfHeader = 0; public static final byte Comment = 1; public static final byte CipherID = 2; @@ -68,19 +68,19 @@ public class PwDbHeaderV4Fields { } - public class PwDbInnerHeaderV4Fields { + public static class PwDbInnerHeaderV4Fields { public static final byte EndOfHeader = 0; public static final byte InnerRandomStreamID = 1; public static final byte InnerRandomstreamKey = 2; public static final byte Binary = 3; } - public class KdbxBinaryFlags { + public static class KdbxBinaryFlags { public static final byte None = 0; public static final byte Protected = 1; } - public class HeaderAndHash { + public static class HeaderAndHash { public byte[] header; public byte[] hash; diff --git a/app/src/main/java/com/keepassdroid/database/PwEntryV4.java b/app/src/main/java/com/keepassdroid/database/PwEntryV4.java index beb17d255..b08a5dd7b 100644 --- a/app/src/main/java/com/keepassdroid/database/PwEntryV4.java +++ b/app/src/main/java/com/keepassdroid/database/PwEntryV4.java @@ -62,7 +62,7 @@ public class PwEntryV4 extends PwEntry implements ITimeLogger { public String tags = ""; public Map customData = new HashMap(); - public class AutoType implements Cloneable { + public static class AutoType implements Cloneable { private static final long OBF_OPT_NONE = 0; public boolean enabled = true; diff --git a/app/src/main/java/com/keepassdroid/database/security/ProtectedBinary.java b/app/src/main/java/com/keepassdroid/database/security/ProtectedBinary.java index e217eb800..00a57871e 100644 --- a/app/src/main/java/com/keepassdroid/database/security/ProtectedBinary.java +++ b/app/src/main/java/com/keepassdroid/database/security/ProtectedBinary.java @@ -56,7 +56,7 @@ public class ProtectedBinary { private static final SecureRandom secureRandom = new SecureRandom(); private FileParams fileParams; - private class FileParams { + private static class FileParams { private File dataFile; public CipherOutputStream cos; diff --git a/app/src/main/java/com/keepassdroid/utils/SprEngineV4.java b/app/src/main/java/com/keepassdroid/utils/SprEngineV4.java index 67c9ad97a..4e057c156 100644 --- a/app/src/main/java/com/keepassdroid/utils/SprEngineV4.java +++ b/app/src/main/java/com/keepassdroid/utils/SprEngineV4.java @@ -35,7 +35,7 @@ public class SprEngineV4 extends SprEngine { private final String STR_REF_START = "{REF:"; private final String STR_REF_END = "}"; - public class TargetResult { + public static class TargetResult { public PwEntryV4 entry; public char wanted;