nus-yam/ex-repair huggingface dataset:
Program: 76748
Project: 76748
Buggy source:
private void sendData(Context context,ArrayList<Uri> uris){
  int len=0;
  byte buf[]=new byte[1024];
  Log.d("String_Node_Str","String_Node_Str");
  Socket socket=new Socket();
  try {
    socket.bind(null);
    Log.d("String_Node_Str",socket.getLocalSocketAddress().toString());
    socket.connect(new InetSocketAddress(serverAddress,8888));
    Log.d("String_Node_Str","String_Node_Str");
    OutputStream outputStream=socket.getOutputStream();
    ObjectOutputStream objectOutputStream=new ObjectOutputStream(outputStream);
    ContentResolver cr=context.getContentResolver();
    objectOutputStream.writeInt(uris.size());
    objectOutputStream.writeObject(fileNames);
    objectOutputStream.flush();
    objectOutputStream.writeObject(filesLength);
    objectOutputStream.flush();
    for (int i=0; i < uris.size(); i++) {
      InputStream inputStream=cr.openInputStream(uris.get(i));
      while ((len=inputStream.read(buf)) != -1) {
        objectOutputStream.write(buf,0,len);
        objectOutputStream.flush();
      }
      inputStream.close();
      publishProgress(i);
      if (this.isCancelled())       return;
      Log.d("String_Node_Str","String_Node_Str" + len);
    }
    objectOutputStream.close();
    socket.close();
  }
 catch (  Exception e) {
    Log.d("String_Node_Str",e.toString());
    e.printStackTrace();
  }
 finally {
    if (socket.isConnected()) {
      try {
        socket.close();
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
  }
}

Fixed version (ground truth):
private void sendData(Context context,ArrayList<Uri> uris){
  int len=0;
  byte buf[]=new byte[1024];
  Log.d("String_Node_Str","String_Node_Str");
  Socket socket=new Socket();
  try {
    socket.bind(null);
    Log.d("String_Node_Str",socket.getLocalSocketAddress().toString());
    socket.connect(new InetSocketAddress(serverAddress,8888));
    Log.d("String_Node_Str","String_Node_Str");
    OutputStream outputStream=socket.getOutputStream();
    ObjectOutputStream objectOutputStream=new ObjectOutputStream(outputStream);
    ContentResolver cr=context.getContentResolver();
    objectOutputStream.writeInt(uris.size());
    objectOutputStream.writeObject(fileNames);
    objectOutputStream.flush();
    objectOutputStream.writeObject(filesLength);
    objectOutputStream.flush();
    for (int i=0; i < uris.size(); i++) {
      InputStream inputStream=cr.openInputStream(uris.get(i));
      while ((len=inputStream.read(buf)) != -1) {
        objectOutputStream.write(buf,0,len);
      }
      inputStream.close();
      publishProgress(fileNames.get(i));
      Log.d("String_Node_Str","String_Node_Str" + len);
    }
    objectOutputStream.close();
    socket.close();
  }
 catch (  Exception e) {
    Log.d("String_Node_Str",e.toString());
    e.printStackTrace();
  }
 finally {
    if (socket.isConnected()) {
      try {
        socket.close();
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
  }
}
Program: 76749
Project: 76749
Buggy source:
@Override protected void onProgressUpdate(Integer... values){
  super.onProgressUpdate(values);
  Log.d("String_Node_Str",this.sendFilesAdapter.filesViewHolders.toString());
  this.sendFilesAdapter.filesViewHolders.get(values[0]).stateFile.setImageResource(R.drawable.d_icon_done);
}

Fixed version (ground truth):
@Override protected void onProgressUpdate(String... values){
  super.onProgressUpdate(values);
  Log.d("String_Node_Str",this.sendFilesAdapter.filesViewHolders.toString());
  for (int i=0; i < this.sendFilesAdapter.filesViewHolders.size(); i++) {
    if (this.sendFilesAdapter.filesViewHolders.get(i).fileModel.getFileName().equals(values[0])) {
      this.sendFilesAdapter.filesViewHolders.get(i).stateFile.setImageResource(R.drawable.d_icon_done);
    }
  }
}
Program: 76750
Project: 76750
Buggy source:
public TransferData(Context context,FilesSendAdapter referenceSendFilesAdapter,InetAddress serverAddress,final WifiP2pManager manager,final WifiP2pManager.Channel channel){
  this.context=context;
  this.channel=channel;
  this.manager=manager;
  this.sendFilesAdapter=referenceSendFilesAdapter;
  this.uris=referenceSendFilesAdapter.uris;
  this.fileNames=referenceSendFilesAdapter.fileNames;
  this.filesLength=referenceSendFilesAdapter.filesLength;
  this.serverAddress=serverAddress;
  Log.d("String_Node_Str",serverAddress.getHostAddress());
  Toast.makeText(context,"String_Node_Str",Toast.LENGTH_SHORT).show();
}

Fixed version (ground truth):
public TransferData(Context context,ArrayList<Uri> uris,ArrayList<Long> filesLength,ArrayList<String> fileNames,FilesSendAdapter referenceSendFilesAdapter,InetAddress serverAddress,final WifiP2pManager manager,final WifiP2pManager.Channel channel){
  this.context=context;
  this.channel=channel;
  this.manager=manager;
  this.sendFilesAdapter=referenceSendFilesAdapter;
  this.uris=uris;
  this.fileNames=fileNames;
  this.filesLength=filesLength;
  this.serverAddress=serverAddress;
  Log.d("String_Node_Str",serverAddress.getHostAddress());
  Toast.makeText(context,"String_Node_Str",Toast.LENGTH_SHORT).show();
}
Program: 76751
Project: 76751
Buggy source:
@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
  super.onActivityResult(requestCode,resultCode,data);
switch (requestCode) {
case ChooseFile.FILE_TRANSFER_CODE:
    if (data == null)     return;
  ArrayList<Uri> uris=new ArrayList<>();
ArrayList<Long> filesLength=new ArrayList<>();
ArrayList<String> fileNames=new ArrayList<>();
try {
ClipData clipData=data.getClipData();
if (clipData != null) {
for (int i=0; i < clipData.getItemCount(); i++) {
  uris.add(clipData.getItemAt(i).getUri());
  String fileName=PathUtil.getPath(getApplicationContext(),clipData.getItemAt(i).getUri());
  filesLength.add(new File(fileName).length());
  fileName=FilesUtil.getFileName(fileName);
  fileNames.add(fileName);
  Log.d("String_Node_Str",clipData.getItemAt(i).getUri().toString());
  Log.d("String_Node_Str",fileName);
}
}
 else {
Uri uri=data.getData();
uris.add(uri);
String fileName=PathUtil.getPath(getApplicationContext(),uri);
filesLength.add(new File(fileName).length());
fileName=FilesUtil.getFileName(fileName);
fileNames.add(fileName);
}
sendFilesAdapter.notifyAdapter(uris,filesLength,fileNames);
TransferData transferData=new TransferData(SendFileActivity.this,(sendFilesAdapter),serverAddress,p2pManager,channel);
transferData.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
 catch (Exception e) {
e.printStackTrace();
}
}
}

Fixed version (ground truth):
@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
  super.onActivityResult(requestCode,resultCode,data);
switch (requestCode) {
case ChooseFile.FILE_TRANSFER_CODE:
    if (data == null)     return;
  ArrayList<Uri> uris=new ArrayList<>();
ArrayList<Long> filesLength=new ArrayList<>();
ArrayList<String> fileNames=new ArrayList<>();
try {
ClipData clipData=data.getClipData();
if (clipData != null) {
for (int i=0; i < clipData.getItemCount(); i++) {
  uris.add(clipData.getItemAt(i).getUri());
  String fileName=PathUtil.getPath(getApplicationContext(),clipData.getItemAt(i).getUri());
  filesLength.add(new File(fileName).length());
  fileName=FilesUtil.getFileName(fileName);
  fileNames.add(fileName);
  Log.d("String_Node_Str",clipData.getItemAt(i).getUri().toString());
  Log.d("String_Node_Str",fileName);
}
}
 else {
Uri uri=data.getData();
uris.add(uri);
String fileName=PathUtil.getPath(getApplicationContext(),uri);
filesLength.add(new File(fileName).length());
fileName=FilesUtil.getFileName(fileName);
fileNames.add(fileName);
}
sendFilesAdapter.notifyAdapter(uris,filesLength,fileNames);
TransferData transferData=new TransferData(SendFileActivity.this,uris,filesLength,fileNames,(sendFilesAdapter),serverAddress,p2pManager,channel);
transferData.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
 catch (Exception e) {
e.printStackTrace();
}
}
}
Program: 76752
Project: 76752
Buggy source:
public static void connect(String deviceAddress,final WifiP2pManager manager,final WifiP2pManager.Channel channel,final Context context,WifiP2pManager.ActionListener listener){
  final WifiP2pConfig config=new WifiP2pConfig();
  config.deviceAddress=deviceAddress;
  Log.d("String_Node_Str","String_Node_Str");
  manager.connect(channel,config,listener);
}

Fixed version (ground truth):
public static void connect(String deviceAddress,final WifiP2pManager manager,final WifiP2pManager.Channel channel,final Context context,WifiP2pManager.ActionListener listener){
  final WifiP2pConfig config=new WifiP2pConfig();
  config.deviceAddress=deviceAddress;
  config.groupOwnerIntent=0;
  Log.d("String_Node_Str","String_Node_Str");
  manager.connect(channel,config,listener);
}
Program: 76754
Project: 76754
Buggy source:
private void check(CompileCodeTestCase testCase){
  System.out.println(testCase);
  NMethod nMethod=testCase.deoptimizeAndCompile();
  if (nMethod == null) {
    throw new Error(testCase + "String_Node_Str");
  }
  InstalledCode installedCode=testCase.toInstalledCode();
  String str=CompilerToVMHelper.disassembleCodeBlob(installedCode);
  if (str != null) {
    Asserts.assertGT(str.length(),0,testCase + "String_Node_Str");
  }
  String str2=CompilerToVMHelper.disassembleCodeBlob(installedCode);
  Asserts.assertEQ(str,str2,testCase + "String_Node_Str");
}

Fixed version (ground truth):
private void check(CompileCodeTestCase testCase){
  System.out.println(testCase);
  NMethod nMethod=testCase.deoptimizeAndCompile();
  if (nMethod == null) {
    throw new Error(testCase + "String_Node_Str");
  }
  InstalledCode installedCode=testCase.toInstalledCode();
  String str1=CompilerToVMHelper.disassembleCodeBlob(installedCode);
  if (str1 != null) {
    Asserts.assertGT(str1.length(),0,testCase + "String_Node_Str");
  }
  String str2=CompilerToVMHelper.disassembleCodeBlob(installedCode);
  String str3=CompilerToVMHelper.disassembleCodeBlob(installedCode);
  Asserts.assertEQ(str2,str3,testCase + "String_Node_Str");
}
Program: 76755
Project: 76755
Buggy source:
@Override public boolean finishOptionSettings(){
  if (!validateOptions()) {
    return false;
  }
  if (!getSpecifiedTypeElements().isEmpty()) {
    Map<String,PackageElement> map=new HashMap<>();
    PackageElement pkg;
    for (    TypeElement aClass : getIncludedTypeElements()) {
      pkg=utils.containingPackage(aClass);
      if (!map.containsKey(utils.getPackageName(pkg))) {
        map.put(utils.getPackageName(pkg),pkg);
      }
    }
  }
  docPaths=new DocPaths(utils,useModuleDirectories);
  setCreateOverview();
  setTopFile(docEnv);
  workArounds.initDocLint(doclintOpts.values(),tagletManager.getCustomTagNames(),Utils.toLowerCase(htmlVersion.name()));
  return true;
}

Fixed version (ground truth):
@Override public boolean finishOptionSettings(){
  if (!validateOptions()) {
    return false;
  }
  if (!getSpecifiedTypeElements().isEmpty()) {
    Map<String,PackageElement> map=new HashMap<>();
    PackageElement pkg;
    for (    TypeElement aClass : getIncludedTypeElements()) {
      pkg=utils.containingPackage(aClass);
      if (!map.containsKey(utils.getPackageName(pkg))) {
        map.put(utils.getPackageName(pkg),pkg);
      }
    }
  }
  docPaths=new DocPaths(utils,useModuleDirectories);
  setCreateOverview();
  setTopFile(docEnv);
  workArounds.initDocLint(doclintOpts.values(),tagletManager.getAllTagletNames(),Utils.toLowerCase(htmlVersion.name()));
  return true;
}
Program: 76756
Project: 76756
Buggy source:
/** 
 * Check whether there are any tags for Serialization Overview section to be printed.
 * @param field the VariableElement object to check for tags.
 * @return true if there are tags to be printed else return false.
 */
protected boolean hasSerializationOverviewTags(VariableElement field){
  Content output=new ContentBuilder();
  TagletWriter.genTagOutput(configuration.tagletManager,field,configuration.tagletManager.getCustomTaglets(field),getTagletWriterInstance(false),output);
  return !output.isEmpty();
}

Fixed version (ground truth):
/** 
 * Check whether there are any tags for Serialization Overview section to be printed.
 * @param field the VariableElement object to check for tags.
 * @return true if there are tags to be printed else return false.
 */
protected boolean hasSerializationOverviewTags(VariableElement field){
  Content output=new ContentBuilder();
  TagletWriter.genTagOutput(configuration.tagletManager,field,configuration.tagletManager.getBlockTaglets(field),getTagletWriterInstance(false),output);
  return !output.isEmpty();
}
Program: 76757
Project: 76757
Buggy source:
/** 
 * Adds the tags information.
 * @param e the Element for which the tags will be generated
 * @param htmltree the documentation tree to which the tags will be added
 */
protected void addTagsInfo(Element e,Content htmltree){
  if (configuration.nocomment) {
    return;
  }
  Content dl=new HtmlTree(HtmlTag.DL);
  if (utils.isExecutableElement(e) && !utils.isConstructor(e)) {
    addMethodInfo((ExecutableElement)e,dl);
  }
  Content output=new ContentBuilder();
  TagletWriter.genTagOutput(configuration.tagletManager,e,configuration.tagletManager.getCustomTaglets(e),getTagletWriterInstance(false),output);
  dl.addContent(output);
  htmltree.addContent(dl);
}

Fixed version (ground truth):
/** 
 * Adds the tags information.
 * @param e the Element for which the tags will be generated
 * @param htmltree the documentation tree to which the tags will be added
 */
protected void addTagsInfo(Element e,Content htmltree){
  if (configuration.nocomment) {
    return;
  }
  Content dl=new HtmlTree(HtmlTag.DL);
  if (utils.isExecutableElement(e) && !utils.isConstructor(e)) {
    addMethodInfo((ExecutableElement)e,dl);
  }
  Content output=new ContentBuilder();
  TagletWriter.genTagOutput(configuration.tagletManager,e,configuration.tagletManager.getBlockTaglets(e),getTagletWriterInstance(false),output);
  dl.addContent(output);
  htmltree.addContent(dl);
}
Program: 76759
Project: 76759
Buggy source:
/** 
 * Add the tag information for this member.
 * @param field the field to document.
 * @param contentTree the tree to which the member tags info will be added
 */
public void addMemberTags(VariableElement field,Content contentTree){
  Content tagContent=new ContentBuilder();
  TagletWriter.genTagOutput(configuration.tagletManager,field,configuration.tagletManager.getCustomTaglets(field),writer.getTagletWriterInstance(false),tagContent);
  Content dlTags=new HtmlTree(HtmlTag.DL);
  dlTags.addContent(tagContent);
  contentTree.addContent(dlTags);
}

Fixed version (ground truth):
/** 
 * Add the tag information for this member.
 * @param field the field to document.
 * @param contentTree the tree to which the member tags info will be added
 */
public void addMemberTags(VariableElement field,Content contentTree){
  Content tagContent=new ContentBuilder();
  TagletWriter.genTagOutput(configuration.tagletManager,field,configuration.tagletManager.getBlockTaglets(field),writer.getTagletWriterInstance(false),tagContent);
  Content dlTags=new HtmlTree(HtmlTag.DL);
  dlTags.addContent(tagContent);
  contentTree.addContent(dlTags);
}
Program: 76760
Project: 76760
Buggy source:
/** 
 * Initialize the taglet manager.  The strings to initialize the simple custom tags should be in the following format:  "[tag name]:[location str]:[heading]".
 * @param customTagStrs the set two dimensional arrays of strings.  These arrays containeither -tag or -taglet arguments.
 */
private void initTagletManager(Set<List<String>> customTagStrs){
  tagletManager=tagletManager == null ? new TagletManager(nosince,showversion,showauthor,javafx,this) : tagletManager;
  for (  List<String> args : customTagStrs) {
    if (args.get(0).equals("String_Node_Str")) {
      tagletManager.addCustomTag(args.get(1),getFileManager(),tagletpath);
      continue;
    }
    List<String> tokens=tokenize(args.get(1),TagletManager.SIMPLE_TAGLET_OPT_SEPARATOR,3);
    if (tokens.size() == 1) {
      String tagName=args.get(1);
      if (tagletManager.isKnownCustomTag(tagName)) {
        tagletManager.addNewSimpleCustomTag(tagName,null,"String_Node_Str");
      }
 else {
        StringBuilder heading=new StringBuilder(tagName + "String_Node_Str");
        heading.setCharAt(0,Character.toUpperCase(tagName.charAt(0)));
        tagletManager.addNewSimpleCustomTag(tagName,heading.toString(),"String_Node_Str");
      }
    }
 else     if (tokens.size() == 2) {
      tagletManager.addNewSimpleCustomTag(tokens.get(0),tokens.get(1),"String_Node_Str");
    }
 else     if (tokens.size() >= 3) {
      tagletManager.addNewSimpleCustomTag(tokens.get(0),tokens.get(2),tokens.get(1));
    }
 else {
      Messages messages=getMessages();
      messages.error("String_Node_Str",args.get(1));
    }
  }
}

Fixed version (ground truth):
/** 
 * Initialize the taglet manager.  The strings to initialize the simple custom tags should be in the following format:  "[tag name]:[location str]:[heading]".
 * @param customTagStrs the set two dimensional arrays of strings.  These arrays containeither -tag or -taglet arguments.
 */
private void initTagletManager(Set<List<String>> customTagStrs){
  tagletManager=tagletManager == null ? new TagletManager(nosince,showversion,showauthor,javafx,this) : tagletManager;
  for (  List<String> args : customTagStrs) {
    if (args.get(0).equals("String_Node_Str")) {
      tagletManager.addCustomTag(args.get(1),getFileManager(),tagletpath);
      continue;
    }
    List<String> tokens=tokenize(args.get(1),TagletManager.SIMPLE_TAGLET_OPT_SEPARATOR,3);
switch (tokens.size()) {
case 1:
      String tagName=args.get(1);
    if (tagletManager.isKnownCustomTag(tagName)) {
      tagletManager.addNewSimpleCustomTag(tagName,null,"String_Node_Str");
    }
 else {
      StringBuilder heading=new StringBuilder(tagName + "String_Node_Str");
      heading.setCharAt(0,Character.toUpperCase(tagName.charAt(0)));
      tagletManager.addNewSimpleCustomTag(tagName,heading.toString(),"String_Node_Str");
    }
  break;
case 2:
tagletManager.addNewSimpleCustomTag(tokens.get(0),tokens.get(1),"String_Node_Str");
break;
case 3:
tagletManager.addNewSimpleCustomTag(tokens.get(0),tokens.get(2),tokens.get(1));
break;
default :
Messages messages=getMessages();
messages.error("String_Node_Str",args.get(1));
}
}
}
Program: 76762
Project: 76762
Buggy source:
@Override public boolean process(String opt,List<String> args){
  disableJavaFxStrictChecks=true;
  return true;
}

Fixed version (ground truth):
@Override public boolean process(String opt,List<String> args){
  showTaglets=true;
  return true;
}
Program: 76763
Project: 76763
Buggy source:
public BasePropertyTaglet(){
}

Fixed version (ground truth):
public BasePropertyTaglet(String name){
  super(name,false,EnumSet.of(Site.METHOD));
}
Program: 76764
Project: 76764
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: 76766
Project: 76766
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: 76768
Project: 76768
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: 76770
Project: 76770
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: 76771
Project: 76771
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: 76772
Project: 76772
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: 76773
Project: 76773
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: 76775
Project: 76775
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: 76777
Project: 76777
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: 76778
Project: 76778
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: 76779
Project: 76779
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: 76780
Project: 76780
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: 76781
Project: 76781
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: 76782
Project: 76782
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: 76783
Project: 76783
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: 76785
Project: 76785
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);