Skip to content

Commit

Permalink
[release] Release new version.
Browse files Browse the repository at this point in the history
  • Loading branch information
raphw committed Apr 7, 2022
1 parent 6a2b8ca commit 85a0943
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2058,8 +2058,10 @@ public int getOwnerIdOf(File file) {
try {
// The binding for 'stat' is very platform dependant. To avoid the complexity of binding the correct method,
// stat is called as a separate command. This is less efficient but more portable.
String statUserSwitch = Platform.isMac() ? "-f" : "-c";
Process process = Runtime.getRuntime().exec("stat " + statUserSwitch + " %u " + file.getAbsolutePath());
Process process = Runtime.getRuntime().exec(new String[]{"stat",
Platform.isMac() ? "-f" : "-c",
"%u",
file.getAbsolutePath()});
int attempts = this.attempts;
boolean exited = false;
String line = new BufferedReader(new InputStreamReader(process.getInputStream(), "UTF-8")).readLine();
Expand Down
2 changes: 2 additions & 0 deletions byte-buddy-dep/src/main/java/net/bytebuddy/ByteBuddy.java
Original file line number Diff line number Diff line change
Expand Up @@ -1382,6 +1382,7 @@ public ByteBuddy with(ClassWriterStrategy classWriterStrategy) {
* @param ignoredMethods A matcher for identifying methods to be excluded from instrumentation.
* @return A new Byte Buddy instance that excludes any method from instrumentation if it is matched by the supplied matcher.
*/
@SuppressWarnings("overloads")
public ByteBuddy ignore(ElementMatcher<? super MethodDescription> ignoredMethods) {
return ignore(new LatentMatcher.Resolved<MethodDescription>(ignoredMethods));
}
Expand All @@ -1397,6 +1398,7 @@ public ByteBuddy ignore(ElementMatcher<? super MethodDescription> ignoredMethods
* @param ignoredMethods A matcher for identifying methods to be excluded from instrumentation.
* @return A new Byte Buddy instance that excludes any method from instrumentation if it is matched by the supplied matcher.
*/
@SuppressWarnings("overloads")
public ByteBuddy ignore(LatentMatcher<? super MethodDescription> ignoredMethods) {
return new ByteBuddy(classFileVersion,
namingStrategy,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ public interface AgentBuilder {
* @param locationStrategy The location strategy to use.
* @return A new instance of this agent builder which uses the given location strategy for looking up class files.
*/
@SuppressWarnings("overloads")
AgentBuilder with(LocationStrategy locationStrategy);

/**
Expand Down Expand Up @@ -231,6 +232,7 @@ public interface AgentBuilder {
* @param fallbackStrategy The fallback strategy to be used.
* @return A new agent builder that applies the supplied fallback strategy.
*/
@SuppressWarnings("overloads")
AgentBuilder with(FallbackStrategy fallbackStrategy);

/**
Expand All @@ -257,6 +259,7 @@ public interface AgentBuilder {
* @param injectionStrategy The injection strategy to use.
* @return A new agent builder with the supplied injection strategy configured.
*/
@SuppressWarnings("overloads")
AgentBuilder with(InjectionStrategy injectionStrategy);

/**
Expand Down Expand Up @@ -1404,6 +1407,7 @@ interface WithImplicitDiscoveryStrategy extends RedefinitionListenable {
* @param redefinitionDiscoveryStrategy The redefinition discovery strategy to use.
* @return A new instance of this agent builder which makes use of the specified discovery strategy.
*/
@SuppressWarnings("overloads")
RedefinitionListenable with(RedefinitionStrategy.DiscoveryStrategy redefinitionDiscoveryStrategy);
}

Expand All @@ -1420,6 +1424,7 @@ interface WithoutBatchStrategy extends WithImplicitDiscoveryStrategy {
* @param redefinitionBatchAllocator The batch allocator to use.
* @return A new instance of this agent builder which makes use of the specified batch allocator.
*/
@SuppressWarnings("overloads")
WithImplicitDiscoveryStrategy with(RedefinitionStrategy.BatchAllocator redefinitionBatchAllocator);
}
}
Expand Down Expand Up @@ -2944,6 +2949,7 @@ public ForAdvice include(List<? extends ClassFileLocator> classFileLocators) {
* @param name The fully-qualified, binary name of the advice class.
* @return A new instance of this advice transformer that applies the given advice to all matched methods of an instrumented type.
*/
@SuppressWarnings("overloads")
public ForAdvice advice(ElementMatcher<? super MethodDescription> matcher, String name) {
return advice(new LatentMatcher.Resolved<MethodDescription>(matcher), name);
}
Expand All @@ -2955,6 +2961,7 @@ public ForAdvice advice(ElementMatcher<? super MethodDescription> matcher, Strin
* @param name The fully-qualified, binary name of the advice class.
* @return A new instance of this advice transformer that applies the given advice to all matched methods of an instrumented type.
*/
@SuppressWarnings("overloads")
public ForAdvice advice(LatentMatcher<? super MethodDescription> matcher, String name) {
return new ForAdvice(advice,
exceptionHandler,
Expand All @@ -2973,6 +2980,7 @@ public ForAdvice advice(LatentMatcher<? super MethodDescription> matcher, String
* @param exit The fully-qualified, binary name of the exit advice class.
* @return A new instance of this advice transformer that applies the given advice to all matched methods of an instrumented type.
*/
@SuppressWarnings("overloads")
public ForAdvice advice(ElementMatcher<? super MethodDescription> matcher, String enter, String exit) {
return advice(new LatentMatcher.Resolved<MethodDescription>(matcher), enter, exit);
}
Expand All @@ -2985,6 +2993,7 @@ public ForAdvice advice(ElementMatcher<? super MethodDescription> matcher, Strin
* @param exit The fully-qualified, binary name of the exit advice class.
* @return A new instance of this advice transformer that applies the given advice to all matched methods of an instrumented type.
*/
@SuppressWarnings("overloads")
public ForAdvice advice(LatentMatcher<? super MethodDescription> matcher, String enter, String exit) {
return new ForAdvice(advice,
exceptionHandler,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ Iterator<AgentBuilder.Transformer> iterator(TypeDescription typeDescription,
* @param redefinitionBatchAllocator The batch allocator to use.
* @return {@code true} if a reset was applied and this transformer was not previously removed.
*/
@SuppressWarnings("overloads")
boolean reset(Instrumentation instrumentation,
AgentBuilder.RedefinitionStrategy redefinitionStrategy,
AgentBuilder.RedefinitionStrategy.BatchAllocator redefinitionBatchAllocator);
Expand All @@ -117,6 +118,7 @@ boolean reset(Instrumentation instrumentation,
* @param redefinitionDiscoveryStrategy The discovery strategy for the types to reset.
* @return {@code true} if a reset was applied and this transformer was not previously removed.
*/
@SuppressWarnings("overloads")
boolean reset(Instrumentation instrumentation,
AgentBuilder.RedefinitionStrategy redefinitionStrategy,
AgentBuilder.RedefinitionStrategy.DiscoveryStrategy redefinitionDiscoveryStrategy);
Expand Down Expand Up @@ -172,6 +174,7 @@ boolean reset(Instrumentation instrumentation,
* @param redefinitionListener The redefinition listener to apply.
* @return {@code true} if a reset was applied and this transformer was not previously removed.
*/
@SuppressWarnings("overloads")
boolean reset(Instrumentation instrumentation,
AgentBuilder.RedefinitionStrategy redefinitionStrategy,
AgentBuilder.RedefinitionStrategy.DiscoveryStrategy redefinitionDiscoveryStrategy,
Expand Down Expand Up @@ -200,6 +203,7 @@ boolean reset(Instrumentation instrumentation,
* @param redefinitionListener The redefinition listener to apply.
* @return {@code true} if a reset was applied and this transformer was not previously removed.
*/
@SuppressWarnings("overloads")
boolean reset(Instrumentation instrumentation,
AgentBuilder.RedefinitionStrategy redefinitionStrategy,
AgentBuilder.RedefinitionStrategy.BatchAllocator redefinitionBatchAllocator,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,7 @@ interface Builder<T> {
* @param matcher The matcher that determines what declared fields are affected by the subsequent specification.
* @return A builder that allows for changing a field's definition.
*/
@SuppressWarnings("overloads")
FieldDefinition.Valuable<T> field(ElementMatcher<? super FieldDescription> matcher);

/**
Expand All @@ -993,6 +994,7 @@ interface Builder<T> {
* @param matcher The matcher that determines what declared fields are affected by the subsequent specification.
* @return A builder that allows for changing a field's definition.
*/
@SuppressWarnings("overloads")
FieldDefinition.Valuable<T> field(LatentMatcher<? super FieldDescription> matcher);

/**
Expand All @@ -1009,6 +1011,7 @@ interface Builder<T> {
* @return A new builder that is equal to this builder but that is excluding any method that is matched by the supplied matcher from
* instrumentation.
*/
@SuppressWarnings("overloads")
Builder<T> ignoreAlso(ElementMatcher<? super MethodDescription> ignoredMethods);

/**
Expand All @@ -1027,6 +1030,7 @@ interface Builder<T> {
* @return A new builder that is equal to this builder but that is excluding any method that is matched by the supplied matcher from
* instrumentation.
*/
@SuppressWarnings("overloads")
Builder<T> ignoreAlso(LatentMatcher<? super MethodDescription> ignoredMethods);

/**
Expand Down Expand Up @@ -1270,6 +1274,7 @@ interface Builder<T> {
* @param matcher The matcher that determines what methods or constructors are affected by the subsequent specification.
* @return A builder that allows for changing a method's or constructor's definition.
*/
@SuppressWarnings("overloads")
MethodDefinition.ImplementationDefinition<T> invokable(ElementMatcher<? super MethodDescription> matcher);

/**
Expand Down Expand Up @@ -1302,6 +1307,7 @@ interface Builder<T> {
* @param matcher The matcher that determines what declared methods or constructors are affected by the subsequent specification.
* @return A builder that allows for changing a method's or constructor's definition.
*/
@SuppressWarnings("overloads")
MethodDefinition.ImplementationDefinition<T> invokable(LatentMatcher<? super MethodDescription> matcher);

/**
Expand Down Expand Up @@ -1370,6 +1376,7 @@ interface Builder<T> {
* @param matcher The matcher that determines what declared record components are affected by the subsequent specification.
* @return A builder that allows for changing a record component's definition.
*/
@SuppressWarnings("overloads")
RecordComponentDefinition<T> recordComponent(ElementMatcher<? super RecordComponentDescription> matcher);

/**
Expand All @@ -1391,6 +1398,7 @@ interface Builder<T> {
* @param matcher The matcher that determines what declared record components are affected by the subsequent specification.
* @return A builder that allows for changing a record component's definition.
*/
@SuppressWarnings("overloads")
RecordComponentDefinition<T> recordComponent(LatentMatcher<? super RecordComponentDescription> matcher);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ class ForStaticField implements LoadedTypeInitializer, Serializable {
/**
* The value of the field.
*/
@SuppressWarnings("serial")
private final Object value;

/**
Expand Down Expand Up @@ -197,6 +198,7 @@ class Compound implements LoadedTypeInitializer, Serializable {
/**
* The loaded type initializers that are represented by this compound type initializer.
*/
@SuppressWarnings("serial")
private final List<LoadedTypeInitializer> loadedTypeInitializers;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ public static WithoutSpecifiedTarget invoke(MethodDescription methodDescription)
* @param matcher The matcher to identify the method to invoke.
* @return A method call for the uniquely identified method.
*/
@SuppressWarnings("overloads")
public static WithoutSpecifiedTarget invoke(ElementMatcher<? super MethodDescription> matcher) {
return invoke(matcher, MethodGraph.Compiler.DEFAULT);
}
Expand All @@ -199,6 +200,7 @@ public static WithoutSpecifiedTarget invoke(ElementMatcher<? super MethodDescrip
* @return A method call implementation that uses the provided method locator for resolving the method
* to be invoked.
*/
@SuppressWarnings("overloads")
public static WithoutSpecifiedTarget invoke(MethodLocator.Factory methodLocator) {
return new WithoutSpecifiedTarget(methodLocator);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,14 @@ public void setUp() throws Exception {
ClassFileVersion.ofThisVm().isAtLeast(ClassFileVersion.JAVA_V17),
ClassFileVersion.ofThisVm().isAtLeast(ClassFileVersion.JAVA_V17)))
.make()
.include(new ByteBuddy().decorate(AbstractAnnotationDescriptionTest.class).make())
.include(new ByteBuddy().decorate(IncompatibleAnnotationProperty.class).make())
.include(new ByteBuddy().decorate(IncompatibleEnumerationProperty.class).make())
.include(new ByteBuddy().decorate(SampleEnumeration.class).make())
.include(new ByteBuddy().decorate(DefectiveAnnotation.class).make())
.include(new ByteBuddy().subclass(Object.class).name(BrokenAnnotationProperty.class.getName()).make())
.include(new ByteBuddy().subclass(Object.class).name(BrokenEnumerationProperty.class.getName()).make())
.load(getClassLoader(), ClassLoadingStrategy.Default.CHILD_FIRST_PERSISTENT)
.load(ClassLoadingStrategy.BOOTSTRAP_LOADER, ClassLoadingStrategy.Default.WRAPPER_PERSISTENT)
.getLoaded();
broken = brokenCarrier.getAnnotations()[0];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import java.lang.ref.Reference;
import java.lang.ref.ReferenceQueue;
import java.lang.ref.SoftReference;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
Expand Down Expand Up @@ -194,7 +195,7 @@ public void testUnavailableDispatcherRegisterThrowsException() throws Exception
@Test(expected = UnsupportedOperationException.class)
@SuppressWarnings("unchecked")
public void testUnavailableDispatcherCleanThrowsException() throws Exception {
new NexusAccessor.Dispatcher.Unavailable("unavailable").clean(mock(Reference.class));
new NexusAccessor.Dispatcher.Unavailable("unavailable").clean(new SoftReference<ClassLoader>(ClassLoader.getSystemClassLoader()));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1416,8 +1416,8 @@ public String toString() {
return super.toString();
}

@Override
@SuppressWarnings("deprecation")
//@Override
@SuppressWarnings({"deprecation", "removal"})
protected void finalize() throws Throwable {
super.finalize();
}
Expand Down

0 comments on commit 85a0943

Please sign in to comment.