Bug 207631 - [Content Assist] Autocompletion fails after use of binary right-shift operators
Summary: [Content Assist] Autocompletion fails after use of binary right-shift operators
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: All All
: P2 major (vote)
Target Milestone: 3.4 M7   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-26 16:50 EDT by Mark A. Ziesemer CLA
Modified: 2008-04-29 03:11 EDT (History)
3 users (show)

See Also:


Attachments
Proposed fix (3.06 KB, patch)
2008-04-16 05:32 EDT, David Audel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark A. Ziesemer CLA 2007-10-26 16:50:17 EDT
Build ID: I20070921-0919 (3.4M2)

Steps To Reproduce:
Enter the following code anywhere in a Java method:

int x = 0;
int y = (x >> (1));

Place the cursor anywhere after the 2nd line and the end of the method, then invoke Ctrl+Spacebar and note that the Content Assist dialog comes up empty.  Do the same after placing the cursor on or before the 1st line, and note that Content Assist works as expected.

Significant (+) and insignificant (-) factors:

+ Using a variable in the position of "x" in the 2nd line.  (Compared to replacing with a number constant, e.g. "2".)
+ Choosing <<, +, -, or any other tested operators.
+ Removing any pair(s) of parenthesis.
- The data types used (byte/short/int/etc.)
- Choosing between the >> and >>> operators.

More information:
Also occurs with I20070625-1500 (3.3.0).

Java code compiles without errors or warnings.  Nothing is generated in the Eclipse Error Log.

A more realistic code example (based on what I was writing when I found the problem):

long code;
byte off;
byte len;
...
byte result = (byte)(code >> (Long.SIZE - off - len));
Comment 1 David Audel CLA 2008-04-16 05:32:55 EDT
Created attachment 96223 [details]
Proposed fix
Comment 2 David Audel CLA 2008-04-16 05:39:35 EDT
Released for 3.4M7.

Test added
  GenericsCompletionParserTest#test0217_Method()

The problem was caused by a identifier followed by '>>' followed by '(' near the completion location. In this case the CompletionParser tried to build a generic constructor (new x<empty<empty>>(1)).
Comment 3 Mark A. Ziesemer CLA 2008-04-17 20:17:51 EDT
Thanks!

F.Y.I., the symptoms and conditions on bug 75650 are rather similar to this.  When I get a chance, I'll try to verify whether it was still an issue as of 3.4M6 and/or if it is also fixed in the current build.

Do you have a build # that this fix should be present in?
Comment 4 David Audel CLA 2008-04-18 04:18:53 EDT
This fix will present in the next integration build (>I20080415-1646).
Comment 5 Eric Jodet CLA 2008-04-29 03:11:21 EDT
Verified for 3.4M7 using I20080427-2000.