Bug 238380 - Content Assist Not Working In Long Method
Summary: Content Assist Not Working In Long Method
Status: VERIFIED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 3.6 M7   Edit
Assignee: Srikanth Sankaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 238381 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-06-25 03:28 EDT by nikolaus heger CLA
Modified: 2010-04-26 14:21 EDT (History)
2 users (show)

See Also:


Attachments
Java class that shows the bug, for convenience (11.21 KB, text/plain)
2008-06-25 05:35 EDT, nikolaus heger CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description nikolaus heger CLA 2008-06-25 03:28:05 EDT
I found that Eclipse Content Assist does not work in log methods, or long if statements - not sure which. 

See the test class below. 

Using content assist anywhere below line 320 in method foo does not work.

Steps to reproduce:
- Create a new Java Project in Eclipse
- Import attached class ContentCompleteBug.java
- Scroll to line 319
- Type JF and hit the content complete shortcut (ctrl-space by default)
- Notice how the content assist pops up correctly
- Scroll to line 325
- Type JF and hit the content complete shortcut

Expected Result: Content complete popup shows "JFileChooser" as the first content complete option
Actual Result: Content complete popup shows "No Default Proposals"

Regression: Content compete still works for templates. It doesn't work for any Java classes though, no matter where on the build path the Java classes are.

/**
 * This class demonstrates how Eclipse content complete does not work in long methods
 * Eclipse Version Tested:
 * Version: 3.3.2
 * Build id: M20080221-1800
 * @author nik
 */

public class ContentCompleteBug {

	public void foo() {
        
        if (1 == 2) {
        	
        } else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
                    Object o = new Object();
                }
            }
        }else if ("a".equals("b")) {
            final String primarySymbol = getPrimarySymbol();
            if (primarySymbol != null) {
                
                if (primarySymbol != null) {
    // ------------ CONTENT ASSIST STILL WORKS HERE ------------------------------------------------
    // Type the following:
    // JF(ctrl-space)... => content assist popup with JFileChooser as the first choice
                	
                    Object o = new Object();
	// -------------------------------- ERROR CUTOFF -------------------------------------------------
	// CONTENT ASSIST DOESNt work anywhere below this line
	// Type the following:
	// JF(ctrl-space)... => no default proposal
                    
                }
            }
        }
        // content asssist doesn't work anywhere below this...
        
	}

	private String getPrimarySymbol() {
		// TODO Auto-generated method stub
		return "";
	}
	
}
Comment 1 Jerome Lanneluc CLA 2008-06-25 05:29:15 EDT
*** Bug 238381 has been marked as a duplicate of this bug. ***
Comment 2 nikolaus heger CLA 2008-06-25 05:35:19 EDT
Created attachment 105790 [details]
Java class that shows the bug, for convenience
Comment 3 Srikanth Sankaran CLA 2010-03-31 07:10:17 EDT
I can reproduce the problem on 3.4.2, but not on 3.5
or 3.6M6 (latest milestone build) nor on HEAD.

Resolving as WORKSFORME.
Comment 4 Olivier Thomann CLA 2010-04-26 14:21:44 EDT
Verified for 3.6M7 using I20100425-2000