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

(-)compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java (-1 / +4 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
2
 * Copyright (c) 2000, 2011 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 163-168 Link Here
163
	// for all method/constructor invocations (msg, alloc, expl. constr call)
163
	// for all method/constructor invocations (msg, alloc, expl. constr call)
164
	public static final int Unchecked = Bit17;
164
	public static final int Unchecked = Bit17;
165
	
165
	
166
	// for javadoc - used to indicate whether the javadoc has to be resolved
167
	public static final int ResolveJavadoc = Bit17;
168
	
166
	// for empty statement
169
	// for empty statement
167
	public static final int IsUsefulEmptyStatement = Bit1;
170
	public static final int IsUsefulEmptyStatement = Bit1;
168
171
(-)compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java (-2 / +11 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
2
 * Copyright (c) 2000, 2011 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-43 Link Here
38
	public Javadoc(int sourceStart, int sourceEnd) {
38
	public Javadoc(int sourceStart, int sourceEnd) {
39
		this.sourceStart = sourceStart;
39
		this.sourceStart = sourceStart;
40
		this.sourceEnd = sourceEnd;
40
		this.sourceEnd = sourceEnd;
41
		this.bits |= ASTNode.ResolveJavadoc;
41
	}
42
	}
42
	/**
43
	/**
43
	 * Returns whether a type can be seen at a given visibility level or not.
44
	 * Returns whether a type can be seen at a given visibility level or not.
Lines 184-189 Link Here
184
	 * Resolve type javadoc
185
	 * Resolve type javadoc
185
	 */
186
	 */
186
	public void resolve(ClassScope scope) {
187
	public void resolve(ClassScope scope) {
188
		if ((this.bits & ASTNode.ResolveJavadoc) == 0) {
189
			return;
190
		}
187
		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=247037, @inheritDoc tag cannot
191
		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=247037, @inheritDoc tag cannot
188
		// be used in the documentation comment for a class or interface.
192
		// be used in the documentation comment for a class or interface.
189
		if (this.inheritedPositions != null) {
193
		if (this.inheritedPositions != null) {
Lines 244-249 Link Here
244
	 * Resolve compilation unit javadoc
248
	 * Resolve compilation unit javadoc
245
	 */
249
	 */
246
	public void resolve(CompilationUnitScope unitScope) {
250
	public void resolve(CompilationUnitScope unitScope) {
251
		if ((this.bits & ASTNode.ResolveJavadoc) == 0) {
252
			return;
253
		}
247
		// Do nothing - This is to mimic the SDK's javadoc tool behavior, which neither
254
		// Do nothing - This is to mimic the SDK's javadoc tool behavior, which neither
248
		// sanity checks nor generates documentation using comments at the CU scope 
255
		// sanity checks nor generates documentation using comments at the CU scope 
249
		// (unless the unit happens to be package-info.java - in which case we don't come here.) 
256
		// (unless the unit happens to be package-info.java - in which case we don't come here.) 
Lines 253-259 Link Here
253
	 * Resolve method javadoc
260
	 * Resolve method javadoc
254
	 */
261
	 */
255
	public void resolve(MethodScope methScope) {
262
	public void resolve(MethodScope methScope) {
256
263
		if ((this.bits & ASTNode.ResolveJavadoc) == 0) {
264
			return;
265
		}
257
		// get method declaration
266
		// get method declaration
258
		AbstractMethodDeclaration methDecl = methScope.referenceMethod();
267
		AbstractMethodDeclaration methDecl = methScope.referenceMethod();
259
		boolean overriding = methDecl == null /* field declaration */ || methDecl.binding == null /* compiler error */
268
		boolean overriding = methDecl == null /* field declaration */ || methDecl.binding == null /* compiler error */
(-)compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java (-1 lines)
Lines 1500-1506 Link Here
1500
			if (ENABLED.equals(optionValue)) {
1500
			if (ENABLED.equals(optionValue)) {
1501
				this.processAnnotations = true;
1501
				this.processAnnotations = true;
1502
				this.storeAnnotations = true; // annotation processing requires annotation to be stored
1502
				this.storeAnnotations = true; // annotation processing requires annotation to be stored
1503
				this.docCommentSupport = true;  // annotation processing requires javadoc processing
1504
			} else if (DISABLED.equals(optionValue)) {
1503
			} else if (DISABLED.equals(optionValue)) {
1505
				this.processAnnotations = false;
1504
				this.processAnnotations = false;
1506
				this.storeAnnotations = false;
1505
				this.storeAnnotations = false;
(-)compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java (-1 / +2 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
2
 * Copyright (c) 2000, 2011 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 48-53 Link Here
48
48
49
	// Options
49
	// Options
50
	public boolean checkDocComment = false;
50
	public boolean checkDocComment = false;
51
	public boolean setJavadocPositions = false;
51
	public boolean reportProblems;
52
	public boolean reportProblems;
52
	protected long complianceLevel;
53
	protected long complianceLevel;
53
	protected long sourceLevel;
54
	protected long sourceLevel;
(-)compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java (-1 / +10 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
2
 * Copyright (c) 2000, 2011 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 46-51 Link Here
46
	public JavadocParser(Parser sourceParser) {
46
	public JavadocParser(Parser sourceParser) {
47
		super(sourceParser);
47
		super(sourceParser);
48
		this.kind = COMPIL_PARSER | TEXT_VERIF;
48
		this.kind = COMPIL_PARSER | TEXT_VERIF;
49
		if (sourceParser != null && sourceParser.options != null) {
50
			this.setJavadocPositions = sourceParser.options.processAnnotations;
51
		}
49
	}
52
	}
50
53
51
	/* (non-Javadoc)
54
	/* (non-Javadoc)
Lines 67-72 Link Here
67
		// Init javadoc if necessary
70
		// Init javadoc if necessary
68
		if (this.checkDocComment) {
71
		if (this.checkDocComment) {
69
			this.docComment = new Javadoc(this.javadocStart, this.javadocEnd);
72
			this.docComment = new Javadoc(this.javadocStart, this.javadocEnd);
73
		} else if (this.setJavadocPositions) {
74
			// https://bugs.eclipse.org/bugs/show_bug.cgi?id=189459
75
			// if annotation processors are there, javadoc object is required but
76
			// they need not be resolved
77
			this.docComment = new Javadoc(this.javadocStart, this.javadocEnd);
78
			this.docComment.bits &= ~ASTNode.ResolveJavadoc;
70
		} else {
79
		} else {
71
			this.docComment = null;
80
			this.docComment = null;
72
		}
81
		}
(-)src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java (-2 / +23 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
2
 * Copyright (c) 2000, 2011 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 30-35 Link Here
30
	String reportMissingJavadocCommentsVisibility = null;
30
	String reportMissingJavadocCommentsVisibility = null;
31
	String reportDeprecation = CompilerOptions.ERROR;
31
	String reportDeprecation = CompilerOptions.ERROR;
32
	String reportJavadocDeprecation = null;
32
	String reportJavadocDeprecation = null;
33
	String processAnnotations = null;
33
34
34
public JavadocBugsTest(String name) {
35
public JavadocBugsTest(String name) {
35
	super(name);
36
	super(name);
Lines 80-85 Link Here
80
	if (this.reportMissingJavadocDescription != null) {
81
	if (this.reportMissingJavadocDescription != null) {
81
		options.put(CompilerOptions.OPTION_ReportMissingJavadocTagDescription, this.reportMissingJavadocDescription);
82
		options.put(CompilerOptions.OPTION_ReportMissingJavadocTagDescription, this.reportMissingJavadocDescription);
82
	}
83
	}
84
	if (this.processAnnotations != null) {
85
		options.put(CompilerOptions.OPTION_Process_Annotations, this.processAnnotations);
86
	}
83
	options.put(CompilerOptions.OPTION_ReportFieldHiding, CompilerOptions.IGNORE);
87
	options.put(CompilerOptions.OPTION_ReportFieldHiding, CompilerOptions.IGNORE);
84
	options.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE);
88
	options.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE);
85
	options.put(CompilerOptions.OPTION_ReportDeprecation, this.reportDeprecation);
89
	options.put(CompilerOptions.OPTION_ReportDeprecation, this.reportDeprecation);
Lines 8631-8635 Link Here
8631
			JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
8635
			JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
8632
	);
8636
	);
8633
}
8637
}
8634
8638
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=316782
8639
// Test to verify that turning on process annotations doesn't turn on javadoc check
8640
public void testBug316782() {
8641
	if (this.complianceLevel < ClassFileConstants.JDK1_5) {
8642
		return;
8643
	}
8644
	this.processAnnotations = CompilerOptions.ENABLED;
8645
	this.docCommentSupport = CompilerOptions.DISABLED;
8646
	runConformTest(
8647
		new String[] {
8648
			"X.java",
8649
			"/**  @see X.XX.XXX */\n" +
8650
				"public class X {\n" +
8651
				"/**  @see X.XX.XXX */\n" +
8652
				"    public void foo() { }\n" +
8653
				"}\n"
8654
		});
8655
}
8635
}
8656
}

Return to bug 189459