View | Details | Raw Unified | Return to bug 141830
Collapse All | Expand All

(-)batch/org/eclipse/jdt/internal/compiler/batch/Main.java (-10 / +56 lines)
Lines 3412-3431 Link Here
3412
			if (!this.didSpecifySource) this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_3);
3412
			if (!this.didSpecifySource) this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_3);
3413
			if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_1);
3413
			if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_1);
3414
		} else if (CompilerOptions.VERSION_1_4.equals(version)) {
3414
		} else if (CompilerOptions.VERSION_1_4.equals(version)) {
3415
			if (!this.didSpecifySource) this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_3);
3415
			if (this.didSpecifySource) {
3416
			if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_2);
3416
				Object source = this.options.get(CompilerOptions.OPTION_Source);
3417
				if (CompilerOptions.VERSION_1_2.equals(source)
3418
						|| CompilerOptions.VERSION_1_3.equals(source)) {
3419
					if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_2);
3420
				} else if (CompilerOptions.VERSION_1_4.equals(source)) {
3421
					if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_4);
3422
				}
3423
			} else {
3424
				this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_3);
3425
				if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_2);
3426
			}
3417
		} else if (CompilerOptions.VERSION_1_5.equals(version)) {
3427
		} else if (CompilerOptions.VERSION_1_5.equals(version)) {
3418
			if (!this.didSpecifySource) this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
3428
			if (this.didSpecifySource) {
3419
			if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
3429
				Object source = this.options.get(CompilerOptions.OPTION_Source);
3430
				if (CompilerOptions.VERSION_1_2.equals(source)
3431
						|| CompilerOptions.VERSION_1_3.equals(source)
3432
						|| CompilerOptions.VERSION_1_4.equals(source)) {
3433
					if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_4);
3434
				} else if (CompilerOptions.VERSION_1_5.equals(source)) {
3435
					if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
3436
				}
3437
			} else {
3438
				this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
3439
				if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
3440
			}
3420
		} else if (CompilerOptions.VERSION_1_6.equals(version)) {
3441
		} else if (CompilerOptions.VERSION_1_6.equals(version)) {
3421
			if (!this.didSpecifySource) this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6);
3442
			if (this.didSpecifySource) {
3422
			if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6);
3443
				Object source = this.options.get(CompilerOptions.OPTION_Source);
3444
				if (CompilerOptions.VERSION_1_2.equals(source)
3445
						|| CompilerOptions.VERSION_1_3.equals(source)
3446
						|| CompilerOptions.VERSION_1_4.equals(source)) {
3447
					if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_4);
3448
				} else if (CompilerOptions.VERSION_1_5.equals(source)
3449
						|| CompilerOptions.VERSION_1_6.equals(source)) {
3450
					if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6);
3451
				}
3452
			} else {
3453
				this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6);
3454
				if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6);
3455
			}
3423
		} else if (CompilerOptions.VERSION_1_7.equals(version)) {
3456
		} else if (CompilerOptions.VERSION_1_7.equals(version)) {
3424
			if (!this.didSpecifySource) this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
3457
			if (this.didSpecifySource) {
3425
			if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
3458
				Object source = this.options.get(CompilerOptions.OPTION_Source);
3459
				if (CompilerOptions.VERSION_1_2.equals(source)
3460
						|| CompilerOptions.VERSION_1_3.equals(source)
3461
						|| CompilerOptions.VERSION_1_4.equals(source)) {
3462
					if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_4);
3463
				} else if (CompilerOptions.VERSION_1_5.equals(source)
3464
						|| CompilerOptions.VERSION_1_6.equals(source)) {
3465
					if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6);
3466
				} else if (CompilerOptions.VERSION_1_7.equals(source)) {
3467
					if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
3468
				}
3469
			} else {
3470
				this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
3471
				if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
3472
			}
3426
		}
3473
		}
3427
	}
3474
	} else if (this.didSpecifySource) {
3428
	if (this.didSpecifySource) {
3429
		Object version = this.options.get(CompilerOptions.OPTION_Source);
3475
		Object version = this.options.get(CompilerOptions.OPTION_Source);
3430
		// default is source 1.3 target 1.2 and compliance 1.4
3476
		// default is source 1.3 target 1.2 and compliance 1.4
3431
		if (CompilerOptions.VERSION_1_4.equals(version)) {
3477
		if (CompilerOptions.VERSION_1_4.equals(version)) {

Return to bug 141830