### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: batch/org/eclipse/jdt/internal/compiler/batch/Main.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java,v retrieving revision 1.277 diff -u -r1.277 Main.java --- batch/org/eclipse/jdt/internal/compiler/batch/Main.java 17 Jan 2007 02:36:07 -0000 1.277 +++ batch/org/eclipse/jdt/internal/compiler/batch/Main.java 26 Jan 2007 19:37:37 -0000 @@ -3412,20 +3412,66 @@ if (!this.didSpecifySource) this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_3); if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_1); } else if (CompilerOptions.VERSION_1_4.equals(version)) { - if (!this.didSpecifySource) this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_3); - if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_2); + if (this.didSpecifySource) { + Object source = this.options.get(CompilerOptions.OPTION_Source); + if (CompilerOptions.VERSION_1_2.equals(source) + || CompilerOptions.VERSION_1_3.equals(source)) { + if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_2); + } else if (CompilerOptions.VERSION_1_4.equals(source)) { + if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_4); + } + } else { + this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_3); + if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_2); + } } else if (CompilerOptions.VERSION_1_5.equals(version)) { - if (!this.didSpecifySource) this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5); - if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5); + if (this.didSpecifySource) { + Object source = this.options.get(CompilerOptions.OPTION_Source); + if (CompilerOptions.VERSION_1_2.equals(source) + || CompilerOptions.VERSION_1_3.equals(source) + || CompilerOptions.VERSION_1_4.equals(source)) { + if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_4); + } else if (CompilerOptions.VERSION_1_5.equals(source)) { + if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5); + } + } else { + this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5); + if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5); + } } else if (CompilerOptions.VERSION_1_6.equals(version)) { - if (!this.didSpecifySource) this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6); - if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6); + if (this.didSpecifySource) { + Object source = this.options.get(CompilerOptions.OPTION_Source); + if (CompilerOptions.VERSION_1_2.equals(source) + || CompilerOptions.VERSION_1_3.equals(source) + || CompilerOptions.VERSION_1_4.equals(source)) { + if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_4); + } else if (CompilerOptions.VERSION_1_5.equals(source) + || CompilerOptions.VERSION_1_6.equals(source)) { + if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6); + } + } else { + this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6); + if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6); + } } else if (CompilerOptions.VERSION_1_7.equals(version)) { - if (!this.didSpecifySource) this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7); - if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7); + if (this.didSpecifySource) { + Object source = this.options.get(CompilerOptions.OPTION_Source); + if (CompilerOptions.VERSION_1_2.equals(source) + || CompilerOptions.VERSION_1_3.equals(source) + || CompilerOptions.VERSION_1_4.equals(source)) { + if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_4); + } else if (CompilerOptions.VERSION_1_5.equals(source) + || CompilerOptions.VERSION_1_6.equals(source)) { + if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6); + } else if (CompilerOptions.VERSION_1_7.equals(source)) { + if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7); + } + } else { + this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7); + if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7); + } } - } - if (this.didSpecifySource) { + } else if (this.didSpecifySource) { Object version = this.options.get(CompilerOptions.OPTION_Source); // default is source 1.3 target 1.2 and compliance 1.4 if (CompilerOptions.VERSION_1_4.equals(version)) {