From 7c1eef17073d2276396b85c0dc4786cf54e11104 Mon Sep 17 00:00:00 2001 From: tdurieux Date: Tue, 7 Mar 2017 13:27:40 +0100 Subject: [PATCH] buggy files form Mockito #11 --- .../internal/creation/DelegatingMethod.java | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 projects/Mockito/11/org/mockito/internal/creation/DelegatingMethod.java diff --git a/projects/Mockito/11/org/mockito/internal/creation/DelegatingMethod.java b/projects/Mockito/11/org/mockito/internal/creation/DelegatingMethod.java new file mode 100644 index 0000000..349719b --- /dev/null +++ b/projects/Mockito/11/org/mockito/internal/creation/DelegatingMethod.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2007 Mockito contributors + * This program is made available under the terms of the MIT License. + */ +package org.mockito.internal.creation; + +import org.mockito.internal.invocation.MockitoMethod; + +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; + +public class DelegatingMethod implements MockitoMethod { + + private final Method method; + + public DelegatingMethod(Method method) { + assert method != null : "Method cannot be null"; + this.method = method; + } + + public Class[] getExceptionTypes() { + return method.getExceptionTypes(); + } + + public Method getJavaMethod() { + return method; + } + + public String getName() { + return method.getName(); + } + + public Class[] getParameterTypes() { + return method.getParameterTypes(); + } + + public Class getReturnType() { + return method.getReturnType(); + } + + public boolean isVarArgs() { + return method.isVarArgs(); + } + + public boolean isAbstract() { + return (method.getModifiers() & Modifier.ABSTRACT) != 0; + } + + /** + * @return True if the input object is a DelegatingMethod which has an internal Method which is equal to the internal Method of this DelegatingMethod, + * or if the input object is a Method which is equal to the internal Method of this DelegatingMethod. + */ + @Override + public boolean equals(Object o) { + return method.equals(o); + } + + @Override + public int hashCode() { + return 1; + } +} \ No newline at end of file