[Japi-cvs] SF.net SVN: japi:[755] historic/trunk/src
Status: Beta
Brought to you by:
christianhujer
|
From: <chr...@us...> - 2008-12-28 23:30:08
|
Revision: 755
http://japi.svn.sourceforge.net/japi/?rev=755&view=rev
Author: christianhujer
Date: 2008-12-28 23:30:05 +0000 (Sun, 28 Dec 2008)
Log Message:
-----------
Added missing braces to control flow statements.
Modified Paths:
--------------
historic/trunk/src/app/net/sf/japi/finance/SimpleCapitalCalculator.java
historic/trunk/src/doc/guide/io/src/SortPlain.java
Modified: historic/trunk/src/app/net/sf/japi/finance/SimpleCapitalCalculator.java
===================================================================
--- historic/trunk/src/app/net/sf/japi/finance/SimpleCapitalCalculator.java 2008-12-28 23:28:23 UTC (rev 754)
+++ historic/trunk/src/app/net/sf/japi/finance/SimpleCapitalCalculator.java 2008-12-28 23:30:05 UTC (rev 755)
@@ -42,9 +42,12 @@
* @return the overall capital after numberOfPeriods periods
*/
public double calculateCapital( int numberOfPeriods ) {
- if ( numberOfPeriods < 0 ) throw new IllegalArgumentException("Number of periods has to be at least 0!");
- if ( numberOfPeriods == 0 )
+ if ( numberOfPeriods < 0 ) {
+ throw new IllegalArgumentException("Number of periods has to be at least 0!");
+ }
+ if ( numberOfPeriods == 0 ) {
return initialCapital;
+ }
currentCapital = numberOfPeriods == 1 ? initialCapital * (1 + interestRate / 100) : initialCapital * Math.pow((1 + interestRate / 100), numberOfPeriods);
return currentCapital;
}
Modified: historic/trunk/src/doc/guide/io/src/SortPlain.java
===================================================================
--- historic/trunk/src/doc/guide/io/src/SortPlain.java 2008-12-28 23:28:23 UTC (rev 754)
+++ historic/trunk/src/doc/guide/io/src/SortPlain.java 2008-12-28 23:30:05 UTC (rev 755)
@@ -21,7 +21,10 @@
try {
final BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
try {
- for (String line; (line = in.readLine()) != null; lineList.add(line));
+ String line;
+ while ((line = in.readLine()) != null) {
+ lineList.add(line);
+ }
} catch (final IOException e) {
System.err.println(e);
} finally {
@@ -35,7 +38,10 @@
try {
final BufferedReader in = new BufferedReader(new FileReader(arg));
try {
- for (String line; (line = in.readLine()) != null; lineList.add(line));
+ String line;
+ while ((line = in.readLine()) != null) {
+ lineList.add(line);
+ }
} finally {
in.close();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|