nus-yam/ex-repair huggingface dataset:
Program: 77434
Project: 77434
Buggy source:
/** 
 * Find a resource of the specified name from the search path used to load classes.  This method locates the resource through the system class loader (see   {@link #getSystemClassLoader()}).  </p>
 * @param name The resource name
 * @return  A {@link java.net.URL <tt>URL</tt>} object for reading theresource, or <tt>null</tt> if the resource could not be found
 * @since  1.1
 */
public static URL getSystemResource(String name){
  ClassLoader system=getSystemClassLoader();
  if (system == null) {
    return getBootstrapResource(name);
  }
  return system.getResource(name);
}

Fixed version (ground truth):
/** 
 * Find a resource of the specified name from the search path used to load classes.  This method locates the resource through the system class loader (see   {@link #getSystemClassLoader()}).
 * @param name The resource name
 * @return  A {@link java.net.URL <tt>URL</tt>} object for reading theresource, or <tt>null</tt> if the resource could not be found
 * @since  1.1
 */
public static URL getSystemResource(String name){
  ClassLoader system=getSystemClassLoader();
  if (system == null) {
    return getBootstrapResource(name);
  }
  return system.getResource(name);
}
Program: 77435
Project: 77435
Buggy source:
/** 
 * Sets the signers of a class.  This should be invoked after defining a class.  </p>
 * @param c The <tt>Class</tt> object
 * @param signers The signers for the class
 * @since  1.1
 */
protected final void setSigners(Class<?> c,Object[] signers){
  c.setSigners(signers);
}

Fixed version (ground truth):
/** 
 * Sets the signers of a class.  This should be invoked after defining a class.
 * @param c The <tt>Class</tt> object
 * @param signers The signers for the class
 * @since  1.1
 */
protected final void setSigners(Class<?> c,Object[] signers){
  c.setSigners(signers);
}
Program: 77436
Project: 77436
Buggy source:
/** 
 * Returns all of the <tt>Packages</tt> defined by this class loader and its ancestors.  </p>
 * @return  The array of <tt>Package</tt> objects defined by this<tt>ClassLoader</tt>
 * @since  1.2
 */
protected Package[] getPackages(){
  Map<String,Package> map;
synchronized (packages) {
    map=new HashMap<>(packages);
  }
  Package[] pkgs;
  if (parent != null) {
    pkgs=parent.getPackages();
  }
 else {
    pkgs=Package.getSystemPackages();
  }
  if (pkgs != null) {
    for (int i=0; i < pkgs.length; i++) {
      String pkgName=pkgs[i].getName();
      if (map.get(pkgName) == null) {
        map.put(pkgName,pkgs[i]);
      }
    }
  }
  return map.values().toArray(new Package[map.size()]);
}

Fixed version (ground truth):
/** 
 * Returns all of the <tt>Packages</tt> defined by this class loader and its ancestors.
 * @return  The array of <tt>Package</tt> objects defined by this<tt>ClassLoader</tt>
 * @since  1.2
 */
protected Package[] getPackages(){
  Map<String,Package> map;
synchronized (packages) {
    map=new HashMap<>(packages);
  }
  Package[] pkgs;
  if (parent != null) {
    pkgs=parent.getPackages();
  }
 else {
    pkgs=Package.getSystemPackages();
  }
  if (pkgs != null) {
    for (int i=0; i < pkgs.length; i++) {
      String pkgName=pkgs[i].getName();
      if (map.get(pkgName) == null) {
        map.put(pkgName,pkgs[i]);
      }
    }
  }
  return map.values().toArray(new Package[map.size()]);
}
Program: 77437
Project: 77437
Buggy source:
/** 
 * Returns the lock object for class loading operations. For backward compatibility, the default implementation of this method behaves as follows. If this ClassLoader object is registered as parallel capable, the method returns a dedicated object associated with the specified class name. Otherwise, the method returns this ClassLoader object. </p>
 * @param className The name of the to-be-loaded class
 * @return the lock for class loading operations
 * @throws NullPointerException If registered as parallel capable and <tt>className</tt> is null
 * @see #loadClass(String,boolean)
 * @since  1.7
 */
