auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean apply(GHPullRequest remotePR) { @CheckForNull GitHubPRPullRequest localPR = localRepo.getPulls().get(remotePR.getNumber()); if (!isUpdated(remotePR, localPR)) { String logMessage = String.format("PR [#%s %s] not changed", remotePR.getNumber(), remotePR.getTitle()); logger.getLogger().println(logMessage); LOGGER.info(logMessage); return false; } return true; }

Target:
public boolean apply(GHPullRequest remotePR) { @CheckForNull GitHubPRPullRequest localPR = localRepo.getPulls().get(remotePR.getNumber()); if (!isUpdated(remotePR, localPR)) { String logMessage = String.format("PR [#%s %s] not changed", remotePR.getNumber(), remotePR.getTitle()); logger.getLogger().println(logMessage); LOGGER.debug(logMessage); return false; } return true; }
Source:
private InitializationManager(Project project) { File baseFolder = new File(PluginManager.getPlugin(PluginId.findId("nl.tudelft.watchdog")).getPath().getPath()); File toTransferDatabaseFile = new File(baseFolder, WatchDogUtils.getProjectName() + "watchdog.mapdb"); File statisticsDatabaseFile = new File(baseFolder, WatchDogUtils.getProjectName() + "watchdogStatistics.mapdb"); toTransferPersister = new Persister( toTransferDatabaseFile); statisticsPersister = new Persister( statisticsDatabaseFile); intervalManager = new IntervalManager(toTransferPersister, statisticsPersister); eventManager = new EventManager(toTransferPersister, statisticsPersister); eventManager.setSessionSeed(intervalManager.getSessionSeed()); watchDogEventManager = new WatchDogEventManager(intervalManager, USER_ACTIVITY_TIMEOUT); new TimeSynchronityChecker(intervalManager, watchDogEventManager); transferManager = new TransferManagerBase(toTransferPersister, WatchDogUtils.getProjectName()); intelliJListener = new IntelliJListener(watchDogEventManager, project); intelliJListener.attachListeners(); XDebuggerManager.getInstance(project).getBreakpointManager().addBreakpointListener(new BreakpointListener(eventManager)); DebuggerManagerEx.getInstanceEx(project).getContextManager().addListener(new DebugEventListener(eventManager)); ActionManager.getInstance().addAnActionListener(new DebugActionListener(eventManager)); }

Target:
private InitializationManager(Project project) { File baseFolder = new File(PluginManager.getPlugin(PluginId.findId("nl.tudelft.watchdog")).getPath().getPath()); File toTransferDatabaseFile = new File(baseFolder, WatchDogUtils.getProjectName() + "watchdog.mapdb"); File statisticsDatabaseFile = new File(baseFolder, WatchDogUtils.getProjectName() + "watchdogStatistics.mapdb"); toTransferPersister = new Persister( toTransferDatabaseFile); statisticsPersister = new Persister( statisticsDatabaseFile); intervalManager = new IntervalManager(toTransferPersister, statisticsPersister); debugEventManager = new DebugEventManager(toTransferPersister, statisticsPersister); debugEventManager.setSessionSeed(intervalManager.getSessionSeed()); watchDogEventManager = new WatchDogEventManager(intervalManager, USER_ACTIVITY_TIMEOUT); new TimeSynchronityChecker(intervalManager, watchDogEventManager); transferManager = new TransferManagerBase(toTransferPersister, WatchDogUtils.getProjectName()); intelliJListener = new IntelliJListener(watchDogEventManager, debugEventManager, project); intelliJListener.attachListeners(); }
Source:
public String getGame(Model model, HttpSession session, @PathVariable int id) { model.addAttribute("gameId", id); if (session.getAttribute("member") == null) { return "redirect:../../denied"; } Member member = (Member) session.getAttribute("member"); List<Team> teams = member.getTeams(); model.addAttribute("teams", teams); TournamentDao tournamentDao = new TournamentDao(); List<Tournament> tournaments = tournamentDao.getLastXTournaments(5); model.addAttribute("tournaments", tournaments); GameDao gameDao = new GameDao(); Game game = gameDao.getGameById(id, true); model.addAttribute("game", game); return "game"; }

Target:
public String getGame(Model model, HttpSession session, @PathVariable int id) { model.addAttribute("gameId", id); if (session.getAttribute("member") == null) { return "redirect:/denied"; } Member member = (Member) session.getAttribute("member"); Set<Team> teams = member.getTeams(); model.addAttribute("teams", teams); TournamentDao tournamentDao = new TournamentDao(); List<Tournament> tournaments = tournamentDao.getLastXTournaments(5); model.addAttribute("tournaments", tournaments); GameDao gameDao = new GameDao(); Game game = gameDao.getGameById(id, true); if(game==null) { return "redirect:/denied"; } model.addAttribute("game", game); return "game"; }
Source:
protected Entity createNode(Location loc, Map<?, ?> flags) { Entity node = super.createNode(loc, flags); if (!IS_MASTER.apply(node)) { ServiceNotUpLogic.updateNotUpIndicator((EntityLocal)node, MySqlSlave.SLAVE_HEALTHY, "Replication not started"); FunctionFeed.builder() .entity((EntityLocal)node) .period(Duration.FIVE_SECONDS) .poll(FunctionPollConfig.forSensor(MySqlSlave.SLAVE_HEALTHY) .callable(new SlaveStateCallable(node)) .checkSuccess(StringPredicates.isNonBlank()) .onSuccess(new SlaveStateParser(node)) .setOnFailure(false) .description("Polls SHOW SLAVE STATUS")) .build(); node.addEnricher(Enrichers.builder().updatingMap(Attributes.SERVICE_NOT_UP_INDICATORS) .from(MySqlSlave.SLAVE_HEALTHY) .computing(Functionals.ifNotEquals(true).value("Slave replication status is not healthy") ) .build()); } return node; }

Target:
protected Entity createNode(Location loc, Map<?, ?> flags) { Entity node = super.createNode(loc, flags); if (!IS_MASTER.apply(node)) { ServiceNotUpLogic.updateNotUpIndicator((EntityLocal)node, MySqlSlave.SLAVE_HEALTHY, "Replication not started"); addFeed(FunctionFeed.builder() .entity((EntityLocal)node) .period(Duration.FIVE_SECONDS) .poll(FunctionPollConfig.forSensor(MySqlSlave.SLAVE_HEALTHY) .callable(new SlaveStateCallable(node)) .checkSuccess(StringPredicates.isNonBlank()) .onSuccess(new SlaveStateParser(node)) .setOnFailure(false) .description("Polls SHOW SLAVE STATUS")) .build()); node.addEnricher(Enrichers.builder().updatingMap(Attributes.SERVICE_NOT_UP_INDICATORS) .from(MySqlSlave.SLAVE_HEALTHY) .computing(Functionals.ifNotEquals(true).value("Slave replication status is not healthy") ) .build()); } return node; }
Source:
Attribute createAttribute(final String friendlyName, final String name, final String nameFormat) { return SAML2ComponentBuilder.createAttribute(friendlyName, name, StringUtils.defaultIfBlank(nameFormat, "urn:oasis:names:tc:SAML:2.0:attrname-format:uri")); }

Target:
Attribute createAttribute(final String friendlyName, final String name, final String nameFormat) { return SAML2ComponentBuilder.createAttribute(friendlyName, name, StringUtils.defaultIfBlank(nameFormat, NAME_FORMAT_STRING)); }
Source:
public AuthOutcome authenticate(HttpFacade exchange) { List<String> authHeaders = exchange.getRequest().getHeaders("Authorization"); if (authHeaders == null || authHeaders.size() == 0) { challenge = challengeResponse(exchange, OIDCAuthenticationError.Reason.NO_AUTHORIZATION_HEADER, null, null); return AuthOutcome.NOT_ATTEMPTED; } tokenString = null; for (String authHeader : authHeaders) { String[] split = authHeader.trim().split("\\s+"); if (split == null || split.length != 2) continue; if (!split[0].equalsIgnoreCase("Basic")) continue; tokenString = split[1]; } if (tokenString == null) { challenge = challengeResponse(exchange, OIDCAuthenticationError.Reason.INVALID_TOKEN, null, null); return AuthOutcome.NOT_ATTEMPTED; } AccessTokenResponse atr=null; try { String userpw=new String(Base64.decode(tokenString)); int seperatorIndex = userpw.indexOf(":"); String user = userpw.substring(0, seperatorIndex); String pw = userpw.substring(seperatorIndex + 1); log.debug("user: " + user); log.debug("pw: " + pw); atr = getToken(user, pw); tokenString = atr.getToken(); } catch (Exception e) { log.debug("Failed to obtain token", e); challenge = challengeResponse(exchange, OIDCAuthenticationError.Reason.INVALID_TOKEN, "no_token", e.getMessage()); return AuthOutcome.FAILED; } return authenticateToken(exchange, atr.getToken()); }

Target:
public AuthOutcome authenticate(HttpFacade exchange) { List<String> authHeaders = exchange.getRequest().getHeaders("Authorization"); if (authHeaders == null || authHeaders.size() == 0) { challenge = challengeResponse(exchange, OIDCAuthenticationError.Reason.NO_AUTHORIZATION_HEADER, null, null); return AuthOutcome.NOT_ATTEMPTED; } tokenString = null; for (String authHeader : authHeaders) { String[] split = authHeader.trim().split("\\s+"); if (split == null || split.length != 2) continue; if (!split[0].equalsIgnoreCase("Basic")) continue; tokenString = split[1]; } if (tokenString == null) { challenge = challengeResponse(exchange, OIDCAuthenticationError.Reason.INVALID_TOKEN, null, null); return AuthOutcome.NOT_ATTEMPTED; } AccessTokenResponse atr=null; try { String userpw=new String(Base64.decode(tokenString)); int seperatorIndex = userpw.indexOf(":"); String user = userpw.substring(0, seperatorIndex); String pw = userpw.substring(seperatorIndex + 1); atr = getToken(user, pw); tokenString = atr.getToken(); } catch (Exception e) { log.debug("Failed to obtain token", e); challenge = challengeResponse(exchange, OIDCAuthenticationError.Reason.INVALID_TOKEN, "no_token", e.getMessage()); return AuthOutcome.FAILED; } return authenticateToken(exchange, atr.getToken()); }
Source:
protected void copyDiff(Diff target, Monitor monitor, boolean rightToLeft) { if (isInTerminalState(target)) { return; } long start = System.currentTimeMillis(); target.setState(MERGING); Set<Diff> impliedMerges = getImpliedMerges(target, rightToLeft); while (!impliedMerges.isEmpty()) { Diff impliedMerge = impliedMerges.iterator().next(); if (impliedMerge != target && !isInTerminalState(impliedMerge)) { impliedMerge.setState(MERGED); impliedMerges.addAll(getImpliedMerges(impliedMerge, rightToLeft)); } impliedMerges.remove(impliedMerge); impliedMerges.remove(target); } if (isAccepting(target, rightToLeft)) { accept(target, rightToLeft); } else { reject(target, rightToLeft); } target.setState(MERGED); if (LOGGER.isDebugEnabled()) { long duration = System.currentTimeMillis() - start; if (rightToLeft) { LOGGER.debug("copyDiff(Diff, Monitor, Boolean) - diff " + target.hashCode() + " merged from right to left in " + duration + "ms"); } else { LOGGER.debug("copyDiff(Diff, Monitor, Boolean) - diff " + target.hashCode() + " merged from left to right in " + duration + "ms"); } } }

Target:
protected void copyDiff(Diff target, Monitor monitor, boolean rightToLeft) { if (isInTerminalState(target)) { return; } long start = System.currentTimeMillis(); target.setState(MERGING); Set<Diff> impliedMerges = getImpliedMerges(target, rightToLeft); while (!impliedMerges.isEmpty()) { Diff impliedMerge = impliedMerges.iterator().next(); if (impliedMerge != target && !isInTerminalState(impliedMerge)) { impliedMerge.setState(MERGED); impliedMerges.addAll(getImpliedMerges(impliedMerge, rightToLeft)); } impliedMerges.remove(impliedMerge); impliedMerges.remove(target); } if (isAccepting(target, rightToLeft)) { accept(target, rightToLeft); } else { reject(target, rightToLeft); } target.setState(MERGED); if (LOGGER.isDebugEnabled()) { long duration = System.currentTimeMillis() - start; LOGGER.debug("copyDiff(Diff, Monitor, Boolean) - diff " + target.hashCode() + " merged (rightToLeft: " + rightToLeft + ") in " + duration + "ms"); } }
Source:
void _setVisible (boolean visible) { if (visible == OS.gtk_widget_get_mapped (handle)) return; if (visible) { sendEvent (SWT.Show); if (getItemCount () != 0) { if ((parent._getShell ().style & SWT.ON_TOP) != 0) { OS.gtk_menu_shell_set_take_focus (handle, false); } if (OS.GTK_VERSION < OS.VERSION(3, 22, 0)) { long address = 0; hasLocation = false; long data = 0; TrayItem item = display.currentTrayItem; if (item != null && !item.isDisposed()) { data = item.handle; address = OS.gtk_status_icon_position_menu_func (); } OS.gtk_menu_popup (handle, 0, 0, address, data, 0, display.getLastEventTime ()); } else { long eventPtr = OS.gtk_get_current_event(); if (eventPtr == 0) { eventPtr = OS.gdk_event_new(OS.GDK_BUTTON_PRESS); GdkEventButton event = new GdkEventButton(); event.window = OS.g_object_ref(OS.gtk_widget_get_window(getShell().handle)); OS.memmove (eventPtr, event, GdkEventButton.sizeof); } OS.gtk_menu_popup_at_pointer (handle, eventPtr); OS.gdk_event_free (eventPtr); } } else { sendEvent (SWT.Hide); } } else { OS.gtk_menu_popdown (handle); } }

Target:
void _setVisible (boolean visible) { if (visible == OS.gtk_widget_get_mapped (handle)) return; if (visible) { sendEvent (SWT.Show); if (getItemCount () != 0) { if ((parent._getShell ().style & SWT.ON_TOP) != 0) { OS.gtk_menu_shell_set_take_focus (handle, false); } if (OS.GTK_VERSION < OS.VERSION(3, 22, 0)) { long address = 0; hasLocation = false; long data = 0; TrayItem item = display.currentTrayItem; if (item != null && !item.isDisposed()) { data = item.handle; address = OS.gtk_status_icon_position_menu_func (); } OS.gtk_menu_popup (handle, 0, 0, address, data, 0, display.getLastEventTime ()); } else { long eventPtr = OS.gtk_get_current_event(); if (eventPtr == 0) { eventPtr = OS.gdk_event_new(OS.GDK_BUTTON_PRESS); GdkEventButton event = new GdkEventButton(); event.type = OS.GDK_BUTTON_PRESS; event.window = OS.g_object_ref(OS.gtk_widget_get_window(getShell().handle)); long device_manager = OS.gdk_display_get_device_manager( OS.gdk_display_get_default ()); event.device = OS.gdk_device_manager_get_client_pointer (device_manager); event.time = display.getLastEventTime (); OS.memmove (eventPtr, event, GdkEventButton.sizeof); } OS.gtk_menu_popup_at_pointer (handle, eventPtr); OS.gdk_event_free (eventPtr); } } else { sendEvent (SWT.Hide); } } else { OS.gtk_menu_popdown (handle); } }
Source:
protected void fireStoppedEvent(final MIOutput output, final IExecutionDMContext ctx) { final DsfSession session = DsfSession.getSession(ctx.getSessionId()); session.getExecutor().execute(new DsfRunnable() { @Override public void run() { int token = output.getMIResultRecord().getToken(); session.dispatchEvent(MIErrorEvent.parse(ctx, token, output.getMIResultRecord().getMIResults(), output.getMIOOBRecords()), null); } }); }

Target:
protected void fireStoppedEvent(final MIOutput output, final IExecutionDMContext ctx) { DsfSession session = DsfSession.getSession(ctx.getSessionId()); int token = output.getMIResultRecord().getToken(); session.dispatchEvent(MIErrorEvent.parse(ctx, token, output.getMIResultRecord().getMIResults(), output.getMIOOBRecords()), null); }
Source:
public boolean addConsumer(MqttMessageSubscriber subscriber) throws MqttException { String topic = StringUtils.replace(StringUtils.replace(subscriber.getTopic(), "+", "[^/]*"), "#", ".*"); synchronized (consumers) { List<MqttMessageSubscriber> subscriberList = consumers.get(topic); if (subscriberList == null) { subscriberList = new ArrayList<>(); } subscriberList.add(subscriber); consumers.put(subscriber.getTopic(), subscriberList); } if (isConnected()) { try { client.subscribe(subscriber.getTopic(), qos); } catch (org.eclipse.paho.client.mqttv3.MqttException e) { throw new MqttException(e); } } return true; }

Target:
public boolean addConsumer(MqttMessageSubscriber subscriber) throws MqttException { String topic = prepareTopic(subscriber.getTopic()); synchronized (consumers) { List<MqttMessageSubscriber> subscriberList = consumers.get(topic); if (subscriberList == null) { subscriberList = new ArrayList<>(); consumers.put(topic, subscriberList); } subscriberList.add(subscriber); } if (isConnected()) { try { client.subscribe(subscriber.getTopic(), qos); } catch (org.eclipse.paho.client.mqttv3.MqttException e) { throw new MqttException(e); } } return true; }
Source:
protected int getSpecificHeaderSize() { int maxChildren = getConfig().getMaxChildren(); int specificSize = SIZE_INT + SIZE_INT + SIZE_INT * maxChildren + SIZE_LONG * maxChildren + SIZE_LONG * maxChildren + SIZE_INT * maxChildren + SIZE_INT * maxChildren; return specificSize; }

Target:
protected int getSpecificHeaderSize() { int maxChildren = getConfig().getMaxChildren(); int specificSize = SIZE_INT + SIZE_INT + SIZE_INT * maxChildren + SIZE_LONG * maxChildren + SIZE_LONG * maxChildren; return specificSize; }
Source:
public PhysicalDeviceDto getPhysicalDevice() { return physicalDevice; }

