Skip to content

Commit

Permalink
Small fixes wrt lgtm.com's suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jan 5, 2021
1 parent db75318 commit 49223ee
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ public class AvroTypeIdResolver extends ClassNameIdResolver
{
private final Map<String, Class<?>> _idTypes = new HashMap<>();

private final Map<Class<?>, String> _typeIds = new HashMap<>();
// 04-Jan-2021, tatu: Not sure why this is being kept around, not used as of
// 2.12; commenting out may be removed from 2.13
// private final Map<Class<?>, String> _typeIds = new HashMap<>();

public AvroTypeIdResolver(JavaType baseType, TypeFactory typeFactory,
PolymorphicTypeValidator ptv,
Expand All @@ -44,12 +46,12 @@ public AvroTypeIdResolver(JavaType baseType, TypeFactory typeFactory,
@Override
public void registerSubtype(Class<?> type, String name) {
_idTypes.put(name, type);
_typeIds.put(type, name);
// _typeIds.put(type, name);
}

@Override
protected JavaType _typeFromId(String id, DatabindContext ctxt) throws IOException {
// base types don't have subclasses
// primitive types don't have subclasses
if (_baseType.isPrimitive()) {
return _baseType;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ private long _decodeLongSlow2(long lo) throws IOException
i = b & 0x7F;
if (b < 0) {
b = _nextByteGuaranteed();
if (i < 0) {
if (b < 0) {
_reportInvalidNegative(b);
}
i |= (b << 7);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2867,7 +2867,7 @@ protected void _skipIncomplete() throws IOException

// Either String or byte[]
if (type != CBORConstants.MAJOR_TYPE_TEXT
&& type == CBORConstants.MAJOR_TYPE_TEXT) {
&& type != CBORConstants.MAJOR_TYPE_BYTES) {
_throwInternal();
}
final int lowBits = _typeByte & 0x1F;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ public static int lengthLength(int len) {
if (len <= 0x1FFFFF) { // 21 bytes
return 3;
}
if (len <= 0x1FFFFF) { // 21 bytes
return 3;
}
if (len <= 0x0FFFFFFF) { // 28 bytes
return 4;
}
Expand Down

0 comments on commit 49223ee

Please sign in to comment.