Issue #1139 fixed javadoc

This commit is contained in:
Greg Wilkins 2016-12-02 14:12:15 +11:00
parent 8dcdea45a1
commit 73ee8f29bd
2 changed files with 37 additions and 45 deletions

View File

@ -50,8 +50,8 @@ public class BaseBuilder
/** /**
* Add a module to the start environment in <code>${jetty.base}</code> * Add a module to the start environment in <code>${jetty.base}</code>
* *
* @param module * @param module the module to add
* the module to add * @param props The properties to substitute into a template
* @return The ini file if module was added, null if module was not added. * @return The ini file if module was added, null if module was not added.
* @throws IOException if unable to add the module * @throws IOException if unable to add the module
*/ */

View File

@ -183,7 +183,6 @@ public class StartArgs
private String exec_properties; private String exec_properties;
private boolean approveAllLicenses = false; private boolean approveAllLicenses = false;
public StartArgs(BaseHome baseHome) public StartArgs(BaseHome baseHome)
{ {
this.baseHome = baseHome; this.baseHome = baseHome;
@ -411,8 +410,7 @@ public class StartArgs
} }
/** /**
* Ensure that the System Properties are set (if defined as a System property, or start.config property, or * Ensure that the System Properties are set (if defined as a System property, or start.config property, or start.ini property)
* start.ini property)
* *
* @param key * @param key
* the key to be sure of * the key to be sure of
@ -440,8 +438,6 @@ public class StartArgs
/** /**
* Expand any command line added <code>--lib</code> lib references. * Expand any command line added <code>--lib</code> lib references.
* *
* @param baseHome
* the base home in use
* @throws IOException * @throws IOException
* if unable to expand the libraries * if unable to expand the libraries
*/ */
@ -579,7 +575,7 @@ public class StartArgs
ensureSystemPropertySet("STOP.WAIT"); ensureSystemPropertySet("STOP.WAIT");
// pass properties as args or as a file // pass properties as args or as a file
if (dryRun && exec_properties==null) if (dryRun && exec_properties == null)
{ {
for (Prop p : properties) for (Prop p : properties)
cmd.addRawArg(CommandLineBuilder.quote(p.key) + "=" + CommandLineBuilder.quote(p.value)); cmd.addRawArg(CommandLineBuilder.quote(p.key) + "=" + CommandLineBuilder.quote(p.value));
@ -587,13 +583,13 @@ public class StartArgs
else if (properties.size() > 0) else if (properties.size() > 0)
{ {
Path prop_path; Path prop_path;
if (exec_properties==null) if (exec_properties == null)
{ {
prop_path=Files.createTempFile("start_", ".properties"); prop_path = Files.createTempFile("start_",".properties");
prop_path.toFile().deleteOnExit(); prop_path.toFile().deleteOnExit();
} }
else else
prop_path=new File(exec_properties).toPath(); prop_path = new File(exec_properties).toPath();
try (OutputStream out = Files.newOutputStream(prop_path)) try (OutputStream out = Files.newOutputStream(prop_path))
{ {
@ -862,8 +858,8 @@ public class StartArgs
{ {
TextFile file = new TextFile(commands); TextFile file = new TextFile(commands);
StartLog.info("reading commands from %s",baseHome.toShortForm(commands)); StartLog.info("reading commands from %s",baseHome.toShortForm(commands));
String s = source+"|"+baseHome.toShortForm(commands); String s = source + "|" + baseHome.toShortForm(commands);
for (String line: file) for (String line : file)
{ {
parse(line,s); parse(line,s);
} }
@ -934,7 +930,7 @@ public class StartArgs
// Assign a fixed name to the property file for exec // Assign a fixed name to the property file for exec
if (arg.startsWith("--exec-properties=")) if (arg.startsWith("--exec-properties="))
{ {
exec_properties=Props.getValue(arg); exec_properties = Props.getValue(arg);
if (!exec_properties.endsWith(".properties")) if (!exec_properties.endsWith(".properties"))
throw new UsageException(ERR_BAD_ARG,"--exec-properties filename must have .properties suffix: %s",exec_properties); throw new UsageException(ERR_BAD_ARG,"--exec-properties filename must have .properties suffix: %s",exec_properties);
return; return;
@ -989,7 +985,7 @@ public class StartArgs
// jetty.base build-out : add to ${jetty.base}/start.ini // jetty.base build-out : add to ${jetty.base}/start.ini
if ("--create-startd".equals(arg)) if ("--create-startd".equals(arg))
{ {
createStartd=true; createStartd = true;
run = false; run = false;
createFiles = true; createFiles = true;
licenseCheckRequired = true; licenseCheckRequired = true;
@ -999,7 +995,7 @@ public class StartArgs
{ {
String value = Props.getValue(arg); String value = Props.getValue(arg);
StartLog.warn("--add-to-startd is deprecated! Instead use: --create-startd --add-to-start=%s",value); StartLog.warn("--add-to-startd is deprecated! Instead use: --create-startd --add-to-start=%s",value);
createStartd=true; createStartd = true;
startModules.addAll(Props.getValues(arg)); startModules.addAll(Props.getValues(arg));
run = false; run = false;
createFiles = true; createFiles = true;
@ -1083,29 +1079,29 @@ public class StartArgs
if (key.endsWith("+")) if (key.endsWith("+"))
{ {
key = key.substring(0,key.length()-1); key = key.substring(0,key.length() - 1);
String orig = getProperties().getString(key); String orig = getProperties().getString(key);
if (orig == null || orig.isEmpty()) if (orig == null || orig.isEmpty())
{ {
if (value.startsWith(",")) if (value.startsWith(","))
value=value.substring(1); value = value.substring(1);
} }
else else
{ {
value=orig+value; value = orig + value;
source=propertySource.get(key)+","+source; source = propertySource.get(key) + "," + source;
} }
} }
if (key.endsWith("?")) if (key.endsWith("?"))
{ {
key = key.substring(0,key.length()-1); key = key.substring(0,key.length() - 1);
if (getProperties().containsKey(key)) if (getProperties().containsKey(key))
return; return;
} }
else if (propertySource.containsKey(key)) else if (propertySource.containsKey(key))
{ {
if(!propertySource.get(key).endsWith("[ini]")) if (!propertySource.get(key).endsWith("[ini]"))
StartLog.warn("Property %s in %s already set in %s",key,source,propertySource.get(key)); StartLog.warn("Property %s in %s already set in %s",key,source,propertySource.get(key));
propertySource.put(key,source); propertySource.put(key,source);
} }
@ -1139,8 +1135,6 @@ public class StartArgs
throw new UsageException(ERR_BAD_ARG,"Unrecognized argument: \"%s\" in %s",arg,source); throw new UsageException(ERR_BAD_ARG,"Unrecognized argument: \"%s\" in %s",arg,source);
} }
private void enableModules(String source, List<String> moduleNames) private void enableModules(String source, List<String> moduleNames)
{ {
for (String moduleName : moduleNames) for (String moduleName : moduleNames)
@ -1208,7 +1202,7 @@ public class StartArgs
} }
properties.setProperty(key,value,source); properties.setProperty(key,value,source);
if(key.equals("java.version")) if (key.equals("java.version"))
{ {
Version ver = new Version(value); Version ver = new Version(value);
@ -1225,7 +1219,6 @@ public class StartArgs
this.run = run; this.run = run;
} }
@Override @Override
public String toString() public String toString()
{ {
@ -1242,5 +1235,4 @@ public class StartArgs
return builder.toString(); return builder.toString();
} }
} }