nus-yam/ex-repair huggingface dataset:
Program: 16367
Project: 16367
Buggy source:
public Object clone(){
  final Grid clone=(Grid)super.clone();
  clone.init();
  clone._pgListener=null;
  clone._pgImpListener=null;
  final int offset=clone.getDataLoader().getOffset();
  final int limit=clone.getDataLoader().getLimit();
  clone.resetDataLoader();
  clone.getDataLoader().init(clone,offset,limit);
  int cnt=0;
  if (clone._rows != null)   ++cnt;
  if (clone._cols != null)   ++cnt;
  if (clone._foot != null)   ++cnt;
  if (clone._frozen != null)   ++cnt;
  if (clone._paging != null)   ++cnt;
  if (cnt > 0)   clone.afterUnmarshal(cnt);
  if (clone._model != null) {
    if (clone._model instanceof ComponentCloneListener) {
      final ListModel model=(ListModel)((ComponentCloneListener)clone._model).willClone(clone);
      if (model != null)       clone._model=model;
    }
    clone._dataListener=null;
    clone.initDataListener();
    clone.getDataLoader().setLoadAll(_renderAll);
  }
  return clone;
}

Fixed version (ground truth):
public Object clone(){
  final Grid clone=(Grid)super.clone();
  clone.init();
  clone._pgListener=null;
  clone._pgImpListener=null;
  final int offset=clone.getDataLoader().getOffset();
  int cnt=0;
  if (clone._rows != null)   ++cnt;
  if (clone._cols != null)   ++cnt;
  if (clone._foot != null)   ++cnt;
  if (clone._frozen != null)   ++cnt;
  if (clone._paging != null)   ++cnt;
  if (cnt > 0)   clone.afterUnmarshal(cnt);
  final int limit=clone.getDataLoader().getLimit();
  clone.resetDataLoader(false);
  clone.getDataLoader().init(clone,offset,limit);
  if (clone._model != null) {
    if (clone._model instanceof ComponentCloneListener) {
      final ListModel model=(ListModel)((ComponentCloneListener)clone._model).willClone(clone);
      if (model != null)       clone._model=model;
    }
    clone._dataListener=null;
    clone.initDataListener();
    clone.getDataLoader().setLoadAll(_renderAll);
  }
  return clone;
}
Program: 16368
Project: 16368
Buggy source:
private synchronized void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException {
  s.defaultReadObject();
  _model=(ListModel)s.readObject();
  didDeserialize(_model);
  _renderer=(ListitemRenderer)s.readObject();
  didDeserialize(_renderer);
  init();
  afterUnmarshal();
  if (_model != null) {
    initDataListener();
    getDataLoader().setLoadAll(_renderAll);
  }
  int size=s.readInt();
  if (size > 0) {
    List groupsInfo=(List)s.readObject();
    for (int i=0; i < size; i++)     _groupsInfo.add((int[])groupsInfo.get(i));
  }
}

Fixed version (ground truth):
private synchronized void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException {
  s.defaultReadObject();
  _model=(ListModel)s.readObject();
  didDeserialize(_model);
  _renderer=(ListitemRenderer)s.readObject();
  didDeserialize(_renderer);
  init();
  int offset=s.readInt();
  afterUnmarshal(offset);
  int limit=s.readInt();
  resetDataLoader(false);
  getDataLoader().init(this,offset,limit);
  if (_model != null) {
    initDataListener();
    getDataLoader().setLoadAll(_renderAll);
  }
  int size=s.readInt();
  if (size > 0) {
    List groupsInfo=(List)s.readObject();
    for (int i=0; i < size; i++)     _groupsInfo.add((int[])groupsInfo.get(i));
  }
}
Program: 16369
Project: 16369
Buggy source:
private void afterUnmarshal(){
  final int offset=getDataLoader().getOffset();
  int index=offset;
  for (Iterator it=getChildren().iterator(); it.hasNext(); ) {
    final Object child=it.next();
    if (child instanceof Listitem) {
      final Listitem li=(Listitem)child;
      li.setIndexDirectly(index++);
      if (li.isSelected()) {
        _selItems.add(li);
      }
    }
 else     if (child instanceof Listhead) {
      _listhead=(Listhead)child;
    }
 else     if (child instanceof Listfoot) {
      _listfoot=(Listfoot)child;
    }
 else     if (child instanceof Frozen) {
      _frozen=(Frozen)child;
    }
 else     if (child instanceof Paging) {
      _pgi=_paging=(Paging)child;
      addPagingListener(_pgi);
    }
  }
  final int limit=getDataLoader().getLimit();
  resetDataLoader();
  getDataLoader().init(this,offset,limit);
}

Fixed version (ground truth):
private void afterUnmarshal(int index){
  for (Iterator it=getChildren().iterator(); it.hasNext(); ) {
    final Object child=it.next();
    if (child instanceof Listitem) {
      final Listitem li=(Listitem)child;
      li.setIndexDirectly(index++);
      if (li.isSelected()) {
        _selItems.add(li);
      }
    }
 else     if (child instanceof Listhead) {
      _listhead=(Listhead)child;
    }
 else     if (child instanceof Listfoot) {
      _listfoot=(Listfoot)child;
    }
 else     if (child instanceof Frozen) {
      _frozen=(Frozen)child;
    }
 else     if (child instanceof Paging) {
      _pgi=_paging=(Paging)child;
      addPagingListener(_pgi);
    }
  }
}
Program: 16370
Project: 16370
Buggy source:
private void resetDataLoader(){
  if (_dataLoader != null) {
    _dataLoader.reset();
    _dataLoader=null;
    smartUpdate("String_Node_Str",0);
  }
  smartUpdate("String_Node_Str",true);
  _currentTop=0;
  _currentLeft=0;
  _topPad=0;
}

Fixed version (ground truth):
private void resetDataLoader(boolean shallReset){
  if (_dataLoader != null) {
    if (shallReset) {
      _dataLoader.reset();
      smartUpdate("String_Node_Str",0);
    }
    _dataLoader=null;
  }
  if (shallReset) {
    smartUpdate("String_Node_Str",true);
    _currentTop=0;
    _currentLeft=0;
    _topPad=0;
  }
}
Program: 16371
Project: 16371
Buggy source:
private synchronized void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
  s.defaultWriteObject();
  willSerialize(_model);
  Serializables.smartWrite(s,_model);
  willSerialize(_renderer);
  Serializables.smartWrite(s,_renderer);
  int size=_groupsInfo.size();
  s.writeInt(size);
  if (size > 0)   s.writeObject(_groupsInfo);
}

