Skip to content

Commit

Permalink
Merge pull request #37770 from geoand/#37768
Browse files Browse the repository at this point in the history
Add SequencedCollection to BANNED_INTERFACE_TYPES
  • Loading branch information
geoand authored Dec 15, 2023
2 parents 0b2706f + 674eac2 commit 02a2f75
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
Expand Down Expand Up @@ -78,13 +77,9 @@ public final class Types {
DotNames.DOUBLE,
DotNames.CHARACTER);

// we ban these interfaces because they are new to Java 12 and are used by java.lang.String which
// means that they cannot be included in bytecode if we want to have application built with Java 12+ but targeting Java 8 - 11
// actually run on those older versions
// we ban these interfaces because of mismatch between building JDK version and target JDK version
// TODO: add a extensible banning mechanism based on predicates if we find that this set needs to grow...
private static final Set<DotName> BANNED_INTERFACE_TYPES = new HashSet<>(
Arrays.asList(DotName.createSimple("java.lang.constant.ConstantDesc"),
DotName.createSimple("java.lang.constant.Constable")));
private static final Set<DotName> BANNED_INTERFACE_TYPES = Set.of(DotName.createSimple("java.util.SequencedCollection"));

private Types() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void test() {
InjectableBean<ExtendedBoolean> bean = Arc.container().instance(ExtendedBoolean.class).getBean();
Set<Type> types = bean.getTypes();

assertEquals(5, types.size());
assertEquals(6, types.size());
assertTrue(types.contains(Object.class));
assertTrue(types.contains(Serializable.class));
assertTrue(types.contains(ExtendedBoolean.class));
Expand Down

0 comments on commit 02a2f75

Please sign in to comment.