Adapt to change in Gerrit core that added generic types to time contexts Signed-off-by: Edwin Kempin <ekempin@google.com> Change-Id: If0ed7a293ae226a0f974983662588133bf646bfd
diff --git a/src/main/java/com/googlesource/gerrit/plugins/hooks/HookMetrics.java b/src/main/java/com/googlesource/gerrit/plugins/hooks/HookMetrics.java index c2046a1..e5dd877 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/hooks/HookMetrics.java +++ b/src/main/java/com/googlesource/gerrit/plugins/hooks/HookMetrics.java
@@ -47,7 +47,7 @@ "timeout", new Description("Hook execution timeouts").setRate(), field); } - public Timer1.Context start(String name) { + public Timer1.Context<String> start(String name) { return latency.start(name); }
diff --git a/src/main/java/com/googlesource/gerrit/plugins/hooks/HookTask.java b/src/main/java/com/googlesource/gerrit/plugins/hooks/HookTask.java index 4ff5d94..ee59fb4 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/hooks/HookTask.java +++ b/src/main/java/com/googlesource/gerrit/plugins/hooks/HookTask.java
@@ -85,7 +85,7 @@ public HookResult runHook() { HookResult result = null; String name = getName(); - try (Timer1.Context timer = args.metrics.start(name)) { + try (Timer1.Context<String> timer = args.metrics.start(name)) { args.metrics.count(name); List<String> argv = new ArrayList<>(1 + args.get().size()); argv.add(hook.toAbsolutePath().toString());