Program: 78444
Project: 78444
Buggy source:
/** 
 * handle the hyperlink, bookmark and drillthrough
 * @param area			the area which may need to handle the hyperlink action
 */
private void handleHyperlinkAction(IArea area){
  IContent content=area.getContent();
  if (null != content) {
    IHyperlinkAction hlAction=content.getHyperlinkAction();
    if (null != hlAction)     try {
switch (hlAction.getType()) {
case IHyperlinkAction.ACTION_BOOKMARK:
        writer.addAnnotation(new PdfAnnotation(writer,layoutPointX2PDF(area.getAbsoluteX()),layoutPointY2PDF(area.getAbsoluteY() + area.getHeight()),layoutPointX2PDF(area.getAbsoluteX() + area.getWidth()),layoutPointY2PDF(area.getAbsoluteY()),createPdfAction(hlAction.getHyperlink(),hlAction.getBookmark(),hlAction.getTargetWindow(),IHyperlinkAction.ACTION_BOOKMARK)));
      break;
case IHyperlinkAction.ACTION_DRILLTHROUGH:
    String baseURL=null;
  if (context != null) {
    baseURL=context.getBaseURL();
  }
StringBuffer link=new StringBuffer();
String reportName=hlAction.getReportName();
if (reportName != null && !reportName.equals("String_Node_Str")) {
String format=hlAction.getFormat();
if ("String_Node_Str".equalsIgnoreCase(format)) {
link.append(baseURL.replaceFirst("String_Node_Str","String_Node_Str"));
}
 else if ("String_Node_Str".equalsIgnoreCase(format)) {
link.append(baseURL);
}
link.append("String_Node_Str");
try {
link.append(URLEncoder.encode(reportName,"String_Node_Str"));
}
 catch (UnsupportedEncodingException e1) {
}
if (format != null && format.length() > 0) {
link.append("String_Node_Str" + format);
}
if (hlAction.getParameterBindings() != null) {
Iterator paramsIte=hlAction.getParameterBindings().entrySet().iterator();
while (paramsIte.hasNext()) {
  Map.Entry entry=(Map.Entry)paramsIte.next();
  try {
    link.append("String_Node_Str" + URLEncoder.encode((String)entry.getKey(),"String_Node_Str") + "String_Node_Str"+ URLEncoder.encode((String)entry.getValue(),"String_Node_Str"));
  }
 catch (  UnsupportedEncodingException e) {
  }
}
}
}
if (hlAction.getBookmark() != null) {
link.append("String_Node_Str");
link.append(hlAction.getBookmark());
}
writer.addAnnotation(new PdfAnnotation(writer,layoutPointX2PDF(area.getAbsoluteX()),layoutPointY2PDF(area.getAbsoluteY() + area.getHeight()),layoutPointX2PDF(area.getAbsoluteX() + area.getWidth()),layoutPointY2PDF(area.getAbsoluteY()),createPdfAction(link.toString(),null,hlAction.getTargetWindow(),IHyperlinkAction.ACTION_DRILLTHROUGH)));
break;
case IHyperlinkAction.ACTION_HYPERLINK:
writer.addAnnotation(new PdfAnnotation(writer,layoutPointX2PDF(area.getAbsoluteX()),layoutPointY2PDF(area.getAbsoluteY() + area.getHeight()),layoutPointX2PDF(area.getAbsoluteX() + area.getWidth()),layoutPointY2PDF(area.getAbsoluteY()),createPdfAction(hlAction.getHyperlink(),null,hlAction.getTargetWindow(),IHyperlinkAction.ACTION_HYPERLINK)));
break;
}
}
 catch (Exception e) {
logger.log(Level.WARNING,e.getMessage(),e);
}
}
}

Fixed version (ground truth):
/** 
 * handle the hyperlink, bookmark and drillthrough
 * @param area			the area which may need to handle the hyperlink action
 */
private void handleHyperlinkAction(IArea area){
  IContent content=area.getContent();
  if (null != content) {
    IHyperlinkAction hlAction=content.getHyperlinkAction();
    if (null != hlAction)     try {
switch (hlAction.getType()) {
case IHyperlinkAction.ACTION_BOOKMARK:
        writer.addAnnotation(new PdfAnnotation(writer,layoutPointX2PDF(area.getAbsoluteX()),layoutPointY2PDF(area.getAbsoluteY() + area.getHeight()),layoutPointX2PDF(area.getAbsoluteX() + area.getWidth()),layoutPointY2PDF(area.getAbsoluteY()),createPdfAction(hlAction.getHyperlink(),hlAction.getBookmark(),hlAction.getTargetWindow(),IHyperlinkAction.ACTION_BOOKMARK)));
      break;
case IHyperlinkAction.ACTION_DRILLTHROUGH:
    String baseURL=null;
  if (context != null) {
    baseURL=context.getBaseURL();
  }
StringBuffer link=new StringBuffer();
String reportName=hlAction.getReportName();
if (reportName != null && !reportName.equals("String_Node_Str")) {
String format=hlAction.getFormat();
if ("String_Node_Str".equalsIgnoreCase(format)) {
link.append(baseURL.replaceFirst("String_Node_Str","String_Node_Str"));
}
 else if ("String_Node_Str".equalsIgnoreCase(format)) {
link.append(baseURL);
}
link.append("String_Node_Str");
try {
link.append(URLEncoder.encode(reportName,"String_Node_Str"));
}
 catch (UnsupportedEncodingException e1) {
}
if (format != null && format.length() > 0) {
link.append("String_Node_Str" + format);
}
if (hlAction.getParameterBindings() != null) {
Iterator paramsIte=hlAction.getParameterBindings().entrySet().iterator();
while (paramsIte.hasNext()) {
  Map.Entry entry=(Map.Entry)paramsIte.next();
  try {
    String key=(String)entry.getKey();
    Object valueObj=entry.getValue();
    if (valueObj != null) {
      String value=valueObj.toString();
      link.append("String_Node_Str" + URLEncoder.encode(key,"String_Node_Str") + "String_Node_Str"+ URLEncoder.encode(value,"String_Node_Str"));
    }
  }
 catch (  UnsupportedEncodingException e) {
  }
}
}
}
link.append("String_Node_Str");
if (hlAction.getBookmark() != null) {
link.append("String_Node_Str");
link.append(hlAction.getBookmark());
}
writer.addAnnotation(new PdfAnnotation(writer,layoutPointX2PDF(area.getAbsoluteX()),layoutPointY2PDF(area.getAbsoluteY() + area.getHeight()),layoutPointX2PDF(area.getAbsoluteX() + area.getWidth()),layoutPointY2PDF(area.getAbsoluteY()),createPdfAction(link.toString(),null,hlAction.getTargetWindow(),IHyperlinkAction.ACTION_DRILLTHROUGH)));
break;
case IHyperlinkAction.ACTION_HYPERLINK:
writer.addAnnotation(new PdfAnnotation(writer,layoutPointX2PDF(area.getAbsoluteX()),layoutPointY2PDF(area.getAbsoluteY() + area.getHeight()),layoutPointX2PDF(area.getAbsoluteX() + area.getWidth()),layoutPointY2PDF(area.getAbsoluteY()),createPdfAction(hlAction.getHyperlink(),null,hlAction.getTargetWindow(),IHyperlinkAction.ACTION_HYPERLINK)));
break;
}
}
 catch (Exception e) {
logger.log(Level.WARNING,e.getMessage(),e);
}
}
}