I just found a way of indirectly hiding information

The entire method dissapeared. WTF(in a good way)?
I’m not entirely sure if I had ever done this before but it works and I thought some people might like to explain this to me.

Here’s my wrapper for GLDrawable:

Here’s the video class. It sets the GLDrawable inside a wrapper and sends it off to the game project class.

Here’s the box class which is supposed to draw a box. Notice how “getData” returns JOGL’s “GLDrawable”?

This is the game project class which recieves the GLData sent by the video class, notice how “getData” doesn’t even exist.

I didn’t think this would be possible but hell it sure does work. :slight_smile:

It’s not possible. Either you have two versions of DataGL, your IDE is broken, or you’ve faked the screenshots. :smiley:
Note that setDrawable doesn’t show up in the last screenshot either, despite being defined in DataGL in the first screenshot.

Exactly. Set drawable only appears in box due to box being in the same package as video.
It set/get drawable doesn’t appear outside of it’s package. :smiley:

CODE: (Try if you don’t believe me)
http://members.optusnet.com.au/ksaho/designs/javaHiding/Engine.zip

setDrawable is public, not package private.

I can’t find the code from the fourth screenshot in the zip file you linked.

Sorry, I deleted box because I wanted to test if Java would actually pass the parameter.
All you have to do is create a class, let it accept VideoData as a parameter and then test it.

I’m using Eclipse 3.2 with 3 projects(as you’ve seen).

The issue is:
I create a wrapper for JOGL’s drawable object.
I send this down my program into Main.
“Main” project has NO access to JOGL source code or libraries however the wrapper I passed down DOES need the access to JOGL’s libs.
When I do code completion I don’t see the “GLDrawable” and I initially thought it WOULD be show as “Object” however my results are surprising.

I do believe this is most likely a bug in the IDE because it makes the most sense.

Oh, it’s two different projects?

Freaky! Sounds like a bug in eclipse. :slight_smile:

Eclipse has bugs in the completion code in exactly this manner, so although I dont quite understand what you’re saying, I think you’ve probably hit one of those.

It particularly has problems with:

  • project1 one uses lib1
  • project1 has class1
  • project2 includes project1
  • project2 extends or uses class1
  • project1 imports lib1 as an “external jar”
  • project references some class of lib1 (I’ve seen this when extending classes in lib1) in class1
  • project2 attempts to continue to use methods in class1
  • …bizarrely, eclipse stops letting project2 see any changes to class1’s methods etc - it simply stops paying any attention

This is a very annoying bug when you don’t know what’s causing it - there are no errors, it’s just that compile + autocomplete both stop working.

Solution? Add lib1 to project2, even though technically you shouldn’t need to.

I believe (but I’ve not looked carefully, so take with pinch of salt) it’s a bug in eclipse’s custom compiler, specifically in the dynamic recompile subsystem that recompiles incrementally

Thanks.
I didn’t think I’d see such bugs in Eclipse. :confused:

I have to find a better way to hide info.
Dependency injection will be the answer to using the wrapper.

Eclispe can get particualrly confused when you refactor because it tends to leave old class files around.

Whever it seems to not quite udnerstand what your code currently is, do a “clean”.

That always fixes it for me.