Community
Participate
Working Groups
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
Created attachment 199 [details] Jar file containing CICSEXCIInteractionSpec
Created attachment 200 [details] Jar file containing interfaces and classes needed to reproduce the problem
moving to java-core for investigation
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.
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
We should improve our tolerance to missing types.
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'.
Fixed