Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ASM dependency #2279

Merged
merged 1 commit into from Apr 29, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions build.gradle
Expand Up @@ -86,8 +86,6 @@ dependencies {
compileOnly libraries.junit4, libraries.hamcrest, libraries.opentest4j
compile libraries.objenesis

testCompile libraries.asm

testCompile libraries.assertj

//putting 'provided' dependencies on test compile and runtime classpath
Expand Down
2 changes: 0 additions & 2 deletions gradle/dependencies.gradle
Expand Up @@ -28,8 +28,6 @@ libraries.autoservice = "com.google.auto.service:auto-service:1.0"

libraries.objenesis = 'org.objenesis:objenesis:3.2'

libraries.asm = 'org.ow2.asm:asm:7.0'

libraries.osgi = 'org.osgi:osgi.core:8.0.0'
libraries.equinox = 'org.eclipse.platform:org.eclipse.osgi:3.16.200'
libraries.bndGradle = 'biz.aQute.bnd:biz.aQute.bnd.gradle:5.2.0'
Expand Down
18 changes: 2 additions & 16 deletions src/test/java/org/mockitoutil/SimpleClassGenerator.java
Expand Up @@ -4,25 +4,11 @@
*/
package org.mockitoutil;

import static org.objectweb.asm.Opcodes.*;

import org.objectweb.asm.ClassWriter;
import net.bytebuddy.ByteBuddy;

public class SimpleClassGenerator {

public static byte[] makeMarkerInterface(String qualifiedName) {
String relativePath = qualifiedName.replace('.', '/');

ClassWriter cw = new ClassWriter(0);
cw.visit(
V1_6,
ACC_PUBLIC + ACC_ABSTRACT + ACC_INTERFACE,
relativePath,
null,
"java/lang/Object",
null);
cw.visitEnd();

return cw.toByteArray();
return new ByteBuddy().makeInterface().name(qualifiedName).make().getBytes();
}
}