nus-yam/ex-repair huggingface dataset:
Program: 78468
Project: 78468
Buggy source:
private void startCalendar(ActionListener cal,ActionListener ctrlCal) throws ParseException {
  calendar.setLayout(new BorderLayout());
  panelDateCalendar.setLayout(new GridLayout(1,5));
  panelDateCalendar.add(buttonPreviousYear);
  panelDateCalendar.add(buttonPreviousMonth);
  panelDateCalendar.add(labelDateMonthYear);
  panelDateCalendar.add(buttonNextMonth);
  panelDateCalendar.add(buttonNextYear);
  calendar.add(panelDateCalendar,BorderLayout.NORTH);
  panelGridCalendar.setLayout((new GridLayout(7,7)));
  calendar.add(panelGridCalendar,BorderLayout.CENTER);
  labelDay=new JLabel[7];
  int i=0;
  for (  WeekDays wd : WeekDays.values()) {
    labelDay[i]=new JLabel(wd.toString(),SwingConstants.CENTER);
    panelGridCalendar.add(labelDay[i]);
    i++;
  }
  buttonDay=new JButton[31];
  for (i=0; i < 31; i++) {
    buttonDay[i]=new JButton(Integer.toString(i + 1));
    buttonDay[i].setBackground(new Color(204,230,255));
  }
  add(calendar,BorderLayout.CENTER);
  initializeCalendar(cal);
  buttonPreviousMonth.addActionListener(ctrlCal);
  buttonNextMonth.addActionListener(ctrlCal);
  buttonPreviousYear.addActionListener(ctrlCal);
  buttonNextYear.addActionListener(ctrlCal);
}

Fixed version (ground truth):
private void startCalendar(ActionListener cal,ActionListener ctrlCal) throws ParseException {
  calendar.setLayout(new BorderLayout());
  panelDateCalendar.setLayout(new GridLayout(1,5));
  panelDateCalendar.add(buttonPreviousYear);
  panelDateCalendar.add(buttonPreviousMonth);
  panelDateCalendar.add(labelDateMonthYear);
  panelDateCalendar.add(buttonNextMonth);
  panelDateCalendar.add(buttonNextYear);
  calendar.add(panelDateCalendar,BorderLayout.NORTH);
  panelGridCalendar.setLayout((new GridLayout(7,7)));
  calendar.add(panelGridCalendar,BorderLayout.CENTER);
  labelDay=new JLabel[7];
  int i=0;
  for (  WeekDays wd : WeekDays.values()) {
    labelDay[i]=new JLabel(wd.toString(),SwingConstants.CENTER);
    panelGridCalendar.add(labelDay[i]);
    i++;
  }
  buttonDay=new JButton[31];
  for (i=0; i < 31; i++) {
    buttonDay[i]=new JButton(Integer.toString(i + 1));
    buttonDay[i].setBackground(new Color(204,230,255));
    buttonDay[i].addActionListener(cal);
  }
  add(calendar,BorderLayout.CENTER);
  initializeCalendar(cal);
  buttonPreviousMonth.addActionListener(ctrlCal);
  buttonNextMonth.addActionListener(ctrlCal);
  buttonPreviousYear.addActionListener(ctrlCal);
  buttonNextYear.addActionListener(ctrlCal);
}
Program: 78469
Project: 78469
Buggy source:
private void updateCalendar(int monthNumber,ActionListener cal) throws ParseException {
  SimpleDateFormat date=new SimpleDateFormat("String_Node_Str");
  String strDate="String_Node_Str" + labelDateMonthYear.getText();
  Date currentDate=date.parse(strDate);
  SimpleDateFormat dateDayNumber=new SimpleDateFormat("String_Node_Str");
  dateDayNumber.setLenient(false);
  String stringDayNumber=dateDayNumber.format(currentDate);
  int dayNumber=Integer.parseInt(stringDayNumber);
  int i;
  int ie;
  int ne=0;
  int cc=7;
  labelEmpty=new JLabel[11];
switch (dayNumber) {
case 1:
    ne=0;
  break;
case 2:
ne=1;
break;
case 3:
ne=2;
break;
case 4:
ne=3;
break;
case 5:
ne=4;
break;
case 6:
ne=5;
break;
case 7:
ne=6;
break;
}
for (ie=0; ie < ne; ie++) {
labelEmpty[ie]=new JLabel();
panelGridCalendar.add(labelEmpty[ie]);
cc++;
}
i=0;
int nd;
switch (monthNumber) {
case 4:
case 6:
case 9:
case 11:
nd=30;
break;
case 2:
if (isLeap(currentDate)) {
nd=29;
}
 else {
nd=28;
}
break;
default :
nd=31;
break;
}
for (i=0; i < nd; i++) {
panelGridCalendar.add(buttonDay[i]);
cc++;
}
while (cc < 49) {
labelEmpty[ie]=new JLabel();
panelGridCalendar.add(labelEmpty[ie]);
cc++;
}
for (i=0; i < nd; i++) {
buttonDay[i].addActionListener(cal);
}
}

Fixed version (ground truth):
private void updateCalendar(int monthNumber,ActionListener cal) throws ParseException {
  SimpleDateFormat date=new SimpleDateFormat("String_Node_Str");
  String strDate="String_Node_Str" + labelDateMonthYear.getText();
  Date currentDate=date.parse(strDate);
  SimpleDateFormat dateDayNumber=new SimpleDateFormat("String_Node_Str");
  dateDayNumber.setLenient(false);
  String stringDayNumber=dateDayNumber.format(currentDate);
  int dayNumber=Integer.parseInt(stringDayNumber);
  int i;
  int ie;
  int ne=0;
  int cc=7;
  labelEmpty=new JLabel[11];
switch (dayNumber) {
case 1:
    ne=0;
  break;
case 2:
ne=1;
break;
case 3:
ne=2;
break;
case 4:
ne=3;
break;
case 5:
ne=4;
break;
case 6:
ne=5;
break;
case 7:
ne=6;
break;
}
for (ie=0; ie < ne; ie++) {
labelEmpty[ie]=new JLabel();
panelGridCalendar.add(labelEmpty[ie]);
cc++;
}
i=0;
int nd;
switch (monthNumber) {
case 4:
case 6:
case 9:
case 11:
nd=30;
break;
case 2:
if (isLeap(currentDate)) {
nd=29;
}
 else {
nd=28;
}
break;
default :
nd=31;
break;
}
for (i=0; i < nd; i++) {
panelGridCalendar.add(buttonDay[i]);
cc++;
}
while (cc < 49) {
labelEmpty[ie]=new JLabel();
panelGridCalendar.add(labelEmpty[ie]);
cc++;
}
}
Program: 78470
Project: 78470
Buggy source:
public int getHeight(){
  return height;
}

