diff options
Diffstat (limited to 'src/com/google/testing')
-rw-r--r-- | src/com/google/testing/littlemock/LittleMock.java | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/src/com/google/testing/littlemock/LittleMock.java b/src/com/google/testing/littlemock/LittleMock.java index 0e96938..140f853 100644 --- a/src/com/google/testing/littlemock/LittleMock.java +++ b/src/com/google/testing/littlemock/LittleMock.java @@ -1314,17 +1314,6 @@ public class LittleMock { newInstance.setAccessible(true); return (T) newInstance.invoke(null, clazz, constructorId); } catch (Exception ignored) {} - // try dalvikvm, with change https://android-review.googlesource.com/#/c/52331/ - try { - Method getConstructorId = ObjectStreamClass.class - .getDeclaredMethod("getConstructorId", Class.class); - getConstructorId.setAccessible(true); - final long constructorId = (Long) getConstructorId.invoke(null, Object.class); - final Method newInstance = ObjectStreamClass.class - .getDeclaredMethod("newInstance", Class.class, long.class); - newInstance.setAccessible(true); - return (T) newInstance.invoke(null, clazz, constructorId); - } catch (Exception ignored) {} throw new IllegalStateException("unsafe create instance failed"); } |