diff --git a/internal/compiler-interface/src/main/java/xsbti/compile/DefaultExternalHooks.java b/internal/compiler-interface/src/main/java/xsbti/compile/DefaultExternalHooks.java index f4bc253482..358b0615a7 100644 --- a/internal/compiler-interface/src/main/java/xsbti/compile/DefaultExternalHooks.java +++ b/internal/compiler-interface/src/main/java/xsbti/compile/DefaultExternalHooks.java @@ -17,15 +17,25 @@ public class DefaultExternalHooks implements ExternalHooks { private Optional lookup = Optional.empty(); private Optional classFileManager = Optional.empty(); private GetProvenance getProvenance = NoProvenance.INSTANCE; + private InvalidationProfiler invalidationProfiler = InvalidationProfiler.EMPTY.INSTANCE; public DefaultExternalHooks( - Optional lookup, - Optional classFileManager, - GetProvenance getProvenance + Optional lookup, + Optional classFileManager, + GetProvenance getProvenance, + InvalidationProfiler invalidationProfiler ) { this.lookup = lookup; this.classFileManager = classFileManager; this.getProvenance = getProvenance; + this.invalidationProfiler = invalidationProfiler; + } + public DefaultExternalHooks( + Optional lookup, + Optional classFileManager, + GetProvenance getProvenance + ) { + this(lookup, classFileManager, getProvenance, InvalidationProfiler.EMPTY.INSTANCE); } public DefaultExternalHooks(Optional lookup, Optional classFileManager) { @@ -44,23 +54,31 @@ public Optional getExternalClassFileManager() { @Override public GetProvenance getProvenance() { return getProvenance; } + @Override + public InvalidationProfiler getInvalidationProfiler() { return invalidationProfiler; } + @Override public ExternalHooks withExternalClassFileManager(ClassFileManager externalClassFileManager) { Optional external = Optional.of(externalClassFileManager); Optional mixedManager = classFileManager.isPresent() ? Optional.of(WrappedClassFileManager.of(classFileManager.get(), external)) : external; - return new DefaultExternalHooks(lookup, mixedManager, getProvenance); + return new DefaultExternalHooks(lookup, mixedManager, getProvenance, invalidationProfiler); } @Override public ExternalHooks withExternalLookup(ExternalHooks.Lookup externalLookup) { Optional externalLookup1 = Optional.of(externalLookup); - return new DefaultExternalHooks(externalLookup1, classFileManager, getProvenance); + return new DefaultExternalHooks(externalLookup1, classFileManager, getProvenance, invalidationProfiler); } @Override public ExternalHooks withGetProvenance(GetProvenance getProvenance) { - return new DefaultExternalHooks(lookup, classFileManager, getProvenance); + return new DefaultExternalHooks(lookup, classFileManager, getProvenance, invalidationProfiler); + } + + @Override + public ExternalHooks withInvalidationProfiler(InvalidationProfiler profiler) { + return new DefaultExternalHooks(lookup, classFileManager, getProvenance, profiler); } }