package cucumber.runtime;

import java.util.MissingResourceException;
import java.util.ResourceBundle;

/**
 * Looks up values in the following order:
 * <ol>
 * <li>Environment variable</li>
 * <li>System property</li>
 * <li>Resource bundle</li>
 * </ol>
 */
public class Env {
    private final String bundleName;

    public Env(String bundleName) {
        this.bundleName = bundleName;
    }

    public String get(String key) {
        String value = System.getenv(key);
        if (value == null) {
            value = System.getProperty(key);
            if (value == null) {
                value = System.getProperty(key);
                if (value == null) {
                    try {
                        value = ResourceBundle.getBundle(bundleName).getString(key);
                    } catch (MissingResourceException ignore) {
                    }
                }
            }
        }
        return value;
    }
}

@@ -582,98 +582,8 @@
 ) %7B%0A
-                value = System.getProperty(key);%0A                if (value == null) %7B%0A    
     
@@ -612,36 +612,32 @@
                 
-    
 value = Resource
@@ -697,20 +697,16 @@
         
-    
 %7D catch 
@@ -745,30 +745,8 @@
 ) %7B%0A
-                    %7D%0A
     

Simplify Env