diff options
author | fmoga <fmoga@13f79535-47bb-0310-9956-ffa450edef68> | 2010-08-24 13:08:55 +0000 |
---|---|---|
committer | fmoga <fmoga@13f79535-47bb-0310-9956-ffa450edef68> | 2010-08-24 13:08:55 +0000 |
commit | 61ed6b103cdea7af530950851857643a0b3efd45 (patch) | |
tree | e712ad12fd50e5194fada5be200b6c7345dfff92 /sca-java-2.x/contrib/samples | |
parent | d1f056a0126252f101d108ad2952ac0eebb78cb0 (diff) |
Enforced coding standards and formatting.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@988521 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/contrib/samples')
6 files changed, 21 insertions, 18 deletions
diff --git a/sca-java-2.x/contrib/samples/comet-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/Helper.java b/sca-java-2.x/contrib/samples/comet-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/Helper.java index 4a26f3720d..eecc6044ea 100644 --- a/sca-java-2.x/contrib/samples/comet-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/Helper.java +++ b/sca-java-2.x/contrib/samples/comet-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/Helper.java @@ -22,10 +22,13 @@ package org.apache.tuscany.sca.sample.comet; import java.util.Date; import java.util.Random; -public class Helper { +public final class Helper { - public static int randomInt(int max) { + public static int randomInt(final int max) { return (new Random(new Date().getTime()).nextInt(100)); } + private Helper() { + } + } diff --git a/sca-java-2.x/contrib/samples/comet-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/PrecipitationService.java b/sca-java-2.x/contrib/samples/comet-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/PrecipitationService.java index f31b6a79df..afbdcbc8d7 100644 --- a/sca-java-2.x/contrib/samples/comet-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/PrecipitationService.java +++ b/sca-java-2.x/contrib/samples/comet-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/PrecipitationService.java @@ -27,5 +27,5 @@ import org.oasisopen.sca.annotation.Remotable; public interface PrecipitationService { Response getPrecipitation(Location location); - + } diff --git a/sca-java-2.x/contrib/samples/comet-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/PrecipitationServiceImpl.java b/sca-java-2.x/contrib/samples/comet-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/PrecipitationServiceImpl.java index dca144ad84..4278ef975b 100644 --- a/sca-java-2.x/contrib/samples/comet-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/PrecipitationServiceImpl.java +++ b/sca-java-2.x/contrib/samples/comet-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/PrecipitationServiceImpl.java @@ -29,8 +29,8 @@ import org.oasisopen.sca.annotation.Service; public class PrecipitationServiceImpl implements PrecipitationService { @Override - public Response getPrecipitation(Location location) { - Response response = new Response(); + public Response getPrecipitation(final Location location) { + final Response response = new Response(); response.setDate(new Date()); response.setData(Helper.randomInt(100) + "%"); return response; diff --git a/sca-java-2.x/contrib/samples/comet-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/TemperatureHumidityServiceImpl.java b/sca-java-2.x/contrib/samples/comet-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/TemperatureHumidityServiceImpl.java index 9556c91484..55f935fa9f 100644 --- a/sca-java-2.x/contrib/samples/comet-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/TemperatureHumidityServiceImpl.java +++ b/sca-java-2.x/contrib/samples/comet-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/TemperatureHumidityServiceImpl.java @@ -29,18 +29,18 @@ import org.oasisopen.sca.annotation.Service; public class TemperatureHumidityServiceImpl implements TemperatureService, HumidityService { @Override - public Response getHumidity(Location location) { - Response response = new Response(); + public Response getHumidity(final Location location) { + final Response response = new Response(); response.setDate(new Date()); response.setData(Helper.randomInt(90) + "%"); return response; } @Override - public Response getTemperature(Location location, int scale) { - Response response = new Response(); + public Response getTemperature(final Location location, final int scale) { + final Response response = new Response(); response.setDate(new Date()); - String data = "" + Helper.randomInt(scale == CELSIUS ? 40 : 150); + final String data = "" + Helper.randomInt(scale == TemperatureService.CELSIUS ? 40 : 150); response.setData(data); return response; } diff --git a/sca-java-2.x/contrib/samples/comet-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/model/Location.java b/sca-java-2.x/contrib/samples/comet-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/model/Location.java index da36b3741f..ff2da3a360 100644 --- a/sca-java-2.x/contrib/samples/comet-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/model/Location.java +++ b/sca-java-2.x/contrib/samples/comet-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/model/Location.java @@ -25,18 +25,18 @@ public class Location { private String country; public String getCity() { - return city; + return this.city; } - public void setCity(String city) { + public void setCity(final String city) { this.city = city; } public String getCountry() { - return country; + return this.country; } - public void setCountry(String country) { + public void setCountry(final String country) { this.country = country; } diff --git a/sca-java-2.x/contrib/samples/comet-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/model/Response.java b/sca-java-2.x/contrib/samples/comet-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/model/Response.java index 1a1649101f..aaa23f0b8a 100644 --- a/sca-java-2.x/contrib/samples/comet-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/model/Response.java +++ b/sca-java-2.x/contrib/samples/comet-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/model/Response.java @@ -27,18 +27,18 @@ public class Response { private String data; public Date getDate() { - return date; + return this.date; } - public void setDate(Date date) { + public void setDate(final Date date) { this.date = date; } public String getData() { - return data; + return this.data; } - public void setData(String data) { + public void setData(final String data) { this.data = data; } |