SmartAgentBase.weOwnContsArround Scope
SmartAgentBase.weOwnContsArround Scope
I cloned BetterPixie as Sparrow and found that the SmartAgentBase.weOwnContsArround method is problematic asside from its misspelling. While BetterPixie can use it, Sparrow cannot. It appears that when Sparrow is added to the ...lux/support/agent dir of the runtime, it is not treated as a member of the com.sillysoft.lux.agent package and hence has problems accessing this method with default class access (you get a java.lang.IllegalAccessError exception). I was able to override the method within Sparrow, but I think the default declaration of the weOwnContsArround method in SmartAgentBase (the only declaration in that class that is not 'public' or 'protected') was an oversite.
Again, I'm sorta of a newbie, and appreciate any suggestions, corrections, or clarifications re. this observation.
Again, I'm sorta of a newbie, and appreciate any suggestions, corrections, or clarifications re. this observation.
To get a class into a package, you need to both have the class in the proper directory and have a package declaration at the top of the .java file. So, if you want Sparrow in the "com.sillysoft.lux.agent" package you need to put the statement "package com.sillysoft.lux.agent;" at the beginning of Sparrow.java.jaybird wrote:...it appears that when Sparrow is added to the ...lux/support/agent dir of the runtime, it is not treated as a member of the com.sillysoft.lux.agent package and hence has problems accessing this method with default class access (you get a java.lang.IllegalAccessError exception)...
Good luck with your bot. It would be nice to have another AI around.
I've had the same issue, but when cloning EvilPixie. The new class couldn't access outnumberBy and ourConts (which have the default modifier in Pixie.java). I do have the "package com.sillysoft.lux.agent;" statement at the first line of the file.
I could get rid of this problem by defining those two fields in my cloned class, but then I fear calls to inherited methods from Pixie that use those variables will use the value of the Pixie fields, not those of the cloned EvilPixie class...
I'm a bit rusted in Java, so sorry if this is dumb question, but could you explain what exactly is the problem here, and how I should solve it?
Thanks!
I could get rid of this problem by defining those two fields in my cloned class, but then I fear calls to inherited methods from Pixie that use those variables will use the value of the Pixie fields, not those of the cloned EvilPixie class...
I'm a bit rusted in Java, so sorry if this is dumb question, but could you explain what exactly is the problem here, and how I should solve it?
Thanks!
Who is online
Users browsing this forum: No registered users and 49 guests