Skip to content

Commit

Permalink
#659:fixed tests according to new rule
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuchyn committed Feb 20, 2016
1 parent b6059f3 commit 9302a52
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,13 @@
* @since 1.0
*/
public final class Sample {
/**
* Utility constructor.
*/
private Sample() {
// do nothing
}

/**
* Test method.
* @return Stream.
* @checkstyle NonStaticMethod (2 lines)
*/
public static InputStream test() {
public InputStream test() {
return IOUtils.toInputStream("oops");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,13 @@
* @since 1.0
*/
public final class Sample {
/**
* Utility constructor.
*/
private Sample() {
// do nothing
}

/**
* Test method.
* @return Stream.
* @checkstyle NonStaticMethod (2 lines)
*/
public static InputStream test() {
public InputStream test() {
return IOUtils.toInputStream("oops");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,13 @@
* @since 1.0
*/
public final class Sample {
/**
* Utility constructor.
*/
private Sample() {
// do nothing
}

/**
* Test method.
* @return Stream.
* @checkstyle NonStaticMethod (2 lines)
*/
public static String test() {
public String test() {
return "oops";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
* @version $Id$
* @since 1.0
*/
@SuppressWarnings("PMD.ProhibitPublicStaticMethods")
public final class Main {
/**
* Utility constructor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,53 +41,50 @@ public final class Violations {
*/
private Integer var;

/**
* Utility constructor.
*/
private Violations() {
// do nothing
}

/**
* Calculate square of a number.
* @param num The number
* @return The square
* @checkstyle NonStaticMethod (2 lines)
*/
public static int square(final int num) {
public int square(final int num) {
return num * num;
}

/**
* Returns Foo.
* @return Foo.
* @checkstyle NonStaticMethod (2 lines)
*/
public static Foo doSmth() {
public Foo doSmth() {
final String name = "test".toUpperCase();
return new Foo(name);
}

/**
* Returns Foo again.
* @return Foo.
* @checkstyle NonStaticMethod (2 lines)
*/
public static Foo doSmthElse() {
public Foo doSmthElse() {
String name = "other";
name = String.format("%s append", name);
return new Foo(name);
}

/**
* Prints something.
* @checkstyle NonStaticMethod (2 lines)
*/
public static void print() {
public void print() {
final String message = "hello";
System.out.println(message);
}

/**
* Test class.
*/
private static final class Foo {
private final class Foo {
/**
* Name.
*/
Expand Down

0 comments on commit 9302a52

Please sign in to comment.