Skip to content

Commit

Permalink
Don't throw IOException when none is required (#206)
Browse files Browse the repository at this point in the history
This fixes #206 and closes #221
  • Loading branch information
michael-o committed Oct 15, 2022
1 parent 67ac243 commit f377137
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public static int executeCommandLine( Commandline cl, InputStream systemIn, Stre

/**
* Immediately forks a process, returns a callable that will block until process is complete.
*
*
* @param cl The command line to execute
* @param systemIn The input to read from, must be thread safe
* @param systemOut A consumer that receives output, must be thread safe
Expand Down Expand Up @@ -354,12 +354,10 @@ private static void handleException( final StreamFeeder streamFeeder, final Stri
* with case-insensitive environment variables like Windows, all variable names will be normalized to upper case.
*
* @return The shell environment variables, can be empty but never <code>null</code>.
* @throws IOException If the environment variables could not be queried from the shell.
* @see System#getenv() System.getenv() API, new in JDK 5.0, to get the same result <b>since 2.0.2 System#getenv()
* will be used if available in the current running jvm.</b>
*/
public static Properties getSystemEnvVars()
throws IOException
{
return getSystemEnvVars( !Os.isFamily( Os.FAMILY_WINDOWS ) );
}
Expand All @@ -370,12 +368,10 @@ public static Properties getSystemEnvVars()
*
* @param caseSensitive Whether environment variable keys should be treated case-sensitively.
* @return Properties object of (possibly modified) envar keys mapped to their values.
* @throws IOException .
* @see System#getenv() System.getenv() API, new in JDK 5.0, to get the same result <b>since 2.0.2 System#getenv()
* will be used if available in the current running jvm.</b>
*/
public static Properties getSystemEnvVars( boolean caseSensitive )
throws IOException
{
Properties envVars = new Properties();
Map<String, String> envs = System.getenv();
Expand Down

0 comments on commit f377137

Please sign in to comment.