Fixed version (ground truth):
private synchronized void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
  s.defaultWriteObject();
  willSerialize(_model);
  Serializables.smartWrite(s,_model);
  willSerialize(_renderer);
  Serializables.smartWrite(s,_renderer);
  if (_dataLoader != null) {
    s.writeInt(_dataLoader.getOffset());
    s.writeInt(_dataLoader.getLimit());
  }
 else {
    s.writeInt(0);
    s.writeInt(100);
  }
  int size=_groupsInfo.size();
  s.writeInt(size);
  if (size > 0)   s.writeObject(_groupsInfo);
}
Program: 16372
Project: 16372
Buggy source:
public Object clone(){
  final Listbox clone=(Listbox)super.clone();
  clone.init();
  clone._pgListener=null;
  clone._pgImpListener=null;
  clone.afterUnmarshal();
  if (clone._model != null) {
    if (clone._model instanceof ComponentCloneListener) {
      final ListModel model=(ListModel)((ComponentCloneListener)clone._model).willClone(clone);
      if (model != null)       clone._model=model;
    }
    clone._dataListener=null;
    clone.initDataListener();
    clone.getDataLoader().setLoadAll(_renderAll);
  }
  clone._groupsInfo.addAll(_groupsInfo);
  return clone;
}

Fixed version (ground truth):
public Object clone(){
  final Listbox clone=(Listbox)super.clone();
  clone.init();
  clone._pgListener=null;
  clone._pgImpListener=null;
  final int offset=clone.getDataLoader().getOffset();
  clone.afterUnmarshal(offset);
  final int limit=clone.getDataLoader().getLimit();
  clone.resetDataLoader(false);
  clone.getDataLoader().init(clone,offset,limit);
  if (clone._model != null) {
    if (clone._model instanceof ComponentCloneListener) {
      final ListModel model=(ListModel)((ComponentCloneListener)clone._model).willClone(clone);
      if (model != null)       clone._model=model;
    }
    clone._dataListener=null;
    clone.initDataListener();
    clone.getDataLoader().setLoadAll(_renderAll);
  }
  clone._groupsInfo.addAll(_groupsInfo);
  return clone;
}
Program: 16373
Project: 16373
Buggy source:
private void afterUnmarshal(){
  Grid grid=getGrid();
  final int offset=grid != null ? grid.getDataLoader().getOffset() : 0;
  int index=offset;
  for (Iterator it=getChildren().iterator(); it.hasNext(); ) {
    ((Row)it.next()).setIndexDirectly(index++);
  }
}

Fixed version (ground truth):
private void afterUnmarshal(int index){
  for (Iterator it=getChildren().iterator(); it.hasNext(); ) {
    ((Row)it.next()).setIndexDirectly(index++);
  }
}
Program: 16374
Project: 16374
Buggy source:
private synchronized void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
  s.defaultWriteObject();
  int size=_groupsInfo.size();
  s.writeInt(size);
  if (size > 0)   s.writeObject(_groupsInfo);
}

Fixed version (ground truth):
private synchronized void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
  s.defaultWriteObject();
  int size=_groupsInfo.size();
  s.writeInt(size);
  if (size > 0)   s.writeObject(_groupsInfo);
  Grid grid=getGrid();
  DataLoader loader=grid != null ? grid.getDataLoader() : null;
  if (loader != null) {
    s.writeInt(loader.getOffset());
  }
 else   s.writeInt(0);
}
Program: 16375
Project: 16375
Buggy source:
private synchronized void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException {
  s.defaultReadObject();
  init();
  int size=s.readInt();
  if (size > 0) {
    List groupsInfo=(List)s.readObject();
    for (int i=0; i < size; i++)     _groupsInfo.add((int[])groupsInfo.get(i));
  }
  afterUnmarshal();
}

Fixed version (ground truth):
private synchronized void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException {
  s.defaultReadObject();
  init();
  int size=s.readInt();
  if (size > 0) {
    List groupsInfo=(List)s.readObject();
    for (int i=0; i < size; i++)     _groupsInfo.add((int[])groupsInfo.get(i));
  }
  int offset=s.readInt();
  afterUnmarshal(offset);
}
Program: 16376
Project: 16376
Buggy source:
public Object clone(){
  final Rows clone=(Rows)super.clone();
  clone.init();
  clone._groupsInfo.addAll(_groupsInfo);
  clone.afterUnmarshal();
  return clone;
}

Fixed version (ground truth):
public Object clone(){
  final Rows clone=(Rows)super.clone();
  clone.init();
  clone._groupsInfo.addAll(_groupsInfo);
  Grid grid=getGrid();
  final int offset=grid != null ? grid.getDataLoader().getOffset() : 0;
  clone.afterUnmarshal(offset);
  return clone;
}
Program: 16377
Project: 16377
Buggy source:
@Override public int[] getPath(TreeNode<E> child){
  final TreeNode<E> root=getRoot();
  List<Integer> p=new ArrayList<Integer>();
  while (root != child) {
    TreeNode<E> parent=child.getParent();
    for (int i=0, j=parent.getChildCount(); i < j; i++) {
      if (parent.getChildAt(i) == child) {
        p.add(0,i);
        break;
      }
    }
    child=parent;
  }
  final Integer[] objs=p.toArray(new Integer[p.size()]);
  final int[] path=new int[objs.length];
  for (int i=0; i < objs.length; i++)   path[i]=objs[i].intValue();
  return path;
}

