Skip to content

Commit

Permalink
Merge pull request #5 from StephG38/master
Browse files Browse the repository at this point in the history
Using single quotes instead of double quotes
  • Loading branch information
krummas committed May 15, 2012
2 parents f4507e8 + 7beb592 commit 4963672
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
Expand Up @@ -39,14 +39,14 @@ public class ByteParameter implements ParameterHolder {
public ByteParameter(final byte[] x) {
buffer = new byte[x.length * 2 + 2];
int pos = 0;
buffer[pos++] = '"';
buffer[pos++] = '\'';
for (final byte b : x) {
if (needsEscaping(b)) {
buffer[pos++] = '\\';
}
buffer[pos++] = b;
}
buffer[pos++] = '"';
buffer[pos++] = '\'';
this.length = pos;
}

Expand Down
Expand Up @@ -45,13 +45,13 @@ public class DateParameter implements ParameterHolder {
*/
public DateParameter(final long timestamp) {
final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
byteRepresentation = String.valueOf("\"" + sdf.format(new Date(timestamp)) + "\"").getBytes();
byteRepresentation = String.valueOf("'" + sdf.format(new Date(timestamp)) + "'").getBytes();
}

public DateParameter(final long timestamp, final Calendar cal) {
final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
sdf.setCalendar(cal);
byteRepresentation = String.valueOf("\"" + sdf.format(new Date(timestamp)) + "\"").getBytes();
byteRepresentation = String.valueOf("'" + sdf.format(new Date(timestamp)) + "'").getBytes();

}

Expand All @@ -64,4 +64,4 @@ public int writeTo(final OutputStream os, int offset, int maxWriteSize) throws I
public long length() {
return byteRepresentation.length;
}
}
}
Expand Up @@ -38,7 +38,7 @@ public class TimeParameter implements ParameterHolder {

public TimeParameter(final long timestamp) {
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
byteRepresentation = ("\""+sdf.format(new Date(timestamp))+"\"").getBytes();
byteRepresentation = ("'"+sdf.format(new Date(timestamp))+"'").getBytes();
}

public int writeTo(final OutputStream os, int offset, int maxWriteSize) throws IOException {
Expand All @@ -50,4 +50,4 @@ public int writeTo(final OutputStream os, int offset, int maxWriteSize) throws I
public long length() {
return byteRepresentation.length;
}
}
}
Expand Up @@ -45,13 +45,13 @@ public class TimestampParameter implements ParameterHolder {
*/
public TimestampParameter(final long timestamp) {
final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
byteRepresentation = String.valueOf("\"" + sdf.format(new Date(timestamp)) + "\"").getBytes();
byteRepresentation = String.valueOf("'" + sdf.format(new Date(timestamp)) + "'").getBytes();
}

public TimestampParameter(final long timestamp, final Calendar cal) {
final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
sdf.setCalendar(cal);
byteRepresentation = String.valueOf("\"" + sdf.format(new Date(timestamp)) + "\"").getBytes();
byteRepresentation = String.valueOf("'" + sdf.format(new Date(timestamp)) + "'").getBytes();

}

Expand All @@ -64,4 +64,4 @@ public int writeTo(final OutputStream os, int offset, int maxWriteSize) throws I
public long length() {
return byteRepresentation.length;
}
}
}

0 comments on commit 4963672

Please sign in to comment.