[GRADLE-422] Script Caching gets stuck on EMPTY_SCRIPT state Created: 12/Mar/09 Updated: 04/Jan/13 Resolved: 14/Apr/09 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | 0.5.2 |
Fix Version/s: | 0.6 |
Type: | Bug | ||
Reporter: | Steve Appling | Assignee: | Hans Dockter |
Resolution: | Fixed | Votes: | 0 |
Attachments: | cachefix.patch | ||||||||
Issue Links: |
|
Description |
If a script has been identified as an empty script, then this information is cached and the script is never used again unless the cache is cleaned (even after contents are added). Also, truely empty scripts (with no content - even whitespace) cause an NPE. To reproduce this problem:
I added testCases to DefaultCachePropertiesHandlerTest to cover both of these problems. |
Comments |
Comment by Hans Dockter [ 13/Mar/09 ] |
Many thanks for the patch. We will apply this for 0.6. |
Comment by Hans Dockter [ 13/Apr/09 ] |
I saw a possibility to get rid of the special case 'empty script' all together (We only need to deal with it in one place now). I think this is a nice simplification. I haven't committed it yet. I'd like to get some feedback first. I have changed the contract of the ScriptSource.getText method to never return null. This method returns an empty String now in case of an empty (or non existing script). I have uploaded the stuff to github. For a list of changed files see: http://github.com/hansd/gradle/commit/9082c4c48f9a317339ce37f6d400a5e552bf9ec8 |
Comment by Steve Appling [ 13/Apr/09 ] |
Not treating the empty script as a special case is a much better solution! |