Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 350003

Summary: [1.7] [compiler] AnnotationPolymorphicSignature tag is not being set to invokeExact while compiling MethodHandle source file
Product: [Eclipse Project] JDT Reporter: Satyam Kandula <satyam.kandula>
Component: CoreAssignee: Satyam Kandula <satyam.kandula>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public, Olivier_Thomann, srikanth_sankaran
Version: 3.7Flags: Olivier_Thomann: review+
Target Milestone: 3.7.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed patch
none
Same patch with fixed typos none

Description Satyam Kandula CLA 2011-06-22 02:35:35 EDT
Generally the MethodHandle class file is used to resolve any calls to its classes, but there are occasions that the associated source file will be used during search. In these cases, I see that the AnnotationPolymorphicSignature tag is not being set.
Comment 1 Satyam Kandula CLA 2011-06-22 02:49:00 EDT
Created attachment 198371 [details]
Proposed patch

java.lang.invoke.MethodHandle.PolymorphicSignature is being searched for, while  java.lang.invoke.MethodHandle$PolymorphicSignature is getting passed for. I haven't removed the previous checks. 
Olivier, do you think java.lang.invoke.MethodHandle.PolymorphicSignature could be passed sometimes?
Comment 2 Olivier Thomann CLA 2011-06-24 13:55:30 EDT
Patch looks good. I'll attach a new one with typos fixed.
Could you please provide steps that is passing in the new code ?
Comment 3 Olivier Thomann CLA 2011-06-24 14:00:14 EDT
Created attachment 198562 [details]
Same patch with fixed typos
Comment 4 Olivier Thomann CLA 2011-06-24 14:00:53 EDT
Patch itself looks good, but I would like to see a test case that goes through that code.
Comment 5 Satyam Kandula CLA 2011-06-27 10:07:38 EDT
(In reply to comment #4)
Adding a test case seems to be difficult, will try!
Comment 6 Olivier Thomann CLA 2011-06-27 10:18:06 EDT
In this case, just describe the steps that led to this fix, please.
Thanks.
Comment 7 Satyam Kandula CLA 2011-06-28 12:08:38 EDT
Consistent way is to run this through debugger with a fresh workspace
1. Create a Java7 project with a jdk with sources.
2. Put a break point in ReferenceBinding#computeId() around the patch. 
3. Create a dummy class file and try to search for Method references to MethodHandle.invokeExact(). 
4. Breakpoint should be hit.
Comment 8 Satyam Kandula CLA 2011-06-28 12:10:07 EDT
Released the patch on BETA_JAVA7 branch
Comment 9 Curtis Windatt CLA 2011-07-20 17:31:58 EDT
Verified using the steps from comment #7.