nus-yam/ex-repair huggingface dataset:
Program: 19558
Project: 19558
Buggy source:
@Override public ComponentWrapper wrapperFor(Collection<?> wrapped,Object proxy){
  CollectionWrapper wrapper=new CollectionWrapper(wrapped,proxy);
  return wrapper;
}

Fixed version (ground truth):
@Override public ComponentWrapper wrapperFor(Collection<E> wrapped,Object proxy){
  CollectionWrapper<E> wrapper=new CollectionWrapper<E>(wrapped,proxy);
  return wrapper;
}
Program: 19559
Project: 19559
Buggy source:
public void set(String name,String key,Object value){
  getDynaBean().set(name,key,value);
}

Fixed version (ground truth):
@Override public void set(String name,String key,Object value){
  getDynaBean().set(name,key,value);
}
Program: 19560
Project: 19560
Buggy source:
public void remove(String name,String key){
  getDynaBean().remove(name,key);
}

Fixed version (ground truth):
@Override public boolean remove(Object o){
  return wrapped.remove(o);
}
Program: 19561
Project: 19561
Buggy source:
/** 
 * Constructor.
 * @param collection
 * @param proxy
 */
public CollectionWrapper(Collection<?> collection,Object proxy){
  this.proxy=proxy;
  this.wrapped=collection;
  this.dynaBean=new WrapDynaBean(wrapped);
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param collection
 * @param proxy
 */
public CollectionWrapper(Collection<E> collection,Object proxy){
  this.proxy=proxy;
  this.wrapped=collection;
  this.dynaBean=new WrapDynaBean(wrapped);
}
Program: 19562
Project: 19562
Buggy source:
@Override public void busStarting(BusEvent event) throws BusCrashException {
  iconHelper.changeIcon(ACTIVE);
}

Fixed version (ground truth):
@Override public void busStarting(BusEvent event) throws BusCrashException {
  busCrashException=null;
  iconHelper.changeIcon(ACTIVE);
}
Program: 19563
Project: 19563
Buggy source:
public boolean contains(String name,String key){
  return getDynaBean().contains(name,key);
}

Fixed version (ground truth):
@Override public boolean contains(Object o){
  return wrapped.contains(o);
}
Program: 19564
Project: 19564
Buggy source:
public boolean equals(Object other){
  return other == getProxy();
}

Fixed version (ground truth):
@Override public boolean equals(Object other){
  return other == getProxy();
}
Program: 19565
Project: 19565
Buggy source:
public Object get(String name,String key){
  return getDynaBean().get(name,key);
}

Fixed version (ground truth):
@Override public Object get(String name,String key){
  return getDynaBean().get(name,key);
}
Program: 19566
Project: 19566
Buggy source:
public DynaClass getDynaClass(){
  return getDynaBean().getDynaClass();
}

Fixed version (ground truth):
@Override public DynaClass getDynaClass(){
  return getDynaBean().getDynaClass();
}
Program: 19567
Project: 19567
Buggy source:
public String toString(){
  return getWrapped().toString();
}

Fixed version (ground truth):
@Override public String toString(){
  return getWrapped().toString();
}
Program: 19569
Project: 19569
Buggy source:
protected void doStop(final WhyStop why,final Exception cause) throws JMException, IOException {
  onStop(why);
  notificationProcessor.shutdownNow();
  notificationProcessor=null;
  if (why != WhyStop.HEARTBEAT_FAILURE) {
    serverStoppedListener.remove();
    if (cntor != null) {
      cntor.close();
    }
  }
  stateHandler.waitToWhen(new IsStoppable(),new Runnable(){
    public void run(){
switch (why) {
case HEARTBEAT_FAILURE:
        getStateChanger().setStateException(cause);
      logger().error("String_Node_Str",cause);
    break;
case SERVER_STOPPED:
  getStateChanger().setStateException(new Exception("String_Node_Str"));
logger().info("String_Node_Str");
break;
default :
getStateChanger().setState(ServiceState.COMPLETE);
logger().info("String_Node_Str");
}
}
}
);
}

Fixed version (ground truth):
protected void doStop(final WhyStop why,final Exception cause){
  ServerStoppedListener serverStoppedListener;
synchronized (this) {
    serverStoppedListener=this.serverStoppedListener;
    if (serverStoppedListener == null) {
      return;
    }
    this.serverStoppedListener=null;
  }
  if (why == WhyStop.STOP_REQUEST) {
    serverStoppedListener.remove();
  }
  onStop(why);
  notificationProcessor.shutdownNow();
  notificationProcessor=null;
  if (why == WhyStop.STOP_REQUEST && cntor != null) {
    try {
      cntor.close();
    }
 catch (    IOException e) {
      logger.debug("String_Node_Str" + e);
    }
  }
  cntor=null;
  stateHandler.waitToWhen(new IsStoppable(),new Runnable(){
    public void run(){
switch (why) {
case HEARTBEAT_FAILURE:
        getStateChanger().setStateException(cause);
      logger().error("String_Node_Str",cause);
    break;
case SERVER_STOPPED:
  getStateChanger().setStateException(new Exception("String_Node_Str"));
logger().info("String_Node_Str");
break;
default :
getStateChanger().setState(ServiceState.COMPLETE);
logger().info("String_Node_Str");
}
}
}
);
}
Program: 19570
Project: 19570
Buggy source:
public void remove() throws JMException, IOException {
  mbsc.removeNotificationListener(new ObjectName("String_Node_Str"),this);
}

Fixed version (ground truth):
public void remove(){
  try {
    mbsc.removeNotificationListener(new ObjectName("String_Node_Str"),this);
  }
 catch (  Exception e) {
    logger.debug("String_Node_Str" + e);
  }
}
Program: 19572
Project: 19572
Buggy source:
synchronized public void jobStateChange(StateEvent event){
synchronized (states) {
    states.add(event.getState());
    stateHandler().waitToWhen(new IsAnyState(),new Runnable(){
      public void run(){
        stateHandler.wake();
      }
    }
);
  }
}

Fixed version (ground truth):
public void jobStateChange(StateEvent event){
synchronized (states) {
    states.add(event.getState());
    states.notifyAll();
  }
}
Program: 19573
Project: 19573
Buggy source:
private void completeConstruction(){
  this.dynaBean=new WrapDynaBean(wrapped);
  stateHandler=new JobStateHandler(this);
  stateChanger=new JobStateChanger(stateHandler,iconHelper,new Persistable(){
    @Override public void persist() throws ComponentPersistException {
      save();
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Complete construction. Called by constructor and post deserialisation.
 */
private void completeConstruction(){
  this.dynaBean=new WrapDynaBean(wrapped);
  stateHandler=new JobStateHandler((Stateful)proxy);
  stateChanger=new JobStateChanger(stateHandler,iconHelper,new Persistable(){
    @Override public void persist() throws ComponentPersistException {
      save();
    }
  }
);
}
Program: 19574
Project: 19574
Buggy source:
@Override protected void doStart(final MBeanServerConnection mbsc,ScheduledExecutorService notificationProcessor) throws IOException {
  SimpleMBeanSession session=new SimpleMBeanSession(getArooaSession(),mbsc);
  String[] domains=mbsc.getDomains();
  for (  String domain : domains) {
    DomainNode node=new SimpleDomainNode(domain,session);
    childHelper.addChild(node);
    node.initialise();
  }
  beanDirectory=new MBeanDirectory(session);
  notificationProcessor.scheduleAtFixedRate(new Runnable(){
    public void run(){
      try {
        int count=mbsc.getMBeanCount();
        logger().debug("String_Node_Str" + count);
      }
 catch (      Exception e) {
        try {
          doStop(WhyStop.HEARTBEAT_FAILURE,e);
        }
 catch (        Exception e1) {
          logger().error("String_Node_Str",e1);
        }
      }
    }
    @Override public String toString(){
      return "String_Node_Str";
    }
  }
,getHeartbeat(),getHeartbeat(),TimeUnit.MILLISECONDS);
}

Fixed version (ground truth):
@Override protected void doStart(final MBeanServerConnection mbsc,ScheduledExecutorService notificationProcessor) throws IOException {
  SimpleMBeanSession session=new SimpleMBeanSession(getArooaSession(),mbsc);
  beanDirectory=new MBeanDirectory(session);
  String[] domains=mbsc.getDomains();
  for (  String domain : domains) {
    DomainNode node=new SimpleDomainNode(domain,session);
    childHelper.addChild(node);
    node.initialise();
  }
  notificationProcessor.scheduleAtFixedRate(new Runnable(){
    public void run(){
      try {
        int count=mbsc.getMBeanCount();
        logger().debug("String_Node_Str" + count);
      }
 catch (      Exception e) {
        try {
          doStop(WhyStop.HEARTBEAT_FAILURE,e);
        }
 catch (        Exception e1) {
          logger().error("String_Node_Str",e1);
        }
      }
    }
    @Override public String toString(){
      return "String_Node_Str";
    }
  }
,getHeartbeat(),getHeartbeat(),TimeUnit.MILLISECONDS);
}
Program: 19575
Project: 19575
Buggy source:
@Override public void dispatch(StructuralListener listener){
  listener.childRemoved(event);
}

Fixed version (ground truth):
final void dispatch(StructuralListener listener){
  try {
    doDispatch(listener);
  }
 catch (  RuntimeException e) {
    logger.error("String_Node_Str" + getClass().getSimpleName() + "String_Node_Str"+ listener,e);
  }
}
Program: 19576
Project: 19576
Buggy source:
private void notifyChildRemoved(StructuralEvent event){
  List<StructuralListener> copy=null;
synchronized (missed) {
    copy=new ArrayList<StructuralListener>(listeners);
  }
  for (  StructuralListener l : copy) {
    l.childRemoved(event);
  }
}

Fixed version (ground truth):
private void notifyChildRemoved(StructuralEvent event){
  List<StructuralListener> copy=null;
synchronized (missed) {
    copy=new ArrayList<StructuralListener>(listeners);
  }
  for (  StructuralListener l : copy) {
    new ChildRemoved(event).dispatch(l);
  }
}
Program: 19577
Project: 19577
Buggy source:
/** 
 * Notify the listeners.
 * @param event The event.
 */
private void notifyChildAdded(StructuralEvent event){
  List<StructuralListener> copy=null;
synchronized (missed) {
    copy=new ArrayList<StructuralListener>(listeners);
  }
  for (  StructuralListener l : copy) {
    l.childAdded(event);
  }
}

Fixed version (ground truth):
/** 
 * Notify the listeners.
 * @param event The event.
 */
private void notifyChildAdded(StructuralEvent event){
  List<StructuralListener> copy=null;
synchronized (missed) {
    copy=new ArrayList<StructuralListener>(listeners);
  }
  for (  StructuralListener l : copy) {
    new ChildAdded(event).dispatch(l);
  }
}
Program: 19578
Project: 19578
Buggy source:
public void childAdded(StructuralEvent event){
  Object child=event.getChild();
  String name=child.toString();
  if (children.containsKey(name)) {
    throw new IllegalStateException();
  }
  children.put(name,child);
}

Fixed version (ground truth):
public void childAdded(StructuralEvent event){
  if (event.getSource() instanceof BeanDirectoryOwner) {
    BeanDirectoryOwner directoryOwner=(BeanDirectoryOwner)event.getSource();
    BeanDirectory directory=directoryOwner.provideBeanDirectory();
    if (directory == null) {
      throw new NullPointerException("String_Node_Str");
    }
  }
  Object child=event.getChild();
  String name=child.toString();
  if (children.containsKey(name)) {
    throw new IllegalStateException();
  }
  children.put(name,child);
}
Program: 19580
Project: 19580
Buggy source:
public void initialise(ComponentWrapper wrapper,Class<?>[] wrappingInterfaces,Object wrapped,Class<?>[] wrappedInterfaces){
  this.wrapper=wrapper;
  this.wrappingInterfaces=wrappingInterfaces;
  this.wrapped=wrapped;
  this.wrappedInterfaces=wrappedInterfaces;
  initialiseMethods();
}

Fixed version (ground truth):
/** 
 * Initialise the invocation handler.
 * @param wrapper The wrapper. Handles invocations for wrapping interfaces.
 * @param wrappingInterfaces The wrapping interfaces.
 * @param wrapped The component.
 * @param wrappedInterfaces The component interfaces.
 */
public void initialise(ComponentWrapper wrapper,Class<?>[] wrappingInterfaces,Object wrapped,Class<?>[] wrappedInterfaces){
  this.wrapper=wrapper;
  this.wrappingInterfaces=wrappingInterfaces;
  this.wrapped=wrapped;
  this.wrappedInterfaces=wrappedInterfaces;
  initialiseMethods();
}
Program: 19581
Project: 19581
Buggy source:
public static Class<?>[] interfacesFor(Object object){
  List<Class<?>> results=new ArrayList<Class<?>>();
  for (Class<?> cl=object.getClass(); cl != null; cl=cl.getSuperclass()) {
    results.addAll(Arrays.asList((Class<?>[])cl.getInterfaces()));
  }
  return (Class[])results.toArray(new Class[0]);
}

Fixed version (ground truth):
/** 
 * Find all the interfaces an object implements.
 * @param object The object.
 * @return All the interfaces it implements
 */
public static Class<?>[] interfacesFor(Object object){
  List<Class<?>> results=new ArrayList<Class<?>>();
  for (Class<?> cl=object.getClass(); cl != null; cl=cl.getSuperclass()) {
    results.addAll(Arrays.asList((Class<?>[])cl.getInterfaces()));
  }
  return (Class[])results.toArray(new Class[0]);
}
Program: 19582
Project: 19582
Buggy source:
/** 
 * Generate the proxy.
 * @param wrapped
 * @param wrapperFactory
 * @param classLoader
 * @return
 */
public Object generate(T wrapped,WrapperFactory<T> wrapperFactory,ClassLoader classLoader){
  Class<?>[] wrappedInterfaces=interfacesFor(wrapped);
  Class<?>[] wrappingInterfaces=wrapperFactory.wrappingInterfacesFor(wrapped);
  Set<Class<?>> proxyInterfaces=new HashSet<Class<?>>();
  proxyInterfaces.addAll(Arrays.asList(wrappedInterfaces));
  proxyInterfaces.addAll(Arrays.asList(wrappingInterfaces));
  proxyInterfaces.remove(Object.class);
  Class<?>[] interfaceArray=(Class[])proxyInterfaces.toArray(new Class[proxyInterfaces.size()]);
  DefaultInvocationHandler handler=new DefaultInvocationHandler();
  Object proxy=Proxy.newProxyInstance(classLoader,interfaceArray,handler);
  ComponentWrapper wrapper=wrapperFactory.wrapperFor(wrapped,proxy);
  handler.initialise(wrapper,wrappingInterfaces,wrapped,wrappedInterfaces);
  return proxy;
}

Fixed version (ground truth):
/** 
 * Generate the proxy.
 * @param wrapped The component being wrapped.
 * @param wrapperFactory
 * @param classLoader
 * @return A proxy implementing all the interface of factory andcomponent.
 */
public Object generate(T wrapped,WrapperFactory<T> wrapperFactory,ClassLoader classLoader){
  Object component;
  if (wrapped instanceof Adaptor) {
    component=((Adaptor)wrapped).getComponent();
  }
 else {
    component=wrapped;
  }
  Class<?>[] wrappedInterfaces=interfacesFor(component);
  Class<?>[] wrappingInterfaces=wrapperFactory.wrappingInterfacesFor(wrapped);
  Set<Class<?>> proxyInterfaces=new HashSet<Class<?>>();
  proxyInterfaces.addAll(Arrays.asList(wrappedInterfaces));
  proxyInterfaces.addAll(Arrays.asList(wrappingInterfaces));
  proxyInterfaces.remove(Object.class);
  Class<?>[] interfaceArray=(Class[])proxyInterfaces.toArray(new Class[proxyInterfaces.size()]);
  DefaultInvocationHandler handler=new DefaultInvocationHandler();
  Object proxy=Proxy.newProxyInstance(classLoader,interfaceArray,handler);
  ComponentWrapper wrapper=wrapperFactory.wrapperFor(wrapped,proxy);
  handler.initialise(wrapper,wrappingInterfaces,component,wrappedInterfaces);
  return proxy;
}
Program: 19583
Project: 19583
Buggy source:
/** 
 * The component being adapted.
 * @return The component.
 */
public Object getComponent();

Fixed version (ground truth):
/** 
 * The component being adapted.
 * @return The component.
 */
@Override public Object getComponent();
Program: 19584
Project: 19584
Buggy source:
/** 
 * Implement the schedule.
 */
public ScheduleResult nextDue(ScheduleContext context){
  Date now=context.getDate();
  logger.debug(this + "String_Node_Str" + now);
  if (schedule == null) {
    return null;
  }
  if (breaks == null) {
    return schedule.nextDue(context);
  }
  Date use=now;
  while (true) {
    if (use == null) {
      return null;
    }
    ScheduleResult next=schedule.nextDue(context.move(use));
    if (next == null) {
      return null;
    }
    Interval exclude=mergeBreaks(context.move(next.getFromDate()));
    if (exclude == null) {
      return next;
    }
    if (new IntervalHelper(next).isBefore(exclude)) {
      return next;
    }
    Date lastUse=use;
    if (next.getUseNext() == null) {
      use=null;
    }
 else {
      if (exclude.getToDate().after(next.getUseNext())) {
        use=exclude.getToDate();
      }
 else {
        use=next.getUseNext();
      }
    }
    if (alternative != null) {
      ScheduleResult alternativeResult=alternative.nextDue(context.spawn(lastUse,exclude));
      if (alternativeResult == null) {
        return null;
      }
      return new SimpleScheduleResult(alternativeResult,use);
    }
  }
}

Fixed version (ground truth):
/** 
 * Implement the schedule.
 */
public ScheduleResult nextDue(ScheduleContext context){
  Date now=context.getDate();
  logger.debug(this + "String_Node_Str" + now);
  if (schedule == null) {
    return null;
  }
  if (breaks == null) {
    return schedule.nextDue(context);
  }
  Date use=now;
  while (true) {
    if (use == null) {
      return null;
    }
    ScheduleResult next=schedule.nextDue(context.move(use));
    if (next == null) {
      return null;
    }
    Interval exclude=mergeBreaks(context.move(next.getFromDate()));
    if (exclude == null) {
      return next;
    }
    if (new IntervalHelper(next).isBefore(exclude)) {
      return next;
    }
    Date lastUse=use;
    if (next.getUseNext() == null) {
      use=null;
    }
 else {
      if (exclude.getToDate().after(next.getUseNext())) {
        use=exclude.getToDate();
      }
 else {
        use=next.getUseNext();
      }
    }
    if (alternative != null) {
      if (lastUse.before(exclude.getFromDate())) {
        lastUse=exclude.getFromDate();
      }
      ScheduleResult alternativeResult=alternative.nextDue(context.spawn(lastUse,exclude));
      if (alternativeResult != null) {
        return new SimpleScheduleResult(alternativeResult,use);
      }
    }
  }
}
Program: 19585
Project: 19585
Buggy source:
/** 
 * Calendar for the day of year.
 * @param referenceDate The date to take year from.
 * @param dayOfYear The day of the year.
 * @return The calendar.
 */
public static Calendar dayOfYear(Date referenceDate,int dayOfYear,TimeZone timeZone){
  Calendar c1=Calendar.getInstance();
  c1.setTimeZone(timeZone);
  c1.setTime(referenceDate);
  Calendar c2=Calendar.getInstance(timeZone);
  c2.clear();
  c2.set(Calendar.YEAR,c1.get(Calendar.YEAR));
  c2.set(Calendar.DAY_OF_YEAR,dayOfYear);
  return c2;
}

Fixed version (ground truth):
/** 
 * Calendar for the day of year.
 * @param referenceDate The date to take year from.
 * @param dayOfYear The day of the year.
 * @return The calendar.
 */
public Calendar dayOfYear(int dayOfMonth,int month){
  Calendar c2=Calendar.getInstance(baseCalendar.getTimeZone());
  c2.clear();
  c2.set(Calendar.YEAR,baseCalendar.get(Calendar.YEAR));
  c2.set(Calendar.DATE,dayOfMonth);
  c2.set(Calendar.MONTH,month - 1);
  return c2;
}
Program: 19586
Project: 19586
Buggy source:
/** 
 * Parse the day of the year.
 * @param text The day of the year
 * @param timeZone The time zone.
 * @return
 */
static int parseDay(String text,TimeZone timeZone) throws ParseException {
  SimpleDateFormat f=new SimpleDateFormat(DAY_FORMAT);
  f.setTimeZone(timeZone);
  Date d=f.parse(text);
  return DateUtils.dayOfYear(d,timeZone);
}

Fixed version (ground truth):
/** 
 * Parse the day of the year.
 * @param text The day of the year
 * @param timeZone The time zone.
 * @return
 */
static Calendar parseDay(String text,Date referenceDate,TimeZone timeZone) throws ParseException {
  Matcher matcher=DAY_FORMAT.matcher(text);
  if (!matcher.matches()) {
    throw new ParseException(text,0);
  }
  int month=Integer.parseInt(matcher.group(1));
  int day=Integer.parseInt(matcher.group(2));
  CalendarUtils calendarUtils=new CalendarUtils(referenceDate,timeZone);
  return calendarUtils.dayOfYear(day,month);
}
Program: 19587
Project: 19587
Buggy source:
protected Calendar toCalendar(Date referenceDate,TimeZone timeZone){
  if (toDate != null) {
    try {
      Calendar cal=CalendarUtils.dayOfYear(referenceDate,parseDay(toDate,timeZone),timeZone);
      CalendarUtils.setEndOfDay(cal);
      return cal;
    }
 catch (    ParseException e) {
      throw new RuntimeException("String_Node_Str",e);
    }
  }
 else   if (toMonth != null) {
    Calendar toCal=CalendarUtils.monthOfYear(referenceDate,toMonth.getMonthNumber(),timeZone);
    CalendarUtils.setEndOfMonth(toCal);
    return toCal;
  }
 else {
    return CalendarUtils.endOfYear(referenceDate,timeZone);
  }
}

Fixed version (ground truth):
protected Calendar toCalendar(Date referenceDate,TimeZone timeZone){
  if (toDate != null) {
    try {
      Calendar cal=parseDay(toDate,referenceDate,timeZone);
      CalendarUtils.setEndOfDay(cal);
      return cal;
    }
 catch (    ParseException e) {
      throw new RuntimeException("String_Node_Str",e);
    }
  }
 else   if (toMonth != null) {
    Calendar toCal=CalendarUtils.monthOfYear(referenceDate,toMonth.getMonthNumber(),timeZone);
    CalendarUtils.setEndOfMonth(toCal);
    return toCal;
  }
 else {
    return CalendarUtils.endOfYear(referenceDate,timeZone);
  }
}
Program: 19588
Project: 19588
Buggy source:
protected Calendar fromCalendar(Date referenceDate,TimeZone timeZone){
  if (fromDate != null) {
    try {
      return CalendarUtils.dayOfYear(referenceDate,parseDay(fromDate,timeZone),timeZone);
    }
 catch (    ParseException e) {
      throw new RuntimeException("String_Node_Str",e);
    }
  }
 else   if (fromMonth != null) {
    return CalendarUtils.monthOfYear(referenceDate,fromMonth.getMonthNumber(),timeZone);
  }
 else {
    return CalendarUtils.startOfYear(referenceDate,timeZone);
  }
}

Fixed version (ground truth):
protected Calendar fromCalendar(Date referenceDate,TimeZone timeZone){
  if (fromDate != null) {
    try {
      return parseDay(fromDate,referenceDate,timeZone);
    }
 catch (    ParseException e) {
      throw new RuntimeException("String_Node_Str",e);
    }
  }
 else   if (fromMonth != null) {
    return CalendarUtils.monthOfYear(referenceDate,fromMonth.getMonthNumber(),timeZone);
  }
 else {
    return CalendarUtils.startOfYear(referenceDate,timeZone);
  }
}
Program: 19589
Project: 19589
Buggy source:
public void testDayOfYear() throws ParseException {
  assertEquals(DateHelper.parseDateTime("String_Node_Str"),CalendarUtils.dayOfYear(DateHelper.parseDateTime("String_Node_Str"),67,TimeZone.getDefault()).getTime());
}

Fixed version (ground truth):
public void testDayOfYear() throws ParseException {
  CalendarUtils test=new CalendarUtils(DateHelper.parseDateTime("String_Node_Str"),TimeZone.getDefault());
  Calendar result=test.dayOfYear(26,5);
  Date expected=DateHelper.parseDateTime("String_Node_Str");
  assertEquals(expected,result.getTime());
}
Program: 19591
Project: 19591
Buggy source:
public void sessionChanged(final ConfigOwnerEvent event){
  ConfigurationSession session=configurationOwner.provideConfigurationSession();
  if (session != null) {
    session.addSessionStateListener(modifiedListener);
  }
  toolkit.runSynchronized(new Runnable(){
    public void run(){
      Notification notification=toolkit.createNotification(CHANGE_NOTIF_TYPE);
      notification.setUserData(event.getChange());
      toolkit.sendNotification(notification);
    }
  }
);
}

Fixed version (ground truth):
public void sessionChanged(final ConfigOwnerEvent event){
  configurationSession=configurationOwner.provideConfigurationSession();
  if (configurationSession != null) {
    configurationSession.addSessionStateListener(modifiedListener);
  }
  toolkit.runSynchronized(new Runnable(){
    public void run(){
      Notification notification=toolkit.createNotification(CHANGE_NOTIF_TYPE);
      notification.setUserData(event.getChange());
      toolkit.sendNotification(notification);
    }
  }
);
}
Program: 19592
Project: 19592
Buggy source:
public void destroy(){
  configurationOwner.removeOwnerStateListener(configurationListener);
  ConfigurationSession session=configurationOwner.provideConfigurationSession();
  if (session != null) {
    session.removeSessionStateListener(modifiedListener);
  }
}

Fixed version (ground truth):
public void destroy(){
  configurationOwner.removeOwnerStateListener(configurationListener);
  if (configurationSession != null) {
    configurationSession.removeSessionStateListener(modifiedListener);
  }
}
Program: 19593
Project: 19593
Buggy source:
ServerComponentOwnerHandler(ConfigurationOwner configurationOwner,ServerSideToolkit serverToolkit){
  this.configurationOwner=configurationOwner;
  this.toolkit=serverToolkit;
  configurationOwner.addOwnerStateListener(configurationListener);
  ConfigurationSession session=configurationOwner.provideConfigurationSession();
  if (session != null) {
    session.addSessionStateListener(modifiedListener);
  }
}

Fixed version (ground truth):
ServerComponentOwnerHandler(ConfigurationOwner configurationOwner,ServerSideToolkit serverToolkit){
  this.configurationOwner=configurationOwner;
  this.toolkit=serverToolkit;
  configurationOwner.addOwnerStateListener(configurationListener);
  configurationSession=configurationOwner.provideConfigurationSession();
  if (configurationSession != null) {
    configurationSession.addSessionStateListener(modifiedListener);
  }
}
Program: 19594
Project: 19594
Buggy source:
/** 
 * Utility method to load properties from an InputStream.
 * @return The properties, never null.
 * @throws IOException
 */
private Properties loadInput() throws IOException {
  Properties props=new Properties();
  if (fromXML) {
    props.loadFromXML(input);
  }
 else {
    props.load(input);
  }
  return props;
}

Fixed version (ground truth):
/** 
 * Utility method to load properties from an InputStream.
 * @return The properties, never null.
 * @throws IOException
 */
private Properties loadInput() throws IOException {
  Properties props=new Properties();
  try {
    if (fromXML) {
      props.loadFromXML(input);
    }
 else {
      props.load(input);
    }
    return props;
  }
  finally {
    input.close();
  }
}
Program: 19595
Project: 19595
Buggy source:
public void childAdded(final StructuralEvent e){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      addChild(e.getIndex(),e.getChild());
    }
  }
);
}

Fixed version (ground truth):
public void childAdded(final StructuralEvent e){
  executor.execute(new Runnable(){
    public void run(){
      addChild(e.getIndex(),e.getChild());
    }
  }
);
}
Program: 19596
Project: 19596
Buggy source:
/** 
 * Constructor for child nodes.
 * @param parent The parent node.
 * @param node The structure node this is modelling.
 */
public JobTreeNode(JobTreeNode parent,Object node){
  if (parent == null) {
    throw new NullPointerException("String_Node_Str");
  }
  this.parent=parent;
  this.model=parent.model;
  this.component=node;
  this.explorerContext=parent.explorerContext.addChild(node);
}

Fixed version (ground truth):
/** 
 * Constructor for child nodes.
 * @param parent The parent node.
 * @param node The structure node this is modelling.
 */
public JobTreeNode(JobTreeNode parent,Object node){
  if (parent == null) {
    throw new NullPointerException("String_Node_Str");
  }
  this.parent=parent;
  this.model=parent.model;
  this.component=node;
  this.explorerContext=parent.explorerContext.addChild(node);
  this.executor=parent.executor;
}
Program: 19597
Project: 19597
Buggy source:
public void setVisible(boolean visible){
  if (this.visible == visible) {
    return;
  }
  if (visible) {
    if (!listening && component instanceof Structural) {
      ((Structural)component).addStructuralListener(structuralListner);
      listening=true;
    }
    iconListener.listen();
  }
 else {
    iconListener.dont();
  }
  this.visible=visible;
}

Fixed version (ground truth):
/** 
 * Called when a node is made visible. This is to reduce the amount of listeners added to the job tree.
 * @param visible True if visible.
 */
public void setVisible(boolean visible){
  if (this.visible == visible) {
    return;
  }
  if (visible) {
    if (!listening && component instanceof Structural) {
      ((Structural)component).addStructuralListener(structuralListner);
      listening=true;
    }
    iconListener.listen();
  }
 else {
    iconListener.dont();
  }
  this.visible=visible;
}
Program: 19598
Project: 19598
Buggy source:
public void destroy(){
  while (nodeList.size() > 0) {
    int index=nodeList.size() - 1;
    JobTreeNode child=(JobTreeNode)nodeList.remove(index);
    child.destroy();
    model.fireTreeNodesRemoved(this,child,index);
  }
  if (component instanceof Structural) {
    ((Structural)component).removeStructuralListener(structuralListner);
  }
  iconListener.dont();
}

Fixed version (ground truth):
public void destroy(){
  if (component instanceof Structural) {
    ((Structural)component).removeStructuralListener(structuralListner);
  }
  iconListener.dont();
}
Program: 19599
Project: 19599
Buggy source:
void setIcon(IconTip iconTip){
synchronized (this) {
    this.iconTip=iconTip;
  }
  SwingUtilities.invokeLater(new Runnable(){
    @Override public void run(){
      model.fireTreeNodesChanged(JobTreeNode.this);
    }
  }
);
}

Fixed version (ground truth):
void setIcon(IconTip iconTip){
synchronized (this) {
    this.iconTip=iconTip;
  }
  executor.execute(new Runnable(){
    @Override public void run(){
      model.fireTreeNodesChanged(JobTreeNode.this);
    }
  }
);
}
Program: 19600
Project: 19600
Buggy source:
public void childRemoved(final StructuralEvent e){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      removeChild(e.getIndex());
    }
  }
);
}

