Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
public class HopRowCoder extends AtomicCoder<HopRow> {

@Override
public void encode(HopRow value, OutputStream outStream) throws CoderException, IOException {
public void encode(HopRow value, OutputStream outStream) throws IOException {

Object[] row = value.getRow();
ObjectOutputStream out = new ObjectOutputStream(outStream);
Expand Down Expand Up @@ -69,7 +69,7 @@ public void encode(HopRow value, OutputStream outStream) throws CoderException,
}

@Override
public HopRow decode(InputStream inStream) throws CoderException, IOException {
public HopRow decode(InputStream inStream) throws IOException {

ObjectInputStream in = new ObjectInputStream(inStream);

Expand All @@ -93,7 +93,7 @@ public HopRow decode(InputStream inStream) throws CoderException, IOException {
}

@Override
public void verifyDeterministic() throws NonDeterministicException {
public void verifyDeterministic() {
// Sure
}

Expand Down Expand Up @@ -121,7 +121,7 @@ private void write(ObjectOutputStream out, int objectType, Object object) throws
break;
case IValueMeta.TYPE_DATE:
{
Long lng = ((Date) object).getTime();
long lng = ((Date) object).getTime();
out.writeLong(lng);
}
break;
Expand Down Expand Up @@ -171,14 +171,12 @@ private Object read(ObjectInputStream in, int objectType) throws IOException {
int length = in.readInt();
byte[] data = new byte[length];
in.readFully(data);
String string = new String(data, StandardCharsets.UTF_8);
return string;
return new String(data, StandardCharsets.UTF_8);
}

case IValueMeta.TYPE_INTEGER:
{
Long lng = in.readLong();
return lng;
return in.readLong();
}

case IValueMeta.TYPE_TIMESTAMP:
Expand All @@ -190,40 +188,33 @@ private Object read(ObjectInputStream in, int objectType) throws IOException {

case IValueMeta.TYPE_DATE:
{
Long lng = in.readLong();
return new Date(lng);
return new Date(in.readLong());
}

case IValueMeta.TYPE_BOOLEAN:
{
boolean b = in.readBoolean();
return b;
return in.readBoolean();
}

case IValueMeta.TYPE_NUMBER:
{
Double dbl = in.readDouble();
return dbl;
return in.readDouble();
}

case IValueMeta.TYPE_BIGNUMBER:
{
String bd = in.readUTF();
return new BigDecimal(bd);
return new BigDecimal(in.readUTF());
}

case IValueMeta.TYPE_BINARY:
{
byte[] bytes = new byte[in.readInt()];
in.read(bytes);
return bytes;
return new byte[in.readInt()];
}

case IValueMeta.TYPE_INET:
{
String hostname = (String) read(in, IValueMeta.TYPE_STRING);
byte[] addr = new byte[in.readInt() == 1 ? 4 : 16];
in.read(addr);
return InetAddress.getByAddress(hostname, addr);
}
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import org.apache.hop.core.row.value.ValueMetaString;
import org.apache.hop.core.util.Utils;
import org.apache.hop.core.variables.IVariables;
import org.apache.hop.core.xml.XmlHandler;
import org.apache.hop.metadata.api.HopMetadata;
import org.apache.hop.metadata.api.HopMetadataBase;
import org.apache.hop.metadata.api.HopMetadataProperty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

import java.io.CharArrayWriter;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;

public class SshData extends BaseTransformData implements ITransformData {
public int indexOfCommand;
Expand Down Expand Up @@ -94,7 +95,7 @@ public static Connection openConnection(IVariables variables, SshMeta meta) thro
CharArrayWriter charArrayWriter = new CharArrayWriter((int) keyFileContent.getSize());

try (InputStream in = keyFileContent.getInputStream()) {
IOUtils.copy(in, charArrayWriter, "UTF-8");
IOUtils.copy(in, charArrayWriter, StandardCharsets.UTF_8);
}

content = charArrayWriter.toCharArray();
Expand Down