Bug 328611 - different key value for second level member class of a generic type
Summary: different key value for second level member class of a generic type
Status: VERIFIED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows Server 2003
: P3 normal (vote)
Target Milestone: 3.7 M4   Edit
Assignee: Jay Arthanareeswaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-25 10:34 EDT by Zsolt Thalmeiner CLA
Modified: 2011-01-25 11:17 EST (History)
2 users (show)

See Also:


Attachments
Example project (1.70 KB, application/octet-stream)
2010-10-25 10:38 EDT, Zsolt Thalmeiner CLA
no flags Details
workaround patch (1.32 KB, text/plain)
2010-10-26 03:23 EDT, Zsolt Thalmeiner CLA
no flags Details
Test case (2.17 KB, patch)
2010-11-29 09:30 EST, Jay Arthanareeswaran CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zsolt Thalmeiner CLA 2010-10-25 10:34:41 EDT
Build Identifier: I20100608-0911

When editing the example code, different keys will be generated for class C but not for class B.

1.
If the source A.java is modified, generated keys are
"Leclipse/bug/A<TT;>.B;" for generic member class B, respectivelly
"Leclipse/bug/A<TT;>.B.C;" for generic member class C.
In this case binding objects are MemberTypeBinding.

2.
If the source Test.java  is modified, generated keys are
"Leclipse/bug/A<TT;>.B;" for generic member class B, respectivelly
"Leclipse/bug/A$B$C;" for generic member class C.
In this case binding objects are BinaryTypeBinding.

I find the difference in ResourceBinding.computeGenericTypeSignature(TypeVariableBinding[]) method.
As I see the MemberTypeBinding object for class B has the ExtraCompilerModifiers.AccGenericSignature flag, but the BinaryTypeBinding object for class B hasn't.

I don't know if it is a problem.

Reproducible: Always
Comment 1 Zsolt Thalmeiner CLA 2010-10-25 10:38:22 EDT
Created attachment 181642 [details]
Example project
Comment 2 Zsolt Thalmeiner CLA 2010-10-26 03:23:16 EDT
Created attachment 181699 [details]
workaround patch
Comment 3 Jay Arthanareeswaran CLA 2010-11-29 09:30:56 EST
Created attachment 184040 [details]
Test case

Zsolt, can you provide us a test case or the steps to reproduce the problem? The attached test case produces a similar error but in a different part of the code. 

Between, you meant ReferenceBinding and not ResourceBinding, right?
Comment 4 Jay Arthanareeswaran CLA 2010-11-29 09:31:22 EST
Thanks for the test case, Srikanth.
Comment 5 Zsolt Thalmeiner CLA 2010-11-29 10:08:56 EST
(In reply to comment #3)
> Zsolt, can you provide us a test case or the steps to reproduce the problem?
> The attached test case produces a similar error but in a different part of the
> code.
Sorry, I have no test case for this problem :(

Our AST visitor (extension of org.eclipse.jdt.internal.compiler.ASTVisitor) stores the type bindings in a map using string keys:
String key = String.valueOf(typeBinding.computeUniqueKey());

These key values are different, as I described in the description.

> Between, you meant ReferenceBinding and not ResourceBinding, right?
Yes, I meant ReferenceBinding.

I hope this will help you. If not, I should try to make small working example.
Comment 6 Srikanth Sankaran CLA 2010-11-29 22:24:47 EST
(In reply to comment #4)
> Thanks for the test case, Srikanth.

Just for the record, this test case elicits a very similar but not
identical issue.
Comment 7 Jay Arthanareeswaran CLA 2010-12-01 08:23:45 EST
(In reply to comment #5)
> I hope this will help you. If not, I should try to make small working example.

I would really appreciate an example. I am not able to come up with something myself.
Comment 8 Zsolt Thalmeiner CLA 2010-12-08 10:23:54 EST
(In reply to comment #7)
> I would really appreciate an example. I am not able to come up with something
> myself.
I'm working on it but it is not so simple...
Comment 9 Zsolt Thalmeiner CLA 2010-12-10 09:50:24 EST
As I see the mentioned problem appears only in our code because we are doing a project-wide analysis where binary and source bindings must have the same keys. As I see, the JDT compiler works in different way so I think this problem is not a JDT bug.
Thanks, and I am sorry for wasting your time.
Comment 10 Olivier Thomann CLA 2011-01-25 11:17:01 EST
Verified.