Fixed version (ground truth):
public void childRemoved(final StructuralEvent e){
  executor.execute(new Runnable(){
    public void run(){
      removeChild(e.getIndex());
    }
  }
);
}
Program: 19601
Project: 19601
Buggy source:
public void destroy(){
  if (component instanceof Structural) {
    ((Structural)component).removeStructuralListener(structuralListner);
  }
  while (nodeList.size() > 0) {
    final int index=nodeList.size() - 1;
    final JobTreeNode child=(JobTreeNode)nodeList.remove(index);
    child.destroy();
    executor.execute(new Runnable(){
      public void run(){
        model.fireTreeNodesRemoved(JobTreeNode.this,child,index);
      }
    }
);
  }
  iconListener.dont();
}

Fixed version (ground truth):
/** 
 * Destroy the node. Remove listeners and destroy any remaining child nodes. Child node will remain in situations where a child is removed  from it's parent before being destroyed This happens with both the  {@link org.oddjob.jobs.structural.ForEachJob} and the {@link org.oddjob.jmx.JMXClientJob} jobs.
 */
public void destroy(){
  logger.debug("String_Node_Str" + getComponent() + "String_Node_Str");
  if (component instanceof Structural) {
    ((Structural)component).removeStructuralListener(structuralListner);
  }
  iconListener.dont();
  for (int i=currentList.size(); i > 0; --i) {
    final int index=i - 1;
    final JobTreeNode child=currentList.remove(index);
    child.destroy();
    executor.execute(new Runnable(){
      public void run(){
        logger.debug("String_Node_Str" + child.getComponent() + "String_Node_Str");
        JobTreeNode child=nodeList.remove(index);
        model.fireTreeNodesRemoved(JobTreeNode.this,child,index);
      }
    }
);
  }
}
Program: 19602
Project: 19602
Buggy source:
public void run(){
  model.fireTreeNodesRemoved(JobTreeNode.this,child,index);
}

Fixed version (ground truth):
public void run(){
  logger.debug("String_Node_Str" + child.getComponent() + "String_Node_Str");
  JobTreeNode child=nodeList.remove(index);
  model.fireTreeNodesRemoved(JobTreeNode.this,child,index);
}
Program: 19603
Project: 19603
Buggy source:
public void childAdded(final StructuralEvent e){
  final int index=e.getIndex();
  Object childJob=e.getChild();
  final JobTreeNode childNode=new JobTreeNode(JobTreeNode.this,childJob);
  if (visible) {
    childNode.setVisible(true);
  }
  nodeList.add(index,childNode);
  executor.execute(new Runnable(){
    public void run(){
      model.fireTreeNodesInserted(JobTreeNode.this,childNode,index);
    }
  }
);
}

Fixed version (ground truth):
public synchronized void childAdded(final StructuralEvent e){
  final int index=e.getIndex();
  Object childJob=e.getChild();
  final JobTreeNode childNode=new JobTreeNode(JobTreeNode.this,childJob);
  logger.debug("String_Node_Str" + childNode.getComponent() + "String_Node_Str");
  if (visible) {
    childNode.setVisible(true);
  }
  currentList.add(index,childNode);
  executor.execute(new Runnable(){
    public void run(){
      logger.debug("String_Node_Str" + childNode.getComponent() + "String_Node_Str");
      nodeList.add(index,childNode);
      model.fireTreeNodesInserted(JobTreeNode.this,childNode,index);
    }
  }
);
}
Program: 19604
Project: 19604
Buggy source:
public void childRemoved(final StructuralEvent e){
  final int index=e.getIndex();
  final JobTreeNode child=nodeList.remove(index);
  child.destroy();
  executor.execute(new Runnable(){
    public void run(){
      model.fireTreeNodesRemoved(JobTreeNode.this,child,index);
    }
  }
);
}

Fixed version (ground truth):
public synchronized void childRemoved(final StructuralEvent e){
  final int index=e.getIndex();
  final JobTreeNode child=currentList.remove(index);
  logger.debug("String_Node_Str" + child.getComponent() + "String_Node_Str");
  child.destroy();
  executor.execute(new Runnable(){
    public void run(){
      logger.debug("String_Node_Str" + child.getComponent() + "String_Node_Str");
      JobTreeNode child=nodeList.remove(index);
      model.fireTreeNodesRemoved(JobTreeNode.this,child,index);
    }
  }
);
}
Program: 19605
Project: 19605
Buggy source:
public void removeChild(int index){
  JobTreeNode child=nodeList.remove(index);
  child.destroy();
  model.fireTreeNodesRemoved(JobTreeNode.this,child,index);
}

Fixed version (ground truth):
private void removeChild(int index){
  JobTreeNode child=nodeList.remove(index);
  model.fireTreeNodesRemoved(JobTreeNode.this,child,index);
}
Program: 19606
Project: 19606
Buggy source:
@Override public void run(){
  model.fireTreeNodesChanged(JobTreeNode.this);
}

Fixed version (ground truth):
public void run(){
  model.fireTreeNodesRemoved(JobTreeNode.this,child,index);
}
Program: 19607
Project: 19607
Buggy source:
public void destroy(){
  if (component instanceof Structural) {
    ((Structural)component).removeStructuralListener(structuralListner);
  }
  iconListener.dont();
}

