Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0008502
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 02. Master data managementtrivialalways2009-04-08 12:302009-05-13 00:00
ReportercheliView Statuspublic 
Assigned Toshuehner 
PrioritynormalResolutionno change requiredFixed in Version
StatusclosedFix in branchpiFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSLinux 32 bitDatabaseOracleJava version1.6
OS VersionDebian Gnu LinuxDatabase version11gAnt version1.7
Product Version2.40MP1SCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0008502: Code errors in SE_Order_BPartner.java file

DescriptionI was trying to upgrade from 2.40mp1 to 2.40mp3 and I found some odd things, then I have checked the mp3 source file and I found this:

Line 81:

if (data!=null && data.length>0) {
      strDeliveryRule = data[0].deliveryrule.equals("")?strDeliveryRule0:data[0].deliveryrule;
      strUserRep = SEOrderBPartnerData.userIdSalesRep(this, data[0].salesrepId);
      strUserRep = strUserRep.equals("")?strUserRep0:strUserRep;
      strPaymentrule = (strIsSOTrx.equals("Y")?data[0].paymentrule: data[0].paymentrulepo);
      strPaymentrule = strPaymentrule.equals("")?strPaymentrule0:strPaymentrule;
      strPaymentterm = (strIsSOTrx.equals("Y")?data[0].cPaymenttermId: data[0].poPaymenttermId);
      strPaymentterm = strPaymentterm.equals("")?strPaymentterm0:strPaymentterm;
      strInvoiceRule = data[0].invoicerule.equals("")?strInvoiceRule0:data[0].invoicerule;
      strPriceList = (strIsSOTrx.equals("Y")?data[0].mPricelistId: data[0].poPricelistId);
      strPriceList = strPriceList.equals("")?strPriceList0:strPriceList;
    }

it makes no sense to make assignments twice for the same variable.
Proposed SolutionLeave only last assignment for each variable.
TagsClean-up, tictech
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0015284)
cheli (reporter)
2009-04-08 14:57

Ok you compare if the first assignment returns 0 length string.

strUserRep = SEOrderBPartnerData.userIdSalesRep(this, data[0].salesrepId);
strUserRep = strUserRep.equals("")?strUserRep0:strUserRep;
(0016286)
shuehner (administrator)
2009-05-12 10:12

cheli: do you have any further info that there is a possible bug/problem?

As like you said the two lines together only select one of three values.

If not i would like to reject this as not an issue..
(0016287)
shuehner (administrator)
2009-05-12 11:02

Reasking last notes' question via the feedback state:

do you have any further info that there is a possible bug/problem?

As like you said the two lines together only select one of three values.

If not i would like to reject this as not an issue..
(0016289)
cheli (reporter)
2009-05-12 11:13

Hi Shuehner, perhaps the code is not as elegant as it could be but the answear is no, it has not got any bug/problem. You can reject this issue.

Thanks.
(0016292)
shuehner (administrator)
2009-05-12 11:46

After discussion with reporter no change required as the code question does have a purpose and is not a programming mistake.

- Issue History
Date Modified Username Field Change
2009-04-08 12:30 cheli New Issue
2009-04-08 12:30 cheli Assigned To => rafaroda
2009-04-08 12:31 cheli Tag Attached: tictech
2009-04-08 12:42 rafaroda Tag Attached: Clean-up
2009-04-08 14:57 cheli Note Added: 0015284
2009-04-22 18:43 psarobe Status new => scheduled
2009-04-22 18:43 psarobe fix_in_branch => pi
2009-04-23 12:03 rafaroda Assigned To rafaroda => shuehner
2009-05-12 10:12 shuehner Note Added: 0016286
2009-05-12 11:02 shuehner Note Added: 0016287
2009-05-12 11:02 shuehner Status scheduled => feedback
2009-05-12 11:13 cheli Note Added: 0016289
2009-05-12 11:46 shuehner Regression testing => No
2009-05-12 11:46 shuehner Status feedback => closed
2009-05-12 11:46 shuehner Note Added: 0016292
2009-05-12 11:46 shuehner Resolution open => no change required
2009-05-13 00:00 anonymous sf_bug_id 0 => 2790912


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker