From 6c99cf14115f26ae8603a15248021aea31d02c96 Mon Sep 17 00:00:00 2001 From: Philipp Wollermann Date: Tue, 17 Jul 2018 12:54:11 +0200 Subject: Remove third_party/{minlog,reflectasm} --- third_party/BUILD | 30 ++------- third_party/minlog/LICENSE | 10 --- third_party/minlog/minlog-1.2.jar | Bin 3085 -> 0 bytes third_party/reflectasm/LICENSE | 10 --- third_party/reflectasm/README.md | 94 --------------------------- third_party/reflectasm/reflectasm-1.10.1.jar | Bin 74282 -> 0 bytes 6 files changed, 4 insertions(+), 140 deletions(-) delete mode 100644 third_party/minlog/LICENSE delete mode 100644 third_party/minlog/minlog-1.2.jar delete mode 100644 third_party/reflectasm/LICENSE delete mode 100644 third_party/reflectasm/README.md delete mode 100644 third_party/reflectasm/reflectasm-1.10.1.jar diff --git a/third_party/BUILD b/third_party/BUILD index b34f1676e8..cc310b3436 100644 --- a/third_party/BUILD +++ b/third_party/BUILD @@ -513,39 +513,17 @@ java_import( ], ) -java_import( - name = "minlog_lib", - jars = ["minlog/minlog-1.2.jar"], -) - -java_library( - name = "minlog", - exports = ["minlog_lib"], -) - java_import( name = "mockito", jars = ["mockito/mockito-all-1.10.19.jar"], + deps = [ + ":objenesis", + ], ) java_import( - name = "objenesis_lib", - jars = ["objenesis/objenesis-1_3.jar"], -) - -java_library( name = "objenesis", - exports = ["objenesis_lib"], -) - -java_import( - name = "reflectasm_lib", - jars = ["reflectasm/reflectasm-1.10.1.jar"], -) - -java_library( - name = "reflectasm", - exports = ["reflectasm_lib"], + jars = ["objenesis/objenesis-1_3.jar"], ) java_import( diff --git a/third_party/minlog/LICENSE b/third_party/minlog/LICENSE deleted file mode 100644 index e1cd88478e..0000000000 --- a/third_party/minlog/LICENSE +++ /dev/null @@ -1,10 +0,0 @@ -Copyright (c) 2008, Nathan Sweet -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Esoteric Software nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/third_party/minlog/minlog-1.2.jar b/third_party/minlog/minlog-1.2.jar deleted file mode 100644 index 7cc55acf7f..0000000000 Binary files a/third_party/minlog/minlog-1.2.jar and /dev/null differ diff --git a/third_party/reflectasm/LICENSE b/third_party/reflectasm/LICENSE deleted file mode 100644 index e1cd88478e..0000000000 --- a/third_party/reflectasm/LICENSE +++ /dev/null @@ -1,10 +0,0 @@ -Copyright (c) 2008, Nathan Sweet -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Esoteric Software nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/third_party/reflectasm/README.md b/third_party/reflectasm/README.md deleted file mode 100644 index 8759addc6b..0000000000 --- a/third_party/reflectasm/README.md +++ /dev/null @@ -1,94 +0,0 @@ -![](https://raw.github.com/wiki/EsotericSoftware/reflectasm/images/logo.png) - -Please use the [ReflectASM discussion group](http://groups.google.com/group/reflectasm-users) for support. - -## Overview - -ReflectASM is a very small Java library that provides high performance reflection by using code generation. An access class is generated to set/get fields, call methods, or create a new instance. The access class uses bytecode rather than Java's reflection, so it is much faster. It can also access primitive fields via bytecode to avoid boxing. - -## Performance - -![](http://chart.apis.google.com/chart?chma=100&chtt=Field%20Set/Get&chs=700x62&chd=t:1402081,11339107&chds=0,11339107&chxl=0:|Java%20Reflection|FieldAccess&cht=bhg&chbh=10&chxt=y&chco=6600FF) - -![](http://chart.apis.google.com/chart?chma=100&chtt=Method%20Call&chs=700x62&chd=t:97390,208750&chds=0,208750&chxl=0:|Java%20Reflection|MethodAccess&cht=bhg&chbh=10&chxt=y&chco=6600AA) - -![](http://chart.apis.google.com/chart?chma=100&chtt=Constructor&chs=700x62&chd=t:2853063,5828993&chds=0,5828993&chxl=0:|Java%20Reflection|ConstructorAccess&cht=bhg&chbh=10&chxt=y&chco=660066) - -The source code for these benchmarks is included in the project. The above charts were generated on Oracle's Java 7u3, server VM. - -## Usage - -Method reflection with ReflectASM: - -```java - SomeClass someObject = ... - MethodAccess access = MethodAccess.get(SomeClass.class); - access.invoke(someObject, "setName", "Awesome McLovin"); - String name = (String)access.invoke(someObject, "getName"); -``` - -Field reflection with ReflectASM: - -```java - SomeClass someObject = ... - FieldAccess access = FieldAccess.get(SomeClass.class); - access.set(someObject, "name", "Awesome McLovin"); - String name = (String)access.get(someObject, "name"); -``` - -Constructor reflection with ReflectASM: - -```java - ConstructorAccess access = ConstructorAccess.get(SomeClass.class); - SomeClass someObject = access.newInstance(); -``` - -## Avoiding Name Lookup - -For maximum performance when methods or fields are accessed repeatedly, the method or field index should be used instead of the name: - -```java - SomeClass someObject = ... - MethodAccess access = MethodAccess.get(SomeClass.class); - int addNameIndex = access.getIndex("addName"); - for (String name : names) - access.invoke(someObject, addNameIndex, "Awesome McLovin"); -``` - -Iterate all fields: - -```java - FieldAccess access = FieldAccess.get(SomeClass.class); - for(int i = 0, n = access.getFieldCount(); i < n; i++) { - access.set(instanceObject, i, valueToPut); - } - } - -``` - -## Visibility - -ReflectASM can always access public members. An attempt is made to define access classes in the same classloader (using setAccessible) and package as the accessed class. If the security manager allows setAccessible to succeed, then protected and default access (package private) members can be accessed. If setAccessible fails, no exception is thrown, but only public members can be accessed. Private members can never be accessed. - -## Exceptions - -Stack traces when using ReflectASM are a bit cleaner. Here is Java's reflection calling a method that throws a RuntimeException: - - Exception in thread "main" java.lang.reflect.InvocationTargetException - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) - at java.lang.reflect.Method.invoke(Method.java:597) - at com.example.SomeCallingCode.doit(SomeCallingCode.java:22) - Caused by: java.lang.RuntimeException - at com.example.SomeClass.someMethod(SomeClass.java:48) - ... 5 more - -Here is the same but when ReflectASM is used: - - Exception in thread "main" java.lang.RuntimeException - at com.example.SomeClass.someMethod(SomeClass.java:48) - at com.example.SomeClassMethodAccess.invoke(Unknown Source) - at com.example.SomeCallingCode.doit(SomeCallingCode.java:22) - -If ReflectASM is used to invoke code that throws a checked exception, the checked exception is thrown. Because it is a compilation error to use try/catch with a checked exception around code that doesn't declare that exception as being thrown, you must catch Exception if you care about catching a checked exception in code you invoke with ReflectASM. diff --git a/third_party/reflectasm/reflectasm-1.10.1.jar b/third_party/reflectasm/reflectasm-1.10.1.jar deleted file mode 100644 index 7476612b7d..0000000000 Binary files a/third_party/reflectasm/reflectasm-1.10.1.jar and /dev/null differ -- cgit v1.2.3