Fixed version (ground truth):
public void destroy(){
  if (component instanceof Structural) {
    ((Structural)component).removeStructuralListener(structuralListner);
  }
  while (nodeList.size() > 0) {
    final int index=nodeList.size() - 1;
    final JobTreeNode child=(JobTreeNode)nodeList.remove(index);
    child.destroy();
    executor.execute(new Runnable(){
      public void run(){
        model.fireTreeNodesRemoved(JobTreeNode.this,child,index);
      }
    }
);
  }
  iconListener.dont();
}
Program: 19608
Project: 19608
Buggy source:
public void childRemoved(final StructuralEvent e){
  executor.execute(new Runnable(){
    public void run(){
      removeChild(e.getIndex());
    }
  }
);
}

Fixed version (ground truth):
public void childRemoved(final StructuralEvent e){
  final int index=e.getIndex();
  JobTreeNode child=nodeList.elementAt(index);
  child.destroy();
  executor.execute(new Runnable(){
    public void run(){
      removeChild(index);
    }
  }
);
}
Program: 19609
Project: 19609
Buggy source:
public void addChild(int index,Object childJob){
  JobTreeNode childNode=new JobTreeNode(this,childJob);
  if (visible) {
    childNode.setVisible(true);
  }
  nodeList.add(index,childNode);
  model.fireTreeNodesInserted(JobTreeNode.this,childNode,index);
}

