auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public CreateContainerCmd getBaseCommand() { String hostDir = MesosCluster.getHostDir().getAbsolutePath(); return dockerClient.createContainerCmd( getMesosImageName() + ":" + getMesosImageTag() ) .withName( getName() ) .withPrivileged(true) .withEnv(createMesosLocalEnvironment()) .withPid("host") .withLinks(new Link(getZooKeeperContainer().getContainerId(), "minimesos-zookeeper")) .withBinds( Bind.parse("/var/run/docker.sock:/var/run/docker.sock"), Bind.parse("/sys/fs/cgroup:/sys/fs/cgroup"), Bind.parse(String.format("%s:%s:rw", hostDir + "/.minimesos/sandbox-" + getClusterId() + "/" + MesosCluster.SLAVE_MAPPING_DIR + this.getUuid(), MESOS_AGENT_SANDBOX_DIR)), Bind.parse(hostDir + ":" + hostDir) <START> ); <END> }</code><technical_language>2 directories important in minimesos. is _install directory_ ${HOME}/.minimesos contains bin/minimesos is _cluster directory_ ${PWD}/.minimesos contains minimesos.cluster In this snippet create a sandbox-clusterID directory in install directory. instead add a sandbox directory in cluster directory? rename identifier hostDir is clear directory talking about</technical_language>

Target:
public CreateContainerCmd getBaseCommand() { String hostDir = MesosCluster.getHostDir().getAbsolutePath(); List<Bind> binds = new ArrayList<>(); binds.add(Bind.parse("/var/run/docker.sock:/var/run/docker.sock")); binds.add(Bind.parse("/sys/fs/cgroup:/sys/fs/cgroup")); binds.add(Bind.parse(hostDir + ":" + hostDir)); if (getCluster().getMapAgentSandboxVolume()) { binds.add(Bind.parse(String.format("%s:%s:rw", hostDir + "/.minimesos/sandbox-" + getClusterId() + "/agent-" + getUuid(), MESOS_AGENT_SANDBOX_DIR))); } return dockerClient.createContainerCmd( getMesosImageName() + ":" + getMesosImageTag() ) .withName( getName() ) .withPrivileged(true) .withEnv(createMesosLocalEnvironment()) .withPid("host") .withLinks(new Link(getZooKeeperContainer().getContainerId(), "minimesos-zookeeper")) .withBinds(binds.stream().toArray(Bind[]::new)); }
Source:
<code>public void get() { call = cachedService.service(site).get(); call.enqueue(new Callback<CardPageItem>() { @Override public void onResponse(Call<CardPageItem> call, Response<CardPageItem> response) { responseHeaderHandler.onHeaderCheck(response); PageTitle title = response.body().toPageTitle(site); cb.onSuccess(title); } @Override public void onFailure(Call<CardPageItem> call, Throwable t) { <START> L.w("Failed to get random page title/summary", t); <END> } }); }</code><technical_language>Is call cb.onError here</technical_language>

Target:
public void get() { Call<CardPageItem> call = cachedService.service(site).get(); call.enqueue(new Callback<CardPageItem>() { @Override public void onResponse(Call<CardPageItem> call, Response<CardPageItem> response) { responseHeaderHandler.onHeaderCheck(response); PageTitle title = response.body().toPageTitle(site); cb.onSuccess(title); } @Override public void onFailure(Call<CardPageItem> call, Throwable t) { L.w("Failed to get random page title/summary", t); cb.onError(t); } }); }
Source:
<code>public void handle(LegacyHandshake legacyHandshake) throws Exception { this.legacy = true; <START> ch.close( bungee.getTranslation( "outdated_client", BungeeCord.getInstance().getGameVersion() ) ); <END> }</code><technical_language>bungee field</technical_language>

Target:
public void handle(LegacyHandshake legacyHandshake) throws Exception { this.legacy = true; ch.close( bungee.getTranslation( "outdated_client", bungee.getGameVersion() ) ); }
Source:
<code>protected void preHookCreateControlAndViewer() { fAdapterFactory = new ComposedAdapterFactory(EMFCompareRCPPlugin.getDefault() .getAdapterFactoryRegistry()); fAdapterFactory.addAdapterFactory(new TreeItemProviderAdapterFactorySpec()); fAdapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory()); fAdapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory()); getCompareConfiguration().setAdapterFactory(fAdapterFactory); <START> updateColors(); <END> inputChangedTask = new CompareInputChangedJob("Computing Model Differences"); }</code><technical_language>ICompareColor instead, ease maintenance</technical_language>

Target:
protected void preHookCreateControlAndViewer() { fAdapterFactory = new ComposedAdapterFactory(EMFCompareRCPPlugin.getDefault() .getAdapterFactoryRegistry()); fAdapterFactory.addAdapterFactory(new TreeItemProviderAdapterFactorySpec()); fAdapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory()); fAdapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory()); getCompareConfiguration().setAdapterFactory(fAdapterFactory); inputChangedTask = new CompareInputChangedJob("Computing Model Differences"); }
Source:
<code>public static Map<String, Object> encounterParameters(Encounter encounter) { Map<String, Object> encounterParameters = new HashMap<>(); encounterParameters.put(EventKeys.ENCOUNTER_ID, encounter.getUuid()); if (encounter.getEncounterProviders().get(0) != null) { encounterParameters.put(EventKeys.PROVIDER_ID, encounter.getEncounterProviders().get(0).getUuid()); } else { encounterParameters.put(EventKeys.PROVIDER_ID, null); } if (encounter.getLocation() != null) { encounterParameters.put(EventKeys.LOCATION_ID, encounter.getLocation().getUuid()); } else { encounterParameters.put(EventKeys.LOCATION_ID, null); } if (encounter.getVisit() != null) { encounterParameters.put(EventKeys.VISIT_ID, encounter.getVisit().getUuid()); } encounterParameters.put(EventKeys.ENCOUNTER_DATE, encounter.getEncounterDatetime()); encounterParameters.put(EventKeys.ENCOUNTER_TYPE, encounter.getEncounterType().getUuid()); <START> encounterParameters.put(EventKeys.FORM_ID, encounter.getForm().getUuid()); <END> return encounterParameters; }</code><technical_language>form is optional ,so please add if</technical_language>