Target:
public PhysicalDeviceDto getPhysicalDevice() { return this.physicalDevice; }
Source:
protected ItemStack dispenseStack(GlowBlock block, ItemStack stack) { Material armor = stack.getType(); BlockFace facing = BlockDispenser.getFacing(block); GlowBlock target = block.getRelative(facing); Location location1 = target.getLocation(); Location location2 = location1.clone(); location2.setY(location2.getY() - 1); World world = location1.getWorld(); List<LivingEntity> entities = new ArrayList<>(); for (Entity cEntity : world.getNearbyEntities(location1, 3, 3, 3)) { switch (cEntity.getType()) { case PLAYER: entities.add((LivingEntity) cEntity); break; } } Location location; Boolean location1Test; Boolean location2Test; for (LivingEntity player : entities) { location = player.getLocation().clone(); location.setX(location.getBlockX()); location.setY(location.getBlockY()); location.setZ(location.getBlockZ()); location1Test = (location.getX() == location1.getX() && location.getY() == location1.getY() && location.getZ() == location1.getZ()); location2Test = (location.getX() == location2.getX() && location.getY() == location2.getY() && location.getZ() == location2.getZ()); if ((location1Test || location2Test)) { return ((GlowInventory) ((Player) player).getInventory()).tryToFillSlots(stack, 36, 40); } } return defaultBehavior.dispense(block, stack); }

Target:
protected ItemStack dispenseStack(GlowBlock block, ItemStack stack) { BlockFace facing = BlockDispenser.getFacing(block); Location targetLocation = block.getLocation().clone().add(facing.getModX(), facing.getModY(), facing.getModZ()); List<LivingEntity> entities = new ArrayList<>(); for (Entity entity : targetLocation.getWorld().getNearbyEntities(targetLocation, 3, 3, 3)) { switch (entity.getType()) { case PLAYER: entities.add((LivingEntity) entity); break; } } boolean targetLocationTest1; boolean targetLocationTest2; for (LivingEntity player : entities) { targetLocationTest1 = (player.getLocation().getBlockX() == targetLocation.getX() && player.getLocation().getBlockY() == targetLocation.getY() && player.getLocation().getBlockZ() == targetLocation.getZ()); targetLocationTest2 = (player.getEyeLocation().getBlockX() == targetLocation.getX() && player.getEyeLocation().getBlockY() == targetLocation.getY() && player.getEyeLocation().getBlockZ() == targetLocation.getZ()); if ((targetLocationTest1 || targetLocationTest2)) { return ((GlowInventory) ((Player) player).getInventory()).tryToFillSlots(stack, 36, 40); } } return defaultBehavior.dispense(block, stack); }
Source:
protected RuntimeException safeTransformEntityErrorResponse(RuntimeException e, Response response, Supplier<RuntimeException> entityExceptionSupplier, Supplier<RuntimeException> fallbackExceptionSupplier) { RuntimeException suppressedException = null; try { if (response.hasEntity() && MediaType.APPLICATION_JSON_TYPE.equals(response.getMediaType())) { return entityExceptionSupplier.get(); } } catch (@SuppressWarnings("squid:S1166") javax.ws.rs.ProcessingException | IllegalStateException ex) { suppressedException = ex; } RuntimeException exception = fallbackExceptionSupplier.get(); if (suppressedException != null) { exception.addSuppressed(suppressedException); } return exception; }

Target:
protected RuntimeException safeTransformEntityErrorResponse(RuntimeException e, Response response, Supplier<RuntimeException> entityExceptionSupplier, Supplier<RuntimeException> fallbackExceptionSupplier) { RuntimeException suppressedException = null; try { if (response.hasEntity()) { return entityExceptionSupplier.get(); } } catch (RuntimeException ex) { suppressedException = ex; } RuntimeException exception = fallbackExceptionSupplier.get(); if (suppressedException != null) { exception.addSuppressed(suppressedException); } return exception; }
Source:
public void testAnySubpaths() { String id = RestAssured .given() .contentType(JSONAPI_CONTENT_TYPE) .accept(JSONAPI_CONTENT_TYPE) .body(jsonParser.getJson(tractorAsPropertyFile)) .post(propertyPath) .then() .assertThat() .statusCode(HttpStatus.SC_CREATED) .extract() .path(idPath); RestAssured .given() .contentType(JSONAPI_CONTENT_TYPE) .accept(JSONAPI_CONTENT_TYPE) .get(propertyPath + "?page[totals]") .then() .assertThat() .statusCode(HttpStatus.SC_OK) .body("meta.page.totalRecords", greaterThan(0)); RestAssured .given() .contentType(JSONAPI_CONTENT_TYPE) .accept(JSONAPI_CONTENT_TYPE) .get(propertyPath + sep + id + "/myStuff") .then() .assertThat() .statusCode(HttpStatus.SC_OK) .body("data.attributes.horsepower", equalTo(horsepower), idPath, equalTo(one)); RestAssured .given() .contentType(JSONAPI_CONTENT_TYPE) .accept(JSONAPI_CONTENT_TYPE) .get(propertyPath + sep + id + "/myStuff?page[totals]") .then() .assertThat() .statusCode(HttpStatus.SC_OK) .body("meta", equalTo(null)); RestAssured .given() .contentType(JSONAPI_CONTENT_TYPE) .accept(JSONAPI_CONTENT_TYPE) .get(propertyPath + sep + id + "?filter[tractor]=horsepower==103") .then() .assertThat() .statusCode(HttpStatus.SC_BAD_REQUEST); }

Target:
public void testAnySubpaths() { String id = RestAssured .given() .contentType(JSONAPI_CONTENT_TYPE) .accept(JSONAPI_CONTENT_TYPE) .body(jsonParser.getJson("/AnyPolymorphismIT/AddTractorProperty.json")) .post("/property") .then() .assertThat() .statusCode(HttpStatus.SC_CREATED) .extract() .path("data.id"); Response response = RestAssured .given() .contentType(JSONAPI_CONTENT_TYPE) .accept(JSONAPI_CONTENT_TYPE) .get("/property?page[totals]") .then() .assertThat() .statusCode(HttpStatus.SC_OK) .extract() .response(); Integer collectionSize = response.path("data.size()"); Integer totalSize = response.path("meta.page.totalRecords"); Assert.assertEquals(collectionSize, totalSize); RestAssured .given() .contentType(JSONAPI_CONTENT_TYPE) .accept(JSONAPI_CONTENT_TYPE) .get("/property/" + id + "/myStuff") .then() .assertThat() .statusCode(HttpStatus.SC_OK) .body("data.attributes.horsepower", equalTo(102), "data.id", equalTo("1")); RestAssured .given() .contentType(JSONAPI_CONTENT_TYPE) .accept(JSONAPI_CONTENT_TYPE) .get("/device") .then() .assertThat() .statusCode(HttpStatus.SC_NOT_FOUND) .body("errors[0]", containsString("Unknown collection")); RestAssured .given() .contentType(JSONAPI_CONTENT_TYPE) .accept(JSONAPI_CONTENT_TYPE) .get("/property/" + id + "?filter[tractor]=horsepower==103") .then() .assertThat() .statusCode(HttpStatus.SC_BAD_REQUEST); }
Source:
public static void setAsDefault() { try { HttpsURLConnection.setDefaultSSLSocketFactory(getInstance()); } catch (NoSuchAlgorithmException | KeyManagementException e) { e.printStackTrace(); } }

