nus-yam/ex-repair huggingface dataset:
Program: 152058
Project: 152058
Buggy source:
/** 
 * Creates a canvas using one of our supported pixel formats.
 */
protected Canvas createCanvas(){
  if (RunAnywhere.isLinux()) {
    return new DisplayCanvas(){
      @Override protected void didInit(){
        GlCanvasApp.this.init();
      }
      @Override protected void updateView(){
        GlCanvasApp.this.updateView();
      }
      @Override protected void renderView(){
        GlCanvasApp.this.renderView();
      }
    }
;
  }
  for (  PixelFormat format : PIXEL_FORMATS) {
    try {
      return new AWTCanvas(format){
        @Override protected void didInit(){
          GlCanvasApp.this.init();
        }
        @Override protected void updateView(){
          GlCanvasApp.this.updateView();
        }
        @Override protected void renderView(){
          GlCanvasApp.this.renderView();
        }
      }
;
    }
 catch (    LWJGLException e) {
    }
  }
  log.warning("String_Node_Str");
  return null;
}

Fixed version (ground truth):
/** 
 * Creates a canvas using one of our supported pixel formats.
 */
protected Canvas createCanvas(){
  for (  PixelFormat format : PIXEL_FORMATS) {
    try {
      return new AWTCanvas(format){
        @Override protected void didInit(){
          GlCanvasApp.this.init();
        }
        @Override protected void updateView(){
          GlCanvasApp.this.updateView();
        }
        @Override protected void renderView(){
          GlCanvasApp.this.renderView();
        }
      }
;
    }
 catch (    LWJGLException e) {
    }
  }
  log.warning("String_Node_Str");
  return null;
}
Program: 152059
Project: 152059
Buggy source:
public int getState(){
  int state=super.getState();
  if (state == DISABLED) {
    return state;
  }
  if (_armed && _pressed) {
    return DOWN;
  }
 else {
    return state;
  }
}

Fixed version (ground truth):
public int getState(){
  int state=super.getState();
  if (state == DISABLED) {
    return state;
  }
  if (_pressed) {
    return DOWN;
  }
 else {
    return state;
  }
}
Program: 152060
Project: 152060
Buggy source:
public boolean dispatchEvent(Event event){
  if (isEnabled() && event instanceof MouseEvent) {
    int ostate=getState();
    MouseEvent mev=(MouseEvent)event;
switch (mev.getType()) {
case MouseEvent.MOUSE_DRAGGED:
      int mx=mev.getX(), my=mev.getY();
    int ax=getAbsoluteX(), ay=getAbsoluteY();
  if ((mx >= ax) && (my >= ay) && (mx < ax + _width)&& (my < ay + _height)) {
    _armed=_pressed=(mev.getModifiers() & MouseEvent.BUTTON1_DOWN_MASK) != 0;
  }
 else {
    _armed=_pressed=false;
  }
break;
case MouseEvent.MOUSE_ENTERED:
_armed=_pressed;
return super.dispatchEvent(event);
case MouseEvent.MOUSE_EXITED:
_armed=false;
return super.dispatchEvent(event);
case MouseEvent.MOUSE_PRESSED:
if (mev.getButton() == 0) {
_pressed=true;
_armed=true;
}
break;
case MouseEvent.MOUSE_RELEASED:
if (_armed && _pressed) {
fireAction(mev.getWhen(),mev.getModifiers());
_armed=false;
}
_pressed=false;
break;
default :
return super.dispatchEvent(event);
}
int state=getState();
if (state != ostate) {
stateDidChange();
}
if (_listeners != null) {
for (int ii=0, ll=_listeners.size(); ii < ll; ii++) {
event.dispatch(_listeners.get(ii));
}
}
return true;
}
return super.dispatchEvent(event);
}

Fixed version (ground truth):
public boolean dispatchEvent(Event event){
  if (isEnabled() && event instanceof MouseEvent) {
    int ostate=getState();
    MouseEvent mev=(MouseEvent)event;
switch (mev.getType()) {
case MouseEvent.MOUSE_DRAGGED:
      int mx=mev.getX(), my=mev.getY();
    int ax=getAbsoluteX(), ay=getAbsoluteY();
  if ((mx >= ax) && (my >= ay) && (mx < ax + _width)&& (my < ay + _height)) {
    _pressed=(mev.getModifiers() & MouseEvent.BUTTON1_DOWN_MASK) != 0;
  }
 else {
    _pressed=false;
  }
break;
case MouseEvent.MOUSE_ENTERED:
_pressed=false;
return super.dispatchEvent(event);
case MouseEvent.MOUSE_EXITED:
_pressed=false;
return super.dispatchEvent(event);
case MouseEvent.MOUSE_PRESSED:
if (mev.getButton() == 0) {
_pressed=true;
}
break;
case MouseEvent.MOUSE_RELEASED:
if (_pressed) {
fireAction(mev.getWhen(),mev.getModifiers());
_pressed=false;
}
break;
default :
return super.dispatchEvent(event);
}
int state=getState();
if (state != ostate) {
stateDidChange();
}
if (_listeners != null) {
for (int ii=0, ll=_listeners.size(); ii < ll; ii++) {
event.dispatch(_listeners.get(ii));
}
}
return true;
}
return super.dispatchEvent(event);
}
Program: 152061
Project: 152061
Buggy source:
/** 
 * Notes that an animation has started.
 * @param overrideBlendOut if non-negative, an interval over which to blend out allanimations currently playing at the same priority level as this one.
 */
protected void animationStarted(Animation animation,float overrideBlendOut){
  _playing.remove(animation);
  int priority=animation.getPriority();
  if (overrideBlendOut >= 0f) {
    ((Model)_parentScope).stopAnimations(priority,overrideBlendOut);
  }
  for (int ii=0, nn=_playing.size(); ii < nn; ii++) {
    if (priority >= _playing.get(ii).getPriority()) {
      _playing.add(ii,animation);
      return;
    }
  }
  _playing.add(animation);
  ((Model)_parentScope).animationStarted(animation);
}

Fixed version (ground truth):
/** 
 * Notes that an animation has started.
 * @param overrideBlendOut if non-negative, an interval over which to blend out allanimations currently playing at the same priority level as this one.
 */