Target:
public static Map<String, Object> encounterParameters(Encounter encounter) { Map<String, Object> encounterParameters = new HashMap<>(); encounterParameters.put(EventKeys.ENCOUNTER_ID, encounter.getUuid()); if (encounter.getEncounterProviders().get(0) != null) { encounterParameters.put(EventKeys.PROVIDER_ID, encounter.getEncounterProviders().get(0).getUuid()); } else { encounterParameters.put(EventKeys.PROVIDER_ID, null); } if (encounter.getLocation() != null) { encounterParameters.put(EventKeys.LOCATION_ID, encounter.getLocation().getUuid()); } else { encounterParameters.put(EventKeys.LOCATION_ID, null); } if (encounter.getVisit() != null) { encounterParameters.put(EventKeys.VISIT_ID, encounter.getVisit().getUuid()); } if (encounter.getForm() != null) { encounterParameters.put(EventKeys.FORM_ID, encounter.getForm().getUuid()); } encounterParameters.put(EventKeys.ENCOUNTER_DATE, encounter.getEncounterDatetime()); encounterParameters.put(EventKeys.ENCOUNTER_TYPE, encounter.getEncounterType().getUuid()); return encounterParameters; }
Source:
<code>private boolean isHostHealthy(CassandraClientPoolingContainer container) { try { container.runWithPooledResource(CassandraUtils.getDescribeRing(config)); container.runWithPooledResource(CassandraUtils.getValidatePartitioner(config)); return true; } catch (Exception e) { <START> log.debug("We tried to add blacklisted host '{}' back into the pool, but got an exception" <END> + " that caused us to distrust this host further. Exception message was: : {}", SafeArg.of("host", CassandraLogHelper.host(container.getHost())), SafeArg.of("exceptionClass", e.getClass().getCanonicalName()), UnsafeArg.of("exceptionMessage", e.getMessage())); return false; } }</code><technical_language>this is TimedOutException Thrift-based things, I if this is useful for debugging</technical_language>

Target:
private boolean isHostHealthy(CassandraClientPoolingContainer container) { try { container.runWithPooledResource(CassandraUtils.getDescribeRing(config)); container.runWithPooledResource(CassandraUtils.getValidatePartitioner(config)); return true; } catch (Exception e) { log.info("We tried to add blacklisted host '{}' back into the pool, but got an exception" + " that caused us to distrust this host further. Exception message was: : {}", SafeArg.of("host", CassandraLogHelper.host(container.getHost())), SafeArg.of("exceptionClass", e.getClass().getCanonicalName()), UnsafeArg.of("exceptionMessage", e.getMessage())); return false; } }
Source:
<code>protected void update(int position, Object object, int viewType) { if (viewType == ITEM_HEADER) { updater.view.setEnabled(false); updater.view.setOnClickListener(null); Repository repository = (Repository) object; setText(0, repository.fullName()); setText(1, "\uf03a"); if (!textView(1).hasOnClickListeners()) { textView(1).setOnClickListener(v -> notificationReadListener.readNotifications(repository)); } } else if (viewType == ITEM_NOTIFICATION) { NotificationThread notificationThread = (NotificationThread) object; String type = notificationThread.subject().type(); switch (type) { case "Issue": setText(0, OcticonTextView.ICON_ISSUE_OPEN); break; case "Release": setText(0, OcticonTextView.ICON_TAG); break; default: setText(0, OcticonTextView.ICON_PULL_REQUEST); break; } setText(1, notificationThread.subject().title()); setText(2, TimeUtils.getRelativeTime(notificationThread.updatedAt())); <START> setText(3, "\uf03a"); <END> setGone(3, !notificationThread.unread()); if (!textView(3).hasOnClickListeners()) { textView(3).setOnClickListener(v -> notificationReadListener.readNotification(notificationThread)); } } }</code><technical_language>add a constant in OcticonTextView.ICON_READ in here, code more readable</technical_language>

Target:
protected void update(int position, Object object, int viewType) { if (viewType == ITEM_HEADER) { updater.view.setEnabled(false); updater.view.setOnClickListener(null); Repository repository = (Repository) object; setText(0, repository.fullName()); setText(1, "\uf03a"); if (!textView(1).hasOnClickListeners()) { textView(1).setOnClickListener(v -> notificationReadListener.readNotifications(repository)); } } else if (viewType == ITEM_NOTIFICATION) { NotificationThread notificationThread = (NotificationThread) object; String type = notificationThread.subject().type(); switch (type) { case "Issue": setText(0, OcticonTextView.ICON_ISSUE_OPEN); break; case "Release": setText(0, OcticonTextView.ICON_TAG); break; default: setText(0, OcticonTextView.ICON_PULL_REQUEST); break; } setText(1, notificationThread.subject().title()); setText(2, TimeUtils.getRelativeTime(notificationThread.updatedAt())); setText(3, OcticonTextView.ICON_READ); setGone(3, !notificationThread.unread()); if (!textView(3).hasOnClickListeners()) { textView(3).setOnClickListener(v -> notificationReadListener.readNotification(notificationThread)); } } }
Source:
<code>public ValueGetter makeValueGetter(final DimensionSelector selector) { if (selector.getValueCardinality() == 0) { return new ValueGetter() { @Override public String[] get() { <START> return new String[]{ null }; <END> } }; } else { return new ValueGetter() { @Override public String[] get() { final IndexedInts row = selector.getRow(); final int size = row.size(); if (size == 0) { return new String[]{ null }; } else { String[] values = new String[size]; for (int i = 0; i < size; ++i) { values[i] = Strings.emptyToNull(selector.lookupName(row.get(i))); } return values; } } }; } }</code><technical_language>This String[], ValueGetter itself, extracted constants</technical_language>

Target:
public ValueGetter makeValueGetter(final DimensionSelector selector) { if (selector.getValueCardinality() == 0) { return NULL_VALUE_GETTER; } else { return new ValueGetter() { @Override public String[] get() { final IndexedInts row = selector.getRow(); final int size = row.size(); if (size == 0) { return NULL_VALUE; } else { String[] values = new String[size]; for (int i = 0; i < size; ++i) { values[i] = Strings.emptyToNull(selector.lookupName(row.get(i))); } return values; } } }; } }
Source:
<code><START> public void setCenter(Node nodeToShow) { <END> this.content.setCenter(nodeToShow); }</code><technical_language>Ok, do this in another PR a time</technical_language>

