Program: 143725
Project: 143725
Buggy source:
public static Insets createBorderCSSProperties(String s,Properties style){
  if (s == null) {
    return null;
  }
 else {
    StringTokenizer tk=new StringTokenizer(s,"String_Node_Str");
    if (tk.hasMoreTokens()) {
      try {
        String type=tk.nextToken();
        if (type.equals(COMPOUND_BORDER)) {
          StringTokenizer tk2=new StringTokenizer(s,"String_Node_Str");
          tk2.nextToken();
          String s_oborder=tk2.nextToken();
          return createBorderCSSProperties(s_oborder,style);
        }
 else         if (type.equals(EMPTY_BORDER)) {
          int top=Utils.getAsInteger(tk.nextToken());
          int right=Utils.getAsInteger(tk.nextToken());
          int bottom=Utils.getAsInteger(tk.nextToken());
          int left=Utils.getAsInteger(tk.nextToken());
          if (top != 0 && right != 0 && bottom != 0 && left != 0) {
            StringBuffer pad=new StringBuffer();
            pad.append(top);
            pad.append("String_Node_Str");
            pad.append(right);
            pad.append("String_Node_Str");
            pad.append(bottom);
            pad.append("String_Node_Str");
            pad.append(left);
            pad.append("String_Node_Str");
            style.setProperty("String_Node_Str",pad.toString());
          }
          style.setProperty("String_Node_Str","String_Node_Str");
          return new Insets(top,left,bottom,right);
        }
 else         if (type.equals(BEVEL_BORDER) || type.equals(ETCHED_BORDER)) {
          int beveltype=Utils.getAsInteger(tk.nextToken());
          if (tk.hasMoreTokens()) {
            Color highlightO=null;
            Color highlightI=null;
            Color shadowO=null;
            Color shadowI=null;
            if (type.equals(BEVEL_BORDER)) {
              highlightO=PersistHelper.createColor(tk.nextToken());
              highlightI=PersistHelper.createColor(tk.nextToken());
              shadowO=PersistHelper.createColor(tk.nextToken());
              shadowI=PersistHelper.createColor(tk.nextToken());
            }
 else {
              highlightO=PersistHelper.createColor(tk.nextToken());
              highlightI=highlightO;
              shadowO=PersistHelper.createColor(tk.nextToken());
              shadowI=shadowO;
            }
            if (beveltype == BevelBorder.LOWERED) {
              if (PersistHelper.createColorString(shadowO) != null) {
                StringBuffer pad=new StringBuffer();
                pad.append(PersistHelper.createColorString(shadowO));
                pad.append(' ');
                pad.append(PersistHelper.createColorString(highlightI));
                pad.append(' ');
                pad.append(PersistHelper.createColorString(highlightO));
                pad.append(' ');
                pad.append(PersistHelper.createColorString(shadowI));
                style.setProperty("String_Node_Str",pad.toString());
              }
              if (type.equals(BEVEL_BORDER)) {
                style.setProperty("String_Node_Str","String_Node_Str");
              }
 else {
                style.setProperty("String_Node_Str","String_Node_Str");
              }
            }
 else {
              if (PersistHelper.createColorString(shadowO) != null) {
                StringBuffer pad=new StringBuffer();
                pad.append(PersistHelper.createColorString(highlightO));
                pad.append(' ');
                pad.append(PersistHelper.createColorString(shadowI));
                pad.append(' ');
                pad.append(PersistHelper.createColorString(shadowO));
                pad.append(' ');
                pad.append(PersistHelper.createColorString(highlightI));
                style.setProperty("String_Node_Str",pad.toString());
              }
              if (type.equals(BEVEL_BORDER)) {
                style.setProperty("String_Node_Str","String_Node_Str");
              }
 else {
                style.setProperty("String_Node_Str","String_Node_Str");
              }
            }
            return null;
          }
 else {
            style.setProperty("String_Node_Str",(beveltype == BevelBorder.LOWERED ? "String_Node_Str" : "String_Node_Str"));
            return null;
          }
        }
 else         if (type.equals(LINE_BORDER)) {
          int thick=Utils.getAsInteger(tk.nextToken());
          style.setProperty("String_Node_Str","String_Node_Str");
          style.setProperty("String_Node_Str",thick + "String_Node_Str");
          style.setProperty("String_Node_Str",tk.nextToken());
          return new Insets(thick,thick,thick,thick);
        }
 else         if (type.equals(TITLED_BORDER)) {
          style.setProperty("String_Node_Str","String_Node_Str");
          return null;
        }
 else         if (type.equals(MATTE_BORDER)) {
          int top=Utils.getAsInteger(tk.nextToken());
          int right=Utils.getAsInteger(tk.nextToken());
          int bottom=Utils.getAsInteger(tk.nextToken());
          int left=Utils.getAsInteger(tk.nextToken());
          Color c=Color.black;
          if (tk.hasMoreElements())           c=PersistHelper.createColor(tk.nextToken());
          style.setProperty("String_Node_Str","String_Node_Str");
          StringBuffer pad=new StringBuffer();
          pad.append(top);
          pad.append("String_Node_Str");
          pad.append(right);
          pad.append("String_Node_Str");
          pad.append(bottom);
          pad.append("String_Node_Str");
          pad.append(left);
          pad.append("String_Node_Str");
          style.setProperty("String_Node_Str",pad.toString());
          style.setProperty("String_Node_Str",PersistHelper.createColorString(c));
          return new Insets(top,left,bottom,right);
        }
 else         if (type.equals(SPECIAL_MATTE_BORDER)) {
          float top=Utils.getAsFloat(tk.nextToken());
          float right=Utils.getAsFloat(tk.nextToken());
          float bottom=Utils.getAsFloat(tk.nextToken());
          float left=Utils.getAsFloat(tk.nextToken());
          StringBuffer pad=new StringBuffer();
          pad.append(Math.round(top));
          pad.append("String_Node_Str");
          pad.append(Math.round(right));
          pad.append("String_Node_Str");
          pad.append(Math.round(bottom));
          pad.append("String_Node_Str");
          pad.append(Math.round(left));
          pad.append("String_Node_Str");
          style.setProperty("String_Node_Str",pad.toString());
          Color topColor=PersistHelper.createColor(tk.nextToken());
          Color rightColor=PersistHelper.createColor(tk.nextToken());
          Color bottomColor=PersistHelper.createColor(tk.nextToken());
          Color leftColor=PersistHelper.createColor(tk.nextToken());
          StringBuffer c=new StringBuffer();
          c.append(PersistHelper.createColorString(topColor));
          c.append(' ');
          c.append(PersistHelper.createColorString(rightColor));
          c.append(' ');
          c.append(PersistHelper.createColorString(bottomColor));
          c.append(' ');
          c.append(PersistHelper.createColorString(leftColor));
          style.setProperty("String_Node_Str",c.toString());
          style.setProperty("String_Node_Str","String_Node_Str");
          if (tk.hasMoreTokens()) {
            tk.nextToken();
          }
          if (tk.hasMoreTokens() && tk.nextToken().trim().length() != 0) {
            style.setProperty("String_Node_Str","String_Node_Str");
          }
          return new Insets(Math.round(top),Math.round(left),Math.round(bottom),Math.round(right));
        }
 else {
          return null;
        }
      }
 catch (      Exception ex) {
        Debug.error(ex);
        return null;
      }
    }
 else {
      return null;
    }
  }
}

