Program: 29301
Project: 29301
Buggy source:
@Override public Entry nextEntry() throws IOException {
  EnumSet<PropagationMode> propModes=toPropagationMode(ois.readInt());
  ContextBootstrap.debug(MessageID.READ_PROP_MODES,propModes);
  String className=readAscii();
  Entry.ContextType contextType=toContextType(className);
  ContextBootstrap.debug(MessageID.READ_CONTEXT_TYPE,contextType);
  Object value;
switch (contextType) {
case LONG:
    value=ois.readLong();
  if (key.equals(Catalog.CATALOG_META_KEY)) {
    wlsCatalog.setMeta((Long)value);
  }
break;
case STRING:
value=ois.readUTF();
break;
case ASCII_STRING:
value=readAscii();
break;
case SERIALIZABLE:
byte[] bytes=new byte[ois.readInt()];
ois.readFully(bytes);
try {
Carrier carrier=Carrier.fromBytes(bytes);
value=carrier.serializable;
if (value instanceof ViewMeta) {
try {
value=((PrivilegedWireAdapterAccessor)ContextMapHelper.getScopeAwareContextMap()).createViewCapable(key,false);
}
 catch (InsufficientCredentialException e) {
throw new AssertionError("String_Node_Str");
}
}
 else {
if (key.equals(Catalog.CATALOG_KEY)) {
wlsCatalog.setPosisionsFrom((Catalog)value);
}
}
}
 catch (ClassNotFoundException e) {
ContextBootstrap.debug(MessageID.READING_OPAQUE_TYPE,key,bytes.length);
value=bytes;
contextType=ContextType.OPAQUE;
}
break;
case OPAQUE:
SerializableContextFactory factory=HELPER.findContextFactory(key,className);
if (factory == null) {
error(MessageID.ERROR_NO_WORK_CONTEXT_FACTORY,key,className);
return null;
}
 else {
value=factory.createInstance();
if (value instanceof WLSContext) {
((WLSContext)value).readContext(ois);
}
}
break;
default :
throw new AssertionError("String_Node_Str" + contextType);
}
ContextBootstrap.debug(MessageID.READ_VALUE,value);
return contextType == ContextType.OPAQUE ? Entry.createOpaqueEntryInstance(value,propModes,className) : new Entry(value,propModes,contextType);
}

Fixed version (ground truth):
@Override public Entry nextEntry() throws IOException {
  EnumSet<PropagationMode> propModes=toPropagationMode(ois.readInt());
  ContextBootstrap.debug(MessageID.READ_PROP_MODES,propModes);
  String className=readAscii();
  Entry.ContextType contextType=toContextType(className);
  ContextBootstrap.debug(MessageID.READ_CONTEXT_TYPE,contextType);
  Object value;
switch (contextType) {
case LONG:
    value=ois.readLong();
  if (key.equals(Catalog.CATALOG_META_KEY)) {
    wlsCatalog.setMeta((Long)value);
  }
break;
case STRING:
value=ois.readUTF();
break;
case ASCII_STRING:
value=readAscii();
break;
case SERIALIZABLE:
byte[] bytes=new byte[ois.readInt()];
ois.readFully(bytes);
try {
Carrier carrier=Carrier.fromBytes(bytes);
value=carrier.serializable;
if (value instanceof ViewMeta) {
try {
value=((PrivilegedWireAdapterAccessor)ContextMapHelper.getScopeAwareContextMap()).createViewCapable(key,false);
}
 catch (InsufficientCredentialException e) {
throw new AssertionError("String_Node_Str");
}
}
 else {
if (key.equals(Catalog.CATALOG_KEY)) {
wlsCatalog.setPosisionsFrom((Catalog)value);
}
}
}
 catch (ClassNotFoundException e) {
ContextBootstrap.debug(MessageID.READING_OPAQUE_TYPE,key,bytes.length);
value=bytes;
contextType=ContextType.OPAQUE;
}
break;
case OPAQUE:
SerializableContextFactory factory=HELPER.findContextFactory(key,className);
if (factory == null) {
error(MessageID.ERROR_NO_WORK_CONTEXT_FACTORY,key,className);
return null;
}
 else {
WLSContext ctx=factory.createInstance();
if (ctx != null) {
ctx.readContext(ois);
}
value=ctx;
}
break;
default :
throw new AssertionError("String_Node_Str" + contextType);
}
ContextBootstrap.debug(MessageID.READ_VALUE,value);
return contextType == ContextType.OPAQUE ? Entry.createOpaqueEntryInstance(value,propModes,className) : new Entry(value,propModes,contextType);
}