Target:
public void setCenter(Node nodeToShow) { closeDetailsView(); this.content.setCenter(nodeToShow); }
Source:
<code>public boolean isEnchantedCreature(MageObject input, Game game) { <START> if (!input.getCardType().contains(CardType.CREATURE)) { <END> return false; } for (UUID attachmentId : ((Permanent)input).getAttachments()) { Permanent attachment = game.getPermanent(attachmentId); if (attachment != null && attachment.getCardType().contains(CardType.ENCHANTMENT)) { return true; } } return false; }</code><technical_language>check input != null</technical_language>

Target:
public boolean isEnchantedCreature(MageObject input, Game game) { if (input != null && !input.getCardType().contains(CardType.CREATURE)) { return false; } for (UUID attachmentId : ((Permanent)input).getAttachments()) { Permanent attachment = game.getPermanent(attachmentId); if (attachment != null && attachment.getCardType().contains(CardType.ENCHANTMENT)) { return true; } } return false; }
Source:
<code>protected Object deleteToken(Object obj, ApiRequest request) { String jwt = ""; Token token = null; if (SecurityConstants.INTERNAL_AUTH_PROVIDERS.contains(SecurityConstants.AUTH_PROVIDER.get())) { for (TokenCreator tokenCreator : tokenCreators) { if (tokenCreator.isConfigured() && tokenCreator.providerType().equalsIgnoreCase(SecurityConstants.AUTH_PROVIDER.get())) { if (!SecurityConstants.SECURITY.get()) { tokenCreator.reset(); } jwt = tokenCreator.getTokenJWTValue(); <START> token = tokenCreator.getCurrentToken(); <END> break; } } } else { if (externalAuthProvider.isConfigured()) { jwt = tokenUtil.getJWT(); token = externalAuthProvider.readCurrentToken(); } } if(StringUtils.isBlank(jwt)) { throw new ClientVisibleException(ResponseCodes.INTERNAL_SERVER_ERROR, "JWTNotProvided", "Request does not contain JWT cookie", null); } AuthToken authToken= authTokenDao.getTokenByKey(jwt); String tokenId = (String)ApiContext.getContext().getIdFormatter().formatId(objectManager.getType(Account.class), authToken.getId()); if(!StringUtils.equals(tokenId, token.getId())) { throw new ClientVisibleException(ResponseCodes.INTERNAL_SERVER_ERROR, "TokenIDMismatch", "JWT and Token ID do not match", null); } request.setResponseCode(ResponseCodes.NO_CONTENT); if(authTokenDao.deleteToken(jwt)) { return obj; } return null; }</code><technical_language>Lets set jwt key Token returned tokenCreator.getCurrentToken();. This expose call separate method tokenCreator.getTokenJWTValue()</technical_language>

Target:
protected Object deleteToken(Object obj, ApiRequest request) { Token token = new Token(); String jwt = ""; token = listToken(); jwt = token.getJwt(); if(StringUtils.isBlank(jwt)) { throw new ClientVisibleException(ResponseCodes.INTERNAL_SERVER_ERROR, "JWTNotProvided", "Request does not contain JWT cookie", null); } request.setResponseCode(ResponseCodes.NO_CONTENT); HttpServletResponse response = request.getServletContext().getResponse(); String cookieString="token=;Path=/;Expires=Thu, 01 Jan 1970 00:00:00 GMT;"; response.addHeader("Set-Cookie", cookieString); request.getServletContext().setResponse(response); if(authTokenDao.deleteToken(jwt)) { return obj; } return null; }
Source:
<code>private boolean runReadyJob(final ExecutableNode node) throws IOException { if (Status.isStatusFinished(node.getStatus()) || Status.isStatusRunning(node.getStatus())) { return false; } final Status nextNodeStatus = getImpliedStatus(node); if (nextNodeStatus == null) { return false; } if (nextNodeStatus == Status.CANCELLED) { if (node instanceof ExecutableFlow && node.getParentFlow() == null) { <START> logger.info(String.format("Flow '%s' was cancelled before execution had started.", <END> node.getId())); finalizeFlow((ExecutableFlow) node); } else { this.logger.info("Cancelling '" + node.getNestedId() + "' due to prior errors."); node.cancelNode(System.currentTimeMillis()); finishExecutableNode(node); } } else if (nextNodeStatus == Status.SKIPPED) { this.logger.info("Skipping disabled job '" + node.getId() + "'."); node.skipNode(System.currentTimeMillis()); finishExecutableNode(node); } else if (nextNodeStatus == Status.READY) { if (node instanceof ExecutableFlowBase) { final ExecutableFlowBase flow = ((ExecutableFlowBase) node); this.logger.info("Running flow '" + flow.getNestedId() + "'."); flow.setStatus(Status.RUNNING); if (flow.getStartTime() <= 0) { flow.setStartTime(System.currentTimeMillis()); } prepareJobProperties(flow); for (final String startNodeId : ((ExecutableFlowBase) node).getStartNodes()) { final ExecutableNode startNode = flow.getExecutableNode(startNodeId); runReadyJob(startNode); } } else { runExecutableNode(node); } } return true; }</code><technical_language>nitpick : this.logger</technical_language>

Target:
private boolean runReadyJob(final ExecutableNode node) throws IOException { if (Status.isStatusFinished(node.getStatus()) || Status.isStatusRunning(node.getStatus())) { return false; } final Status nextNodeStatus = getImpliedStatus(node); if (nextNodeStatus == null) { return false; } if (nextNodeStatus == Status.CANCELLED) { if (node instanceof ExecutableFlow && node.getParentFlow() == null) { this.logger.info(String.format("Flow '%s' was cancelled before execution had started.", node.getId())); finalizeFlow((ExecutableFlow) node); } else { this.logger.info(String.format("Cancelling '%s' due to prior errors.", node.getNestedId())); node.cancelNode(System.currentTimeMillis()); finishExecutableNode(node); } } else if (nextNodeStatus == Status.SKIPPED) { this.logger.info("Skipping disabled job '" + node.getId() + "'."); node.skipNode(System.currentTimeMillis()); finishExecutableNode(node); } else if (nextNodeStatus == Status.READY) { if (node instanceof ExecutableFlowBase) { final ExecutableFlowBase flow = ((ExecutableFlowBase) node); this.logger.info("Running flow '" + flow.getNestedId() + "'."); flow.setStatus(Status.RUNNING); if (flow.getStartTime() <= 0) { flow.setStartTime(System.currentTimeMillis()); } prepareJobProperties(flow); for (final String startNodeId : ((ExecutableFlowBase) node).getStartNodes()) { final ExecutableNode startNode = flow.getExecutableNode(startNodeId); runReadyJob(startNode); } } else { runExecutableNode(node); } } return true; }
Source:
<code>public String toString() { <START> return "custom toString"; <END> }</code><technical_language>I move this a constant access tests well</technical_language>