Target:
public static void setAsDefault() { try { HttpsURLConnection.setDefaultSSLSocketFactory(getInstance()); } catch (NoSuchAlgorithmException | KeyManagementException e) { if (DEBUG) e.printStackTrace(); } }
Source:
public List<Extension> getExtension() { if (extension == null) { extension = new ArrayList<Extension>(); } return this.extension; }

Target:
public List<Extension> getExtension() { return this.extension; }
Source:
public void close() { if (TransactionalContext.isInTransaction()) { if (txnType == READ_ONLY) { long timeElapsed = System.nanoTime() - txnStartTime; tablesInTxn.forEach(t -> t.getMetrics().readOnlyTxnTimes.set(timeElapsed)); } else { log.warn("close()ing a transaction with mutations without calling commit()!"); } this.objectsView.TXAbort(); } operations.clear(); tablesInTxn.clear(); }

Target:
public void close() { if (TransactionalContext.isInTransaction()) { log.warn("close()ing a transaction without calling commit()!", txnType); long timeElapsed = System.nanoTime() - txnStartTime; if (txnType == READ_ONLY) { tablesInTxn.forEach(t -> t.getMetrics().setReadOnlyTxnTimes(timeElapsed)); } else { tablesInTxn.forEach(t -> t.getMetrics().incNumTxnAborts()); } this.objectsView.TXAbort(); } operations.clear(); tablesInTxn.clear(); }
Source:
public void test() throws Exception { File file = new File("./example/example.xml"); URL channelsURL = file.toURI().toURL(); ThingDescriptionReader reader = new ThingDescriptionReader(); ThingDescriptionList thingList = (ThingDescriptionList) reader.readFromXML(channelsURL); thingList.stream().forEach(it -> { if (it instanceof ChannelTypeXmlResult) { ((ChannelTypeXmlResult) it).toChannelType(); } }); }

Target:
public void test() throws Exception { File file = new File("./example/example.xml"); URL channelsURL = file.toURI().toURL(); ThingDescriptionReader reader = new ThingDescriptionReader(); ThingDescriptionList thingList = (ThingDescriptionList) reader.readFromXML(channelsURL); }
Source:
private void verifyProtocolLogging(LoadBalancer loadBalancer, LoadBalancer dbLoadBalancer) throws UnprocessableEntityException { String logErr = "Protocol must be a non-UDP protocol for connection logging to be enabled."; String proErr = "Cannot change protocol from non-UDP to UDP while logging is enabled."; boolean changingLogging = loadBalancer.isConnectionLogging() != null && !loadBalancer.isConnectionLogging().equals(dbLoadBalancer.isConnectionLogging()); boolean changingProtocol = loadBalancer.getProtocol() != null && !loadBalancer.getProtocol().equals(dbLoadBalancer.getProtocol()); if (changingProtocol && changingLogging) { if(loadBalancer.isUdpProtocol() && loadBalancer.isConnectionLogging()) { LOG.error(logErr); throw new UnprocessableEntityException(logErr); } LOG.debug("ConnectionLogging is being enabled on the loadbalancer."); } else if (changingLogging) { if (loadBalancer.isConnectionLogging()) { if (dbLoadBalancer.isUdpProtocol()) { LOG.error(logErr); throw new UnprocessableEntityException(logErr); } LOG.debug("ConnectionLogging is being enabled on the loadbalancer."); } else { LOG.debug("ConnectionLogging is being disabled on the loadbalancer."); } dbLoadBalancer.setConnectionLogging(loadBalancer.isConnectionLogging()); } else if (changingProtocol) { if (loadBalancer.isUdpProtocol()) { if (dbLoadBalancer.isConnectionLogging()) { LOG.error(proErr); throw new UnprocessableEntityException(proErr); } } } }

Target:
private void verifyProtocolLogging(LoadBalancer loadBalancer, LoadBalancer dbLoadBalancer) throws UnprocessableEntityException { String logErr = "Cannot change to UDP based protocol while logging is enabled."; if (loadBalancer.getProtocol() != null && !loadBalancer.getProtocol().equals(dbLoadBalancer.getProtocol())) { if (loadBalancer.isUdpProtocol()) { if (dbLoadBalancer.isConnectionLogging()) { LOG.error(logErr); throw new UnprocessableEntityException(logErr); } LOG.debug("Change to UDP based protocol does not clash with current logging state."); } } }
Source:
public void testAdd() { String id = "fakeID"; IItemDescriptor<Factory> instance = createDescriptor(id, 1, new MatchEngineFactoryImpl()); IItemDescriptor<Factory> oldValue = registry.add(instance); assertTrue(registry.getItemDescriptors().size() == 1); assertTrue(registry.getItemDescriptor(id) == instance); assertTrue(registry.getHighestRankingDescriptor() == instance); assertTrue(oldValue == null); }

Target:
public void testAdd() { String id = "fakeID"; IItemDescriptor<Factory> instance = createDescriptor(id, 1, new MatchEngineFactoryImpl()); IItemDescriptor<Factory> oldValue = registry.add(instance); assertEquals(registry.getItemDescriptors().size(), 1); assertSame(registry.getItemDescriptor(id), instance); assertSame(registry.getHighestRankingDescriptor(), instance); assertNull(oldValue); }
Source:
public void testConvertToMimeType(String mimeType) throws IOException { String converterName = cs.getConverterName(mimeType, "text/html"); assertEquals("zip2html", converterName); checkConverterAvailability(converterName); BlobHolder htmlBH = getBlobFromPath("test-docs/hello.zip"); htmlBH.getBlob().setMimeType(mimeType); Map<String, Serializable> parameters = Collections.emptyMap(); BlobHolder result = cs.convert(converterName, htmlBH, parameters); assertNotNull(result); List<Blob> blobs = result.getBlobs(); assertNotNull(blobs); assertEquals(3, blobs.size()); Map<String, String> zipContent = new HashMap<>(); zipContent.put("hello.xml", "Hello from a xml <b>document</b>"); zipContent.put("hello.txt", "Hello from a text document"); String content = blobs.get(0).getString(); assertTrue(content, content.contains("<li><a href=\"hello.xml\">hello.xml</a></li>")); assertTrue(content, content.contains("<li><a href=\"hello.txt\">hello.txt</a></li>")); for (int i = 1; i < blobs.size(); i++) { File file = blobs.get(i).getFile(); content = DocumentUTUtils.readContent(file); assertTrue(content, content.contains(zipContent.get(file.getName()))); zipContent.remove(file.getName()); } assertEquals(zipContent.size(), 0, zipContent.size()); }

