Skip to content

Commit

Permalink
Merge pull request mybatis#260 from hazendaz/master
Browse files Browse the repository at this point in the history
JPetstore Warning Cleanup
  • Loading branch information
emacarron committed Aug 25, 2014
2 parents b1d81f4 + f0d5520 commit 8937ace
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 9 deletions.
2 changes: 2 additions & 0 deletions src/test/java/domain/jpetstore/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

public class Account implements Serializable {

private static final long serialVersionUID = 1L;

private String username;
private String password;
private String email;
Expand Down
12 changes: 7 additions & 5 deletions src/test/java/domain/jpetstore/Cart.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@

public class Cart implements Serializable {

private final Map itemMap = Collections.synchronizedMap(new HashMap());
private final List itemList = new ArrayList();
private static final long serialVersionUID = 1L;

public Iterator getCartItems() {
private final Map<String, CartItem> itemMap = Collections.synchronizedMap(new HashMap<String, CartItem>());
private final List<CartItem> itemList = new ArrayList<CartItem>();

public Iterator<CartItem> getCartItems() {
return itemList.iterator();
}

public List getCartItemList() {
public List<CartItem> getCartItemList() {
return itemList;
}

Expand Down Expand Up @@ -76,7 +78,7 @@ public void setQuantityByItemId(String itemId, int quantity) {

public BigDecimal getSubTotal() {
BigDecimal subTotal = new BigDecimal("0");
Iterator items = getCartItems();
Iterator<CartItem> items = getCartItems();
while (items.hasNext()) {
CartItem cartItem = (CartItem) items.next();
Item item = cartItem.getItem();
Expand Down
2 changes: 2 additions & 0 deletions src/test/java/domain/jpetstore/CartItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

public class CartItem implements Serializable {

private static final long serialVersionUID = 1L;

private Item item;
private int quantity;
private boolean inStock;
Expand Down
2 changes: 2 additions & 0 deletions src/test/java/domain/jpetstore/Category.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

public class Category implements Serializable {

private static final long serialVersionUID = 1L;

private String categoryId;
private String name;
private String description;
Expand Down
2 changes: 2 additions & 0 deletions src/test/java/domain/jpetstore/Item.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

public class Item implements Serializable {

private static final long serialVersionUID = 1L;

private String itemId;
private String productId;
private BigDecimal listPrice;
Expand Down
2 changes: 2 additions & 0 deletions src/test/java/domain/jpetstore/LineItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

public class LineItem implements Serializable {

private static final long serialVersionUID = 1L;

private int orderId;
private int lineNumber;
private int quantity;
Expand Down
10 changes: 6 additions & 4 deletions src/test/java/domain/jpetstore/Order.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

public class Order implements Serializable {

private static final long serialVersionUID = 1L;

private int orderId;
private String username;
private Date orderDate;
Expand All @@ -51,7 +53,7 @@ public class Order implements Serializable {
private String cardType;
private String locale;
private String status;
private List lineItems = new ArrayList();
private List<LineItem> lineItems = new ArrayList<LineItem>();

public int getOrderId() {
return orderId;
Expand Down Expand Up @@ -261,11 +263,11 @@ public void setStatus(String status) {
this.status = status;
}

public void setLineItems(List lineItems) {
public void setLineItems(List<LineItem> lineItems) {
this.lineItems = lineItems;
}

public List getLineItems() {
public List<LineItem> getLineItems() {
return lineItems;
}

Expand Down Expand Up @@ -302,7 +304,7 @@ public void initOrder(Account account, Cart cart) {
status = "P";


Iterator i = cart.getCartItems();
Iterator<CartItem> i = cart.getCartItems();
while (i.hasNext()) {
CartItem cartItem = (CartItem) i.next();
addLineItem(cartItem);
Expand Down
2 changes: 2 additions & 0 deletions src/test/java/domain/jpetstore/Product.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

public class Product implements Serializable {

private static final long serialVersionUID = 1L;

private String productId;
private String categoryId;
private String name;
Expand Down
2 changes: 2 additions & 0 deletions src/test/java/domain/jpetstore/Sequence.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

public class Sequence implements Serializable {

private static final long serialVersionUID = 1L;

private String name;
private int nextId;

Expand Down

0 comments on commit 8937ace

Please sign in to comment.