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
46540de6
Commit
46540de6
authored
Feb 02, 2016
by
Johnny Lim
Committed by
Stephane Nicoll
Feb 02, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix typos
Closes gh-5067
parent
f5edd53d
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
33 additions
and
33 deletions
+33
-33
appendix-configuration-metadata.adoc
...cs/src/main/asciidoc/appendix-configuration-metadata.adoc
+1
-1
spring-boot-features.adoc
spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
+1
-1
AsciiBytes.java
.../java/org/springframework/boot/loader/jar/AsciiBytes.java
+1
-1
CentralDirectoryParser.java
...ringframework/boot/loader/jar/CentralDirectoryParser.java
+12
-12
CentralDirectoryVisitor.java
...ingframework/boot/loader/jar/CentralDirectoryVisitor.java
+2
-2
FileHeader.java
.../java/org/springframework/boot/loader/jar/FileHeader.java
+1
-1
JarFile.java
...ain/java/org/springframework/boot/loader/jar/JarFile.java
+4
-4
JarFileEntries.java
...a/org/springframework/boot/loader/jar/JarFileEntries.java
+1
-1
CentralDirectoryParserTests.java
...ramework/boot/loader/jar/CentralDirectoryParserTests.java
+10
-10
No files found.
spring-boot-docs/src/main/asciidoc/appendix-configuration-metadata.adoc
View file @
46540de6
...
@@ -717,7 +717,7 @@ annotations.
...
@@ -717,7 +717,7 @@ annotations.
If you are using AspectJ in your project, you need to make sure that the annotation
If you are using AspectJ in your project, you need to make sure that the annotation
processor only runs once. There are several ways to do this: with Maven, you can
processor only runs once. There are several ways to do this: with Maven, you can
configure the `maven-apt-plugin` explicitly and add the dependency to the annotation
configure the `maven-apt-plugin` explicitly and add the dependency to the annotation
processor only there. You could also let the AspectJ plugin run
s
all the processing
processor only there. You could also let the AspectJ plugin run all the processing
and disable annotation processing in the `maven-compiler-plugin` configuration:
and disable annotation processing in the `maven-compiler-plugin` configuration:
[source,xml,indent=0,subs="verbatim,quotes,attributes"]
[source,xml,indent=0,subs="verbatim,quotes,attributes"]
...
...
spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
View file @
46540de6
...
@@ -998,7 +998,7 @@ Spring Boot uses http://commons.apache.org/logging[Commons Logging] for all inte
...
@@ -998,7 +998,7 @@ Spring Boot uses http://commons.apache.org/logging[Commons Logging] for all inte
logging, but leaves the underlying log implementation open. Default configurations are
logging, but leaves the underlying log implementation open. Default configurations are
provided for
provided for
http://docs.oracle.com/javase/7/docs/api/java/util/logging/package-summary.html[Java Util Logging],
http://docs.oracle.com/javase/7/docs/api/java/util/logging/package-summary.html[Java Util Logging],
http://logging.apache.org/log4j/2.x/[Log4J2] andhttp://logback.qos.ch/[Logback]. In each
http://logging.apache.org/log4j/2.x/[Log4J2] and
http://logback.qos.ch/[Logback]. In each
case loggers are pre-configured to use console output with optional file output also
case loggers are pre-configured to use console output with optional file output also
available.
available.
...
...
spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/AsciiBytes.java
View file @
46540de6
...
@@ -200,7 +200,7 @@ final class AsciiBytes {
...
@@ -200,7 +200,7 @@ final class AsciiBytes {
}
}
public
static
int
hashCode
(
String
string
)
{
public
static
int
hashCode
(
String
string
)
{
// We're compatible with String's hash
code
// We're compatible with String's hash
Code().
return
string
.
hashCode
();
return
string
.
hashCode
();
}
}
...
...
spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/CentralDirectoryParser.java
View file @
46540de6
...
@@ -28,21 +28,21 @@ import org.springframework.boot.loader.data.RandomAccessData.ResourceAccess;
...
@@ -28,21 +28,21 @@ import org.springframework.boot.loader.data.RandomAccessData.ResourceAccess;
* Parses the central directory from a JAR file.
* Parses the central directory from a JAR file.
*
*
* @author Phillip Webb
* @author Phillip Webb
* @see CentralDirectoryVistor
* @see CentralDirectoryVis
i
tor
*/
*/
class
CentralDirectoryParser
{
class
CentralDirectoryParser
{
private
int
CENTRAL_DIRECTORY_HEADER_BASE_SIZE
=
46
;
private
int
CENTRAL_DIRECTORY_HEADER_BASE_SIZE
=
46
;
private
final
List
<
CentralDirectoryVis
tor
>
vistors
=
new
ArrayList
<
CentralDirectoryVis
tor
>();
private
final
List
<
CentralDirectoryVis
itor
>
visitors
=
new
ArrayList
<
CentralDirectoryVisi
tor
>();
public
<
T
extends
CentralDirectoryVis
tor
>
T
addVistor
(
T
vis
tor
)
{
public
<
T
extends
CentralDirectoryVis
itor
>
T
addVisitor
(
T
visi
tor
)
{
this
.
vis
tors
.
add
(
vis
tor
);
this
.
vis
itors
.
add
(
visi
tor
);
return
vistor
;
return
vis
i
tor
;
}
}
/**
/**
* Parse the source data, triggering {@link CentralDirectoryVis
tor vis
tors}.
* Parse the source data, triggering {@link CentralDirectoryVis
itor visi
tors}.
* @param data the source data
* @param data the source data
* @param skipPrefixBytes if prefix bytes should be skipped
* @param skipPrefixBytes if prefix bytes should be skipped
* @return The actual archive data without any prefix bytes
* @return The actual archive data without any prefix bytes
...
@@ -87,20 +87,20 @@ class CentralDirectoryParser {
...
@@ -87,20 +87,20 @@ class CentralDirectoryParser {
private
void
visitStart
(
CentralDirectoryEndRecord
endRecord
,
private
void
visitStart
(
CentralDirectoryEndRecord
endRecord
,
RandomAccessData
centralDirectoryData
)
{
RandomAccessData
centralDirectoryData
)
{
for
(
CentralDirectoryVis
tor
vistor
:
this
.
vis
tors
)
{
for
(
CentralDirectoryVis
itor
visitor
:
this
.
visi
tors
)
{
vistor
.
visitStart
(
endRecord
,
centralDirectoryData
);
vis
i
tor
.
visitStart
(
endRecord
,
centralDirectoryData
);
}
}
}
}
private
void
visitFileHeader
(
int
dataOffset
,
CentralDirectoryFileHeader
fileHeader
)
{
private
void
visitFileHeader
(
int
dataOffset
,
CentralDirectoryFileHeader
fileHeader
)
{
for
(
CentralDirectoryVis
tor
vistor
:
this
.
vis
tors
)
{
for
(
CentralDirectoryVis
itor
visitor
:
this
.
visi
tors
)
{
vistor
.
visitFileHeader
(
fileHeader
,
dataOffset
);
vis
i
tor
.
visitFileHeader
(
fileHeader
,
dataOffset
);
}
}
}
}
private
void
visitEnd
()
{
private
void
visitEnd
()
{
for
(
CentralDirectoryVis
tor
vistor
:
this
.
vis
tors
)
{
for
(
CentralDirectoryVis
itor
visitor
:
this
.
visi
tors
)
{
vistor
.
visitEnd
();
vis
i
tor
.
visitEnd
();
}
}
}
}
...
...
spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/CentralDirectoryVistor.java
→
spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/CentralDirectoryVis
i
tor.java
View file @
46540de6
...
@@ -19,11 +19,11 @@ package org.springframework.boot.loader.jar;
...
@@ -19,11 +19,11 @@ package org.springframework.boot.loader.jar;
import
org.springframework.boot.loader.data.RandomAccessData
;
import
org.springframework.boot.loader.data.RandomAccessData
;
/**
/**
* Callback vistor triggered by {@link CentralDirectoryParser}.
* Callback vis
i
tor triggered by {@link CentralDirectoryParser}.
*
*
* @author Phillip Webb
* @author Phillip Webb
*/
*/
interface
CentralDirectoryVistor
{
interface
CentralDirectoryVis
i
tor
{
void
visitStart
(
CentralDirectoryEndRecord
endRecord
,
void
visitStart
(
CentralDirectoryEndRecord
endRecord
,
RandomAccessData
centralDirectoryData
);
RandomAccessData
centralDirectoryData
);
...
...
spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/FileHeader.java
View file @
46540de6
...
@@ -36,7 +36,7 @@ interface FileHeader {
...
@@ -36,7 +36,7 @@ interface FileHeader {
boolean
hasName
(
String
name
,
String
suffix
);
boolean
hasName
(
String
name
,
String
suffix
);
/**
/**
* Return the offset of the load file header within
g
the archive data.
* Return the offset of the load file header within the archive data.
* @return the local header offset
* @return the local header offset
*/
*/
long
getLocalHeaderOffset
();
long
getLocalHeaderOffset
();
...
...
spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFile.java
View file @
46540de6
...
@@ -109,13 +109,13 @@ public class JarFile extends java.util.jar.JarFile {
...
@@ -109,13 +109,13 @@ public class JarFile extends java.util.jar.JarFile {
this
.
rootFile
=
rootFile
;
this
.
rootFile
=
rootFile
;
this
.
pathFromRoot
=
pathFromRoot
;
this
.
pathFromRoot
=
pathFromRoot
;
CentralDirectoryParser
parser
=
new
CentralDirectoryParser
();
CentralDirectoryParser
parser
=
new
CentralDirectoryParser
();
this
.
entries
=
parser
.
addVistor
(
new
JarFileEntries
(
this
,
filter
));
this
.
entries
=
parser
.
addVis
i
tor
(
new
JarFileEntries
(
this
,
filter
));
parser
.
addVis
tor
(
centralDirectoryVis
tor
());
parser
.
addVis
itor
(
centralDirectoryVisi
tor
());
this
.
data
=
parser
.
parse
(
data
,
filter
==
null
);
this
.
data
=
parser
.
parse
(
data
,
filter
==
null
);
}
}
private
CentralDirectoryVis
tor
centralDirectoryVis
tor
()
{
private
CentralDirectoryVis
itor
centralDirectoryVisi
tor
()
{
return
new
CentralDirectoryVistor
()
{
return
new
CentralDirectoryVis
i
tor
()
{
@Override
@Override
public
void
visitStart
(
CentralDirectoryEndRecord
endRecord
,
public
void
visitStart
(
CentralDirectoryEndRecord
endRecord
,
...
...
spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFileEntries.java
View file @
46540de6
...
@@ -42,7 +42,7 @@ import org.springframework.boot.loader.data.RandomAccessData.ResourceAccess;
...
@@ -42,7 +42,7 @@ import org.springframework.boot.loader.data.RandomAccessData.ResourceAccess;
*
*
* @author Phillip Webb
* @author Phillip Webb
*/
*/
class
JarFileEntries
implements
CentralDirectoryVistor
,
Iterable
<
JarEntry
>
{
class
JarFileEntries
implements
CentralDirectoryVis
i
tor
,
Iterable
<
JarEntry
>
{
private
static
final
long
LOCAL_FILE_HEADER_SIZE
=
30
;
private
static
final
long
LOCAL_FILE_HEADER_SIZE
=
30
;
...
...
spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jar/CentralDirectoryParserTests.java
View file @
46540de6
...
@@ -61,24 +61,24 @@ public class CentralDirectoryParserTests {
...
@@ -61,24 +61,24 @@ public class CentralDirectoryParserTests {
}
}
@Test
@Test
public
void
vistsInOrder
()
throws
Exception
{
public
void
vis
i
tsInOrder
()
throws
Exception
{
CentralDirectoryVis
tor
vistor
=
mock
(
CentralDirectoryVis
tor
.
class
);
CentralDirectoryVis
itor
visitor
=
mock
(
CentralDirectoryVisi
tor
.
class
);
CentralDirectoryParser
parser
=
new
CentralDirectoryParser
();
CentralDirectoryParser
parser
=
new
CentralDirectoryParser
();
parser
.
addVis
tor
(
vis
tor
);
parser
.
addVis
itor
(
visi
tor
);
parser
.
parse
(
this
.
jarData
,
false
);
parser
.
parse
(
this
.
jarData
,
false
);
InOrder
ordered
=
inOrder
(
vistor
);
InOrder
ordered
=
inOrder
(
vis
i
tor
);
ordered
.
verify
(
vistor
).
visitStart
(
any
(
CentralDirectoryEndRecord
.
class
),
ordered
.
verify
(
vis
i
tor
).
visitStart
(
any
(
CentralDirectoryEndRecord
.
class
),
any
(
RandomAccessData
.
class
));
any
(
RandomAccessData
.
class
));
ordered
.
verify
(
vistor
,
atLeastOnce
())
ordered
.
verify
(
vis
i
tor
,
atLeastOnce
())
.
visitFileHeader
(
any
(
CentralDirectoryFileHeader
.
class
),
anyInt
());
.
visitFileHeader
(
any
(
CentralDirectoryFileHeader
.
class
),
anyInt
());
ordered
.
verify
(
vistor
).
visitEnd
();
ordered
.
verify
(
vis
i
tor
).
visitEnd
();
}
}
@Test
@Test
public
void
vistRecords
()
throws
Exception
{
public
void
vis
i
tRecords
()
throws
Exception
{
Collector
collector
=
new
Collector
();
Collector
collector
=
new
Collector
();
CentralDirectoryParser
parser
=
new
CentralDirectoryParser
();
CentralDirectoryParser
parser
=
new
CentralDirectoryParser
();
parser
.
addVistor
(
collector
);
parser
.
addVis
i
tor
(
collector
);
parser
.
parse
(
this
.
jarData
,
false
);
parser
.
parse
(
this
.
jarData
,
false
);
Iterator
<
CentralDirectoryFileHeader
>
headers
=
collector
.
getHeaders
().
iterator
();
Iterator
<
CentralDirectoryFileHeader
>
headers
=
collector
.
getHeaders
().
iterator
();
assertThat
(
headers
.
next
().
getName
().
toString
(),
equalTo
(
"META-INF/"
));
assertThat
(
headers
.
next
().
getName
().
toString
(),
equalTo
(
"META-INF/"
));
...
@@ -94,7 +94,7 @@ public class CentralDirectoryParserTests {
...
@@ -94,7 +94,7 @@ public class CentralDirectoryParserTests {
assertThat
(
headers
.
hasNext
(),
equalTo
(
false
));
assertThat
(
headers
.
hasNext
(),
equalTo
(
false
));
}
}
private
static
class
Collector
implements
CentralDirectoryVistor
{
private
static
class
Collector
implements
CentralDirectoryVis
i
tor
{
private
List
<
CentralDirectoryFileHeader
>
headers
=
new
ArrayList
<
CentralDirectoryFileHeader
>();
private
List
<
CentralDirectoryFileHeader
>
headers
=
new
ArrayList
<
CentralDirectoryFileHeader
>();
...
...
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