public static JvmArguments parseArguments(String arguments){
  JvmArguments jvmArguments=new JvmArguments();
  StringBuffer genericArgs=new StringBuffer();
  if (arguments != null) {
    for (    String arg : arguments.split(" ")) {
      if (arg.startsWith("-Xms")) {
        long initialHeap=getHeapArgValueInBytes(arg);
        jvmArguments.setInitialHeap(initialHeap);
      }
 else       if (arg.startsWith("-Xmx")) {
        long maxHeap=getHeapArgValueInBytes(arg);
        jvmArguments.setMaxHeap(maxHeap);
      }
 else {
        if (genericArgs.length() > 0) {
          genericArgs.append(' ');
        }
        genericArgs.append(arg);
      }
    }
  }
  jvmArguments.setGenericArgs(genericArgs.toString());
  return jvmArguments;
}

public static JvmArguments parseArguments ( String arguments ) { JvmArguments jvmArguments = new JvmArguments ( ) ; StringBuffer genericArgs = new StringBuffer ( ) ; if ( arguments != null ) { for ( String arg : arguments . split ( " " ) ) { if ( arg . startsWith ( "-Xms" ) ) { long initialHeap = getHeapArgValueInBytes ( arg ) ; jvmArguments . setInitialHeap ( initialHeap ) ; } else if ( arg . startsWith ( "-Xmx" ) ) { long maxHeap = getHeapArgValueInBytes ( arg ) ; jvmArguments . setMaxHeap ( maxHeap ) ; } else { if ( genericArgs . length ( ) > 0 ) { genericArgs . append ( ' ' ) ; } genericArgs . append ( arg ) ; } } } jvmArguments . setGenericArgs ( genericArgs . toString ( ) ) ; return jvmArguments ; }
used for parsing jvm arguments string into specific values .