protected void animationStarted(Animation animation,float overrideBlendOut){
  _playing.remove(animation);
  int priority=animation.getPriority();
  if (overrideBlendOut >= 0f) {
    ((Model)_parentScope).stopAnimations(priority,overrideBlendOut);
  }
  int ii=0;
  for (int nn=_playing.size(); ii < nn; ii++) {
    if (priority >= _playing.get(ii).getPriority()) {
      break;
    }
  }
  _playing.add(ii,animation);
  ((Model)_parentScope).animationStarted(animation);
}
Program: 152062
Project: 152062
Buggy source:
protected void packAndFit(int x,int y,boolean above){
  int width=_root.getDisplayWidth();
  int height=_root.getDisplayHeight();
  if (_rows != 0) {
    ScrollPane pane=(ScrollPane)getComponent(0);
    Container cont=(Container)pane.getChild();
    if (cont.getComponentCount() > _rows) {
      int theight=0;
      for (int ii=0; ii < _rows; ii++) {
        theight+=cont.getComponent(ii).getPreferredSize(-1,-1).height;
      }
      pane.setPreferredSize(-1,theight);
    }
  }
  ArrayList<Component> children=null;
  int columns=_columns;
  do {
    Dimension d=getPreferredSize(-1,-1);
    if (d.height > height && _rows == 0) {
      if (children == null) {
        children=new ArrayList<Component>(_children);
      }
      removeAll();
      setLayoutManager(new TableLayout(++columns,0,5));
      for (int ii=0; ii < children.size(); ii++) {
        add(children.get(ii));
      }
    }
 else {
      break;
    }
  }
 while (columns < 4);
  pack();
  x=Math.min(width - getWidth(),x);
  y=above ? Math.min(height - getHeight(),y) : Math.max(0,y - getHeight());
  setLocation(x,y);
}

Fixed version (ground truth):
protected void packAndFit(int x,int y,boolean above){
  int width=_root.getDisplayWidth();
  int height=_root.getDisplayHeight();
  if (_rows != 0) {
    ScrollPane pane=(ScrollPane)getComponent(0);
    Container cont=(Container)pane.getChild();
    if (cont.getComponentCount() > _rows) {
      int theight=0;
      for (int ii=0; ii < _rows; ii++) {
        theight+=cont.getComponent(ii).getPreferredSize(-1,-1).height;
      }
      pane.setPreferredSize(-1,theight);
    }
  }
  ArrayList<Component> children=null;
  int columns=_columns;
  do {
    Dimension d=getPreferredSize(-1,-1);
    if (d.height > height && _rows == 0) {
      if (children == null) {
        children=new ArrayList<Component>(_children);
      }
      removeAll();
      setLayoutManager(new TableLayout(++columns,0,5));
      for (int ii=0; ii < children.size(); ii++) {
        add(children.get(ii));
      }
    }
 else {
      break;
    }
  }
 while (columns < 4);
  pack();
  x=Math.min(width - getWidth(),x);
  y=above ? Math.min(height - getHeight(),y) : Math.max(0,y - getHeight());
  setLocation(x,y);
  validate();
}
Program: 152065
Project: 152065
Buggy source:
public int getSourceActions(JComponent comp){
  return MOVE;
}

Fixed version (ground truth):
public int getSourceActions(JComponent comp){
  return isEditable() ? MOVE : COPY;
}
Program: 152066
Project: 152066
Buggy source:
/** 
 * Returns an instance of the referenced model from the transient pool.
 */
protected Model getFromTransientPool(ConfigReference<ModelConfig> ref){
  ArrayList<SoftReference<Model>> list=_transientPool.get(ref);
  if (list != null) {
    for (int ii=list.size() - 1; ii >= 0; ii--) {
      Model model=list.remove(ii).get();
      if (model != null) {
        model.reset();
        return model;
      }
    }
    _transientPool.remove(ref);
  }
  Model model=new Model(_ctx);
  model.setParentScope(this);
  model.setConfig(ref);
  model.setUserObject(ref);
  model.addObserver(_transientObserver);
  return model;
}

Fixed version (ground truth):
/** 
 * Returns an instance of the referenced model from the transient pool.
 */
protected Model getFromTransientPool(ConfigReference<ModelConfig> ref){
  ArrayList<SoftReference<Model>> list=_transientPool.get(ref);
  if (list != null) {
    for (int ii=list.size() - 1; ii >= 0; ii--) {
      Model model=list.remove(ii).get();
      if (model != null) {
        model.reset();
        return model;
      }
    }
    _transientPool.remove(ref);
  }
  Model model=new Model(_ctx,ref);
  model.setParentScope(this);
  model.setUserObject(ref);
  model.addObserver(_transientObserver);
  return model;
}
Program: 152067
Project: 152067
Buggy source:
/** 
 * Spawns a transient model.
 */
@Scoped public void spawnTransient(ConfigReference<ModelConfig> ref,Transform3D transform){
  Model model=getFromTransientPool(ref);
  model.getLocalTransform().set(transform);
  add(model);
}

Fixed version (ground truth):
/** 
 * Spawns a transient model.
 */
@Scoped public void spawnTransient(ConfigReference<ModelConfig> ref,Transform3D transform){
  Model model=getFromTransientPool(ref);
  model.setLocalTransform(transform);
  add(model);
}
Program: 152068
Project: 152068
Buggy source:
@Override public void tick(float elapsed){
  if (_editor.isThirdButtonDown()) {
    _editor.deleteMouseObject();
  }
}

Fixed version (ground truth):
@Override public void tick(float elapsed){
  if (_editor.isThirdButtonDown() && !_editor.isControlDown()) {
    _editor.deleteMouseObject();
  }
}
Program: 152069
Project: 152069
Buggy source:
@Override public void mousePressed(MouseEvent event){
  if (event.getButton() == MouseEvent.BUTTON1) {
    _editor.editMouseObject();
  }
}

Fixed version (ground truth):
@Override public void mousePressed(MouseEvent event){
  if (event.getButton() == MouseEvent.BUTTON1 && !_editor.isControlDown()) {
    _editor.editMouseObject();
  }
}
Program: 152070
Project: 152070
Buggy source:
/** 
 * Recomputes the bounds of the roots.
 */
protected void recomputeBounds(){
  _bounds.setToEmpty();
  for (  Node root : _elements.values()) {
    _bounds.addLocal(root.getBounds());
  }
  for (  Node root : _influences.values()) {
    _bounds.addLocal(root.getBounds());
  }
  for (  Node root : _effects.values()) {
    _bounds.addLocal(root.getBounds());
  }
}

