Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid using collection as bean type in ManagedBeanTypesTest #477

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,119 +25,10 @@
import java.util.ListIterator;

@Dependent
public class Flock implements List<Vulture<Integer>> {
public class Flock implements Gathering<Vulture<Integer>> {

@Override
public int size() {
return 0;
}

@Override
public boolean isEmpty() {
return false;
}

@Override
public boolean contains(Object o) {
return false;
}

@Override
public Iterator<Vulture<Integer>> iterator() {
public Vulture<Integer> getType() {
return null;
}

@Override
public Object[] toArray() {
return null;
}

@Override
public <T> T[] toArray(T[] a) {
return null;
}

@Override
public boolean add(Vulture<Integer> e) {
return false;
}

@Override
public boolean remove(Object o) {
return false;
}

@Override
public boolean containsAll(Collection<?> c) {
return false;
}

@Override
public boolean addAll(Collection<? extends Vulture<Integer>> c) {
return false;
}

@Override
public boolean addAll(int index, Collection<? extends Vulture<Integer>> c) {
return false;
}

@Override
public boolean removeAll(Collection<?> c) {
return false;
}

@Override
public boolean retainAll(Collection<?> c) {
return false;
}

@Override
public void clear() {
}

@Override
public Vulture<Integer> get(int index) {
return null;
}

@Override
public Vulture<Integer> set(int index, Vulture<Integer> element) {
return null;
}

@Override
public void add(int index, Vulture<Integer> element) {
}

@Override
public Vulture<Integer> remove(int index) {
return null;
}

@Override
public int indexOf(Object o) {
return 0;
}

@Override
public int lastIndexOf(Object o) {
return 0;
}

@Override
public ListIterator<Vulture<Integer>> listIterator() {
return null;
}

@Override
public ListIterator<Vulture<Integer>> listIterator(int index) {
return null;
}

@Override
public List<Vulture<Integer>> subList(int fromIndex, int toIndex) {
return null;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package org.jboss.cdi.tck.tests.definition.bean.types;

public interface Gathering<T> extends GroupingOfCertainType<T> {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.jboss.cdi.tck.tests.definition.bean.types;

public interface GroupingOfCertainType<T> {

T getType(); // just to avoid having <T> unused
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,9 @@ public void testGenericHierarchyBeanTypes() {
// Nested generic class inheritance
Bean<Flock> flockBean = getUniqueBean(Flock.class);
assertNotNull(flockBean);
// Object, Flock, List<Vulture<Integer>>, Collection<Vulture<Integer>>, Iterable<Vulture<Integer>>
assertTypeSetMatches(flockBean.getTypes(), Object.class, Flock.class, new TypeLiteral<List<Vulture<Integer>>>() {
}.getType(), new TypeLiteral<Collection<Vulture<Integer>>>() {
}.getType(), new TypeLiteral<Iterable<Vulture<Integer>>>() {
// Object, Flock, Gathering<Vulture<Integer>>, GroupingOfCertainType<Vulture<Integer>>
assertTypeSetMatches(flockBean.getTypes(), Object.class, Flock.class, new TypeLiteral<Gathering<Vulture<Integer>>>() {
}.getType(), new TypeLiteral<GroupingOfCertainType<Vulture<Integer>>>() {
}.getType());
}

Expand Down