Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't throw IOException when none is required (#206) #221

Merged
merged 1 commit into from
Oct 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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