auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
RevCommit next() throws MissingObjectException, IncorrectObjectTypeException, IOException { for (;;) { final RevCommit c = pending.next(); if (c == null) return null; if (c.inDegree > 0) { c.flags |= TOPO_DELAY; continue; } for (int i = 0; i < c.parents.length; i++) { if (i > 0 && firstParent) { break; } RevCommit p = c.parents[i]; if (--p.inDegree == 0 && (p.flags & TOPO_DELAY) != 0) { p.flags &= ~TOPO_DELAY; pending.unpop(p); } } return c; } }

Target:
RevCommit next() throws MissingObjectException, IncorrectObjectTypeException, IOException { for (;;) { final RevCommit c = pending.next(); if (c == null) return null; if (c.inDegree > 0) { c.flags |= TOPO_DELAY; continue; } for (int i = 0; i < c.parents.length; i++) { if (firstParent && i > 0) { break; } RevCommit p = c.parents[i]; if (--p.inDegree == 0 && (p.flags & TOPO_DELAY) != 0) { p.flags &= ~TOPO_DELAY; pending.unpop(p); } } return c; } }
Source:
public void testConfiguredConfigEnabled() { CallOptionsConfig config = new CallOptionsConfig.Builder().setUseTimeout(true).build(); CallOptionsFactory factory = new CallOptionsFactory.ConfiguredCallOptionsFactory(config); Assert.assertEquals( (double) config.getShortRpcTimeoutMs(), getDeadlineMs(factory, MutateRowRequest.getDefaultInstance()), 100.0 ); Assert.assertEquals( (double) config.getLongRpcTimeoutMs(), (double) getDeadlineMs(factory, MutateRowsRequest.getDefaultInstance()), 100.0 ); }

Target:
public void testConfiguredConfigEnabled() { CallOptionsConfig config = new CallOptionsConfig.Builder().setUseTimeout(true).build(); CallOptionsFactory factory = new CallOptionsFactory.ConfiguredCallOptionsFactory(config); assertEqualsDeadlines( config.getShortRpcTimeoutMs(), getDeadlineMs(factory, MutateRowRequest.getDefaultInstance()) ); assertEqualsDeadlines( config.getLongRpcTimeoutMs(), getDeadlineMs(factory, MutateRowsRequest.getDefaultInstance()) ); }
Source:
public int hashCode() { return Objects.hash(pointer, ownerName, owner, readers, writers); }

Target:
public int hashCode() { return Objects.hash(pointer, ownerName); }
Source:
private Contentlet createContentlet(final ContentType contentType) { final ContentletDataGen contentletDataGen = new ContentletDataGen(contentType.id()); Contentlet contentlet = contentletDataGen.next(); contentlet.setStringProperty("widgetTitle", "New YouTube Content"); contentlet.setStringProperty("url", "new-youtube-content"); contentlet = contentletDataGen.persist(contentlet); return contentlet; }

Target:
private Contentlet createContentlet(final ContentType contentType) { return new ContentletDataGen(contentType.id()) .setProperty("widgetTitle", "New YouTube Content") .setProperty("url", "new-youtube-content").nextPersisted(); }
Source:
public void testFiltersByDate() throws Exception { FeatureSource fs = dataStore.getFeatureSource( tname("dates") ); FilterFactory ff = dataStore.getFilterFactory(); DateFormat df = new SimpleDateFormat("yyyy-dd-MM"); df.setTimeZone( TimeZone.getTimeZone("PST")); Filter f = ff.lessOrEqual( ff.property( aname("d") ), ff.literal("2009-06-28") ); assertEquals( 2, fs.getCount( new DefaultQuery(tname("dates"),f ) ) ); f = ff.lessOrEqual( ff.property( aname("d") ), ff.literal( df.parse("2009-28-06") ) ); assertEquals( 2, fs.getCount( new DefaultQuery(tname("dates"),f ) ) ); }

Target:
public void testFiltersByDate() throws Exception { FeatureSource fs = dataStore.getFeatureSource( tname("dates") ); FilterFactory ff = dataStore.getFilterFactory(); DateFormat df = new SimpleDateFormat("yyyy-dd-MM"); df.setTimeZone( TimeZone.getTimeZone("PST")); Filter f = ff.lessOrEqual( ff.property( aname("d") ), ff.literal( df.parse("2009-28-06") ) ); assertEquals( 2, fs.getCount( new DefaultQuery(tname("dates"),f ) ) ); f = ff.lessOrEqual( ff.property( aname("d") ),ff.literal( df.parse("2009-28-06") ) ); assertEquals( 2, fs.getCount( new DefaultQuery(tname("dates"),f ) ) ); }
Source:
public static Collection<Object> getSatisfiedAuthenticationMethods(final Authentication authentication) { if (authentication.getAttributes().containsKey(MultiFactorAuthenticationSupportingWebApplicationService.CONST_PARAM_AUTHN_METHOD)) { final Object methods = authentication.getAttributes().get( MultiFactorAuthenticationSupportingWebApplicationService.CONST_PARAM_AUTHN_METHOD); if (methods != null) { return MultiFactorUtils.convertValueToCollection(methods); } } return Collections.emptyList(); }

Target:
public static Set<String> getSatisfiedAuthenticationMethods(final Authentication authentication) { if (authentication.getAttributes().containsKey(MultiFactorAuthenticationSupportingWebApplicationService.CONST_PARAM_AUTHN_METHOD)) { final Object methods = authentication.getAttributes().get( MultiFactorAuthenticationSupportingWebApplicationService.CONST_PARAM_AUTHN_METHOD); if (methods != null) { final Set<Object> valuesAsACollection = convertValueToCollection(methods); return new HashSet<String>(Arrays.asList(valuesAsACollection.toArray(new String[] {}))); } } return Collections.emptySet(); }
Source:
public void canReadItemJustWritten() throws BufferIOException { CircularBuffer<Integer> buffer = new CircularBuffer<>(1); buffer.write(1); assertEquals((int) buffer.read(), 1); }