Target:
public String toString() { return CUSTOM_TO_STRING; }
Source:
<code>protected void localize() { generalTab.setLabel(constants.generalTabNetworkPopup()); clusterTab.setLabel(constants.clusterTabNetworkPopup()); profilesTab.setLabel(constants.profilesTabNetworkPopup()); subnetTab.setLabel(constants.subnetTabNetworkPopup()); dataCenterEditor.setLabel(constants.networkPopupDataCenterLabel()); assignLabel.setText(constants.networkPopupAssignLabel()); nameEditor.setLabel(constants.nameLabel()); descriptionEditor.setLabel(constants.descriptionLabel()); exportLabel.setText(constants.exportLabel()); exportEditor.setLabel(constants.exportCheckboxLabel()); externalProviderEditor.setLabel(constants.externalProviderLabel()); neutronPhysicalNetwork.setLabel(constants.neutronPhysicalNetwork()); networkLabel.setLabel(constants.networkLabel()); commentEditor.setLabel(constants.commentLabel()); isVmNetworkEditor.setLabel(constants.vmNetworkLabel()); vlanTagging.setLabel(constants.enableVlanTagLabel()); qosEditor.setLabel(constants.hostNetworkQos()); createSubnetEditor.setLabel(constants.createSubnetLabel()); profilesLabel.setText(constants.profilesLabel()); <START> shouldSetDnsConfigurationEditor.setLabel(constants.shouldSetDnsConfigurationLabel()); <END> }</code><technical_language>this moved *.ui.xml</technical_language>

Target:
protected void localize() { generalTab.setLabel(constants.generalTabNetworkPopup()); clusterTab.setLabel(constants.clusterTabNetworkPopup()); profilesTab.setLabel(constants.profilesTabNetworkPopup()); subnetTab.setLabel(constants.subnetTabNetworkPopup()); dataCenterEditor.setLabel(constants.networkPopupDataCenterLabel()); assignLabel.setText(constants.networkPopupAssignLabel()); nameEditor.setLabel(constants.nameLabel()); descriptionEditor.setLabel(constants.descriptionLabel()); exportLabel.setText(constants.exportLabel()); exportEditor.setLabel(constants.exportCheckboxLabel()); externalProviderEditor.setLabel(constants.externalProviderLabel()); neutronPhysicalNetwork.setLabel(constants.neutronPhysicalNetwork()); networkLabel.setLabel(constants.networkLabel()); commentEditor.setLabel(constants.commentLabel()); isVmNetworkEditor.setLabel(constants.vmNetworkLabel()); vlanTagging.setLabel(constants.enableVlanTagLabel()); qosEditor.setLabel(constants.hostNetworkQos()); createSubnetEditor.setLabel(constants.createSubnetLabel()); profilesLabel.setText(constants.profilesLabel()); }
Source:
<code>public void handle(Willie bot, Channel channel, User sender, String[] args) { if (args.length < 1) { channel.sendMessage(Colors.RED + "Please supply a message " + sender.getNick() + "!"); return; } try {ChatterBotFactory factory = new ChatterBotFactory(); ChatterBot cbot = factory.create(ChatterBotType.CLEVERBOT); ChatterBotSession cBotSession = cbot.createSession(); StringBuilder question = new StringBuilder(); for (String arg : args) { question.append(arg + " "); } <START> String cBotResponce = cBotSession.think(question.toString()); <END> channel.sendMessage(Colors.CYAN + "Cleverbot's responce: " + Colors.DARK_GREEN + cBotResponce); } catch (Exception e) { e.printStackTrace(); channel.sendMessage(Colors.RED + "Error Occured! " + e.getMessage()); } }</code><technical_language>trimmed</technical_language>

Target:
public void handle(Willie bot, Channel channel, User sender, String[] args) { if (args.length < 1) { channel.sendMessage(Colors.RED + "Please supply a message " + sender.getNick() + "!"); return; } try {ChatterBotFactory factory = new ChatterBotFactory(); ChatterBot cbot = factory.create(ChatterBotType.CLEVERBOT); ChatterBotSession cBotSession = cbot.createSession(); StringBuilder question = new StringBuilder(); for (String arg : args) { question.append(arg + " "); } String cBotResponce = cBotSession.think(question.toString().trim()).trim(); channel.sendMessage(Colors.CYAN + "Cleverbot's responce: " + Colors.DARK_GREEN + cBotResponce); } catch (Exception e) { e.printStackTrace(); channel.sendMessage(Colors.RED + "Error Occured! " + e.getMessage()); } }
Source:
<code>public void run() { while (!stopped) { synchronized (cleanEvent) { try { if (!stopped && deadWatchers.size() < watcherCleanThreshold) { int maxWaitMs = (watcherCleanIntervalInSeconds + r.nextInt(watcherCleanIntervalInSeconds / 2 + 1)) * 1000; cleanEvent.wait(maxWaitMs); } } catch (InterruptedException e) { LOG.info("Received InterruptedException while " + "waiting for cleanEvent"); break; } } if (deadWatchers.isEmpty()) { continue; } synchronized (this) { final Set<Integer> snapshot = new HashSet<Integer>(deadWatchers); deadWatchers.clear(); int total = snapshot.size(); LOG.info("Processing dead watchers", total); cleaners.schedule(new WorkRequest() { @Override public void doWork() throws Exception { long startTime = Time.currentElapsedTime(); listener.processDeadWatchers(snapshot); long latency = Time.currentElapsedTime() - startTime; <START> LOG.info("Takes to process watchers", latency, total); <END> totalDeadWatchers.addAndGet(-total); synchronized(processingCompletedEvent) { processingCompletedEvent.notifyAll(); } } }); } } LOG.info("WatcherCleaner thread exited"); }</code><technical_language>Watches more reasonable here, watcher maps a single client session, watch multiple paths, multiple watches a single watcher, total is total watches count watcher</technical_language>

Target:
public void run() { while (!stopped) { synchronized (cleanEvent) { try { if (!stopped && deadWatchers.size() < watcherCleanThreshold) { int maxWaitMs = (watcherCleanIntervalInSeconds + r.nextInt(watcherCleanIntervalInSeconds / 2 + 1)) * 1000; cleanEvent.wait(maxWaitMs); } } catch (InterruptedException e) { LOG.info("Received InterruptedException while " + "waiting for cleanEvent"); break; } } if (deadWatchers.isEmpty()) { continue; } synchronized (this) { final Set<Integer> snapshot = new HashSet<Integer>(deadWatchers); deadWatchers.clear(); int total = snapshot.size(); LOG.info("Processing dead watchers", total); cleaners.schedule(new WorkRequest() { @Override public void doWork() throws Exception { long startTime = Time.currentElapsedTime(); listener.processDeadWatchers(snapshot); long latency = Time.currentElapsedTime() - startTime; LOG.info("Takes to process watches", latency, total); totalDeadWatchers.addAndGet(-total); synchronized(processingCompletedEvent) { processingCompletedEvent.notifyAll(); } } }); } } LOG.info("WatcherCleaner thread exited"); }
Source:
<code>public void testQueryConflictCase() { String <START> randomColumn = <END> "random"; Uri uri = Carriers.CONTENT_URI; ContentValues contentValues = new ContentValues(); contentValues.put(Carriers.NAME, NAME); contentValues.put(Carriers.APN, APN); contentValues.put(Carriers.PORT, PORT); contentValues.put(Carriers.PROTOCOL, PROTOCOL); contentValues.put(Carriers.NUMERIC, NUMERIC); try { Log.d(TAG, "testInsertCarriers Inserting contentValues: " + contentValues); mContentResolver.insert(uri, contentValues); final String[] testProjection = { Carriers.NAME, Carriers.APN, Carriers.PORT, Carriers.PROTOCOL, Carriers.NUMERIC, }; final String selection = randomColumn + "=?"; String[] selectionArgs = { randomColumn }; Log.d(TAG, "testInsertCarriers query projection: " + testProjection + "\ntestInsertCarriers selection: " + selection + "\ntestInsertCarriers selectionArgs: " + selectionArgs); Cursor cursor = mContentResolver.query(uri, testProjection, selection, selectionArgs, null); assertNull(cursor); final String selectionToDelete = Carriers.NAME + "=?"; String[] selectionArgsToDelete = { NAME }; Log.d(TAG, "testInsertCarriers deleting selection: " + selectionToDelete + "testInsertCarriers selectionArgs: " + selectionArgs); int numRowsDeleted = mContentResolver.delete(uri, selectionToDelete, selectionArgsToDelete); assertEquals(1, numRowsDeleted); cursor = mContentResolver.query( uri, testProjection, selectionToDelete, selectionArgsToDelete, null); assertEquals(0, cursor.getCount()); } catch (SecurityException e) { failMessage(); } }</code><technical_language>invalidColumn</technical_language>

Target:
public void testQueryConflictCase() { String invalidColumn = "random"; Uri uri = Carriers.CONTENT_URI; ContentValues contentValues = new ContentValues(); contentValues.put(Carriers.NAME, NAME); contentValues.put(Carriers.APN, APN); contentValues.put(Carriers.PORT, PORT); contentValues.put(Carriers.PROTOCOL, PROTOCOL); contentValues.put(Carriers.NUMERIC, NUMERIC); try { Log.d(TAG, "testInsertCarriers Inserting contentValues: " + contentValues); mContentResolver.insert(uri, contentValues); final String[] testProjection = { Carriers.NAME, Carriers.APN, Carriers.PORT, Carriers.PROTOCOL, Carriers.NUMERIC, }; final String selection = invalidColumn + "=?"; String[] selectionArgs = { invalidColumn }; Log.d(TAG, "testInsertCarriers query projection: " + testProjection + "\ntestInsertCarriers selection: " + selection + "\ntestInsertCarriers selectionArgs: " + selectionArgs); Cursor cursor = mContentResolver.query(uri, testProjection, selection, selectionArgs, null); assertNull(cursor); final String selectionToDelete = Carriers.NAME + "=?"; String[] selectionArgsToDelete = { NAME }; Log.d(TAG, "testInsertCarriers deleting selection: " + selectionToDelete + "testInsertCarriers selectionArgs: " + selectionArgs); int numRowsDeleted = mContentResolver.delete(uri, selectionToDelete, selectionArgsToDelete); assertEquals(1, numRowsDeleted); cursor = mContentResolver.query( uri, testProjection, selectionToDelete, selectionArgsToDelete, null); assertEquals(0, cursor.getCount()); } catch (SecurityException e) { failMessage(); } }
Source:
<code>public void paintControl(PaintEvent e) { if (fIsUpdate && (fStartTime != fEndTime)) { IAxis xAxis = getChart().getAxisSet().getXAxis(0); int startX = xAxis.getPixelCoordinate(fStartTime); int endX = xAxis.getPixelCoordinate(fEndTime); if (fStartTime < fEndTime) { <START> e.gc.setBackground(TmfXYChartViewer.getDisplay().getSystemColor(SWT.COLOR_TITLE_INACTIVE_BACKGROUND)); <END> e.gc.fillRectangle(startX, 0, endX - startX, e.height); } else { e.gc.setBackground(TmfXYChartViewer.getDisplay().getSystemColor(SWT.COLOR_TITLE_INACTIVE_BACKGROUND)); e.gc.fillRectangle(endX, 0, startX - endX, e.height); } e.gc.drawLine(startX, 0, startX, e.height); e.gc.drawLine(endX, 0, endX, e.height); } }</code><technical_language>This line if</technical_language>

Target:
public void paintControl(PaintEvent e) { if (fIsUpdate && (fStartTime != fEndTime)) { IAxis xAxis = getChart().getAxisSet().getXAxis(0); int startX = xAxis.getPixelCoordinate(fStartTime); int endX = xAxis.getPixelCoordinate(fEndTime); e.gc.setBackground(TmfXYChartViewer.getDisplay().getSystemColor(SWT.COLOR_TITLE_INACTIVE_BACKGROUND)); if (fStartTime < fEndTime) { e.gc.fillRectangle(startX, 0, endX - startX, e.height); } else { e.gc.fillRectangle(endX, 0, startX - endX, e.height); } e.gc.drawLine(startX, 0, startX, e.height); e.gc.drawLine(endX, 0, endX, e.height); } }
Source:
<code>public String getAppointmentByAppointmentID(@PathVariable("id") int id) { <START> System.out.println("PathVariable is" + id); <END> return jsonUtil.toJson(appointmentDAOMock.getAppointmentByAppointmentID(id)); }</code><technical_language>System.out in code. SOUT while development. In future - logger, SOUT in code</technical_language>

Target:
public Appointment getAppointmentByAppointmentID(@PathVariable("id") int id) { return appointmentDAO.getAppointmentByAppointmentID(id); }
Source:
<code>private void activate() { ClassLoader oldTccl = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged(); try { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(classLoader); <START> NamespaceContextSelector.pushCurrentSelector(this.getNamespaceContextSelector()); <END> this.endpoint.activate(endpointFactory, activationSpec); NamespaceContextSelector.popCurrentSelector(); } catch (Exception e) { throw EjbLogger.ROOT_LOGGER.failedToActivateMdb(getComponentName(), e); } finally { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(oldTccl); } }</code><technical_language>code push pop wrapped in a "try" block, pop invoked "finally"</technical_language>

Target:
private void activate() { ClassLoader oldTccl = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged(); try { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(classLoader); NamespaceContextSelector.pushCurrentSelector(this.getNamespaceContextSelector()); try { this.endpoint.activate(endpointFactory, activationSpec); } finally { NamespaceContextSelector.popCurrentSelector(); } } catch (Exception e) { throw EjbLogger.ROOT_LOGGER.failedToActivateMdb(getComponentName(), e); } finally { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(oldTccl); } }
Source:
<code>protected void executeQueryCommand() { Provider<?> provider = getProvider(); try { ProviderProxy proxy = ProviderProxyFactory.getInstance().create(provider); List<? extends Certificate> chain = proxy.getCertificateChain(); if (!chain.isEmpty()) { List<CertificateInfo> results = new ArrayList<CertificateInfo>(); for (Certificate cert : chain) { results.add(createCertificateInfo((X509Certificate) cert)); } getQueryReturnValue().setReturnValue(results); } } catch (Exception e) { log.error("Error in encoding certificate. Error is " + e.getMessage()); if (log.isDebugEnabled()) { log.debug("", e); <START> } <END> } }</code><technical_language>conditional needed ^^^ just: log.debug("Exception", e);</technical_language>

Target:
protected void executeQueryCommand() { Provider<?> provider = getProvider(); try { ProviderProxy proxy = ProviderProxyFactory.getInstance().create(provider); List<? extends Certificate> chain = proxy.getCertificateChain(); if (!chain.isEmpty()) { List<CertificateInfo> results = new ArrayList<CertificateInfo>(); for (Certificate cert : chain) { results.add(createCertificateInfo((X509Certificate) cert)); } getQueryReturnValue().setReturnValue(results); } } catch (Exception e) { log.error("Error in encoding certificate. Error is " + e.getMessage()); log.debug("Exeption:", e); } }
Source:
<code>private GeneratorSwapIborIborMaster() { _iborIndexMaster = IndexIborMaster.getInstance(); final Calendar baseCalendar = new CalendarNoHoliday("No Holidays"); _generatorSwap = new HashMap<>(); _generatorSwap.put(AUDBBSW3MBBSW6M, new GeneratorSwapIborIbor(AUDBBSW3MBBSW6M, _iborIndexMaster.getIndex("AUDBB3M"), _iborIndexMaster.getIndex("AUDBB6M"), baseCalendar, baseCalendar)); _generatorSwap.put(EUREURIBOR3MEURIBOR6M, new GeneratorSwapIborIbor(EUREURIBOR3MEURIBOR6M, _iborIndexMaster.getIndex("EURIBOR3M"), _iborIndexMaster.getIndex("EURIBOR6M"), baseCalendar, baseCalendar)); _generatorSwap.put(JPYLIBOR6MLIBOR3M, new GeneratorSwapIborIbor(JPYLIBOR6MLIBOR3M, _iborIndexMaster.getIndex("JPYLIBOR3M"), _iborIndexMaster.getIndex("JPYLIBOR6M"), <START> baseCalendar, baseCalendar)); <END> }</code><technical_language>Line length</technical_language>

Target:
private GeneratorSwapIborIborMaster() { _iborIndexMaster = IndexIborMaster.getInstance(); final Calendar baseCalendar = new CalendarNoHoliday("No Holidays"); _generatorSwap = new HashMap<>(); _generatorSwap.put(AUDBBSW3MBBSW6M, new GeneratorSwapIborIbor(AUDBBSW3MBBSW6M, _iborIndexMaster.getIndex(IndexIborMaster.AUDBB3M), _iborIndexMaster.getIndex(IndexIborMaster.AUDBB6M), baseCalendar, baseCalendar)); _generatorSwap.put(EUREURIBOR3MEURIBOR6M, new GeneratorSwapIborIbor(EUREURIBOR3MEURIBOR6M, _iborIndexMaster.getIndex(IndexIborMaster.EURIBOR3M), _iborIndexMaster.getIndex(IndexIborMaster.EURIBOR6M), baseCalendar, baseCalendar)); _generatorSwap.put(JPYLIBOR6MLIBOR3M, new GeneratorSwapIborIbor(JPYLIBOR6MLIBOR3M, _iborIndexMaster.getIndex(IndexIborMaster.JPYLIBOR3M), _iborIndexMaster.getIndex(IndexIborMaster.JPYLIBOR6M), baseCalendar, baseCalendar)); }
Source:
<code>private void updateGitIgnore(File gitIgnore, String entry) throws CoreException { try { if (!gitIgnore.exists()) { if (!gitIgnore.createNewFile()) { String error = NLS.bind( CoreText.IgnoreOperation_creatingFailed, gitIgnore.getAbsolutePath()); throw new CoreException(Activator.error(error, null)); } <START> } else { <END> entry = getEntry(gitIgnore, entry); } FileOutputStream os = new FileOutputStream(gitIgnore, true); try { os.write(entry.getBytes()); } finally { os.close(); } } catch (IOException e) { String error = NLS.bind(CoreText.IgnoreOperation_updatingFailed, gitIgnore.getAbsolutePath()); throw new CoreException(Activator.error(error, e)); } }</code><technical_language>Style nit: brackets for single line blocks</technical_language>

