Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
42db41e0
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,发现更多精彩内容 >>
提交
42db41e0
编写于
1月 23, 2014
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polishing
上级
86fc2dd5
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
34 addition
and
33 deletion
+34
-33
spring-core/src/main/java/org/springframework/core/io/support/SpringFactoriesLoader.java
...pringframework/core/io/support/SpringFactoriesLoader.java
+2
-2
spring-expression/src/main/java/org/springframework/expression/spel/support/ReflectiveMethodResolver.java
...ork/expression/spel/support/ReflectiveMethodResolver.java
+18
-16
spring-orm/src/main/java/org/springframework/orm/jpa/vendor/HibernateJpaVendorAdapter.java
...ngframework/orm/jpa/vendor/HibernateJpaVendorAdapter.java
+2
-2
spring-web/src/main/java/org/springframework/web/context/support/WebApplicationContextUtils.java
...ework/web/context/support/WebApplicationContextUtils.java
+4
-4
spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletApplicationContextUtils.java
...k/web/portlet/context/PortletApplicationContextUtils.java
+8
-9
未找到文件。
spring-core/src/main/java/org/springframework/core/io/support/SpringFactoriesLoader.java
浏览文件 @
42db41e0
...
...
@@ -59,8 +59,8 @@ public abstract class SpringFactoriesLoader {
/**
* Load
s the factory implementations of the given type from the default location, using
* the given class loader.
* Load
the factory implementations of the given type from the default location,
*
using
the given class loader.
* <p>The returned factories are ordered in accordance with the {@link OrderComparator}.
* @param factoryClass the interface or abstract class representing the factory
* @param classLoader the ClassLoader to use for loading (can be {@code null} to use the default)
...
...
spring-expression/src/main/java/org/springframework/expression/spel/support/ReflectiveMethodResolver.java
浏览文件 @
42db41e0
...
...
@@ -53,20 +53,21 @@ import org.springframework.expression.spel.SpelMessage;
*/
public
class
ReflectiveMethodResolver
implements
MethodResolver
{
private
Map
<
Class
<?>,
MethodFilter
>
filters
=
null
;
// Using distance will ensure a more accurate match is discovered,
// more closely following the Java rules.
private
boolean
useDistance
=
false
;
private
final
boolean
useDistance
;
private
Map
<
Class
<?>,
MethodFilter
>
filters
;
public
ReflectiveMethodResolver
()
{
this
.
useDistance
=
false
;
}
/**
* This constructors allows the ReflectiveMethodResolver to be configured such that it will
* use a distance computation to check which is the better of two close matches (when there
* are multiple matches).
Using the distance computation is intended to ensure matches
* are multiple matches). Using the distance computation is intended to ensure matches
* are more closely representative of what a Java compiler would do when taking into
* account boxing/unboxing and whether the method candidates are declared to handle a
* supertype of the type (of the argument) being passed in.
...
...
@@ -77,6 +78,19 @@ public class ReflectiveMethodResolver implements MethodResolver {
}
public
void
registerMethodFilter
(
Class
<?>
type
,
MethodFilter
filter
)
{
if
(
this
.
filters
==
null
)
{
this
.
filters
=
new
HashMap
<
Class
<?>,
MethodFilter
>();
}
if
(
filter
!=
null
)
{
this
.
filters
.
put
(
type
,
filter
);
}
else
{
this
.
filters
.
remove
(
type
);
}
}
/**
* Locate a method on a type. There are three kinds of match that might occur:
* <ol>
...
...
@@ -187,18 +201,6 @@ public class ReflectiveMethodResolver implements MethodResolver {
}
}
public
void
registerMethodFilter
(
Class
<?>
type
,
MethodFilter
filter
)
{
if
(
this
.
filters
==
null
)
{
this
.
filters
=
new
HashMap
<
Class
<?>,
MethodFilter
>();
}
if
(
filter
==
null
)
{
this
.
filters
.
remove
(
type
);
}
else
{
this
.
filters
.
put
(
type
,
filter
);
}
}
private
Method
[]
getMethods
(
Class
<?>
type
,
Object
targetObject
)
{
if
(
targetObject
instanceof
Class
)
{
Set
<
Method
>
methods
=
new
HashSet
<
Method
>();
...
...
spring-orm/src/main/java/org/springframework/orm/jpa/vendor/HibernateJpaVendorAdapter.java
浏览文件 @
42db41e0
...
...
@@ -57,10 +57,10 @@ import org.springframework.orm.jpa.JpaDialect;
*/
public
class
HibernateJpaVendorAdapter
extends
AbstractJpaVendorAdapter
{
private
final
PersistenceProvider
persistenceProvider
;
private
final
JpaDialect
jpaDialect
=
new
HibernateJpaDialect
();
private
final
PersistenceProvider
persistenceProvider
;
private
final
Class
<?
extends
EntityManagerFactory
>
entityManagerFactoryInterface
;
private
final
Class
<?
extends
EntityManager
>
entityManagerInterface
;
...
...
spring-web/src/main/java/org/springframework/web/context/support/WebApplicationContextUtils.java
浏览文件 @
42db41e0
...
...
@@ -45,10 +45,9 @@ import org.springframework.web.context.request.SessionScope;
import
org.springframework.web.context.request.WebRequest
;
/**
* Convenience methods for retrieving the root
* {@link org.springframework.web.context.WebApplicationContext} for a given
* {@code ServletContext}. This is useful for programmatically accessing a
* Spring application context from within custom web views or MVC actions.
* Convenience methods for retrieving the root {@link WebApplicationContext} for
* a given {@link ServletContext}. This is useful for programmatically accessing
* a Spring application context from within custom web views or MVC actions.
*
* <p>Note that there are more convenient ways of accessing the root context for
* many web frameworks, either part of Spring or available as an external library.
...
...
@@ -232,6 +231,7 @@ public abstract class WebApplicationContextUtils {
*/
public
static
void
initServletPropertySources
(
MutablePropertySources
propertySources
,
ServletContext
servletContext
)
{
initServletPropertySources
(
propertySources
,
servletContext
,
null
);
}
...
...
spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletApplicationContextUtils.java
浏览文件 @
42db41e0
/*
* Copyright 2002-201
2
the original author or authors.
* Copyright 2002-201
3
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.
...
...
@@ -21,7 +21,6 @@ import java.util.Collections;
import
java.util.Enumeration
;
import
java.util.HashMap
;
import
java.util.Map
;
import
javax.portlet.PortletConfig
;
import
javax.portlet.PortletContext
;
import
javax.portlet.PortletRequest
;
...
...
@@ -42,9 +41,9 @@ import org.springframework.web.context.request.WebRequest;
import
org.springframework.web.context.support.WebApplicationContextUtils
;
/**
* Convenience methods for retrieving the root
WebApplicationContext for a given
*
PortletContext. This is e.g. useful for accessing a Spring context from
* within custom Portlet implementations.
* Convenience methods for retrieving the root
{@link WebApplicationContext} for
*
a given {@link PortletContext}. This is useful for programmatically accessing
*
a Spring application context from
within custom Portlet implementations.
*
* @author Juergen Hoeller
* @author John A. Lewis
...
...
@@ -98,7 +97,7 @@ public abstract class PortletApplicationContextUtils {
* @see org.springframework.web.context.WebApplicationContext#ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE
*/
public
static
ApplicationContext
getRequiredWebApplicationContext
(
PortletContext
pc
)
throws
IllegalStateException
{
throws
IllegalStateException
{
ApplicationContext
wac
=
getWebApplicationContext
(
pc
);
if
(
wac
==
null
)
{
...
...
@@ -211,15 +210,15 @@ public abstract class PortletApplicationContextUtils {
*/
public
static
void
initPortletPropertySources
(
MutablePropertySources
propertySources
,
ServletContext
servletContext
,
PortletContext
portletContext
,
PortletConfig
portletConfig
)
{
Assert
.
notNull
(
propertySources
,
"propertySources must not be null"
);
Assert
.
notNull
(
propertySources
,
"propertySources must not be null"
);
WebApplicationContextUtils
.
initServletPropertySources
(
propertySources
,
servletContext
);
if
(
portletContext
!=
null
&&
propertySources
.
contains
(
StandardPortletEnvironment
.
PORTLET_CONTEXT_PROPERTY_SOURCE_NAME
))
{
if
(
portletContext
!=
null
&&
propertySources
.
contains
(
StandardPortletEnvironment
.
PORTLET_CONTEXT_PROPERTY_SOURCE_NAME
))
{
propertySources
.
replace
(
StandardPortletEnvironment
.
PORTLET_CONTEXT_PROPERTY_SOURCE_NAME
,
new
PortletContextPropertySource
(
StandardPortletEnvironment
.
PORTLET_CONTEXT_PROPERTY_SOURCE_NAME
,
portletContext
));
}
if
(
portletConfig
!=
null
&&
propertySources
.
contains
(
StandardPortletEnvironment
.
PORTLET_CONFIG_PROPERTY_SOURCE_NAME
))
{
if
(
portletConfig
!=
null
&&
propertySources
.
contains
(
StandardPortletEnvironment
.
PORTLET_CONFIG_PROPERTY_SOURCE_NAME
))
{
propertySources
.
replace
(
StandardPortletEnvironment
.
PORTLET_CONFIG_PROPERTY_SOURCE_NAME
,
new
PortletConfigPropertySource
(
StandardPortletEnvironment
.
PORTLET_CONFIG_PROPERTY_SOURCE_NAME
,
portletConfig
));
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录