private static Map<String,String> extractKeyValuePairs(String props,ObjectName mbean){
  Map<String,String> map=new LinkedHashMap<String,String>();
  int eq=props.indexOf("=");
  while (eq != -1) {
    String key=props.substring(0,eq);
    String value=mbean.getKeyProperty(key);
    map.put(key,value);
    props=props.substring(key.length() + 1 + value.length());
    if (props.startsWith(",")) {
      props=props.substring(1);
    }
    eq=props.indexOf("=");
  }
  return map;
}

private static Map < String , String > extractKeyValuePairs ( String props , ObjectName mbean ) { Map < String , String > map = new LinkedHashMap < String , String > ( ) ; int eq = props . indexOf ( "=" ) ; while ( eq != - 1 ) { String key = props . substring ( 0 , eq ) ; String value = mbean . getKeyProperty ( key ) ; map . put ( key , value ) ; props = props . substring ( key . length ( ) + 1 + value . length ( ) ) ; if ( props . startsWith ( "," ) ) { props = props . substring ( 1 ) ; } eq = props . indexOf ( "=" ) ; } return map ; }
parses the mbean objectname comma - separated properties string and puts the individual key / value pairs into the map . key order in the properties string is preserved by the map .
