@Test public void testNormalizeValue() throws Exception{ String normalizedValue = ConfigMergeHelper.normalizeValue(null, "2048m"); assertEquals("2048m", normalizedValue); normalizedValue = ConfigMergeHelper.normalizeValue("3k", "2048"); assertEquals("2048", normalizedValue); normalizedValue = ConfigMergeHelper.normalizeValue("1024m", "2048"); assertEquals("2048m", normalizedValue); normalizedValue = ConfigMergeHelper.normalizeValue("1024M", "2048"); assertEquals("2048M", normalizedValue); normalizedValue = ConfigMergeHelper.normalizeValue("4g", "2"); assertEquals("2g", normalizedValue); normalizedValue = ConfigMergeHelper.normalizeValue("4G", "2"); assertEquals("2G", normalizedValue); }
static String normalizeValue(String templateValue, String newRawValue) { if (null == templateValue) { return newRawValue; } Matcher m = HEAP_PATTERN.matcher(templateValue); if (m.matches()) { return newRawValue + m.group(2); } return newRawValue; }
ConfigMergeHelper { static String normalizeValue(String templateValue, String newRawValue) { if (null == templateValue) { return newRawValue; } Matcher m = HEAP_PATTERN.matcher(templateValue); if (m.matches()) { return newRawValue + m.group(2); } return newRawValue; } }
ConfigMergeHelper { static String normalizeValue(String templateValue, String newRawValue) { if (null == templateValue) { return newRawValue; } Matcher m = HEAP_PATTERN.matcher(templateValue); if (m.matches()) { return newRawValue + m.group(2); } return newRawValue; }  }
ConfigMergeHelper { static String normalizeValue(String templateValue, String newRawValue) { if (null == templateValue) { return newRawValue; } Matcher m = HEAP_PATTERN.matcher(templateValue); if (m.matches()) { return newRawValue + m.group(2); } return newRawValue; }  @SuppressWarnings("unchecked") Map<String, Map<String, ThreeWayValue>> getConflicts(String clusterName, StackId targetStack); }
ConfigMergeHelper { static String normalizeValue(String templateValue, String newRawValue) { if (null == templateValue) { return newRawValue; } Matcher m = HEAP_PATTERN.matcher(templateValue); if (m.matches()) { return newRawValue + m.group(2); } return newRawValue; }  @SuppressWarnings("unchecked") Map<String, Map<String, ThreeWayValue>> getConflicts(String clusterName, StackId targetStack);  }