Skip to content

Commit

Permalink
Make classes static when possible
Browse files Browse the repository at this point in the history
This avoids an unneeded implicit this reference.  Found via
error-prone.
  • Loading branch information
gaul committed Dec 27, 2018
1 parent 883c707 commit abccb81
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class VariantDictionary {

private Map<String, VdType> dict = new HashMap<String, VdType>();

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;
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/java/com/keepassdroid/database/PwDatabaseV4.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,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;
Expand Down Expand Up @@ -474,7 +474,7 @@ private String dbNameFromPath(String dbPath) {
return filename.substring(0, lastExtDot);
}

private class GroupHasCustomData extends GroupHandler<PwGroup> {
private static class GroupHasCustomData extends GroupHandler<PwGroup> {

public boolean hasCustomData = false;

Expand All @@ -493,7 +493,7 @@ public boolean operate(PwGroup group) {
}
}

private class EntryHasCustomData extends EntryHandler<PwEntry> {
private static class EntryHasCustomData extends EntryHandler<PwEntry> {

public boolean hasCustomData = false;

Expand Down Expand Up @@ -536,4 +536,4 @@ public int getMinKdbxVersion() {
return PwDbHeaderV4.FILE_VERSION_32_3;
}

}
}
8 changes: 4 additions & 4 deletions app/src/main/java/com/keepassdroid/database/PwDbHeaderV4.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/keepassdroid/database/PwEntryV4.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class PwEntryV4 extends PwEntry implements ITimeLogger {
public String tags = "";
public Map<String, String> customData = new HashMap<String, String>();

public class AutoType implements Cloneable {
public static class AutoType implements Cloneable {
private static final long OBF_OPT_NONE = 0;

public boolean enabled = true;
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/keepassdroid/utils/SprEngineV4.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit abccb81

Please sign in to comment.