Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ We use [semantic versioning](http://semver.org/):
- PATCH version when you make backwards compatible bug fixes.

# Next version
- [feature] _agent_: Added official support for Java 26 and experimental support for Java 27 (via JaCoCo 0.8.15)

# 36.5.2
- [security fix] _agent_: The Teamscale access token was logged in clear text in DEBUG-level logs (e.g., when `debug=true` was set) and in the WARN-level log emitted when multiple `-javaagent` arguments are present. The token is now obfuscated in those logs as well, matching INFO-level behavior.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@

package com.teamscale.jacoco.agent;

import org.jacoco.agent.rt.internal_29a6edd.Agent;
import org.jacoco.agent.rt.internal_29a6edd.AgentModule;
import org.jacoco.agent.rt.internal_29a6edd.CoverageTransformer;
import org.jacoco.agent.rt.internal_29a6edd.IExceptionLogger;
import org.jacoco.agent.rt.internal_29a6edd.PreMain;
import org.jacoco.agent.rt.internal_29a6edd.core.runtime.AgentOptions;
import org.jacoco.agent.rt.internal_29a6edd.core.runtime.IRuntime;
import org.jacoco.agent.rt.internal_29a6edd.core.runtime.InjectedClassRuntime;
import org.jacoco.agent.rt.internal_29a6edd.core.runtime.ModifiedSystemClassRuntime;
import org.jacoco.agent.rt.internal_bac9136.Agent;
import org.jacoco.agent.rt.internal_bac9136.AgentModule;
import org.jacoco.agent.rt.internal_bac9136.CoverageTransformer;
import org.jacoco.agent.rt.internal_bac9136.IExceptionLogger;
import org.jacoco.agent.rt.internal_bac9136.PreMain;
import org.jacoco.agent.rt.internal_bac9136.core.runtime.AgentOptions;
import org.jacoco.agent.rt.internal_bac9136.core.runtime.IRuntime;
import org.jacoco.agent.rt.internal_bac9136.core.runtime.InjectedClassRuntime;
import org.jacoco.agent.rt.internal_bac9136.core.runtime.ModifiedSystemClassRuntime;
import org.slf4j.Logger;

import java.lang.instrument.Instrumentation;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package com.teamscale.jacoco.agent

import org.jacoco.agent.rt.internal_29a6edd.CoverageTransformer
import org.jacoco.agent.rt.internal_29a6edd.IExceptionLogger
import org.jacoco.agent.rt.internal_29a6edd.core.runtime.AgentOptions
import org.jacoco.agent.rt.internal_29a6edd.core.runtime.IRuntime
import org.jacoco.agent.rt.internal_bac9136.CoverageTransformer
import org.jacoco.agent.rt.internal_bac9136.IExceptionLogger
import org.jacoco.agent.rt.internal_bac9136.core.runtime.AgentOptions
import org.jacoco.agent.rt.internal_bac9136.core.runtime.IRuntime
import org.slf4j.Logger
import java.lang.instrument.IllegalClassFormatException
import java.security.ProtectionDomain

/**
* A class file transformer which delegates to the JaCoCo [org.jacoco.agent.rt.internal_29a6edd.CoverageTransformer] to do the actual instrumentation,
* A class file transformer which delegates to the JaCoCo [org.jacoco.agent.rt.internal_bac9136.CoverageTransformer] to do the actual instrumentation,
* but treats instrumentation errors e.g. due to unsupported class file versions more lenient by only logging them, but
* not bailing out completely. Those unsupported classes will not be instrumented and will therefore not be contained in
* the collected coverage report.
Expand Down
7 changes: 5 additions & 2 deletions buildSrc/src/main/kotlin/KotlinStringTransformer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import kotlin.io.path.pathString

/**
* Reverts the transformation from "kotlin" to "shadow/kotlin" within strings of
* "org/jacoco/core/internal/analysis/filter" to make JaCoCo correctly process Kotlin class files.
* "org/jacoco/core/internal/analysis" (including the "filter" subpackage) to make JaCoCo correctly
* process Kotlin class files. Since JaCoCo 0.8.15 the kotlin.Metadata descriptor literal is also
* inlined into ClassAnalyzer (in the parent "analysis" package), so the filter subpackage alone is
* not enough.
*/
fun revertKotlinPackageChanges(archiveFile: Provider<RegularFile>) {
val zip = archiveFile.get().asFile.toPath()
Expand Down Expand Up @@ -37,7 +40,7 @@ private fun transformClass(file: Path) {
}

private fun shouldTransform(path: String): Boolean {
return path.contains("org/jacoco/core/internal/analysis/filter")
return path.contains("org/jacoco/core/internal/analysis")
}

private class StringReplacerClassVisitor(classNode: ClassVisitor?) : ClassVisitor(Opcodes.ASM9, classNode) {
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/com.teamscale.coverage.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

jacoco {
toolVersion = "0.8.14"
toolVersion = "0.8.15"
}

tasks.jacocoTestReport {
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# When upgrading JaCoCo to a newer version, make sure to
# check the comment in the OpenAnalyzer.java, JaCoCoPreMain.java and CachingInstructionsBuilder.java
# and update the internal_xxxxxx hash included in the imports in LenientCoverageTransformer.java and JaCoCoPreMain.java.
jacoco = "0.8.14"
jacoco = "0.8.15"
# We need to stay on the 1.3.x release line as 1.4.x requires Java 11
logback = "1.3.16"
retrofit = "3.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ protected void analyzeClass(final byte[] source) {
if ((reader.getAccess() & Opcodes.ACC_MODULE) != 0) {
return;
}
if ((reader.getAccess() & Opcodes.ACC_SYNTHETIC) != 0) {
if (reader.getClassName().endsWith("/package-info")) {
return;
}
final ClassVisitor visitor = createAnalyzingVisitor(classId,
Expand Down
Loading