/** * 2 AliasToBeanConstructorResultTransformer are considered equal if they have the same * defined constructor. * * @param other The other instance to check for equality. * @return True if both have the same defined constuctor; false otherwise. */ @Override public boolean equals(Object other) { return other instanceof AliasToBeanConstructorResultTransformer && constructor.equals( ( ( AliasToBeanConstructorResultTransformer ) other ).constructor ); } }
@Override public boolean equals(Object obj) { return target.equals(obj); }
public static boolean callEquals(Constructor thiz, Object a0) { return thiz.equals(a0); }
@Override public boolean equals(Object obj) { return target.equals(obj); }
/** * {@inheritDoc} */ public boolean represents(Constructor<?> constructor) { return this.constructor.equals(constructor) || equals(new MethodDescription.ForLoadedConstructor(constructor)); }
public static CachedConstructor find(Constructor constructor) { CachedConstructor[] constructors = ReflectionCache.getCachedClass(constructor.getDeclaringClass()).getConstructors(); for (int i = 0; i < constructors.length; i++) { CachedConstructor cachedConstructor = constructors[i]; if (cachedConstructor.cachedConstructor.equals(constructor)) return cachedConstructor; } throw new RuntimeException("Couldn't find method: " + constructor); }
private Constructor<?> getConstructor(Class<?> cl) throws HiveException { try { Constructor<?> [] ctors = cl.getDeclaredConstructors(); if (ctors.length == 1) { return ctors[0]; } Constructor<?> defaultCtor = cl.getConstructor(); for (Constructor<?> ctor : ctors) { if (!ctor.equals(defaultCtor)) { return ctor; } } throw new HiveException("Only default constructor found"); } catch (Exception ex) { throw new HiveException(ex); } }
private Constructor<?> getConstructor(Class<?> cl) throws HiveException { try { Constructor<?> [] ctors = cl.getDeclaredConstructors(); if (ctors.length == 1) { return ctors[0]; } Constructor<?> defaultCtor = cl.getConstructor(); for (Constructor<?> ctor : ctors) { if (!ctor.equals(defaultCtor)) { return ctor; } } throw new HiveException("Only default constructor found"); } catch (Exception ex) { throw new HiveException(ex); } }
defaultConstructor != null && !primaryConstructor.equals(defaultConstructor)) { candidateConstructors = new Constructor<?>[] {primaryConstructor, defaultConstructor};
for (int i = 0; i < constructors.length; ++i) { Constructor<?> constructor = constructors[i]; if (constructor.equals(constructorToUse)) { if (i > (int)Byte.MAX_VALUE) { throw new IllegalArgumentException(
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ConstructorOrMethod other = (ConstructorOrMethod) obj; if (getConstructor() == null) { if (other.getConstructor() != null) return false; } else if (!getConstructor().equals(other.getConstructor())) return false; if (getMethod() == null) { if (other.getMethod() != null) return false; } else if (!getMethod().equals(other.getMethod())) return false; return true; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ConstructorOrMethod other = (ConstructorOrMethod) obj; if (getConstructor() == null) { if (other.getConstructor() != null) return false; } else if (!getConstructor().equals(other.getConstructor())) return false; if (getMethod() == null) { if (other.getMethod() != null) return false; } else if (!getMethod().equals(other.getMethod())) return false; return true; }
defaultConstructor != null && !primaryConstructor.equals(defaultConstructor)) { candidateConstructors = new Constructor<?>[] {primaryConstructor, defaultConstructor};
/** * Compares based on the executable and the index. * * @param obj * The object to compare. * @return Whether or not this is equal to the argument. */ public boolean equals(Object obj) { if (obj instanceof RtParameter) { RtParameter other = (RtParameter) obj; if (method == null) { return (other.constructor.equals(constructor) && other.index == index); } return (other.method.equals(method) && other.index == index); } return false; }
public boolean equals(Object o) { if (o == null) return false; if (o == this) return true; if (!(o instanceof ConstructorCalledByConstructorJoinpoint)) return false; ConstructorCalledByConstructorJoinpoint jp = (ConstructorCalledByConstructorJoinpoint)o; if (!jp.calling.equals(this.calling)) return false; if (!jp.called.equals(this.called)) return false; return true; }
public boolean equals(Object o) { if (o == null) return false; if (o == this) return true; if (!(o instanceof MethodCalledByConstructorJoinpoint)) return false; MethodCalledByConstructorJoinpoint jp = (MethodCalledByConstructorJoinpoint)o; if (!jp.calling.equals(this.calling)) return false; if (!jp.called.equals(this.called)) return false; return true; }
@Override public boolean equals(Object other) { if (this == other) return true; if (other == null || getClass() != other.getClass()) return false; if (!super.equals(other)) return false; ForJava7CapableVm that = (ForJava7CapableVm) other; return methodInfo.equals(that.methodInfo); }
private <T> boolean computeIsConstructorValidated(Class<T> targetClass, Constructor<T> ctor) { final AnnotatedType<T> annotatedType = CDI.current().getBeanManager().createAnnotatedType(ctor.getDeclaringClass()); final ValidateOnExecution annotation = annotatedType.getConstructors().stream().filter(ac -> ctor.equals(ac.getJavaMember())).findFirst() .map(ac -> ac.getAnnotation(ValidateOnExecution.class)) .orElseGet(() -> ctor.getAnnotation(ValidateOnExecution.class)); final Set<ExecutableType> validatedExecutableTypes = annotation == null ? classConfiguration : ExecutableTypes.interpret(annotation.type()); return validatedExecutableTypes.contains(ExecutableType.CONSTRUCTORS); }
@Override protected boolean matches(InjectionPoint ip, AnnotatedCallable<?> annotatedCallable) { if (annotatedCallable instanceof AnnotatedConstructor<?>) { AnnotatedConstructor<?> annotatedConstructor = Reflections.cast(annotatedCallable); return constructor.get().equals(annotatedConstructor.getJavaMember()); } return false; } }
@Override protected boolean matches(InjectionPoint ip, AnnotatedCallable<?> annotatedCallable) { if (annotatedCallable instanceof AnnotatedConstructor<?>) { AnnotatedConstructor<?> annotatedConstructor = Reflections.cast(annotatedCallable); return constructor.get().equals(annotatedConstructor.getJavaMember()); } return false; } }