Commit Graph

190 Commits (a9f1441fccd8b95851962f39197d7e23889cae2c)

Author SHA1 Message Date
Phillip Webb a20fdf8e6a Merge branch '2.1.x' into 2.2.x
Closes gh-23263
4 years ago
Phillip Webb 895ff9c72d Merge pull request #19041 from mathieufortin01
* pr/19041:
  Polish 'Fix signed jar performance issues'
  Fix signed jar performance issues
  Ignore Visual Studio Code Files

Closes gh-19041
4 years ago
Phillip Webb c6a9696dd1 Polish 'Fix signed jar performance issues'
Update the performance improvements to push certificate loading
and storage into the `JarFileEntries` class. This allows us to
keep certificates without needing to cache all entry data. We
now also keep certificates and code signers in a dedicated class
which is set whenever the full jar stream as been read, even if
the contained values are `null`. The logic that assumes META-INF
entries are not signed has been removed in favor of delegating to
the streamed entry results.

See gh-19041
4 years ago
mathieufortin01 4d053e15d8 Fix signed jar performance issues
Update Spring Boot nested JarFile support to improve the performance of
signed jars. Prior to this commit, `certificates` and `codeSigners`
were read by streaming the entire jar whenever the existing values
were `null`. Unfortunately, the contract for `getCertificates` and
get `getCodeSigners` states that `null` is a valid return value. This
meant that full jar streaming would occur whenever either method was
called on an entry that had no result. The problem was further
exacerbated by the fact that entries might not be cached.

See gh-19041
4 years ago
Phillip Webb 17e2d72bcb Fix Windows path issue in JarFileWrapperTests
See gh-22991
4 years ago
Phillip Webb 3fe2005e06 Use @AfterEach to close the source jar file
Update `JarFileWrapperTests` so that the jar files are closed after each
test.

See gh-22991
4 years ago
Phillip Webb 2a137a2d8a Remove Mockito from JarFileWrapperTests
Remove Mockto from JarFileWrapperTests since it seems to be failing on
later versions of Java.

See gh-22991
4 years ago
Phillip Webb 4e76138ebc Update copyright year of changed files 4 years ago
Phillip Webb 5997cbd21f Refine AbstractJarFile method visibility
Refine method visibility in an attempt to fix test issues on Java 11+.

See gh-22991
4 years ago
Phillip Webb aac367e9c5 Attempt to fix memory leak in JarFile class
Create a new `JarFileWrapper` class so that we can wrap and existing
`JarFile` and offer a version that can be safely closed.

Prior to this commit, we provided wrapper functionality in the `JarFile`
class itself. Unfortunately, because we override `close` and also create
a lot of wrappers this caused memory issues when running on Java 11.

With Java 11 `java.util.zip.ZipFile` class uses `FinalizableResource`
for any implementation that overrides `close()`. This means that any
wrapper classes will not be garbage collected until the JVM finalizer
thread runs.

Closes gh-22991
4 years ago
Andy Wilkinson f4508b4059 Merge branch '2.1.x' into 2.2.x
Closes gh-22547
4 years ago
Nelson Osacky e41a53cf85 Add Gradle Enterprise Extension
This adds build caching and build scans.

The changes required disabling scans when using the maven invoker
plugin in order to not cause duplicate build scans when invoking other
maven builds. There is also an empty `.mvn` folder in the
spring-boot-starters project to prevent duplicate build scans as well
since there is no way to pass properties to the maven-javadoc-plugin.

The checkstyle plugin was causing a cache miss with the
`propertyExpansion` because it contains an absolute path. The absolute
path is now ignored and instead the files are added as inputs to the
checkstyle plugin. This only enables the local build cache. The remote
cache is not yet enabled.

On my local machine:

./mvnw clean install build times go from about 30 minutes to about 10 minutes.
./mvnw clean install -Pfull build times go from about 60 minutes to about 13 minutes.

See gh-22089
4 years ago
Phillip Webb 50e9674631 Backport "Attempt to prevent JarFiles from being left open"
Update `JarFile` so that `super.close()` is called early so that the
file is not left open. Since we re-implement `JarFile` methods to work
directly on the underlying `RandomAccessDataFile`, it should be safe
to close immediately.

Closes gh-21177
5 years ago
Phillip Webb 7d53f7d27f Attempt to prevent JarFiles from being left open
Update `JarFile` to also call `super.close()` early for nested jars.

See gh-21126
5 years ago
Phillip Webb 7c6e912463 Attempt to prevent JarFiles from being left open
Update `JarFile` so that `super.close()` is called early so that the
file is not left open. Since we re-implement `JarFile` methods to work
directly on the underlying `RandomAccessDataFile`, it should be safe
to close immediately.

See gh-21126
5 years ago
Phillip Webb 6bf933205c Merge branch '2.1.x' into 2.2.x
Fixes gh-21073
5 years ago
Phillip Webb c85918b8b3 Create new JarFile instance for URL connections
Update `JarURLConnection` to ensure that when connections are opened
a new copy of the JarFile is provided.

