From 5a390791d3049d415d98507be8b8ed29f523ecf0 Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Wed, 10 Mar 2010 09:34:20 +0000 Subject: Minor cleanup, renamed mcache to memcache, added a uuid util function to get consistent and unique uuids across languages. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@921270 13f79535-47bb-0310-9956-ffa450edef68 --- .../trunk/test/store-java/store/ShoppingCartImpl.java | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'sca-cpp/trunk/test/store-java/store/ShoppingCartImpl.java') diff --git a/sca-cpp/trunk/test/store-java/store/ShoppingCartImpl.java b/sca-cpp/trunk/test/store-java/store/ShoppingCartImpl.java index 6620cbbbb0..878e0cff49 100644 --- a/sca-cpp/trunk/test/store-java/store/ShoppingCartImpl.java +++ b/sca-cpp/trunk/test/store-java/store/ShoppingCartImpl.java @@ -14,14 +14,13 @@ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations - * under the License. + * under the License. */ package store; import static org.apache.tuscany.IterableUtil.*; - -import java.util.UUID; +import static org.apache.tuscany.UUIDUtil.*; import org.apache.tuscany.Service; @@ -43,18 +42,11 @@ public class ShoppingCartImpl { return cart; } - /** - * Returns a UUID. - */ - String uuid() { - return UUID.randomUUID().toString(); - } - /** * Post a new item to the cart. Create a new cart if necessary. */ public Iterable post(final Iterable collection, final Iterable item, final Service cache) { - final String id = this.uuid(); + final String id = uuid(); final Iterable newItem = list(car(item), id, caddr(item)); final Iterable cart = cons(newItem, this.getcart(cartId, cache)); final Iterable iid = list(cartId); @@ -65,7 +57,7 @@ public class ShoppingCartImpl { /** * Find an item in the cart. */ - public Iterable find(final String id, final Iterable cart) { + Iterable find(final String id, final Iterable cart) { if(isNil(cart)) return cons("Item", list("0", list())); if(id.equals(cadr(car(cart)))) -- cgit v1.2.3