Program: 74870
Project: 74870
Buggy source:
/** 
 * Get the documentation for a particular class.   <p>If the configuration has a parameter _docApplicationSpecializer and that parameter names a class that that implements the DocApplicationSpecializer interface, then we call docClassNameToURL(). <p>If the documentation is not found, pop up a dialog and ask the user if they would like to build the documentation, use the website documentation or cancel.  The location of the website documentation is set by the _remoteDocumentationURLBase attribute in the configuration.  That attribute, if present, should be a parameter that whose value is a string that represents the URL where the documentation may be found.  If the _remoteDocumentationURLBase attribute is not set, then the location of the website documentation defaults to <code>http://ptolemy.eecs.berkeley.edu/ptolemyII/ptII/<i>Major.Version</i>, where <code><i>Major.Version</i> is the value returned by  {@link ptolemy.kernel.attributes.VersionAttribute#majorCurrentVersion()}.
 * @param configuration The configuration.
 * @param className The dot separated fully qualified name of the class.
 * @param context The context.
 */
public static void getDocumentation(Configuration configuration,String className,Effigy context){
  try {
    URL toRead=DocManager.docClassNameToURL(configuration,className,true,true,false,false);
    if (toRead != null) {
      _lastClassName=null;
      configuration.openModel(null,toRead,toRead.toExternalForm());
    }
 else {
      throw new Exception("String_Node_Str" + className + "String_Node_Str"+ (DocManager.getRemoteDocumentationURLBase() != null ? "String_Node_Str" + DocManager.getRemoteDocumentationURLBase() + "String_Node_Str" : "String_Node_Str"));
    }
  }
 catch (  Exception ex) {
    try {
      Parameter remoteDocumentationURLBaseParameter=(Parameter)configuration.getAttribute("String_Node_Str",Parameter.class);
      String tentativeRemoteDocumentationURLBase=null;
      if (remoteDocumentationURLBaseParameter != null) {
        tentativeRemoteDocumentationURLBase=remoteDocumentationURLBaseParameter.getExpression();
      }
 else {
        tentativeRemoteDocumentationURLBase="String_Node_Str" + VersionAttribute.majorCurrentVersion() + "String_Node_Str";
      }
      String message="String_Node_Str" + (_lastClassName != null && DocManager.getRemoteDocumentationURLBase() != null ? "String_Node_Str" + DocManager.getRemoteDocumentationURLBase() + "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ tentativeRemoteDocumentationURLBase+ "String_Node_Str"+ "String_Node_Str";
      Object[] options={"String_Node_Str","String_Node_Str","String_Node_Str"};
      int selected=JOptionPane.showOptionDialog(null,message,"String_Node_Str",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE,null,options,options[0]);
switch (selected) {
case 2:
        return;
case 1:
      DocManager.setRemoteDocumentationURLBase(tentativeRemoteDocumentationURLBase);
    _lastClassName=className;
  getDocumentation(configuration,className,context);
break;
case 0:
ComponentEntity effigy=context.getEntity("String_Node_Str");
if (effigy == null) {
try {
effigy=new DocBuilderEffigy(context,"String_Node_Str");
}
 catch (KernelException exception) {
throw new InternalErrorException(exception);
}
}
if (!(effigy instanceof DocBuilderEffigy)) {
MessageHandler.error("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
}
ComponentEntity tableau=((Effigy)effigy).getEntity("String_Node_Str");
if (tableau == null) {
try {
tableau=new DocBuilderTableau((DocBuilderEffigy)effigy,"String_Node_Str");
((DocBuilderTableau)tableau).setTitle("String_Node_Str" + className);
}
 catch (KernelException exception) {
throw new InternalErrorException(exception);
}
}
if (!(tableau instanceof DocBuilderTableau)) {
MessageHandler.error("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
}
((DocBuilderTableau)tableau).show();
default :
throw new InternalErrorException("String_Node_Str" + selected + "String_Node_Str");
}
}
 catch (Throwable throwable) {
MessageHandler.error("String_Node_Str" + className + "String_Node_Str"+ "String_Node_Str",throwable);
}
}
}

Fixed version (ground truth):
/** 
 * Get the documentation for a particular class.   <p>If the configuration has a parameter _docApplicationSpecializer and that parameter names a class that that implements the DocApplicationSpecializer interface, then we call docClassNameToURL(). <p>If the documentation is not found, pop up a dialog and ask the user if they would like to build the documentation, use the website documentation or cancel.  The location of the website documentation is set by the _remoteDocumentationURLBase attribute in the configuration.  That attribute, if present, should be a parameter that whose value is a string that represents the URL where the documentation may be found.  If the _remoteDocumentationURLBase attribute is not set, then the location of the website documentation defaults to <code>http://ptolemy.eecs.berkeley.edu/ptolemyII/ptII/<i>Major.Version</i>, where <code><i>Major.Version</i> is the value returned by  {@link ptolemy.kernel.attributes.VersionAttribute#majorCurrentVersion()}.
 * @param configuration The configuration.
 * @param className The dot separated fully qualified name of the class.
 * @param context The context.
 */
public static void getDocumentation(Configuration configuration,String className,Effigy context){
  try {
    URL toRead=DocManager.docClassNameToURL(configuration,className,true,true,false,false);
    if (toRead != null) {
      _lastClassName=null;
      configuration.openModel(null,toRead,toRead.toExternalForm());
    }
 else {
      throw new Exception("String_Node_Str" + className + "String_Node_Str"+ (DocManager.getRemoteDocumentationURLBase() != null ? "String_Node_Str" + DocManager.getRemoteDocumentationURLBase() + "String_Node_Str" : "String_Node_Str"));
    }
  }
 catch (  Exception ex) {
    try {
      Parameter remoteDocumentationURLBaseParameter=(Parameter)configuration.getAttribute("String_Node_Str",Parameter.class);
      String tentativeRemoteDocumentationURLBase=null;
      if (remoteDocumentationURLBaseParameter != null) {
        tentativeRemoteDocumentationURLBase=remoteDocumentationURLBaseParameter.getExpression();
      }
 else {
        tentativeRemoteDocumentationURLBase="String_Node_Str" + VersionAttribute.majorCurrentVersion() + "String_Node_Str";
      }
      String message="String_Node_Str" + (_lastClassName != null && DocManager.getRemoteDocumentationURLBase() != null ? "String_Node_Str" + DocManager.getRemoteDocumentationURLBase() + "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ tentativeRemoteDocumentationURLBase+ "String_Node_Str"+ "String_Node_Str";
      Object[] options={"String_Node_Str","String_Node_Str","String_Node_Str"};
      int selected=JOptionPane.showOptionDialog(null,message,"String_Node_Str",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE,null,options,options[0]);
switch (selected) {
case 2:
        return;
case 1:
      DocManager.setRemoteDocumentationURLBase(tentativeRemoteDocumentationURLBase);
    _lastClassName=className;
  getDocumentation(configuration,className,context);
break;
case 0:
ComponentEntity effigy=context.getEntity("String_Node_Str");
if (effigy == null) {
try {
effigy=new DocBuilderEffigy(context,"String_Node_Str");
}
 catch (KernelException exception) {
throw new InternalErrorException(exception);
}
}
if (!(effigy instanceof DocBuilderEffigy)) {
MessageHandler.error("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
}
ComponentEntity tableau=((Effigy)effigy).getEntity("String_Node_Str");
if (tableau == null) {
try {
tableau=new DocBuilderTableau((DocBuilderEffigy)effigy,"String_Node_Str");
((DocBuilderTableau)tableau).setTitle("String_Node_Str" + className);
}
 catch (KernelException exception) {
throw new InternalErrorException(exception);
}
}
if (!(tableau instanceof DocBuilderTableau)) {
MessageHandler.error("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
}
((DocBuilderTableau)tableau).show();
break;
default :
throw new InternalErrorException("String_Node_Str" + selected + "String_Node_Str");
}
}
 catch (Throwable throwable) {
MessageHandler.error("String_Node_Str" + className + "String_Node_Str"+ "String_Node_Str",throwable);
}
}
}