code: public static String injectProperties(final String string) throws BugError
    {
      return Strings.replaceAll(string, VARIABLE_PATTERN, new Handler<String, String>()
      {
        @Override
        public String handle(String variableName)
        {
          String property = System.getProperty(variableName);
          if(property == null) {
            throw new BugError("Missing system property |%s|. String |%s| variable injection aborted.", variableName, string);
          }
          return property;
        }
      });
    }
docs: Inject system properties into text with variables. Given text uses standard variable notation
  <code>${variable-name}</code> , as known from, for example, Ant or Log4j configuration. This method replace found
  variable with system property using <code>variable-name</code> as property key. It is a logic flaw if system
  property is missing.
  <p>
  For example, injecting system properties into <code>${log}/app.log</code> will return <code>/var/log/app.log</code>
  provided there is a system property named <code>log</code> with value <code>/var/log</code>. Note that there is no
  limit on the number of system properties and/or variables to replace.
  
  @param string text with variables.
  @return new string with variables replaces.
  @throws BugError if system property is missing.