View Experiment.java
import net.bytebuddy.description.method.MethodDescription;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.dynamic.DynamicType;
import net.bytebuddy.dynamic.scaffold.InstrumentedType;
import net.bytebuddy.implementation.Implementation;
import net.bytebuddy.implementation.bytecode.ByteCodeAppender;
import net.bytebuddy.pool.TypePool;
import org.objectweb.asm.*;
import org.objectweb.asm.commons.ClassRemapper;
import org.objectweb.asm.commons.SimpleRemapper;
View PackageConfustion.java
import net.bytebuddy.dynamic.loading.ClassLoadingStrategy;
import net.bytebuddy.implementation.FixedValue;
import java.lang.reflect.Method;
import static net.bytebuddy.matcher.ElementMatchers.named;
public class PackageConfusion {
public static void main(String[] args) throws Exception {
View Benchmark
package test;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.xml.JacksonXmlModule;
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
import com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector;
import foo.SampleBean;
import foo.SampleBeans;
View FileMonitor.java
import java.io.IOException;
import java.nio.file.*;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Set;
import java.util.function.Consumer;
import java.util.function.Predicate;
public class FileMonitor implements Runnable {
View event.txt
XMLInputFactory xif = XMLInputFactory.newFactory();
XMLOutputFactory xof = XMLOutputFactory.newFactory();
try (InputStream in = new FileInputStream("/home/rafael/foo.xml")) {
XMLEventReader xer = xif.createXMLEventReader(in);
XMLEventWriter xew = xof.createXMLEventWriter(System.out);
JAXBContext jc = JAXBContext.newInstance(Bar.class);
View Dispatcher.java
import net.bytebuddy.asm.AsmVisitorWrapper;
import net.bytebuddy.description.method.MethodDescription;
import net.bytebuddy.description.modifier.Visibility;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.dynamic.DynamicType;
import net.bytebuddy.implementation.FixedValue;
import net.bytebuddy.implementation.Implementation;
import net.bytebuddy.pool.TypePool;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
View Foo.java
import net.bytebuddy.asm.AsmVisitorWrapper;
import net.bytebuddy.description.method.MethodDescription;
import net.bytebuddy.description.type.TypeDescription;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
import static net.bytebuddy.matcher.ElementMatchers.named;
public class Foo {
View WeakeningAgent.java
import java.lang.instrument.Instrumentation;
import java.lang.reflect.Layer;
import java.lang.reflect.Module;
import java.util.*;
public class WeakeningAgent {
public static void premain(String argument, Instrumentation instrumentation) {
boolean full = argument != null && argument.equals("full");
Set<Module> importing = new HashSet<>(), exporting = new HashSet<>();
View Foo.java
public class Foo {
public static void main(String[] args) throws UnmodifiableClassException, InterruptedException {
// jar: https://bintray.com/raphw/maven/download_file?file_path=net%2Fbytebuddy%2Fbyte-buddy-agent%2F1.4.26%2Fbyte-buddy-agent-1.4.26.jar
Instrumentation instrumentation = ByteBuddyAgent.install();
System.out.println(instrumentation.isRedefineClassesSupported());
System.out.println(instrumentation.isRetransformClassesSupported());
View keybase.md

Keybase proof

I hereby claim:

  • I am raphw on github.
  • I am raphw (https://keybase.io/raphw) on keybase.
  • I have a public key ASCRLoOS-VdPyzfuhZ_xgec5Zht5jaGp2ScPVs_qJ-kXEgo

To claim this, I am signing this object: