Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
85c7ed27
Commit
85c7ed27
authored
Feb 23, 2018
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '1.5.x'
parents
73ad36d8
746cc0f7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
5 deletions
+12
-5
JarFile.java
...ain/java/org/springframework/boot/loader/jar/JarFile.java
+2
-2
JarFileEntries.java
...a/org/springframework/boot/loader/jar/JarFileEntries.java
+4
-0
JarFileTests.java
...ava/org/springframework/boot/loader/jar/JarFileTests.java
+6
-3
No files found.
spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFile.java
View file @
85c7ed27
...
...
@@ -108,7 +108,7 @@ public class JarFile extends java.util.jar.JarFile {
private
JarFile
(
RandomAccessDataFile
rootFile
,
String
pathFromRoot
,
RandomAccessData
data
,
JarEntryFilter
filter
,
JarFileType
type
)
throws
IOException
{
throws
IOException
{
super
(
rootFile
.
getFile
());
this
.
rootFile
=
rootFile
;
this
.
pathFromRoot
=
pathFromRoot
;
...
...
@@ -289,7 +289,7 @@ public class JarFile extends java.util.jar.JarFile {
@Override
public
int
size
()
{
return
(
int
)
this
.
data
.
getSize
();
return
this
.
entries
.
getSize
();
}
@Override
...
...
spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFileEntries.java
View file @
85c7ed27
...
...
@@ -120,6 +120,10 @@ class JarFileEntries implements CentralDirectoryVisitor, Iterable<JarEntry> {
}
}
int
getSize
()
{
return
this
.
size
;
}
private
void
sort
(
int
left
,
int
right
)
{
// Quick sort algorithm, uses hashCodes as the source but sorts all arrays
if
(
left
<
right
)
{
...
...
spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jar/JarFileTests.java
View file @
85c7ed27
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -31,6 +31,7 @@ import java.util.jar.JarEntry;
import
java.util.jar.JarInputStream
;
import
java.util.jar.Manifest
;
import
java.util.zip.ZipEntry
;
import
java.util.zip.ZipFile
;
import
org.junit.Before
;
import
org.junit.Rule
;
...
...
@@ -168,8 +169,10 @@ public class JarFileTests {
}
@Test
public
void
getSize
()
{
assertThat
(
this
.
jarFile
.
size
()).
isEqualTo
((
int
)
this
.
rootJarFile
.
length
());
public
void
getSize
()
throws
Exception
{
try
(
ZipFile
zip
=
new
ZipFile
(
this
.
rootJarFile
))
{
assertThat
(
this
.
jarFile
.
size
()).
isEqualTo
(
zip
.
size
());
}
}
@Test
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment