Return a new StringBuilder containing the same contents as the input buffer, except that data of form ${varname} have been replaced by the value of that var as defined in the system property.
(StringBuilder bodyText)
| 2145 | * have been replaced by the value of that var as defined in the system property. |
| 2146 | */ |
| 2147 | private StringBuilder updateBodyText(StringBuilder bodyText) { |
| 2148 | String in = bodyText.toString(); |
| 2149 | String out; |
| 2150 | try { |
| 2151 | out = IntrospectionUtils.replaceProperties(in, null, source, getClassLoader()); |
| 2152 | } catch (Exception e) { |
| 2153 | return bodyText; // return unchanged data |
| 2154 | } |
| 2155 | |
| 2156 | if (out == in) { |
| 2157 | // No substitutions required. Don't waste memory creating |
| 2158 | // a new buffer |
| 2159 | return bodyText; |
| 2160 | } else { |
| 2161 | return new StringBuilder(out); |
| 2162 | } |
| 2163 | } |
| 2164 | |
| 2165 | |
| 2166 | private static class EntityResolverWrapper implements EntityResolver { |
no test coverage detected