equal
deleted
inserted
replaced
52 import java.util.Arrays; |
52 import java.util.Arrays; |
53 import java.util.BitSet; |
53 import java.util.BitSet; |
54 import java.util.Iterator; |
54 import java.util.Iterator; |
55 import java.util.List; |
55 import java.util.List; |
56 import java.util.Objects; |
56 import java.util.Objects; |
|
57 import java.util.Set; |
57 import java.util.concurrent.ConcurrentHashMap; |
58 import java.util.concurrent.ConcurrentHashMap; |
58 import java.util.stream.Collectors; |
59 import java.util.stream.Collectors; |
59 import java.util.stream.Stream; |
60 import java.util.stream.Stream; |
60 |
61 |
61 import static java.lang.invoke.MethodHandleImpl.Intrinsic; |
62 import static java.lang.invoke.MethodHandleImpl.Intrinsic; |
640 /** The class on behalf of whom the lookup is being performed. */ |
641 /** The class on behalf of whom the lookup is being performed. */ |
641 private final Class<?> lookupClass; |
642 private final Class<?> lookupClass; |
642 |
643 |
643 /** The allowed sorts of members which may be looked up (PUBLIC, etc.). */ |
644 /** The allowed sorts of members which may be looked up (PUBLIC, etc.). */ |
644 private final int allowedModes; |
645 private final int allowedModes; |
|
646 |
|
647 static { |
|
648 Reflection.registerFieldsToFilter(Lookup.class, Set.of("lookupClass", "allowedModes")); |
|
649 } |
645 |
650 |
646 /** A single-bit mask representing {@code public} access, |
651 /** A single-bit mask representing {@code public} access, |
647 * which may contribute to the result of {@link #lookupModes lookupModes}. |
652 * which may contribute to the result of {@link #lookupModes lookupModes}. |
648 * The value, {@code 0x01}, happens to be the same as the value of the |
653 * The value, {@code 0x01}, happens to be the same as the value of the |
649 * {@code public} {@linkplain java.lang.reflect.Modifier#PUBLIC modifier bit}. |
654 * {@code public} {@linkplain java.lang.reflect.Modifier#PUBLIC modifier bit}. |