private static void extractFollowingKeychains(List<DeterministicKeyChain> chains) { // look for following key chains and map them to the watch keys of followed keychains List<DeterministicKeyChain> followingChains = Lists.newArrayList(); for (Iterator<DeterministicKeyChain> it = chains.iterator(); it.hasNext(); ) { DeterministicKeyChain chain = it.next(); if (chain.isFollowing()) { followingChains.add(chain); it.remove(); } else if (!followingChains.isEmpty()) { if (!(chain instanceof MarriedKeyChain)) throw new IllegalStateException(); ((MarriedKeyChain)chain).setFollowingKeyChains(followingChains); followingChains = Lists.newArrayList(); } } }
private static void extractFollowingKeychains(List<DeterministicKeyChain> chains) { // look for following key chains and map them to the watch keys of followed keychains List<DeterministicKeyChain> followingChains = Lists.newArrayList(); for (Iterator<DeterministicKeyChain> it = chains.iterator(); it.hasNext(); ) { DeterministicKeyChain chain = it.next(); if (chain.isFollowing()) { followingChains.add(chain); it.remove(); } else if (!followingChains.isEmpty()) { if (!(chain instanceof MarriedKeyChain)) throw new IllegalStateException(); ((MarriedKeyChain)chain).setFollowingKeyChains(followingChains); followingChains = Lists.newArrayList(); } } }
private static void extractFollowingKeychains(List<DeterministicKeyChain> chains) { // look for following key chains and map them to the watch keys of followed keychains List<DeterministicKeyChain> followingChains = Lists.newArrayList(); for (Iterator<DeterministicKeyChain> it = chains.iterator(); it.hasNext(); ) { DeterministicKeyChain chain = it.next(); if (chain.isFollowing()) { followingChains.add(chain); it.remove(); } else if (!followingChains.isEmpty()) { if (!(chain instanceof MarriedKeyChain)) throw new IllegalStateException(); ((MarriedKeyChain)chain).setFollowingKeyChains(followingChains); followingChains = Lists.newArrayList(); } } }
private static void extractFollowingKeychains(List<DeterministicKeyChain> chains) { // look for following key chains and map them to the watch keys of followed keychains List<DeterministicKeyChain> followingChains = Lists.newArrayList(); for (Iterator<DeterministicKeyChain> it = chains.iterator(); it.hasNext(); ) { DeterministicKeyChain chain = it.next(); if (chain.isFollowing()) { followingChains.add(chain); it.remove(); } else if (!followingChains.isEmpty()) { if (!(chain instanceof MarriedKeyChain)) throw new IllegalStateException(); ((MarriedKeyChain)chain).setFollowingKeyChains(followingChains); followingChains = Lists.newArrayList(); } } }