Commit Graph
74 Commits
Author SHA1 Message Date
Hyunwoo Jung fabfdd5dc7 Improve classpath lookup in IndexedJarStructure
See gh-51787

Signed-off-by: Hyunwoo Jung <hyunwoojung@kakao.com>
2026-09-17 09:06:54 +01:00
Phillip Webb adcb3256c6 Merge branch '4.1.x'
Closes gh-51746
2026-09-14 18:10:07 -07:00
Phillip Webb bd1ae5ede0 Merge branch '4.0.x' into 4.1.x
Closes gh-51745
2026-09-14 18:09:52 -07:00
Phillip Webb d6aac54e2e Polish 'Fix inflater cache race in NestedJarFileResources'
See gh-51744
2026-09-14 17:37:06 -07:00
Ian Kettle b103aaa1f6 Fix inflater cache race in NestedJarFileResources
Update `NestedJarFileResources` to fix a race condition that could
result in a `NullPointerException`.

The methods `getOrCreateInflater` and `endOrCacheInflater` both
synchronize on a local `inflaterCache` variable but attempted to use the
`this.inflaterCache` instance which could be set to null.

The `releaseInflators` method had a synchronized block for ending each
inflater but the cache was being nulled out outside the block meaning that
the other 2 methods mentioned could hit the race condition.

Signed-off-by: Ian Kettle <25729118+icikle@users.noreply.github.com>

See gh-51744
2026-09-14 17:34:45 -07:00
Junggi Kim 823744c0b2 Use a map to look up layer index child nodes
LayersIndex.Node kept its children in a list and scanned that list
linearly to find the child for each path segment. Building the index is
therefore O(entries x siblings), a cost that is dominated by the largest
flat directory in the jar: BOOT-INF/lib/ for the dependencies, and any
bundled resource directory such as a front-end build output.

Keep the children in a LinkedHashMap keyed by the segment name so that
lookups are constant time. Insertion order is preserved, so the order in
which buildIndex() walks the tree is unchanged.

For a jar with 32,529 entries, 426 dependencies and a 12,000 file static
resource directory, this reduces the number of string comparisons from
73.7M to 222K and the time spent building the index from 197ms to 12ms.
For a jar with no large flat directory (20,529 entries, 426
dependencies) the gain is much smaller: 1.58M comparisons to 162K, and
12.5ms to 9.6ms. The generated layers.idx is byte for byte identical in
both cases.

See gh-51654

Signed-off-by: Junggi Kim <kimjg2477@gmail.com>
2026-09-10 16:30:35 +02:00
Junggi KimandClaude Opus 5 a0f0cf00b3 Avoid scanning the whole layer index for every entry
IndexedLayers.getLayer() walked every entry of layers.idx for each jar
entry being extracted, making extraction O(entries x index size). The
dependency entries are listed first while the application classes are
covered by a single directory entry near the end, so the most numerous
entries consistently scanned the longest.

Index the candidates once when the index file is read, keeping the
directory candidates in a separate map that preserves index order. A
file name is then resolved with a single map lookup and only the
handful of directory candidates has to be scanned.

For a jar with 24,823 entries and 700 dependencies this reduces the
number of string comparisons from 17,179,582 to 72,946 (106.9ms to
2.5ms). With 4,173 entries it goes from 1,019,857 to 11,896 (5.4ms to
0.1ms) and with 903 entries from 70,612 to 2,426 (0.8ms to 0.1ms).

Lookups resolve to the same layer as before. LayersIndex only writes a
name once its whole subtree belongs to a single layer, so no indexed
name is a prefix of another and at most one candidate can match, which
makes the order the two kinds of candidate are consulted in immaterial.

See gh-51653

Signed-off-by: Junggi Kim <kimjg2477@gmail.com>

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 16:23:11 +02:00
Andy Wilkinson 59379ae449 Merge branch '4.1.x'
Closes gh-51652
2026-09-09 15:32:53 +01:00
Andy Wilkinson 5b3631bfe9 Merge branch '4.0.x' into 4.1.x
Closes gh-51651
2026-09-09 15:31:57 +01:00
Andy Wilkinson 007ca201e1 Polish "Add SBOM manifest attributes to repackaged Maven wars"
See gh-51551

Signed-off-by: Andy Wilkinson <andy.wilkinson@broadcom.com>
2026-09-09 14:44:51 +01:00
COBI-98 bfd05e38b5 Add SBOM manifest attributes to repackaged Maven wars
Packager#isCycloneDxBom only recognized CycloneDX SBOMs beneath
META-INF/sbom/. In a war, the CycloneDX Maven plugin's output is
packaged beneath WEB-INF/classes/META-INF/sbom/, so repackaging did
not add the SBOM manifest attributes.

Also check beneath Layout#getClassesLocation(), which findMainMethod
already uses to locate application classes. Continue to support the
root location used by jars.

Signed-off-by: COBI-98 <tkdgus968@naver.com>

See gh-51551
2026-09-09 14:44:33 +01:00
Wan bin yu 0d223cbc77 Filter additional configuration metadata from archives
Signed-off-by: Wan bin yu <3431359639@qq.com>

See gh-51386
2026-09-09 08:30:08 +01:00
Andy Wilkinson 85535ce81f Merge branch '4.1.x'
Closes gh-51607
2026-09-07 12:20:42 +01:00
Andy Wilkinson 50350d0c83 Merge branch '4.0.x' into 4.1.x
Closes gh-51606
2026-09-07 12:20:30 +01:00
Hyunwoo Jung 528c8bd1ea Fix typos
Signed-off-by: Hyunwoo Jung <hyunwoojung@kakao.com>

