nus-yam/ex-repair huggingface dataset:
Program: 71898
Project: 71898
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: 71901
Project: 71901
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: 71902
Project: 71902
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: 71903
Project: 71903
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: 71904
Project: 71904
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: 71906
Project: 71906
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: 71907
Project: 71907
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: 71908
Project: 71908
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: 71909
Project: 71909
Buggy source:
/** 
 * Returns   {@code true} if this Spliterator's {@link #characteristics} contain all of the given characteristics.
 * @implSpec The default implementation returns true if the corresponding bits of the given characteristics are set.
 * @return {@code true} if all the specified characteristics are present,else  {@code false}
 */
default boolean hasCharacteristics(int characteristics){
  return (characteristics() & characteristics) == characteristics;
}

Fixed version (ground truth):
/** 
 * Returns   {@code true} if this Spliterator's {@link #characteristics} contain all of the given characteristics.
 * @implSpec The default implementation returns true if the corresponding bits of the given characteristics are set.
 * @param characteristics the characteristics to check for
 * @return {@code true} if all the specified characteristics are present,else  {@code false}
 */
default boolean hasCharacteristics(int characteristics){
  return (characteristics() & characteristics) == characteristics;
}
Program: 71910
Project: 71910
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: 71911
Project: 71911
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: 71912
Project: 71912
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: 71913
Project: 71913
Buggy source:
public NullCipher(){
  super(new NullCipherSpi(),null);
}

Fixed version (ground truth):
/** 
 * Creates a NullCipher object.
 */
public NullCipher(){
  super(new NullCipherSpi(),null);
}
Program: 71914
Project: 71914
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: 71915
Project: 71915
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: 71916
Project: 71916
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: 71919
Project: 71919
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: 71920
Project: 71920
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: 71921
Project: 71921
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: 71922
Project: 71922
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: 71923
Project: 71923
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: 71924
Project: 71924
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: 71925
Project: 71925
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: 71926
Project: 71926
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: 71927
Project: 71927
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: 71928
Project: 71928
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: 71929
Project: 71929
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: 71931
Project: 71931
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: 71932
Project: 71932
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: 71935
Project: 71935
Buggy source:
/** 
 * Determines whether a class is modifiable by  {@linkplain #retransformClasses retransformation}or   {@linkplain #redefineClasses redefinition}. If a class is modifiable then this method returns <code>true</code>. If a class is not modifiable then this method returns <code>false</code>. <P> For a class to be retransformed,   {@link #isRetransformClassesSupported} must also be true.But the value of <code>isRetransformClassesSupported()</code> does not influence the value returned by this function. For a class to be redefined,  {@link #isRedefineClassesSupported} must also be true.But the value of <code>isRedefineClassesSupported()</code> does not influence the value returned by this function. <P> Primitive classes (for example, <code>java.lang.Integer.TYPE</code>) and array classes are never modifiable.
 * @throws java.lang.NullPointerException if the specified class is <code>null</code>.
 * @see #retransformClasses
 * @see #isRetransformClassesSupported
 * @see #redefineClasses
 * @see #isRedefineClassesSupported
 * @since 1.6
 */
boolean isModifiableClass(Class<?> theClass);

Fixed version (ground truth):
/** 
 * Determines whether a class is modifiable by  {@linkplain #retransformClasses retransformation}or   {@linkplain #redefineClasses redefinition}. If a class is modifiable then this method returns <code>true</code>. If a class is not modifiable then this method returns <code>false</code>. <P> For a class to be retransformed,   {@link #isRetransformClassesSupported} must also be true.But the value of <code>isRetransformClassesSupported()</code> does not influence the value returned by this function. For a class to be redefined,  {@link #isRedefineClassesSupported} must also be true.But the value of <code>isRedefineClassesSupported()</code> does not influence the value returned by this function. <P> Primitive classes (for example, <code>java.lang.Integer.TYPE</code>) and array classes are never modifiable.
 * @param theClass the class to check for being modifiable
 * @return whether or not the argument class is modifiable
 * @throws java.lang.NullPointerException if the specified class is <code>null</code>.
 * @see #retransformClasses
 * @see #isRetransformClassesSupported
 * @see #redefineClasses
 * @see #isRedefineClassesSupported
 * @since 1.6
 */
boolean isModifiableClass(Class<?> theClass);
Program: 71936
Project: 71936
Buggy source:
/** 
 * A query that provides access to whether a leap-second was parsed. <p> This returns a singleton   {@linkplain TemporalQuery query} that providesaccess to additional information from the parse. The query always returns a non-null boolean, true if parsing saw a leap-second, false if not. <p> Instant parsing handles the special "leap second" time of '23:59:60'. Leap seconds occur at '23:59:60' in the UTC time-zone, but at other local times in different time-zones. To avoid this potential ambiguity, the handling of leap-seconds is limited to {@link DateTimeFormatterBuilder#appendInstant()}, as that method always parses the instant with the UTC zone offset. <p> If the time '23:59:60' is received, then a simple conversion is applied, replacing the second-of-minute of 60 with 59. This query can be used on the parse result to determine if the leap-second adjustment was made. The query will return one second of excess if it did adjust to remove the leap-second, and zero if not. Note that applying a leap-second smoothing mechanism, such as UTC-SLS, is the responsibility of the application, as follows: <pre> TemporalAccessor parsed = formatter.parse(str); Instant instant = parsed.query(Instant::from); if (parsed.query(DateTimeFormatter.parsedLeapSecond())) { // validate leap-second is correct and apply correct smoothing } </pre>
 */
public static final TemporalQuery<Boolean> parsedLeapSecond(){
  return PARSED_LEAP_SECOND;
}

Fixed version (ground truth):
/** 
 * A query that provides access to whether a leap-second was parsed. <p> This returns a singleton   {@linkplain TemporalQuery query} that providesaccess to additional information from the parse. The query always returns a non-null boolean, true if parsing saw a leap-second, false if not. <p> Instant parsing handles the special "leap second" time of '23:59:60'. Leap seconds occur at '23:59:60' in the UTC time-zone, but at other local times in different time-zones. To avoid this potential ambiguity, the handling of leap-seconds is limited to {@link DateTimeFormatterBuilder#appendInstant()}, as that method always parses the instant with the UTC zone offset. <p> If the time '23:59:60' is received, then a simple conversion is applied, replacing the second-of-minute of 60 with 59. This query can be used on the parse result to determine if the leap-second adjustment was made. The query will return one second of excess if it did adjust to remove the leap-second, and zero if not. Note that applying a leap-second smoothing mechanism, such as UTC-SLS, is the responsibility of the application, as follows: <pre> TemporalAccessor parsed = formatter.parse(str); Instant instant = parsed.query(Instant::from); if (parsed.query(DateTimeFormatter.parsedLeapSecond())) { // validate leap-second is correct and apply correct smoothing } </pre>
 * @return a query that provides access to whether a leap-second was parsed
 */
public static final TemporalQuery<Boolean> parsedLeapSecond(){
  return PARSED_LEAP_SECOND;
}