Skip to content
Permalink
Browse files

[misc] code style correction

  • Loading branch information...
rusher committed Jul 30, 2019
1 parent f22fe19 commit 5cdf78545344ffc8a7876d3540a6ca89f9dc114b

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -3,7 +3,7 @@
* MariaDB Client for Java
*
* Copyright (c) 2012-2014 Monty Program Ab.
* Copyright (c) 2015-2017 MariaDB Ab.
* Copyright (c) 2015-2019 MariaDB Ab.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
@@ -22,10 +22,10 @@

package org.mariadb.jdbc.internal.com.send.parameters;

import java.io.IOException;
import org.mariadb.jdbc.internal.ColumnType;
import org.mariadb.jdbc.internal.io.output.PacketOutputStream;

import java.io.IOException;

public class BooleanParameter implements Cloneable, ParameterHolder {

@@ -69,5 +69,4 @@ public boolean isNullData() {
public boolean isLongData() {
return false;
}

}
@@ -65,6 +65,12 @@ public ByteParameter(byte value) {
this.value = value & 0xFF;
}

/**
* Write Byte value to stream using TEXT protocol.
*
* @param os the stream to write to
* @throws IOException if any socket error occur
*/
public void writeTo(final PacketOutputStream os) throws IOException {
os.write("0x");
os.write(hexArray[value >>> 4]);
@@ -21,14 +21,12 @@
*
*/


package org.mariadb.jdbc.internal.com.send.parameters;

import org.mariadb.jdbc.internal.ColumnType;
import org.mariadb.jdbc.internal.io.output.PacketOutputStream;

import java.io.IOException;
import java.time.LocalTime;
import org.mariadb.jdbc.internal.ColumnType;
import org.mariadb.jdbc.internal.io.output.PacketOutputStream;

public class LocalTimeParameter implements Cloneable, ParameterHolder {

@@ -38,7 +36,7 @@
/**
* Constructor.
*
* @param time time to write
* @param time time to write
* @param fractionalSeconds must fractional seconds be send.
*/
public LocalTimeParameter(LocalTime time, boolean fractionalSeconds) {
@@ -54,12 +52,12 @@ public LocalTimeParameter(LocalTime time, boolean fractionalSeconds) {
public void writeTo(final PacketOutputStream pos) throws IOException {
StringBuilder dateString = new StringBuilder(15);
dateString
.append(time.getHour() < 10 ? "0" : "")
.append(time.getHour())
.append(time.getMinute() < 10 ? ":0" : ":")
.append(time.getMinute())
.append(time.getSecond() < 10 ? ":0" : ":")
.append(time.getSecond());
.append(time.getHour() < 10 ? "0" : "")
.append(time.getHour())
.append(time.getMinute() < 10 ? ":0" : ":")
.append(time.getMinute())
.append(time.getSecond() < 10 ? ":0" : ":")
.append(time.getSecond());
int microseconds = time.getNano() / 1000;
if (microseconds > 0 && fractionalSeconds) {
dateString.append(".");
@@ -85,7 +83,6 @@ public long getApproximateTextProtocolLength() {
* @param pos socket output stream
* @throws IOException if socket error occur
*/

public void writeBinary(final PacketOutputStream pos) throws IOException {
int nano = time.getNano();
if (fractionalSeconds && nano > 0) {
@@ -97,7 +94,7 @@ public void writeBinary(final PacketOutputStream pos) throws IOException {
pos.write((byte) time.getSecond());
pos.writeInt(nano / 1000);
} else {
pos.write((byte) 8);//length
pos.write((byte) 8); // length
pos.write((byte) 0);
pos.writeInt(0);
pos.write((byte) time.getHour());
@@ -122,4 +119,4 @@ public boolean isNullData() {
public boolean isLongData() {
return false;
}
}
}
@@ -3,7 +3,7 @@
* MariaDB Client for Java
*
* Copyright (c) 2012-2014 Monty Program Ab.
* Copyright (c) 2015-2017 MariaDB Ab.
* Copyright (c) 2015-2019 MariaDB Ab.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
@@ -3,7 +3,7 @@
* MariaDB Client for Java
*
* Copyright (c) 2012-2014 Monty Program Ab.
* Copyright (c) 2015-2017 MariaDB Ab.
* Copyright (c) 2015-2019 MariaDB Ab.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free

0 comments on commit 5cdf785

Please sign in to comment.
You can’t perform that action at this time.