Fixed version (ground truth):
@Override public int[] getPath(TreeNode<E> child){
  final TreeNode<E> root=getRoot();
  List<Integer> p=new ArrayList<Integer>();
  while (root != child) {
    TreeNode<E> parent=child.getParent();
    if (parent != null) {
      for (int i=0, j=parent.getChildCount(); i < j; i++) {
        if (parent.getChildAt(i) == child) {
          p.add(0,i);
          break;
        }
      }
      child=parent;
    }
  }
  final Integer[] objs=p.toArray(new Integer[p.size()]);
  final int[] path=new int[objs.length];
  for (int i=0; i < objs.length; i++)   path[i]=objs[i].intValue();
  return path;
}
Program: 16378
Project: 16378
Buggy source:
protected void addTemplateDependency(Component templateComp,final Component eachComp,Object data,final int index){
  Object old=null;
  Object oldStatus=null;
  try {
    old=eachComp.setAttribute(EACH_VAR,data);
    oldStatus=eachComp.setAttribute(EACH_STATUS_VAR,new AbstractIterationStatus(){
      private static final long serialVersionUID=1L;
      @Override public int getIndex(){
        return Integer.valueOf(index);
      }
    }
);
    final Binder binder=(Binder)eachComp.getAttribute(BinderImpl.BINDER,true);
    final TemplateResolver resolver=((BinderCtrl)binder).getTemplateResolver(templateComp,_attributeName);
    resolver.addTemplateDependency(eachComp);
  }
  finally {
    eachComp.setAttribute(EACH_STATUS_VAR,oldStatus);
    eachComp.setAttribute(TemplateResolver.EACH_VAR,old);
  }
}

Fixed version (ground truth):
protected void addTemplateDependency(Component templateComp,final Component eachComp,Object data,final int index){
  final Binder binder=(Binder)eachComp.getAttribute(BinderImpl.BINDER,true);
  final TemplateResolver resolver=((BinderCtrl)binder).getTemplateResolver(templateComp,_attributeName);
  if (resolver == null)   return;
  Object old=null;
  Object oldStatus=null;
  try {
    old=eachComp.setAttribute(EACH_VAR,data);
    oldStatus=eachComp.setAttribute(EACH_STATUS_VAR,new AbstractIterationStatus(){
      private static final long serialVersionUID=1L;
      @Override public int getIndex(){
        return Integer.valueOf(index);
      }
    }
);
    resolver.addTemplateDependency(eachComp);
  }
  finally {
    eachComp.setAttribute(EACH_STATUS_VAR,oldStatus);
    eachComp.setAttribute(TemplateResolver.EACH_VAR,old);
  }
}
Program: 16379
Project: 16379
Buggy source:
public Object coerceToBean(Object val,Component comp,BindContext ctx){
  if (val != null) {
    final Combobox lbx=(Combobox)comp;
    final ListModel<?> model=lbx.getModel();
    if (model != null) {
      final String varnm=(String)lbx.getAttribute("String_Node_Str");
      if (varnm != null) {
        return ((Comboitem)val).getAttribute(varnm);
      }
 else {
        return model.getElementAt(((Comboitem)val).getIndex());
      }
    }
 else {
      return ((Comboitem)val).getValue();
    }
  }
  return null;
}

Fixed version (ground truth):
public Object coerceToBean(Object val,Component comp,BindContext ctx){
  if (val != null) {
    final Combobox lbx=(Combobox)comp;
    final ListModel<?> model=lbx.getModel();
    if (model != null) {
      final String varnm=(String)((Comboitem)val).getAttribute(BinderImpl.VAR);
      if (varnm != null) {
        return ((Comboitem)val).getAttribute(varnm);
      }
 else {
        return model.getElementAt(((Comboitem)val).getIndex());
      }
    }
 else {
      return ((Comboitem)val).getValue();
    }
  }
  return null;
}
Program: 16380
Project: 16380
Buggy source:
public Object coerceToBean(Object val,Component comp,BindContext ctx){
  if (val != null) {
    final Listbox lbx=(Listbox)comp;
    final ListModel<?> model=lbx.getModel();
    if (model != null) {
      final String varnm=(String)lbx.getAttribute(BinderImpl.VAR);
      if (varnm != null) {
        return ((Listitem)val).getAttribute(varnm);
      }
 else {
        return model.getElementAt(((Listitem)val).getIndex());
      }
    }
 else {
      return ((Listitem)val).getValue();
    }
  }
  return null;
}

Fixed version (ground truth):
public Object coerceToBean(Object val,Component comp,BindContext ctx){
  if (val != null) {
    final Listbox lbx=(Listbox)comp;
    final ListModel<?> model=lbx.getModel();
    if (model != null) {
      final String varnm=(String)((Listitem)val).getAttribute(BinderImpl.VAR);
      if (varnm != null) {
        return ((Listitem)val).getAttribute(varnm);
      }
 else {
        return model.getElementAt(((Listitem)val).getIndex());
      }
    }
 else {
      return ((Listitem)val).getValue();
    }
  }
  return null;
}
Program: 16381
Project: 16381
Buggy source:
public Object coerceToBean(Object val,Component comp,BindContext ctx){
  if (val != null) {
    final Tree tree=(Tree)comp;
    final TreeModel<?> model=tree.getModel();
    if (model != null) {
      final String varnm=(String)tree.getAttribute("String_Node_Str");
      if (varnm != null) {
        return ((Treeitem)val).getAttribute(varnm);
      }
 else {
        return ((Treeitem)val).getValue();
      }
    }
 else {
      return ((Treeitem)val).getValue();
    }
  }
  return null;
}