Target:
public void testConvertToMimeType(String mimeType) throws IOException { String converterName = cs.getConverterName(mimeType, "text/html"); assertEquals("zip2html", converterName); checkConverterAvailability(converterName); BlobHolder htmlBH = getBlobFromPath("test-docs/hello.zip"); htmlBH.getBlob().setMimeType(mimeType); Map<String, Serializable> parameters = Collections.emptyMap(); BlobHolder result = cs.convert(converterName, htmlBH, parameters); assertNotNull(result); List<Blob> blobs = result.getBlobs(); assertNotNull(blobs); assertEquals(3, blobs.size()); Map<String, String> zipContent = new HashMap<>(); zipContent.put("hello.xml", "Hello from a xml <b>document</b>"); zipContent.put("hello.txt", "Hello from a text document"); String content = blobs.get(0).getString(); assertTrue(content, content.contains("<li><a href=\"hello.xml\">hello.xml</a></li>")); assertTrue(content, content.contains("<li><a href=\"hello.txt\">hello.txt</a></li>")); for (int i = 1; i < blobs.size(); i++) { File file = blobs.get(i).getFile(); String filename = file.getName(); content = DocumentUTUtils.readContent(file); assertTrue("File " + i + " does not contain " + filename + ": " + content, content.contains(zipContent.get(file.getName()))); zipContent.remove(file.getName()); } assertTrue("Unexpected remaining files: " + zipContent.keySet(), zipContent.isEmpty()); }
Source:
List<AqlSearchResult.SearchEntry> SearchByFileSpec(FileSpec file) throws IOException { AqlSearchHelper aqlHelper = new AqlSearchHelper(client); WildcardsSearchHelper wildcardHelper = new WildcardsSearchHelper(client); List<AqlSearchResult.SearchEntry> results = new ArrayList<>(); log.info("Searching for artifacts..."); switch(file.getSpecType()) { case PATTERN: { setWildcardHelperProperties(wildcardHelper,file); results = wildcardHelper.collectArtifactsByPattern(file.getPattern(), file.getExcludePatterns()); break; } case BUILD: { setAqlHelperProperties(aqlHelper,file); results = aqlHelper.collectArtifactsByBuild(); break; } case AQL: { setAqlHelperProperties(aqlHelper,file); results = aqlHelper.collectArtifactsByAql(file.getAql()); break; } } log.info(String.format("Found %s artifacts.", results.size())); return results; }

Target:
List<AqlSearchResult.SearchEntry> SearchByFileSpec(FileSpec file) throws IOException { List<AqlSearchResult.SearchEntry> results = null; log.info("Searching for artifacts..."); switch (file.getSpecType()) { case PATTERN: { WildcardsSearchHelper wildcardHelper = getNewWildcardHelper(file); results = wildcardHelper.collectArtifactsByPattern(file.getPattern(), file.getExcludePatterns()); break; } case BUILD: { AqlSearchHelper aqlHelper = getNewAqlHelper(file); results = aqlHelper.collectArtifactsByBuild(); break; } case AQL: { AqlSearchHelper aqlHelper = getNewAqlHelper(file); results = aqlHelper.collectArtifactsByAql(file.getAql()); break; } } results = (results == null ? new ArrayList<>() : results); log.info(String.format("Found %s artifacts.", results.size())); return results; }
Source:
protected SnapshotTransaction createTransaction( long immutableTimestamp, Supplier<Long> startTimestampSupplier, LockToken immutableTsLock, AdvisoryLockPreCommitCheck advisoryLockCheck) { return new SnapshotTransaction( keyValueService, timelockService, transactionService, cleaner, startTimestampSupplier, conflictDetectionManager, sweepStrategyManager, immutableTimestamp, Optional.of(immutableTsLock), advisoryLockCheck, constraintModeSupplier.get(), cleaner.getTransactionReadTimeoutMillis(), TransactionReadSentinelBehavior.THROW_EXCEPTION, allowHiddenTableAccess, timestampValidationReadCache, lockAcquireTimeoutMs.get(), getRangesExecutor, defaultGetRangesConcurrency, sweepQueueWriter::enqueue); }

Target:
protected SnapshotTransaction createTransaction( long immutableTimestamp, Supplier<Long> startTimestampSupplier, LockToken immutableTsLock, AdvisoryLockPreCommitCheck advisoryLockCheck) { return new SnapshotTransaction( keyValueService, timelockService, transactionService, cleaner, startTimestampSupplier, conflictDetectionManager, sweepStrategyManager, immutableTimestamp, Optional.of(immutableTsLock), advisoryLockCheck, constraintModeSupplier.get(), cleaner.getTransactionReadTimeoutMillis(), TransactionReadSentinelBehavior.THROW_EXCEPTION, allowHiddenTableAccess, timestampValidationReadCache, lockAcquireTimeoutMs.get(), getRangesExecutor, defaultGetRangesConcurrency, sweepQueueWriter); }
Source:
public SyntaxErrorMessage getSyntaxErrorMessage(IParserErrorContext context) { String defaultMessage = context.getDefaultMessage(); if (defaultMessage.contains(SyntaxErrorMessages.MISSING_EOF)) { return new SyntaxErrorMessage("Failed to parse Expression '" + context.getRecognitionException().token.getText() + "'.", SYNTAX_DIAGNOSTIC); } else { return new SyntaxErrorMessage(defaultMessage, SYNTAX_DIAGNOSTIC); } }

