Polishing
This commit is contained in:
parent
6acb091c4e
commit
19911af30a
|
@ -68,7 +68,7 @@ import org.springframework.util.StringUtils;
|
||||||
*/
|
*/
|
||||||
public final class SpelCompiler implements Opcodes {
|
public final class SpelCompiler implements Opcodes {
|
||||||
|
|
||||||
private static final int CLASSES_DEFINED_LIMIT = 10;
|
private static final int CLASSES_DEFINED_LIMIT = 100;
|
||||||
|
|
||||||
private static final Log logger = LogFactory.getLog(SpelCompiler.class);
|
private static final Log logger = LogFactory.getLog(SpelCompiler.class);
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ public final class SpelCompiler implements Opcodes {
|
||||||
/**
|
/**
|
||||||
* Attempt compilation of the supplied expression. A check is made to see
|
* Attempt compilation of the supplied expression. A check is made to see
|
||||||
* if it is compilable before compilation proceeds. The check involves
|
* if it is compilable before compilation proceeds. The check involves
|
||||||
* visiting all the nodes in the expression Ast and ensuring enough state
|
* visiting all the nodes in the expression AST and ensuring enough state
|
||||||
* is known about them that bytecode can be generated for them.
|
* is known about them that bytecode can be generated for them.
|
||||||
* @param expression the expression to compile
|
* @param expression the expression to compile
|
||||||
* @return an instance of the class implementing the compiled expression,
|
* @return an instance of the class implementing the compiled expression,
|
||||||
|
@ -127,7 +127,7 @@ public final class SpelCompiler implements Opcodes {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate the class that encapsulates the compiled expression and define it.
|
* Generate the class that encapsulates the compiled expression and define it.
|
||||||
* The generated class will be a subtype of CompiledExpression.
|
* The generated class will be a subtype of CompiledExpression.
|
||||||
* @param expressionToCompile the expression to be compiled
|
* @param expressionToCompile the expression to be compiled
|
||||||
* @return the expression call, or {@code null} if the decision was to opt out of
|
* @return the expression call, or {@code null} if the decision was to opt out of
|
||||||
* compilation during code generation
|
* compilation during code generation
|
||||||
|
@ -290,6 +290,9 @@ public final class SpelCompiler implements Opcodes {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An ASM ClassWriter extension bound to the SpelCompiler's ClassLoader.
|
||||||
|
*/
|
||||||
private class ExpressionClassWriter extends ClassWriter {
|
private class ExpressionClassWriter extends ClassWriter {
|
||||||
|
|
||||||
public ExpressionClassWriter() {
|
public ExpressionClassWriter() {
|
||||||
|
|
|
@ -614,7 +614,7 @@ class UriComponentsBuilderTests {
|
||||||
assertThat(after.getPath()).isEqualTo("/foo/");
|
assertThat(after.getPath()).isEqualTo("/foo/");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test // gh-19890
|
@Test // gh-19890
|
||||||
void fromHttpRequestWithEmptyScheme() {
|
void fromHttpRequestWithEmptyScheme() {
|
||||||
HttpRequest request = new HttpRequest() {
|
HttpRequest request = new HttpRequest() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -896,7 +896,7 @@ class UriComponentsBuilderTests {
|
||||||
assertThat(uriComponents.getQueryParams().get("bar").get(0)).isNull();
|
assertThat(uriComponents.getQueryParams().get("bar").get(0)).isNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test // gh-24444
|
@Test // gh-24444
|
||||||
void opaqueUriDoesNotResetOnNullInput() throws URISyntaxException {
|
void opaqueUriDoesNotResetOnNullInput() throws URISyntaxException {
|
||||||
URI uri = new URI("urn:ietf:wg:oauth:2.0:oob");
|
URI uri = new URI("urn:ietf:wg:oauth:2.0:oob");
|
||||||
UriComponents result = UriComponentsBuilder.fromUri(uri)
|
UriComponents result = UriComponentsBuilder.fromUri(uri)
|
||||||
|
@ -1156,7 +1156,7 @@ class UriComponentsBuilderTests {
|
||||||
assertThat(result.toUriString()).isEqualTo("https://example.com/rest/mobile/users/1");
|
assertThat(result.toUriString()).isEqualTo("https://example.com/rest/mobile/users/1");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test // gh-25737
|
@Test // gh-25737
|
||||||
void fromHttpRequestForwardedHeaderComma() {
|
void fromHttpRequestForwardedHeaderComma() {
|
||||||
MockHttpServletRequest request = new MockHttpServletRequest();
|
MockHttpServletRequest request = new MockHttpServletRequest();
|
||||||
request.addHeader("Forwarded", "for=192.0.2.0,for=192.0.2.1;proto=https;host=192.0.2.3:9090");
|
request.addHeader("Forwarded", "for=192.0.2.0,for=192.0.2.1;proto=https;host=192.0.2.3:9090");
|
||||||
|
|
Loading…
Reference in New Issue