Prior to this commit, a single `JarFile` instance was shared which meant
that it could be accidental closed if accessed via
`JarURLConnection.getJarFile()`. If the underlying jar file is closed
then it's possible for a `NoClassDefFoundError` to be thrown if running
on JDK 11 with an active `SecurityManager`.

Closes gh-17796
5 years ago
Stephane Nicoll 1dd8dcc6c9 Polish "Polish JarFile to extra anonymous inner class"
See gh-20882
5 years ago
Konrado85 e0d1cf0e38 Polish JarFile to extra anonymous inner class
See gh-20882
5 years ago
Stephane Nicoll 579a6ac254 Adapt tests for support for Java 14
See gh-20576
5 years ago
Andy Wilkinson b7e250eb04 Merge branch '2.1.x' into 2.2.x 5 years ago
Andy Wilkinson ebebe09a9d Fix file handle leak in JarFileTests
The JarFile was not being closed which linked a file handle and caused
a test failure on Windows.

The local variable has been renamed as, when declared in a
try-with-resources, Checkstyle was confused by the shadowing of the
jarFile field and required references to jarFile within the try-block
the be prefixed with this.

See gh-19595
5 years ago
Madhura Bhave 3bf943d597 Merge branch '2.1.x' into 2.2.x
Closes gh-19713
5 years ago
Madhura Bhave 91e459a5d4 Polish "Limit ChronoField values to their range"
See gh-19595
5 years ago
Dmytro Nosan 9bc68b9877 Limit ChronoField values to their range
See gh-19595
5 years ago
Johnny Lim ea51947741 Use try-with-resources blocks in JarFileArchiveTests
See gh-18883
5 years ago
Stephane Nicoll 8108b556ad Fix resource cleanup in test
Closes gh-18569
5 years ago
Andy Wilkinson 46c30d6bb0 Merge branch '2.1.x'
Closes gh-18476
5 years ago
Andy Wilkinson 3d4157ad6d Correct SCM URLs in published poms
Previously, Maven's default behaviour was relied up which resulted
in the artifact ID being appended to each URL as it was inherited.
This behaviour can only be disabled in Maven 3.6 and later, a version
that we cannot use due to an incompatibility with the Flatten Plugin.

This commit works around Maven's default behaviour by defining
properties for the SCM URL, connection, and developer connection and
then explicitly defining the settings in each pom using these
properties. The explicit definition of the properties in each pom
prevents them being inherited from the parent, thereby disabling the
unwanted appending of the artifact ID to the URL.

Fixes gh-18328
5 years ago
Andy Wilkinson 02ac089767 Polish "Support zip64 jars"
See gh-16091
5 years ago
Camille Vienot 1917e1eac5 Support zip64 jars
See gh-16091
5 years ago
Andy Wilkinson 1b237de5f5 Use Awaitility in our own tests
Closes gh-18227
5 years ago
Andy Wilkinson ff1983c9ae Merge branch '2.1.x'
Closes gh-18168
5 years ago
Andy Wilkinson 795c2f225f Support getComment() on a nested JarFile
Previously, calling getComment() on a nested jar file would result
in the outer jar file's comment being returned.

This commit updates the loader's JarFile to read the file's comment
from the central directory end record and return it from getComment().

Fixes gh-18128
5 years ago
thelproad 9c1f503e46 Simplify if statements
See gh-17884
5 years ago
dreis2211 b605cddb10 Polish some Collections API calls
See gh-17825
5 years ago
Madhura Bhave 8a9c60a29a Merge branch '2.1.x' 5 years ago
Madhura Bhave 541d3c4853 Fix typo 5 years ago
Phillip Webb 8bc780762a Merge branch '2.1.x' 5 years ago
Phillip Webb fb1dd8fe93 Merge branch '2.0.x' into 2.1.x 5 years ago
Phillip Webb 913e831f4e Merge '1.5.x' into 2.0.x 5 years ago
Stephane Nicoll 19eaf86efa Update multi release test jar to include Java 12
See gh-16970
5 years ago
Phillip Webb a9ba7080ce Merge branch '2.1.x' 5 years ago
Phillip Webb 01933f9b06 Merge previously split strings
Merge some string lines that were previously split because of the
90 chars wide formatting.
5 years ago
Phillip Webb c3816bfe7b Polish output capture names 5 years ago
Andy Wilkinson bd22ca0268 Polish 5 years ago
Andy Wilkinson 2816635418 Polish 5 years ago
Andy Wilkinson 4b2a116fa7 Use String indexOf(char) and lastIndexOf(char) where possible
Closes gh-11416
5 years ago
Phillip Webb a66c4d3096 Unify method visibility of private classes
Apply checkstyle rule to ensure that private and package private
classes do not have unnecessary public methods. Test classes have
also been unified as much as possible to use default scoped
inner-classes.

Closes gh-7316
5 years ago
Andy Wilkinson 6791dbb786 Merge branch '2.1.x'
Closes gh-17381
5 years ago