Details
-
Sub-task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.7.0, 1.7.1, 1.7.2
-
None
Description
GroovyScriptEngine
In case of using a custom ResourceConnector the provided resource might not be a file resource (within GroovyClassLoader there is similar code (isSourceNewer) already respecting non file base resources)
protected boolean isSourceNewer(ScriptCacheEntry entry) throws ResourceException { if (entry==null) return true; long time = System.currentTimeMillis(); for (String scriptName:entry.dependencies) { ScriptCacheEntry depEntry = scriptCache.get(scriptName); long entryChangeTime = depEntry.lastModified + config.getMinimumRecompilationInterval(); if (entryChangeTime>time) continue; URLConnection conn = rc.getResourceConnection(scriptName); URL source = conn.getURL(); --> String path = source.getPath().replace('/', File.separatorChar).replace('|', ':'); --> File file = new File(path); long lastMod = file.lastModified(); if (entryChangeTime > lastMod) { ScriptCacheEntry newEntry = new ScriptCacheEntry(depEntry.scriptClass,time,depEntry.dependencies); scriptCache.put(scriptName,newEntry); continue; } return true; } return false; }
Attachments
Attachments
Issue Links
- is related to
-
GROOVY-4288 GroovyScriptEngine can't refresh class from url other than file
- Closed