diff options
author | wisberg <wisberg> | 2003-02-01 01:00:34 +0000 |
---|---|---|
committer | wisberg <wisberg> | 2003-02-01 01:00:34 +0000 |
commit | 1b52bb2c266e2022fe42bad3686ae094376c0b0d (patch) | |
tree | dbf5511a63be59b6ec743c5f54f21a26d952ea2b /ajde | |
parent | e7e3398a966db548fe0dc0403ceba6d0d96e11c5 (diff) | |
download | aspectj-1b52bb2c266e2022fe42bad3686ae094376c0b0d.tar.gz aspectj-1b52bb2c266e2022fe42bad3686ae094376c0b0d.zip |
fixed NPE (was & for &&) with bad options file.
Also now setting some options only if not empty (was resetting options if not null).
Diffstat (limited to 'ajde')
-rw-r--r-- | ajde/src/org/aspectj/ajde/internal/CompilerAdapter.java | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/ajde/src/org/aspectj/ajde/internal/CompilerAdapter.java b/ajde/src/org/aspectj/ajde/internal/CompilerAdapter.java index 9279456a7..325ac75e5 100644 --- a/ajde/src/org/aspectj/ajde/internal/CompilerAdapter.java +++ b/ajde/src/org/aspectj/ajde/internal/CompilerAdapter.java @@ -117,8 +117,10 @@ public class CompilerAdapter { * 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); @@ -126,12 +128,12 @@ public class CompilerAdapter { } 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; @@ -141,7 +143,7 @@ public class CompilerAdapter { } 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; @@ -155,7 +157,7 @@ public class CompilerAdapter { } Set warnings = options.getWarnings(); - if ( warnings != null ) { + if (!LangUtil.isEmpty(warnings)) { // turn off all warnings disableWarnings( javaOptions ); // then selectively enable those in the set @@ -163,7 +165,7 @@ public class CompilerAdapter { } 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(); @@ -327,6 +329,7 @@ public class CompilerAdapter { List classpath = new ArrayList(); while (st.hasMoreTokens()) classpath.add(st.nextToken()); + config.setClasspath(classpath); Ajde.getDefault().logEvent("building with classpath: " + classpath); |