This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.openjdk.jmh.annotations.Benchmark; | |
public class StackWalkerExtraction { | |
private static Object call(int depth, Callable<?> result) throws Exception { | |
if (depth == 0) { | |
return result.call(); | |
} else { | |
return call(depth - 1, result); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main; | |
import bar.Bar; | |
import qux.Qux; | |
import java.lang.invoke.MethodHandles; | |
import java.lang.invoke.MethodType; | |
import java.lang.reflect.Proxy; | |
import java.util.function.Consumer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.objectweb.asm.ClassReader; | |
import org.objectweb.asm.util.TraceClassVisitor; | |
import java.io.PrintWriter; | |
import java.lang.instrument.ClassFileTransformer; | |
import java.lang.instrument.Instrumentation; | |
import java.security.ProtectionDomain; | |
public class BugReportDeprecatedModifier { |