Program: 184315
Project: 184315
Buggy source:
@Override public Resource resolve(String path){
  String extension=path.substring(path.lastIndexOf('.') + 1);
  Source source=loader.findSource(path);
  if (source != null) {
    return new StaticResource(source,TheMimeTypes.get(extension),this.age);
  }
  String theme="String_Node_Str";
  String skin="String_Node_Str";
  int last=path.lastIndexOf('/');
  int prev=path.indexOf('/') + 1;
  int next=path.indexOf("String_Node_Str",prev);
  if (0 < next && next <= last) {
    prev=next + 1;
  }
  next=path.indexOf("String_Node_Str",prev);
  if (0 < next && next <= last) {
    theme=path.substring(prev,next);
    prev=next + 1;
  }
  next=path.indexOf("String_Node_Str",prev);
  if (0 < next && next <= last) {
    skin=path.substring(prev,next);
    prev=next + 1;
  }
  String name=path.substring(prev);
  if ((source=loader.findSource("String_Node_Str" + "String_Node_Str" + theme + "String_Node_Str"+ skin+ "String_Node_Str"+ name)) != null) {
    return new StaticResource(source,TheMimeTypes.get(extension),this.age);
  }
 else   if ((source=loader.findSource("String_Node_Str" + "String_Node_Str" + theme + "String_Node_Str"+ name)) != null) {
    return new StaticResource(source,TheMimeTypes.get(extension),this.age);
  }
 else   if ((source=loader.findSource("String_Node_Str" + "String_Node_Str" + name)) != null) {
    return new StaticResource(source,TheMimeTypes.get(extension),this.age);
  }
 else   if ((source=loader.findSource("String_Node_Str" + "String_Node_Str" + name)) != null) {
    return new StaticResource(source,TheMimeTypes.get(extension),this.age);
  }
 else   if ((source=loader.findSource("String_Node_Str" + name)) != null) {
    return new StaticResource(source,TheMimeTypes.get(extension),this.age);
  }
  String[] names=null;
  if (name.indexOf('/',prev) > 0) {
    return new StaticTemplateResouce(templateConfig,typeLoader,attributes,theme,skin,name);
  }
 else   if ((names=name.split("String_Node_Str")).length > 0) {
    String specName=null;
    final int start;
    if ("String_Node_Str".indexOf(names[0]) >= 0) {
      start=1;
      specName=names[0];
    }
 else {
      start=0;
    }
    String attachedTypeName;
    String typeName;
    String layoutName;
    String actionName;
    Broker<Type> type;
    Broker<Type> attachedType;
switch (names.length - start) {
default :
case 4:
      attachedTypeName=names[start + 0];
    typeName=names[start + 1];
  layoutName=names[start + 2];
actionName=names[start + 3];
attachedType=typeBrokers.getBroker(attachedTypeName);
type=typeBrokers.getBroker(typeName);
if (specName == null && type.get().getStandalone() == TypeStandalone.Master) {
specName="String_Node_Str";
}
return new AttachedTypeTemplateResouce(templateConfig,dataWareHouse,attributes,path,theme,skin,attachedType,type,specName,layoutName,actionName);
case 3:
typeName=names[start + 0];
layoutName=names[start + 1];
actionName=names[start + 2];
type=typeBrokers.getBroker(typeName);
if (type.get().getAttrs().containsKey(Type.ATTACH_TO)) {
attachedTypeName=(String)type.get().getAttrs().get(Type.ATTACH_TO);
attachedType=typeBrokers.getBroker(attachedTypeName);
if (specName == null && type.get().getStandalone() == TypeStandalone.Master) {
specName="String_Node_Str";
}
return new AttachedTypeTemplateResouce(templateConfig,dataWareHouse,attributes,path,theme,skin,attachedType,type,specName,layoutName,actionName);
}
return new TypeTemplateResouce(templateConfig,dataWareHouse,attributes,path,theme,skin,type,specName,layoutName,actionName);
case 2:
typeName=names[start + 0];
layoutName=null;
actionName=names[start + 1];
type=typeBrokers.getBroker(typeName);
if (type.get().getAttrs().containsKey(Type.ATTACH_TO)) {
attachedTypeName=(String)type.get().getAttrs().get(Type.ATTACH_TO);
attachedType=typeBrokers.getBroker(attachedTypeName);
if (specName == null && type.get().getStandalone() == TypeStandalone.Master) {
specName="String_Node_Str";
}
return new AttachedTypeTemplateResouce(templateConfig,dataWareHouse,attributes,path,theme,skin,attachedType,type,specName,layoutName,actionName);
}
return new TypeTemplateResouce(templateConfig,dataWareHouse,attributes,path,theme,skin,type,specName,layoutName,actionName);
}
}
 else {
return new StaticTemplateResouce(templateConfig,typeLoader,attributes,theme,skin,name);
}
}

