Saturday, August 14, 2010

JarClassLoader & Groovy -- side effects

It appears that when you ask JarClassLoader to load compiled Groovy classes (compiled with Ant groovyc), the resulting classes do not behave the same way as regular java classes. In particular, the Groovy classes don't know what package they belong to:




 MyClass.java 
  
 println MyClass.class.getPackage() 
 >my.package
  
 MyClass.groovy 
  
 println MyClass.class.getPackage() 
 >null


The Java class gives the correct answer whether it is loaded by ClasspathClassLoader or by JarClassLoader. However, the Groovy class only works when called by ClasspathClassLoader, not by JarClassLoader.

13 comments:

  1. The war between humans, orcs and elves continues earn to die . Lead your race through a series of epic battles, using your crossbow to fend off foes and sending out units to destroy castleshappy wheels . Researching and upgrading wisely will be crucial to your success! There are 5 ages total and each one will bring you new units to train to fight in the war for you cause.
    earn to die 2
    Whatever you do, don’t neglect your home base because you cannot repair it and once it is destroyed, you lose! Age of War is the first game of the series and really sets the tone for the Age of War games . Also try out the Age of Defense series as it is pretty similar.
    In this game, you start at the cavern men’s age, then evolvetank trouble ! There is a total of 5 ages, each with its units and turrets. Take control of 16 different units and 15 different turrets to defend your base and destroy your enemy.
    The goal of the game also differs depending on the level. In most levels the goal is to reach a finish line or to collect tokens. Many levels feature alternate or nonexistent goals for the player.

    ReplyDelete
  2. Thank you for some other informative website. I have a venture that I am simply now running on, and I’ve been at the glance out for such info.
    eCommerce Support Services In India

    ReplyDelete
  3. Infycle Technologies, one of the topmost software training institutes in Chennai offers excellent AWS Training in Chennai | Infycle Technologies ​for freshers and students, and Tech Professionals of any field. Other demanding courses such as Digital Marketing, Java, Python, Hadoop, Selenium, Big Data, AWS, Android, and iOS Development will also be trained with complete hands-on training. After the completion of training, the students will be sent for placement interviews in the core MNC's. Dial 7504633633 to get more info and a free demo.

    ReplyDelete
  4. replica bags in china Look At This j6v89z9y01 replica zara bags visit our website k3d88j3k18 replica wallets replica bags in dubai replica bags koh samui replica hermes j6v38r2w15 replica bags paypal

    ReplyDelete