|
1 | 1 | /*
|
2 |
| - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
4 | 4 | *
|
5 | 5 | * The Universal Permissive License (UPL), Version 1.0
|
@@ -266,12 +266,20 @@ public void reportUpdatedCapacity(BasicSequenceStorage newStore) {
|
266 | 266 | if (PythonContext.get(this).getOption(PythonOptions.OverallocateLiteralLists)) {
|
267 | 267 | if (newStore.getCapacity() > initialCapacity.estimate()) {
|
268 | 268 | initialCapacity.updateFrom(newStore.getCapacity());
|
269 |
| - LOGGER.finest(() -> String.format("Updating list size estimate at %s. Observed capacity: %d, new estimate: %d", getSourceSection(), newStore.getCapacity(), |
270 |
| - initialCapacity.estimate())); |
| 269 | + LOGGER.finest(() -> { |
| 270 | + SourceSection encapsulatingSourceSection = getEncapsulatingSourceSection(); |
| 271 | + String sourceSection = encapsulatingSourceSection == null ? "<unavailable source>" : encapsulatingSourceSection.toString(); |
| 272 | + return String.format("Updating list size estimate at %s. Observed capacity: %d, new estimate: %d", sourceSection, newStore.getCapacity(), |
| 273 | + initialCapacity.estimate()); |
| 274 | + }); |
271 | 275 | }
|
272 | 276 | if (newStore.getElementType().generalizesFrom(type)) {
|
273 | 277 | type = newStore.getElementType();
|
274 |
| - LOGGER.finest(() -> String.format("Updating list type estimate at %s. New type: %s", getSourceSection(), type.name())); |
| 278 | + LOGGER.finest(() -> { |
| 279 | + SourceSection encapsulatingSourceSection = getEncapsulatingSourceSection(); |
| 280 | + String sourceSection = encapsulatingSourceSection == null ? "<unavailable source>" : encapsulatingSourceSection.toString(); |
| 281 | + return String.format("Updating list type estimate at %s. New type: %s", sourceSection, type.name()); |
| 282 | + }); |
275 | 283 | }
|
276 | 284 | }
|
277 | 285 | }
|
|
0 commit comments