langtools/src/share/classes/com/sun/tools/sjavac/CompileJavaPackages.java
changeset 24067 76e7b6bbbd85
parent 22448 a85fbad9d687
child 25299 b4a7dcd657f5
--- a/langtools/src/share/classes/com/sun/tools/sjavac/CompileJavaPackages.java	Mon Apr 21 22:51:49 2014 +0100
+++ b/langtools/src/share/classes/com/sun/tools/sjavac/CompileJavaPackages.java	Tue Apr 22 16:51:10 2014 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,15 +25,16 @@
 
 package com.sun.tools.sjavac;
 
+import java.io.PrintStream;
 import java.net.URI;
 import java.util.Arrays;
 import java.util.Random;
 import java.util.Set;
 import java.util.Map;
 
+import com.sun.tools.sjavac.options.Options;
 import com.sun.tools.sjavac.server.JavacServer;
 import com.sun.tools.sjavac.server.SysInfo;
-import java.io.PrintStream;
 
 /**
  * This transform compiles a set of packages containing Java sources.
@@ -54,13 +55,12 @@
     // We hope to improve this in the future.
     final static int limitOnConcurrency = 3;
 
-    String serverSettings;
+    Options args;
+
     public void setExtra(String e) {
-        serverSettings = e;
     }
 
-    String[] args;
-    public void setExtra(String[] a) {
+    public void setExtra(Options a) {
         args = a;
     }
 
@@ -82,14 +82,14 @@
         boolean concurrentCompiles = true;
 
         // Fetch the id.
-        String id = Util.extractStringOption("id", serverSettings);
+        String id = Util.extractStringOption("id", args.getServerConf());
         if (id == null || id.equals("")) {
             // No explicit id set. Create a random id so that the requests can be
             // grouped properly in the server.
             id = "id"+(((new Random()).nextLong())&Long.MAX_VALUE);
         }
         // Only keep portfile and sjavac settings..
-        String psServerSettings = Util.cleanSubOptions("--server:", Util.set("portfile","sjavac","background","keepalive"), serverSettings);
+        String psServerSettings = Util.cleanSubOptions(Util.set("portfile","sjavac","background","keepalive"), args.getServerConf());
 
         // Get maximum heap size from the server!
         SysInfo sysinfo = JavacServer.connectGetSysInfo(psServerSettings, out, err);
@@ -223,7 +223,7 @@
                 @Override
                 public void run() {
                                         rn[ii] = JavacServer.useServer(cleanedServerSettings,
-                                                           Main.removeWrapperArgs(args),
+                                                           args.prepJavacArgs(),
                                                                cc.srcs,
                                                            fvisible_sources,
                                                            fvisible_classes,