Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 340386 - CompilerBindings - method "toTypeName": wrong computation on primitives
Summary: CompilerBindings - method "toTypeName": wrong computation on primitives
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Recommenders (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Marcel Bruch CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-17 21:02 EDT by Andreas Kaluza CLA
Modified: 2019-07-24 14:36 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kaluza CLA 2011-03-17 21:02:35 EDT
The primitive type "int" leads to the output "Lint" --> should be "I" IMHO
The primitive array type "int[]" --> should be "[I" IMHO
Comment 1 Andreas Kaluza CLA 2011-03-17 21:07:07 EDT
Problem is in the class IntelligentCompletionContext: the method getExpectedType() returns "Lint" on the primitive "int". If I like to test isPrimitive on the return, the result is false.
Comment 2 Marcel Bruch CLA 2011-03-18 05:24:43 EDT
Added:

if (binding.isArrayType()) {
            final int dimensions = binding.dimensions();
            final TypeBinding leafComponentType = binding.leafComponentType();
            return VmTypeName.get(StringUtils.repeat("[", dimensions) + toTypeName(leafComponentType));
        }
        String signature = String.valueOf(binding.computeUniqueKey());
        if (signature.length() == 1) {
            return VmTypeName.get(signature);
        }
...

However, this string parsing stuff is somewhat error prone and happens in several different places. we need to get rid of this somehow and put it into one single place... I'll keep an eye on this
Comment 3 Marcel Bruch CLA 2012-02-02 01:41:44 EST
Closing this issue. Please give latest dev build (v0.5) a try:

http://download.eclipse.org/recommenders/updates/dev/e37/
http://download.eclipse.org/recommenders/updates/dev/e42/
Comment 4 Marcel Bruch CLA 2012-02-02 01:41:57 EST
Closing this issue. Please give latest dev build (v0.5) a try:

http://download.eclipse.org/recommenders/updates/dev/e37/
http://download.eclipse.org/recommenders/updates/dev/e42/