From 12267525847917a543f3fbacb58cd1621d835f7c Mon Sep 17 00:00:00 2001 From: greeshmaswaminathan Date: Tue, 2 Mar 2021 18:00:43 +0000 Subject: [PATCH] Update asm version and use asm-commons --- common-io/pom.xml | 3 +- .../io/cdap/common/internal/asm/Debugs.java | 50 ------------------- common-lang/pom.xml | 3 +- pom.xml | 2 +- 4 files changed, 5 insertions(+), 53 deletions(-) delete mode 100644 common-io/src/main/java/io/cdap/common/internal/asm/Debugs.java diff --git a/common-io/pom.xml b/common-io/pom.xml index 380f511..e9aeedc 100644 --- a/common-io/pom.xml +++ b/common-io/pom.xml @@ -55,7 +55,8 @@ the License. org.ow2.asm - asm-all + asm-commons + ${asm.version} junit diff --git a/common-io/src/main/java/io/cdap/common/internal/asm/Debugs.java b/common-io/src/main/java/io/cdap/common/internal/asm/Debugs.java deleted file mode 100644 index b78630b..0000000 --- a/common-io/src/main/java/io/cdap/common/internal/asm/Debugs.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright © 2014 Cask Data, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package io.cdap.common.internal.asm; - -import com.google.common.io.ByteStreams; -import com.google.common.io.Files; -import org.objectweb.asm.ClassReader; -import org.objectweb.asm.util.CheckClassAdapter; -import org.objectweb.asm.util.TraceClassVisitor; - -import java.io.File; -import java.io.IOException; -import java.io.PrintWriter; - -/** - * Util class for debugging ASM bytecode generation. - */ -public final class Debugs { - - public static void debugByteCode(ClassDefinition classDefinition, PrintWriter writer) { - ClassReader reader = new ClassReader(classDefinition.getBytecode()); - reader.accept(new CheckClassAdapter(new TraceClassVisitor(writer)), 0); - - File file = new File("/tmp/" + classDefinition.getInternalName() + ".class"); - file.getParentFile().mkdirs(); - writer.println(file); - writer.flush(); - try { - ByteStreams.write(classDefinition.getBytecode(), Files.newOutputStreamSupplier(file)); - } catch (IOException e) { - e.printStackTrace(); - } - } - - private Debugs() {} -} diff --git a/common-lang/pom.xml b/common-lang/pom.xml index a06f6e6..8137f8a 100644 --- a/common-lang/pom.xml +++ b/common-lang/pom.xml @@ -42,7 +42,8 @@ the License. org.ow2.asm - asm-all + asm-commons + ${asm.version} junit diff --git a/pom.xml b/pom.xml index 75538c4..faac74b 100644 --- a/pom.xml +++ b/pom.xml @@ -92,7 +92,7 @@ the License. UTF-8 - 4.0 + 7.1 2.0.1 2.0.0 13.0.1