Bug 66551 - Error in org.eclipse.swt project on class PrinterData
Summary: Error in org.eclipse.swt project on class PrinterData
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 RC2   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 66594 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-06-10 12:55 EDT by Michael Van Meekeren CLA
Modified: 2004-06-11 10:47 EDT (History)
2 users (show)

See Also:


Attachments
Patch to start lookup in more appropriate context (750 bytes, patch)
2004-06-10 15:07 EDT, Philipe Mulet CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Van Meekeren CLA 2004-06-10 12:55:41 EDT
build 20040610 - 0800
- load SWT + UI from HEAD at 12 noon on June 10.

- I have a single class in SWT called PrinterData that does not seem to 
compile.
- the error is "Missing code implementation in the compiler
	PrinterData.java	org.eclipse.swt/Eclipse SWT 
Printing/common/org/eclipse/swt/printing	line 1	June 10, 2004 12:50:59 
PM"

- recompiling/delete and checkout again will not fix this.  I'm not sure why 
this is happening
Comment 1 Michael Van Meekeren CLA 2004-06-10 12:58:07 EDT
This is an older workspace (at least 1 week I think), not a new one.  
Comment 2 Michael Van Meekeren CLA 2004-06-10 13:00:30 EDT
strangely, when I change the constructor to the following: 
	/**
	 * Constructs an instance of this class with the given
	 * printer driver and printer name.
	 *
	 * @param driver the printer driver for the printer
	 * @param name the name of the printer
	 *
	 * @exception SWTError <ul>
	 *    <li>ERROR_NO_HANDLES - if there are no valid printers
	 * </ul>
	 *
	 * @see #driver
	 * @see #name
	 */
	public PrinterData(String driver2, String name2) {
		this.driver = driver2;
		this.name = name2;
	}

it starts to compile.
Comment 3 Frederic Fusier CLA 2004-06-10 13:40:40 EDT
Surely a side effect of bug 65180. I investigate...
Comment 4 Frederic Fusier CLA 2004-06-10 14:23:31 EDT
Problem comes from following type of javadoc reference:
public class Test {
    int field;
    /**
     *  @see #field
     */
    void foo(int field) {
    }

}

field is now incorrectly bound to parameter instead of field...
Comment 5 Philipe Mulet CLA 2004-06-10 15:07:23 EDT
Created attachment 11900 [details]
Patch to start lookup in more appropriate context

I don't like the previous patch. I believe the problem is rather that you start
the resolution in the context of the method, instead of the context of the
enclosing type.
Comment 6 Philipe Mulet CLA 2004-06-10 15:23:47 EDT
Actually, my patch does allow @param tags to resolve any longer. Need to make 
the JavadocFieldReference starts its lookup in parent scope alone.
Comment 7 Frederic Fusier CLA 2004-06-10 15:30:14 EDT
Problem of this patch was that we would not allow to resolve @param tags
parameter name reference...
As the workaround is quite simple: rename parameters with different name than
fields, we need to figure out if this is really necessary to fixed this for 3.0
or deferred it...
Comment 8 Olivier Thomann CLA 2004-06-10 15:44:30 EDT
As this is breaking code in the visual editor, I think it is pretty serious.
Comment 9 Olivier Thomann CLA 2004-06-10 15:49:10 EDT
Using:

public class Test {
    int field;
    /**
     *  Comment {@link #field}
     */
    void foo(int field) {
    }

}

is causing the same problem. This is causing some grief during the build of the
visual editor project.
Comment 10 Peter Walker CLA 2004-06-10 16:30:43 EDT
In one of our classes we have several ctor's that have this type of syntax and 
resulted in compile errors and a broken build. Here's an example of one of the 
constructors:
	/**
	 * Creates an empty instance with the given result index.
	 * @param resultIndex the {@link #resultIndex}.
	 */
	public CompoundCommand(int resultIndex) {
		super();
		this.resultIndex = resultIndex;
		commandList = new ArrayList();
	}

This code has been around for ages and has never been a problem until now.
Comment 11 Jerome Lanneluc CLA 2004-06-10 17:19:13 EDT
*** Bug 66594 has been marked as a duplicate of this bug. ***
Comment 12 Philipe Mulet CLA 2004-06-10 17:33:45 EDT
Must fix for 3.0. If we can get it finalized for RC2, we should contribute it. 
If not, then it will be for RC3.
Comment 13 Philipe Mulet CLA 2004-06-10 17:59:37 EDT
Released for integration. Fix is stepping out of methodScope for implicit 
lookup only (using Scope#classScope()).

Frederic - pls add regression tests.
Comment 14 Frederic Fusier CLA 2004-06-10 18:35:23 EDT
Test cases added in JavadocTestMixed
Comment 15 David Audel CLA 2004-06-11 10:47:41 EDT
Verified for 3.0RC2 I20040611