protected static < S extends IPAddressSegment > void normalizePrefixBoundary ( int sectionPrefixBits , S segments [ ] , int segmentBitCount , int segmentByteCount , BiFunction < S , Integer , S > segProducer ) { //we've already verified segment prefixes in super constructor. We simply need to check the case where the prefix is at a segment boundary, //whether the network side has the correct prefix int networkSegmentIndex = getNetworkSegmentIndex ( sectionPrefixBits , segmentByteCount , segmentBitCount ) ; if ( networkSegmentIndex >= 0 ) { S segment = segments [ networkSegmentIndex ] ; if ( ! segment . isPrefixed ( ) ) { segments [ networkSegmentIndex ] = segProducer . apply ( segment , segmentBitCount ) ; } } }
In the case where the prefix sits at a segment boundary and the prefix sequence is null - null - 0 this changes to prefix sequence of null - x - 0 where x is segment bit length .