* Added by AMC 01.20.2003, bugzilla #29769
*/
private void configureBuildOptions( AjBuildConfig config, BuildOptionsAdapter options ) {
-
+ LangUtil.throwIaxIfNull(options, "options");
+ LangUtil.throwIaxIfNull(config, "config");
Map javaOptions = config.getJavaOptions();
+ LangUtil.throwIaxIfNull(javaOptions, "javaOptions");
if (options.getSourceOnePointFourMode()) {
javaOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_4);
}
String enc = options.getCharacterEncoding();
- if ( enc != null & (enc.length() > 0)) {
+ if (!LangUtil.isEmpty(enc)) {
javaOptions.put(CompilerOptions.OPTION_Encoding, enc );
}
String compliance = options.getComplianceLevel();
- if ( compliance != null && (compliance.length() > 0) ) {
+ if (!LangUtil.isEmpty(compliance)) {
String version = CompilerOptions.VERSION_1_4;
if ( compliance.equals( BuildOptionsAdapter.VERSION_13 ) ) {
version = CompilerOptions.VERSION_1_3;
}
String sourceLevel = options.getSourceCompatibilityLevel();
- if ( null != sourceLevel && ( sourceLevel.length() > 0 )) {
+ if (!LangUtil.isEmpty(sourceLevel)) {
String slVersion = CompilerOptions.VERSION_1_4;
if ( sourceLevel.equals( BuildOptionsAdapter.VERSION_13 ) ) {
slVersion = CompilerOptions.VERSION_1_3;
}
Set warnings = options.getWarnings();
- if ( warnings != null ) {
+ if (!LangUtil.isEmpty(warnings)) {
// turn off all warnings
disableWarnings( javaOptions );
// then selectively enable those in the set
}
Set debugOptions = options.getDebugLevel();
- if ( debugOptions != null ) {
+ if (!LangUtil.isEmpty(debugOptions)) {
// default is all options off, so just need to selectively
// enable
Iterator it = debugOptions.iterator();
List classpath = new ArrayList();
while (st.hasMoreTokens()) classpath.add(st.nextToken());
+
config.setClasspath(classpath);
Ajde.getDefault().logEvent("building with classpath: " + classpath);