Fixed version (ground truth):
@Override public int getHeight(){
  return height;
}
Program: 78471
Project: 78471
Buggy source:
public Bitmap getViewContent(){
  return null;
}

Fixed version (ground truth):
@Override public Bitmap getViewContent(){
  return null;
}
Program: 78472
Project: 78472
Buggy source:
public FlutterMap(Context context,MapboxMapOptions options,SurfaceTexture surfaceTexture,int width,int height){
  this.context=context;
  this.mapboxMapOptions=options;
  this.width=width;
  this.height=height;
  String localFontFamily=mapboxMapOptions.getLocalIdeographFontFamily();
  boolean translucentSurface=mapboxMapOptions.getTranslucentTextureSurface();
  mapRenderer=new SurfaceTextureMapRenderer(context,surfaceTexture,width,height,localFontFamily,translucentSurface);
  nativeMapView=new NativeMapView(context,this,mapRenderer);
  nativeMapView.setStyleUrl(mapboxMapOptions.getStyle());
  nativeMapView.resizeView(width,height);
  nativeMapView.setReachability(ConnectivityReceiver.instance(context).isConnected(context));
  nativeMapView.update();
  CameraPosition cameraPosition=mapboxMapOptions.getCamera();
  if (cameraPosition != null) {
    nativeMapView.jumpTo(cameraPosition.bearing,cameraPosition.target,cameraPosition.tilt,cameraPosition.zoom);
  }
}

Fixed version (ground truth):
public FlutterMap(Context context,MapboxMapOptions options,SurfaceTexture surfaceTexture,int width,int height){
  this.context=context;
  this.mapboxMapOptions=options;
  this.width=width;
  this.height=height;
  String localFontFamily=mapboxMapOptions.getLocalIdeographFontFamily();
  boolean translucentSurface=mapboxMapOptions.getTranslucentTextureSurface();
  mapRenderer=new SurfaceTextureMapRenderer(context,surfaceTexture,width,height,localFontFamily,translucentSurface);
  nativeMapView=new NativeMapView(context,this,mapRenderer);
  nativeMapView.addOnMapChangedListener(this);
  nativeMapView.setStyleUrl(mapboxMapOptions.getStyle());
  nativeMapView.resizeView(width,height);
  nativeMapView.setReachability(ConnectivityReceiver.instance(context).isConnected(context));
  nativeMapView.update();
  CameraPosition cameraPosition=mapboxMapOptions.getCamera();
  if (cameraPosition != null) {
    nativeMapView.jumpTo(cameraPosition.bearing,cameraPosition.target,cameraPosition.tilt,cameraPosition.zoom);
  }
}
Program: 78473
Project: 78473
Buggy source:
public int getWidth(){
  return width;
}

Fixed version (ground truth):
@Override public int getWidth(){
  return width;
}
Program: 78474
Project: 78474
Buggy source:
private void populateModiferList(){
  validModifierList.add(ModItems.nuggetForce);
  validModifierList.add(ModItems.claw);
  validModifierList.add(ModItems.fortune);
  validModifierList.add(Items.SUGAR);
  validModifierList.add(Items.COAL);
  validModifierList.add(ModItems.goldenPowerSource);
  validModifierList.add(ModItems.cookieFortune);
  validModifierList.add(Items.FLINT);
  validModifierList.add(Items.DYE);
  validModifierList.add(Items.EXPERIENCE_BOTTLE);
  validModifierList.add(Items.SPIDER_EYE);
  validModifierList.add(Items.ARROW);
  validModifierList.add(Items.GHAST_TEAR);
  validModifierList.add(ModItems.soulWafer);
  validModifierList.add(Items.FEATHER);
  validModifierList.add(Items.ENDER_PEARL);
  validModifierList.add(Items.GLOWSTONE_DUST);
  validModifierList.add(Item.getItemFromBlock(Blocks.CRAFTING_TABLE));
  validModifierList.add(Item.getItemFromBlock(ModBlocks.forceLog));
  validModifierList.add(Item.getItemFromBlock(Blocks.WEB));
  validModifierList.add(Item.getItemFromBlock(Blocks.OBSIDIAN));
  validModifierList.add(Item.getItemFromBlock(Blocks.BRICK_BLOCK));
  validModifierList.add(Items.GOLD_INGOT);
  validModifierList.add(Items.IRON_INGOT);
}

Fixed version (ground truth):
private void populateModiferList(){
  validModifierList.add(ModItems.nuggetForce);
  validModifierList.add(ModItems.claw);
  validModifierList.add(ModItems.fortune);
  validModifierList.add(Items.SUGAR);
  validModifierList.add(Items.COAL);
  validModifierList.add(ModItems.goldenPowerSource);
  validModifierList.add(ModItems.cookieFortune);
  validModifierList.add(Items.FLINT);
  validModifierList.add(Items.DYE);
  validModifierList.add(Items.EXPERIENCE_BOTTLE);
  validModifierList.add(Items.SPIDER_EYE);
  validModifierList.add(Items.ARROW);
  validModifierList.add(Items.GHAST_TEAR);
  validModifierList.add(ModItems.soulWafer);
  validModifierList.add(Items.FEATHER);
  validModifierList.add(Items.ENDER_PEARL);
  validModifierList.add(Items.GLOWSTONE_DUST);
  validModifierList.add(Items.POTIONITEM);
  validModifierList.add(Item.getItemFromBlock(Blocks.CRAFTING_TABLE));
  validModifierList.add(Item.getItemFromBlock(ModBlocks.forceLog));
  validModifierList.add(Item.getItemFromBlock(Blocks.WEB));
  validModifierList.add(Item.getItemFromBlock(Blocks.OBSIDIAN));
  validModifierList.add(Item.getItemFromBlock(Blocks.BRICK_BLOCK));
}
Program: 78475
Project: 78475
Buggy source:
private boolean applyModifier(ItemStack stack,ItemStack mod){
  Item modifier=mod.getItem();
  if (modifier == Items.SUGAR)   return addSpeedModifier(stack);
  if (modifier == Items.COAL)   return addHeatModifier(stack);
  if (modifier == Items.FLINT)   return addGrindingModifier(stack);
  if (modifier == ModItems.nuggetForce)   return addForceModifier(stack);
  if (modifier == Item.getItemFromBlock(Blocks.WEB))   return addSilkTouchModifier(stack);
  if (modifier == ModItems.claw)   return addDamageModifier(stack);
  if (modifier == ModItems.fortune)   return addLuckModifier(stack);
  if (modifier == Items.GLOWSTONE_DUST)   return addLightModifier(stack);
  if (modifier == Item.getItemFromBlock(Blocks.BRICK_BLOCK) || modifier == Item.getItemFromBlock(Blocks.OBSIDIAN))   return addSturdyModifier(stack);
  if (modifier == Item.getItemFromBlock(ModBlocks.forceLog))   return addLumberjackModifier(stack);
  if (modifier == Items.GHAST_TEAR)   return addHealingModifier(stack);
  if (modifier == Items.GOLD_INGOT)   return addCamoModifier(stack);
  if (modifier == Items.ENDER_PEARL)   return addEnderModifier(stack);
  if (modifier == Items.IRON_INGOT)   return addSightModifier(stack);
  return false;
}

