Skip to content

Commit

Permalink
fix: squid:S2325 - private methods that don't access instance data sh…
Browse files Browse the repository at this point in the history
…ould be static

closes #514
  • Loading branch information
George Kankava authored and vlsi committed Feb 19, 2016
1 parent a07d6d3 commit 7aac95c
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
Expand Up @@ -280,7 +280,7 @@ public ProtocolConnection openConnectionImpl(HostSpec[] hostSpecs, String user,
*
* @return The current JVM time zone in postgresql format.
*/
private String createPostgresTimeZone() {
private static String createPostgresTimeZone() {
String tz = TimeZone.getDefault().getID();
if (tz.length() <= 3 || !tz.startsWith("GMT")) {
return tz;
Expand Down
Expand Up @@ -1133,7 +1133,7 @@ public void setFromReference(Reference ref) {
}
}

private String getReferenceProperty(Reference ref, String propertyName) {
private static String getReferenceProperty(Reference ref, String propertyName) {
RefAddr addr = ref.get(propertyName);
if (addr == null) {
return null;
Expand Down
Expand Up @@ -2059,7 +2059,7 @@ private static List<String> parseACLArray(String aclString) {
* Add the user described by the given acl to the Lists of users with the privileges described by
* the acl.
*/
private void addACLPrivileges(String acl, Map<String, Map<String, List<String[]>>> privileges) {
private static void addACLPrivileges(String acl, Map<String, Map<String, List<String[]>>> privileges) {
int equalIndex = acl.lastIndexOf("=");
int slashIndex = acl.lastIndexOf("/");
if (equalIndex == -1) {
Expand Down
4 changes: 2 additions & 2 deletions pgjdbc/src/main/java/org/postgresql/util/PGInterval.java
Expand Up @@ -375,7 +375,7 @@ public void scale(int factor) {
* @return integer parsed from string value
* @throws NumberFormatException if the string contains invalid chars
*/
private int nullSafeIntGet(String value) throws NumberFormatException {
private static int nullSafeIntGet(String value) throws NumberFormatException {
return (value == null) ? 0 : Integer.parseInt(value);
}

Expand All @@ -386,7 +386,7 @@ private int nullSafeIntGet(String value) throws NumberFormatException {
* @return double parsed from string value
* @throws NumberFormatException if the string contains invalid chars
*/
private double nullSafeDoubleGet(String value) throws NumberFormatException {
private static double nullSafeDoubleGet(String value) throws NumberFormatException {
return (value == null) ? 0 : Double.parseDouble(value);
}

Expand Down
Expand Up @@ -159,7 +159,7 @@ public String toString() {
return "<stream of " + length + " bytes>";
}

private int copyStream(InputStream inputStream, OutputStream outputStream, int limit)
private static int copyStream(InputStream inputStream, OutputStream outputStream, int limit)
throws IOException {
int totalLength = 0;
byte[] buffer = new byte[2048];
Expand Down
Expand Up @@ -50,7 +50,7 @@ public Collection<String> addJVMOptions(BenchmarkParams params) {
+ params.getBenchmark() + "_" + sb + ".jfr");
}

private long getDurationSeconds(IterationParams warmup) {
private static long getDurationSeconds(IterationParams warmup) {
return warmup.getTime().convertTo(TimeUnit.SECONDS) * warmup.getCount();
}

Expand Down

0 comments on commit 7aac95c

Please sign in to comment.