Program: 76792
Project: 76792
Buggy source:
/** 
 * Determines the current system properties. <p> First, if there is a security manager, its <code>checkPropertiesAccess</code> method is called with no arguments. This may result in a security exception. <p> The current set of system properties for use by the  {@link #getProperty(String)} method is returned as a<code>Properties</code> object. If there is no current set of system properties, a set of system properties is first created and initialized. This set of system properties always includes values for the following keys: <table class="striped"> <caption style="display:none">Shows property keys and associated values</caption> <thead> <tr><th scope="col">Key</th> <th scope="col">Description of Associated Value</th></tr> </thead> <tbody> <tr><th scope="row"><code>java.version</code></th> <td>Java Runtime Environment version which may be interpreted as a  {@link Runtime.Version}</td></tr> <tr><th scope="row"><code>java.vendor</code></th> <td>Java Runtime Environment vendor</td></tr> <tr><th scope="row"><code>java.vendor.url</code></th> <td>Java vendor URL</td></tr> <tr><th scope="row"><code>java.home</code></th> <td>Java installation directory</td></tr> <tr><th scope="row"><code>java.vm.specification.version</code></th> <td>Java Virtual Machine specification version which may be interpreted as a   {@link Runtime.Version}</td></tr> <tr><th scope="row"><code>java.vm.specification.vendor</code></th> <td>Java Virtual Machine specification vendor</td></tr> <tr><th scope="row"><code>java.vm.specification.name</code></th> <td>Java Virtual Machine specification name</td></tr> <tr><th scope="row"><code>java.vm.version</code></th> <td>Java Virtual Machine implementation version which may be interpreted as a   {@link Runtime.Version}</td></tr> <tr><th scope="row"><code>java.vm.vendor</code></th> <td>Java Virtual Machine implementation vendor</td></tr> <tr><th scope="row"><code>java.vm.name</code></th> <td>Java Virtual Machine implementation name</td></tr> <tr><th scope="row"><code>java.specification.version</code></th> <td>Java Runtime Environment specification version which may be interpreted as a   {@link Runtime.Version}</td></tr> <tr><th scope="row"><code>java.specification.vendor</code></th> <td>Java Runtime Environment specification  vendor</td></tr> <tr><th scope="row"><code>java.specification.name</code></th> <td>Java Runtime Environment specification  name</td></tr> <tr><th scope="row"><code>java.class.version</code></th> <td>Java class format version number</td></tr> <tr><th scope="row"><code>java.class.path</code></th> <td>Java class path</td></tr> <tr><th scope="row"><code>java.library.path</code></th> <td>List of paths to search when loading libraries</td></tr> <tr><th scope="row"><code>java.io.tmpdir</code></th> <td>Default temp file path</td></tr> <tr><th scope="row"><code>java.compiler</code></th> <td>Name of JIT compiler to use</td></tr> <tr><th scope="row"><code>os.name</code></th> <td>Operating system name</td></tr> <tr><th scope="row"><code>os.arch</code></th> <td>Operating system architecture</td></tr> <tr><th scope="row"><code>os.version</code></th> <td>Operating system version</td></tr> <tr><th scope="row"><code>file.separator</code></th> <td>File separator ("/" on UNIX)</td></tr> <tr><th scope="row"><code>path.separator</code></th> <td>Path separator (":" on UNIX)</td></tr> <tr><th scope="row"><code>line.separator</code></th> <td>Line separator ("\n" on UNIX)</td></tr> <tr><th scope="row"><code>user.name</code></th> <td>User's account name</td></tr> <tr><th scope="row"><code>user.home</code></th> <td>User's home directory</td></tr> <tr><th scope="row"><code>user.dir</code></th> <td>User's current working directory</td></tr> </tbody> </table> <p> Multiple paths in a system property value are separated by the path separator character of the platform. <p> Note that even if the security manager does not permit the <code>getProperties</code> operation, it may choose to permit the  {@link #getProperty(String)} operation.
 * @implNote In addition to the standard system properties, the systemproperties may include the following keys: <table class="striped"> <caption style="display:none">Shows property keys and associated values</caption> <thead> <tr><th scope="col">Key</th> <th scope="col">Description of Associated Value</th></tr> </thead> <tbody> <tr><th scope="row"> {@code jdk.module.path}</th> <td>The application module path</td></tr> <tr><th scope="row">  {@code jdk.module.upgrade.path}</th> <td>The upgrade module path</td></tr> <tr><th scope="row">  {@code jdk.module.main}</th> <td>The module name of the initial/main module</td></tr> <tr><th scope="row">  {@code jdk.module.main.class}</th> <td>The main class name of the initial module</td></tr> </tbody> </table>
 * @return     the system properties
 * @exception SecurityException  if a security manager exists and its<code>checkPropertiesAccess</code> method doesn't allow access to the system properties.
 * @see #setProperties
 * @see java.lang.SecurityException
 * @see java.lang.SecurityManager#checkPropertiesAccess()
 * @see java.util.Properties
 */
public static Properties getProperties(){
  SecurityManager sm=getSecurityManager();
  if (sm != null) {
    sm.checkPropertiesAccess();
  }
  return props;
}

