-1 );
}
int newFrames = newSize - oldSize; // number of frames to create, if any
int depth = oldSize;
for ( int i = newFrames - 1; i >= 0; i-- ) {
StackFrame currentFrame = (StackFrame) frames.get( i );
JDIStackFrame customFrame = createCustomFrame( this,
depth,
currentFrame );
fStackFrames.add( 0,
customFrame );
depth++;
}
int numToRebind = Math.min( newSize,
oldSize ); // number of frames to attempt to rebind
int offset = newSize - 1;
for ( depth = 0; depth < numToRebind; depth++ ) {
DroolsStackFrame oldFrame = (DroolsStackFrame) fStackFrames.get( offset );
StackFrame frame = (StackFrame) frames.get( offset );
DroolsStackFrame newFrame = (DroolsStackFrame) oldFrame.bind( frame,
depth );
if ( newFrame != oldFrame ) {
fStackFrames.set( offset,
newFrame );