Skip to content

Commit

Permalink
Enforced indentation style of 2 spaces (with further details matching…
Browse files Browse the repository at this point in the history
… Google's CheckStyle specs).

Formatted existing .java code to match.

See #295
  • Loading branch information
brownian-motion committed Apr 20, 2020
1 parent 5dd6a62 commit 2ab54c7
Show file tree
Hide file tree
Showing 157 changed files with 7,055 additions and 6,722 deletions.
13 changes: 13 additions & 0 deletions checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,17 @@
<!-- Report on each line in each file -->
<property name="eachLine" value="true"/>
</module>


<module name="TreeWalker">
<!-- Checks that the indentation style in this project is uniformly "2 spaces". -->
<module name="Indentation">
<property name="basicOffset" value="2"/>
<property name="braceAdjustment" value="0"/>
<property name="caseIndent" value="2"/>
<property name="throwsIndent" value="4"/>
<property name="lineWrappingIndentation" value="4"/>
<property name="arrayInitIndent" value="2"/>
</module>
</module>
</module>
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
*/
public class EasyMock2Matchers {

public static String equalTo(String string) {
EasyMock2Adapter.adapt(IsEqual.equalTo(string));
return null;
}
public static String equalTo(String string) {
EasyMock2Adapter.adapt(IsEqual.equalTo(string));
return null;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

public class JMock1Matchers {

public static Constraint equalTo(String string) {
return JMock1Adapter.adapt(IsEqual.equalTo(string));
}
public static Constraint equalTo(String string) {
return JMock1Adapter.adapt(IsEqual.equalTo(string));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@
* @author Neil Dunn
*/
public class JavaLangMatcherAssert {
private JavaLangMatcherAssert() {};
private JavaLangMatcherAssert() {
}

public static <T> boolean that(T argument, Matcher<? super T> matcher) {
return matcher.matches(argument);
}
;

public static <T> boolean that(T argument, Matcher<? super T> matcher) {
return matcher.matches(argument);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,31 @@
*/
public class EasyMock2Adapter implements IArgumentMatcher {

/**
* Convenience factory method that will adapt a
* Hamcrest {@link org.hamcrest.Matcher} to act as an
* EasyMock {@link org.easymock.IArgumentMatcher} and
* report it to EasyMock so it can be kept track of.
*/
public static IArgumentMatcher adapt(Matcher<?> matcher) {
EasyMock2Adapter easyMock2Matcher = new EasyMock2Adapter(matcher);
EasyMock.reportMatcher(easyMock2Matcher);
return easyMock2Matcher;
}
/**
* Convenience factory method that will adapt a
* Hamcrest {@link org.hamcrest.Matcher} to act as an
* EasyMock {@link org.easymock.IArgumentMatcher} and
* report it to EasyMock so it can be kept track of.
*/
public static IArgumentMatcher adapt(Matcher<?> matcher) {
EasyMock2Adapter easyMock2Matcher = new EasyMock2Adapter(matcher);
EasyMock.reportMatcher(easyMock2Matcher);
return easyMock2Matcher;
}

private final Matcher<?> hamcrestMatcher;
private final Matcher<?> hamcrestMatcher;

public EasyMock2Adapter(Matcher<?> matcher) {
this.hamcrestMatcher = matcher;
}
public EasyMock2Adapter(Matcher<?> matcher) {
this.hamcrestMatcher = matcher;
}

@Override
public boolean matches(Object argument) {
return hamcrestMatcher.matches(argument);
}
@Override
public boolean matches(Object argument) {
return hamcrestMatcher.matches(argument);
}

@Override
public void appendTo(StringBuffer buffer) {
hamcrestMatcher.describeTo(new StringDescription(buffer));
}
@Override
public void appendTo(StringBuffer buffer) {
hamcrestMatcher.describeTo(new StringDescription(buffer));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,29 @@
*/
public class JMock1Adapter implements Constraint {

/**
* Convenience factory method that will adapt a
* Hamcrest {@link org.hamcrest.Matcher} to act as an
* jMock {@link org.jmock.core.Constraint}.
*/
public static Constraint adapt(Matcher<?> matcher) {
return new JMock1Adapter(matcher);
}
/**
* Convenience factory method that will adapt a
* Hamcrest {@link org.hamcrest.Matcher} to act as an
* jMock {@link org.jmock.core.Constraint}.
*/
public static Constraint adapt(Matcher<?> matcher) {
return new JMock1Adapter(matcher);
}

private final Matcher<?> hamcrestMatcher;
private final Matcher<?> hamcrestMatcher;

public JMock1Adapter(Matcher<?> matcher) {
this.hamcrestMatcher = matcher;
}
public JMock1Adapter(Matcher<?> matcher) {
this.hamcrestMatcher = matcher;
}

@Override
public boolean eval(Object o) {
return hamcrestMatcher.matches(o);
}
@Override
public boolean eval(Object o) {
return hamcrestMatcher.matches(o);
}

@Override
public StringBuffer describeTo(StringBuffer buffer) {
hamcrestMatcher.describeTo(new StringDescription(buffer));
return buffer;
}
@Override
public StringBuffer describeTo(StringBuffer buffer) {
hamcrestMatcher.describeTo(new StringDescription(buffer));
return buffer;
}
}
Loading

0 comments on commit 2ab54c7

Please sign in to comment.