MCPcopy Index your code
hub / github.com/apache/groovy / recompile

Method recompile

src/main/java/groovy/lang/GroovyClassLoader.java:765–784  ·  view source on GitHub ↗

(Re)Compiles the given source. This method starts the compilation of a given source, if the source has changed since the class was created. For this isSourceNewer is called. @param source the source pointer for the compilation @param className the name of the class to be generated @param oldClas

(final URL source, final String className, final Class oldClass)

Source from the content-addressed store, hash-verified

763 * @see #isSourceNewer(URL, Class)
764 */
765 protected Class recompile(final URL source, final String className, final Class oldClass) throws CompilationFailedException, IOException {
766 if (source != null) {
767 // found a source, compile it if newer
768 if (oldClass == null || isSourceNewer(source, oldClass)) {
769 String name = source.toExternalForm();
770
771 sourceCache.remove(name);
772
773 if (isFile(source)) {
774 try {
775 return parseClass(new GroovyCodeSource(new File(source.toURI()), sourceEncoding));
776 } catch (URISyntaxException e) {
777 // do nothing and fall back to the other version
778 }
779 }
780 return parseClass(new InputStreamReader(URLStreams.openUncachedStream(source), sourceEncoding), name);
781 }
782 }
783 return oldClass;
784 }
785
786 /**
787 * Gets the time stamp of a given class. For groovy

Callers 1

loadClassMethod · 0.95

Calls 6

isSourceNewerMethod · 0.95
isFileMethod · 0.95
parseClassMethod · 0.95
openUncachedStreamMethod · 0.95
removeMethod · 0.65
toURIMethod · 0.45

Tested by

no test coverage detected