Fixed version (ground truth):
public Object coerceToBean(Object val,Component comp,BindContext ctx){
  if (val != null) {
    final Tree tree=(Tree)comp;
    final TreeModel<?> model=tree.getModel();
    if (model != null) {
      final String varnm=(String)((Treeitem)val).getAttribute(BinderImpl.VAR);
      if (varnm != null) {
        return ((Treeitem)val).getAttribute(varnm);
      }
 else {
        return ((Treeitem)val).getValue();
      }
    }
 else {
      return ((Treeitem)val).getValue();
    }
  }
  return null;
}
Program: 16382
Project: 16382
Buggy source:
@Override public void removeOpenPaths(int[][] paths){
  int newPathLength=paths != null ? paths.length : 0;
  if (newPathLength > 0 && !_opens.isEmpty()) {
    for (    TreeNode<E> e : getNodesByPath(paths)) {
      if (_opens.remove(e)) {
        fireOpenChanged(e);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void removeOpenPaths(int[][] paths){
  int newPathLength=paths != null ? paths.length : 0;
  if (newPathLength > 0 && !_opens.isEmpty()) {
    for (    TreeNode<E> e : getNodesByPath(paths)) {
      if (_opens.containsKey(e)) {
        _opens.remove(e);
        fireOpenChanged(e);
      }
    }
  }
}
Program: 16383
Project: 16383
Buggy source:
@Override public void removeSelectionPaths(int[][] paths){
  int newPathLength=paths != null ? paths.length : 0;
  if (newPathLength > 0 && !_selections.isEmpty()) {
    for (    TreeNode<E> e : getNodesByPath(paths)) {
      if (_selections.remove(e)) {
        fireSelectionChanged(e);
      }
      if (!isMultiple())       break;
    }
  }
}

Fixed version (ground truth):
@Override public void removeSelectionPaths(int[][] paths){
  int newPathLength=paths != null ? paths.length : 0;
  if (newPathLength > 0 && !_selections.isEmpty()) {
    for (    TreeNode<E> e : getNodesByPath(paths)) {
      if (_selections.containsKey(e)) {
        _selections.remove(e);
        fireSelectionChanged(e);
      }
      if (!isMultiple())       break;
    }
  }
}
Program: 16384
Project: 16384
Buggy source:
@SuppressWarnings("String_Node_Str") private void render(Treeitem item,Object node) throws Throwable {
  if (!_rendered && (_renderer instanceof RendererCtrl)) {
    ((RendererCtrl)_renderer).doTry();
    _ctrled=true;
  }
  if (node instanceof TreeNode) {
    TreeNode treeNode=(TreeNode)node;
    item.setTreeNode(treeNode);
  }
  int[] path=null;
  if (_model instanceof TreeSelectionModel) {
    TreeSelectionModel model=(TreeSelectionModel)_model;
    if (!model.isSelectionEmpty()) {
      if (model.isPathSelected((path=_model.getPath(node)))) {
        addItemToSelection(item);
      }
    }
  }
  if (_model instanceof TreeOpenableModel) {
    TreeOpenableModel model=(TreeOpenableModel)_model;
    if (!model.isOpenEmpty()) {
      if (path == null) {
        path=_model.getPath(node);
      }
      item.setOpen(model.isPathOpened(path));
    }
  }
  try {
    _renderer.render(item,node);
  }
 catch (  Throwable ex) {
    try {
      item.setLabel(Exceptions.getMessage(ex));
    }
 catch (    Throwable t) {
      log.error(t);
    }
    throw ex;
  }
  _rendered=true;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void render(Treeitem item,Object node) throws Throwable {
  if (!_rendered && (_renderer instanceof RendererCtrl)) {
    ((RendererCtrl)_renderer).doTry();
    _ctrled=true;
  }
  TreeNode treeNode=null;
  if (node instanceof TreeNode) {
    treeNode=(TreeNode)node;
    item.setTreeNode(treeNode);
  }
  int[] path=null;
  if (_model instanceof TreeSelectionModel) {
    TreeSelectionModel model=(TreeSelectionModel)_model;
    if (!model.isSelectionEmpty() && getSelectedCount() != model.getSelectionCount()) {
      if (model.isPathSelected((path=_model.getPath(node)))) {
        addItemToSelection(item);
      }
    }
  }
  if (_model instanceof TreeOpenableModel) {
    TreeOpenableModel model=(TreeOpenableModel)_model;
    if (!model.isOpenEmpty()) {
      boolean isLeaf=treeNode != null ? treeNode.isLeaf() : false;
      if (!isLeaf) {
        if (path == null) {
          path=_model.getPath(node);
        }
        item.setOpen(model.isPathOpened(path));
      }
    }
  }
  try {
    _renderer.render(item,node);
  }
 catch (  Throwable ex) {
    try {
      item.setLabel(Exceptions.getMessage(ex));
    }
 catch (    Throwable t) {
      log.error(t);
    }
    throw ex;
  }
  _rendered=true;
}
Program: 16385
Project: 16385
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public Object clone(){
  GroupsModelArray clone=(GroupsModelArray)super.clone();
  if (_nativedata != null)   clone._nativedata=ArraysX.clone(_nativedata);
  if (_data != null)   clone._data=ArraysX.clone(_data);
  if (_heads != null)   clone._heads=ArraysX.clone(_heads);
  if (_foots != null)   clone._foots=ArraysX.clone(_foots);
  if (_closes != null)   clone._closes=(boolean[])ArraysX.clone(_closes);
  return clone;
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public Object clone(){
  GroupsModelArray clone=(GroupsModelArray)super.clone();
  if (_nativedata != null)   clone._nativedata=ArraysX.duplicate(_nativedata);
  if (_data != null)   clone._data=ArraysX.duplicate(_data);
  if (_heads != null)   clone._heads=ArraysX.duplicate(_heads);
  if (_foots != null)   clone._foots=ArraysX.duplicate(_foots);
  if (_closes != null)   clone._closes=(boolean[])ArraysX.clone(_closes);
  return clone;
}
Program: 16386
Project: 16386
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public Object clone(){
  ListModelArray clone=(ListModelArray)super.clone();
  if (_array != null)   clone._array=ArraysX.clone(_array);
  return clone;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public Object clone(){
  ListModelArray clone=(ListModelArray)super.clone();
  if (_array != null)   clone._array=ArraysX.duplicate(_array);
  return clone;
}
Program: 16387
Project: 16387
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public Object clone(){
  SimpleGroupsModel clone=(SimpleGroupsModel)super.clone();
  if (_data != null)   clone._data=ArraysX.clone(_data);
  if (_heads != null)   clone._heads=ArraysX.clone(_heads);
  if (_foots != null)   clone._foots=ArraysX.clone(_foots);
  if (_closes != null)   clone._closes=(boolean[])ArraysX.clone(_closes);
  return clone;
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public Object clone(){
  SimpleGroupsModel clone=(SimpleGroupsModel)super.clone();
  if (_data != null)   clone._data=ArraysX.duplicate(_data);
  if (_heads != null)   clone._heads=ArraysX.duplicate(_heads);
  if (_foots != null)   clone._foots=ArraysX.duplicate(_foots);
  if (_closes != null)   clone._closes=(boolean[])ArraysX.duplicate(_closes);
  return clone;
}
Program: 16388
Project: 16388
Buggy source:
public void onChange(ListDataEvent event){
  postOnInitRender(null);
}

Fixed version (ground truth):
public void onChange(ListDataEvent event){
  if (event.getType() == ListDataEvent.SELECTION_CHANGED) {
    int start=event.getIndex0();
    int end=event.getIndex1();
    if (end < getItemCount()) {
      if (_model instanceof ListSelectionModel) {
        ListSelectionModel smodel=(ListSelectionModel)_model;
        if (!smodel.isSelectionEmpty()) {
          for (; start <= end; start++) {
            if (smodel.isSelectedIndex(start))             setSelectedIndex(start);
          }
        }
 else         setSelectedIndex(-1);
        return;
      }
    }
  }
  postOnInitRender(null);
}
Program: 16389
Project: 16389
Buggy source:
private void initDataListener(){
  if (_dataListener == null)   _dataListener=new ListDataListener(){
    public void onChange(    ListDataEvent event){
      postOnInitRender(null);
    }
  }
;
  if (_eventListener == null)   _eventListener=new EventListener<InputEvent>(){
    public void onEvent(    InputEvent event) throws Exception {
      if (getModel() instanceof ListSubModel) {
        if (!event.isChangingBySelectBack())         postOnInitRender(event.getValue());
      }
    }
  }
;
  _model.addListDataListener(_dataListener);
  if (_model instanceof ListSubModel)   addEventListener(Events.ON_CHANGING,_eventListener);
}

Fixed version (ground truth):
private void initDataListener(){
  if (_dataListener == null)   _dataListener=new ListDataListener(){
    public void onChange(    ListDataEvent event){
      if (event.getType() == ListDataEvent.SELECTION_CHANGED) {
        int start=event.getIndex0();
        int end=event.getIndex1();
        if (end < getItemCount()) {
          if (_model instanceof ListSelectionModel) {
            ListSelectionModel smodel=(ListSelectionModel)_model;
            if (!smodel.isSelectionEmpty()) {
              for (; start <= end; start++) {
                if (smodel.isSelectedIndex(start))                 setSelectedIndex(start);
              }
            }
 else             setSelectedIndex(-1);
            return;
          }
        }
      }
      postOnInitRender(null);
    }
  }
;
  if (_eventListener == null)   _eventListener=new EventListener<InputEvent>(){
    public void onEvent(    InputEvent event) throws Exception {
      if (getModel() instanceof ListSubModel) {
        if (!event.isChangingBySelectBack())         postOnInitRender(event.getValue());
      }
    }
  }
;
  _model.addListDataListener(_dataListener);
  if (_model instanceof ListSubModel)   addEventListener(Events.ON_CHANGING,_eventListener);
}
Program: 16390
Project: 16390
Buggy source:
/** 
 * Deselects the currently selected items and selects the given item. <p>Note: if the label of comboitem has the same more than one, the first  comboitem will be selected at client side, it is a limitation of   {@link Combobox}and it is different from   {@link Listbox}.</p>
 * @since 3.0.2
 */
public void setSelectedItem(Comboitem item){
  if (item != null && item.getParent() != this)   throw new UiException("String_Node_Str" + item);
  if (item != _selItem) {
    _selItem=item;
    if (item != null) {
      setValue(item.getLabel());
    }
 else {
      if (_value != null && !"String_Node_Str".equals(_value)) {
        _value="String_Node_Str";
        smartUpdate("String_Node_Str",coerceToString(_value));
      }
    }
    _lastCkVal=getValue();
    syncSelectionToModel();
  }
}

Fixed version (ground truth):
/** 
 * Deselects the currently selected items and selects the given item. <p>Note: if the label of comboitem has the same more than one, the first  comboitem will be selected at client side, it is a limitation of   {@link Combobox}and it is different from   {@link Listbox}.</p>
 * @since 3.0.2
 */
public void setSelectedItem(Comboitem item){
  if (item != null && item.getParent() != this)   throw new UiException("String_Node_Str" + item);
  if (item != _selItem) {
    _selItem=item;
    if (item != null) {
      setValue(item.getLabel());
    }
 else {
      if (_value != null && !"String_Node_Str".equals(_value)) {
        _value="String_Node_Str";
        smartUpdate("String_Node_Str",coerceToString(_value));
      }
    }
    _lastCkVal=getValue();
  }
}
Program: 16391
Project: 16391
Buggy source:
private void syncSelectionToModel(){
  if (_model instanceof ListSelectionModel) {
    ListSelectionModel model=(ListSelectionModel)_model;
    model.clearSelection();
    if (_selItem != null) {
      int index=getChildren().indexOf(_selItem);
      model.addSelectionInterval(index,index);
    }
  }
}

Fixed version (ground truth):
private void syncSelectionToModel(){
  if (_model instanceof ListSelectionModel) {
    ListSelectionModel model=(ListSelectionModel)_model;
    if (_selItem != null) {
      int index=getChildren().indexOf(_selItem);
      model.addSelectionInterval(index,index);
    }
 else     model.clearSelection();
  }
}
Program: 16392
Project: 16392
Buggy source:
public void init(Component comp,Object vm){
  if (_init)   throw new UiException("String_Node_Str");
  _init=true;
  _rootComp=comp;
  setViewModel(vm);
  _dummyTarget.addEventListener(ON_POST_COMMAND,new PostCommandListener());
  subscribeChangeListener(_quename,_quescope,_queueListener);
  if (vm instanceof Composer<?> && !(vm instanceof BindComposer<?>)) {
    _log.warning("String_Node_Str",vm);
  }
  initViewModel(vm);
}

Fixed version (ground truth):
public void init(Component comp,Object vm){
  if (_init)   throw new UiException("String_Node_Str");
  _init=true;
  _rootComp=comp;
  setViewModel(vm);
  _dummyTarget.addEventListener(ON_POST_COMMAND,new PostCommandListener());
  _dummyTarget.addEventListener(ON_VMSGS_CHANGED,new VMsgsChangedListener());
  subscribeChangeListener(_quename,_quescope,_queueListener);
  if (vm instanceof Composer<?> && !(vm instanceof BindComposer<?>)) {
    _log.warning("String_Node_Str",vm);
  }
  initViewModel(vm);
}
Program: 16393
Project: 16393
Buggy source:
/** 
 * Clones the specified object. Use clone() if Cloeable. Otherwise, try to serialize/deserialize it by use of MarshalledObject. <p>If o is null, null is returned.
 * @exception SystemException if failed to clone
 */
public static final Object clone(Object o){
  if (o == null)   return o;
  try {
    final Class<?> kls=o.getClass();
    if (kls.isArray())     return ArraysX.clone(o);
    if (o instanceof Cloneable) {
      try {
        return kls.getMethod("String_Node_Str").invoke(o);
      }
 catch (      NoSuchMethodException ex) {
        if (log.debugable())         log.debug("String_Node_Str" + kls);
      }
    }
    return new MarshalledObject<Object>(o).get();
  }
 catch (  Exception ex) {
    throw SystemException.Aide.wrap(ex);
  }
}

Fixed version (ground truth):
/** 
 * Clones the specified object. Use clone() if Cloeable. Otherwise, try to serialize/deserialize it by use of MarshalledObject. <p>If o is null, null is returned.
 * @exception SystemException if failed to clone
 */
public static final Object clone(Object o){
  if (o == null)   return o;
  try {
    final Class<?> kls=o.getClass();
    if (kls.isArray())     return ArraysX.duplicate(o);
    if (o instanceof Cloneable) {
      try {
        return kls.getMethod("String_Node_Str").invoke(o);
      }
 catch (      NoSuchMethodException ex) {
        if (log.debugable())         log.debug("String_Node_Str" + kls);
      }
    }
    return new MarshalledObject<Object>(o).get();
  }
 catch (  Exception ex) {
    throw SystemException.Aide.wrap(ex);
  }
}
Program: 16394
Project: 16394
Buggy source:
/** 
 * @deprecated As of release 6.0.0, replaced with {@link duplicate(Object)}.
 */
public static final Object clone(Object ary){
  return duplicate(ary);
}

Fixed version (ground truth):
/** 
 * @deprecated As of release 6.0.0, replaced with {@link #duplicate(Object)}.
 */
public static final Object clone(Object ary){
  return duplicate(ary);
}
Program: 16395
Project: 16395
Buggy source:
@Override public boolean isPathOpened(int[] path){
  if (path != null && !_opens.isEmpty()) {
    E e=getNodeByPath(path);
    if (e != null)     return _opens.containsKey(e);
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean isPathOpened(int[] path){
  if (path != null && !_opens.isEmpty()) {
    E e=getChild(path);
    if (e != null)     return _opens.containsKey(e);
  }
  return false;
}
Program: 16396
Project: 16396
Buggy source:
@SuppressWarnings("String_Node_Str") private List<E> getNodesByPath(int[][] paths){
  if (paths == null)   return Collections.EMPTY_LIST;
  List<E> list=new ArrayList<E>();
  for (  int[] path : paths) {
    E node=getNodeByPath(path);
    if (node != null)     list.add(node);
  }
  return list;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private List<E> getNodesByPath(int[][] paths){
  if (paths == null)   return Collections.EMPTY_LIST;
  List<E> list=new ArrayList<E>();
  for (  int[] path : paths) {
    E node=getChild(path);
    if (node != null)     list.add(node);
  }
  return list;
}
Program: 16397
Project: 16397
Buggy source:
/** 
 * @deprecated As of release 5.0.6, it was replaced by{@link #getIndexOfChild}. This method was implemented to provide backward compatibility.
 */
@Deprecated @SuppressWarnings("String_Node_Str") public int[] getPath(Object parent,Object lastNode){
  return Tree.getPath((TreeModel)this,parent,lastNode);
}

Fixed version (ground truth):
/** 
 * Returns the path from a node
 * @since 6.0.0
 */
@SuppressWarnings("String_Node_Str") public int[] getPath(Object parent,Object lastNode){
  return Tree.getPath((TreeModel)this,parent,lastNode);
}
Program: 16398
Project: 16398
Buggy source:
@Override public boolean isPathSelected(int[] path){
  if (path != null && !_selections.isEmpty()) {
    E e=getNodeByPath(path);
    if (e != null)     return _selections.containsKey(e);
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean isPathSelected(int[] path){
  if (path != null && !_selections.isEmpty()) {
    E e=getChild(path);
    if (e != null)     return _selections.containsKey(e);
  }
  return false;
}
Program: 16399
Project: 16399
Buggy source:
@Override public Object clone(){
  DialModel clone=(DialModel)super.clone();
  if (_bgRGB != null)   clone._bgRGB=(int[])ArraysX.clone(_bgRGB);
  if (_bgRGB1 != null)   clone._bgRGB1=(int[])ArraysX.clone(_bgRGB1);
  if (_bgRGB2 != null)   clone._bgRGB2=(int[])ArraysX.clone(_bgRGB2);
  if (_fgRGB != null)   clone._fgRGB=(int[])ArraysX.clone(_fgRGB);
  return clone;
}

Fixed version (ground truth):
@Override public Object clone(){
  DialModel clone=(DialModel)super.clone();
  if (_bgRGB != null)   clone._bgRGB=(int[])ArraysX.duplicate(_bgRGB);
  if (_bgRGB1 != null)   clone._bgRGB1=(int[])ArraysX.duplicate(_bgRGB1);
  if (_bgRGB2 != null)   clone._bgRGB2=(int[])ArraysX.duplicate(_bgRGB2);
  if (_fgRGB != null)   clone._fgRGB=(int[])ArraysX.duplicate(_fgRGB);
  return clone;
}
Program: 16401
Project: 16401
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public Object clone(){
  GroupsModelArray clone=(GroupsModelArray)super.clone();
  if (_nativedata != null)   clone._nativedata=ArraysX.duplicate(_nativedata);
  if (_data != null)   clone._data=ArraysX.duplicate(_data);
  if (_heads != null)   clone._heads=ArraysX.duplicate(_heads);
  if (_foots != null)   clone._foots=ArraysX.duplicate(_foots);
  if (_closes != null)   clone._closes=(boolean[])ArraysX.clone(_closes);
  return clone;
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public Object clone(){
  GroupsModelArray clone=(GroupsModelArray)super.clone();
  if (_nativedata != null)   clone._nativedata=ArraysX.duplicate(_nativedata);
  if (_data != null)   clone._data=ArraysX.duplicate(_data);
  if (_heads != null)   clone._heads=ArraysX.duplicate(_heads);
  if (_foots != null)   clone._foots=ArraysX.duplicate(_foots);
  if (_closes != null)   clone._closes=(boolean[])ArraysX.duplicate(_closes);
  return clone;
}
Program: 16403
Project: 16403
Buggy source:
/** 
 * Opens the menupopup that belongs to the menu. <p> Note that this function is only applied when it is topmost menu, i.e. the parent of the menu is   {@link Menubar}
 * @since 6.0.0
 */
public void open(){
  if (this.getParent() instanceof Menubar)   response("String_Node_Str",new AuInvoke(this,"String_Node_Str",null));
}

Fixed version (ground truth):
/** 
 * Opens the menupopup that belongs to the menu. <p> Note that this function is only applied when it is topmost menu, i.e. the parent of the menu is   {@link Menubar}
 * @since 6.0.0
 */
public void open(){
  if (this.getParent() instanceof Menubar)   response("String_Node_Str",new AuInvoke(this,"String_Node_Str",(Object)null));
}
Program: 16404
Project: 16404
Buggy source:
private synchronized void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException {
  s.defaultReadObject();
  init();
  int size=s.readInt();
  if (size > 0) {
    List groupsInfo=(List)s.readObject();
    for (int i=0; i < size; i++)     _groupsInfo.add(groupsInfo.get(i));
  }
}

Fixed version (ground truth):
private synchronized void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException {
  s.defaultReadObject();
  init();
  int size=s.readInt();
  if (size > 0) {
    List groupsInfo=(List)s.readObject();
    for (int i=0; i < size; i++)     _groupsInfo.add((int[])groupsInfo.get(i));
  }
}
Program: 16405
Project: 16405
Buggy source:
public void setComponent(final Component comp){
  _paramResolvers.put(ScopeParam.class,new ParamResolver<Annotation>(){
    @Override public Object resolveParameter(    Annotation anno){
      final String name=((ScopeParam)anno).value();
      Scope[] ss=((ScopeParam)anno).scopes();
      List<Scope> scopes=new ArrayList<Scope>();
      for (      Scope s : ss) {
switch (s) {
case DEFAULT:
          scopes.addAll(Scope.getDefaultScopes());
        break;
case ALL:
      scopes.addAll(Scope.getAllScopes());
    break;
default :
  scopes.add(s);
}
}
Object val=null;
for (Scope scope : scopes) {
final String scopeName=scope.getName();
Object scopeObj=Components.getImplicit(comp,scopeName);
if (scopeObj instanceof Map) {
val=((Map<?,?>)scopeObj).get(name);
if (val != null) break;
}
 else if (scopeObj != null) {
_log.error("String_Node_Str" + scopeName + "String_Node_Str"+ scopeObj);
}
}
return val;
}
}
);
_paramResolvers.put(SelectorParam.class,new ParamResolver<Annotation>(){
@Override public Object resolveParameter(Annotation anno){
String selector=((SelectorParam)anno).value();
boolean local=((SelectorParam)anno).local();
int index=((SelectorParam)anno).index();
if (!local && _root == null) {
return null;
}
if (index < 0) {
return Selectors.find(local ? comp : _root,selector);
}
 else {
return Selectors.find(local ? comp : _root,selector,index);
}
}
}
);
}

Fixed version (ground truth):
public void setComponent(final Component comp){
  _paramResolvers.put(ScopeParam.class,new ParamResolver<Annotation>(){
    @Override public Object resolveParameter(    Annotation anno){
      final String name=((ScopeParam)anno).value();
      final Scope[] ss=((ScopeParam)anno).scopes();
      final List<Scope> scopes=new ArrayList<Scope>();
      for (      Scope s : ss) {
switch (s) {
case DEFAULT:
          scopes.addAll(Scope.getDefaultScopes());
        break;
case ALL:
      scopes.addAll(Scope.getAllScopes());
    break;
default :
  scopes.add(s);
}
}
Object val=null;
for (Scope scope : scopes) {
final String scopeName=scope.getName();
Object scopeObj=Components.getImplicit(comp,scopeName);
if (scopeObj instanceof Map) {
val=((Map<?,?>)scopeObj).get(name);
if (val != null) break;
}
 else if (scopeObj != null) {
_log.error("String_Node_Str" + scopeName + "String_Node_Str"+ scopeObj);
}
}
return val;
}
}
);
_paramResolvers.put(SelectorParam.class,new ParamResolver<Annotation>(){
@Override public Object resolveParameter(Annotation anno){
final String selector=((SelectorParam)anno).value();
final boolean local=((SelectorParam)anno).local();
final int index=((SelectorParam)anno).index();
if (!local && _root == null) {
return null;
}
if (index < 0) {
return Selectors.find(local ? comp : _root,selector);
}
 else {
return Selectors.find(local ? comp : _root,selector,index);
}
}
}
);
}
Program: 16406
Project: 16406
Buggy source:
public HtmlMacroComponent(){
  setAttribute("String_Node_Str",Boolean.TRUE);
  init();
  _resolvers=Selectors.newVariableResolvers(getClass());
  if (getAutowireFlag() == 0)   Selectors.wireVariables(this,this,_resolvers);
}

Fixed version (ground truth):
public HtmlMacroComponent(){
  setAttribute("String_Node_Str",Boolean.TRUE);
  init();
  _resolvers=Selectors.newVariableResolvers(getClass(),HtmlMacroComponent.class);
  if (getAutowireFlag() == 0)   Selectors.wireVariables(this,this,_resolvers);
}
Program: 16407
Project: 16407
Buggy source:
public SelectorComposer(){
  _resolvers=Selectors.newVariableResolvers(getClass());
}

Fixed version (ground truth):
public SelectorComposer(){
  _resolvers=Selectors.newVariableResolvers(getClass(),SelectorComposer.class);
}
Program: 16408
Project: 16408
Buggy source:
/** 
 * Creates a list of instances of   {@link VariableResolver} basedon the annotation of the given class. If none of annotataion is found, an empty list is returned.
 */
public static List<VariableResolver> newVariableResolvers(Class<?> cls){
  final List<VariableResolver> resolvers=new ArrayList<VariableResolver>();
  while (cls != SelectorComposer.class) {
    final org.zkoss.zk.ui.select.annotation.VariableResolver anno=cls.getAnnotation(org.zkoss.zk.ui.select.annotation.VariableResolver.class);
    if (anno != null)     for (    Class<? extends VariableResolver> rc : anno.value()) {
      try {
        resolvers.add(rc.getConstructor().newInstance());
      }
 catch (      Exception e) {
        throw UiException.Aide.wrap(e);
      }
    }
    cls=cls.getSuperclass();
  }
  return resolvers;
}

Fixed version (ground truth):
/** 
 * Creates a list of instances of   {@link VariableResolver} basedon the annotation of the given class. If none of annotataion is found, an empty list is returned.
 * @param cls the class to look for the annotation.
 * @param untilClass the class to stop the searching.By default, it will look for the annotation of the super class if not found. Ignored if null.
 */
public static List<VariableResolver> newVariableResolvers(Class<?> cls,Class<?> untilClass){
  final List<VariableResolver> resolvers=new ArrayList<VariableResolver>();
  while (cls != null && cls != untilClass) {
    final org.zkoss.zk.ui.select.annotation.VariableResolver anno=cls.getAnnotation(org.zkoss.zk.ui.select.annotation.VariableResolver.class);
    if (anno != null)     for (    Class<? extends VariableResolver> rc : anno.value()) {
      try {
        resolvers.add(rc.getConstructor().newInstance());
      }
 catch (      Exception e) {
        throw UiException.Aide.wrap(e);
      }
    }
    cls=cls.getSuperclass();
  }
  return resolvers;
}
Program: 16409
Project: 16409
Buggy source:
private void wireFellows(IdSpace idspace){
  final Collection fellows=idspace.getFellows();
  for (final Iterator it=fellows.iterator(); it.hasNext(); ) {
    final Component xcomp=(Component)it.next();
    injectFellow(xcomp);
  }
  IdSpace xidspace=idspace;
  if (xidspace instanceof Component) {
    wireController((Component)xidspace,((Component)idspace).getId());
    while (true) {
      final Component parent=((Component)xidspace).getParent();
      if (parent == null) {
        final Page page=((Component)xidspace).getPage();
        if (page != null)         injectFellow(page);
        break;
      }
      xidspace=parent.getSpaceOwner();
      injectFellow(xidspace);
    }
  }
 else {
    wireController((Page)xidspace,((Component)idspace).getId());
    injectFellow((Page)idspace);
  }
}

Fixed version (ground truth):
private void wireFellows(final IdSpace idspace){
  final Collection fellows=idspace.getFellows();
  for (final Iterator it=fellows.iterator(); it.hasNext(); ) {
    final Component xcomp=(Component)it.next();
    injectFellow(xcomp);
  }
  if (idspace instanceof Component) {
    wireController((Component)idspace,((Component)idspace).getId());
    for (IdSpace xidspace=idspace; ; ) {
      final Component parent=((Component)xidspace).getParent();
      if (parent == null) {
        final Page page=((Component)xidspace).getPage();
        if (page != null)         injectFellow(page);
        break;
      }
      xidspace=parent.getSpaceOwner();
      injectFellow(xidspace);
    }
  }
 else {
    injectFellow((Page)idspace);
  }
}
Program: 16410
Project: 16410
Buggy source:
private void addBinding(Component comp,String attr,Binding binding){
  Map<String,List<Binding>> attrMap=_bindings.get(comp);
  if (attrMap == null) {
    attrMap=new HashMap<String,List<Binding>>();
    _bindings.put(comp,attrMap);
  }
  List<Binding> bindings=attrMap.get(attr);
  if (bindings == null) {
    bindings=new ArrayList<Binding>();
    attrMap.put(attr,bindings);
  }
  bindings.add(binding);
  comp.setAttribute(BINDER,this);
}

Fixed version (ground truth):
private void addBinding(Component comp,String attr,Binding binding){
  Map<String,List<Binding>> attrMap=_bindings.get(comp);
  if (attrMap == null) {
    attrMap=new LinkedHashMap<String,List<Binding>>();
    _bindings.put(comp,attrMap);
  }
  List<Binding> bindings=attrMap.get(attr);
  if (bindings == null) {
    bindings=new ArrayList<Binding>();
    attrMap.put(attr,bindings);
  }
  bindings.add(binding);
  comp.setAttribute(BINDER,this);
}
Program: 16411
Project: 16411
Buggy source:
private static String getThemeString(){
  return Library.getProperty(THEME_NAMES_KEY);
}

Fixed version (ground truth):
private static String getThemeString(){
  return Library.getProperty(THEME_NAMES_KEY,"String_Node_Str");
}
Program: 16412
Project: 16412
Buggy source:
public void onAfterRender$themeSelectListbox(Event event){
  String name=Themes.getCurrentTheme();
  List chd=themeSelectListbox.getItems();
  for (int i=0; i < chd.size(); i++) {
    Listitem item=(Listitem)chd.get(i);
    if (name.equals(item.getValue())) {
      themeSelectListbox.setSelectedItem(item);
      break;
    }
  }
}

Fixed version (ground truth):
public void onAfterRender$themeSelectListbox(Event event){
  String name=Themes.getCurrentTheme();
  if (Strings.isEmpty(name))   return;
  List chd=themeSelectListbox.getItems();
  for (int i=0; i < chd.size(); i++) {
    Listitem item=(Listitem)chd.get(i);
    if (name.equals(item.getValue())) {
      themeSelectListbox.setSelectedItem(item);
      break;
    }
  }
}
Program: 16413
Project: 16413
Buggy source:
/** 
 * Returns the annotation associated with the specified property, or null if not available.
 * @param annotName the annotation name
 * @param propName the property name, e.g., "value".If null, this method returns the annotation(s) associated with the component (rather than a particular property).
 */
public Annotation getAnnotation(String propName,String annotName){
  if (_annots != null) {
    final Map<String,List<Annotation>> anmap=_annots.get(propName);
    if (anmap != null) {
      List<Annotation> ans=anmap.get(annotName);
      if (ans != null) {
        if (ans.size() == 1)         return ans.get(0);
        final AnnotImpl ai=new AnnotImpl(annotName);
        for (        Annotation an : ans)         ai.addAttributes(an);
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns the annotation associated with the specified property, or null if not available.
 * @param annotName the annotation name
 * @param propName the property name, e.g., "value".If null, this method returns the annotation(s) associated with the component (rather than a particular property).
 */
public Annotation getAnnotation(String propName,String annotName){
  if (_annots != null) {
    final Map<String,List<Annotation>> anmap=_annots.get(propName);
    if (anmap != null) {
      List<Annotation> ans=anmap.get(annotName);
      if (ans != null) {
        if (ans.size() == 1)         return ans.get(0);
        final AnnotImpl ai=new AnnotImpl(annotName);
        for (        Annotation an : ans)         ai.addAttributes(an);
        return ai;
      }
    }
  }
  return null;
}