| Summary: | [1.8][compiler] Various loose ends in 308 code generation. | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Srikanth Sankaran <srikanth_sankaran> | ||||
| Component: | Core | Assignee: | Andrew Clement <aclement> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | Flags: | srikanth_sankaran:
review+
|
||||
| Version: | 4.3 | ||||||
| Target Milestone: | BETA J8 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Bug Depends on: | |||||||
| Bug Blocks: | 409235 | ||||||
| Attachments: |
|
||||||
|
Description
Srikanth Sankaran
I just commented on https://bugs.eclipse.org/bugs/show_bug.cgi?id=414384 that that is the only open issue against your name - Andy, please also take up this one. Thanks! If these two are resolved, we are ready to declare the 308 code generation project (https://bugs.eclipse.org/bugs/show_bug.cgi?id=409235) completed. > (1) Should TypeAnnotationCodeStream.invoke(byte, MethodBinding, TypeBinding, TypeReference[]) be checking for ASTNode.HasTypeAnnotations ? Checking it feels like a nice cheap check before going looking for something that may or may not be there. Or do you think something more untoward is happening? I see the TODO on that line says can we do the test at a higher level? We can, but it does make a bit of a mess of the codebase. Requiring the caller to discover/remember whether any of the type arguments have type annotations and pass that information around in addition to the type arguments. I am inclined to leave it as it is. But really the reason to change any of this is if we think the extra overhead of iterating through type arguments in the invoke() method is too costly. Given that most methods don't have type arguments that code just won't run anyway, in the normal case. > (2) Is ExtendedAnnotation violating javadoc of IExtendedAnnotation.getLocalVariableTable() ? I guess this refers to the fact that it might return a null object when the javadoc says it will return an empty array. This should be tidied up, yes, but in practice it won't go wrong right now as nobody asks for the local variable table unless they are expecting it to be there at the moment. > (3) CodeStream(s): Is the method CodeStream.newArray(TypeReference, ArrayBinding) needed ? No, we can ditch it. > (4) ClassFile.addFieldAttributes: Needs a relook. Ok, I can switch it to setting the bit during resolution. Created attachment 234718 [details]
patch to address the issues here
This includes the changes I mention in the previous comment
(1) removed TODO
(2) creates an empty array by default that will be used. Could set it empty on reference but I just went this way...
(3) Unnecessary newArray removed
(4) parser setting of bits removed. resolution steps in local/field declarations now setting the bits.
For some reason, your patches don't apply clean when I paste them on the package explorer. The problem seems to be always with the last file, I get by applying the changes manually. Fix looks good: Released here: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=BETA_JAVA8&id=e965722f47023ae407b487744865b93f56cfe7d1. Thanks Andy |