Skip to content

Commit

Permalink
Fix DynamicTableWriter#setPermissive
Browse files Browse the repository at this point in the history
  • Loading branch information
nbauernfeind committed Feb 3, 2023
1 parent b0a0f12 commit 515286e
Showing 1 changed file with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ public void logRowPermissive(Map<String, Object> values) {
"Incompatible logRowPermissive call: " + values.keySet() + " != " + factoryMap.keySet());
}
for (final Map.Entry<String, Object> value : values.entrySet()) {
// noinspection unchecked
getSetter(value.getKey()).setPermissive(value.getValue());
}
writeRow();
Expand All @@ -295,7 +294,6 @@ public void logRowPermissive(Object... values) {
+ factoryMap.size());
}
for (int ii = 0; ii < values.length; ++ii) {
// noinspection unchecked
getSetter(ii).setPermissive(values[ii]);
}
writeRow();
Expand Down Expand Up @@ -440,7 +438,7 @@ private <T> RowSetterImpl<T> createRowSetter(Class<T> type, WritableColumnSource
}

public interface PermissiveRowSetter<T> extends RowSetter<T> {
void setPermissive(T value);
void setPermissive(Object value);
}

private static abstract class RowSetterImpl<T> implements PermissiveRowSetter<T> {
Expand Down Expand Up @@ -471,8 +469,9 @@ public void set(T value) {
}

@Override
public void setPermissive(T value) {
set(value);
public void setPermissive(Object value) {
// noinspection unchecked
set((T) value);
}

@Override
Expand Down Expand Up @@ -552,7 +551,7 @@ public void set(Byte value) {
}

@Override
public void setPermissive(Byte value) {
public void setPermissive(Object value) {
setByte(value == null ? QueryConstants.NULL_BYTE : ((Number) value).byteValue());
}

Expand Down Expand Up @@ -603,7 +602,7 @@ public void set(Integer value) {
}

@Override
public void setPermissive(Integer value) {
public void setPermissive(Object value) {
setInt(value == null ? QueryConstants.NULL_INT : ((Number) value).intValue());
}

Expand Down Expand Up @@ -631,7 +630,7 @@ public void set(Double value) {
}

@Override
public void setPermissive(Double value) {
public void setPermissive(Object value) {
setDouble(value == null ? QueryConstants.NULL_DOUBLE : ((Number) value).doubleValue());
}

Expand Down Expand Up @@ -659,7 +658,7 @@ public void set(Float value) {
}

@Override
public void setPermissive(Float value) {
public void setPermissive(Object value) {
setFloat(value == null ? QueryConstants.NULL_FLOAT : ((Number) value).floatValue());
}

Expand Down Expand Up @@ -687,7 +686,7 @@ public void set(Long value) {
}

@Override
public void setPermissive(Long value) {
public void setPermissive(Object value) {
setLong(value == null ? QueryConstants.NULL_LONG : ((Number) value).longValue());
}

Expand Down Expand Up @@ -715,7 +714,7 @@ public void set(Short value) {
}

@Override
public void setPermissive(Short value) {
public void setPermissive(Object value) {
setShort(value == null ? QueryConstants.NULL_SHORT : ((Number) value).shortValue());
}

Expand Down

0 comments on commit 515286e

Please sign in to comment.