Target:
public void canReadItemJustWritten() throws BufferIOException { CircularBuffer<Integer> buffer = new CircularBuffer<>(1); buffer.write(1); assertThat(buffer.read(), is(1)); }
Source:
private boolean shouldRedraw(AnyObjectId headId, AnyObjectId fetchHeadId, List<FilterPath> paths) { boolean pathChanged = pathChanged(pathFilters, paths); boolean headChanged = headId == null || !headId.equals(currentHeadId); boolean allBranchesChanged = currentShowAllBranches != store .getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_ALL_BRANCHES); currentShowAllBranches = store .getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_ALL_BRANCHES); boolean firstParentOnlyChanged = currentShowFirstParentOnly != isShowFirstParentOnly(); currentShowFirstParentOnly = isShowFirstParentOnly(); boolean additionalRefsChange = currentShowAdditionalRefs != store .getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_ADDITIONAL_REFS); currentShowAdditionalRefs = store .getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_ADDITIONAL_REFS); boolean fetchHeadChanged = currentShowAdditionalRefs && fetchHeadId != null && !fetchHeadId.equals(currentFetchHeadId); boolean showNotesChanged = currentShowNotes != store .getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_NOTES); currentShowNotes = store .getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_NOTES); boolean followRenamesChanged = currentFollowRenames != getFollowRenames(); currentFollowRenames = getFollowRenames(); return pathChanged || headChanged || fetchHeadChanged || allBranchesChanged || firstParentOnlyChanged || additionalRefsChange || showNotesChanged || followRenamesChanged; }

Target:
private boolean shouldRedraw(AnyObjectId headId, AnyObjectId fetchHeadId, List<FilterPath> paths) { boolean pathChanged = pathChanged(pathFilters, paths); boolean headChanged = headId == null || !headId.equals(currentHeadId); boolean allBranchesChanged = currentShowAllBranches != store .getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_ALL_BRANCHES); currentShowAllBranches = store .getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_ALL_BRANCHES); boolean isShowFirstParentOnly = isShowFirstParentOnly(); boolean firstParentOnlyChanged = currentShowFirstParentOnly != isShowFirstParentOnly; currentShowFirstParentOnly = isShowFirstParentOnly; boolean additionalRefsChange = currentShowAdditionalRefs != store .getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_ADDITIONAL_REFS); currentShowAdditionalRefs = store .getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_ADDITIONAL_REFS); boolean fetchHeadChanged = currentShowAdditionalRefs && fetchHeadId != null && !fetchHeadId.equals(currentFetchHeadId); boolean showNotesChanged = currentShowNotes != store .getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_NOTES); currentShowNotes = store .getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_NOTES); boolean followRenamesChanged = currentFollowRenames != getFollowRenames(); currentFollowRenames = getFollowRenames(); return pathChanged || headChanged || fetchHeadChanged || allBranchesChanged || firstParentOnlyChanged || additionalRefsChange || showNotesChanged || followRenamesChanged; }
Source:
public void testAttachContainerToNetwork() { api().connectContainerToNetwork(network.id(), container.id()); Container foundContainer = api.getContainerApi().inspectContainer(container.id()); assertNotNull(Iterables.tryFind(foundContainer.networkSettings().networks().keySet(), Predicates.equalTo(network.name())).orNull()); }

Target:
public void testAttachContainerToNetwork() { api().connectContainerToNetwork(network.id(), container.id()); container = api.getContainerApi().inspectContainer(container.id()); assertTrue(Iterables.any(container.networkSettings().networks().keySet(), Predicates.equalTo(network.name()))); }
Source:
public Version toOSGIVersion() { return new Version(toString()); }

Target:
final public Version toOSGIVersion() { try { return new Version(toString()); } catch (IllegalArgumentException e) { return null; } }
Source:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest req = (HttpServletRequest) request; if (!FiltersHelper.isAuthenticated(req) || !FiltersHelper.isSessionValid((HttpServletRequest) request, (HttpServletResponse) response)) { authenticateWithSSO(req, (HttpServletResponse) response); } chain.doFilter(request, response); }

Target:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest req = (HttpServletRequest) request; HttpServletResponse resp = (HttpServletResponse) response; if (FiltersHelper.isAuthenticated(req) && FiltersHelper.isSessionValid((HttpServletRequest) request, (HttpServletResponse) response)) { chain.doFilter(request, response); } else { try { req.setAttribute(FiltersHelper.Constants.REQUEST_SCHEMES_KEY, schemes); HttpSession session = req.getSession(false); Deque<AuthenticationProfile> stack = null; if (session != null) { stack = (Deque<AuthenticationProfile>) session.getAttribute(STACK_ATTR); } if (stack == null) { stack = new ArrayDeque<>(); stack.addAll(profiles); } String username = doAuth(req, resp, stack); if (!stack.isEmpty()) { req.getSession(true).setAttribute(STACK_ATTR, stack); } else { if (session != null) { session.removeAttribute(STACK_ATTR); } if (StringUtils.isNotEmpty(username)) { Map<String, Object> jsonResponse = SSOOAuthServiceUtils.loginOnBehalf(resp, username, scope); FiltersHelper.isStatusOk(jsonResponse); SSOUtils.createUserSession(req, FiltersHelper.getPayloadForToken(resp, (String) jsonResponse.get("access_token")), false); } chain.doFilter(req, resp); } } catch (Exception e) { log.error("Cannot authenticate using External Authentication: {}", e.getMessage()); log.debug("Cannot authenticate using External Authentication", e); } } }
Source:
private void setupController() { try{ if (player != null) { View f = getView(); if (f != null) { ViewGroup container = (ViewGroup) f .findViewById(R.id.preview_container); PlayerController controller = new PlayerController( getActivity()); controller.setAnchorView(container); controller.setAutoHide(true); controller.setPrevNextListeners(nextListner, prevListner); player.setController(controller); player.setShareVideoListener(this); reAttachPlayEventListener(); } else { } } else { } }catch(Exception e){ logger.error(e); } }

Target:
private void setupController() { if (null == player) { return; } try { View f = getView(); if (f == null) { return; } final ViewGroup container = (ViewGroup) f .findViewById(R.id.preview_container); final PlayerController controller = new PlayerController( getActivity()); controller.setAnchorView(container); controller.setAutoHide(true); controller.setNextPreviousListeners(nextListner, prevListner); player.setController(controller); player.setShareVideoListener(this); reAttachPlayEventListener(); } catch(Exception e) { logger.error(e); } }
Source:
public void start(ComponentContext context) { super.start(context); List<BatchHandlerDescriptor> descriptors = getDescriptors(EP_BATCH_HANDLER); descriptors.forEach(d -> { try { BatchHandler handler = d.klass.newInstance(); handler.initialize(d.name, d.properties); handlers.put(d.name, handler); } catch (ReflectiveOperationException e) { getLog().error(e); } }); }