protected Object getClassLoadingLock(String className){
  Object lock=this;
  if (parallelLockMap != null) {
    Object newLock=new Object();
    lock=parallelLockMap.putIfAbsent(className,newLock);
    if (lock == null) {
      lock=newLock;
    }
  }
  return lock;
}

Fixed version (ground truth):
/** 
 * Returns the lock object for class loading operations. For backward compatibility, the default implementation of this method behaves as follows. If this ClassLoader object is registered as parallel capable, the method returns a dedicated object associated with the specified class name. Otherwise, the method returns this ClassLoader object.
 * @param className The name of the to-be-loaded class
 * @return the lock for class loading operations
 * @throws NullPointerException If registered as parallel capable and <tt>className</tt> is null
 * @see #loadClass(String,boolean)
 * @since  1.7
 */
protected Object getClassLoadingLock(String className){
  Object lock=this;
  if (parallelLockMap != null) {
    Object newLock=new Object();
    lock=parallelLockMap.putIfAbsent(className,newLock);
    if (lock == null) {
      lock=newLock;
    }
  }
  return lock;
}
Program: 77438
Project: 77438
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: 77441
Project: 77441
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: 77442
Project: 77442
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: 77443
Project: 77443
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: 77444
Project: 77444
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: 77446
Project: 77446
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: 77447
Project: 77447
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: 77448
Project: 77448
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: 77449
Project: 77449
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: 77450
Project: 77450
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: 77451
Project: 77451
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: 77452
Project: 77452
Buggy source:
public NullCipher(){
  super(new NullCipherSpi(),null);
}

Fixed version (ground truth):
/** 
 * Creates a NullCipher object.
 */
public NullCipher(){
  super(new NullCipherSpi(),null);
}
Program: 77453
Project: 77453
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: 77454
Project: 77454
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: 77455
Project: 77455
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: 77458
Project: 77458
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: 77459
Project: 77459
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: 77460
Project: 77460
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: 77461
Project: 77461
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: 77462
Project: 77462
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: 77463
Project: 77463
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: 77465
Project: 77465
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;
}
Program: 77468
Project: 77468
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: 77469
Project: 77469
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: 77470
Project: 77470
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: 77471
Project: 77471
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: 77472
Project: 77472
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();
Program: 77473
Project: 77473
Buggy source:
/** 
 * <strong>Denigrated</strong>, replaced by   {@linkplain #getIssuerX500Principal()}. This method returns the   {@code issuer}as an implementation specific Principal object, which should not be relied upon by portable code. <p> Gets the   {@code issuer} (issuer distinguished name) value fromthe 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} describes a hierarchical name composed ofattributes, such as country name, and corresponding values, such as US. The type of the  {@code AttributeValue} component is determined bythe  {@code AttributeType}; in general it will be a  {@code directoryString}. A   {@code directoryString} is usuallyone of  {@code PrintableString},  {@code TeletexString} or {@code UniversalString}.
 * @return a Principal whose name is the issuer distinguished name.
 */
public abstract Principal getIssuerDN();

Fixed version (ground truth):
/** 
 * <strong>Denigrated</strong>, replaced by   {@linkplain #getIssuerX500Principal()}. This method returns the   {@code issuer}as an implementation specific Principal object, which should not be relied upon by portable code. <p> Gets the   {@code issuer} (issuer distinguished name) value fromthe 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} describes a hierarchical name composed ofattributes, such as country name, and corresponding values, such as US. The type of the  {@code AttributeValue} component is determined bythe  {@code AttributeType}; in general it will be a  {@code directoryString}. A   {@code directoryString} is usuallyone of  {@code PrintableString},  {@code TeletexString} or {@code UniversalString}.
 * @return a Principal whose name is the issuer distinguished name.
 */
public abstract Principal getIssuerDN();