diff --git a/src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufIDLGenerator.java b/src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufIDLGenerator.java index 82056a9..91389fd 100644 --- a/src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufIDLGenerator.java +++ b/src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufIDLGenerator.java @@ -229,6 +229,12 @@ private static void generateIDL(StringBuilder code, Class cls, Set> isMap = true; Class keyClass = field.getGenericKeyType(); Class valueClass = field.getGenericeValueType(); + if (keyClass == null) { + keyClass = String.class; + } + if (valueClass == null) { + valueClass = Object.class; + } type = type + "<" + ProtobufProxyUtils.processProtobufType(keyClass) + ", "; type = type + ProtobufProxyUtils.processProtobufType(valueClass) + ">"; diff --git a/src/main/java/com/baidu/bjf/remoting/protobuf/utils/ProtobufProxyUtils.java b/src/main/java/com/baidu/bjf/remoting/protobuf/utils/ProtobufProxyUtils.java index 1fad798..5825936 100644 --- a/src/main/java/com/baidu/bjf/remoting/protobuf/utils/ProtobufProxyUtils.java +++ b/src/main/java/com/baidu/bjf/remoting/protobuf/utils/ProtobufProxyUtils.java @@ -209,6 +209,9 @@ public static List processDefaultValue(List fields, boolean ig if (isList) { fieldTypeClass = fieldInfo.getGenericKeyType(); } + if (fieldTypeClass == null) { + fieldTypeClass = Object.class; + } FieldType fieldType = TYPE_MAPPING.get(fieldTypeClass); if (fieldType == null) {