Target:
public void start(ComponentContext context) { super.start(context); List<BatchHandlerDescriptor> descriptors = getDescriptors(XP_BATCH_HANDLER); descriptors.forEach(d -> { try { BatchHandler handler = d.klass.newInstance(); handler.initialize(d.name, d.properties); handlers.put(d.name, handler); } catch (ReflectiveOperationException e) { getLog().error(e,e); } }); }
Source:
public void testHighWaterMark() throws Exception { try (Scenario scenario = new Scenario(0, 2)) { TFuture<RawResponse> future1 = scenario.sendRequest(100); TFuture<RawResponse> future2 = scenario.sendRequest(100); scenario.releaseResponses(2); int success = 0; if (ResponseCode.OK.equals(future1.get().getResponseCode())) { success += 1; assertEquals(ErrorType.Timeout, future2.get().getError().getErrorType()); } if (ResponseCode.OK.equals(future2.get().getResponseCode())) { success += 1; assertEquals(ErrorType.Timeout, future1.get().getError().getErrorType()); } assertEquals(1, success); } }

Target:
public void testHighWaterMark() throws Exception { try (Scenario scenario = new Scenario(0, 2)) { ArrayList<TFuture<RawResponse>> futures = new ArrayList<>(); futures.add(scenario.sendRequest(1000)); Thread.sleep(100); futures.add(scenario.sendRequest(1000)); Thread.sleep(100); futures.add(scenario.sendRequest(1000)); Thread.sleep(100); assertEquals(2, scenario.responseGate.getQueueLength()); scenario.releaseResponses(futures.size()); for (TFuture<RawResponse> future : futures) { assertEquals(ResponseCode.OK, future.get().getResponseCode()); } } }
Source:
protected void initiateLoginAttempt(boolean restoreSession) { LoginMode loginMode = uiController.getLoginMode(); if (uiController.getEnteredPasswordOrPin().equals("") && loginMode != LoginMode.PRIMED) { if (loginMode == LoginMode.PASSWORD) { raiseLoginMessage(StockMessages.Auth_EmptyPassword, false); return; } else { raiseLoginMessage(StockMessages.Auth_EmptyPin, false); return; } } uiController.clearErrorMessage(); ViewUtil.hideVirtualKeyboard(LoginActivity.this); if (loginMode == LoginMode.PASSWORD) { DevSessionRestorer.tryAutoLoginPasswordSave(uiController.getEnteredPasswordOrPin()); } if (ResourceInstallUtils.isUpdateReadyToInstall()) { installPendingUpdate(); } else { localLoginOrPullAndLogin(restoreSession); } }

Target:
protected void initiateLoginAttempt(boolean restoreSession) { LoginMode loginMode = uiController.getLoginMode(); if ("".equals(uiController.getEnteredPasswordOrPin()) && loginMode != LoginMode.PRIMED) { if (loginMode == LoginMode.PASSWORD) { raiseLoginMessage(StockMessages.Auth_EmptyPassword, false); } else { raiseLoginMessage(StockMessages.Auth_EmptyPin, false); } return; } uiController.clearErrorMessage(); ViewUtil.hideVirtualKeyboard(LoginActivity.this); if (loginMode == LoginMode.PASSWORD) { DevSessionRestorer.tryAutoLoginPasswordSave(uiController.getEnteredPasswordOrPin()); } if (ResourceInstallUtils.isUpdateReadyToInstall()) { installPendingUpdate(); } else { localLoginOrPullAndLogin(restoreSession); } }
Source:
public void testReadOnlySlow() throws IOException { ByteBuffer msg = createMsg("@ReadOnlySlow", "select * from a"); ClientResponseImpl resp = m_ci.handleRead(msg, m_handler, m_cxn); assertNull(resp); ArgumentCaptor<LocalObjectMessage> captor = ArgumentCaptor.forClass(LocalObjectMessage.class); verify(m_messenger).send(eq(32L), captor.capture()); assertTrue(captor.getValue().payload instanceof AdHocPlannerWork); String payloadString = captor.getValue().payload.toString(); assertTrue(payloadString.contains("user partitioning: none")); }

Target:
public void testReadOnlySlow() throws IOException { ByteBuffer msg = createMsg("@ReadOnlySlow", "select * from a"); ClientResponseImpl resp = m_ci.handleRead(msg, m_handler, m_cxn); assertNull(resp); ArgumentCaptor<LocalObjectMessage> captor = ArgumentCaptor.forClass(LocalObjectMessage.class); verify(m_messenger).send(eq(32L), captor.capture()); assertTrue(captor.getValue().payload instanceof AdHocPlannerWork); String payloadString = captor.getValue().payload.toString(); assertTrue(payloadString.contains("user partitioning: none")); reset(m_messenger); msg = createMsg("@ReadOnlySlow", "select * from a where i = 3", 3); resp = m_ci.handleRead(msg, m_handler, m_cxn); assertNull(resp); verify(m_messenger).send(eq(32L), captor.capture()); assertTrue(captor.getValue().payload instanceof AdHocPlannerWork); payloadString = captor.getValue().payload.toString(); assertTrue(payloadString.contains("user param[1]: 3")); assertTrue(payloadString.contains("user partitioning: none")); }
Source:
public Object set(final int index, final Object element) { Object prev = null; if (checkString(index)) prev = table.getStringValue(col, index); else prev = table.getValueAsDouble(col, index); if (element instanceof String) table.setValue(col, index, (String) element); else if (element instanceof Number) table.setValue(col, index, ((Number) element).doubleValue()); else throw new IllegalArgumentException("element must be String or Double"); return prev; }

Target:
public Object set(final int index, final Object element) { Object prev = null; if (checkString(index)) prev = table.getStringValue(col, index); else prev = table.getValueAsDouble(col, index); if (element instanceof Number) table.setValue(col, index, ((Number) element) .doubleValue()); else if (element != null) table.setValue(col, index, element.toString()); else throw new NullPointerException(); return prev; }
Source:
private void handleError(Map action) { String msg = (String) action.get("msg"); if (msg != null) { _collector.reportError(new Exception("Shell Process Exception: " + msg)); } }

