Commit Graph

515 Commits

Author SHA1 Message Date
Phillip Webb
147240aa0c Merge branch '3.2.x'
Closes gh-41080
2024-06-11 13:32:30 -07:00
Phillip Webb
bcbcafaab2 Polish "Use method references when possible in test code"
See gh-40974
2024-06-11 12:58:04 -07:00
Ahmed Ashour
207327d97c Use method references when possible in test code
See gh-40974
2024-06-11 12:58:00 -07:00
Andy Wilkinson
16302c18b2 Merge branch '3.2.x'
Closes gh-41006
2024-06-06 14:58:28 +01:00
Andy Wilkinson
217c2c862b Ignore file entries in META-INF/versions of multi-release jar
Fixes gh-41001
2024-06-06 13:28:36 +01:00
Phillip Webb
348ed47e67 Merge branch '3.2.x' 2024-05-08 18:28:24 -07:00
Phillip Webb
24bfe5087f Fix checkstyle violation
See gh-40549
2024-05-08 18:28:09 -07:00
Phillip Webb
5e4796f0fb Merge branch '3.2.x' 2024-05-08 18:05:31 -07:00
Phillip Webb
8457fc333f Adapt Windows path handling fix to deal with Jetty
Update `NestedLocation` to deal with the fact that Jetty attempts
to fix URLs.