Target:
public SyntaxErrorMessage getSyntaxErrorMessage(IParserErrorContext context) { String defaultMessage = context.getDefaultMessage(); if (!defaultMessage.contains(SyntaxErrorMessages.MISSING_EOF)) { return new SyntaxErrorMessage(defaultMessage, SYNTAX_DIAGNOSTIC); } RecognitionException recognitionException = context.getRecognitionException(); String message = "Failed to parse Expression."; boolean lexicalAnalysisFailed = recognitionException == null; if (!lexicalAnalysisFailed) { message = "Failed to parse Expression '" + recognitionException.token.getText() + "'."; } return new SyntaxErrorMessage(message, SYNTAX_DIAGNOSTIC); }
Source:
private static String[] cleanAndTokenize(String text) throws IOException { if (sentenceDetector == null) { final File sentenceModelFile = InstalledFileLocator.getDefault().locate("textclassifier/en-sent-ewt.bin", TextClassifierUtils.class.getPackage().getName(), false); if (sentenceModelFile == null) { throw new IOException("Error finding sentence detector module"); } sentenceDetector = new NewlineHeuristicSentenceDetector(new SentenceDetectorME(new SentenceModel(new FileInputStream(sentenceModelFile)))); } ArrayList<String> tokens = new ArrayList<>(); String[] sentences = sentenceDetector.sentDetect(text); for (String sentence : sentences) { String[] sentenceTokens = TOKENIZER.tokenize(sentence); ArrayList<String> tokensToKeep = new ArrayList<>(); if (sentenceTokens.length > 5) { tokens.addAll(Arrays.asList(sentenceTokens)); } } return tokens.toArray(new String[0]); }

Target:
private static String[] cleanAndTokenize(String text) throws IOException { initializeSentenceDetector(); ArrayList<String> tokens = new ArrayList<>(); String[] sentences = sentenceDetector.sentDetect(text); for (String sentence : sentences) { String[] sentenceTokens = TOKENIZER.tokenize(sentence); if (sentenceTokens.length > 5) { tokens.addAll(Arrays.asList(sentenceTokens)); } } return tokens.toArray(new String[0]); }
Source:
public PoolExhaustedException(HostConnectionPool hostConnectionPool, Throwable t) { super(t); hcp = hostConnectionPool; }

Target:
public PoolExhaustedException(HostConnectionPool hostConnectionPool, Throwable t) { super(t); this.hcp = hostConnectionPool; }
Source:
public CommandErrorCallback(final Command command) { this.command = checkNotNull("view", command); }

Target:
public CommandErrorCallback(final Command command) { this.command = checkNotNull("command", command); }
Source:
private boolean isNotTimeshiftedOrHd(Channel channel) { return !(channel.getTimeshifted() || channel.getHighDefinition()); }

Target:
boolean isNotTimeshiftedOrHd(Channel channel) { boolean timeshifted = MoreObjects.firstNonNull(channel.getTimeshifted(), false); boolean hd = MoreObjects.firstNonNull(channel.getHighDefinition(), false); return !(timeshifted || hd); }
Source:
public void render(Context context, String value, SafeHtmlBuilder sb) { if (value == null) { value = ""; } String tooltip = value; if (this.sDateDisplayTooltipFormat != null && this.sDateDisplayTooltipFormat != "" && this.sDateFormat != null && this.sDateFormat != "") { try { Date date = DateTimeFormat.getFormat(this.sDateFormat).parse(value); tooltip = DateTimeFormat.getFormat(this.sDateDisplayTooltipFormat).format(date); } catch (Exception e){ } } sb.appendHtmlConstant("<div title=\"" + tooltip + "\" >" + value + "</div>"); }

Target:
public void render(Context context, String value, SafeHtmlBuilder sb) { if (value == null) { value = ""; } String tooltip = value; if (this.sDateDisplayTooltipFormat != null && this.sDateDisplayTooltipFormat != "" && this.sDateFormat != null && this.sDateFormat != "") { try { Date date = DateTimeFormat.getFormat(this.sDateFormat).parse(value); tooltip = DateTimeFormat.getFormat(this.sDateDisplayTooltipFormat).format(date); } catch (Exception e){ } } sb.append(template.action(tooltip, value)); }
Source:
public LinkdStatusProvider(AlarmDao alarmDao) { m_alarmDao = alarmDao; }

Target:
public LinkdStatusProvider(AlarmDao alarmDao) { m_alarmDao = Objects.requireNonNull(alarmDao); }
Source:
public void seedShouldGrowWherePlanted() { setBlock(new Vector3i(), dirt); setBlock(new Vector3i(0, 1, 0), air); EntityRef seed = testSeed(); plant(seed, new Vector3f()); Assertions.assertEquals(bush, worldProvider.getBlock(new Vector3i(0, 1, 0))); Assertions.assertEquals(dirt, worldProvider.getBlock(new Vector3i(0, 0, 0))); }

Target:
public void seedShouldGrowWherePlanted() { setBlock(new Vector3i(0, 0, 0), dirt); setBlock(new Vector3i(0, 1, 0), air); EntityRef seed = testSeed(); plant(seed, new Vector3f(0, 0, 0)); Assertions.assertEquals(bush, worldProvider.getBlock(new Vector3i(0, 1, 0))); Assertions.assertEquals(dirt, worldProvider.getBlock(new Vector3i(0, 0, 0))); }
Source:
private void applyForceCloseTimeout(final Channel channel, ChannelFuture flushFuture) { final long forceCloseTimeoutMillis = this.forceCloseTimeoutMillis; if (forceCloseTimeoutMillis <= 0 || !channel.isActive()) { return; } flushFuture.addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { if (!future.isSuccess() || !channel.isActive()) { return; } if (!forceCloseInit.compareAndSet(false, true)) { return; } final ScheduledFuture<?> forceCloseFuture = channel.eventLoop().schedule(new Runnable() { @Override public void run() { if (channel.isActive()) { channel.close(); setForceCloseComplete(); } } }, forceCloseTimeoutMillis, TimeUnit.MILLISECONDS); channel.closeFuture().addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { forceCloseFuture.cancel(false); } }); } }); }

