Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Findbugs - fix for infinite loops in shopping cart #182

Closed
wants to merge 3 commits into from

2 participants

@ghost

Hi,
Findbugs notified about the infinite loops in these methods.

This is my first interaction with github, so please let me know how I did :-)
Cheers,
Chris

@juanferrub
Owner

Hi Chris! Thanks a lot for your contribution!
For all our commits we have an associated issues.liferay.com issue ticket, so I created one for this (you can see it here - http://issues.liferay.com/browse/LPS-26736)

Apart from that, the commit was perfect, I only renamed the variables so that it's consistent with the rest of the file and I submitted it to Brian Chan (chief architect) to include it on trunk. (You can see the PR here - brianchandotcom#4975)

Thanks for participating in the community and ... keep fixes and improvements coming! :)
Juan Fernández

@juanferrub juanferrub closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 11, 2012
  1. @chas678

    fixed infinite loop bugs

    chas678 authored
  2. @chas678

    fixed infinite loop bugs

    chas678 authored
  3. @chas678
This page is out of date. Refresh to see the latest.
View
4 ...al-impl/src/com/liferay/portlet/shopping/service/impl/ShoppingCouponLocalServiceImpl.java
@@ -235,9 +235,9 @@ protected String getCode() throws SystemException {
PwdGenerator.KEY1 + PwdGenerator.KEY2, 8);
try {
- shoppingCouponPersistence.findByCode(code);
+ ShoppingCoupon foundCoupon = shoppingCouponPersistence.findByCode(code);
- return getCode();
+ return foundCoupon.getCode();
}
catch (NoSuchCouponException nsce) {
return code;
View
4 portal-impl/src/com/liferay/portlet/shopping/service/impl/ShoppingOrderLocalServiceImpl.java
@@ -649,9 +649,9 @@ protected String getNumber() throws SystemException {
PwdGenerator.KEY1 + PwdGenerator.KEY2, 12);
try {
- shoppingOrderPersistence.findByNumber(number);
+ ShoppingOrder foundOrder = shoppingOrderPersistence.findByNumber(number);
- return getNumber();
+ return foundOrder.getNumber();
}
catch (NoSuchOrderException nsoe) {
return number;
Something went wrong with that request. Please try again.