Skip to content

Commit

Permalink
Add setExtendedFieldNames() method and set config
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr14huashao committed Oct 23, 2020
1 parent f152a70 commit c88ef07
Showing 1 changed file with 8 additions and 1 deletion.
Expand Up @@ -63,7 +63,7 @@ public CompatibleFieldSerializer (Kryo kryo, Class type, CompatibleFieldSerializ

@Override
protected void initializeCachedFields() {
if (!super.config.extendedFieldNames) {
if (!config.extendedFieldNames) {
final HashSet hashSet = new HashSet();
CachedField[] fields = cachedFields.fields;
for (int i = 0, n = fields.length; i < n; i++) {
Expand Down Expand Up @@ -304,6 +304,13 @@ public void setChunkedEncoding (boolean chunked) {
if (TRACE) trace("kryo", "CompatibleFieldSerializerConfig setChunked: " + chunked);
}

/** When true, field names are prefixed by their declaring class. This can avoid conflicts when a subclass has a field with
* the same name as a super class. Default is false. */
public void setExtendedFieldNames (boolean extendedFieldNames) {
this.extendedFieldNames = extendedFieldNames;
if (TRACE) trace("kryo", "CompatibleFieldSerializerConfig extendedFieldNames: " + extendedFieldNames);
}

public boolean getChunkedEncoding () {
return chunked;
}
Expand Down

0 comments on commit c88ef07

Please sign in to comment.