Grailsrocks/grails-platform-core — pull request #3 by johnrengelman (2012-08-01 02:54:12+00:00)
Title: Only inject watched resources that are Grails artefacts

Platform Core observes all plugins and responds to their onChange events. During this process it attempts to execute InjectionImpl.applyTo on the source of the onChange event. This can result in a NPE if the watched resource is not a Grails artefact:
```
2012-07-31 16:15:27,046 [FileSystemWatcher: files=#368 cl=java.net.URLClassLoader@560508be] ERROR plugins.AbstractGrailsPluginManager - Plugin [springBatch:0.3] could not reload changes to file [/Users/john/workspace/grails-spring-batch/test/projects/spring-batch-ui-test/grails-app/batch/SimpleJobBatchConfig.groovy]: Cannot get property 'type' on null object
Message: Cannot get property 'type' on null object
Line | Method
->> 89 | applyTo in org.grails.plugin.platform.injection.InjectionImpl
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 269 | doCall in PlatformCoreGrailsPlugin$_closure9
^ 680 | run . . in java.lang.Thread
```

This patch simply bypasses the applyTo on any classes that are not registered as Grails artefacts.