Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
87e5f0db
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,发现更多精彩内容 >>
提交
87e5f0db
编写于
2月 07, 2019
作者:
V
Vedran Pavic
提交者:
Stephane Nicoll
2月 14, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Ensure indexer gracefully handle missing meta annotations
See gh-22385
上级
566cc877
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
45 addition
and
2 deletion
+45
-2
spring-context-indexer/spring-context-indexer.gradle
spring-context-indexer/spring-context-indexer.gradle
+1
-0
spring-context-indexer/src/main/java/org/springframework/context/index/processor/TypeHelper.java
...g/springframework/context/index/processor/TypeHelper.java
+8
-2
spring-context-indexer/src/test/java/org/springframework/context/index/processor/CandidateComponentsIndexerTests.java
...text/index/processor/CandidateComponentsIndexerTests.java
+8
-0
spring-context-indexer/src/test/java/org/springframework/context/index/sample/cdi/SampleTransactional.java
...amework/context/index/sample/cdi/SampleTransactional.java
+28
-0
未找到文件。
spring-context-indexer/spring-context-indexer.gradle
浏览文件 @
87e5f0db
...
...
@@ -4,5 +4,6 @@ dependencies {
testCompile
(
project
(
":spring-context"
))
testCompile
(
"javax.inject:javax.inject:1"
)
testCompile
(
"javax.annotation:javax.annotation-api:1.3.2"
)
testCompile
(
"javax.transaction:javax.transaction-api:1.3"
)
testCompile
(
"org.eclipse.persistence:javax.persistence:2.2.0"
)
}
spring-context-indexer/src/main/java/org/springframework/context/index/processor/TypeHelper.java
浏览文件 @
87e5f0db
/*
* Copyright 2002-201
8
the original author or authors.
* Copyright 2002-201
9
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.
...
...
@@ -17,6 +17,7 @@
package
org.springframework.context.index.processor
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
import
javax.annotation.processing.ProcessingEnvironment
;
import
javax.lang.model.element.AnnotationMirror
;
...
...
@@ -110,7 +111,12 @@ class TypeHelper {
}
public
List
<?
extends
AnnotationMirror
>
getAllAnnotationMirrors
(
Element
e
)
{
return
this
.
env
.
getElementUtils
().
getAllAnnotationMirrors
(
e
);
try
{
return
this
.
env
.
getElementUtils
().
getAllAnnotationMirrors
(
e
);
}
catch
(
Throwable
ex
)
{
return
Collections
.
emptyList
();
}
}
}
spring-context-indexer/src/test/java/org/springframework/context/index/processor/CandidateComponentsIndexerTests.java
浏览文件 @
87e5f0db
...
...
@@ -25,6 +25,7 @@ import javax.persistence.Converter;
import
javax.persistence.Embeddable
;
import
javax.persistence.Entity
;
import
javax.persistence.MappedSuperclass
;
import
javax.transaction.Transactional
;
import
org.junit.Before
;
import
org.junit.Rule
;
...
...
@@ -44,6 +45,7 @@ import org.springframework.context.index.sample.SampleRepository;
import
org.springframework.context.index.sample.SampleService
;
import
org.springframework.context.index.sample.cdi.SampleManagedBean
;
import
org.springframework.context.index.sample.cdi.SampleNamed
;
import
org.springframework.context.index.sample.cdi.SampleTransactional
;
import
org.springframework.context.index.sample.jpa.SampleConverter
;
import
org.springframework.context.index.sample.jpa.SampleEmbeddable
;
import
org.springframework.context.index.sample.SampleEmbedded
;
...
...
@@ -67,6 +69,7 @@ import static org.springframework.context.index.processor.Metadata.*;
* Tests for {@link CandidateComponentsIndexer}.
*
* @author Stephane Nicoll
* @author Vedran Pavic
*/
public
class
CandidateComponentsIndexerTests
{
...
...
@@ -142,6 +145,11 @@ public class CandidateComponentsIndexerTests {
testSingleComponent
(
SampleNamed
.
class
,
Named
.
class
);
}
@Test
public
void
cdiTransactional
()
{
testSingleComponent
(
SampleTransactional
.
class
,
Transactional
.
class
);
}
@Test
public
void
persistenceEntity
()
{
testSingleComponent
(
SampleEntity
.
class
,
Entity
.
class
);
...
...
spring-context-indexer/src/test/java/org/springframework/context/index/sample/cdi/SampleTransactional.java
0 → 100644
浏览文件 @
87e5f0db
/*
* Copyright 2002-2019 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.springframework.context.index.sample.cdi
;
import
javax.transaction.Transactional
;
/**
* Test candidate for {@link Transactional}.
*
* @author Vedran Pavic
*/
@Transactional
public
class
SampleTransactional
{
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录