Lines 1406-1412
Link Here
|
1406 |
this.options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5); |
1406 |
this.options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5); |
1407 |
mode = Default; |
1407 |
mode = Default; |
1408 |
continue; |
1408 |
continue; |
1409 |
} |
1409 |
} |
|
|
1410 |
if (currentArg.equals("-1.6") || currentArg.equals("-6") || currentArg.equals("-6.0")) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
1411 |
if (didSpecifyCompliance) { |
1412 |
throw new InvalidInputException( |
1413 |
Main.bind("configure.duplicateCompliance", currentArg)); //$NON-NLS-1$ |
1414 |
} |
1415 |
didSpecifyCompliance = true; |
1416 |
this.options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_6); |
1417 |
mode = Default; |
1418 |
continue; |
1419 |
} |
1410 |
if (currentArg.equals("-d")) { //$NON-NLS-1$ |
1420 |
if (currentArg.equals("-d")) { //$NON-NLS-1$ |
1411 |
if (this.destinationPath != null) |
1421 |
if (this.destinationPath != null) |
1412 |
throw new InvalidInputException( |
1422 |
throw new InvalidInputException( |
Lines 1978-1983
Link Here
|
1978 |
throw new InvalidInputException(Main.bind("configure.incompatibleComplianceForTarget", (String)this.options.get(CompilerOptions.OPTION_Compliance), CompilerOptions.VERSION_1_5)); //$NON-NLS-1$ |
1988 |
throw new InvalidInputException(Main.bind("configure.incompatibleComplianceForTarget", (String)this.options.get(CompilerOptions.OPTION_Compliance), CompilerOptions.VERSION_1_5)); //$NON-NLS-1$ |
1979 |
} |
1989 |
} |
1980 |
this.options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5); |
1990 |
this.options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5); |
|
|
1991 |
} else if (currentArg.equals("1.6") || currentArg.equals("6") || currentArg.equals("6.0")) { //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ |
1992 |
this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6); |
1993 |
if (didSpecifyCompliance && CompilerOptions.versionToJdkLevel(this.options.get(CompilerOptions.OPTION_Compliance)) < ClassFileConstants.JDK1_6) { |
1994 |
throw new InvalidInputException(Main.bind("configure.incompatibleComplianceForTarget", (String)this.options.get(CompilerOptions.OPTION_Compliance), CompilerOptions.VERSION_1_6)); //$NON-NLS-1$ |
1995 |
} |
1996 |
this.options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_6); |
1981 |
} else { |
1997 |
} else { |
1982 |
throw new InvalidInputException(Main.bind("configure.targetJDK", currentArg)); //$NON-NLS-1$ |
1998 |
throw new InvalidInputException(Main.bind("configure.targetJDK", currentArg)); //$NON-NLS-1$ |
1983 |
} |
1999 |
} |
Lines 2026-2031
Link Here
|
2026 |
this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_4); |
2042 |
this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_4); |
2027 |
} else if (currentArg.equals("1.5") || currentArg.equals("5") || currentArg.equals("5.0")) { //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ |
2043 |
} else if (currentArg.equals("1.5") || currentArg.equals("5") || currentArg.equals("5.0")) { //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ |
2028 |
this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5); |
2044 |
this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5); |
|
|
2045 |
} else if (currentArg.equals("1.6") || currentArg.equals("6") || currentArg.equals("6.0")) { //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ |
2046 |
this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6); |
2029 |
} else { |
2047 |
} else { |
2030 |
throw new InvalidInputException(Main.bind("configure.source", currentArg)); //$NON-NLS-1$ |
2048 |
throw new InvalidInputException(Main.bind("configure.source", currentArg)); //$NON-NLS-1$ |
2031 |
} |
2049 |
} |
Lines 2366-2371
Link Here
|
2366 |
} else if (CompilerOptions.VERSION_1_5.equals(version)) { |
2384 |
} else if (CompilerOptions.VERSION_1_5.equals(version)) { |
2367 |
if (!didSpecifySource) this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5); |
2385 |
if (!didSpecifySource) this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5); |
2368 |
if (!didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5); |
2386 |
if (!didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5); |
|
|
2387 |
} else if (CompilerOptions.VERSION_1_6.equals(version)) { |
2388 |
if (!didSpecifySource) this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6); |
2389 |
if (!didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6); |
2369 |
} |
2390 |
} |
2370 |
} |
2391 |
} |
2371 |
if (didSpecifySource) { |
2392 |
if (didSpecifySource) { |
Lines 2376-2386
Link Here
|
2376 |
} else if (CompilerOptions.VERSION_1_5.equals(version)) { |
2397 |
} else if (CompilerOptions.VERSION_1_5.equals(version)) { |
2377 |
if (!didSpecifyCompliance) this.options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5); |
2398 |
if (!didSpecifyCompliance) this.options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5); |
2378 |
if (!didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5); |
2399 |
if (!didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5); |
|
|
2400 |
} else if (CompilerOptions.VERSION_1_6.equals(version)) { |
2401 |
if (!didSpecifyCompliance) this.options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_6); |
2402 |
if (!didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6); |
2379 |
} |
2403 |
} |
2380 |
} |
2404 |
} |
2381 |
|
2405 |
|
2382 |
// check and set compliance/source/target compatibilities |
2406 |
// check and set compliance/source/target compatibilities |
2383 |
if (didSpecifyTarget) { |
2407 |
if (didSpecifyTarget) { |
|
|
2408 |
// target must be 1.6 if source is 1.6 |
2409 |
if (CompilerOptions.versionToJdkLevel(this.options.get(CompilerOptions.OPTION_Source)) >= ClassFileConstants.JDK1_6 |
2410 |
&& CompilerOptions.versionToJdkLevel(this.options.get(CompilerOptions.OPTION_TargetPlatform)) < ClassFileConstants.JDK1_6){ |
2411 |
throw new InvalidInputException(Main.bind("configure.incompatibleTargetForSource", (String)this.options.get(CompilerOptions.OPTION_TargetPlatform), CompilerOptions.VERSION_1_6)); //$NON-NLS-1$ |
2412 |
} |
2384 |
// target must be 1.5 if source is 1.5 |
2413 |
// target must be 1.5 if source is 1.5 |
2385 |
if (CompilerOptions.versionToJdkLevel(this.options.get(CompilerOptions.OPTION_Source)) >= ClassFileConstants.JDK1_5 |
2414 |
if (CompilerOptions.versionToJdkLevel(this.options.get(CompilerOptions.OPTION_Source)) >= ClassFileConstants.JDK1_5 |
2386 |
&& CompilerOptions.versionToJdkLevel(this.options.get(CompilerOptions.OPTION_TargetPlatform)) < ClassFileConstants.JDK1_5){ |
2415 |
&& CompilerOptions.versionToJdkLevel(this.options.get(CompilerOptions.OPTION_TargetPlatform)) < ClassFileConstants.JDK1_5){ |
Lines 2397-2411
Link Here
|
2397 |
} |
2426 |
} |
2398 |
} |
2427 |
} |
2399 |
|
2428 |
|
2400 |
// compliance must be 1.5 if source is 1.5 |
2429 |
if (this.options.get(CompilerOptions.OPTION_Source).equals(CompilerOptions.VERSION_1_6) |
2401 |
if (this.options.get(CompilerOptions.OPTION_Source).equals(CompilerOptions.VERSION_1_5) |
2430 |
&& CompilerOptions.versionToJdkLevel(this.options.get(CompilerOptions.OPTION_Compliance)) < ClassFileConstants.JDK1_6) { |
|
|
2431 |
// compliance must be 1.6 if source is 1.6 |
2432 |
throw new InvalidInputException(Main.bind("configure.incompatibleComplianceForSource", (String)this.options.get(CompilerOptions.OPTION_Compliance), CompilerOptions.VERSION_1_6)); //$NON-NLS-1$ |
2433 |
} else if (this.options.get(CompilerOptions.OPTION_Source).equals(CompilerOptions.VERSION_1_5) |
2402 |
&& CompilerOptions.versionToJdkLevel(this.options.get(CompilerOptions.OPTION_Compliance)) < ClassFileConstants.JDK1_5) { |
2434 |
&& CompilerOptions.versionToJdkLevel(this.options.get(CompilerOptions.OPTION_Compliance)) < ClassFileConstants.JDK1_5) { |
|
|
2435 |
// compliance must be 1.5 if source is 1.5 |
2403 |
throw new InvalidInputException(Main.bind("configure.incompatibleComplianceForSource", (String)this.options.get(CompilerOptions.OPTION_Compliance), CompilerOptions.VERSION_1_5)); //$NON-NLS-1$ |
2436 |
throw new InvalidInputException(Main.bind("configure.incompatibleComplianceForSource", (String)this.options.get(CompilerOptions.OPTION_Compliance), CompilerOptions.VERSION_1_5)); //$NON-NLS-1$ |
2404 |
} else |
2437 |
} else if (this.options.get(CompilerOptions.OPTION_Source).equals(CompilerOptions.VERSION_1_4) |
|
|
2438 |
&& CompilerOptions.versionToJdkLevel(this.options.get(CompilerOptions.OPTION_Compliance)) < ClassFileConstants.JDK1_4) { |
2405 |
// compliance must be 1.4 if source is 1.4 |
2439 |
// compliance must be 1.4 if source is 1.4 |
2406 |
if (this.options.get(CompilerOptions.OPTION_Source).equals(CompilerOptions.VERSION_1_4) |
2440 |
throw new InvalidInputException(Main.bind("configure.incompatibleComplianceForSource", (String)this.options.get(CompilerOptions.OPTION_Compliance), CompilerOptions.VERSION_1_4)); //$NON-NLS-1$ |
2407 |
&& CompilerOptions.versionToJdkLevel(this.options.get(CompilerOptions.OPTION_Compliance)) < ClassFileConstants.JDK1_4) { |
|
|
2408 |
throw new InvalidInputException(Main.bind("configure.incompatibleComplianceForSource", (String)this.options.get(CompilerOptions.OPTION_Compliance), CompilerOptions.VERSION_1_4)); //$NON-NLS-1$ |
2409 |
} |
2441 |
} |
2410 |
// set default target according to compliance & sourcelevel. |
2442 |
// set default target according to compliance & sourcelevel. |
2411 |
if (!didSpecifyTarget) { |
2443 |
if (!didSpecifyTarget) { |
Lines 2425-2430
Link Here
|
2425 |
} else if (this.options.get(CompilerOptions.OPTION_Source).equals(CompilerOptions.VERSION_1_5)) { |
2457 |
} else if (this.options.get(CompilerOptions.OPTION_Source).equals(CompilerOptions.VERSION_1_5)) { |
2426 |
this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5); |
2458 |
this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5); |
2427 |
} |
2459 |
} |
|
|
2460 |
} else if (this.options.get(CompilerOptions.OPTION_Compliance).equals(CompilerOptions.VERSION_1_6)) { |
2461 |
if (this.options.get(CompilerOptions.OPTION_Source).equals(CompilerOptions.VERSION_1_3)) { |
2462 |
this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_2); |
2463 |
} else if (this.options.get(CompilerOptions.OPTION_Source).equals(CompilerOptions.VERSION_1_4)) { |
2464 |
this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_4); |
2465 |
} else if (this.options.get(CompilerOptions.OPTION_Source).equals(CompilerOptions.VERSION_1_5)) { |
2466 |
this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5); |
2467 |
} else if (this.options.get(CompilerOptions.OPTION_Source).equals(CompilerOptions.VERSION_1_6)) { |
2468 |
this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6); |
2469 |
} |
2428 |
} |
2470 |
} |
2429 |
} |
2471 |
} |
2430 |
this.logger.logCommandLineArguments(newCommandLineArgs); |
2472 |
this.logger.logCommandLineArguments(newCommandLineArgs); |