Polishing (backported from 5.3.x)
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2016 the original author or authors.
|
* Copyright 2002-2021 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -23,7 +23,7 @@ import java.lang.reflect.AccessibleObject;
|
|||||||
* terminology).
|
* terminology).
|
||||||
*
|
*
|
||||||
* <p>A runtime joinpoint is an <i>event</i> that occurs on a static
|
* <p>A runtime joinpoint is an <i>event</i> that occurs on a static
|
||||||
* joinpoint (i.e. a location in a the program). For instance, an
|
* joinpoint (i.e. a location in a program). For instance, an
|
||||||
* invocation is the runtime joinpoint on a method (static joinpoint).
|
* invocation is the runtime joinpoint on a method (static joinpoint).
|
||||||
* The static part of a given joinpoint can be generically retrieved
|
* The static part of a given joinpoint can be generically retrieved
|
||||||
* using the {@link #getStaticPart()} method.
|
* using the {@link #getStaticPart()} method.
|
||||||
|
|||||||
@@ -162,10 +162,8 @@ public class BeanWrapperGenericsTests {
|
|||||||
value2.add(Boolean.TRUE);
|
value2.add(Boolean.TRUE);
|
||||||
input.put("2", value2);
|
input.put("2", value2);
|
||||||
bw.setPropertyValue("collectionMap", input);
|
bw.setPropertyValue("collectionMap", input);
|
||||||
boolean condition1 = gb.getCollectionMap().get(1) instanceof HashSet;
|
assertThat(gb.getCollectionMap().get(1) instanceof HashSet).isTrue();
|
||||||
assertThat(condition1).isTrue();
|
assertThat(gb.getCollectionMap().get(2) instanceof ArrayList).isTrue();
|
||||||
boolean condition = gb.getCollectionMap().get(2) instanceof ArrayList;
|
|
||||||
assertThat(condition).isTrue();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -177,8 +175,7 @@ public class BeanWrapperGenericsTests {
|
|||||||
HashSet<Integer> value1 = new HashSet<>();
|
HashSet<Integer> value1 = new HashSet<>();
|
||||||
value1.add(1);
|
value1.add(1);
|
||||||
bw.setPropertyValue("collectionMap[1]", value1);
|
bw.setPropertyValue("collectionMap[1]", value1);
|
||||||
boolean condition = gb.getCollectionMap().get(1) instanceof HashSet;
|
assertThat(gb.getCollectionMap().get(1) instanceof HashSet).isTrue();
|
||||||
assertThat(condition).isTrue();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -324,14 +321,13 @@ public class BeanWrapperGenericsTests {
|
|||||||
bw.setPropertyValue("mapOfInteger", map);
|
bw.setPropertyValue("mapOfInteger", map);
|
||||||
|
|
||||||
Object obj = gb.getMapOfInteger().get("testKey");
|
Object obj = gb.getMapOfInteger().get("testKey");
|
||||||
boolean condition = obj instanceof Integer;
|
assertThat(obj instanceof Integer).isTrue();
|
||||||
assertThat(condition).isTrue();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGenericTypeNestingMapOfListOfInteger() {
|
public void testGenericTypeNestingMapOfListOfInteger() {
|
||||||
Map<String, List<String>> map = new HashMap<>();
|
Map<String, List<String>> map = new HashMap<>();
|
||||||
List<String> list = Arrays.asList(new String[] {"1", "2", "3"});
|
List<String> list = Arrays.asList("1", "2", "3");
|
||||||
map.put("testKey", list);
|
map.put("testKey", list);
|
||||||
|
|
||||||
NestedGenericCollectionBean gb = new NestedGenericCollectionBean();
|
NestedGenericCollectionBean gb = new NestedGenericCollectionBean();
|
||||||
@@ -362,7 +358,7 @@ public class BeanWrapperGenericsTests {
|
|||||||
@Test
|
@Test
|
||||||
public void testGenericTypeNestingMapOfListOfListOfInteger() {
|
public void testGenericTypeNestingMapOfListOfListOfInteger() {
|
||||||
Map<String, List<List<String>>> map = new HashMap<>();
|
Map<String, List<List<String>>> map = new HashMap<>();
|
||||||
List<String> list = Arrays.asList(new String[] {"1", "2", "3"});
|
List<String> list = Arrays.asList("1", "2", "3");
|
||||||
map.put("testKey", Collections.singletonList(list));
|
map.put("testKey", Collections.singletonList(list));
|
||||||
|
|
||||||
NestedGenericCollectionBean gb = new NestedGenericCollectionBean();
|
NestedGenericCollectionBean gb = new NestedGenericCollectionBean();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2019 the original author or authors.
|
* Copyright 2002-2021 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -71,7 +71,7 @@ public interface RequestPredicate {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Transform the given request into a request used for a nested route. For instance,
|
* Transform the given request into a request used for a nested route. For instance,
|
||||||
* a path-based predicate can return a {@code ServerRequest} with a the path remaining
|
* a path-based predicate can return a {@code ServerRequest} with a path remaining
|
||||||
* after a match.
|
* after a match.
|
||||||
* <p>The default implementation returns an {@code Optional} wrapping the given request if
|
* <p>The default implementation returns an {@code Optional} wrapping the given request if
|
||||||
* {@link #test(ServerRequest)} evaluates to {@code true}; or {@link Optional#empty()}
|
* {@link #test(ServerRequest)} evaluates to {@code true}; or {@link Optional#empty()}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2019 the original author or authors.
|
* Copyright 2002-2021 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -71,7 +71,7 @@ public interface RequestPredicate {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Transform the given request into a request used for a nested route. For instance,
|
* Transform the given request into a request used for a nested route. For instance,
|
||||||
* a path-based predicate can return a {@code ServerRequest} with a the path remaining
|
* a path-based predicate can return a {@code ServerRequest} with a path remaining
|
||||||
* after a match.
|
* after a match.
|
||||||
* <p>The default implementation returns an {@code Optional} wrapping the given request if
|
* <p>The default implementation returns an {@code Optional} wrapping the given request if
|
||||||
* {@link #test(ServerRequest)} evaluates to {@code true}; or {@link Optional#empty()}
|
* {@link #test(ServerRequest)} evaluates to {@code true}; or {@link Optional#empty()}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2020 the original author or authors.
|
* Copyright 2002-2021 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -183,7 +183,7 @@ public abstract class ConvertingEncoderDecoderSupport<T, M> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Decode the a message into an object.
|
* Decode the message into an object.
|
||||||
* @see javax.websocket.Decoder.Text#decode(String)
|
* @see javax.websocket.Decoder.Text#decode(String)
|
||||||
* @see javax.websocket.Decoder.Binary#decode(ByteBuffer)
|
* @see javax.websocket.Decoder.Binary#decode(ByteBuffer)
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1202,7 +1202,7 @@ We can trace the flow through a simple example. Consider the following example,
|
|||||||
@Controller
|
@Controller
|
||||||
public class GreetingController {
|
public class GreetingController {
|
||||||
|
|
||||||
@MessageMapping("/greeting") {
|
@MessageMapping("/greeting")
|
||||||
public String handle(String greeting) {
|
public String handle(String greeting) {
|
||||||
return "[" + getTimestamp() + ": " + greeting;
|
return "[" + getTimestamp() + ": " + greeting;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user