Bug 219820

Summary: [1.6][compiler] APT should not enable doc comment support
Product: [Eclipse Project] JDT Reporter: Philipe Mulet <philippe_mulet>
Component: CoreAssignee: Satyam Kandula <satyam.kandula>
Status: VERIFIED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: jarthana, Olivier_Thomann
Version: 3.4Keywords: performance
Target Milestone: 3.7 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Philipe Mulet CLA 2008-02-21 11:50:43 EST
Build 3.4M4

Currently the batch compiler enables doc comment support as soon as processors are made available:

Why do we enable the docCommentSupport (javadoc) in compiler as soon as APT is turned on ?

		if ((optionValue = optionsMap.get(OPTION_Process_Annotations)) != null) {
			if (ENABLED.equals(optionValue)) {
				this.processAnnotations = true;
				this.storeAnnotations = true; // annotation processing requires annotation to be stored
				this.docCommentSupport = true;  // annotation processing requires javadoc processing
			} else if (DISABLED.equals(optionValue)) {
				this.processAnnotations = false;
				this.storeAnnotations = false;
			}
		}

This is pretty expensive, as it triggers some parsing and reference resolutions (could also cause some side effects).
Comment 1 Philipe Mulet CLA 2008-02-21 11:51:51 EST
Historical explanation is:
This is because there is no way to get the javadoc position for elements in the type system otherwise. 
APT needs the positions of the javadoc. It doesn't need to actually process the javadoc itself.
Comment 2 Philipe Mulet CLA 2008-02-21 11:52:32 EST
Olivier - is the position required on bindings ? or only on declarations ?
Comment 3 Olivier Thomann CLA 2008-02-21 11:58:23 EST
on declarations if I remember well.
Comment 4 Olivier Thomann CLA 2011-02-25 13:38:17 EST
Satyam, isn't this fixed in HEAD?
Comment 5 Satyam Kandula CLA 2011-02-27 23:27:09 EST
Yes, this is fixed in HEAD as part of bug 189459. Hence, marking this as a duplicate.

*** This bug has been marked as a duplicate of bug 189459 ***
Comment 6 Jay Arthanareeswaran CLA 2011-03-08 05:36:50 EST
Verified for 3.7M6 using build I20110301-1537.