Fixed version (ground truth):
/** 
 * Determines the current system properties. <p> First, if there is a security manager, its <code>checkPropertiesAccess</code> method is called with no arguments. This may result in a security exception. <p> The current set of system properties for use by the  {@link #getProperty(String)} method is returned as a<code>Properties</code> object. If there is no current set of system properties, a set of system properties is first created and initialized. This set of system properties always includes values for the following keys: <table class="striped" style="text-align:left"> <caption style="display:none">Shows property keys and associated values</caption> <thead> <tr><th scope="col">Key</th> <th scope="col">Description of Associated Value</th></tr> </thead> <tbody> <tr><th scope="row"><code>java.version</code></th> <td>Java Runtime Environment version which may be interpreted as a  {@link Runtime.Version}</td></tr> <tr><th scope="row"><code>java.vendor</code></th> <td>Java Runtime Environment vendor</td></tr> <tr><th scope="row"><code>java.vendor.url</code></th> <td>Java vendor URL</td></tr> <tr><th scope="row"><code>java.home</code></th> <td>Java installation directory</td></tr> <tr><th scope="row"><code>java.vm.specification.version</code></th> <td>Java Virtual Machine specification version which may be interpreted as a   {@link Runtime.Version}</td></tr> <tr><th scope="row"><code>java.vm.specification.vendor</code></th> <td>Java Virtual Machine specification vendor</td></tr> <tr><th scope="row"><code>java.vm.specification.name</code></th> <td>Java Virtual Machine specification name</td></tr> <tr><th scope="row"><code>java.vm.version</code></th> <td>Java Virtual Machine implementation version which may be interpreted as a   {@link Runtime.Version}</td></tr> <tr><th scope="row"><code>java.vm.vendor</code></th> <td>Java Virtual Machine implementation vendor</td></tr> <tr><th scope="row"><code>java.vm.name</code></th> <td>Java Virtual Machine implementation name</td></tr> <tr><th scope="row"><code>java.specification.version</code></th> <td>Java Runtime Environment specification version which may be interpreted as a   {@link Runtime.Version}</td></tr> <tr><th scope="row"><code>java.specification.vendor</code></th> <td>Java Runtime Environment specification  vendor</td></tr> <tr><th scope="row"><code>java.specification.name</code></th> <td>Java Runtime Environment specification  name</td></tr> <tr><th scope="row"><code>java.class.version</code></th> <td>Java class format version number</td></tr> <tr><th scope="row"><code>java.class.path</code></th> <td>Java class path</td></tr> <tr><th scope="row"><code>java.library.path</code></th> <td>List of paths to search when loading libraries</td></tr> <tr><th scope="row"><code>java.io.tmpdir</code></th> <td>Default temp file path</td></tr> <tr><th scope="row"><code>java.compiler</code></th> <td>Name of JIT compiler to use</td></tr> <tr><th scope="row"><code>os.name</code></th> <td>Operating system name</td></tr> <tr><th scope="row"><code>os.arch</code></th> <td>Operating system architecture</td></tr> <tr><th scope="row"><code>os.version</code></th> <td>Operating system version</td></tr> <tr><th scope="row"><code>file.separator</code></th> <td>File separator ("/" on UNIX)</td></tr> <tr><th scope="row"><code>path.separator</code></th> <td>Path separator (":" on UNIX)</td></tr> <tr><th scope="row"><code>line.separator</code></th> <td>Line separator ("\n" on UNIX)</td></tr> <tr><th scope="row"><code>user.name</code></th> <td>User's account name</td></tr> <tr><th scope="row"><code>user.home</code></th> <td>User's home directory</td></tr> <tr><th scope="row"><code>user.dir</code></th> <td>User's current working directory</td></tr> </tbody> </table> <p> Multiple paths in a system property value are separated by the path separator character of the platform. <p> Note that even if the security manager does not permit the <code>getProperties</code> operation, it may choose to permit the  {@link #getProperty(String)} operation.
 * @implNote In addition to the standard system properties, the systemproperties may include the following keys: <table class="striped"> <caption style="display:none">Shows property keys and associated values</caption> <thead> <tr><th scope="col">Key</th> <th scope="col">Description of Associated Value</th></tr> </thead> <tbody> <tr><th scope="row"> {@code jdk.module.path}</th> <td>The application module path</td></tr> <tr><th scope="row">  {@code jdk.module.upgrade.path}</th> <td>The upgrade module path</td></tr> <tr><th scope="row">  {@code jdk.module.main}</th> <td>The module name of the initial/main module</td></tr> <tr><th scope="row">  {@code jdk.module.main.class}</th> <td>The main class name of the initial module</td></tr> </tbody> </table>
 * @return     the system properties
 * @exception SecurityException  if a security manager exists and its<code>checkPropertiesAccess</code> method doesn't allow access to the system properties.
 * @see #setProperties
 * @see java.lang.SecurityException
 * @see java.lang.SecurityManager#checkPropertiesAccess()
 * @see java.util.Properties
 */
public static Properties getProperties(){
  SecurityManager sm=getSecurityManager();
  if (sm != null) {
    sm.checkPropertiesAccess();
  }
  return props;
}