Skip to content

Commit

Permalink
fix some typos
Browse files Browse the repository at this point in the history
  • Loading branch information
PascalSchumacher committed Jan 21, 2017
1 parent d148c02 commit 38df1e6
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 33 deletions.
Expand Up @@ -1223,7 +1223,7 @@ public SELF usingFieldByFieldElementComparator() {
* assertion checks. This can be useful if actual's {@code equals} implementation does not suit you.
* <p>
* The recursive property/field comparison is <b>not</b> applied on fields having a custom {@code equals}
* implementation, i.e. the overriden {@code equals} method will be used instead of a field/property by field/property
* implementation, i.e. the overridden {@code equals} method will be used instead of a field/property by field/property
* comparison.
* <p>
* The recursive comparison handles cycles.
Expand Down
Expand Up @@ -1290,7 +1290,7 @@ public S usingFieldByFieldElementComparator() {
* assertion checks. This can be useful if actual's {@code equals} implementation does not suit you.
* <p>
* The recursive property/field comparison is <b>not</b> applied on fields having a custom {@code equals}
* implementation, i.e. the overriden {@code equals} method will be used instead of a field/property by field/property comparison.
* implementation, i.e. the overridden {@code equals} method will be used instead of a field/property by field/property comparison.
* <p>
* You can specify a custom comparator per (nested) name or type of element field with
* {@link #usingComparatorForElementFieldsWithNames(Comparator, String...) usingComparatorForElementFieldsWithNames}
Expand Down
Expand Up @@ -1403,7 +1403,7 @@ public AtomicReferenceArrayAssert<T> usingFieldByFieldElementComparator() {
* assertion checks. This can be useful if actual's {@code equals} implementation does not suit you.
* <p>
* The recursive property/field comparison is <b>not</b> applied on fields having a custom {@code equals}
* implementation, i.e. the overriden {@code equals} method will be used instead of a field/property by field/property comparison.
* implementation, i.e. the overridden {@code equals} method will be used instead of a field/property by field/property comparison.
* <p>
* You can specify a custom comparator per (nested) name or type of element field with
* {@link #usingComparatorForElementFieldsWithNames(Comparator, String...) usingComparatorForElementFieldsWithNames}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/assertj/core/internal/Arrays.java
Expand Up @@ -316,14 +316,14 @@ void assertContainsSubsequence(AssertionInfo info, Failures failures, Object act
int sizeOfSubsequence = sizeOf(subsequence);
// look for given subsequence, stop check when there is not enough elements remaining in actual to contain
// subsequence
int lastIndexWhereEndOfSubsequeceCanBeFound = sizeOfActual - sizeOfSubsequence;
int lastIndexWhereEndOfSubsequenceCanBeFound = sizeOfActual - sizeOfSubsequence;

int actualIndex = 0;
int subsequenceIndex = 0;
while (actualIndex <= lastIndexWhereEndOfSubsequeceCanBeFound && subsequenceIndex < sizeOfSubsequence) {
while (actualIndex <= lastIndexWhereEndOfSubsequenceCanBeFound && subsequenceIndex < sizeOfSubsequence) {
if (areEqual(Array.get(actual, actualIndex), Array.get(subsequence, subsequenceIndex))) {
subsequenceIndex++;
lastIndexWhereEndOfSubsequeceCanBeFound++;
lastIndexWhereEndOfSubsequenceCanBeFound++;
}
actualIndex++;
}
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/org/assertj/core/internal/Strings.java
Expand Up @@ -475,10 +475,10 @@ private String removeAllWhitespaces(CharSequence toBeStripped) {
public void assertContainsOnlyOnce(AssertionInfo info, CharSequence actual, CharSequence sequence) {
checkCharSequenceIsNotNull(sequence);
assertNotNull(info, actual);
int sequenceOccurencesInActual = countOccurences(sequence, actual);
if (sequenceOccurencesInActual == 1) return;
int sequenceOccurrencesInActual = countOccurrences(sequence, actual);
if (sequenceOccurrencesInActual == 1) return;
throw failures.failure(info,
shouldContainOnlyOnce(actual, sequence, sequenceOccurencesInActual, comparisonStrategy));
shouldContainOnlyOnce(actual, sequence, sequenceOccurrencesInActual, comparisonStrategy));
}

/**
Expand All @@ -488,16 +488,16 @@ public void assertContainsOnlyOnce(AssertionInfo info, CharSequence actual, Char
* @param actual the {@link CharSequence} to search occurrences in.
* @return the number of occurrences of sequenceToSearch in actual {@link CharSequence}.
*/
private int countOccurences(CharSequence sequenceToSearch, CharSequence actual) {
private int countOccurrences(CharSequence sequenceToSearch, CharSequence actual) {
String strToSearch = sequenceToSearch.toString();
String strActual = actual.toString();
int occurences = 0;
int occurrences = 0;
for (int i = 0; i <= (strActual.length() - strToSearch.length()); i++) {
if (comparisonStrategy.areEqual(strActual.substring(i, i + sequenceToSearch.length()), strToSearch)) {
occurences++;
occurrences++;
}
}
return occurences;
return occurrences;
}

/**
Expand Down
Expand Up @@ -26,18 +26,18 @@

public class ShouldContainsStringOnlyOnce_create_Test {

private ErrorMessageFactory factoryWithSeveralOccurences;
private ErrorMessageFactory factoryWithSeveralOccurrences;
private ErrorMessageFactory factoryWithNoOccurence;

@Before
public void setUp() {
factoryWithSeveralOccurences = shouldContainOnlyOnce("aaamotifmotifaabbbmotifaaa", "motif", 3);
factoryWithSeveralOccurrences = shouldContainOnlyOnce("aaamotifmotifaabbbmotifaaa", "motif", 3);
factoryWithNoOccurence = shouldContainOnlyOnce("aaamodifmoifaabbbmotfaaa", "motif", 0);
}

@Test
public void should_create_error_message_when_string_to_search_appears_several_times() {
String message = factoryWithSeveralOccurences.create(new TestDescription("Test"), new StandardRepresentation());
String message = factoryWithSeveralOccurrences.create(new TestDescription("Test"), new StandardRepresentation());
assertThat(message).isEqualTo(String.format(
"[Test] %nExpecting:%n <\"motif\">%nto appear only once in:%n <\"aaamotifmotifaabbbmotifaaa\">%nbut it appeared 3 times "
));
Expand Down
Expand Up @@ -84,9 +84,9 @@ public void should_fallback_to_field_if_exception_has_been_thrown_on_property_ac

@Test
public void should_prefer_properties_over_fields() {
Object extractedValue = nameExtractor().extract(new EmployeeWithOverridenName("Overriden Name"));
Object extractedValue = nameExtractor().extract(new EmployeeWithOverriddenName("Overridden Name"));

assertThat(extractedValue).isEqualTo(new Name("Overriden Name"));
assertThat(extractedValue).isEqualTo(new Name("Overridden Name"));
}

@Test
Expand Down Expand Up @@ -148,18 +148,18 @@ public Name getName() {
}
}

public static class EmployeeWithOverridenName extends Employee {
public static class EmployeeWithOverriddenName extends Employee {

private String overridenName;
private String overriddenName;

public EmployeeWithOverridenName(final String overridenName) {
public EmployeeWithOverriddenName(final String overriddenName) {
super(1L, new Name("Name"), 0);
this.overridenName = overridenName;
this.overriddenName = overriddenName;
}

@Override
public Name getName() {
return new Name(overridenName);
return new Name(overriddenName);
}
}

Expand Down
Expand Up @@ -119,7 +119,7 @@ public void should_fallback_to_field_if_exception_has_been_thrown_on_property_ac
@Test
public void should_prefer_properties_over_fields() {

List<Employee> employees = Arrays.<Employee>asList(new EmployeeWithOverridenName("Overridden Name"));
List<Employee> employees = Arrays.<Employee>asList(new EmployeeWithOverriddenName("Overridden Name"));
List<Object> extractedValues = extract(employees, byName("name"));
assertThat(extractedValues).containsOnly(new Name("Overridden Name"));
}
Expand All @@ -145,18 +145,18 @@ public Name getName() {
}
}

public static class EmployeeWithOverridenName extends Employee {
public static class EmployeeWithOverriddenName extends Employee {

private String overridenName;
private String overriddenName;

public EmployeeWithOverridenName(final String overridenName) {
public EmployeeWithOverriddenName(final String overriddenName) {
super(1L, new Name("Name"), 0);
this.overridenName = overridenName;
this.overriddenName = overriddenName;
}

@Override
public Name getName() {
return new Name(overridenName);
return new Name(overriddenName);
}
}

Expand Down
Expand Up @@ -54,9 +54,9 @@ public void should_extract_property_with_no_corresponding_field() {

@Test
public void should_prefer_properties_over_fields() {
Object extractedValue = propertyOrFieldSupport.getValueOf("name", employeeWithOverridenName("Overriden Name"));
Object extractedValue = propertyOrFieldSupport.getValueOf("name", employeeWithOverriddenName("Overridden Name"));

assertThat(extractedValue).isEqualTo(new Name("Overriden Name"));
assertThat(extractedValue).isEqualTo(new Name("Overridden Name"));
}

@Test
Expand Down Expand Up @@ -170,11 +170,11 @@ public Name getName() {
};
}

private Employee employeeWithOverridenName(final String overridenName) {
private Employee employeeWithOverriddenName(final String overriddenName) {
return new Employee(1L, new Name("Name"), 0) {
@Override
public Name getName() {
return new Name(overridenName);
return new Name(overriddenName);
}
};
}
Expand Down

0 comments on commit 38df1e6

Please sign in to comment.