mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
Stub more of Spring
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* https://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 org.springframework.context;
|
||||
|
||||
public interface MessageSourceResolvable {
|
||||
String[] getCodes();
|
||||
|
||||
default Object[] getArguments() {
|
||||
return null;
|
||||
}
|
||||
|
||||
default String getDefaultMessage() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* https://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 org.springframework.context.support;
|
||||
|
||||
import java.io.Serializable;
|
||||
import org.springframework.context.MessageSourceResolvable;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
public class DefaultMessageSourceResolvable implements MessageSourceResolvable, Serializable {
|
||||
public DefaultMessageSourceResolvable(String code) {}
|
||||
|
||||
public DefaultMessageSourceResolvable(String[] codes) {}
|
||||
|
||||
public DefaultMessageSourceResolvable(String[] codes, String defaultMessage) {}
|
||||
|
||||
public DefaultMessageSourceResolvable(String[] codes, Object[] arguments) {}
|
||||
|
||||
public DefaultMessageSourceResolvable(
|
||||
@Nullable String[] codes, @Nullable Object[] arguments, @Nullable String defaultMessage) {}
|
||||
|
||||
public DefaultMessageSourceResolvable(MessageSourceResolvable resolvable) {}
|
||||
|
||||
public String getCode() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getCodes() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] getArguments() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultMessage() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean shouldRenderDefaultMessage() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected final String resolvableToString() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,50 +1,188 @@
|
||||
// Generated automatically from org.springframework.util.ObjectUtils for testing purposes
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* https://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 org.springframework.util;
|
||||
|
||||
|
||||
abstract public class ObjectUtils
|
||||
{
|
||||
public ObjectUtils(){}
|
||||
public static <A, O extends A> A[] addObjectToArray(A[] p0, O p1){ return null; }
|
||||
public static <E extends Enum<? extends Object>> E caseInsensitiveValueOf(E[] p0, String p1){ return null; }
|
||||
public static Object unwrapOptional(Object p0){ return null; }
|
||||
public static Object[] toObjectArray(Object p0){ return null; }
|
||||
public static String getDisplayString(Object p0){ return null; }
|
||||
public static String getIdentityHexString(Object p0){ return null; }
|
||||
public static String identityToString(Object p0){ return null; }
|
||||
public static String nullSafeClassName(Object p0){ return null; }
|
||||
public static String nullSafeToString(Object p0){ return null; }
|
||||
public static String nullSafeToString(Object[] p0){ return null; }
|
||||
public static String nullSafeToString(boolean[] p0){ return null; }
|
||||
public static String nullSafeToString(byte[] p0){ return null; }
|
||||
public static String nullSafeToString(char[] p0){ return null; }
|
||||
public static String nullSafeToString(double[] p0){ return null; }
|
||||
public static String nullSafeToString(float[] p0){ return null; }
|
||||
public static String nullSafeToString(int[] p0){ return null; }
|
||||
public static String nullSafeToString(long[] p0){ return null; }
|
||||
public static String nullSafeToString(short[] p0){ return null; }
|
||||
public static boolean containsConstant(Enum<? extends Object>[] p0, String p1){ return false; }
|
||||
public static boolean containsConstant(Enum<? extends Object>[] p0, String p1, boolean p2){ return false; }
|
||||
public static boolean containsElement(Object[] p0, Object p1){ return false; }
|
||||
public static boolean isArray(Object p0){ return false; }
|
||||
public static boolean isCheckedException(Throwable p0){ return false; }
|
||||
public static boolean isCompatibleWithThrowsClause(Throwable p0, Class<? extends Object>... p1){ return false; }
|
||||
public static boolean isEmpty(Object p0){ return false; }
|
||||
public static boolean isEmpty(Object[] p0){ return false; }
|
||||
public static boolean nullSafeEquals(Object p0, Object p1){ return false; }
|
||||
public static int hashCode(boolean p0){ return 0; }
|
||||
public static int hashCode(double p0){ return 0; }
|
||||
public static int hashCode(float p0){ return 0; }
|
||||
public static int hashCode(long p0){ return 0; }
|
||||
public static int nullSafeHashCode(Object p0){ return 0; }
|
||||
public static int nullSafeHashCode(Object[] p0){ return 0; }
|
||||
public static int nullSafeHashCode(boolean[] p0){ return 0; }
|
||||
public static int nullSafeHashCode(byte[] p0){ return 0; }
|
||||
public static int nullSafeHashCode(char[] p0){ return 0; }
|
||||
public static int nullSafeHashCode(double[] p0){ return 0; }
|
||||
public static int nullSafeHashCode(float[] p0){ return 0; }
|
||||
public static int nullSafeHashCode(int[] p0){ return 0; }
|
||||
public static int nullSafeHashCode(long[] p0){ return 0; }
|
||||
public static int nullSafeHashCode(short[] p0){ return 0; }
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
public abstract class ObjectUtils {
|
||||
public static boolean isCheckedException(Throwable ex) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isCompatibleWithThrowsClause(
|
||||
Throwable ex, @Nullable Class<?>... declaredExceptions) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isArray(@Nullable Object obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isEmpty(@Nullable Object[] array) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isEmpty(@Nullable Object obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static Object unwrapOptional(@Nullable Object obj) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean containsElement(@Nullable Object[] array, Object element) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean containsConstant(Enum<?>[] enumValues, String constant) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean containsConstant(
|
||||
Enum<?>[] enumValues, String constant, boolean caseSensitive) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static <E extends Enum<?>> E caseInsensitiveValueOf(E[] enumValues, String constant) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static <A, O extends A> A[] addObjectToArray(@Nullable A[] array, @Nullable O obj) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Object[] toObjectArray(@Nullable Object source) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean nullSafeEquals(@Nullable Object o1, @Nullable Object o2) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static int nullSafeHashCode(@Nullable Object obj) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int nullSafeHashCode(@Nullable Object[] array) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int nullSafeHashCode(@Nullable boolean[] array) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int nullSafeHashCode(@Nullable byte[] array) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int nullSafeHashCode(@Nullable char[] array) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int nullSafeHashCode(@Nullable double[] array) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int nullSafeHashCode(@Nullable float[] array) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int nullSafeHashCode(@Nullable int[] array) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int nullSafeHashCode(@Nullable long[] array) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int nullSafeHashCode(@Nullable short[] array) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int hashCode(boolean bool) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int hashCode(double dbl) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int hashCode(float flt) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int hashCode(long lng) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static String identityToString(@Nullable Object obj) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getIdentityHexString(Object obj) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getDisplayString(@Nullable Object obj) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String nullSafeClassName(@Nullable Object obj) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String nullSafeToString(@Nullable Object obj) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String nullSafeToString(@Nullable Object[] array) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String nullSafeToString(@Nullable boolean[] array) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String nullSafeToString(@Nullable byte[] array) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String nullSafeToString(@Nullable char[] array) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String nullSafeToString(@Nullable double[] array) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String nullSafeToString(@Nullable float[] array) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String nullSafeToString(@Nullable int[] array) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String nullSafeToString(@Nullable long[] array) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String nullSafeToString(@Nullable short[] array) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* https://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 org.springframework.validation;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
public interface Errors {
|
||||
String getObjectName();
|
||||
|
||||
void setNestedPath(String nestedPath);
|
||||
|
||||
String getNestedPath();
|
||||
|
||||
void pushNestedPath(String subPath);
|
||||
|
||||
void popNestedPath() throws IllegalStateException;
|
||||
|
||||
void reject(String errorCode);
|
||||
|
||||
void reject(String errorCode, String defaultMessage);
|
||||
|
||||
void reject(String errorCode, @Nullable Object[] errorArgs, @Nullable String defaultMessage);
|
||||
|
||||
void rejectValue(@Nullable String field, String errorCode);
|
||||
|
||||
void rejectValue(@Nullable String field, String errorCode, String defaultMessage);
|
||||
|
||||
void rejectValue(
|
||||
@Nullable String field,
|
||||
String errorCode,
|
||||
@Nullable Object[] errorArgs,
|
||||
@Nullable String defaultMessage);
|
||||
|
||||
void addAllErrors(Errors errors);
|
||||
|
||||
boolean hasErrors();
|
||||
|
||||
int getErrorCount();
|
||||
|
||||
List<ObjectError> getAllErrors();
|
||||
|
||||
boolean hasGlobalErrors();
|
||||
|
||||
int getGlobalErrorCount();
|
||||
|
||||
List<ObjectError> getGlobalErrors();
|
||||
|
||||
ObjectError getGlobalError();
|
||||
|
||||
boolean hasFieldErrors();
|
||||
|
||||
int getFieldErrorCount();
|
||||
|
||||
List<FieldError> getFieldErrors();
|
||||
|
||||
FieldError getFieldError();
|
||||
|
||||
boolean hasFieldErrors(String field);
|
||||
|
||||
int getFieldErrorCount(String field);
|
||||
|
||||
List<FieldError> getFieldErrors(String field);
|
||||
|
||||
FieldError getFieldError(String field);
|
||||
|
||||
Object getFieldValue(String field);
|
||||
|
||||
Class<?> getFieldType(String field);
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* https://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 org.springframework.validation;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
public class FieldError extends ObjectError {
|
||||
|
||||
private final String field;
|
||||
|
||||
@Nullable private final Object rejectedValue;
|
||||
|
||||
private final boolean bindingFailure;
|
||||
|
||||
public FieldError(String objectName, String field, String defaultMessage) {
|
||||
this(objectName, field, null, false, null, null, defaultMessage);
|
||||
}
|
||||
|
||||
public FieldError(
|
||||
String objectName,
|
||||
String field,
|
||||
@Nullable Object rejectedValue,
|
||||
boolean bindingFailure,
|
||||
@Nullable String[] codes,
|
||||
@Nullable Object[] arguments,
|
||||
@Nullable String defaultMessage) {
|
||||
super(objectName, "");
|
||||
this.field = field;
|
||||
this.rejectedValue = rejectedValue;
|
||||
this.bindingFailure = bindingFailure;
|
||||
}
|
||||
|
||||
public String getField() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Object getRejectedValue() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isBindingFailure() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* https://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 org.springframework.validation;
|
||||
|
||||
import org.springframework.context.support.DefaultMessageSourceResolvable;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
public class ObjectError extends DefaultMessageSourceResolvable {
|
||||
|
||||
private final String objectName;
|
||||
|
||||
@Nullable private transient Object source;
|
||||
|
||||
public ObjectError(String objectName, String defaultMessage) {
|
||||
super("");
|
||||
this.objectName = objectName;
|
||||
}
|
||||
|
||||
public ObjectError(
|
||||
String objectName,
|
||||
@Nullable String[] codes,
|
||||
@Nullable Object[] arguments,
|
||||
@Nullable String defaultMessage) {
|
||||
this(objectName, defaultMessage);
|
||||
}
|
||||
|
||||
public String getObjectName() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void wrap(Object source) {}
|
||||
|
||||
public <T> T unwrap(Class<T> sourceType) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean contains(Class<?> sourceType) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (other == null || other.getClass() != getClass() || !super.equals(other)) {
|
||||
return false;
|
||||
}
|
||||
ObjectError otherError = (ObjectError) other;
|
||||
return getObjectName().equals(otherError.getObjectName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return (29 * super.hashCode() + getObjectName().hashCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Error in object '" + this.objectName + "': " + resolvableToString();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user