alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

/*
 *                 Sun Public License Notice
 * 
 * The contents of this file are subject to the Sun Public License
 * Version 1.0 (the "License"). You may not use this file except in
 * compliance with the License. A copy of the License is available at
 * http://www.sun.com/
 * 
 * The Original Code is NetBeans. The Initial Developer of the Original
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2001 Sun
 * Microsystems, Inc. All Rights Reserved.
 */

package org.netbeans.test.debugger.Util;

import java.io.File;
import java.io.PrintWriter;
import java.lang.InterruptedException;
import java.lang.reflect.InvocationTargetException;
import javax.swing.SwingUtilities;
import org.openide.TopManager;
import org.openide.nodes.Node;
import org.openide.debugger.Debugger;
import org.openide.debugger.Breakpoint;
import org.openide.debugger.DebuggerException;
import org.openide.debugger.DebuggerType;
import org.netbeans.modules.debugger.Register;
import org.netbeans.modules.debugger.DebuggerImpl;
import org.netbeans.modules.debugger.CoreBreakpoint;
import org.netbeans.modules.debugger.support.DebuggerSupport;
import org.netbeans.modules.debugger.support.DebuggerContextSettings;
import org.netbeans.modules.debugger.support.java.MethodBreakpointEvent;
import org.netbeans.modules.debugger.support.java.JavaLineBreakpointEvent;
import org.netbeans.modules.debugger.support.java.ClassBreakpointEvent;
import org.netbeans.modules.debugger.support.java.JavaDebuggerSettings;
import org.netbeans.modules.debugger.support.StopAction;
import org.netbeans.modules.debugger.delegator.DelegatingDebuggerImpl;
import org.netbeans.modules.debugger.delegator.DefaultDebuggerType;
// Marek import org.netbeans.modules.debugger.debug.ToolsDebugger11Type;
import org.netbeans.modules.debugger.jpda.ClassBreakpoint;
import org.netbeans.modules.debugger.jpda.ThreadBreakpoint;
import org.netbeans.modules.debugger.jpda.VariableBreakpoint;
import org.netbeans.modules.debugger.jpda.ExceptionBreakpoint;
import org.openide.execution.ExecInfo;

/**
 * Common methods used in automated test's of debugger. These methods are
 * using both Open API and API of the debugger modules.
 *
 * @author Jan Stola
 */
public class DebuggerAPI extends Object {
    /** Value of the Action On Trace Into property. */
    private static int actionOnTraceInto;
    /** Value of the Action On Trace Into Set property. */
    private static boolean actionOnTraceIntoSet;
    /** Value of the Show Finish Dialog property. */
    private static boolean showFinishDialog;
    /** Value of the Show Run Multissesion Dialog. */
    private static boolean showRunMultisessionDialog;
    /** Value of the Run Multisession property. */
    private static boolean runMultisession;
    /** Value of the Classic Switch property. */
    private static boolean classic;
    /** Value of the Implementation property. */
    private static boolean JPDA;
    /** Value of the JDK1.1 Home property. */
    private static File jdk11Home;
    
    /**
     * Looks for variable breakpoint with the given type
     * on the given fieldName in the class with the given
     * className.
     *
     * @param className name of the class the desired breakpoint belongs to.
     * @param fieldName name of the field the desired breakpoint is set on.
     * @param type type of the desired breakpoint.
     * @return Breakpoint that match the given arguments or
     * null if such breakpoint doesn't exist.
     */
    public static Breakpoint findVariableBreakpoint (String className, String fieldName, int type) {
        //PENDING
        try {
            Thread.currentThread().sleep(500);
        } catch (InterruptedException e) {
        }
        Debugger d = DebuggerOpenAPI.getDebugger ();
        if (d == null) return null;
        CoreBreakpoint[] b = (CoreBreakpoint[]) d.getBreakpoints ();
        CoreBreakpoint.Event ce;
        for (int i = 0; i < b.length; i++) {
            ce=b[i].getEvent(d);
            if ((ce!=null)&&(ce instanceof VariableBreakpoint)) {
                VariableBreakpoint vb=(VariableBreakpoint)ce;
                if (vb.getClassName().equals(className)&&vb.getFieldName().equals(fieldName)&&(type==vb.getType())) return b[i];
            }
        }
        return null;
    }
    
