nus-yam/ex-repair huggingface dataset:
Program: 36755
Project: 36755
Buggy source:
/** 
 * Returns the absolute path name of a native library.  The VM invokes this method to locate the native libraries that belong to classes loaded with this class loader. If this method returns <tt>null</tt>, the VM searches the library along the path specified as the "<tt>java.library.path</tt>" property.  </p>
 * @param libname The library name
 * @return  The absolute path of the native library
 * @see System#loadLibrary(String)
 * @see System#mapLibraryName(String)
 * @since  1.2
 */
protected String findLibrary(String libname){
  return null;
}

Fixed version (ground truth):
/** 
 * Returns the absolute path name of a native library.  The VM invokes this method to locate the native libraries that belong to classes loaded with this class loader. If this method returns <tt>null</tt>, the VM searches the library along the path specified as the "<tt>java.library.path</tt>" property.
 * @param libname The library name
 * @return  The absolute path of the native library
 * @see System#loadLibrary(String)
 * @see System#mapLibraryName(String)
 * @since  1.2
 */
protected String findLibrary(String libname){
  return null;
}
Program: 36758
Project: 36758
Buggy source:
/** 
 * Returns a redirect to append to the specified file. Each write operation first advances the position to the end of the file and then writes the requested data. Whether the advancement of the position and the writing of the data are done in a single atomic operation is system-dependent and therefore unspecified. <p>It will always be true that <pre>   {@code Redirect.appendTo(file).file() == file && Redirect.appendTo(file).type() == Redirect.Type.APPEND}</pre>
 * @throws NullPointerException if the specified file is null
 * @return a redirect to append to the specified file
 */
