Preferences { public static ScriptInfo[] decode(final String script_list) throws Exception { final String[] desc_scripts = StringSplitter.splitIgnoreInQuotes(script_list, ',', false); final ScriptInfo[] infos = new ScriptInfo[desc_scripts.length]; for (int i=0; i<infos.length; ++i) { final String[] desc_script = StringSplitter.splitIgnoreInQuotes(desc_scripts[i], '|', true); if (desc_script.length != 2) throw new Exception("Error in preference " + Activator.ID + "/scripts"); infos[i] = new ScriptInfo(desc_script[0], desc_script[1]); } return infos; }  static boolean getRunIndividualScripts(); static ScriptInfo[] getCommandInfos(); static String encode(final ScriptInfo[] infos); static ScriptInfo[] decode(final String script_list); final static String PREV_INDIVIDUAL; }
@Test public void testDecode() throws Exception { final ScriptInfo[] infos = Preferences.decode(ENCODED); assertEquals(2, infos.length); System.out.println(infos[0]); System.out.println(infos[1]); assertEquals("cmd1 -opt", infos[0].getScript()); assertEquals("Good bye", infos[1].getDescription()); }