Bug 56697 - An error during parsing and AST tree.
Summary: An error during parsing and AST tree.
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M9   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-30 03:11 EST by David CLA
Modified: 2004-05-19 12:30 EDT (History)
0 users

See Also:


Attachments
Classes (6.38 KB, application/x-zip-compressed)
2004-03-30 09:30 EST, David CLA
no flags Details
The AP502002 Class (35.76 KB, application/octet-stream)
2004-04-01 01:33 EST, David CLA
no flags Details
Test case to try on your machine (723 bytes, application/octet-stream)
2004-04-01 13:36 EST, Olivier Thomann CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description David CLA 2004-03-30 03:11:30 EST
Hi!

I've found an error during parsing and AST tree.

I use an AST tree and a visitor class.

The visitor method 'endVisit' (with QualifiedName as parameter) has this lines:

IBinding i_binding = qualifiedName.getQualifier().resolveBinding();	
					
ITypeBinding type_binding = qualifiedName.getQualifier().resolveTypeBinding();


The problems is that when visitor inspect lines as:


  private int[] posicionTabla = new int[]
        {
            AP502002.CODNIVEL3, AP502002.NOMNIVEL3, AP502002.CODAUTORIZA,
            AP502002.NOMUSRCIA, AP502002.TIPAUTORIZA, AP502002.NOMAUTORIZA,
            AP502002.CODCTOAUTORIZA, AP502002.NOMCTOAUTORIZA, AP502002.CODMON,
            AP502002.NOMMON, AP502002.MCAINH, AP502002.IMPORTEAUTORIZA,
            AP502002.NUMDECIMALES
        };


the type_binding variables is only correct (not null) for the first element in 
the array. It is null for the next ones. 

AP502002 extends from JFrame and all fields are ints.
Comment 1 Olivier Thomann CLA 2004-03-30 09:13:59 EST
Could you please attach your complete test case? It is easier for us to
reproduce your problem.
Comment 2 Olivier Thomann CLA 2004-03-30 09:17:25 EST
I will investigate as soon as I have your test case. Please zip the file and
attach it to this bug report.
Comment 3 David CLA 2004-03-30 09:30:09 EST
Created attachment 9005 [details]
Classes
Comment 4 Olivier Thomann CLA 2004-03-30 09:40:16 EST
Thanks, I will check it with the 3.0 builds.
Comment 5 Olivier Thomann CLA 2004-03-30 09:44:50 EST
Could you please provide the source for the class AP502002?
Thanks.
Comment 6 Olivier Thomann CLA 2004-03-31 14:19:49 EST
Decrease severity as I am waiting for complete reproducable test case.
Comment 7 David CLA 2004-04-01 01:33:33 EST
Created attachment 9082 [details]
The AP502002 Class
Comment 8 Olivier Thomann CLA 2004-04-01 13:14:22 EST
All the fields in your array initializer are wrong.
The names in the file you sent me are preceeded with 'ivj'. Is this a mistake
submitting the bug?

I will try to reproduce your problem with a simple test case.
Comment 9 Olivier Thomann CLA 2004-04-01 13:33:37 EST
I tried to reproduce your problem but unsuccessfully.
I will attach my test case. Could you please try it on your side and let me know
if it is working?

Thanks.
Comment 10 Olivier Thomann CLA 2004-04-01 13:35:03 EST
I tried only in 3.0 stream.
Comment 11 Olivier Thomann CLA 2004-04-01 13:36:27 EST
Created attachment 9102 [details]
Test case to try on your machine
Comment 12 David CLA 2004-04-02 02:15:52 EST
Hi!

I run your test case and the problem persist.

I'm using VE 2.1.2 and java 1.4.2_3.

My code prefix the fields names with a 'ivj' prefix.

can you send me your 'parser code' that do this changes?

Many thanks!
Comment 13 Olivier Thomann CLA 2004-04-05 16:59:03 EDT
I build up an example and I removed the 'ivj' prefix.

I need some clarifications. Are you saying that you write some code that refers
to field without the prefix and you expect to get the bindings?

Could you please describe what you are doing to get the problem from an empty
worspace?

Thanks.
Comment 14 Olivier Thomann CLA 2004-04-20 16:29:18 EDT
Close as WORKSFORME.
Reopen if you can provide a simple test case that shows the problem. Trying to
reproduce it using your description is unsuccessful so far.