Target:
private void handleError(Map action) { String msg = (String) action.get("msg"); _collector.reportError(new Exception("Shell Process Exception: " + msg)); }
Source:
public Object createModelObject(Class<?> model, OpenEngSBModelEntry... entries) throws IllegalArgumentException { LOGGER.debug("createModelObject for model interface called", model.getName()); boolean valid = false; for (Class<?> i : model.getInterfaces()) { if (i.equals(OpenEngSBModel.class)) { valid = true; break; } } if (!valid) { throw new IllegalArgumentException("the model class is not an interface of OpenEngSBModel"); } return generateProxy(model, entries); }

Target:
private Object createModelObject(Class<?> model, OpenEngSBModelEntry... entries) { ClassLoader classLoader = model.getClassLoader(); Class<?>[] classes = new Class<?>[]{ OpenEngSBModel.class, model }; InvocationHandler handler = makeHandler(model, entries); return Proxy.newProxyInstance(classLoader, classes, handler); }
Source:
public void onActivityResult(final int requestCode, int resultCode, final Intent intent) { if (mRequestQuestionId == null || resultCode != RESULT_OK) { mRequestQuestionId = null; return; } mAdapter.setOnTabLoadedListener(new SurveyTabAdapter.OnTabLoadedListener() { @Override public void OnTabLoaded() { switch (requestCode) { case ConstantUtil.PHOTO_ACTIVITY_REQUEST: onImageTaken(); break; case ConstantUtil.VIDEO_ACTIVITY_REQUEST: onVideoTaken(intent.getData()); break; case ConstantUtil.GET_PHOTO_ACTIVITY_REQUEST: onImageAcquired(intent.getData()); break; case ConstantUtil.GET_VIDEO_ACTIVITY_REQUEST: onVideoAcquired(intent.getData()); break; case ConstantUtil.CADDISFLY_REQUEST: case ConstantUtil.SCAN_ACTIVITY_REQUEST: case ConstantUtil.PLOTTING_REQUEST: case ConstantUtil.SIGNATURE_REQUEST: default: mAdapter.onQuestionResultReceived(mRequestQuestionId, intent.getExtras()); break; } mAdapter.setOnTabLoadedListener(null); mRequestQuestionId = null; } }); }

Target:
public void onActivityResult(final int requestCode, int resultCode, final Intent intent) { if (mRequestQuestionId == null || resultCode != RESULT_OK) { mRequestQuestionId = null; return; } if (mAdapter.getQuestionView(mRequestQuestionId) == null) { mAdapter.setOnTabLoadedListener(new SurveyTabAdapter.OnTabLoadedListener() { @Override public void onTabLoaded() { setResult(requestCode, intent, mRequestQuestionId); mAdapter.setOnTabLoadedListener(null); } }); } else { setResult(requestCode, intent, mRequestQuestionId); } }
Source:
public LuceneCollectors build() { TopDocsCollector<?> topDocsCollector = null; LuceneScoreDocPostProcessor scoreDocPostProcessor = null; if ( requireTopDocs && maxDocs > 0 ) { if ( sort == null ) { topDocsCollector = TopScoreDocCollector.create( maxDocs, Integer.MAX_VALUE ); } else { if ( requireScore ) { SortField[] sortFields = sort.getSort(); for ( int i = 0; i < sortFields.length; i++ ) { SortField sortField = sortFields[i]; if ( sortField.getType() == SortField.Type.SCORE ) { scoreDocPostProcessor = new LuceneTopFieldCollectorScoreSortPostProcessor( i ); break; } } scoreDocPostProcessor = new LuceneTopFieldCollectorRescoringPostProcessor(); } topDocsCollector = TopFieldCollector.create( sort, maxDocs, Integer.MAX_VALUE ); } luceneCollectors.add( topDocsCollector ); } Collector compositeCollector; if ( luceneCollectors.size() == 1 ) { compositeCollector = luceneCollectors.get( 0 ); } else { compositeCollector = MultiCollector.wrap( luceneCollectors ); } return new LuceneCollectors( topDocsCollector, totalHitCountCollector, compositeCollector, scoreDocPostProcessor ); }

Target:
public LuceneCollectors build() { TopDocsCollector<?> topDocsCollector = null; Integer scoreSortFieldIndexForRescoring = null; boolean requireFieldDocRescoring = false; if ( requireTopDocs && maxDocs > 0 ) { if ( sort == null ) { topDocsCollector = TopScoreDocCollector.create( maxDocs, Integer.MAX_VALUE ); } else { if ( requireScore ) { requireFieldDocRescoring = true; SortField[] sortFields = sort.getSort(); for ( int i = 0; i < sortFields.length; i++ ) { SortField sortField = sortFields[i]; if ( sortField.getType() == SortField.Type.SCORE ) { scoreSortFieldIndexForRescoring = i; break; } } } topDocsCollector = TopFieldCollector.create( sort, maxDocs, Integer.MAX_VALUE ); } luceneCollectors.add( topDocsCollector ); } Collector compositeCollector; if ( luceneCollectors.size() == 1 ) { compositeCollector = luceneCollectors.get( 0 ); } else { compositeCollector = MultiCollector.wrap( luceneCollectors ); } return new LuceneCollectors( topDocsCollector, totalHitCountCollector, compositeCollector, requireFieldDocRescoring, scoreSortFieldIndexForRescoring ); }
Source:
static Stream<Arguments> filePositionFromQuery() { return Stream.of( Arguments.of(null, -1, -1), Arguments.of("?!", -1, -1), Arguments.of("line=ZZ", -1, -1), Arguments.of("line=42", 42, -1), Arguments.of("line=42&line=24", 24, -1), Arguments.of("line=42&column=99", 42, 99), Arguments.of("line=42&column=ZZ", 42, -1) ); }

Target:
static Stream<Arguments> filePositionFromQuery() { return Stream.of( arguments(null, -1, -1), arguments("?!", -1, -1), arguments("line=ZZ", -1, -1), arguments("line=42", 42, -1), arguments("line=42&line=24", 24, -1), arguments("line=42&column=99", 42, 99), arguments("line=42&column=ZZ", 42, -1) ); }
Source:
private void doAsyncCreate(final String path, final byte[] data, final CreateMode mode, final long startT, final ZkAsyncCallbacks.CreateCallbackHandler cb, final String expectedSessionId) { retryUntilConnected(() -> { final ZooKeeper zk; try { zk = getExpectedZookeeper(expectedSessionId); } catch (ZkSessionMismatchedException e) { cb.processResult(KeeperException.Code.BADARGUMENTS.intValue(), path, new ZkAsyncCallMonitorContext(_monitor, startT, 0, false), null); throw e; } zk.create(path, data, ZooDefs.Ids.OPEN_ACL_UNSAFE, mode, cb, new ZkAsyncRetryCallContext(_asyncCallRetryThread, cb, _monitor, startT, 0, false) { @Override protected void doRetry() { doAsyncCreate(path, data, mode, System.currentTimeMillis(), cb, expectedSessionId); } }); return null; }); }

