public static void worked(IProgressMonitor monitor, int units) throws CancelException { if (monitor != null) { monitor.worked(units); if (monitor.isCanceled()) { throw CancelException.make("cancelled in " + monitor.toString()); } } }
public static CancelException make(String msg) { return new CancelException(msg); }
@SuppressWarnings("deprecation") public AbstractRootMethod getLanguageRoot(Atom language){ if (!languageRoots.containsKey(language)) { AbstractRootMethod languageRoot = roots.get(language, this); CGNode languageRootNode = null; try { languageRootNode = findOrCreateNode(languageRoot, Everywhere.EVERYWHERE); } catch (CancelException e) { e.printStackTrace(); Assertions.UNREACHABLE(); } languageRootNodes.add(languageRootNode); CallSiteReference site = CallSiteReference.make(1, languageRoot.getReference(), IInvokeInstruction.Dispatch.STATIC); CGNode fakeRootNode = getFakeRootNode(); CrossLanguageFakeRoot fakeRootMethod = (CrossLanguageFakeRoot) fakeRootNode.getMethod(); site = fakeRootMethod.addInvocationInternal(new int[0], site).getCallSite(); fakeRootNode.addTarget(site, languageRootNode); languageRoots.put(language, languageRoot); } return (AbstractRootMethod) languageRoots.get(language); }
@Override public Set<CGNode> getPossibleTargets(CGNode node, CallSiteReference site) { return Iterator2Collection.toSet( new MapIterator<IMethod,CGNode>( new FilterIterator<>( getPossibleTargets(site), this::isRelevantMethod ), object -> { try { return findOrCreateNode(object, Everywhere.EVERYWHERE); } catch (CancelException e) { assert false : e.toString(); return null; } })); }
@SuppressWarnings("deprecation") public AbstractRootMethod getLanguageRoot(Atom language){ if (!languageRoots.containsKey(language)) { AbstractRootMethod languageRoot = roots.get(language, this); CGNode languageRootNode = null; try { languageRootNode = findOrCreateNode(languageRoot, Everywhere.EVERYWHERE); } catch (CancelException e) { e.printStackTrace(); Assertions.UNREACHABLE(); } languageRootNodes.add(languageRootNode); CallSiteReference site = CallSiteReference.make(1, languageRoot.getReference(), IInvokeInstruction.Dispatch.STATIC); CGNode fakeRootNode = getFakeRootNode(); CrossLanguageFakeRoot fakeRootMethod = (CrossLanguageFakeRoot) fakeRootNode.getMethod(); site = fakeRootMethod.addInvocationInternal(new int[0], site).getCallSite(); fakeRootNode.addTarget(site, languageRootNode); languageRoots.put(language, languageRoot); } return (AbstractRootMethod) languageRoots.get(language); }
@Override public Set<CGNode> getPossibleTargets(CGNode node, CallSiteReference site) { return Iterator2Collection.toSet( new MapIterator<IMethod,CGNode>( new FilterIterator<>( getPossibleTargets(site), this::isRelevantMethod ), object -> { try { return findOrCreateNode(object, Everywhere.EVERYWHERE); } catch (CancelException e) { assert false : e.toString(); return null; } })); }
public static void done(IProgressMonitor monitor) throws CancelException { if (monitor != null) { monitor.done(); if (monitor.isCanceled()) { throw CancelException.make("cancelled in " + monitor.toString()); } } }
@Test public void testSwitch1() { try { runTest(singleTestSrc(), rtJar, simpleTestEntryPoint(), emptyList, true, null); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (CancelException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
public static CancelException make(String msg) { return new CancelException(msg); }
public static void worked(IProgressMonitor monitor, int units) throws CancelException { if (monitor != null) { monitor.worked(units); if (monitor.isCanceled()) { throw CancelException.make("cancelled in " + monitor.toString()); } } }
public static CancelException make(String msg) { return new CancelException(msg); }
public static void done(IProgressMonitor monitor) throws CancelException { if (monitor != null) { monitor.done(); if (monitor.isCanceled()) { throw CancelException.make("cancelled in " + monitor.toString()); } } }
public static void done(IProgressMonitor monitor) throws CancelException { if (monitor != null) { monitor.done(); if (monitor.isCanceled()) { throw CancelException.make("cancelled in " + monitor.toString()); } } }
public static void worked(IProgressMonitor monitor, int units) throws CancelException { if (monitor != null) { monitor.worked(units); if (monitor.isCanceled()) { throw CancelException.make("cancelled in " + monitor.toString()); } } }
public static void throwExceptionIfCanceled(IProgressMonitor progressMonitor) throws CancelException { if (progressMonitor != null) { if (progressMonitor.isCanceled()) { throw CancelException.make(progressMonitor.getCancelMessage()); } } } /** BEGIN Custom change: more on subtasks */
public static void throwExceptionIfCanceled(IProgressMonitor progressMonitor) throws CancelException { if (progressMonitor != null) { if (progressMonitor.isCanceled()) { throw CancelException.make(progressMonitor.getCancelMessage()); } } } /** BEGIN Custom change: more on subtasks */
public static void beginTask(IProgressMonitor monitor, String task, int totalWork) throws CancelException { if (monitor != null) { monitor.beginTask(task, totalWork); if (monitor.isCanceled()) { throw CancelException.make("cancelled in " + task); } } }
public static void beginTask(IProgressMonitor monitor, String task, int totalWork) throws CancelException { if (monitor != null) { monitor.beginTask(task, totalWork); if (monitor.isCanceled()) { throw CancelException.make("cancelled in " + task); } } }
/** BEGIN Custom change: more on subtasks */ public static void subTask(IProgressMonitor progressMonitor, String subTask) throws CancelException { if (progressMonitor != null) { progressMonitor.subTask(subTask); if (progressMonitor.isCanceled()) { throw CancelException.make("cancelled in " + subTask); } } }
/** BEGIN Custom change: more on subtasks */ public static void subTask(IProgressMonitor progressMonitor, String subTask) throws CancelException { if (progressMonitor != null) { progressMonitor.subTask(subTask); if (progressMonitor.isCanceled()) { throw CancelException.make("cancelled in " + subTask); } } }