Program: 162987
Project: 162987
Buggy source:
private void registerConverter(XStream xstream){
  final Converter converter=new Converter(){
    final Bytes buffer=XStreamConverter.this.buffer;
    @Override public boolean canConvert(    Class aClass){
      if (EntrySet.class.isAssignableFrom(aClass) || WriteThroughEntry.class.isAssignableFrom(aClass))       return true;
      String canonicalName=aClass.getCanonicalName();
      if (canonicalName.startsWith("String_Node_Str")) {
        return true;
      }
      return false;
    }
    @Override public void marshal(    Object o,    HierarchicalStreamWriter writer,    MarshallingContext marshallingContext){
      if (WriteThroughEntry.class.isAssignableFrom(o.getClass())) {
        final SimpleEntry e=(SimpleEntry)o;
        writer.startNode("String_Node_Str");
        Object key=e.getKey();
        writeType(writer,key,kClass);
        marshallingContext.convertAnother(key);
        writer.endNode();
        writer.startNode("String_Node_Str");
        Object value=e.getValue();
        writeType(writer,value,vClass);
        marshallingContext.convertAnother(value);
        writer.endNode();
      }
 else       if (EntrySet.class.isAssignableFrom(o.getClass())) {
        for (        Entry e : (EntrySet)o) {
          writer.startNode("String_Node_Str");
          marshallingContext.convertAnother(e);
          writer.endNode();
        }
      }
      if (o.getClass().getCanonicalName().startsWith("String_Node_Str") && (o.getClass().getCanonicalName().endsWith("String_Node_Str") || o.getClass().getCanonicalName().endsWith("String_Node_Str"))) {
        Method[] methods=o.getClass().getMethods();
        for (        Method method : methods) {
          if (method.getName().equals("String_Node_Str") && method.getParameterTypes().length == 0) {
            try {
              Object result=method.invoke(o);
              writer.setValue(result.toString());
              return;
            }
 catch (            Exception e) {
              throw new RuntimeException("String_Node_Str" + o.getClass().getCanonicalName(),e);
            }
          }
        }
      }
    }
    @Override public Object unmarshal(    HierarchicalStreamReader reader,    UnmarshallingContext unmarshallingContext){
      final String nodeName=reader.getNodeName();
switch (nodeName) {
case "String_Node_Str":
        while (reader.hasMoreChildren()) {
          reader.moveDown();
          final String nodeName0=reader.getNodeName();
          if (!nodeName0.equals("String_Node_Str"))           throw new ConversionException("String_Node_Str" + "String_Node_Str" + nodeName0);
          K k=null;
          V v=null;
          while (reader.hasMoreChildren()) {
            reader.moveDown();
            final String nodeName1=reader.getNodeName();
            if ("String_Node_Str".equals(nodeName1))             k=get(reader,unmarshallingContext,kClass);
 else             if ("String_Node_Str".equals(nodeName1))             v=get(reader,unmarshallingContext,vClass);
 else             throw new ConversionException("String_Node_Str");
            reader.moveUp();
          }
          if (k != null)           VanillaChronicleMap.this.put(k,v);
          reader.moveUp();
        }
      break;
case "String_Node_Str":
    if (kClass.getCanonicalName().startsWith("String_Node_Str")) {
      return toNative(reader,vClass);
    }
 else {
      long keySize=keySizeMarshaller.readSize(buffer);
      ThreadLocalCopies copies=keyReaderProvider.getCopies(null);
      BytesReader<K> keyReader=keyReaderProvider.get(copies,originalKeyReader);
      return keyReader.read(buffer,keySize);
    }
case "String_Node_Str":
  if (vClass.getCanonicalName().startsWith("String_Node_Str")) {
    return toNative(reader,vClass);
  }
 else {
    long valueSize=valueSizeMarshaller.readSize(buffer);
    ThreadLocalCopies copies=valueReaderProvider.getCopies(null);
    BytesReader<V> valueReader=valueReaderProvider.get(copies,originalValueReader);
    return valueReader.read(buffer,valueSize);
  }
}
return null;
}
private <E>E get(HierarchicalStreamReader reader,UnmarshallingContext unmarshallingContext,Class<E> clazz){
if (reader.getAttributeCount() > 0) {
final String type=reader.getAttribute("String_Node_Str");
try {
  return (E)unmarshallingContext.convertAnother(null,forName(type));
}
 catch (ClassNotFoundException e) {
  throw new ConversionException(e);
}
}
 else return (E)unmarshallingContext.convertAnother(null,clazz);
}
private Object toNative(HierarchicalStreamReader reader,final Class aClass){
Object o=DataValueClasses.newDirectInstance(aClass);
try {
for (Method $$nativeMethod : o.getClass().getMethods()) {
  if ($$nativeMethod.getName().equals("String_Node_Str") && $$nativeMethod.getParameterTypes().length == 1) {
    Class<?> parameterType=$$nativeMethod.getParameterTypes()[0];
    String value=reader.getValue();
    if (parameterType.isPrimitive()) {
      String name=parameterType.getSimpleName();
      String properName="String_Node_Str" + Character.toString(name.charAt(0)).toUpperCase() + name.substring(1);
      parameterType=Class.forName(properName);
    }
    Method valueOf=parameterType.getMethod("String_Node_Str",String.class);
    Object invoke=valueOf.invoke(null,value);
    $$nativeMethod.invoke(o,invoke);
    return o;
  }
}
}
 catch (Exception e) {
throw new ConversionException("String_Node_Str" + aClass.getCanonicalName(),e);
}
throw new ConversionException("String_Node_Str" + aClass.getCanonicalName());
}
}
;
xstream.registerConverter(converter);
}