    /**
     * Looks for the thread breakpoint with the given type.
     *
     * @param type type of the desired breakpoint.
     * @return desired Breakpoint or null if such
     * breakpoint doesn't exist.
     */
    public static Breakpoint findThreadBreakpoint (int type) {
        //PENDING
        try {
            Thread.currentThread().sleep(500);
        } catch (InterruptedException e) {
        }
        Debugger d=DebuggerOpenAPI.getDebugger();
        if (d == null) return null;
        CoreBreakpoint[] b = (CoreBreakpoint[]) d.getBreakpoints ();
        CoreBreakpoint.Event ce;
        for (int i = 0; i < b.length; i++) {
            ce=b[i].getEvent(d);
            if ((ce!=null)&&(ce instanceof ThreadBreakpoint)) {
                ThreadBreakpoint tb=(ThreadBreakpoint)ce;
                if (tb.getType()==type) return b[i];
            }
        }
        return null;
    }
    
    /**
     * Looks for class breakpoint of the given type and
     * classFilter.
     *
     * @param classFilter class filter of the desired breakpoint.
     * @param type type of the desired breakpoint.
     * @return Breakpoint that match the given arguments or
     * null if such breakpoint doesn't exist.
     */
    public static Breakpoint findClassBreakpoint (String classFilter, int type) {
        //PENDING
        try {
            Thread.currentThread().sleep(500);
        } catch (InterruptedException e) {
        }
        Debugger d = DebuggerOpenAPI.getDebugger ();
        if (d == null) return null;
        CoreBreakpoint[] b = (CoreBreakpoint[]) d.getBreakpoints ();
        CoreBreakpoint.Event ce;
        for (int i = 0; i < b.length; i++) {
            ce=b[i].getEvent(d);
            if ((ce!=null)&&(ce instanceof ClassBreakpoint)) {
                ClassBreakpoint cb=(ClassBreakpoint)ce;
                if ((cb.getClassFilter().equals(classFilter))&&(cb.getType()==type)) return b[i];
            }
        }
        return null;
    }
    
    /**
     * Looks for method breakpoint on the method with given methodName
     * in class with given className.
     *
     * @param className name of the class the desired breakpoint belongs to.
     * @param methodName name of the method the desired breakpoint belongs to.
     * @return Breakpoint that match the given arguments or
     * null if such breakpoint doesn't exist.
     */
    public static Breakpoint findMethodBreakpoint (String className, String methodName) {
        //PENDING
        try {
            Thread.currentThread().sleep(500);
        } catch (InterruptedException e) {
        }
        Debugger d = DebuggerOpenAPI.getDebugger ();
        if (d == null) return null;
        CoreBreakpoint[] b = (CoreBreakpoint[]) d.getBreakpoints ();
        int i, k = b.length;
        CoreBreakpoint.Event ce;
        for (i = 0; i < k; i++) {
            ce=b[i].getEvent(d);
            if ((ce!=null)&&(ce instanceof MethodBreakpointEvent)) {
                MethodBreakpointEvent mbe=(MethodBreakpointEvent)ce;
                if (mbe.getClassName().equals(className) &&
                mbe.getMethodName().equals(methodName)) return b[i];
            }
        }
        return null;
    }
    
    /**
     * Adds variable breakpoint with given type on the field
     * with given fieldName in the class with the given
     * className.
     *
     * @param className name of the class the created breakpoint belongs to.
     * @param fieldName name of the field the created breakpoint is set on.
     * @param type type of the created breakpoint.
     * @return newly created Breakpoint or null
     * if the creation was not successful.
     */
    public static Breakpoint addVariableBreakpoint(String className, String fieldName, int type) {
        //PENDING
        try {
            Thread.currentThread().sleep(500);
        } catch (InterruptedException e) {
        }
        DebuggerSupport d=(DebuggerSupport)DebuggerOpenAPI.getDebugger();
        CoreBreakpoint b=d.createBreakpoint(false);
        if (b==null) {
            Common.error="Cannot create empty breakpoint.";
            return null;
        }
        VariableBreakpoint c=(VariableBreakpoint)getBreakpoint("java-field");
        if (c==null) {
            Common.error+="Cannot create thread breakpoint event.";
            return null;
        }
        c.setClassName(className);
        c.setFieldName(fieldName);
        c.setType(type);
        b.setEvent(c);
        //PENDING
        b.setEnabled(false);
        b.setEnabled(true);
        return b;
    }
    
