Source:
<code>public String realMember(@SuppressWarnings("rawtypes") Class type, String serialized) { String serializedFieldName = super.realMember(type, serialized); if (serializedFieldName.startsWith(OUTER_CLASS_FIELD_PREFIX)) { Collection<String> compiledFieldNames = findOuterClassFieldNames(type); if (compiledFieldNames.size() == 0) { throw new IllegalStateException("Unable to find any outer class fields in " + type + ", searching specifically for " + serializedFieldName); } Set<String> uniqueFieldNames = new HashSet<String>(compiledFieldNames); String deepestField = compiledFieldNames.iterator().next(); String deserializeFieldName; if (!compiledFieldNames.contains(serializedFieldName)) { String msg = "Unable to find outer class field " + serializedFieldName + " in class " + type + ". " + "This could be caused by " + "1) changing the class (or one of its parents) to a static or " + "2) moving the class to a different lexical level (enclosing classes) or " + "3) using a different compiler (i.e eclipse vs oracle) at the time the object was serialized. "; if (uniqueFieldNames.size() == 1) { LOG.warn(msg + "Will use the field " + deepestField + " instead."); <START> deserializeFieldName = deepestField; <END> } else { LOG.error(msg + "Will fail with a field not found exception. " + "Edit the persistence state manually and update the field names. "+ "Existing field names are " + uniqueFieldNames); deserializeFieldName = serializedFieldName; } } else { if (uniqueFieldNames.size() > 1) { LOG.debug("Deserializing the non-static class " + type + " with multiple outer class fields " + uniqueFieldNames + ". " + "When changing compilers it's possible that the instance won't be able to be deserialized due to changed outer class field names. " + "In those cases deserialization could fail with field not found exception or class cast exception following this log line."); } deserializeFieldName = serializedFieldName; } return deserializeFieldName; } else { return serializedFieldName; } }</code><technical_language>personally delete deepestField variable (which is here), assign deserializeFieldName = Iterables.getOnlyElement(uniqueFieldNames)l. name "deepestField" threw first</technical_language>

Target:
public String realMember(@SuppressWarnings("rawtypes") Class type, String serialized) { String serializedFieldName = super.realMember(type, serialized); if (serializedFieldName.startsWith(OUTER_CLASS_FIELD_PREFIX)) { Collection<String> compiledFieldNames = findOuterClassFieldNames(type); if (compiledFieldNames.size() == 0) { throw new IllegalStateException("Unable to find any outer class fields in " + type + ", searching specifically for " + serializedFieldName); } Set<String> uniqueFieldNames = new HashSet<String>(compiledFieldNames); String deserializeFieldName; if (!compiledFieldNames.contains(serializedFieldName)) { String msg = "Unable to find outer class field " + serializedFieldName + " in class " + type + ". " + "This could be caused by " + "1) changing the class (or one of its parents) to a static or " + "2) moving the class to a different lexical level (enclosing classes) or " + "3) using a different compiler (i.e eclipse vs oracle) at the time the object was serialized. "; if (uniqueFieldNames.size() == 1) { deserializeFieldName = compiledFieldNames.iterator().next(); LOG.warn(msg + "Will use the field " + deserializeFieldName + " instead."); } else { LOG.error(msg + "Will fail with a field not found exception. " + "Edit the persistence state manually and update the field names. "+ "Existing field names are " + uniqueFieldNames); deserializeFieldName = serializedFieldName; } } else { if (uniqueFieldNames.size() > 1) { LOG.debug("Deserializing the non-static class " + type + " with multiple outer class fields " + uniqueFieldNames + ". " + "When changing compilers it's possible that the instance won't be able to be deserialized due to changed outer class field names. " + "In those cases deserialization could fail with field not found exception or class cast exception following this log line."); } deserializeFieldName = serializedFieldName; } return deserializeFieldName; } else { return serializedFieldName; } }