Program: 78368
Project: 78368
Buggy source:
public void enableInteraction(InteractionEvent ie) throws ChartException {
  if (_iun == null) {
    logger.log(ILogger.WARNING,Messages.getString("String_Node_Str",getULocale()));
    return;
  }
  Trigger[] triggers=ie.getTriggers();
  if (triggers == null) {
    return;
  }
  final PrimitiveRenderEvent pre=ie.getHotSpot();
  Element elm=null;
  if (pre instanceof PolygonRenderEvent) {
    final Location[] loa=((PolygonRenderEvent)pre).getPoints();
    int[][] pa=getCoordinatesAsInts(loa);
    elm=svggc.createPolygon(pa[0],pa[1],pa[0].length);
  }
 else   if (pre instanceof OvalRenderEvent) {
    final Bounds boEllipse=((OvalRenderEvent)pre).getBounds();
    elm=svggc.createOval(boEllipse.getLeft(),boEllipse.getTop(),boEllipse.getWidth(),boEllipse.getHeight());
  }
 else   if (pre instanceof RectangleRenderEvent) {
    final Bounds boRect=((RectangleRenderEvent)pre).getBounds();
    elm=svggc.createRect(boRect.getLeft(),boRect.getTop(),boRect.getWidth(),boRect.getHeight());
  }
 else   if (pre instanceof ArcRenderEvent) {
    final ArcRenderEvent are=(ArcRenderEvent)pre;
    if (are.getInnerRadius() >= 0 && are.getOuterRadius() > 0 && are.getInnerRadius() < are.getOuterRadius()) {
      Shape outerArc=new Arc2D.Double(are.getTopLeft().getX() + (are.getWidth() - 2 * are.getOuterRadius()) / 2,are.getTopLeft().getY() + (are.getHeight() - 2 * are.getOuterRadius()) / 2,2 * are.getOuterRadius(),2 * are.getOuterRadius(),are.getStartAngle(),are.getAngleExtent(),Arc2D.PIE);
      Shape innerArc=new Arc2D.Double(are.getTopLeft().getX() + (are.getWidth() - 2 * are.getInnerRadius()) / 2,are.getTopLeft().getY() + (are.getHeight() - 2 * are.getInnerRadius()) / 2,2 * are.getInnerRadius(),2 * are.getInnerRadius(),are.getStartAngle(),are.getAngleExtent(),Arc2D.PIE);
      Area fArea=new Area(outerArc);
      fArea.exclusiveOr(new Area(innerArc));
      elm=svggc.createGeneralPath(fArea);
    }
 else {
      elm=svggc.createGeneralPath(new Arc2D.Double(are.getTopLeft().getX(),are.getTopLeft().getY(),are.getWidth(),are.getHeight(),are.getStartAngle(),are.getAngleExtent(),toSwingArcType(are.getStyle())));
    }
  }
  if (elm != null) {
    for (int x=0; x < triggers.length; x++) {
      Trigger tg=triggers[x];
      final StructureSource src=(StructureSource)ie.getSource();
switch (tg.getAction().getType().getValue()) {
case ActionType.SHOW_TOOLTIP:
        String tooltipText=((TooltipValue)tg.getAction().getValue()).getText();
      if ((tooltipText != null) && (tooltipText.trim().length() > 0)) {
        Element title=svggc.dom.createElement("String_Node_Str");
        title.appendChild(svggc.dom.createTextNode(tooltipText));
        elm.appendChild(title);
        elm.setAttribute("String_Node_Str","String_Node_Str");
        elm.setAttribute("String_Node_Str","String_Node_Str");
      }
    break;
case ActionType.URL_REDIRECT:
  URLValue urlValue=((URLValue)tg.getAction().getValue());
if (urlValue.getBaseUrl().startsWith("String_Node_Str")) {
  Element aLink=((SVGGraphics2D)_g2d).createElement("String_Node_Str");
  aLink.setAttribute("String_Node_Str","String_Node_Str" + urlValue.getBaseUrl() + "String_Node_Str");
  aLink.setAttribute("String_Node_Str","String_Node_Str");
  aLink.appendChild(elm);
  elm=aLink;
}
 else {
  Element aLink=((SVGGraphics2D)_g2d).createElement("String_Node_Str");
  aLink.setAttribute("String_Node_Str",urlValue.getBaseUrl());
  if (urlValue.getTarget() != null)   aLink.setAttribute("String_Node_Str",urlValue.getTarget());
  aLink.appendChild(elm);
  elm=aLink;
}
break;
case ActionType.TOGGLE_VISIBILITY:
if (src.getType() == StructureType.SERIES) {
final Series seRT=(Series)src.getSource();
logger.log(ILogger.INFORMATION,Messages.getString("String_Node_Str",getULocale()) + seRT);
Series seDT=null;
try {
seDT=findDesignTimeSeries(seRT);
cacheSeriesHotspots.put(elm,seDT);
}
 catch (ChartException oosx) {
logger.log(oosx);
return;
}
}
break;
case ActionType.TOGGLE_DATA_POINT_VISIBILITY:
if (src.getType() == StructureType.SERIES) {
final Series seRT=(Series)src.getSource();
logger.log(ILogger.INFORMATION,Messages.getString("String_Node_Str",getULocale()) + seRT);
Series seDT=null;
try {
seDT=findDesignTimeSeries(seRT);
}
 catch (ChartException oosx) {
logger.log(oosx);
return;
}
if (seDT != null) cacheHotspots.put(elm,seDT);
}
break;
case ActionType.HIGHLIGHT:
if (src.getType() == StructureType.SERIES) {
final Series seRT=(Series)src.getSource();
logger.log(ILogger.INFORMATION,Messages.getString("String_Node_Str",getULocale()) + seRT);
String scriptEvent=getJsScriptEvent(tg.getCondition().getValue());
if (scriptEvent != null) {
Series seDT=null;
try {
seDT=findDesignTimeSeries(seRT);
List components=(List)componentPrimitives.get(seDT);
if (components != null) {
Iterator iter=components.iterator();
StringBuffer sb=new StringBuffer();
sb.append(seDT.hashCode());
if (iter.hasNext()) sb.append("String_Node_Str");
while (iter.hasNext()) {
sb.append("String_Node_Str").append(iter.next()).append("String_Node_Str");
if (iter.hasNext()) sb.append("String_Node_Str");
}
if (components.size() > 0) sb.append("String_Node_Str");
elm.setAttribute(scriptEvent,"String_Node_Str" + sb.toString() + "String_Node_Str");
if (tg.getCondition().getValue() == TriggerCondition.ONMOUSEOVER) {
elm.setAttribute("String_Node_Str","String_Node_Str");
}
setCursor(elm);
((SVGGraphics2D)_g2d).addCSSStyle("String_Node_Str" + seDT.hashCode(),"String_Node_Str","String_Node_Str");
}
}
 catch (ChartException oosx) {
logger.log(oosx);
return;
}
}
}
break;
case ActionType.INVOKE_SCRIPT:
final StructureSource sructSource=(StructureSource)ie.getSource();
if (tg.getCondition().equals(TriggerCondition.ACCESSIBILITY_LITERAL)) {
AccessibilityValue accessValue=((AccessibilityValue)tg.getAction().getValue());
if (accessValue.getText() != null) {
Element title=((SVGGraphics2D)_g2d).createElement("String_Node_Str");
title.appendChild(svggc.dom.createTextNode(accessValue.getText()));
elm.appendChild(title);
}
if (accessValue.getAccessibility() != null) {
Element description=((SVGGraphics2D)_g2d).createElement("String_Node_Str");
description.appendChild(svggc.dom.createTextNode(accessValue.getAccessibility()));
elm.appendChild(description);
}
}
 else {
String scriptEvent=getJsScriptEvent(tg.getCondition().getValue());
if (scriptEvent != null) {
String script=((ScriptValue)tg.getAction().getValue()).getScript();
String callbackFunction="String_Node_Str" + Math.abs(script.hashCode()) + "String_Node_Str"+ sructSource.getSource().hashCode()+ "String_Node_Str";
elm.setAttribute(scriptEvent,callbackFunction);
setCursor(elm);
if (!(scripts.contains(script))) {
((SVGGraphics2D)_g2d).addScript("String_Node_Str" + Math.abs(script.hashCode()) + "String_Node_Str"+ "String_Node_Str"+ script+ "String_Node_Str");
scripts.add(script);
}
}
}
break;
}
}
hotspotLayer.appendChild(elm);
}
}

