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

(-)dom/org/eclipse/jdt/core/dom/AST.java (-5 / +21 lines)
Lines 196-212 Link Here
196
     * @since 3.0
196
     * @since 3.0
197
	 */
197
	 */
198
	private AST(int level) {
198
	private AST(int level) {
199
		if ((level != AST.JLS2)
199
		long sourceLevel = ClassFileConstants.JDK1_3;
200
			&& (level != AST.JLS3)) {
200
		long complianceLevel = ClassFileConstants.JDK1_3;
201
			throw new IllegalArgumentException();
201
		switch (level) {
202
			case AST.JLS3:
203
				sourceLevel = ClassFileConstants.JDK1_5;
204
				complianceLevel = ClassFileConstants.JDK1_5;
205
			case AST.JLS2:
206
				this.apiLevel = level;
207
				break;
208
			default:
209
				throw new IllegalArgumentException();
202
		}
210
		}
203
		this.apiLevel = level;
204
		// initialize a scanner
211
		// initialize a scanner
205
		this.scanner = new Scanner(
212
		this.scanner = new Scanner(
206
				true /*comment*/, 
213
				true /*comment*/, 
207
				true /*whitespace*/, 
214
				true /*whitespace*/, 
208
				false /*nls*/, 
215
				false /*nls*/, 
209
				ClassFileConstants.JDK1_3 /*sourceLevel*/, 
216
				sourceLevel /*sourceLevel*/, 
217
				complianceLevel /*complianceLevel*/, 
210
				null/*taskTag*/, 
218
				null/*taskTag*/, 
211
				null/*taskPriorities*/,
219
				null/*taskPriorities*/,
212
				true/*taskCaseSensitive*/);
220
				true/*taskCaseSensitive*/);
Lines 296-307 Link Here
296
		} else if (JavaCore.VERSION_1_5.equals(sourceLevelOption)) {
304
		} else if (JavaCore.VERSION_1_5.equals(sourceLevelOption)) {
297
			sourceLevel = ClassFileConstants.JDK1_5;
305
			sourceLevel = ClassFileConstants.JDK1_5;
298
		}
306
		}
307
		Object complianceLevelOption = options.get(JavaCore.COMPILER_COMPLIANCE);
308
		long complianceLevel = ClassFileConstants.JDK1_3;
309
		if (JavaCore.VERSION_1_4.equals(complianceLevelOption)) {
310
			complianceLevel = ClassFileConstants.JDK1_4;
311
		} else if (JavaCore.VERSION_1_5.equals(complianceLevelOption)) {
312
			complianceLevel = ClassFileConstants.JDK1_5;
313
		}
299
		// override scanner if 1.4 or 1.5 asked for
314
		// override scanner if 1.4 or 1.5 asked for
300
		this.scanner = new Scanner(
315
		this.scanner = new Scanner(
301
			true /*comment*/, 
316
			true /*comment*/, 
302
			true /*whitespace*/, 
317
			true /*whitespace*/, 
303
			false /*nls*/, 
318
			false /*nls*/, 
304
			sourceLevel /*sourceLevel*/,
319
			sourceLevel /*sourceLevel*/,
320
			complianceLevel /*complianceLevel*/,
305
			null/*taskTag*/, 
321
			null/*taskTag*/, 
306
			null/*taskPriorities*/,
322
			null/*taskPriorities*/,
307
			true/*taskCaseSensitive*/);
323
			true/*taskCaseSensitive*/);

Return to bug 88841