Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
102dc8a4
S
spring-framework
项目概览
爱吃血肠
/
spring-framework
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
spring-framework
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
102dc8a4
编写于
7月 06, 2016
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polishing
上级
19e5a34f
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
110 addition
and
106 deletion
+110
-106
spring-context/src/main/java/org/springframework/cache/interceptor/CacheOperationInvoker.java
...ingframework/cache/interceptor/CacheOperationInvoker.java
+2
-3
spring-core/src/main/java/org/springframework/util/UpdateMessageDigestInputStream.java
.../springframework/util/UpdateMessageDigestInputStream.java
+2
-2
spring-core/src/main/java/org/springframework/util/concurrent/FutureAdapter.java
...va/org/springframework/util/concurrent/FutureAdapter.java
+4
-5
spring-expression/src/main/java/org/springframework/expression/spel/CodeFlow.java
...in/java/org/springframework/expression/spel/CodeFlow.java
+74
-70
spring-expression/src/main/java/org/springframework/expression/spel/ast/InlineList.java
...a/org/springframework/expression/spel/ast/InlineList.java
+6
-6
spring-web/src/main/java/org/springframework/http/client/ClientHttpRequestExecution.java
...ringframework/http/client/ClientHttpRequestExecution.java
+6
-5
spring-webmvc/src/main/java/org/springframework/web/servlet/LocaleResolver.java
.../java/org/springframework/web/servlet/LocaleResolver.java
+5
-5
spring-webmvc/src/main/java/org/springframework/web/servlet/handler/HandlerInterceptorAdapter.java
...mework/web/servlet/handler/HandlerInterceptorAdapter.java
+4
-3
spring-webmvc/src/main/java/org/springframework/web/servlet/resource/CssLinkResourceTransformer.java
...work/web/servlet/resource/CssLinkResourceTransformer.java
+5
-5
spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceTransformer.java
...ngframework/web/servlet/resource/ResourceTransformer.java
+2
-2
未找到文件。
spring-context/src/main/java/org/springframework/cache/interceptor/CacheOperationInvoker.java
浏览文件 @
102dc8a4
...
...
@@ -31,9 +31,8 @@ package org.springframework.cache.interceptor;
public
interface
CacheOperationInvoker
{
/**
* Invoke the cache operation defined by this instance. Wraps any
* exception that is thrown during the invocation in a
* {@link ThrowableWrapper}.
* Invoke the cache operation defined by this instance. Wraps any exception
* that is thrown during the invocation in a {@link ThrowableWrapper}.
* @return the result of the operation
* @throws ThrowableWrapper if an error occurred while invoking the operation
*/
...
...
spring-core/src/main/java/org/springframework/util/UpdateMessageDigestInputStream.java
浏览文件 @
102dc8a4
...
...
@@ -33,7 +33,7 @@ abstract class UpdateMessageDigestInputStream extends InputStream {
* Update the message digest with the rest of the bytes in this stream.
* <p>Using this method is more optimized since it avoids creating new
* byte arrays for each call.
* @param messageDigest
T
he message digest to update
* @param messageDigest
t
he message digest to update
* @throws IOException when propagated from {@link #read()}
*/
public
void
updateMessageDigest
(
MessageDigest
messageDigest
)
throws
IOException
{
...
...
@@ -47,7 +47,7 @@ abstract class UpdateMessageDigestInputStream extends InputStream {
* Update the message digest with the next len bytes in this stream.
* <p>Using this method is more optimized since it avoids creating new
* byte arrays for each call.
* @param messageDigest
T
he message digest to update
* @param messageDigest
t
he message digest to update
* @param len how many bytes to read from this stream and use to update the message digest
* @throws IOException when propagated from {@link #read()}
*/
...
...
spring-core/src/main/java/org/springframework/util/concurrent/FutureAdapter.java
浏览文件 @
102dc8a4
/*
* Copyright 2002-201
5
the original author or authors.
* Copyright 2002-201
6
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.
...
...
@@ -24,10 +24,9 @@ import java.util.concurrent.TimeoutException;
import
org.springframework.util.Assert
;
/**
* Abstract class that adapts a {@link Future} parameterized over S into a {@code
* Future} parameterized over T. All methods are delegated to the adaptee, where {@link
* #get()} and {@link #get(long, TimeUnit)} call {@link #adapt(Object)} on the adaptee's
* result.
* Abstract class that adapts a {@link Future} parameterized over S into a {@code Future}
* parameterized over T. All methods are delegated to the adaptee, where {@link #get()}
* and {@link #get(long, TimeUnit)} call {@link #adapt(Object)} on the adaptee's result.
*
* @author Arjen Poutsma
* @since 4.0
...
...
spring-expression/src/main/java/org/springframework/expression/spel/CodeFlow.java
浏览文件 @
102dc8a4
...
...
@@ -147,6 +147,67 @@ public class CodeFlow implements Opcodes {
}
}
/**
* Called after the main expression evaluation method has been generated, this
* method will callback any registered FieldAdders or ClinitAdders to add any
* extra information to the class representing the compiled expression.
*/
public
void
finish
()
{
if
(
this
.
fieldAdders
!=
null
)
{
for
(
FieldAdder
fieldAdder
:
this
.
fieldAdders
)
{
fieldAdder
.
generateField
(
cw
,
this
);
}
}
if
(
this
.
clinitAdders
!=
null
)
{
MethodVisitor
mv
=
cw
.
visitMethod
(
ACC_PUBLIC
|
ACC_STATIC
,
"<clinit>"
,
"()V"
,
null
,
null
);
mv
.
visitCode
();
this
.
nextFreeVariableId
=
0
;
// To 0 because there is no 'this' in a clinit
for
(
ClinitAdder
clinitAdder
:
this
.
clinitAdders
)
{
clinitAdder
.
generateCode
(
mv
,
this
);
}
mv
.
visitInsn
(
RETURN
);
mv
.
visitMaxs
(
0
,
0
);
// not supplied due to COMPUTE_MAXS
mv
.
visitEnd
();
}
}
/**
* Register a FieldAdder which will add a new field to the generated
* class to support the code produced by an ast nodes primary
* generateCode() method.
*/
public
void
registerNewField
(
FieldAdder
fieldAdder
)
{
if
(
this
.
fieldAdders
==
null
)
{
this
.
fieldAdders
=
new
ArrayList
<>();
}
this
.
fieldAdders
.
add
(
fieldAdder
);
}
/**
* Register a ClinitAdder which will add code to the static
* initializer in the generated class to support the code
* produced by an ast nodes primary generateCode() method.
*/
public
void
registerNewClinit
(
ClinitAdder
clinitAdder
)
{
if
(
this
.
clinitAdders
==
null
)
{
this
.
clinitAdders
=
new
ArrayList
<>();
}
this
.
clinitAdders
.
add
(
clinitAdder
);
}
public
int
nextFieldId
()
{
return
this
.
nextFieldId
++;
}
public
int
nextFreeVariableId
()
{
return
this
.
nextFreeVariableId
++;
}
public
String
getClassName
()
{
return
this
.
clazzName
;
}
/**
* Insert any necessary cast and value call to convert from a boxed type to a
* primitive value
...
...
@@ -778,76 +839,6 @@ public class CodeFlow implements Opcodes {
return
descriptors
;
}
/**
* Called after the main expression evaluation method has been generated, this
* method will callback any registered FieldAdders or ClinitAdders to add any
* extra information to the class representing the compiled expression.
*/
public
void
finish
()
{
if
(
fieldAdders
!=
null
)
{
for
(
FieldAdder
fieldAdder:
fieldAdders
)
{
fieldAdder
.
generateField
(
cw
,
this
);
}
}
if
(
clinitAdders
!=
null
)
{
MethodVisitor
mv
=
cw
.
visitMethod
(
ACC_PUBLIC
|
ACC_STATIC
,
"<clinit>"
,
"()V"
,
null
,
null
);
mv
.
visitCode
();
nextFreeVariableId
=
0
;
// To 0 because there is no 'this' in a clinit
for
(
ClinitAdder
clinitAdder:
clinitAdders
)
{
clinitAdder
.
generateCode
(
mv
,
this
);
}
mv
.
visitInsn
(
RETURN
);
mv
.
visitMaxs
(
0
,
0
);
// not supplied due to COMPUTE_MAXS
mv
.
visitEnd
();
}
}
/**
* Register a FieldAdder which will add a new field to the generated
* class to support the code produced by an ast nodes primary
* generateCode() method.
*/
public
void
registerNewField
(
FieldAdder
fieldAdder
)
{
if
(
fieldAdders
==
null
)
{
fieldAdders
=
new
ArrayList
<>();
}
fieldAdders
.
add
(
fieldAdder
);
}
/**
* Register a ClinitAdder which will add code to the static
* initializer in the generated class to support the code
* produced by an ast nodes primary generateCode() method.
*/
public
void
registerNewClinit
(
ClinitAdder
clinitAdder
)
{
if
(
clinitAdders
==
null
)
{
clinitAdders
=
new
ArrayList
<>();
}
clinitAdders
.
add
(
clinitAdder
);
}
public
int
nextFieldId
()
{
return
nextFieldId
++;
}
public
int
nextFreeVariableId
()
{
return
nextFreeVariableId
++;
}
public
String
getClassname
()
{
return
clazzName
;
}
@FunctionalInterface
public
interface
FieldAdder
{
void
generateField
(
ClassWriter
cw
,
CodeFlow
codeflow
);
}
@FunctionalInterface
public
interface
ClinitAdder
{
void
generateCode
(
MethodVisitor
mv
,
CodeFlow
codeflow
);
}
/**
* Create the optimal instruction for loading a number on the stack.
* @param mv where to insert the bytecode
...
...
@@ -979,4 +970,17 @@ public class CodeFlow implements Opcodes {
}
@FunctionalInterface
public
interface
FieldAdder
{
void
generateField
(
ClassWriter
cw
,
CodeFlow
codeflow
);
}
@FunctionalInterface
public
interface
ClinitAdder
{
void
generateCode
(
MethodVisitor
mv
,
CodeFlow
codeflow
);
}
}
spring-expression/src/main/java/org/springframework/expression/spel/ast/InlineList.java
浏览文件 @
102dc8a4
...
...
@@ -132,8 +132,8 @@ public class InlineList extends SpelNodeImpl {
@Override
public
void
generateCode
(
MethodVisitor
mv
,
CodeFlow
codeflow
)
{
final
String
constantFieldName
=
"inlineList$"
+
codeflow
.
nextFieldId
();
final
String
cla
zzname
=
codeflow
.
getClassn
ame
();
final
String
constantFieldName
=
"inlineList$"
+
codeflow
.
nextFieldId
();
final
String
cla
ssName
=
codeflow
.
getClassN
ame
();
codeflow
.
registerNewField
(
new
CodeFlow
.
FieldAdder
()
{
public
void
generateField
(
ClassWriter
cw
,
CodeFlow
codeflow
)
{
...
...
@@ -143,11 +143,11 @@ public class InlineList extends SpelNodeImpl {
codeflow
.
registerNewClinit
(
new
CodeFlow
.
ClinitAdder
()
{
public
void
generateCode
(
MethodVisitor
mv
,
CodeFlow
codeflow
)
{
generateClinitCode
(
cla
zzname
,
constantFieldName
,
mv
,
codeflow
,
false
);
generateClinitCode
(
cla
ssName
,
constantFieldName
,
mv
,
codeflow
,
false
);
}
});
mv
.
visitFieldInsn
(
GETSTATIC
,
cla
zzn
ame
,
constantFieldName
,
"Ljava/util/List;"
);
mv
.
visitFieldInsn
(
GETSTATIC
,
cla
ssN
ame
,
constantFieldName
,
"Ljava/util/List;"
);
codeflow
.
pushDescriptor
(
"Ljava/util/List"
);
}
...
...
@@ -158,8 +158,8 @@ public class InlineList extends SpelNodeImpl {
if
(!
nested
)
{
mv
.
visitFieldInsn
(
PUTSTATIC
,
clazzname
,
constantFieldName
,
"Ljava/util/List;"
);
}
int
child
count
=
getChildCount
();
for
(
int
c
=
0
;
c
<
childc
ount
;
c
++)
{
int
child
Count
=
getChildCount
();
for
(
int
c
=
0
;
c
<
childC
ount
;
c
++)
{
if
(!
nested
)
{
mv
.
visitFieldInsn
(
GETSTATIC
,
clazzname
,
constantFieldName
,
"Ljava/util/List;"
);
}
...
...
spring-web/src/main/java/org/springframework/http/client/ClientHttpRequestExecution.java
浏览文件 @
102dc8a4
...
...
@@ -23,23 +23,24 @@ import org.springframework.http.HttpRequest;
/**
* Represents the context of a client-side HTTP request execution.
*
* <p>Used to invoke the next interceptor in the interceptor chain,
or - if the calling interceptor is last - execute
* the request itself.
* <p>Used to invoke the next interceptor in the interceptor chain,
*
or - if the calling interceptor is last - execute
the request itself.
*
* @author Arjen Poutsma
* @see ClientHttpRequestInterceptor
* @since 3.1
* @see ClientHttpRequestInterceptor
*/
@FunctionalInterface
public
interface
ClientHttpRequestExecution
{
/**
* Execute the request with the given request attributes and body,
and return the response.
*
* Execute the request with the given request attributes and body,
*
and return the response.
* @param request the request, containing method, URI, and headers
* @param body the body of the request to execute
* @return the response
* @throws IOException in case of I/O errors
*/
ClientHttpResponse
execute
(
HttpRequest
request
,
byte
[]
body
)
throws
IOException
;
}
spring-webmvc/src/main/java/org/springframework/web/servlet/LocaleResolver.java
浏览文件 @
102dc8a4
/*
* Copyright 2002-201
3
the original author or authors.
* Copyright 2002-201
6
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.
...
...
@@ -51,8 +51,8 @@ import javax.servlet.http.HttpServletResponse;
public
interface
LocaleResolver
{
/**
* Resolve the current locale via the given request.
Can return a default locale as
* fallback in any case.
* Resolve the current locale via the given request.
*
Can return a default locale as
fallback in any case.
* @param request the request to resolve the locale for
* @return the current locale (never {@code null})
*/
...
...
@@ -63,8 +63,8 @@ public interface LocaleResolver {
* @param request the request to be used for locale modification
* @param response the response to be used for locale modification
* @param locale the new locale, or {@code null} to clear the locale
* @throws UnsupportedOperationException if the LocaleResolver
implementation does not
* support dynamic changing of the locale
* @throws UnsupportedOperationException if the LocaleResolver
*
implementation does not
support dynamic changing of the locale
*/
void
setLocale
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Locale
locale
);
...
...
spring-webmvc/src/main/java/org/springframework/web/servlet/handler/HandlerInterceptorAdapter.java
浏览文件 @
102dc8a4
/*
* Copyright 2002-201
2
the original author or authors.
* Copyright 2002-201
6
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.
...
...
@@ -23,7 +23,7 @@ import org.springframework.web.servlet.AsyncHandlerInterceptor;
import
org.springframework.web.servlet.ModelAndView
;
/**
* Abstract adapter class for the
HandlerInterceptor
interface,
* Abstract adapter class for the
{@link AsyncHandlerInterceptor}
interface,
* for simplified implementation of pre-only/post-only interceptors.
*
* @author Juergen Hoeller
...
...
@@ -36,7 +36,8 @@ public abstract class HandlerInterceptorAdapter implements AsyncHandlerIntercept
*/
@Override
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
{
throws
Exception
{
return
true
;
}
...
...
spring-webmvc/src/main/java/org/springframework/web/servlet/resource/CssLinkResourceTransformer.java
浏览文件 @
102dc8a4
...
...
@@ -123,8 +123,7 @@ public class CssLinkResourceTransformer extends ResourceTransformerSupport {
private
boolean
hasScheme
(
String
link
)
{
int
schemeIndex
=
link
.
indexOf
(
":"
);
return
(
schemeIndex
>
0
&&
!
link
.
substring
(
0
,
schemeIndex
).
contains
(
"/"
))
||
link
.
indexOf
(
"//"
)
==
0
;
return
(
schemeIndex
>
0
&&
!
link
.
substring
(
0
,
schemeIndex
).
contains
(
"/"
))
||
link
.
indexOf
(
"//"
)
==
0
;
}
...
...
@@ -132,9 +131,9 @@ public class CssLinkResourceTransformer extends ResourceTransformerSupport {
protected
interface
CssLinkParser
{
void
parseLink
(
String
content
,
Set
<
CssLinkInfo
>
linkInfos
);
}
protected
static
abstract
class
AbstractCssLinkParser
implements
CssLinkParser
{
/**
...
...
@@ -190,6 +189,7 @@ public class CssLinkResourceTransformer extends ResourceTransformerSupport {
}
private
static
class
ImportStatementCssLinkParser
extends
AbstractCssLinkParser
{
@Override
...
...
@@ -209,6 +209,7 @@ public class CssLinkResourceTransformer extends ResourceTransformerSupport {
}
}
private
static
class
UrlFunctionCssLinkParser
extends
AbstractCssLinkParser
{
@Override
...
...
@@ -230,8 +231,7 @@ public class CssLinkResourceTransformer extends ResourceTransformerSupport {
private
final
int
end
;
private
CssLinkInfo
(
int
start
,
int
end
)
{
public
CssLinkInfo
(
int
start
,
int
end
)
{
this
.
start
=
start
;
this
.
end
=
end
;
}
...
...
spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceTransformer.java
浏览文件 @
102dc8a4
...
...
@@ -36,10 +36,10 @@ public interface ResourceTransformer {
* @param request the current request
* @param resource the resource to transform
* @param transformerChain the chain of remaining transformers to delegate to
* @return the transformed resource
, never {@code null}
* @return the transformed resource
(never {@code null})
* @throws IOException if the transformation fails
*/
Resource
transform
(
HttpServletRequest
request
,
Resource
resource
,
ResourceTransformerChain
transformerChain
)
throws
IOException
;
}
\ No newline at end of file
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录