    /**
     * Adds thread breakpoint with the given type.
     *
     * @param type type of the created breakpoint.
     * @return newly created Breakpoint or null
     * if the creation was not successful.
     */
    public static Breakpoint addThreadBreakpoint(int type) {
        //PENDING
        try {
            Thread.currentThread().sleep(500);
        } catch (InterruptedException e) {
        }
        DebuggerSupport d=(DebuggerSupport)DebuggerOpenAPI.getDebugger();
        CoreBreakpoint b=d.createBreakpoint(false);
        if (b==null) {
            Common.error="Cannot create empty breakpoint.";
            return null;
        }
        ThreadBreakpoint c=(ThreadBreakpoint)getBreakpoint("java-thread");
        if (c==null) {
            Common.error+="Cannot create thread breakpoint event.";
            return null;
        }
        c.setType(type);
        b.setEvent(c);
        //PENDING
        b.setEnabled(false);
        b.setEnabled(true);
        return b;
    }
    
    /**
     * Adds class breakpoint with the given type and
     * classFilter.
     *
     * @param classFilter class filter of the created breakpoint.
     * @param type type of created breakpoint.
     * @return newly created Breakpoint or null
     * if the creation was not successful.
     */
    public static Breakpoint addClassBreakpoint(String classFilter, int type) {
        //PENDING
        try {
            Thread.currentThread().sleep(500);
        } catch (InterruptedException e) {
        }
        DebuggerSupport d=(DebuggerSupport) DebuggerOpenAPI.getDebugger();
        CoreBreakpoint b=d.createBreakpoint(false);
        if (b==null) {
            Common.error="Cannot create empty breakpoint.";
            return null;
        }
        ClassBreakpoint c=(ClassBreakpoint)getBreakpoint("java-class");
        if (c==null) {
            Common.error+="Cannot create class breakpoint event.";
            return null;
        }
        c.setClassFilter(classFilter);
        c.setType(type);
        b.setEvent(c);
        //PENDING
        b.setEnabled(false);
        b.setEnabled(true);
        return b;
    }
    
    /**
     * Adds exception breakpoint with the given type and
     * classFilter.
     *
     * @param classFilter class filter of the created breakpoint.
     * @param type type of created breakpoint or 0 when
     * JDK 1.1 debugging is used.
     * @return newly created Breakpoint or null
     * if the creation was not successful.
     */
    public static Breakpoint addExceptionBreakpoint(String classFilter, int type) {
        //PENDING
        try {
            Thread.currentThread().sleep(500);
        } catch (InterruptedException e) {
        }
        DebuggerSupport d=(DebuggerSupport) DebuggerOpenAPI.getDebugger();
        CoreBreakpoint b=(CoreBreakpoint)d.createBreakpoint(false);
        if (b==null) {
            Common.error="Cannot create empty breakpoint.";
            return null;
        }
        ClassBreakpointEvent c=(ClassBreakpointEvent)getBreakpoint("java-exception");
        if (c==null) {
            Common.error+="Cannot create exception breakpoint event.";
            return null;
        }
        c.setClassName(classFilter);
        if (type!=0) {
            ((ExceptionBreakpoint)c).setCatchType(type);
        }
        b.setEvent(c);
        //PENDING
        b.setEnabled(false);
        b.setEnabled(true);
        return b;
    }
    
    /**
     * Looks for exception breakpoint of the given type and
     * classFilter.
     *
     * @param classFilter class filter of the desired breakpoint.
     * @param type type of the desired breakpoint.
     * @return Breakpoint that match the given arguments or
     * null if such breakpoint doesn't exist.
     */
    public static Breakpoint findExceptionBreakpoint (String classFilter, int type) {
        //PENDING
        try {
            Thread.currentThread().sleep(500);
        } catch (InterruptedException e) {
        }
        Debugger d = DebuggerOpenAPI.getDebugger ();
        if (d == null) return null;
        CoreBreakpoint[] b = (CoreBreakpoint[]) d.getBreakpoints ();
        CoreBreakpoint.Event ce;
        for (int i = 0; i < b.length; i++) {
            ce=b[i].getEvent(d);
            if ((ce!=null)&&(ce instanceof ExceptionBreakpoint)) {
                ExceptionBreakpoint eb=(ExceptionBreakpoint)ce;
                if ((eb.getClassName().equals(classFilter))&&(eb.getCatchType()==type)) return b[i];
            }
        }
        return null;
    }
        
