Added Spring Java Conventions to all of the spring sub-projects and formatted them to meet the guidelines.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#Tue Jul 31 15:11:23 EDT 2007
|
||||
#Mon Aug 13 12:11:28 EDT 2007
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
|
||||
@@ -76,7 +76,7 @@ org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
|
||||
org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
|
||||
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
|
||||
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
|
||||
org.eclipse.jdt.core.formatter.indentation.size=4
|
||||
org.eclipse.jdt.core.formatter.indentation.size=8
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
|
||||
@@ -256,7 +256,7 @@ org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
|
||||
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
|
||||
org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
|
||||
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
|
||||
org.eclipse.jdt.core.formatter.tabulation.char=mixed
|
||||
org.eclipse.jdt.core.formatter.tabulation.size=8
|
||||
org.eclipse.jdt.core.formatter.tabulation.char=tab
|
||||
org.eclipse.jdt.core.formatter.tabulation.size=4
|
||||
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
|
||||
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
#Tue Jul 31 15:08:39 EDT 2007
|
||||
#Mon Aug 13 12:11:28 EDT 2007
|
||||
eclipse.preferences.version=1
|
||||
editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
|
||||
formatter_profile=_Spring Java Conventions
|
||||
formatter_settings_version=11
|
||||
org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates/>
|
||||
sp_cleanup.add_default_serial_version_id=true
|
||||
sp_cleanup.add_generated_serial_version_id=false
|
||||
sp_cleanup.add_missing_annotations=true
|
||||
|
||||
@@ -20,8 +20,8 @@ import java.util.Calendar;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* Action that encapsulates logic for the number guess sample flow. Note that
|
||||
* this is a stateful action: it holds modifiable state in instance members!
|
||||
* Action that encapsulates logic for the number guess sample flow. Note that this is a stateful action: it holds
|
||||
* modifiable state in instance members!
|
||||
*
|
||||
* @author Erwin Vervaet
|
||||
* @author Keith Donald
|
||||
@@ -63,16 +63,13 @@ public class HigherLowerGame implements Serializable {
|
||||
public GuessResult makeGuess(int guess) {
|
||||
if (guess < 0 || guess > 100) {
|
||||
setResult(GuessResult.INVALID);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
guesses++;
|
||||
if (answer < guess) {
|
||||
setResult(GuessResult.TOO_HIGH);
|
||||
}
|
||||
else if (answer > guess) {
|
||||
} else if (answer > guess) {
|
||||
setResult(GuessResult.TOO_LOW);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
setResult(GuessResult.CORRECT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,8 +51,7 @@ public class MastermindGame implements Serializable {
|
||||
public GuessResult makeGuess(String guess) {
|
||||
if (isGuessValid(guess)) {
|
||||
setResult(calculateResult(guess));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
setResult(GuessResult.INVALID);
|
||||
}
|
||||
return getResult();
|
||||
@@ -86,8 +85,7 @@ public class MastermindGame implements Serializable {
|
||||
if (digit == answerDigit) {
|
||||
if (i == j) {
|
||||
rightPosition++;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
correctButWrongPosition++;
|
||||
}
|
||||
break;
|
||||
@@ -97,8 +95,7 @@ public class MastermindGame implements Serializable {
|
||||
data.recordGuessData(guess, rightPosition, correctButWrongPosition);
|
||||
if (rightPosition == 4) {
|
||||
return GuessResult.CORRECT;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return GuessResult.WRONG;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,11 +23,11 @@ import org.springframework.webflow.samples.numberguess.MastermindGame.GuessResul
|
||||
public class MastermindGameTests extends TestCase {
|
||||
|
||||
private MastermindGame action = new MastermindGame();
|
||||
|
||||
|
||||
protected void setUp() {
|
||||
action = new MastermindGame();
|
||||
}
|
||||
|
||||
|
||||
public void testGuessNoInputProvided() throws Exception {
|
||||
GuessResult result = action.makeGuess(null);
|
||||
assertEquals(GuessResult.INVALID, result);
|
||||
|
||||
Reference in New Issue
Block a user