Target:
private void updateGitIgnore(File gitIgnore, String entry) throws CoreException { try { if (!gitIgnore.exists()) { if (!gitIgnore.createNewFile()) { String error = NLS.bind( CoreText.IgnoreOperation_creatingFailed, gitIgnore.getAbsolutePath()); throw new CoreException(Activator.error(error, null)); } } else entry = getEntry(gitIgnore, entry); FileOutputStream os = new FileOutputStream(gitIgnore, true); try { os.write(entry.getBytes()); } finally { os.close(); } } catch (IOException e) { String error = NLS.bind(CoreText.IgnoreOperation_updatingFailed, gitIgnore.getAbsolutePath()); throw new CoreException(Activator.error(error, e)); } }
Source:
<code>public void addWhiteSpace() { <START> Pattern pattern = Pattern.compile("((/\\*([^*]|[\\r\\n]|(\\*+([^*/]|[\\r\\n])))*\\*+/)|( END> int seed = 0; for (NonTerminal nonTerminal : getAllNonTerminals()) { for (State s : nonTerminal.getReachableStates()) { if (s instanceof PrimitiveState) { PrimitiveState ps = ((PrimitiveState) s); PrimitiveState whitespace = new RegExState( new StateId("whitespace" + seed++), s.nt, pattern, KSorts.K); RuleState deleteToken = new RuleState( new StateId("whitespace-D-" + seed++), s.nt, new DeleteRule(1, true)); whitespace.next.add(deleteToken); deleteToken.next.addAll(ps.next); ps.next.clear(); ps.next.add(whitespace); } } } for (Entry<NonTerminalId, NonTerminal> entry : startNonTerminals.entrySet()) { NonTerminal nt = entry.getValue(); NonTerminal whiteStartNt = new NonTerminal(new NonTerminalId(nt.nonTerminalId.name)); PrimitiveState whitespace = new RegExState( new StateId("whitespace-" + seed++), whiteStartNt, pattern, KSorts.K); NonTerminalState nts = new NonTerminalState( new StateId("white-calls-" + nt.nonTerminalId.name), whiteStartNt, nt, false); RuleState deleteToken = new RuleState( new StateId("whitespace-D-" + seed++), whiteStartNt, new DeleteRule(1, true)); nt.nonTerminalId = new NonTerminalId(nt.nonTerminalId.name + "-afterWhite"); whiteStartNt.entryState.next.add(whitespace); whitespace.next.add(deleteToken); deleteToken.next.add(nts); nts.next.add(whiteStartNt.exitState); entry.setValue(whiteStartNt); } }</code><technical_language>If cases, break Strings combine a single regex? This is impossible read</technical_language>

Target:
public void addWhiteSpace() { for (NonTerminal nonTerminal : getAllNonTerminals()) { for (State s : nonTerminal.getReachableStates()) { if (s instanceof PrimitiveState) { PrimitiveState ps = ((PrimitiveState) s); addWhitespace(ps); } } } for (NonTerminal nt : startNonTerminals.values()) { addWhitespace(nt.entryState); } }
Source:
<code>public final List<E> getEntries() { if(isStreamable()) { <START> return new ArrayList<>(0); <END> } final List<SecondaryIndexQueryOperation.Response.Entry> coreEntries = coreResponse.getEntryList(); final List<E> convertedList = new ArrayList<>(coreEntries.size()); for (SecondaryIndexQueryOperation.Response.Entry e : coreEntries) { final E ce = createEntry(queryLocation, e, converter); convertedList.add(ce); } return convertedList; }</code><technical_language>throwing IllegalState UnsupportedOperation</technical_language>

Target:
public final List<E> getEntries() { if(isStreaming()) { throw new IllegalStateException("Use the iterator() while using the streaming API"); } final List<SecondaryIndexQueryOperation.Response.Entry> coreEntries = coreResponse.getEntryList(); final List<E> convertedList = new ArrayList<>(coreEntries.size()); for (SecondaryIndexQueryOperation.Response.Entry e : coreEntries) { final E ce = createEntry(queryLocation, e, converter); convertedList.add(ce); } return convertedList; }
Source:
<code>public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } OAuthProvider that = (OAuthProvider) o; <START> return Objects.equals(name, that.name) && <END> Objects.equals(tokenEndpoint, that.tokenEndpoint) && Objects.equals(clientId, that.clientId) && Objects.equals(clientSecret, that.clientSecret) && Objects.equals(tokenRequestInitialDelay, that.tokenRequestInitialDelay) && Objects.equals(tokenRequestMaxDelay, that.tokenRequestMaxDelay) && Objects.equals(requestTimeout, that.requestTimeout); }</code><technical_language>some kind of id? do need check fields</technical_language>

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } OAuthProvider that = (OAuthProvider) o; return Objects.equals(name, that.name); }
Source:
<code>public InterpreterResultMessage(InterpreterResult.Type type, String data) { this.type = type; this.data = data; <START> this.msgColumnTypes = new MessageColumnTypes(); <END> }</code><technical_language>I replace this(type, data, new ArrayList<ColumnDef.TYPE>()</technical_language>

Target:
public InterpreterResultMessage(InterpreterResult.Type type, String data) { this(type, data, new ArrayList<>()); }
Source:
<code>public void testexpandTreeRowToLevel() { SWTBotNatTable nattable = bot.nattable(); nattable.collaspeAll(POSITION); nattable.expandTreeRowToLevel(POSITION, 0, 1); int count = nattable.preferredRowCount(); assertEquals("After expandTreeRowToLevel 1", 16, count); assertEquals("Cell data of <START> 3,1", <END> "C", nattable.getCellDataValueByPosition(2, 1)); nattable.expandTreeRowToLevel(POSITION, 1, 2); assertEquals("Cell data of 3,1", "C.5", bot.nattable().getCellDataValueByPosition(3, 1)); count = nattable.preferredRowCount(); assertEquals("After expandTreeRowToLevel 2", 17, count); }</code><technical_language>2,1</technical_language>

Target:
public void testexpandTreeRowToLevel() { SWTBotNatTable nattable = bot.nattable(); nattable.collapseAll(POSITION); nattable.expandTreeRowToLevel(POSITION, 0, 1); int count = nattable.preferredRowCount(); assertEquals("After expandTreeRowToLevel 1", 16, count); assertEquals("Cell data of 2,1", "C", nattable.getCellDataValueByPosition(2, 1)); nattable.expandTreeRowToLevel(POSITION, 1, 2); assertEquals("Cell data of 3,1", "C.5", bot.nattable().getCellDataValueByPosition(3, 1)); count = nattable.preferredRowCount(); assertEquals("After expandTreeRowToLevel 2", 17, count); }
Source:
<code>public DefaultVaultTranscriber(final VaultProvider provider) { if (provider == null) { <START> throw new IllegalArgumentException("Required VaultProvider not specified - check vault configuration"); <END> } this.provider = provider; }</code><technical_language>In this case a special vault provider instead returns empty secrets: suggestion this.provider = new VaultProvider() { @Override public VaultRawSecret obtainSecret(String vaultSecretId) { return DefaultVaultRawSecret.forBuffer(null); } } do force user set a vault need it. This simplify migration effectively migration needed vault needed</technical_language>

Target:
public DefaultVaultTranscriber(final VaultProvider provider) { if (provider == null) { this.provider = new VaultProvider() { @Override public VaultRawSecret obtainSecret(String vaultSecretId) { return DefaultVaultRawSecret.forBuffer(null); } @Override public void close() { } }; } else { this.provider = provider; } }
Source:
<code>public void ifBlockComment(Consumer<BlockComment> action) { <START> if (isBlockComment()) { <END> action.accept(asBlockComment()); } }</code><technical_language>this empty I guess</technical_language>

Target:
public void ifBlockComment(Consumer<BlockComment> action) { }
Source:
<code>public String pinLs() { String pinnedJsonString = null; HttpGet request = new HttpGet(baseUrl + "pin/ls?type=recursive&quiet=true"); try { CloseableHttpResponse response = client.execute(request); <START> try { <END> int statusCode = response.getStatusLine().getStatusCode(); HttpEntity resEntity = response.getEntity(); if (statusCode == HttpStatus.SC_OK && resEntity != null) { pinnedJsonString = EntityUtils.toString(resEntity, "UTF-8"); } else { LOG.error("Failed to get pinned objects with unexpected statuscode " + statusCode); } } finally { response.close(); } } catch (IOException e) { LOG.error("Http request failed to send to " + baseUrl, e); } return pinnedJsonString; }</code><technical_language>avoid embedded try keeping multiple catch clause please</technical_language>

Target:
public String pinLs() { String pinnedJsonString = null; HttpGet request = new HttpGet(baseUrl + "pin/ls?type=recursive&quiet=true"); CloseableHttpResponse response = null; try { response = client.execute(request); int statusCode = response.getStatusLine().getStatusCode(); HttpEntity resEntity = response.getEntity(); if (statusCode == HttpStatus.SC_OK && resEntity != null) { pinnedJsonString = EntityUtils.toString(resEntity, "UTF-8"); } else { LOG.error("Failed to get pinned objects with unexpected statuscode " + statusCode); } } catch (IOException e) { LOG.error("Http request failed to send to " + baseUrl, e); } finally { try { response.close(); } catch (IOException | NullPointerException e) { LOG.error("Failed to close response", e); } } return pinnedJsonString; }
Source:
<code>protected void runTask() { try { ingestProcessor.process(programsFile, seasonsFile, scheduleFile, programDescriptionsFile, episodeSequenceFile); } catch (IOException e) { <START> LOG.error("Error while processing programs", e); <END> } }</code><technical_language>swallow this exception. If exception is thrown task marked failed, is want</technical_language>

Target:
protected void runTask() { try { ingestProcessor.process(programsFile, seasonsFile, scheduleFile, programDescriptionsFile, episodeSequenceFile); } catch (IOException e) { throw Throwables.propagate(e); } }
Source:
<code><START> void notifyJar(File jar) { <END> for (Listener listener : listeners) { listener.onJar(this, jar); } }</code><technical_language>I prefer a more explicit method name, e.g. "beforeJarSend()"</technical_language>

Target:
void notifyJar(File jar) { for (Listener listener : listeners) { try { listener.onJar(this, jar); } catch (Throwable x) { logger.log(Level.WARNING, null, x); } } }
Source:
<code>public String localSiteName() { <START> return findRelay2().site(); <END> }</code><technical_language>throw nullpointer if called check</technical_language>

Target:
public String localSiteName() { RELAY2 relay2 = findRelay2(); return relay2 == null ? null : relay2.site(); }
Source:
<code>@Override public @Nullable Object decode(GridNioSession ses, ByteBuffer buf) { ClientMessageDecoder decoder = ses.meta(SES_META_DECODER); if (decoder == null) { decoder = new ClientMessageDecoder(); ses.addMeta(SES_META_DECODER, decoder); } byte[] bytes = decoder.apply(buf); if (bytes == null) return null; <START> return ByteBuffer.wrap(bytes).order(ByteOrder.nativeOrder()); <END> }</code><technical_language>I ByteOrder.LITTLE_ENDIAN this ByteBuffer is passed payload readers</technical_language>

Target:
@Override public @Nullable Object decode(GridNioSession ses, ByteBuffer buf) { ClientMessageDecoder decoder = ses.meta(SES_META_DECODER); if (decoder == null) { decoder = new ClientMessageDecoder(); ses.addMeta(SES_META_DECODER, decoder); } byte[] bytes = decoder.apply(buf); if (bytes == null) return null; return ByteBuffer.wrap(bytes).order(ByteOrder.LITTLE_ENDIAN); }
Source:
<code>public static Path createTempFiles( final String prefix, final int numFiles, final long length) throws IOException { LOG.info("Creating files of size {}...", numFiles, length); final Path tempDir = Files.createTempDirectory(prefix); for(int fileNum = 0; fileNum < numFiles; fileNum++) { final File tempFile = new File(tempDir.toString(), prefix + "_" + fileNum); <START> final RandomAccessFile raf = new RandomAccessFile(tempFile, "rw"); <END> raf.seek(length); raf.writeBytes("end of RandomAccessFile."); raf.close(); } return tempDir; }</code><technical_language>a try resource here. close is called if exception is thrown close is called</technical_language>

Target:
public static Path createTempFiles( final String prefix, final int numFiles, final long length) throws IOException { LOG.info("Creating files of size {}...", numFiles, length); final Path tempDir = Files.createTempDirectory(prefix); for(int fileNum = 0; fileNum < numFiles; fileNum++) { final File tempFile = new File(tempDir.toString(), prefix + "_" + fileNum); try (final RandomAccessFile raf = new RandomAccessFile(tempFile, "rw")) { raf.seek(length); raf.writeBytes("end of RandomAccessFile."); } } return tempDir; }
Source:
<code>static String readLine(BufferedReader in, File inputFile) { String line = null; try { line = in.readLine(); } catch (Exception e) { <START> logger.error("Can't read from '" + inputFile + "': " + e); <END> System.exit(1); } return line; }</code><technical_language>exiting, STDERR</technical_language>

Target:
static String readLine(BufferedReader in, File inputFile) { String line = null; try { line = in.readLine(); } catch (Exception e) { System.err.println("Can't read from '" + inputFile + "': " + e); System.exit(1); } return line; }