Target:
private void doAsyncCreate(final String path, final byte[] data, final CreateMode mode, final long startT, final ZkAsyncCallbacks.CreateCallbackHandler cb, final String expectedSessionId) { try { retryUntilConnected(() -> { getExpectedZookeeper(expectedSessionId) .create(path, data, ZooDefs.Ids.OPEN_ACL_UNSAFE, mode, cb, new ZkAsyncRetryCallContext(_asyncCallRetryThread, cb, _monitor, startT, 0, false) { @Override protected void doRetry() { doAsyncCreate(path, data, mode, System.currentTimeMillis(), cb, expectedSessionId); } }); return null; }); } catch (RuntimeException e) { cb.processResult(ZkAsyncCallbacks.UNKNOWN_RET_CODE, path, new ZkAsyncCallMonitorContext(_monitor, startT, 0, false), null); throw e; } }
Source:
public void close() { LOG.info("Closing crutch consumer and removing ip address change listener"); super.close(); this.kafkaLocationManager.removeIpAddressChangeListener(brokerIpAddressChangeListener); }

Target:
public void close() { this.kafkaLocationManager.removeIpAddressChangeListener(brokerIpAddressChangeListener); super.close(); }
Source:
public void setNull(long columnIndex) { parent.checkImmutable(); getTable().checkNullValueIsLegal(columnIndex, getIndex()); nativeSetNull(nativePointer, columnIndex); }

Target:
public void setNull(long columnIndex) { parent.checkImmutable(); getTable().checkDuplicatedNullForPrimaryKeyValue(columnIndex, getIndex()); nativeSetNull(nativePointer, columnIndex); }
Source:
public MessageContext receive() { if (isAlive()) { try { GetResponse delivery = channel.basicGet(queueName, false); if (delivery != null) { StorableMessage storableMessage = deserializeMessage(channel, delivery); org.apache.axis2.context.MessageContext axis2Mc = store.newAxis2Mc(); MessageContext synapseMc = store.newSynapseMc(axis2Mc); synapseMc = MessageConverter.toMessageContext(storableMessage, axis2Mc, synapseMc); updateCache(delivery, delivery.getProps().getMessageId()); log.info(getId() + " Received MessageId: " + delivery.getProps().getMessageId()); if (log.isDebugEnabled()) { log.debug(getId() + " Received MessageId: " + delivery.getProps().getMessageId()); } return synapseMc; } } catch (ShutdownSignalException | IOException e) { log.error(getId() + " connection error when receiving messages." + e); } } else { cleanup(); setConnection(store.createConnection()); setChannel(store.createChannel(connection)); } return null; }

Target:
public MessageContext receive() { if (isAlive()) { GetResponse delivery = null; try { delivery = channel.basicGet(queueName, false); if (delivery != null) { StorableMessage storableMessage = deserializeMessage(delivery); org.apache.axis2.context.MessageContext axis2Mc = store.newAxis2Mc(); MessageContext synapseMc = store.newSynapseMc(axis2Mc); synapseMc = MessageConverter.toMessageContext(storableMessage, axis2Mc, synapseMc); updateCache(delivery, delivery.getProps().getMessageId()); if (log.isDebugEnabled()) { log.debug(getId() + " Received MessageId: " + delivery.getProps().getMessageId()); } return synapseMc; } } catch (ShutdownSignalException | IOException e) { log.error(getId() + " connection error when receiving messages.", e); cleanup(); } catch (ClassNotFoundException e) { log.error(getId() + "unable to read the stored message.", e); try { channel.basicAck(delivery.getEnvelope().getDeliveryTag(), false); } catch (IOException ex) { log.error(getId() + "unable to acknowledge the stored message.", e); } } } else { log.warn("The connection and channel to the RabbitMQ broker are unhealthy."); cleanup(); setConnection(store.createConnection()); setChannel(store.createChannel(connection)); } return null; }
Source:
public void edgeCaseTest() throws Exception { AsyncRequestResponseHandler requestResponseHandler; RequestResponseHandlerMetrics metrics; try { requestResponseHandler = getAsyncRequestResponseHandler(-1); fail("Setting request workers < 0 should have thrown exception"); } catch (IllegalArgumentException e) { } try { requestResponseHandler = getAsyncRequestResponseHandler(-1); fail("Setting request workers < 0 should have thrown exception"); } catch (IllegalArgumentException e) { } try { RestRequestService restRequestService = new MockRestRequestService(verifiableProperties, router); metrics = new RequestResponseHandlerMetrics(new MetricRegistry()); new AsyncRequestResponseHandler(metrics, 1, null); fail("Setting RestRequestService to null should have thrown exception"); } catch (IllegalArgumentException e) { } }

Target:
public void edgeCaseTest() throws Exception { AsyncRequestResponseHandler requestResponseHandler; RequestResponseHandlerMetrics metrics; try { requestResponseHandler = getAsyncRequestResponseHandler(-1); fail("Setting request workers < 0 should have thrown exception"); } catch (IllegalArgumentException e) { } try { RestRequestService restRequestService = new MockRestRequestService(verifiableProperties, router); metrics = new RequestResponseHandlerMetrics(new MetricRegistry()); new AsyncRequestResponseHandler(metrics, 1, null); fail("Setting RestRequestService to null should have thrown exception"); } catch (IllegalArgumentException e) { } }
Source:
public void tint (Color tint) { final float floatTint = tint.toFloatBits(); if (textChanged || oldTint != floatTint) { textChanged = false; oldTint = floatTint; markdown.tint(this, tint, floatTint); } }

