Skip to content

Use diamond operator in examples in reference manual #30204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion framework-docs/src/docs/asciidoc/core/core-appendix.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1300,7 +1300,7 @@ listing shows our custom `BeanDefinitionParser` implementation:
}

private static void parseChildComponents(List<Element> childElements, BeanDefinitionBuilder factory) {
ManagedList<BeanDefinition> children = new ManagedList<BeanDefinition>(childElements.size());
ManagedList<BeanDefinition> children = new ManagedList<>(childElements.size());
for (Element element : childElements) {
children.add(parseComponentElement(element));
}
Expand Down
6 changes: 3 additions & 3 deletions framework-docs/src/docs/asciidoc/core/core-expressions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ being placed in it. The following example shows how to do so:
.Java
----
class Simple {
public List<Boolean> booleanList = new ArrayList<Boolean>();
public List<Boolean> booleanList = new ArrayList<>();
}

Simple simple = new Simple();
Expand Down Expand Up @@ -1478,7 +1478,7 @@ show how to use the `#this` and `#root` variables:
.Java
----
// create an array of integers
List<Integer> primes = new ArrayList<Integer>();
List<Integer> primes = new ArrayList<>();
primes.addAll(Arrays.asList(2,3,5,7,11,13,17));

// create parser and set variable 'primes' as the array of integers
Expand Down Expand Up @@ -2122,7 +2122,7 @@ This section lists the classes used in the examples throughout this chapter.
public static String Advisors = "advisors";
public static String President = "president";

private List<Inventor> members = new ArrayList<Inventor>();
private List<Inventor> members = new ArrayList<>();
private Map officers = new HashMap();

public List getMembers() {
Expand Down
8 changes: 4 additions & 4 deletions framework-docs/src/docs/asciidoc/data-access.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4528,7 +4528,7 @@ JDBC `?` placeholders:
}

public int[] batchUpdate(final List<Actor> actors) {
List<Object[]> batch = new ArrayList<Object[]>();
List<Object[]> batch = new ArrayList<>();
for (Actor actor : actors) {
Object[] values = new Object[] {
actor.getFirstName(), actor.getLastName(), actor.getId()};
Expand Down Expand Up @@ -4692,7 +4692,7 @@ example uses only one configuration method (we show examples of multiple methods
}

public void add(Actor actor) {
Map<String, Object> parameters = new HashMap<String, Object>(3);
Map<String, Object> parameters = new HashMap<>(3);
parameters.put("id", actor.getId());
parameters.put("first_name", actor.getFirstName());
parameters.put("last_name", actor.getLastName());
Expand Down Expand Up @@ -4750,7 +4750,7 @@ listing shows how it works:
}

public void add(Actor actor) {
Map<String, Object> parameters = new HashMap<String, Object>(2);
Map<String, Object> parameters = new HashMap<>(2);
parameters.put("first_name", actor.getFirstName());
parameters.put("last_name", actor.getLastName());
Number newId = insertActor.executeAndReturnKey(parameters);
Expand Down Expand Up @@ -4810,7 +4810,7 @@ You can limit the columns for an insert by specifying a list of column names wit
}

public void add(Actor actor) {
Map<String, Object> parameters = new HashMap<String, Object>(2);
Map<String, Object> parameters = new HashMap<>(2);
parameters.put("first_name", actor.getFirstName());
parameters.put("last_name", actor.getLastName());
Number newId = insertActor.executeAndReturnKey(parameters);
Expand Down
4 changes: 2 additions & 2 deletions framework-docs/src/docs/asciidoc/web/webmvc.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ or to render a JSON response, as the following example shows:

@RequestMapping(path = "/error")
public Map<String, Object> handle(HttpServletRequest request) {
Map<String, Object> map = new HashMap<String, Object>();
Map<String, Object> map = new HashMap<>();
map.put("status", request.getAttribute("jakarta.servlet.error.status_code"));
map.put("reason", request.getAttribute("jakarta.servlet.error.message"));
return map;
Expand Down Expand Up @@ -4393,7 +4393,7 @@ return value with `DeferredResult`, as the following example shows:
@GetMapping("/quotes")
@ResponseBody
public DeferredResult<String> quotes() {
DeferredResult<String> deferredResult = new DeferredResult<String>();
DeferredResult<String> deferredResult = new DeferredResult<>();
// Save the deferredResult somewhere..
return deferredResult;
}
Expand Down