jprudent (jerp2) proposes a better fix for Bug-244 regarding overkilled garbage collection on static fields on robots. His comment can be read here.
I really like his suggestion:
"To fix this more properly, I wouldn't clean any of the class loaded by a parent classloader. In my case, clojure.jar is added in classpath and any related classes is loaded via the Container classloader."
This is the way it should be fixed so Clojure and other languages as well will be supported by Robocode. :-)
Anonymous
I have created an 1.9.2.4 Alpha version of Robocode here with a possible fix.
Please try it out and check if this fixes the issue with Clojure.
Hi,
I've tried. It successfully load the first round now !!!
... but ... on the second round, hitting the Restart button, I get NullPointerException. I didn't have time to find why, but I would bet it's the cleaning. Here is my guess: the sorting between robot classes and system classes is perfectly done so clojure classes don't get clean up. Still, the rebot generated with clojure has some static fields that get clean up, hence the NPE.
But, I think the fix is fine for Scala, must try this out !
I'll give a deeper look this weekend to know exactly what is happening.
Thanks :)
You are welcome.
If you have a jar file or the classes for the robot(s). Or the sources + a short description of how to compile your robots for testing this change, you are welcome to send it to me or attach it here. Then I will try to find out, what is going on inside Robocode since it causes problems with rounds two.
Hi,
Here is my repo : https://github.com/jprudent/clobocode
The bots are doing almost nothing, except gearing radar and gun when round
starts.
There is a Readme that explains how to build. The generated jar is loadable
in Robocode.
Here is the jars :
https://drive.google.com/file/d/0B9LaCjHSfccCSXZUbE1kQkpJLUE/view?usp=sharing
Thanks :)
On Sat, Oct 11, 2014 at 4:13 AM, Flemming N. Larsen fnl@users.sf.net
wrote:
--
(Jérôme Prudent)
Related
Feature Requests:
#159Thank you for sending the zipped jar file. I use the clojure-1.5.1.jar which I have added to the classpath of the JVM that runs Robocode and also disabled security (-DNOSECURITY=true).
You are right. Your robots seems to work with the first round, and I also get a NPE from the robots, with the 2nd round.
I will dig into this and figure out what goes wrong. Please don't get impatient with me, as I might first get time for it in the end of the weekend. Let's see. :-)
Hi,
You know I am not in a hurry AT ALL. Take your time. I lack some free time
myself ;)
On Tue, Oct 14, 2014 at 11:45 PM, Flemming N. Larsen fnl@users.sf.net
wrote:
--
(Jérôme Prudent)
Related
Feature Requests:
#159Hi again,
I have made a new Alpha-2 version here:
http://robocode.sourceforge.net/files/robocode-1.9.2.4-Alpha-2-setup.jar
This version works for me with your robots. :-)
Closed as this has been implemented in 1.9.2.4