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

(-)dom/org/eclipse/jdt/core/dom/AST.java (-28 / +31 lines)
Lines 95-105 Link Here
95
     * up to and including J2SE 1.4.
95
     * up to and including J2SE 1.4.
96
     *
96
     *
97
	 * @since 3.0
97
	 * @since 3.0
98
	 * @deprecated Clients should use the {@link #JLS3} AST API instead.
98
	 */
99
	 */
99
	// TODO (jeem) When JLS3 support is complete (post 3.0) - deprecated Clients should use the JLS3 API.
100
	public static final int JLS2 = 2;
100
	public static final int JLS2 = 2;
101
	
101
	
102
	/**
102
	/**
103
	 * Internal synonym for {@link #JLS2}. Use to alleviate
104
	 * deprecation warnings.
105
	 * @since 3.1
106
	 */
107
	/*package*/ static final int JLS2_INTERNAL = JLS2;
108
109
	/**
103
	 * Constant for indicating the AST API that handles JLS3.
110
	 * Constant for indicating the AST API that handles JLS3.
104
	 * This API is capable of handling all constructs in the
111
	 * This API is capable of handling all constructs in the
105
	 * Java language as described in the Java Language
112
	 * Java language as described in the Java Language
Lines 107-121 Link Here
107
     * JLS3 is a superset of all earlier versions of the
114
     * JLS3 is a superset of all earlier versions of the
108
     * Java language, and the JLS3 API can be used to manipulate
115
     * Java language, and the JLS3 API can be used to manipulate
109
     * programs written in all versions of the Java language
116
     * programs written in all versions of the Java language
110
     * up to and including J2SE 1.5.
117
     * up to and including J2SE 5 (aka JDK 1.5). 
111
     * <p>
112
     * <b>NOTE:</b>In Eclipse 3.0, there is no underlying parser support for
113
     * JLS3 ASTs. This support is planned for the follow-on release of
114
     * Eclipse which includes support for J2SE 1.5. Without a parser to create
115
     * JLS3 ASTs, they are not much use. Use JLS2 ASTs instead.
116
     * </p>
117
     *
118
     *
118
	 * @since 3.0
119
	 * @since 3.1
119
	 */
120
	 */
120
	public static final int JLS3 = 3;
121
	public static final int JLS3 = 3;
121
	
122
	
Lines 215-222 Link Here
215
	 * Creates a new, empty abstract syntax tree using default options.
216
	 * Creates a new, empty abstract syntax tree using default options.
216
	 * 
217
	 * 
217
	 * @see JavaCore#getDefaultOptions()
218
	 * @see JavaCore#getDefaultOptions()
219
	 * @deprecated Clients should port their code to use the new JLS3 AST API and call
220
	 *    {@link #newAST(int) AST.newAST(AST.JLS3)} instead of using this constructor.
218
	 */
221
	 */
219
	// TODO (jeem) When JLS3 support is complete (post 3.0) - deprecated Clients should port their code to use the new JLS3 API and call {@link #newAST(int)} instead of using this constructor.
220
	public AST() {
222
	public AST() {
221
		this(JavaCore.getDefaultOptions());
223
		this(JavaCore.getDefaultOptions());
222
	}
224
	}
Lines 282-289 Link Here
282
	 * @param options the table of options (key type: <code>String</code>;
284
	 * @param options the table of options (key type: <code>String</code>;
283
	 *    value type: <code>String</code>)
285
	 *    value type: <code>String</code>)
284
	 * @see JavaCore#getDefaultOptions()
286
	 * @see JavaCore#getDefaultOptions()
287
	 * @deprecated Clients should port their code to use the new JLS3 AST API and call
288
	 *    {@link #newAST(int) AST.newAST(AST.JLS3)} instead of using this constructor.
285
	 */
289
	 */
286
	// TODO (jeem) When JLS3 support is complete (post 3.0) - deprecated Clients should port their code to use the new JLS3 API and call {@link #newAST(int)} instead of using this constructor.
287
	public AST(Map options) {
290
	public AST(Map options) {
288
		this(JLS2);
291
		this(JLS2);
289
		Object sourceLevelOption = options.get(JavaCore.COMPILER_SOURCE);
292
		Object sourceLevelOption = options.get(JavaCore.COMPILER_SOURCE);
Lines 308-315 Link Here
308
	 * Creates a new Java abstract syntax tree
311
	 * Creates a new Java abstract syntax tree
309
     * (AST) following the specified set of API rules. 
312
     * (AST) following the specified set of API rules. 
310
     * <p>
313
     * <p>
311
     * Clients should use this method. It is provided only so that
314
     * Clients should use this method specifing {@link #JLS3} as the
312
     * test suites can create AST instances that employ the JLS2 APIs.
315
     * AST level in all cases, even when dealing with JDK 1.3 or 1.4..
313
     * </p>
316
     * </p>
314
     * 
317
     * 
315
 	 * @param level the API level; one of the LEVEL constants
318
 	 * @param level the API level; one of the LEVEL constants
Lines 1447-1453 Link Here
1447
	 * </ul>
1450
	 * </ul>
1448
	 * @exception UnsupportedOperationException if this operation is used in
1451
	 * @exception UnsupportedOperationException if this operation is used in
1449
	 * a JLS2 AST
1452
	 * a JLS2 AST
1450
	 * @since 3.0
1453
	 * @since 3.1
1451
	 */
1454
	 */
1452
	public ParameterizedType newParameterizedType(Type type) {
1455
	public ParameterizedType newParameterizedType(Type type) {
1453
		ParameterizedType result = new ParameterizedType(this);
1456
		ParameterizedType result = new ParameterizedType(this);
Lines 1469-1475 Link Here
1469
	 * </ul>
1472
	 * </ul>
1470
	 * @exception UnsupportedOperationException if this operation is used in
1473
	 * @exception UnsupportedOperationException if this operation is used in
1471
	 * a JLS2 AST
1474
	 * a JLS2 AST
1472
	 * @since 3.0
1475
	 * @since 3.1
1473
	 */
1476
	 */
1474
	public QualifiedType newQualifiedType(Type qualifier, SimpleName name) {
1477
	public QualifiedType newQualifiedType(Type qualifier, SimpleName name) {
1475
		QualifiedType result = new QualifiedType(this);
1478
		QualifiedType result = new QualifiedType(this);
Lines 1485-1491 Link Here
1485
	 * @return a new unparented wildcard type node
1488
	 * @return a new unparented wildcard type node
1486
	 * @exception UnsupportedOperationException if this operation is used in
1489
	 * @exception UnsupportedOperationException if this operation is used in
1487
	 * a JLS2 AST
1490
	 * a JLS2 AST
1488
	 * @since 3.0
1491
	 * @since 3.1
1489
	 */
1492
	 */
1490
	public WildcardType newWildcardType() {
1493
	public WildcardType newWildcardType() {
1491
		WildcardType result = new WildcardType(this);
1494
		WildcardType result = new WildcardType(this);
Lines 1621-1627 Link Here
1621
	 * @return a new unparented enum constant declaration node
1624
	 * @return a new unparented enum constant declaration node
1622
	 * @exception UnsupportedOperationException if this operation is used in
1625
	 * @exception UnsupportedOperationException if this operation is used in
1623
	 * a JLS2 AST
1626
	 * a JLS2 AST
1624
	 * @since 3.0
1627
	 * @since 3.1
1625
	 */
1628
	 */
1626
	public EnumConstantDeclaration newEnumConstantDeclaration() {
1629
	public EnumConstantDeclaration newEnumConstantDeclaration() {
1627
		EnumConstantDeclaration result = new EnumConstantDeclaration(this);
1630
		EnumConstantDeclaration result = new EnumConstantDeclaration(this);
Lines 1638-1644 Link Here
1638
	 * @return a new unparented enum declaration node
1641
	 * @return a new unparented enum declaration node
1639
	 * @exception UnsupportedOperationException if this operation is used in
1642
	 * @exception UnsupportedOperationException if this operation is used in
1640
	 * a JLS2 AST
1643
	 * a JLS2 AST
1641
	 * @since 3.0
1644
	 * @since 3.1
1642
	 */
1645
	 */
1643
	public EnumDeclaration newEnumDeclaration() {
1646
	public EnumDeclaration newEnumDeclaration() {
1644
		EnumDeclaration result = new EnumDeclaration(this);
1647
		EnumDeclaration result = new EnumDeclaration(this);
Lines 1652-1658 Link Here
1652
	 * @return a new unparented type parameter node
1655
	 * @return a new unparented type parameter node
1653
	 * @exception UnsupportedOperationException if this operation is used in
1656
	 * @exception UnsupportedOperationException if this operation is used in
1654
	 * a JLS2 AST
1657
	 * a JLS2 AST
1655
	 * @since 3.0
1658
	 * @since 3.1
1656
	 */
1659
	 */
1657
	public TypeParameter newTypeParameter() {
1660
	public TypeParameter newTypeParameter() {
1658
		TypeParameter result = new TypeParameter(this);
1661
		TypeParameter result = new TypeParameter(this);
Lines 1667-1673 Link Here
1667
	 * @return a new unparented annotation type declaration node
1670
	 * @return a new unparented annotation type declaration node
1668
	 * @exception UnsupportedOperationException if this operation is used in
1671
	 * @exception UnsupportedOperationException if this operation is used in
1669
	 * a JLS2 AST
1672
	 * a JLS2 AST
1670
	 * @since 3.0
1673
	 * @since 3.1
1671
	 */
1674
	 */
1672
	public AnnotationTypeDeclaration newAnnotationTypeDeclaration() {
1675
	public AnnotationTypeDeclaration newAnnotationTypeDeclaration() {
1673
		AnnotationTypeDeclaration result = new AnnotationTypeDeclaration(this);
1676
		AnnotationTypeDeclaration result = new AnnotationTypeDeclaration(this);
Lines 1683-1689 Link Here
1683
	 * @return a new unparented annotation type member declaration node
1686
	 * @return a new unparented annotation type member declaration node
1684
	 * @exception UnsupportedOperationException if this operation is used in
1687
	 * @exception UnsupportedOperationException if this operation is used in
1685
	 * a JLS2 AST
1688
	 * a JLS2 AST
1686
	 * @since 3.0
1689
	 * @since 3.1
1687
	 */
1690
	 */
1688
	public AnnotationTypeMemberDeclaration newAnnotationTypeMemberDeclaration() {
1691
	public AnnotationTypeMemberDeclaration newAnnotationTypeMemberDeclaration() {
1689
		AnnotationTypeMemberDeclaration result = new AnnotationTypeMemberDeclaration(this);
1692
		AnnotationTypeMemberDeclaration result = new AnnotationTypeMemberDeclaration(this);
Lines 1699-1705 Link Here
1699
	 * @exception IllegalArgumentException if the primitive type code is invalid
1702
	 * @exception IllegalArgumentException if the primitive type code is invalid
1700
	 * @exception UnsupportedOperationException if this operation is used in
1703
	 * @exception UnsupportedOperationException if this operation is used in
1701
	 * a JLS2 AST
1704
	 * a JLS2 AST
1702
	 * @since 3.0
1705
	 * @since 3.1
1703
	 */
1706
	 */
1704
	public Modifier newModifier(Modifier.ModifierKeyword keyword) {
1707
	public Modifier newModifier(Modifier.ModifierKeyword keyword) {
1705
		Modifier result = new Modifier(this);
1708
		Modifier result = new Modifier(this);
Lines 1980-1986 Link Here
1980
			newTypeDeclarationStatement(AbstractTypeDeclaration decl) {
1983
			newTypeDeclarationStatement(AbstractTypeDeclaration decl) {
1981
		TypeDeclarationStatement result = new TypeDeclarationStatement(this);
1984
		TypeDeclarationStatement result = new TypeDeclarationStatement(this);
1982
		if (this.apiLevel == AST.JLS2) {
1985
		if (this.apiLevel == AST.JLS2) {
1983
			result.setTypeDeclaration((TypeDeclaration) decl);
1986
			result.internalSetTypeDeclaration((TypeDeclaration) decl);
1984
		}
1987
		}
1985
		if (this.apiLevel >= AST.JLS3) {
1988
		if (this.apiLevel >= AST.JLS3) {
1986
			result.setDeclaration(decl);
1989
			result.setDeclaration(decl);
Lines 2200-2206 Link Here
2200
	 * @return a new unparented throw statement node
2203
	 * @return a new unparented throw statement node
2201
	 * @exception UnsupportedOperationException if this operation is used in
2204
	 * @exception UnsupportedOperationException if this operation is used in
2202
	 * a JLS2 AST
2205
	 * a JLS2 AST
2203
	 * @since 3.0
2206
	 * @since 3.1
2204
	 */
2207
	 */
2205
	public EnhancedForStatement newEnhancedForStatement() {
2208
	public EnhancedForStatement newEnhancedForStatement() {
2206
		return new EnhancedForStatement(this);
2209
		return new EnhancedForStatement(this);
Lines 2660-2666 Link Here
2660
	 * @return a new unparented normal annotation node
2663
	 * @return a new unparented normal annotation node
2661
	 * @exception UnsupportedOperationException if this operation is used in
2664
	 * @exception UnsupportedOperationException if this operation is used in
2662
	 * a JLS2 AST
2665
	 * a JLS2 AST
2663
	 * @since 3.0
2666
	 * @since 3.1
2664
	 */
2667
	 */
2665
	public NormalAnnotation newNormalAnnotation() {
2668
	public NormalAnnotation newNormalAnnotation() {
2666
		NormalAnnotation result = new NormalAnnotation(this);
2669
		NormalAnnotation result = new NormalAnnotation(this);
Lines 2674-2680 Link Here
2674
	 * @return a new unparented marker annotation node
2677
	 * @return a new unparented marker annotation node
2675
	 * @exception UnsupportedOperationException if this operation is used in
2678
	 * @exception UnsupportedOperationException if this operation is used in
2676
	 * a JLS2 AST
2679
	 * a JLS2 AST
2677
	 * @since 3.0
2680
	 * @since 3.1
2678
	 */
2681
	 */
2679
	public MarkerAnnotation newMarkerAnnotation() {
2682
	public MarkerAnnotation newMarkerAnnotation() {
2680
		MarkerAnnotation result = new MarkerAnnotation(this);
2683
		MarkerAnnotation result = new MarkerAnnotation(this);
Lines 2688-2694 Link Here
2688
	 * @return a new unparented single member annotation node
2691
	 * @return a new unparented single member annotation node
2689
	 * @exception UnsupportedOperationException if this operation is used in
2692
	 * @exception UnsupportedOperationException if this operation is used in
2690
	 * a JLS2 AST
2693
	 * a JLS2 AST
2691
	 * @since 3.0
2694
	 * @since 3.1
2692
	 */
2695
	 */
2693
	public SingleMemberAnnotation newSingleMemberAnnotation() {
2696
	public SingleMemberAnnotation newSingleMemberAnnotation() {
2694
		SingleMemberAnnotation result = new SingleMemberAnnotation(this);
2697
		SingleMemberAnnotation result = new SingleMemberAnnotation(this);
Lines 2702-2708 Link Here
2702
	 * @return a new unparented member value pair node
2705
	 * @return a new unparented member value pair node
2703
	 * @exception UnsupportedOperationException if this operation is used in
2706
	 * @exception UnsupportedOperationException if this operation is used in
2704
	 * a JLS2 AST
2707
	 * a JLS2 AST
2705
	 * @since 3.0
2708
	 * @since 3.1
2706
	 */
2709
	 */
2707
	public MemberValuePair newMemberValuePair() {
2710
	public MemberValuePair newMemberValuePair() {
2708
		MemberValuePair result = new MemberValuePair(this);
2711
		MemberValuePair result = new MemberValuePair(this);
(-)dom/org/eclipse/jdt/core/dom/ASTConverter.java (-58 / +58 lines)
Lines 447-457 Link Here
447
			org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration constructorDeclaration = (org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration) methodDeclaration;
447
			org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration constructorDeclaration = (org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration) methodDeclaration;
448
			explicitConstructorCall = constructorDeclaration.constructorCall;
448
			explicitConstructorCall = constructorDeclaration.constructorCall;
449
			switch(this.ast.apiLevel) {
449
			switch(this.ast.apiLevel) {
450
				case AST.JLS2 :
450
				case AST.JLS2_INTERNAL :
451
					// set the return type to VOID
451
					// set the return type to VOID
452
					PrimitiveType returnType = this.ast.newPrimitiveType(PrimitiveType.VOID);
452
					PrimitiveType returnType = this.ast.newPrimitiveType(PrimitiveType.VOID);
453
					returnType.setSourceRange(methodDeclaration.sourceStart, 0);
453
					returnType.setSourceRange(methodDeclaration.sourceStart, 0);
454
					methodDecl.setReturnType(returnType);
454
					methodDecl.internalSetReturnType(returnType);
455
					break;
455
					break;
456
				case AST.JLS3 :
456
				case AST.JLS3 :
457
					methodDecl.setReturnType2(null);
457
					methodDecl.setReturnType2(null);
Lines 537-543 Link Here
537
		org.eclipse.jdt.internal.compiler.ast.TypeParameter[] typeParameters = methodDeclaration.typeParameters();
537
		org.eclipse.jdt.internal.compiler.ast.TypeParameter[] typeParameters = methodDeclaration.typeParameters();
538
		if (typeParameters != null) {
538
		if (typeParameters != null) {
539
			switch(this.ast.apiLevel) {
539
			switch(this.ast.apiLevel) {
540
				case AST.JLS2 :
540
				case AST.JLS2_INTERNAL :
541
					methodDecl.setFlags(methodDecl.getFlags() | ASTNode.MALFORMED);
541
					methodDecl.setFlags(methodDecl.getFlags() | ASTNode.MALFORMED);
542
					break;
542
					break;
543
				case AST.JLS3 :
543
				case AST.JLS3 :
Lines 564-570 Link Here
564
		}
564
		}
565
		if (expression.typeArguments != null) {
565
		if (expression.typeArguments != null) {
566
			switch(this.ast.apiLevel) {
566
			switch(this.ast.apiLevel) {
567
				case AST.JLS2 :
567
				case AST.JLS2_INTERNAL :
568
					classInstanceCreation.setFlags(classInstanceCreation.getFlags() | ASTNode.MALFORMED);
568
					classInstanceCreation.setFlags(classInstanceCreation.getFlags() | ASTNode.MALFORMED);
569
					break;
569
					break;
570
				case AST.JLS3 :
570
				case AST.JLS3 :
Lines 574-581 Link Here
574
			}
574
			}
575
		}
575
		}
576
		switch(this.ast.apiLevel) {
576
		switch(this.ast.apiLevel) {
577
			case AST.JLS2 :
577
			case AST.JLS2_INTERNAL :
578
				classInstanceCreation.setName(convert(expression.type));
578
				classInstanceCreation.internalSetName(convert(expression.type));
579
				break;
579
				break;
580
			case AST.JLS3 :
580
			case AST.JLS3 :
581
				classInstanceCreation.setType(convertType(expression.type));
581
				classInstanceCreation.setType(convertType(expression.type));
Lines 628-634 Link Here
628
	
628
	
629
	public ASTNode convert(org.eclipse.jdt.internal.compiler.ast.AnnotationMethodDeclaration annotationTypeMemberDeclaration) {
629
	public ASTNode convert(org.eclipse.jdt.internal.compiler.ast.AnnotationMethodDeclaration annotationTypeMemberDeclaration) {
630
		checkCanceled();
630
		checkCanceled();
631
		if (this.ast.apiLevel == AST.JLS2) {
631
		if (this.ast.apiLevel == AST.JLS2_INTERNAL) {
632
			return null;
632
			return null;
633
		}
633
		}
634
		AnnotationTypeMemberDeclaration annotationTypeMemberDeclaration2 = this.ast.newAnnotationTypeMemberDeclaration();
634
		AnnotationTypeMemberDeclaration annotationTypeMemberDeclaration2 = this.ast.newAnnotationTypeMemberDeclaration();
Lines 695-701 Link Here
695
		
695
		
696
		if (isVarArgs) {
696
		if (isVarArgs) {
697
			switch(this.ast.apiLevel) {
697
			switch(this.ast.apiLevel) {
698
				case AST.JLS2 :
698
				case AST.JLS2_INTERNAL :
699
					variableDecl.setFlags(variableDecl.getFlags() | ASTNode.MALFORMED);
699
					variableDecl.setFlags(variableDecl.getFlags() | ASTNode.MALFORMED);
700
					break;
700
					break;
701
				case AST.JLS3 :
701
				case AST.JLS3 :
Lines 1366-1372 Link Here
1366
					sourceStart = statement.typeArgumentsSourceStart;
1366
					sourceStart = statement.typeArgumentsSourceStart;
1367
				}
1367
				}
1368
				switch(this.ast.apiLevel) {
1368
				switch(this.ast.apiLevel) {
1369
					case AST.JLS2 :
1369
					case AST.JLS2_INTERNAL :
1370
						superConstructorInvocation.setFlags(superConstructorInvocation.getFlags() | ASTNode.MALFORMED);
1370
						superConstructorInvocation.setFlags(superConstructorInvocation.getFlags() | ASTNode.MALFORMED);
1371
						break;
1371
						break;
1372
					case AST.JLS3 :
1372
					case AST.JLS3 :
Lines 1391-1397 Link Here
1391
					sourceStart = statement.typeArgumentsSourceStart;
1391
					sourceStart = statement.typeArgumentsSourceStart;
1392
				}
1392
				}
1393
				switch(this.ast.apiLevel) {
1393
				switch(this.ast.apiLevel) {
1394
					case AST.JLS2 :
1394
					case AST.JLS2_INTERNAL :
1395
						constructorInvocation.setFlags(constructorInvocation.getFlags() | ASTNode.MALFORMED);
1395
						constructorInvocation.setFlags(constructorInvocation.getFlags() | ASTNode.MALFORMED);
1396
						break;
1396
						break;
1397
					case AST.JLS3 :
1397
					case AST.JLS3 :
Lines 1604-1610 Link Here
1604
	
1604
	
1605
	public Statement convert(ForeachStatement statement) {
1605
	public Statement convert(ForeachStatement statement) {
1606
		switch(this.ast.apiLevel) {
1606
		switch(this.ast.apiLevel) {
1607
			case AST.JLS2 :
1607
			case AST.JLS2_INTERNAL :
1608
				return createFakeEmptyStatement(statement);
1608
				return createFakeEmptyStatement(statement);
1609
			case AST.JLS3 :
1609
			case AST.JLS3 :
1610
				EnhancedForStatement enhancedForStatement = this.ast.newEnhancedForStatement();
1610
				EnhancedForStatement enhancedForStatement = this.ast.newEnhancedForStatement();
Lines 1822-1828 Link Here
1822
			final TypeReference[] typeArguments = expression.typeArguments;
1822
			final TypeReference[] typeArguments = expression.typeArguments;
1823
			if (typeArguments != null) {
1823
			if (typeArguments != null) {
1824
				switch(this.ast.apiLevel) {
1824
				switch(this.ast.apiLevel) {
1825
					case AST.JLS2 :
1825
					case AST.JLS2_INTERNAL :
1826
						superMethodInvocation.setFlags(superMethodInvocation.getFlags() | ASTNode.MALFORMED);
1826
						superMethodInvocation.setFlags(superMethodInvocation.getFlags() | ASTNode.MALFORMED);
1827
						break;
1827
						break;
1828
					case AST.JLS3 :
1828
					case AST.JLS3 :
Lines 1879-1885 Link Here
1879
			final TypeReference[] typeArguments = expression.typeArguments;
1879
			final TypeReference[] typeArguments = expression.typeArguments;
1880
			if (typeArguments != null) {
1880
			if (typeArguments != null) {
1881
				switch(this.ast.apiLevel) {
1881
				switch(this.ast.apiLevel) {
1882
					case AST.JLS2 :
1882
					case AST.JLS2_INTERNAL :
1883
						methodInvocation.setFlags(methodInvocation.getFlags() | ASTNode.MALFORMED);
1883
						methodInvocation.setFlags(methodInvocation.getFlags() | ASTNode.MALFORMED);
1884
						break;
1884
						break;
1885
					case AST.JLS3 :
1885
					case AST.JLS3 :
Lines 2033-2040 Link Here
2033
			classInstanceCreation.setExpression(convert(allocation.enclosingInstance));
2033
			classInstanceCreation.setExpression(convert(allocation.enclosingInstance));
2034
		}
2034
		}
2035
		switch(this.ast.apiLevel) {
2035
		switch(this.ast.apiLevel) {
2036
			case AST.JLS2 :
2036
			case AST.JLS2_INTERNAL :
2037
				classInstanceCreation.setName(convert(allocation.type));
2037
				classInstanceCreation.internalSetName(convert(allocation.type));
2038
				break;
2038
				break;
2039
			case AST.JLS3 :
2039
			case AST.JLS3 :
2040
				classInstanceCreation.setType(convertType(allocation.type));
2040
				classInstanceCreation.setType(convertType(allocation.type));
Lines 2052-2058 Link Here
2052
		}
2052
		}
2053
		if (allocation.typeArguments != null) {
2053
		if (allocation.typeArguments != null) {
2054
			switch(this.ast.apiLevel) {
2054
			switch(this.ast.apiLevel) {
2055
				case AST.JLS2 :
2055
				case AST.JLS2_INTERNAL :
2056
					classInstanceCreation.setFlags(classInstanceCreation.getFlags() | ASTNode.MALFORMED);
2056
					classInstanceCreation.setFlags(classInstanceCreation.getFlags() | ASTNode.MALFORMED);
2057
					break;
2057
					break;
2058
				case AST.JLS3 :
2058
				case AST.JLS3 :
Lines 2216-2237 Link Here
2216
			switch(result.getNodeType()) {
2216
			switch(result.getNodeType()) {
2217
				case ASTNode.ENUM_DECLARATION:
2217
				case ASTNode.ENUM_DECLARATION:
2218
					switch(this.ast.apiLevel) {
2218
					switch(this.ast.apiLevel) {
2219
						case AST.JLS2 :
2219
						case AST.JLS2_INTERNAL :
2220
							return createFakeEmptyStatement(statement);
2220
							return createFakeEmptyStatement(statement);
2221
						case AST.JLS3 :
2221
						case AST.JLS3 :
2222
							TypeDeclarationStatement typeDeclarationStatement = this.ast.newTypeDeclarationStatement((EnumDeclaration) result);
2222
							TypeDeclarationStatement typeDeclarationStatement = this.ast.newTypeDeclarationStatement((EnumDeclaration) result);
2223
							TypeDeclaration typeDecl = typeDeclarationStatement.getTypeDeclaration();
2223
							AbstractTypeDeclaration typeDecl = typeDeclarationStatement.getDeclaration();
2224
							typeDeclarationStatement.setSourceRange(typeDecl.getStartPosition(), typeDecl.getLength());
2224
							typeDeclarationStatement.setSourceRange(typeDecl.getStartPosition(), typeDecl.getLength());
2225
							return typeDeclarationStatement;
2225
							return typeDeclarationStatement;
2226
					}
2226
					}
2227
					break;
2227
					break;
2228
				case ASTNode.ANNOTATION_TYPE_DECLARATION :
2228
				case ASTNode.ANNOTATION_TYPE_DECLARATION :
2229
					switch(this.ast.apiLevel) {
2229
					switch(this.ast.apiLevel) {
2230
						case AST.JLS2 :
2230
						case AST.JLS2_INTERNAL :
2231
							return createFakeEmptyStatement(statement);
2231
							return createFakeEmptyStatement(statement);
2232
						case AST.JLS3 :
2232
						case AST.JLS3 :
2233
							TypeDeclarationStatement typeDeclarationStatement = this.ast.newTypeDeclarationStatement((AnnotationTypeDeclaration) result);
2233
							TypeDeclarationStatement typeDeclarationStatement = this.ast.newTypeDeclarationStatement((AnnotationTypeDeclaration) result);
2234
							TypeDeclaration typeDecl = typeDeclarationStatement.getTypeDeclaration();
2234
							AbstractTypeDeclaration typeDecl = typeDeclarationStatement.getDeclaration();
2235
							typeDeclarationStatement.setSourceRange(typeDecl.getStartPosition(), typeDecl.getLength());
2235
							typeDeclarationStatement.setSourceRange(typeDecl.getStartPosition(), typeDecl.getLength());
2236
							return typeDeclarationStatement;
2236
							return typeDeclarationStatement;
2237
					}
2237
					}
Lines 2243-2250 Link Here
2243
					} else {
2243
					} else {
2244
						TypeDeclarationStatement typeDeclarationStatement = this.ast.newTypeDeclarationStatement(typeDeclaration);
2244
						TypeDeclarationStatement typeDeclarationStatement = this.ast.newTypeDeclarationStatement(typeDeclaration);
2245
						switch(this.ast.apiLevel) {
2245
						switch(this.ast.apiLevel) {
2246
							case AST.JLS2 :
2246
							case AST.JLS2_INTERNAL :
2247
								TypeDeclaration typeDecl = typeDeclarationStatement.getTypeDeclaration();
2247
								TypeDeclaration typeDecl = typeDeclarationStatement.internalGetTypeDeclaration();
2248
								typeDeclarationStatement.setSourceRange(typeDecl.getStartPosition(), typeDecl.getLength());					
2248
								typeDeclarationStatement.setSourceRange(typeDecl.getStartPosition(), typeDecl.getLength());					
2249
								break;
2249
								break;
2250
							case AST.JLS3 :
2250
							case AST.JLS3 :
Lines 2373-2385 Link Here
2373
	public ASTNode convert(org.eclipse.jdt.internal.compiler.ast.TypeDeclaration typeDeclaration) {
2373
	public ASTNode convert(org.eclipse.jdt.internal.compiler.ast.TypeDeclaration typeDeclaration) {
2374
		switch (typeDeclaration.kind()) {
2374
		switch (typeDeclaration.kind()) {
2375
			case IGenericType.ENUM_DECL :
2375
			case IGenericType.ENUM_DECL :
2376
				if (this.ast.apiLevel == AST.JLS2) {
2376
				if (this.ast.apiLevel == AST.JLS2_INTERNAL) {
2377
					return null;
2377
					return null;
2378
				} else {
2378
				} else {
2379
					return convertToEnumDeclaration(typeDeclaration);
2379
					return convertToEnumDeclaration(typeDeclaration);
2380
				}
2380
				}
2381
			case IGenericType.ANNOTATION_TYPE_DECL :
2381
			case IGenericType.ANNOTATION_TYPE_DECL :
2382
				if (this.ast.apiLevel == AST.JLS2) {
2382
				if (this.ast.apiLevel == AST.JLS2_INTERNAL) {
2383
					return null;
2383
					return null;
2384
				} else {
2384
				} else {
2385
					return convertToAnnotationDeclaration(typeDeclaration);
2385
					return convertToAnnotationDeclaration(typeDeclaration);
Lines 2401-2408 Link Here
2401
		// the type references level.
2401
		// the type references level.
2402
		if (typeDeclaration.superclass != null) {
2402
		if (typeDeclaration.superclass != null) {
2403
			switch(this.ast.apiLevel) {
2403
			switch(this.ast.apiLevel) {
2404
				case AST.JLS2 :
2404
				case AST.JLS2_INTERNAL :
2405
					typeDecl.setSuperclass(convert(typeDeclaration.superclass));
2405
					typeDecl.internalSetSuperclass(convert(typeDeclaration.superclass));
2406
					break;
2406
					break;
2407
				case AST.JLS3 :
2407
				case AST.JLS3 :
2408
					typeDecl.setSuperclassType(convertType(typeDeclaration.superclass));
2408
					typeDecl.setSuperclassType(convertType(typeDeclaration.superclass));
Lines 2413-2421 Link Here
2413
		org.eclipse.jdt.internal.compiler.ast.TypeReference[] superInterfaces = typeDeclaration.superInterfaces;
2413
		org.eclipse.jdt.internal.compiler.ast.TypeReference[] superInterfaces = typeDeclaration.superInterfaces;
2414
		if (superInterfaces != null) {
2414
		if (superInterfaces != null) {
2415
			switch(this.ast.apiLevel) {
2415
			switch(this.ast.apiLevel) {
2416
				case AST.JLS2 :
2416
				case AST.JLS2_INTERNAL :
2417
					for (int index = 0, length = superInterfaces.length; index < length; index++) {
2417
					for (int index = 0, length = superInterfaces.length; index < length; index++) {
2418
						typeDecl.superInterfaces().add(convert(superInterfaces[index]));
2418
						typeDecl.internalSuperInterfaces().add(convert(superInterfaces[index]));
2419
					}
2419
					}
2420
					break;
2420
					break;
2421
				case AST.JLS3 :
2421
				case AST.JLS3 :
Lines 2427-2433 Link Here
2427
		org.eclipse.jdt.internal.compiler.ast.TypeParameter[] typeParameters = typeDeclaration.typeParameters;
2427
		org.eclipse.jdt.internal.compiler.ast.TypeParameter[] typeParameters = typeDeclaration.typeParameters;
2428
		if (typeParameters != null) {
2428
		if (typeParameters != null) {
2429
			switch(this.ast.apiLevel) {
2429
			switch(this.ast.apiLevel) {
2430
				case AST.JLS2 :
2430
				case AST.JLS2_INTERNAL :
2431
					typeDecl.setFlags(typeDecl.getFlags() | ASTNode.MALFORMED);
2431
					typeDecl.setFlags(typeDecl.getFlags() | ASTNode.MALFORMED);
2432
					break;
2432
					break;
2433
				case AST.JLS3 :
2433
				case AST.JLS3 :
Lines 2551-2557 Link Here
2551
		int modifiers = importReference.modifiers;
2551
		int modifiers = importReference.modifiers;
2552
		if (modifiers != IConstants.AccDefault) {
2552
		if (modifiers != IConstants.AccDefault) {
2553
			switch(this.ast.apiLevel) {
2553
			switch(this.ast.apiLevel) {
2554
				case AST.JLS2 :
2554
				case AST.JLS2_INTERNAL :
2555
					importDeclaration.setFlags(importDeclaration.getFlags() | ASTNode.MALFORMED);
2555
					importDeclaration.setFlags(importDeclaration.getFlags() | ASTNode.MALFORMED);
2556
					break;
2556
					break;
2557
				case AST.JLS3 :
2557
				case AST.JLS3 :
Lines 2588-2594 Link Here
2588
		org.eclipse.jdt.internal.compiler.ast.Annotation[] annotations = importReference.annotations;
2588
		org.eclipse.jdt.internal.compiler.ast.Annotation[] annotations = importReference.annotations;
2589
		if (annotations != null) {
2589
		if (annotations != null) {
2590
			switch(this.ast.apiLevel) {
2590
			switch(this.ast.apiLevel) {
2591
				case AST.JLS2 :
2591
				case AST.JLS2_INTERNAL :
2592
					packageDeclaration.setFlags(packageDeclaration.getFlags() & ASTNode.MALFORMED);
2592
					packageDeclaration.setFlags(packageDeclaration.getFlags() & ASTNode.MALFORMED);
2593
					break;
2593
					break;
2594
				case AST.JLS3 :
2594
				case AST.JLS3 :
Lines 2828-2834 Link Here
2828
				}
2828
				}
2829
				simpleName.setSourceRange(sourceStart, end - sourceStart + 1);
2829
				simpleName.setSourceRange(sourceStart, end - sourceStart + 1);
2830
				switch(this.ast.apiLevel) {
2830
				switch(this.ast.apiLevel) {
2831
					case AST.JLS2 :
2831
					case AST.JLS2_INTERNAL :
2832
						type = this.ast.newSimpleType(simpleName);
2832
						type = this.ast.newSimpleType(simpleName);
2833
						type.setFlags(type.getFlags() | ASTNode.MALFORMED);
2833
						type.setFlags(type.getFlags() | ASTNode.MALFORMED);
2834
						type.setSourceRange(sourceStart, end - sourceStart + 1);
2834
						type.setSourceRange(sourceStart, end - sourceStart + 1);
Lines 2889-2895 Link Here
2889
				long[] positions = parameterizedQualifiedTypeReference.sourcePositions;
2889
				long[] positions = parameterizedQualifiedTypeReference.sourcePositions;
2890
				sourceStart = (int)(positions[0]>>>32);
2890
				sourceStart = (int)(positions[0]>>>32);
2891
				switch(this.ast.apiLevel) {
2891
				switch(this.ast.apiLevel) {
2892
					case AST.JLS2 : {
2892
					case AST.JLS2_INTERNAL : {
2893
							char[][] name = ((org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference) typeReference).getTypeName();
2893
							char[][] name = ((org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference) typeReference).getTypeName();
2894
							int nameLength = name.length;
2894
							int nameLength = name.length;
2895
							sourceStart = (int)(positions[0]>>>32);
2895
							sourceStart = (int)(positions[0]>>>32);
Lines 3417-3423 Link Here
3417
						if (expression instanceof JavadocArgumentExpression) {
3417
						if (expression instanceof JavadocArgumentExpression) {
3418
							JavadocArgumentExpression argExpr = (JavadocArgumentExpression) expression;
3418
							JavadocArgumentExpression argExpr = (JavadocArgumentExpression) expression;
3419
							org.eclipse.jdt.internal.compiler.ast.TypeReference typeRef = argExpr.argument.type;
3419
							org.eclipse.jdt.internal.compiler.ast.TypeReference typeRef = argExpr.argument.type;
3420
							if (this.ast.apiLevel != AST.JLS2) param.setVarargs(argExpr.argument.isVarArgs());
3420
							if (this.ast.apiLevel >= AST.JLS3) param.setVarargs(argExpr.argument.isVarArgs());
3421
							recordNodes(param.getType(), typeRef);
3421
							recordNodes(param.getType(), typeRef);
3422
							if (param.getType().isSimpleType()) {
3422
							if (param.getType().isSimpleType()) {
3423
								recordName(((SimpleType)param.getType()).getName(), typeRef);
3423
								recordName(((SimpleType)param.getType()).getName(), typeRef);
Lines 4144-4151 Link Here
4144
	 */
4144
	 */
4145
	protected void setModifiers(FieldDeclaration fieldDeclaration, org.eclipse.jdt.internal.compiler.ast.FieldDeclaration fieldDecl) {
4145
	protected void setModifiers(FieldDeclaration fieldDeclaration, org.eclipse.jdt.internal.compiler.ast.FieldDeclaration fieldDecl) {
4146
		switch(this.ast.apiLevel) {
4146
		switch(this.ast.apiLevel) {
4147
			case AST.JLS2 :
4147
			case AST.JLS2_INTERNAL :
4148
				fieldDeclaration.setModifiers(fieldDecl.modifiers & CompilerModifiers.AccJustFlag);
4148
				fieldDeclaration.internalSetModifiers(fieldDecl.modifiers & CompilerModifiers.AccJustFlag);
4149
				if (fieldDecl.annotations != null) {
4149
				if (fieldDecl.annotations != null) {
4150
					fieldDeclaration.setFlags(fieldDeclaration.getFlags() | ASTNode.MALFORMED);
4150
					fieldDeclaration.setFlags(fieldDeclaration.getFlags() | ASTNode.MALFORMED);
4151
				}
4151
				}
Lines 4162-4169 Link Here
4162
	 */
4162
	 */
4163
	protected void setModifiers(Initializer initializer, org.eclipse.jdt.internal.compiler.ast.Initializer oldInitializer) {
4163
	protected void setModifiers(Initializer initializer, org.eclipse.jdt.internal.compiler.ast.Initializer oldInitializer) {
4164
		switch(this.ast.apiLevel) {
4164
		switch(this.ast.apiLevel) {
4165
			case AST.JLS2: 
4165
			case AST.JLS2_INTERNAL: 
4166
				initializer.setModifiers(oldInitializer.modifiers & CompilerModifiers.AccJustFlag);
4166
				initializer.internalSetModifiers(oldInitializer.modifiers & CompilerModifiers.AccJustFlag);
4167
				if (oldInitializer.annotations != null) {
4167
				if (oldInitializer.annotations != null) {
4168
					initializer.setFlags(initializer.getFlags() | ASTNode.MALFORMED);
4168
					initializer.setFlags(initializer.getFlags() | ASTNode.MALFORMED);
4169
				}
4169
				}
Lines 4179-4186 Link Here
4179
	 */
4179
	 */
4180
	protected void setModifiers(MethodDeclaration methodDecl, AbstractMethodDeclaration methodDeclaration) {
4180
	protected void setModifiers(MethodDeclaration methodDecl, AbstractMethodDeclaration methodDeclaration) {
4181
		switch(this.ast.apiLevel) {
4181
		switch(this.ast.apiLevel) {
4182
			case AST.JLS2 :
4182
			case AST.JLS2_INTERNAL :
4183
				methodDecl.setModifiers(methodDeclaration.modifiers & CompilerModifiers.AccJustFlag);
4183
				methodDecl.internalSetModifiers(methodDeclaration.modifiers & CompilerModifiers.AccJustFlag);
4184
				if (methodDeclaration.annotations != null) {
4184
				if (methodDeclaration.annotations != null) {
4185
					methodDecl.setFlags(methodDecl.getFlags() | ASTNode.MALFORMED);
4185
					methodDecl.setFlags(methodDecl.getFlags() | ASTNode.MALFORMED);
4186
				}
4186
				}
Lines 4197-4204 Link Here
4197
	 */
4197
	 */
4198
	protected void setModifiers(SingleVariableDeclaration variableDecl, Argument argument) {
4198
	protected void setModifiers(SingleVariableDeclaration variableDecl, Argument argument) {
4199
		switch(this.ast.apiLevel) {
4199
		switch(this.ast.apiLevel) {
4200
			case AST.JLS2 :
4200
			case AST.JLS2_INTERNAL :
4201
				variableDecl.setModifiers(argument.modifiers & CompilerModifiers.AccJustFlag);
4201
				variableDecl.internalSetModifiers(argument.modifiers & CompilerModifiers.AccJustFlag);
4202
				if (argument.annotations != null) {
4202
				if (argument.annotations != null) {
4203
					variableDecl.setFlags(variableDecl.getFlags() | ASTNode.MALFORMED);
4203
					variableDecl.setFlags(variableDecl.getFlags() | ASTNode.MALFORMED);
4204
				}
4204
				}
Lines 4265-4272 Link Here
4265
	
4265
	
4266
	protected void setModifiers(SingleVariableDeclaration variableDecl, LocalDeclaration localDeclaration) {
4266
	protected void setModifiers(SingleVariableDeclaration variableDecl, LocalDeclaration localDeclaration) {
4267
		switch(this.ast.apiLevel) {
4267
		switch(this.ast.apiLevel) {
4268
		case AST.JLS2 :
4268
		case AST.JLS2_INTERNAL :
4269
			variableDecl.setModifiers(localDeclaration.modifiers & CompilerModifiers.AccJustFlag);
4269
			variableDecl.internalSetModifiers(localDeclaration.modifiers & CompilerModifiers.AccJustFlag);
4270
			if (localDeclaration.annotations != null) {
4270
			if (localDeclaration.annotations != null) {
4271
				variableDecl.setFlags(variableDecl.getFlags() | ASTNode.MALFORMED);
4271
				variableDecl.setFlags(variableDecl.getFlags() | ASTNode.MALFORMED);
4272
			}
4272
			}
Lines 4337-4347 Link Here
4337
	 */
4337
	 */
4338
	protected void setModifiers(TypeDeclaration typeDecl, org.eclipse.jdt.internal.compiler.ast.TypeDeclaration typeDeclaration) {
4338
	protected void setModifiers(TypeDeclaration typeDecl, org.eclipse.jdt.internal.compiler.ast.TypeDeclaration typeDeclaration) {
4339
		switch(this.ast.apiLevel) { 
4339
		switch(this.ast.apiLevel) { 
4340
			case AST.JLS2 :
4340
			case AST.JLS2_INTERNAL :
4341
				int modifiers = typeDeclaration.modifiers;
4341
				int modifiers = typeDeclaration.modifiers;
4342
				modifiers &= ~IConstants.AccInterface; // remove AccInterface flags
4342
				modifiers &= ~IConstants.AccInterface; // remove AccInterface flags
4343
				modifiers &= CompilerModifiers.AccJustFlag;
4343
				modifiers &= CompilerModifiers.AccJustFlag;
4344
				typeDecl.setModifiers(modifiers);
4344
				typeDecl.internalSetModifiers(modifiers);
4345
				if (typeDeclaration.annotations != null) {
4345
				if (typeDeclaration.annotations != null) {
4346
					typeDecl.setFlags(typeDecl.getFlags() | ASTNode.MALFORMED);
4346
					typeDecl.setFlags(typeDecl.getFlags() | ASTNode.MALFORMED);
4347
				}
4347
				}
Lines 4358-4367 Link Here
4358
	 */
4358
	 */
4359
	protected void setModifiers(VariableDeclarationExpression variableDeclarationExpression, LocalDeclaration localDeclaration) {
4359
	protected void setModifiers(VariableDeclarationExpression variableDeclarationExpression, LocalDeclaration localDeclaration) {
4360
		switch(this.ast.apiLevel) {
4360
		switch(this.ast.apiLevel) {
4361
			case AST.JLS2 :
4361
			case AST.JLS2_INTERNAL :
4362
				int modifiers = localDeclaration.modifiers & CompilerModifiers.AccJustFlag;
4362
				int modifiers = localDeclaration.modifiers & CompilerModifiers.AccJustFlag;
4363
				modifiers &= ~CompilerModifiers.AccBlankFinal;
4363
				modifiers &= ~CompilerModifiers.AccBlankFinal;
4364
				variableDeclarationExpression.setModifiers(modifiers);
4364
				variableDeclarationExpression.internalSetModifiers(modifiers);
4365
				if (localDeclaration.annotations != null) {
4365
				if (localDeclaration.annotations != null) {
4366
					variableDeclarationExpression.setFlags(variableDeclarationExpression.getFlags() | ASTNode.MALFORMED);
4366
					variableDeclarationExpression.setFlags(variableDeclarationExpression.getFlags() | ASTNode.MALFORMED);
4367
				}
4367
				}
Lines 4432-4441 Link Here
4432
	 */
4432
	 */
4433
	protected void setModifiers(VariableDeclarationStatement variableDeclarationStatement, LocalDeclaration localDeclaration) {
4433
	protected void setModifiers(VariableDeclarationStatement variableDeclarationStatement, LocalDeclaration localDeclaration) {
4434
		switch(this.ast.apiLevel) {
4434
		switch(this.ast.apiLevel) {
4435
			case AST.JLS2 :
4435
			case AST.JLS2_INTERNAL :
4436
				int modifiers = localDeclaration.modifiers & CompilerModifiers.AccJustFlag;
4436
				int modifiers = localDeclaration.modifiers & CompilerModifiers.AccJustFlag;
4437
				modifiers &= ~CompilerModifiers.AccBlankFinal;
4437
				modifiers &= ~CompilerModifiers.AccBlankFinal;
4438
				variableDeclarationStatement.setModifiers(modifiers);
4438
				variableDeclarationStatement.internalSetModifiers(modifiers);
4439
				if (localDeclaration.annotations != null) {
4439
				if (localDeclaration.annotations != null) {
4440
					variableDeclarationStatement.setFlags(variableDeclarationStatement.getFlags() | ASTNode.MALFORMED);
4440
					variableDeclarationStatement.setFlags(variableDeclarationStatement.getFlags() | ASTNode.MALFORMED);
4441
				}
4441
				}
Lines 4672-4679 Link Here
4672
					elementType.setParent(null, null);
4672
					elementType.setParent(null, null);
4673
					this.ast.getBindingResolver().updateKey(type, elementType);
4673
					this.ast.getBindingResolver().updateKey(type, elementType);
4674
					switch(this.ast.apiLevel) {
4674
					switch(this.ast.apiLevel) {
4675
						case AST.JLS2 :
4675
						case AST.JLS2_INTERNAL :
4676
							methodDeclaration.setReturnType(elementType);
4676
							methodDeclaration.internalSetReturnType(elementType);
4677
							break;
4677
							break;
4678
						case AST.JLS3 :
4678
						case AST.JLS3 :
4679
							methodDeclaration.setReturnType2(elementType);
4679
							methodDeclaration.setReturnType2(elementType);
Lines 4693-4700 Link Here
4693
					subarrayType.setParent(null, null);
4693
					subarrayType.setParent(null, null);
4694
					updateInnerPositions(subarrayType, remainingDimensions);
4694
					updateInnerPositions(subarrayType, remainingDimensions);
4695
					switch(this.ast.apiLevel) {
4695
					switch(this.ast.apiLevel) {
4696
						case AST.JLS2 :
4696
						case AST.JLS2_INTERNAL :
4697
							methodDeclaration.setReturnType(subarrayType);
4697
							methodDeclaration.internalSetReturnType(subarrayType);
4698
							break;
4698
							break;
4699
						case AST.JLS3 :
4699
						case AST.JLS3 :
4700
							methodDeclaration.setReturnType2(subarrayType);
4700
							methodDeclaration.setReturnType2(subarrayType);
Lines 4704-4711 Link Here
4704
				}
4704
				}
4705
			} else {
4705
			} else {
4706
				switch(this.ast.apiLevel) {
4706
				switch(this.ast.apiLevel) {
4707
					case AST.JLS2 :
4707
					case AST.JLS2_INTERNAL :
4708
						methodDeclaration.setReturnType(type);
4708
						methodDeclaration.internalSetReturnType(type);
4709
						break;
4709
						break;
4710
					case AST.JLS3 :
4710
					case AST.JLS3 :
4711
						methodDeclaration.setReturnType2(type);
4711
						methodDeclaration.setReturnType2(type);
Lines 4714-4721 Link Here
4714
			}
4714
			}
4715
		} else {
4715
		} else {
4716
			switch(this.ast.apiLevel) {
4716
			switch(this.ast.apiLevel) {
4717
				case AST.JLS2 :
4717
				case AST.JLS2_INTERNAL :
4718
					methodDeclaration.setReturnType(type);
4718
					methodDeclaration.internalSetReturnType(type);
4719
					break;
4719
					break;
4720
				case AST.JLS3 :
4720
				case AST.JLS3 :
4721
					methodDeclaration.setReturnType2(type);
4721
					methodDeclaration.setReturnType2(type);
(-)dom/org/eclipse/jdt/core/dom/ASTMatcher.java (-33 / +27 lines)
Lines 172-178 Link Here
172
	 * @return <code>true</code> if the subtree matches, or 
172
	 * @return <code>true</code> if the subtree matches, or 
173
	 *   <code>false</code> if they do not match or the other object has a
173
	 *   <code>false</code> if they do not match or the other object has a
174
	 *   different node type or is <code>null</code>
174
	 *   different node type or is <code>null</code>
175
	 * @since 3.0
175
	 * @since 3.1
176
	 */
176
	 */
177
	public boolean match(AnnotationTypeDeclaration node, Object other) {
177
	public boolean match(AnnotationTypeDeclaration node, Object other) {
178
		if (!(other instanceof AnnotationTypeDeclaration)) {
178
		if (!(other instanceof AnnotationTypeDeclaration)) {
Lines 199-205 Link Here
199
	 * @return <code>true</code> if the subtree matches, or 
199
	 * @return <code>true</code> if the subtree matches, or 
200
	 *   <code>false</code> if they do not match or the other object has a
200
	 *   <code>false</code> if they do not match or the other object has a
201
	 *   different node type or is <code>null</code>
201
	 *   different node type or is <code>null</code>
202
	 * @since 3.0
202
	 * @since 3.1
203
	 */
203
	 */
204
	public boolean match(AnnotationTypeMemberDeclaration node, Object other) {
204
	public boolean match(AnnotationTypeMemberDeclaration node, Object other) {
205
		if (!(other instanceof AnnotationTypeMemberDeclaration)) {
205
		if (!(other instanceof AnnotationTypeMemberDeclaration)) {
Lines 561-568 Link Here
561
		}
561
		}
562
		ClassInstanceCreation o = (ClassInstanceCreation) other;
562
		ClassInstanceCreation o = (ClassInstanceCreation) other;
563
		int level = node.getAST().apiLevel;
563
		int level = node.getAST().apiLevel;
564
		if (level == AST.JLS2) {
564
		if (level == AST.JLS2_INTERNAL) {
565
			if (!safeSubtreeMatch(node.getName(), o.getName())) {
565
			if (!safeSubtreeMatch(node.internalGetName(), o.internalGetName())) {
566
				return false;
566
				return false;
567
			}
567
			}
568
		}
568
		}
Lines 739-745 Link Here
739
	 * @return <code>true</code> if the subtree matches, or 
739
	 * @return <code>true</code> if the subtree matches, or 
740
	 *   <code>false</code> if they do not match or the other object has a
740
	 *   <code>false</code> if they do not match or the other object has a
741
	 *   different node type or is <code>null</code>
741
	 *   different node type or is <code>null</code>
742
	 * @since 3.0
742
	 * @since 3.1
743
	 */
743
	 */
744
	public boolean match(EnhancedForStatement node, Object other) {
744
	public boolean match(EnhancedForStatement node, Object other) {
745
		if (!(other instanceof EnhancedForStatement)) {
745
		if (!(other instanceof EnhancedForStatement)) {
Lines 759-777 Link Here
759
	 * other object is a node of the same type with structurally isomorphic
759
	 * other object is a node of the same type with structurally isomorphic
760
	 * child subtrees. Subclasses may override this method as needed.
760
	 * child subtrees. Subclasses may override this method as needed.
761
	 * </p>
761
	 * </p>
762
	 * <p>
763
	 * Note: This API element is only needed for dealing with Java code that uses
764
	 * new language features of J2SE 1.5. It is included in anticipation of J2SE
765
	 * 1.5 support, which is planned for the next release of Eclipse after 3.0, and
766
	 * may change slightly before reaching its final form.
767
	 * </p>
768
	 * 
762
	 * 
769
	 * @param node the node
763
	 * @param node the node
770
	 * @param other the other object, or <code>null</code>
764
	 * @param other the other object, or <code>null</code>
771
	 * @return <code>true</code> if the subtree matches, or 
765
	 * @return <code>true</code> if the subtree matches, or 
772
	 *   <code>false</code> if they do not match or the other object has a
766
	 *   <code>false</code> if they do not match or the other object has a
773
	 *   different node type or is <code>null</code>
767
	 *   different node type or is <code>null</code>
774
	 * @since 3.0
768
	 * @since 3.1
775
	 */
769
	 */
776
	public boolean match(EnumConstantDeclaration node, Object other) {
770
	public boolean match(EnumConstantDeclaration node, Object other) {
777
		if (!(other instanceof EnumConstantDeclaration)) {
771
		if (!(other instanceof EnumConstantDeclaration)) {
Lines 804-810 Link Here
804
	 * @return <code>true</code> if the subtree matches, or 
798
	 * @return <code>true</code> if the subtree matches, or 
805
	 *   <code>false</code> if they do not match or the other object has a
799
	 *   <code>false</code> if they do not match or the other object has a
806
	 *   different node type or is <code>null</code>
800
	 *   different node type or is <code>null</code>
807
	 * @since 3.0
801
	 * @since 3.1
808
	 */
802
	 */
809
	public boolean match(EnumDeclaration node, Object other) {
803
	public boolean match(EnumDeclaration node, Object other) {
810
		if (!(other instanceof EnumDeclaration)) {
804
		if (!(other instanceof EnumDeclaration)) {
Lines 888-894 Link Here
888
		}
882
		}
889
		FieldDeclaration o = (FieldDeclaration) other;
883
		FieldDeclaration o = (FieldDeclaration) other;
890
		int level = node.getAST().apiLevel;
884
		int level = node.getAST().apiLevel;
891
		if (level == AST.JLS2) {
885
		if (level == AST.JLS2_INTERNAL) {
892
			if (node.getModifiers() != o.getModifiers()) {
886
			if (node.getModifiers() != o.getModifiers()) {
893
				return false;
887
				return false;
894
			}
888
			}
Lines 1062-1068 Link Here
1062
		}
1056
		}
1063
		Initializer o = (Initializer) other;
1057
		Initializer o = (Initializer) other;
1064
		int level = node.getAST().apiLevel;
1058
		int level = node.getAST().apiLevel;
1065
		if (level == AST.JLS2) {
1059
		if (level == AST.JLS2_INTERNAL) {
1066
			if (node.getModifiers() != o.getModifiers()) {
1060
			if (node.getModifiers() != o.getModifiers()) {
1067
				return false;
1061
				return false;
1068
			}
1062
			}
Lines 1122-1128 Link Here
1122
	 * @deprecated mark deprecated to hide deprecated usage
1116
	 * @deprecated mark deprecated to hide deprecated usage
1123
	 */
1117
	 */
1124
	private boolean compareDeprecatedComment(Javadoc first, Javadoc second) {
1118
	private boolean compareDeprecatedComment(Javadoc first, Javadoc second) {
1125
		if (first.getAST().apiLevel == AST.JLS2) {
1119
		if (first.getAST().apiLevel == AST.JLS2_INTERNAL) {
1126
			return safeEquals(first.getComment(), second.getComment());
1120
			return safeEquals(first.getComment(), second.getComment());
1127
		} else {
1121
		} else {
1128
			return true;
1122
			return true;
Lines 1193-1199 Link Here
1193
	 * @return <code>true</code> if the subtree matches, or 
1187
	 * @return <code>true</code> if the subtree matches, or 
1194
	 *   <code>false</code> if they do not match or the other object has a
1188
	 *   <code>false</code> if they do not match or the other object has a
1195
	 *   different node type or is <code>null</code>
1189
	 *   different node type or is <code>null</code>
1196
	 * @since 3.0
1190
	 * @since 3.1
1197
	 */
1191
	 */
1198
	public boolean match(MarkerAnnotation node, Object other) {
1192
	public boolean match(MarkerAnnotation node, Object other) {
1199
		if (!(other instanceof MarkerAnnotation)) {
1193
		if (!(other instanceof MarkerAnnotation)) {
Lines 1241-1247 Link Here
1241
	 * @return <code>true</code> if the subtree matches, or 
1235
	 * @return <code>true</code> if the subtree matches, or 
1242
	 *   <code>false</code> if they do not match or the other object has a
1236
	 *   <code>false</code> if they do not match or the other object has a
1243
	 *   different node type or is <code>null</code>
1237
	 *   different node type or is <code>null</code>
1244
	 * @since 3.0
1238
	 * @since 3.1
1245
	 */
1239
	 */
1246
	public boolean match(MemberValuePair node, Object other) {
1240
	public boolean match(MemberValuePair node, Object other) {
1247
		if (!(other instanceof MemberValuePair)) {
1241
		if (!(other instanceof MemberValuePair)) {
Lines 1337-1347 Link Here
1337
		}
1331
		}
1338
		MethodDeclaration o = (MethodDeclaration) other;
1332
		MethodDeclaration o = (MethodDeclaration) other;
1339
		int level = node.getAST().apiLevel;
1333
		int level = node.getAST().apiLevel;
1340
		if (level == AST.JLS2) {
1334
		if (level == AST.JLS2_INTERNAL) {
1341
			if (node.getModifiers() != o.getModifiers()) {
1335
			if (node.getModifiers() != o.getModifiers()) {
1342
				return false;
1336
				return false;
1343
			}
1337
			}
1344
			if (!safeSubtreeMatch(node.getReturnType(), o.getReturnType())) {
1338
			if (!safeSubtreeMatch(node.internalGetReturnType(), o.internalGetReturnType())) {
1345
				return false;
1339
				return false;
1346
			}
1340
			}
1347
		}
1341
		}
Lines 1410-1416 Link Here
1410
	 * @return <code>true</code> if the subtree matches, or 
1404
	 * @return <code>true</code> if the subtree matches, or 
1411
	 *   <code>false</code> if they do not match or the other object has a
1405
	 *   <code>false</code> if they do not match or the other object has a
1412
	 *   different node type or is <code>null</code>
1406
	 *   different node type or is <code>null</code>
1413
	 * @since 3.0
1407
	 * @since 3.1
1414
	 */
1408
	 */
1415
	public boolean match(Modifier node, Object other) {
1409
	public boolean match(Modifier node, Object other) {
1416
		if (!(other instanceof Modifier)) {
1410
		if (!(other instanceof Modifier)) {
Lines 1433-1439 Link Here
1433
	 * @return <code>true</code> if the subtree matches, or 
1427
	 * @return <code>true</code> if the subtree matches, or 
1434
	 *   <code>false</code> if they do not match or the other object has a
1428
	 *   <code>false</code> if they do not match or the other object has a
1435
	 *   different node type or is <code>null</code>
1429
	 *   different node type or is <code>null</code>
1436
	 * @since 3.0
1430
	 * @since 3.1
1437
	 */
1431
	 */
1438
	public boolean match(NormalAnnotation node, Object other) {
1432
	public boolean match(NormalAnnotation node, Object other) {
1439
		if (!(other instanceof NormalAnnotation)) {
1433
		if (!(other instanceof NormalAnnotation)) {
Lines 1530-1536 Link Here
1530
	 * @return <code>true</code> if the subtree matches, or 
1524
	 * @return <code>true</code> if the subtree matches, or 
1531
	 *   <code>false</code> if they do not match or the other object has a
1525
	 *   <code>false</code> if they do not match or the other object has a
1532
	 *   different node type or is <code>null</code>
1526
	 *   different node type or is <code>null</code>
1533
	 * @since 3.0
1527
	 * @since 3.1
1534
	 */
1528
	 */
1535
	public boolean match(ParameterizedType node, Object other) {
1529
	public boolean match(ParameterizedType node, Object other) {
1536
		if (!(other instanceof ParameterizedType)) {
1530
		if (!(other instanceof ParameterizedType)) {
Lines 1670-1676 Link Here
1670
	 * @return <code>true</code> if the subtree matches, or 
1664
	 * @return <code>true</code> if the subtree matches, or 
1671
	 *   <code>false</code> if they do not match or the other object has a
1665
	 *   <code>false</code> if they do not match or the other object has a
1672
	 *   different node type or is <code>null</code>
1666
	 *   different node type or is <code>null</code>
1673
	 * @since 3.0
1667
	 * @since 3.1
1674
	 */
1668
	 */
1675
	public boolean match(QualifiedType node, Object other) {
1669
	public boolean match(QualifiedType node, Object other) {
1676
		if (!(other instanceof QualifiedType)) {
1670
		if (!(other instanceof QualifiedType)) {
Lines 1761-1767 Link Here
1761
	 * @return <code>true</code> if the subtree matches, or 
1755
	 * @return <code>true</code> if the subtree matches, or 
1762
	 *   <code>false</code> if they do not match or the other object has a
1756
	 *   <code>false</code> if they do not match or the other object has a
1763
	 *   different node type or is <code>null</code>
1757
	 *   different node type or is <code>null</code>
1764
	 * @since 3.0
1758
	 * @since 3.1
1765
	 */
1759
	 */
1766
	public boolean match(SingleMemberAnnotation node, Object other) {
1760
	public boolean match(SingleMemberAnnotation node, Object other) {
1767
		if (!(other instanceof SingleMemberAnnotation)) {
1761
		if (!(other instanceof SingleMemberAnnotation)) {
Lines 1796-1802 Link Here
1796
		}
1790
		}
1797
		SingleVariableDeclaration o = (SingleVariableDeclaration) other;
1791
		SingleVariableDeclaration o = (SingleVariableDeclaration) other;
1798
		int level = node.getAST().apiLevel;
1792
		int level = node.getAST().apiLevel;
1799
		if (level == AST.JLS2) {
1793
		if (level == AST.JLS2_INTERNAL) {
1800
			if (node.getModifiers() != o.getModifiers()) {
1794
			if (node.getModifiers() != o.getModifiers()) {
1801
				return false;
1795
				return false;
1802
			}
1796
			}
Lines 2128-2141 Link Here
2128
		}
2122
		}
2129
		TypeDeclaration o = (TypeDeclaration) other;
2123
		TypeDeclaration o = (TypeDeclaration) other;
2130
		int level = node.getAST().apiLevel;
2124
		int level = node.getAST().apiLevel;
2131
		if (level == AST.JLS2) {
2125
		if (level == AST.JLS2_INTERNAL) {
2132
			if (node.getModifiers() != o.getModifiers()) {
2126
			if (node.getModifiers() != o.getModifiers()) {
2133
				return false;
2127
				return false;
2134
			}
2128
			}
2135
			if (!safeSubtreeMatch(node.getSuperclass(), o.getSuperclass())) {
2129
			if (!safeSubtreeMatch(node.internalGetSuperclass(), o.internalGetSuperclass())) {
2136
				return false;
2130
				return false;
2137
			}
2131
			}
2138
			if (!safeSubtreeListMatch(node.superInterfaces(), o.superInterfaces())) {
2132
			if (!safeSubtreeListMatch(node.internalSuperInterfaces(), o.internalSuperInterfaces())) {
2139
				return false;
2133
				return false;
2140
			}
2134
			}
2141
		}
2135
		}
Lines 2217-2223 Link Here
2217
	 * @return <code>true</code> if the subtree matches, or 
2211
	 * @return <code>true</code> if the subtree matches, or 
2218
	 *   <code>false</code> if they do not match or the other object has a
2212
	 *   <code>false</code> if they do not match or the other object has a
2219
	 *   different node type or is <code>null</code>
2213
	 *   different node type or is <code>null</code>
2220
	 * @since 3.0
2214
	 * @since 3.1
2221
	 */
2215
	 */
2222
	public boolean match(TypeParameter node, Object other) {
2216
	public boolean match(TypeParameter node, Object other) {
2223
		if (!(other instanceof TypeParameter)) {
2217
		if (!(other instanceof TypeParameter)) {
Lines 2248-2254 Link Here
2248
		}
2242
		}
2249
		VariableDeclarationExpression o = (VariableDeclarationExpression) other;
2243
		VariableDeclarationExpression o = (VariableDeclarationExpression) other;
2250
		int level = node.getAST().apiLevel;
2244
		int level = node.getAST().apiLevel;
2251
		if (level == AST.JLS2) {
2245
		if (level == AST.JLS2_INTERNAL) {
2252
			if (node.getModifiers() != o.getModifiers()) {
2246
			if (node.getModifiers() != o.getModifiers()) {
2253
				return false;
2247
				return false;
2254
			}
2248
			}
Lines 2310-2316 Link Here
2310
		}
2304
		}
2311
		VariableDeclarationStatement o = (VariableDeclarationStatement) other;
2305
		VariableDeclarationStatement o = (VariableDeclarationStatement) other;
2312
		int level = node.getAST().apiLevel;
2306
		int level = node.getAST().apiLevel;
2313
		if (level == AST.JLS2) {
2307
		if (level == AST.JLS2_INTERNAL) {
2314
			if (node.getModifiers() != o.getModifiers()) {
2308
			if (node.getModifiers() != o.getModifiers()) {
2315
				return false;
2309
				return false;
2316
			}
2310
			}
Lines 2361-2367 Link Here
2361
	 * @return <code>true</code> if the subtree matches, or 
2355
	 * @return <code>true</code> if the subtree matches, or 
2362
	 *   <code>false</code> if they do not match or the other object has a
2356
	 *   <code>false</code> if they do not match or the other object has a
2363
	 *   different node type or is <code>null</code>
2357
	 *   different node type or is <code>null</code>
2364
	 * @since 3.0
2358
	 * @since 3.1
2365
	 */
2359
	 */
2366
	public boolean match(WildcardType node, Object other) {
2360
	public boolean match(WildcardType node, Object other) {
2367
		if (!(other instanceof WildcardType)) {
2361
		if (!(other instanceof WildcardType)) {
(-)dom/org/eclipse/jdt/core/dom/ASTNode.java (-17 / +17 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2004 IBM Corporation and others.
2
 * Copyright (c) 2000, 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 647-653 Link Here
647
	 * Node type constant indicating a node of type 
647
	 * Node type constant indicating a node of type 
648
	 * <code>EnhancedForStatement</code>.
648
	 * <code>EnhancedForStatement</code>.
649
	 * @see EnhancedForStatement
649
	 * @see EnhancedForStatement
650
	 * @since 3.0
650
	 * @since 3.1
651
	 */
651
	 */
652
	public static final int ENHANCED_FOR_STATEMENT = 70;
652
	public static final int ENHANCED_FOR_STATEMENT = 70;
653
653
Lines 655-661 Link Here
655
	 * Node type constant indicating a node of type 
655
	 * Node type constant indicating a node of type 
656
	 * <code>EnumDeclaration</code>.
656
	 * <code>EnumDeclaration</code>.
657
	 * @see EnumDeclaration
657
	 * @see EnumDeclaration
658
	 * @since 3.0
658
	 * @since 3.1
659
	 */
659
	 */
660
	public static final int ENUM_DECLARATION = 71;
660
	public static final int ENUM_DECLARATION = 71;
661
	
661
	
Lines 663-669 Link Here
663
	 * Node type constant indicating a node of type 
663
	 * Node type constant indicating a node of type 
664
	 * <code>EnumConstantDeclaration</code>.
664
	 * <code>EnumConstantDeclaration</code>.
665
	 * @see EnumConstantDeclaration
665
	 * @see EnumConstantDeclaration
666
	 * @since 3.0
666
	 * @since 3.1
667
	 */
667
	 */
668
	public static final int ENUM_CONSTANT_DECLARATION = 72;
668
	public static final int ENUM_CONSTANT_DECLARATION = 72;
669
	
669
	
Lines 671-677 Link Here
671
	 * Node type constant indicating a node of type 
671
	 * Node type constant indicating a node of type 
672
	 * <code>TypeParameter</code>.
672
	 * <code>TypeParameter</code>.
673
	 * @see TypeParameter
673
	 * @see TypeParameter
674
	 * @since 3.0
674
	 * @since 3.1
675
	 */
675
	 */
676
	public static final int TYPE_PARAMETER = 73;
676
	public static final int TYPE_PARAMETER = 73;
677
677
Lines 679-685 Link Here
679
	 * Node type constant indicating a node of type 
679
	 * Node type constant indicating a node of type 
680
	 * <code>ParameterizedType</code>.
680
	 * <code>ParameterizedType</code>.
681
	 * @see ParameterizedType
681
	 * @see ParameterizedType
682
	 * @since 3.0
682
	 * @since 3.1
683
	 */
683
	 */
684
	public static final int PARAMETERIZED_TYPE = 74;
684
	public static final int PARAMETERIZED_TYPE = 74;
685
685
Lines 687-693 Link Here
687
	 * Node type constant indicating a node of type 
687
	 * Node type constant indicating a node of type 
688
	 * <code>QualifiedType</code>.
688
	 * <code>QualifiedType</code>.
689
	 * @see QualifiedType
689
	 * @see QualifiedType
690
	 * @since 3.0
690
	 * @since 3.1
691
	 */
691
	 */
692
	public static final int QUALIFIED_TYPE = 75;
692
	public static final int QUALIFIED_TYPE = 75;
693
	
693
	
Lines 695-701 Link Here
695
	 * Node type constant indicating a node of type 
695
	 * Node type constant indicating a node of type 
696
	 * <code>WildcardType</code>.
696
	 * <code>WildcardType</code>.
697
	 * @see WildcardType
697
	 * @see WildcardType
698
	 * @since 3.0
698
	 * @since 3.1
699
	 */
699
	 */
700
	public static final int WILDCARD_TYPE = 76;
700
	public static final int WILDCARD_TYPE = 76;
701
	
701
	
Lines 703-709 Link Here
703
	 * Node type constant indicating a node of type 
703
	 * Node type constant indicating a node of type 
704
	 * <code>NormalAnnotation</code>.
704
	 * <code>NormalAnnotation</code>.
705
	 * @see NormalAnnotation
705
	 * @see NormalAnnotation
706
	 * @since 3.0
706
	 * @since 3.1
707
	 */
707
	 */
708
	public static final int NORMAL_ANNOTATION = 77;
708
	public static final int NORMAL_ANNOTATION = 77;
709
	
709
	
Lines 711-717 Link Here
711
	 * Node type constant indicating a node of type 
711
	 * Node type constant indicating a node of type 
712
	 * <code>MarkerAnnotation</code>.
712
	 * <code>MarkerAnnotation</code>.
713
	 * @see MarkerAnnotation
713
	 * @see MarkerAnnotation
714
	 * @since 3.0
714
	 * @since 3.1
715
	 */
715
	 */
716
	public static final int MARKER_ANNOTATION = 78;
716
	public static final int MARKER_ANNOTATION = 78;
717
	
717
	
Lines 719-725 Link Here
719
	 * Node type constant indicating a node of type 
719
	 * Node type constant indicating a node of type 
720
	 * <code>SingleMemberAnnotation</code>.
720
	 * <code>SingleMemberAnnotation</code>.
721
	 * @see SingleMemberAnnotation
721
	 * @see SingleMemberAnnotation
722
	 * @since 3.0
722
	 * @since 3.1
723
	 */
723
	 */
724
	public static final int SINGLE_MEMBER_ANNOTATION = 79;
724
	public static final int SINGLE_MEMBER_ANNOTATION = 79;
725
	
725
	
Lines 727-733 Link Here
727
	 * Node type constant indicating a node of type 
727
	 * Node type constant indicating a node of type 
728
	 * <code>MemberValuePair</code>.
728
	 * <code>MemberValuePair</code>.
729
	 * @see MemberValuePair
729
	 * @see MemberValuePair
730
	 * @since 3.0
730
	 * @since 3.1
731
	 */
731
	 */
732
	public static final int MEMBER_VALUE_PAIR = 80;
732
	public static final int MEMBER_VALUE_PAIR = 80;
733
	
733
	
Lines 735-741 Link Here
735
	 * Node type constant indicating a node of type 
735
	 * Node type constant indicating a node of type 
736
	 * <code>AnnotationTypeDeclaration</code>.
736
	 * <code>AnnotationTypeDeclaration</code>.
737
	 * @see AnnotationTypeDeclaration
737
	 * @see AnnotationTypeDeclaration
738
	 * @since 3.0
738
	 * @since 3.1
739
	 */
739
	 */
740
	public static final int ANNOTATION_TYPE_DECLARATION = 81;
740
	public static final int ANNOTATION_TYPE_DECLARATION = 81;
741
	
741
	
Lines 743-749 Link Here
743
	 * Node type constant indicating a node of type 
743
	 * Node type constant indicating a node of type 
744
	 * <code>AnnotationTypeMemberDeclaration</code>.
744
	 * <code>AnnotationTypeMemberDeclaration</code>.
745
	 * @see AnnotationTypeMemberDeclaration
745
	 * @see AnnotationTypeMemberDeclaration
746
	 * @since 3.0
746
	 * @since 3.1
747
	 */
747
	 */
748
	public static final int ANNOTATION_TYPE_MEMBER_DECLARATION = 82;
748
	public static final int ANNOTATION_TYPE_MEMBER_DECLARATION = 82;
749
	
749
	
Lines 751-757 Link Here
751
	 * Node type constant indicating a node of type 
751
	 * Node type constant indicating a node of type 
752
	 * <code>Modifier</code>.
752
	 * <code>Modifier</code>.
753
	 * @see Modifier
753
	 * @see Modifier
754
	 * @since 3.0
754
	 * @since 3.1
755
	 */
755
	 */
756
	public static final int MODIFIER = 83;
756
	public static final int MODIFIER = 83;
757
	
757
	
Lines 1754-1760 Link Here
1754
	 * @since 3.0
1754
	 * @since 3.0
1755
     */
1755
     */
1756
	final void unsupportedIn2() {
1756
	final void unsupportedIn2() {
1757
	  if (this.ast.apiLevel == AST.JLS2) {
1757
	  if (this.ast.apiLevel == AST.JLS2_INTERNAL) {
1758
	  	throw new UnsupportedOperationException("Operation not supported in JLS2 AST"); //$NON-NLS-1$
1758
	  	throw new UnsupportedOperationException("Operation not supported in JLS2 AST"); //$NON-NLS-1$
1759
	  }
1759
	  }
1760
	}
1760
	}
Lines 1767-1773 Link Here
1767
	 * @since 3.0
1767
	 * @since 3.0
1768
     */
1768
     */
1769
	final void supportedOnlyIn2() {
1769
	final void supportedOnlyIn2() {
1770
	  if (this.ast.apiLevel != AST.JLS2) {
1770
	  if (this.ast.apiLevel != AST.JLS2_INTERNAL) {
1771
	  	throw new UnsupportedOperationException("Operation only supported in JLS2 AST"); //$NON-NLS-1$
1771
	  	throw new UnsupportedOperationException("Operation only supported in JLS2 AST"); //$NON-NLS-1$
1772
	  }
1772
	  }
1773
	}
1773
	}
(-)dom/org/eclipse/jdt/core/dom/ASTParser.java (-7 / +2 lines)
Lines 38-44 Link Here
38
 * Example: Create basic AST from source string
38
 * Example: Create basic AST from source string
39
 * <pre>
39
 * <pre>
40
 * char[] source = ...;
40
 * char[] source = ...;
41
 * ASTParser parser = ASTParser.newParser(AST.JLS2);  // handles JLS2 (J2SE 1.4)
41
 * ASTParser parser = ASTParser.newParser(AST.JLS3);  // handles JDK 1.0, 1.1, 1.2, 1.3, 1.4, 1.5
42
 * parser.setSource(source);
42
 * parser.setSource(source);
43
 * CompilationUnit result = (CompilationUnit) parser.createAST(null);
43
 * CompilationUnit result = (CompilationUnit) parser.createAST(null);
44
 * </pre>
44
 * </pre>
Lines 100-110 Link Here
100
	/**
100
	/**
101
	 * Creates a new object for creating a Java abstract syntax tree
101
	 * Creates a new object for creating a Java abstract syntax tree
102
     * (AST) following the specified set of API rules.
102
     * (AST) following the specified set of API rules.
103
     * <p>
104
     * <b>NOTE:</b>In Eclipse 3.0, there is no parser support for
105
     * AST.JLS3. This support is planned for the follow-on release of
106
     * Eclipse which includes support for J2SE 1.5.
107
     * </p>
108
     *  
103
     *  
109
 	 * @param level the API level; one of the LEVEL constants
104
 	 * @param level the API level; one of the LEVEL constants
110
     * declared on <code>AST</code>
105
     * declared on <code>AST</code>
Lines 201-207 Link Here
201
     * declared on <code>AST</code>
196
     * declared on <code>AST</code>
202
	 */
197
	 */
203
	ASTParser(int level) {
198
	ASTParser(int level) {
204
		if ((level != AST.JLS2)
199
		if ((level != AST.JLS2_INTERNAL)
205
			&& (level != AST.JLS3)) {
200
			&& (level != AST.JLS3)) {
206
			throw new IllegalArgumentException();
201
			throw new IllegalArgumentException();
207
		}
202
		}
(-)dom/org/eclipse/jdt/core/dom/ASTRequestor.java (-1 / +1 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2004 IBM Corporation and others.
2
 * Copyright (c) 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
(-)dom/org/eclipse/jdt/core/dom/ASTVisitor.java (-28 / +28 lines)
Lines 173-179 Link Here
173
	 * @return <code>true</code> if the children of this node should be
173
	 * @return <code>true</code> if the children of this node should be
174
	 * visited, and <code>false</code> if the children of this node should
174
	 * visited, and <code>false</code> if the children of this node should
175
	 * be skipped
175
	 * be skipped
176
	 * @since 3.0
176
	 * @since 3.1
177
	 */
177
	 */
178
	public boolean visit(AnnotationTypeDeclaration node) {
178
	public boolean visit(AnnotationTypeDeclaration node) {
179
		return true;
179
		return true;
Lines 191-197 Link Here
191
	 * @return <code>true</code> if the children of this node should be
191
	 * @return <code>true</code> if the children of this node should be
192
	 * visited, and <code>false</code> if the children of this node should
192
	 * visited, and <code>false</code> if the children of this node should
193
	 * be skipped
193
	 * be skipped
194
	 * @since 3.0
194
	 * @since 3.1
195
	 */
195
	 */
196
	public boolean visit(AnnotationTypeMemberDeclaration node) {
196
	public boolean visit(AnnotationTypeMemberDeclaration node) {
197
		return true;
197
		return true;
Lines 551-557 Link Here
551
	 * @return <code>true</code> if the children of this node should be
551
	 * @return <code>true</code> if the children of this node should be
552
	 * visited, and <code>false</code> if the children of this node should
552
	 * visited, and <code>false</code> if the children of this node should
553
	 * be skipped
553
	 * be skipped
554
	 * @since 3.0
554
	 * @since 3.1
555
	 */
555
	 */
556
	public boolean visit(EnhancedForStatement node) {
556
	public boolean visit(EnhancedForStatement node) {
557
		return true;
557
		return true;
Lines 568-574 Link Here
568
	 * @return <code>true</code> if the children of this node should be
568
	 * @return <code>true</code> if the children of this node should be
569
	 * visited, and <code>false</code> if the children of this node should
569
	 * visited, and <code>false</code> if the children of this node should
570
	 * be skipped
570
	 * be skipped
571
	 * @since 3.0
571
	 * @since 3.1
572
	 */
572
	 */
573
	public boolean visit(EnumConstantDeclaration node) {
573
	public boolean visit(EnumConstantDeclaration node) {
574
		return true;
574
		return true;
Lines 585-591 Link Here
585
	 * @return <code>true</code> if the children of this node should be
585
	 * @return <code>true</code> if the children of this node should be
586
	 * visited, and <code>false</code> if the children of this node should
586
	 * visited, and <code>false</code> if the children of this node should
587
	 * be skipped
587
	 * be skipped
588
	 * @since 3.0
588
	 * @since 3.1
589
	 */
589
	 */
590
	public boolean visit(EnumDeclaration node) {
590
	public boolean visit(EnumDeclaration node) {
591
		return true;
591
		return true;
Lines 808-814 Link Here
808
	 * @return <code>true</code> if the children of this node should be
808
	 * @return <code>true</code> if the children of this node should be
809
	 * visited, and <code>false</code> if the children of this node should
809
	 * visited, and <code>false</code> if the children of this node should
810
	 * be skipped
810
	 * be skipped
811
	 * @since 3.0
811
	 * @since 3.1
812
	 */
812
	 */
813
	public boolean visit(MarkerAnnotation node) {
813
	public boolean visit(MarkerAnnotation node) {
814
		return true;
814
		return true;
Lines 844-850 Link Here
844
	 * @return <code>true</code> if the children of this node should be
844
	 * @return <code>true</code> if the children of this node should be
845
	 * visited, and <code>false</code> if the children of this node should
845
	 * visited, and <code>false</code> if the children of this node should
846
	 * be skipped
846
	 * be skipped
847
	 * @since 3.0
847
	 * @since 3.1
848
	 */
848
	 */
849
	public boolean visit(MemberValuePair node) {
849
	public boolean visit(MemberValuePair node) {
850
		return true;
850
		return true;
Lines 931-937 Link Here
931
	 * @return <code>true</code> if the children of this node should be
931
	 * @return <code>true</code> if the children of this node should be
932
	 * visited, and <code>false</code> if the children of this node should
932
	 * visited, and <code>false</code> if the children of this node should
933
	 * be skipped
933
	 * be skipped
934
	 * @since 3.0
934
	 * @since 3.1
935
	 */
935
	 */
936
	public boolean visit(Modifier node) {
936
	public boolean visit(Modifier node) {
937
		return true;
937
		return true;
Lines 949-955 Link Here
949
	 * @return <code>true</code> if the children of this node should be
949
	 * @return <code>true</code> if the children of this node should be
950
	 * visited, and <code>false</code> if the children of this node should
950
	 * visited, and <code>false</code> if the children of this node should
951
	 * be skipped
951
	 * be skipped
952
	 * @since 3.0
952
	 * @since 3.1
953
	 */
953
	 */
954
	public boolean visit(NormalAnnotation node) {
954
	public boolean visit(NormalAnnotation node) {
955
		return true;
955
		return true;
Lines 1015-1021 Link Here
1015
	 * @return <code>true</code> if the children of this node should be
1015
	 * @return <code>true</code> if the children of this node should be
1016
	 * visited, and <code>false</code> if the children of this node should
1016
	 * visited, and <code>false</code> if the children of this node should
1017
	 * be skipped
1017
	 * be skipped
1018
	 * @since 3.0
1018
	 * @since 3.1
1019
	 */
1019
	 */
1020
	public boolean visit(ParameterizedType node) {
1020
	public boolean visit(ParameterizedType node) {
1021
		return true;
1021
		return true;
Lines 1112-1118 Link Here
1112
	 * @return <code>true</code> if the children of this node should be
1112
	 * @return <code>true</code> if the children of this node should be
1113
	 * visited, and <code>false</code> if the children of this node should
1113
	 * visited, and <code>false</code> if the children of this node should
1114
	 * be skipped
1114
	 * be skipped
1115
	 * @since 3.0
1115
	 * @since 3.1
1116
	 */
1116
	 */
1117
	public boolean visit(QualifiedType node) {
1117
	public boolean visit(QualifiedType node) {
1118
		return true;
1118
		return true;
Lines 1178-1184 Link Here
1178
	 * @return <code>true</code> if the children of this node should be
1178
	 * @return <code>true</code> if the children of this node should be
1179
	 * visited, and <code>false</code> if the children of this node should
1179
	 * visited, and <code>false</code> if the children of this node should
1180
	 * be skipped
1180
	 * be skipped
1181
	 * @since 3.0
1181
	 * @since 3.1
1182
	 */
1182
	 */
1183
	public boolean visit(SingleMemberAnnotation node) {
1183
	public boolean visit(SingleMemberAnnotation node) {
1184
		return true;
1184
		return true;
Lines 1457-1463 Link Here
1457
	 * @return <code>true</code> if the children of this node should be
1457
	 * @return <code>true</code> if the children of this node should be
1458
	 * visited, and <code>false</code> if the children of this node should
1458
	 * visited, and <code>false</code> if the children of this node should
1459
	 * be skipped
1459
	 * be skipped
1460
	 * @since 3.0
1460
	 * @since 3.1
1461
	 */
1461
	 */
1462
	public boolean visit(TypeParameter node) {
1462
	public boolean visit(TypeParameter node) {
1463
		return true;
1463
		return true;
Lines 1538-1544 Link Here
1538
	 * @return <code>true</code> if the children of this node should be
1538
	 * @return <code>true</code> if the children of this node should be
1539
	 * visited, and <code>false</code> if the children of this node should
1539
	 * visited, and <code>false</code> if the children of this node should
1540
	 * be skipped
1540
	 * be skipped
1541
	 * @since 3.0
1541
	 * @since 3.1
1542
	 */
1542
	 */
1543
	public boolean visit(WildcardType node) {
1543
	public boolean visit(WildcardType node) {
1544
		return true;
1544
		return true;
Lines 1551-1557 Link Here
1551
	 * </p>
1551
	 * </p>
1552
	 * 
1552
	 * 
1553
	 * @param node the node to visit
1553
	 * @param node the node to visit
1554
	 * @since 3.0
1554
	 * @since 3.1
1555
	 */
1555
	 */
1556
	public void endVisit(AnnotationTypeDeclaration node) {
1556
	public void endVisit(AnnotationTypeDeclaration node) {
1557
		// default implementation: do nothing
1557
		// default implementation: do nothing
Lines 1564-1570 Link Here
1564
	 * </p>
1564
	 * </p>
1565
	 * 
1565
	 * 
1566
	 * @param node the node to visit
1566
	 * @param node the node to visit
1567
	 * @since 3.0
1567
	 * @since 3.1
1568
	 */
1568
	 */
1569
	public void endVisit(AnnotationTypeMemberDeclaration node) {
1569
	public void endVisit(AnnotationTypeMemberDeclaration node) {
1570
		// default implementation: do nothing
1570
		// default implementation: do nothing
Lines 1835-1841 Link Here
1835
	 * </p>
1835
	 * </p>
1836
	 * 
1836
	 * 
1837
	 * @param node the node to visit
1837
	 * @param node the node to visit
1838
	 * @since 3.0
1838
	 * @since 3.1
1839
	 */
1839
	 */
1840
	public void endVisit(EnhancedForStatement node) {
1840
	public void endVisit(EnhancedForStatement node) {
1841
		// default implementation: do nothing
1841
		// default implementation: do nothing
Lines 1848-1854 Link Here
1848
	 * </p>
1848
	 * </p>
1849
	 * 
1849
	 * 
1850
	 * @param node the node to visit
1850
	 * @param node the node to visit
1851
	 * @since 3.0
1851
	 * @since 3.1
1852
	 */
1852
	 */
1853
	public void endVisit(EnumConstantDeclaration node) {
1853
	public void endVisit(EnumConstantDeclaration node) {
1854
		// default implementation: do nothing
1854
		// default implementation: do nothing
Lines 1861-1867 Link Here
1861
	 * </p>
1861
	 * </p>
1862
	 * 
1862
	 * 
1863
	 * @param node the node to visit
1863
	 * @param node the node to visit
1864
	 * @since 3.0
1864
	 * @since 3.1
1865
	 */
1865
	 */
1866
	public void endVisit(EnumDeclaration node) {
1866
	public void endVisit(EnumDeclaration node) {
1867
		// default implementation: do nothing
1867
		// default implementation: do nothing
Lines 2024-2030 Link Here
2024
	 * </p>
2024
	 * </p>
2025
	 * 
2025
	 * 
2026
	 * @param node the node to visit
2026
	 * @param node the node to visit
2027
	 * @since 3.0
2027
	 * @since 3.1
2028
	 */
2028
	 */
2029
	public void endVisit(MarkerAnnotation node) {
2029
	public void endVisit(MarkerAnnotation node) {
2030
		// default implementation: do nothing
2030
		// default implementation: do nothing
Lines 2050-2056 Link Here
2050
	 * </p>
2050
	 * </p>
2051
	 * 
2051
	 * 
2052
	 * @param node the node to visit
2052
	 * @param node the node to visit
2053
	 * @since 3.0
2053
	 * @since 3.1
2054
	 */
2054
	 */
2055
	public void endVisit(MemberValuePair node) {
2055
	public void endVisit(MemberValuePair node) {
2056
		// default implementation: do nothing
2056
		// default implementation: do nothing
Lines 2113-2119 Link Here
2113
	 * </p>
2113
	 * </p>
2114
	 * 
2114
	 * 
2115
	 * @param node the node to visit
2115
	 * @param node the node to visit
2116
	 * @since 3.0
2116
	 * @since 3.1
2117
	 */
2117
	 */
2118
	public void endVisit(Modifier node) {
2118
	public void endVisit(Modifier node) {
2119
		// default implementation: do nothing
2119
		// default implementation: do nothing
Lines 2126-2132 Link Here
2126
	 * </p>
2126
	 * </p>
2127
	 * 
2127
	 * 
2128
	 * @param node the node to visit
2128
	 * @param node the node to visit
2129
	 * @since 3.0
2129
	 * @since 3.1
2130
	 */
2130
	 */
2131
	public void endVisit(NormalAnnotation node) {
2131
	public void endVisit(NormalAnnotation node) {
2132
		// default implementation: do nothing
2132
		// default implementation: do nothing
Lines 2175-2181 Link Here
2175
	 * </p>
2175
	 * </p>
2176
	 * 
2176
	 * 
2177
	 * @param node the node to visit
2177
	 * @param node the node to visit
2178
	 * @since 3.0
2178
	 * @since 3.1
2179
	 */
2179
	 */
2180
	public void endVisit(ParameterizedType node) {
2180
	public void endVisit(ParameterizedType node) {
2181
		// default implementation: do nothing
2181
		// default implementation: do nothing
Lines 2248-2254 Link Here
2248
	 * </p>
2248
	 * </p>
2249
	 * 
2249
	 * 
2250
	 * @param node the node to visit
2250
	 * @param node the node to visit
2251
	 * @since 3.0
2251
	 * @since 3.1
2252
	 */
2252
	 */
2253
	public void endVisit(QualifiedType node) {
2253
	public void endVisit(QualifiedType node) {
2254
		// default implementation: do nothing
2254
		// default implementation: do nothing
Lines 2297-2303 Link Here
2297
	 * </p>
2297
	 * </p>
2298
	 * 
2298
	 * 
2299
	 * @param node the node to visit
2299
	 * @param node the node to visit
2300
	 * @since 3.0
2300
	 * @since 3.1
2301
	 */
2301
	 */
2302
	public void endVisit(SingleMemberAnnotation node) {
2302
	public void endVisit(SingleMemberAnnotation node) {
2303
		// default implementation: do nothing
2303
		// default implementation: do nothing
Lines 2504-2510 Link Here
2504
	 * </p>
2504
	 * </p>
2505
	 * 
2505
	 * 
2506
	 * @param node the node to visit
2506
	 * @param node the node to visit
2507
	 * @since 3.0
2507
	 * @since 3.1
2508
	 */
2508
	 */
2509
	public void endVisit(TypeParameter node) {
2509
	public void endVisit(TypeParameter node) {
2510
		// default implementation: do nothing
2510
		// default implementation: do nothing
Lines 2565-2571 Link Here
2565
	 * </p>
2565
	 * </p>
2566
	 * 
2566
	 * 
2567
	 * @param node the node to visit
2567
	 * @param node the node to visit
2568
	 * @since 3.0
2568
	 * @since 3.1
2569
	 */
2569
	 */
2570
	public void endVisit(WildcardType node) {
2570
	public void endVisit(WildcardType node) {
2571
		// default implementation: do nothing
2571
		// default implementation: do nothing
(-)dom/org/eclipse/jdt/core/dom/Annotation.java (-9 / +2 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2004 IBM Corporation and others.
2
 * Copyright (c) 2004, 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 20-32 Link Here
20
 *		SingleMemberAnnotation
20
 *		SingleMemberAnnotation
21
 * </pre>
21
 * </pre>
22
 * </p>
22
 * </p>
23
 * <p>
23
 * @since 3.1
24
 * Note: This API element is only needed for dealing with Java code that uses
25
 * new language features of J2SE 1.5. It is included in anticipation of J2SE
26
 * 1.5 support, which is planned for the next release of Eclipse after 3.0, and
27
 * may change slightly before reaching its final form.
28
 * </p>
29
 * @since 3.0
30
 */
24
 */
31
public abstract class Annotation extends Expression implements IExtendedModifier {
25
public abstract class Annotation extends Expression implements IExtendedModifier {
32
	
26
	
Lines 43-49 Link Here
43
	 * of this node.
37
	 * of this node.
44
	 * 
38
	 * 
45
	 * @return the property descriptor
39
	 * @return the property descriptor
46
	 * @since 3.1
47
	 */
40
	 */
48
	public final ChildPropertyDescriptor getTypeNameProperty() {
41
	public final ChildPropertyDescriptor getTypeNameProperty() {
49
		return internalTypeNameProperty();
42
		return internalTypeNameProperty();
(-)dom/org/eclipse/jdt/core/dom/AnnotationTypeDeclaration.java (-8 / +2 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2004 IBM Corporation and others.
2
 * Copyright (c) 2004, 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 39-52 Link Here
39
 * modifiers). The source range extends through the last character of the "}"
39
 * modifiers). The source range extends through the last character of the "}"
40
 * token following the body declarations.
40
 * token following the body declarations.
41
 * </p>
41
 * </p>
42
 * <p>
43
 * Note: This API element is only needed for dealing with Java code that uses
44
 * new language features of J2SE 1.5. It is included in anticipation of J2SE
45
 * 1.5 support, which is planned for the next release of Eclipse after 3.0, and
46
 * may change slightly before reaching its final form.
47
 * </p>
48
 * 
42
 * 
49
 * @since 3.0
43
 * @since 3.1
50
 */
44
 */
51
public class AnnotationTypeDeclaration extends AbstractTypeDeclaration {
45
public class AnnotationTypeDeclaration extends AbstractTypeDeclaration {
52
	
46
	
(-)dom/org/eclipse/jdt/core/dom/AnnotationTypeMemberDeclaration.java (-13 / +2 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2004 IBM Corporation and others.
2
 * Copyright (c) 2004, 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 33-80 Link Here
33
 * The source range extends through the last character of the
33
 * The source range extends through the last character of the
34
 * ";" token.
34
 * ";" token.
35
 * </p>
35
 * </p>
36
 * <p>
37
 * Note: This API element is only needed for dealing with Java code that uses
38
 * new language features of J2SE 1.5. It is included in anticipation of J2SE
39
 * 1.5 support, which is planned for the next release of Eclipse after 3.0, and
40
 * may change slightly before reaching its final form.
41
 * </p>
42
 * 
36
 * 
43
 * @since 3.0
37
 * @since 3.1
44
 */
38
 */
45
public class AnnotationTypeMemberDeclaration extends BodyDeclaration {
39
public class AnnotationTypeMemberDeclaration extends BodyDeclaration {
46
	
40
	
47
	/**
41
	/**
48
	 * The "javadoc" structural property of this node type.
42
	 * The "javadoc" structural property of this node type.
49
	 * @since 3.0
50
	 */
43
	 */
51
	public static final ChildPropertyDescriptor JAVADOC_PROPERTY = 
44
	public static final ChildPropertyDescriptor JAVADOC_PROPERTY = 
52
		internalJavadocPropertyFactory(AnnotationTypeMemberDeclaration.class);
45
		internalJavadocPropertyFactory(AnnotationTypeMemberDeclaration.class);
53
46
54
	/**
47
	/**
55
	 * The "modifiers" structural property of this node type.
48
	 * The "modifiers" structural property of this node type.
56
	 * @since 3.0
57
	 */
49
	 */
58
	public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = 
50
	public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = 
59
		internalModifiers2PropertyFactory(AnnotationTypeMemberDeclaration.class);
51
		internalModifiers2PropertyFactory(AnnotationTypeMemberDeclaration.class);
60
	
52
	
61
	/**
53
	/**
62
	 * The "name" structural property of this node type.
54
	 * The "name" structural property of this node type.
63
	 * @since 3.0
64
	 */
55
	 */
65
	public static final ChildPropertyDescriptor NAME_PROPERTY = 
56
	public static final ChildPropertyDescriptor NAME_PROPERTY = 
66
		new ChildPropertyDescriptor(AnnotationTypeMemberDeclaration.class, "name", SimpleName.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$
57
		new ChildPropertyDescriptor(AnnotationTypeMemberDeclaration.class, "name", SimpleName.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$
67
58
68
	/**
59
	/**
69
	 * The "type" structural property of this node type.
60
	 * The "type" structural property of this node type.
70
	 * @since 3.0
71
	 */
61
	 */
72
	public static final ChildPropertyDescriptor TYPE_PROPERTY = 
62
	public static final ChildPropertyDescriptor TYPE_PROPERTY = 
73
		new ChildPropertyDescriptor(AnnotationTypeMemberDeclaration.class, "type", Type.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$
63
		new ChildPropertyDescriptor(AnnotationTypeMemberDeclaration.class, "type", Type.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$
74
64
75
	/**
65
	/**
76
	 * The "default" structural property of this node type.
66
	 * The "default" structural property of this node type.
77
	 * @since 3.0
78
	 */
67
	 */
79
	public static final ChildPropertyDescriptor DEFAULT_PROPERTY = 
68
	public static final ChildPropertyDescriptor DEFAULT_PROPERTY = 
80
		new ChildPropertyDescriptor(AnnotationTypeMemberDeclaration.class, "default", Expression.class, OPTIONAL, CYCLE_RISK); //$NON-NLS-1$
69
		new ChildPropertyDescriptor(AnnotationTypeMemberDeclaration.class, "default", Expression.class, OPTIONAL, CYCLE_RISK); //$NON-NLS-1$
(-)dom/org/eclipse/jdt/core/dom/BodyDeclaration.java (-4 / +14 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2004 IBM Corporation and others.
2
 * Copyright (c) 2000, 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 231-246 Link Here
231
	 * @exception UnsupportedOperationException if this operation is used in
231
	 * @exception UnsupportedOperationException if this operation is used in
232
	 * an AST later than JLS2
232
	 * an AST later than JLS2
233
	 * @see Modifier
233
	 * @see Modifier
234
	 * @deprecated In the JLS3 API, this method is replaced by 
235
	 * {@link #modifiers()} which contains a list of a <code>Modifier</code> nodes.
234
	 */ 
236
	 */ 
235
	// TODO (jeem) When JLS3 support is complete (post 3.0) - deprecated In the JLS3 API, this method is replaced by <code>modifiers()</code> which contains a list of a <code>Modifier</code> nodes.
236
	public void setModifiers(int modifiers) {
237
	public void setModifiers(int modifiers) {
238
		internalSetModifiers(modifiers);
239
	}
240
	
241
	/**
242
	 * Internal synonym for deprecated method. Used to avoid
243
	 * deprecation warnings.
244
	 * @since 3.1
245
	 */
246
	/*package*/ final void internalSetModifiers(int pmodifiers) {
237
		// more efficient than just calling supportedOnlyIn2() to check
247
		// more efficient than just calling supportedOnlyIn2() to check
238
		if (this.modifiers != null) {
248
		if (this.modifiers != null) {
239
			supportedOnlyIn2();
249
			supportedOnlyIn2();
240
		}
250
		}
241
		SimplePropertyDescriptor p = internalModifiersProperty();
251
		SimplePropertyDescriptor p = internalModifiersProperty();
242
		preValueChange(p);
252
		preValueChange(p);
243
		this.modifierFlags = modifiers;
253
		this.modifierFlags = pmodifiers;
244
		postValueChange(p);
254
		postValueChange(p);
245
	}
255
	}
246
256
Lines 252-258 Link Here
252
	 *    (element type: <code>IExtendedModifier</code>)
262
	 *    (element type: <code>IExtendedModifier</code>)
253
	 * @exception UnsupportedOperationException if this operation is used in
263
	 * @exception UnsupportedOperationException if this operation is used in
254
	 * a JLS2 AST
264
	 * a JLS2 AST
255
	 * @since 3.0
265
	 * @since 3.1
256
	 */ 
266
	 */ 
257
	public List modifiers() {
267
	public List modifiers() {
258
		// more efficient than just calling unsupportedIn2() to check
268
		// more efficient than just calling unsupportedIn2() to check
(-)dom/org/eclipse/jdt/core/dom/ClassInstanceCreation.java (-20 / +35 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2004 IBM Corporation and others.
2
 * Copyright (c) 2000, 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 63-69 Link Here
63
63
64
	/**
64
	/**
65
	 * The "typeArguments" structural property of this node type (added in JLS3 API).
65
	 * The "typeArguments" structural property of this node type (added in JLS3 API).
66
	 * @since 3.0
66
	 * @since 3.1
67
	 */
67
	 */
68
	public static final ChildListPropertyDescriptor TYPE_ARGUMENTS_PROPERTY = 
68
	public static final ChildListPropertyDescriptor TYPE_ARGUMENTS_PROPERTY = 
69
		new ChildListPropertyDescriptor(ClassInstanceCreation.class, "typeArguments", Type.class, NO_CYCLE_RISK); //$NON-NLS-1$
69
		new ChildListPropertyDescriptor(ClassInstanceCreation.class, "typeArguments", Type.class, NO_CYCLE_RISK); //$NON-NLS-1$
Lines 79-91 Link Here
79
	 * The "name" structural property of this node type (JLS2 API only).
79
	 * The "name" structural property of this node type (JLS2 API only).
80
	 * @since 3.0
80
	 * @since 3.0
81
	 */
81
	 */
82
	// TODO (jeem) When JLS3 support is complete (post 3.0) - deprecated Replaced by {@link #TYPE_PROPERTY} in the JLS3 API.
83
	public static final ChildPropertyDescriptor NAME_PROPERTY = 
82
	public static final ChildPropertyDescriptor NAME_PROPERTY = 
84
		new ChildPropertyDescriptor(ClassInstanceCreation.class, "name", Name.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$
83
		new ChildPropertyDescriptor(ClassInstanceCreation.class, "name", Name.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$
85
84
86
	/**
85
	/**
87
	 * The "type" structural property of this node type (added in JLS3 API).
86
	 * The "type" structural property of this node type (added in JLS3 API).
88
	 * @since 3.0
87
	 * @since 3.1
89
	 */
88
	 */
90
	public static final ChildPropertyDescriptor TYPE_PROPERTY = 
89
	public static final ChildPropertyDescriptor TYPE_PROPERTY = 
91
		new ChildPropertyDescriptor(ClassInstanceCreation.class, "type", Type.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$
90
		new ChildPropertyDescriptor(ClassInstanceCreation.class, "type", Type.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$
Lines 116-122 Link Here
116
	 * A list of property descriptors (element type: 
115
	 * A list of property descriptors (element type: 
117
	 * {@link StructuralPropertyDescriptor}),
116
	 * {@link StructuralPropertyDescriptor}),
118
	 * or null if uninitialized.
117
	 * or null if uninitialized.
119
	 * @since 3.0
118
	 * @since 3.1
120
	 */
119
	 */
121
	private static final List PROPERTY_DESCRIPTORS_3_0;
120
	private static final List PROPERTY_DESCRIPTORS_3_0;
122
	
121
	
Lines 151-157 Link Here
151
	 * @since 3.0
150
	 * @since 3.0
152
	 */
151
	 */
153
	public static List propertyDescriptors(int apiLevel) {
152
	public static List propertyDescriptors(int apiLevel) {
154
		if (apiLevel == AST.JLS2) {
153
		if (apiLevel == AST.JLS2_INTERNAL) {
155
			return PROPERTY_DESCRIPTORS_2_0;
154
			return PROPERTY_DESCRIPTORS_2_0;
156
		} else {
155
		} else {
157
			return PROPERTY_DESCRIPTORS_3_0;
156
			return PROPERTY_DESCRIPTORS_3_0;
Lines 167-173 Link Here
167
	 * The type arguments (element type: <code>Type</code>). 
166
	 * The type arguments (element type: <code>Type</code>). 
168
	 * Null in JLS2. Added in JLS3; defaults to an empty list
167
	 * Null in JLS2. Added in JLS3; defaults to an empty list
169
	 * (see constructor).
168
	 * (see constructor).
170
	 * @since 3.0
169
	 * @since 3.1
171
	 */
170
	 */
172
	private ASTNode.NodeList typeArguments = null;
171
	private ASTNode.NodeList typeArguments = null;
173
172
Lines 294-300 Link Here
294
		result.setSourceRange(this.getStartPosition(), this.getLength());
293
		result.setSourceRange(this.getStartPosition(), this.getLength());
295
		result.setExpression(
294
		result.setExpression(
296
			(Expression) ASTNode.copySubtree(target, getExpression()));
295
			(Expression) ASTNode.copySubtree(target, getExpression()));
297
		if (this.ast.apiLevel == AST.JLS2) {
296
		if (this.ast.apiLevel == AST.JLS2_INTERNAL) {
298
			result.setName((Name) getName().clone(target));
297
			result.setName((Name) getName().clone(target));
299
		}
298
		}
300
		if (this.ast.apiLevel >= AST.JLS3) {
299
		if (this.ast.apiLevel >= AST.JLS3) {
Lines 324-330 Link Here
324
		if (visitChildren) {
323
		if (visitChildren) {
325
			// visit children in normal left to right reading order
324
			// visit children in normal left to right reading order
326
			acceptChild(visitor, getExpression());
325
			acceptChild(visitor, getExpression());
327
			if (this.ast.apiLevel == AST.JLS2) {
326
			if (this.ast.apiLevel == AST.JLS2_INTERNAL) {
328
				acceptChild(visitor, getName());
327
				acceptChild(visitor, getName());
329
			}
328
			}
330
			if (this.ast.apiLevel >= AST.JLS3) {
329
			if (this.ast.apiLevel >= AST.JLS3) {
Lines 371-388 Link Here
371
	/**
370
	/**
372
	 * Returns the live ordered list of type arguments of this class
371
	 * Returns the live ordered list of type arguments of this class
373
	 * instance creation (added in JLS3 API).
372
	 * instance creation (added in JLS3 API).
374
	 * <p>
375
	 * Note: This API element is only needed for dealing with Java code that uses
376
	 * new language features of J2SE 1.5. It is included in anticipation of J2SE
377
	 * 1.5 support, which is planned for the next release of Eclipse after 3.0, and
378
	 * may change slightly before reaching its final form.
379
	 * </p>
380
	 * 
373
	 * 
381
	 * @return the live list of type arguments
374
	 * @return the live list of type arguments
382
	 *    (element type: <code>Type</code>)
375
	 *    (element type: <code>Type</code>)
383
	 * @exception UnsupportedOperationException if this operation is used in
376
	 * @exception UnsupportedOperationException if this operation is used in
384
	 * a JLS2 AST
377
	 * a JLS2 AST
385
	 * @since 3.0
378
	 * @since 3.1
386
	 */ 
379
	 */ 
387
	public List typeArguments() {
380
	public List typeArguments() {
388
		// more efficient than just calling unsupportedIn2() to check
381
		// more efficient than just calling unsupportedIn2() to check
Lines 399-407 Link Here
399
	 * @return the type name node
392
	 * @return the type name node
400
	 * @exception UnsupportedOperationException if this operation is used in
393
	 * @exception UnsupportedOperationException if this operation is used in
401
	 * an AST later than JLS2
394
	 * an AST later than JLS2
395
	 * @deprecated In the JLS3 API, this method is replaced by
396
	 * {@link #getType()}, which returns a <code>Type</code> instead of a
397
	 * <code>Name</code>.
402
	 */ 
398
	 */ 
403
	// TODO (jeem) When JLS3 support is complete (post 3.0) - deprecated In the JLS3 API, this method is replaced by <code>getType</code>, which returns a <code>Type</code> instead of a <code>Name</code>.
404
	public Name getName() {
399
	public Name getName() {
400
		return internalGetName();
401
	}
402
403
	/**
404
	 * Internal synonym for deprecated method. Used to avoid
405
	 * deprecation warnings.
406
	 * @since 3.1
407
	 */
408
	/*package*/ Name internalGetName() {
405
	    supportedOnlyIn2();
409
	    supportedOnlyIn2();
406
		if (this.typeName == null) {
410
		if (this.typeName == null) {
407
			// lazy init must be thread-safe for readers
411
			// lazy init must be thread-safe for readers
Lines 428-436 Link Here
428
	 * </ul>
432
	 * </ul>
429
	 * @exception UnsupportedOperationException if this operation is used in
433
	 * @exception UnsupportedOperationException if this operation is used in
430
	 * an AST later than JLS2
434
	 * an AST later than JLS2
435
	 * @deprecated In the JLS3 API, this method is replaced by 
436
	 * {@link #setType(Type)}, which expects a <code>Type</code> instead of
437
	 * a <code>Name</code>.
431
	 */ 
438
	 */ 
432
	// TODO (jeem) When JLS3 support is complete (post 3.0) - deprecated In the JLS3 API, this method is replaced by <code>setType</code>, which expects a <code>Type</code> instead of a <code>Name</code>.
433
	public void setName(Name name) {
439
	public void setName(Name name) {
440
		internalSetName(name);
441
	}
442
443
	/**
444
	 * Internal synonym for deprecated method. Used to avoid
445
	 * deprecation warnings.
446
	 * @since 3.1
447
	 */
448
	/*package*/ public void internalSetName(Name name) {
434
	    supportedOnlyIn2();
449
	    supportedOnlyIn2();
435
		if (name == null) {
450
		if (name == null) {
436
			throw new IllegalArgumentException();
451
			throw new IllegalArgumentException();
Lines 448-454 Link Here
448
	 * @return the type node
463
	 * @return the type node
449
	 * @exception UnsupportedOperationException if this operation is used in
464
	 * @exception UnsupportedOperationException if this operation is used in
450
	 * a JLS2 AST
465
	 * a JLS2 AST
451
	 * @since 3.0
466
	 * @since 3.1
452
	 */ 
467
	 */ 
453
	public Type getType() {
468
	public Type getType() {
454
	    unsupportedIn2();
469
	    unsupportedIn2();
Lines 477-483 Link Here
477
	 * </ul>
492
	 * </ul>
478
	 * @exception UnsupportedOperationException if this operation is used in
493
	 * @exception UnsupportedOperationException if this operation is used in
479
	 * a JLS2 AST
494
	 * a JLS2 AST
480
	 * @since 3.0
495
	 * @since 3.1
481
	 */ 
496
	 */ 
482
	public void setType(Type type) {
497
	public void setType(Type type) {
483
	    unsupportedIn2();
498
	    unsupportedIn2();
(-)dom/org/eclipse/jdt/core/dom/CompilationUnit.java (-1 / +1 lines)
Lines 348-354 Link Here
348
	 * compilation unit, in order of appearance.
348
	 * compilation unit, in order of appearance.
349
     * <p>
349
     * <p>
350
     * Note that in JLS3, the types may include both enum declarations
350
     * Note that in JLS3, the types may include both enum declarations
351
     * and annotation type declarations introduced in J2SE 1.5.
351
     * and annotation type declarations introduced in J2SE 5.
352
     * For JLS2, the elements are always <code>TypeDeclaration</code>.
352
     * For JLS2, the elements are always <code>TypeDeclaration</code>.
353
     * </p>
353
     * </p>
354
	 * 
354
	 * 
(-)dom/org/eclipse/jdt/core/dom/ConstructorInvocation.java (-12 / +6 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2004 IBM Corporation and others.
2
 * Copyright (c) 2000, 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 34-40 Link Here
34
	
34
	
35
	/**
35
	/**
36
	 * The "typeArguments" structural property of this node type (added in JLS3 API).
36
	 * The "typeArguments" structural property of this node type (added in JLS3 API).
37
	 * @since 3.0
37
	 * @since 3.1
38
	 */
38
	 */
39
	public static final ChildListPropertyDescriptor TYPE_ARGUMENTS_PROPERTY = 
39
	public static final ChildListPropertyDescriptor TYPE_ARGUMENTS_PROPERTY = 
40
		new ChildListPropertyDescriptor(ConstructorInvocation.class, "typeArguments", Type.class, NO_CYCLE_RISK); //$NON-NLS-1$
40
		new ChildListPropertyDescriptor(ConstructorInvocation.class, "typeArguments", Type.class, NO_CYCLE_RISK); //$NON-NLS-1$
Lines 58-64 Link Here
58
	 * A list of property descriptors (element type: 
58
	 * A list of property descriptors (element type: 
59
	 * {@link StructuralPropertyDescriptor}),
59
	 * {@link StructuralPropertyDescriptor}),
60
	 * or null if uninitialized.
60
	 * or null if uninitialized.
61
	 * @since 3.0
61
	 * @since 3.1
62
	 */
62
	 */
63
	private static final List PROPERTY_DESCRIPTORS_3_0;
63
	private static final List PROPERTY_DESCRIPTORS_3_0;
64
	
64
	
Lines 87-93 Link Here
87
	 * @since 3.0
87
	 * @since 3.0
88
	 */
88
	 */
89
	public static List propertyDescriptors(int apiLevel) {
89
	public static List propertyDescriptors(int apiLevel) {
90
		if (apiLevel == AST.JLS2) {
90
		if (apiLevel == AST.JLS2_INTERNAL) {
91
			return PROPERTY_DESCRIPTORS_2_0;
91
			return PROPERTY_DESCRIPTORS_2_0;
92
		} else {
92
		} else {
93
			return PROPERTY_DESCRIPTORS_3_0;
93
			return PROPERTY_DESCRIPTORS_3_0;
Lines 98-104 Link Here
98
	 * The type arguments (element type: <code>Type</code>). 
98
	 * The type arguments (element type: <code>Type</code>). 
99
	 * Null in JLS2. Added in JLS3; defaults to an empty list
99
	 * Null in JLS2. Added in JLS3; defaults to an empty list
100
	 * (see constructor).
100
	 * (see constructor).
101
	 * @since 3.0
101
	 * @since 3.1
102
	 */
102
	 */
103
	private ASTNode.NodeList typeArguments = null;
103
	private ASTNode.NodeList typeArguments = null;
104
104
Lines 189-206 Link Here
189
	/**
189
	/**
190
	 * Returns the live ordered list of type arguments of this constructor
190
	 * Returns the live ordered list of type arguments of this constructor
191
	 * invocation (added in JLS3 API).
191
	 * invocation (added in JLS3 API).
192
	 * <p>
193
	 * Note: This API element is only needed for dealing with Java code that uses
194
	 * new language features of J2SE 1.5. It is included in anticipation of J2SE
195
	 * 1.5 support, which is planned for the next release of Eclipse after 3.0, and
196
	 * may change slightly before reaching its final form.
197
	 * </p>
198
	 * 
192
	 * 
199
	 * @return the live list of type arguments
193
	 * @return the live list of type arguments
200
	 *    (element type: <code>Type</code>)
194
	 *    (element type: <code>Type</code>)
201
	 * @exception UnsupportedOperationException if this operation is used in
195
	 * @exception UnsupportedOperationException if this operation is used in
202
	 * a JLS2 AST
196
	 * a JLS2 AST
203
	 * @since 3.0
197
	 * @since 3.1
204
	 */ 
198
	 */ 
205
	public List typeArguments() {
199
	public List typeArguments() {
206
		// more efficient than just calling unsupportedIn2() to check
200
		// more efficient than just calling unsupportedIn2() to check
(-)dom/org/eclipse/jdt/core/dom/DocCommentParser.java (-1 / +1 lines)
Lines 62-68 Link Here
62
			commentParse(start, start+length-1);
62
			commentParse(start, start+length-1);
63
		}
63
		}
64
		this.docComment.setSourceRange(start, length);
64
		this.docComment.setSourceRange(start, length);
65
		if (this.ast.apiLevel == AST.JLS2) {
65
		if (this.ast.apiLevel == AST.JLS2_INTERNAL) {
66
			setComment(start, length);  // backward compatibility
66
			setComment(start, length);  // backward compatibility
67
		}
67
		}
68
		return this.docComment;
68
		return this.docComment;
(-)dom/org/eclipse/jdt/core/dom/EnhancedForStatement.java (-12 / +3 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2004 IBM Corporation and others.
2
 * Copyright (c) 2000, 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 24-56 Link Here
24
 * </pre>
24
 * </pre>
25
 * The FormalParameter is represented by a <code>SingleVariableDeclaration</code>
25
 * The FormalParameter is represented by a <code>SingleVariableDeclaration</code>
26
 * (without an initializer).
26
 * (without an initializer).
27
 * <p>
27
 * 
28
 * Note: This API element is only needed for dealing with Java code that uses
28
 * @since 3.1
29
 * new language features of J2SE 1.5. It is included in anticipation of J2SE
30
 * 1.5 support, which is planned for the next release of Eclipse after 3.0, and
31
 * may change slightly before reaching its final form.
32
 * </p>
33
 * @since 3.0
34
 */
29
 */
35
public class EnhancedForStatement extends Statement {
30
public class EnhancedForStatement extends Statement {
36
	
31
	
37
	/**
32
	/**
38
	 * The "parameter" structural property of this node type.
33
	 * The "parameter" structural property of this node type.
39
	 * @since 3.0
40
	 */
34
	 */
41
	public static final ChildPropertyDescriptor PARAMETER_PROPERTY = 
35
	public static final ChildPropertyDescriptor PARAMETER_PROPERTY = 
42
		new ChildPropertyDescriptor(EnhancedForStatement.class, "parameter", SingleVariableDeclaration.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$
36
		new ChildPropertyDescriptor(EnhancedForStatement.class, "parameter", SingleVariableDeclaration.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$
43
37
44
	/**
38
	/**
45
	 * The "expression" structural property of this node type.
39
	 * The "expression" structural property of this node type.
46
	 * @since 3.0
47
	 */
40
	 */
48
	public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = 
41
	public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = 
49
		new ChildPropertyDescriptor(EnhancedForStatement.class, "expression", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$
42
		new ChildPropertyDescriptor(EnhancedForStatement.class, "expression", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$
50
43
51
	/**
44
	/**
52
	 * The "body" structural property of this node type.
45
	 * The "body" structural property of this node type.
53
	 * @since 3.0
54
	 */
46
	 */
55
	public static final ChildPropertyDescriptor BODY_PROPERTY = 
47
	public static final ChildPropertyDescriptor BODY_PROPERTY = 
56
		new ChildPropertyDescriptor(EnhancedForStatement.class, "body", Statement.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$
48
		new ChildPropertyDescriptor(EnhancedForStatement.class, "body", Statement.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$
Lines 80-86 Link Here
80
72
81
	 * @return a list of property descriptors (element type: 
73
	 * @return a list of property descriptors (element type: 
82
	 * {@link StructuralPropertyDescriptor})
74
	 * {@link StructuralPropertyDescriptor})
83
	 * @since 3.0
84
	 */
75
	 */
85
	public static List propertyDescriptors(int apiLevel) {
76
	public static List propertyDescriptors(int apiLevel) {
86
		return PROPERTY_DESCRIPTORS;
77
		return PROPERTY_DESCRIPTORS;
(-)dom/org/eclipse/jdt/core/dom/EnumConstantDeclaration.java (-12 / +1 lines)
Lines 35-48 Link Here
35
 * arguments and no class body declarations, the source range extends through
35
 * arguments and no class body declarations, the source range extends through
36
 * the last character of the identifier.
36
 * the last character of the identifier.
37
 * </p>
37
 * </p>
38
 * <p>
39
 * Note: This API element is only needed for dealing with Java code that uses
40
 * new language features of J2SE 1.5. It is included in anticipation of J2SE
41
 * 1.5 support, which is planned for the next release of Eclipse after 3.0, and
42
 * may change slightly before reaching its final form.
43
 * </p>
44
 * 
38
 * 
45
 * @since 3.0
39
 * @since 3.1
46
 */
40
 */
47
public class EnumConstantDeclaration extends BodyDeclaration {
41
public class EnumConstantDeclaration extends BodyDeclaration {
48
	
42
	
Lines 80-86 Link Here
80
	
74
	
81
	/**
75
	/**
82
	 * The "anonymousClassDeclaration" structural property of this node type.
76
	 * The "anonymousClassDeclaration" structural property of this node type.
83
	 * @since 3.1
84
	 */
77
	 */
85
	public static final ChildPropertyDescriptor ANONYMOUS_CLASS_DECLARATION_PROPERTY = 
78
	public static final ChildPropertyDescriptor ANONYMOUS_CLASS_DECLARATION_PROPERTY = 
86
		new ChildPropertyDescriptor(EnumConstantDeclaration.class, "anonymousClassDeclaration", AnonymousClassDeclaration.class, OPTIONAL, CYCLE_RISK); //$NON-NLS-1$
79
		new ChildPropertyDescriptor(EnumConstantDeclaration.class, "anonymousClassDeclaration", AnonymousClassDeclaration.class, OPTIONAL, CYCLE_RISK); //$NON-NLS-1$
Lines 143-149 Link Here
143
	/**
136
	/**
144
	 * The optional anonymous class declaration; <code>null</code> for none; 
137
	 * The optional anonymous class declaration; <code>null</code> for none; 
145
	 * defaults to none.
138
	 * defaults to none.
146
	 * @since 3.1
147
	 */
139
	 */
148
	private AnonymousClassDeclaration optionalAnonymousClassDeclaration = null;
140
	private AnonymousClassDeclaration optionalAnonymousClassDeclaration = null;
149
	
141
	
Lines 373-379 Link Here
373
	 * enum constant declaration, if it has one.
365
	 * enum constant declaration, if it has one.
374
	 * 
366
	 * 
375
	 * @return the anonymous class declaration, or <code>null</code> if none
367
	 * @return the anonymous class declaration, or <code>null</code> if none
376
	 * @since 3.1
377
	 */ 
368
	 */ 
378
	public AnonymousClassDeclaration getAnonymousClassDeclaration() {
369
	public AnonymousClassDeclaration getAnonymousClassDeclaration() {
379
		return this.optionalAnonymousClassDeclaration;
370
		return this.optionalAnonymousClassDeclaration;
Lines 385-391 Link Here
385
	 * 
376
	 * 
386
	 * @param decl the anonymous class declaration, or <code>null</code> 
377
	 * @param decl the anonymous class declaration, or <code>null</code> 
387
	 *    if none
378
	 *    if none
388
	 * @since 3.1
389
	 */ 
379
	 */ 
390
	public void setAnonymousClassDeclaration(AnonymousClassDeclaration decl) {
380
	public void setAnonymousClassDeclaration(AnonymousClassDeclaration decl) {
391
		ASTNode oldChild = this.optionalAnonymousClassDeclaration;
381
		ASTNode oldChild = this.optionalAnonymousClassDeclaration;
Lines 404-410 Link Here
404
	 * 
394
	 * 
405
	 * @return the constructor binding, or <code>null</code> if the binding
395
	 * @return the constructor binding, or <code>null</code> if the binding
406
	 *    cannot be resolved
396
	 *    cannot be resolved
407
	 * @since 3.1
408
	 */	
397
	 */	
409
	public IMethodBinding resolveConstructorBinding() {
398
	public IMethodBinding resolveConstructorBinding() {
410
		return this.ast.getBindingResolver().resolveConstructor(this);
399
		return this.ast.getBindingResolver().resolveConstructor(this);
(-)dom/org/eclipse/jdt/core/dom/EnumDeclaration.java (-11 / +2 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2004 IBM Corporation and others.
2
 * Copyright (c) 2000, 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 38-51 Link Here
38
 * modifiers or annotations). The source range extends through the last
38
 * modifiers or annotations). The source range extends through the last
39
 * character of the "}" token following the body declarations.
39
 * character of the "}" token following the body declarations.
40
 * </p>
40
 * </p>
41
 * <p>
42
 * Note: This API element is only needed for dealing with Java code that uses
43
 * new language features of J2SE 1.5. It is included in anticipation of J2SE
44
 * 1.5 support, which is planned for the next release of Eclipse after 3.0, and
45
 * may change slightly before reaching its final form.
46
 * </p>
47
 * 
41
 * 
48
 * @since 3.0
42
 * @since 3.1
49
 */
43
 */
50
public class EnumDeclaration extends AbstractTypeDeclaration {
44
public class EnumDeclaration extends AbstractTypeDeclaration {
51
	
45
	
Lines 75-81 Link Here
75
	
69
	
76
	/**
70
	/**
77
	 * The "enumConstants" structural property of this node type.
71
	 * The "enumConstants" structural property of this node type.
78
	 * @since 3.1
79
	 */
72
	 */
80
	public static final ChildListPropertyDescriptor ENUM_CONSTANTS_PROPERTY = 
73
	public static final ChildListPropertyDescriptor ENUM_CONSTANTS_PROPERTY = 
81
		new ChildListPropertyDescriptor(EnumDeclaration.class, "enumConstants", EnumConstantDeclaration.class, CYCLE_RISK); //$NON-NLS-1$
74
		new ChildListPropertyDescriptor(EnumDeclaration.class, "enumConstants", EnumConstantDeclaration.class, CYCLE_RISK); //$NON-NLS-1$
Lines 130-136 Link Here
130
	 * The enum constant declarations
123
	 * The enum constant declarations
131
	 * (element type: <code>EnumConstantDeclaration</code>).
124
	 * (element type: <code>EnumConstantDeclaration</code>).
132
	 * Defaults to an empty list.
125
	 * Defaults to an empty list.
133
	 * @since 3.1
134
	 */
126
	 */
135
	private ASTNode.NodeList enumConstants = 
127
	private ASTNode.NodeList enumConstants = 
136
		new ASTNode.NodeList(ENUM_CONSTANTS_PROPERTY);
128
		new ASTNode.NodeList(ENUM_CONSTANTS_PROPERTY);
Lines 308-314 Link Here
308
	 * 
300
	 * 
309
	 * @return the live list of enum constant declarations
301
	 * @return the live list of enum constant declarations
310
	 *    (element type: {@link EnumConstantDeclaration})
302
	 *    (element type: {@link EnumConstantDeclaration})
311
	 * @since 3.1
312
	 */ 
303
	 */ 
313
	public List enumConstants() {
304
	public List enumConstants() {
314
		return enumConstants;
305
		return enumConstants;
(-)dom/org/eclipse/jdt/core/dom/FieldDeclaration.java (-7 / +6 lines)
Lines 48-60 Link Here
48
	 * The "modifiers" structural property of this node type (JLS2 API only).
48
	 * The "modifiers" structural property of this node type (JLS2 API only).
49
	 * @since 3.0
49
	 * @since 3.0
50
	 */
50
	 */
51
    // TODO (jeem) When JLS3 support is complete (post 3.0) - deprecated Replaced by {@link #MODIFIERS2_PROPERTY} in the JLS3 API.
52
	public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = 
51
	public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = 
53
		internalModifiersPropertyFactory(FieldDeclaration.class);
52
		internalModifiersPropertyFactory(FieldDeclaration.class);
54
	
53
	
55
	/**
54
	/**
56
	 * The "modifiers" structural property of this node type (added in JLS3 API).
55
	 * The "modifiers" structural property of this node type (added in JLS3 API).
57
	 * @since 3.0
56
	 * @since 3.1
58
	 */
57
	 */
59
	public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = 
58
	public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = 
60
		internalModifiers2PropertyFactory(FieldDeclaration.class);
59
		internalModifiers2PropertyFactory(FieldDeclaration.class);
Lines 85-91 Link Here
85
	 * A list of property descriptors (element type: 
84
	 * A list of property descriptors (element type: 
86
	 * {@link StructuralPropertyDescriptor}),
85
	 * {@link StructuralPropertyDescriptor}),
87
	 * or null if uninitialized.
86
	 * or null if uninitialized.
88
	 * @since 3.0
87
	 * @since 3.1
89
	 */
88
	 */
90
	private static final List PROPERTY_DESCRIPTORS_3_0;
89
	private static final List PROPERTY_DESCRIPTORS_3_0;
91
	
90
	
Lines 119-125 Link Here
119
	 * @since 3.0
118
	 * @since 3.0
120
	 */
119
	 */
121
	public static List propertyDescriptors(int apiLevel) {
120
	public static List propertyDescriptors(int apiLevel) {
122
		if (apiLevel == AST.JLS2) {
121
		if (apiLevel == AST.JLS2_INTERNAL) {
123
			return PROPERTY_DESCRIPTORS_2_0;
122
			return PROPERTY_DESCRIPTORS_2_0;
124
		} else {
123
		} else {
125
			return PROPERTY_DESCRIPTORS_3_0;
124
			return PROPERTY_DESCRIPTORS_3_0;
Lines 170-176 Link Here
170
			if (get) {
169
			if (get) {
171
				return getModifiers();
170
				return getModifiers();
172
			} else {
171
			} else {
173
				setModifiers(value);
172
				internalSetModifiers(value);
174
				return 0;
173
				return 0;
175
			}
174
			}
176
		}
175
		}
Lines 252-259 Link Here
252
		result.setSourceRange(this.getStartPosition(), this.getLength());
251
		result.setSourceRange(this.getStartPosition(), this.getLength());
253
		result.setJavadoc(
252
		result.setJavadoc(
254
			(Javadoc) ASTNode.copySubtree(target, getJavadoc()));
253
			(Javadoc) ASTNode.copySubtree(target, getJavadoc()));
255
		if (this.ast.apiLevel == AST.JLS2) {
254
		if (this.ast.apiLevel == AST.JLS2_INTERNAL) {
256
			result.setModifiers(getModifiers());
255
			result.internalSetModifiers(getModifiers());
257
		}
256
		}
258
		if (this.ast.apiLevel >= AST.JLS3) {
257
		if (this.ast.apiLevel >= AST.JLS3) {
259
			result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers()));
258
			result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers()));
(-)dom/org/eclipse/jdt/core/dom/IBinding.java (-1 / +1 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2004 IBM Corporation and others.
2
 * Copyright (c) 2000, 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
(-)dom/org/eclipse/jdt/core/dom/IExtendedModifier.java (-2 / +2 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2004 IBM Corporation and others.
2
 * Copyright (c) 2004, 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 18-24 Link Here
18
 *   Modifier
18
 *   Modifier
19
 *   Annotation
19
 *   Annotation
20
 * </pre>
20
 * </pre>
21
 * @since 3.0
21
 * @since 3.1
22
 */
22
 */
23
public interface IExtendedModifier {
23
public interface IExtendedModifier {
24
	
24
	
(-)dom/org/eclipse/jdt/core/dom/IMethodBinding.java (-25 / +1 lines)
Lines 138-152 Link Here
138
	 * parameters (they instead have non-empty type arguments
138
	 * parameters (they instead have non-empty type arguments
139
	 * and non-trivial erasure).
139
	 * and non-trivial erasure).
140
	 * </p>
140
	 * </p>
141
	 * <p>
142
	 * Note: Support for new language features proposed for the upcoming 1.5
143
	 * release of J2SE is tentative and subject to change.
144
	 * </p>
145
	 *
141
	 *
146
	 * @return the list of binding for the type variables for the type
142
	 * @return the list of binding for the type variables for the type
147
	 * parameters of this method, or otherwise the empty list
143
	 * parameters of this method, or otherwise the empty list
148
	 * @see ITypeBinding#isTypeVariable()
144
	 * @see ITypeBinding#isTypeVariable()
149
	 * @since 3.0
145
	 * @since 3.1
150
	 */
146
	 */
151
	public ITypeBinding[] getTypeParameters();
147
	public ITypeBinding[] getTypeParameters();
152
	
148
	
Lines 166-175 Link Here
166
	 * {@link #isParameterizedMethod()},
162
	 * {@link #isParameterizedMethod()},
167
	 * and {@link #isRawMethod()} are mutually exclusive.
163
	 * and {@link #isRawMethod()} are mutually exclusive.
168
	 * </p>
164
	 * </p>
169
	 * <p>
170
	 * Note: Support for new language features of the 1.5
171
	 * release of J2SE is tentative and subject to change.
172
	 * </p>
173
	 *
165
	 *
174
	 * @return <code>true</code> if this method binding represents a 
166
	 * @return <code>true</code> if this method binding represents a 
175
	 * declaration of a generic method, and <code>false</code> otherwise
167
	 * declaration of a generic method, and <code>false</code> otherwise
Lines 186-195 Link Here
186
	 * {@link #isParameterizedMethod()},
178
	 * {@link #isParameterizedMethod()},
187
	 * and {@link #isRawMethod()} are mutually exclusive.
179
	 * and {@link #isRawMethod()} are mutually exclusive.
188
	 * </p>
180
	 * </p>
189
	 * <p>
190
	 * Note: Support for new language features proposed for the upcoming 1.5
191
	 * release of J2SE is tentative and subject to change.
192
	 * </p>
193
	 *
181
	 *
194
	 * @return <code>true</code> if this method binding represents a 
182
	 * @return <code>true</code> if this method binding represents a 
195
	 * an instance of a generic method corresponding to a parameterized
183
	 * an instance of a generic method corresponding to a parameterized
Lines 210-219 Link Here
210
	 * which only occur on the method binding corresponding directly to the
198
	 * which only occur on the method binding corresponding directly to the
211
	 * declaration of a generic method.
199
	 * declaration of a generic method.
212
	 * </p> 
200
	 * </p> 
213
	 * <p>
214
	 * Note: Support for new language features proposed for the upcoming 1.5
215
	 * release of J2SE is tentative and subject to change.
216
	 * </p>
217
	 *
201
	 *
218
	 * @return the list of type bindings for the type arguments used to
202
	 * @return the list of type bindings for the type arguments used to
219
	 * instantiate the corrresponding generic method, or otherwise the empty list
203
	 * instantiate the corrresponding generic method, or otherwise the empty list
Lines 237-246 Link Here
237
	 * and raw methods ({@link #isRawMethod()}), this method returns the binding
221
	 * and raw methods ({@link #isRawMethod()}), this method returns the binding
238
	 * for the corresponding generic method. For other method bindings, this
222
	 * for the corresponding generic method. For other method bindings, this
239
	 * returns the same binding.
223
	 * returns the same binding.
240
	 * <p>
241
	 * Note: Support for new language features proposed for the upcoming 1.5
242
	 * release of J2SE is tentative and subject to change.
243
	 * </p>
244
	 *
224
	 *
245
	 * @return the method binding
225
	 * @return the method binding
246
	 * @since 3.1
226
	 * @since 3.1
Lines 261-270 Link Here
261
	 * Note that {@link #isGenericMethod()},
241
	 * Note that {@link #isGenericMethod()},
262
	 * {@link #isParameterizedMethod()},
242
	 * {@link #isParameterizedMethod()},
263
	 * and {@link #isRawMethod()} are mutually exclusive.
243
	 * and {@link #isRawMethod()} are mutually exclusive.
264
	 * </p>
265
	 * <p>
266
	 * Note: Support for new language features proposed for the upcoming 1.5
267
	 * release of J2SE is tentative and subject to change.
268
	 * </p>
244
	 * </p>
269
	 *
245
	 *
270
	 * @return <code>true</code> if this method binding represents a 
246
	 * @return <code>true</code> if this method binding represents a 
(-)dom/org/eclipse/jdt/core/dom/ITypeBinding.java (-68 / +12 lines)
Lines 40-49 Link Here
40
 * <p>
40
 * <p>
41
 * This interface is not intended to be implemented by clients.
41
 * This interface is not intended to be implemented by clients.
42
 * </p>
42
 * </p>
43
 * <p>
44
 * Note: Support for new language features proposed for the upcoming 1.5
45
 * release of J2SE is tentative and subject to change.
46
 * </p>
47
 * 
43
 * 
48
 * @see ITypeBinding#getDeclaredTypes()
44
 * @see ITypeBinding#getDeclaredTypes()
49
 * @since 2.0
45
 * @since 2.0
Lines 165-178 Link Here
165
	
161
	
166
	/**
162
	/**
167
	 * Returns whether this type binding represents an enum type.
163
	 * Returns whether this type binding represents an enum type.
168
	 * <p>
169
	 * Note: Support for new language features proposed for the upcoming 1.5
170
	 * release of J2SE is tentative and subject to change.
171
	 * </p>
172
	 *
164
	 *
173
	 * @return <code>true</code> if this object represents an enum type,
165
	 * @return <code>true</code> if this object represents an enum type,
174
	 *    and <code>false</code> otherwise
166
	 *    and <code>false</code> otherwise
175
	 * @since 3.0
167
	 * @since 3.1
176
	 */
168
	 */
177
	public boolean isEnum();
169
	public boolean isEnum();
178
	
170
	
Lines 181-194 Link Here
181
	 * <p>
173
	 * <p>
182
	 * Note that an annotation type is always an interface.
174
	 * Note that an annotation type is always an interface.
183
	 * </p>
175
	 * </p>
184
	 * <p>
185
	 * Note: Support for new language features proposed for the upcoming 1.5
186
	 * release of J2SE is tentative and subject to change.
187
	 * </p>
188
	 *
176
	 *
189
	 * @return <code>true</code> if this object represents an annotation type,
177
	 * @return <code>true</code> if this object represents an annotation type,
190
	 *    and <code>false</code> otherwise
178
	 *    and <code>false</code> otherwise
191
	 * @since 3.0
179
	 * @since 3.1
192
	 */
180
	 */
193
	public boolean isAnnotation();
181
	public boolean isAnnotation();
194
	
182
	
Lines 201-215 Link Here
201
	 * type do not carry type parameters (they instead have non-empty type arguments
189
	 * type do not carry type parameters (they instead have non-empty type arguments
202
	 * and non-trivial erasure).
190
	 * and non-trivial erasure).
203
	 * </p> 
191
	 * </p> 
204
	 * <p>
205
	 * Note: Support for new language features proposed for the upcoming 1.5
206
	 * release of J2SE is tentative and subject to change.
207
	 * </p>
208
	 *
192
	 *
209
	 * @return the list of binding for the type variables for the type
193
	 * @return the list of binding for the type variables for the type
210
	 * parameters of this type, or otherwise the empty list
194
	 * parameters of this type, or otherwise the empty list
211
	 * @see #isTypeVariable()
195
	 * @see #isTypeVariable()
212
	 * @since 3.0
196
	 * @since 3.1
213
	 */
197
	 */
214
	// TODO (jeem) - clarify whether binding for a generic type instance carries a copy of the generic type's type parameters as well as type arguments
198
	// TODO (jeem) - clarify whether binding for a generic type instance carries a copy of the generic type's type parameters as well as type arguments
215
	public ITypeBinding[] getTypeParameters();
199
	public ITypeBinding[] getTypeParameters();
Lines 230-239 Link Here
230
	 * {@link #isParameterizedType()},
214
	 * {@link #isParameterizedType()},
231
	 * and {@link #isRawType()} are mutually exclusive.
215
	 * and {@link #isRawType()} are mutually exclusive.
232
	 * </p>
216
	 * </p>
233
	 * <p>
234
	 * Note: Support for new language features of the 1.5
235
	 * release of J2SE is tentative and subject to change.
236
	 * </p>
237
	 *
217
	 *
238
	 * @return <code>true</code> if this type binding represents a 
218
	 * @return <code>true</code> if this type binding represents a 
239
	 * declaration of a generic class or interface, and <code>false</code> otherwise
219
	 * declaration of a generic class or interface, and <code>false</code> otherwise
Lines 245-274 Link Here
245
	/**
225
	/**
246
	 * Returns whether this type binding represents a type variable.
226
	 * Returns whether this type binding represents a type variable.
247
	 * Type variables bindings carry the type variable's bounds.
227
	 * Type variables bindings carry the type variable's bounds.
248
	 * <p>
249
	 * Note: Support for new language features proposed for the upcoming 1.5
250
	 * release of J2SE is tentative and subject to change.
251
	 * </p>
252
	 * 
228
	 * 
253
	 * @return <code>true</code> if this type binding is for a type variable,
229
	 * @return <code>true</code> if this type binding is for a type variable,
254
	 *   and <code>false</code> otherwise
230
	 *   and <code>false</code> otherwise
255
	 * @see #getName()
231
	 * @see #getName()
256
	 * @see #getTypeBounds()
232
	 * @see #getTypeBounds()
257
	 * @since 3.0
233
	 * @since 3.1
258
	 */
234
	 */
259
	public boolean isTypeVariable();
235
	public boolean isTypeVariable();
260
	
236
	
261
	/**
237
	/**
262
	 * Returns the type bounds of this type variable.
238
	 * Returns the type bounds of this type variable.
263
	 * <p>
264
	 * Note: Support for new language features proposed for the upcoming 1.5
265
	 * release of J2SE is tentative and subject to change.
266
	 * </p>
267
	 *
239
	 *
268
	 * @return the list of type bindings for this type variable, or otherwise
240
	 * @return the list of type bindings for this type variable, or otherwise
269
	 * the empty list
241
	 * the empty list
270
	 * @see #isTypeVariable()
242
	 * @see #isTypeVariable()
271
	 * @since 3.0
243
	 * @since 3.1
272
	 */
244
	 */
273
	public ITypeBinding[] getTypeBounds();
245
	public ITypeBinding[] getTypeBounds();
274
	
246
	
Lines 292-298 Link Here
292
	 * type reference, and <code>false</code> otherwise
264
	 * type reference, and <code>false</code> otherwise
293
	 * @see #getTypeArguments()
265
	 * @see #getTypeArguments()
294
	 * @see #getGenericType()
266
	 * @see #getGenericType()
295
	 * @since 3.0
267
	 * @since 3.1
296
	 */
268
	 */
297
	public boolean isParameterizedType();
269
	public boolean isParameterizedType();
298
	
270
	
Lines 308-317 Link Here
308
	 * type binding corresponding directly to the declaration of the 
280
	 * type binding corresponding directly to the declaration of the 
309
	 * generic class or interface (e.g., <code>Collection&lt;T&gt;</code>).
281
	 * generic class or interface (e.g., <code>Collection&lt;T&gt;</code>).
310
	 * </p> 
282
	 * </p> 
311
	 * <p>
312
	 * Note: Support for new language features proposed for the upcoming 1.5
313
	 * release of J2SE is tentative and subject to change.
314
	 * </p>
315
	 *
283
	 *
316
	 * @return the list of type bindings for the type arguments used to
284
	 * @return the list of type bindings for the type arguments used to
317
	 * instantiate the corrresponding generic type, or otherwise the empty list
285
	 * instantiate the corrresponding generic type, or otherwise the empty list
Lines 319-325 Link Here
319
	 * @see #isGenericType()
287
	 * @see #isGenericType()
320
	 * @see #isParameterizedType()
288
	 * @see #isParameterizedType()
321
	 * @see #isRawType()
289
	 * @see #isRawType()
322
	 * @since 3.0
290
	 * @since 3.1
323
	 */
291
	 */
324
	public ITypeBinding[] getTypeArguments();
292
	public ITypeBinding[] getTypeArguments();
325
	
293
	
Lines 339-351 Link Here
339
	 * if it has bounds and java.lang.Object if it does not.</li>
307
	 * if it has bounds and java.lang.Object if it does not.</li>
340
	 * <li>For all other type bindings - returns the identical binding.</li>
308
	 * <li>For all other type bindings - returns the identical binding.</li>
341
	 * </ul>
309
	 * </ul>
342
	 * <p>
343
	 * Note: Support for new language features proposed for the upcoming 1.5
344
	 * release of J2SE is tentative and subject to change.
345
	 * </p>
346
	 *
310
	 *
347
	 * @return the erasure type binding
311
	 * @return the erasure type binding
348
	 * @since 3.0
312
	 * @since 3.1
349
	 */
313
	 */
350
	public ITypeBinding getErasure();
314
	public ITypeBinding getErasure();
351
	
315
	
Lines 362-371 Link Here
362
	 * and raw types ({@link #isRawType()}), this method returns the binding
326
	 * and raw types ({@link #isRawType()}), this method returns the binding
363
	 * for the corresponding generic type. For other type bindings, this
327
	 * for the corresponding generic type. For other type bindings, this
364
	 * returns the same binding.
328
	 * returns the same binding.
365
	 * <p>
366
	 * Note: Support for new language features proposed for the upcoming 1.5
367
	 * release of J2SE is tentative and subject to change.
368
	 * </p>
369
	 *
329
	 *
370
	 * @return the type binding
330
	 * @return the type binding
371
	 * @since 3.1
331
	 * @since 3.1
Lines 390-406 Link Here
390
	 * {@link #isParameterizedType()},
350
	 * {@link #isParameterizedType()},
391
	 * and {@link #isRawType()} are mutually exclusive.
351
	 * and {@link #isRawType()} are mutually exclusive.
392
	 * </p>
352
	 * </p>
393
	 * <p>
394
	 * Note: Support for new language features proposed for the upcoming 1.5
395
	 * release of J2SE is tentative and subject to change.
396
	 * </p>
397
	 *
353
	 *
398
	 * @return <code>true</code> if this type binding represents a 
354
	 * @return <code>true</code> if this type binding represents a 
399
	 * an instance of a generic type corresponding to a raw
355
	 * an instance of a generic type corresponding to a raw
400
	 * type reference, and <code>false</code> otherwise
356
	 * type reference, and <code>false</code> otherwise
401
	 * @see #getGenericType()
357
	 * @see #getGenericType()
402
	 * @see #getTypeArguments()
358
	 * @see #getTypeArguments()
403
	 * @since 3.0
359
	 * @since 3.1
404
	 */
360
	 */
405
	public boolean isRawType();
361
	public boolean isRawType();
406
	
362
	
Lines 413-426 Link Here
413
	 * parameterized type binding whose type argument is a wildcard type
369
	 * parameterized type binding whose type argument is a wildcard type
414
	 * with upper type bound <code>java.util.Object/code>.
370
	 * with upper type bound <code>java.util.Object/code>.
415
	 * </p>
371
	 * </p>
416
	 * <p>
417
	 * Note: Support for new language features proposed for the upcoming 1.5
418
	 * release of J2SE is tentative and subject to change.
419
	 * </p>
420
	 *
372
	 *
421
	 * @return <code>true</code> if this object represents a wildcard type,
373
	 * @return <code>true</code> if this object represents a wildcard type,
422
	 *    and <code>false</code> otherwise
374
	 *    and <code>false</code> otherwise
423
	 * @since 3.0
375
	 * @since 3.1
424
	 * @see #getBound()
376
	 * @see #getBound()
425
	 * @see #isUpperbound()
377
	 * @see #isUpperbound()
426
	 */
378
	 */
Lines 429-443 Link Here
429
	/**
381
	/**
430
	 * Returns the bound of this wildcard type if it has one.
382
	 * Returns the bound of this wildcard type if it has one.
431
	 * Returns <code>null</code> if this is not a wildcard type.
383
	 * Returns <code>null</code> if this is not a wildcard type.
432
	 * <p>
433
	 * Note: Support for new language features proposed for the upcoming 1.5
434
	 * release of J2SE is tentative and subject to change.
435
	 * </p>
436
	 * 
384
	 * 
437
	 * @return the bound of this wildcard type, or <code>null</code> if none
385
	 * @return the bound of this wildcard type, or <code>null</code> if none
438
	 * @see #isWildcardType()
386
	 * @see #isWildcardType()
439
	 * @see #isUpperbound()
387
	 * @see #isUpperbound()
440
	 * @since 3.0
388
	 * @since 3.1
441
	 */
389
	 */
442
	public ITypeBinding getBound();
390
	public ITypeBinding getBound();
443
	
391
	
Lines 446-461 Link Here
446
	 * ("extends") as opposed to a lower bound ("super").
394
	 * ("extends") as opposed to a lower bound ("super").
447
	 * Note that this property is only relevant for wildcards
395
	 * Note that this property is only relevant for wildcards
448
	 * that have a bound.
396
	 * that have a bound.
449
	 * <p>
450
	 * Note: Support for new language features proposed for the upcoming 1.5
451
	 * release of J2SE is tentative and subject to change.
452
	 * </p>
453
	 *
397
	 *
454
	 * @return <code>true</code> if this wildcard type has a bound that is
398
	 * @return <code>true</code> if this wildcard type has a bound that is
455
	 * an upper bound, and <code>false</code> in all other cases
399
	 * an upper bound, and <code>false</code> in all other cases
456
	 * @see #isWildcardType()
400
	 * @see #isWildcardType()
457
	 * @see #getBound()
401
	 * @see #getBound()
458
	 * @since 3.0
402
	 * @since 3.1
459
	 */
403
	 */
460
	public boolean isUpperbound();
404
	public boolean isUpperbound();
461
	
405
	
(-)dom/org/eclipse/jdt/core/dom/ImportDeclaration.java (-18 / +6 lines)
Lines 47-53 Link Here
47
	
47
	
48
	/**
48
	/**
49
	 * The "static" structural property of this node type (added in JLS3 API).
49
	 * The "static" structural property of this node type (added in JLS3 API).
50
	 * @since 3.0
50
	 * @since 3.1
51
	 */
51
	 */
52
	public static final SimplePropertyDescriptor STATIC_PROPERTY = 
52
	public static final SimplePropertyDescriptor STATIC_PROPERTY = 
53
		new SimplePropertyDescriptor(ImportDeclaration.class, "static", boolean.class, MANDATORY); //$NON-NLS-1$
53
		new SimplePropertyDescriptor(ImportDeclaration.class, "static", boolean.class, MANDATORY); //$NON-NLS-1$
Lines 64-70 Link Here
64
	 * A list of property descriptors (element type: 
64
	 * A list of property descriptors (element type: 
65
	 * {@link StructuralPropertyDescriptor}),
65
	 * {@link StructuralPropertyDescriptor}),
66
	 * or null if uninitialized.
66
	 * or null if uninitialized.
67
	 * @since 3.0
67
	 * @since 3.1
68
	 */
68
	 */
69
	private static final List PROPERTY_DESCRIPTORS_3_0;
69
	private static final List PROPERTY_DESCRIPTORS_3_0;
70
	
70
	
Lines 95-101 Link Here
95
	 * @since 3.0
95
	 * @since 3.0
96
	 */
96
	 */
97
	public static List propertyDescriptors(int apiLevel) {
97
	public static List propertyDescriptors(int apiLevel) {
98
		if (apiLevel == AST.JLS2) {
98
		if (apiLevel == AST.JLS2_INTERNAL) {
99
			return PROPERTY_DESCRIPTORS_2_0;
99
			return PROPERTY_DESCRIPTORS_2_0;
100
		} else {
100
		} else {
101
			return PROPERTY_DESCRIPTORS_3_0;
101
			return PROPERTY_DESCRIPTORS_3_0;
Lines 116-122 Link Here
116
	/**
116
	/**
117
	 * Static versus regular; defaults to regular import.
117
	 * Static versus regular; defaults to regular import.
118
	 * Added in JLS3; not used in JLS2.
118
	 * Added in JLS3; not used in JLS2.
119
	 * @since 3.0
119
	 * @since 3.1
120
	 */
120
	 */
121
	private boolean isStatic = false;
121
	private boolean isStatic = false;
122
122
Lines 303-320 Link Here
303
	
303
	
304
	/**
304
	/**
305
	 * Returns whether this import declaration is a static import (added in JLS3 API).
305
	 * Returns whether this import declaration is a static import (added in JLS3 API).
306
	 * <p>
307
	 * Note: This API element is only needed for dealing with Java code that uses
308
	 * new language features of J2SE 1.5. It is included in anticipation of J2SE
309
	 * 1.5 support, which is planned for the next release of Eclipse after 3.0, and
310
	 * may change slightly before reaching its final form.
311
	 * </p>
312
	 * 
306
	 * 
313
	 * @return <code>true</code> if this is a static import,
307
	 * @return <code>true</code> if this is a static import,
314
	 *    and <code>false</code> if this is a regular import
308
	 *    and <code>false</code> if this is a regular import
315
	 * @exception UnsupportedOperationException if this operation is used in
309
	 * @exception UnsupportedOperationException if this operation is used in
316
	 * a JLS2 AST
310
	 * a JLS2 AST
317
	 * @since 3.0
311
	 * @since 3.1
318
	 */ 
312
	 */ 
319
	public boolean isStatic() {
313
	public boolean isStatic() {
320
		unsupportedIn2();
314
		unsupportedIn2();
Lines 323-340 Link Here
323
		
317
		
324
	/**
318
	/**
325
	 * Sets whether this import declaration is a static import (added in JLS3 API).
319
	 * Sets whether this import declaration is a static import (added in JLS3 API).
326
	 * <p>
327
	 * Note: This API element is only needed for dealing with Java code that uses
328
	 * new language features of J2SE 1.5. It is included in anticipation of J2SE
329
	 * 1.5 support, which is planned for the next release of Eclipse after 3.0, and
330
	 * may change slightly before reaching its final form.
331
	 * </p>
332
	 * 
320
	 * 
333
	 * @param isStatic <code>true</code> if this is a static import,
321
	 * @param isStatic <code>true</code> if this is a static import,
334
	 *    and <code>false</code> if this is a regular import
322
	 *    and <code>false</code> if this is a regular import
335
	 * @exception UnsupportedOperationException if this operation is used in
323
	 * @exception UnsupportedOperationException if this operation is used in
336
	 * a JLS2 AST
324
	 * a JLS2 AST
337
	 * @since 3.0
325
	 * @since 3.1
338
	 */ 
326
	 */ 
339
	public void setStatic(boolean isStatic) {
327
	public void setStatic(boolean isStatic) {
340
		unsupportedIn2();
328
		unsupportedIn2();
(-)dom/org/eclipse/jdt/core/dom/Initializer.java (-8 / +7 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2004 IBM Corporation and others.
2
 * Copyright (c) 2000, 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 36-48 Link Here
36
	 * The "modifiers" structural property of this node type (JLS2 API only).
36
	 * The "modifiers" structural property of this node type (JLS2 API only).
37
	 * @since 3.0
37
	 * @since 3.0
38
	 */
38
	 */
39
    // TODO (jeem) When JLS3 support is complete (post 3.0) - deprecated Replaced by {@link #MODIFIERS2_PROPERTY} in the JLS3 API.
40
	public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = 
39
	public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = 
41
		internalModifiersPropertyFactory(Initializer.class);
40
		internalModifiersPropertyFactory(Initializer.class);
42
	
41
	
43
	/**
42
	/**
44
	 * The "modifiers" structural property of this node type (added in JLS3 API).
43
	 * The "modifiers" structural property of this node type (added in JLS3 API).
45
	 * @since 3.0
44
	 * @since 3.1
46
	 */
45
	 */
47
	public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = 
46
	public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = 
48
		internalModifiers2PropertyFactory(Initializer.class);
47
		internalModifiers2PropertyFactory(Initializer.class);
Lines 66-72 Link Here
66
	 * A list of property descriptors (element type: 
65
	 * A list of property descriptors (element type: 
67
	 * {@link StructuralPropertyDescriptor}),
66
	 * {@link StructuralPropertyDescriptor}),
68
	 * or null if uninitialized.
67
	 * or null if uninitialized.
69
	 * @since 3.0
68
	 * @since 3.1
70
	 */
69
	 */
71
	private static final List PROPERTY_DESCRIPTORS_3_0;
70
	private static final List PROPERTY_DESCRIPTORS_3_0;
72
	
71
	
Lines 98-104 Link Here
98
	 * @since 3.0
97
	 * @since 3.0
99
	 */
98
	 */
100
	public static List propertyDescriptors(int apiLevel) {
99
	public static List propertyDescriptors(int apiLevel) {
101
		if (apiLevel == AST.JLS2) {
100
		if (apiLevel == AST.JLS2_INTERNAL) {
102
			return PROPERTY_DESCRIPTORS_2_0;
101
			return PROPERTY_DESCRIPTORS_2_0;
103
		} else {
102
		} else {
104
			return PROPERTY_DESCRIPTORS_3_0;
103
			return PROPERTY_DESCRIPTORS_3_0;
Lines 140-146 Link Here
140
			if (get) {
139
			if (get) {
141
				return getModifiers();
140
				return getModifiers();
142
			} else {
141
			} else {
143
				setModifiers(value);
142
				internalSetModifiers(value);
144
				return 0;
143
				return 0;
145
			}
144
			}
146
		}
145
		}
Lines 217-224 Link Here
217
	ASTNode clone0(AST target) {
216
	ASTNode clone0(AST target) {
218
		Initializer result = new Initializer(target);
217
		Initializer result = new Initializer(target);
219
		result.setSourceRange(this.getStartPosition(), this.getLength());
218
		result.setSourceRange(this.getStartPosition(), this.getLength());
220
		if (this.ast.apiLevel == AST.JLS2) {
219
		if (this.ast.apiLevel == AST.JLS2_INTERNAL) {
221
			result.setModifiers(getModifiers());
220
			result.internalSetModifiers(getModifiers());
222
		}
221
		}
223
		if (this.ast.apiLevel >= AST.JLS3) {
222
		if (this.ast.apiLevel >= AST.JLS3) {
224
			result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers()));
223
			result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers()));
(-)dom/org/eclipse/jdt/core/dom/Javadoc.java (-6 / +6 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2004 IBM Corporation and others.
2
 * Copyright (c) 2000, 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 32-45 Link Here
32
	/**
32
	/**
33
	 * The "comment" structural property of this node type (JLS2 API only).
33
	 * The "comment" structural property of this node type (JLS2 API only).
34
	 * @since 3.0
34
	 * @since 3.0
35
	 * @deprecated Replaced by {@link #TAGS_PROPERTY} in the JLS3 API.
35
	 */
36
	 */
36
	// TODO (jeem) When JLS3 support is complete (post 3.0) - deprecated Replaced by {@link #TAGS_PROPERTY} in the JLS3 API.
37
	public static final SimplePropertyDescriptor COMMENT_PROPERTY = 
37
	public static final SimplePropertyDescriptor COMMENT_PROPERTY = 
38
		new SimplePropertyDescriptor(Javadoc.class, "comment", String.class, MANDATORY); //$NON-NLS-1$
38
		new SimplePropertyDescriptor(Javadoc.class, "comment", String.class, MANDATORY); //$NON-NLS-1$
39
	
39
	
40
	/**
40
	/**
41
	 * The "tags" structural property of this node type.
41
	 * The "tags" structural property of this node type.
42
	 * @since 3.0
42
	 * @since 3.1
43
	 */
43
	 */
44
	public static final ChildListPropertyDescriptor TAGS_PROPERTY = 
44
	public static final ChildListPropertyDescriptor TAGS_PROPERTY = 
45
		new ChildListPropertyDescriptor(Javadoc.class, "tags", TagElement.class, CYCLE_RISK); //$NON-NLS-1$
45
		new ChildListPropertyDescriptor(Javadoc.class, "tags", TagElement.class, CYCLE_RISK); //$NON-NLS-1$
Lines 57-63 Link Here
57
	 * A list of property descriptors (element type: 
57
	 * A list of property descriptors (element type: 
58
	 * {@link StructuralPropertyDescriptor}),
58
	 * {@link StructuralPropertyDescriptor}),
59
	 * or null if uninitialized.
59
	 * or null if uninitialized.
60
	 * @since 3.0
60
	 * @since 3.1
61
	 */
61
	 */
62
	private static final List PROPERTY_DESCRIPTORS_3_0;
62
	private static final List PROPERTY_DESCRIPTORS_3_0;
63
	
63
	
Lines 85-91 Link Here
85
	 * @since 3.0
85
	 * @since 3.0
86
	 */
86
	 */
87
	public static List propertyDescriptors(int apiLevel) {
87
	public static List propertyDescriptors(int apiLevel) {
88
		if (apiLevel == AST.JLS2) {
88
		if (apiLevel == AST.JLS2_INTERNAL) {
89
			return PROPERTY_DESCRIPTORS_2_0;
89
			return PROPERTY_DESCRIPTORS_2_0;
90
		} else {
90
		} else {
91
			return PROPERTY_DESCRIPTORS_3_0;
91
			return PROPERTY_DESCRIPTORS_3_0;
Lines 178-184 Link Here
178
	ASTNode clone0(AST target) {
178
	ASTNode clone0(AST target) {
179
		Javadoc result = new Javadoc(target);
179
		Javadoc result = new Javadoc(target);
180
		result.setSourceRange(this.getStartPosition(), this.getLength());
180
		result.setSourceRange(this.getStartPosition(), this.getLength());
181
		if (this.ast.apiLevel == AST.JLS2) {
181
		if (this.ast.apiLevel == AST.JLS2_INTERNAL) {
182
			result.setComment(getComment());
182
			result.setComment(getComment());
183
		}
183
		}
184
		result.tags().addAll(ASTNode.copySubtrees(target, tags()));
184
		result.tags().addAll(ASTNode.copySubtrees(target, tags()));
(-)dom/org/eclipse/jdt/core/dom/MarkerAnnotation.java (-12 / +3 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2004 IBM Corporation and others.
2
 * Copyright (c) 2004, 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 22-40 Link Here
22
 *   <b>@</b> TypeName
22
 *   <b>@</b> TypeName
23
 * </pre>
23
 * </pre>
24
 * </p>
24
 * </p>
25
 * <p>
25
 * 
26
 * Note: This API element is only needed for dealing with Java code that uses
26
 * @since 3.1
27
 * new language features of J2SE 1.5. It is included in anticipation of J2SE
28
 * 1.5 support, which is planned for the next release of Eclipse after 3.0, and
29
 * may change slightly before reaching its final form.
30
 * </p>
31
 * @since 3.0
32
 */
27
 */
33
public final class MarkerAnnotation extends Annotation {
28
public final class MarkerAnnotation extends Annotation {
34
29
35
	/**
30
	/**
36
	 * The "typeName" structural property of this node type.
31
	 * The "typeName" structural property of this node type.
37
	 * @since 3.0
38
	 */
32
	 */
39
	public static final ChildPropertyDescriptor TYPE_NAME_PROPERTY = 
33
	public static final ChildPropertyDescriptor TYPE_NAME_PROPERTY = 
40
		internalTypeNamePropertyFactory(MarkerAnnotation.class);
34
		internalTypeNamePropertyFactory(MarkerAnnotation.class);
Lines 43-49 Link Here
43
	 * A list of property descriptors (element type: 
37
	 * A list of property descriptors (element type: 
44
	 * {@link StructuralPropertyDescriptor}),
38
	 * {@link StructuralPropertyDescriptor}),
45
	 * or null if uninitialized.
39
	 * or null if uninitialized.
46
	 * @since 3.0
47
	 */
40
	 */
48
	private static final List PROPERTY_DESCRIPTORS;
41
	private static final List PROPERTY_DESCRIPTORS;
49
	
42
	
Lines 61-67 Link Here
61
	 * @param apiLevel the API level; one of the AST.JLS* constants
54
	 * @param apiLevel the API level; one of the AST.JLS* constants
62
	 * @return a list of property descriptors (element type: 
55
	 * @return a list of property descriptors (element type: 
63
	 * {@link StructuralPropertyDescriptor})
56
	 * {@link StructuralPropertyDescriptor})
64
	 * @since 3.0
65
	 */
57
	 */
66
	public static List propertyDescriptors(int apiLevel) {
58
	public static List propertyDescriptors(int apiLevel) {
67
		return PROPERTY_DESCRIPTORS;
59
		return PROPERTY_DESCRIPTORS;
Lines 84-90 Link Here
84
76
85
	/* (omit javadoc for this method)
77
	/* (omit javadoc for this method)
86
	 * Method declared on ASTNode.
78
	 * Method declared on ASTNode.
87
	 * @since 3.0
88
	 */
79
	 */
89
	final List internalStructuralPropertiesForType(int apiLevel) {
80
	final List internalStructuralPropertiesForType(int apiLevel) {
90
		return propertyDescriptors(apiLevel);
81
		return propertyDescriptors(apiLevel);
(-)dom/org/eclipse/jdt/core/dom/MemberValuePair.java (-10 / +3 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2004 IBM Corporation and others.
2
 * Copyright (c) 2004, 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 24-50 Link Here
24
 * Within annotations, only certain kinds of expressions are meaningful,
24
 * Within annotations, only certain kinds of expressions are meaningful,
25
 * including other annotations.
25
 * including other annotations.
26
 * </p>
26
 * </p>
27
 * <p>
27
 *
28
 * Note: This API element is only needed for dealing with Java code that uses
29
 * new language features of J2SE 1.5. It is included in anticipation of J2SE
30
 * 1.5 support, which is planned for the next release of Eclipse after 3.0, and
31
 * may change slightly before reaching its final form.
32
 * </p>
33
 * @see NormalAnnotation
28
 * @see NormalAnnotation
34
 * @since 3.0
29
 * @since 3.1
35
 */
30
 */
36
public class MemberValuePair extends ASTNode {
31
public class MemberValuePair extends ASTNode {
37
	
32
	
38
	/**
33
	/**
39
	 * The "name" structural property of this node type.
34
	 * The "name" structural property of this node type.
40
	 * @since 3.0
41
	 */
35
	 */
42
	public static final ChildPropertyDescriptor NAME_PROPERTY = 
36
	public static final ChildPropertyDescriptor NAME_PROPERTY = 
43
		new ChildPropertyDescriptor(MemberValuePair.class, "name", SimpleName.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$
37
		new ChildPropertyDescriptor(MemberValuePair.class, "name", SimpleName.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$
44
38
45
	/**
39
	/**
46
	 * The "value" structural property of this node type.
40
	 * The "value" structural property of this node type.
47
	 * @since 3.0
48
	 */
41
	 */
49
	public static final ChildPropertyDescriptor VALUE_PROPERTY = 
42
	public static final ChildPropertyDescriptor VALUE_PROPERTY = 
50
		new ChildPropertyDescriptor(MemberValuePair.class, "value", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$
43
		new ChildPropertyDescriptor(MemberValuePair.class, "value", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$
(-)dom/org/eclipse/jdt/core/dom/MethodDeclaration.java (-32 / +38 lines)
Lines 75-87 Link Here
75
	 * The "modifiers" structural property of this node type (JLS2 API only).
75
	 * The "modifiers" structural property of this node type (JLS2 API only).
76
	 * @since 3.0
76
	 * @since 3.0
77
	 */
77
	 */
78
    // TODO (jeem) When JLS3 support is complete (post 3.0) - deprecated Replaced by {@link #MODIFIERS2_PROPERTY} in the JLS3 API.
79
	public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = 
78
	public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = 
80
		internalModifiersPropertyFactory(MethodDeclaration.class);
79
		internalModifiersPropertyFactory(MethodDeclaration.class);
81
	
80
	
82
	/**
81
	/**
83
	 * The "modifiers" structural property of this node type (added in JLS3 API).
82
	 * The "modifiers" structural property of this node type (added in JLS3 API).
84
	 * @since 3.0
83
	 * @since 3.1
85
	 */
84
	 */
86
	public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = 
85
	public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = 
87
		internalModifiers2PropertyFactory(MethodDeclaration.class);
86
		internalModifiers2PropertyFactory(MethodDeclaration.class);
Lines 104-116 Link Here
104
	 * The "returnType" structural property of this node type (JLS2 API only).
103
	 * The "returnType" structural property of this node type (JLS2 API only).
105
	 * @since 3.0
104
	 * @since 3.0
106
	 */
105
	 */
107
	// TODO (jeem) When JLS3 support is complete (post 3.0) - deprecated Replaced by {@link #RETURN_TYPE2_PROPERTY} in the JLS3 API.
108
	public static final ChildPropertyDescriptor RETURN_TYPE_PROPERTY = 
106
	public static final ChildPropertyDescriptor RETURN_TYPE_PROPERTY = 
109
		new ChildPropertyDescriptor(MethodDeclaration.class, "returnType", Type.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$
107
		new ChildPropertyDescriptor(MethodDeclaration.class, "returnType", Type.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$
110
108
111
	/**
109
	/**
112
	 * The "returnType2" structural property of this node type (added in JLS3 API).
110
	 * The "returnType2" structural property of this node type (added in JLS3 API).
113
	 * @since 3.0
111
	 * @since 3.1
114
	 */
112
	 */
115
	public static final ChildPropertyDescriptor RETURN_TYPE2_PROPERTY = 
113
	public static final ChildPropertyDescriptor RETURN_TYPE2_PROPERTY = 
116
		new ChildPropertyDescriptor(MethodDeclaration.class, "returnType2", Type.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$
114
		new ChildPropertyDescriptor(MethodDeclaration.class, "returnType2", Type.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$
Lines 124-130 Link Here
124
	
122
	
125
	/**
123
	/**
126
	 * The "typeParameters" structural property of this node type (added in JLS3 API).
124
	 * The "typeParameters" structural property of this node type (added in JLS3 API).
127
	 * @since 3.0
125
	 * @since 3.1
128
	 */
126
	 */
129
	public static final ChildListPropertyDescriptor TYPE_PARAMETERS_PROPERTY = 
127
	public static final ChildListPropertyDescriptor TYPE_PARAMETERS_PROPERTY = 
130
		new ChildListPropertyDescriptor(MethodDeclaration.class, "typeParameters", TypeParameter.class, NO_CYCLE_RISK); //$NON-NLS-1$
128
		new ChildListPropertyDescriptor(MethodDeclaration.class, "typeParameters", TypeParameter.class, NO_CYCLE_RISK); //$NON-NLS-1$
Lines 162-168 Link Here
162
	 * A list of property descriptors (element type: 
160
	 * A list of property descriptors (element type: 
163
	 * {@link StructuralPropertyDescriptor}),
161
	 * {@link StructuralPropertyDescriptor}),
164
	 * or null if uninitialized.
162
	 * or null if uninitialized.
165
	 * @since 3.0
163
	 * @since 3.1
166
	 */
164
	 */
167
	private static final List PROPERTY_DESCRIPTORS_3_0;
165
	private static final List PROPERTY_DESCRIPTORS_3_0;
168
	
166
	
Lines 205-211 Link Here
205
	 * @since 3.0
203
	 * @since 3.0
206
	 */
204
	 */
207
	public static List propertyDescriptors(int apiLevel) {
205
	public static List propertyDescriptors(int apiLevel) {
208
		if (apiLevel == AST.JLS2) {
206
		if (apiLevel == AST.JLS2_INTERNAL) {
209
			return PROPERTY_DESCRIPTORS_2_0;
207
			return PROPERTY_DESCRIPTORS_2_0;
210
		} else {
208
		} else {
211
			return PROPERTY_DESCRIPTORS_3_0;
209
			return PROPERTY_DESCRIPTORS_3_0;
Lines 242-248 Link Here
242
	
240
	
243
	/**
241
	/**
244
	 * Indicated whether the return type has been initialized.
242
	 * Indicated whether the return type has been initialized.
245
	 * @since 3.0
243
	 * @since 3.1
246
	 */
244
	 */
247
	private boolean returnType2Initialized = false;
245
	private boolean returnType2Initialized = false;
248
	
246
	
Lines 250-256 Link Here
250
	 * The type paramters (element type: <code>TypeParameter</code>). 
248
	 * The type paramters (element type: <code>TypeParameter</code>). 
251
	 * Null in JLS2. Added in JLS3; defaults to an empty list
249
	 * Null in JLS2. Added in JLS3; defaults to an empty list
252
	 * (see constructor).
250
	 * (see constructor).
253
	 * @since 3.0
251
	 * @since 3.1
254
	 */
252
	 */
255
	private ASTNode.NodeList typeParameters = null;
253
	private ASTNode.NodeList typeParameters = null;
256
254
Lines 313-319 Link Here
313
			if (get) {
311
			if (get) {
314
				return getModifiers();
312
				return getModifiers();
315
			} else {
313
			} else {
316
				setModifiers(value);
314
				internalSetModifiers(value);
317
				return 0;
315
				return 0;
318
			}
316
			}
319
		}
317
		}
Lines 449-456 Link Here
449
		result.setSourceRange(this.getStartPosition(), this.getLength());
447
		result.setSourceRange(this.getStartPosition(), this.getLength());
450
		result.setJavadoc(
448
		result.setJavadoc(
451
			(Javadoc) ASTNode.copySubtree(target, getJavadoc()));
449
			(Javadoc) ASTNode.copySubtree(target, getJavadoc()));
452
		if (this.ast.apiLevel == AST.JLS2) {
450
		if (this.ast.apiLevel == AST.JLS2_INTERNAL) {
453
			result.setModifiers(getModifiers());
451
			result.internalSetModifiers(getModifiers());
454
			result.setReturnType(
452
			result.setReturnType(
455
					(Type) ASTNode.copySubtree(target, getReturnType()));
453
					(Type) ASTNode.copySubtree(target, getReturnType()));
456
		}
454
		}
Lines 489-495 Link Here
489
		if (visitChildren) {
487
		if (visitChildren) {
490
			// visit children in normal left to right reading order
488
			// visit children in normal left to right reading order
491
			acceptChild(visitor, getJavadoc());
489
			acceptChild(visitor, getJavadoc());
492
			if (this.ast.apiLevel == AST.JLS2) {
490
			if (this.ast.apiLevel == AST.JLS2_INTERNAL) {
493
				acceptChild(visitor, getReturnType());
491
				acceptChild(visitor, getReturnType());
494
			} else {
492
			} else {
495
				acceptChildren(visitor, this.modifiers);
493
				acceptChildren(visitor, this.modifiers);
Lines 530-547 Link Here
530
	/**
528
	/**
531
	 * Returns the live ordered list of type parameters of this method
529
	 * Returns the live ordered list of type parameters of this method
532
	 * declaration (added in JLS3 API). This list is non-empty for parameterized methods.
530
	 * declaration (added in JLS3 API). This list is non-empty for parameterized methods.
533
	 * <p>
534
	 * Note: This API element is only needed for dealing with Java code that uses
535
	 * new language features of J2SE 1.5. It is included in anticipation of J2SE
536
	 * 1.5 support, which is planned for the next release of Eclipse after 3.0, and
537
	 * may change slightly before reaching its final form.
538
	 * </p>
539
	 * 
531
	 * 
540
	 * @return the live list of type parameters
532
	 * @return the live list of type parameters
541
	 *    (element type: <code>TypeParameter</code>)
533
	 *    (element type: <code>TypeParameter</code>)
542
	 * @exception UnsupportedOperationException if this operation is used in
534
	 * @exception UnsupportedOperationException if this operation is used in
543
	 * a JLS2 AST
535
	 * a JLS2 AST
544
	 * @since 3.0
536
	 * @since 3.1
545
	 */ 
537
	 */ 
546
	public List typeParameters() {
538
	public List typeParameters() {
547
		// more efficient than just calling unsupportedIn2() to check
539
		// more efficient than just calling unsupportedIn2() to check
Lines 609-627 Link Here
609
	 * Returns whether this method declaration declares a
601
	 * Returns whether this method declaration declares a
610
	 * variable arity method (added in JLS3 API). The convenience method checks
602
	 * variable arity method (added in JLS3 API). The convenience method checks
611
	 * whether the last parameter is so marked.
603
	 * whether the last parameter is so marked.
612
	 * <p>
613
	 * Note: This API element is only needed for dealing with Java code that uses
614
	 * new language features of J2SE 1.5. It is included in anticipation of J2SE
615
	 * 1.5 support, which is planned for the next release of Eclipse after 3.0, and
616
	 * may change slightly before reaching its final form.
617
	 * </p>
618
	 * 
604
	 * 
619
	 * @return <code>true</code> if this is a variable arity method declaration,
605
	 * @return <code>true</code> if this is a variable arity method declaration,
620
	 *    and <code>false</code> otherwise
606
	 *    and <code>false</code> otherwise
621
	 * @exception UnsupportedOperationException if this operation is used in
607
	 * @exception UnsupportedOperationException if this operation is used in
622
	 * a JLS2 AST
608
	 * a JLS2 AST
623
	 * @see SingleVariableDeclaration#isVarargs()
609
	 * @see SingleVariableDeclaration#isVarargs()
624
	 * @since 3.0
610
	 * @since 3.1
625
	 */ 
611
	 */ 
626
	public boolean isVarargs() {
612
	public boolean isVarargs() {
627
		// more efficient than just calling unsupportedIn2() to check
613
		// more efficient than just calling unsupportedIn2() to check
Lines 661-670 Link Here
661
	 * @return the return type, possibly the void primitive type
647
	 * @return the return type, possibly the void primitive type
662
	 * @exception UnsupportedOperationException if this operation is used in
648
	 * @exception UnsupportedOperationException if this operation is used in
663
	 * an AST later than JLS2
649
	 * an AST later than JLS2
650
	 * @deprecated In the JLS3 API, this method is replaced by {@link #getReturnType2()},
651
	 * which may return <code>null</code>.
664
	 */ 
652
	 */ 
665
	// TODO (jeem) When JLS3 support is complete (post 3.0) - deprecated In the JLS3 API, this method is replaced by <code>getReturnType2</code>, which may return <code>null</code>.
666
	public Type getReturnType() {
653
	public Type getReturnType() {
667
	    supportedOnlyIn2();
654
		return internalGetReturnType();
655
	}
656
	
657
	/**
658
	 * Internal synonym for deprecated method. Used to avoid
659
	 * deprecation warnings.
660
	 * @since 3.1
661
	 */
662
	/*package*/ final Type internalGetReturnType() {
663
		supportedOnlyIn2();
668
		if (this.returnType == null) {
664
		if (this.returnType == null) {
669
			// lazy init must be thread-safe for readers
665
			// lazy init must be thread-safe for readers
670
			synchronized (this) {
666
			synchronized (this) {
Lines 695-703 Link Here
695
	 * </ul>
691
	 * </ul>
696
	 * @exception UnsupportedOperationException if this operation is used in
692
	 * @exception UnsupportedOperationException if this operation is used in
697
	 * an AST later than JLS2
693
	 * an AST later than JLS2
694
	 * @deprecated In the JLS3 API, this method is replaced by 
695
	 * {@link #setReturnType2(Type)}, which accepts <code>null</code>.
698
	 */ 
696
	 */ 
699
	// TODO (jeem) When JLS3 support is complete (post 3.0) - deprecated In the JLS3 API, this method is replaced by <code>setReturnType2</code>, which accepts <code>null</code>.
700
	public void setReturnType(Type type) {
697
	public void setReturnType(Type type) {
698
		internalSetReturnType(type);
699
	}
700
	
701
	/**
702
	 * Internal synonym for deprecated method. Used to avoid
703
	 * deprecation warnings.
704
	 * @since 3.1
705
	 */
706
	/*package*/ void internalSetReturnType(Type type) {
701
	    supportedOnlyIn2();
707
	    supportedOnlyIn2();
702
		if (type == null) {
708
		if (type == null) {
703
			throw new IllegalArgumentException();
709
			throw new IllegalArgumentException();
Lines 724-730 Link Here
724
	 * or <code>null</code> if none
730
	 * or <code>null</code> if none
725
	 * @exception UnsupportedOperationException if this operation is used in
731
	 * @exception UnsupportedOperationException if this operation is used in
726
	 * a JLS2 AST
732
	 * a JLS2 AST
727
	 * @since 3.0
733
	 * @since 3.1
728
	 */ 
734
	 */ 
729
	public Type getReturnType2() {
735
	public Type getReturnType2() {
730
	    unsupportedIn2();
736
	    unsupportedIn2();
Lines 762-768 Link Here
762
	 * <li>the node belongs to a different AST</li>
768
	 * <li>the node belongs to a different AST</li>
763
	 * <li>the node already has a parent</li>
769
	 * <li>the node already has a parent</li>
764
	 * </ul>
770
	 * </ul>
765
	 * @since 3.0
771
	 * @since 3.1
766
	 */ 
772
	 */ 
767
	public void setReturnType2(Type type) {
773
	public void setReturnType2(Type type) {
768
	    unsupportedIn2();
774
	    unsupportedIn2();
(-)dom/org/eclipse/jdt/core/dom/MethodInvocation.java (-12 / +6 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2004 IBM Corporation and others.
2
 * Copyright (c) 2000, 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 43-49 Link Here
43
43
44
	/**
44
	/**
45
	 * The "typeArguments" structural property of this node type (added in JLS3 API).
45
	 * The "typeArguments" structural property of this node type (added in JLS3 API).
46
	 * @since 3.0
46
	 * @since 3.1
47
	 */
47
	 */
48
	public static final ChildListPropertyDescriptor TYPE_ARGUMENTS_PROPERTY = 
48
	public static final ChildListPropertyDescriptor TYPE_ARGUMENTS_PROPERTY = 
49
		new ChildListPropertyDescriptor(MethodInvocation.class, "typeArguments", Type.class, NO_CYCLE_RISK); //$NON-NLS-1$
49
		new ChildListPropertyDescriptor(MethodInvocation.class, "typeArguments", Type.class, NO_CYCLE_RISK); //$NON-NLS-1$
Lines 74-80 Link Here
74
	 * A list of property descriptors (element type: 
74
	 * A list of property descriptors (element type: 
75
	 * {@link StructuralPropertyDescriptor}),
75
	 * {@link StructuralPropertyDescriptor}),
76
	 * or null if uninitialized.
76
	 * or null if uninitialized.
77
	 * @since 3.0
77
	 * @since 3.1
78
	 */
78
	 */
79
	private static final List PROPERTY_DESCRIPTORS_3_0;
79
	private static final List PROPERTY_DESCRIPTORS_3_0;
80
	
80
	
Lines 107-113 Link Here
107
	 * @since 3.0
107
	 * @since 3.0
108
	 */
108
	 */
109
	public static List propertyDescriptors(int apiLevel) {
109
	public static List propertyDescriptors(int apiLevel) {
110
		if (apiLevel == AST.JLS2) {
110
		if (apiLevel == AST.JLS2_INTERNAL) {
111
			return PROPERTY_DESCRIPTORS_2_0;
111
			return PROPERTY_DESCRIPTORS_2_0;
112
		} else {
112
		} else {
113
			return PROPERTY_DESCRIPTORS_3_0;
113
			return PROPERTY_DESCRIPTORS_3_0;
Lines 123-129 Link Here
123
	 * The type arguments (element type: <code>Type</code>). 
123
	 * The type arguments (element type: <code>Type</code>). 
124
	 * Null in JLS2. Added in JLS3; defaults to an empty list
124
	 * Null in JLS2. Added in JLS3; defaults to an empty list
125
	 * (see constructor).
125
	 * (see constructor).
126
	 * @since 3.0
126
	 * @since 3.1
127
	 */
127
	 */
128
	private ASTNode.NodeList typeArguments = null;
128
	private ASTNode.NodeList typeArguments = null;
129
129
Lines 279-296 Link Here
279
	/**
279
	/**
280
	 * Returns the live ordered list of type arguments of this method
280
	 * Returns the live ordered list of type arguments of this method
281
	 * invocation (added in JLS3 API).
281
	 * invocation (added in JLS3 API).
282
	 * <p>
283
	 * Note: This API element is only needed for dealing with Java code that uses
284
	 * new language features of J2SE 1.5. It is included in anticipation of J2SE
285
	 * 1.5 support, which is planned for the next release of Eclipse after 3.0, and
286
	 * may change slightly before reaching its final form.
287
	 * </p>
288
	 * 
282
	 * 
289
	 * @return the live list of type arguments
283
	 * @return the live list of type arguments
290
	 *    (element type: <code>Type</code>)
284
	 *    (element type: <code>Type</code>)
291
	 * @exception UnsupportedOperationException if this operation is used in
285
	 * @exception UnsupportedOperationException if this operation is used in
292
	 * a JLS2 AST
286
	 * a JLS2 AST
293
	 * @since 3.0
287
	 * @since 3.1
294
	 */ 
288
	 */ 
295
	public List typeArguments() {
289
	public List typeArguments() {
296
		// more efficient than just calling unsupportedIn2() to check
290
		// more efficient than just calling unsupportedIn2() to check
(-)dom/org/eclipse/jdt/core/dom/MethodRefParameter.java (-2 / +2 lines)
Lines 73-79 Link Here
73
	 * A list of property descriptors (element type: 
73
	 * A list of property descriptors (element type: 
74
	 * {@link StructuralPropertyDescriptor}),
74
	 * {@link StructuralPropertyDescriptor}),
75
	 * or null if uninitialized.
75
	 * or null if uninitialized.
76
	 * @since 3.0
76
	 * @since 3.1
77
	 */
77
	 */
78
	private static final List PROPERTY_DESCRIPTORS_3_0;
78
	private static final List PROPERTY_DESCRIPTORS_3_0;
79
		
79
		
Lines 102-108 Link Here
102
	 * @since 3.0
102
	 * @since 3.0
103
	 */
103
	 */
104
	public static List propertyDescriptors(int apiLevel) {
104
	public static List propertyDescriptors(int apiLevel) {
105
		if (apiLevel == AST.JLS2) {
105
		if (apiLevel == AST.JLS2_INTERNAL) {
106
			return PROPERTY_DESCRIPTORS_2_0;
106
			return PROPERTY_DESCRIPTORS_2_0;
107
		} else {
107
		} else {
108
			return PROPERTY_DESCRIPTORS_3_0;
108
			return PROPERTY_DESCRIPTORS_3_0;
(-)dom/org/eclipse/jdt/core/dom/NaiveASTFlattener.java (-32 / +32 lines)
Lines 131-137 Link Here
131
	
131
	
132
	/*
132
	/*
133
	 * @see ASTVisitor#visit(AnnotationTypeDeclaration)
133
	 * @see ASTVisitor#visit(AnnotationTypeDeclaration)
134
	 * @since 3.0
134
	 * @since 3.1
135
	 */
135
	 */
136
	public boolean visit(AnnotationTypeDeclaration node) {
136
	public boolean visit(AnnotationTypeDeclaration node) {
137
		if (node.getJavadoc() != null) {
137
		if (node.getJavadoc() != null) {
Lines 152-158 Link Here
152
	
152
	
153
	/*
153
	/*
154
	 * @see ASTVisitor#visit(AnnotationTypeMemberDeclaration)
154
	 * @see ASTVisitor#visit(AnnotationTypeMemberDeclaration)
155
	 * @since 3.0
155
	 * @since 3.1
156
	 */
156
	 */
157
	public boolean visit(AnnotationTypeMemberDeclaration node) {
157
	public boolean visit(AnnotationTypeMemberDeclaration node) {
158
		if (node.getJavadoc() != null) {
158
		if (node.getJavadoc() != null) {
Lines 366-373 Link Here
366
			this.buffer.append(".");//$NON-NLS-1$
366
			this.buffer.append(".");//$NON-NLS-1$
367
		}
367
		}
368
		this.buffer.append("new ");//$NON-NLS-1$
368
		this.buffer.append("new ");//$NON-NLS-1$
369
		if (node.getAST().apiLevel() == AST.JLS2) {
369
		if (node.getAST().apiLevel() == AST.JLS2_INTERNAL) {
370
			node.getName().accept(this);
370
			node.internalGetName().accept(this);
371
		}
371
		}
372
		if (node.getAST().apiLevel() >= AST.JLS3) {
372
		if (node.getAST().apiLevel() >= AST.JLS3) {
373
			if (!node.typeArguments().isEmpty()) {
373
			if (!node.typeArguments().isEmpty()) {
Lines 496-502 Link Here
496
496
497
	/*
497
	/*
498
	 * @see ASTVisitor#visit(EnhancedForStatement)
498
	 * @see ASTVisitor#visit(EnhancedForStatement)
499
	 * @since 3.0
499
	 * @since 3.1
500
	 */
500
	 */
501
	public boolean visit(EnhancedForStatement node) {
501
	public boolean visit(EnhancedForStatement node) {
502
		printIndent();
502
		printIndent();
Lines 511-517 Link Here
511
511
512
	/*
512
	/*
513
	 * @see ASTVisitor#visit(EnumConstantDeclaration)
513
	 * @see ASTVisitor#visit(EnumConstantDeclaration)
514
	 * @since 3.0
514
	 * @since 3.1
515
	 */
515
	 */
516
	public boolean visit(EnumConstantDeclaration node) {
516
	public boolean visit(EnumConstantDeclaration node) {
517
		if (node.getJavadoc() != null) {
517
		if (node.getJavadoc() != null) {
Lines 539-545 Link Here
539
539
540
	/*
540
	/*
541
	 * @see ASTVisitor#visit(EnumDeclaration)
541
	 * @see ASTVisitor#visit(EnumDeclaration)
542
	 * @since 3.0
542
	 * @since 3.1
543
	 */
543
	 */
544
	public boolean visit(EnumDeclaration node) {
544
	public boolean visit(EnumDeclaration node) {
545
		if (node.getJavadoc() != null) {
545
		if (node.getJavadoc() != null) {
Lines 611-617 Link Here
611
			node.getJavadoc().accept(this);
611
			node.getJavadoc().accept(this);
612
		}
612
		}
613
		printIndent();
613
		printIndent();
614
		if (node.getAST().apiLevel() == AST.JLS2) {
614
		if (node.getAST().apiLevel() == AST.JLS2_INTERNAL) {
615
			printModifiers(node.getModifiers());
615
			printModifiers(node.getModifiers());
616
		}
616
		}
617
		if (node.getAST().apiLevel() >= AST.JLS3) {
617
		if (node.getAST().apiLevel() >= AST.JLS3) {
Lines 727-733 Link Here
727
		if (node.getJavadoc() != null) {
727
		if (node.getJavadoc() != null) {
728
			node.getJavadoc().accept(this);
728
			node.getJavadoc().accept(this);
729
		}
729
		}
730
		if (node.getAST().apiLevel() == AST.JLS2) {
730
		if (node.getAST().apiLevel() == AST.JLS2_INTERNAL) {
731
			printModifiers(node.getModifiers());
731
			printModifiers(node.getModifiers());
732
		}
732
		}
733
		if (node.getAST().apiLevel() >= AST.JLS3) {
733
		if (node.getAST().apiLevel() >= AST.JLS3) {
Lines 773-779 Link Here
773
773
774
	/*
774
	/*
775
	 * @see ASTVisitor#visit(MarkerAnnotation)
775
	 * @see ASTVisitor#visit(MarkerAnnotation)
776
	 * @since 3.0
776
	 * @since 3.1
777
	 */
777
	 */
778
	public boolean visit(MarkerAnnotation node) {
778
	public boolean visit(MarkerAnnotation node) {
779
		this.buffer.append("@");//$NON-NLS-1$
779
		this.buffer.append("@");//$NON-NLS-1$
Lines 796-802 Link Here
796
	
796
	
797
	/*
797
	/*
798
	 * @see ASTVisitor#visit(MemberValuePair)
798
	 * @see ASTVisitor#visit(MemberValuePair)
799
	 * @since 3.0
799
	 * @since 3.1
800
	 */
800
	 */
801
	public boolean visit(MemberValuePair node) {
801
	public boolean visit(MemberValuePair node) {
802
		node.getName().accept(this);
802
		node.getName().accept(this);
Lines 853-859 Link Here
853
			node.getJavadoc().accept(this);
853
			node.getJavadoc().accept(this);
854
		}
854
		}
855
		printIndent();
855
		printIndent();
856
		if (node.getAST().apiLevel() == AST.JLS2) {
856
		if (node.getAST().apiLevel() == AST.JLS2_INTERNAL) {
857
			printModifiers(node.getModifiers());
857
			printModifiers(node.getModifiers());
858
		}
858
		}
859
		if (node.getAST().apiLevel() >= AST.JLS3) {
859
		if (node.getAST().apiLevel() >= AST.JLS3) {
Lines 871-878 Link Here
871
			}
871
			}
872
		}
872
		}
873
		if (!node.isConstructor()) {
873
		if (!node.isConstructor()) {
874
			if (node.getAST().apiLevel() == AST.JLS2) {
874
			if (node.getAST().apiLevel() == AST.JLS2_INTERNAL) {
875
				node.getReturnType().accept(this);
875
				node.internalGetReturnType().accept(this);
876
			} else {
876
			} else {
877
				if (node.getReturnType2() != null) {
877
				if (node.getReturnType2() != null) {
878
					node.getReturnType2().accept(this);
878
					node.getReturnType2().accept(this);
Lines 951-957 Link Here
951
951
952
	/*
952
	/*
953
	 * @see ASTVisitor#visit(Modifier)
953
	 * @see ASTVisitor#visit(Modifier)
954
	 * @since 3.0
954
	 * @since 3.1
955
	 */
955
	 */
956
	public boolean visit(Modifier node) {
956
	public boolean visit(Modifier node) {
957
		this.buffer.append(node.getKeyword().toString());
957
		this.buffer.append(node.getKeyword().toString());
Lines 960-966 Link Here
960
	
960
	
961
	/*
961
	/*
962
	 * @see ASTVisitor#visit(NormalAnnotation)
962
	 * @see ASTVisitor#visit(NormalAnnotation)
963
	 * @since 3.0
963
	 * @since 3.1
964
	 */
964
	 */
965
	public boolean visit(NormalAnnotation node) {
965
	public boolean visit(NormalAnnotation node) {
966
		this.buffer.append("@");//$NON-NLS-1$
966
		this.buffer.append("@");//$NON-NLS-1$
Lines 1016-1022 Link Here
1016
1016
1017
	/*
1017
	/*
1018
	 * @see ASTVisitor#visit(ParameterizedType)
1018
	 * @see ASTVisitor#visit(ParameterizedType)
1019
	 * @since 3.0
1019
	 * @since 3.1
1020
	 */
1020
	 */
1021
	public boolean visit(ParameterizedType node) {
1021
	public boolean visit(ParameterizedType node) {
1022
		node.getType().accept(this);
1022
		node.getType().accept(this);
Lines 1080-1086 Link Here
1080
1080
1081
	/*
1081
	/*
1082
	 * @see ASTVisitor#visit(QualifiedType)
1082
	 * @see ASTVisitor#visit(QualifiedType)
1083
	 * @since 3.0
1083
	 * @since 3.1
1084
	 */
1084
	 */
1085
	public boolean visit(QualifiedType node) {
1085
	public boolean visit(QualifiedType node) {
1086
		node.getQualifier().accept(this);
1086
		node.getQualifier().accept(this);
Lines 1120-1126 Link Here
1120
1120
1121
	/*
1121
	/*
1122
	 * @see ASTVisitor#visit(SingleMemberAnnotation)
1122
	 * @see ASTVisitor#visit(SingleMemberAnnotation)
1123
	 * @since 3.0
1123
	 * @since 3.1
1124
	 */
1124
	 */
1125
	public boolean visit(SingleMemberAnnotation node) {
1125
	public boolean visit(SingleMemberAnnotation node) {
1126
		this.buffer.append("@");//$NON-NLS-1$
1126
		this.buffer.append("@");//$NON-NLS-1$
Lines 1136-1142 Link Here
1136
	 */
1136
	 */
1137
	public boolean visit(SingleVariableDeclaration node) {
1137
	public boolean visit(SingleVariableDeclaration node) {
1138
		printIndent();
1138
		printIndent();
1139
		if (node.getAST().apiLevel() == AST.JLS2) {
1139
		if (node.getAST().apiLevel() == AST.JLS2_INTERNAL) {
1140
			printModifiers(node.getModifiers());
1140
			printModifiers(node.getModifiers());
1141
		}
1141
		}
1142
		if (node.getAST().apiLevel() >= AST.JLS3) {
1142
		if (node.getAST().apiLevel() >= AST.JLS3) {
Lines 1394-1400 Link Here
1394
		if (node.getJavadoc() != null) {
1394
		if (node.getJavadoc() != null) {
1395
			node.getJavadoc().accept(this);
1395
			node.getJavadoc().accept(this);
1396
		}
1396
		}
1397
		if (node.getAST().apiLevel() == AST.JLS2) {
1397
		if (node.getAST().apiLevel() == AST.JLS2_INTERNAL) {
1398
			printModifiers(node.getModifiers());
1398
			printModifiers(node.getModifiers());
1399
		}
1399
		}
1400
		if (node.getAST().apiLevel() >= AST.JLS3) {
1400
		if (node.getAST().apiLevel() >= AST.JLS3) {
Lines 1416-1430 Link Here
1416
			}
1416
			}
1417
		}
1417
		}
1418
		this.buffer.append(" ");//$NON-NLS-1$
1418
		this.buffer.append(" ");//$NON-NLS-1$
1419
		if (node.getAST().apiLevel() == AST.JLS2) {
1419
		if (node.getAST().apiLevel() == AST.JLS2_INTERNAL) {
1420
			if (node.getSuperclass() != null) {
1420
			if (node.internalGetSuperclass() != null) {
1421
				this.buffer.append("extends ");//$NON-NLS-1$
1421
				this.buffer.append("extends ");//$NON-NLS-1$
1422
				node.getSuperclass().accept(this);
1422
				node.internalGetSuperclass().accept(this);
1423
				this.buffer.append(" ");//$NON-NLS-1$
1423
				this.buffer.append(" ");//$NON-NLS-1$
1424
			}
1424
			}
1425
			if (!node.superInterfaces().isEmpty()) {
1425
			if (!node.internalSuperInterfaces().isEmpty()) {
1426
				this.buffer.append(node.isInterface() ? "extends " : "implements ");//$NON-NLS-2$//$NON-NLS-1$
1426
				this.buffer.append(node.isInterface() ? "extends " : "implements ");//$NON-NLS-2$//$NON-NLS-1$
1427
				for (Iterator it = node.superInterfaces().iterator(); it.hasNext(); ) {
1427
				for (Iterator it = node.internalSuperInterfaces().iterator(); it.hasNext(); ) {
1428
					Name n = (Name) it.next();
1428
					Name n = (Name) it.next();
1429
					n.accept(this);
1429
					n.accept(this);
1430
					if (it.hasNext()) {
1430
					if (it.hasNext()) {
Lines 1480-1487 Link Here
1480
	 * @see ASTVisitor#visit(TypeDeclarationStatement)
1480
	 * @see ASTVisitor#visit(TypeDeclarationStatement)
1481
	 */
1481
	 */
1482
	public boolean visit(TypeDeclarationStatement node) {
1482
	public boolean visit(TypeDeclarationStatement node) {
1483
		if (node.getAST().apiLevel() == AST.JLS2) {
1483
		if (node.getAST().apiLevel() == AST.JLS2_INTERNAL) {
1484
			node.getTypeDeclaration().accept(this);
1484
			node.internalGetTypeDeclaration().accept(this);
1485
		}
1485
		}
1486
		if (node.getAST().apiLevel() >= AST.JLS3) {
1486
		if (node.getAST().apiLevel() >= AST.JLS3) {
1487
			node.getDeclaration().accept(this);
1487
			node.getDeclaration().accept(this);
Lines 1500-1506 Link Here
1500
1500
1501
	/*
1501
	/*
1502
	 * @see ASTVisitor#visit(TypeParameter)
1502
	 * @see ASTVisitor#visit(TypeParameter)
1503
	 * @since 3.0
1503
	 * @since 3.1
1504
	 */
1504
	 */
1505
	public boolean visit(TypeParameter node) {
1505
	public boolean visit(TypeParameter node) {
1506
		node.getName().accept(this);
1506
		node.getName().accept(this);
Lines 1521-1527 Link Here
1521
	 * @see ASTVisitor#visit(VariableDeclarationExpression)
1521
	 * @see ASTVisitor#visit(VariableDeclarationExpression)
1522
	 */
1522
	 */
1523
	public boolean visit(VariableDeclarationExpression node) {
1523
	public boolean visit(VariableDeclarationExpression node) {
1524
		if (node.getAST().apiLevel() == AST.JLS2) {
1524
		if (node.getAST().apiLevel() == AST.JLS2_INTERNAL) {
1525
			printModifiers(node.getModifiers());
1525
			printModifiers(node.getModifiers());
1526
		}
1526
		}
1527
		if (node.getAST().apiLevel() >= AST.JLS3) {
1527
		if (node.getAST().apiLevel() >= AST.JLS3) {
Lines 1559-1565 Link Here
1559
	 */
1559
	 */
1560
	public boolean visit(VariableDeclarationStatement node) {
1560
	public boolean visit(VariableDeclarationStatement node) {
1561
		printIndent();
1561
		printIndent();
1562
		if (node.getAST().apiLevel() == AST.JLS2) {
1562
		if (node.getAST().apiLevel() == AST.JLS2_INTERNAL) {
1563
			printModifiers(node.getModifiers());
1563
			printModifiers(node.getModifiers());
1564
		}
1564
		}
1565
		if (node.getAST().apiLevel() >= AST.JLS3) {
1565
		if (node.getAST().apiLevel() >= AST.JLS3) {
Lines 1580-1586 Link Here
1580
1580
1581
	/*
1581
	/*
1582
	 * @see ASTVisitor#visit(WildcardType)
1582
	 * @see ASTVisitor#visit(WildcardType)
1583
	 * @since 3.0
1583
	 * @since 3.1
1584
	 */
1584
	 */
1585
	public boolean visit(WildcardType node) {
1585
	public boolean visit(WildcardType node) {
1586
		this.buffer.append("?");//$NON-NLS-1$
1586
		this.buffer.append("?");//$NON-NLS-1$
(-)dom/org/eclipse/jdt/core/dom/NormalAnnotation.java (-12 / +3 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2004 IBM Corporation and others.
2
 * Copyright (c) 2004, 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 21-39 Link Here
21
 *   <b>@</b> TypeName <b>(</b> [ MemberValuePair { <b>,</b> MemberValuePair } ] <b>)</b>
21
 *   <b>@</b> TypeName <b>(</b> [ MemberValuePair { <b>,</b> MemberValuePair } ] <b>)</b>
22
 * </pre>
22
 * </pre>
23
 * </p>
23
 * </p>
24
 * <p>
24
 * 
25
 * Note: This API element is only needed for dealing with Java code that uses
25
 * @since 3.1
26
 * new language features of J2SE 1.5. It is included in anticipation of J2SE
27
 * 1.5 support, which is planned for the next release of Eclipse after 3.0, and
28
 * may change slightly before reaching its final form.
29
 * </p>
30
 * @since 3.0
31
 */
26
 */
32
public final class NormalAnnotation extends Annotation {
27
public final class NormalAnnotation extends Annotation {
33
	
28
	
34
	/**
29
	/**
35
	 * The "typeName" structural property of this node type.
30
	 * The "typeName" structural property of this node type.
36
	 * @since 3.0
37
	 */
31
	 */
38
	public static final ChildPropertyDescriptor TYPE_NAME_PROPERTY = 
32
	public static final ChildPropertyDescriptor TYPE_NAME_PROPERTY = 
39
		internalTypeNamePropertyFactory(NormalAnnotation.class);
33
		internalTypeNamePropertyFactory(NormalAnnotation.class);
Lines 48-54 Link Here
48
	 * A list of property descriptors (element type: 
42
	 * A list of property descriptors (element type: 
49
	 * {@link StructuralPropertyDescriptor}),
43
	 * {@link StructuralPropertyDescriptor}),
50
	 * or null if uninitialized.
44
	 * or null if uninitialized.
51
	 * @since 3.0
52
	 */
45
	 */
53
	private static final List PROPERTY_DESCRIPTORS;
46
	private static final List PROPERTY_DESCRIPTORS;
54
	
47
	
Lines 67-73 Link Here
67
	 * @param apiLevel the API level; one of the AST.JLS* constants
60
	 * @param apiLevel the API level; one of the AST.JLS* constants
68
	 * @return a list of property descriptors (element type: 
61
	 * @return a list of property descriptors (element type: 
69
	 * {@link StructuralPropertyDescriptor})
62
	 * {@link StructuralPropertyDescriptor})
70
	 * @since 3.0
71
	 */
63
	 */
72
	public static List propertyDescriptors(int apiLevel) {
64
	public static List propertyDescriptors(int apiLevel) {
73
		return PROPERTY_DESCRIPTORS;
65
		return PROPERTY_DESCRIPTORS;
Lines 98-104 Link Here
98
90
99
	/* (omit javadoc for this method)
91
	/* (omit javadoc for this method)
100
	 * Method declared on ASTNode.
92
	 * Method declared on ASTNode.
101
	 * @since 3.0
102
	 */
93
	 */
103
	final List internalStructuralPropertiesForType(int apiLevel) {
94
	final List internalStructuralPropertiesForType(int apiLevel) {
104
		return propertyDescriptors(apiLevel);
95
		return propertyDescriptors(apiLevel);
(-)dom/org/eclipse/jdt/core/dom/PackageDeclaration.java (-12 / +6 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2004 IBM Corporation and others.
2
 * Copyright (c) 2000, 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 41-47 Link Here
41
41
42
	/**
42
	/**
43
	 * The "annotations" structural property of this node type (added in JLS3 API).
43
	 * The "annotations" structural property of this node type (added in JLS3 API).
44
	 * @since 3.0
44
	 * @since 3.1
45
	 */
45
	 */
46
	public static final ChildListPropertyDescriptor ANNOTATIONS_PROPERTY = 
46
	public static final ChildListPropertyDescriptor ANNOTATIONS_PROPERTY = 
47
		new ChildListPropertyDescriptor(PackageDeclaration.class, "annotations", Annotation.class, CYCLE_RISK); //$NON-NLS-1$
47
		new ChildListPropertyDescriptor(PackageDeclaration.class, "annotations", Annotation.class, CYCLE_RISK); //$NON-NLS-1$
Lines 65-71 Link Here
65
	 * A list of property descriptors (element type: 
65
	 * A list of property descriptors (element type: 
66
	 * {@link StructuralPropertyDescriptor}),
66
	 * {@link StructuralPropertyDescriptor}),
67
	 * or null if uninitialized.
67
	 * or null if uninitialized.
68
	 * @since 3.0
68
	 * @since 3.1
69
	 */
69
	 */
70
	private static final List PROPERTY_DESCRIPTORS_3_0;
70
	private static final List PROPERTY_DESCRIPTORS_3_0;
71
	
71
	
Lines 95-101 Link Here
95
	 * @since 3.0
95
	 * @since 3.0
96
	 */
96
	 */
97
	public static List propertyDescriptors(int apiLevel) {
97
	public static List propertyDescriptors(int apiLevel) {
98
		if (apiLevel == AST.JLS2) {
98
		if (apiLevel == AST.JLS2_INTERNAL) {
99
			return PROPERTY_DESCRIPTORS_2_0;
99
			return PROPERTY_DESCRIPTORS_2_0;
100
		} else {
100
		} else {
101
			return PROPERTY_DESCRIPTORS_3_0;
101
			return PROPERTY_DESCRIPTORS_3_0;
Lines 113-119 Link Here
113
	 * The annotations (element type: <code>Annotation</code>). 
113
	 * The annotations (element type: <code>Annotation</code>). 
114
	 * Null in JLS2. Added in JLS3; defaults to an empty list
114
	 * Null in JLS2. Added in JLS3; defaults to an empty list
115
	 * (see constructor).
115
	 * (see constructor).
116
	 * @since 3.0
116
	 * @since 3.1
117
	 */
117
	 */
118
	private ASTNode.NodeList annotations = null;
118
	private ASTNode.NodeList annotations = null;
119
	
119
	
Lines 231-248 Link Here
231
	/**
231
	/**
232
	 * Returns the live ordered list of annotations of this 
232
	 * Returns the live ordered list of annotations of this 
233
	 * package declaration (added in JLS3 API).
233
	 * package declaration (added in JLS3 API).
234
	 * <p>
235
	 * Note: This API element is only needed for dealing with Java code that uses
236
	 * new language features of J2SE 1.5. It is included in anticipation of J2SE
237
	 * 1.5 support, which is planned for the next release of Eclipse after 3.0, and
238
	 * may change slightly before reaching its final form.
239
	 * </p>
240
	 * 
234
	 * 
241
	 * @return the live list of annotations
235
	 * @return the live list of annotations
242
	 *    (element type: <code>Annotation</code>)
236
	 *    (element type: <code>Annotation</code>)
243
	 * @exception UnsupportedOperationException if this operation is used in
237
	 * @exception UnsupportedOperationException if this operation is used in
244
	 * a JLS2 AST
238
	 * a JLS2 AST
245
	 * @since 3.0
239
	 * @since 3.1
246
	 */ 
240
	 */ 
247
	public List annotations() {
241
	public List annotations() {
248
		// more efficient than just calling unsupportedIn2() to check
242
		// more efficient than just calling unsupportedIn2() to check
(-)dom/org/eclipse/jdt/core/dom/ParameterizedType.java (-10 / +1 lines)
Lines 24-37 Link Here
24
 * </pre>
24
 * </pre>
25
 * The first type may be a simple type or a qualified type;
25
 * The first type may be a simple type or a qualified type;
26
 * other kinds of types are meaningless.
26
 * other kinds of types are meaningless.
27
 * <p>
28
 * Note: This API element is only needed for dealing with Java code that uses
29
 * new language features of J2SE 1.5. It is included in anticipation of J2SE
30
 * 1.5 support, which is planned for the next release of Eclipse after 3.0, and
31
 * may change slightly before reaching its final form.
32
 * </p>
33
 * 
27
 * 
34
 * @since 3.0
28
 * @since 3.1
35
 */
29
 */
36
public class ParameterizedType extends Type {
30
public class ParameterizedType extends Type {
37
    /**
31
    /**
Lines 41-54 Link Here
41
	
35
	
42
	/**
36
	/**
43
	 * The "type" structural property of this node type.
37
	 * The "type" structural property of this node type.
44
	 * @since 3.0
45
	 */
38
	 */
46
	public static final ChildPropertyDescriptor TYPE_PROPERTY = 
39
	public static final ChildPropertyDescriptor TYPE_PROPERTY = 
47
		new ChildPropertyDescriptor(ParameterizedType.class, "type", Type.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$
40
		new ChildPropertyDescriptor(ParameterizedType.class, "type", Type.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$
48
41
49
	/**
42
	/**
50
	 * The "typeArguments" structural property of this node type.
43
	 * The "typeArguments" structural property of this node type.
51
	 * @since 3.0
52
	 */
44
	 */
53
	public static final ChildListPropertyDescriptor TYPE_ARGUMENTS_PROPERTY = 
45
	public static final ChildListPropertyDescriptor TYPE_ARGUMENTS_PROPERTY = 
54
		new ChildListPropertyDescriptor(ParameterizedType.class, "typeArguments", Type.class, CYCLE_RISK); //$NON-NLS-1$
46
		new ChildListPropertyDescriptor(ParameterizedType.class, "typeArguments", Type.class, CYCLE_RISK); //$NON-NLS-1$
Lines 77-83 Link Here
77
69
78
	 * @return a list of property descriptors (element type: 
70
	 * @return a list of property descriptors (element type: 
79
	 * {@link StructuralPropertyDescriptor})
71
	 * {@link StructuralPropertyDescriptor})
80
	 * @since 3.0
81
	 */
72
	 */
82
	public static List propertyDescriptors(int apiLevel) {
73
	public static List propertyDescriptors(int apiLevel) {
83
		return PROPERTY_DESCRIPTORS;
74
		return PROPERTY_DESCRIPTORS;
(-)dom/org/eclipse/jdt/core/dom/QualifiedType.java (-4 / +1 lines)
Lines 41-47 Link Here
41
 * became possible as of JLS3; only the second form existed in JLS2 API.)
41
 * became possible as of JLS3; only the second form existed in JLS2 API.)
42
 * </p>
42
 * </p>
43
 * 
43
 * 
44
 * @since 3.0
44
 * @since 3.1
45
 */
45
 */
46
public class QualifiedType extends Type {
46
public class QualifiedType extends Type {
47
    /**
47
    /**
Lines 51-64 Link Here
51
	
51
	
52
	/**
52
	/**
53
	 * The "qualifier" structural property of this node type.
53
	 * The "qualifier" structural property of this node type.
54
	 * @since 3.0
55
	 */
54
	 */
56
	public static final ChildPropertyDescriptor QUALIFIER_PROPERTY = 
55
	public static final ChildPropertyDescriptor QUALIFIER_PROPERTY = 
57
		new ChildPropertyDescriptor(QualifiedType.class, "qualifier", Type.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$
56
		new ChildPropertyDescriptor(QualifiedType.class, "qualifier", Type.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$
58
57
59
	/**
58
	/**
60
	 * The "name" structural property of this node type.
59
	 * The "name" structural property of this node type.
61
	 * @since 3.0
62
	 */
60
	 */
63
	public static final ChildPropertyDescriptor NAME_PROPERTY = 
61
	public static final ChildPropertyDescriptor NAME_PROPERTY = 
64
		new ChildPropertyDescriptor(QualifiedType.class, "name", SimpleName.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$
62
		new ChildPropertyDescriptor(QualifiedType.class, "name", SimpleName.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$
Lines 86-92 Link Here
86
	 * <code>AST.JLS&ast;</code> constants
84
	 * <code>AST.JLS&ast;</code> constants
87
	 * @return a list of property descriptors (element type: 
85
	 * @return a list of property descriptors (element type: 
88
	 * {@link StructuralPropertyDescriptor})
86
	 * {@link StructuralPropertyDescriptor})
89
	 * @since 3.0
90
	 */
87
	 */
91
	public static List propertyDescriptors(int apiLevel) {
88
	public static List propertyDescriptors(int apiLevel) {
92
		return PROPERTY_DESCRIPTORS;
89
		return PROPERTY_DESCRIPTORS;
(-)dom/org/eclipse/jdt/core/dom/SingleMemberAnnotation.java (-13 / +3 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2004 IBM Corporation and others.
2
 * Copyright (c) 2004, 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 24-49 Link Here
24
 * Within annotations, only certain kinds of expressions are meaningful,
24
 * Within annotations, only certain kinds of expressions are meaningful,
25
 * including other annotations.
25
 * including other annotations.
26
 * </p>
26
 * </p>
27
 * <p>
27
 * 
28
 * Note: This API element is only needed for dealing with Java code that uses
28
 * @since 3.1
29
 * new language features of J2SE 1.5. It is included in anticipation of J2SE
30
 * 1.5 support, which is planned for the next release of Eclipse after 3.0, and
31
 * may change slightly before reaching its final form.
32
 * </p>
33
 * @since 3.0
34
 */
29
 */
35
public final class SingleMemberAnnotation extends Annotation {
30
public final class SingleMemberAnnotation extends Annotation {
36
	
31
	
37
	/**
32
	/**
38
	 * The "typeName" structural property of this node type.
33
	 * The "typeName" structural property of this node type.
39
	 * @since 3.0
40
	 */
34
	 */
41
	public static final ChildPropertyDescriptor TYPE_NAME_PROPERTY = 
35
	public static final ChildPropertyDescriptor TYPE_NAME_PROPERTY = 
42
		internalTypeNamePropertyFactory(SingleMemberAnnotation.class);
36
		internalTypeNamePropertyFactory(SingleMemberAnnotation.class);
43
37
44
	/**
38
	/**
45
	 * The "value" structural property of this node type.
39
	 * The "value" structural property of this node type.
46
	 * @since 3.0
47
	 */
40
	 */
48
	public static final ChildPropertyDescriptor VALUE_PROPERTY = 
41
	public static final ChildPropertyDescriptor VALUE_PROPERTY = 
49
		new ChildPropertyDescriptor(SingleMemberAnnotation.class, "value", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$
42
		new ChildPropertyDescriptor(SingleMemberAnnotation.class, "value", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$
Lines 52-58 Link Here
52
	 * A list of property descriptors (element type: 
45
	 * A list of property descriptors (element type: 
53
	 * {@link StructuralPropertyDescriptor}),
46
	 * {@link StructuralPropertyDescriptor}),
54
	 * or null if uninitialized.
47
	 * or null if uninitialized.
55
	 * @since 3.0
56
	 */
48
	 */
57
	private static final List PROPERTY_DESCRIPTORS;
49
	private static final List PROPERTY_DESCRIPTORS;
58
	
50
	
Lines 71-77 Link Here
71
	 * @param apiLevel the API level; one of the AST.JLS* constants
63
	 * @param apiLevel the API level; one of the AST.JLS* constants
72
	 * @return a list of property descriptors (element type: 
64
	 * @return a list of property descriptors (element type: 
73
	 * {@link StructuralPropertyDescriptor})
65
	 * {@link StructuralPropertyDescriptor})
74
	 * @since 3.0
75
	 */
66
	 */
76
	public static List propertyDescriptors(int apiLevel) {
67
	public static List propertyDescriptors(int apiLevel) {
77
		return PROPERTY_DESCRIPTORS;
68
		return PROPERTY_DESCRIPTORS;
Lines 100-106 Link Here
100
91
101
	/* (omit javadoc for this method)
92
	/* (omit javadoc for this method)
102
	 * Method declared on ASTNode.
93
	 * Method declared on ASTNode.
103
	 * @since 3.0
104
	 */
94
	 */
105
	final List internalStructuralPropertiesForType(int apiLevel) {
95
	final List internalStructuralPropertiesForType(int apiLevel) {
106
		return propertyDescriptors(apiLevel);
96
		return propertyDescriptors(apiLevel);
(-)dom/org/eclipse/jdt/core/dom/SingleVariableDeclaration.java (-19 / +22 lines)
Lines 41-53 Link Here
41
	 * The "modifiers" structural property of this node type (JLS2 API only).
41
	 * The "modifiers" structural property of this node type (JLS2 API only).
42
	 * @since 3.0
42
	 * @since 3.0
43
	 */
43
	 */
44
    // TODO (jeem) When JLS3 support is complete (post 3.0) - deprecated Replaced by {@link #MODIFIERS2_PROPERTY} in the JLS3 API.
45
	public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = 
44
	public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = 
46
		new SimplePropertyDescriptor(SingleVariableDeclaration.class, "modifiers", int.class, MANDATORY); //$NON-NLS-1$
45
		new SimplePropertyDescriptor(SingleVariableDeclaration.class, "modifiers", int.class, MANDATORY); //$NON-NLS-1$
47
	
46
	
48
	/**
47
	/**
49
	 * The "modifiers" structural property of this node type (added in JLS3 API).
48
	 * The "modifiers" structural property of this node type (added in JLS3 API).
50
	 * @since 3.0
49
	 * @since 3.1
51
	 */
50
	 */
52
	public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = 
51
	public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = 
53
		new ChildListPropertyDescriptor(SingleVariableDeclaration.class, "modifiers", IExtendedModifier.class, CYCLE_RISK); //$NON-NLS-1$
52
		new ChildListPropertyDescriptor(SingleVariableDeclaration.class, "modifiers", IExtendedModifier.class, CYCLE_RISK); //$NON-NLS-1$
Lines 68-74 Link Here
68
67
69
	/**
68
	/**
70
	 * The "varargs" structural property of this node type (added in JLS3 API).
69
	 * The "varargs" structural property of this node type (added in JLS3 API).
71
	 * @since 3.0
70
	 * @since 3.1
72
	 */
71
	 */
73
	public static final SimplePropertyDescriptor VARARGS_PROPERTY = 
72
	public static final SimplePropertyDescriptor VARARGS_PROPERTY = 
74
		new SimplePropertyDescriptor(SingleVariableDeclaration.class, "varargs", boolean.class, MANDATORY); //$NON-NLS-1$
73
		new SimplePropertyDescriptor(SingleVariableDeclaration.class, "varargs", boolean.class, MANDATORY); //$NON-NLS-1$
Lines 99-105 Link Here
99
	 * A list of property descriptors (element type: 
98
	 * A list of property descriptors (element type: 
100
	 * {@link StructuralPropertyDescriptor}),
99
	 * {@link StructuralPropertyDescriptor}),
101
	 * or null if uninitialized.
100
	 * or null if uninitialized.
102
	 * @since 3.0
101
	 * @since 3.1
103
	 */
102
	 */
104
	private static final List PROPERTY_DESCRIPTORS_3_0;
103
	private static final List PROPERTY_DESCRIPTORS_3_0;
105
	
104
	
Lines 135-141 Link Here
135
	 * @since 3.0
134
	 * @since 3.0
136
	 */
135
	 */
137
	public static List propertyDescriptors(int apiLevel) {
136
	public static List propertyDescriptors(int apiLevel) {
138
		if (apiLevel == AST.JLS2) {
137
		if (apiLevel == AST.JLS2_INTERNAL) {
139
			return PROPERTY_DESCRIPTORS_2_0;
138
			return PROPERTY_DESCRIPTORS_2_0;
140
		} else {
139
		} else {
141
			return PROPERTY_DESCRIPTORS_3_0;
140
			return PROPERTY_DESCRIPTORS_3_0;
Lines 147-153 Link Here
147
	 * Null in JLS2. Added in JLS3; defaults to an empty list
146
	 * Null in JLS2. Added in JLS3; defaults to an empty list
148
	 * (see constructor).
147
	 * (see constructor).
149
	 * 
148
	 * 
150
	 * @since 3.0
149
	 * @since 3.1
151
	 */
150
	 */
152
	private ASTNode.NodeList modifiers = null;
151
	private ASTNode.NodeList modifiers = null;
153
	
152
	
Lines 173-179 Link Here
173
	 * Indicates the last parameter of a variable arity method;
172
	 * Indicates the last parameter of a variable arity method;
174
	 * defaults to false.
173
	 * defaults to false.
175
	 * 
174
	 * 
176
	 * @since 3.0
175
	 * @since 3.1
177
	 */
176
	 */
178
	private boolean variableArity = false;
177
	private boolean variableArity = false;
179
178
Lines 336-342 Link Here
336
	ASTNode clone0(AST target) {
335
	ASTNode clone0(AST target) {
337
		SingleVariableDeclaration result = new SingleVariableDeclaration(target);
336
		SingleVariableDeclaration result = new SingleVariableDeclaration(target);
338
		result.setSourceRange(this.getStartPosition(), this.getLength());
337
		result.setSourceRange(this.getStartPosition(), this.getLength());
339
		if (this.ast.apiLevel == AST.JLS2) {
338
		if (this.ast.apiLevel == AST.JLS2_INTERNAL) {
340
			result.setModifiers(getModifiers());
339
			result.setModifiers(getModifiers());
341
		} else {
340
		} else {
342
			result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers()));
341
			result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers()));
Lines 387-393 Link Here
387
	 *    (element type: <code>IExtendedModifier</code>)
386
	 *    (element type: <code>IExtendedModifier</code>)
388
	 * @exception UnsupportedOperationException if this operation is used in
387
	 * @exception UnsupportedOperationException if this operation is used in
389
	 * a JLS2 AST
388
	 * a JLS2 AST
390
	 * @since 3.0
389
	 * @since 3.1
391
	 */ 
390
	 */ 
392
	public List modifiers() {
391
	public List modifiers() {
393
		// more efficient than just calling unsupportedIn2() to check
392
		// more efficient than just calling unsupportedIn2() to check
Lines 439-450 Link Here
439
	 * @exception UnsupportedOperationException if this operation is used in
438
	 * @exception UnsupportedOperationException if this operation is used in
440
	 * an AST later than JLS2
439
	 * an AST later than JLS2
441
	 * @see Modifier
440
	 * @see Modifier
441
	 * @deprecated In the JLS3 API, this method is replaced by 
442
	 * {@link  #modifiers()} which contains a list of a <code>Modifier</code> nodes.
442
	 */ 
443
	 */ 
443
	// TODO (jeem) When JLS3 support is complete (post 3.0) - deprecated In the JLS3 API, this method is replaced by <code>modifiers()</code> which contains a list of  a <code>Modifier</code> nodes.
444
	public void setModifiers(int modifiers) {
444
	public void setModifiers(int modifiers) {
445
		internalSetModifiers(modifiers);
446
	}
447
448
	/**
449
	 * Internal synonym for deprecated method. Used to avoid
450
	 * deprecation warnings.
451
	 * @since 3.1
452
	 */
453
	/*package*/ final void internalSetModifiers(int pmodifiers) {
445
	    supportedOnlyIn2();
454
	    supportedOnlyIn2();
446
		preValueChange(MODIFIERS_PROPERTY);
455
		preValueChange(MODIFIERS_PROPERTY);
447
		this.modifierFlags = modifiers;
456
		this.modifierFlags = pmodifiers;
448
		postValueChange(MODIFIERS_PROPERTY);
457
		postValueChange(MODIFIERS_PROPERTY);
449
	}
458
	}
450
459
Lines 536-542 Link Here
536
	 *    and <code>false</code> otherwise
545
	 *    and <code>false</code> otherwise
537
	 * @exception UnsupportedOperationException if this operation is used in
546
	 * @exception UnsupportedOperationException if this operation is used in
538
	 * a JLS2 AST
547
	 * a JLS2 AST
539
	 * @since 3.0
548
	 * @since 3.1
540
	 */ 
549
	 */ 
541
	public boolean isVarargs() {
550
	public boolean isVarargs() {
542
		// more efficient than just calling unsupportedIn2() to check
551
		// more efficient than just calling unsupportedIn2() to check
Lines 549-564 Link Here
549
	/**
558
	/**
550
	 * Sets whether this declaration declares the last parameter of
559
	 * Sets whether this declaration declares the last parameter of
551
	 * a variable arity method (added in JLS3 API).
560
	 * a variable arity method (added in JLS3 API).
552
	 * <p>
553
	 * Note: This API element is only needed for dealing with Java code that uses
554
	 * new language features of J2SE 1.5. It is included in anticipation of J2SE
555
	 * 1.5 support, which is planned for the next release of Eclipse after 3.0, and
556
	 * may change slightly before reaching its final form.
557
	 * </p>
558
	 * 
561
	 * 
559
	 * @param variableArity <code>true</code> if this is a variable arity
562
	 * @param variableArity <code>true</code> if this is a variable arity
560
	 *    parameter declaration, and <code>false</code> otherwise
563
	 *    parameter declaration, and <code>false</code> otherwise
561
	 * @since 3.0
564
	 * @since 3.1
562
	 */ 
565
	 */ 
563
	public void setVarargs(boolean variableArity) {
566
	public void setVarargs(boolean variableArity) {
564
		// more efficient than just calling unsupportedIn2() to check
567
		// more efficient than just calling unsupportedIn2() to check
(-)dom/org/eclipse/jdt/core/dom/SuperConstructorInvocation.java (-12 / +6 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2004 IBM Corporation and others.
2
 * Copyright (c) 2000, 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 42-48 Link Here
42
42
43
	/**
43
	/**
44
	 * The "typeArguments" structural property of this node type (added in JLS3 API).
44
	 * The "typeArguments" structural property of this node type (added in JLS3 API).
45
	 * @since 3.0
45
	 * @since 3.1
46
	 */
46
	 */
47
	public static final ChildListPropertyDescriptor TYPE_ARGUMENTS_PROPERTY = 
47
	public static final ChildListPropertyDescriptor TYPE_ARGUMENTS_PROPERTY = 
48
		new ChildListPropertyDescriptor(SuperConstructorInvocation.class, "typeArguments", Type.class, NO_CYCLE_RISK); //$NON-NLS-1$
48
		new ChildListPropertyDescriptor(SuperConstructorInvocation.class, "typeArguments", Type.class, NO_CYCLE_RISK); //$NON-NLS-1$
Lines 66-72 Link Here
66
	 * A list of property descriptors (element type: 
66
	 * A list of property descriptors (element type: 
67
	 * {@link StructuralPropertyDescriptor}),
67
	 * {@link StructuralPropertyDescriptor}),
68
	 * or null if uninitialized.
68
	 * or null if uninitialized.
69
	 * @since 3.0
69
	 * @since 3.1
70
	 */
70
	 */
71
	private static final List PROPERTY_DESCRIPTORS_3_0;
71
	private static final List PROPERTY_DESCRIPTORS_3_0;
72
	
72
	
Lines 97-103 Link Here
97
	 * @since 3.0
97
	 * @since 3.0
98
	 */
98
	 */
99
	public static List propertyDescriptors(int apiLevel) {
99
	public static List propertyDescriptors(int apiLevel) {
100
		if (apiLevel == AST.JLS2) {
100
		if (apiLevel == AST.JLS2_INTERNAL) {
101
			return PROPERTY_DESCRIPTORS_2_0;
101
			return PROPERTY_DESCRIPTORS_2_0;
102
		} else {
102
		} else {
103
			return PROPERTY_DESCRIPTORS_3_0;
103
			return PROPERTY_DESCRIPTORS_3_0;
Lines 113-119 Link Here
113
	 * The type arguments (element type: <code>Type</code>). 
113
	 * The type arguments (element type: <code>Type</code>). 
114
	 * Null in JLS2. Added in JLS3; defaults to an empty list
114
	 * Null in JLS2. Added in JLS3; defaults to an empty list
115
	 * (see constructor).
115
	 * (see constructor).
116
	 * @since 3.0
116
	 * @since 3.1
117
	 */
117
	 */
118
	private ASTNode.NodeList typeArguments = null;
118
	private ASTNode.NodeList typeArguments = null;
119
119
Lines 255-272 Link Here
255
	/**
255
	/**
256
	 * Returns the live ordered list of type arguments of this constructor
256
	 * Returns the live ordered list of type arguments of this constructor
257
	 * invocation (added in JLS3 API).
257
	 * invocation (added in JLS3 API).
258
	 * <p>
259
	 * Note: This API element is only needed for dealing with Java code that uses
260
	 * new language features of J2SE 1.5. It is included in anticipation of J2SE
261
	 * 1.5 support, which is planned for the next release of Eclipse after 3.0, and
262
	 * may change slightly before reaching its final form.
263
	 * </p>
264
	 * 
258
	 * 
265
	 * @return the live list of type arguments
259
	 * @return the live list of type arguments
266
	 *    (element type: <code>Type</code>)
260
	 *    (element type: <code>Type</code>)
267
	 * @exception UnsupportedOperationException if this operation is used in
261
	 * @exception UnsupportedOperationException if this operation is used in
268
	 * a JLS2 AST
262
	 * a JLS2 AST
269
	 * @since 3.0
263
	 * @since 3.1
270
	 */ 
264
	 */ 
271
	public List typeArguments() {
265
	public List typeArguments() {
272
		// more efficient than just calling unsupportedIn2() to check
266
		// more efficient than just calling unsupportedIn2() to check
(-)dom/org/eclipse/jdt/core/dom/SuperMethodInvocation.java (-12 / +6 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2004 IBM Corporation and others.
2
 * Copyright (c) 2000, 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 43-49 Link Here
43
43
44
	/**
44
	/**
45
	 * The "typeArguments" structural property of this node type (added in JLS3 API).
45
	 * The "typeArguments" structural property of this node type (added in JLS3 API).
46
	 * @since 3.0
46
	 * @since 3.1
47
	 */
47
	 */
48
	public static final ChildListPropertyDescriptor TYPE_ARGUMENTS_PROPERTY = 
48
	public static final ChildListPropertyDescriptor TYPE_ARGUMENTS_PROPERTY = 
49
		new ChildListPropertyDescriptor(SuperMethodInvocation.class, "typeArguments", Type.class, NO_CYCLE_RISK); //$NON-NLS-1$
49
		new ChildListPropertyDescriptor(SuperMethodInvocation.class, "typeArguments", Type.class, NO_CYCLE_RISK); //$NON-NLS-1$
Lines 74-80 Link Here
74
	 * A list of property descriptors (element type: 
74
	 * A list of property descriptors (element type: 
75
	 * {@link StructuralPropertyDescriptor}),
75
	 * {@link StructuralPropertyDescriptor}),
76
	 * or null if uninitialized.
76
	 * or null if uninitialized.
77
	 * @since 3.0
77
	 * @since 3.1
78
	 */
78
	 */
79
	private static final List PROPERTY_DESCRIPTORS_3_0;
79
	private static final List PROPERTY_DESCRIPTORS_3_0;
80
	
80
	
Lines 107-113 Link Here
107
	 * @since 3.0
107
	 * @since 3.0
108
	 */
108
	 */
109
	public static List propertyDescriptors(int apiLevel) {
109
	public static List propertyDescriptors(int apiLevel) {
110
		if (apiLevel == AST.JLS2) {
110
		if (apiLevel == AST.JLS2_INTERNAL) {
111
			return PROPERTY_DESCRIPTORS_2_0;
111
			return PROPERTY_DESCRIPTORS_2_0;
112
		} else {
112
		} else {
113
			return PROPERTY_DESCRIPTORS_3_0;
113
			return PROPERTY_DESCRIPTORS_3_0;
Lines 123-129 Link Here
123
	 * The type arguments (element type: <code>Type</code>). 
123
	 * The type arguments (element type: <code>Type</code>). 
124
	 * Null in JLS2. Added in JLS3; defaults to an empty list
124
	 * Null in JLS2. Added in JLS3; defaults to an empty list
125
	 * (see constructor).
125
	 * (see constructor).
126
	 * @since 3.0
126
	 * @since 3.1
127
	 */
127
	 */
128
	private ASTNode.NodeList typeArguments = null;
128
	private ASTNode.NodeList typeArguments = null;
129
129
Lines 277-294 Link Here
277
	/**
277
	/**
278
	 * Returns the live ordered list of type arguments of this method
278
	 * Returns the live ordered list of type arguments of this method
279
	 * invocation (added in JLS3 API).
279
	 * invocation (added in JLS3 API).
280
	 * <p>
281
	 * Note: This API element is only needed for dealing with Java code that uses
282
	 * new language features of J2SE 1.5. It is included in anticipation of J2SE
283
	 * 1.5 support, which is planned for the next release of Eclipse after 3.0, and
284
	 * may change slightly before reaching its final form.
285
	 * </p>
286
	 * 
280
	 * 
287
	 * @return the live list of type arguments
281
	 * @return the live list of type arguments
288
	 *    (element type: <code>Type</code>)
282
	 *    (element type: <code>Type</code>)
289
	 * @exception UnsupportedOperationException if this operation is used in
283
	 * @exception UnsupportedOperationException if this operation is used in
290
	 * a JLS2 AST
284
	 * a JLS2 AST
291
	 * @since 3.0
285
	 * @since 3.1
292
	 */ 
286
	 */ 
293
	public List typeArguments() {
287
	public List typeArguments() {
294
		// more efficient than just calling unsupportedIn2() to check
288
		// more efficient than just calling unsupportedIn2() to check
(-)dom/org/eclipse/jdt/core/dom/Type.java (-4 / +4 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2004 IBM Corporation and others.
2
 * Copyright (c) 2000, 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 105-111 Link Here
105
	 * 
105
	 * 
106
	 * @return <code>true</code> if this is a parameterized type, and 
106
	 * @return <code>true</code> if this is a parameterized type, and 
107
	 *    <code>false</code> otherwise
107
	 *    <code>false</code> otherwise
108
	 * @since 3.0
108
	 * @since 3.1
109
	 */
109
	 */
110
	public final boolean isParameterizedType() {
110
	public final boolean isParameterizedType() {
111
		return (this instanceof ParameterizedType);
111
		return (this instanceof ParameterizedType);
Lines 133-139 Link Here
133
	 * 
133
	 * 
134
	 * @return <code>true</code> if this is a qualified type, and 
134
	 * @return <code>true</code> if this is a qualified type, and 
135
	 *    <code>false</code> otherwise
135
	 *    <code>false</code> otherwise
136
	 * @since 3.0
136
	 * @since 3.1
137
	 */
137
	 */
138
	public final boolean isQualifiedType() {
138
	public final boolean isQualifiedType() {
139
		return (this instanceof QualifiedType);
139
		return (this instanceof QualifiedType);
Lines 149-155 Link Here
149
	 * 
149
	 * 
150
	 * @return <code>true</code> if this is a wildcard type, and 
150
	 * @return <code>true</code> if this is a wildcard type, and 
151
	 *    <code>false</code> otherwise
151
	 *    <code>false</code> otherwise
152
	 * @since 3.0
152
	 * @since 3.1
153
	 */
153
	 */
154
	public final boolean isWildcardType() {
154
	public final boolean isWildcardType() {
155
		return (this instanceof WildcardType);
155
		return (this instanceof WildcardType);
(-)dom/org/eclipse/jdt/core/dom/TypeDeclaration.java (-31 / +54 lines)
Lines 78-90 Link Here
78
	 * The "modifiers" structural property of this node type (JLS2 API only).
78
	 * The "modifiers" structural property of this node type (JLS2 API only).
79
	 * @since 3.0
79
	 * @since 3.0
80
	 */
80
	 */
81
    // TODO (jeem) When JLS3 support is complete (post 3.0) - deprecated Replaced by {@link #MODIFIERS2_PROPERTY} in the JLS3 API.
82
	public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = 
81
	public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = 
83
		internalModifiersPropertyFactory(TypeDeclaration.class);
82
		internalModifiersPropertyFactory(TypeDeclaration.class);
84
	
83
	
85
	/**
84
	/**
86
	 * The "modifiers" structural property of this node type (added in JLS3 API).
85
	 * The "modifiers" structural property of this node type (added in JLS3 API).
87
	 * @since 3.0
86
	 * @since 3.1
88
	 */
87
	 */
89
	public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = 
88
	public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = 
90
		internalModifiers2PropertyFactory(TypeDeclaration.class);
89
		internalModifiers2PropertyFactory(TypeDeclaration.class);
Lines 107-113 Link Here
107
	 * The "superclass" structural property of this node type (JLS2 API only).
106
	 * The "superclass" structural property of this node type (JLS2 API only).
108
	 * @since 3.0
107
	 * @since 3.0
109
	 */
108
	 */
110
	// TODO (jeem) When JLS3 support is complete (post 3.0) - deprecated Replaced by {@link #SUPERCLASS_TYPE_PROPERTY} in the JLS3 API.
111
	public static final ChildPropertyDescriptor SUPERCLASS_PROPERTY = 
109
	public static final ChildPropertyDescriptor SUPERCLASS_PROPERTY = 
112
		new ChildPropertyDescriptor(TypeDeclaration.class, "superclass", Name.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$
110
		new ChildPropertyDescriptor(TypeDeclaration.class, "superclass", Name.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$
113
111
Lines 115-141 Link Here
115
	 * The "superInterfaces" structural property of this node type (JLS2 API only).
113
	 * The "superInterfaces" structural property of this node type (JLS2 API only).
116
	 * @since 3.0
114
	 * @since 3.0
117
	 */
115
	 */
118
	// TODO (jeem) When JLS3 support is complete (post 3.0) - deprecated Replaced by {@link #SUPER_INTERFACE_TYPES_PROPERTY} in the JLS3 API.
119
	public static final ChildListPropertyDescriptor SUPER_INTERFACES_PROPERTY = 
116
	public static final ChildListPropertyDescriptor SUPER_INTERFACES_PROPERTY = 
120
		new ChildListPropertyDescriptor(TypeDeclaration.class, "superInterfaces", Name.class, NO_CYCLE_RISK); //$NON-NLS-1$
117
		new ChildListPropertyDescriptor(TypeDeclaration.class, "superInterfaces", Name.class, NO_CYCLE_RISK); //$NON-NLS-1$
121
118
122
	/**
119
	/**
123
	 * The "superclassType" structural property of this node type (added in JLS3 API).
120
	 * The "superclassType" structural property of this node type (added in JLS3 API).
124
	 * @since 3.0
121
	 * @since 3.1
125
	 */
122
	 */
126
	public static final ChildPropertyDescriptor SUPERCLASS_TYPE_PROPERTY = 
123
	public static final ChildPropertyDescriptor SUPERCLASS_TYPE_PROPERTY = 
127
		new ChildPropertyDescriptor(TypeDeclaration.class, "superclassType", Type.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$
124
		new ChildPropertyDescriptor(TypeDeclaration.class, "superclassType", Type.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$
128
125
129
	/**
126
	/**
130
	 * The "superInterfaceTypes" structural property of this node type (added in JLS3 API).
127
	 * The "superInterfaceTypes" structural property of this node type (added in JLS3 API).
131
	 * @since 3.0
128
	 * @since 3.1
132
	 */
129
	 */
133
	public static final ChildListPropertyDescriptor SUPER_INTERFACE_TYPES_PROPERTY = 
130
	public static final ChildListPropertyDescriptor SUPER_INTERFACE_TYPES_PROPERTY = 
134
		new ChildListPropertyDescriptor(TypeDeclaration.class, "superInterfaceTypes", Type.class, NO_CYCLE_RISK); //$NON-NLS-1$
131
		new ChildListPropertyDescriptor(TypeDeclaration.class, "superInterfaceTypes", Type.class, NO_CYCLE_RISK); //$NON-NLS-1$
135
	
132
	
136
	/**
133
	/**
137
	 * The "typeParameters" structural property of this node type (added in JLS3 API).
134
	 * The "typeParameters" structural property of this node type (added in JLS3 API).
138
	 * @since 3.0
135
	 * @since 3.1
139
	 */
136
	 */
140
	public static final ChildListPropertyDescriptor TYPE_PARAMETERS_PROPERTY = 
137
	public static final ChildListPropertyDescriptor TYPE_PARAMETERS_PROPERTY = 
141
		new ChildListPropertyDescriptor(TypeDeclaration.class, "typeParameters", TypeParameter.class, NO_CYCLE_RISK); //$NON-NLS-1$
138
		new ChildListPropertyDescriptor(TypeDeclaration.class, "typeParameters", TypeParameter.class, NO_CYCLE_RISK); //$NON-NLS-1$
Lines 159-165 Link Here
159
	 * A list of property descriptors (element type: 
156
	 * A list of property descriptors (element type: 
160
	 * {@link StructuralPropertyDescriptor}),
157
	 * {@link StructuralPropertyDescriptor}),
161
	 * or null if uninitialized.
158
	 * or null if uninitialized.
162
	 * @since 3.0
159
	 * @since 3.1
163
	 */
160
	 */
164
	private static final List PROPERTY_DESCRIPTORS_3_0;
161
	private static final List PROPERTY_DESCRIPTORS_3_0;
165
	
162
	
Lines 200-206 Link Here
200
	 * @since 3.0
197
	 * @since 3.0
201
	 */
198
	 */
202
	public static List propertyDescriptors(int apiLevel) {
199
	public static List propertyDescriptors(int apiLevel) {
203
		if (apiLevel == AST.JLS2) {
200
		if (apiLevel == AST.JLS2_INTERNAL) {
204
			return PROPERTY_DESCRIPTORS_2_0;
201
			return PROPERTY_DESCRIPTORS_2_0;
205
		} else {
202
		} else {
206
			return PROPERTY_DESCRIPTORS_3_0;
203
			return PROPERTY_DESCRIPTORS_3_0;
Lines 217-223 Link Here
217
	 * The type paramters (element type: <code>TypeParameter</code>). 
214
	 * The type paramters (element type: <code>TypeParameter</code>). 
218
	 * Null in JLS2. Added in JLS3; defaults to an empty list
215
	 * Null in JLS2. Added in JLS3; defaults to an empty list
219
	 * (see constructor).
216
	 * (see constructor).
220
	 * @since 3.0
217
	 * @since 3.1
221
	 */
218
	 */
222
	private ASTNode.NodeList typeParameters = null;
219
	private ASTNode.NodeList typeParameters = null;
223
220
Lines 240-246 Link Here
240
	 * The optional superclass type; <code>null</code> if none.
237
	 * The optional superclass type; <code>null</code> if none.
241
	 * Defaults to none. Note that this field is not used for
238
	 * Defaults to none. Note that this field is not used for
242
	 * interface declarations. Null in JLS2. Added in JLS3.
239
	 * interface declarations. Null in JLS2. Added in JLS3.
243
	 * @since 3.0
240
	 * @since 3.1
244
	 */
241
	 */
245
	private Type optionalSuperclassType = null;
242
	private Type optionalSuperclassType = null;
246
243
Lines 248-254 Link Here
248
	 * The superinterface types (element type: <code>Type</code>). 
245
	 * The superinterface types (element type: <code>Type</code>). 
249
	 * Null in JLS2. Added in JLS3; defaults to an empty list
246
	 * Null in JLS2. Added in JLS3; defaults to an empty list
250
	 * (see constructor).
247
	 * (see constructor).
251
	 * @since 3.0
248
	 * @since 3.1
252
	 */
249
	 */
253
	private ASTNode.NodeList superInterfaceTypes = null;
250
	private ASTNode.NodeList superInterfaceTypes = null;
254
251
Lines 268-274 Link Here
268
	 */
265
	 */
269
	TypeDeclaration(AST ast) {
266
	TypeDeclaration(AST ast) {
270
		super(ast);
267
		super(ast);
271
		if (ast.apiLevel == AST.JLS2) {
268
		if (ast.apiLevel == AST.JLS2_INTERNAL) {
272
			this.superInterfaceNames = new ASTNode.NodeList(SUPER_INTERFACES_PROPERTY);
269
			this.superInterfaceNames = new ASTNode.NodeList(SUPER_INTERFACES_PROPERTY);
273
		}
270
		}
274
		if (ast.apiLevel >= AST.JLS3) {
271
		if (ast.apiLevel >= AST.JLS3) {
Lines 293-299 Link Here
293
			if (get) {
290
			if (get) {
294
				return getModifiers();
291
				return getModifiers();
295
			} else {
292
			} else {
296
				setModifiers(value);
293
				internalSetModifiers(value);
297
				return 0;
294
				return 0;
298
			}
295
			}
299
		}
296
		}
Lines 431-438 Link Here
431
		result.setSourceRange(this.getStartPosition(), this.getLength());
428
		result.setSourceRange(this.getStartPosition(), this.getLength());
432
		result.setJavadoc(
429
		result.setJavadoc(
433
			(Javadoc) ASTNode.copySubtree(target, getJavadoc()));
430
			(Javadoc) ASTNode.copySubtree(target, getJavadoc()));
434
		if (this.ast.apiLevel == AST.JLS2) {
431
		if (this.ast.apiLevel == AST.JLS2_INTERNAL) {
435
			result.setModifiers(getModifiers());
432
			result.internalSetModifiers(getModifiers());
436
			result.setSuperclass(
433
			result.setSuperclass(
437
					(Name) ASTNode.copySubtree(target, getSuperclass()));
434
					(Name) ASTNode.copySubtree(target, getSuperclass()));
438
			result.superInterfaces().addAll(
435
			result.superInterfaces().addAll(
Lines 469-475 Link Here
469
		boolean visitChildren = visitor.visit(this);
466
		boolean visitChildren = visitor.visit(this);
470
		if (visitChildren) {
467
		if (visitChildren) {
471
			// visit children in normal left to right reading order
468
			// visit children in normal left to right reading order
472
			if (this.ast.apiLevel == AST.JLS2) {
469
			if (this.ast.apiLevel == AST.JLS2_INTERNAL) {
473
				acceptChild(visitor, getJavadoc());
470
				acceptChild(visitor, getJavadoc());
474
				acceptChild(visitor, getName());
471
				acceptChild(visitor, getName());
475
				acceptChild(visitor, getSuperclass());
472
				acceptChild(visitor, getSuperclass());
Lines 517-534 Link Here
517
	/**
514
	/**
518
	 * Returns the live ordered list of type parameters of this type 
515
	 * Returns the live ordered list of type parameters of this type 
519
	 * declaration (added in JLS3 API). This list is non-empty for parameterized types.
516
	 * declaration (added in JLS3 API). This list is non-empty for parameterized types.
520
	 * <p>
521
	 * Note: This API element is only needed for dealing with Java code that uses
522
	 * new language features of J2SE 1.5. It is included in anticipation of J2SE
523
	 * 1.5 support, which is planned for the next release of Eclipse after 3.0, and
524
	 * may change slightly before reaching its final form.
525
	 * </p>
526
	 * 
517
	 * 
527
	 * @return the live list of type parameters
518
	 * @return the live list of type parameters
528
	 *    (element type: <code>TypeParameter</code>)
519
	 *    (element type: <code>TypeParameter</code>)
529
	 * @exception UnsupportedOperationException if this operation is used in
520
	 * @exception UnsupportedOperationException if this operation is used in
530
	 * a JLS2 AST
521
	 * a JLS2 AST
531
	 * @since 3.0
522
	 * @since 3.1
532
	 */ 
523
	 */ 
533
	public List typeParameters() {
524
	public List typeParameters() {
534
		// more efficient than just calling unsupportedIn2() to check
525
		// more efficient than just calling unsupportedIn2() to check
Lines 551-560 Link Here
551
	 *    there is none
542
	 *    there is none
552
	 * @exception UnsupportedOperationException if this operation is used in
543
	 * @exception UnsupportedOperationException if this operation is used in
553
	 * an AST later than JLS2
544
	 * an AST later than JLS2
545
	 * @deprecated In the JLS3 API, this method is replaced by
546
	 * {@link #getSuperclassType()}, which returns a <code>Type</code>
547
	 * instead of a <code>Name</code>.
554
	 */ 
548
	 */ 
555
	// TODO (jeem) When JLS3 support is complete (post 3.0) - deprecated In the JLS3 API, this method is replaced by <code>getSuperclassType</code>, which returns a <code>Type</code> instead of a <code>Name</code>.
556
	public Name getSuperclass() {
549
	public Name getSuperclass() {
557
	    supportedOnlyIn2();
550
		return internalGetSuperclass();
551
	}
552
	
553
	/**
554
	 * Internal synonym for deprecated method. Used to avoid
555
	 * deprecation warnings.
556
	 * @since 3.1
557
	 */
558
	/*package*/ final Name internalGetSuperclass() {
559
		supportedOnlyIn2();
558
		return this.optionalSuperclassName;
560
		return this.optionalSuperclassName;
559
	}
561
	}
560
562
Lines 571-577 Link Here
571
	*    there is none
573
	*    there is none
572
	* @exception UnsupportedOperationException if this operation is used in
574
	* @exception UnsupportedOperationException if this operation is used in
573
	* a JLS2 AST
575
	* a JLS2 AST
574
	* @since 3.0
576
	* @since 3.1
575
	*/ 
577
	*/ 
576
	public Type getSuperclassType() {
578
	public Type getSuperclassType() {
577
	    unsupportedIn2();
579
	    unsupportedIn2();
Lines 596-604 Link Here
596
	 * </ul>
598
	 * </ul>
597
	 * @exception UnsupportedOperationException if this operation is used in
599
	 * @exception UnsupportedOperationException if this operation is used in
598
	 * an AST later than JLS2
600
	 * an AST later than JLS2
601
	 * @deprecated In the JLS3 API, this method is replaced by 
602
	 * {@link #setSuperclassType(Type)}, which expects a
603
	 * <code>Type</code> instead of a <code>Name</code>.
599
	 */ 
604
	 */ 
600
	// TODO (jeem) When JLS3 support is complete (post 3.0) - deprecated In the JLS3 API, this method is replaced by <code>setType</code>, which expects a <code>Type</code> instead of a <code>Name</code>.
601
	public void setSuperclass(Name superclassName) {
605
	public void setSuperclass(Name superclassName) {
606
		internalSetSuperclass(superclassName);
607
	}
608
	
609
	/**
610
	 * Internal synonym for deprecated method. Used to avoid
611
	 * deprecation warnings.
612
	 * @since 3.1
613
	 */
614
	/*package*/ final void internalSetSuperclass(Name superclassName) {
602
	    supportedOnlyIn2();
615
	    supportedOnlyIn2();
603
		ASTNode oldChild = this.optionalSuperclassName;
616
		ASTNode oldChild = this.optionalSuperclassName;
604
		preReplaceChild(oldChild, superclassName, SUPERCLASS_PROPERTY);
617
		preReplaceChild(oldChild, superclassName, SUPERCLASS_PROPERTY);
Lines 623-629 Link Here
623
	 * </ul>
636
	 * </ul>
624
	 * @exception UnsupportedOperationException if this operation is used in
637
	 * @exception UnsupportedOperationException if this operation is used in
625
	 * a JLS2 AST
638
	 * a JLS2 AST
626
	 * @since 3.0
639
	 * @since 3.1
627
	 */ 
640
	 */ 
628
	public void setSuperclassType(Type superclassType) {
641
	public void setSuperclassType(Type superclassType) {
629
	    unsupportedIn2();
642
	    unsupportedIn2();
Lines 644-652 Link Here
644
	 *    (element type: <code>Name</code>)
657
	 *    (element type: <code>Name</code>)
645
	 * @exception UnsupportedOperationException if this operation is used in
658
	 * @exception UnsupportedOperationException if this operation is used in
646
	 * an AST later than JLS2
659
	 * an AST later than JLS2
660
	 * @deprecated In the JLS3 API, this method is replaced by 
661
	 * {@link #superInterfaceTypes()}.
647
	 */ 
662
	 */ 
648
	// TODO (jeem) When JLS3 support is complete (post 3.0) - deprecated In the JLS3 API, this method is replaced by <code>superInterfaceTypes()</code>
649
	public List superInterfaces() {
663
	public List superInterfaces() {
664
		return internalSuperInterfaces();
665
	}
666
	
667
	/**
668
	 * Internal synonym for deprecated method. Used to avoid
669
	 * deprecation warnings.
670
	 * @since 3.1
671
	 */
672
	/*package*/ final List internalSuperInterfaces() {
650
		// more efficient than just calling supportedOnlyIn2() to check
673
		// more efficient than just calling supportedOnlyIn2() to check
651
		if (this.superInterfaceNames == null) {
674
		if (this.superInterfaceNames == null) {
652
			supportedOnlyIn2();
675
			supportedOnlyIn2();
Lines 664-670 Link Here
664
	 *    (element type: <code>Type</code>)
687
	 *    (element type: <code>Type</code>)
665
	 * @exception UnsupportedOperationException if this operation is used in
688
	 * @exception UnsupportedOperationException if this operation is used in
666
	 * a JLS2 AST
689
	 * a JLS2 AST
667
	 * @since 3.0
690
	 * @since 3.1
668
	 */ 
691
	 */ 
669
	public List superInterfaceTypes() {
692
	public List superInterfaceTypes() {
670
		// more efficient than just calling unsupportedIn2() to check
693
		// more efficient than just calling unsupportedIn2() to check
(-)dom/org/eclipse/jdt/core/dom/TypeDeclarationStatement.java (-10 / +32 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2004 IBM Corporation and others.
2
 * Copyright (c) 2000, 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 43-55 Link Here
43
	 * The "typeDeclaration" structural property of this node type (JLS2 API only).
43
	 * The "typeDeclaration" structural property of this node type (JLS2 API only).
44
	 * @since 3.0
44
	 * @since 3.0
45
	 */
45
	 */
46
	// TODO (jeem) When JLS3 support is complete (post 3.0) - deprecated Replaced by {@link #DECLARATION_PROPERTY} in the JLS3 API.
47
	public static final ChildPropertyDescriptor TYPE_DECLARATION_PROPERTY = 
46
	public static final ChildPropertyDescriptor TYPE_DECLARATION_PROPERTY = 
48
		new ChildPropertyDescriptor(TypeDeclarationStatement.class, "typeDeclaration", TypeDeclaration.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$
47
		new ChildPropertyDescriptor(TypeDeclarationStatement.class, "typeDeclaration", TypeDeclaration.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$
49
48
50
	/**
49
	/**
51
	 * The "declaration" structural property of this node type (added in JLS3 API).
50
	 * The "declaration" structural property of this node type (added in JLS3 API).
52
	 * @since 3.0
51
	 * @since 3.1
53
	 */
52
	 */
54
	public static final ChildPropertyDescriptor DECLARATION_PROPERTY = 
53
	public static final ChildPropertyDescriptor DECLARATION_PROPERTY = 
55
		new ChildPropertyDescriptor(TypeDeclarationStatement.class, "declaration", AbstractTypeDeclaration.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$
54
		new ChildPropertyDescriptor(TypeDeclarationStatement.class, "declaration", AbstractTypeDeclaration.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$
Lines 66-72 Link Here
66
	 * A list of property descriptors (element type: 
65
	 * A list of property descriptors (element type: 
67
	 * {@link StructuralPropertyDescriptor}),
66
	 * {@link StructuralPropertyDescriptor}),
68
	 * or null if uninitialized.
67
	 * or null if uninitialized.
69
	 * @since 3.0
68
	 * @since 3.1
70
	 */
69
	 */
71
	private static final List PROPERTY_DESCRIPTORS_3_0;
70
	private static final List PROPERTY_DESCRIPTORS_3_0;
72
	
71
	
Lines 94-100 Link Here
94
	 * @since 3.0
93
	 * @since 3.0
95
	 */
94
	 */
96
	public static List propertyDescriptors(int apiLevel) {
95
	public static List propertyDescriptors(int apiLevel) {
97
		if (apiLevel == AST.JLS2) {
96
		if (apiLevel == AST.JLS2_INTERNAL) {
98
			return PROPERTY_DESCRIPTORS_2_0;
97
			return PROPERTY_DESCRIPTORS_2_0;
99
		} else {
98
		} else {
100
			return PROPERTY_DESCRIPTORS_3_0;
99
			return PROPERTY_DESCRIPTORS_3_0;
Lines 197-203 Link Here
197
	 * statement (added in JLS3 API).
196
	 * statement (added in JLS3 API).
198
	 * 
197
	 * 
199
	 * @return the type declaration node
198
	 * @return the type declaration node
200
	 * @since 3.0
199
	 * @since 3.1
201
	 */ 
200
	 */ 
202
	public AbstractTypeDeclaration getDeclaration() {
201
	public AbstractTypeDeclaration getDeclaration() {
203
		if (this.typeDecl == null) {
202
		if (this.typeDecl == null) {
Lines 224-230 Link Here
224
	 * <li>the node already has a parent</li>
223
	 * <li>the node already has a parent</li>
225
	 * <li>a cycle in would be created</li>
224
	 * <li>a cycle in would be created</li>
226
	 * </ul>
225
	 * </ul>
227
	 * @since 3.0
226
	 * @since 3.1
228
	 */ 
227
	 */ 
229
	public void setDeclaration(AbstractTypeDeclaration decl) {
228
	public void setDeclaration(AbstractTypeDeclaration decl) {
230
		if (decl == null) {
229
		if (decl == null) {
Lines 245-254 Link Here
245
	 * @return the type declaration node
244
	 * @return the type declaration node
246
	 * @exception UnsupportedOperationException if this operation is used in
245
	 * @exception UnsupportedOperationException if this operation is used in
247
	 * an AST later than JLS2
246
	 * an AST later than JLS2
247
	 * @deprecated In the JLS3 API, this method is replaced by 
248
	 * {@link #getDeclaration()}, which returns <code>AbstractTypeDeclaration</code>
249
	 * instead of <code>TypeDeclaration</code>.
248
	 */ 
250
	 */ 
249
	// TODO (jeem) When JLS3 support is complete (post 3.0) - deprecated In the JLS3 API, this method is replaced by <code>getDeclaration</code>, which returns <code>AbstractTypeDeclaration</code> instead of <code>TypeDeclaration</code>.
250
	public TypeDeclaration getTypeDeclaration() {
251
	public TypeDeclaration getTypeDeclaration() {
251
	    supportedOnlyIn2();
252
		return internalGetTypeDeclaration();
253
	}
254
	
255
	/**
256
	 * Internal synonym for deprecated method. Used to avoid
257
	 * deprecation warnings.
258
	 * @since 3.1
259
	 */
260
	/*package*/ final TypeDeclaration internalGetTypeDeclaration() {
261
		supportedOnlyIn2();
252
		return (TypeDeclaration) getDeclaration();
262
		return (TypeDeclaration) getDeclaration();
253
	}
263
	}
254
		
264
		
Lines 265-273 Link Here
265
	 * </ul>
275
	 * </ul>
266
	 * @exception UnsupportedOperationException if this operation is used in
276
	 * @exception UnsupportedOperationException if this operation is used in
267
	 * an AST later than JLS2
277
	 * an AST later than JLS2
278
     * @deprecated In the JLS3 API, this method is replaced by 
279
     * {@link #setDeclaration(AbstractTypeDeclaration)} which takes
280
     * <code>AbstractTypeDeclaration</code> instead of
281
     * <code>TypeDeclaration</code>.
268
	 */ 
282
	 */ 
269
    // TODO (jeem) When JLS3 support is complete (post 3.0) - deprecated In the JLS3 API, this method is replaced by <code>setDeclaration</code> which takes <code>AbstractTypeDeclaration</code> instead of <code>TypeDeclaration</code>.
270
	public void setTypeDeclaration(TypeDeclaration decl) {
283
	public void setTypeDeclaration(TypeDeclaration decl) {
284
		internalSetTypeDeclaration(decl);
285
	}
286
	
287
	/**
288
	 * Internal synonym for deprecated method. Used to avoid
289
	 * deprecation warnings.
290
	 * @since 3.1
291
	 */
292
	/*package*/ final void internalSetTypeDeclaration(TypeDeclaration decl) {
271
	    supportedOnlyIn2();
293
	    supportedOnlyIn2();
272
		// forward to non-deprecated replacement method
294
		// forward to non-deprecated replacement method
273
		setDeclaration(decl);
295
		setDeclaration(decl);
(-)dom/org/eclipse/jdt/core/dom/TypeParameter.java (-11 / +1 lines)
Lines 20-46 Link Here
20
 * TypeParameter:
20
 * TypeParameter:
21
 *    TypeVariable [ <b>extends</b> Type { <b>&</b> Type } ]
21
 *    TypeVariable [ <b>extends</b> Type { <b>&</b> Type } ]
22
 * </pre>
22
 * </pre>
23
 * <p>
24
 * Note: This API element is only needed for dealing with Java code that uses
25
 * new language features of J2SE 1.5. It is included in anticipation of J2SE
26
 * 1.5 support, which is planned for the next release of Eclipse after 3.0, and
27
 * may change slightly before reaching its final form.
28
 * </p>
29
 * 
23
 * 
30
 * @since 3.0
24
 * @since 3.1
31
 */
25
 */
32
public class TypeParameter extends ASTNode {
26
public class TypeParameter extends ASTNode {
33
	
27
	
34
	/**
28
	/**
35
	 * The "name" structural property of this node type.
29
	 * The "name" structural property of this node type.
36
	 * @since 3.0
37
	 */
30
	 */
38
	public static final ChildPropertyDescriptor NAME_PROPERTY = 
31
	public static final ChildPropertyDescriptor NAME_PROPERTY = 
39
		new ChildPropertyDescriptor(TypeParameter.class, "name", SimpleName.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$
32
		new ChildPropertyDescriptor(TypeParameter.class, "name", SimpleName.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$
40
33
41
	/**
34
	/**
42
	 * The "typeBounds" structural property of this node type.
35
	 * The "typeBounds" structural property of this node type.
43
	 * @since 3.0
44
	 */
36
	 */
45
	public static final ChildListPropertyDescriptor TYPE_BOUNDS_PROPERTY = 
37
	public static final ChildListPropertyDescriptor TYPE_BOUNDS_PROPERTY = 
46
		new ChildListPropertyDescriptor(TypeParameter.class, "typeBounds", Type.class, NO_CYCLE_RISK); //$NON-NLS-1$
38
		new ChildListPropertyDescriptor(TypeParameter.class, "typeBounds", Type.class, NO_CYCLE_RISK); //$NON-NLS-1$
Lines 69-75 Link Here
69
61
70
	 * @return a list of property descriptors (element type: 
62
	 * @return a list of property descriptors (element type: 
71
	 * {@link StructuralPropertyDescriptor})
63
	 * {@link StructuralPropertyDescriptor})
72
	 * @since 3.0
73
	 */
64
	 */
74
	public static List propertyDescriptors(int apiLevel) {
65
	public static List propertyDescriptors(int apiLevel) {
75
		return PROPERTY_DESCRIPTORS;
66
		return PROPERTY_DESCRIPTORS;
Lines 205-211 Link Here
205
	 * 
196
	 * 
206
	 * @return the binding, or <code>null</code> if the binding cannot be 
197
	 * @return the binding, or <code>null</code> if the binding cannot be 
207
	 *    resolved
198
	 *    resolved
208
	 * @since 3.1
209
	 */	
199
	 */	
210
	public final ITypeBinding resolveBinding() {
200
	public final ITypeBinding resolveBinding() {
211
		return this.ast.getBindingResolver().resolveTypeParameter(this);
201
		return this.ast.getBindingResolver().resolveTypeParameter(this);
(-)dom/org/eclipse/jdt/core/dom/VariableDeclarationExpression.java (-15 / +18 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2004 IBM Corporation and others.
2
 * Copyright (c) 2000, 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 47-59 Link Here
47
	 * The "modifiers" structural property of this node type (JLS2 API only).
47
	 * The "modifiers" structural property of this node type (JLS2 API only).
48
	 * @since 3.0
48
	 * @since 3.0
49
	 */
49
	 */
50
	// TODO (jeem) When JLS3 support is complete (post 3.0) - deprecated Replaced by {@link #MODIFIERS2_PROPERTY} in the JLS3 API.
51
	public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = 
50
	public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = 
52
		new SimplePropertyDescriptor(VariableDeclarationExpression.class, "modifiers", int.class, MANDATORY); //$NON-NLS-1$
51
		new SimplePropertyDescriptor(VariableDeclarationExpression.class, "modifiers", int.class, MANDATORY); //$NON-NLS-1$
53
	
52
	
54
	/**
53
	/**
55
	 * The "modifiers" structural property of this node type (added in JLS3 API).
54
	 * The "modifiers" structural property of this node type (added in JLS3 API).
56
	 * @since 3.0
55
	 * @since 3.1
57
	 */
56
	 */
58
	public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = 
57
	public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = 
59
		new ChildListPropertyDescriptor(VariableDeclarationExpression.class, "modifiers", IExtendedModifier.class, CYCLE_RISK); //$NON-NLS-1$
58
		new ChildListPropertyDescriptor(VariableDeclarationExpression.class, "modifiers", IExtendedModifier.class, CYCLE_RISK); //$NON-NLS-1$
Lines 84-90 Link Here
84
	 * A list of property descriptors (element type: 
83
	 * A list of property descriptors (element type: 
85
	 * {@link StructuralPropertyDescriptor}),
84
	 * {@link StructuralPropertyDescriptor}),
86
	 * or null if uninitialized.
85
	 * or null if uninitialized.
87
	 * @since 3.0
86
	 * @since 3.1
88
	 */
87
	 */
89
	private static final List PROPERTY_DESCRIPTORS_3_0;
88
	private static final List PROPERTY_DESCRIPTORS_3_0;
90
	
89
	
Lines 116-122 Link Here
116
	 * @since 3.0
115
	 * @since 3.0
117
	 */
116
	 */
118
	public static List propertyDescriptors(int apiLevel) {
117
	public static List propertyDescriptors(int apiLevel) {
119
		if (apiLevel == AST.JLS2) {
118
		if (apiLevel == AST.JLS2_INTERNAL) {
120
			return PROPERTY_DESCRIPTORS_2_0;
119
			return PROPERTY_DESCRIPTORS_2_0;
121
		} else {
120
		} else {
122
			return PROPERTY_DESCRIPTORS_3_0;
121
			return PROPERTY_DESCRIPTORS_3_0;
Lines 235-241 Link Here
235
		VariableDeclarationExpression result = 
234
		VariableDeclarationExpression result = 
236
			new VariableDeclarationExpression(target);
235
			new VariableDeclarationExpression(target);
237
		result.setSourceRange(this.getStartPosition(), this.getLength());
236
		result.setSourceRange(this.getStartPosition(), this.getLength());
238
		if (this.ast.apiLevel == AST.JLS2) {
237
		if (this.ast.apiLevel == AST.JLS2_INTERNAL) {
239
			result.setModifiers(getModifiers());
238
			result.setModifiers(getModifiers());
240
		}
239
		}
241
		if (this.ast.apiLevel >= AST.JLS3) {
240
		if (this.ast.apiLevel >= AST.JLS3) {
Lines 279-296 Link Here
279
	 * Note that the final modifier is the only meaningful modifier for local
278
	 * Note that the final modifier is the only meaningful modifier for local
280
	 * variable declarations.
279
	 * variable declarations.
281
	 * </p>
280
	 * </p>
282
	 * <p>
283
	 * Note: This API element is only needed for dealing with Java code that uses
284
	 * new language features of J2SE 1.5. It is included in anticipation of J2SE
285
	 * 1.5 support, which is planned for the next release of Eclipse after 3.0, and
286
	 * may change slightly before reaching its final form.
287
	 * </p>
288
	 * 
281
	 * 
289
	 * @return the live list of modifiers and annotations
282
	 * @return the live list of modifiers and annotations
290
	 *    (element type: <code>IExtendedModifier</code>)
283
	 *    (element type: <code>IExtendedModifier</code>)
291
	 * @exception UnsupportedOperationException if this operation is used in
284
	 * @exception UnsupportedOperationException if this operation is used in
292
	 * a JLS2 AST
285
	 * a JLS2 AST
293
	 * @since 3.0
286
	 * @since 3.1
294
	 */ 
287
	 */ 
295
	public List modifiers() {
288
	public List modifiers() {
296
		// more efficient than just calling unsupportedIn2() to check
289
		// more efficient than just calling unsupportedIn2() to check
Lines 341-352 Link Here
341
	 * @exception UnsupportedOperationException if this operation is used in
334
	 * @exception UnsupportedOperationException if this operation is used in
342
	 * an AST later than JLS2
335
	 * an AST later than JLS2
343
	 * @see Modifier
336
	 * @see Modifier
337
	 * @deprecated In the JLS3 API, this method is replaced by 
338
	 * {@link  #modifiers()} which contains a list of a <code>Modifier</code> nodes.
344
	 */ 
339
	 */ 
345
	// TODO (jeem) When JLS3 support is complete (post 3.0) - deprecated In the JLS3 API, this method is replaced by <code>modifiers()</code> which contains a list of a <code>Modifier</code> nodes.
346
	public void setModifiers(int modifiers) {
340
	public void setModifiers(int modifiers) {
341
		internalSetModifiers(modifiers);
342
	}
343
	
344
	/**
345
	 * Internal synonym for deprecated method. Used to avoid
346
	 * deprecation warnings.
347
	 * @since 3.1
348
	 */
349
	/*package*/ final void internalSetModifiers(int pmodifiers) {
347
	    supportedOnlyIn2();
350
	    supportedOnlyIn2();
348
		preValueChange(MODIFIERS_PROPERTY);
351
		preValueChange(MODIFIERS_PROPERTY);
349
		this.modifierFlags = modifiers;
352
		this.modifierFlags = pmodifiers;
350
		postValueChange(MODIFIERS_PROPERTY);
353
		postValueChange(MODIFIERS_PROPERTY);
351
	}
354
	}
352
355
(-)dom/org/eclipse/jdt/core/dom/VariableDeclarationStatement.java (-10 / +19 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2004 IBM Corporation and others.
2
 * Copyright (c) 2000, 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 50-62 Link Here
50
	 * The "modifiers" structural property of this node type (JLS2 API only).
50
	 * The "modifiers" structural property of this node type (JLS2 API only).
51
	 * @since 3.0
51
	 * @since 3.0
52
	 */
52
	 */
53
	// TODO (jeem) When JLS3 support is complete (post 3.0) - deprecated Replaced by {@link #MODIFIERS2_PROPERTY} in the JLS3 API.
54
	public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = 
53
	public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = 
55
		new SimplePropertyDescriptor(VariableDeclarationStatement.class, "modifiers", int.class, MANDATORY); //$NON-NLS-1$
54
		new SimplePropertyDescriptor(VariableDeclarationStatement.class, "modifiers", int.class, MANDATORY); //$NON-NLS-1$
56
	
55
	
57
	/**
56
	/**
58
	 * The "modifiers" structural property of this node type (added in JLS3 API).
57
	 * The "modifiers" structural property of this node type (added in JLS3 API).
59
	 * @since 3.0
58
	 * @since 3.1
60
	 */
59
	 */
61
	public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = 
60
	public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = 
62
		new ChildListPropertyDescriptor(VariableDeclarationStatement.class, "modifiers", IExtendedModifier.class, CYCLE_RISK); //$NON-NLS-1$
61
		new ChildListPropertyDescriptor(VariableDeclarationStatement.class, "modifiers", IExtendedModifier.class, CYCLE_RISK); //$NON-NLS-1$
Lines 87-93 Link Here
87
	 * A list of property descriptors (element type: 
86
	 * A list of property descriptors (element type: 
88
	 * {@link StructuralPropertyDescriptor}),
87
	 * {@link StructuralPropertyDescriptor}),
89
	 * or null if uninitialized.
88
	 * or null if uninitialized.
90
	 * @since 3.0
89
	 * @since 3.1
91
	 */
90
	 */
92
	private static final List PROPERTY_DESCRIPTORS_3_0;
91
	private static final List PROPERTY_DESCRIPTORS_3_0;
93
	
92
	
Lines 119-125 Link Here
119
	 * @since 3.0
118
	 * @since 3.0
120
	 */
119
	 */
121
	public static List propertyDescriptors(int apiLevel) {
120
	public static List propertyDescriptors(int apiLevel) {
122
		if (apiLevel == AST.JLS2) {
121
		if (apiLevel == AST.JLS2_INTERNAL) {
123
			return PROPERTY_DESCRIPTORS_2_0;
122
			return PROPERTY_DESCRIPTORS_2_0;
124
		} else {
123
		} else {
125
			return PROPERTY_DESCRIPTORS_3_0;
124
			return PROPERTY_DESCRIPTORS_3_0;
Lines 130-136 Link Here
130
	 * The extended modifiers (element type: <code>IExtendedModifier</code>). 
129
	 * The extended modifiers (element type: <code>IExtendedModifier</code>). 
131
	 * Null in JLS2. Added in JLS3; defaults to an empty list
130
	 * Null in JLS2. Added in JLS3; defaults to an empty list
132
	 * (see constructor).
131
	 * (see constructor).
133
	 * @since 3.0
132
	 * @since 3.1
134
	 */
133
	 */
135
	private ASTNode.NodeList modifiers = null;
134
	private ASTNode.NodeList modifiers = null;
136
	
135
	
Lines 239-245 Link Here
239
			new VariableDeclarationStatement(target);
238
			new VariableDeclarationStatement(target);
240
		result.setSourceRange(this.getStartPosition(), this.getLength());
239
		result.setSourceRange(this.getStartPosition(), this.getLength());
241
		result.copyLeadingComment(this);
240
		result.copyLeadingComment(this);
242
		if (this.ast.apiLevel == AST.JLS2) {
241
		if (this.ast.apiLevel == AST.JLS2_INTERNAL) {
243
			result.setModifiers(getModifiers());
242
			result.setModifiers(getModifiers());
244
		}
243
		}
245
		if (this.ast.apiLevel >= AST.JLS3) {
244
		if (this.ast.apiLevel >= AST.JLS3) {
Lines 287-293 Link Here
287
	 *    (element type: <code>IExtendedModifier</code>)
286
	 *    (element type: <code>IExtendedModifier</code>)
288
	 * @exception UnsupportedOperationException if this operation is used in
287
	 * @exception UnsupportedOperationException if this operation is used in
289
	 * a JLS2 AST
288
	 * a JLS2 AST
290
	 * @since 3.0
289
	 * @since 3.1
291
	 */ 
290
	 */ 
292
	public List modifiers() {
291
	public List modifiers() {
293
		// more efficient than just calling unsupportedIn2() to check
292
		// more efficient than just calling unsupportedIn2() to check
Lines 338-349 Link Here
338
	 * @exception UnsupportedOperationException if this operation is used in
337
	 * @exception UnsupportedOperationException if this operation is used in
339
	 * an AST later than JLS2
338
	 * an AST later than JLS2
340
	 * @see Modifier
339
	 * @see Modifier
340
	 * @deprecated In the JLS3 API, this method is replaced by 
341
	 * {@link  #modifiers()} which contains a list of a <code>Modifier</code> nodes.
341
	 */ 
342
	 */ 
342
	// TODO (jeem) When JLS3 support is complete (post 3.0) - deprecated In the JLS3 API, this method is replaced by <code>modifiers()</code> which contains a list of a <code>Modifier</code> nodes.
343
	public void setModifiers(int modifiers) {
343
	public void setModifiers(int modifiers) {
344
		internalSetModifiers(modifiers);
345
	}
346
	
347
	/**
348
	 * Internal synonym for deprecated method. Used to avoid
349
	 * deprecation warnings.
350
	 * @since 3.1
351
	 */
352
	/*package*/ final void internalSetModifiers(int pmodifiers) {
344
	    supportedOnlyIn2();
353
	    supportedOnlyIn2();
345
		preValueChange(MODIFIERS_PROPERTY);
354
		preValueChange(MODIFIERS_PROPERTY);
346
		this.modifierFlags = modifiers;
355
		this.modifierFlags = pmodifiers;
347
		postValueChange(MODIFIERS_PROPERTY);
356
		postValueChange(MODIFIERS_PROPERTY);
348
	}
357
	}
349
358
(-)dom/org/eclipse/jdt/core/dom/WildcardType.java (-11 / +2 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2003, 2004 IBM Corporation and others.
2
 * Copyright (c) 2003, 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 25-51 Link Here
25
 * it is nonsense if a wildcard type node appears anywhere other than as an
25
 * it is nonsense if a wildcard type node appears anywhere other than as an
26
 * argument of a <code>ParameterizedType</code> node.
26
 * argument of a <code>ParameterizedType</code> node.
27
 * </p>
27
 * </p>
28
 * <p>
29
 * Note: This API element is only needed for dealing with Java code that uses
30
 * new language features of J2SE 1.5. It is included in anticipation of J2SE
31
 * 1.5 support, which is planned for the next release of Eclipse after 3.0, and
32
 * may change slightly before reaching its final form.
33
 * </p>
34
 * 
28
 * 
35
 * @since 3.0
29
 * @since 3.1
36
 */
30
 */
37
public class WildcardType extends Type {
31
public class WildcardType extends Type {
38
	
32
	
39
	/**
33
	/**
40
	 * The "bound" structural property of this node type.
34
	 * The "bound" structural property of this node type.
41
	 * @since 3.0
42
	 */
35
	 */
43
	public static final ChildPropertyDescriptor BOUND_PROPERTY = 
36
	public static final ChildPropertyDescriptor BOUND_PROPERTY = 
44
		new ChildPropertyDescriptor(WildcardType.class, "bound", Type.class, OPTIONAL, CYCLE_RISK); //$NON-NLS-1$
37
		new ChildPropertyDescriptor(WildcardType.class, "bound", Type.class, OPTIONAL, CYCLE_RISK); //$NON-NLS-1$
45
38
46
	/**
39
	/**
47
	 * The "upperBound" structural property of this node type.
40
	 * The "upperBound" structural property of this node type.
48
	 * @since 3.0
49
	 */
41
	 */
50
	public static final SimplePropertyDescriptor UPPER_BOUND_PROPERTY = 
42
	public static final SimplePropertyDescriptor UPPER_BOUND_PROPERTY = 
51
		new SimplePropertyDescriptor(WildcardType.class, "upperBound", boolean.class, MANDATORY); //$NON-NLS-1$
43
		new SimplePropertyDescriptor(WildcardType.class, "upperBound", boolean.class, MANDATORY); //$NON-NLS-1$
Lines 74-80 Link Here
74
66
75
	 * @return a list of property descriptors (element type: 
67
	 * @return a list of property descriptors (element type: 
76
	 * {@link StructuralPropertyDescriptor})
68
	 * {@link StructuralPropertyDescriptor})
77
	 * @since 3.0
78
	 */
69
	 */
79
	public static List propertyDescriptors(int apiLevel) {
70
	public static List propertyDescriptors(int apiLevel) {
80
		return PROPERTY_DESCRIPTORS;
71
		return PROPERTY_DESCRIPTORS;
(-)dom/org/eclipse/jdt/core/dom/rewrite/ASTRewrite.java (-1 / +1 lines)
Lines 51-57 Link Here
51
 * </p>
51
 * </p>
52
 * <pre>
52
 * <pre>
53
 * Document doc = new Document("import java.util.List;\nclass X {}\n");
53
 * Document doc = new Document("import java.util.List;\nclass X {}\n");
54
 * ASTParser parser = ASTParser.newParser(AST.JLS2);
54
 * ASTParser parser = ASTParser.newParser(AST.JLS3);
55
 * parser.setSource(doc.get().toCharArray());
55
 * parser.setSource(doc.get().toCharArray());
56
 * CompilationUnit cu = (CompilationUnit) parser.createAST(null);
56
 * CompilationUnit cu = (CompilationUnit) parser.createAST(null);
57
 * AST ast = cu.getAST();
57
 * AST ast = cu.getAST();
(-)dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java (-12 / +19 lines)
Lines 63-68 Link Here
63
 */
63
 */
64
public final class ASTRewriteAnalyzer extends ASTVisitor {
64
public final class ASTRewriteAnalyzer extends ASTVisitor {
65
	
65
	
66
	/**
67
	 * Internal synonynm for deprecated constant AST.JLS2
68
	 * to alleviate deprecation warnings.
69
	 * @deprecated
70
	 */
71
	/*package*/ static final int JLS2_INTERNAL = AST.JLS2;
72
	
66
	TextEdit currentEdit;
73
	TextEdit currentEdit;
67
	final RewriteEventStore eventStore; // used from inner classes
74
	final RewriteEventStore eventStore; // used from inner classes
68
	
75
	
Lines 1329-1335 Link Here
1329
		
1336
		
1330
		int pos= rewriteJavadoc(node, TypeDeclaration.JAVADOC_PROPERTY);
1337
		int pos= rewriteJavadoc(node, TypeDeclaration.JAVADOC_PROPERTY);
1331
		
1338
		
1332
		if (apiLevel == AST.JLS2) {
1339
		if (apiLevel == JLS2_INTERNAL) {
1333
			rewriteModifiers(node, TypeDeclaration.MODIFIERS_PROPERTY, pos);
1340
			rewriteModifiers(node, TypeDeclaration.MODIFIERS_PROPERTY, pos);
1334
		} else {
1341
		} else {
1335
			rewriteModifiers2(node, TypeDeclaration.MODIFIERS2_PROPERTY, pos);
1342
			rewriteModifiers2(node, TypeDeclaration.MODIFIERS2_PROPERTY, pos);
Lines 1362-1368 Link Here
1362
		
1369
		
1363
		// superclass
1370
		// superclass
1364
		if (!isInterface || invertType) {
1371
		if (!isInterface || invertType) {
1365
			ChildPropertyDescriptor superClassProperty= (apiLevel == AST.JLS2) ? TypeDeclaration.SUPERCLASS_PROPERTY : TypeDeclaration.SUPERCLASS_TYPE_PROPERTY;
1372
			ChildPropertyDescriptor superClassProperty= (apiLevel == JLS2_INTERNAL) ? TypeDeclaration.SUPERCLASS_PROPERTY : TypeDeclaration.SUPERCLASS_TYPE_PROPERTY;
1366
1373
1367
			RewriteEvent superClassEvent= getEvent(node, superClassProperty);
1374
			RewriteEvent superClassEvent= getEvent(node, superClassProperty);
1368
			
1375
			
Lines 1396-1402 Link Here
1396
			}
1403
			}
1397
		}
1404
		}
1398
		// extended interfaces
1405
		// extended interfaces
1399
		ChildListPropertyDescriptor superInterfaceProperty= (apiLevel == AST.JLS2) ? TypeDeclaration.SUPER_INTERFACES_PROPERTY : TypeDeclaration.SUPER_INTERFACE_TYPES_PROPERTY;
1406
		ChildListPropertyDescriptor superInterfaceProperty= (apiLevel == JLS2_INTERNAL) ? TypeDeclaration.SUPER_INTERFACES_PROPERTY : TypeDeclaration.SUPER_INTERFACE_TYPES_PROPERTY;
1400
1407
1401
		RewriteEvent interfaceEvent= getEvent(node, superInterfaceProperty);
1408
		RewriteEvent interfaceEvent= getEvent(node, superInterfaceProperty);
1402
		if (interfaceEvent == null || interfaceEvent.getChangeKind() == RewriteEvent.UNCHANGED) {
1409
		if (interfaceEvent == null || interfaceEvent.getChangeKind() == RewriteEvent.UNCHANGED) {
Lines 1436-1442 Link Here
1436
	}
1443
	}
1437
1444
1438
	private void rewriteReturnType(MethodDeclaration node, boolean isConstructor, boolean isConstructorChange) {
1445
	private void rewriteReturnType(MethodDeclaration node, boolean isConstructor, boolean isConstructorChange) {
1439
		ChildPropertyDescriptor property= (node.getAST().apiLevel() == AST.JLS2) ? MethodDeclaration.RETURN_TYPE_PROPERTY : MethodDeclaration.RETURN_TYPE2_PROPERTY;
1446
		ChildPropertyDescriptor property= (node.getAST().apiLevel() == JLS2_INTERNAL) ? MethodDeclaration.RETURN_TYPE_PROPERTY : MethodDeclaration.RETURN_TYPE2_PROPERTY;
1440
1447
1441
		// weakness in the AST: return type can exist, even if missing in source
1448
		// weakness in the AST: return type can exist, even if missing in source
1442
		ASTNode originalReturnType= (ASTNode) getOriginalValue(node, property);
1449
		ASTNode originalReturnType= (ASTNode) getOriginalValue(node, property);
Lines 1471-1477 Link Here
1471
			return doVisitUnchangedChildren(node);
1478
			return doVisitUnchangedChildren(node);
1472
		}
1479
		}
1473
		int pos= rewriteJavadoc(node, MethodDeclaration.JAVADOC_PROPERTY);
1480
		int pos= rewriteJavadoc(node, MethodDeclaration.JAVADOC_PROPERTY);
1474
		if (node.getAST().apiLevel() == AST.JLS2) {
1481
		if (node.getAST().apiLevel() == JLS2_INTERNAL) {
1475
			rewriteModifiers(node, MethodDeclaration.MODIFIERS_PROPERTY, pos);
1482
			rewriteModifiers(node, MethodDeclaration.MODIFIERS_PROPERTY, pos);
1476
		} else {
1483
		} else {
1477
			pos= rewriteModifiers2(node, MethodDeclaration.MODIFIERS2_PROPERTY, pos);
1484
			pos= rewriteModifiers2(node, MethodDeclaration.MODIFIERS2_PROPERTY, pos);
Lines 1829-1835 Link Here
1829
		}
1836
		}
1830
		
1837
		
1831
		int pos= rewriteOptionalQualifier(node, ClassInstanceCreation.EXPRESSION_PROPERTY, node.getStartPosition());
1838
		int pos= rewriteOptionalQualifier(node, ClassInstanceCreation.EXPRESSION_PROPERTY, node.getStartPosition());
1832
		if (node.getAST().apiLevel() == AST.JLS2) {
1839
		if (node.getAST().apiLevel() == JLS2_INTERNAL) {
1833
			pos= rewriteRequiredNode(node, ClassInstanceCreation.NAME_PROPERTY);
1840
			pos= rewriteRequiredNode(node, ClassInstanceCreation.NAME_PROPERTY);
1834
		} else {
1841
		} else {
1835
			if (isChanged(node, ClassInstanceCreation.TYPE_ARGUMENTS_PROPERTY)) {
1842
			if (isChanged(node, ClassInstanceCreation.TYPE_ARGUMENTS_PROPERTY)) {
Lines 1995-2001 Link Here
1995
		}
2002
		}
1996
		int pos= rewriteJavadoc(node, FieldDeclaration.JAVADOC_PROPERTY);
2003
		int pos= rewriteJavadoc(node, FieldDeclaration.JAVADOC_PROPERTY);
1997
2004
1998
		if (node.getAST().apiLevel() == AST.JLS2) {
2005
		if (node.getAST().apiLevel() == JLS2_INTERNAL) {
1999
			rewriteModifiers(node, FieldDeclaration.MODIFIERS_PROPERTY, pos);
2006
			rewriteModifiers(node, FieldDeclaration.MODIFIERS_PROPERTY, pos);
2000
		} else {
2007
		} else {
2001
			rewriteModifiers2(node, FieldDeclaration.MODIFIERS2_PROPERTY, pos);
2008
			rewriteModifiers2(node, FieldDeclaration.MODIFIERS2_PROPERTY, pos);
Lines 2208-2214 Link Here
2208
			return doVisitUnchangedChildren(node);
2215
			return doVisitUnchangedChildren(node);
2209
		}
2216
		}
2210
		int pos= rewriteJavadoc(node, Initializer.JAVADOC_PROPERTY);
2217
		int pos= rewriteJavadoc(node, Initializer.JAVADOC_PROPERTY);
2211
		if (node.getAST().apiLevel() == AST.JLS2) {
2218
		if (node.getAST().apiLevel() == JLS2_INTERNAL) {
2212
			rewriteModifiers(node, Initializer.MODIFIERS_PROPERTY, pos);
2219
			rewriteModifiers(node, Initializer.MODIFIERS_PROPERTY, pos);
2213
		} else {
2220
		} else {
2214
			rewriteModifiers2(node, Initializer.MODIFIERS2_PROPERTY, pos);
2221
			rewriteModifiers2(node, Initializer.MODIFIERS2_PROPERTY, pos);
Lines 2424-2430 Link Here
2424
			return doVisitUnchangedChildren(node);
2431
			return doVisitUnchangedChildren(node);
2425
		}
2432
		}
2426
		int pos= node.getStartPosition();
2433
		int pos= node.getStartPosition();
2427
		if (node.getAST().apiLevel() == AST.JLS2) {
2434
		if (node.getAST().apiLevel() == JLS2_INTERNAL) {
2428
			rewriteModifiers(node, SingleVariableDeclaration.MODIFIERS_PROPERTY, pos);
2435
			rewriteModifiers(node, SingleVariableDeclaration.MODIFIERS_PROPERTY, pos);
2429
		} else {
2436
		} else {
2430
			rewriteModifiers2(node, SingleVariableDeclaration.MODIFIERS2_PROPERTY, pos);
2437
			rewriteModifiers2(node, SingleVariableDeclaration.MODIFIERS2_PROPERTY, pos);
Lines 2686-2692 Link Here
2686
		if (!hasChildrenChanges(node)) {
2693
		if (!hasChildrenChanges(node)) {
2687
			return doVisitUnchangedChildren(node);
2694
			return doVisitUnchangedChildren(node);
2688
		}
2695
		}
2689
		if (node.getAST().apiLevel() == AST.JLS2) {
2696
		if (node.getAST().apiLevel() == JLS2_INTERNAL) {
2690
			rewriteRequiredNode(node, TypeDeclarationStatement.TYPE_DECLARATION_PROPERTY);	
2697
			rewriteRequiredNode(node, TypeDeclarationStatement.TYPE_DECLARATION_PROPERTY);	
2691
		} else {
2698
		} else {
2692
			rewriteRequiredNode(node, TypeDeclarationStatement.DECLARATION_PROPERTY);	
2699
			rewriteRequiredNode(node, TypeDeclarationStatement.DECLARATION_PROPERTY);	
Lines 2716-2722 Link Here
2716
		
2723
		
2717
		// same code as FieldDeclaration
2724
		// same code as FieldDeclaration
2718
		int pos= node.getStartPosition();
2725
		int pos= node.getStartPosition();
2719
		if (node.getAST().apiLevel() == AST.JLS2) {
2726
		if (node.getAST().apiLevel() == JLS2_INTERNAL) {
2720
			rewriteModifiers(node, VariableDeclarationExpression.MODIFIERS_PROPERTY, pos);
2727
			rewriteModifiers(node, VariableDeclarationExpression.MODIFIERS_PROPERTY, pos);
2721
		} else {
2728
		} else {
2722
			rewriteModifiers2(node, VariableDeclarationExpression.MODIFIERS2_PROPERTY, pos);
2729
			rewriteModifiers2(node, VariableDeclarationExpression.MODIFIERS2_PROPERTY, pos);
Lines 2764-2770 Link Here
2764
		
2771
		
2765
		// same code as FieldDeclaration
2772
		// same code as FieldDeclaration
2766
		int pos= node.getStartPosition();
2773
		int pos= node.getStartPosition();
2767
		if (node.getAST().apiLevel() == AST.JLS2) {
2774
		if (node.getAST().apiLevel() == JLS2_INTERNAL) {
2768
			rewriteModifiers(node, VariableDeclarationStatement.MODIFIERS_PROPERTY, pos);
2775
			rewriteModifiers(node, VariableDeclarationStatement.MODIFIERS_PROPERTY, pos);
2769
		} else {
2776
		} else {
2770
			rewriteModifiers2(node, VariableDeclarationStatement.MODIFIERS2_PROPERTY, pos);
2777
			rewriteModifiers2(node, VariableDeclarationStatement.MODIFIERS2_PROPERTY, pos);
(-)dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFlattener.java (-12 / +19 lines)
Lines 16-21 Link Here
16
16
17
public class ASTRewriteFlattener extends ASTVisitor {
17
public class ASTRewriteFlattener extends ASTVisitor {
18
	
18
	
19
	/**
20
	 * Internal synonynm for deprecated constant AST.JSL2
21
	 * to alleviate deprecation warnings.
22
	 * @deprecated
23
	 */
24
	/*package*/ static final int JLS2_INTERNAL = AST.JLS2;
25
	
19
	public static String asString(ASTNode node, RewriteEventStore store) {
26
	public static String asString(ASTNode node, RewriteEventStore store) {
20
		ASTRewriteFlattener flattener= new ASTRewriteFlattener(store);
27
		ASTRewriteFlattener flattener= new ASTRewriteFlattener(store);
21
		node.accept(flattener);
28
		node.accept(flattener);
Lines 315-321 Link Here
315
			this.result.append('.');
322
			this.result.append('.');
316
		}
323
		}
317
		this.result.append("new ");//$NON-NLS-1$
324
		this.result.append("new ");//$NON-NLS-1$
318
		if (node.getAST().apiLevel() == AST.JLS2) {
325
		if (node.getAST().apiLevel() == JLS2_INTERNAL) {
319
			getChildNode(node, ClassInstanceCreation.NAME_PROPERTY).accept(this);
326
			getChildNode(node, ClassInstanceCreation.NAME_PROPERTY).accept(this);
320
		} else {
327
		} else {
321
			visitList(node, ClassInstanceCreation.TYPE_ARGUMENTS_PROPERTY, String.valueOf(','), String.valueOf('<'), String.valueOf('>'));
328
			visitList(node, ClassInstanceCreation.TYPE_ARGUMENTS_PROPERTY, String.valueOf(','), String.valueOf('<'), String.valueOf('>'));
Lines 431-437 Link Here
431
		if (javadoc != null) {
438
		if (javadoc != null) {
432
			javadoc.accept(this);
439
			javadoc.accept(this);
433
		}
440
		}
434
		if (node.getAST().apiLevel() == AST.JLS2) {
441
		if (node.getAST().apiLevel() == JLS2_INTERNAL) {
435
			printModifiers(getIntAttribute(node, FieldDeclaration.MODIFIERS_PROPERTY), this.result);
442
			printModifiers(getIntAttribute(node, FieldDeclaration.MODIFIERS_PROPERTY), this.result);
436
		} else {
443
		} else {
437
			visitList(node, FieldDeclaration.MODIFIERS2_PROPERTY, String.valueOf(' '), EMPTY, String.valueOf(' '));
444
			visitList(node, FieldDeclaration.MODIFIERS2_PROPERTY, String.valueOf(' '), EMPTY, String.valueOf(' '));
Lines 535-541 Link Here
535
		if (javadoc != null) {
542
		if (javadoc != null) {
536
			javadoc.accept(this);
543
			javadoc.accept(this);
537
		}
544
		}
538
		if (node.getAST().apiLevel() == AST.JLS2) {
545
		if (node.getAST().apiLevel() == JLS2_INTERNAL) {
539
			printModifiers(getIntAttribute(node, Initializer.MODIFIERS_PROPERTY), this.result);
546
			printModifiers(getIntAttribute(node, Initializer.MODIFIERS_PROPERTY), this.result);
540
		} else {
547
		} else {
541
			visitList(node, Initializer.MODIFIERS2_PROPERTY, String.valueOf(' '), EMPTY, String.valueOf(' '));
548
			visitList(node, Initializer.MODIFIERS2_PROPERTY, String.valueOf(' '), EMPTY, String.valueOf(' '));
Lines 576-582 Link Here
576
		if (javadoc != null) {
583
		if (javadoc != null) {
577
			javadoc.accept(this);
584
			javadoc.accept(this);
578
		}
585
		}
579
		if (node.getAST().apiLevel() == AST.JLS2) {
586
		if (node.getAST().apiLevel() == JLS2_INTERNAL) {
580
			printModifiers(getIntAttribute(node, MethodDeclaration.MODIFIERS_PROPERTY), this.result);
587
			printModifiers(getIntAttribute(node, MethodDeclaration.MODIFIERS_PROPERTY), this.result);
581
		} else {
588
		} else {
582
			visitList(node, MethodDeclaration.MODIFIERS2_PROPERTY, String.valueOf(' '), EMPTY, String.valueOf(' '));
589
			visitList(node, MethodDeclaration.MODIFIERS2_PROPERTY, String.valueOf(' '), EMPTY, String.valueOf(' '));
Lines 584-590 Link Here
584
		}
591
		}
585
				
592
				
586
		if (!getBooleanAttribute(node, MethodDeclaration.CONSTRUCTOR_PROPERTY)) {
593
		if (!getBooleanAttribute(node, MethodDeclaration.CONSTRUCTOR_PROPERTY)) {
587
			if (node.getAST().apiLevel() == AST.JLS2) {
594
			if (node.getAST().apiLevel() == JLS2_INTERNAL) {
588
				getChildNode(node, MethodDeclaration.RETURN_TYPE_PROPERTY).accept(this);
595
				getChildNode(node, MethodDeclaration.RETURN_TYPE_PROPERTY).accept(this);
589
			} else {
596
			} else {
590
				ASTNode returnType = getChildNode(node, MethodDeclaration.RETURN_TYPE2_PROPERTY);
597
				ASTNode returnType = getChildNode(node, MethodDeclaration.RETURN_TYPE2_PROPERTY);
Lines 747-753 Link Here
747
	 * @see ASTVisitor#visit(SingleVariableDeclaration)
754
	 * @see ASTVisitor#visit(SingleVariableDeclaration)
748
	 */
755
	 */
749
	public boolean visit(SingleVariableDeclaration node) {
756
	public boolean visit(SingleVariableDeclaration node) {
750
		if (node.getAST().apiLevel() == AST.JLS2) {
757
		if (node.getAST().apiLevel() == JLS2_INTERNAL) {
751
			printModifiers(getIntAttribute(node, SingleVariableDeclaration.MODIFIERS_PROPERTY), this.result);
758
			printModifiers(getIntAttribute(node, SingleVariableDeclaration.MODIFIERS_PROPERTY), this.result);
752
		} else {
759
		} else {
753
			visitList(node, SingleVariableDeclaration.MODIFIERS2_PROPERTY, String.valueOf(' '), EMPTY, String.valueOf(' '));
760
			visitList(node, SingleVariableDeclaration.MODIFIERS2_PROPERTY, String.valueOf(' '), EMPTY, String.valueOf(' '));
Lines 921-927 Link Here
921
			javadoc.accept(this);
928
			javadoc.accept(this);
922
		}
929
		}
923
930
924
		if (apiLevel == AST.JLS2) {
931
		if (apiLevel == JLS2_INTERNAL) {
925
			printModifiers(getIntAttribute(node, TypeDeclaration.MODIFIERS_PROPERTY), this.result);
932
			printModifiers(getIntAttribute(node, TypeDeclaration.MODIFIERS_PROPERTY), this.result);
926
		} else {
933
		} else {
927
			visitList(node, TypeDeclaration.MODIFIERS2_PROPERTY, String.valueOf(' '), EMPTY, String.valueOf(' '));
934
			visitList(node, TypeDeclaration.MODIFIERS2_PROPERTY, String.valueOf(' '), EMPTY, String.valueOf(' '));
Lines 936-942 Link Here
936
943
937
		this.result.append(' ');
944
		this.result.append(' ');
938
		
945
		
939
		ChildPropertyDescriptor superClassProperty= (apiLevel == AST.JLS2) ? TypeDeclaration.SUPERCLASS_PROPERTY : TypeDeclaration.SUPERCLASS_TYPE_PROPERTY;
946
		ChildPropertyDescriptor superClassProperty= (apiLevel == JLS2_INTERNAL) ? TypeDeclaration.SUPERCLASS_PROPERTY : TypeDeclaration.SUPERCLASS_TYPE_PROPERTY;
940
		ASTNode superclass= getChildNode(node, superClassProperty);
947
		ASTNode superclass= getChildNode(node, superClassProperty);
941
		if (superclass != null) {
948
		if (superclass != null) {
942
			this.result.append("extends "); //$NON-NLS-1$
949
			this.result.append("extends "); //$NON-NLS-1$
Lines 944-950 Link Here
944
			this.result.append(' ');
951
			this.result.append(' ');
945
		}
952
		}
946
		
953
		
947
		ChildListPropertyDescriptor superInterfaceProperty= (apiLevel == AST.JLS2) ? TypeDeclaration.SUPER_INTERFACES_PROPERTY : TypeDeclaration.SUPER_INTERFACE_TYPES_PROPERTY;
954
		ChildListPropertyDescriptor superInterfaceProperty= (apiLevel == JLS2_INTERNAL) ? TypeDeclaration.SUPER_INTERFACES_PROPERTY : TypeDeclaration.SUPER_INTERFACE_TYPES_PROPERTY;
948
		String lead= isInterface ? "extends " : "implements ";  //$NON-NLS-1$//$NON-NLS-2$
955
		String lead= isInterface ? "extends " : "implements ";  //$NON-NLS-1$//$NON-NLS-2$
949
		visitList(node, superInterfaceProperty, String.valueOf(','), lead, EMPTY);
956
		visitList(node, superInterfaceProperty, String.valueOf(','), lead, EMPTY);
950
		this.result.append('{');
957
		this.result.append('{');
Lines 957-963 Link Here
957
	 * @see ASTVisitor#visit(TypeDeclarationStatement)
964
	 * @see ASTVisitor#visit(TypeDeclarationStatement)
958
	 */
965
	 */
959
	public boolean visit(TypeDeclarationStatement node) {
966
	public boolean visit(TypeDeclarationStatement node) {
960
		if (node.getAST().apiLevel() == AST.JLS2) {
967
		if (node.getAST().apiLevel() == JLS2_INTERNAL) {
961
			getChildNode(node, TypeDeclarationStatement.TYPE_DECLARATION_PROPERTY).accept(this);
968
			getChildNode(node, TypeDeclarationStatement.TYPE_DECLARATION_PROPERTY).accept(this);
962
		} else {
969
		} else {
963
			getChildNode(node, TypeDeclarationStatement.DECLARATION_PROPERTY).accept(this);
970
			getChildNode(node, TypeDeclarationStatement.DECLARATION_PROPERTY).accept(this);
Lines 978-984 Link Here
978
	 * @see ASTVisitor#visit(VariableDeclarationExpression)
985
	 * @see ASTVisitor#visit(VariableDeclarationExpression)
979
	 */
986
	 */
980
	public boolean visit(VariableDeclarationExpression node) {
987
	public boolean visit(VariableDeclarationExpression node) {
981
		if (node.getAST().apiLevel() == AST.JLS2) {
988
		if (node.getAST().apiLevel() == JLS2_INTERNAL) {
982
			printModifiers(getIntAttribute(node, VariableDeclarationExpression.MODIFIERS_PROPERTY), this.result);
989
			printModifiers(getIntAttribute(node, VariableDeclarationExpression.MODIFIERS_PROPERTY), this.result);
983
		} else {
990
		} else {
984
			visitList(node, VariableDeclarationExpression.MODIFIERS2_PROPERTY, String.valueOf(' '), EMPTY, String.valueOf(' '));
991
			visitList(node, VariableDeclarationExpression.MODIFIERS2_PROPERTY, String.valueOf(' '), EMPTY, String.valueOf(' '));
Lines 1010-1016 Link Here
1010
	 * @see ASTVisitor#visit(VariableDeclarationStatement)
1017
	 * @see ASTVisitor#visit(VariableDeclarationStatement)
1011
	 */
1018
	 */
1012
	public boolean visit(VariableDeclarationStatement node) {
1019
	public boolean visit(VariableDeclarationStatement node) {
1013
		if (node.getAST().apiLevel() == AST.JLS2) {
1020
		if (node.getAST().apiLevel() == JLS2_INTERNAL) {
1014
			printModifiers(getIntAttribute(node, VariableDeclarationStatement.MODIFIERS_PROPERTY), this.result);
1021
			printModifiers(getIntAttribute(node, VariableDeclarationStatement.MODIFIERS_PROPERTY), this.result);
1015
		} else {
1022
		} else {
1016
			visitList(node, VariableDeclarationStatement.MODIFIERS2_PROPERTY, String.valueOf(' '), EMPTY, String.valueOf(' '));
1023
			visitList(node, VariableDeclarationStatement.MODIFIERS2_PROPERTY, String.valueOf(' '), EMPTY, String.valueOf(' '));

Return to bug 69657