Skip to content

Commit 02180c1

Browse files
committed
fix(): update java timing code
now that I ran it again for once Signed-off-by: l-1squared <[email protected]>
1 parent a4233f2 commit 02180c1

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ aspectj-jrt = { module = "org.aspectj:aspectjrt", version.ref = "aspectj-version
2323
aspectj-jweaver = { module = "org.aspectj:aspectjweaver", version.ref = "aspectj-version" }
2424
byteBuddy = { module = "net.bytebuddy:byte-buddy", version.ref = "byteBuddy-version" }
2525
byteBuddy-agent = { module = "net.bytebuddy:byte-buddy-agent", version.ref = "byteBuddy-version" }
26+
byteBuddy-plugin = { module = "net.bytebuddy:byte-buddy-gradle-plugin", version.ref = "byteBuddy-version" }
2627
gson = { module = "com.google.code.gson:gson", version.ref = "gson-version" }
2728
guava = { module = "com.google.guava:guava", version.ref = "guava-version" }
2829
hypersql-database = { module = "org.hsqldb:hsqldb", version = "2.7.4" }
@@ -53,4 +54,3 @@ spring-compile = [ "spring-context", "spring-test" ]
5354
aspectj-spring-test = [ "aspectj-jrt", "aspectj-jweaver" ]
5455

5556
[plugins]
56-
byteBuddy-plugin = { id = "net.bytebuddy:byte-buddy-gradle-plugin", version.ref = "byteBuddy-version" }

jgiven-timing/src/main/java/com/tngtech/jgiven/timing/TimerInjectorAgent.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
package com.tngtech.jgiven.timing;
22

33
import com.tngtech.jgiven.impl.ScenarioBase;
4-
import java.lang.instrument.Instrumentation;
54
import net.bytebuddy.agent.builder.AgentBuilder;
65
import net.bytebuddy.implementation.MethodDelegation;
76
import net.bytebuddy.matcher.ElementMatchers;
87

8+
import java.lang.instrument.Instrumentation;
9+
910
/**
1011
* Class that acts as a Java agent and injects code before class for timing the test methods.
1112
*/
@@ -16,7 +17,7 @@ public class TimerInjectorAgent {
1617
public static void premain(String args, Instrumentation instrumentation) {
1718
new AgentBuilder.Default()
1819
.type(ElementMatchers.isSubTypeOf(ScenarioBase.class))
19-
.transform((builder, type, classLoader, module) ->
20+
.transform((builder, type, classLoader, module, __) ->
2021
builder.method(ElementMatchers.named("initialize")
2122
.or(ElementMatchers.named("finished")))
2223
.intercept(MethodDelegation.to(ManageTimerInterceptor.class))

0 commit comments

Comments
 (0)