Donate Share

Jester

Tracker: Bugs

5 Infinte Loop - ID: 2829777
Last Update: Tracker Item Submitted ( nobody )

I am running into the problem of infinite loop while running jester.
> Jester is changing a condition in a for loop which is causing an
> infinite loop while running unit tests.

Here is the code: So when jester changes nested for loop inside switch from
++cIdx to --cIdx, it goes into infinite loop

StringBuffer argBuf = new StringBuffer();

for ( int cIdx = 0 ; cIdx < argStr.length() ; ) {
char ch = argStr.charAt( cIdx );

switch ( ch ) {
case '$':
StringBuffer nameBuf = new StringBuffer();
for ( ++cIdx ; cIdx < argStr.length() ; ++cIdx ) {
ch = argStr.charAt( cIdx );
if ( ch == '_' || Character.isLetterOrDigit( ch )
)
nameBuf.append( ch );
else
break;
}

if ( nameBuf.length() > 0 ) {
String value = (String)
vars.get( nameBuf.toString() );

if ( value != null ) {
argBuf.append( value );
}
}
break;

default:
argBuf.append( ch );
++cIdx;
break;
}
}


Nobody/Anonymous ( nobody ) - 2009-07-30 16:57

5

Open

None

Nobody/Anonymous

Core

None

Public


Comments




Log in to comment.

No follow-up comments have been posted.

Attached File

No Files Currently Attached

Change

No changes have been made to this artifact.