Fixed version (ground truth):
private boolean applyModifier(ItemStack stack,ItemStack mod){
  Item modifier=mod.getItem();
  if (modifier == Items.SUGAR)   return addSpeedModifier(stack);
  if (modifier == Items.COAL)   return addHeatModifier(stack);
  if (modifier == Items.FLINT)   return addGrindingModifier(stack);
  if (modifier == ModItems.nuggetForce)   return addForceModifier(stack);
  if (modifier == Item.getItemFromBlock(Blocks.WEB))   return addSilkTouchModifier(stack);
  if (modifier == ModItems.claw)   return addDamageModifier(stack);
  if (modifier == ModItems.fortune)   return addLuckModifier(stack);
  if (modifier == Items.GLOWSTONE_DUST)   return addLightModifier(stack);
  if (modifier == Item.getItemFromBlock(Blocks.BRICK_BLOCK) || modifier == Item.getItemFromBlock(Blocks.OBSIDIAN))   return addSturdyModifier(stack);
  if (modifier == Item.getItemFromBlock(ModBlocks.forceLog))   return addLumberjackModifier(stack);
  if (modifier == Items.GHAST_TEAR)   return addHealingModifier(stack);
  if (modifier == Items.ENDER_PEARL)   return addEnderModifier(stack);
  if (modifier == Items.POTIONITEM) {
    List<PotionEffect> effects=PotionUtils.getEffectsFromStack(mod);
    for (    PotionEffect e : effects) {
      if (e.getPotion() == MobEffects.NIGHT_VISION) {
        return addSightModifier(stack);
      }
      if (e.getPotion() == MobEffects.INVISIBILITY) {
        return addCamoModifier(stack);
      }
    }
  }
  return false;
}
Program: 78476
Project: 78476
Buggy source:
public ServerSocket createServerSocket(int port) throws IOException {
  ServerSocket ss=new ServerSocket();
  if (port == 0) {
    ss.setReuseAddress(false);
  }
  ss.bind(new InetSocketAddress(port));
  return ss;
}

Fixed version (ground truth):
public ServerSocket createServerSocket(int port) throws IOException {
  return new ServerSocket(port);
}
Program: 78478
Project: 78478
Buggy source:
/** 
 * Sets the SO_RCVBUF option to the specified value for this  {@code DatagramSocket}. The SO_RCVBUF option is used by the the network implementation as a hint to size the underlying network I/O buffers. The SO_RCVBUF setting may also be used by the network implementation to determine the maximum size of the packet that can be received on this socket. <p> Because SO_RCVBUF is a hint, applications that want to verify what size the buffers were set to should call  {@link #getReceiveBufferSize()}. <p> Increasing SO_RCVBUF may allow the network implementation to buffer multiple packets when packets arrive faster than are being received using   {@link #receive(DatagramPacket)}. <p> Note: It is implementation specific if a packet larger than SO_RCVBUF can be received.
 * @param size the size to which to set the receive buffersize. This value must be greater than 0.
 * @exception SocketException if there is an error inthe underlying protocol, such as an UDP error.
 * @exception IllegalArgumentException if the value is 0 or isnegative.
 * @see #getReceiveBufferSize()
 */
public synchronized void setReceiveBufferSize(int size) throws SocketException {
  if (size <= 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (isClosed())   throw new SocketException("String_Node_Str");
  getImpl().setOption(SocketOptions.SO_RCVBUF,size);
}

Fixed version (ground truth):
/** 
 * Sets the SO_RCVBUF option to the specified value for this  {@code DatagramSocket}. The SO_RCVBUF option is used by the network implementation as a hint to size the underlying network I/O buffers. The SO_RCVBUF setting may also be used by the network implementation to determine the maximum size of the packet that can be received on this socket. <p> Because SO_RCVBUF is a hint, applications that want to verify what size the buffers were set to should call  {@link #getReceiveBufferSize()}. <p> Increasing SO_RCVBUF may allow the network implementation to buffer multiple packets when packets arrive faster than are being received using   {@link #receive(DatagramPacket)}. <p> Note: It is implementation specific if a packet larger than SO_RCVBUF can be received.
 * @param size the size to which to set the receive buffersize. This value must be greater than 0.
 * @exception SocketException if there is an error inthe underlying protocol, such as an UDP error.
 * @exception IllegalArgumentException if the value is 0 or isnegative.
 * @see #getReceiveBufferSize()
 */
public synchronized void setReceiveBufferSize(int size) throws SocketException {
  if (size <= 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (isClosed())   throw new SocketException("String_Node_Str");
  getImpl().setOption(SocketOptions.SO_RCVBUF,size);
}
Program: 78480
Project: 78480
Buggy source:
/** 
 * Sends the Bind request to the SOCKS proxy. In the SOCKS protocol, bind means "accept incoming connection from", so the SocketAddress is the the one of the host we do accept connection from.
 * @param saddr   the Socket address of the remote host.
 * @exception IOException  if an I/O error occurs when binding this socket.
 */
protected synchronized void socksBind(InetSocketAddress saddr) throws IOException {
}

Fixed version (ground truth):
/** 
 * Sends the Bind request to the SOCKS proxy. In the SOCKS protocol, bind means "accept incoming connection from", so the SocketAddress is the one of the host we do accept connection from.
 * @param saddr   the Socket address of the remote host.
 * @exception IOException  if an I/O error occurs when binding this socket.
 */
protected synchronized void socksBind(InetSocketAddress saddr) throws IOException {
}
Program: 78482
Project: 78482
Buggy source:
/** 
 * Obtains an instance of   {@code WeekFields} from the first day-of-week and minimal days.<p> The first day-of-week defines the ISO  {@code DayOfWeek} that is day 1 of the week.The minimal number of days in the first week defines how many days must be present in a month or year, starting from the first day-of-week, before the week is counted as the first week. A value of 1 will count the first day of the month or year as part of the first week, whereas a value of 7 will require the whole seven days to be in the new month or year. <p> WeekFields instances are singletons; for each unique combination of  {@code firstDayOfWeek} and {@code minimalDaysInFirstWeek} thethe same instance will be returned.
 * @param firstDayOfWeek  the first day of the week, not null
 * @param minimalDaysInFirstWeek  the minimal number of days in the first week, from 1 to 7
 * @return the week-definition, not null
 * @throws IllegalArgumentException if the minimal days value is less than oneor greater than 7
 */
public static WeekFields of(DayOfWeek firstDayOfWeek,int minimalDaysInFirstWeek){
  String key=firstDayOfWeek.toString() + minimalDaysInFirstWeek;
  WeekFields rules=CACHE.get(key);
  if (rules == null) {
    rules=new WeekFields(firstDayOfWeek,minimalDaysInFirstWeek);
    CACHE.putIfAbsent(key,rules);
    rules=CACHE.get(key);
  }
  return rules;
}

Fixed version (ground truth):
/** 
 * Obtains an instance of   {@code WeekFields} from the first day-of-week and minimal days.<p> The first day-of-week defines the ISO  {@code DayOfWeek} that is day 1 of the week.The minimal number of days in the first week defines how many days must be present in a month or year, starting from the first day-of-week, before the week is counted as the first week. A value of 1 will count the first day of the month or year as part of the first week, whereas a value of 7 will require the whole seven days to be in the new month or year. <p> WeekFields instances are singletons; for each unique combination of  {@code firstDayOfWeek} and {@code minimalDaysInFirstWeek}the same instance will be returned.
 * @param firstDayOfWeek  the first day of the week, not null
 * @param minimalDaysInFirstWeek  the minimal number of days in the first week, from 1 to 7
 * @return the week-definition, not null
 * @throws IllegalArgumentException if the minimal days value is less than oneor greater than 7
 */
public static WeekFields of(DayOfWeek firstDayOfWeek,int minimalDaysInFirstWeek){
  String key=firstDayOfWeek.toString() + minimalDaysInFirstWeek;
  WeekFields rules=CACHE.get(key);
  if (rules == null) {
    rules=new WeekFields(firstDayOfWeek,minimalDaysInFirstWeek);
    CACHE.putIfAbsent(key,rules);
    rules=CACHE.get(key);
  }
  return rules;
}
Program: 78483
Project: 78483
Buggy source:
/** 
 * The object on which the Event initially occurred.
 * @return   The object on which the Event initially occurred.
 */
public Object getSource(){
  return source;
}

Fixed version (ground truth):
/** 
 * The object on which the Event initially occurred.
 * @return the object on which the Event initially occurred
 */
public Object getSource(){
  return source;
}
Program: 78484
Project: 78484
Buggy source:
/** 
 * Returns a String representation of this EventObject.
 * @return  A a String representation of this EventObject.
 */
public String toString(){
  return getClass().getName() + "String_Node_Str" + source+ "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * Returns a String representation of this EventObject.
 * @return a String representation of this EventObject
 */
public String toString(){
  return getClass().getName() + "String_Node_Str" + source+ "String_Node_Str";
}
Program: 78485
Project: 78485
Buggy source:
/** 
 * Constructs a prototypical Event.
 * @param source    The object on which the Event initially occurred.
 * @exception IllegalArgumentException  if source is null.
 */
public EventObject(Object source){
  if (source == null)   throw new IllegalArgumentException("String_Node_Str");
  this.source=source;
}

Fixed version (ground truth):
/** 
 * Constructs a prototypical Event.
 * @param source the object on which the Event initially occurred
 * @throws IllegalArgumentException if source is null
 */
public EventObject(Object source){
  if (source == null)   throw new IllegalArgumentException("String_Node_Str");
  this.source=source;
}
Program: 78487
Project: 78487
Buggy source:
/** 
 * Static factory. Given a (generic) class, actual type arguments and an owner type, creates a parameterized type. This class can be instantiated with a a raw type that does not represent a generic type, provided the list of actual type arguments is empty. If the ownerType argument is null, the declaring class of the raw type is used as the owner type. <p> This method throws a MalformedParameterizedTypeException under the following circumstances: If the number of actual type arguments (i.e., the size of the array   {@code typeArgs}) does not correspond to the number of formal type arguments. If any of the actual type arguments is not an instance of the bounds on the corresponding formal.
 * @param rawType the Class representing the generic type declaration beinginstantiated
 * @param actualTypeArguments a (possibly empty) array of typesrepresenting the actual type arguments to the parameterized type
 * @param ownerType the enclosing type, if known.
 * @return An instance of {@code ParameterizedType}
 * @throws MalformedParameterizedTypeException if the instantiationis invalid
 */
public static ParameterizedTypeImpl make(Class<?> rawType,Type[] actualTypeArguments,Type ownerType){
  return new ParameterizedTypeImpl(rawType,actualTypeArguments,ownerType);
}

Fixed version (ground truth):
/** 
 * Static factory. Given a (generic) class, actual type arguments and an owner type, creates a parameterized type. This class can be instantiated with a raw type that does not represent a generic type, provided the list of actual type arguments is empty. If the ownerType argument is null, the declaring class of the raw type is used as the owner type. <p> This method throws a MalformedParameterizedTypeException under the following circumstances: If the number of actual type arguments (i.e., the size of the array   {@code typeArgs}) does not correspond to the number of formal type arguments. If any of the actual type arguments is not an instance of the bounds on the corresponding formal.
 * @param rawType the Class representing the generic type declaration beinginstantiated
 * @param actualTypeArguments a (possibly empty) array of typesrepresenting the actual type arguments to the parameterized type
 * @param ownerType the enclosing type, if known.
 * @return An instance of {@code ParameterizedType}
 * @throws MalformedParameterizedTypeException if the instantiationis invalid
 */
public static ParameterizedTypeImpl make(Class<?> rawType,Type[] actualTypeArguments,Type ownerType){
  return new ParameterizedTypeImpl(rawType,actualTypeArguments,ownerType);
}
Program: 78489
Project: 78489
Buggy source:
/** 
 * Get the certificate constraints path length from the the critical BasicConstraints extension, (oid = 2.5.29.19).
 * @return the length of the constraint.
 */
public int getBasicConstraints(){
  try {
    String extAlias=OIDMap.getName(PKIXExtensions.BasicConstraints_Id);
    if (extAlias == null)     return -1;
    BasicConstraintsExtension certExt=(BasicConstraintsExtension)this.get(extAlias);
    if (certExt == null)     return -1;
    if (((Boolean)certExt.get(BasicConstraintsExtension.IS_CA)).booleanValue() == true)     return ((Integer)certExt.get(BasicConstraintsExtension.PATH_LEN)).intValue();
 else     return -1;
  }
 catch (  Exception e) {
    return -1;
  }
}

Fixed version (ground truth):
/** 
 * Get the certificate constraints path length from the critical BasicConstraints extension, (oid = 2.5.29.19).
 * @return the length of the constraint.
 */
public int getBasicConstraints(){
  try {
    String extAlias=OIDMap.getName(PKIXExtensions.BasicConstraints_Id);
    if (extAlias == null)     return -1;
    BasicConstraintsExtension certExt=(BasicConstraintsExtension)this.get(extAlias);
    if (certExt == null)     return -1;
    if (((Boolean)certExt.get(BasicConstraintsExtension.IS_CA)).booleanValue() == true)     return ((Integer)certExt.get(BasicConstraintsExtension.PATH_LEN)).intValue();
 else     return -1;
  }
 catch (  Exception e) {
    return -1;
  }
}
Program: 78490
Project: 78490
Buggy source:
/** 
 * Get the particular property in the underlying implementation of  {@code Marshaller}.  This method can only be used to get one of the standard JAXB defined properties above or a provider specific property.  Attempting to get an undefined property will result in a PropertyException being thrown.  See <a href="#supportedProps"> Supported Properties</a>.
 * @param name the name of the property to retrieve
 * @return the value of the requested property
 * @throws PropertyException when there is an error retrieving the given property or value property name
 * @throws IllegalArgumentException If the name parameter is null
 */
public Object getProperty(String name) throws PropertyException ;

Fixed version (ground truth):
/** 
 * Get the particular property in the underlying implementation of  {@code Marshaller}.  This method can only be used to get one of the standard JAXB defined properties above or a provider specific property.  Attempting to get an undefined property will result in a PropertyException being thrown.  See <a href="  {@docRoot}/javax/xml/bind/Marshaller.html#supportedProps"> Supported Properties</a>.
 * @param name the name of the property to retrieve
 * @return the value of the requested property
 * @throws PropertyException when there is an error retrieving the given property or value property name
 * @throws IllegalArgumentException If the name parameter is null
 */
public Object getProperty(String name) throws PropertyException ;
Program: 78491
Project: 78491
Buggy source:
/** 
 * Marshal the content tree rooted at   {@code jaxbElement} into a{@link javax.xml.stream.XMLEventWriter}.
 * @param jaxbElement The content tree rooted at jaxbElement to be marshalled.
 * @param writer XML will be sent to this writer.
 * @throws JAXBException If any unexpected problem occurs during the marshalling.
 * @throws MarshalException If the  {@link ValidationEventHandler ValidationEventHandler}returns false from its   {@code handleEvent} method or the{@code Marshaller} is unable to marshal {@code jaxbElement} (or anyobject reachable from  {@code jaxbElement}).  See <a href="#elementMarshalling"> Marshalling a JAXB element</a>.
 * @throws IllegalArgumentException If any of the method parameters are null
 * @since 1.6, JAXB 2.0
 */
public void marshal(Object jaxbElement,javax.xml.stream.XMLEventWriter writer) throws JAXBException ;

Fixed version (ground truth):
/** 
 * Marshal the content tree rooted at   {@code jaxbElement} into a{@link javax.xml.stream.XMLEventWriter}.
 * @param jaxbElement The content tree rooted at jaxbElement to be marshalled.
 * @param writer XML will be sent to this writer.
 * @throws JAXBException If any unexpected problem occurs during the marshalling.
 * @throws MarshalException If the  {@link ValidationEventHandler ValidationEventHandler}returns false from its   {@code handleEvent} method or the{@code Marshaller} is unable to marshal {@code jaxbElement} (or anyobject reachable from  {@code jaxbElement}).  See <a href="  {@docRoot}/javax/xml/bind/Marshaller.html#elementMarshalling"> Marshalling a JAXB element</a>.
 * @throws IllegalArgumentException If any of the method parameters are null
 * @since 1.6, JAXB 2.0
 */
public void marshal(Object jaxbElement,javax.xml.stream.XMLEventWriter writer) throws JAXBException ;
Program: 78492
Project: 78492
Buggy source:
/** 
 * Set the particular property in the underlying implementation of  {@code Marshaller}.  This method can only be used to set one of the standard JAXB defined properties above or a provider specific property.  Attempting to set an undefined property will result in a PropertyException being thrown.  See <a href="#supportedProps"> Supported Properties</a>.
 * @param name the name of the property to be set. This value can eitherbe specified using one of the constant fields or a user supplied string.
 * @param value the value of the property to be set
 * @throws PropertyException when there is an error processing the givenproperty or value
 * @throws IllegalArgumentException If the name parameter is null
 */
public void setProperty(String name,Object value) throws PropertyException ;

Fixed version (ground truth):
/** 
 * Set the particular property in the underlying implementation of  {@code Marshaller}.  This method can only be used to set one of the standard JAXB defined properties above or a provider specific property.  Attempting to set an undefined property will result in a PropertyException being thrown.  See <a href="  {@docRoot}/javax/xml/bind/Marshaller.html#supportedProps"> Supported Properties</a>.
 * @param name the name of the property to be set. This value can eitherbe specified using one of the constant fields or a user supplied string.
 * @param value the value of the property to be set
 * @throws PropertyException when there is an error processing the givenproperty or value
 * @throws IllegalArgumentException If the name parameter is null
 */
public void setProperty(String name,Object value) throws PropertyException ;
Program: 78493
Project: 78493
Buggy source:
/** 
 * Returns a   {@code LockInfo} object represented by thegiven  {@code CompositeData}. The given   {@code CompositeData} must contain the following attributes:<blockquote> <table border="1"> <caption style="display:none">The attributes and the types the given CompositeData contains</caption> <tr> <th style="text-align:left">Attribute Name</th> <th style="text-align:left">Type</th> </tr> <tr> <td>className</td> <td> {@code java.lang.String}</td> </tr> <tr> <td>identityHashCode</td> <td>  {@code java.lang.Integer}</td> </tr> </table> </blockquote>
 * @param cd {@code CompositeData} representing a {@code LockInfo}
 * @throws IllegalArgumentException if {@code cd} does notrepresent a  {@code LockInfo} with the attributes describedabove.
 * @return a {@code LockInfo} object representedby  {@code cd} if {@code cd} is not {@code null};  {@code null} otherwise.
 * @since 1.8
 */
public static LockInfo from(CompositeData cd){
  if (cd == null) {
    return null;
  }
  if (cd instanceof LockInfoCompositeData) {
    return ((LockInfoCompositeData)cd).getLockInfo();
  }
 else {
    return LockInfoCompositeData.toLockInfo(cd);
  }
}

Fixed version (ground truth):
/** 
 * Returns a   {@code LockInfo} object represented by thegiven  {@code CompositeData}. The given   {@code CompositeData} must contain the following attributes:<table class="striped" style="margin-left:2em;"> <caption style="display:none">The attributes and the types the given CompositeData contains</caption> <thead style="text-align:left"> <tr> <th scope="col">Attribute Name</th> <th scope="col">Type</th> </tr> </thead> <tbody style="text-align:left"> <tr> <th scope="row">className</th> <td> {@code java.lang.String}</td> </tr> <tr> <th scope="row">identityHashCode</th> <td>  {@code java.lang.Integer}</td> </tr> </tbody> </table>
 * @param cd {@code CompositeData} representing a {@code LockInfo}
 * @throws IllegalArgumentException if {@code cd} does notrepresent a  {@code LockInfo} with the attributes describedabove.
 * @return a {@code LockInfo} object representedby  {@code cd} if {@code cd} is not {@code null};  {@code null} otherwise.
 * @since 1.8
 */
public static LockInfo from(CompositeData cd){
  if (cd == null) {
    return null;
  }
  if (cd instanceof LockInfoCompositeData) {
    return ((LockInfoCompositeData)cd).getLockInfo();
  }
 else {
    return LockInfoCompositeData.toLockInfo(cd);
  }
}
Program: 78494
Project: 78494
Buggy source:
/** 
 * Returns a   {@code MemoryNotificationInfo} object represented by thegiven  {@code CompositeData}. The given   {@code CompositeData} must containthe following attributes: <blockquote> <table border="1"> <caption style="display:none">The attributes and the types the given CompositeData contains</caption> <tr> <th style="text-align:left">Attribute Name</th> <th style="text-align:left">Type</th> </tr> <tr> <td>poolName</td> <td> {@code java.lang.String}</td> </tr> <tr> <td>usage</td> <td>  {@code javax.management.openmbean.CompositeData}</td> </tr> <tr> <td>count</td> <td>  {@code java.lang.Long}</td> </tr> </table> </blockquote>
 * @param cd {@code CompositeData} representing a{@code MemoryNotificationInfo}
 * @throws IllegalArgumentException if {@code cd} does notrepresent a  {@code MemoryNotificationInfo} object.
 * @return a {@code MemoryNotificationInfo} object representedby  {@code cd} if {@code cd} is not {@code null};  {@code null} otherwise.
 */
public static MemoryNotificationInfo from(CompositeData cd){
  if (cd == null) {
    return null;
  }
  if (cd instanceof MemoryNotifInfoCompositeData) {
    return ((MemoryNotifInfoCompositeData)cd).getMemoryNotifInfo();
  }
 else {
    return new MemoryNotificationInfo(cd);
  }
}

Fixed version (ground truth):
/** 
 * Returns a   {@code MemoryNotificationInfo} object represented by thegiven  {@code CompositeData}. The given   {@code CompositeData} must containthe following attributes: <table class="striped" style="margin-left:2em"> <caption style="display:none">The attributes and the types the given CompositeData contains</caption> <thead> <tr> <th scope="col">Attribute Name</th> <th scope="col">Type</th> </tr> </thead> <tbody style="text-align:left"> <tr> <th scope="row">poolName</th> <td> {@code java.lang.String}</td> </tr> <tr> <th scope="row">usage</th> <td>  {@code javax.management.openmbean.CompositeData}</td> </tr> <tr> <th scope="row">count</th> <td>  {@code java.lang.Long}</td> </tr> </tbody> </table>
 * @param cd {@code CompositeData} representing a{@code MemoryNotificationInfo}
 * @throws IllegalArgumentException if {@code cd} does notrepresent a  {@code MemoryNotificationInfo} object.
 * @return a {@code MemoryNotificationInfo} object representedby  {@code cd} if {@code cd} is not {@code null};  {@code null} otherwise.
 */
public static MemoryNotificationInfo from(CompositeData cd){
  if (cd == null) {
    return null;
  }
  if (cd instanceof MemoryNotifInfoCompositeData) {
    return ((MemoryNotifInfoCompositeData)cd).getMemoryNotifInfo();
  }
 else {
    return new MemoryNotificationInfo(cd);
  }
}
Program: 78495
Project: 78495
Buggy source:
/** 
 * Returns a   {@code MemoryUsage} object represented by thegiven  {@code CompositeData}. The given   {@code CompositeData}must contain the following attributes: <blockquote> <table border="1"> <caption style="display:none">The attributes and the types the given CompositeData contains</caption> <tr> <th style="text-align:left">Attribute Name</th> <th style="text-align:left">Type</th> </tr> <tr> <td>init</td> <td>  {@code java.lang.Long}</td> </tr> <tr> <td>used</td> <td>  {@code java.lang.Long}</td> </tr> <tr> <td>committed</td> <td>  {@code java.lang.Long}</td> </tr> <tr> <td>max</td> <td>  {@code java.lang.Long}</td> </tr> </table> </blockquote>
 * @param cd {@code CompositeData} representing a {@code MemoryUsage}
 * @throws IllegalArgumentException if {@code cd} does notrepresent a  {@code MemoryUsage} with the attributes describedabove.
 * @return a {@code MemoryUsage} object represented by {@code cd}if   {@code cd} is not {@code null};  {@code null} otherwise.
 */
public static MemoryUsage from(CompositeData cd){
  if (cd == null) {
    return null;
  }
  if (cd instanceof MemoryUsageCompositeData) {
    return ((MemoryUsageCompositeData)cd).getMemoryUsage();
  }
 else {
    return new MemoryUsage(cd);
  }
}

Fixed version (ground truth):
/** 
 * Returns a   {@code MemoryUsage} object represented by thegiven  {@code CompositeData}. The given   {@code CompositeData}must contain the following attributes: <table class="striped" style="margin-left:2em;"> <caption style="display:none">The attributes and the types the given CompositeData contains</caption> <thead> <tr> <th scope="col">Attribute Name</th> <th scope="col">Type</th> </tr> </thead> <tbody style="text-align:left"> <tr> <th scope="row">init</th> <td>  {@code java.lang.Long}</td> </tr> <tr> <th scope="row">used</th> <td>  {@code java.lang.Long}</td> </tr> <tr> <th scope="row">committed</th> <td>  {@code java.lang.Long}</td> </tr> <tr> <th scope="row">max</th> <td>  {@code java.lang.Long}</td> </tr> </tbody> </table>
 * @param cd {@code CompositeData} representing a {@code MemoryUsage}
 * @throws IllegalArgumentException if {@code cd} does notrepresent a  {@code MemoryUsage} with the attributes describedabove.
 * @return a {@code MemoryUsage} object represented by {@code cd}if   {@code cd} is not {@code null};  {@code null} otherwise.
 */
public static MemoryUsage from(CompositeData cd){
  if (cd == null) {
    return null;
  }
  if (cd instanceof MemoryUsageCompositeData) {
    return ((MemoryUsageCompositeData)cd).getMemoryUsage();
  }
 else {
    return new MemoryUsage(cd);
  }
}
Program: 78497
Project: 78497
Buggy source:
/** 
 * Gets the DER-encoded OCTET string for the extension value (<em>extnValue</em>) identified by the passed-in   {@code oid}String. The   {@code oid} string isrepresented by a set of nonnegative whole numbers separated by periods. <p>For example:<br> <table class="plain"> <caption style="display:none">Examples of OIDs and extension names</caption> <thead> <tr> <th>OID <em>(Object Identifier)</em></th> <th>Extension Name</th></tr> </thead> <tbody> <tr><td>2.5.29.14</td> <td>SubjectKeyIdentifier</td></tr> <tr><td>2.5.29.15</td> <td>KeyUsage</td></tr> <tr><td>2.5.29.16</td> <td>PrivateKeyUsage</td></tr> <tr><td>2.5.29.17</td> <td>SubjectAlternativeName</td></tr> <tr><td>2.5.29.18</td> <td>IssuerAlternativeName</td></tr> <tr><td>2.5.29.19</td> <td>BasicConstraints</td></tr> <tr><td>2.5.29.30</td> <td>NameConstraints</td></tr> <tr><td>2.5.29.33</td> <td>PolicyMappings</td></tr> <tr><td>2.5.29.35</td> <td>AuthorityKeyIdentifier</td></tr> <tr><td>2.5.29.36</td> <td>PolicyConstraints</td></tr> </tbody> </table>
 * @param oid the Object Identifier value for the extension.
 * @return the DER-encoded octet string of the extension value ornull if it is not present.
 */
public byte[] getExtensionValue(String oid);

Fixed version (ground truth):
/** 
 * Gets the DER-encoded OCTET string for the extension value (<em>extnValue</em>) identified by the passed-in   {@code oid}String. The   {@code oid} string isrepresented by a set of nonnegative whole numbers separated by periods. <p>For example:<br> <table class="striped"> <caption style="display:none">Examples of OIDs and extension names</caption> <thead> <tr> <th scope="col">OID <em>(Object Identifier)</em></th> <th scope="col">Extension Name</th></tr> </thead> <tbody style="text-align:left"> <tr><th scope="row">2.5.29.14</th> <td>SubjectKeyIdentifier</td></tr> <tr><th scope="row">2.5.29.15</th> <td>KeyUsage</td></tr> <tr><th scope="row">2.5.29.16</th> <td>PrivateKeyUsage</td></tr> <tr><th scope="row">2.5.29.17</th> <td>SubjectAlternativeName</td></tr> <tr><th scope="row">2.5.29.18</th> <td>IssuerAlternativeName</td></tr> <tr><th scope="row">2.5.29.19</th> <td>BasicConstraints</td></tr> <tr><th scope="row">2.5.29.30</th> <td>NameConstraints</td></tr> <tr><th scope="row">2.5.29.33</th> <td>PolicyMappings</td></tr> <tr><th scope="row">2.5.29.35</th> <td>AuthorityKeyIdentifier</td></tr> <tr><th scope="row">2.5.29.36</th> <td>PolicyConstraints</td></tr> </tbody> </table>
 * @param oid the Object Identifier value for the extension.
 * @return the DER-encoded octet string of the extension value ornull if it is not present.
 */
public byte[] getExtensionValue(String oid);
Program: 78498
Project: 78498
Buggy source:
/** 
 * Determines if the specified character is ISO-LATIN-1 white space. This method returns   {@code true} for the following fivecharacters only: <table class="borderless"> <caption style="display:none">truechars</caption> <tbody> <tr><td> {@code '\t'}</td>            <td>  {@code U+0009}</td> <td>  {@code HORIZONTAL TABULATION}</td></tr> <tr><td>  {@code '\n'}</td>            <td>  {@code U+000A}</td> <td>  {@code NEW LINE}</td></tr> <tr><td>  {@code '\f'}</td>            <td>  {@code U+000C}</td> <td>  {@code FORM FEED}</td></tr> <tr><td>  {@code '\r'}</td>            <td>  {@code U+000D}</td> <td>  {@code CARRIAGE RETURN}</td></tr> <tr><td>  {@code ' '}</td>  <td>  {@code U+0020}</td> <td>  {@code SPACE}</td></tr> </tbody> </table>
 * @param ch   the character to be tested.
 * @return     {@code true} if the character is ISO-LATIN-1 whitespace;  {@code false} otherwise.
 * @see Character#isSpaceChar(char)
 * @see Character#isWhitespace(char)
 * @deprecated Replaced by isWhitespace(char).
 */
@Deprecated(since="String_Node_Str") public static boolean isSpace(char ch){
  return (ch <= 0x0020) && (((((1L << 0x0009) | (1L << 0x000A) | (1L << 0x000C)| (1L << 0x000D)| (1L << 0x0020)) >> ch) & 1L) != 0);
}

Fixed version (ground truth):
/** 
 * Determines if the specified character is ISO-LATIN-1 white space. This method returns   {@code true} for the following fivecharacters only: <table class="striped"> <caption style="display:none">truechars</caption> <thead> <tr><th scope="col">Character <th scope="col">Code <th scope="col">Name </thead> <tbody> <tr><th scope="row"> {@code '\t'}</th>            <td>  {@code U+0009}</td> <td>  {@code HORIZONTAL TABULATION}</td></tr> <tr><th scope="row">  {@code '\n'}</th>            <td>  {@code U+000A}</td> <td>  {@code NEW LINE}</td></tr> <tr><th scope="row">  {@code '\f'}</th>            <td>  {@code U+000C}</td> <td>  {@code FORM FEED}</td></tr> <tr><th scope="row">  {@code '\r'}</th>            <td>  {@code U+000D}</td> <td>  {@code CARRIAGE RETURN}</td></tr> <tr><th scope="row">  {@code ' '}</th>  <td>  {@code U+0020}</td> <td>  {@code SPACE}</td></tr> </tbody> </table>
 * @param ch   the character to be tested.
 * @return     {@code true} if the character is ISO-LATIN-1 whitespace;  {@code false} otherwise.
 * @see Character#isSpaceChar(char)
 * @see Character#isWhitespace(char)
 * @deprecated Replaced by isWhitespace(char).
 */
@Deprecated(since="String_Node_Str") public static boolean isSpace(char ch){
  return (ch <= 0x0020) && (((((1L << 0x0009) | (1L << 0x000A) | (1L << 0x000C)| (1L << 0x000D)| (1L << 0x0020)) >> ch) & 1L) != 0);
}
Program: 78501
Project: 78501
Buggy source:
/** 
 * Splits this string around matches of the given <a href="../util/regex/Pattern.html#sum">regular expression</a>. <p> This method works as if by invoking the two-argument   {@link #split(String,int) split} method with the given expression and a limitargument of zero.  Trailing empty strings are therefore not included in the resulting array. <p> The string  {@code "boo:and:foo"}, for example, yields the following results with these expressions: <blockquote><table class="plain"> <caption style="display:none">Split examples showing regex and result</caption> <thead> <tr> <th>Regex</th> <th>Result</th> </tr> </thead> <tbody> <tr><td style="text-align:center">:</td> <td>  {@code} "boo", "and", "foo" }}</td></tr> <tr><td style="text-align:center">o</td> <td> {@code} "b", "", ":and:f" }}</td></tr> </tbody> </table></blockquote>
 * @param regex the delimiting regular expression
 * @return  the array of strings computed by splitting this stringaround matches of the given regular expression
 * @throws PatternSyntaxException if the regular expression's syntax is invalid
 * @see java.util.regex.Pattern
 * @since 1.4
 * @spec JSR-51
 */
public String[] split(String regex){
  return split(regex,0);
}

Fixed version (ground truth):
/** 
 * Splits this string around matches of the given <a href="../util/regex/Pattern.html#sum">regular expression</a>. <p> This method works as if by invoking the two-argument   {@link #split(String,int) split} method with the given expression and a limitargument of zero.  Trailing empty strings are therefore not included in the resulting array. <p> The string  {@code "boo:and:foo"}, for example, yields the following results with these expressions: <blockquote><table class="plain"> <caption style="display:none">Split examples showing regex and result</caption> <thead> <tr> <th scope="col">Regex</th> <th scope="col">Result</th> </tr> </thead> <tbody> <tr><th scope="row" style="text-weight:normal">:</th> <td>  {@code} "boo", "and", "foo" }}</td></tr> <tr><th scope="row" style="text-weight:normal">o</th> <td> {@code} "b", "", ":and:f" }}</td></tr> </tbody> </table></blockquote>
 * @param regex the delimiting regular expression
 * @return  the array of strings computed by splitting this stringaround matches of the given regular expression
 * @throws PatternSyntaxException if the regular expression's syntax is invalid
 * @see java.util.regex.Pattern
 * @since 1.4
 * @spec JSR-51
 */
public String[] split(String regex){
  return split(regex,0);
}
Program: 78503
Project: 78503
Buggy source:
/** 
 * Indicates that the caller is momentarily unable to progress, until the occurrence of one or more actions on the part of other activities. By invoking this method within each iteration of a spin-wait loop construct, the calling thread indicates to the runtime that it is busy-waiting. The runtime may take action to improve the performance of invoking spin-wait loop constructions. <p>
 * @apiNote As an example consider a method in a class that spins in a loop until some flag is set outside of that method. A call to the  {@code onSpinWait}method should be placed inside the spin loop. <pre>  {@code}class EventHandler  volatile boolean eventNotificationNotReceived; void waitForEventAndHandleIt() { while ( eventNotificationNotReceived ) { java.lang.Thread.onSpinWait(); } readAndProcessEvent(); } void readAndProcessEvent() { // Read event from some source and process it . . . } } }</pre> <p> The code above would remain correct even if the   {@code onSpinWait}method was not called at all. However on some architectures the Java Virtual Machine may issue the processor instructions to address such code patterns in a more beneficial way. <p>
 * @since 9
 */
@HotSpotIntrinsicCandidate public static void onSpinWait(){
}

Fixed version (ground truth):
/** 
 * Indicates that the caller is momentarily unable to progress, until the occurrence of one or more actions on the part of other activities. By invoking this method within each iteration of a spin-wait loop construct, the calling thread indicates to the runtime that it is busy-waiting. The runtime may take action to improve the performance of invoking spin-wait loop constructions.
 * @apiNote As an example consider a method in a class that spins in a loop until some flag is set outside of that method. A call to the  {@code onSpinWait}method should be placed inside the spin loop. <pre>  {@code}class EventHandler  volatile boolean eventNotificationNotReceived; void waitForEventAndHandleIt() { while ( eventNotificationNotReceived ) { java.lang.Thread.onSpinWait(); } readAndProcessEvent(); } void readAndProcessEvent() { // Read event from some source and process it . . . } } }</pre> <p> The code above would remain correct even if the   {@code onSpinWait}method was not called at all. However on some architectures the Java Virtual Machine may issue the processor instructions to address such code patterns in a more beneficial way.
 * @since 9
 */
@HotSpotIntrinsicCandidate public static void onSpinWait(){
}