Skip to content

Commit

Permalink
Refactored package structure.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafael Winterhalter committed Apr 14, 2015
1 parent a805f9e commit ac6f8a6
Show file tree
Hide file tree
Showing 552 changed files with 4,038 additions and 4,194 deletions.
Expand Up @@ -11,8 +11,8 @@
import net.bytebuddy.ClassFileVersion;
import net.bytebuddy.android.AndroidClassLoadingStrategy;
import net.bytebuddy.dynamic.DynamicType;
import net.bytebuddy.instrumentation.MethodDelegation;
import net.bytebuddy.instrumentation.method.bytecode.bind.annotation.SuperCall;
import net.bytebuddy.implementation.MethodDelegation;
import net.bytebuddy.implementation.bind.annotation.SuperCall;
import net.bytebuddy.utility.RandomString;

import java.io.File;
Expand Down Expand Up @@ -93,8 +93,8 @@ public void onClick(View view) {

/**
* An interceptor to be used in the instrumentation of the {@link Object#toString()} method. Of course, this
* could also be achieved by using a {@link net.bytebuddy.instrumentation.FixedValue} instrumentation. However,
* the instrumentation should generate an {@link net.bytebuddy.instrumentation.type.auxiliary.AuxiliaryType}
* could also be achieved by using a {@link net.bytebuddy.implementation.FixedValue} instrumentation. However,
* the instrumentation should generate an {@link net.bytebuddy.implementation.auxiliary.AuxiliaryType}
* to validate their functionality.
*/
public static class Interceptor {
Expand Down
Expand Up @@ -7,8 +7,8 @@
import com.android.dx.dex.cf.CfTranslator;
import com.android.dx.dex.file.DexFile;
import dalvik.system.DexClassLoader;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.dynamic.loading.ClassLoadingStrategy;
import net.bytebuddy.instrumentation.type.TypeDescription;
import net.bytebuddy.utility.RandomString;

import java.io.*;
Expand Down
Expand Up @@ -5,10 +5,10 @@
import com.android.dx.dex.file.DexFile;
import net.bytebuddy.ByteBuddy;
import net.bytebuddy.ClassFileVersion;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.dynamic.DynamicType;
import net.bytebuddy.dynamic.loading.ClassLoadingStrategy;
import net.bytebuddy.instrumentation.FixedValue;
import net.bytebuddy.instrumentation.type.TypeDescription;
import net.bytebuddy.implementation.FixedValue;
import net.bytebuddy.test.utility.MockitoRule;
import net.bytebuddy.test.utility.ObjectPropertyAssertion;
import org.junit.After;
Expand Down

This file was deleted.

Expand Up @@ -6,10 +6,10 @@
import net.bytebuddy.ByteBuddy;
import net.bytebuddy.benchmark.specimen.ExampleClass;
import net.bytebuddy.dynamic.loading.ClassLoadingStrategy;
import net.bytebuddy.instrumentation.MethodDelegation;
import net.bytebuddy.instrumentation.SuperMethodCall;
import net.bytebuddy.instrumentation.method.bytecode.bind.annotation.RuntimeType;
import net.bytebuddy.instrumentation.method.bytecode.bind.annotation.SuperCall;
import net.bytebuddy.implementation.MethodDelegation;
import net.bytebuddy.implementation.SuperMethodCall;
import net.bytebuddy.implementation.bind.annotation.RuntimeType;
import net.bytebuddy.implementation.bind.annotation.SuperCall;
import net.sf.cglib.proxy.*;
import org.openjdk.jmh.annotations.*;

Expand Down Expand Up @@ -172,7 +172,7 @@ public Object invoke(Object self,
}

/**
* Instead of using the {@link net.bytebuddy.instrumentation.SuperMethodCall} instrumentation, we are using
* Instead of using the {@link net.bytebuddy.implementation.SuperMethodCall} instrumentation, we are using
* a delegate in order to emulate the interception approach of other instrumentation libraries. Otherwise,
* this benchmark would be biased in favor of Byte Buddy.
*/
Expand Down
Expand Up @@ -6,7 +6,7 @@
import net.bytebuddy.ByteBuddy;
import net.bytebuddy.benchmark.specimen.ExampleInterface;
import net.bytebuddy.dynamic.loading.ClassLoadingStrategy;
import net.bytebuddy.instrumentation.StubMethod;
import net.bytebuddy.implementation.StubMethod;
import net.sf.cglib.proxy.CallbackHelper;
import net.sf.cglib.proxy.Enhancer;
import net.sf.cglib.proxy.FixedValue;
Expand Down
@@ -1,9 +1,9 @@
package net.bytebuddy.benchmark;

import net.bytebuddy.ByteBuddy;
import net.bytebuddy.description.modifier.Visibility;
import net.bytebuddy.dynamic.loading.ClassLoadingStrategy;
import net.bytebuddy.instrumentation.MethodDelegation;
import net.bytebuddy.modifier.Visibility;
import net.bytebuddy.implementation.MethodDelegation;
import net.bytebuddy.utility.RandomString;
import org.junit.Before;
import org.openjdk.jmh.infra.Blackhole;
Expand Down
46 changes: 23 additions & 23 deletions byte-buddy-dep/src/main/java/net/bytebuddy/ByteBuddy.java
@@ -1,31 +1,31 @@
package net.bytebuddy;

import net.bytebuddy.asm.ClassVisitorWrapper;
import net.bytebuddy.description.annotation.AnnotationDescription;
import net.bytebuddy.description.annotation.AnnotationList;
import net.bytebuddy.description.method.MethodDescription;
import net.bytebuddy.description.modifier.ModifierContributor;
import net.bytebuddy.description.modifier.TypeManifestation;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.description.type.TypeList;
import net.bytebuddy.dynamic.ClassFileLocator;
import net.bytebuddy.dynamic.DynamicType;
import net.bytebuddy.dynamic.scaffold.BridgeMethodResolver;
import net.bytebuddy.dynamic.scaffold.FieldRegistry;
import net.bytebuddy.dynamic.scaffold.MethodLookupEngine;
import net.bytebuddy.dynamic.scaffold.MethodRegistry;
import net.bytebuddy.dynamic.scaffold.inline.MethodRebaseResolver;
import net.bytebuddy.dynamic.scaffold.inline.RebaseDynamicTypeBuilder;
import net.bytebuddy.dynamic.scaffold.inline.RedefinitionDynamicTypeBuilder;
import net.bytebuddy.dynamic.scaffold.subclass.ConstructorStrategy;
import net.bytebuddy.dynamic.scaffold.subclass.SubclassDynamicTypeBuilder;
import net.bytebuddy.instrumentation.Instrumentation;
import net.bytebuddy.instrumentation.ModifierContributor;
import net.bytebuddy.instrumentation.attribute.FieldAttributeAppender;
import net.bytebuddy.instrumentation.attribute.MethodAttributeAppender;
import net.bytebuddy.instrumentation.attribute.TypeAttributeAppender;
import net.bytebuddy.instrumentation.attribute.annotation.AnnotationDescription;
import net.bytebuddy.instrumentation.attribute.annotation.AnnotationList;
import net.bytebuddy.instrumentation.method.MethodDescription;
import net.bytebuddy.instrumentation.method.MethodLookupEngine;
import net.bytebuddy.instrumentation.type.TypeDescription;
import net.bytebuddy.instrumentation.type.TypeList;
import net.bytebuddy.instrumentation.type.auxiliary.AuxiliaryType;
import net.bytebuddy.implementation.Implementation;
import net.bytebuddy.implementation.attribute.FieldAttributeAppender;
import net.bytebuddy.implementation.attribute.MethodAttributeAppender;
import net.bytebuddy.implementation.attribute.TypeAttributeAppender;
import net.bytebuddy.implementation.auxiliary.AuxiliaryType;
import net.bytebuddy.matcher.ElementMatcher;
import net.bytebuddy.matcher.LatentMethodMatcher;
import net.bytebuddy.modifier.TypeManifestation;
import org.objectweb.asm.Opcodes;

import java.lang.annotation.Annotation;
Expand Down Expand Up @@ -962,8 +962,8 @@ public ByteBuddy withClassVisitor(ClassVisitorWrapper classVisitorWrapper) {
}

/**
* Defines a new {@link net.bytebuddy.instrumentation.method.MethodLookupEngine.Factory} to be used for creating
* {@link net.bytebuddy.instrumentation.method.MethodLookupEngine}s for type creations based on this configuration.
* Defines a new {@link MethodLookupEngine.Factory} to be used for creating
* {@link MethodLookupEngine}s for type creations based on this configuration.
* The default lookup engine queries any class or interface type that is represented by the created type. These
* queries might however be costly such that this factory can be configured to save lookup time, for example
* by providing additional caching or by providing precomputed results.
Expand Down Expand Up @@ -1251,11 +1251,11 @@ public interface MethodInterceptable {
/**
* Intercepts the given method with the given instrumentation.
*
* @param instrumentation The instrumentation to apply to the selected methods.
* @param implementation The instrumentation to apply to the selected methods.
* @return A method annotation target for this instance with the given instrumentation applied to the
* current selection.
*/
MethodAnnotationTarget intercept(Instrumentation instrumentation);
MethodAnnotationTarget intercept(Implementation implementation);

/**
* Defines the currently selected methods as {@code abstract}.
Expand All @@ -1276,8 +1276,8 @@ public interface MethodInterceptable {

/**
* Defines a default annotation value to set for any matched method. The value is to be represented in a wrapper format,
* {@code enum} values should be handed as {@link net.bytebuddy.instrumentation.attribute.annotation.AnnotationDescription.EnumerationValue}
* instances, annotations as {@link net.bytebuddy.instrumentation.attribute.annotation.AnnotationDescription} instances and
* {@code enum} values should be handed as {@link AnnotationDescription.EnumerationValue}
* instances, annotations as {@link AnnotationDescription} instances and
* {@link Class} values as {@link TypeDescription} instances. Other values are handed in their raw format or as their wrapper types.
*
* @param value A non-loaded value that the annotation property should set as a default.
Expand Down Expand Up @@ -1527,7 +1527,7 @@ protected MatchedMethodInterception(LatentMethodMatcher methodMatcher) {
}

@Override
public MethodAnnotationTarget intercept(Instrumentation instrumentation) {
public MethodAnnotationTarget intercept(Implementation implementation) {
return new MethodAnnotationTarget(classFileVersion,
namingStrategy,
auxiliaryTypeNamingStrategy,
Expand All @@ -1542,7 +1542,7 @@ public MethodAnnotationTarget intercept(Instrumentation instrumentation) {
defaultFieldAttributeAppenderFactory,
defaultMethodAttributeAppenderFactory,
methodMatcher,
new MethodRegistry.Handler.ForInstrumentation(nonNull(instrumentation)),
new MethodRegistry.Handler.ForImplementation(nonNull(implementation)),
MethodAttributeAppender.NoOp.INSTANCE);
}

Expand Down Expand Up @@ -1685,8 +1685,8 @@ protected OptionalMethodInterception(ClassFileVersion classFileVersion,
}

@Override
public MethodAnnotationTarget intercept(Instrumentation instrumentation) {
return new MatchedMethodInterception(methodMatcher).intercept(instrumentation);
public MethodAnnotationTarget intercept(Implementation implementation) {
return new MatchedMethodInterception(methodMatcher).intercept(implementation);
}

@Override
Expand Down
@@ -1,11 +1,7 @@
package net.bytebuddy;

import net.bytebuddy.instrumentation.ModifierContributor;
import net.bytebuddy.instrumentation.type.TypeDescription;
import net.bytebuddy.modifier.EnumerationState;
import net.bytebuddy.modifier.SyntheticState;
import net.bytebuddy.modifier.TypeManifestation;
import net.bytebuddy.modifier.Visibility;
import net.bytebuddy.description.modifier.*;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.utility.ByteBuddyCommons;
import net.bytebuddy.utility.RandomString;
import org.objectweb.asm.Opcodes;
Expand Down

0 comments on commit ac6f8a6

Please sign in to comment.