Skip to content

Commit 5c3fd82

Browse files
author
Faisal Hameed
committed
Fixing squid:S1213 - The members of an interface declaration or class should appear in a pre-defined order.
1 parent 7923862 commit 5c3fd82

File tree

5 files changed

+27
-28
lines changed

5 files changed

+27
-28
lines changed

activejdbc-instrumentation/src/main/java/org/javalite/instrumentation/InstrumentationModelFinder.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public class InstrumentationModelFinder {
4343
private final CtClass modelClass;
4444
private final List<CtClass> models = new ArrayList<CtClass>();
4545
private final ClassPool cp;
46+
private String currentDirectoryPath;
4647

4748

4849
protected InstrumentationModelFinder() throws NotFoundException, ClassNotFoundException {
@@ -92,8 +93,6 @@ private void processFilePath(File file) {
9293
}
9394
}
9495

95-
private String currentDirectoryPath;
96-
9796
protected void processDirectoryPath(File directory) throws IOException, ClassNotFoundException {
9897
currentDirectoryPath = directory.getCanonicalPath();
9998
processDirectory(directory);

activejdbc/src/main/java/org/javalite/activejdbc/DBException.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
public class DBException extends RuntimeException{
2828

2929
final String message;
30+
31+
public DBException() {
32+
super();
33+
this.message = null;
34+
}
3035

3136
public DBException(Throwable cause) {
3237
super(cause);
@@ -67,9 +72,5 @@ public DBException(String query, Object[] params, Throwable cause) {
6772
public String getMessage() {
6873
return message == null ? super.getMessage() : message;
6974
}
70-
71-
public DBException() {
72-
super();
73-
this.message = null;
74-
}
75+
7576
}

activejdbc/src/main/java/org/javalite/activejdbc/StatementCache.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
enum StatementCache {
3333
INSTANCE;
3434

35-
static StatementCache instance() { return INSTANCE; }
36-
3735
private final ConcurrentMap<Connection, Map<String, PreparedStatement>> statementCache = new ConcurrentHashMap<Connection, Map<String, PreparedStatement>>();
3836

3937
private StatementCache() { }
38+
39+
static StatementCache instance() { return INSTANCE; }
4040

4141
PreparedStatement getPreparedStatement(Connection connection, String query) {
4242
if (!statementCache.containsKey(connection)) {

app-config/src/main/java/org/javalite/app_config/AppConfig.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ public class AppConfig implements Map<String, String> {
3939
private static Logger LOGGER = LoggerFactory.getLogger(AppConfig.class);
4040
private static HashMap<String, Property> props = new HashMap<String, Property>();
4141
private static HashMap<String, String> plainProps = new HashMap<String, String>();
42+
43+
public AppConfig() {
44+
init();
45+
}
4246

4347
public static synchronized void init() {
4448
if (isInited()) return;
@@ -157,11 +161,6 @@ public static Map<String, String> getAllProperties() {
157161

158162
/////////// Implementation of Map interface below ///////////////////
159163

160-
161-
public AppConfig() {
162-
init();
163-
}
164-
165164
@Override
166165
public int size() {
167166
return props.size();

javalite-common/src/main/java/org/javalite/common/Base64.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,6 @@ public static class Encoder {
176176
private final boolean isURL;
177177
private final boolean doPadding;
178178

179-
private Encoder(boolean isURL, byte[] newline, int linemax, boolean doPadding) {
180-
this.isURL = isURL;
181-
this.newline = newline;
182-
this.linemax = linemax;
183-
this.doPadding = doPadding;
184-
}
185-
186179
/**
187180
* This array is a lookup table that translates 6-bit positive integer
188181
* index values into their "Base64 Alphabet" equivalents as specified
@@ -215,6 +208,13 @@ private Encoder(boolean isURL, byte[] newline, int linemax, boolean doPadding) {
215208
static final Encoder RFC4648 = new Encoder(false, null, -1, true);
216209
static final Encoder RFC4648_URLSAFE = new Encoder(true, null, -1, true);
217210
static final Encoder RFC2045 = new Encoder(false, CRLF, MIMELINEMAX, true);
211+
212+
private Encoder(boolean isURL, byte[] newline, int linemax, boolean doPadding) {
213+
this.isURL = isURL;
214+
this.newline = newline;
215+
this.linemax = linemax;
216+
this.doPadding = doPadding;
217+
}
218218

219219
private final int outLength(int srclen) {
220220
int len = 0;
@@ -451,11 +451,6 @@ public static class Decoder {
451451
private final boolean isURL;
452452
private final boolean isMIME;
453453

454-
private Decoder(boolean isURL, boolean isMIME) {
455-
this.isURL = isURL;
456-
this.isMIME = isMIME;
457-
}
458-
459454
/**
460455
* Lookup table for decoding unicode characters drawn from the
461456
* "Base64 Alphabet" (as specified in Table 1 of RFC 2045) into
@@ -488,6 +483,11 @@ private Decoder(boolean isURL, boolean isMIME) {
488483
static final Decoder RFC4648 = new Decoder(false, false);
489484
static final Decoder RFC4648_URLSAFE = new Decoder(true, false);
490485
static final Decoder RFC2045 = new Decoder(false, true);
486+
487+
private Decoder(boolean isURL, boolean isMIME) {
488+
this.isURL = isURL;
489+
this.isMIME = isMIME;
490+
}
491491

492492
/**
493493
* Decodes all bytes from the input byte array using the {@link Base64}
@@ -856,14 +856,14 @@ private static class DecInputStream extends InputStream {
856856
private boolean eof;
857857
private boolean closed;
858858

859+
private byte[] sbBuf = new byte[1];
860+
859861
DecInputStream(InputStream is, int[] base64, boolean isMIME) {
860862
this.is = is;
861863
this.base64 = base64;
862864
this.isMIME = isMIME;
863865
}
864866

865-
private byte[] sbBuf = new byte[1];
866-
867867
@Override
868868
public int read() throws IOException {
869869
return read(sbBuf, 0, 1) == -1 ? -1 : sbBuf[0] & 0xff;

0 commit comments

Comments
 (0)