Fixed version (ground truth):
private void registerConverter(XStream xstream){
  final Converter converter=new Converter(){
    final Bytes buffer=XStreamConverter.this.buffer;
    @Override public boolean canConvert(    Class aClass){
      if (EntrySet.class.isAssignableFrom(aClass) || WriteThroughEntry.class.isAssignableFrom(aClass))       return true;
      String canonicalName=aClass.getCanonicalName();
      if (canonicalName.startsWith("String_Node_Str")) {
        return true;
      }
      return false;
    }
    @Override public void marshal(    Object o,    HierarchicalStreamWriter writer,    MarshallingContext marshallingContext){
      if (WriteThroughEntry.class.isAssignableFrom(o.getClass())) {
        final SimpleEntry e=(SimpleEntry)o;
        writer.startNode("String_Node_Str");
        Object key=e.getKey();
        writeType(writer,key,kClass);
        marshallingContext.convertAnother(key);
        writer.endNode();
        writer.startNode("String_Node_Str");
        Object value=e.getValue();
        writeType(writer,value,vClass);
        marshallingContext.convertAnother(value);
        writer.endNode();
      }
 else       if (EntrySet.class.isAssignableFrom(o.getClass())) {
        for (        Entry e : (EntrySet)o) {
          writer.startNode("String_Node_Str");
          marshallingContext.convertAnother(e);
          writer.endNode();
        }
      }
      if (o.getClass().getCanonicalName().startsWith("String_Node_Str") && (o.getClass().getCanonicalName().endsWith("String_Node_Str") || o.getClass().getCanonicalName().endsWith("String_Node_Str"))) {
        Method[] methods=o.getClass().getMethods();
        for (        Method method : methods) {
          if (method.getName().equals("String_Node_Str") && method.getParameterTypes().length == 0) {
            try {
              Object result=method.invoke(o);
              writer.setValue(result.toString());
              return;
            }
 catch (            Exception e) {
              throw new RuntimeException("String_Node_Str" + o.getClass().getCanonicalName(),e);
            }
          }
        }
      }
    }
    @Override public Object unmarshal(    HierarchicalStreamReader reader,    UnmarshallingContext unmarshallingContext){
      final String nodeName=reader.getNodeName();
switch (nodeName) {
case "String_Node_Str":
        while (reader.hasMoreChildren()) {
          reader.moveDown();
          final String nodeName0=reader.getNodeName();
          if (!nodeName0.equals("String_Node_Str"))           throw new ConversionException("String_Node_Str" + "String_Node_Str" + nodeName0);
          K k=null;
          V v=null;
          while (reader.hasMoreChildren()) {
            reader.moveDown();
            final String nodeName1=reader.getNodeName();
            if ("String_Node_Str".equals(nodeName1))             k=get(reader,unmarshallingContext,kClass);
 else             if ("String_Node_Str".equals(nodeName1))             v=get(reader,unmarshallingContext,vClass);
 else             throw new ConversionException("String_Node_Str");
            reader.moveUp();
          }
          if (k != null)           VanillaChronicleMap.this.put(k,v);
          reader.moveUp();
        }
      break;
case "String_Node_Str":
    if (kClass.getCanonicalName().startsWith("String_Node_Str")) {
      return to$$Native(reader,vClass);
    }
 else {
      long keySize=keySizeMarshaller.readSize(buffer);
      ThreadLocalCopies copies=keyReaderProvider.getCopies(null);
      BytesReader<K> keyReader=keyReaderProvider.get(copies,originalKeyReader);
      return keyReader.read(buffer,keySize);
    }
case "String_Node_Str":
  if (vClass.getCanonicalName().startsWith("String_Node_Str")) {
    return to$$Native(reader,vClass);
  }
 else {
    long valueSize=valueSizeMarshaller.readSize(buffer);
    ThreadLocalCopies copies=valueReaderProvider.getCopies(null);
    BytesReader<V> valueReader=valueReaderProvider.get(copies,originalValueReader);
    return valueReader.read(buffer,valueSize);
  }
}
return null;
}
private <E>E get(HierarchicalStreamReader reader,UnmarshallingContext unmarshallingContext,Class<E> clazz){
if (reader.getAttributeCount() > 0) {
final String type=reader.getAttribute("String_Node_Str");
try {
  return (E)unmarshallingContext.convertAnother(null,forName(type));
}
 catch (ClassNotFoundException e) {
  throw new ConversionException(e);
}
}
 else return (E)unmarshallingContext.convertAnother(null,clazz);
}
private Object to$$Native(HierarchicalStreamReader reader,final Class aClass){
Object o=DataValueClasses.newDirectInstance(aClass);
try {
for (Method $$nativeMethod : o.getClass().getMethods()) {
  if ($$nativeMethod.getName().equals("String_Node_Str") && $$nativeMethod.getParameterTypes().length == 1) {
    Class<?> parameterType=$$nativeMethod.getParameterTypes()[0];
    String value=reader.getValue();
    if (parameterType.isPrimitive()) {
      if (parameterType == int.class)       parameterType=Integer.class;
 else       if (parameterType == char.class)       parameterType=Character.class;
 else {
        final String name=parameterType.getSimpleName();
        final String properName="String_Node_Str" + Character.toString(name.charAt(0)).toUpperCase() + name.substring(1);
        parameterType=Class.forName(properName);
      }
    }
    final Method valueOf=parameterType.getMethod("String_Node_Str",String.class);
    final Object invoke=valueOf.invoke(null,value);
    $$nativeMethod.invoke(o,invoke);
    return o;
  }
}
}
 catch (Exception e) {
throw new ConversionException("String_Node_Str" + aClass.getCanonicalName(),e);
}
throw new ConversionException("String_Node_Str" + aClass.getCanonicalName());
}
}
;
xstream.registerConverter(converter);
}