Target:
public void tint (Color tint) { final float floatTint = tint.toFloatBits(); if (textChanged || oldTint != floatTint) { textChanged = false; oldTint = floatTint; markup.tint(this, tint); } }
Source:
handleOfflineReservationsWillExpire(Event event, List<TicketReservationInfo> reservations) { Map<String, Object> payload = new HashMap<>(); payload.put("reservations", reservations); asyncCall(ExtensionEvent.OFFLINE_RESERVATIONS_WILL_EXPIRE, event, payload); }

Target:
void handleOfflineReservationsWillExpire(Event event, List<TicketReservationInfo> reservations) { Map<String, Object> payload = new HashMap<>(); payload.put("reservations", reservations); asyncCall(ExtensionEvent.OFFLINE_RESERVATIONS_WILL_EXPIRE, event, payload); }
Source:
private void createMarriedWallet() throws BlockStoreException { wallet = new Wallet(params); blockStore = new MemoryBlockStore(params); chain = new BlockChain(params, wallet, blockStore); final DeterministicKeyChain keyChain = new DeterministicKeyChain(new SecureRandom()); DeterministicKey partnerKey = DeterministicKey.deserializeB58(null, keyChain.getWatchingKey().serializePubB58()); CustomTransactionSigner signer = new CustomTransactionSigner() { @Override public byte[] serialize() { return new byte[0]; } @Override protected SignatureAndKey getSignature(Sha256Hash sighash, List<ChildNumber> derivationPath) { ImmutableList<ChildNumber> keyPath = ImmutableList.copyOf(derivationPath); DeterministicKey key = keyChain.getKeyByPath(keyPath, true); return new SignatureAndKey(key.sign(sighash), key.getPubOnly()); } }; wallet.addTransactionSigner(signer); wallet.addFollowingAccountKeys(ImmutableList.of(partnerKey)); }

Target:
private void createMarriedWallet() throws BlockStoreException { wallet = new Wallet(params); blockStore = new MemoryBlockStore(params); chain = new BlockChain(params, wallet, blockStore); final DeterministicKeyChain keyChain = new DeterministicKeyChain(new SecureRandom()); DeterministicKey partnerKey = DeterministicKey.deserializeB58(null, keyChain.getWatchingKey().serializePubB58()); CustomTransactionSigner signer = new CustomTransactionSigner() { @Override protected SignatureAndKey getSignature(Sha256Hash sighash, List<ChildNumber> derivationPath) { ImmutableList<ChildNumber> keyPath = ImmutableList.copyOf(derivationPath); DeterministicKey key = keyChain.getKeyByPath(keyPath, true); return new SignatureAndKey(key.sign(sighash), key.getPubOnly()); } }; wallet.addTransactionSigner(signer); wallet.addFollowingAccountKeys(ImmutableList.of(partnerKey)); }
Source:
private void initOwner() { final VerticalPanel ownerPanel = new VerticalPanel(); ownerPanel.setStyleName(Gerrit.RESOURCES.css().groupOwnerPanel()); ownerPanel.add(new SmallHeading(Util.C.headingOwner())); ownerTxtBox = new NpTextBox(); ownerTxtBox.setVisibleLength(60); final AccountGroupSuggestOracle accountGroupOracle = new AccountGroupSuggestOracle(); ownerTxt = new SuggestBox(new RPCSuggestOracle( accountGroupOracle), ownerTxtBox); ownerTxt.setStyleName(Gerrit.RESOURCES.css().groupOwnerTextBox()); ownerPanel.add(ownerTxt); saveOwner = new Button(Util.C.buttonChangeGroupOwner()); saveOwner.setEnabled(false); saveOwner.addClickHandler(new ClickHandler() { @Override public void onClick(final ClickEvent event) { final String newOwner = ownerTxt.getText().trim(); if (newOwner.length() > 0) { AccountGroup.UUID ownerUuid = accountGroupOracle.getUUID(newOwner); GroupApi.setGroupOwner(getGroupUUID(), ownerUuid.get(), new GerritCallback<GroupInfo>() { public void onSuccess(final GroupInfo result) { updateOwnerGroup(result); saveOwner.setEnabled(false); } }); } } }); ownerPanel.add(saveOwner); add(ownerPanel); new OnEditEnabler(saveOwner, ownerTxtBox); }

Target:
private void initOwner() { final VerticalPanel ownerPanel = new VerticalPanel(); ownerPanel.setStyleName(Gerrit.RESOURCES.css().groupOwnerPanel()); ownerPanel.add(new SmallHeading(Util.C.headingOwner())); ownerTxtBox = new NpTextBox(); ownerTxtBox.setVisibleLength(60); final AccountGroupSuggestOracle accountGroupOracle = new AccountGroupSuggestOracle(); ownerTxt = new SuggestBox(new RPCSuggestOracle( accountGroupOracle), ownerTxtBox); ownerTxt.setStyleName(Gerrit.RESOURCES.css().groupOwnerTextBox()); ownerPanel.add(ownerTxt); saveOwner = new Button(Util.C.buttonChangeGroupOwner()); saveOwner.setEnabled(false); saveOwner.addClickHandler(new ClickHandler() { @Override public void onClick(final ClickEvent event) { final String newOwner = ownerTxt.getText().trim(); if (newOwner.length() > 0) { AccountGroup.UUID ownerUuid = accountGroupOracle.getUUID(newOwner); String ownerId = ownerUuid != null ? ownerUuid.get() : newOwner; GroupApi.setGroupOwner(getGroupUUID(), ownerId, new GerritCallback<GroupInfo>() { public void onSuccess(final GroupInfo result) { updateOwnerGroup(result); saveOwner.setEnabled(false); } }); } } }); ownerPanel.add(saveOwner); add(ownerPanel); new OnEditEnabler(saveOwner, ownerTxtBox); }
Source:
private void innerVerifyJobActive(final UUID jobId) throws IOException, JobRecoveryNotActiveException { try { client.getActiveJobSpectraS3(new GetActiveJobSpectraS3Request(jobId)); } catch (final FailedRequestException e) { throw new JobRecoveryNotActiveException(jobId, e.getMessage()); } }

