Bug 88206 - ASTParser is ignoring my javadoc
Summary: ASTParser is ignoring my javadoc
Status: VERIFIED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.1 M6   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 88185 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-03-16 12:27 EST by Jeffrey Liu CLA
Modified: 2005-06-27 15:19 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeffrey Liu CLA 2005-03-16 12:27:54 EST
Eclipse 3.1M5

I'm using ASTParser to parse the java file below. Problem is ASTParser is not 
returning the javadoc for my interface. The following code returns null.

node.getJavadoc(); // where node is the interface declaration node

What I found is that if I put a blank line between the interface declaration 
and the next javadoc (see below)

public interface IOptionalTask extends ITask {

    /**
     * Optional task status constant 

then everything works. Here's the java file:

/******************************************************************************
*
 * Copyright (c) 2004, 2005 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - Initial API and implementation
 
*******************************************************************************
/
package org.eclipse.wst.server.core;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;

/**
 * An optional task. 
 * 
 * [issue: EY It is not clear to me that when this task will be run. Is this 
task be used for
 * both the server task and the module task? Will the place where the
 * task is being run depends on the server, e.g. the TDC tasks for the v6 
server should be run
 * after the server is started the modules are added to the server; however, 
the EJB deploy task
 * makes more sense to be run before adding the project to the server.]
 * 
 * @since 1.0
 */
public interface IOptionalTask extends ITask {
    /**
     * Optional task status constant (value 0) indicating that the task
     * should not be run.
     * 
     * @see #getStatus()
     */
	public static final int TASK_UNNECESSARY = 0;
    /**
     * Optional task status constant (value 1) indicating that the task
     * is completed.
     * 
     * @see #getStatus()
     */
	public static final int TASK_COMPLETED = 1;
    /**
     * Optional task status constant (value 2) indicating that the task
     * is ready to be run.
     * 
     * @see #getStatus()
     */
	public static final int TASK_READY = 2;
    /**
     * Optional task status constant (value 3) indicating that the task
     * should be selected to be run by default.
     * 
     * @see #getStatus()
     */
	public static final int TASK_PREFERRED = 3;
    /**
     * Optional task status constant (value 4) indicating that the task
     * must be run.
     * 
     * @see #getStatus()
     */
	public static final int TASK_MANDATORY = 4;

	/**
	 * Returns the status of this task.
     * 
     * issue: EY Should this status can return any of the TASK_XXX? The 
TASK_XXX looks
     * like a mix of status, e.g. for TASK_COMPLETED and TASK_READY. The other 
TASK_XXX
     * look like a nature of the task, e.g. TASK_UNNECESSARY, TASK_PREFERRED, 
TASK_MANDATORY.
     * Is this being used for both status and deciding whether the task should 
be shown? 
     *  
     * @return one of the status of the task (<code>TASK_XXX</code>)
     * constants declared on {@link IOptionalTask}
     * @since 1.0
	 */
	public int getStatus();
	
	/**
	 * Returns the order (index/priority) of the task that will be run. 
The task with
     * a smaller order value will be run before the task with a bigger order 
value.
     * For tasks that have the same order value, the order of running those 
task are 
     * not guaranteed.  
	 * 
	 * @return the order (index/priority) of the task that will be run.
	 */
	public int getOrder();
}
Comment 1 Frederic Fusier CLA 2005-03-16 12:39:56 EST
Same question as for bug 88200: does the Javadoc appears in ASTView tree or not?
Comment 2 Jeffrey Liu CLA 2005-03-16 12:46:14 EST
I believe javadoc is showing up correctly. There is a javadoc node inside the 
type declaration node.
Comment 3 Jeffrey Liu CLA 2005-03-16 14:37:45 EST
*** Bug 88185 has been marked as a duplicate of this bug. ***
Comment 4 Frederic Fusier CLA 2005-03-17 06:48:04 EST
As said in bug 88200, I cannot reproduce your problem using your visitor.
I've tested with last integration build and M5, both results are correct.
Any other hint to help me to reproduce?
Comment 5 Frederic Fusier CLA 2005-03-18 10:19:35 EST
Please reopen while provindg requested info and if you find a reproduceable test
case, thanks
Comment 6 Jeffrey Liu CLA 2005-06-27 15:19:45 EDT
Verified with RC3.