Bug 84690 - [assist] CompletionProposal.getDeclarationSignature returns null for array types
Summary: [assist] CompletionProposal.getDeclarationSignature returns null for array types
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.1 M7   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-08 09:59 EST by Tom Hofmann CLA
Modified: 2005-05-12 13:37 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 Tom Hofmann CLA 2005-02-08 09:59:28 EST
I20050202 (jdt-core from I20050207)

CompletionProposal.getDeclarationSignature states that it may return null for
some proposal types. However, from the description I assumed that it was
guaranteed not to return null *if* the proposal was of kind METHOD_REF.

For methods on array objects, the declaration is always null, however. It would
make sense to return "Ljava.lang.Object;" since this is where all the methods
are declared that an array has.

For FIELD_REF proposals to the "length" field of an array, it would probably
make sense to return the array type, although this is not as important for us as
there is no javadoc associated with the field.
Comment 1 David Audel CLA 2005-03-16 11:41:18 EST
For an array object the only proposals without 'declaration signature' are the
FIELD_REF 'length' and the METHOD_REF 'clone' and they are not defined inside
Object.

I can return:
   null (as now)
or Ljava.lang.Object; (Object is not really the declaring type)
or [Ljava.lang.Object;
or [RealTypeSignature  (RealTypeSignature could be a base type)
Comment 2 Tom Hofmann CLA 2005-04-28 04:45:12 EDT
sorry for not replying earlier...

> For an array object the only proposals without 'declaration signature' are the
> FIELD_REF 'length' and the METHOD_REF 'clone' and they are not defined inside
> Object.
> 
> I can return:
>    null (as now)

-1 as comment 0 says, I believe this is unexpected.

> or Ljava.lang.Object; (Object is not really the declaring type)

-1 as this would be simply not true.

> or [Ljava.lang.Object;

ok - albeit this could be interpreted to imply that the declaring type is an
Object[]

> or [RealTypeSignature  (RealTypeSignature could be a base type)

I like this one best, because this is the correct answer to the question "which
types declares the field 'length'?"
Comment 3 David Audel CLA 2005-04-28 10:16:19 EDT
Fixed and tests added
  CompletionTests#testArrayLength()
  CompletionTests#testArrayClone()
Comment 4 Olivier Thomann CLA 2005-05-12 13:37:39 EDT
Verified in I20050510-0010 + JDT/Core v_556