Skip to content

Commit

Permalink
Replace annotations with internal aliases.
Browse files Browse the repository at this point in the history
  • Loading branch information
raphw committed Dec 16, 2021
1 parent 111521a commit a9ab948
Show file tree
Hide file tree
Showing 58 changed files with 55 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
import net.bytebuddy.agent.nullability.MaybeNull;
import net.bytebuddy.agent.nullability.UnknownNull;

import javax.annotation.Nonnull;
import javax.annotation.meta.When;
import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/**
* This package is dedicated to supporting Byte Buddy on Android devices.
*/
@NeverNull
@NeverNull.ByDefault
package net.bytebuddy.android;

import net.bytebuddy.utility.nullability.NeverNull;
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import net.bytebuddy.implementation.SuperMethodCall;
import net.bytebuddy.implementation.bind.annotation.*;
import net.bytebuddy.pool.TypePool;
import net.bytebuddy.utility.nullability.MaybeNull;
import net.sf.cglib.proxy.*;
import org.openjdk.jmh.annotations.*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
import net.bytebuddy.dynamic.scaffold.TypeValidation;
import net.bytebuddy.implementation.StubMethod;
import net.bytebuddy.pool.TypePool;
import net.bytebuddy.utility.nullability.AlwaysNull;
import net.bytebuddy.utility.nullability.MaybeNull;
import net.sf.cglib.proxy.CallbackHelper;
import net.sf.cglib.proxy.Enhancer;
import net.sf.cglib.proxy.FixedValue;
Expand Down Expand Up @@ -257,79 +259,79 @@ public double method(double arg) {
/**
* {@inheritDoc}
*/
@MaybeNull
@AlwaysNull
public Object method(Object arg) {
return null;
}

/**
* {@inheritDoc}
*/
@MaybeNull
@AlwaysNull
public boolean[] method(boolean arg1, boolean arg2, boolean arg3) {
return null;
}

/**
* {@inheritDoc}
*/
@MaybeNull
@AlwaysNull
public byte[] method(byte arg1, byte arg2, byte arg3) {
return null;
}

/**
* {@inheritDoc}
*/
@MaybeNull
@AlwaysNull
public short[] method(short arg1, short arg2, short arg3) {
return null;
}

/**
* {@inheritDoc}
*/
@MaybeNull
@AlwaysNull
public int[] method(int arg1, int arg2, int arg3) {
return null;
}

/**
* {@inheritDoc}
*/
@MaybeNull
@AlwaysNull
public char[] method(char arg1, char arg2, char arg3) {
return null;
}

/**
* {@inheritDoc}
*/
@MaybeNull
@AlwaysNull
public long[] method(long arg1, long arg2, long arg3) {
return null;
}

/**
* {@inheritDoc}
*/
@MaybeNull
@AlwaysNull
public float[] method(float arg1, float arg2, float arg3) {
return null;
}

/**
* {@inheritDoc}
*/
@MaybeNull
@AlwaysNull
public double[] method(double arg1, double arg2, double arg3) {
return null;
}

/**
* {@inheritDoc}
*/
@MaybeNull
@AlwaysNull
public Object[] method(Object arg1, Object arg2, Object arg3) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package net.bytebuddy.benchmark;

import net.bytebuddy.benchmark.specimen.ExampleInterface;
import net.bytebuddy.utility.nullability.MaybeNull;
import org.openjdk.jmh.annotations.*;
import org.openjdk.jmh.infra.Blackhole;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package net.bytebuddy.benchmark;

import net.bytebuddy.benchmark.specimen.ExampleClass;
import net.bytebuddy.utility.nullability.MaybeNull;
import org.openjdk.jmh.annotations.*;
import org.openjdk.jmh.infra.Blackhole;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/**
* A package containing benchmarks for Byte Buddy and other code generation libraries.
*/
@NeverNull
@NeverNull.ByDefault
package net.bytebuddy.benchmark;

import net.bytebuddy.utility.nullability.NeverNull;
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/**
* A package dedicated to running benchmarks.
*/
@NeverNull
@NeverNull.ByDefault
package net.bytebuddy.benchmark.runner;

import net.bytebuddy.utility.nullability.NeverNull;
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
package net.bytebuddy.benchmark.specimen;

import net.bytebuddy.utility.nullability.MaybeNull;

/**
* An example interface with several methods which is used as a specimen in benchmarks.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/**
* Specimen classes which are required for some benchmarks.
*/
@NeverNull
@NeverNull.ByDefault
package net.bytebuddy.benchmark.specimen;

import net.bytebuddy.utility.nullability.NeverNull;
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@
import net.bytebuddy.utility.JavaModule;
import net.bytebuddy.utility.JavaType;
import net.bytebuddy.utility.dispatcher.JavaDispatcher;
import net.bytebuddy.utility.nullability.AlwaysNull;
import net.bytebuddy.utility.nullability.MaybeNull;
import org.objectweb.asm.*;

import javax.annotation.CheckForNull;
import java.io.*;
import java.lang.instrument.*;
import java.lang.ref.WeakReference;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* but offers higher-level APIs in order to allow for the implementation of very readable transformations using
* {@link net.bytebuddy.ByteBuddy}.
*/
@NeverNull
@NeverNull.ByDefault
package net.bytebuddy.agent.builder;

import net.bytebuddy.utility.nullability.NeverNull;
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import org.objectweb.asm.FieldVisitor;
import org.objectweb.asm.MethodVisitor;

import javax.annotation.CheckForNull;
import java.util.*;

import static net.bytebuddy.matcher.ElementMatchers.isConstructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import net.bytebuddy.pool.TypePool;
import net.bytebuddy.utility.CompoundList;
import net.bytebuddy.utility.OpenedClassReader;
import net.bytebuddy.utility.nullability.MaybeNull;
import net.bytebuddy.utility.visitor.LocalVariableAwareMethodVisitor;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
import net.bytebuddy.implementation.attribute.MethodAttributeAppender;
import net.bytebuddy.matcher.ElementMatcher;
import net.bytebuddy.matcher.ElementMatchers;
import net.bytebuddy.utility.nullability.MaybeNull;
import org.objectweb.asm.AnnotationVisitor;
import org.objectweb.asm.MethodVisitor;

import javax.annotation.CheckForNull;
import java.lang.annotation.*;
import java.util.Comparator;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import net.bytebuddy.utility.nullability.AlwaysNull;
import net.bytebuddy.utility.nullability.MaybeNull;

import javax.annotation.CheckForNull;
import java.io.*;
import java.lang.annotation.*;
import java.lang.reflect.Constructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
import net.bytebuddy.dynamic.DynamicType;
import net.bytebuddy.implementation.ToStringMethod;
import net.bytebuddy.matcher.ElementMatchers;
import net.bytebuddy.utility.nullability.MaybeNull;

import javax.annotation.CheckForNull;
import java.lang.annotation.*;

import static net.bytebuddy.matcher.ElementMatchers.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import net.bytebuddy.description.method.MethodDescription;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.description.type.TypeList;
import net.bytebuddy.utility.nullability.AlwaysNull;
import net.bytebuddy.utility.nullability.MaybeNull;

import static net.bytebuddy.matcher.ElementMatchers.named;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import net.bytebuddy.utility.nullability.MaybeNull;
import net.bytebuddy.utility.privilege.SetAccessibleAction;

import javax.annotation.CheckForNull;
import java.lang.annotation.*;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import net.bytebuddy.utility.nullability.AlwaysNull;
import net.bytebuddy.utility.nullability.MaybeNull;

import javax.annotation.CheckForNull;
import java.lang.annotation.Annotation;
import java.lang.annotation.AnnotationTypeMismatchException;
import java.lang.annotation.IncompleteAnnotationException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import net.bytebuddy.build.CachedReturnPlugin;
import net.bytebuddy.description.NamedElement;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.utility.nullability.MaybeNull;

import javax.annotation.CheckForNull;
import java.util.ArrayList;
import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.signature.SignatureWriter;

import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
import java.lang.reflect.Field;
import java.lang.reflect.GenericSignatureFormatError;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import org.objectweb.asm.Type;
import org.objectweb.asm.signature.SignatureWriter;

import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
import java.lang.annotation.Annotation;
import java.lang.reflect.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import net.bytebuddy.utility.nullability.AlwaysNull;
import net.bytebuddy.utility.nullability.MaybeNull;

import javax.annotation.CheckForNull;
import java.lang.annotation.Annotation;
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Constructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* reflection API, it would be required to load classes but by using these descriptions, it is possible to
* represent byte code elements without prior loading.
*/
@NeverNull
@NeverNull.ByDefault
package net.bytebuddy.description;

import net.bytebuddy.utility.nullability.NeverNull;
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@
import net.bytebuddy.description.annotation.AnnotationList;
import net.bytebuddy.description.annotation.AnnotationSource;
import net.bytebuddy.utility.nullability.AlwaysNull;
import net.bytebuddy.utility.nullability.MaybeNull;
import org.objectweb.asm.Opcodes;

import javax.annotation.CheckForNull;

/**
* A package description represents a Java package.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import net.bytebuddy.utility.nullability.MaybeNull;
import org.objectweb.asm.signature.SignatureWriter;

import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.GenericSignatureFormatError;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
import net.bytebuddy.utility.nullability.MaybeNull;
import net.bytebuddy.utility.nullability.UnknownNull;

import javax.annotation.Nonnull;
import javax.annotation.meta.When;
import java.lang.reflect.*;
import java.security.PrivilegedAction;
import java.util.Iterator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
import org.objectweb.asm.signature.SignatureVisitor;
import org.objectweb.asm.signature.SignatureWriter;

import javax.annotation.CheckForNull;
import java.io.Serializable;
import java.lang.annotation.Annotation;
import java.lang.annotation.ElementType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import net.bytebuddy.description.annotation.AnnotationDescription;
import net.bytebuddy.description.annotation.AnnotationList;
import net.bytebuddy.matcher.ElementMatcher;
import net.bytebuddy.utility.nullability.MaybeNull;

import javax.annotation.CheckForNull;
import java.util.Collections;
import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import net.bytebuddy.utility.CompoundList;
import net.bytebuddy.utility.FileSystem;
import net.bytebuddy.utility.GraalImageCode;
import net.bytebuddy.utility.nullability.MaybeNull;
import org.objectweb.asm.Opcodes;

import java.io.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
*/
package net.bytebuddy.dynamic;

import javax.annotation.CheckForNull;
import net.bytebuddy.utility.nullability.AlwaysNull;
import net.bytebuddy.utility.nullability.MaybeNull;

import java.lang.ref.Reference;
import java.lang.ref.ReferenceQueue;
import java.lang.ref.WeakReference;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@
import net.bytebuddy.utility.nullability.UnknownNull;
import net.bytebuddy.utility.privilege.GetMethodAction;

import javax.annotation.Nonnull;
import javax.annotation.meta.When;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import net.bytebuddy.utility.nullability.AlwaysNull;
import net.bytebuddy.utility.nullability.MaybeNull;

import javax.annotation.CheckForNull;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
Expand Down
Loading

0 comments on commit a9ab948

Please sign in to comment.