Fixed version (ground truth):
private void addChild(int index,Object childJob){
  JobTreeNode childNode=new JobTreeNode(this,childJob);
  if (visible) {
    childNode.setVisible(true);
  }
  nodeList.add(index,childNode);
  model.fireTreeNodesInserted(JobTreeNode.this,childNode,index);
}
Program: 19611
Project: 19611
Buggy source:
public IntroFade(Activity activity,GL11 gl){
  super(gl);
  title_droid=new Texture2D(gl);
  Bitmap bitmap=BitmapFactory.decodeResource(activity.getResources(),R.drawable.title_droid);
  title_droid.setData(bitmap);
  bitmap.recycle();
  title_parandroid=new Texture2D(gl);
  bitmap=BitmapFactory.decodeResource(activity.getResources(),R.drawable.title_parandroid);
  title_parandroid.setData(bitmap);
  bitmap.recycle();
  title_trsinrab=new Texture2D(gl);
  bitmap=BitmapFactory.decodeResource(activity.getResources(),R.drawable.title_trsinrab);
  title_trsinrab.setData(bitmap);
  bitmap.recycle();
  title_droid.enable(true);
  gl.glEnable(GL11.GL_BLEND);
  gl.glBlendFunc(GL11.GL_SRC_ALPHA,GL11.GL_ONE_MINUS_SRC_ALPHA);
  gl.glEnableClientState(GL11.GL_VERTEX_ARRAY);
  gl.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
  add(new Wait(),1000);
  add(new FadeBlackToDroid(),7 * 1000);
  add(new ShowDroidTitle(),7 * 1000);
  add(new FadeDroidToTrsiNRab(),7 * 1000);
  add(new ShowTrsiNRabTitle(),7 * 1000);
  add(new FadeTrsiNRabToParaNdroiD(),7 * 1000);
  add(new ShowParaNdroiDTitle(),7 * 1000);
  add(new FadeParaNdroiDToWhite(),500);
}