Target:
private void innerVerifyJobActive(final UUID jobId) throws IOException, JobRecoveryNotActiveException { try { client.getActiveJobSpectraS3(new GetActiveJobSpectraS3Request(jobId)); } catch (final FailedRequestException e) { if (e.getStatusCode() == 404) { throw new JobRecoveryNotActiveException(jobId, e); } throw e; } }
Source:
public OptionalLong metadataDelete(ConnectorSession session, ConnectorTableHandle tableHandle, ConnectorTableLayoutHandle tableLayoutHandle) { HiveTableHandle handle = (HiveTableHandle) tableHandle; HiveTableLayoutHandle layoutHandle = (HiveTableLayoutHandle) tableLayoutHandle; Optional<Table> table = metastore.getTable(handle.getSchemaName(), handle.getTableName()); if (!table.isPresent()) { throw new TableNotFoundException(handle.getSchemaTableName()); } List<ColumnHandle> partitionColumns = layoutHandle.getPartitionColumns(); if (!layoutHandle.getEffectivePredicate().getDomains() .map(domains -> Maps.filterKeys(domains, not(Predicates.in(partitionColumns)))) .orElse(ImmutableMap.of()).isEmpty()) { throw new PrestoException(NOT_SUPPORTED, "This connector only supports delete where one or more partitions are deleted entirely"); } if (table.get().getPartitionColumns().isEmpty()) { metastore.truncateUnpartitionedTable(session, handle.getSchemaName(), handle.getTableName()); } else { for (HivePartition hivePartition : getOrComputePartitions(layoutHandle, session, tableHandle)) { metastore.dropPartition(session, handle.getSchemaName(), handle.getTableName(), toPartitionValues(hivePartition.getPartitionId())); } } return OptionalLong.empty(); }

Target:
public OptionalLong metadataDelete(ConnectorSession session, ConnectorTableHandle tableHandle, ConnectorTableLayoutHandle tableLayoutHandle) { HiveTableHandle handle = (HiveTableHandle) tableHandle; HiveTableLayoutHandle layoutHandle = (HiveTableLayoutHandle) tableLayoutHandle; Optional<Table> table = metastore.getTable(handle.getSchemaName(), handle.getTableName()); if (!table.isPresent()) { throw new TableNotFoundException(handle.getSchemaTableName()); } List<ColumnHandle> partitionColumns = layoutHandle.getPartitionColumns(); if (!layoutHandle.getEffectivePredicate().getDomains() .map(domains -> filterKeys(domains, not(in(partitionColumns)))) .orElse(ImmutableMap.of()).isEmpty()) { throw new PrestoException(NOT_SUPPORTED, "This connector only supports delete where one or more partitions are deleted entirely"); } if (table.get().getPartitionColumns().isEmpty()) { metastore.truncateUnpartitionedTable(session, handle.getSchemaName(), handle.getTableName()); } else { for (HivePartition hivePartition : getOrComputePartitions(layoutHandle, session, tableHandle)) { metastore.dropPartition(session, handle.getSchemaName(), handle.getTableName(), toPartitionValues(hivePartition.getPartitionId())); } } return OptionalLong.empty(); }
Source:
void start() { long start_ms = System.currentTimeMillis(); long delta_s = 0; FileInputStream sdPipe = null; if(appConfig.getSDEnabled()) { LOGGER.info("Service Discovery enabled"); sdPipe = newSdPipe(); } while (true) { if (appConfig.getExitWatcher().shouldExit()){ LOGGER.info("Exit file detected: stopping JMXFetch."); System.exit(0); } if(sdPipe == null && appConfig.getSDEnabled()) { sdPipe = newSdPipe(); } try { if(sdPipe != null && sdPipe.available() > 0) { int len = sdPipe.available(); byte[] buffer = new byte[len]; sdPipe.read(buffer); setReinit(processServiceDiscovery(buffer)); } } catch(IOException e) { LOGGER.warn("Unable to read from pipe - Service Discovery configuration may have been skipped."); } long start = System.currentTimeMillis(); if (this.reinit.get()) { init(true); } if (instances.size() > 0) { doIteration(); } else { LOGGER.warn("No instance could be initiated. Retrying initialization."); appConfig.getStatus().flush(); configs = getConfigs(appConfig); init(true); } long length = System.currentTimeMillis() - start; LOGGER.debug("Iteration ran in " + length + " ms"); try { int loopPeriod = appConfig.getCheckPeriod(); LOGGER.debug("Sleeping for " + loopPeriod + " ms."); Thread.sleep(loopPeriod); } catch (InterruptedException e) { LOGGER.warn(e.getMessage(), e); } } }

Target:
void start() { long start_ms = System.currentTimeMillis(); long delta_s = 0; FileInputStream sdPipe = null; if(appConfig.getSDEnabled()) { LOGGER.info("Service Discovery enabled"); sdPipe = newSdPipe(); } while (true) { if (appConfig.getExitWatcher().shouldExit()){ LOGGER.info("Exit file detected: stopping JMXFetch."); System.exit(0); } if(sdPipe == null && appConfig.getSDEnabled()) { sdPipe = newSdPipe(); } try { int len; if(sdPipe != null && (len = sdPipe.available()) > 0) { byte[] buffer = new byte[len]; sdPipe.read(buffer); setReinit(processServiceDiscovery(buffer)); } } catch(IOException e) { LOGGER.warn("Unable to read from pipe - Service Discovery configuration may have been skipped."); } long start = System.currentTimeMillis(); if (this.reinit.get()) { init(true); } if (instances.size() > 0) { doIteration(); } else { LOGGER.warn("No instance could be initiated. Retrying initialization."); appConfig.getStatus().flush(); configs = getConfigs(appConfig); init(true); } long length = System.currentTimeMillis() - start; LOGGER.debug("Iteration ran in " + length + " ms"); try { int loopPeriod = appConfig.getCheckPeriod(); LOGGER.debug("Sleeping for " + loopPeriod + " ms."); Thread.sleep(loopPeriod); } catch (InterruptedException e) { LOGGER.warn(e.getMessage(), e); } } }
Source:
private RetryDriver retry() { return RetryDriver.retry() .exponentialBackoff(thriftConfig.getMaxRetries(), thriftConfig.getMinBackoffDelay(), thriftConfig.getMaxBackoffDelay(), thriftConfig.getMaxRetryTime(), thriftConfig.getBackoffScaleFactor(), exceptionMapper, ImmutableList.of(), Optional.empty()).stopOn(PrestoException.class); }

