Skip to content

Support Java 14 - records (Instrumentation) #166

@mhagnumdw

Description

@mhagnumdw

Record example:

public record TransactionInfoData(StackFrame stackFrame, Optional<AuditInfo> auditInfo) {
    @Override
    public String toString() {
        final String prefix = String.format("%s.%s:%s", stackFrame.getDeclaringClass().getSimpleName(), stackFrame.getMethodName(), stackFrame.getLineNumber());
        if (auditInfo.isPresent()) {
            return prefix + " (" + auditInfo.get().transactionIdentifier() + ")";
        }
        return prefix;
    }
}

Problem in the public String toString() line:

[INFO] Instrumentation error
com.atlassian.clover.api.CloverException: /home/user/projects/audit/TransactionInfoData.java:6:8:unexpected token: record
    at com.atlassian.clover.instr.java.Instrumenter.instrument (Instrumenter.java:159)
    at com.atlassian.clover.CloverInstr.execute (CloverInstr.java:110)
    at ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions