Skip to content

Commit

Permalink
Explicit nullability declarations for getTarget() implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoeller committed Sep 1, 2020
1 parent d62202f commit 141470f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2020 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.
Expand Down Expand Up @@ -70,8 +70,6 @@ public BindException(Object target, String objectName) {

/**
* Return the BindingResult that this BindException wraps.
* Will typically be a BeanPropertyBindingResult.
* @see BeanPropertyBindingResult
*/
public final BindingResult getBindingResult() {
return this.bindingResult;
Expand Down Expand Up @@ -231,6 +229,7 @@ public Class<?> getFieldType(String field) {
}

@Override
@Nullable
public Object getTarget() {
return this.bindingResult.getTarget();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2006 the original author or authors.
* Copyright 2002-2020 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.
Expand All @@ -19,6 +19,7 @@
import java.io.Serializable;
import java.util.Map;

import org.springframework.lang.NonNull;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;

Expand Down Expand Up @@ -52,11 +53,15 @@ public MapBindingResult(Map<?, ?> target, String objectName) {
}


/**
* Return the target Map to bind onto.
*/
public final Map<?, ?> getTargetMap() {
return this.target;
}

@Override
@NonNull
public final Object getTarget() {
return this.target;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2020 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.
Expand Down Expand Up @@ -217,6 +217,7 @@ public Class<?> getFieldType(String field) {
}

@Override
@Nullable
public Object getTarget() {
return this.bindingResult.getTarget();
}
Expand Down

0 comments on commit 141470f

Please sign in to comment.