+ /**
+ * Helper method to parse out the resource bundle key parameter of a method
+ * call
+ *
+ * @param method
+ * @param methodArgs
+ * the rest of the source line starting with arguments to method
+ * @return
+ */
+ private String getMessageKey(String method, String methodArgs)
+ {
+ String key = methodArgs;
+
+ /*
+ * locate second argument if calling jvInitComponent()
+ */
+ if (method == JVINIT)
+ {
+ int commaLoc = methodArgs.indexOf(",");
+ if (commaLoc == -1)
+ {
+ return null;
+ }
+ key = key.substring(commaLoc + 1).trim();
+ }
+
+ /*
+ * take up to next comma or ) or end of line
+ */
+ int commaPos = key.indexOf(",");
+ int bracePos = key.indexOf(")");
+ int endPos = commaPos == -1 ? bracePos : (bracePos == -1 ? commaPos
+ : Math.min(commaPos, bracePos));
+ if (endPos == -1 && key.length() > 1 && key.endsWith("\""))
+ {
+ endPos = key.length();
+ }
+
+ return endPos == -1 ? null : key.substring(0, endPos);
+ }
+