From b336e3d1dbdc4134f670f10b1a3f6ec9410f3d56 Mon Sep 17 00:00:00 2001 From: Liam Miller-Cushon Date: Thu, 19 Oct 2023 14:03:00 -0700 Subject: [PATCH] Import of https://gitlab.ow2.org/asm/asm. #MIGRATION_3P_JAVA_ASM__DEFAULT_SERVICE - a087e8a1d3a16bff9c533bd800f5978758262248 Update JaCoCo to version 0.8.10 by Evgeny Mandrikov - 0caa0d4214fba986f4b987d0161629238a687dd1 Add support for 'new' after 'invokespecial ' (in by... by Eric Bruneton - 579caab5e018bdcbd80ca3601446439f65efd4fb Update SonarQube plugin to latest version. by Eric Bruneton - d70cd319a5a26fd3683ceacc079311b6c3bdb095 Upgrade to Gradle 8.3. by Eric Bruneton - 082e5c985516d5351ba55f337ebb9d3571c5dc53 Increase JVM Metaspace size in an attempt to fix Sonar Gr... by Eric Bruneton - 44ae3de4bfb2aea7e4afe6152bd4b7b8289be9ac Add quotes around jvmargs option. by Eric Bruneton - c890eac5963700541703445d06c62c18e044d671 Fix typo in .gitlab-ci.yml'. by Eric Bruneton - 5d00fe4ea47b17f3d2e981a18ee447d9b1d32de1 Add a getArgumentCount() method in Type. by Eric Bruneton - 10317262ee5f23be4ad8b42f384aebb5d81cad04 Update version number. by Eric Bruneton - af4ee811fde0b14bd7db84aa944a1b3733c37289 Remove an extra space at the end of a line. by Eric Spishak-Thomas PiperOrigin-RevId: 574994755 --- .../google/turbine/lower/testdata/golden/outer.txt | 2 +- javatests/com/google/turbine/testing/AsmUtils.java | 12 +++++++++++- pom.xml | 1 + 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/javatests/com/google/turbine/lower/testdata/golden/outer.txt b/javatests/com/google/turbine/lower/testdata/golden/outer.txt index b6d541c6..dcc69831 100644 --- a/javatests/com/google/turbine/lower/testdata/golden/outer.txt +++ b/javatests/com/google/turbine/lower/testdata/golden/outer.txt @@ -16,6 +16,6 @@ public class test/Test implements java/util/List { // access flags 0x1 // signature (I)V^TE; // declaration: void g(int) throws E - public g(I)V throws java/lang/Error + public g(I)V throws java/lang/Error // parameter foo } diff --git a/javatests/com/google/turbine/testing/AsmUtils.java b/javatests/com/google/turbine/testing/AsmUtils.java index b7e77bc4..2a66dde5 100644 --- a/javatests/com/google/turbine/testing/AsmUtils.java +++ b/javatests/com/google/turbine/testing/AsmUtils.java @@ -16,6 +16,11 @@ package com.google.turbine.testing; +import static java.util.stream.Collectors.joining; + +import com.google.common.base.CharMatcher; +import com.google.common.base.Splitter; +import java.io.File; import java.io.PrintWriter; import java.io.StringWriter; import org.objectweb.asm.ClassReader; @@ -37,7 +42,12 @@ public static String textify(byte[] bytes, boolean skipDebug) { ClassReader.SKIP_FRAMES | ClassReader.SKIP_CODE | (skipDebug ? ClassReader.SKIP_DEBUG : 0)); - return sw.toString(); + // TODO(cushon): Remove this after next ASM update + // See https://gitlab.ow2.org/asm/asm/-/commit/af4ee811fde0b14bd7db84aa944a1b3733c37289 + return Splitter.on("\\R") + .splitToStream(sw.toString()) + .map(CharMatcher.is(' ')::trimTrailingFrom) + .collect(joining(File.separator)); } private AsmUtils() {} diff --git a/pom.xml b/pom.xml index 912ed716..a86487a0 100644 --- a/pom.xml +++ b/pom.xml @@ -229,6 +229,7 @@ -Xmx2g + -Xss2m --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED