Java Code Examples for com.sun.jdi.ObjectReference#equals()

The following examples show how to use com.sun.jdi.ObjectReference#equals() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ComponentBreakpointActionProvider.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public static ComponentBreakpoint findBreakpoint (ObjectReference component) {
    Breakpoint[] breakpoints = DebuggerManager.getDebuggerManager().getBreakpoints();
    for (int i = 0; i < breakpoints.length; i++) {
        if (!(breakpoints[i] instanceof ComponentBreakpoint)) {
            continue;
        }
        ComponentBreakpoint ab = (ComponentBreakpoint) breakpoints[i];
        Session currentSession = DebuggerManager.getDebuggerManager().getCurrentSession();
        if (currentSession != null) {
            JPDADebugger debugger = currentSession.lookupFirst(null, JPDADebugger.class);
            if (debugger != null) {
                if (component.equals(ab.getComponent().getComponent(debugger))) {
                    return ab;
                }
            }
        }
    }
    return null;
}
 
Example 2
Source File: TakeScreenshotActionProvider.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private ComponentInfo findComponentInfo(ComponentInfo ci, ObjectReference oc) {
    if (ci instanceof JavaComponentInfo) {
        ObjectReference or = ((JavaComponentInfo) ci).getComponent();
        if (oc.equals(or)) {
            return ci;
        }
    }
    for (ComponentInfo sci : ci.getSubComponents()) {
        ComponentInfo fci = findComponentInfo(sci, oc);
        if (fci != null) {
            return fci;
        }
    }
    return null;
}
 
Example 3
Source File: DecisionProcedureGuidanceJDI.java    From jbse with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean areAlias(ReferenceSymbolic first, ReferenceSymbolic second) throws GuidanceException {
    final ObjectReference objectFirst = (ObjectReference) getJDIValue(first);
    final ObjectReference objectSecond = (ObjectReference) getJDIValue(second);
    return ((objectFirst == null && objectSecond == null) || 
            (objectFirst != null && objectSecond != null && objectFirst.equals(objectSecond)));
}