Target:
private void applyForceCloseTimeout(final Channel channel, ChannelFuture flushFuture) { final long forceCloseTimeoutMillis = this.forceCloseTimeoutMillis; final WebSocketClientHandshaker handshaker = this; if (forceCloseTimeoutMillis <= 0 || !channel.isActive() || forceCloseInit != 0) { return; } flushFuture.addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { if (future.isSuccess() && channel.isActive() && FORCE_CLOSE_INIT_UPDATER.compareAndSet(handshaker, 0, 1)) { final Future<?> forceCloseFuture = channel.eventLoop().schedule(new Runnable() { @Override public void run() { if (channel.isActive()) { channel.close(); forceCloseComplete = true; } } }, forceCloseTimeoutMillis, TimeUnit.MILLISECONDS); channel.closeFuture().addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { forceCloseFuture.cancel(false); } }); } } }); }
Source:
public Opt<Identity> enter(final String user, final String pwd) { final Opt<Identity> identity; final User valid = this.usernames.get(user); if (valid == null) { identity = new Opt.Empty<Identity>(); } else if (valid.password().equals(pwd)) { identity = new Opt.Single<Identity>(valid.identity()); } else { identity = new Opt.Empty<Identity>(); } return identity; }

Target:
public Opt<Identity> enter(final String user, final String pwd) { final Opt<String> urn = this.urn(user, pwd); final Opt<Identity> identity; if (urn.has()) { try { identity = new Opt.Single<Identity>( new Identity.Simple( URLDecoder.decode(urn.get(), Default.ENCODING) ) ); } catch (final UnsupportedEncodingException ex) { throw new IllegalStateException(ex); } } else { identity = new Opt.Empty<Identity>(); } return identity; }
Source:
private void validateStartDateTimeToBirthdate(Visit visit, Errors errors) { Patient patient = visit.getPatient(); if (patient != null) { if (visit.getStartDatetime() != null && patient.getBirthdate() != null && !patient.getBirthdateEstimated() && visit.getStartDatetime().before(patient.getBirthdate())) { errors.rejectValue("startDatetime", "Visit.startDateCannotBeBeforeBirthdate", "This visit has a start date before birth date of the patient."); } } }

Target:
private void validateStartDateTimeToBirthdate(Visit visit, Errors errors) { Patient patient = visit.getPatient(); if (patient != null) { if (visit.getStartDatetime() != null && patient.getBirthdate() != null) { if (!patient.getBirthdateEstimated() && visit.getStartDatetime().before(patient.getBirthdate())) { errors.rejectValue("startDatetime", "Visit.startDateCannotBeBeforeBirthdate", "This visit has a start date before birth date of the patient."); } if (patient.getBirthdateEstimated()) { Calendar calendar = Calendar.getInstance(); calendar.setTime(patient.getBirthdate()); long ageInMillis = Calendar.getInstance().getTimeInMillis() - calendar.getTimeInMillis(); long ageInYears = (ageInMillis / 86400000) / 365; int ageInMillisInt = (int) ageInMillis; if (ageInYears < 2) { calendar.add(Calendar.YEAR, -1); } else { calendar.add(Calendar.MILLISECOND, -(ageInMillisInt / 2)); } Date estimatedDate = calendar.getTime(); if (visit.getStartDatetime().before(estimatedDate)) { errors.rejectValue("startDatetime", "Visit.startDateCannotBeBeforeBirthdate", "This visit has a start date before birth date of the patient."); } } } } }
Source:
protected byte[] downloadByteArray(AccountingXmlDocumentBackupLink accountingXmlDocumentBackupLink) throws IOException { Collection<WebServiceCredential> credentials = getWebServiceCredentials(accountingXmlDocumentBackupLink); try { if (isLinkUrlValidForGroupCode(accountingXmlDocumentBackupLink, credentials)) { Invocation request = buildClientRequest(accountingXmlDocumentBackupLink.getLinkUrl(), credentials); return downloadByteArrayFromWebResource(accountingXmlDocumentBackupLink.getFileName(), request); } else { LOG.error("downloadByteArray, the group code isn't valid for the link URL"); throw new ValidationException("The group code: " + accountingXmlDocumentBackupLink.getCredentialGroupCode() + " isn't valid for the link URL: " + accountingXmlDocumentBackupLink.getLinkUrl()); } } catch (URISyntaxException e) { throw new IOException(e.getMessage()); } }

Target:
protected byte[] downloadByteArray(AccountingXmlDocumentBackupLink accountingXmlDocumentBackupLink) throws IOException { Collection<WebServiceCredential> credentials = getWebServiceCredentials(accountingXmlDocumentBackupLink); try { if (isLinkUrlValidForGroupCode(accountingXmlDocumentBackupLink, credentials)) { Invocation request = buildClientRequest(accountingXmlDocumentBackupLink.getLinkUrl(), credentials); return downloadByteArrayFromWebResource(accountingXmlDocumentBackupLink.getFileName(), request); } else { LOG.error("downloadByteArray, the group code isn't valid for the link URL"); throw new ValidationException("The group code: " + accountingXmlDocumentBackupLink.getCredentialGroupCode() + " isn't valid for the link URL: " + accountingXmlDocumentBackupLink.getLinkUrl()); } } catch (URISyntaxException e) { LOG.error("downloadByteArray, the URL has an incorrect syntax", e); throw new ValidationException("The URL has an incorrect syntax: " + accountingXmlDocumentBackupLink.getLinkUrl()); } }
Source:
private void handleAttributeOrDirective(Annotation a) { Object o = getOrDefault(lastMethodSeen); if (o != null) { String attributeName = a.get("value"); if (attributeName == null) { attributeName = lastMethodSeen; } if (STD_DIRECTIVE.equals(a.getName() .getFQN())) { attributeName += ":"; } if (!attributesAndDirectives.containsKey(attributeName)) { attributesAndDirectives.putTyped(attributeName, o); } } }

Target:
private void handleAttributeOrDirective(Annotation a) { Object o = annotation.get(lastMethodSeen); if (o != null) { String attributeName = a.get("value"); if (attributeName == null) { attributeName = lastMethodSeen; } if (STD_DIRECTIVE.equals(a.getName() .getFQN())) { attributeName += ":"; } if (!attributesAndDirectives.containsKey(attributeName)) { attributesAndDirectives.putTyped(attributeName, o); } } }
Source:
public static MyLooperDelayedExecutor newInstance() { Handler handler = new Handler(); return new MyLooperDelayedExecutor(handler, new HashMap<Action, Runnable>()); }

Target:
public static MyLooperDelayedExecutor newInstance() { Handler handler = new Handler(Looper.myLooper()); return new MyLooperDelayedExecutor(handler, new HashMap<Action, Runnable>()); }