import java.util.List;
import java.util.Map;
import java.util.Properties;
+import java.util.Set;
import java.util.StringTokenizer;
+import java.util.TreeSet;
import org.argeo.slc.ide.ui.SlcIdeUiPlugin;
import org.eclipse.core.resources.IFile;
*/
@SuppressWarnings("restriction")
public class OsgiLaunchHelper implements OsgiLauncherConstants {
- private static Boolean debug = false;
+ private static Boolean debug = true;
private final static String DEFAULT_DATA_DIR = "data";
private final static String DEFAULT_EXEC_DIR = "exec";
- private final static String DEFAULT_VMARGS = "-Xmx128m";
+ private final static String DEFAULT_VMARGS = "-Xmx256m";
private final static String DEFAULT_PROGRAM_ARGS = "-console";
/** Sets default values on this configuration. */
if (debug)
System.out.println("Original bundle list: " + original);
- StringBuffer bufBundles = new StringBuffer(1024);
StringTokenizer stComa = new StringTokenizer(original, ",");
- boolean first = true;
+ // sort by bundle symbolic name
+ Set<String> bundleIds = new TreeSet<String>();
bundles: while (stComa.hasMoreTokens()) {
- if (first)
- first = false;
- else
- bufBundles.append(',');
String bundleId = stComa.nextToken();
if (bundleId.indexOf('*') >= 0)
+ " not properly formatted, clean your workspace projects");
int indexAt = bundleId.indexOf('@');
- boolean modified = false;
if (indexAt >= 0) {
bundleId = bundleId.substring(0, indexAt);
}
// skip simple configurator in order to avoid side-effects
continue bundles;
}
+ bundleIds.add(bundleId);
+ }
+ StringBuffer bufBundles = new StringBuffer(1024);
+ boolean first = true;
+ for (String bundleId : bundleIds) {
+ if (first)
+ first = false;
+ else
+ bufBundles.append(',');
+ boolean modified = false;
if (bundlesToStart.contains(bundleId)) {
bufBundles.append(bundleId).append('@').append("default:true");
modified = true;
if (!modified)
bufBundles.append(bundleId);
+
}
String output = bufBundles.toString();
return output;
try {
in = file.getContents();
props.load(in);
- } catch (IOException e) {
+ } catch (Exception e) {
throw new CoreException(new Status(IStatus.ERROR,
SlcIdeUiPlugin.ID, "Cannot read properties file", e));
} finally {