Target:
private RetryDriver retry() { return RetryDriver.retry() .exponentialBackoff( minBackoffDelay, maxBackoffDelay, maxRetryTime, scaleFactor) .maxAttempts(maxRetries + 1) .exceptionMapper(exceptionMapper) .stopOn(PrestoException.class); }
Source:
public void prepareTestInstance(TestContext testContext) throws Exception { LOG.info("@RunWith(CamelSpringBootRunner.class) preparing: {}", testContext.getTestClass()); Class<?> testClass = testContext.getTestClass(); CamelAnnotationsHandler.handleExcludeRoutesForSpringBoot(testClass); SpringCamelContext.setNoStart(true); System.setProperty("skipStartingCamelContext", "true"); ConfigurableApplicationContext context = (ConfigurableApplicationContext) testContext.getApplicationContext(); CamelAnnotationsHandler.handleProvidesBreakpoint(context, testClass); CamelAnnotationsHandler.handleShutdownTimeout(context, testClass); CamelAnnotationsHandler.handleMockEndpoints(context, testClass); CamelAnnotationsHandler.handleMockEndpointsAndSkip(context, testClass); CamelAnnotationsHandler.handleUseOverridePropertiesWithPropertiesComponent(context, testClass); System.clearProperty("skipStartingCamelContext"); SpringCamelContext.setNoStart(false); }

Target:
public void prepareTestInstance(TestContext testContext) throws Exception { LOG.info("CamelSpringBootExecutionListener preparing: {}", testContext.getTestClass()); Class<?> testClass = testContext.getTestClass(); CamelAnnotationsHandler.handleExcludeRoutesForSpringBoot(testClass); SpringCamelContext.setNoStart(true); System.setProperty("skipStartingCamelContext", "true"); ConfigurableApplicationContext context = (ConfigurableApplicationContext) testContext.getApplicationContext(); CamelAnnotationsHandler.handleProvidesBreakpoint(context, testClass); CamelAnnotationsHandler.handleShutdownTimeout(context, testClass); CamelAnnotationsHandler.handleMockEndpoints(context, testClass); CamelAnnotationsHandler.handleMockEndpointsAndSkip(context, testClass); CamelAnnotationsHandler.handleUseOverridePropertiesWithPropertiesComponent(context, testClass); System.clearProperty("skipStartingCamelContext"); SpringCamelContext.setNoStart(false); }
Source:
public Mono<String> getTableName() { return Mono.empty(); }

Target:
public String getTableName() { return tableName; }
Source:
public void sortTests() { testEval("sort('commcare is the best tool ever', false())", null, null, "tool the is ever commcare best"); testEval("sort('2222 5555 9999 1111', 'd b c a', true())", null, null, "1111 5555 9999 2222"); testEval("sort('a b c d e f', '4 2 1 5 3 2', false())", null, null, "d a e f b c"); testEval("sort('c c z f z f', '4 2 1 5 3 2', true())", null, null, "z c f z c f"); testEval("sort('a b c d e f', '4 2 1 5 3 2')", null, null, "c b f e a d"); testEval("sort('commcare is the best tool ever')", null, null, "best commcare ever is the tool"); testEval("sort('a b c', '4 2 5 1', true())", null, null, new XPathTypeMismatchException()); }

Target:
public void sortTests() { testEval("sort('commcare is the best tool ever', false())", null, null, "tool the is ever commcare best"); testEval("sort-by('2222 5555 9999 1111', 'd b c a', true())", null, null, "1111 5555 9999 2222"); testEval("sort-by('a b c d e f', '4 2 1 5 3 2', false())", null, null, "d a e f b c"); testEval("sort-by('c c z f z f', '4 2 1 5 3 2', true())", null, null, "z c f z c f"); testEval("sort-by('a b c d e f', '4 2 1 5 3 2')", null, null, "c b f e a d"); testEval("sort('commcare is the best tool ever')", null, null, "best commcare ever is the tool"); testEval("sort-by('a b c', '4 2 5 1', true())", null, null, new XPathTypeMismatchException()); }
Source:
protected FileMonitoringController(FilePath ws) throws IOException, InterruptedException { ws.mkdirs(); FilePath tmpDir = WorkspaceList.tempDir(ws); if (tmpDir != null) { FilePath cd = cd.child("durable-" + Util.getDigestOf(UUID.randomUUID().toString()).substring(0,8)); cd.mkdirs(); controlDir = cd.getRemote(); } else { controlDir = null; } }

Target:
protected FileMonitoringController(FilePath ws) throws IOException, InterruptedException { ws.mkdirs(); FilePath tmpDir = ws.getParent() != null ? WorkspaceList.tempDir(ws) : null; if (tmpDir != null) { FilePath cd = tmpDir.child("durable-" + Util.getDigestOf(UUID.randomUUID().toString()).substring(0,8)); cd.mkdirs(); controlDir = cd.getRemote(); } else { controlDir = null; } }
Source:
public Object execute(final ExecutionEvent event) throws ExecutionException { final List<RefNode> nodes = getSelectedNodes(event); final List<Ref> refs = new ArrayList<Ref>(); for (RefNode refNode : nodes) { refs.add(refNode.getObject()); } Shell shell = getShell(event); MessageDialog messageDialog = new BranchMessageDialog(shell, nodes); if (messageDialog.open() != Window.OK) { return null; } try { new ProgressMonitorDialog(shell).run(false, false, new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { for (RefNode refNode : nodes) { deleteBranch(refNode, refNode.getObject()); } } catch (IOException ioe) { throw new InvocationTargetException(ioe); } } }); } catch (InvocationTargetException e1) { Activator.handleError( UIText.RepositoriesView_BranchDeletionFailureMessage, e1.getCause(), true); e1.printStackTrace(); } catch (InterruptedException e1) { } return null; }

Target:
public Object execute(final ExecutionEvent event) throws ExecutionException { final List<RefNode> nodes = getSelectedNodes(event); final List<Ref> refs = new ArrayList<Ref>(); for (RefNode refNode : nodes) { refs.add(refNode.getObject()); } Shell shell = getShell(event); MessageDialog messageDialog = new BranchMessageDialog(shell, nodes); if (messageDialog.open() != Window.OK) return null; try { new ProgressMonitorDialog(shell).run(false, false, new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { for (RefNode refNode : nodes) deleteBranch(refNode, refNode.getObject()); } catch (IOException ioe) { throw new InvocationTargetException(ioe); } } }); } catch (InvocationTargetException e1) { Activator.handleError( UIText.RepositoriesView_BranchDeletionFailureMessage, e1.getCause(), true); e1.printStackTrace(); } catch (InterruptedException e1) { } return null; }