public static Redirect appendTo(final File file){
  if (file == null)   throw new NullPointerException();
  return new Redirect(){
    public Type type(){
      return Type.APPEND;
    }
    public File file(){
      return file;
    }
    public String toString(){
      return "String_Node_Str" + file + "String_Node_Str";
    }
    boolean append(){
      return true;
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Returns a redirect to append to the specified file. Each write operation first advances the position to the end of the file and then writes the requested data. Whether the advancement of the position and the writing of the data are done in a single atomic operation is system-dependent and therefore unspecified. <p>It will always be true that <pre>   {@code Redirect.appendTo(file).file() == file && Redirect.appendTo(file).type() == Redirect.Type.APPEND}</pre>
 * @param file The {@code File} for the {@code Redirect}.
 * @throws NullPointerException if the specified file is null
 * @return a redirect to append to the specified file
 */
public static Redirect appendTo(final File file){
  if (file == null)   throw new NullPointerException();
  return new Redirect(){
    public Type type(){
      return Type.APPEND;
    }
    public File file(){
      return file;
    }
    public String toString(){
      return "String_Node_Str" + file + "String_Node_Str";
    }
    boolean append(){
      return true;
    }
  }
;
}
Program: 36759
Project: 36759
Buggy source:
/** 
 * Returns a redirect to read from the specified file. <p>It will always be true that <pre>   {@code Redirect.from(file).file() == file && Redirect.from(file).type() == Redirect.Type.READ}</pre>
 * @throws NullPointerException if the specified file is null
 * @return a redirect to read from the specified file
 */
public static Redirect from(final File file){
  if (file == null)   throw new NullPointerException();
  return new Redirect(){
    public Type type(){
      return Type.READ;
    }
    public File file(){
      return file;
    }
    public String toString(){
      return "String_Node_Str" + file + "String_Node_Str";
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Returns a redirect to read from the specified file. <p>It will always be true that <pre>   {@code Redirect.from(file).file() == file && Redirect.from(file).type() == Redirect.Type.READ}</pre>
 * @param file The {@code File} for the {@code Redirect}.
 * @throws NullPointerException if the specified file is null
 * @return a redirect to read from the specified file
 */
public static Redirect from(final File file){
  if (file == null)   throw new NullPointerException();
  return new Redirect(){
    public Type type(){
      return Type.READ;
    }
    public File file(){
      return file;
    }
    public String toString(){
      return "String_Node_Str" + file + "String_Node_Str";
    }
  }
;
}
Program: 36760
Project: 36760
Buggy source:
/** 
 * Returns a redirect to write to the specified file. If the specified file exists when the subprocess is started, its previous contents will be discarded. <p>It will always be true that <pre>   {@code Redirect.to(file).file() == file && Redirect.to(file).type() == Redirect.Type.WRITE}</pre>
 * @throws NullPointerException if the specified file is null
 * @return a redirect to write to the specified file
 */
public static Redirect to(final File file){
  if (file == null)   throw new NullPointerException();
  return new Redirect(){
    public Type type(){
      return Type.WRITE;
    }
    public File file(){
      return file;
    }
    public String toString(){
      return "String_Node_Str" + file + "String_Node_Str";
    }
    boolean append(){
      return false;
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Returns a redirect to write to the specified file. If the specified file exists when the subprocess is started, its previous contents will be discarded. <p>It will always be true that <pre>   {@code Redirect.to(file).file() == file && Redirect.to(file).type() == Redirect.Type.WRITE}</pre>
 * @param file The {@code File} for the {@code Redirect}.
 * @throws NullPointerException if the specified file is null
 * @return a redirect to write to the specified file
 */
public static Redirect to(final File file){
  if (file == null)   throw new NullPointerException();
  return new Redirect(){
    public Type type(){
      return Type.WRITE;
    }
    public File file(){
      return file;
    }
    public String toString(){
      return "String_Node_Str" + file + "String_Node_Str";
    }
    boolean append(){
      return false;
    }
  }
;
}
Program: 36761
Project: 36761
Buggy source:
/** 
 * Returns the maximum amount of memory that the Java virtual machine will attempt to use.  If there is no inherent limit then the value   {@link java.lang.Long#MAX_VALUE} will be returned. </p>
 * @return  the maximum amount of memory that the virtual machine willattempt to use, measured in bytes
 * @since 1.4
 */
public native long maxMemory();

Fixed version (ground truth):
/** 
 * Returns the maximum amount of memory that the Java virtual machine will attempt to use.  If there is no inherent limit then the value   {@link java.lang.Long#MAX_VALUE} will be returned.
 * @return  the maximum amount of memory that the virtual machine willattempt to use, measured in bytes
 * @since 1.4
 */
public native long maxMemory();
Program: 36763
Project: 36763
Buggy source:
/** 
 * Returns the default handler invoked when a thread abruptly terminates due to an uncaught exception. If the returned value is <tt>null</tt>, there is no default.
 * @since 1.5
 * @see #setDefaultUncaughtExceptionHandler
 */
public static UncaughtExceptionHandler getDefaultUncaughtExceptionHandler(){
  return defaultUncaughtExceptionHandler;
}

Fixed version (ground truth):
/** 
 * Returns the default handler invoked when a thread abruptly terminates due to an uncaught exception. If the returned value is <tt>null</tt>, there is no default.
 * @since 1.5
 * @see #setDefaultUncaughtExceptionHandler
 * @return the default uncaught exception handler for all threads
 */
public static UncaughtExceptionHandler getDefaultUncaughtExceptionHandler(){
  return defaultUncaughtExceptionHandler;
}
Program: 36764
Project: 36764
Buggy source:
/** 
 * Returns the handler invoked when this thread abruptly terminates due to an uncaught exception. If this thread has not had an uncaught exception handler explicitly set then this thread's <tt>ThreadGroup</tt> object is returned, unless this thread has terminated, in which case <tt>null</tt> is returned.
 * @since 1.5
 */
public UncaughtExceptionHandler getUncaughtExceptionHandler(){
  return uncaughtExceptionHandler != null ? uncaughtExceptionHandler : group;
}

Fixed version (ground truth):
/** 
 * Returns the handler invoked when this thread abruptly terminates due to an uncaught exception. If this thread has not had an uncaught exception handler explicitly set then this thread's <tt>ThreadGroup</tt> object is returned, unless this thread has terminated, in which case <tt>null</tt> is returned.
 * @since 1.5
 * @return the uncaught exception handler for this thread
 */
public UncaughtExceptionHandler getUncaughtExceptionHandler(){
  return uncaughtExceptionHandler != null ? uncaughtExceptionHandler : group;
}
Program: 36765
Project: 36765
Buggy source:
/** 
 * Creates a thread local variable. The initial value of the variable is determined by invoking the   {@code get} method on the {@code Supplier}.
 * @param supplier the supplier to be used to determine the initial value
 * @return a new thread local variable
 * @throws NullPointerException if the specified supplier is null
 * @since 1.8
 */
public static <T>ThreadLocal<T> withInitial(Supplier<? extends T> supplier){
  return new SuppliedThreadLocal<>(supplier);
}

Fixed version (ground truth):
/** 
 * Creates a thread local variable. The initial value of the variable is determined by invoking the   {@code get} method on the {@code Supplier}.
 * @param < S > the type of the thread local's value
 * @param supplier the supplier to be used to determine the initial value
 * @return a new thread local variable
 * @throws NullPointerException if the specified supplier is null
 * @since 1.8
 */
public static <S>ThreadLocal<S> withInitial(Supplier<? extends S> supplier){
  return new SuppliedThreadLocal<>(supplier);
}
Program: 36766
Project: 36766
Buggy source:
/** 
 * Returns the unique   {@link java.nio.channels.FileChannel FileChannel}object associated with this file input stream. <p> The initial   {@link java.nio.channels.FileChannel#position() </code>position<code>} of the returned channel will be equal to thenumber of bytes read from the file so far.  Reading bytes from this stream will increment the channel's position.  Changing the channel's position, either explicitly or by reading, will change this stream's file position.
 * @return  the file channel associated with this file input stream
 * @since 1.4
 * @spec JSR-51
 */
public FileChannel getChannel(){
synchronized (this) {
    if (channel == null) {
      channel=FileChannelImpl.open(fd,true,false,this);
    }
    return channel;
  }
}

Fixed version (ground truth):
/** 
 * Returns the unique   {@link java.nio.channels.FileChannel FileChannel}object associated with this file input stream. <p> The initial   {@link java.nio.channels.FileChannel#position() position} of the returned channel will be equal to thenumber of bytes read from the file so far.  Reading bytes from this stream will increment the channel's position.  Changing the channel's position, either explicitly or by reading, will change this stream's file position.
 * @return  the file channel associated with this file input stream
 * @since 1.4
 * @spec JSR-51
 */
public FileChannel getChannel(){
synchronized (this) {
    if (channel == null) {
      channel=FileChannelImpl.open(fd,true,false,this);
    }
    return channel;
  }
}
Program: 36767
Project: 36767
Buggy source:
/** 
 * Returns the unique   {@link java.nio.channels.FileChannel FileChannel}object associated with this file output stream. </p> <p> The initial   {@link java.nio.channels.FileChannel#position() </code>position<code>} of the returned channel will be equal to thenumber of bytes written to the file so far unless this stream is in append mode, in which case it will be equal to the size of the file. Writing bytes to this stream will increment the channel's position accordingly.  Changing the channel's position, either explicitly or by writing, will change this stream's file position.
 * @return  the file channel associated with this file output stream
 * @since 1.4
 * @spec JSR-51
 */
public FileChannel getChannel(){
synchronized (this) {
    if (channel == null) {
      channel=FileChannelImpl.open(fd,false,true,append,this);
    }
    return channel;
  }
}

Fixed version (ground truth):
/** 
 * Returns the unique   {@link java.nio.channels.FileChannel FileChannel}object associated with this file output stream. <p> The initial   {@link java.nio.channels.FileChannel#position() position} of the returned channel will be equal to thenumber of bytes written to the file so far unless this stream is in append mode, in which case it will be equal to the size of the file. Writing bytes to this stream will increment the channel's position accordingly.  Changing the channel's position, either explicitly or by writing, will change this stream's file position.
 * @return  the file channel associated with this file output stream
 * @since 1.4
 * @spec JSR-51
 */
public FileChannel getChannel(){
synchronized (this) {
    if (channel == null) {
      channel=FileChannelImpl.open(fd,false,true,append,this);
    }
    return channel;
  }
}
Program: 36768
Project: 36768
Buggy source:
/** 
 * Creates an InputStreamReader that uses the given charset decoder.  </p>
 * @param in       An InputStream
 * @param dec      A charset decoder
 * @since 1.4
 * @spec JSR-51
 */
public InputStreamReader(InputStream in,CharsetDecoder dec){
  super(in);
  if (dec == null)   throw new NullPointerException("String_Node_Str");
  sd=StreamDecoder.forInputStreamReader(in,this,dec);
}

Fixed version (ground truth):
/** 
 * Creates an InputStreamReader that uses the given charset decoder.
 * @param in       An InputStream
 * @param dec      A charset decoder
 * @since 1.4
 * @spec JSR-51
 */
public InputStreamReader(InputStream in,CharsetDecoder dec){
  super(in);
  if (dec == null)   throw new NullPointerException("String_Node_Str");
  sd=StreamDecoder.forInputStreamReader(in,this,dec);
}
Program: 36769
Project: 36769
Buggy source:
/** 
 * Creates an OutputStreamWriter that uses the given charset encoder.  </p>
 * @param out An OutputStream
 * @param enc A charset encoder
 * @since 1.4
 * @spec JSR-51
 */
public OutputStreamWriter(OutputStream out,CharsetEncoder enc){
  super(out);
  if (enc == null)   throw new NullPointerException("String_Node_Str");
  se=StreamEncoder.forOutputStreamWriter(out,this,enc);
}

Fixed version (ground truth):
/** 
 * Creates an OutputStreamWriter that uses the given charset encoder.
 * @param out An OutputStream
 * @param enc A charset encoder
 * @since 1.4
 * @spec JSR-51
 */
public OutputStreamWriter(OutputStream out,CharsetEncoder enc){
  super(out);
  if (enc == null)   throw new NullPointerException("String_Node_Str");
  se=StreamEncoder.forOutputStreamWriter(out,this,enc);
}
Program: 36770
Project: 36770
Buggy source:
/** 
 * Receives data into an array of bytes.  This method will block until some input is available.
 * @param b the buffer into which the data is received
 * @param off the start offset of the data
 * @param len the maximum number of bytes received
 * @exception IOException If the pipe is <a href=#BROKEN> broken</a>,{@link #connect(java.io.PipedOutputStream) unconnected}, closed,or if an I/O error occurs.
 */
synchronized void receive(byte b[],int off,int len) throws IOException {
  checkStateForReceive();
  writeSide=Thread.currentThread();
  int bytesToTransfer=len;
  while (bytesToTransfer > 0) {
    if (in == out)     awaitSpace();
    int nextTransferAmount=0;
    if (out < in) {
      nextTransferAmount=buffer.length - in;
    }
 else     if (in < out) {
      if (in == -1) {
        in=out=0;
        nextTransferAmount=buffer.length - in;
      }
 else {
        nextTransferAmount=out - in;
      }
    }
    if (nextTransferAmount > bytesToTransfer)     nextTransferAmount=bytesToTransfer;
    assert(nextTransferAmount > 0);
    System.arraycopy(b,off,buffer,in,nextTransferAmount);
    bytesToTransfer-=nextTransferAmount;
    off+=nextTransferAmount;
    in+=nextTransferAmount;
    if (in >= buffer.length) {
      in=0;
    }
  }
}

Fixed version (ground truth):
/** 
 * Receives data into an array of bytes.  This method will block until some input is available.
 * @param b the buffer into which the data is received
 * @param off the start offset of the data
 * @param len the maximum number of bytes received
 * @exception IOException If the pipe is <a href="#BROKEN"> broken</a>,{@link #connect(java.io.PipedOutputStream) unconnected}, closed,or if an I/O error occurs.
 */
synchronized void receive(byte b[],int off,int len) throws IOException {
  checkStateForReceive();
  writeSide=Thread.currentThread();
  int bytesToTransfer=len;
  while (bytesToTransfer > 0) {
    if (in == out)     awaitSpace();
    int nextTransferAmount=0;
    if (out < in) {
      nextTransferAmount=buffer.length - in;
    }
 else     if (in < out) {
      if (in == -1) {
        in=out=0;
        nextTransferAmount=buffer.length - in;
      }
 else {
        nextTransferAmount=out - in;
      }
    }
    if (nextTransferAmount > bytesToTransfer)     nextTransferAmount=bytesToTransfer;
    assert(nextTransferAmount > 0);
    System.arraycopy(b,off,buffer,in,nextTransferAmount);
    bytesToTransfer-=nextTransferAmount;
    off+=nextTransferAmount;
    in+=nextTransferAmount;
    if (in >= buffer.length) {
      in=0;
    }
  }
}
Program: 36772
Project: 36772
Buggy source:
/** 
 * Returns the number of bytes that can be read from this input stream without blocking.
 * @return the number of bytes that can be read from this input streamwithout blocking, or  {@code 0} if this input stream has beenclosed by invoking its  {@link #close()} method, or if the pipeis  {@link #connect(java.io.PipedOutputStream) unconnected}, or <a href=#BROKEN> <code>broken</code></a>.
 * @exception IOException  if an I/O error occurs.
 * @since   JDK1.0.2
 */
public synchronized int available() throws IOException {
  if (in < 0)   return 0;
 else   if (in == out)   return buffer.length;
 else   if (in > out)   return in - out;
 else   return in + buffer.length - out;
}

Fixed version (ground truth):
/** 
 * Returns the number of bytes that can be read from this input stream without blocking.
 * @return the number of bytes that can be read from this input streamwithout blocking, or  {@code 0} if this input stream has beenclosed by invoking its  {@link #close()} method, or if the pipeis  {@link #connect(java.io.PipedOutputStream) unconnected}, or <a href="#BROKEN"> <code>broken</code></a>.
 * @exception IOException  if an I/O error occurs.
 * @since   JDK1.0.2
 */
public synchronized int available() throws IOException {
  if (in < 0)   return 0;
 else   if (in == out)   return buffer.length;
 else   if (in > out)   return in - out;
 else   return in + buffer.length - out;
}
Program: 36773
Project: 36773
Buggy source:
/** 
 * Returns the opaque file descriptor object associated with this stream. </p>
 * @return     the file descriptor object associated with this stream.
 * @exception IOException  if an I/O error occurs.
 * @see java.io.FileDescriptor
 */
public final FileDescriptor getFD() throws IOException {
  if (fd != null) {
    return fd;
  }
  throw new IOException();
}

Fixed version (ground truth):
/** 
 * Returns the opaque file descriptor object associated with this stream.
 * @return     the file descriptor object associated with this stream.
 * @exception IOException  if an I/O error occurs.
 * @see java.io.FileDescriptor
 */
public final FileDescriptor getFD() throws IOException {
  if (fd != null) {
    return fd;
  }
  throw new IOException();
}
Program: 36775
Project: 36775
Buggy source:
/** 
 * Skips <code>n</code> bytes of input from the bytes that can be read from this input stream without blocking. <p>Fewer bytes than requested might be skipped. The actual number of bytes skipped is equal to <code>n</code> or the result of a call to  {@link #available() <code>available</code>}, whichever is smaller. If <code>n</code> is less than zero, no bytes are skipped. <p>The actual number of bytes skipped is returned.
 * @param n the number of bytes to be skipped.
 * @return     the actual number of bytes skipped.
 * @exception IOException  if an I/O error occurs.
 * @since JCE1.2
 */
public long skip(long n) throws IOException {
  int available=ofinish - ostart;
  if (n > available) {
    n=available;
  }
  if (n < 0) {
    return 0;
  }
  ostart+=n;
  return n;
}

Fixed version (ground truth):
/** 
 * Skips <code>n</code> bytes of input from the bytes that can be read from this input stream without blocking. <p>Fewer bytes than requested might be skipped. The actual number of bytes skipped is equal to <code>n</code> or the result of a call to  {@link #available() available}, whichever is smaller. If <code>n</code> is less than zero, no bytes are skipped. <p>The actual number of bytes skipped is returned.
 * @param n the number of bytes to be skipped.
 * @return     the actual number of bytes skipped.
 * @exception IOException  if an I/O error occurs.
 * @since JCE1.2
 */
public long skip(long n) throws IOException {
  int available=ofinish - ostart;
  if (n > available) {
    n=available;
  }
  if (n < 0) {
    return 0;
  }
  ostart+=n;
  return n;
}
Program: 36776
Project: 36776
Buggy source:
/** 
 * Returns an <code>ExemptionMechanism</code> object that implements the specified exemption mechanism algorithm. <p> A new ExemptionMechanism object encapsulating the ExemptionMechanismSpi implementation from the specified Provider object is returned.  Note that the specified Provider object does not have to be registered in the provider list.
 * @param algorithm the standard name of the requested exemption mechanism.See the ExemptionMechanism section in the <a href= "{docRoot}/../technotes/guides/security/StandardNames.html#Exemption"> Java Cryptography Architecture Standard Algorithm Name Documentation</a> for information about standard exemption mechanism names.
 * @param provider the provider.
 * @return the new <code>ExemptionMechanism</code> object.
 * @exception NullPointerException if <code>algorithm</code>is null.
 * @exception NoSuchAlgorithmException if an ExemptionMechanismSpiimplementation for the specified algorithm is not available from the specified Provider object.
 * @exception IllegalArgumentException if the <code>provider</code>is null.
 * @see java.security.Provider
 */
public static final ExemptionMechanism getInstance(String algorithm,Provider provider) throws NoSuchAlgorithmException {
  Instance instance=JceSecurity.getInstance("String_Node_Str",ExemptionMechanismSpi.class,algorithm,provider);
  return new ExemptionMechanism((ExemptionMechanismSpi)instance.impl,instance.provider,algorithm);
}

Fixed version (ground truth):
/** 
 * Returns an <code>ExemptionMechanism</code> object that implements the specified exemption mechanism algorithm. <p> A new ExemptionMechanism object encapsulating the ExemptionMechanismSpi implementation from the specified Provider object is returned.  Note that the specified Provider object does not have to be registered in the provider list.
 * @param algorithm the standard name of the requested exemption mechanism.See the ExemptionMechanism section in the <a href= " {@docRoot}/../technotes/guides/security/StandardNames.html#Exemption"> Java Cryptography Architecture Standard Algorithm Name Documentation</a> for information about standard exemption mechanism names.
 * @param provider the provider.
 * @return the new <code>ExemptionMechanism</code> object.
 * @exception NullPointerException if <code>algorithm</code>is null.
 * @exception NoSuchAlgorithmException if an ExemptionMechanismSpiimplementation for the specified algorithm is not available from the specified Provider object.
 * @exception IllegalArgumentException if the <code>provider</code>is null.
 * @see java.security.Provider
 */
public static final ExemptionMechanism getInstance(String algorithm,Provider provider) throws NoSuchAlgorithmException {
  Instance instance=JceSecurity.getInstance("String_Node_Str",ExemptionMechanismSpi.class,algorithm,provider);
  return new ExemptionMechanism((ExemptionMechanismSpi)instance.impl,instance.provider,algorithm);
}
Program: 36777
Project: 36777
Buggy source:
/** 
 * Returns a <code>KeyAgreement</code> object that implements the specified key agreement algorithm. <p> A new KeyAgreement object encapsulating the KeyAgreementSpi implementation from the specified Provider object is returned.  Note that the specified Provider object does not have to be registered in the provider list.
 * @param algorithm the standard name of the requested key agreementalgorithm. See the KeyAgreement section in the <a href= " {@docRoot}/../technotes/guides/security/StandardNames.html#KeyAgreement"> Java Cryptography Architecture Standard Algorithm Name Documentation for information about standard algorithm names.
 * @param provider the provider.
 * @return the new <code>KeyAgreement</code> object.
 * @exception NullPointerException if the specified algorithmis null.
 * @exception NoSuchAlgorithmException if a KeyAgreementSpiimplementation for the specified algorithm is not available from the specified Provider object.
 * @exception IllegalArgumentException if the <code>provider</code>is null.
 * @see java.security.Provider
 */
public static final KeyAgreement getInstance(String algorithm,Provider provider) throws NoSuchAlgorithmException {
  Instance instance=JceSecurity.getInstance("String_Node_Str",KeyAgreementSpi.class,algorithm,provider);
  return new KeyAgreement((KeyAgreementSpi)instance.impl,instance.provider,algorithm);
}

Fixed version (ground truth):
/** 
 * Returns a <code>KeyAgreement</code> object that implements the specified key agreement algorithm. <p> A new KeyAgreement object encapsulating the KeyAgreementSpi implementation from the specified Provider object is returned.  Note that the specified Provider object does not have to be registered in the provider list.
 * @param algorithm the standard name of the requested key agreementalgorithm. See the KeyAgreement section in the <a href= " {@docRoot}/../technotes/guides/security/StandardNames.html#KeyAgreement"> Java Cryptography Architecture Standard Algorithm Name Documentation</a> for information about standard algorithm names.
 * @param provider the provider.
 * @return the new <code>KeyAgreement</code> object.
 * @exception NullPointerException if the specified algorithmis null.
 * @exception NoSuchAlgorithmException if a KeyAgreementSpiimplementation for the specified algorithm is not available from the specified Provider object.
 * @exception IllegalArgumentException if the <code>provider</code>is null.
 * @see java.security.Provider
 */
public static final KeyAgreement getInstance(String algorithm,Provider provider) throws NoSuchAlgorithmException {
  Instance instance=JceSecurity.getInstance("String_Node_Str",KeyAgreementSpi.class,algorithm,provider);
  return new KeyAgreement((KeyAgreementSpi)instance.impl,instance.provider,algorithm);
}
Program: 36778
Project: 36778
Buggy source:
public NullCipher(){
  super(new NullCipherSpi(),null);
}

Fixed version (ground truth):
/** 
 * Creates a NullCipher object.
 */
public NullCipher(){
  super(new NullCipherSpi(),null);
}
Program: 36779
Project: 36779
Buggy source:
/** 
 * Return a <code>Set</code> of private credentials associated with this <code>Subject</code> that are instances or subclasses of the specified <code>Class</code>. <p> The caller must have permission to access all of the requested Credentials, or a <code>SecurityException</code> will be thrown. <p> The returned <code>Set</code> is not backed by this Subject's internal private Credential <code>Set</code>.  A new <code>Set</code> is created and returned for each method invocation. Modifications to the returned <code>Set</code> will not affect the internal private Credential <code>Set</code>. <p>
 * @param c the returned <code>Set</code> of private credentials will all beinstances of this class.
 * @return a <code>Set</code> of private credentials that are instancesof the  specified <code>Class</code>.
 * @exception NullPointerException if the specified <code>Class</code>is <code>null</code>.
 */
public <T>Set<T> getPrivateCredentials(Class<T> c){
  if (c == null)   throw new NullPointerException(ResourcesMgr.getString("String_Node_Str"));
  return new ClassSet<T>(PRIV_CREDENTIAL_SET,c);
}

Fixed version (ground truth):
/** 
 * Return a <code>Set</code> of private credentials associated with this <code>Subject</code> that are instances or subclasses of the specified <code>Class</code>. <p> The caller must have permission to access all of the requested Credentials, or a <code>SecurityException</code> will be thrown. <p> The returned <code>Set</code> is not backed by this Subject's internal private Credential <code>Set</code>.  A new <code>Set</code> is created and returned for each method invocation. Modifications to the returned <code>Set</code> will not affect the internal private Credential <code>Set</code>. <p>
 * @param < T > the type of the class modeled by {@code c}
 * @param c the returned <code>Set</code> of private credentials will all beinstances of this class.
 * @return a <code>Set</code> of private credentials that are instancesof the  specified <code>Class</code>.
 * @exception NullPointerException if the specified <code>Class</code>is <code>null</code>.
 */
public <T>Set<T> getPrivateCredentials(Class<T> c){
  if (c == null)   throw new NullPointerException(ResourcesMgr.getString("String_Node_Str"));
  return new ClassSet<T>(PRIV_CREDENTIAL_SET,c);
}
Program: 36780
Project: 36780
Buggy source:
/** 
 * Return a <code>Set</code> of public credentials associated with this <code>Subject</code> that are instances or subclasses of the specified <code>Class</code>. <p> The returned <code>Set</code> is not backed by this Subject's internal public Credential <code>Set</code>.  A new <code>Set</code> is created and returned for each method invocation. Modifications to the returned <code>Set</code> will not affect the internal public Credential <code>Set</code>. <p>
 * @param c the returned <code>Set</code> of public credentials will all beinstances of this class.
 * @return a <code>Set</code> of public credentials that are instancesof the  specified <code>Class</code>.
 * @exception NullPointerException if the specified <code>Class</code>is <code>null</code>.
 */
public <T>Set<T> getPublicCredentials(Class<T> c){
  if (c == null)   throw new NullPointerException(ResourcesMgr.getString("String_Node_Str"));
  return new ClassSet<T>(PUB_CREDENTIAL_SET,c);
}

Fixed version (ground truth):
/** 
 * Return a <code>Set</code> of public credentials associated with this <code>Subject</code> that are instances or subclasses of the specified <code>Class</code>. <p> The returned <code>Set</code> is not backed by this Subject's internal public Credential <code>Set</code>.  A new <code>Set</code> is created and returned for each method invocation. Modifications to the returned <code>Set</code> will not affect the internal public Credential <code>Set</code>. <p>
 * @param < T > the type of the class modeled by {@code c}
 * @param c the returned <code>Set</code> of public credentials will all beinstances of this class.
 * @return a <code>Set</code> of public credentials that are instancesof the  specified <code>Class</code>.
 * @exception NullPointerException if the specified <code>Class</code>is <code>null</code>.
 */
public <T>Set<T> getPublicCredentials(Class<T> c){
  if (c == null)   throw new NullPointerException(ResourcesMgr.getString("String_Node_Str"));
  return new ClassSet<T>(PUB_CREDENTIAL_SET,c);
}
Program: 36781
Project: 36781
Buggy source:
/** 
 * Return a <code>Set</code> of Principals associated with this <code>Subject</code> that are instances or subclasses of the specified <code>Class</code>. <p> The returned <code>Set</code> is not backed by this Subject's internal <code>Principal</code> <code>Set</code>.  A new <code>Set</code> is created and returned for each method invocation. Modifications to the returned <code>Set</code> will not affect the internal <code>Principal</code> <code>Set</code>. <p>
 * @param c the returned <code>Set</code> of Principals will all beinstances of this class.
 * @return a <code>Set</code> of Principals that are instances of thespecified <code>Class</code>.
 * @exception NullPointerException if the specified <code>Class</code>is <code>null</code>.
 */
public <T extends Principal>Set<T> getPrincipals(Class<T> c){
  if (c == null)   throw new NullPointerException(ResourcesMgr.getString("String_Node_Str"));
  return new ClassSet<T>(PRINCIPAL_SET,c);
}

Fixed version (ground truth):
/** 
 * Return a <code>Set</code> of Principals associated with this <code>Subject</code> that are instances or subclasses of the specified <code>Class</code>. <p> The returned <code>Set</code> is not backed by this Subject's internal <code>Principal</code> <code>Set</code>.  A new <code>Set</code> is created and returned for each method invocation. Modifications to the returned <code>Set</code> will not affect the internal <code>Principal</code> <code>Set</code>. <p>
 * @param < T > the type of the class modeled by {@code c}
 * @param c the returned <code>Set</code> of Principals will all beinstances of this class.
 * @return a <code>Set</code> of Principals that are instances of thespecified <code>Class</code>.
 * @exception NullPointerException if the specified <code>Class</code>is <code>null</code>.
 */
public <T extends Principal>Set<T> getPrincipals(Class<T> c){
  if (c == null)   throw new NullPointerException(ResourcesMgr.getString("String_Node_Str"));
  return new ClassSet<T>(PRINCIPAL_SET,c);
}
Program: 36784
Project: 36784
Buggy source:
/** 
 * Gets the <code>version</code> (version number) value from the certificate. The ASN.1 definition for this is: <pre> version         [0]  EXPLICIT Version DEFAULT v1<p> Version  ::=  INTEGER  {  v1(0), v2(1), v3(2)  } </pre>
 * @return the version number from the ASN.1 encoding, i.e. 0, 1 or 2.
 */
public abstract int getVersion();

Fixed version (ground truth):
/** 
 * Gets the <code>version</code> (version number) value from the certificate. The ASN.1 definition for this is: <pre> version         [0]  EXPLICIT Version DEFAULT v1 Version  ::=  INTEGER  {  v1(0), v2(1), v3(2)  } </pre>
 * @return the version number from the ASN.1 encoding, i.e. 0, 1 or 2.
 */
public abstract int getVersion();
Program: 36785
Project: 36785
Buggy source:
/** 
 * Gets the <code>serialNumber</code> value from the certificate. The serial number is an integer assigned by the certification authority to each certificate. It must be unique for each certificate issued by a given CA (i.e., the issuer name and serial number identify a unique certificate). The ASN.1 definition for this is: <pre> serialNumber     CertificateSerialNumber<p> CertificateSerialNumber  ::=  INTEGER </pre>
 * @return the serial number.
 */
public abstract BigInteger getSerialNumber();

Fixed version (ground truth):
/** 
 * Gets the <code>serialNumber</code> value from the certificate. The serial number is an integer assigned by the certification authority to each certificate. It must be unique for each certificate issued by a given CA (i.e., the issuer name and serial number identify a unique certificate). The ASN.1 definition for this is: <pre> serialNumber     CertificateSerialNumber CertificateSerialNumber  ::=  INTEGER </pre>
 * @return the serial number.
 */
public abstract BigInteger getSerialNumber();
Program: 36786
Project: 36786
Buggy source:
/** 
 * Gets the <code>issuer</code> (issuer distinguished name) value from the certificate. The issuer name identifies the entity that signed (and issued) the certificate. <p>The issuer name field contains an X.500 distinguished name (DN). The ASN.1 definition for this is: <pre> issuer    Name<p> Name ::= CHOICE { RDNSequence } RDNSequence ::= SEQUENCE OF RelativeDistinguishedName RelativeDistinguishedName ::= SET OF AttributeValueAssertion AttributeValueAssertion ::= SEQUENCE { AttributeType, AttributeValue } AttributeType ::= OBJECT IDENTIFIER AttributeValue ::= ANY </pre> The <code>Name</code> describes a hierarchical name composed of attributes, such as country name, and corresponding values, such as US. The type of the <code>AttributeValue</code> component is determined by the <code>AttributeType</code>; in general it will be a <code>directoryString</code>. A <code>directoryString</code> is usually one of <code>PrintableString</code>, <code>TeletexString</code> or <code>UniversalString</code>.
 * @return a Principal whose name is the issuer distinguished name.
 */
public abstract Principal getIssuerDN();

Fixed version (ground truth):
/** 
 * Gets the <code>issuer</code> (issuer distinguished name) value from the certificate. The issuer name identifies the entity that signed (and issued) the certificate. <p>The issuer name field contains an X.500 distinguished name (DN). The ASN.1 definition for this is: <pre> issuer    Name Name ::= CHOICE { RDNSequence } RDNSequence ::= SEQUENCE OF RelativeDistinguishedName RelativeDistinguishedName ::= SET OF AttributeValueAssertion AttributeValueAssertion ::= SEQUENCE { AttributeType, AttributeValue } AttributeType ::= OBJECT IDENTIFIER AttributeValue ::= ANY </pre> The <code>Name</code> describes a hierarchical name composed of attributes, such as country name, and corresponding values, such as US. The type of the <code>AttributeValue</code> component is determined by the <code>AttributeType</code>; in general it will be a <code>directoryString</code>. A <code>directoryString</code> is usually one of <code>PrintableString</code>, <code>TeletexString</code> or <code>UniversalString</code>.
 * @return a Principal whose name is the issuer distinguished name.
 */
public abstract Principal getIssuerDN();
Program: 36787
Project: 36787
Buggy source:
/** 
 * Gets the <code>notBefore</code> date from the validity period of the certificate. The relevant ASN.1 definitions are: <pre> validity             Validity<p> Validity ::= SEQUENCE { notBefore      CertificateValidityDate, notAfter       CertificateValidityDate }<p> CertificateValidityDate ::= CHOICE { utcTime        UTCTime, generalTime    GeneralizedTime } </pre>
 * @return the start date of the validity period.
 * @see #checkValidity()
 */
public abstract Date getNotBefore();

Fixed version (ground truth):
/** 
 * Gets the <code>notBefore</code> date from the validity period of the certificate. The relevant ASN.1 definitions are: <pre> validity             Validity Validity ::= SEQUENCE { notBefore      CertificateValidityDate, notAfter       CertificateValidityDate } CertificateValidityDate ::= CHOICE { utcTime        UTCTime, generalTime    GeneralizedTime } </pre>
 * @return the start date of the validity period.
 * @see #checkValidity()
 */
public abstract Date getNotBefore();
Program: 36788
Project: 36788
Buggy source:
/** 
 * Gets the signature algorithm name for the certificate signature algorithm. An example is the string "SHA-1/DSA". The ASN.1 definition for this is: <pre> signatureAlgorithm   AlgorithmIdentifier<p> AlgorithmIdentifier  ::=  SEQUENCE  { algorithm               OBJECT IDENTIFIER, parameters              ANY DEFINED BY algorithm OPTIONAL  } -- contains a value of the type -- registered for use with the -- algorithm object identifier value </pre> <p>The algorithm name is determined from the <code>algorithm</code> OID string.
 * @return the signature algorithm name.
 */
public abstract String getSigAlgName();

Fixed version (ground truth):
/** 
 * Gets the signature algorithm name for the certificate signature algorithm. An example is the string "SHA-1/DSA". The ASN.1 definition for this is: <pre> signatureAlgorithm   AlgorithmIdentifier AlgorithmIdentifier  ::=  SEQUENCE  { algorithm               OBJECT IDENTIFIER, parameters              ANY DEFINED BY algorithm OPTIONAL  } -- contains a value of the type -- registered for use with the -- algorithm object identifier value </pre> <p>The algorithm name is determined from the <code>algorithm</code> OID string.
 * @return the signature algorithm name.
 */
public abstract String getSigAlgName();
Program: 36789
Project: 36789
Buggy source:
/** 
 * Instantiates an X509Certificate object, and initializes it with the specified byte array. The implementation (X509Certificate is an abstract class) is provided by the class specified as the value of the  {@code cert.provider.x509v1} security property.<p>Note: All X509Certificate subclasses must provide a constructor of the form: <code><pre> public &lt;subClass&gt;(InputStream inStream) ... </pre></code>
 * @param certData a byte array containing the DER-encodedcertificate.
 * @return an X509Certificate object initialized with the datafrom <code>certData</code>.
 * @exception CertificateException if a class initializationor certificate parsing error occurs.
 */
public static final X509Certificate getInstance(byte[] certData) throws CertificateException {
  return getInst((Object)certData);
}

Fixed version (ground truth):
/** 
 * Instantiates an X509Certificate object, and initializes it with the specified byte array. The implementation (X509Certificate is an abstract class) is provided by the class specified as the value of the  {@code cert.provider.x509v1} security property.<p>Note: All X509Certificate subclasses must provide a constructor of the form: <pre> {@code public <subClass>(InputStream inStream) ...}</pre>
 * @param certData a byte array containing the DER-encodedcertificate.
 * @return an X509Certificate object initialized with the datafrom <code>certData</code>.
 * @exception CertificateException if a class initializationor certificate parsing error occurs.
 */
public static final X509Certificate getInstance(byte[] certData) throws CertificateException {
  return getInst((Object)certData);
}
Program: 36791
Project: 36791
Buggy source:
/** 
 * Gets the   {@code version} (version number) value from the CRL.The ASN.1 definition for this is: <pre> version    Version OPTIONAL, -- if present, must be v2<p> Version  ::=  INTEGER  {  v1(0), v2(1), v3(2)  } -- v3 does not apply to CRLs but appears for consistency -- with definition of Version for certs </pre>
 * @return the version number, i.e. 1 or 2.
 */
public abstract int getVersion();

Fixed version (ground truth):
/** 
 * Gets the   {@code version} (version number) value from the CRL.The ASN.1 definition for this is: <pre> version    Version OPTIONAL, -- if present, must be v2 Version  ::=  INTEGER  {  v1(0), v2(1), v3(2)  } -- v3 does not apply to CRLs but appears for consistency -- with definition of Version for certs </pre>
 * @return the version number, i.e. 1 or 2.
 */
public abstract int getVersion();
Program: 36792
Project: 36792
Buggy source:
/** 
 * Gets the signature algorithm name for the CRL signature algorithm. An example is the string "SHA256withRSA". The ASN.1 definition for this is: <pre> signatureAlgorithm   AlgorithmIdentifier<p> AlgorithmIdentifier  ::=  SEQUENCE  { algorithm               OBJECT IDENTIFIER, parameters              ANY DEFINED BY algorithm OPTIONAL  } -- contains a value of the type -- registered for use with the -- algorithm object identifier value </pre> <p>The algorithm name is determined from the   {@code algorithm}OID string.
 * @return the signature algorithm name.
 */
public abstract String getSigAlgName();

Fixed version (ground truth):
/** 
 * Gets the signature algorithm name for the CRL signature algorithm. An example is the string "SHA256withRSA". The ASN.1 definition for this is: <pre> signatureAlgorithm   AlgorithmIdentifier AlgorithmIdentifier  ::=  SEQUENCE  { algorithm               OBJECT IDENTIFIER, parameters              ANY DEFINED BY algorithm OPTIONAL  } -- contains a value of the type -- registered for use with the -- algorithm object identifier value </pre> <p>The algorithm name is determined from the   {@code algorithm}OID string.
 * @return the signature algorithm name.
 */
public abstract String getSigAlgName();
Program: 36793
Project: 36793
Buggy source:
/** 
 * Gets the   {@code version} (version number) value from thecertificate. The ASN.1 definition for this is: <pre> version  [0] EXPLICIT Version DEFAULT v1<p> Version ::=  INTEGER  {  v1(0), v2(1), v3(2)  } </pre>
 * @return the version number, i.e. 1, 2 or 3.
 */
public abstract int getVersion();

Fixed version (ground truth):
/** 
 * Gets the   {@code version} (version number) value from thecertificate. The ASN.1 definition for this is: <pre> version  [0] EXPLICIT Version DEFAULT v1 Version ::=  INTEGER  {  v1(0), v2(1), v3(2)  } </pre>
 * @return the version number, i.e. 1, 2 or 3.
 */
public abstract int getVersion();
Program: 36794
Project: 36794
Buggy source:
/** 
 * Gets the   {@code serialNumber} value from the certificate.The serial number is an integer assigned by the certification authority to each certificate. It must be unique for each certificate issued by a given CA (i.e., the issuer name and serial number identify a unique certificate). The ASN.1 definition for this is: <pre> serialNumber     CertificateSerialNumber<p> CertificateSerialNumber  ::=  INTEGER </pre>
 * @return the serial number.
 */
public abstract BigInteger getSerialNumber();

Fixed version (ground truth):
/** 
 * Gets the   {@code serialNumber} value from the certificate.The serial number is an integer assigned by the certification authority to each certificate. It must be unique for each certificate issued by a given CA (i.e., the issuer name and serial number identify a unique certificate). The ASN.1 definition for this is: <pre> serialNumber     CertificateSerialNumber CertificateSerialNumber  ::=  INTEGER </pre>
 * @return the serial number.
 */
public abstract BigInteger getSerialNumber();
Program: 36795
Project: 36795
Buggy source:
/** 
 * Gets the   {@code issuerUniqueID} value from the certificate.The issuer unique identifier is present in the certificate to handle the possibility of reuse of issuer names over time. RFC 3280 recommends that names not be reused and that conforming certificates not make use of unique identifiers. Applications conforming to that profile should be capable of parsing unique identifiers and making comparisons. <p>The ASN.1 definition for this is: <pre> issuerUniqueID  [1]  IMPLICIT UniqueIdentifier OPTIONAL<p> UniqueIdentifier  ::=  BIT STRING </pre>
 * @return the issuer unique identifier or null if it is notpresent in the certificate.
 */
public abstract boolean[] getIssuerUniqueID();

Fixed version (ground truth):
/** 
 * Gets the   {@code issuerUniqueID} value from the certificate.The issuer unique identifier is present in the certificate to handle the possibility of reuse of issuer names over time. RFC 3280 recommends that names not be reused and that conforming certificates not make use of unique identifiers. Applications conforming to that profile should be capable of parsing unique identifiers and making comparisons. <p>The ASN.1 definition for this is: <pre> issuerUniqueID  [1]  IMPLICIT UniqueIdentifier OPTIONAL UniqueIdentifier  ::=  BIT STRING </pre>
 * @return the issuer unique identifier or null if it is notpresent in the certificate.
 */
public abstract boolean[] getIssuerUniqueID();