Fixed version (ground truth):
@Override public Resource resolve(String path){
  String extension=path.substring(path.lastIndexOf('.') + 1);
  Source source=loader.findSource(path);
  if (source != null) {
    return new StaticResource(source,TheMimeTypes.get(extension),this.age);
  }
  String theme="String_Node_Str";
  String skin="String_Node_Str";
  int last=path.lastIndexOf('/');
  int prev=path.indexOf('/') + 1;
  int next=path.indexOf("String_Node_Str",prev);
  if (0 < next && next <= last) {
    prev=next + 1;
  }
  next=path.indexOf("String_Node_Str",prev);
  if (0 < next && next <= last) {
    theme=path.substring(prev,next);
    prev=next + 1;
  }
  next=path.indexOf("String_Node_Str",prev);
  if (0 < next && next <= last) {
    skin=path.substring(prev,next);
    prev=next + 1;
  }
  String name=path.substring(prev);
  if ((source=loader.findSource("String_Node_Str" + "String_Node_Str" + theme + "String_Node_Str"+ skin+ "String_Node_Str"+ name)) != null) {
    return new StaticResource(source,TheMimeTypes.get(extension),this.age);
  }
 else   if ((source=loader.findSource("String_Node_Str" + "String_Node_Str" + theme + "String_Node_Str"+ name)) != null) {
    return new StaticResource(source,TheMimeTypes.get(extension),this.age);
  }
 else   if ((source=loader.findSource("String_Node_Str" + "String_Node_Str" + name)) != null) {
    return new StaticResource(source,TheMimeTypes.get(extension),this.age);
  }
 else   if ((source=loader.findSource("String_Node_Str" + "String_Node_Str" + name)) != null) {
    return new StaticResource(source,TheMimeTypes.get(extension),this.age);
  }
 else   if ((source=loader.findSource("String_Node_Str" + name)) != null) {
    return new StaticResource(source,TheMimeTypes.get(extension),this.age);
  }
  String[] names=null;
  if (name.indexOf('/',prev) > 0) {
    return new StaticTemplateResouce(templateConfig,typeLoader,attributes,theme,skin,name);
  }
 else   if ((names=name.split("String_Node_Str")).length > 0) {
    String specName=null;
    final int start;
    if ("String_Node_Str".indexOf(names[0]) >= 0) {
      start=1;
      specName=names[0];
    }
 else {
      start=0;
    }
    String attachedTypeName;
    String typeName;
    String layoutName;
    String actionName;
    Broker<Type> type;
    Broker<Type> attachedType;
switch (names.length - start) {
default :
case 4:
      attachedTypeName=names[start + 0];
    typeName=names[start + 1];
  layoutName=names[start + 2];
actionName=names[start + 3];
attachedType=typeBrokers.getBroker(attachedTypeName);
type=typeBrokers.getBroker(typeName);
if (specName == null && type.get().getStandalone() == TypeStandalone.Master) {
specName="String_Node_Str";
}
return new AttachedTypeTemplateResouce(templateConfig,dataWareHouse,attributes,path,theme,skin,attachedType,type,specName,layoutName,actionName);
case 3:
typeName=names[start + 0];
layoutName=names[start + 1];
actionName=names[start + 2];
type=typeBrokers.getBroker(typeName);
return new TypeTemplateResouce(templateConfig,dataWareHouse,attributes,path,theme,skin,type,specName,layoutName,actionName);
case 2:
typeName=names[start + 0];
layoutName=null;
actionName=names[start + 1];
type=typeBrokers.getBroker(typeName);
return new TypeTemplateResouce(templateConfig,dataWareHouse,attributes,path,theme,skin,type,specName,layoutName,actionName);
}
}
 else {
return new StaticTemplateResouce(templateConfig,typeLoader,attributes,theme,skin,name);
}
}