[jboss-svn-commits] JBL Code SVN: r26490 - labs/jbossrules/trunk/drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/debug/core.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed May 13 00:26:48 EDT 2009
Author: mark.proctor at jboss.com
Date: 2009-05-13 00:26:48 -0400 (Wed, 13 May 2009)
New Revision: 26490
Modified:
labs/jbossrules/trunk/drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/debug/core/MVELStackFrame.java
Log:
-re-enabled cache.
Modified: labs/jbossrules/trunk/drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/debug/core/MVELStackFrame.java
===================================================================
--- labs/jbossrules/trunk/drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/debug/core/MVELStackFrame.java 2009-05-13 04:04:53 UTC (rev 26489)
+++ labs/jbossrules/trunk/drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/debug/core/MVELStackFrame.java 2009-05-13 04:26:48 UTC (rev 26490)
@@ -51,7 +51,7 @@
*/
public class MVELStackFrame extends DroolsStackFrame {
- //private final MVELStackFrameContext ctxCache = new MVELStackFrameContext();
+ private final MVELStackFrameContext ctxCache = new MVELStackFrameContext();
public MVELStackFrame(DroolsThread thread,
StackFrame frame,
@@ -82,10 +82,10 @@
return new IVariable[0];
}
-// IVariable[] cache = ctxCache.getCacheVariables();
-// if ( cache != null ) {
-// return cache;
-// }
+ IVariable[] cache = ctxCache.getCacheVariables();
+ if ( cache != null ) {
+ return cache;
+ }
List<IVariable> result = new ArrayList<IVariable>( 0 );
@@ -139,7 +139,7 @@
}
}
} );
-// ctxCache.setCacheVariables( vararr );
+ ctxCache.setCacheVariables( vararr );
return vararr;
} catch ( Throwable t ) {
@@ -148,19 +148,25 @@
return new IVariable[0];
}
}
-
- @Override
public int getLineNumber() throws DebugException {
synchronized ( getThread() ) {
-// int cache = ctxCache.getCacheLineNumber();
-// if ( cache != -1 ) {
-// return cache;
-// }
+ int i = x();
+ System.out.println( i );
+ return i;
+ }
+ }
+ private int x() throws DebugException {
+ int cache = ctxCache.getCacheLineNumber();
+ if ( cache != -1 ) {
+ return cache;
+ }
+
DroolsDebugTarget t = (DroolsDebugTarget) getDebugTarget();
String sourceName = getMVELName();
DroolsLineBreakpoint bpoint = (DroolsLineBreakpoint) t.getDroolsBreakpoint( sourceName );
if ( bpoint == null ) {
+ System.out.println( "1Unable to retrieve fragment line!" );
return -1;
}
@@ -169,6 +175,7 @@
line = Integer.parseInt( bpoint.getFileRuleMappings().get( sourceName ).toString() );
} catch ( Throwable t2 ) {
DroolsEclipsePlugin.log( t2 );
+ System.out.println( "2Unable to retrieve fragment line!" );
return -1;
}
@@ -178,18 +185,18 @@
// System.out.println("Resolved line to line:"+line+"; fragment:"+fragmentLine);
if ( fragmentLine == -1 ) {
- System.err.println( "Unable to retrieve fragment line!" );
+ System.out.println( "3Unable to retrieve fragment line!" );
return -1;
}
-// ctxCache.setCacheLineNumber( res );
+ ctxCache.setCacheLineNumber( res );
return res;
- }
+ //}
}
private int getBreakpointLineNumber() {
-// if ( ctxCache.getCacheBreakpointLineNumber() != -1 ) {
-// return ctxCache.getCacheBreakpointLineNumber();
-// }
+ if ( ctxCache.getCacheBreakpointLineNumber() != -1 ) {
+ return ctxCache.getCacheBreakpointLineNumber();
+ }
// Drools 4
try {
@@ -199,7 +206,7 @@
}
IntegerValue val = (IntegerValue) o;
int realval = val.value();
-// ctxCache.setCacheBreakpointLineNumber( realval );
+ ctxCache.setCacheBreakpointLineNumber( realval );
return realval;
} catch ( NullPointerException e ) {
// Drools 5+
@@ -222,7 +229,7 @@
}
IntegerValue val = (IntegerValue) o;
int realval = val.value();
-// ctxCache.setCacheBreakpointLineNumber( realval );
+ ctxCache.setCacheBreakpointLineNumber( realval );
return realval;
} catch ( NullPointerException e ) {
// Drools 5+
@@ -239,10 +246,10 @@
return null;
}
-// String cache = ctxCache.getCacheMVELName();
-// if ( cache != null ) {
-// return cache;
-// }
+ String cache = ctxCache.getCacheMVELName();
+ if ( cache != null ) {
+ return cache;
+ }
// Drools 4
try {
@@ -252,7 +259,7 @@
}
StringReference res = (StringReference) rem;
String realres = res.value();
-// ctxCache.setCacheMVELName( realres );
+ ctxCache.setCacheMVELName( realres );
return realres;
} catch ( NullPointerException e ) {
// Drools 5
@@ -275,7 +282,7 @@
}
StringReference res = (StringReference) rem;
String realres = res.value();
-// ctxCache.setCacheMVELName( realres );
+ ctxCache.setCacheMVELName( realres );
return realres;
} catch ( Throwable e ) {
DroolsEclipsePlugin.log( e );
@@ -333,6 +340,13 @@
public String getSourceName() throws DebugException {
return getMVELName();
}
+
+ public void stepOver() throws DebugException {
+ synchronized ( getThread() ) {
+ ctxCache.clear();
+ }
+ super.stepOver();
+ }
public boolean canStepInto() {
return false;
More information about the jboss-svn-commits
mailing list