Commit 46540de6 authored by Johnny Lim's avatar Johnny Lim Committed by Stephane Nicoll

Fix typos

Closes gh-5067
parent f5edd53d
...@@ -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 runs 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"]
......
...@@ -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.
......
...@@ -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 hashcode // We're compatible with String's hashCode().
return string.hashCode(); return string.hashCode();
} }
......
...@@ -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 CentralDirectoryVisitor
*/ */
class CentralDirectoryParser { class CentralDirectoryParser {
private int CENTRAL_DIRECTORY_HEADER_BASE_SIZE = 46; private int CENTRAL_DIRECTORY_HEADER_BASE_SIZE = 46;
private final List<CentralDirectoryVistor> vistors = new ArrayList<CentralDirectoryVistor>(); private final List<CentralDirectoryVisitor> visitors = new ArrayList<CentralDirectoryVisitor>();
public <T extends CentralDirectoryVistor> T addVistor(T vistor) { public <T extends CentralDirectoryVisitor> T addVisitor(T visitor) {
this.vistors.add(vistor); this.visitors.add(visitor);
return vistor; return visitor;
} }
/** /**
* Parse the source data, triggering {@link CentralDirectoryVistor vistors}. * Parse the source data, triggering {@link CentralDirectoryVisitor visitors}.
* @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 (CentralDirectoryVistor vistor : this.vistors) { for (CentralDirectoryVisitor visitor : this.visitors) {
vistor.visitStart(endRecord, centralDirectoryData); visitor.visitStart(endRecord, centralDirectoryData);
} }
} }
private void visitFileHeader(int dataOffset, CentralDirectoryFileHeader fileHeader) { private void visitFileHeader(int dataOffset, CentralDirectoryFileHeader fileHeader) {
for (CentralDirectoryVistor vistor : this.vistors) { for (CentralDirectoryVisitor visitor : this.visitors) {
vistor.visitFileHeader(fileHeader, dataOffset); visitor.visitFileHeader(fileHeader, dataOffset);
} }
} }
private void visitEnd() { private void visitEnd() {
for (CentralDirectoryVistor vistor : this.vistors) { for (CentralDirectoryVisitor visitor : this.visitors) {
vistor.visitEnd(); visitor.visitEnd();
} }
} }
......
...@@ -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 visitor triggered by {@link CentralDirectoryParser}.
* *
* @author Phillip Webb * @author Phillip Webb
*/ */
interface CentralDirectoryVistor { interface CentralDirectoryVisitor {
void visitStart(CentralDirectoryEndRecord endRecord, void visitStart(CentralDirectoryEndRecord endRecord,
RandomAccessData centralDirectoryData); RandomAccessData centralDirectoryData);
......
...@@ -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 withing 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();
......
...@@ -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.addVisitor(new JarFileEntries(this, filter));
parser.addVistor(centralDirectoryVistor()); parser.addVisitor(centralDirectoryVisitor());
this.data = parser.parse(data, filter == null); this.data = parser.parse(data, filter == null);
} }
private CentralDirectoryVistor centralDirectoryVistor() { private CentralDirectoryVisitor centralDirectoryVisitor() {
return new CentralDirectoryVistor() { return new CentralDirectoryVisitor() {
@Override @Override
public void visitStart(CentralDirectoryEndRecord endRecord, public void visitStart(CentralDirectoryEndRecord endRecord,
......
...@@ -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 CentralDirectoryVisitor, Iterable<JarEntry> {
private static final long LOCAL_FILE_HEADER_SIZE = 30; private static final long LOCAL_FILE_HEADER_SIZE = 30;
......
...@@ -61,24 +61,24 @@ public class CentralDirectoryParserTests { ...@@ -61,24 +61,24 @@ public class CentralDirectoryParserTests {
} }
@Test @Test
public void vistsInOrder() throws Exception { public void visitsInOrder() throws Exception {
CentralDirectoryVistor vistor = mock(CentralDirectoryVistor.class); CentralDirectoryVisitor visitor = mock(CentralDirectoryVisitor.class);
CentralDirectoryParser parser = new CentralDirectoryParser(); CentralDirectoryParser parser = new CentralDirectoryParser();
parser.addVistor(vistor); parser.addVisitor(visitor);
parser.parse(this.jarData, false); parser.parse(this.jarData, false);
InOrder ordered = inOrder(vistor); InOrder ordered = inOrder(visitor);
ordered.verify(vistor).visitStart(any(CentralDirectoryEndRecord.class), ordered.verify(visitor).visitStart(any(CentralDirectoryEndRecord.class),
any(RandomAccessData.class)); any(RandomAccessData.class));
ordered.verify(vistor, atLeastOnce()) ordered.verify(visitor, atLeastOnce())
.visitFileHeader(any(CentralDirectoryFileHeader.class), anyInt()); .visitFileHeader(any(CentralDirectoryFileHeader.class), anyInt());
ordered.verify(vistor).visitEnd(); ordered.verify(visitor).visitEnd();
} }
@Test @Test
public void vistRecords() throws Exception { public void visitRecords() throws Exception {
Collector collector = new Collector(); Collector collector = new Collector();
CentralDirectoryParser parser = new CentralDirectoryParser(); CentralDirectoryParser parser = new CentralDirectoryParser();
parser.addVistor(collector); parser.addVisitor(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 CentralDirectoryVisitor {
private List<CentralDirectoryFileHeader> headers = new ArrayList<CentralDirectoryFileHeader>(); private List<CentralDirectoryFileHeader> headers = new ArrayList<CentralDirectoryFileHeader>();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment