a.b.c.b.bar();
b.c.a.foo();
}
-
+
private void emptyMethod() {
// Keep empty
}
-
+
private boolean searchableMethod() {
A a = new A();
B b = new B();
b.c.crap();
return true;
}
-
+
protected abstract void iAmAbstract();
/*
private void iAmPrefixedWithAMultilineComment() {
return;
}
-
+
// A single line comment. (Leave this above a method with Javadoc attached!)
-
+
/**
* This is Javadoc.
*/
private void iHaveJavadocAttachedButThereIsAlsoASingleLineCommentAboveMe() {
return;
}
-
+
private void iAmAnOverloadedMethod(DuplicateType type) {
return;
}
private void iAmAnOverloadedMethod(A.DuplicateType type) {
return;
}
-
+
private void iHaveATooSimpleBodyToBeConsidered() {
b.bar();
}
+
+ private String iHaveAConditionalWithAReturnStatement() {
+ // Do not touch me
+ if ("A".equals("B"))
+ return b.c.moreCrap();
+ return "NO";
+ }
+
+ private String iHaveAConditionalWithAnElseAndAllBranchesEndInReturn() {
+ // Do not touch me
+ try {
+ if ("A".equals("B"))
+ return b.c.moreCrap();
+ else
+ return b.c.crap();
+ } catch (Exception e) {
+ System.err.println("finally!");
+ }
+ return "test";
+ }
+
+ private String iHaveAConditionalWithAnElseAndNotAllBranchesEndInReturn() {
+ // Do not touch me
+ if ("A".equals("B"))
+ return b.c.moreCrap();
+ else
+ System.out.println("crap");
+ return "NO";
+ }
+
+ private String iHaveAComplexConditionalWithAnElseAndAllBranchesEndInReturn() {
+ // Do not touch me
+ try {
+ if ("A".equals("B")) {
+ return b.c.moreCrap();
+ } else {
+ if ("C".equals("D")) {
+ return b.c.moreCrap();
+ } else if ("A".equals("A")) {
+ return b.c.moreCrap();
+ } else {
+ return b.c.crap();
+ }
+ }
+ } catch (Exception e) {
+ System.err.println("finally!");
+ }
+ return "test";
+ }
+
+ private String iHaveAComplexConditionalWithAnElseAndNotAllBranchesEndInReturn() {
+ // Do not touch me
+ if ("A".equals("B")) {
+ if ("C".equals("D")) {
+ return b.c.moreCrap();
+ } else if ("A".equals("A")) {
+ return b.c.moreCrap();
+ }
+ } else {
+ return b.c.moreCrap();
+ }
+ return "NO";
+ }
+
+ private String iHaveReturnInsideWhile() {
+ // Do not touch me
+ boolean bool = true;
+ while(bool) {
+ if (bool)
+ bool = false;
+ return b.c.moreCrap();
+ }
+ return b.c.moreCrap();
+ }
+
+ private String iHaveReturnInsideFor() {
+ // Do not touch me
+ for(int i = 0; i < 3; i++) {
+ if (i == 1)
+ return b.c.moreCrap();
+ }
+ return b.c.moreCrap();
+ }
+
+ private String iHaveReturnInsideCatch() {
+ // Do not touch me
+ try {
+ System.out.print("test");
+ } catch (Exception e) {
+ return b.c.moreCrap();
+ }
+ return b.c.moreCrap();
+ }
}
\ No newline at end of file