Fixed version (ground truth):
public IntroFade(Activity activity,GL11 gl){
  super(gl);
  title_droid=new Texture2D(gl);
  Bitmap bitmap=BitmapFactory.decodeResource(activity.getResources(),R.drawable.title_droid);
  title_droid.setData(bitmap);
  bitmap.recycle();
  title_parandroid=new Texture2D(gl);
  bitmap=BitmapFactory.decodeResource(activity.getResources(),R.drawable.title_parandroid);
  title_parandroid.setData(bitmap);
  bitmap.recycle();
  title_trsinrab=new Texture2D(gl);
  bitmap=BitmapFactory.decodeResource(activity.getResources(),R.drawable.title_trsinrab);
  title_trsinrab.setData(bitmap);
  bitmap.recycle();
  title_droid.enable(true);
  gl.glEnable(GL11.GL_BLEND);
  gl.glBlendFunc(GL11.GL_SRC_ALPHA,GL11.GL_ONE_MINUS_SRC_ALPHA);
  gl.glEnableClientState(GL11.GL_VERTEX_ARRAY);
  gl.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
  add(new Clear(),1000);
  add(new FadeBlackToDroid(),7 * 1000);
  add(new ShowDroidTitle(),7 * 1000);
  add(new FadeDroidToTrsiNRab(),7 * 1000);
  add(new ShowTrsiNRabTitle(),7 * 1000);
  add(new FadeTrsiNRabToParaNdroiD(),7 * 1000);
  add(new ShowParaNdroiDTitle(),7 * 1000);
  add(new FadeParaNdroiDToWhite(),500);
}
Program: 19614
Project: 19614
Buggy source:
public String getIconFileName(){
  if (publisher.isPublishHtmlReport()) {
    FilePath r=getWorkspaceReportDir();
    if (exists(r,"String_Node_Str")) {
      return ICON;
    }
  }
  File reportDir=getLastBuildReportDir();
  if (exists(new FilePath(reportDir),"String_Node_Str")) {
    return ICON;
  }
  return null;
}

Fixed version (ground truth):
public String getIconFileName(){
  if (publisher.isPublishHtmlReport()) {
    FilePath r=getWorkspaceReportDir();
    if (exists(r,"String_Node_Str")) {
      return ICON;
    }
  }
  File reportDir=getLastBuildReportDir();
  if (reportDir != null && exists(new FilePath(reportDir),"String_Node_Str")) {
    return ICON;
  }
  return null;
}
Program: 19615
Project: 19615
Buggy source:
/** 
 * Test of getPercentageStr method, of class Ratio.
 */
@Test public void testGetPercentageStr_undefined(){
  Ratio ratio=Ratio.create(1.0f,0.0f);
  assertEquals("String_Node_Str",ratio.getPercentageStr());
  ratio=Ratio.create(1.0f,-5.0f);
  assertEquals("String_Node_Str",ratio.getPercentageStr());
}

Fixed version (ground truth):
/** 
 * Test of getPercentageStr method, of class Ratio.
 */
@Test public void testGetPercentageStr_undefined(){
  Ratio ratio=Ratio.create(1.0f,0.0f);
  assertEquals("String_Node_Str",ratio.getPercentageStr());
  ratio=Ratio.create(1.0f,-50.0f);
  assertEquals("String_Node_Str",ratio.getPercentageStr());
}
Program: 19616
Project: 19616
Buggy source:
/** 
 * Test of getPreviousCloverBuildAction method, of class AbstractClassMetrics.
 */
@Test public void testGetPreviousCloverBuildAction_ActionNull(){
  CloverBuildAction cba=mock(CloverBuildAction.class);
  Run<?,?> r=mock(Run.class);
  when(r.getAction(CloverBuildAction.class)).thenReturn(cba);
  AbstractBuild b=mock(AbstractBuild.class);
  when(b.getPreviousBuild()).thenReturn(r);
  target.setOwner(b);
  assertEquals(cba,target.getPreviousCloverBuildAction());
}

Fixed version (ground truth):
/** 
 * Test of getPreviousCloverBuildAction method, of class AbstractClassMetrics.
 */
