Summary: | [1.5][compiler] Array clone return type should be governed by source level instead of compliance | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Philipe Mulet <philippe_mulet> | ||||||
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> | ||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||
Severity: | normal | ||||||||
Priority: | P3 | ||||||||
Version: | 3.5 | ||||||||
Target Milestone: | 3.5 M3 | ||||||||
Hardware: | PC | ||||||||
OS: | Windows XP | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
Philipe Mulet
2008-09-15 11:57:03 EDT
Created attachment 112557 [details]
Test patch
Created attachment 112567 [details]
Better regression tests
Added ArrayTest#test014-017
Change being combined with bug 247292. Specific fix takes place in 2 places: MessageSend#computeConversion(...) following portion should refer to sourceLevel instead of complianceLevel: } else if (this.actualReceiverType.isArrayType() && runtimeTimeType.id != TypeIds.T_JavaLangObject && this.binding.parameters == Binding.NO_PARAMETERS && scope.compilerOptions().complianceLevel >= ClassFileConstants.JDK1_5 && CharOperation.equals(this.binding.selector, TypeConstants.CLONE)) { // from 1.5 compliant mode on, array#clone() resolves to array type, but codegen to #clone()Object - thus require extra inserted cast this.valueCast = runtimeTimeType; also MessageSend#resolveType(...) should refer to sourceLevel instead of complianceLevel in following code: // from 1.5 compliance on, array#clone() returns the array type (but binding still shows Object) if (this.actualReceiverType.isArrayType() && this.binding.parameters == Binding.NO_PARAMETERS && compilerOptions.complianceLevel >= ClassFileConstants.JDK1_5 && CharOperation.equals(this.binding.selector, TypeConstants.CLONE)) { this.resolvedType = this.actualReceiverType; Released for 3.5M3. Fixed Verified for 3.5M3 using I20081026-2000 build. |