Fixed version (ground truth):
public void enableInteraction(InteractionEvent ie) throws ChartException {
  if (_iun == null) {
    logger.log(ILogger.WARNING,Messages.getString("String_Node_Str",getULocale()));
    return;
  }
  Trigger[] triggers=ie.getTriggers();
  if (triggers == null) {
    return;
  }
  final PrimitiveRenderEvent pre=ie.getHotSpot();
  Element elm=null;
  if (pre instanceof PolygonRenderEvent) {
    final Location[] loa=((PolygonRenderEvent)pre).getPoints();
    int[][] pa=getCoordinatesAsInts(loa);
    elm=svggc.createPolygon(pa[0],pa[1],pa[0].length);
  }
 else   if (pre instanceof OvalRenderEvent) {
    final Bounds boEllipse=((OvalRenderEvent)pre).getBounds();
    elm=svggc.createOval(boEllipse.getLeft(),boEllipse.getTop(),boEllipse.getWidth(),boEllipse.getHeight());
  }
 else   if (pre instanceof RectangleRenderEvent) {
    final Bounds boRect=((RectangleRenderEvent)pre).getBounds();
    elm=svggc.createRect(boRect.getLeft(),boRect.getTop(),boRect.getWidth(),boRect.getHeight());
  }
 else   if (pre instanceof AreaRenderEvent) {
    AreaRenderEvent are=(AreaRenderEvent)pre;
    final GeneralPath gp=new GeneralPath();
    PrimitiveRenderEvent subPre;
    for (int i=0; i < are.getElementCount(); i++) {
      subPre=are.getElement(i);
      if (subPre instanceof ArcRenderEvent) {
        final ArcRenderEvent acre=(ArcRenderEvent)subPre;
        final Arc2D.Double a2d=new Arc2D.Double(acre.getTopLeft().getX(),acre.getTopLeft().getY(),acre.getWidth(),acre.getHeight(),acre.getStartAngle(),acre.getAngleExtent(),toSwingArcType(acre.getStyle()));
        gp.append(a2d,true);
      }
 else       if (subPre instanceof LineRenderEvent) {
        final LineRenderEvent lre=(LineRenderEvent)subPre;
        final Line2D.Double l2d=new Line2D.Double(lre.getStart().getX(),lre.getStart().getY(),lre.getEnd().getX(),lre.getEnd().getY());
        gp.append(l2d,true);
      }
    }
    elm=svggc.createGeneralPath(gp);
  }
 else   if (pre instanceof ArcRenderEvent) {
    final ArcRenderEvent are=(ArcRenderEvent)pre;
    if (are.getInnerRadius() >= 0 && are.getOuterRadius() > 0 && are.getInnerRadius() < are.getOuterRadius()) {
      Shape outerArc=new Arc2D.Double(are.getTopLeft().getX() + (are.getWidth() - 2 * are.getOuterRadius()) / 2,are.getTopLeft().getY() + (are.getHeight() - 2 * are.getOuterRadius()) / 2,2 * are.getOuterRadius(),2 * are.getOuterRadius(),are.getStartAngle(),are.getAngleExtent(),Arc2D.PIE);
      Shape innerArc=new Arc2D.Double(are.getTopLeft().getX() + (are.getWidth() - 2 * are.getInnerRadius()) / 2,are.getTopLeft().getY() + (are.getHeight() - 2 * are.getInnerRadius()) / 2,2 * are.getInnerRadius(),2 * are.getInnerRadius(),are.getStartAngle(),are.getAngleExtent(),Arc2D.PIE);
      Area fArea=new Area(outerArc);
      fArea.exclusiveOr(new Area(innerArc));
      elm=svggc.createGeneralPath(fArea);
    }
 else {
      elm=svggc.createGeneralPath(new Arc2D.Double(are.getTopLeft().getX(),are.getTopLeft().getY(),are.getWidth(),are.getHeight(),are.getStartAngle(),are.getAngleExtent(),toSwingArcType(are.getStyle())));
    }
  }
  if (elm != null) {
    for (int x=0; x < triggers.length; x++) {
      Trigger tg=triggers[x];
      final StructureSource src=(StructureSource)ie.getSource();
switch (tg.getAction().getType().getValue()) {
case ActionType.SHOW_TOOLTIP:
        String tooltipText=((TooltipValue)tg.getAction().getValue()).getText();
      if ((tooltipText != null) && (tooltipText.trim().length() > 0)) {
        Element title=svggc.dom.createElement("String_Node_Str");
        title.appendChild(svggc.dom.createTextNode(tooltipText));
        elm.appendChild(title);
        elm.setAttribute("String_Node_Str","String_Node_Str");
        elm.setAttribute("String_Node_Str","String_Node_Str");
      }
    break;
case ActionType.URL_REDIRECT:
  URLValue urlValue=((URLValue)tg.getAction().getValue());
if (urlValue.getBaseUrl().startsWith("String_Node_Str")) {
  Element aLink=((SVGGraphics2D)_g2d).createElement("String_Node_Str");
  aLink.setAttribute("String_Node_Str","String_Node_Str" + urlValue.getBaseUrl() + "String_Node_Str");
  aLink.setAttribute("String_Node_Str","String_Node_Str");
  aLink.appendChild(elm);
  elm=aLink;
}
 else {
  Element aLink=((SVGGraphics2D)_g2d).createElement("String_Node_Str");
  aLink.setAttribute("String_Node_Str",urlValue.getBaseUrl());
  if (urlValue.getTarget() != null)   aLink.setAttribute("String_Node_Str",urlValue.getTarget());
  aLink.appendChild(elm);
  elm=aLink;
}
break;
case ActionType.TOGGLE_VISIBILITY:
if (src.getType() == StructureType.SERIES) {
final Series seRT=(Series)src.getSource();
logger.log(ILogger.INFORMATION,Messages.getString("String_Node_Str",getULocale()) + seRT);
Series seDT=null;
try {
seDT=findDesignTimeSeries(seRT);
cacheSeriesHotspots.put(elm,seDT);
}
 catch (ChartException oosx) {
logger.log(oosx);
return;
}
}
break;
case ActionType.TOGGLE_DATA_POINT_VISIBILITY:
if (src.getType() == StructureType.SERIES) {
final Series seRT=(Series)src.getSource();
logger.log(ILogger.INFORMATION,Messages.getString("String_Node_Str",getULocale()) + seRT);
Series seDT=null;
try {
seDT=findDesignTimeSeries(seRT);
}
 catch (ChartException oosx) {
logger.log(oosx);
return;
}
if (seDT != null) cacheHotspots.put(elm,seDT);
}
break;
case ActionType.HIGHLIGHT:
if (src.getType() == StructureType.SERIES) {
final Series seRT=(Series)src.getSource();
logger.log(ILogger.INFORMATION,Messages.getString("String_Node_Str",getULocale()) + seRT);
String scriptEvent=getJsScriptEvent(tg.getCondition().getValue());
if (scriptEvent != null) {
Series seDT=null;
try {
seDT=findDesignTimeSeries(seRT);
List components=(List)componentPrimitives.get(seDT);
if (components != null) {
Iterator iter=components.iterator();
StringBuffer sb=new StringBuffer();
sb.append(seDT.hashCode());
if (iter.hasNext()) sb.append("String_Node_Str");
while (iter.hasNext()) {
sb.append("String_Node_Str").append(iter.next()).append("String_Node_Str");
if (iter.hasNext()) sb.append("String_Node_Str");
}
if (components.size() > 0) sb.append("String_Node_Str");
elm.setAttribute(scriptEvent,"String_Node_Str" + sb.toString() + "String_Node_Str");
if (tg.getCondition().getValue() == TriggerCondition.ONMOUSEOVER) {
elm.setAttribute("String_Node_Str","String_Node_Str");
}
setCursor(elm);
((SVGGraphics2D)_g2d).addCSSStyle("String_Node_Str" + seDT.hashCode(),"String_Node_Str","String_Node_Str");
}
}
 catch (ChartException oosx) {
logger.log(oosx);
return;
}
}
}
break;
case ActionType.INVOKE_SCRIPT:
final StructureSource sructSource=(StructureSource)ie.getSource();
if (tg.getCondition().equals(TriggerCondition.ACCESSIBILITY_LITERAL)) {
AccessibilityValue accessValue=((AccessibilityValue)tg.getAction().getValue());
if (accessValue.getText() != null) {
Element title=((SVGGraphics2D)_g2d).createElement("String_Node_Str");
title.appendChild(svggc.dom.createTextNode(accessValue.getText()));
elm.appendChild(title);
}
if (accessValue.getAccessibility() != null) {
Element description=((SVGGraphics2D)_g2d).createElement("String_Node_Str");
description.appendChild(svggc.dom.createTextNode(accessValue.getAccessibility()));
elm.appendChild(description);
}
}
 else {
String scriptEvent=getJsScriptEvent(tg.getCondition().getValue());
if (scriptEvent != null) {
String script=((ScriptValue)tg.getAction().getValue()).getScript();
String callbackFunction="String_Node_Str" + Math.abs(script.hashCode()) + "String_Node_Str"+ sructSource.getSource().hashCode()+ "String_Node_Str";
elm.setAttribute(scriptEvent,callbackFunction);
setCursor(elm);
if (!(scripts.contains(script))) {
((SVGGraphics2D)_g2d).addScript("String_Node_Str" + Math.abs(script.hashCode()) + "String_Node_Str"+ "String_Node_Str"+ script+ "String_Node_Str");
scripts.add(script);
}
}
}
break;
}
}
hotspotLayer.appendChild(elm);
}
}