File tree 2 files changed +10
-6
lines changed
cdi/instance-qualifiers/src/test/java/org/javaee7/cdi/instance
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 {
49
49
assertTrue (instance .isAmbiguous ());
50
50
51
51
// 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 ();
53
54
assertThat (businessBean , instanceOf (FormalGreeting .class ));
54
- instance .destroy (businessBean );
55
+ businessInstance .destroy (businessBean );
55
56
56
- Greeting defaultBean = instance .select (new AnnotationLiteral <Default >() {}).get ();
57
+ Instance <Greeting > defaultInstance = instance .select (new AnnotationLiteral <Default >() {});
58
+ Greeting defaultBean = defaultInstance .get ();
57
59
assertThat (defaultBean , instanceOf (SimpleGreeting .class ));
58
- instance .destroy (defaultBean );
60
+ defaultInstance .destroy (defaultBean );
59
61
}
60
62
}
61
63
Original file line number Diff line number Diff line change @@ -54,9 +54,11 @@ public void test() throws Exception {
54
54
instance .destroy (bean );
55
55
56
56
// 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 ();
58
60
assertThat (anotherBean , instanceOf (SimpleGreeting .class ));
59
- instance .destroy (anotherBean );
61
+ anotherInstance .destroy (anotherBean );
60
62
}
61
63
}
62
64
You can’t perform that action at this time.
0 commit comments