Program: 16490
Project: 16490
Buggy source:
/** 
 * StructureName wraps another StructureIdentifier. The type of the base identifier depends on the   {@link #getSource() source}. Most StructureName methods deligate to the base identifier. <p>It is possible that future versions of StructureName might change the return type. Except for some specialized uses, it is probably better to create the correct type of identifier directly, rather than creating a StructureName and casting the result of this method.
 * @return A Str
 * @throws StructureException Wraps exceptions that may be thrown byindividual implementations. For example, a SCOP identifier may require that the domain definitions be available for download.
 */
public StructureIdentifier getBaseIdentifier() throws StructureException {
  if (base == null) {
switch (mySource) {
case CATH:
      base=CathFactory.getCathDatabase().getDescriptionByCathId(getIdentifier());
    break;
case ECOD:
  try {
    base=EcodFactory.getEcodDatabase().getDomainsById(name);
  }
 catch (  IOException e) {
    throw new StructureException("String_Node_Str" + name,e);
  }
break;
case SCOP:
base=guessScopDomain(getIdentifier(),ScopFactory.getSCOP());
if (base == null) {
if (chainId.equals("String_Node_Str")) {
base=new SubstructureIdentifier(pdbId);
}
 else {
base=new SubstructureIdentifier(pdbId,ResidueRange.parseMultiple(chainId));
}
logger.error("String_Node_Str",name,base);
}
break;
case FILE:
try {
String[] prefix=name.split("String_Node_Str",2);
String filename;
if (prefix.length > 1) {
filename=prefix[1];
}
 else {
filename=name;
}
filename=FileDownloadUtils.expandUserHome(filename);
base=new URLIdentifier(new File(filename).toURI().toURL());
}
 catch (MalformedURLException e) {
throw new StructureException("String_Node_Str" + name,e);
}
break;
case URL:
try {
base=new URLIdentifier(name);
}
 catch (MalformedURLException e) {
throw new StructureException("String_Node_Str" + name,e);
}
break;
case PDP:
try {
PDPProvider provider=new RemotePDPProvider(false);
base=provider.getPDPDomain(name);
}
 catch (IOException e) {
throw new StructureException("String_Node_Str" + name,e);
}
break;
case BIO:
base=new BioAssemblyIdentifier(name);
case PDB:
base=new SubstructureIdentifier(getIdentifier());
break;
default :
throw new IllegalStateException("String_Node_Str" + mySource);
}
}
return base;
}

Fixed version (ground truth):
/** 
 * StructureName wraps another StructureIdentifier. The type of the base identifier depends on the   {@link #getSource() source}. Most StructureName methods deligate to the base identifier. <p>It is possible that future versions of StructureName might change the return type. Except for some specialized uses, it is probably better to create the correct type of identifier directly, rather than creating a StructureName and casting the result of this method.
 * @return A Str
 * @throws StructureException Wraps exceptions that may be thrown byindividual implementations. For example, a SCOP identifier may require that the domain definitions be available for download.
 */
public StructureIdentifier getBaseIdentifier() throws StructureException {
  if (base == null) {
switch (mySource) {
case CATH:
      base=CathFactory.getCathDatabase().getDescriptionByCathId(getIdentifier());
    break;
case ECOD:
  try {
    base=EcodFactory.getEcodDatabase().getDomainsById(name);
  }
 catch (  IOException e) {
    throw new StructureException("String_Node_Str" + name,e);
  }
break;
case SCOP:
base=guessScopDomain(getIdentifier(),ScopFactory.getSCOP());
if (base == null) {
if (chainId.equals("String_Node_Str")) {
base=new SubstructureIdentifier(pdbId);
}
 else {
base=new SubstructureIdentifier(pdbId,ResidueRange.parseMultiple(chainId));
}
logger.error("String_Node_Str",name,base);
}
break;
case FILE:
try {
String[] prefix=name.split("String_Node_Str",2);
String filename;
if (prefix.length > 1) {
filename=prefix[1];
}
 else {
filename=name;
}
filename=FileDownloadUtils.expandUserHome(filename);
base=new URLIdentifier(new File(filename).toURI().toURL());
}
 catch (MalformedURLException e) {
throw new StructureException("String_Node_Str" + name,e);
}
break;
case URL:
try {
base=new URLIdentifier(name);
}
 catch (MalformedURLException e) {
throw new StructureException("String_Node_Str" + name,e);
}
break;
case PDP:
try {
PDPProvider provider=new RemotePDPProvider(false);
base=provider.getPDPDomain(name);
}
 catch (IOException e) {
throw new StructureException("String_Node_Str" + name,e);
}
break;
case BIO:
base=new BioAssemblyIdentifier(name);
break;
case PDB:
base=new SubstructureIdentifier(getIdentifier());
break;
default :
throw new IllegalStateException("String_Node_Str" + mySource);
}
}
return base;
}