Skip to content

Commit

Permalink
Streamlined code formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafael Winterhalter committed Jul 14, 2015
1 parent 26edd82 commit c498f72
Show file tree
Hide file tree
Showing 74 changed files with 3,685 additions and 3,761 deletions.
3 changes: 2 additions & 1 deletion byte-buddy-agent/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
Expand Down
3 changes: 2 additions & 1 deletion byte-buddy-android/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
Expand Down
3 changes: 2 additions & 1 deletion byte-buddy-benchmark/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
Expand Down
3 changes: 2 additions & 1 deletion byte-buddy-dep/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
Expand Down
244 changes: 122 additions & 122 deletions byte-buddy-dep/src/main/java/net/bytebuddy/ByteBuddy.java
Original file line number Diff line number Diff line change
Expand Up @@ -2213,123 +2213,24 @@ public MatchedMethodInterception constructor(ElementMatcher<? super MethodDescri
}

/**
* A matched method interception for a non-optional method definition.
* An implementation fo the {@code values} method of an enumeration type.
*/
public class MatchedMethodInterception implements MethodInterceptable {
protected static class EnumerationImplementation implements Implementation {

/**
* A method matcher that representedBy the current method selection.
* The name of the {@link java.lang.Object#clone()} method.
*/
protected final LatentMethodMatcher methodMatcher;
protected static final String CLONE_METHOD_NAME = "clone";

/**
* Creates a new matched method interception.
*
* @param methodMatcher The method matcher representing the current method selection.
* The name of the {@code valueOf} method that is defined for any enumeration.
*/
protected MatchedMethodInterception(LatentMethodMatcher methodMatcher) {
this.methodMatcher = methodMatcher;
}

@Override
public MethodAnnotationTarget intercept(Implementation implementation) {
return new MethodAnnotationTarget(classFileVersion,
namingStrategy,
auxiliaryTypeNamingStrategy,
interfaceTypes,
ignoredMethods,
bridgeMethodResolverFactory,
classVisitorWrapperChain,
methodRegistry,
modifiers,
typeAttributeAppender,
methodLookupEngineFactory,
defaultFieldAttributeAppenderFactory,
defaultMethodAttributeAppenderFactory,
methodMatcher,
new MethodRegistry.Handler.ForImplementation(nonNull(implementation), ModifierResolver.Simple.INSTANCE),
MethodAttributeAppender.NoOp.INSTANCE);
}

@Override
public MethodAnnotationTarget withoutCode() {
return new MethodAnnotationTarget(classFileVersion,
namingStrategy,
auxiliaryTypeNamingStrategy,
interfaceTypes,
ignoredMethods,
bridgeMethodResolverFactory,
classVisitorWrapperChain,
methodRegistry,
modifiers,
typeAttributeAppender,
methodLookupEngineFactory,
defaultFieldAttributeAppenderFactory,
defaultMethodAttributeAppenderFactory,
methodMatcher,
new MethodRegistry.Handler.ForAbstractMethod(ModifierResolver.Simple.INSTANCE),
MethodAttributeAppender.NoOp.INSTANCE);
}

@Override
public MethodAnnotationTarget withDefaultValue(Object value, Class<?> type) {
return withDefaultValue(AnnotationDescription.ForLoadedAnnotation.describe(nonNull(value), new TypeDescription.ForLoadedType(nonNull(type))));
}

@Override
public MethodAnnotationTarget withDefaultValue(Object value) {
return new MethodAnnotationTarget(classFileVersion,
namingStrategy,
auxiliaryTypeNamingStrategy,
interfaceTypes,
ignoredMethods,
bridgeMethodResolverFactory,
classVisitorWrapperChain,
methodRegistry,
modifiers,
typeAttributeAppender,
methodLookupEngineFactory,
defaultFieldAttributeAppenderFactory,
defaultMethodAttributeAppenderFactory,
methodMatcher,
MethodRegistry.Handler.ForAnnotationValue.of(value, ModifierResolver.Simple.INSTANCE),
MethodAttributeAppender.NoOp.INSTANCE);
}
protected static final String ENUM_VALUE_OF_METHOD_NAME = "valueOf";

/**
* Returns the outer class instance of this instance.
*
* @return The outer class instance.
* The name of the {@code values} method that is defined for any enumeration.
*/
private ByteBuddy getByteBuddy() {
return ByteBuddy.this;
}

@Override
public boolean equals(Object other) {
return this == other || !(other == null || getClass() != other.getClass())
&& ByteBuddy.this.equals(((MatchedMethodInterception) other).getByteBuddy())
&& methodMatcher.equals(((MatchedMethodInterception) other).methodMatcher);
}

@Override
public int hashCode() {
return 31 * methodMatcher.hashCode() + ByteBuddy.this.hashCode();
}

@Override
public String toString() {
return "ByteBuddy.MatchedMethodInterception{" +
"methodMatcher=" + methodMatcher +
"byteBuddy=" + ByteBuddy.this.toString() +
'}';
}
}

/**
* An implementation fo the {@code values} method of an enumeration type.
*/
protected static class EnumerationImplementation implements Implementation {
protected static final String ENUM_VALUES_METHOD_NAME = "values";

/**
* The field modifiers to use for any field that is added to an enumeration.
Expand All @@ -2341,21 +2242,6 @@ protected static class EnumerationImplementation implements Implementation {
*/
private static final String ENUM_VALUES = "$VALUES";

/**
* The name of the {@link java.lang.Object#clone()} method.
*/
protected static final String CLONE_METHOD_NAME = "clone";

/**
* The name of the {@code valueOf} method that is defined for any enumeration.
*/
protected static final String ENUM_VALUE_OF_METHOD_NAME = "valueOf";

/**
* The name of the {@code values} method that is defined for any enumeration.
*/
protected static final String ENUM_VALUES_METHOD_NAME = "values";

/**
* The names of the enumerations to define for the enumeration.
*/
Expand Down Expand Up @@ -2535,4 +2421,118 @@ public String toString() {
}
}
}

