Bug 7119 - Content Assist does not complete some code
Summary: Content Assist does not complete some code
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.0 M2   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 6984
Blocks:
  Show dependency tree
 
Reported: 2001-12-19 18:11 EST by Gary L Peskin CLA
Modified: 2002-01-14 07:41 EST (History)
0 users

See Also:


Attachments
Jar file containing CICSEXCIInteractionSpec (76.52 KB, application/octet-stream)
2001-12-19 18:13 EST, Gary L Peskin CLA
no flags Details
Jar file containing interfaces and classes needed to reproduce the problem (17.56 KB, application/octet-stream)
2001-12-19 18:14 EST, Gary L Peskin CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gary L Peskin CLA 2001-12-19 18:11:50 EST
I have a java class called GaryTest.  Here is the code for the class:

public class GaryTest
{
  com.ibm.connector2.ws390.cicsexci.CICSEXCIInteractionSpec foo;
  public static void main(String[] args)
  {
    GaryTest myTest = new GaryTest();
    myTest.foo.setCommareaLength(3);
    System.exit(0);
  }
}

When I code GaryTest manually and compile GaryTest.java, everything compiles 
fine.

If I then change the line "myTest.foo...." to

    myTest.foo.setComm

and then press ctrl+enter with the cursor after "Comm", I get a "ding" sound and
no pop-up.  It's as if Content Assist cannot find the methods, or at least a 
matching method, in this class.

The CICSEXCIInteractionSpec class is in a .jar file that appears in 
the "Libraries" tab of the Java Build Path property for the java project 
containing GaryTest.  I will attach that .jar file and another .jar file 
containing some needed superclasses and/or interfaces so that the problem can 
be reproduced.

If any additional information is needed, please advise.

Thanks,
Gary
Comment 1 Gary L Peskin CLA 2001-12-19 18:13:06 EST
Created attachment 199 [details]
Jar file containing CICSEXCIInteractionSpec
Comment 2 Gary L Peskin CLA 2001-12-19 18:14:04 EST
Created attachment 200 [details]
Jar file containing interfaces and classes needed to reproduce the problem
Comment 3 Erich Gamma CLA 2001-12-20 04:39:20 EST
moving to java-core for investigation
Comment 4 David Audel CLA 2001-12-20 07:16:03 EST
The class com.ibm.connector2.ws390.cicsexci.CICSEXCIInteractionSpec have a 
private field named <tc>.
The type of this field is com.ibm.ejs.ras.TraceComponent and this type is not 
on build path.
That's why Content Assist find nothing (except templates) if you do ctrl+space 
with the cursor after myTest.foo.

Could you add com.ibm.ejs.ras.TraceComponent to your build path and test if it 
works.
Comment 5 Gary L Peskin CLA 2001-12-20 11:56:42 EST
David --

Thank you very much for your prompt and accurate answer.  This was indeed the 
problem.  I was confused because the class compiled okay.

The compiler can compile my class just fine having only the 
CICSEXCIInteractionSpec class in a .jar file in the classpath.  It doesn't need 
the class files for all of the superclasses or interfaces of 
CICSEXCIInterfactionSpec nor does it need the class files for all of the fields 
of CICSEXCIInteractionSpec.

Shouldn't Content Assist work the same as the compiler?  If Content Assist can 
see CICSEXCIInteractionSpec itself and I'm trying to do method completion, why 
does Content Assist insist on having access to classes for each field within 
CICSEXCIInteractionSpec?

Is this a possible enhancement for Content Assist or is it just not possible 
given the current design of that feature?

Thanks again,
Gary
Comment 6 Philipe Mulet CLA 2002-01-07 07:17:12 EST
We should improve our tolerance to missing types.
Comment 7 Philipe Mulet CLA 2002-01-10 11:47:03 EST
The compiler behavior will not change (6984), codeassist has to solve this one 
problem on its own.

Please add fault-tolerant APIs on BinaryTypeBinding to obtain valid fields and 
methods only (catching the AbortCompilation exception locally). These methods 
should have different names: 'availableFields & availableMethods'.
Comment 8 David Audel CLA 2002-01-14 07:36:56 EST
Fixed