From e1d96f49fa926717d0a76bccda19c86e9d5bf929 Mon Sep 17 00:00:00 2001 From: Rafael Winterhalter Date: Sat, 9 Nov 2024 19:42:06 +0100 Subject: [PATCH] Make cached return plugin independent of (extenral) class loader and precompilation. --- byte-buddy-dep/pom.xml | 54 ++-- .../CachedReturnPlugin$Advice$Object.java | 60 ---- .../CachedReturnPlugin$Advice$boolean.java | 60 ---- .../build/CachedReturnPlugin$Advice$byte.java | 60 ---- .../build/CachedReturnPlugin$Advice$char.java | 60 ---- .../CachedReturnPlugin$Advice$double.java | 60 ---- .../CachedReturnPlugin$Advice$float.java | 60 ---- .../build/CachedReturnPlugin$Advice$int.java | 60 ---- .../build/CachedReturnPlugin$Advice$long.java | 60 ---- .../CachedReturnPlugin$Advice$short.java | 60 ---- .../bytebuddy/build/CachedReturnPlugin.java | 273 +++++++++++++++--- .../CachedReturnPlugin$Advice$Object.class | Bin 2112 -> 0 bytes .../CachedReturnPlugin$Advice$boolean.class | Bin 1914 -> 0 bytes .../CachedReturnPlugin$Advice$byte.class | Bin 1889 -> 0 bytes .../CachedReturnPlugin$Advice$char.class | Bin 1889 -> 0 bytes .../CachedReturnPlugin$Advice$double.class | Bin 1897 -> 0 bytes .../CachedReturnPlugin$Advice$float.class | Bin 1894 -> 0 bytes .../build/CachedReturnPlugin$Advice$int.class | Bin 1886 -> 0 bytes .../CachedReturnPlugin$Advice$long.class | Bin 1891 -> 0 bytes .../CachedReturnPlugin$Advice$short.class | Bin 1892 -> 0 bytes .../build/CachedReturnPluginOtherTest.java | 6 + .../build/CachedReturnPluginTest.java | 20 -- 22 files changed, 255 insertions(+), 638 deletions(-) delete mode 100644 byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$Object.java delete mode 100644 byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$boolean.java delete mode 100644 byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$byte.java delete mode 100644 byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$char.java delete mode 100644 byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$double.java delete mode 100644 byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$float.java delete mode 100644 byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$int.java delete mode 100644 byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$long.java delete mode 100644 byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$short.java delete mode 100644 byte-buddy-dep/src/main/precompiled-6/net/bytebuddy/build/CachedReturnPlugin$Advice$Object.class delete mode 100644 byte-buddy-dep/src/main/precompiled-6/net/bytebuddy/build/CachedReturnPlugin$Advice$boolean.class delete mode 100644 byte-buddy-dep/src/main/precompiled-6/net/bytebuddy/build/CachedReturnPlugin$Advice$byte.class delete mode 100644 byte-buddy-dep/src/main/precompiled-6/net/bytebuddy/build/CachedReturnPlugin$Advice$char.class delete mode 100644 byte-buddy-dep/src/main/precompiled-6/net/bytebuddy/build/CachedReturnPlugin$Advice$double.class delete mode 100644 byte-buddy-dep/src/main/precompiled-6/net/bytebuddy/build/CachedReturnPlugin$Advice$float.class delete mode 100644 byte-buddy-dep/src/main/precompiled-6/net/bytebuddy/build/CachedReturnPlugin$Advice$int.class delete mode 100644 byte-buddy-dep/src/main/precompiled-6/net/bytebuddy/build/CachedReturnPlugin$Advice$long.class delete mode 100644 byte-buddy-dep/src/main/precompiled-6/net/bytebuddy/build/CachedReturnPlugin$Advice$short.class diff --git a/byte-buddy-dep/pom.xml b/byte-buddy-dep/pom.xml index 38962848798..aad5b6f91ad 100644 --- a/byte-buddy-dep/pom.xml +++ b/byte-buddy-dep/pom.xml @@ -382,6 +382,29 @@ + + org.apache.maven.plugins + maven-resources-plugin + ${version.plugin.resources} + + + copy-advice-templates + + copy-resources + + prepare-package + + ${basedir}/target/destination-folder + + + src/main/precompiled-6 + false + + + + + + @@ -593,18 +616,6 @@ build-helper-maven-plugin ${version.plugin.buildhelper} - - java-6-precompile - generate-sources - - add-source - - - - src/main/java-6 - - - java-6-precompile-test generate-sources @@ -624,20 +635,6 @@ maven-antrun-plugin ${version.plugin.antrun} - - java-6-precompile-copy - process-classes - - run - - - - - - - - - java-6-precompile-test-copy process-test-classes @@ -666,11 +663,6 @@ - - - src/main/precompiled-6 - - src/test/precompiled-6 diff --git a/byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$Object.java b/byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$Object.java deleted file mode 100644 index 23bfb008022..00000000000 --- a/byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$Object.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2014 - Present Rafael Winterhalter - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package net.bytebuddy.build; - -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import net.bytebuddy.asm.Advice; -import net.bytebuddy.implementation.bytecode.assign.Assigner; - -/** - * An advice class for caching a reference value. - */ -class CachedReturnPlugin$Advice$Object { - - /** - * A constructor that prohibits the instantiation of the class. - */ - private CachedReturnPlugin$Advice$Object() { - throw new UnsupportedOperationException("This class is merely an advice template and should not be instantiated"); - } - - /** - * The enter advice. - * - * @param cached The cached field's value. - * @return {@code true} if a cached value exists. - */ - @Advice.OnMethodEnter(skipOn = Advice.OnNonDefaultValue.class) - protected static Object enter(@CachedReturnPlugin.CacheField Object cached) { - return cached; - } - - /** - * The exit advice. - * - * @param returned The value that was returned by the method's execution or {@code 0} if it was not executed. - * @param cached The previously cached value or {@code 0} if no previous value exists. - */ - @Advice.OnMethodExit - @SuppressFBWarnings(value = {"UC_USELESS_VOID_METHOD", "DLS_DEAD_LOCAL_STORE"}, justification = "Advice method serves as a template") - protected static void exit(@Advice.Return(readOnly = false, typing = Assigner.Typing.DYNAMIC) Object returned, @CachedReturnPlugin.CacheField Object cached) { - if (returned == null) { - returned = cached; - } else { - cached = returned; - } - } -} diff --git a/byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$boolean.java b/byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$boolean.java deleted file mode 100644 index 34fe87599f1..00000000000 --- a/byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$boolean.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2014 - Present Rafael Winterhalter - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package net.bytebuddy.build; - -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import net.bytebuddy.asm.Advice; - -/** - * An advice class for caching a {@code boolean} value. - */ -@SuppressFBWarnings(value = "NM_CLASS_NAMING_CONVENTION", justification = "Name is chosen to optimize for simple lookup") -class CachedReturnPlugin$Advice$boolean { - - /** - * A constructor that prohibits the instantiation of the class. - */ - private CachedReturnPlugin$Advice$boolean() { - throw new UnsupportedOperationException("This class is merely an advice template and should not be instantiated"); - } - - /** - * The enter advice. - * - * @param cached The cached field's value. - * @return {@code true} if a cached value exists. - */ - @Advice.OnMethodEnter(skipOn = Advice.OnNonDefaultValue.class) - protected static boolean enter(@CachedReturnPlugin.CacheField boolean cached) { - return cached; - } - - /** - * The exit advice. - * - * @param returned The value that was returned by the method's execution or {@code 0} if it was not executed. - * @param cached The previously cached value or {@code 0} if no previous value exists. - */ - @Advice.OnMethodExit - @SuppressFBWarnings(value = {"UC_USELESS_VOID_METHOD", "IP_PARAMETER_IS_DEAD_BUT_OVERWRITTEN"}, justification = "Advice method serves as a template") - protected static void exit(@Advice.Return(readOnly = false) boolean returned, @CachedReturnPlugin.CacheField boolean cached) { - if (returned) { - cached = true; - } else { - returned = true; - } - } -} diff --git a/byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$byte.java b/byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$byte.java deleted file mode 100644 index 99aa7de9f55..00000000000 --- a/byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$byte.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2014 - Present Rafael Winterhalter - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package net.bytebuddy.build; - -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import net.bytebuddy.asm.Advice; - -/** - * An advice class for caching a {@code byte} value. - */ -@SuppressFBWarnings(value = "NM_CLASS_NAMING_CONVENTION", justification = "Name is chosen to optimize for simple lookup") -class CachedReturnPlugin$Advice$byte { - - /** - * A constructor that prohibits the instantiation of the class. - */ - private CachedReturnPlugin$Advice$byte() { - throw new UnsupportedOperationException("This class is merely an advice template and should not be instantiated"); - } - - /** - * The enter advice. - * - * @param cached The cached field's value. - * @return {@code true} if a cached value exists. - */ - @Advice.OnMethodEnter(skipOn = Advice.OnNonDefaultValue.class) - protected static byte enter(@CachedReturnPlugin.CacheField byte cached) { - return cached; - } - - /** - * The exit advice. - * - * @param returned The value that was returned by the method's execution or {@code 0} if it was not executed. - * @param cached The previously cached value or {@code 0} if no previous value exists. - */ - @Advice.OnMethodExit - @SuppressFBWarnings(value = {"UC_USELESS_VOID_METHOD", "DLS_DEAD_LOCAL_STORE"}, justification = "Advice method serves as a template") - protected static void exit(@Advice.Return(readOnly = false) byte returned, @CachedReturnPlugin.CacheField byte cached) { - if (returned == 0) { - returned = cached; - } else { - cached = returned; - } - } -} diff --git a/byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$char.java b/byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$char.java deleted file mode 100644 index 55a7f029fe4..00000000000 --- a/byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$char.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2014 - Present Rafael Winterhalter - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package net.bytebuddy.build; - -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import net.bytebuddy.asm.Advice; - -/** - * An advice class for caching a {@code char} value. - */ -@SuppressFBWarnings(value = "NM_CLASS_NAMING_CONVENTION", justification = "Name is chosen to optimize for simple lookup") -class CachedReturnPlugin$Advice$char { - - /** - * A constructor that prohibits the instantiation of the class. - */ - private CachedReturnPlugin$Advice$char() { - throw new UnsupportedOperationException("This class is merely an advice template and should not be instantiated"); - } - - /** - * The enter advice. - * - * @param cached The cached field's value. - * @return {@code true} if a cached value exists. - */ - @Advice.OnMethodEnter(skipOn = Advice.OnNonDefaultValue.class) - protected static char enter(@CachedReturnPlugin.CacheField char cached) { - return cached; - } - - /** - * The exit advice. - * - * @param returned The value that was returned by the method's execution or {@code 0} if it was not executed. - * @param cached The previously cached value or {@code 0} if no previous value exists. - */ - @Advice.OnMethodExit - @SuppressFBWarnings(value = {"UC_USELESS_VOID_METHOD", "DLS_DEAD_LOCAL_STORE"}, justification = "Advice method serves as a template") - protected static void exit(@Advice.Return(readOnly = false) char returned, @CachedReturnPlugin.CacheField char cached) { - if (returned == 0) { - returned = cached; - } else { - cached = returned; - } - } -} diff --git a/byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$double.java b/byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$double.java deleted file mode 100644 index 07615848a47..00000000000 --- a/byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$double.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2014 - Present Rafael Winterhalter - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package net.bytebuddy.build; - -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import net.bytebuddy.asm.Advice; - -/** - * An advice class for caching a {@code double} value. - */ -@SuppressFBWarnings(value = "NM_CLASS_NAMING_CONVENTION", justification = "Name is chosen to optimize for simple lookup") -class CachedReturnPlugin$Advice$double { - - /** - * A constructor that prohibits the instantiation of the class. - */ - private CachedReturnPlugin$Advice$double() { - throw new UnsupportedOperationException("This class is merely an advice template and should not be instantiated"); - } - - /** - * The enter advice. - * - * @param cached The cached field's value. - * @return {@code true} if a cached value exists. - */ - @Advice.OnMethodEnter(skipOn = Advice.OnNonDefaultValue.class) - protected static double enter(@CachedReturnPlugin.CacheField double cached) { - return cached; - } - - /** - * The exit advice. - * - * @param returned The value that was returned by the method's execution or {@code 0} if it was not executed. - * @param cached The previously cached value or {@code 0} if no previous value exists. - */ - @Advice.OnMethodExit - @SuppressFBWarnings(value = {"UC_USELESS_VOID_METHOD", "DLS_DEAD_LOCAL_STORE"}, justification = "Advice method serves as a template") - protected static void exit(@Advice.Return(readOnly = false) double returned, @CachedReturnPlugin.CacheField double cached) { - if (returned == 0d) { - returned = cached; - } else { - cached = returned; - } - } -} diff --git a/byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$float.java b/byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$float.java deleted file mode 100644 index a5d60f83534..00000000000 --- a/byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$float.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2014 - Present Rafael Winterhalter - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package net.bytebuddy.build; - -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import net.bytebuddy.asm.Advice; - -/** - * An advice class for caching a {@code float} value. - */ -@SuppressFBWarnings(value = "NM_CLASS_NAMING_CONVENTION", justification = "Name is chosen to optimize for simple lookup") -class CachedReturnPlugin$Advice$float { - - /** - * A constructor that prohibits the instantiation of the class. - */ - private CachedReturnPlugin$Advice$float() { - throw new UnsupportedOperationException("This class is merely an advice template and should not be instantiated"); - } - - /** - * The enter advice. - * - * @param cached The cached field's value. - * @return {@code true} if a cached value exists. - */ - @Advice.OnMethodEnter(skipOn = Advice.OnNonDefaultValue.class) - protected static float enter(@CachedReturnPlugin.CacheField float cached) { - return cached; - } - - /** - * The exit advice. - * - * @param returned The value that was returned by the method's execution or {@code 0} if it was not executed. - * @param cached The previously cached value or {@code 0} if no previous value exists. - */ - @Advice.OnMethodExit - @SuppressFBWarnings(value = {"UC_USELESS_VOID_METHOD", "DLS_DEAD_LOCAL_STORE"}, justification = "Advice method serves as a template") - protected static void exit(@Advice.Return(readOnly = false) float returned, @CachedReturnPlugin.CacheField float cached) { - if (returned == 0f) { - returned = cached; - } else { - cached = returned; - } - } -} diff --git a/byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$int.java b/byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$int.java deleted file mode 100644 index 69ce1281105..00000000000 --- a/byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$int.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2014 - Present Rafael Winterhalter - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package net.bytebuddy.build; - -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import net.bytebuddy.asm.Advice; - -/** - * An advice class for caching a {@code int} value. - */ -@SuppressFBWarnings(value = "NM_CLASS_NAMING_CONVENTION", justification = "Name is chosen to optimize for simple lookup") -class CachedReturnPlugin$Advice$int { - - /** - * A constructor that prohibits the instantiation of the class. - */ - private CachedReturnPlugin$Advice$int() { - throw new UnsupportedOperationException("This class is merely an advice template and should not be instantiated"); - } - - /** - * The enter advice. - * - * @param cached The cached field's value. - * @return {@code true} if a cached value exists. - */ - @Advice.OnMethodEnter(skipOn = Advice.OnNonDefaultValue.class) - protected static int enter(@CachedReturnPlugin.CacheField int cached) { - return cached; - } - - /** - * The exit advice. - * - * @param returned The value that was returned by the method's execution or {@code 0} if it was not executed. - * @param cached The previously cached value or {@code 0} if no previous value exists. - */ - @Advice.OnMethodExit - @SuppressFBWarnings(value = {"UC_USELESS_VOID_METHOD", "DLS_DEAD_LOCAL_STORE"}, justification = "Advice method serves as a template") - protected static void exit(@Advice.Return(readOnly = false) int returned, @CachedReturnPlugin.CacheField int cached) { - if (returned == 0) { - returned = cached; - } else { - cached = returned; - } - } -} diff --git a/byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$long.java b/byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$long.java deleted file mode 100644 index c05cbaf41af..00000000000 --- a/byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$long.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2014 - Present Rafael Winterhalter - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package net.bytebuddy.build; - -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import net.bytebuddy.asm.Advice; - -/** - * An advice class for caching a {@code long} value. - */ -@SuppressFBWarnings(value = "NM_CLASS_NAMING_CONVENTION", justification = "Name is chosen to optimize for simple lookup") -class CachedReturnPlugin$Advice$long { - - /** - * A constructor that prohibits the instantiation of the class. - */ - private CachedReturnPlugin$Advice$long() { - throw new UnsupportedOperationException("This class is merely an advice template and should not be instantiated"); - } - - /** - * The enter advice. - * - * @param cached The cached field's value. - * @return {@code true} if a cached value exists. - */ - @Advice.OnMethodEnter(skipOn = Advice.OnNonDefaultValue.class) - protected static long enter(@CachedReturnPlugin.CacheField long cached) { - return cached; - } - - /** - * The exit advice. - * - * @param returned The value that was returned by the method's execution or {@code 0} if it was not executed. - * @param cached The previously cached value or {@code 0} if no previous value exists. - */ - @Advice.OnMethodExit - @SuppressFBWarnings(value = {"UC_USELESS_VOID_METHOD", "DLS_DEAD_LOCAL_STORE"}, justification = "Advice method serves as a template") - protected static void exit(@Advice.Return(readOnly = false) long returned, @CachedReturnPlugin.CacheField long cached) { - if (returned == 0L) { - returned = cached; - } else { - cached = returned; - } - } -} diff --git a/byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$short.java b/byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$short.java deleted file mode 100644 index c525e124f18..00000000000 --- a/byte-buddy-dep/src/main/java-6/net/bytebuddy/build/CachedReturnPlugin$Advice$short.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2014 - Present Rafael Winterhalter - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package net.bytebuddy.build; - -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import net.bytebuddy.asm.Advice; - -/** - * An advice class for caching a {@code short} value. - */ -@SuppressFBWarnings(value = "NM_CLASS_NAMING_CONVENTION", justification = "Name is chosen to optimize for simple lookup") -class CachedReturnPlugin$Advice$short { - - /** - * A constructor that prohibits the instantiation of the class. - */ - private CachedReturnPlugin$Advice$short() { - throw new UnsupportedOperationException("This class is merely an advice template and should not be instantiated"); - } - - /** - * The enter advice. - * - * @param cached The cached field's value. - * @return {@code true} if a cached value exists. - */ - @Advice.OnMethodEnter(skipOn = Advice.OnNonDefaultValue.class) - protected static short enter(@CachedReturnPlugin.CacheField short cached) { - return cached; - } - - /** - * The exit advice. - * - * @param returned The value that was returned by the method's execution or {@code 0} if it was not executed. - * @param cached The previously cached value or {@code 0} if no previous value exists. - */ - @Advice.OnMethodExit - @SuppressFBWarnings(value = {"UC_USELESS_VOID_METHOD", "DLS_DEAD_LOCAL_STORE"}, justification = "Advice method serves as a template") - protected static void exit(@Advice.Return(readOnly = false) short returned, @CachedReturnPlugin.CacheField short cached) { - if (returned == 0) { - returned = cached; - } else { - cached = returned; - } - } -} diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/build/CachedReturnPlugin.java b/byte-buddy-dep/src/main/java/net/bytebuddy/build/CachedReturnPlugin.java index d3ae6c1392e..37f6201f031 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/build/CachedReturnPlugin.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/build/CachedReturnPlugin.java @@ -16,22 +16,33 @@ package net.bytebuddy.build; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import net.bytebuddy.ByteBuddy; +import net.bytebuddy.ClassFileVersion; import net.bytebuddy.asm.Advice; +import net.bytebuddy.description.annotation.AnnotationDescription; import net.bytebuddy.description.method.MethodDescription; import net.bytebuddy.description.modifier.FieldPersistence; import net.bytebuddy.description.modifier.Ownership; import net.bytebuddy.description.modifier.SyntheticState; import net.bytebuddy.description.modifier.Visibility; +import net.bytebuddy.description.type.TypeDefinition; import net.bytebuddy.description.type.TypeDescription; import net.bytebuddy.dynamic.ClassFileLocator; import net.bytebuddy.dynamic.DynamicType; +import net.bytebuddy.dynamic.scaffold.TypeValidation; +import net.bytebuddy.dynamic.scaffold.subclass.ConstructorStrategy; +import net.bytebuddy.implementation.Implementation; +import net.bytebuddy.implementation.bytecode.ByteCodeAppender; +import net.bytebuddy.implementation.bytecode.StackSize; import net.bytebuddy.implementation.bytecode.assign.Assigner; -import net.bytebuddy.pool.TypePool; +import net.bytebuddy.implementation.bytecode.member.MethodReturn; +import net.bytebuddy.implementation.bytecode.member.MethodVariableAccess; import net.bytebuddy.utility.RandomString; +import org.objectweb.asm.Label; +import org.objectweb.asm.MethodVisitor; +import org.objectweb.asm.Opcodes; import java.lang.annotation.*; -import java.util.HashMap; -import java.util.Map; import static net.bytebuddy.matcher.ElementMatchers.*; @@ -51,11 +62,6 @@ public class CachedReturnPlugin extends Plugin.ForElementMatcher implements Plug */ private static final String NAME_INFIX = "_"; - /** - * The infix symbol for advice classes. - */ - private static final String ADVICE_INFIX = "$Advice$"; - /** * A description of the {@link Enhance#value()} method. */ @@ -75,21 +81,6 @@ public class CachedReturnPlugin extends Plugin.ForElementMatcher implements Plug @HashCodeAndEqualsPlugin.ValueHandling(HashCodeAndEqualsPlugin.ValueHandling.Sort.IGNORE) private final RandomString randomString; - /** - * The class file locator to use. - */ - private final ClassFileLocator classFileLocator; - - /** - * A map of advice types mapped by their argument type. All advice types are precompiled using Java 6 to allow - * for releasing Byte Buddy with a Java 5 byte code level where compiled classes do not contain stack map frames. - * Byte Buddy filters stack map frames when applying advice in newer version but it cannot add stack map frames - * without explicit frame computation which is expensive which is why precompilation was used. To avoid loading - * Java classes in incompatible versions, all advice types are resolved using a type pool. - */ - @HashCodeAndEqualsPlugin.ValueHandling(HashCodeAndEqualsPlugin.ValueHandling.Sort.IGNORE) - private final Map adviceByType; - /** * Creates a plugin for caching method return values. If a field name exists before applying this plugin, an exception is raised. */ @@ -106,24 +97,6 @@ public CachedReturnPlugin(boolean ignoreExistingFields) { super(declaresMethod(isAnnotatedWith(Enhance.class))); this.ignoreExistingFields = ignoreExistingFields; randomString = new RandomString(); - classFileLocator = ClassFileLocator.ForClassLoader.of(CachedReturnPlugin.class.getClassLoader()); - TypePool typePool = TypePool.Default.of(classFileLocator); - adviceByType = new HashMap(); - for (Class type : new Class[]{ - boolean.class, - byte.class, - short.class, - char.class, - int.class, - long.class, - float.class, - double.class, - Object.class - }) { - adviceByType.put(TypeDescription.ForLoadedType.ForLoadedType.of(type), typePool.describe(CachedReturnPlugin.class.getName() - + ADVICE_INFIX - + type.getSimpleName()).resolve()); - } } /** @@ -161,12 +134,9 @@ public DynamicType.Builder apply(DynamicType.Builder builder, TypeDescript : Ownership.MEMBER, methodDescription.isStatic() ? FieldPersistence.PLAIN : FieldPersistence.TRANSIENT, Visibility.PRIVATE, SyntheticState.SYNTHETIC) - .visit(Advice.withCustomMapping() - .bind(CacheField.class, new CacheFieldOffsetMapping(name)) - .to(adviceByType.get(methodDescription.getReturnType().isPrimitive() - ? methodDescription.getReturnType().asErasure() - : TypeDescription.ForLoadedType.of(Object.class)), this.classFileLocator) - .on(is(methodDescription))); + .visit(AdviceResolver + .of(methodDescription.getReturnType()) + .toAdvice(name).on(is(methodDescription))); } return builder; } @@ -205,6 +175,215 @@ public void close() { /* empty */ } + /** + * A resolver for {@link Advice} that caches a method's return type. + */ + protected enum AdviceResolver { + + /** + * A resolver for a {@code boolean} type. + */ + BOOLEAN(boolean.class, Opcodes.ILOAD, Opcodes.ISTORE, Opcodes.NOP, Opcodes.IFNE), + + /** + * A resolver for a {@code byte} type. + */ + BYTE(byte.class, Opcodes.ILOAD, Opcodes.ISTORE, Opcodes.NOP, Opcodes.IFNE), + + /** + * A resolver for a {@code short} type. + */ + SHORT(short.class, Opcodes.ILOAD, Opcodes.ISTORE, Opcodes.NOP, Opcodes.IFNE), + + /** + * A resolver for a {@code char} type. + */ + CHARACTER(char.class, Opcodes.ILOAD, Opcodes.ISTORE, Opcodes.NOP, Opcodes.IFNE), + + /** + * A resolver for a {@code int} type. + */ + INTEGER(int.class, Opcodes.ILOAD, Opcodes.ISTORE, Opcodes.NOP, Opcodes.IFNE), + + /** + * A resolver for a {@code long} type. + */ + LONG(long.class, Opcodes.LLOAD, Opcodes.LSTORE, Opcodes.L2I, Opcodes.IFNE), + + /** + * A resolver for a {@code float} type. + */ + FLOAT(float.class, Opcodes.FLOAD, Opcodes.FSTORE, Opcodes.F2I, Opcodes.IFNE), + + /** + * A resolver for a {@code double} type. + */ + DOUBLE(double.class, Opcodes.DLOAD, Opcodes.DSTORE, Opcodes.D2I, Opcodes.IFNE), + + /** + * A resolver for a reference type. + */ + REFERENCE(Object.class, Opcodes.ALOAD, Opcodes.ASTORE, Opcodes.NOP, Opcodes.IFNONNULL); + + /** + * The created dynamic type to use for advice. + */ + private final DynamicType.Loaded dynamicType; + + /** + * Creates an advice resolver. + * + * @param type The type of the return type. + * @param load The byte code that loads a value onto the stack from the local variable array. + * @param store The byte code that stores a value to the local variable array. + * @param convert An instruction to convert the cached value to a value that is applied on the branch instruction. + * @param branch A jump instruction that checks if the cached value is already set. + */ + AdviceResolver(Class type, int load, int store, int convert, int branch) { + dynamicType = new ByteBuddy(ClassFileVersion.JAVA_V6) + .with(TypeValidation.DISABLED) + .subclass(Object.class, ConstructorStrategy.Default.NO_CONSTRUCTORS) + .name(CachedReturnPlugin.class.getName() + "$Advice$" + this) + .defineMethod("enter", type, Ownership.STATIC) + .withParameter(type) + .annotateParameter(AnnotationDescription.Builder.ofType(CachedReturnPlugin.CacheField.class).build()) + .intercept(new Implementation.Simple( + MethodVariableAccess.of(TypeDescription.ForLoadedType.of(type)).loadFrom(0), + MethodReturn.of(TypeDescription.ForLoadedType.of(type)) + )) + .annotateMethod(AnnotationDescription.Builder.ofType(Advice.OnMethodEnter.class) + .define("skipOn", Advice.OnNonDefaultValue.class) + .build()) + .defineMethod("exit", void.class, Ownership.STATIC) + .withParameter(type) + .annotateParameter(AnnotationDescription.Builder.ofType(Advice.Return.class) + .define("readOnly", false) + .define("typing", Assigner.Typing.DYNAMIC) + .build()) + .withParameter(type) + .annotateParameter(AnnotationDescription.Builder.ofType(CachedReturnPlugin.CacheField.class).build()) + .intercept(new Implementation.Simple(new ExitAdviceByteCodeAppender(load, store, convert, branch, StackSize.of(type).getSize()))) + .annotateMethod(AnnotationDescription.Builder.ofType(Advice.OnMethodExit.class).build()) + .make() + .load(null); + dynamicType.getLoaded().getMethods(); + } + + /** + * Creates an advice resolver for a given type definition. + * + * @param typeDefinition The type definition for which advice is to be created. + * @return An appropriate advice resolver. + */ + protected static AdviceResolver of(TypeDefinition typeDefinition) { + if (typeDefinition.represents(boolean.class)) { + return BOOLEAN; + } else if (typeDefinition.represents(byte.class)) { + return BYTE; + } else if (typeDefinition.represents(short.class)) { + return SHORT; + } else if (typeDefinition.represents(char.class)) { + return CHARACTER; + } else if (typeDefinition.represents(int.class)) { + return INTEGER; + } else if (typeDefinition.represents(long.class)) { + return LONG; + } else if (typeDefinition.represents(float.class)) { + return FLOAT; + } else if (typeDefinition.represents(double.class)) { + return DOUBLE; + } else if (typeDefinition.isPrimitive()) { + throw new IllegalArgumentException("Unexpected advice type: " + typeDefinition); + } else { + return REFERENCE; + } + } + + /** + * Resolve advice for a given field name. + * + * @param name The name of the field to resolve the advice for. + * @return An appropriate advice. + */ + protected Advice toAdvice(String name) { + return Advice.withCustomMapping() + .bind(CacheField.class, new CacheFieldOffsetMapping(name)) + .to(dynamicType.getTypeDescription(), dynamicType); + } + + /** + * A byte code appender for the exit advice. + */ + @HashCodeAndEqualsPlugin.Enhance + protected static class ExitAdviceByteCodeAppender implements ByteCodeAppender { + + /** + * The byte code that loads a value onto the stack from the local variable array. + */ + private final int load; + + /** + * The byte code that stores a value to the local variable array. + */ + private final int store; + + /** + * An instruction to convert the cached value to a value that is applied on the branch instruction. + */ + private final int convert; + + /** + * A jump instruction that checks if the cached value is already set. + */ + private final int branch; + + /** + * The size of the created type on the operand stack. + */ + private final int size; + + /** + * Creates a byte code appender for exit advice on a cached return plugin. + * + * @param load The byte code that loads a value onto the stack from the local variable array. + * @param store The byte code that stores a value to the local variable array. + * @param convert An instruction to convert the cached value to a value that is applied on the branch instruction. + * @param branch A jump instruction that checks if the cached value is already set. + * @param size The size of the created type on the operand stack. + */ + protected ExitAdviceByteCodeAppender(int load, int store, int convert, int branch, int size) { + this.load = load; + this.store = store; + this.convert = convert; + this.branch = branch; + this.size = size; + } + + /** + * {@inheritDoc} + */ + public Size apply(MethodVisitor methodVisitor, Implementation.Context implementationContext, MethodDescription instrumentedMethod) { + Label complete = new Label(), uncached = new Label(); + methodVisitor.visitVarInsn(load, 0); + if (convert != Opcodes.NOP) { + methodVisitor.visitInsn(convert); + } + methodVisitor.visitJumpInsn(branch, uncached); + methodVisitor.visitVarInsn(load, size); + methodVisitor.visitVarInsn(store, 0); + methodVisitor.visitJumpInsn(Opcodes.GOTO, complete); + methodVisitor.visitFrame(Opcodes.F_SAME, 0, null, 0, null); + methodVisitor.visitLabel(uncached); + methodVisitor.visitVarInsn(load, 0); + methodVisitor.visitVarInsn(store, size); + methodVisitor.visitLabel(complete); + methodVisitor.visitFrame(Opcodes.F_SAME, 0, null, 0, null); + methodVisitor.visitInsn(Opcodes.RETURN); + return new Size(size * 2, instrumentedMethod.getStackSize()); + } + } + } + /** * An offset mapping for the cached field. */ diff --git a/byte-buddy-dep/src/main/precompiled-6/net/bytebuddy/build/CachedReturnPlugin$Advice$Object.class b/byte-buddy-dep/src/main/precompiled-6/net/bytebuddy/build/CachedReturnPlugin$Advice$Object.class deleted file mode 100644 index 0c2c809e48d389bb0a44a0d4d07577db9572c477..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2112 zcmbVNTT|Oc6h3Pk1jOV*6B?Q}QCdR4Nu!2b+7z0`@uhJia0Y`rX&*dmX@Mp3+9Rzz z@h|FY`;?h>rhV*8e^jU6N;F^tX%dXIyJyekJ7>?g`um^X{ve`da;IpV9$57C1g%U_ zhE^^5#-fLe##g118k6keQj<}x)b$0UGp$(yaG|IlU_* zM)zGMw9_7F(T;t8;Iv~I_)dv?yTacPIu6ydAl{K`zUcR*C+6$zJ>lsUMq@&05i(j> zboY3lI{{Za&i?MwQ4!F3iBkjThykOyjaX^f5ltCMfGjH2)m+Q2iY$7>Xu7V}gx>A? zl{9L;rj!Uv0gobqEEY$y;8Dl<5Ab0_;2w`&$X;DpRAh9nuGYJ%EVg+Z=q3+h6zk@j zT#abM-KWF2pYf1)1PU{hK#9>*QqrmvfzRm9NQ@JUeqe-9Iq_0zM%Rxi_|b}*hL{MG z0~Clj-O${7vBrDJ>04B0lz&~))a?kS<4Ooc;JCD(a!vJ*92TRyuJB_g?)Z)uIoneC z?RY10_`!KPjkwnfMHE#Z|G+~f)lLMbWBs)Jvs*_RFURjD{ASR zxKD8E?{kYVI(q;&y*eza;Yt~Hc3dZ>w?N?yiX&9D=zB)DhxOlrb}0X_&2eB7{#-dx zFKr`>o-$e;R(iJNK5!2jl4` zc8sS?;TQ8xtj7~c;gDs9&eA#T&)_+Q-B~;zdh`)pg1|B!E@P5MG#fFE-zH=RL%#4A zP270;GmRD8U$M?65oVx8bRX|8q5S|pSCVM6sSRCCq8X1SF76#@=O{CY&l_e2-!+U2 zcnp&3uv+|yG7&9BRG=FXvNFKtGT3ym`NfZPo0bLLL&y|r27yhwU(p4O%W(MteM{#T hCg~!^Is87R$MnfUo<75R9`esI-oki?s&x0!+`r5dPrLvC diff --git a/byte-buddy-dep/src/main/precompiled-6/net/bytebuddy/build/CachedReturnPlugin$Advice$boolean.class b/byte-buddy-dep/src/main/precompiled-6/net/bytebuddy/build/CachedReturnPlugin$Advice$boolean.class deleted file mode 100644 index 84c9ce0f578a6cfcafa9b0bf7ab1a7072055ab41..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1914 zcmbVNZFAd15Z<$$C`p~Zq%^cCv?`>I6GBDlODG8x$9BLoj+L<;cL*OmXX%n$BA+}u zDbw&z_yv673!gdzGw_`s#qgXQ8k{DD!S?C2tKEHepWBuH`16)dQ zxp-e{Mk{qCVyAZ;i(caU$4)Pif$x;Lw=evrh?7Wd1<9UN^CkaCdSbp8hJoM;=wm{~ zA_8o2XK@F~c&QH~2H{pSQL*fcj?@y6C8ffc$1+sfqAwUtyJ}O!`=MVQhRD~H5>Ywe zS_|Y=y6^6iIenw$J5TPRDLhn(+)p9EvJlvH~fLC21U8@|LyKbl2e9^46+tmgNJxFvcccquM2G}1SvJJ}78@3kFkqO(vlu4A(Y3-P^2CNTlTrBBMt^X?k2s^b#%8x%FQL#zX|vY& zx?6S|oob_9b5X}~16^WEZF~En7Rru8I~<_><@dtg4I^7iBrohB3=fk*o-CSRv|!>o z0ats@w$flZjAG%t0}-WUR9|`mAwtDyqm4neJu@5zqc0*69NS#kJe|nb)IbH!_QNFb zZH$}ULrO}=9D@kre1ltN^yGhyJEN;e>y?K%68%$i3FxfPQx4HRb@hV3v zpd}|EtwCnkFE70!_A6z+oyoqU-0#q2XbM;J;wQR8Il4=iaF-uiW1mi?%X9@1Or&Kz zF_AKJKbdRlJ)UZo{^6OSt8@*|XRt2e=`7Z}9?j8hC@d4<4sP;5vw>;icAzskeWX#9No*#AhYr>!JM<8n$uWz+NK@yd)cg9WH`DakxIUp9FjxZd h*Fp0;g-N=J{T9CO(Q|sgkf#qJ&qMz)_6LQ@zW}#N0xAFi diff --git a/byte-buddy-dep/src/main/precompiled-6/net/bytebuddy/build/CachedReturnPlugin$Advice$byte.class b/byte-buddy-dep/src/main/precompiled-6/net/bytebuddy/build/CachedReturnPlugin$Advice$byte.class deleted file mode 100644 index cbf3d68c9758ab5bf960a29824f344f94f69617c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1889 zcmb7F+fo}x5bco!3t0GqZDK=WuWby1INtaYI}YTc8xB=M>q4MZk_XjjcYuM_tZHYL zGWnGJKwk2aCs!p^$$LI3l`|`1A`Da_X?AvcyZdyX?q2=**RQ`5(PLVjpiz3}(DO0+ zbb@m9!lBO`T4pr5B9$~>Fv^z}+l&g;I24R7HKY>FwAU5MChta&Of}+wM{S-+dp;5t z%&ydoo;H*)UiZ+5ZW@M%UN@Cd=v8^JE5Z$7(nP(A(jBSh%He?w#GKUx^oUSKB)}|H z7AuG($P5@U9Byu;%E+E*OD%y{Rw_2!$XIEIK4&!Pt94;^B-My(Ef7%Y zL_l2kyd&%(Lz}%5jqnI<m>fc> zT5*~LVpZBPxOaY6KiuO7oY72ky;E(JkyW$2zSex%srt=!y}7yOH_=f|w1g|Q8|=nf zDA&Yp+()m=AB4LdC$5%=T)0sj@2CADIW)#-!TR+gu6DdFr9o+&7!mq?kz`ENUk3s% zV#R266C>#cb`mT`Pb4Bbbh&bQHhXV*fe3`{#%UC~m@T)9kd!tYQwP>Ui(6&%`2P7{O`C(V5b=+Wnr{DIN{$|A*mWbbr|9v|zG1xqYVIKOJ?w z)HqJJWfFAwvK_}8XIZ|(#90B8OCxw`+fN>EZ1e$|aU7==oEi3uOK*t%M!9dN@^7f{ z2P8R~z}3FriEdGWZqo(a6$jebC$rNs3R*<{P1{|1{0`6mDX diff --git a/byte-buddy-dep/src/main/precompiled-6/net/bytebuddy/build/CachedReturnPlugin$Advice$char.class b/byte-buddy-dep/src/main/precompiled-6/net/bytebuddy/build/CachedReturnPlugin$Advice$char.class deleted file mode 100644 index 959fc8d9ed6b50f0c49f04931a3004dd5dbb2cd2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1889 zcmb7FZFAd15Z<$$C`p~Zq-|&uXjPgfjwuy=p`|3exUvJ8ajZ`4m;pX`&eA2mL_T?R zQl{aj@CW$97d~|cX5c$Nis3mqG}uitVEc5s)$TsK&+f{9{`KqcMD&O@W@wV0TJ&s+ zKAE8$J-6sni`E!Tu1h78&l%-Qt8GRFHwpx!OLeJ4BkgxZ+~VC3lDT^1^RUfhY0k&O zLei6((UZCoiPJqwL^lnBBd43nFmPP%_e8KQk~CH?!*oxorAlxpeX->Ccns(Xp%M`T zv*fP2h{Vqf7%?1fZl@}debJU$0zc|<#TnBA{$`sA_Yb!CAS;ta6-LE3 zd1po|V~D2_1Vx}M9w)S^4&N$;sk{hMC+!E0ubo|~f^NE}9ez?RrTBX{ldv2xPX|}xW8WP)2 zbs~4ApS1$m9v0OG#pnfFi}+Azo8xCEqCW_EA}o4=A`iQe(VesN9;zTX5Xl2ig-3Zz z4xv=dD2;uwA=_))J8mJB*@(bWkLVrWmalzfQ>2p0lGgD2?Jo1l~Zz856Zv zzJQBJG1_QhByHbJg2CvEScFG5S2oXP?+q^yfv{ebhJlUQvbzXL>4anIz*=B%F@}%+ z|6nt^d=jkJ-4}jh5lXr|>gu$P8_sh19L2GLvj|P`a8&<43=gAwqc*1nlg-KPGxh%I zsOzQrNxID>Mu)GNalCPs>)W$xWoi5TPcrc#srGwaDrQvR1^jxN&` zJfFk5fT#0V@A$Mpix61G!!6ttfo22K_-#XGVkj>BNK=bzKhea(`Y$-=GlV&45k1BA z8ML3n=URp~KeVAc8Jh8Ea53f3E>Lb7e?qu3@!i9|jAbHOfmP{y%4u5FRHhF!vND0q z9$3LOT^KoW<^~9QKdSXmJrt45BgZQhU`P%X{-N1em-*@Q?dT+T% PcX3{V{6p*ymZ$#)jPm&E diff --git a/byte-buddy-dep/src/main/precompiled-6/net/bytebuddy/build/CachedReturnPlugin$Advice$double.class b/byte-buddy-dep/src/main/precompiled-6/net/bytebuddy/build/CachedReturnPlugin$Advice$double.class deleted file mode 100644 index 17f3be01e22020512603801e95620d3eacda1156..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1897 zcmbVNTW=dh6h3P^+1%TvZRiEawxo_@N|(}-Qc^Ci?X;F0Zxtuz_F#>7C-EffS!-w3 zYWO2a`~e;jPnAG|cYYM&n{}vhniN#qv*VdLm+yS%oY_DB`t^4r`iM4XXp+`#dN4(w z%ut3N+VrVS8x~DI5>n{TEy@+l1f)w+Mw)36NoCV#7R`Hdi|cL_REH+!YEtsJ95SUi zAQetPVyfpJdmmFY45&lV_oPiA;esa{k*x4NmV~;+!UU1uex0ck(lB>(9QQL8vmQs3 zV*z|=(M-zErr=><(Y+Hs&SY?;1Xnr!TxhUZs8meurs9-q4tw)W&HTeH)=v{T!`qing&q~DLZQk##z zVzCr*U%}|aU`X!LZn?eNtk$c|X1nFpD($W6&QlNRzf`F=+m&jm(yn{uQoY^W@wTf7 z>>yEE>Mj=01ia5z?0!o z7QI7ARWnLrpKl7&2)F*LuJ0VM0kh~@W2;@Rmk?K@v{h?7X_vi5tJ>J9c@5N514ZEo z<@nu5ap~yDiTbE^@jZ9;qS#Ra*tru%(P7e`Bb%lyS~YgvkjZ^_S1OPi#hM3RpT{W| z)#pBkiAY+sxr4TJeA5fYM~}xmJaU+HSlWLtnZXt)>qbc!IOr~?14vS7hQ0%Df$>{L zhTo*QEjmAf>vayeuWdqF^W(-&tGZ!77hfZIqUmfxVcZ>;{~ry6RF3PM1}5#5g}z2Mfm1ZAco~O#Wx{OtmLd>EgdMGjyIV z;CvBd7N<)XZ~1hMu4BW-oef{c%Q6t>QoCPc&S7sMzwpD4G*x)=6HVl6zhEbu`dCa) z*Ad+VSbPXv8>zpg6wLzNNc}-S^_-!b(9BV07B3_GGYD^C&SMxXtI#TZM;S$Hii-5U zLR<#gVg`pU#)se1T}%dL7H>oo>Ah6@;z-+4bl<3cOqU^01oam|^rieXUBP@6-?!-t TdM7_e?_s@y{SPqT$xr_c#k>5L diff --git a/byte-buddy-dep/src/main/precompiled-6/net/bytebuddy/build/CachedReturnPlugin$Advice$float.class b/byte-buddy-dep/src/main/precompiled-6/net/bytebuddy/build/CachedReturnPlugin$Advice$float.class deleted file mode 100644 index 71674352e4694f0893be7874bd6c78d8cfba054a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1894 zcmbVNTT|Oc6h3Pk#Kn+=Bs7;cQ3wG;)2L}~O-V0~FDWy|%3yGB51zHOz=FK;Xje?= z|L9BqK;Jskr_8i7?R$Szr{Bsn)CAH_Y_C^)bS~fd&NPo$FOGe-H+Qkzks5{H7(nTAxNnfAIO+2Gv>l9@&v@TkobY0rnk zg4vOp(SwE(#_Jv!(M`kf!0VVOht7K|7Um)BEeWKXoEmIzo@DmL86SZRkoWi;ihHDPw*ur_c}TvbXWm56IC zfT(l~5!XHMF!+$6B|z`VzONht2j_g%j8#=^@ia1R9;Hb9_M2QC(}ugbVcgGo!g~T) z4khpfqlt{3x)f2!=-#myrxJK%girJWJe?ac+W~H;)sx@k@R;TT+Ry%98jW7KwqYKqWt5dC&tDS~lDK|Q;4S&6c z#CB6{is=4}BFK z4`hfpG{$T^ROtQqK*hdHD^B$41T}w8hRoTpGc1+kWzRXrmF(j^j8z!I@#7UVcgJH_Cl8 zlYdEtKOo7`1pe(Kp6D7C=sHc}syNWbK9!xO=?pwrPq%T$ddkiHZ2vRs(M+=ZFUuUA zrE|DHgEfh}vsmv0bcL=$;8+jWa8X1w7cs5hui?vLn4X*b;YS*~S^0@Z=BmFylFwqy zK#%AlvU>!NkAZ6?i#I#4q8nK}*k_S3>Ci4vZW3=ITv>#-urFX)EQ_!zeMdP>OPZGH zeT}>+?s}Ow)a9`hYG%VHwn)2hkT6#_1CF%lN)a UpVNB_MY@UeJmeo>zq2s@H?ubTM*si- diff --git a/byte-buddy-dep/src/main/precompiled-6/net/bytebuddy/build/CachedReturnPlugin$Advice$int.class b/byte-buddy-dep/src/main/precompiled-6/net/bytebuddy/build/CachedReturnPlugin$Advice$int.class deleted file mode 100644 index 9be9616ae5a543525175064d39d30f9a2a9a2462..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1886 zcmb7FTW=dh6h31+*(7y(aof-)&~8iWIH7bYEiEPC;@S>aa=cZX7y%E~cz2RavYxee zW}}9m!XMy;7oIAC1n>MP#5e0ulT?YQ?b+FL=3KvX&iJptfBS=oKBn~heTd`j}ZT zdr~uc)KbED{Uam#X&4@P{ZvMwSL4B+2sedE6ZIlWccogahKDi`i&7bQo)F521THJh zS}#LdlA895MLsU_T1m5L2FGFIB5&l%17YD1X4IBbke6q`zkq!w|l1>&ik ziihigckKFvqD@~P$f2(s0s>cj)s9tN?C>-)T^^-K`~G>RPD#Vu-IH;@;0YfHWO*Wi zuNci_;H*m#g>M1hSP8BQ;-xe|vC?eX!c8R^&;s^mJB9}b8+@2m$)PHv;_JLKrKR(- zIz|?P@Un26P*WYgQ3^(nTOv%obP#%h_I9KS`{}Os__$hLCmjwGq4oOnZ+W7m+SM>R zaX12ZZoAgo?lfABPN&!PoAusCW9u8g&gfdb)#=q6)q1bx*Q%{vXUpGgAhG>a8@VHc ztQCOvsHiR=MlZNpB!@z~96#5H!7$=RIP@Gv9yKAOJ7?!T5%QAQ~?N0TZ!e zw7!LbbOSpG*2h33B06%pa(Om+uVDcTcOvz6gv%C}{blrLzW-(aJf3r^d}8w8Z}naXdPV?w#Xf-29AgpDFimKV7f1#_4uU zg8p8$!+7H?%{P!Z>#8J|CU9fhPafAb+5oLM4QdTE!+vq)6|vtb_gyLfiVA;%lcO0t z?d48%iwbm`F5s;=lEyxpQ5WeFELcnTabhjy=6|uzOnWlpto%naN0;de&P!Mqa5{(e zPC)at0ES~N+`>x{-dy;!cDvx&7>e^h(bU4~&onW=_ABUo=Ai^Bq9=Ghh4eGnT+O`A zjdbWv=FM8Pelc;7E>Lb7|3G-N@!i8-#d#va*4dayay`KKh;> zVzV*k@i%Dme3WTl9cwd9kFDw_bR7aK0RAdqzE+;58`y8+`!0P+@0E-6KIld8Kg9l^ GJpB(E?)VG< diff --git a/byte-buddy-dep/src/main/precompiled-6/net/bytebuddy/build/CachedReturnPlugin$Advice$long.class b/byte-buddy-dep/src/main/precompiled-6/net/bytebuddy/build/CachedReturnPlugin$Advice$long.class deleted file mode 100644 index 98e42c0414017e78a58a19645725ce2be848f7ea..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1891 zcmb7FTT>f16h5*I%RLE6Xf7>m5(0*%+2+!uDQQ#3HVKUJW-z$72amifK(N+&R$369Qw?mB}Ri!rIO|gM)~4GlTo1@hl0_$npC2mcG@D@;Oz)IleIYDQIjXqt`9d0 zW=Cp94{J&ouYF)dI}O7Fubs*$^vXQg5#hQpX`)_5>9$m}rEp&cVm6A^He3$~Wkdp> z#npvXAPF)BMhuIq>!~ubBbri6_$w(D8*XH*v_qdW8u!(jFgtNr?U@)`QA#A`h-)nX zsCWzz*B$TBcb}q-U+>ATuN(pe7kpKZRYh#^G%`&drHK2^S*DIj!`#h&+^=}TI|5Pm z1@I-Kk&K;XDWZ_kgJV8UxTiYsQq_RVKXnn)Jr>|7ie!ws<54IYmXmg%WI_FZX&c^e*P6t zlvLXqMhEtLs17{ zn`$GsWRR5t*zP6O1;wZZSBqp{XqV&X8qw)S+z5xBBgwrgWOU>7xO*Z12O@dstLPw) z&LO0#5vNHYmZfcjTW44G-Ce%V8C|QdwaT>;qNfy>PeU#MKhWg&W23UfLZahlUup;LntQakCpe5bFc7pZM5s8QnT&`T6_1;@vum!?);xr0f^p@KOB&7{U*MYUr`YkiM z|Nk4C(fK2=etTC0#v!D1uHV#271!(K#WMttHJn2zihKR?|Dkyp-R{>p2~5@}GpEY^ zQ&E?TwWDwwCP9TS*>=2gn&vx9oCcU&8o;G(KY85Pr~?$^Fjh~oW|$`y-w^waa^Fnm z-%#NX?Br+!PkX-;O;dqpXcYg(deWH3v(*Hhg9U5p4kWE?Zu)2Y%(MqH>BWC(=IA_K z!1*M`C{Cv^-V5j&UB`xl`x?Himl+@~WOl#CT)^JM^zaWq(vbV?CmNV8{eqo*=3_ED zeT3*9!{QU*TFU%QWoRboM&=Ltndcncgl2(qqj(MBpG9~Z^Bji7G7qidca+n#plOjl z)QHPMo6O*qj_?r$45BE3tAg_}{RYv7k zdFMt;ClF5~2#P?NKT2p_9lTZwMh}`I%Dk)}d7<`pq>8%PuJ-tGwY(r33{s)>+Ow~D zs-)W0a5{D{BzJbZ*4Yjk%|;M(+WvaIv(ec4%C9rJQf~&GdZSwJH2qq&*$KA%%?1+N z%e0X@GR#{6Y!8d-f@1W7t3`Ssw9D~xjpz?zZiGY6P~>47GP-qk-a{1x2O@dotN5^p z(IJ#7NU}5(Ytqia!oRfj-93K58O^meI<;mMX|<{w>#Z+4HNVwvw6@m$7Fw!>o^Yjh z!(O6=a!ukU12nt*Ubs6+>S~G5g&QZyel{qRLlcaatY0tYYS-IV8k}N;MC1=dnp4qu z5em3S6r;5*45b^|QLq?&k&5`x<;vyx^t~bmA~4oVvN&=vTy7U3DQ!5$4zxuUw}#gI zAEV9a;&HTocTa@IAry6S)YoY}H=O2`Hz=MMIfu{|_eS;q!}u_|J!*4WF!`k1JX7!Q zp1N9T9;X|a6g|Fb2lCokmaj2!R>0)a7~b3VQ^ZRfjevHX#OW!{4Ey<&m&AUh!Z$O; zmsI*4k^)WPYG3h0H>gB6=^XCLLv8HS`RP1efCua84xU&~g}I;XHMbtmB`g21EYL-| zgy%C@=kRnE>#dOHXdVK`dboj`GSFOLTEA_`Yz*bOA82BJ^+y_;d-^lZ#T;P constructor = Class.forName(CachedReturnPlugin.class.getName() + "$Advice$" + adviceArgument.getSimpleName(), - true, - CachedReturnPlugin.class.getClassLoader()).getDeclaredConstructor(); - constructor.setAccessible(true); - try { - constructor.newInstance(); - fail(); - } catch (InvocationTargetException exception) { - throw (Exception) exception.getTargetException(); - } - } - - @Test - public void testJavaVersion() throws Exception { - Class type = Class.forName(CachedReturnPlugin.class.getName() + "$Advice$" + adviceArgument.getSimpleName()); - assertThat(ClassFileVersion.of(type), is(ClassFileVersion.JAVA_V6)); - } - public static class BooleanSample { private boolean executed;