473,396 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

variable values in loops

14
//Define Iterator iter

String policyPath = "";
while (iter.hasNext())
{
deductionL = (DeductionsLocal) iter.next();

String policyID = deductionL.getPolicyID();

policyL = policyH.findByPrimaryKey(policyID);

if(policyL.getStatus().equalsIgnoreCase("READY TO GO INTO FORCE")||policyL.getStatus().equalsIgnoreCase("IN FORCE"))
policyPath = "/NewBusiness/displayPolicyApproved.jsp";
else
policyPath = Utils.getPolicyPath(policyL.getNextAction());



//other code
//end loop
}

why is it that policyPath has nothing for the rest of the iterations?
Jun 29 '07 #1
1 1038
r035198x
13,262 8TB
//Define Iterator iter

String policyPath = "";
while (iter.hasNext())
{
deductionL = (DeductionsLocal) iter.next();

String policyID = deductionL.getPolicyID();

policyL = policyH.findByPrimaryKey(policyID);

if(policyL.getStatus().equalsIgnoreCase("READY TO GO INTO FORCE")||policyL.getStatus().equalsIgnoreCase("IN FORCE"))
policyPath = "/NewBusiness/displayPolicyApproved.jsp";
else
policyPath = Utils.getPolicyPath(policyL.getNextAction());



//other code
//end loop
}

why is it that policyPath has nothing for the rest of the iterations?
1.) Code tags code tags code tags code tags code tags code tags
2.) What makes you sure that there's nothing in policyPath ?
3.) If there is nothing, then the reason will be that the getPolicyPath in your Utils class did not return anything
Jun 29 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Gord | last post by:
Hello, I think that what I'm trying to do is impossible, but before I give up I thought I'd try and pick a few more knowledgeable brains than my own. I have any array of user defined type...
23
by: stewart.midwinter | last post by:
No doubt I've overlooked something obvious, but here goes: Let's say I assign a value to a var, e.g.: myPlace = 'right here' myTime = 'right now' Now let's say I want to print out the two...
32
by: Wenjie | last post by:
Hello, We had a code review with the argument of whether "i" is out of scope as illustrated below: for (int i=0; i<2004; i++) { doSomething(i); }
134
by: James A. Donald | last post by:
I am contemplating getting into Python, which is used by engineers I admire - google and Bram Cohen, but was horrified to read "no variable or argument declarations are necessary." Surely that...
27
by: Mike P | last post by:
I will be passing my function a two dimensional array of varying length. Within that array is one data point, and the number of times it should loop through. So, for example, I might pass this...
20
by: Joseph Wakeling | last post by:
Hello all, Here's a brief function from the aforementioned (and controversial) GNU Scientific Library (GSL), or rather, a slightly rewritten version of it that I've made. The function takes an...
2
by: John McMonagle | last post by:
Say I have a dictionary like below: d = {(100,500):, (100,501):, (100,502):} Say I want to multiply all the values of the dictionary by 2: for key in d.keys(): d = map(lambda x: x*2,...
12
by: PSN | last post by:
The following code compiles fine with GCC. Isnt this supposed to be a redefinition of 'i' error ... main() { for (int i=0; i<10; i++) cout << i << endl; for (int i=10; i>0; i--) cout << i...
2
by: bdude | last post by:
Hey, I'm new to python and am looking for the most efficient way to see if the contents of a variable is equal to one of many options. Cheers, Bryce R
0
by: Derek Martin | last post by:
On Fri, Jul 18, 2008 at 12:21:49PM -0700, mark floyd wrote: One wonders why... :) Even if Python didn't offer a way to write a for loop in a similar fashion (someone else replied about...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.