    /**
     * Adds method breakpoint on the method with the given methodName
     * that resides in the class with the given className.
     * The parameters of this breakpoint are set through MethodBreakpointEvent's
     * methods.
     *
     * @param className name of the class the created breakpoint belongs to.
     * @param methodName name of the method the created breakpoint is set on.
     * @return newly created Breakpoint or null
     * if the creation was not successful.
     */
    public static Breakpoint addMethodBreakpoint(String className, String methodName) {
        //PENDING
        try {
            Thread.currentThread().sleep(500);
        } catch (InterruptedException e) {
        }
        DebuggerSupport d = (DebuggerSupport) DebuggerOpenAPI.getDebugger ();
        if (d == null) return null;
        CoreBreakpoint b = (CoreBreakpoint) d.createBreakpoint (false);
        if (b == null) {
            Common.error="Can not create empty breakpoint.";
            return null;
        }
        MethodBreakpointEvent c=(MethodBreakpointEvent)getBreakpoint("java-method");
        if (c==null) {
            Common.error+="Cannot create method breakpoint event.";
            return null;
        }
        c.setMethodName (methodName);
        c.setClassName (className);
        b.setEvent(c);
        //PENDING
        b.setEnabled(false);
        b.setEnabled(true);
        return b;
    }
    
    /**
     * Adds line breakpoint on the given lineNumber in the class
     * with the given className.
     * The parameters of this breakpoint are set through LineBreakpointEvent's
     * methods.
     *
     * @param className name of the class the created breakpoint belongs to.
     * @param lineNumber line number of the created breakpoint.
     * @return newly created Breakpoint or null
     * if the creation was not successful.
     */
    public static Breakpoint addLineBreakpoint(String className, int lineNumber) {
        //PENDING
        try {
            Thread.currentThread().sleep(500);
        } catch (InterruptedException e) {
        }
        DebuggerSupport d = (DebuggerSupport) DebuggerOpenAPI.getDebugger ();
        if (d == null) return null;
        CoreBreakpoint b = (CoreBreakpoint) d.createBreakpoint (false);
        if (b == null) {
            Common.error="Can not create empty breakpoint.";
            return null;
        }
        JavaLineBreakpointEvent c=(JavaLineBreakpointEvent)getBreakpoint("java-line");
        if (c==null) {
            Common.error+="Cannot create line breakpoint event.";
            return null;
        }
        c.setLineNumber (lineNumber);
// XXX: temporarily disabled
//        c.setSourceName (className);
        b.setEvent(c);
        //PENDING
        b.setEnabled(false);
        b.setEnabled(true);
        return b;
    }
    
    /**
     * Looks for line breakpoint with given lineNumber
     * and className.
     *
     * @param className name of the class the desired breakpoint belongs to.
     * @param lineNumber line number of the desired breakpoint.
     * @return Breakpoint that match the given arguments or
     * null if such breakpoint doesn't exist.
     */
    public static Breakpoint findLineBreakpoint (String className, int lineNumber) {
        //PENDING
        try {
            Thread.currentThread().sleep(500);
        } catch (InterruptedException e) {
        }
        Debugger d = DebuggerOpenAPI.getDebugger ();
        if (d == null) return null;
        CoreBreakpoint[] b = (CoreBreakpoint[]) d.getBreakpoints ();
        int i, k = b.length;
        CoreBreakpoint.Event ce;
        for (i = 0; i < k; i++) {
            ce=b[i].getEvent(d);
            if ((ce!=null)&&(ce instanceof JavaLineBreakpointEvent)) {
                JavaLineBreakpointEvent lbe=(JavaLineBreakpointEvent)ce;
                if (lbe.getSourceName().equals(className) &&
                (lbe.getLineNumber()==lineNumber)) return b[i];
            }
        }
        return null;
    }
    
    private static DebuggerException startException;
    private static Object            startExceptionLock = new Object();
    /**
     * Starts debugger whose type is specified by debuggerType.
     *
     * @param debuggerType type of the started debugger.
     * @param className name of the debugged class.
     * @param argv arguments of the debugger application.
     * @param stopOnMain whether the debugger should stop on the main class of
     * the application.
     * @return true if debugger was successfully started and
     * stoped on breakpoint. Returns false otherwise.
     */
    public static boolean start(String debuggerType, final String className, final String[] argv, final boolean stopOnMain) {
        Debugger d=DebuggerOpenAPI.getDebugger();
        DebuggerStateListener pcl=new DebuggerStateListener();
        d.addPropertyChangeListener(pcl);
        synchronized (pcl) {
            DebuggerType ddt;
            if ("JDK11".equals(debuggerType)) {
// Marek                 ddt=(DebuggerType)TopManager.getDefault().getServices().find(ToolsDebugger11Type.class);
                ddt = null; // Marek 
            } else {
                ddt=(DebuggerType)TopManager.getDefault().getServices().find("Default Debugging");
            }
            if (ddt==null) {
                Common.error="Default debugger type not found.";
                d.removePropertyChangeListener(pcl);
                return false;
            }
            try {
// Marek                System.out.println("className < "+className+" >");
// Marek                System.out.println("argv < "+argv+" >");
// Marek                System.out.println("stopOnMain < "+stopOnMain+" >");
// Marek                System.out.println("ddt < "+ddt+" >");
                
                if (SwingUtilities.isEventDispatchThread())
                    ddt.startDebugger(new ExecInfo(className, argv), stopOnMain);
                else {
                    synchronized (startExceptionLock) {
                        startException = null;
                        final DebuggerType ddtCopy = ddt;
                        
                        try {
                            SwingUtilities.invokeAndWait(new Runnable() {
                                public void run() {
                                    try {
                                        ddtCopy.startDebugger(new ExecInfo(className, argv), stopOnMain);
                                    } catch (DebuggerException e) {
                                        startException = e;
                                    }
                                }
                            });
                        } catch (InterruptedException e) {
                            if (startException != null)
                                Common.error="Exception thrown during the start of the debugger. "+Common.getString(startException)+".";
                            else
                                Common.error="Exception thrown during the start of the debugger. "+Common.getString(e)+".";
                            d.removePropertyChangeListener(pcl);
                            return false;
                        } catch (InvocationTargetException e) {
                            if (startException != null)
                                Common.error="Exception thrown during the start of the debugger. "+Common.getString(startException)+".";
                            else
                                Common.error="Exception thrown during the start of the debugger. "+Common.getString(e)+".";
                            d.removePropertyChangeListener(pcl);
                            return false;
                        }
                        
                        if (startException != null)
                            throw startException;
                    }
                }
                
            } catch (DebuggerException e) {
                Common.error="Exception thrown during the start of the debugger. "+Common.getString(e)+".";
                d.removePropertyChangeListener(pcl);
                return false;
            }
            try {
                pcl.wait(30000);
            } catch (InterruptedException e) {
            }
        }
        d.removePropertyChangeListener(pcl);
        boolean ok=d.getState()==Debugger.DEBUGGER_STOPPED;        
        if (!ok) {
            Common.error=Common.stopBug;
        }
// Marek        System.out.println("OK : < "+ok+" >");
        return ok;
    }
    
    /**
     * Sets necessary properties such that debuggerType can
     * be used.
     *
     * @param debuggerType type of the debugger.
     */
    private static void setDebuggerType(String debuggerType) {
        boolean jdk11="JDK11".equals(debuggerType);
        if (!jdk11) {
            DefaultDebuggerType ddt=(DefaultDebuggerType)TopManager.getDefault().getServices().find("Default Debugging");
            if (ddt==null) {
                Common.error="Cannot find DefaultDebuggerType service.";
                return;
            }
            classic=ddt.isClassic();
// Marek            System.out.println("debuggerType" + debuggerType);
            if (debuggerType.equals("Classic")||debuggerType.equals("JDK11Impl")) {
                ddt.setClassic(true);
            } else if (debuggerType.equals("Hotspot")) {
                ddt.setClassic(false);
            }
            String value=ddt.getDebuggerType().trim();
            if (value.equals("Default debugger (JPDA)")) {
                JPDA=true;
            } else {
                JPDA=false;
            }
            if (debuggerType.equals("JDK11Impl")) {
                ddt.setDebuggerType("JDK 1.1 debugger implementation");
            } else {
                ddt.setDebuggerType("Default debugger (JPDA)");
            }
        } else {
// Marek             ToolsDebugger11Type tdt=(ToolsDebugger11Type)TopManager.getDefault().getServices().find(ToolsDebugger11Type.class);
// Marek            if (tdt==null) {
// Marek                Common.error="Cannot find ToolsDebugger11Type service.";
// Marek                return;
// Marek            }
// Marek            jdk11Home=tdt.getJavaHomeDir();
// Marek            String home=System.getProperty("debugger.jdk11.path");
// Marek            if (home!=null) {
// Marek                tdt.setJavaHomeDir(new File(home));
// Marek            }
        }        
    }
    
    /**
     * Initializes all settings such that automated test with
     * the given debuggerType can be run.
     */
    public static void initSettings(String debuggerType) {
        //PENDING
        try {
            Thread.currentThread().sleep(500);
        } catch (InterruptedException e) {
        }        
        setDebuggerType(debuggerType);
        Debugger d = DebuggerOpenAPI.getDebugger ();        
        d.removeAllBreakpoints ();
        d.removeAllWatches ();        
        DebuggerContextSettings ds = (DebuggerContextSettings) DebuggerContextSettings.findObject (
        DebuggerContextSettings.class);
        JavaDebuggerSettings jds = (JavaDebuggerSettings) JavaDebuggerSettings.findObject (
        JavaDebuggerSettings.class);
        actionOnTraceInto=jds.getActionOnTraceInto();
        jds.setActionOnTraceInto (org.netbeans.modules.debugger.jpda.JPDADebugger.ACTION_ON_TI_FIND);
        actionOnTraceIntoSet=jds.isActionOnTraceIntoSet();
        jds.setActionOnTraceIntoSet (true);
        showFinishDialog=ds.getShowFinishDialog();
        ds.setShowFinishDialog (false);
        showRunMultisessionDialog=ds.getShowRunMultisessionDialog();
        ds.setShowRunMultisessionDialog(false);
        runMultisession=ds.getRunMultisession();
        ds.setRunMultisession(false);        
    }
    
    /**
     * Restores all settings as they were before automated test with the given
     * debuggerType was used.
     *
     * @param debuggerType type of the debugger.
     */
    public static void restoreSettings(String debuggerType) {
        //PENDING
        try {
            Thread.currentThread().sleep(500);
        } catch (InterruptedException e) {
        }        
        Debugger d=DebuggerOpenAPI.getDebugger();
        d.removeAllBreakpoints ();
        d.removeAllWatches ();
        if (d.getState()!=Debugger.DEBUGGER_NOT_RUNNING) {
            DebuggerOpenAPI.finish();
        }
        DebuggerContextSettings ds = (DebuggerContextSettings) DebuggerContextSettings.findObject (
        DebuggerContextSettings.class);
        JavaDebuggerSettings jds = (JavaDebuggerSettings) JavaDebuggerSettings.findObject (
        JavaDebuggerSettings.class);
        jds.setActionOnTraceInto(actionOnTraceInto);
        jds.setActionOnTraceIntoSet(actionOnTraceIntoSet);        
        ds.setShowFinishDialog(showFinishDialog);
        ds.setShowRunMultisessionDialog(showRunMultisessionDialog);
        ds.setRunMultisession(runMultisession);
        if ("JDK11".equals(debuggerType)) {
// Marek             ToolsDebugger11Type tdt=(ToolsDebugger11Type)TopManager.getDefault().getServices().find(ToolsDebugger11Type.class);
// Marek             tdt.setJavaHomeDir(jdk11Home);
            System.out.println("// tdt removed //");
        } else {
            DefaultDebuggerType ddt=(DefaultDebuggerType)TopManager.getDefault().getServices().find("Default Debugging");
            ddt.setClassic(classic);
            if (JPDA) {
                ddt.setDebuggerType("Default Debugger (JPDA)");
            } else {
                ddt.setDebuggerType("JDK 1.1 debugger implementation");
            }
        }        
        //PENDING
        try {
            Thread.currentThread().sleep(500);
        } catch (InterruptedException e) {
        }
    }
    
    /**
     * Returns breakpoint event for the given eventName.
     *
     * @param eventName name of the desired event.
     * @return CoreBreakpoint.Event corresponding to the given
     * eventName.
     */
    public static CoreBreakpoint.Event getBreakpoint(String eventName) {
        DelegatingDebuggerImpl ddi=(DelegatingDebuggerImpl) Register.getDebuggerCoreImpl();
        CoreBreakpoint.Event events[]=ddi.getEvents();
        int i=0;
        while ((ib
     * according to the value of suspend.
     *
     * @param b breakpoint the changed property belongs to.
     * @param suspend new value of the suspend_debugging property.
     * @return true when the property was successfully
     * changed.
     */
    public static boolean setSuspend(CoreBreakpoint b, boolean suspend) {
        CoreBreakpoint.Action[] sas=b.getActions();
        int i=0;
        for (; i
... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.