File tree Expand file tree Collapse file tree 4 files changed +45
-2
lines changed
main/java/org/springframework/context/index/processor
test/java/org/springframework/context/index Expand file tree Collapse file tree 4 files changed +45
-2
lines changed Original file line number Diff line number Diff line change @@ -4,5 +4,6 @@ dependencies {
4
4
testCompile(project(" :spring-context" ))
5
5
testCompile(" javax.inject:javax.inject:1" )
6
6
testCompile(" javax.annotation:javax.annotation-api:1.3.2" )
7
+ testCompile(" javax.transaction:javax.transaction-api:1.3" )
7
8
testCompile(" org.eclipse.persistence:javax.persistence:2.2.0" )
8
9
}
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2018 the original author or authors.
2
+ * Copyright 2002-2019 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
17
17
package org .springframework .context .index .processor ;
18
18
19
19
import java .util .ArrayList ;
20
+ import java .util .Collections ;
20
21
import java .util .List ;
21
22
import javax .annotation .processing .ProcessingEnvironment ;
22
23
import javax .lang .model .element .AnnotationMirror ;
@@ -110,7 +111,12 @@ public List<Element> getDirectInterfaces(Element element) {
110
111
}
111
112
112
113
public List <? extends AnnotationMirror > getAllAnnotationMirrors (Element e ) {
113
- return this .env .getElementUtils ().getAllAnnotationMirrors (e );
114
+ try {
115
+ return this .env .getElementUtils ().getAllAnnotationMirrors (e );
116
+ }
117
+ catch (Throwable ex ) {
118
+ return Collections .emptyList ();
119
+ }
114
120
}
115
121
116
122
}
Original file line number Diff line number Diff line change 25
25
import javax .persistence .Embeddable ;
26
26
import javax .persistence .Entity ;
27
27
import javax .persistence .MappedSuperclass ;
28
+ import javax .transaction .Transactional ;
28
29
29
30
import org .junit .Before ;
30
31
import org .junit .Rule ;
44
45
import org .springframework .context .index .sample .SampleService ;
45
46
import org .springframework .context .index .sample .cdi .SampleManagedBean ;
46
47
import org .springframework .context .index .sample .cdi .SampleNamed ;
48
+ import org .springframework .context .index .sample .cdi .SampleTransactional ;
47
49
import org .springframework .context .index .sample .jpa .SampleConverter ;
48
50
import org .springframework .context .index .sample .jpa .SampleEmbeddable ;
49
51
import org .springframework .context .index .sample .SampleEmbedded ;
67
69
* Tests for {@link CandidateComponentsIndexer}.
68
70
*
69
71
* @author Stephane Nicoll
72
+ * @author Vedran Pavic
70
73
*/
71
74
public class CandidateComponentsIndexerTests {
72
75
@@ -142,6 +145,11 @@ public void cdiNamed() {
142
145
testSingleComponent (SampleNamed .class , Named .class );
143
146
}
144
147
148
+ @ Test
149
+ public void cdiTransactional () {
150
+ testSingleComponent (SampleTransactional .class , Transactional .class );
151
+ }
152
+
145
153
@ Test
146
154
public void persistenceEntity () {
147
155
testSingleComponent (SampleEntity .class , Entity .class );
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright 2002-2019 the original author or authors.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ package org .springframework .context .index .sample .cdi ;
18
+
19
+ import javax .transaction .Transactional ;
20
+
21
+ /**
22
+ * Test candidate for {@link Transactional}.
23
+ *
24
+ * @author Vedran Pavic
25
+ */
26
+ @ Transactional
27
+ public class SampleTransactional {
28
+ }
You can’t perform that action at this time.
0 commit comments