Fixed version (ground truth):
public static Insets createBorderCSSProperties(String s,Properties style){
  if (s == null) {
    return null;
  }
 else {
    StringTokenizer tk=new StringTokenizer(s,"String_Node_Str");
    if (tk.hasMoreTokens()) {
      try {
        String type=tk.nextToken();
        if (type.equals(COMPOUND_BORDER)) {
          StringTokenizer tk2=new StringTokenizer(s,"String_Node_Str");
          tk2.nextToken();
          String s_oborder=tk2.nextToken();
          return createBorderCSSProperties(s_oborder,style);
        }
 else         if (type.equals(EMPTY_BORDER)) {
          int top=Utils.getAsInteger(tk.nextToken());
          int right=Utils.getAsInteger(tk.nextToken());
          int bottom=Utils.getAsInteger(tk.nextToken());
          int left=Utils.getAsInteger(tk.nextToken());
          if (top != 0 && right != 0 && bottom != 0 && left != 0) {
            StringBuffer pad=new StringBuffer();
            pad.append(top);
            pad.append("String_Node_Str");
            pad.append(right);
            pad.append("String_Node_Str");
            pad.append(bottom);
            pad.append("String_Node_Str");
            pad.append(left);
            pad.append("String_Node_Str");
            style.setProperty("String_Node_Str",pad.toString());
          }
          style.setProperty("String_Node_Str","String_Node_Str");
          return new Insets(top,left,bottom,right);
        }
 else         if (type.equals(BEVEL_BORDER) || type.equals(ETCHED_BORDER)) {
          int beveltype=Utils.getAsInteger(tk.nextToken());
          if (tk.hasMoreTokens()) {
            Color highlightO=null;
            Color highlightI=null;
            Color shadowO=null;
            Color shadowI=null;
            if (type.equals(BEVEL_BORDER)) {
              highlightO=PersistHelper.createColor(tk.nextToken());
              highlightI=PersistHelper.createColor(tk.nextToken());
              shadowO=PersistHelper.createColor(tk.nextToken());
              shadowI=PersistHelper.createColor(tk.nextToken());
            }
 else {
              highlightO=PersistHelper.createColor(tk.nextToken());
              highlightI=highlightO;
              shadowO=PersistHelper.createColor(tk.nextToken());
              shadowI=shadowO;
            }
            if (beveltype == BevelBorder.LOWERED) {
              if (PersistHelper.createColorString(shadowO) != null) {
                StringBuffer pad=new StringBuffer();
                pad.append(PersistHelper.createColorString(shadowO));
                pad.append(' ');
                pad.append(PersistHelper.createColorString(highlightI));
                pad.append(' ');
                pad.append(PersistHelper.createColorString(highlightO));
                pad.append(' ');
                pad.append(PersistHelper.createColorString(shadowI));
                style.setProperty("String_Node_Str",pad.toString());
              }
              if (type.equals(BEVEL_BORDER)) {
                style.setProperty("String_Node_Str","String_Node_Str");
              }
 else {
                style.setProperty("String_Node_Str","String_Node_Str");
              }
            }
 else {
              if (PersistHelper.createColorString(shadowO) != null) {
                StringBuffer pad=new StringBuffer();
                pad.append(PersistHelper.createColorString(highlightO));
                pad.append(' ');
                pad.append(PersistHelper.createColorString(shadowI));
                pad.append(' ');
                pad.append(PersistHelper.createColorString(shadowO));
                pad.append(' ');
                pad.append(PersistHelper.createColorString(highlightI));
                style.setProperty("String_Node_Str",pad.toString());
              }
              if (type.equals(BEVEL_BORDER)) {
                style.setProperty("String_Node_Str","String_Node_Str");
              }
 else {
                style.setProperty("String_Node_Str","String_Node_Str");
              }
            }
            return null;
          }
 else {
            style.setProperty("String_Node_Str",(beveltype == BevelBorder.LOWERED ? "String_Node_Str" : "String_Node_Str"));
            return null;
          }
        }
 else         if (type.equals(LINE_BORDER)) {
          int thick=Utils.getAsInteger(tk.nextToken());
          style.setProperty("String_Node_Str","String_Node_Str");
          style.setProperty("String_Node_Str",thick + "String_Node_Str");
          style.setProperty("String_Node_Str",tk.nextToken());
          return new Insets(thick,thick,thick,thick);
        }
 else         if (type.equals(TITLED_BORDER)) {
          style.setProperty("String_Node_Str","String_Node_Str");
          return null;
        }
 else         if (type.equals(MATTE_BORDER)) {
          int top=Utils.getAsInteger(tk.nextToken());
          int right=Utils.getAsInteger(tk.nextToken());
          int bottom=Utils.getAsInteger(tk.nextToken());
          int left=Utils.getAsInteger(tk.nextToken());
          Color c=Color.black;
          if (tk.hasMoreElements())           c=PersistHelper.createColor(tk.nextToken());
          style.setProperty("String_Node_Str","String_Node_Str");
          StringBuffer pad=new StringBuffer();
          pad.append(top);
          pad.append("String_Node_Str");
          pad.append(right);
          pad.append("String_Node_Str");
          pad.append(bottom);
          pad.append("String_Node_Str");
          pad.append(left);
          pad.append("String_Node_Str");
          style.setProperty("String_Node_Str",pad.toString());
          style.setProperty("String_Node_Str",PersistHelper.createColorString(c));
          return new Insets(top,left,bottom,right);
        }
 else         if (type.equals(SPECIAL_MATTE_BORDER)) {
          float top=Utils.getAsFloat(tk.nextToken());
          float right=Utils.getAsFloat(tk.nextToken());
          float bottom=Utils.getAsFloat(tk.nextToken());
          float left=Utils.getAsFloat(tk.nextToken());
          StringBuffer pad=new StringBuffer();
          pad.append(Math.round(top));
          pad.append("String_Node_Str");
          pad.append(Math.round(right));
          pad.append("String_Node_Str");
          pad.append(Math.round(bottom));
          pad.append("String_Node_Str");
          pad.append(Math.round(left));
          pad.append("String_Node_Str");
          style.setProperty("String_Node_Str",pad.toString());
          Color topColor=PersistHelper.createColor(tk.nextToken());
          Color rightColor=PersistHelper.createColor(tk.nextToken());
          Color bottomColor=PersistHelper.createColor(tk.nextToken());
          Color leftColor=PersistHelper.createColor(tk.nextToken());
          StringBuffer c=new StringBuffer();
          c.append(PersistHelper.createColorString(topColor));
          c.append(' ');
          c.append(PersistHelper.createColorString(rightColor));
          c.append(' ');
          c.append(PersistHelper.createColorString(bottomColor));
          c.append(' ');
          c.append(PersistHelper.createColorString(leftColor));
          style.setProperty("String_Node_Str",c.toString());
          style.setProperty("String_Node_Str","String_Node_Str");
          if (tk.hasMoreTokens()) {
            tk.nextToken();
          }
          if (tk.hasMoreTokens()) {
            String dashPattern=tk.nextToken().trim();
            if (dashPattern.length() > 0) {
              style.setProperty("String_Node_Str",dashPattern.equals("String_Node_Str") ? "String_Node_Str" : "String_Node_Str");
            }
          }
          return new Insets(Math.round(top),Math.round(left),Math.round(bottom),Math.round(right));
        }
 else {
          return null;
        }
      }
 catch (      Exception ex) {
        Debug.error(ex);
        return null;
      }
    }
 else {
      return null;
    }
  }
}