@Test public void testGetPreviousCloverBuildAction_ActionNull(){
  CloverBuildAction cba2=null;
  Run prebuild2=mock(Run.class);
  when(prebuild2.getAction(CloverBuildAction.class)).thenReturn(cba2);
  CloverBuildAction cba=null;
  Run prebuild=mock(Run.class);
  when(prebuild.getAction(CloverBuildAction.class)).thenReturn(cba);
  when(prebuild.getPreviousBuild()).thenReturn(prebuild2);
  AbstractBuild b=mock(AbstractBuild.class);
  when(b.getPreviousBuild()).thenReturn(prebuild);
  target.setOwner(b);
  assertEquals(cba2,target.getPreviousCloverBuildAction());
}
Program: 19617
Project: 19617
Buggy source:
@EventHandler public void onVehicleBlockCollision(VehicleBlockCollisionEvent event){
  if (event.getBlock().getRelative(BlockFace.UP).getState() instanceof Dispenser && event.getVehicle() instanceof Minecart) {
    ItemStack item;
    if (event.getVehicle() instanceof PoweredMinecart) {
      item=new ItemStack(Material.POWERED_MINECART,1);
    }
 else     if (event.getVehicle() instanceof StorageMinecart) {
      item=new ItemStack(Material.STORAGE_MINECART,1);
    }
 else {
      item=new ItemStack(Material.MINECART,1);
    }
    Dispenser dispenser=(Dispenser)event.getBlock().getRelative(BlockFace.UP).getState();
    ItemStack cartItemStack=ChestUtil.putItems(item,dispenser)[0];
    if (cartItemStack == null) {
      if (event.getVehicle() instanceof StorageMinecart) {
        StorageMinecart cart=(StorageMinecart)event.getVehicle();
        ItemStack[] leftovers=ChestUtil.putItems(cart.getInventory().getContents(),dispenser);
        cart.getInventory().clear();
        for (        ItemStack i : leftovers) {
          if (i == null)           continue;
          cart.getWorld().dropItem(cart.getLocation(),i);
        }
      }
      event.getVehicle().remove();
      return;
    }
  }
}

Fixed version (ground truth):
@EventHandler public void onVehicleBlockCollision(VehicleBlockCollisionEvent event){
  if (event.getBlock().getState() instanceof Dispenser && event.getVehicle() instanceof Minecart) {
    ItemStack item;
    if (event.getVehicle() instanceof PoweredMinecart) {
      item=new ItemStack(Material.POWERED_MINECART,1);
    }
 else     if (event.getVehicle() instanceof StorageMinecart) {
      item=new ItemStack(Material.STORAGE_MINECART,1);
    }
 else {
      item=new ItemStack(Material.MINECART,1);
    }
    Dispenser dispenser=(Dispenser)event.getBlock().getState();
    ItemStack cartItemStack=ChestUtil.putItems(item,dispenser)[0];
    if (cartItemStack == null) {
      if (event.getVehicle() instanceof StorageMinecart) {
        StorageMinecart cart=(StorageMinecart)event.getVehicle();
        ItemStack[] leftovers=ChestUtil.putItems(cart.getInventory().getContents(),dispenser);
        cart.getInventory().clear();
        for (        ItemStack i : leftovers) {
          if (i == null)           continue;
          cart.getWorld().dropItem(cart.getLocation(),i);
        }
      }
      event.getVehicle().remove();
      return;
    }
  }
}
Program: 19618
Project: 19618
Buggy source:
/** 
 * Sets a range of the IntMap prevents multiple calls to IntMap and back
 */
public boolean setRange(int startId,byte startdata,int endId,byte enddata,int value){
  if (startdata < -1 || enddata < -1 || startId > endId || (startdata > 0 && !hasDataValue(startId)) || (enddata > 0 && !hasDataValue(endId)) || !isAllowedMaterial(startId,startdata) || !isAllowedMaterial(endId,enddata))   return false;
  if (startId < endId) {
    if (startdata >= 0 && enddata >= 0) {
      setDataRange(startId,startdata,(byte)15,value);
      startId++;
      setDataRange(endId,(byte)0,enddata,value);
      endId--;
    }
 else     if (startdata == -1 && enddata >= 0) {
      setDataRange(endId,(byte)0,enddata,value);
      endId--;
    }
 else     if (startdata >= 0 && enddata == -1) {
      setDataRange(startId,startdata,(byte)15,value);
      startId++;
    }
    while (startId <= endId) {
      if (hasDataValue(startId)) {
        setDataRange(startId,(byte)0,(byte)15,value);
      }
 else {
        setInt(startId,(byte)0,value);
      }
      do {
        startId++;
      }
 while (!isAllowedMaterial(startId,(byte)0));
    }
    return true;
  }
 else   if (startId == endId) {
    if (startdata < enddata && hasDataValue(startId)) {
      setDataRange(startId,startdata,enddata,value);
      return true;
    }
    return false;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Sets a range of the IntMap prevents multiple calls to IntMap and back
 */
public boolean setRange(int startId,byte startdata,int endId,byte enddata,int value){
  if (startdata < -1 || enddata < -1 || startId > endId || (startdata > 0 && !hasDataValue(startId)) || (enddata > 0 && !hasDataValue(endId)) || !isAllowedMaterial(startId,startdata) || !isAllowedMaterial(endId,enddata))   return false;
  if (startId < endId) {
    if (startdata >= 0 && enddata >= 0) {
      setDataRange(startId,startdata,(byte)15,value);
      startId++;
      setDataRange(endId,(byte)0,enddata,value);
      endId--;
    }
 else     if (startdata == -1 && enddata >= 0) {
      setDataRange(endId,(byte)0,enddata,value);
      endId--;
    }
 else     if (startdata >= 0 && enddata == -1) {
      setDataRange(startId,startdata,(byte)15,value);
      startId++;
    }
    while (startId <= endId) {
      if (!isAllowedMaterial(startId,(byte)0)) {
        startId++;
      }
 else       if (hasDataValue(startId)) {
        setDataRange(startId,(byte)0,(byte)15,value);
        startId++;
      }
 else {
        setInt(startId,(byte)0,value);
        startId++;
      }
    }
    return true;
  }
 else   if (startId == endId) {
    if (startdata < enddata && hasDataValue(startId)) {
      setDataRange(startId,startdata,enddata,value);
      return true;
    }
    return false;
  }
 else {
    return false;
  }
}