File tree Expand file tree Collapse file tree
http/http/src/main/java/io/helidon/http Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2022, 2025 Oracle and/or its affiliates.
2+ * Copyright (c) 2022, 2026 Oracle and/or its affiliates.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
3131@ SuppressWarnings ("unchecked" )
3232class HeadersImpl <T extends WritableHeaders <T >> implements WritableHeaders <T > {
3333 static final int KNOWN_HEADER_SIZE = HeaderNameEnum .values ().length ;
34+ // must be one higher to avoid bit set expansion
35+ private static final int NBITS = KNOWN_HEADER_SIZE + 1 ;
36+
3437 /*
3538 Optimization for most commonly used header names
3639 */
3740 private final Header [] knownHeaders = new Header [KNOWN_HEADER_SIZE ];
3841
3942 // custom (unknown) headers are slower
4043 private Map <HeaderName , Header > customHeaders = null ;
41- private final BitSet knownHeaderIndices = new BitSet (KNOWN_HEADER_SIZE );
44+ private final BitSet knownHeaderIndices = new BitSet (NBITS );
4245
4346 HeadersImpl () {
4447 }
You can’t perform that action at this time.
0 commit comments