Here you can find the source of getDenotationOfJVMMemorySettings(String stringMapJavaOpts)
private static char getDenotationOfJVMMemorySettings(String stringMapJavaOpts)
//package com.java2s; //License from project: LGPL public class Main { private static char getDenotationOfJVMMemorySettings(String stringMapJavaOpts) { int index = -1; if (stringMapJavaOpts.lastIndexOf('k') != -1) { return 'k'; } else if (stringMapJavaOpts.lastIndexOf('K') != -1) { return 'K'; } else if ((index = stringMapJavaOpts.lastIndexOf('m')) != -1 && index != 2) { return 'm'; } else if ((index = stringMapJavaOpts.lastIndexOf('M')) != -1) { return 'M'; } else if ((index = stringMapJavaOpts.lastIndexOf('g')) != -1) { return 'g'; } else if ((index = stringMapJavaOpts.lastIndexOf('G')) != -1) { return 'G'; }//from ww w . j a v a 2 s. co m return (char) -1; } }