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 c2a42aa
Show file tree
Hide file tree
Showing 160 changed files with 9,169 additions and 7,336 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 @@ -5,5 +5,6 @@
* <code>hamcrest.jar</code>. Please use that dependency instead.
*/
@Deprecated
class HamcrestCoreIsDeprecated {
class HamcrestCoreIsDeprecated
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
import org.hamcrest.core.IsEqual;

/**
*
* @author Joe Walnes
*/
public class EasyMock2Matchers {
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 @@ -4,9 +4,11 @@
import org.hamcrest.core.IsEqual;
import org.jmock.core.Constraint;

public class JMock1Matchers {
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 @@ -9,10 +9,16 @@
*
* @author Neil Dunn
*/
public class JavaLangMatcherAssert {
private JavaLangMatcherAssert() {};
public class 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 @@ -11,33 +11,38 @@
*
* @author Joe Walnes
*/
public class EasyMock2Adapter implements IArgumentMatcher {
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 @@ -12,31 +12,36 @@
*
* @author Joe Walnes
*/
public class JMock1Adapter implements Constraint {
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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
* <code>hamcrest.jar</code>. Please use that dependency instead.
*/
@Deprecated
class HamcrestLibraryIsDeprecated {
class HamcrestLibraryIsDeprecated
{
}
Loading

0 comments on commit c2a42aa

Please sign in to comment.