COMMAND git -C /tmp/java-baseline-guava-3350 rev-parse HEAD
8868c096cfdabbe38170b6e395369c315cfb72a1
READ /tmp/java-baseline-guava-3350/guava/src/com/google/common/collect/ImmutableMap.java
SHA256 9c0b2287cbf28a3d103f3476d3e3d2871a63d87777ed0570c126eeed5f85099a
100:    * values are merged using the specified merging function. If the merging function returns {@code
101:    * null}, then the collector removes the value that has been computed for the key thus far (though
102:    * future occurrences of the key would reinsert it).
103:    *
104:    * <p>Entries will appear in the encounter order of the first occurrence of the key.
105:    *
106:    * @since 21.0
107:    */
108:   public static <T extends @Nullable Object, K, V>
109:       Collector<T, ?, ImmutableMap<K, V>> toImmutableMap(
110:           Function<? super T, ? extends K> keyFunction,
111:           Function<? super T, ? extends V> valueFunction,
112:           BinaryOperator<V> mergeFunction) {
113:     return CollectCollectors.toImmutableMap(keyFunction, valueFunction, mergeFunction);
114:   }
115: 
116:   /**
117:    * Returns the empty map. This map behaves and performs comparably to {@link
118:    * Collections#emptyMap}, and is preferable mainly for consistency and maintainability of your
119:    * code.
120:    *
121:    * <p><b>Performance note:</b> the instance returned is a singleton.
122:    */
123:   @SuppressWarnings("unchecked")
124:   public static <K, V> ImmutableMap<K, V> of() {
125:     return (ImmutableMap<K, V>) RegularImmutableMap.EMPTY;
126:   }
127: 
128:   /**
129:    * Returns an immutable map containing a single entry. This map behaves and performs comparably to
130:    * {@link Collections#singletonMap} but will not accept a null key or value. It is preferable
131:    * mainly for consistency and maintainability of your code.
132:    */
133:   public static <K, V> ImmutableMap<K, V> of(K k1, V v1) {
134:     return ImmutableBiMap.of(k1, v1);
135:   }
136: 
137:   /**
138:    * Returns an immutable map containing the given entries, in order.
139:    *
140:    * @throws IllegalArgumentException if duplicate keys are provided
141:    */
142:   public static <K, V> ImmutableMap<K, V> of(K k1, V v1, K k2, V v2) {
143:     return RegularImmutableMap.fromEntries(entryOf(k1, v1), entryOf(k2, v2));
144:   }
145: 
146:   /**
147:    * Returns an immutable map containing the given entries, in order.
148:    *
149:    * @throws IllegalArgumentException if duplicate keys are provided
150:    */
151:   public static <K, V> ImmutableMap<K, V> of(K k1, V v1, K k2, V v2, K k3, V v3) {
152:     return RegularImmutableMap.fromEntries(entryOf(k1, v1), entryOf(k2, v2), entryOf(k3, v3));
153:   }
154: 
155:   /**
156:    * Returns an immutable map containing the given entries, in order.
157:    *
158:    * @throws IllegalArgumentException if duplicate keys are provided
159:    */
160:   public static <K, V> ImmutableMap<K, V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4) {
COMMAND git -C /tmp/java-series-commons-csv-1.14.1 rev-parse HEAD
e14ef86d34211f9d1b9b6040c5f6dbafc93ba907
READ /tmp/java-series-commons-csv-1.14.1/src/main/java/org/apache/commons/csv/CSVParser.java
SHA256 a60ab37d6b269d2b76e2fc51deb32bcdb3aad0feff405cbb0d57d8804a4ac19c
215:             this.trackBytes = trackBytes;
216:             return asThis();
217:         }
218: 
219:     }
220: 
221:     final class CSVRecordIterator implements Iterator<CSVRecord> {
222:         private CSVRecord current;
223: 
224:         /**
225:          * Gets the next record or null at the end of stream or max rows read.
226:          *
227:          * @throws IOException  on parse error or input read-failure
228:          * @throws CSVException on invalid input.
229:          * @return the next record, or {@code null} if the end of the stream has been reached.
230:          */
231:         private CSVRecord getNextRecord() {
232:             CSVRecord record = null;
233:             if (format.useRow(recordNumber + 1)) {
234:                 record = Uncheck.get(CSVParser.this::nextRecord);
235:             }
236:             return record;
237:         }
238: 
239:         @Override
240:         public boolean hasNext() {
241:             if (isClosed()) {
242:                 return false;
243:             }
244:             if (current == null) {
245:                 current = getNextRecord();
COMMAND git -C /tmp/java-series-jackson-databind-jackson-databind-2.20.1 rev-parse HEAD
4164a2b47d3795a28f7cb838a02c27b77f9adaf4
READ /tmp/java-series-jackson-databind-jackson-databind-2.20.1/src/main/java/com/fasterxml/jackson/databind/ObjectMapper.java
SHA256 0211f7f5dad82502d03bcec759fe03f01cd0855df6e2b59a6741d984de613d74
5020: 
5021:     protected Object _readMapAndClose(JsonParser p0, JavaType valueType)
5022:         throws IOException
5023:     {
5024:         try (JsonParser p = p0) {
5025:             final Object result;
5026:             final DeserializationConfig cfg = getDeserializationConfig();
5027:             final DefaultDeserializationContext ctxt = createDeserializationContext(p, cfg);
5028:             JsonToken t = _initForReading(p, valueType);
5029:             if (t == JsonToken.VALUE_NULL) {
5030:                 // Ask JsonDeserializer what 'null value' to use:
5031:                 result = _findRootDeserializer(ctxt, valueType).getNullValue(ctxt);
5032:             } else if (t == JsonToken.END_ARRAY || t == JsonToken.END_OBJECT) {
5033:                 result = null;
5034:             } else if (t == JsonToken.NOT_AVAILABLE) {
5035:                 // 28-Jan-2025, tatu: [databind#4932] Need to handle this case too
5036:                 result = null;
5037:             } else {
5038:                 result = ctxt.readRootValue(p, valueType,
5039:                         _findRootDeserializer(ctxt, valueType), null);
5040:                 ctxt.checkUnresolvedObjectId();
5041:             }
5042:             if (cfg.isEnabled(DeserializationFeature.FAIL_ON_TRAILING_TOKENS)) {
5043:                 _verifyNoTrailingTokens(p, ctxt, valueType);
5044:             }
5045:             return result;
5046:         }
5047:     }
5048: 
5049:     /**
5050:      * Similar to {@link #_readMapAndClose} but specialized for <code>JsonNode</code>
5051:      * reading.
5052:      *
5053:      * @since 2.9
5054:      */
5055:     protected JsonNode _readTreeAndClose(JsonParser p0) throws IOException
5056:     {
5057:         try (JsonParser p = p0) {
5058:             final JavaType valueType = constructType(JsonNode.class);
5059: 
5060:             DeserializationConfig cfg = getDeserializationConfig();
5061:             // 27-Oct-2016, tatu: Need to inline `_initForReading()` due to
5062:             //   special requirements by tree reading (no fail on eof)
5063: 
5064:             cfg.initialize(p); // since 2.5
5065:             JsonToken t = p.currentToken();
5066:             if (t == null) {
5067:                 t = p.nextToken();
5068:                 if (t == null) {
5069:                     // [databind#2211]: return `MissingNode` (supercedes [databind#1406] which dictated
5070:                     // returning `null`
5071:                     return cfg.getNodeFactory().missingNode();
5072:                 }
5073:             }
5074:             final JsonNode resultNode;
5075: 
5076:             final DefaultDeserializationContext ctxt = createDeserializationContext(p, cfg);
5077:             if (t == JsonToken.VALUE_NULL) {
5078:                 resultNode = cfg.getNodeFactory().nullNode();
5079:             } else {
5080:                 resultNode = (JsonNode) ctxt.readRootValue(p, valueType,
5081:                         _findRootDeserializer(ctxt, valueType), null);
5082:                 // No ObjectIds so can ignore
5083: //              ctxt.checkUnresolvedObjectId();
5084:             }
5085:             if (cfg.isEnabled(DeserializationFeature.FAIL_ON_TRAILING_TOKENS)) {
5086:                 _verifyNoTrailingTokens(p, ctxt, valueType);
5087:             }
5088:             return resultNode;
5089:         }
5090:     }
5091: 
5092: 
5093: 
5094:     /**
5095:      * Internal helper method called to create an instance of {@link DeserializationContext}
5096:      * for deserializing a single root value.
5097:      * Can be overridden if a custom context is needed.
5098:      */
5099:     protected DefaultDeserializationContext createDeserializationContext(JsonParser p,
5100:             DeserializationConfig cfg) {
COMMAND git -C /tmp/java-series-httpcomponents-client-rel-v5.6.4 rev-parse HEAD
36508cead5c4388d04d20aa7efad5a68595631a0
READ /tmp/java-series-httpcomponents-client-rel-v5.6.4/httpclient5/src/main/java/org/apache/hc/client5/http/classic/HttpClient.java
SHA256 ef11f1dd6e4b376c5a15a8ec2813ef536366326e1dcf3b2bf400f3c93b251526
160:      *
161:      * @param target    the target host for the request.
162:      *                  Implementations may accept {@code null}
163:      *                  if they can still determine a route, for example
164:      *                  to a default target or by inspecting the request.
165:      * @param request   the request to execute
166:      * @param context   the context to use for the execution, or
167:      *                  {@code null} to use the default context
168:      *
169:      * @return  the response to the request. This is always a final response,
170:      *          never an intermediate response with an 1xx status code.
171:      *          Whether redirects or authentication challenges will be returned
172:      *          or handled automatically depends on the implementation and
173:      *          configuration of this client.
174:      *          The response returned by this method must be closed with
175:      *          {@link Closeable#close()} in order ensure deallocation
176:      *          of system resources.
177:      * @throws IOException in case of a problem or the connection was aborted
178:      *
179:      * @since 5.2
180:      */
181:     @SuppressWarnings("deprecation")
182:     default ClassicHttpResponse executeOpen(HttpHost target, ClassicHttpRequest request, HttpContext context) throws IOException {
183:         return (ClassicHttpResponse) execute(target, request, context);
184:     }
185: 
186:     /**
187:      * Executes HTTP request using the default context and processes the
188:      * response using the given response handler.
189:      * <p>
190:      * Implementing classes are required to ensure that the content entity
191:      * associated with the response is fully consumed and the underlying
192:      * connection is released back to the connection manager automatically
193:      * in all cases relieving individual {@link HttpClientResponseHandler}s from
194:      * having to manage resource deallocation internally.
195:      * </p>
196:      *
197:      * @param <T> the type of the value determined by the response.
198:      * @param request   the request to execute
199:      * @param responseHandler the response handler
200:      *
201:      * @return  the response object as generated by the response handler.
202:      * @throws IOException in case of a problem or the connection was aborted
203:      */
204:     <T> T execute(ClassicHttpRequest request, HttpClientResponseHandler<? extends T> responseHandler) throws IOException;
205: 
206:     /**
207:      * Executes HTTP request using the given context and processes the
208:      * response using the given response handler.
209:      * <p>
210:      * Implementing classes are required to ensure that the content entity