See gh-40549
2024-05-08 18:04:17 -07:00
Phillip Webb
ac9d2e7c11 Merge branch '3.2.x'
Closes gh-40643
2024-05-08 15:44:35 -07:00
Phillip Webb
7708ec7592 Fix Windows path handling for nested jars
Update `Path` creation for nested locations to allow both UNC and classic
file references to be used. This commit attempts to align our URL
handling with that of standard file URLs. The `NestedLocation` class
no longer attempts to remove leading all `\` characters and instead
only removes the first `\` when the second char is `:`. This duplicates
the logic found in Java's own internal `WindowsUriSupport` class which
is used when calling `Path.of(url)` with a `file:` URL.

Fixes gh-40549
2024-05-08 15:44:03 -07:00
Moritz Halbritter
9bb981be11 Merge branch '3.2.x'
Closes gh-40625
2024-05-06 10:25:08 +02:00
Moritz Halbritter
c47cdda824 Merge branch '3.1.x' into 3.2.x
Closes gh-40624
2024-05-06 09:51:39 +02:00
Moritz Halbritter
d18fb9ce65 Upgrade to bcprov-jdk18on 1.78.1
Closes gh-40621
2024-05-06 09:49:32 +02:00
Phillip Webb
3b66eb7bb7 Merge branch '3.2.x'
See gh-40616
2024-05-03 12:31:33 -07:00
Phillip Webb
8a72e55106 Fix UriPathEncoder bug to improve performance
Fix `isAllowed` check and write test to ensure that additional object
instances are not created unnecessarily.

See gh-40615
2024-05-03 12:29:41 -07:00
Phillip Webb
208efae975 Merge branch '3.2.x'
Closes gh-40616
2024-05-02 15:53:38 -07:00
Phillip Webb
d0ce4daec1 Use URI encoded values when creating NestedPath URIs
Update `NestedPath.toUri()` so that the URI is constructed using encoded
strings.

Fixes gh-40615
2024-05-02 15:53:01 -07:00
Phillip Webb
63dedaafe0 Merge branch '3.2.x'
Closes gh-40599
2024-05-01 22:46:53 -07:00
yokotaso
5b4bd61720 Fix possible NullPointerException from getPermission()
Fix regression in `JarUrlConnection` where a NullPointerException could
be thrown internally causing performance issues.

When the SecurityManager is present, the following stack trace is
thrown:

java.lang.NullPointerException: Cannot invoke "java.net.URLConnection.getPermission()" because "this.jarFileConnection" is null
        at org.springframework.boot.loader.net.protocol.jar.JarUrlConnection.getPermission(JarUrlConnection.java:175)
        at java.base/jdk.internal.loader.URLClassPath.check(URLClassPath.java:553)
        at java.base/jdk.internal.loader.URLClassPath$Loader.findResource(URLClassPath.java:612)
        at java.base/jdk.internal.loader.URLClassPath.findResource(URLClassPath.java:296)
        at java.base/java.net.URLClassLoader$2.run(URLClassLoader.java:629)
        at java.base/java.net.URLClassLoader$2.run(URLClassLoader.java:627)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
        at java.base/java.net.URLClassLoader.findResource(URLClassLoader.java:626)
        at org.springframework.boot.loader.net.protocol.jar.JarUrlClassLoader.findResource(JarUrlClassLoader.java:70)
        at java.base/java.lang.ClassLoader.getResource(ClassLoader.java:1403)
        at java.base/java.net.URLClassLoader.getResourceAsStream(URLClassLoader.java:290)
        at java.base/java.lang.Class.getResourceAsStream(Class.java:2850)

See gh-39856
2024-05-01 22:42:52 -07:00
Scott Frederick
c6c02906ef Merge branch '3.2.x'
Closes gh-40577
2024-04-29 16:43:20 -05:00
Scott Frederick
21a0bc7fee Merge branch '3.1.x' into 3.2.x
Closes gh-40576
2024-04-29 16:42:53 -05:00
Phillip Webb
6963bd884b Merge branch '3.2.x' 2024-04-18 12:53:26 -07:00
Phillip Webb
38af8cd362 Merge branch '3.1.x' into 3.2.x 2024-04-18 12:52:54 -07:00
Phillip Webb
dfee56ad9d Merge branch '3.2.x'
Closes gh-40381
2024-04-16 22:17:28 -07:00
Phillip Webb
78e12251e9 Optimize VirtualZipDataBlock
Add some optimizations to `VirtualZipDataBlock` that help when
sequentially reading the block from a JarInputStream.

Closes gh-40125
2024-04-16 22:16:00 -07:00
Phillip Webb
13f41da54f Merge branch '3.2.x'
Closes gh-40379
2024-04-16 15:32:03 -07:00
Phillip Webb
9b0593efe3 Fallback to RandomAccessFile on ClosedByInterruptException
Refine the fix for gh-38611 so that `ClosedByInterruptException` no
longer retries in a loop.

Our previous fix was flawed due to the fact that another interrupt
could occur after we clear the first and whilst we are reading data.
If this happens 10 times in a row, we raise an exception and end up
causing NoClassDefFoundError errors.

Our new approach retains the use of `FileChannel` and a direct buffer
up to the point that a `ClosedByInterruptException` is raised or the
thread is detected as interrupted.  At that point, we temporarily
switch to using a `RandomAccessFile` to access the data. This will
block the thread until the data has been read.

Fixes gh-40096
2024-04-16 14:47:07 -07:00
Phillip Webb
4203e1f2fa Rename FileChannelDataBlock to FileDataBlock
Rename the internal `FileChannelDataBlock` to `FileDataBlock` since we
want to fallback to a `RandomAccessFile` when a thread is interrupted.

See gh-40096
2024-04-16 14:46:56 -07:00
Johnny Lim
412b8dd548 Polish
See gh-39910
2024-03-15 11:25:16 +01:00
Phillip Webb
2b7320be1a Merge branch '3.2.x'
Closes gh-39690
2024-02-21 21:36:07 -08:00
Phillip Webb
a457638e6c Polish 'Decode URL content before passing it to NestedLocation.parse'
See gh-39675'

Closes gh-39675'
2024-02-21 21:16:33 -08:00
_ext Slovak, Jiri
06569e76f6 Decode URL content before passing it to NestedLocation.parse
URL can contains empty spaced encoded as %20, so it should be decoded
before passing it to NestedLocation. NestedLocation expects file system
path which should not contain URL encoded values.

See gh-39675
2024-02-21 17:28:55 -08:00
Moritz Halbritter
7f55cae90f Merge branch '3.2.x' 2024-02-12 10:19:46 +01:00
Moritz Halbritter
4387b79831 Merge branch '3.1.x' into 3.2.x 2024-02-12 10:18:46 +01:00
Moritz Halbritter
8ffcfc9b77 Harmonize style of igored exceptions across the codebase 2024-02-12 10:14:20 +01:00
Moritz Halbritter
f36b69f961 Merge branch '3.2.x'
Closes gh-39338
2024-01-30 13:48:44 +01:00
Piyal Ahmed
a85e99790b Fix NestedJarFile constructor javadoc
See gh-39285
2024-01-30 13:47:23 +01:00
Phillip Webb
8f1a330dd5 Update copyright header of cleaned up code
See gh-39259
2024-01-23 10:18:50 -08:00
Tobias Lippert
316b415e95 Use try with resources instead of try-finally
See gh-39259
2024-01-23 10:18:49 -08:00
Tobias Lippert
fe38cb3b4a Use string.repeat()
See gh-39259
2024-01-23 09:47:07 -08:00
Phillip Webb
ddb769bf7f Polish 'Simplify conditionals'
See gh-39259
2024-01-23 09:47:07 -08:00
Tobias Lippert
65a1ff84e6 Simplify conditionals
See gh-39259
2024-01-23 09:07:40 -08:00
Phillip Webb
a0a804cfdf Merge branch '3.2.x' 2024-01-22 12:20:41 -08:00
Phillip Webb
cff8cb98c7 Merge branch '3.1.x' into 3.2.x 2024-01-22 12:20:24 -08:00
Phillip Webb
9de0085a43 Merge branch '3.2.x'
Closes gh-39226
2024-01-17 13:16:53 -08:00
Phillip Webb
eb0040c225 Fix ZipCentralDirectoryFileHeaderRecord entry comment read offset
Update `ZipCentralDirectoryFileHeaderRecord.copyTo` comment read offset
to account for the record position.

Fixes gh-39166
2024-01-17 13:16:43 -08:00
Andy Wilkinson
ac63fc0701 Merge branch '3.2.x'
Closes gh-39121
2024-01-12 16:25:13 +00:00
Andy Wilkinson
6bfac1f860 Fix handling of nested: UNC paths on Windows
Closes gh-38956
2024-01-12 15:53:19 +00:00
Andy Wilkinson
17e9f0cb8e Merge branch '3.2.x'
Closes gh-39093
2024-01-11 11:36:38 +00:00