Program: 143375
Project: 143375
Buggy source:
@Override public Border fromJSON(Object newValue,Border previousValue,PropertyDescription pd,IBrowserConverterContext dataConverterContext){
  if (newValue == null)   return null;
  JSONObject object=(JSONObject)newValue;
  String type=object.optString(TYPE);
  if (type == null)   return null;
  JSONObject borderStyle=object.optJSONObject(BORDER_STYLE);
switch (type) {
case ComponentFactoryHelper.BEVEL_BORDER:
{
      int borderType="String_Node_Str".equals(borderStyle.optString(BORDER_STYLE)) ? BevelBorder.RAISED : BevelBorder.LOWERED;
      String borderColor=borderStyle.optString(BORDER_COLOR);
      StringTokenizer st=new StringTokenizer(borderColor,"String_Node_Str");
      Color hiOut=null;
      Color hiin=null;
      Color shOut=null;
      Color shIn=null;
      if (st.hasMoreTokens())       hiOut=PersistHelper.createColor(st.nextToken());
      if (st.hasMoreTokens())       shOut=PersistHelper.createColor(st.nextToken());
      if (st.hasMoreTokens())       shIn=PersistHelper.createColor(st.nextToken());
      if (st.hasMoreTokens())       hiin=PersistHelper.createColor(st.nextToken());
      return BorderFactory.createBevelBorder(borderType,hiOut,hiin,shOut,shIn);
    }
case ComponentFactoryHelper.EMPTY_BORDER:
{
    Insets insets=PersistHelper.createInsets(borderStyle.optString(BORDER_WIDTH).replaceAll("String_Node_Str","String_Node_Str"));
    return BorderFactory.createEmptyBorder(insets.top,insets.right,insets.bottom,insets.left);
  }
case ComponentFactoryHelper.ETCHED_BORDER:
{
  StringTokenizer st=new StringTokenizer(borderStyle.optString(BORDER_COLOR),"String_Node_Str");
  Color hi=null;
  Color sh=null;
  if (st.hasMoreTokens())   hi=PersistHelper.createColor(st.nextToken());
  if (st.hasMoreTokens())   sh=PersistHelper.createColor(st.nextToken());
  int t=borderStyle.optString(BORDER_STYLE).equals("String_Node_Str") ? EtchedBorder.RAISED : EtchedBorder.LOWERED;
  return BorderFactory.createEtchedBorder(t,hi,sh);
}
case ComponentFactoryHelper.LINE_BORDER:
{
Color borderColor=PersistHelper.createColor(borderStyle.optString(BORDER_COLOR));
String width=borderStyle.optString(BORDER_WIDTH);
if (width != null) width=width.substring(0,width.length() - 2);
return BorderFactory.createLineBorder(borderColor,Utils.getAsInteger(width));
}
case ComponentFactoryHelper.MATTE_BORDER:
{
Insets insets=PersistHelper.createInsets(borderStyle.optString(BORDER_WIDTH).replaceAll("String_Node_Str","String_Node_Str"));
Color borderColor=PersistHelper.createColor(borderStyle.optString(BORDER_COLOR));
return BorderFactory.createMatteBorder(insets.top,insets.right,insets.bottom,insets.left,borderColor);
}
case ComponentFactoryHelper.ROUNDED_BORDER:
{
float top=Utils.getAsFloat(borderStyle.optString(BORDER_TOP_WIDTH).replace("String_Node_Str","String_Node_Str"));
float left=Utils.getAsFloat(borderStyle.optString(BORDER_LEFT_WIDTH).replace("String_Node_Str","String_Node_Str"));
float bottom=Utils.getAsFloat(borderStyle.optString(BORDER_BOTTOM_WIDTH).replace("String_Node_Str","String_Node_Str"));
float right=Utils.getAsFloat(borderStyle.optString(BORDER_RIGHT_WIDTH).replace("String_Node_Str","String_Node_Str"));
Color topColor=PersistHelper.createColor(borderStyle.optString(BORDER_TOP_COLOR));
Color bottomColor=PersistHelper.createColor(borderStyle.optString(BORDER_BOTTOM_COLOR));
Color leftColor=PersistHelper.createColor(borderStyle.optString(BORDER_LEFT_COLOR));
Color rightColor=PersistHelper.createColor(borderStyle.optString(BORDER_RIGHT_COLOR));
RoundedBorder border=new RoundedBorder(top,left,bottom,right,topColor,leftColor,bottomColor,rightColor);
border.setBorderStyles(borderStyle.optString(BORDER_STYLE).replaceAll("String_Node_Str","String_Node_Str"));
border.setRoundingRadius(borderStyle.optString(BORDER_RADIUS).replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str"));
return border;
}
case ComponentFactoryHelper.SPECIAL_MATTE_BORDER:
{
float top=Utils.getAsFloat(borderStyle.optString(BORDER_TOP_WIDTH).replace("String_Node_Str","String_Node_Str"));
float left=Utils.getAsFloat(borderStyle.optString(BORDER_LEFT_WIDTH).replace("String_Node_Str","String_Node_Str"));
float bottom=Utils.getAsFloat(borderStyle.optString(BORDER_BOTTOM_WIDTH).replace("String_Node_Str","String_Node_Str"));
float right=Utils.getAsFloat(borderStyle.optString(BORDER_RIGHT_WIDTH).replace("String_Node_Str","String_Node_Str"));
Color topColor=PersistHelper.createColor(borderStyle.optString(BORDER_TOP_COLOR));
Color bottomColor=PersistHelper.createColor(borderStyle.optString(BORDER_BOTTOM_COLOR));
Color leftColor=PersistHelper.createColor(borderStyle.optString(BORDER_LEFT_COLOR));
Color rightColor=PersistHelper.createColor(borderStyle.optString(BORDER_RIGHT_COLOR));
return new SpecialMatteBorder(top,left,bottom,right,topColor,leftColor,bottomColor,rightColor);
}
case ComponentFactoryHelper.TITLED_BORDER:
{
String borderTitle=object.optString(TITLE);
int titleJustification=TitledBorder.DEFAULT_JUSTIFICATION;
switch (object.optString(TITLE_JUSTIFICATION)) {
case "String_Node_Str":
titleJustification=TitledBorder.LEFT;
break;
case "String_Node_Str":
titleJustification=TitledBorder.RIGHT;
break;
case "String_Node_Str":
titleJustification=TitledBorder.CENTER;
break;
case "String_Node_Str":
titleJustification=TitledBorder.LEADING;
break;
case "String_Node_Str":
titleJustification=TitledBorder.TRAILING;
}
int titlePosition=TitledBorder.DEFAULT_POSITION;
switch (object.optString(TITLE_POSITION)) {
case "String_Node_Str":
titlePosition=TitledBorder.ABOVE_TOP;
break;
case "String_Node_Str":
titlePosition=TitledBorder.TOP;
break;
case "String_Node_Str":
titlePosition=TitledBorder.BELOW_TOP;
break;
case "String_Node_Str":
titlePosition=TitledBorder.ABOVE_BOTTOM;
break;
case "String_Node_Str":
titlePosition=TitledBorder.BELOW_BOTTOM;
break;
case "String_Node_Str":
titlePosition=TitledBorder.BOTTOM;
break;
}
Font titleFont=FontPropertyType.INSTANCE.fromJSON(object.optJSONObject("String_Node_Str"),null,null,dataConverterContext);
Color titleColor=PersistHelper.createColor(object.optString("String_Node_Str"));
return BorderFactory.createTitledBorder(null,borderTitle,titleJustification,titlePosition,titleFont,titleColor);
}
}
return null;
}

Fixed version (ground truth):
@Override public Border fromJSON(Object newValue,Border previousValue,PropertyDescription pd,IBrowserConverterContext dataConverterContext,ValueReference<Boolean> returnValueAdjustedIncommingValue){
  if (newValue == null)   return null;
  JSONObject object=(JSONObject)newValue;
  String type=object.optString(TYPE);
  if (type == null)   return null;
  JSONObject borderStyle=object.optJSONObject(BORDER_STYLE);
switch (type) {
case ComponentFactoryHelper.BEVEL_BORDER:
{
      int borderType="String_Node_Str".equals(borderStyle.optString(BORDER_STYLE)) ? BevelBorder.RAISED : BevelBorder.LOWERED;
      String borderColor=borderStyle.optString(BORDER_COLOR);
      StringTokenizer st=new StringTokenizer(borderColor,"String_Node_Str");
      Color hiOut=null;
      Color hiin=null;
      Color shOut=null;
      Color shIn=null;
      if (st.hasMoreTokens())       hiOut=PersistHelper.createColor(st.nextToken());
      if (st.hasMoreTokens())       shOut=PersistHelper.createColor(st.nextToken());
      if (st.hasMoreTokens())       shIn=PersistHelper.createColor(st.nextToken());
      if (st.hasMoreTokens())       hiin=PersistHelper.createColor(st.nextToken());
      return BorderFactory.createBevelBorder(borderType,hiOut,hiin,shOut,shIn);
    }
case ComponentFactoryHelper.EMPTY_BORDER:
{
    Insets insets=PersistHelper.createInsets(borderStyle.optString(BORDER_WIDTH).replaceAll("String_Node_Str","String_Node_Str"));
    return BorderFactory.createEmptyBorder(insets.top,insets.right,insets.bottom,insets.left);
  }
case ComponentFactoryHelper.ETCHED_BORDER:
{
  StringTokenizer st=new StringTokenizer(borderStyle.optString(BORDER_COLOR),"String_Node_Str");
  Color hi=null;
  Color sh=null;
  if (st.hasMoreTokens())   hi=PersistHelper.createColor(st.nextToken());
  if (st.hasMoreTokens())   sh=PersistHelper.createColor(st.nextToken());
  int t=borderStyle.optString(BORDER_STYLE).equals("String_Node_Str") ? EtchedBorder.RAISED : EtchedBorder.LOWERED;
  return BorderFactory.createEtchedBorder(t,hi,sh);
}
case ComponentFactoryHelper.LINE_BORDER:
{
Color borderColor=PersistHelper.createColor(borderStyle.optString(BORDER_COLOR));
String width=borderStyle.optString(BORDER_WIDTH);
if (width != null) width=width.substring(0,width.length() - 2);
return BorderFactory.createLineBorder(borderColor,Utils.getAsInteger(width));
}
case ComponentFactoryHelper.MATTE_BORDER:
{
Insets insets=PersistHelper.createInsets(borderStyle.optString(BORDER_WIDTH).replaceAll("String_Node_Str","String_Node_Str"));
Color borderColor=PersistHelper.createColor(borderStyle.optString(BORDER_COLOR));
return BorderFactory.createMatteBorder(insets.top,insets.right,insets.bottom,insets.left,borderColor);
}
case ComponentFactoryHelper.ROUNDED_BORDER:
{
float top=Utils.getAsFloat(borderStyle.optString(BORDER_TOP_WIDTH).replace("String_Node_Str","String_Node_Str"));
float left=Utils.getAsFloat(borderStyle.optString(BORDER_LEFT_WIDTH).replace("String_Node_Str","String_Node_Str"));
float bottom=Utils.getAsFloat(borderStyle.optString(BORDER_BOTTOM_WIDTH).replace("String_Node_Str","String_Node_Str"));
float right=Utils.getAsFloat(borderStyle.optString(BORDER_RIGHT_WIDTH).replace("String_Node_Str","String_Node_Str"));
Color topColor=PersistHelper.createColor(borderStyle.optString(BORDER_TOP_COLOR));
Color bottomColor=PersistHelper.createColor(borderStyle.optString(BORDER_BOTTOM_COLOR));
Color leftColor=PersistHelper.createColor(borderStyle.optString(BORDER_LEFT_COLOR));
Color rightColor=PersistHelper.createColor(borderStyle.optString(BORDER_RIGHT_COLOR));
RoundedBorder border=new RoundedBorder(top,left,bottom,right,topColor,leftColor,bottomColor,rightColor);
border.setBorderStyles(borderStyle.optString(BORDER_STYLE).replaceAll("String_Node_Str","String_Node_Str"));
border.setRoundingRadius(borderStyle.optString(BORDER_RADIUS).replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str"));
return border;
}
case ComponentFactoryHelper.SPECIAL_MATTE_BORDER:
{
float top=Utils.getAsFloat(borderStyle.optString(BORDER_TOP_WIDTH).replace("String_Node_Str","String_Node_Str"));
float left=Utils.getAsFloat(borderStyle.optString(BORDER_LEFT_WIDTH).replace("String_Node_Str","String_Node_Str"));
float bottom=Utils.getAsFloat(borderStyle.optString(BORDER_BOTTOM_WIDTH).replace("String_Node_Str","String_Node_Str"));
float right=Utils.getAsFloat(borderStyle.optString(BORDER_RIGHT_WIDTH).replace("String_Node_Str","String_Node_Str"));
Color topColor=PersistHelper.createColor(borderStyle.optString(BORDER_TOP_COLOR));
Color bottomColor=PersistHelper.createColor(borderStyle.optString(BORDER_BOTTOM_COLOR));
Color leftColor=PersistHelper.createColor(borderStyle.optString(BORDER_LEFT_COLOR));
Color rightColor=PersistHelper.createColor(borderStyle.optString(BORDER_RIGHT_COLOR));
return new SpecialMatteBorder(top,left,bottom,right,topColor,leftColor,bottomColor,rightColor);
}
case ComponentFactoryHelper.TITLED_BORDER:
{
String borderTitle=object.optString(TITLE);
int titleJustification=TitledBorder.DEFAULT_JUSTIFICATION;
switch (object.optString(TITLE_JUSTIFICATION)) {
case "String_Node_Str":
titleJustification=TitledBorder.LEFT;
break;
case "String_Node_Str":
titleJustification=TitledBorder.RIGHT;
break;
case "String_Node_Str":
titleJustification=TitledBorder.CENTER;
break;
case "String_Node_Str":
titleJustification=TitledBorder.LEADING;
break;
case "String_Node_Str":
titleJustification=TitledBorder.TRAILING;
}
int titlePosition=TitledBorder.DEFAULT_POSITION;
switch (object.optString(TITLE_POSITION)) {
case "String_Node_Str":
titlePosition=TitledBorder.ABOVE_TOP;
break;
case "String_Node_Str":
titlePosition=TitledBorder.TOP;
break;
case "String_Node_Str":
titlePosition=TitledBorder.BELOW_TOP;
break;
case "String_Node_Str":
titlePosition=TitledBorder.ABOVE_BOTTOM;
break;
case "String_Node_Str":
titlePosition=TitledBorder.BELOW_BOTTOM;
break;
case "String_Node_Str":
titlePosition=TitledBorder.BOTTOM;
break;
}
Font titleFont=FontPropertyType.INSTANCE.fromJSON(object.optJSONObject("String_Node_Str"),null,null,dataConverterContext,null);
Color titleColor=PersistHelper.createColor(object.optString("String_Node_Str"));
return BorderFactory.createTitledBorder(null,borderTitle,titleJustification,titlePosition,titleFont,titleColor);
}
}
return null;
}