Github user aledsage commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/241#discussion_r18886476
--- Diff: utils/common/src/main/java/brooklyn/util/text/Strings.java ---
@@ -537,6 +537,18 @@ public static String getFirstWordAfter(String context,
String phrase) {
return getFirstWord(context.substring(index + phrase.length()));
}
+ public static String getRemainderOfLineAfter(String context, String
phrase) {
+ if (context == null || phrase == null) return null;
+ int index = context.indexOf(phrase);
+ if (index < 0) return null;
+ int lineEndIndex = context.indexOf("\n", index);
+ if (lineEndIndex <= 0) {
+ return trim(context.substring(index + phrase.length()));
--- End diff --
I don't think this should trim the result. That's not what I'd expect from
the wording `getRemainderOfLineAfter`. Let the caller trim instead, if it wants
to.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---