File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed
cdi/instance-qualifiers/src/test/java/org/javaee7/cdi/instance Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -49,13 +49,15 @@ public void test() throws Exception {
4949 assertTrue (instance .isAmbiguous ());
5050
5151 // use Instance<T>#select()
52- Greeting businessBean = instance .select (new AnnotationLiteral <Business >() {}).get ();
52+ Instance <Greeting > businessInstance = instance .select (new AnnotationLiteral <Business >() {});
53+ Greeting businessBean = businessInstance .get ();
5354 assertThat (businessBean , instanceOf (FormalGreeting .class ));
54- instance .destroy (businessBean );
55+ businessInstance .destroy (businessBean );
5556
56- Greeting defaultBean = instance .select (new AnnotationLiteral <Default >() {}).get ();
57+ Instance <Greeting > defaultInstance = instance .select (new AnnotationLiteral <Default >() {});
58+ Greeting defaultBean = defaultInstance .get ();
5759 assertThat (defaultBean , instanceOf (SimpleGreeting .class ));
58- instance .destroy (defaultBean );
60+ defaultInstance .destroy (defaultBean );
5961 }
6062}
6163
Original file line number Diff line number Diff line change @@ -54,9 +54,11 @@ public void test() throws Exception {
5454 instance .destroy (bean );
5555
5656 // use Instance<T>#select()
57- Greeting anotherBean = instance .select (new AnnotationLiteral <Default >() {}).get ();
57+ Instance <Greeting > anotherInstance = instance .select (new AnnotationLiteral <Default >() {
58+ });
59+ Greeting anotherBean = anotherInstance .get ();
5860 assertThat (anotherBean , instanceOf (SimpleGreeting .class ));
59- instance .destroy (anotherBean );
61+ anotherInstance .destroy (anotherBean );
6062 }
6163}
6264
You can’t perform that action at this time.
0 commit comments