/**
* A matched method interception for a non-optional method definition.
*/
public class MatchedMethodInterception implements MethodInterceptable {

/**
* A method matcher that representedBy the current method selection.
*/
protected final LatentMethodMatcher methodMatcher;

/**
* Creates a new matched method interception.
*
* @param methodMatcher The method matcher representing the current method selection.
*/
protected MatchedMethodInterception(LatentMethodMatcher methodMatcher) {
this.methodMatcher = methodMatcher;
}

@Override
public MethodAnnotationTarget intercept(Implementation implementation) {
return new MethodAnnotationTarget(classFileVersion,
namingStrategy,
auxiliaryTypeNamingStrategy,
interfaceTypes,
ignoredMethods,
bridgeMethodResolverFactory,
classVisitorWrapperChain,
methodRegistry,
modifiers,
typeAttributeAppender,
methodLookupEngineFactory,
defaultFieldAttributeAppenderFactory,
defaultMethodAttributeAppenderFactory,
methodMatcher,
new MethodRegistry.Handler.ForImplementation(nonNull(implementation), ModifierResolver.Simple.INSTANCE),
MethodAttributeAppender.NoOp.INSTANCE);
}

@Override
public MethodAnnotationTarget withoutCode() {
return new MethodAnnotationTarget(classFileVersion,
namingStrategy,
auxiliaryTypeNamingStrategy,
interfaceTypes,
ignoredMethods,
bridgeMethodResolverFactory,
classVisitorWrapperChain,
methodRegistry,
modifiers,
typeAttributeAppender,
methodLookupEngineFactory,
defaultFieldAttributeAppenderFactory,
defaultMethodAttributeAppenderFactory,
methodMatcher,
new MethodRegistry.Handler.ForAbstractMethod(ModifierResolver.Simple.INSTANCE),
MethodAttributeAppender.NoOp.INSTANCE);
}

@Override
public MethodAnnotationTarget withDefaultValue(Object value, Class<?> type) {
return withDefaultValue(AnnotationDescription.ForLoadedAnnotation.describe(nonNull(value), new TypeDescription.ForLoadedType(nonNull(type))));
}

@Override
public MethodAnnotationTarget withDefaultValue(Object value) {
return new MethodAnnotationTarget(classFileVersion,
namingStrategy,
auxiliaryTypeNamingStrategy,
interfaceTypes,
ignoredMethods,
bridgeMethodResolverFactory,
classVisitorWrapperChain,
methodRegistry,
modifiers,
typeAttributeAppender,
methodLookupEngineFactory,
defaultFieldAttributeAppenderFactory,
defaultMethodAttributeAppenderFactory,
methodMatcher,
MethodRegistry.Handler.ForAnnotationValue.of(value, ModifierResolver.Simple.INSTANCE),
MethodAttributeAppender.NoOp.INSTANCE);
}

/**
* Returns the outer class instance of this instance.
*
* @return The outer class instance.
*/
private ByteBuddy getByteBuddy() {
return ByteBuddy.this;
}

@Override
public boolean equals(Object other) {
return this == other || !(other == null || getClass() != other.getClass())
&& ByteBuddy.this.equals(((MatchedMethodInterception) other).getByteBuddy())
&& methodMatcher.equals(((MatchedMethodInterception) other).methodMatcher);
}

@Override
public int hashCode() {
return 31 * methodMatcher.hashCode() + ByteBuddy.this.hashCode();
}

@Override
public String toString() {
return "ByteBuddy.MatchedMethodInterception{" +
"methodMatcher=" + methodMatcher +
"byteBuddy=" + ByteBuddy.this.toString() +
'}';
}
}
}
Loading

0 comments on commit c498f72

Please sign in to comment.