Fixed version (ground truth):
/** 
 * Recomputes the bounds of the roots.
 */
protected void recomputeBounds(){
  _bounds.setToEmpty();
  _minCoord.set(Integer.MAX_VALUE,Integer.MAX_VALUE,Integer.MAX_VALUE);
  _maxCoord.set(Integer.MIN_VALUE,Integer.MIN_VALUE,Integer.MIN_VALUE);
  addBounds(_elements);
  addBounds(_influences);
  addBounds(_effects);
}
Program: 152071
Project: 152071
Buggy source:
/** 
 * Recomputes the bounds of the roots.
 */
protected void recomputeBounds(){
  _bounds.setToEmpty();
  for (  Node root : _elements.values()) {
    _bounds.addLocal(root.getBounds());
  }
}

Fixed version (ground truth):
/** 
 * Recomputes the bounds of the roots.
 */
protected void recomputeBounds(){
  _bounds.setToEmpty();
  _minCoord.set(Integer.MAX_VALUE,Integer.MAX_VALUE);
  _maxCoord.set(Integer.MIN_VALUE,Integer.MIN_VALUE);
  addBounds(_elements);
}
Program: 152072
Project: 152072
Buggy source:
public void setInfluences(SceneInfluenceSet influences){
  if (_influences.equals(influences)) {
    return;
  }
  _influences.clear();
  _influences.addAll(influences);
  Box bounds=getBounds();
  boolean updated=false;
  FogState fogState=_influences.getFogState(bounds,_fogState);
  if (_fogState != fogState) {
    _fogState=fogState;
    updated=true;
  }
  LightState lightState=_influences.getLightState(bounds,_lightState);
  if (_lightState != lightState) {
    _lightState=lightState;
    updated=true;
  }
  if (updated) {
    wasUpdated();
  }
}

Fixed version (ground truth):
public void setInfluences(SceneInfluenceSet influences){
  boolean influenceable=_impl.isInfluenceable();
  if (influenceable ? _influences.equals(influences) : _influences.isEmpty()) {
    return;
  }
  _influences.clear();
  if (influenceable) {
    _influences.addAll(influences);
  }
  Box bounds=getBounds();
  boolean updated=false;
  FogState fogState=_influences.getFogState(bounds,_fogState);
  if (_fogState != fogState) {
    _fogState=fogState;
    updated=true;
  }
  LightState lightState=_influences.getLightState(bounds,_lightState);
  if (_lightState != lightState) {
    _lightState=lightState;
    updated=true;
  }
  if (updated) {
    wasUpdated();
  }
}
Program: 152073
Project: 152073
Buggy source:
public void tick(float elapsed){
  for (int ii=_alwaysTick.size() - 1; ii >= 0; ii--) {
    _alwaysTick.get(ii).tick(elapsed);
  }
  if (!_visible.isEmpty()) {
    for (    SceneElement element : _visible) {
      element.tick(elapsed);
    }
    _visible.clear();
  }
  Vector3f location=_ctx.getCompositor().getCamera().getWorldTransform().getTranslation();
  getEffects(_viewer.set(location,location),_neffects);
  setEffects(_neffects);
  _neffects.clear();
  for (  ViewerEffect effect : _effects) {
    effect.update();
  }
  if (!_updateInfluences.isEmpty()) {
    for (    SceneElement element : _updateInfluences) {
      getInfluences(element.getBounds(),_influences);
      element.setInfluences(_influences);
      _influences.clear();
    }
    _updateInfluences.clear();
  }
}

Fixed version (ground truth):
public void tick(float elapsed){
  for (int ii=_alwaysTick.size() - 1; ii >= 0; ii--) {
    _alwaysTick.get(ii).tick(elapsed);
  }
  if (!_visible.isEmpty()) {
    for (    SceneElement element : _visible) {
      element.tick(elapsed);
    }
    _visible.clear();
  }
  Vector3f location=_ctx.getCompositor().getCamera().getWorldTransform().getTranslation();
  getEffects(_viewer.set(location,location),_neffects);
  setEffects(_neffects);
  _neffects.clear();
  for (  ViewerEffect effect : _effects) {
    effect.update();
  }
  int size=_updateInfluences.size();
  if (size > 0) {
    _updateArray=_updateInfluences.toArray(_updateArray);
    _updateInfluences.clear();
    for (int ii=0; ii < size; ii++) {
      SceneElement element=_updateArray[ii];
      getInfluences(element.getBounds(),_influences);
      element.setInfluences(_influences);
      _influences.clear();
    }
  }
}
Program: 152074
Project: 152074
Buggy source:
/** 
 * Reads the fields of an object from the specified importer.
 */
public void readFields(Object object,Importer importer,boolean useReader) throws IOException {
  if (_reader != null && useReader) {
    try {
      _reader.invoke(object,importer);
    }
 catch (    InvocationTargetException ite) {
      throw (IOException)ite.getTargetException();
    }
catch (    IllegalAccessException iae) {
      throw new IOException("String_Node_Str" + iae + "String_Node_Str");
    }
  }
 else {
    try {
      for (      FieldData field : _fields) {
        field.read(object,importer);
      }
    }
 catch (    IllegalAccessException iae) {
      throw new IOException("String_Node_Str" + iae + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * Reads the fields of an object from the specified importer.
 */
public void readFields(Object object,Importer importer,boolean useReader) throws IOException {
  if (_reader != null && useReader) {
    try {
      _reader.invoke(object,importer);
    }
 catch (    InvocationTargetException ite) {
      Throwable t=ite.getTargetException();
      if (t instanceof IOException) {
        throw (IOException)t;
      }
 else       if (t instanceof RuntimeException) {
        throw (RuntimeException)t;
      }
 else {
        throw new IOException("String_Node_Str" + t + "String_Node_Str");
      }
    }
catch (    IllegalAccessException iae) {
      throw new IOException("String_Node_Str" + iae + "String_Node_Str");
    }
  }
 else {
    try {
      for (      FieldData field : _fields) {
        field.read(object,importer);
      }
    }
 catch (    IllegalAccessException iae) {
      throw new IOException("String_Node_Str" + iae + "String_Node_Str");
    }
  }
}
Program: 152075
Project: 152075
Buggy source:
/** 
 * Performs the actual removal of the identified entry.
 * @return the removed entry.
 */
protected Entry remove(Object key){
  if (!(key instanceof Coord)) {
    return _entries.remove(key);
  }
  Coord coord=(Coord)key;
  int ovalue=_tiles.get(coord.x,coord.y);
  if (ovalue == -1) {
    return null;
  }
  TileEntry oentry=decodeTileEntry(coord,ovalue);
  removeTileConfig(getTileConfigIndex(ovalue));
  return oentry;
}

Fixed version (ground truth):
/** 
 * Performs the actual removal of the identified entry.
 * @return the removed entry.
 */
protected Entry remove(Object key){
  if (!(key instanceof Coord)) {
    return _entries.remove(key);
  }
  Coord coord=(Coord)key;
  int ovalue=_tiles.remove(coord.x,coord.y);
  if (ovalue == -1) {
    return null;
  }
  TileEntry oentry=decodeTileEntry(coord,ovalue);
  removeTileConfig(getTileConfigIndex(ovalue));
  return oentry;
}
Program: 152076
Project: 152076
Buggy source:
/** 
 * Custom field read method.
 */
public void readFields(Importer in) throws IOException {
  in.defaultReadFields();
  for (  CoordIntEntry entry : _tiles.coordIntEntrySet()) {
    int idx=getTileConfigIndex(entry.getIntValue());
    _tileConfigs.get(idx).count++;
  }
  for (int ii=0, nn=_tileConfigs.size(); ii < nn; ii++) {
    _tileConfigIds.put(_tileConfigs.get(ii).tile,ii);
  }
  for (  Entry entry : in.read("String_Node_Str",new Entry[0],Entry[].class)) {
    _entries.put(entry.getKey(),entry);
    _references.put(entry.getReference(),entry.getReference());
    if (entry instanceof IdEntry) {
      _lastEntryId=Math.max(_lastEntryId,((IdEntry)entry).getId());
    }
  }
}

Fixed version (ground truth):
/** 
 * Custom field read method.
 */
public void readFields(Importer in) throws IOException {
  in.defaultReadFields();
  for (  CoordIntEntry entry : _tiles.coordIntEntrySet()) {
    int idx=getTileConfigIndex(entry.getIntValue());
    _tileConfigs.get(idx).count++;
  }
  for (int ii=0, nn=_tileConfigs.size(); ii < nn; ii++) {
    TileConfigMapping mapping=_tileConfigs.get(ii);
    if (mapping != null) {
      _tileConfigIds.put(mapping.tile,ii);
    }
  }
  for (  Entry entry : in.read("String_Node_Str",new Entry[0],Entry[].class)) {
    _entries.put(entry.getKey(),entry);
    _references.put(entry.getReference(),entry.getReference());
    if (entry instanceof IdEntry) {
      _lastEntryId=Math.max(_lastEntryId,((IdEntry)entry).getId());
    }
  }
}
Program: 152077
Project: 152077
Buggy source:
/** 
 * Places the current entry.
 */
protected void placeEntry(){
  if (_scene.getEntry(_entry.getLocation()) != null) {
    _scene.removeEntry(_entry.getLocation());
  }
  _scene.addEntry((TileEntry)_entry.clone());
  _lastPlacement.set(_entry.getLocation());
}

Fixed version (ground truth):
/** 
 * Places the current entry.
 */
protected void placeEntry(){
  Coord coord=_entry.getLocation();
  if (_scene.getEntry(coord) != null) {
    _scene.removeEntry(coord);
  }
  try {
    _scene.addEntry((TileEntry)_entry.clone());
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  _lastPlacement.set(_entry.getLocation());
}
Program: 152078
Project: 152078
Buggy source:
/** 
 * Returns a reference to an inner object's outer class reference, or <code>null</code> if the object represents an instance of a static class.
 */
public static Object getOuter(Object object){
  Class clazz=object.getClass();
  if (!isInner(clazz)) {
    return null;
  }
  if (object instanceof Inner) {
    return ((Inner)object).getOuter();
  }
  Field field=_outers.get(clazz);
  if (field == null) {
    Class eclazz=clazz.getEnclosingClass();
    for (    Field ofield : clazz.getDeclaredFields()) {
      if (ofield.isSynthetic() && ofield.getType() == eclazz && ofield.getName().startsWith("String_Node_Str")) {
        field=ofield;
        break;
      }
    }
    field.setAccessible(true);
    _outers.put(clazz,field);
  }
  try {
    return field.get(object);
  }
 catch (  IllegalAccessException e) {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Returns a reference to an inner object's outer class reference, or <code>null</code> if the object represents an instance of a static class.
 */
public static Object getOuter(Object object){
  Class clazz=object.getClass();
  if (!isInner(clazz)) {
    return null;
  }
  if (object instanceof Inner) {
    return ((Inner)object).getOuter();
  }
  Field field=_outers.get(clazz);
  if (field == null) {
    Class dclazz=clazz.getDeclaringClass();
    for (    Field ofield : clazz.getDeclaredFields()) {
      if (ofield.isSynthetic() && ofield.getType() == dclazz && ofield.getName().startsWith("String_Node_Str")) {
        field=ofield;
        break;
      }
    }
    field.setAccessible(true);
    _outers.put(clazz,field);
  }
  try {
    return field.get(object);
  }
 catch (  IllegalAccessException e) {
    return null;
  }
}
Program: 152079
Project: 152079
Buggy source:
/** 
 * Returns the outer class for the given inner class (or <code>null</code> if not an inner class).
 */
public static Class getOuterClass(Class clazz){
  if (!isInner(clazz)) {
    return null;
  }
  if (!Inner.class.isAssignableFrom(clazz)) {
    return clazz.getEnclosingClass();
  }
  Class outer=_oclasses.get(clazz);
  if (outer == null) {
    for (    Constructor ctor : clazz.getDeclaredConstructors()) {
      Class[] ptypes=ctor.getParameterTypes();
      if (ptypes.length > 0) {
        _oclasses.put(clazz,outer=ptypes[0]);
        break;
      }
    }
  }
  return outer;
}

Fixed version (ground truth):
/** 
 * Returns the outer class for the given inner class (or <code>null</code> if not an inner class).
 */
public static Class getOuterClass(Class clazz){
  if (!isInner(clazz)) {
    return null;
  }
  if (!Inner.class.isAssignableFrom(clazz)) {
    return clazz.getDeclaringClass();
  }
  Class outer=_oclasses.get(clazz);
  if (outer == null) {
    for (    Constructor ctor : clazz.getDeclaredConstructors()) {
      Class[] ptypes=ctor.getParameterTypes();
      if (ptypes.length > 0) {
        _oclasses.put(clazz,outer=ptypes[0]);
        break;
      }
    }
  }
  return outer;
}
Program: 152080
Project: 152080
Buggy source:
/** 
 * Determines whether the specified class is a non-static inner class.
 */
public static boolean isInner(Class clazz){
  return (clazz.isMemberClass() && !Modifier.isStatic(clazz.getModifiers())) || Inner.class.isAssignableFrom(clazz);
}

Fixed version (ground truth):
/** 
 * Determines whether the specified class is a non-static inner class.
 */
public static boolean isInner(Class clazz){
  return (clazz.getDeclaringClass() != null && !Modifier.isStatic(clazz.getModifiers())) || Inner.class.isAssignableFrom(clazz);
}
Program: 152081
Project: 152081
Buggy source:
/** 
 * Updates the batch's state key using the current set of states.
 */
public void updateKey(){
  TextureState tstate=(TextureState)_states[RenderState.TEXTURE_STATE];
  TextureUnit[] units=(tstate == null) ? null : tstate.getUnits();
  int textures=(units == null) ? 0 : units.length;
  int size=1 + 1 + textures+ 1+ 1;
  if (key == null || key.length != size) {
    key=new int[size];
  }
  ShaderState sstate=(ShaderState)_states[RenderState.SHADER_STATE];
  Program program=(sstate == null) ? null : sstate.getProgram();
  Shader vertexShader=(program == null) ? null : program.getVertexShader();
  Shader fragmentShader=(program == null) ? null : program.getFragmentShader();
  int idx=0;
  key[idx++]=(vertexShader == null) ? 0 : vertexShader.getId();
  key[idx++]=(fragmentShader == null) ? 0 : fragmentShader.getId();
  for (int ii=0; ii < textures; ii++) {
    key[idx++]=(units[ii] == null) ? 0 : units[ii].texture.getId();
  }
  key[idx++]=-1;
  ArrayState astate=(ArrayState)_states[RenderState.ARRAY_STATE];
  BufferObject buffer=(astate == null) ? null : astate.getElementArrayBuffer();
  if (buffer != null) {
    key[idx++]=buffer.getId();
  }
 else   if (_command instanceof CallList) {
    key[idx++]=((CallList)_command).getList().getId();
  }
 else {
    key[idx++]=0;
  }
}

Fixed version (ground truth):
/** 
 * Updates the batch's state key using the current set of states.
 */
public void updateKey(){
  TextureState tstate=(TextureState)_states[RenderState.TEXTURE_STATE];
  TextureUnit[] units=(tstate == null) ? null : tstate.getUnits();
  int textures=(units == null) ? 0 : units.length;
  int size=1 + 1 + textures+ 1+ 1;
  if (key == null || key.length != size) {
    key=new int[size];
  }
  ShaderState sstate=(ShaderState)_states[RenderState.SHADER_STATE];
  Program program=(sstate == null) ? null : sstate.getProgram();
  Shader vertexShader=(program == null) ? null : program.getVertexShader();
  Shader fragmentShader=(program == null) ? null : program.getFragmentShader();
  int idx=0;
  key[idx++]=(vertexShader == null) ? 0 : vertexShader.getId();
  key[idx++]=(fragmentShader == null) ? 0 : fragmentShader.getId();
  for (int ii=0; ii < textures; ii++) {
    Texture texture=(units[ii] == null) ? null : units[ii].texture;
    key[idx++]=(texture == null) ? 0 : texture.getId();
  }
  key[idx++]=-1;
  ArrayState astate=(ArrayState)_states[RenderState.ARRAY_STATE];
  BufferObject buffer=(astate == null) ? null : astate.getElementArrayBuffer();
  if (buffer != null) {
    key[idx++]=buffer.getId();
  }
 else   if (_command instanceof CallList) {
    key[idx++]=((CallList)_command).getList().getId();
  }
 else {
    key[idx++]=0;
  }
}
Program: 152082
Project: 152082
Buggy source:
public boolean importData(JComponent comp,Transferable t){
  boolean local=t.isDataFlavorSupported(LOCAL_NODE_TRANSFER_FLAVOR);
  DataFlavor flavor=local ? LOCAL_NODE_TRANSFER_FLAVOR : ToolUtil.SERIALIZED_WRAPPED_FLAVOR;
  Object data;
  try {
    data=t.getTransferData(local ? LOCAL_NODE_TRANSFER_FLAVOR : ToolUtil.SERIALIZED_WRAPPED_FLAVOR);
  }
 catch (  Exception e) {
    log.warning("String_Node_Str",e);
    return false;
  }
  ConfigTreeNode node, onode=null;
  if (local) {
    NodeTransfer transfer=(NodeTransfer)data;
    node=transfer.cnode;
    onode=transfer.onode;
  }
 else {
    data=((SerializableWrapper)data).getObject();
    if (!(data instanceof ConfigTreeNode)) {
      return false;
    }
    node=(ConfigTreeNode)data;
  }
  if (!node.verifyConfigClass(group.getConfigClass())) {
    return false;
  }
  ConfigTreeNode snode=getSelectedNode();
  if (onode != null && onode == snode) {
    return false;
  }
  ConfigTreeNode parent=(ConfigTreeNode)tree.getModel().getRoot();
  int index=parent.getChildCount();
  if (snode != null && snode.getParent() != null) {
    if (snode.getAllowsChildren()) {
      parent=snode;
      index=snode.getChildCount();
    }
 else {
      parent=(ConfigTreeNode)snode.getParent();
      int oidx=(onode == null) ? -1 : parent.getIndex(onode);
      int sidx=parent.getIndex(snode);
      index=sidx + ((oidx >= 0 && sidx > oidx) ? 1 : 0);
    }
  }
  node=(ConfigTreeNode)node.clone();
  ((DefaultTreeModel)tree.getModel()).insertNodeInto(node,parent,index);
  tree.setSelectionPath(new TreePath(node.getPath()));
  return true;
}

Fixed version (ground truth):
public boolean importData(JComponent comp,Transferable t){
  boolean local=t.isDataFlavorSupported(LOCAL_NODE_TRANSFER_FLAVOR);
  DataFlavor flavor=local ? LOCAL_NODE_TRANSFER_FLAVOR : ToolUtil.SERIALIZED_WRAPPED_FLAVOR;
  Object data;
  try {
    data=t.getTransferData(local ? LOCAL_NODE_TRANSFER_FLAVOR : ToolUtil.SERIALIZED_WRAPPED_FLAVOR);
  }
 catch (  Exception e) {
    log.warning("String_Node_Str",e);
    return false;
  }
  ConfigTreeNode node, onode=null;
  if (local) {
    NodeTransfer transfer=(NodeTransfer)data;
    node=transfer.cnode;
    onode=transfer.onode;
  }
 else {
    data=((SerializableWrapper)data).getObject();
    if (!(data instanceof ConfigTreeNode)) {
      return false;
    }
    node=(ConfigTreeNode)data;
  }
  if (!node.verifyConfigClass(group.getConfigClass())) {
    return false;
  }
  ConfigTreeNode snode=getSelectedNode();
  ConfigTreeNode parent=(ConfigTreeNode)tree.getModel().getRoot();
  if (snode != null) {
    parent=snode.getAllowsChildren() ? snode : (ConfigTreeNode)snode.getParent();
  }
  if (onode != null && onode.getParent() == parent) {
    return false;
  }
  node=(ConfigTreeNode)node.clone();
  ((DefaultTreeModel)tree.getModel()).insertNodeInto(node,parent,parent.getInsertionIndex(node));
  tree.setSelectionPath(new TreePath(node.getPath()));
  return true;
}
Program: 152083
Project: 152083
Buggy source:
@Override public Object getTransferData(DataFlavor flavor){
  return (flavor == LOCAL_NODE_TRANSFER_FLAVOR) ? this : new SerializableWrapper(cnode);
}

Fixed version (ground truth):
public Object getTransferData(DataFlavor flavor){
  return (flavor == LOCAL_NODE_TRANSFER_FLAVOR) ? this : new SerializableWrapper(cnode);
}
Program: 152084
Project: 152084
Buggy source:
@Override public boolean isDataFlavorSupported(DataFlavor flavor){
  return ListUtil.contains(NODE_TRANSFER_FLAVORS,flavor);
}

Fixed version (ground truth):
public boolean isDataFlavorSupported(DataFlavor flavor){
  return ListUtil.contains(NODE_TRANSFER_FLAVORS,flavor);
}
Program: 152086
Project: 152086
Buggy source:
/** 
 * Creates a new node for the supplied configuration (or a folder node, if the configuration is <code>null</code>).
 */
protected void newNode(ManagedConfig config){
  ConfigTreeNode snode=getSelectedNode();
  ConfigTreeNode parent=(ConfigTreeNode)(snode == null ? tree.getModel().getRoot() : snode.getParent());
  String name=parent.findNameForChild(_msgs.get(config == null ? "String_Node_Str" : "String_Node_Str"));
  ConfigTreeNode child=new ConfigTreeNode(name,config);
  ((DefaultTreeModel)tree.getModel()).insertNodeInto(child,parent,parent.getChildCount());
  tree.startEditingAtPath(new TreePath(child.getPath()));
}

Fixed version (ground truth):
/** 
 * Creates a new node for the supplied configuration (or a folder node, if the configuration is <code>null</code>).
 */
protected void newNode(ManagedConfig config){
  ConfigTreeNode snode=getSelectedNode();
  ConfigTreeNode parent=(ConfigTreeNode)(snode == null ? tree.getModel().getRoot() : snode.getParent());
  String name=parent.findNameForChild(_msgs.get(config == null ? "String_Node_Str" : "String_Node_Str"));
  ConfigTreeNode child=new ConfigTreeNode(name,config);
  ((DefaultTreeModel)tree.getModel()).insertNodeInto(child,parent,parent.getInsertionIndex(child));
  tree.startEditingAtPath(new TreePath(child.getPath()));
}
Program: 152087
Project: 152087
Buggy source:
@Override public DataFlavor[] getTransferDataFlavors(){
  return NODE_TRANSFER_FLAVORS;
}

Fixed version (ground truth):
public DataFlavor[] getTransferDataFlavors(){
  return NODE_TRANSFER_FLAVORS;
}
Program: 152088
Project: 152088
Buggy source:
@Override public Object readObject() throws IOException {
  Node first;
  if (_document == null) {
    DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
    try {
      DocumentBuilder builder=factory.newDocumentBuilder();
      _document=builder.parse(_in);
    }
 catch (    Exception e) {
      throw new IOException("String_Node_Str" + e + "String_Node_Str");
    }
    Element top=_document.getDocumentElement();
    if (!top.getTagName().equals("String_Node_Str")) {
      throw new IOException("String_Node_Str" + top.getTagName() + "String_Node_Str");
    }
    String vstr=top.getAttribute("String_Node_Str");
    if (!vstr.equals(XMLExporter.VERSION)) {
      throw new IOException("String_Node_Str" + vstr + "String_Node_Str"+ XMLExporter.VERSION+ "String_Node_Str");
    }
    String cstr=top.getAttribute("String_Node_Str");
    if (!cstr.equals(getClass().getName())) {
      throw new IOException("String_Node_Str" + cstr + "String_Node_Str"+ getClass().getName()+ "String_Node_Str");
    }
    first=top.getFirstChild();
  }
 else {
    first=(_element == null) ? null : _element.getNextSibling();
  }
  if ((_element=findElement(first,"String_Node_Str")) == null) {
    return null;
  }
  return read(_element,Object.class);
}

Fixed version (ground truth):
@Override public Object readObject() throws IOException {
  Node first;
  if (_document == null) {
    DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
    try {
      DocumentBuilder builder=factory.newDocumentBuilder();
      _document=builder.parse(_in);
    }
 catch (    Exception e) {
      throw new IOException("String_Node_Str" + e + "String_Node_Str");
    }
    Element top=_document.getDocumentElement();
    if (!top.getTagName().equals("String_Node_Str")) {
      throw new IOException("String_Node_Str" + top.getTagName() + "String_Node_Str");
    }
    String vstr=top.getAttribute("String_Node_Str");
    if (!vstr.equals(XMLExporter.VERSION)) {
      throw new IOException("String_Node_Str" + vstr + "String_Node_Str"+ XMLExporter.VERSION+ "String_Node_Str");
    }
    String cstr=top.getAttribute("String_Node_Str");
    if (!cstr.equals(getClass().getName())) {
      throw new IOException("String_Node_Str" + cstr + "String_Node_Str"+ getClass().getName()+ "String_Node_Str");
    }
    first=top.getFirstChild();
  }
 else {
    first=(_element == null) ? null : _element.getNextSibling();
  }
  if ((_element=findElement(first,"String_Node_Str")) == null) {
    throw new EOFException();
  }
  return read(_element,Object.class);
}
Program: 152089
Project: 152089
Buggy source:
/** 
 * Program entry point.
 */
public static void main(String[] args) throws Exception {
  if (args.length < 2) {
    System.err.println("String_Node_Str");
    return;
  }
  BinaryImporter in=new BinaryImporter(new FileInputStream(args[0]));
  XMLExporter out=new XMLExporter(new FileOutputStream(args[1]));
  Object obj;
  while ((obj=in.readObject()) != null) {
    out.writeObject(obj);
  }
  in.close();
  out.close();
}

Fixed version (ground truth):
/** 
 * Program entry point.
 */
public static void main(String[] args) throws Exception {
  if (args.length < 2) {
    System.err.println("String_Node_Str");
    return;
  }
  BinaryImporter in=new BinaryImporter(new FileInputStream(args[0]));
  XMLExporter out=new XMLExporter(new FileOutputStream(args[1]));
  try {
    while (true) {
      out.writeObject(in.readObject());
    }
  }
 catch (  EOFException e) {
  }
 finally {
    in.close();
    out.close();
  }
}
Program: 152090
Project: 152090
Buggy source:
/** 
 * Program entry point.
 */
public static void main(String[] args) throws Exception {
  if (args.length < 2) {
    System.err.println("String_Node_Str");
    return;
  }
  XMLImporter in=new XMLImporter(new FileInputStream(args[0]));
  BinaryExporter out=new BinaryExporter(new FileOutputStream(args[1]));
  Object obj;
  while ((obj=in.readObject()) != null) {
    out.writeObject(obj);
  }
  in.close();
  out.close();
}

Fixed version (ground truth):
/** 
 * Program entry point.
 */
public static void main(String[] args) throws Exception {
  if (args.length < 2) {
    System.err.println("String_Node_Str");
    return;
  }
  XMLImporter in=new XMLImporter(new FileInputStream(args[0]));
  BinaryExporter out=new BinaryExporter(new FileOutputStream(args[1]));
  try {
    while (true) {
      out.writeObject(in.readObject());
    }
  }
 catch (  EOFException e) {
  }
 finally {
    in.close();
    out.close();
  }
}
Program: 152091
Project: 152091
Buggy source:
/** 
 * Compares two program versions. Handles if some of them is marked as beta.
 * @param version1 first version. Null means lowest possible version.
 * @param version2 second version. Null means lowest possible version.
 * @return positive number if version1 > version2, zero if version1 == version2,negative number otherwise
 */
public static int compareProgramVersions(String version1,String version2){
  if (version1 == null) {
    return (version2 == null ? 0 : -1);
  }
  String v1=version1;
  String v2=version2;
  boolean beta1=version1.toLowerCase().contains("String_Node_Str");
  boolean beta2=version2.toLowerCase().contains("String_Node_Str");
  if (beta1) {
    v1=version1.substring(0,version1.toLowerCase().indexOf("String_Node_Str")).trim();
  }
  if (beta2) {
    v2=version2.substring(0,version2.toLowerCase().indexOf("String_Node_Str")).trim();
  }
  AlphanumComparator comparator=new AlphanumComparator();
  if (beta1 && beta2) {
    return comparator.compare(v1,v2) == 0 ? version1.compareTo(version2) : comparator.compare(v1,v2);
  }
 else   if (beta1) {
    return (comparator.compare(v1,v2) == 0 ? -1 : comparator.compare(v1,v2));
  }
 else   if (beta2) {
    return (comparator.compare(v1,v2) == 0 ? 1 : comparator.compare(v1,v2));
  }
 else {
    return comparator.compare(v1,v2);
  }
}

Fixed version (ground truth):
/** 
 * Compares two program versions. Handles if some of them is marked as beta.
 * @param version1 first version. Null means lowest possible version.
 * @param version2 second version. Null means lowest possible version.
 * @return positive number if version1 &gt; version2, zero if version1 == version2,negative number otherwise
 */
public static int compareProgramVersions(String version1,String version2){
  if (version1 == null) {
    return (version2 == null ? 0 : -1);
  }
  String v1=version1;
  String v2=version2;
  boolean beta1=version1.toLowerCase().contains("String_Node_Str");
  boolean beta2=version2.toLowerCase().contains("String_Node_Str");
  if (beta1) {
    v1=version1.substring(0,version1.toLowerCase().indexOf("String_Node_Str")).trim();
  }
  if (beta2) {
    v2=version2.substring(0,version2.toLowerCase().indexOf("String_Node_Str")).trim();
  }
  AlphanumComparator comparator=new AlphanumComparator();
  if (beta1 && beta2) {
    return comparator.compare(v1,v2) == 0 ? version1.compareTo(version2) : comparator.compare(v1,v2);
  }
 else   if (beta1) {
    return (comparator.compare(v1,v2) == 0 ? -1 : comparator.compare(v1,v2));
  }
 else   if (beta2) {
    return (comparator.compare(v1,v2) == 0 ? 1 : comparator.compare(v1,v2));
  }
 else {
    return comparator.compare(v1,v2);
  }
}
Program: 152092
Project: 152092
Buggy source:
/** 
 * Gateway name. This name will be visible in the list od available gateways. The name must be in the form "[CC]Gateway", where CC is country code as defined in <a href="http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO 3166-1 alpha-2</a>  and Gateway is the very name of the gateway.<br/> Country code should denote which country is the main interest of the gateway, for example: <ul><li>The gateway is only available in the language of that country.</li> <li>The gateway sends messages only to customers of that country's operator.</li> <li>The gateway requires a SIM card bought from that country's operator.</li></ul> For international gateways, allowing to send SMS to multiple countries, use [INT]Gateway.<br/> This name must be unique amongst other gateway names.
 */
String getName();

Fixed version (ground truth):
/** 
 * Gateway name. This name will be visible in the list od available gateways. The name must be in the form "[CC]Gateway", where CC is country code as defined in <a href="http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO 3166-1 alpha-2</a>  and Gateway is the very name of the gateway.<br> Country code should denote which country is the main interest of the gateway, for example: <ul><li>The gateway is only available in the language of that country.</li> <li>The gateway sends messages only to customers of that country's operator.</li> <li>The gateway requires a SIM card bought from that country's operator.</li></ul> For international gateways, allowing to send SMS to multiple countries, use [INT]Gateway.<br> This name must be unique amongst other gateway names.
 */
String getName();
Program: 152093
Project: 152093
Buggy source:
/** 
 * List of telephone prefixes that are supported by this gateway. All prefixes that are not mentioned here are *not supported* by this gateway. For example for a gateway that can send messages only to numbers originating from Czech Republic (country prefix: +420), and nowhere else, the value is ["+420"]. (The gateway doesn't have to support all numbers starting with +420, but it certainly doesn't support any other prefix.)<br/> The supported prefixes will usually map to country codes. The prefix always starts with "+" sign and is 1-3 digits long. List of country calling codes is on <a href="http://en.wikipedia.org/wiki/Country_calling_codes">Wikipedia</a>.<br/> If the gateway works internationally, allowing to send SMS to multiple countries, this will be an empty array.
 * @return list of supported prefixes; empty array if gateway sends anywhere in the world
 */
String[] getSupportedPrefixes();

Fixed version (ground truth):
/** 
 * List of telephone prefixes that are supported by this gateway. All prefixes that are not mentioned here are *not supported* by this gateway. For example for a gateway that can send messages only to numbers originating from Czech Republic (country prefix: +420), and nowhere else, the value is ["+420"]. (The gateway doesn't have to support all numbers starting with +420, but it certainly doesn't support any other prefix.)<br> The supported prefixes will usually map to country codes. The prefix always starts with "+" sign and is 1-3 digits long. List of country calling codes is on <a href="http://en.wikipedia.org/wiki/Country_calling_codes">Wikipedia</a>.<br> If the gateway works internationally, allowing to send SMS to multiple countries, this will be an empty array.
 * @return list of supported prefixes; empty array if gateway sends anywhere in the world
 */
String[] getSupportedPrefixes();
Program: 152094
Project: 152094
Buggy source:
/** 
 * List of telephone prefixes that are preferred by this gateway. Preferred prefixes means that there is really high probability that this gateway will be able to send message to a phone number with that prefix. Sometimes a gateway support just a certain set of customers (of a single cell operator for example) and this is a way how to mark them. It usually concerns just free gateway, paid ones usually send everywhere.<br/> If the gateway sends messages to any phone number within the supported prefixes (see   {@link #getSupportedPrefixes}) then this will be an empty array.<br/><br/> Example: When the supported prefix is ["+420"] and this gateway allows sending messages to an operator who owns prefixes "606" and "777", then the resulting array of preferred prefixes is ["+420606", "+420777"].
 * @return list of preferred prefixes; empty array if gateway sends to any phone numberin supported prefixes
 */
String[] getPreferredPrefixes();

Fixed version (ground truth):
/** 
 * List of telephone prefixes that are preferred by this gateway. Preferred prefixes means that there is really high probability that this gateway will be able to send message to a phone number with that prefix. Sometimes a gateway support just a certain set of customers (of a single cell operator for example) and this is a way how to mark them. It usually concerns just free gateway, paid ones usually send everywhere.<br> If the gateway sends messages to any phone number within the supported prefixes (see   {@link #getSupportedPrefixes}) then this will be an empty array.<br><br> Example: When the supported prefix is ["+420"] and this gateway allows sending messages to an operator who owns prefixes "606" and "777", then the resulting array of preferred prefixes is ["+420606", "+420777"].
 * @return list of preferred prefixes; empty array if gateway sends to any phone numberin supported prefixes
 */
String[] getPreferredPrefixes();
Program: 152096
Project: 152096
Buggy source:
/** 
 * Install support for main frame. It will add unified l&f for toolbar, drag support for it and removes text from buttons.
 */
public static void installSupport(){
  Context.mainFrame.addWindowFocusListener(new UnifiedToolbarWindowAdapter());
  JToolBar toolbar=Context.mainFrame.getToolbar();
  toolbar.setDoubleBuffered(true);
  MouseDragSupport support=new MouseDragSupport();
  toolbar.addMouseListener(support);
  toolbar.addMouseMotionListener(support);
  for (  Component c : toolbar.getComponents()) {
    if (c instanceof JButton) {
      JButton button=(JButton)c;
      button.setBorderPainted(false);
      button.setText(null);
    }
  }
}

Fixed version (ground truth):
/** 
 * Install support for main frame. It will add unified L&amp;F for toolbar, drag support for it and removes text from buttons.
 */
public static void installSupport(){
  Context.mainFrame.addWindowFocusListener(new UnifiedToolbarWindowAdapter());
  JToolBar toolbar=Context.mainFrame.getToolbar();
  toolbar.setDoubleBuffered(true);
  MouseDragSupport support=new MouseDragSupport();
  toolbar.addMouseListener(support);
  toolbar.addMouseMotionListener(support);
  for (  Component c : toolbar.getComponents()) {
    if (c instanceof JButton) {
      JButton button=(JButton)c;
      button.setBorderPainted(false);
      button.setText(null);
    }
  }
}
Program: 152097
Project: 152097
Buggy source:
/** 
 * Escape text using html entities. Fixes bug in OpenJDK where scaron entity is not replaced by 'š' and euro by '€'.
 * @see ​StringEscapeUtils#escapeHtml(String)
 */
public static String escapeHtml(String input){
  if (input == null) {
    return input;
  }
  String output=StringEscapeUtils.escapeHtml(input);
  output=output.replaceAll("String_Node_Str","String_Node_Str");
  output=output.replaceAll("String_Node_Str","String_Node_Str");
  output=output.replaceAll("String_Node_Str","String_Node_Str");
  return output;
}

Fixed version (ground truth):
/** 
 * Escape text using html entities. Fixes bug in OpenJDK where scaron entity is not replaced by 'š' and euro by '€'.
 * @see StringEscapeUtils#escapeHtml(String)
 */
public static String escapeHtml(String input){
  if (input == null) {
    return input;
  }
  String output=StringEscapeUtils.escapeHtml(input);
  output=output.replaceAll("String_Node_Str","String_Node_Str");
  output=output.replaceAll("String_Node_Str","String_Node_Str");
  output=output.replaceAll("String_Node_Str","String_Node_Str");
  return output;
}