Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Commit

Permalink
-jigged cache a little for more reliability.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.jboss.org/repos/labs/labs/jbossrules/trunk@26491 c60d74c8-e8f6-0310-9e8f-d4a2fc68ab70
  • Loading branch information
mdproctor committed May 13, 2009
1 parent 8cdabff commit ad63e69
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,21 @@ public IVariable[] getVariables() throws DebugException {
}
}
variables = (IVariable[]) result.toArray( new IVariable[result.size()] );
System.out.print( "vars" );
for ( IVariable var : variables ) {
System.out.print( var.getName() + " " );
}
System.out.println( );
// System.out.print( "vars" );
// for ( IVariable var : variables ) {
// System.out.print( var.getName() + " " );
// }
// System.out.println( );
return variables;
}

public IJavaVariable[] getLocalVariables() throws DebugException {
IJavaVariable[] localVars = super.getLocalVariables();
System.out.print( "local vars" );
for ( IJavaVariable var : localVars ) {
System.out.print( var.getName() + " " );
}
System.out.println( );
// System.out.print( "local vars" );
// for ( IJavaVariable var : localVars ) {
// System.out.print( var.getName() + " " );
// }
// System.out.println( );

return localVars;
}
Expand Down Expand Up @@ -127,9 +127,6 @@ protected void setUnderlyingStackFrame(StackFrame frame) {

@Override
public void stepOver() throws DebugException {
List frames = ((JDIThread) getThread()).computeStackFrames();
int index = frames.indexOf(this);
System.out.println( "frames " + frames.size() + " : " + index );
super.stepOver();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,6 @@ public int compare(IVariable var1,
}
public int getLineNumber() throws DebugException {
synchronized ( getThread() ) {
int i = x();
System.out.println( i );
return i;
}
}

private int x() throws DebugException {
int cache = ctxCache.getCacheLineNumber();
if ( cache != -1 ) {
return cache;
Expand All @@ -166,7 +159,6 @@ private int x() throws DebugException {
String sourceName = getMVELName();
DroolsLineBreakpoint bpoint = (DroolsLineBreakpoint) t.getDroolsBreakpoint( sourceName );
if ( bpoint == null ) {
System.out.println( "1Unable to retrieve fragment line!" );
return -1;
}

Expand All @@ -175,22 +167,18 @@ private int x() throws DebugException {
line = Integer.parseInt( bpoint.getFileRuleMappings().get( sourceName ).toString() );
} catch ( Throwable t2 ) {
DroolsEclipsePlugin.log( t2 );
System.out.println( "2Unable to retrieve fragment line!" );
return -1;
}

int fragmentLine = getBreakpointLineNumber(); // 4->5 for step over
int res = line + fragmentLine;

// System.out.println("Resolved line to line:"+line+"; fragment:"+fragmentLine);

if ( fragmentLine == -1 ) {
System.out.println( "3Unable to retrieve fragment line!" );
return -1;
}
ctxCache.setCacheLineNumber( res );
return res;
//}
}
}

private int getBreakpointLineNumber() {
Expand Down Expand Up @@ -242,14 +230,14 @@ private int getBreakpointLineNumber() {

public String getMVELName() {
synchronized ( getThread() ) {
if ( !isSuspended() ) {
return null;
}

String cache = ctxCache.getCacheMVELName();
if ( cache != null ) {
return cache;
}

if ( !isSuspended() ) {
return null;
}

// Drools 4
try {
Expand Down

0 comments on commit ad63e69

Please sign in to comment.