Index: compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java,v retrieving revision 1.13 diff -u -r1.13 ClassFileConstants.java --- compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java 23 Feb 2005 02:47:58 -0000 1.13 +++ compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java 3 Oct 2005 19:15:03 -0000 @@ -43,6 +43,7 @@ int MAJOR_VERSION_1_3 = 47; int MAJOR_VERSION_1_4 = 48; int MAJOR_VERSION_1_5 = 49; + int MAJOR_VERSION_1_6 = 50; int MINOR_VERSION_0 = 0; int MINOR_VERSION_1 = 1; @@ -56,6 +57,7 @@ long JDK1_3 = ((long)ClassFileConstants.MAJOR_VERSION_1_3 << 16) + ClassFileConstants.MINOR_VERSION_0; long JDK1_4 = ((long)ClassFileConstants.MAJOR_VERSION_1_4 << 16) + ClassFileConstants.MINOR_VERSION_0; long JDK1_5 = ((long)ClassFileConstants.MAJOR_VERSION_1_5 << 16) + ClassFileConstants.MINOR_VERSION_0; + long JDK1_6 = ((long)ClassFileConstants.MAJOR_VERSION_1_6 << 16) + ClassFileConstants.MINOR_VERSION_0; // jdk level used to denote future releases: optional behavior is not enabled for now, but may become so. In order to enable these, // search for references to this constant, and change it to one of the official JDT constants above. 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.212 diff -u -r1.212 Main.java --- batch/org/eclipse/jdt/internal/compiler/batch/Main.java 27 Sep 2005 20:42:49 -0000 1.212 +++ batch/org/eclipse/jdt/internal/compiler/batch/Main.java 3 Oct 2005 19:15:03 -0000 @@ -1406,7 +1406,17 @@ this.options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5); mode = Default; continue; - } + } + if (currentArg.equals("-1.6") || currentArg.equals("-6") || currentArg.equals("-6.0")) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + if (didSpecifyCompliance) { + throw new InvalidInputException( + Main.bind("configure.duplicateCompliance", currentArg)); //$NON-NLS-1$ + } + didSpecifyCompliance = true; + this.options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_6); + mode = Default; + continue; + } if (currentArg.equals("-d")) { //$NON-NLS-1$ if (this.destinationPath != null) throw new InvalidInputException( @@ -1978,6 +1988,12 @@ throw new InvalidInputException(Main.bind("configure.incompatibleComplianceForTarget", (String)this.options.get(CompilerOptions.OPTION_Compliance), CompilerOptions.VERSION_1_5)); //$NON-NLS-1$ } this.options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5); + } else if (currentArg.equals("1.6") || currentArg.equals("6") || currentArg.equals("6.0")) { //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ + this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6); + if (didSpecifyCompliance && CompilerOptions.versionToJdkLevel(this.options.get(CompilerOptions.OPTION_Compliance)) < ClassFileConstants.JDK1_6) { + throw new InvalidInputException(Main.bind("configure.incompatibleComplianceForTarget", (String)this.options.get(CompilerOptions.OPTION_Compliance), CompilerOptions.VERSION_1_6)); //$NON-NLS-1$ + } + this.options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_6); } else { throw new InvalidInputException(Main.bind("configure.targetJDK", currentArg)); //$NON-NLS-1$ } @@ -2026,6 +2042,8 @@ this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_4); } else if (currentArg.equals("1.5") || currentArg.equals("5") || currentArg.equals("5.0")) { //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5); + } else if (currentArg.equals("1.6") || currentArg.equals("6") || currentArg.equals("6.0")) { //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ + this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6); } else { throw new InvalidInputException(Main.bind("configure.source", currentArg)); //$NON-NLS-1$ } @@ -2366,6 +2384,9 @@ } else if (CompilerOptions.VERSION_1_5.equals(version)) { if (!didSpecifySource) this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5); if (!didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5); + } else if (CompilerOptions.VERSION_1_6.equals(version)) { + if (!didSpecifySource) this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6); + if (!didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6); } } if (didSpecifySource) { @@ -2376,11 +2397,19 @@ } else if (CompilerOptions.VERSION_1_5.equals(version)) { if (!didSpecifyCompliance) this.options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5); if (!didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5); + } else if (CompilerOptions.VERSION_1_6.equals(version)) { + if (!didSpecifyCompliance) this.options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_6); + if (!didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6); } } // check and set compliance/source/target compatibilities if (didSpecifyTarget) { + // target must be 1.6 if source is 1.6 + if (CompilerOptions.versionToJdkLevel(this.options.get(CompilerOptions.OPTION_Source)) >= ClassFileConstants.JDK1_6 + && CompilerOptions.versionToJdkLevel(this.options.get(CompilerOptions.OPTION_TargetPlatform)) < ClassFileConstants.JDK1_6){ + throw new InvalidInputException(Main.bind("configure.incompatibleTargetForSource", (String)this.options.get(CompilerOptions.OPTION_TargetPlatform), CompilerOptions.VERSION_1_6)); //$NON-NLS-1$ + } // target must be 1.5 if source is 1.5 if (CompilerOptions.versionToJdkLevel(this.options.get(CompilerOptions.OPTION_Source)) >= ClassFileConstants.JDK1_5 && CompilerOptions.versionToJdkLevel(this.options.get(CompilerOptions.OPTION_TargetPlatform)) < ClassFileConstants.JDK1_5){ @@ -2397,15 +2426,18 @@ } } - // compliance must be 1.5 if source is 1.5 - if (this.options.get(CompilerOptions.OPTION_Source).equals(CompilerOptions.VERSION_1_5) + if (this.options.get(CompilerOptions.OPTION_Source).equals(CompilerOptions.VERSION_1_6) + && CompilerOptions.versionToJdkLevel(this.options.get(CompilerOptions.OPTION_Compliance)) < ClassFileConstants.JDK1_6) { + // compliance must be 1.6 if source is 1.6 + throw new InvalidInputException(Main.bind("configure.incompatibleComplianceForSource", (String)this.options.get(CompilerOptions.OPTION_Compliance), CompilerOptions.VERSION_1_6)); //$NON-NLS-1$ + } else if (this.options.get(CompilerOptions.OPTION_Source).equals(CompilerOptions.VERSION_1_5) && CompilerOptions.versionToJdkLevel(this.options.get(CompilerOptions.OPTION_Compliance)) < ClassFileConstants.JDK1_5) { + // compliance must be 1.5 if source is 1.5 throw new InvalidInputException(Main.bind("configure.incompatibleComplianceForSource", (String)this.options.get(CompilerOptions.OPTION_Compliance), CompilerOptions.VERSION_1_5)); //$NON-NLS-1$ - } else + } else if (this.options.get(CompilerOptions.OPTION_Source).equals(CompilerOptions.VERSION_1_4) + && CompilerOptions.versionToJdkLevel(this.options.get(CompilerOptions.OPTION_Compliance)) < ClassFileConstants.JDK1_4) { // compliance must be 1.4 if source is 1.4 - if (this.options.get(CompilerOptions.OPTION_Source).equals(CompilerOptions.VERSION_1_4) - && CompilerOptions.versionToJdkLevel(this.options.get(CompilerOptions.OPTION_Compliance)) < ClassFileConstants.JDK1_4) { - throw new InvalidInputException(Main.bind("configure.incompatibleComplianceForSource", (String)this.options.get(CompilerOptions.OPTION_Compliance), CompilerOptions.VERSION_1_4)); //$NON-NLS-1$ + throw new InvalidInputException(Main.bind("configure.incompatibleComplianceForSource", (String)this.options.get(CompilerOptions.OPTION_Compliance), CompilerOptions.VERSION_1_4)); //$NON-NLS-1$ } // set default target according to compliance & sourcelevel. if (!didSpecifyTarget) { @@ -2425,6 +2457,16 @@ } else if (this.options.get(CompilerOptions.OPTION_Source).equals(CompilerOptions.VERSION_1_5)) { this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5); } + } else if (this.options.get(CompilerOptions.OPTION_Compliance).equals(CompilerOptions.VERSION_1_6)) { + if (this.options.get(CompilerOptions.OPTION_Source).equals(CompilerOptions.VERSION_1_3)) { + this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_2); + } else if (this.options.get(CompilerOptions.OPTION_Source).equals(CompilerOptions.VERSION_1_4)) { + this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_4); + } else if (this.options.get(CompilerOptions.OPTION_Source).equals(CompilerOptions.VERSION_1_5)) { + this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5); + } else if (this.options.get(CompilerOptions.OPTION_Source).equals(CompilerOptions.VERSION_1_6)) { + this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6); + } } } this.logger.logCommandLineArguments(newCommandLineArgs); Index: model/org/eclipse/jdt/core/JavaCore.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java,v retrieving revision 1.489 diff -u -r1.489 JavaCore.java --- model/org/eclipse/jdt/core/JavaCore.java 26 Sep 2005 15:51:47 -0000 1.489 +++ model/org/eclipse/jdt/core/JavaCore.java 3 Oct 2005 19:15:04 -0000 @@ -899,6 +899,12 @@ /** * Possible configurable option value. * @see #getDefaultOptions() + * @since 3.2 + */ + public static final String VERSION_1_6 = "1.6"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() * @since 2.0 */ public static final String ABORT = "abort"; //$NON-NLS-1$ Index: compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java,v retrieving revision 1.143 diff -u -r1.143 CompilerOptions.java --- compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java 26 Sep 2005 15:51:47 -0000 1.143 +++ compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java 3 Oct 2005 19:15:03 -0000 @@ -123,6 +123,7 @@ public static final String VERSION_1_3 = "1.3"; //$NON-NLS-1$ public static final String VERSION_1_4 = "1.4"; //$NON-NLS-1$ public static final String VERSION_1_5 = "1.5"; //$NON-NLS-1$ + public static final String VERSION_1_6 = "1.6"; //$NON-NLS-1$ public static final String ERROR = "error"; //$NON-NLS-1$ public static final String WARNING = "warning"; //$NON-NLS-1$ public static final String IGNORE = "ignore"; //$NON-NLS-1$