From aba59e19587dd920078b2cc09287ea4b7a68eca9 Mon Sep 17 00:00:00 2001 From: acolyer Date: Tue, 4 May 2004 16:21:34 +0000 Subject: [PATCH] change getJavaOptions to getOptions --- .../ajde/internal/CompilerAdapter.java | 34 +++++++++---------- .../aspectj/ajde/BuildConfigurationTests.java | 22 ++++++------ 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/ajde/src/org/aspectj/ajde/internal/CompilerAdapter.java b/ajde/src/org/aspectj/ajde/internal/CompilerAdapter.java index 1df25e3f7..4ee93f867 100644 --- a/ajde/src/org/aspectj/ajde/internal/CompilerAdapter.java +++ b/ajde/src/org/aspectj/ajde/internal/CompilerAdapter.java @@ -182,7 +182,7 @@ public class CompilerAdapter { // always force model generation in AJDE config.setGenerateModelMode(true); if (Ajde.getDefault().getBuildManager().getBuildOptions().getJavaOptionsMap() != null) { - config.getJavaOptions().putAll(Ajde.getDefault().getBuildManager().getBuildOptions().getJavaOptionsMap()); + config.getOptions().set(Ajde.getDefault().getBuildManager().getBuildOptions().getJavaOptionsMap()); } return config; // return fixupBuildConfig(config); @@ -238,17 +238,17 @@ public class CompilerAdapter { private static boolean configureBuildOptions( AjBuildConfig config, BuildOptionsAdapter options, IMessageHandler handler) { LangUtil.throwIaxIfNull(options, "options"); LangUtil.throwIaxIfNull(config, "config"); - Map javaOptions = config.getJavaOptions(); - LangUtil.throwIaxIfNull(javaOptions, "javaOptions"); + Map optionsToSet = new HashMap(); + LangUtil.throwIaxIfNull(optionsToSet, "javaOptions"); if (options.getSourceOnePointFourMode()) { - javaOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_4); - javaOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_4); + optionsToSet.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_4); + optionsToSet.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_4); } String enc = options.getCharacterEncoding(); if (!LangUtil.isEmpty(enc)) { - javaOptions.put(CompilerOptions.OPTION_Encoding, enc ); + optionsToSet.put(CompilerOptions.OPTION_Encoding, enc ); } String compliance = options.getComplianceLevel(); @@ -257,8 +257,8 @@ public class CompilerAdapter { if ( compliance.equals( BuildOptionsAdapter.VERSION_13 ) ) { version = CompilerOptions.VERSION_1_3; } - javaOptions.put(CompilerOptions.OPTION_Compliance, version ); - javaOptions.put(CompilerOptions.OPTION_Source, version ); + optionsToSet.put(CompilerOptions.OPTION_Compliance, version ); + optionsToSet.put(CompilerOptions.OPTION_Source, version ); } String sourceLevel = options.getSourceCompatibilityLevel(); @@ -268,19 +268,19 @@ public class CompilerAdapter { slVersion = CompilerOptions.VERSION_1_3; } // never set a lower source level than compliance level - String setCompliance = (String) javaOptions.get( CompilerOptions.OPTION_Compliance); + String setCompliance = (String) optionsToSet.get( CompilerOptions.OPTION_Compliance); if ( ! (setCompliance.equals( CompilerOptions.VERSION_1_4 ) && slVersion.equals(CompilerOptions.VERSION_1_3)) ) { - javaOptions.put(CompilerOptions.OPTION_Source, slVersion); + optionsToSet.put(CompilerOptions.OPTION_Source, slVersion); } } Set warnings = options.getWarnings(); if (!LangUtil.isEmpty(warnings)) { // turn off all warnings - disableWarnings( javaOptions ); + disableWarnings( optionsToSet ); // then selectively enable those in the set - enableWarnings( javaOptions, warnings ); + enableWarnings( optionsToSet, warnings ); } Set debugOptions = options.getDebugLevel(); @@ -305,11 +305,11 @@ public class CompilerAdapter { varAttr = true; } } - if (sourceLine) javaOptions.put(CompilerOptions.OPTION_SourceFileAttribute, + if (sourceLine) optionsToSet.put(CompilerOptions.OPTION_SourceFileAttribute, CompilerOptions.GENERATE); - if (varAttr) javaOptions.put(CompilerOptions.OPTION_LocalVariableAttribute, + if (varAttr) optionsToSet.put(CompilerOptions.OPTION_LocalVariableAttribute, CompilerOptions.GENERATE); - if (lineNo) javaOptions.put(CompilerOptions.OPTION_LineNumberAttribute, + if (lineNo) optionsToSet.put(CompilerOptions.OPTION_LineNumberAttribute, CompilerOptions.GENERATE); } //XXX we can't turn off import errors in 3.0 stream @@ -319,7 +319,7 @@ public class CompilerAdapter { // } if ( options.getPreserveAllLocals() ) { - javaOptions.put( CompilerOptions.OPTION_PreserveUnusedLocal, + optionsToSet.put( CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.PRESERVE); } if ( !config.isIncrementalMode() @@ -327,7 +327,7 @@ public class CompilerAdapter { config.setIncrementalMode(true); } - config.setJavaOptions( javaOptions ); + config.getOptions().set(optionsToSet); String toAdd = options.getNonStandardOptions(); return LangUtil.isEmpty(toAdd) ? true diff --git a/ajde/testsrc/org/aspectj/ajde/BuildConfigurationTests.java b/ajde/testsrc/org/aspectj/ajde/BuildConfigurationTests.java index 1223b865d..219e32dd9 100644 --- a/ajde/testsrc/org/aspectj/ajde/BuildConfigurationTests.java +++ b/ajde/testsrc/org/aspectj/ajde/BuildConfigurationTests.java @@ -65,7 +65,7 @@ public class BuildConfigurationTests extends AjdeTestCase { buildOptions.setCharacterEncoding( "12345" ); buildConfig = compilerAdapter.genBuildConfig( configFile ); assertTrue(configFile + " failed", null != buildConfig); - Map options = buildConfig.getJavaOptions(); + Map options = buildConfig.getOptions().getMap(); String encoding = (String) options.get( CompilerOptions.OPTION_Encoding ); assertEquals( "character encoding", "12345", encoding ); } @@ -74,7 +74,7 @@ public class BuildConfigurationTests extends AjdeTestCase { buildOptions.setComplianceLevel( BuildOptionsAdapter.VERSION_14 ); buildConfig = compilerAdapter.genBuildConfig( configFile ); assertTrue(configFile + " failed", null != buildConfig); - Map options = buildConfig.getJavaOptions(); + Map options = buildConfig.getOptions().getMap(); String compliance = (String) options.get(CompilerOptions.OPTION_Compliance); String sourceLevel = (String) options.get(CompilerOptions.OPTION_Source); assertEquals( "compliance level", CompilerOptions.VERSION_1_4, compliance); @@ -86,7 +86,7 @@ public class BuildConfigurationTests extends AjdeTestCase { buildOptions.setSourceCompatibilityLevel( BuildOptionsAdapter.VERSION_14); buildConfig = compilerAdapter.genBuildConfig( configFile ); assertTrue(configFile + " failed", null != buildConfig); - Map options = buildConfig.getJavaOptions(); + Map options = buildConfig.getOptions().getMap(); String compliance = (String) options.get(CompilerOptions.OPTION_Compliance); String sourceLevel = (String) options.get(CompilerOptions.OPTION_Source); assertEquals( "compliance level", CompilerOptions.VERSION_1_3, compliance); @@ -99,7 +99,7 @@ public class BuildConfigurationTests extends AjdeTestCase { buildOptions.setSourceCompatibilityLevel( BuildOptionsAdapter.VERSION_13); buildConfig = compilerAdapter.genBuildConfig( configFile ); assertTrue(configFile + " failed", null != buildConfig); - Map options = buildConfig.getJavaOptions(); + Map options = buildConfig.getOptions().getMap(); String compliance = (String) options.get(CompilerOptions.OPTION_Compliance); String sourceLevel = (String) options.get(CompilerOptions.OPTION_Source); assertEquals( "compliance level", CompilerOptions.VERSION_1_4, compliance); @@ -111,7 +111,7 @@ public class BuildConfigurationTests extends AjdeTestCase { buildOptions.setWarnings( null ); buildConfig = compilerAdapter.genBuildConfig( configFile ); assertTrue(configFile + " failed", null != buildConfig); - Map options = buildConfig.getJavaOptions(); + Map options = buildConfig.getOptions().getMap(); // this should leave us with the default warnings assertOptionEquals( "report overriding package default", @@ -213,7 +213,7 @@ public class BuildConfigurationTests extends AjdeTestCase { buildOptions.setWarnings( warnings ); buildConfig = compilerAdapter.genBuildConfig( configFile ); assertTrue(configFile + " failed", null != buildConfig); - Map options = buildConfig.getJavaOptions(); + Map options = buildConfig.getOptions().getMap(); // this should leave us with all the user specifiable warnings // turned on @@ -259,7 +259,7 @@ public class BuildConfigurationTests extends AjdeTestCase { buildOptions.setDebugLevel( null ); buildConfig = compilerAdapter.genBuildConfig( configFile ); assertTrue(configFile + " failed", null != buildConfig); - Map options = buildConfig.getJavaOptions(); + Map options = buildConfig.getOptions().getMap(); // this should leave us with the default debug settings assertOptionEquals( "debug source", @@ -280,7 +280,7 @@ public class BuildConfigurationTests extends AjdeTestCase { buildOptions.setDebugLevel( new HashSet() ); buildConfig = compilerAdapter.genBuildConfig( configFile ); assertTrue(configFile + " failed", null != buildConfig); - Map options = buildConfig.getJavaOptions(); + Map options = buildConfig.getOptions().getMap(); // this should leave us with the debug on assertOptionEquals( "debug source", @@ -303,7 +303,7 @@ public class BuildConfigurationTests extends AjdeTestCase { buildOptions.setDebugLevel( debugOpts ); buildConfig = compilerAdapter.genBuildConfig( configFile ); assertTrue(configFile + " failed", null != buildConfig); - Map options = buildConfig.getJavaOptions(); + Map options = buildConfig.getOptions().getMap(); // this should leave us with all debug on assertOptionEquals( "debug source", @@ -328,7 +328,7 @@ public class BuildConfigurationTests extends AjdeTestCase { buildOptions.setDebugLevel( debugOpts ); buildConfig = compilerAdapter.genBuildConfig( configFile ); assertTrue(configFile + " failed", null != buildConfig); - Map options = buildConfig.getJavaOptions(); + Map options = buildConfig.getOptions().getMap(); // this should leave us with all debug on assertOptionEquals( "debug source", @@ -359,7 +359,7 @@ public class BuildConfigurationTests extends AjdeTestCase { buildOptions.setPreserveAllLocals( true ); buildConfig = compilerAdapter.genBuildConfig( configFile ); assertTrue(configFile + " failed", null != buildConfig); - Map options = buildConfig.getJavaOptions(); + Map options = buildConfig.getOptions().getMap(); String preserve = (String) options.get( CompilerOptions.OPTION_PreserveUnusedLocal ); assertEquals( "preserve unused", CompilerOptions.PRESERVE, preserve ); } -- 2.39.5