See gh-51590
2026-09-07 11:53:30 +01:00
Andy Wilkinson 57b44b0594 Merge branch '4.1.x'
Closes gh-51600
2026-09-07 08:27:14 +01:00
Andy Wilkinson ea613dc511 Merge branch '4.0.x' into 4.1.x
Closes gh-51599
2026-09-07 08:26:42 +01:00
Manu Sridharan 25a3f8feb9 Remove unnecessary NullAway suppressions
Signed-off-by: Manu Sridharan <msridhar@gmail.com>

See gh-51591
2026-09-07 08:18:11 +01:00
Moritz Halbritter e5a24bafc7 Polish "Add jarmode tools command to print the SBOM"
See gh-51505
2026-09-02 16:34:49 +02:00
Hyeongjun Cho 962ca36126 Add jarmode tools command to print the SBOM
Add an 'sbom' command to the tools jar mode which prints the SBOM
packaged in an uber jar or war. The SBOM is located using the
Sbom-Location manifest attribute and its bytes are copied verbatim to
the console, or to the file given by --destination.

See gh-51505

Signed-off-by: Hyeongjun Cho <ryuu.public@gmail.com>
2026-09-02 16:26:35 +02:00
Moritz Halbritter 07e3850143 Merge branch '4.0.x' into 4.1.x
Closes gh-51547
2026-09-02 16:23:27 +02:00
Hyeongjun Cho d92a75c66b Print a simple error message when a jarmode tools command fails
See gh-51540

Signed-off-by: Hyeongjun Cho <ryuu.public@gmail.com>
2026-09-02 16:17:49 +02:00
Andy Wilkinson 40e8911734 Merge branch '4.0.x' into 4.1.x
Closes gh-51520
2026-09-01 16:12:05 +01:00
Andy Wilkinson 837f44f764 Return correct total when read(ByteBuffer) cannot fill buffer
Fixes gh-51515
2026-09-01 16:03:12 +01:00
Stéphane Nicoll 0a399e49da Merge branch '4.0.x' into 4.1.x
Closes gh-51089
2026-07-21 15:18:23 +02:00
Stéphane Nicoll 59de56d66a Polish "Fix nested archive paths logging in PropertiesLauncher"
See gh-50968
2026-07-21 15:15:43 +02:00
Filip Hrisafov 2578e81796 Fix nested archive paths logging in PropertiesLauncher
See gh-50968

Signed-off-by: Filip Hrisafov <filip.hrisafov@gmail.com>
2026-07-21 14:58:48 +02:00
Moritz Halbritter 8afd978548 Merge branch '4.0.x'
Closes gh-50510
2026-05-27 10:47:58 +02:00
Moritz Halbritter 5f0d0ad265 Merge branch '3.5.x' into 4.0.x
Closes gh-50509
2026-05-27 10:47:47 +02:00
Andy Wilkinson 6a74bb85a3 Merge branch '4.0.x'
Closes gh-50440
2026-05-14 15:03:44 +01:00
Andy Wilkinson add52b6ccd Merge branch '3.5.x' into 4.0.x
Closes gh-50439
2026-05-14 15:02:24 +01:00
Phillip Webb fae5a098f7 Merge branch '4.0.x'
Closes gh-50298
2026-05-05 11:35:27 -07:00
Phillip Webb 031cf98084 Merge branch '3.5.x' into 4.0.x
Closes gh-50297
2026-05-05 11:21:40 -07:00
Andy Wilkinson dcf0b4ccab Merge branch '4.0.x'
Closes gh-50132
2026-04-20 10:09:21 +01:00
Andy Wilkinson b43d3d439d Merge branch '3.5.x' into 4.0.x
Closes gh-50131
2026-04-20 10:05:26 +01:00
Stéphane Nicoll 3a38f0039b Merge branch '4.0.x'
Closes gh-49728
2026-03-24 10:29:45 +01:00
Stéphane Nicoll a96bfd6a0b Merge branch '3.5.x' into 4.0.x
Closes gh-49727
2026-03-24 10:29:30 +01:00
Stéphane Nicoll 6bf72956fd Merge branch '4.0.x'
Closes gh-49301
2026-02-23 16:47:29 +01:00
Stéphane Nicoll 5c9dbd4a4d Merge branch '3.5.x' into 4.0.x
Closes gh-49300
2026-02-23 16:47:20 +01:00
Andy Wilkinson 3d6671d47a Merge branch '4.0.x'
Closes gh-48701
2026-01-08 12:14:50 +00:00
Andy Wilkinson 0ffffee4bf Upgrade to Nullability Plugin 0.0.9
Closes gh-48638
2026-01-08 11:59:51 +00:00
Phillip Webb a6e4a93cda Merge branch '4.0.x'
Closes gh-48679
2026-01-05 14:34:20 -08:00
Phillip Webb eef6a6a5e2 Merge branch '3.5.x' into 4.0.x
Closes gh-48678
2026-01-05 14:33:39 -08:00
Stéphane Nicoll da56bfea6e Remove support for the deprecated layertools jar mode
Closes gh-48568
2025-12-22 08:36:52 +01:00
Andy Wilkinson 85bbbc99ad Merge branch '3.5.x'
Closes gh-48229
2025-11-21 16:54:25 +00:00
Stéphane Nicoll d1e5fe3248 Merge branch '3.5.x'
Closes gh-48106
2025-11-13 10:31:25 +01:00
Stéphane Nicoll 728cb95a17 Fix formatting 2025-10-23 14:12:50 +02:00
Andy Wilkinson aa95282290 Polish @since tags
Closes gh-47779
2025-10-23 12:48:58 +01:00
Phillip Webb debbec8ee1 Merge branch '3.5.x'
Closes gh-47772
2025-10-22 22:15:43 -07:00
Phillip Webb 739cb529fb Merge branch '3.5.x'
Closes gh-47749
2025-10-21 11:30:56 -07:00