auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private static void browsePostOrPageEx( Context context, SiteModel site, PostModel post, RemotePreviewType remotePreviewType) { <START> if ( <END> site == null || post == null || TextUtils.isEmpty(post.getLink()) || (remotePreviewType == RemotePreviewType.REMOTE_PREVIEW_WITH_REMOTE_AUTO_SAVE && TextUtils.isEmpty(post.getAutoSavePreviewUrl())) ) { return; } String url = remotePreviewType == RemotePreviewType.REMOTE_PREVIEW_WITH_REMOTE_AUTO_SAVE ? post.getAutoSavePreviewUrl() : UrlUtils.appendUrlParameter(post.getLink(), "preview", "true"); String shareableUrl = post.getLink(); String shareSubject = post.getTitle(); boolean startPreviewForResult = remotePreviewType != RemotePreviewType.NOT_A_REMOTE_PREVIEW; if (site.isWPCom()) { WPWebViewActivity.openPostUrlByUsingGlobalWPCOMCredentials( context, url, shareableUrl, shareSubject, startPreviewForResult); } else if (site.isJetpackConnected()) { WPWebViewActivity .openJetpackBlogPostPreview( context, url, shareableUrl, shareSubject, site.getFrameNonce(), startPreviewForResult); } else { WPWebViewActivity.openUrlByUsingBlogCredentials( context, site, post, url, new String[]{post.getLink()}, true, startPreviewForResult); } }</code><technical_language>Nitpicking: do mind splitting this in 2 tests for readability / style</technical_language>

Target:
private static void browsePostOrPageEx( Context context, SiteModel site, PostModel post, RemotePreviewType remotePreviewType) { if (site == null || post == null || TextUtils.isEmpty(post.getLink())) { return; } if (remotePreviewType == RemotePreviewType.REMOTE_PREVIEW_WITH_REMOTE_AUTO_SAVE && TextUtils.isEmpty(post.getAutoSavePreviewUrl())) { return; } String url = PostUtils.getPreviewUrlForPost(remotePreviewType, post); String shareableUrl = post.getLink(); String shareSubject = post.getTitle(); boolean startPreviewForResult = remotePreviewType != RemotePreviewType.NOT_A_REMOTE_PREVIEW; if (site.isWPCom()) { WPWebViewActivity.openPostUrlByUsingGlobalWPCOMCredentials( context, url, shareableUrl, shareSubject, startPreviewForResult); } else if (site.isJetpackConnected()) { WPWebViewActivity .openJetpackBlogPostPreview( context, url, shareableUrl, shareSubject, site.getFrameNonce(), startPreviewForResult); } else { WPWebViewActivity.openUrlByUsingBlogCredentials( context, site, post, url, new String[]{post.getLink()}, true, startPreviewForResult); } }
Source:
<code>public ObjectPool newPool(final ObjectPoolConfig config) { <START> return new BlockingQueueObjectPool(tsdb, config); <END> }</code><technical_language>this BlockingQueueArrayObjectPool instead</technical_language>

Target:
public ObjectPool newPool(final ObjectPoolConfig config) { return new BlockingQueueArrayObjectPool(tsdb, config); }
Source:
<code>private int getLoginPort(Container container) { if (container.getNetworkSettings() != null) { Map<String, List<Map<String,String>>> ports = container.getNetworkSettings().getPorts(); if(ports != null) { return Integer.parseInt(getOnlyElement(ports.get("22/tcp")).get("HostPort")); } } else if (container.getPorts() != null) { for (Port port : container.getPorts()) { if (port.getPrivatePort() == 22) { return port.getPublicPort(); } } } <START> throw new IllegalStateException("Cannot determine the login port for " + container.getId()); <END> }</code><technical_language>Is ok fail here? default, jclouds assume port 22 a login port. If detect it, fail, jclouds try port 22 anyway</technical_language>

Target:
protected static int getLoginPort(Container container) { if (container.getNetworkSettings() != null) { Map<String, List<Map<String, String>>> ports = container.getNetworkSettings().getPorts(); if (ports != null) { return Integer.parseInt(getOnlyElement(ports.get("22/tcp")).get("HostPort")); } } else if (container.getPorts() != null) { for (Port port : container.getPorts()) { if (port.getPrivatePort() == 22) { return port.getPublicPort(); } } } throw new IllegalStateException("Cannot determine the login port for " + container.getId()); }
Source:
<code>public void testHeartbeatMessage() throws InterruptedException { String TOPIC_NAME = "topic2"; Map<String, AgentTopicStats> topicInfoMap = new HashMap<>(); <START> Instant lastProduced = Instant.now().minusMillis(20000); <END> Instant lastConsumed = Instant.now().minusMillis(30000); topicInfoMap.put(TOPIC_NAME, new AgentTopicStats(true, false, lastProduced, lastConsumed)); Payload payload = new Payload.Builder<Object, Object, Object, Map<String, AgentTopicStats>>() .withBody(topicInfoMap) .build(); CountDownLatch heartBeatResponseReceived = new CountDownLatch(1); Callback<AggregatorStats> handler = stats -> { assertTrue(stats.getTopicInfoMap().containsKey(TOPIC_NAME)); assertEquals(1, stats.getTopicInfoMap().get(TOPIC_NAME).getProducers().size()); heartBeatResponseReceived.countDown(); }; ChannelMonitorAggregator channelMonitorAggregator = msbContext.getObjectFactory().createChannelMonitorAggregator(handler); channelMonitorAggregator.start(true, 10000, 1000); Message requestMessage = awaitHeartBeatRequestSent(RequesterResponderIT.MESSAGE_TRANSMISSION_TIME); Message responseMessage = createMsbRequestMessage(requestMessage.getTopics().getResponse(), requestMessage.getCorrelationId(), payload); MockAdapter.pushRequestMessage(requestMessage.getTopics().getResponse(), Utils.toJson(responseMessage, msbContext.getPayloadMapper())); assertTrue("HeartBeat Response was not received", heartBeatResponseReceived.await(RequesterResponderIT.MESSAGE_TRANSMISSION_TIME, TimeUnit.MILLISECONDS)); }</code><technical_language>dangerous. I suggest fixed clock avoid problems slow Travis. In fact constants here, bother subtractions</technical_language>

Target:
public void testHeartbeatMessage() throws InterruptedException { String TOPIC_NAME = "topic3"; Map<String, AgentTopicStats> topicInfoMap = new HashMap<>(); topicInfoMap.put(TOPIC_NAME, new AgentTopicStats(true, false, LAST_PRODUCED_TIME, LAST_CONSUMED_TIME)); Payload payload = new Payload.Builder<Object, Object, Object, Map<String, AgentTopicStats>>() .withBody(topicInfoMap) .build(); CountDownLatch heartBeatResponseReceived = new CountDownLatch(1); Callback<AggregatorStats> handler = stats -> { assertTrue(stats.getTopicInfoMap().containsKey(TOPIC_NAME)); assertEquals(1, stats.getTopicInfoMap().get(TOPIC_NAME).getProducers().size()); heartBeatResponseReceived.countDown(); }; channelMonitorAggregator = msbContext.getObjectFactory().createChannelMonitorAggregator(handler); channelMonitorAggregator.start(true, ChannelMonitorAggregator.DEFAULT_HEARTBEAT_INTERVAL_MS, HEARTBEAT_TIMEOUT_MS); Message requestMessage = awaitHeartBeatRequestSent(); Message responseMessage = createMsbRequestMessage(requestMessage.getTopics().getResponse(), requestMessage.getCorrelationId(), payload); MockAdapter.pushRequestMessage(requestMessage.getTopics().getResponse(), Utils.toJson(responseMessage, msbContext.getPayloadMapper())); assertTrue("Heartbeat response was not received", heartBeatResponseReceived.await(HEARTBEAT_TIMEOUT_MS * 2, TimeUnit.MILLISECONDS)); }
Source:
<code>public void write(DataOutput out) throws IOException { super.write(out); <START> if (preKmerLength != null) { <END> out.writeInt(preKmerLength); } if (internalKmer != null) { internalKmer.write(out); } if (pathList != null) { pathList.write(out); } if(edgeTypeList != null){ edgeTypeList.write(out); } if (numBranches != null) { out.writeInt(numBranches); } }</code><technical_language>for write getActiveMessageFields, check if lists null if length is 0. If of cases, write/read them</technical_language>

Target:
public void write(DataOutput out) throws IOException { super.write(out); if (preKmerLength != null) { out.writeInt(preKmerLength); } if (internalKmer != null && internalKmer.getKmerLetterLength() > 0) { internalKmer.write(out); } if (pathList != null && pathList.getLength() > 0) { pathList.write(out); } if (edgeTypeList != null && edgeTypeList.size() > 0) { edgeTypeList.write(out); } if (numBranches != null) { out.writeInt(numBranches); } }
Source:
<code>private Constraint shuttleDestinationIsCoachOrHub(ConstraintFactory constraintFactory) { return constraintFactory.from(Shuttle.class) .filter(shuttle -> shuttle.getDestination() != null) .join(StopOrHub.class, equal(Shuttle::getDestination, stopOrHub -> stopOrHub)) .filter((shuttle, stopOrHub) -> !stopOrHub.isVisitedByCoach()) <START> .penalize("shuttleDestinationIsCoachOrHub", HardSoftLongScore.ofUninitialized(0, 1000000000, 0)); <END> }</code><technical_language>For large numbers, I suggest _ separate thousands. 1000000000 1_000_000_000</technical_language>

Target:
private Constraint shuttleDestinationIsCoachOrHub(ConstraintFactory constraintFactory) { return constraintFactory.from(Shuttle.class) .filter(shuttle -> shuttle.getDestination() != null) .join(StopOrHub.class, equal(Shuttle::getDestination, stopOrHub -> stopOrHub)) .filter((shuttle, stopOrHub) -> !stopOrHub.isVisitedByCoach()) .penalize("shuttleDestinationIsCoachOrHub", HardSoftLongScore.ofHard(1000_000_000)); }
Source:
<code>public void testFirstUpstreamBuildFirstProjectHasJustOneUpstreamJob() throws Exception { FreeStyleProject upstream = jenkins.createFreeStyleProject("upstream"); FreeStyleProject build = jenkins.createFreeStyleProject("build"); upstream.getPublishersList().add(new BuildTrigger("build", false)); jenkins.getInstance().rebuildDependencyGraph(); jenkins.buildAndAssertSuccess(upstream); jenkins.waitUntilNoActivity(); assertNotNull(upstream.getLastBuild()); assertNotNull(build.getLastBuild()); assertEquals(build.getLastBuild(), BuildUtil.getFirstUpstreamBuild(build.getLastBuild(), build)); Pipeline pipeline = Pipeline.extractPipeline("Pipeline", build); <START> List<Pipeline> pipelines = pipeline.createPipelineLatest(1, Jenkins.getInstance(), false); <END> assertEquals(1, pipelines.size()); assertEquals(1, pipelines.get(0).getTriggeredBy().size()); assertEquals(TriggerCause.TYPE_UPSTREAM, pipelines.get(0).getTriggeredBy().get(0).getType()); }</code><technical_language>Please extract false a constant declared in beginning of class declare intent of parameter, reused test file</technical_language>

Target:
public void testFirstUpstreamBuildFirstProjectHasJustOneUpstreamJob() throws Exception { FreeStyleProject upstream = jenkins.createFreeStyleProject("upstream"); FreeStyleProject build = jenkins.createFreeStyleProject("build"); upstream.getPublishersList().add(new BuildTrigger("build", false)); jenkins.getInstance().rebuildDependencyGraph(); jenkins.buildAndAssertSuccess(upstream); jenkins.waitUntilNoActivity(); assertNotNull(upstream.getLastBuild()); assertNotNull(build.getLastBuild()); assertEquals(build.getLastBuild(), BuildUtil.getFirstUpstreamBuild(build.getLastBuild(), build)); Pipeline pipeline = Pipeline.extractPipeline("Pipeline", build); List<Pipeline> pipelines = pipeline.createPipelineLatest(1, Jenkins.getInstance(), pagingEnabledFalse); assertEquals(1, pipelines.size()); assertEquals(1, pipelines.get(0).getTriggeredBy().size()); assertEquals(TriggerCause.TYPE_UPSTREAM, pipelines.get(0).getTriggeredBy().get(0).getType()); }
Source:
<code>public int hashCode() { <START> return Objects.hash(bitLengths, values); <END> }</code><technical_language>I this default hashcode, equivalent Arrays.hashCode()</technical_language>

Target:
public int hashCode() { int result = Arrays.hashCode(bitLengths); result = 31 * result + Arrays.hashCode(values); return result; }
Source:
<code>protected void cleanPayeeACHAccountExtractDetail(PayeeACHAccountExtractDetail detail) { if (StringUtils.isNotBlank(detail.getBankAccountNumber()) && !StringUtils.isNumeric(detail.getBankAccountNumber())) { String logMessageStarter = "cleanPayeeACHAccountExtractDetail, the bank account for " + detail.getNetID(); if (StringUtils.contains(detail.getBankAccountNumber(), KFSConstants.DASH)) { LOG.error(logMessageStarter + " contains dashes, so removing them"); String cleanedBankAccount = StringUtils.remove(detail.getBankAccountNumber(), KFSConstants.DASH); detail.setBankAccountNumber(cleanedBankAccount); } else { <START> LOG.error(logMessageStarter + " is not numberic but does NOT contains dashes, no automatic cleaning available"); <END> } } }</code><technical_language>Minor typo in log message; change "...numberic..." "...numeric..."</technical_language>

Target:
protected void cleanPayeeACHAccountExtractDetail(PayeeACHAccountExtractDetail detail) { if (StringUtils.isNotBlank(detail.getBankAccountNumber()) && !StringUtils.isNumeric(detail.getBankAccountNumber())) { String logMessageStarter = "cleanPayeeACHAccountExtractDetail, the bank account for " + detail.getNetID(); if (StringUtils.contains(detail.getBankAccountNumber(), KFSConstants.DASH)) { LOG.error(logMessageStarter + " contains dashes, so removing them"); String cleanedBankAccount = StringUtils.remove(detail.getBankAccountNumber(), KFSConstants.DASH); detail.setBankAccountNumber(cleanedBankAccount); } else { LOG.error(logMessageStarter + " is not numeric but does NOT contains dashes, no automatic cleaning available"); } } }
Source:
<code>public CassandraTableHandle getTableHandle(ConnectorSession session, SchemaTableName tableName) { requireNonNull(tableName, "tableName is null"); try { <START> cassandraSession.getTable(tableName); <END> return cassandraSession.getTableHandle(tableName); } catch (NotFoundException e) { return null; } }</code><technical_language>get TableHandle CassandraTable create in line 98</technical_language>

Target:
public CassandraTableHandle getTableHandle(ConnectorSession session, SchemaTableName tableName) { requireNonNull(tableName, "tableName is null"); try { return cassandraSession.getTable(tableName).getTableHandle(); } catch (TableNotFoundException | SchemaNotFoundException e) { return null; } }
Source:
<code>public BooleanExpr getQuery() { <START> assert children.size() >= 1; <END> BooleanExpr firstChild = children.get(0).getQuery(); if (children.size() == 1) { return firstChild; } AndExpr andExpr = new AndExpr(firstChild); for (int i = 1; i < children.size(); i++) { BooleanExpr child = children.get(i).getQuery(); andExpr.getChildren().add(child); } return andExpr; }</code><technical_language>Is AssertionError IndexOutOfBoundsException</technical_language>

Target:
public BooleanExpr getQuery() { if (children.isEmpty()) { throw new IllegalStateException("A conjunction must have at least one child"); } BooleanExpr firstChild = children.get(0).getQuery(); if (children.size() == 1) { return firstChild; } AndExpr andExpr = new AndExpr(firstChild); for (int i = 1; i < children.size(); i++) { BooleanExpr child = children.get(i).getQuery(); andExpr.getChildren().add(child); } return andExpr; }
Source:
<code>public void setAngleArc(double angleArc) { if (angleArc > 360 || angleArc < 0) { <START> throw new WrongValueException("The value of angleArc should be between 0 between 360 degree"); <END> } else if (_angleArc != angleArc) { _angleArc = angleArc; smartUpdate("angleArc", _angleArc); } }</code><technical_language>0 360 degree :-(</technical_language>

Target:
public void setAngleArc(double angleArc) { if (angleArc > 360 || angleArc < 0) { throw new WrongValueException("The value of angleArc should be between 0 and 360 degree"); } else if (_angleArc != angleArc) { _angleArc = angleArc; smartUpdate("angleArc", _angleArc); } }
Source:
<code>private boolean hasUnsupportedExtensionType(CombinedPluginInfo pluginInfo) { <START> List<String> extensionTypes = Arrays.stream(ExtensionType.values()).map(ExtensionType::getExtensionType).collect(toList()); <END> List<String> invalidExtensions = pluginInfo.extensionNames().stream().filter(extensionName -> !extensionTypes.contains(extensionName)).collect(toList()); return !invalidExtensions.isEmpty(); }</code><technical_language>ExtensionsRegistry instead</technical_language>

Target:
private boolean hasUnsupportedExtensionType(CombinedPluginInfo pluginInfo) { Set<String> extensionTypes = extensionsRegistry.allRegisteredExtensions(); List<String> invalidExtensions = pluginInfo.extensionNames().stream().filter(extensionName -> !extensionTypes.contains(extensionName)).collect(toList()); return !invalidExtensions.isEmpty(); }
Source:
<code>public static void UpdateVmGuestAgentVersion(final VM vm) { if (vm.getAppList() != null) { final String[] parts = vm.getAppList().split("[,]", -1); if (parts != null && parts.length != 0) { final List<String> possibleAgentAppNames = Config.<List<String>> GetValue(ConfigValues.AgentAppName); final Map<String, String> spiceDriversInGuest = Config.<Map<String, String>> GetValue(ConfigValues.SpiceDriverNameInGuest); final String spiceDriverInGuest = <START> spiceDriversInGuest.get(ObjectUtils.toString(vm.getOs()).toLowerCase()); <END> for (final String part : parts) { for (String agentName : possibleAgentAppNames) { if (StringUtils.containsIgnoreCase(part, agentName)) { vm.setGuestAgentVersion(GetApplicationVersion(part, agentName)); } if (StringUtils.containsIgnoreCase(part, spiceDriverInGuest)) { vm.setSpiceDriverVersion(GetApplicationVersion(part, spiceDriverInGuest)); } } } } } }</code><technical_language>spiceDriversInGuest contains map of "windows"->..., "linux"->... convert this vm.getOs() "windows" "linux" strings</technical_language>

Target:
public static void UpdateVmGuestAgentVersion(final VM vm) { if (vm.getAppList() != null) { final String[] parts = vm.getAppList().split("[,]", -1); if (parts != null && parts.length != 0) { final List<String> possibleAgentAppNames = Config.<List<String>> GetValue(ConfigValues.AgentAppName); final Map<String, String> spiceDriversInGuest = Config.<Map<String, String>> GetValue(ConfigValues.SpiceDriverNameInGuest); final String spiceDriverInGuest = spiceDriversInGuest.get(OsRepositoryImpl.INSTANCE.getOsFamily(vm.getOs()).toLowerCase()); for (final String part : parts) { for (String agentName : possibleAgentAppNames) { if (StringUtils.containsIgnoreCase(part, agentName)) { vm.setGuestAgentVersion(GetApplicationVersion(part, agentName)); } if (StringUtils.containsIgnoreCase(part, spiceDriverInGuest)) { vm.setSpiceDriverVersion(GetApplicationVersion(part, spiceDriverInGuest)); } } } } } }
Source:
<code>public void postCollectionAdminGroupCreateAdminGroupUnProcessableName() throws Exception { ObjectMapper mapper = new ObjectMapper(); GroupRest groupRest = new GroupRest(); groupRest.setName("Fail"); MetadataRest metadataRest = new MetadataRest(); metadataRest.put("dc.description", new MetadataValueRest("testingDescription")); metadataRest.put("dc.subject", new MetadataValueRest("testSubject")); groupRest.setMetadata(metadataRest); String token = getAuthToken(admin.getEmail(), password); getClient(token).perform(post("/api/core/collections/" + collection.getID() + "/adminGroup") .content(mapper.writeValueAsBytes(groupRest)) .contentType(contentType)) .andExpect(status().isUnprocessableEntity()); <START> <END> }</code><technical_language>double check group created</technical_language>

Target:
public void postCollectionAdminGroupCreateAdminGroupUnProcessableName() throws Exception { ObjectMapper mapper = new ObjectMapper(); GroupRest groupRest = new GroupRest(); groupRest.setName("Fail"); MetadataRest metadataRest = new MetadataRest(); metadataRest.put("dc.description", new MetadataValueRest("testingDescription")); metadataRest.put("dc.subject", new MetadataValueRest("testSubject")); groupRest.setMetadata(metadataRest); String token = getAuthToken(admin.getEmail(), password); getClient(token).perform(post("/api/core/collections/" + collection.getID() + "/adminGroup") .content(mapper.writeValueAsBytes(groupRest)) .contentType(contentType)) .andExpect(status().isUnprocessableEntity()); getClient(token).perform(get("/api/core/collections/" + collection.getID() + "/adminGroup")) .andExpect(status().isNoContent()); }
Source:
<code><START> public BranchViewData getViewForBranch(BranchId branch) { <END> List<ArtifactReadable> branchViewArts = queryFactory.fromBranch(branch).andIsOfType(CoreArtifactTypes.BranchView).getResults().getList(); List<ArtifactId> branchViewIds = new ArrayList<>(); for (ArtifactReadable art : branchViewArts) { branchViewIds.add(art); } return new BranchViewData(branch, branchViewIds); }</code><technical_language>Please return List<ArtifactToken></technical_language>

Target:
public List<ArtifactToken> getViewForBranch(BranchId branch) { return queryFactory.fromBranch(branch).andIsOfType(CoreArtifactTypes.BranchView).loadArtifactTokens(); }
Source:
<code>public boolean processAuxiliaryFile(InputStream fileInputStream, DataFile dataFile, String formatTag, String formatVersion, String origin, boolean isPublic) { StorageIO<DataFile> storageIO =null; String auxExtension = formatTag + "_" + formatVersion; try { storageIO = dataFile.getStorageIO(); AuxiliaryFile auxFile = new AuxiliaryFile(); storageIO.saveInputStreamAsAux(fileInputStream, auxExtension); auxFile.setChecksum(FileUtil.calculateChecksum(storageIO.getAuxFileAsInputStream(auxExtension), systemConfig.getFileFixityChecksumAlgorithm())); <START> Tika tika = new Tika(); <END> auxFile.setContentType(tika.detect(storageIO.getAuxFileAsInputStream(auxExtension))); auxFile.setFormatTag(formatTag); auxFile.setFormatVersion(formatVersion); auxFile.setOrigin(origin); auxFile.setIsPublic(isPublic); auxFile.setDataFile(dataFile); auxFile.setFileSize(storageIO.getAuxObjectSize(auxExtension)); save(auxFile); } catch (IOException ioex) { logger.info("IO Exception trying to save auxiliary file: " + ioex.getMessage()); return false; } catch (Exception e) { try { storageIO.deleteAuxObject(auxExtension); } catch(IOException ioex) { logger.info("IO Exception trying remove auxiliary file in exception handler: " + ioex.getMessage()); return false; } } return true; }</code><technical_language>Tika is for full-text indexing content-type detection is done differently for Datafiles. Could/should done way? (not necessarily in this PR)</technical_language>

Target:
public AuxiliaryFile processAuxiliaryFile(InputStream fileInputStream, DataFile dataFile, String formatTag, String formatVersion, String origin, boolean isPublic) { StorageIO<DataFile> storageIO =null; AuxiliaryFile auxFile = new AuxiliaryFile(); String auxExtension = formatTag + "_" + formatVersion; try { storageIO = dataFile.getStorageIO(); MessageDigest md = MessageDigest.getInstance(systemConfig.getFileFixityChecksumAlgorithm().toString()); DigestInputStream di = new DigestInputStream(fileInputStream, md); storageIO.saveInputStreamAsAux(fileInputStream, auxExtension); auxFile.setChecksum(FileUtil.checksumDigestToString(di.getMessageDigest().digest()) ); Tika tika = new Tika(); auxFile.setContentType(tika.detect(storageIO.getAuxFileAsInputStream(auxExtension))); auxFile.setFormatTag(formatTag); auxFile.setFormatVersion(formatVersion); auxFile.setOrigin(origin); auxFile.setIsPublic(isPublic); auxFile.setDataFile(dataFile); auxFile.setFileSize(storageIO.getAuxObjectSize(auxExtension)); auxFile = save(auxFile); } catch (IOException ioex) { logger.info("IO Exception trying to save auxiliary file: " + ioex.getMessage()); return null; } catch (Exception e) { try { storageIO.deleteAuxObject(auxExtension); } catch(IOException ioex) { logger.info("IO Exception trying remove auxiliary file in exception handler: " + ioex.getMessage()); return null; } } return auxFile; }
Source:
<code>public FirecannonBlast(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}{R}"); this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new DamageTargetEffect(6), new DamageTargetEffect(3), <START> new InvertCondition(RaidCondition.instance), <END> "{this} deals 3 damage to target creature.<br><i>Raid</i> &mdash; {this} deals 6 damage instead if you attacked with a creature this turn")); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addWatcher(new PlayerAttackedWatcher()); }</code><technical_language>suggestion RaidCondition.instance,</technical_language>

Target:
public FirecannonBlast(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}{R}"); this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new DamageTargetEffect(6), new DamageTargetEffect(3), RaidCondition.instance, "{this} deals 3 damage to target creature.<br><i>Raid</i> &mdash; {this} deals 6 damage instead if you attacked with a creature this turn")); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addWatcher(new PlayerAttackedWatcher()); }
Source:
<code>private static void addNotEmptyLines(Set<Integer> set, String text, XmlTextRange fullTextRange) { <START> String[] lines = text.split("(\r)?\n|\r", -1); <END> int lineNumber = fullTextRange.getStartLine(); for (String line : lines) { if (!line.trim().isEmpty()) { set.add(lineNumber); } lineNumber++; } }</code><technical_language>extract this REGEX a constant? other places consistent</technical_language>

Target:
private static void addNotEmptyLines(Set<Integer> set, String text, XmlTextRange fullTextRange) { int lineNumber = fullTextRange.getStartLine(); for (String line : splitLines(text)) { if (!line.trim().isEmpty()) { set.add(lineNumber); } lineNumber++; } }
Source:
<code>public void testUnmarshallSubprocessLevelEventEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateMessageEventCatching emptySubprocessEvent = getCatchingIntermediateNodeById(diagram, EMPTY_SUBPROCESS_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_NO_OUTGOING_EDGE); assertGeneralSet(emptySubprocessEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); <START> assertMessageEventExecutionSet(emptySubprocessEvent.getExecutionSet(), EMPTY_VALUE, NON_CANCELLING, ""); <END> assertDataIOSet(emptySubprocessEvent.getDataIOSet(), EMPTY_VALUE); }</code><technical_language>suggestion assertMessageEventExecutionSet(emptySubprocessEvent.getExecutionSet(), EMPTY_VALUE, NON_CANCELLING, EMPTY_VALUE);</technical_language>

Target:
public void testUnmarshallSubprocessLevelEventEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateMessageEventCatching emptySubprocessEvent = getCatchingIntermediateNodeById(diagram, EMPTY_SUBPROCESS_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_NO_OUTGOING_EDGE); assertGeneralSet(emptySubprocessEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertMessageEventExecutionSet(emptySubprocessEvent.getExecutionSet(), EMPTY_VALUE, NON_CANCELLING, EMPTY_VALUE); assertDataIOSet(emptySubprocessEvent.getDataIOSet(), EMPTY_VALUE); }
Source:
<code>public boolean provides(final String expression) { <START> if (!StringUtil.isEmpty(expression)) { <END> for (final IInterpreterProvider provider : getProviders()) { if (provider.provides(expression)) { return true; } } } return false; }</code><technical_language>This breaks contract, patch, CompoundInterpreter getProvidersForNewExpression() methode returns null for evaluation, static text integer, compound provider able handles expression default interpreter returns value. check calls of provide method check is regression if follow this way. IMO change this behavior for current issue, remark in other files</technical_language>

Target:
public boolean provides(final String expression) { return getProviderForExpression(expression) != null; }
Source:
<code>private ConcurrentMap<String, IPageTypeCategoryRole> getTypeNameToCategoryMap() { if (typeNameToCategoryMap.isEmpty()) { synchronized (typeNameToCategoryMap) { if (typeNameToCategoryMap.isEmpty()) { for (IPageTypeCategoryRole typeCategory : pageTypeCategoryList) { IPageTypeCategoryRole beforeRegCat = typeNameToCategoryMap.putIfAbsent( <START> typeCategory.getTypeName(), typeCategory); <END> if (beforeRegCat != null) { LOGGER.warn("Page type category collision on category name '{}' the colliding" + " category '{}' is shadowed by ''.", typeCategory.getTypeName(), typeCategory.getClass(), beforeRegCat.getClass()); } } } } } return typeNameToCategoryMap; }</code><technical_language>com.google.common.collect.ImmutableMap.Builder instead of returning a modifiable ConcurrentHashMap</technical_language>

Target:
private Map<String, IPageTypeCategoryRole> getTypeNameToCategoryMap() { if (typeNameToCatCache.isEmpty()) { synchronized (typeNameToCatCache) { if (typeNameToCatCache.isEmpty()) { for (IPageTypeCategoryRole typeCategory : pageTypeCategoryList) { IPageTypeCategoryRole beforeRegCat = typeNameToCatCache.putIfAbsent( typeCategory.getTypeName(), typeCategory); if (beforeRegCat != null) { LOGGER.warn("Page type category collision on category name '{}' the colliding" + " category '{}' is shadowed by '{}'.", typeCategory.getTypeName(), typeCategory.getClass(), beforeRegCat.getClass()); } } } } } return Collections.unmodifiableMap(typeNameToCatCache); }
Source:
<code>public void testLightblueDiagnosticsElementPresent() throws Exception { DiagnosticsElement expectedElementDiagnostics = new DiagnosticsElement("MongoCRUDController", true, "[Mongo Config [lightbluemongo1.dev.a1.vary.redhat.com:27017, " + "DatabaseName: metadata]=>ping:OK, Mongo Config [lightbluemongo1.dev.a1.vary.redhat.com:27017, DatabaseName: data]=>ping:OK]"); <START> when(httpTransport.executeRequest(any(LightblueRequest.class), anyString())).thenReturn(new FakeResponse(diagnosticsResponse, null)); <END> LightblueClientConfiguration c = new LightblueClientConfiguration(); try (LightblueHttpClient httpClient = new LightblueHttpClient(c, httpTransport)) { LightblueDiagnosticsResponse response = httpClient.diagnostics(); DiagnosticsElement elementDiagnostics = response.getDiagnostics("MongoCRUDController"); System.out.println(elementDiagnostics); Assert.assertEquals(expectedElementDiagnostics, elementDiagnostics); Assert.assertTrue(elementDiagnostics.isHealthy()); Assert.assertEquals("MongoCRUDController", elementDiagnostics.getElementName()); } }</code><technical_language>mocks I a good idea right parameters passed well. for example test base URI is correct. need a unit test for diagnostics request itself. others in lightblue-client/core/src/test/java/com/redhat/lightblue/client/request</technical_language>

Target:
public void testLightblueDiagnosticsElementPresent() throws Exception { DiagnosticsElement expectedElementDiagnostics = new DiagnosticsElement("MongoCRUDController", true, "[Mongo Config [MongoURL, " + "DatabaseName: metadata]=>ping:OK, Mongo Config [MongoURL, DatabaseName: data]=>ping:OK]"); when(httpTransport.executeRequest(any(LightblueDiagnosticsRequest.class), anyString())).thenReturn(new FakeResponse(diagnosticsResponse, null)); LightblueClientConfiguration c = new LightblueClientConfiguration(); try (LightblueHttpClient httpClient = new LightblueHttpClient(c, httpTransport)) { LightblueDiagnosticsResponse response = httpClient.diagnostics(); DiagnosticsElement elementDiagnostics = response.getDiagnostics("MongoCRUDController"); Assert.assertEquals(expectedElementDiagnostics, elementDiagnostics); Assert.assertTrue(elementDiagnostics.isHealthy()); Assert.assertEquals("MongoCRUDController", elementDiagnostics.getElementName()); } }
Source:
<code>public static void main(String args[]) { CLIInterface.call(args); final SystemProperties config = SystemProperties.getDefault(); <START> getEthashBlockNumber().ifPresent(blockNumber -> { <END> disableSync(config); new Ethash(config, blockNumber).getFullDataset(); System.exit(0); }); Ethereum ethereum = EthereumFactory.createEthereum(); getBlocksDumpPath(config).ifPresent(path -> { disableSync(config); boolean loaded = false; try { Stream<Path> paths = Files.isDirectory(path) ? Files.list(path).sorted() : Stream.of(path); loaded = ethereum.getBlockLoader().loadBlocks(paths.toArray(Path[]::new)); } catch (IOException e) { e.printStackTrace(); } System.exit(loaded ? 0 : 1); }); }</code><technical_language>line createEthereum</technical_language>

Target:
public static void main(String args[]) { CLIInterface.call(args); final SystemProperties config = SystemProperties.getDefault(); getEthashBlockNumber().ifPresent(blockNumber -> createDagFileAndExit(config, blockNumber)); getBlocksDumpPath(config).ifPresent(dumpPath -> loadDumpAndExit(config, dumpPath)); createEthereum(); }
Source:
<code>public void postProcessModule(Module module) { String outputType = null; String inputType = null; if (module.getType() == ModuleType.source || module.getType() == ModuleType.processor) { <START> outputType = module.getProperties().getProperty(OUTPUT_TYPE); <END> } if (module.getType() == ModuleType.sink || module.getType() == ModuleType.processor) { inputType = module.getProperties().getProperty(INPUT_TYPE); } if (outputType != null) { configureModuleConverters(outputType, module, false); } if (inputType != null) { configureModuleConverters(inputType, module, true); } }</code><technical_language>Ideally, avoid getProperties(), code this factored out. getMimeType() in SparkStreamingPlugin is want, convert utility code</technical_language>

Target:
public void postProcessModule(Module module) { if (module.getType() == ModuleType.source || module.getType() == ModuleType.processor) { moduleTypeConversionSupport.configureModuleOutputChannelMessageConverters(module); } if (module.getType() == ModuleType.sink || module.getType() == ModuleType.processor) { moduleTypeConversionSupport.configureModuleInputChannelMessageConverters(module); } }
Source:
<code>public void testReconnectStraightEdgeTarget() { diagram = localSession.getLocalSessionBrowser().perCategory().selectViewpoint(VIEWPOINT_NAME).selectRepresentation(REPRESENTATION_STRAIGHT_EDGE_NAME) .selectRepresentationInstance(REPRESENTATION_INSTANCE_STRAIGHT_EDGE_NAME, UIDiagramRepresentation.class).open(); <START> editor = diagram.getEditor(); <END> Point location = editor.getLocation("eClass2", AbstractDiagramBorderNodeEditPart.class); Dimension dimension = editor.getDimension("eClass2", AbstractDiagramBorderNodeEditPart.class); PointList pointList = edgePointList("eClass3", "eClass1"); Point target = pointList.getPoint(pointList.size() - 1); editor.select(editor.getEditPart("ref", ConnectionEditPart.class)); editor.drag(target, location.x + dimension.width / 2, location.y + dimension.height / 2); checkConnectionPoints("eClass3", "eClass2", pointList, false); }</code><technical_language>API (and time open a diagram) editor = (SWTBotSiriusDiagramEditor)openRepresentation(localSession.getOpenedSession(), REPRESENTATION_STRAIGHT_EDGE_NAME, REPRESENTATION_INSTANCE_STRAIGHT_EDGE_NAME, DDiagram.class); diagram field is needed</technical_language>

Target:
public void testReconnectStraightEdgeTarget() { reconnectAndValidate(REPRESENTATION_STRAIGHT_EDGE_NAME, false); }
Source:
<code>public void binderDied() { if (DBG) { Slog.d(TAG, "Binder is dead - unregister " + mPackageName); } for (Map.Entry<IBinder, ClientDeathRecipient> entry : mBleApps.entrySet()) { <START> IBinder token = entry.getKey(); ClientDeathRecipient deathRec = entry.getValue(); if (deathRec.equals(this)) { <END> if (DBG) { Slog.d(TAG, "Removing BLE application " + mPackageName); } mBleApps.remove(token); break; } } if (isBleAppPresent()) { return; } if (DBG) { Slog.d(TAG, "Disabling LE only mode after application crash"); } try { mBluetoothLock.readLock().lock(); if (mBluetooth != null && mBluetooth.getState() == BluetoothAdapter.STATE_BLE_ON) { mEnable = false; mBluetooth.onBrEdrDown(); } } catch (RemoteException e) { Slog.e(TAG, "Unable to call onBrEdrDown", e); } finally { mBluetoothLock.readLock().unlock(); } }</code><technical_language>Assuming this means entry deathRec null</technical_language>

Target:
public void binderDied() { if (DBG) { Slog.d(TAG, "Binder is dead - unregister " + mPackageName); } for (Map.Entry<IBinder, ClientDeathRecipient> entry : mBleApps.entrySet()) { IBinder token = entry.getKey(); ClientDeathRecipient deathRec = entry.getValue(); if (deathRec.equals(this)) { mBleApps.remove(token); break; } } if (isBleAppPresent()) { return; } if (DBG) { Slog.d(TAG, "Disabling LE only mode after application crash"); } try { mBluetoothLock.readLock().lock(); if (mBluetooth != null && mBluetooth.getState() == BluetoothAdapter.STATE_BLE_ON) { mEnable = false; mBluetooth.onBrEdrDown(); } } catch (RemoteException e) { Slog.e(TAG, "Unable to call onBrEdrDown", e); } finally { mBluetoothLock.readLock().unlock(); } }
Source:
<code>private void checkForInlinedCode(final Collection<MutationDetails> combined, final Entry<LineMutatorPair, Collection<MutationDetails>> each) { final List<MutationDetails> mutationsInHandlerBlock = FCollection .filter(each.getValue(), isInFinallyHandler()); if (!isPossibleToCorrectInlining(mutationsInHandlerBlock)) { combined.addAll(each.getValue()); return; } final MutationDetails baseMutation = mutationsInHandlerBlock.get(0); final int firstBlock = baseMutation.getBlock(); final List<Integer> ids = map(each.getValue(), mutationToBlock()); <START> if (ids.stream().filter(Predicate.<Integer>isEqual(firstBlock).negate()).findFirst().isPresent()) { <END> combined.add(makeCombinedMutant(each.getValue())); } else { combined.addAll(each.getValue()); } }</code><technical_language>Personally I find this hard read. if (ids.stream().anyMatch(x -> !firstBlock.equals(x))) {</technical_language>

Target:
private void checkForInlinedCode(final Collection<MutationDetails> combined, final Entry<LineMutatorPair, Collection<MutationDetails>> each) { final List<MutationDetails> mutationsInHandlerBlock = FCollection .filter(each.getValue(), isInFinallyHandler()); if (!isPossibleToCorrectInlining(mutationsInHandlerBlock)) { combined.addAll(each.getValue()); return; } final MutationDetails baseMutation = mutationsInHandlerBlock.get(0); final int firstBlock = baseMutation.getBlock(); final List<Integer> ids = map(each.getValue(), mutationToBlock()); if (ids.stream().anyMatch(x -> x.intValue() != firstBlock)) { combined.add(makeCombinedMutant(each.getValue())); } else { combined.addAll(each.getValue()); } }
Source:
<code>private synchronized void clearPackageAccessProperty() { if (hasSecurityManager() && secPrc.sandboxEnabled()) { <START> synchronized (SANDBOXED_NODES_COUNTER) { <END> if (SANDBOXED_NODES_COUNTER.decrementAndGet() == 0) SecurityUtils.removeIgnitePackageFromPackageAccessProperty(); } } }</code><technical_language>do need double synchronization here? Especially AtomicInteger. leave one</technical_language>

Target:
private void clearPackageAccessProperty() { if (hasSecurityManager() && secPrc.sandboxEnabled()) { synchronized (SANDBOXED_NODES_COUNTER) { if (SANDBOXED_NODES_COUNTER.decrementAndGet() == 0) { String packAccess = Security.getProperty("package.access"); if (packAccess.equals(IGNITE_INTERNAL_PACKAGE)) Security.setProperty("package.access", null); else if (packAccess.contains(',' + IGNITE_INTERNAL_PACKAGE)) Security.setProperty("package.access", packAccess.replace(',' + IGNITE_INTERNAL_PACKAGE, "")); } } } }
Source:
<code>public void initialise() { metricsModes = Sets.newLinkedHashSet(); <START> modeIterator = Iterators.cycle(metricsModes); <END> currentMode = register(new NullMetricsMode()); register(new RunningMeansMode()); register(new SpikesMode()); register(new AllocationsMode()); register(new RunningThreadsMode()); register(new WorldRendererMode()); register(new RenderingExecTimeMeansMode("Rendering - Execution Time: Running Means - Sorted Alphabetically")); }</code><technical_language>Please double check methods modify LinkedHashSet. I read iterator need regenerated time is added removed set. If is case additional register(ArrayList) unregister(ArrayList) methods pool changes regenerate iterator once</technical_language>

Target:
public void initialise() { modes = new ArrayList<>(); register(defaultMode); register(new RunningMeansMode()); register(new SpikesMode()); register(new AllocationsMode()); register(new RunningThreadsMode()); register(new WorldRendererMode()); register(new RenderingExecTimeMeansMode("Rendering - Execution Time: Running Means - Sorted Alphabetically")); currentMode = defaultMode; }
Source:
<code><START> Object coerce(Object target, Object value, String fieldName, Class<?> fieldClass) { <END> if (fieldClass != null && Collection.class.isAssignableFrom(fieldClass) && value instanceof Collection) { return coerceCollection(target, (Collection) value, fieldName, fieldClass); } if (fieldClass != null && Map.class.isAssignableFrom(fieldClass) && value instanceof Map) { return coerceMap(target, (Map<?, ?>) value, fieldName, fieldClass); } return CoerceUtil.coerce(value, fieldClass); }</code><technical_language>This needs public</technical_language>

Target:
public Object coerce(Object target, Object value, String fieldName, Class<?> fieldClass) { if (fieldClass != null && Collection.class.isAssignableFrom(fieldClass) && value instanceof Collection) { return coerceCollection(target, (Collection) value, fieldName, fieldClass); } if (fieldClass != null && Map.class.isAssignableFrom(fieldClass) && value instanceof Map) { return coerceMap(target, (Map<?, ?>) value, fieldName); } return CoerceUtil.coerce(value, fieldClass); }
Source:
<code>public void trigger(Collection<WorkingTreeModifiedEvent> events) { boolean haveChanges = false; for (WorkingTreeModifiedEvent event : events) { if (event.isEmpty()) { continue; } Repository repo = event.getRepository(); if (repo == null || repo.isBare()) { continue; } File gitDir = repo.getDirectory(); synchronized (repositoriesChanged) { WorkingTreeChanges changes = repositoriesChanged .get(gitDir); if (changes == null) { repositoriesChanged.put(gitDir, new WorkingTreeChanges(event)); } else { changes.merge(event); if (changes.isEmpty()) { repositoriesChanged.remove(gitDir); } } } haveChanges = true; } if (haveChanges && <START> (!Activator.getDefault().getPreferenceStore() .getBoolean(UIPreferences.REFRESH_ONLY_WHEN_ACTIVE) || isActive())) <END> { schedule(); } }</code><technical_language>this early return avoid synchronized blocks completely for inactive case</technical_language>

Target:
public void trigger(Collection<WorkingTreeModifiedEvent> events) { boolean haveChanges = false; for (WorkingTreeModifiedEvent event : events) { if (event.isEmpty()) { continue; } Repository repo = event.getRepository(); if (repo == null || repo.isBare()) { continue; } File gitDir = repo.getDirectory(); synchronized (repositoriesChanged) { WorkingTreeChanges changes = repositoriesChanged .get(gitDir); if (changes == null) { repositoriesChanged.put(gitDir, new WorkingTreeChanges(event)); } else { changes.merge(event); if (changes.isEmpty()) { repositoriesChanged.remove(gitDir); } } } haveChanges = true; } if (haveChanges) { schedule(); } }
Source:
<code>public ListenableFuture<DatanodeInfo[]> reload( final DatanodeReportType type, DatanodeInfo[] oldValue) throws Exception { <START> ListenableFuture<DatanodeInfo[]> listenableFuture = <END> executorService.submit(new Callable<DatanodeInfo[]>() { @Override public DatanodeInfo[] call() throws Exception { return load(type); } }); return listenableFuture; }</code><technical_language>nit: variable listenableFuture is redundant - return submit call</technical_language>

Target:
public ListenableFuture<DatanodeInfo[]> reload( final DatanodeReportType type, DatanodeInfo[] oldValue) throws Exception { return executorService.submit(new Callable<DatanodeInfo[]>() { @Override public DatanodeInfo[] call() throws Exception { return load(type); } }); }
Source:
<code>Metrics2ReplicationMetrics(Master master, MetricsSystem system) { this.master = master; this.system = system; pathModTimes = new HashMap<>(); registry = new MetricsRegistry(Interns.info(NAME, DESCRIPTION)); replicationUtil = new ReplicationUtil(master); <START> replicationQueueTimeQuantiles = registry.newQuantiles(REPLICATION_QUEUE_TIME_QUANTILES, "replication queue time quantiles in milliseconds", "ops", <END> "latency", 600); replicationQueueTimeStat = registry.newStat(REPLICATION_QUEUE_TIME, "replication queue time stat in milliseconds", "ops", "latency", true); }</code><technical_language>nit: capitalize "Replication" please</technical_language>

Target:
Metrics2ReplicationMetrics(Master master, MetricsSystem system) { this.master = master; this.system = system; pathModTimes = new HashMap<>(); registry = new MetricsRegistry(Interns.info(NAME, DESCRIPTION)); replicationUtil = new ReplicationUtil(master); replicationQueueTimeQuantiles = registry.newQuantiles(REPLICATION_QUEUE_TIME_QUANTILES, "Replication queue time quantiles in milliseconds", "ops", "latency", 600); replicationQueueTimeStat = registry.newStat(REPLICATION_QUEUE_TIME, "Replication queue time statistics in milliseconds", "ops", "latency", true); }
Source:
<code>public void testRelatedAllEntriesRemoved() { <START> List<BibEntry> entries = new ArrayList<>(); <END> entries.add(entry1); entries.add(entry3); db.removeEntries(entries); assertEquals(Optional.empty(), entry2.getField(StandardField.RELATED)); }</code><technical_language>asList</technical_language>

Target:
public void testRelatedAllEntriesRemoved() { List<BibEntry> entries = Arrays.asList(entry1, entry3); db.removeEntries(entries); assertEquals(Optional.empty(), entry2.getField(StandardField.RELATED)); }
Source:
<code>public TabletMutationPrepAttempt prepareMutationsForCommit(final TservConstraintEnv cenv, final List<Mutation> mutations) { cenv.setExtent(extent); final ConstraintChecker constraints = constraintChecker.derive(); final TabletMutationPrepAttempt attempt = new TabletMutationPrepAttempt(); mutations.forEach(mutation -> { Violations violations = constraints.check(cenv, mutation); if (violations != null) { attempt.addViolator(mutation, violations); } else { attempt.addNonViolator(mutation); } }); <START> if (!attempt.hasViolations() || attempt.hasNonViolators()) { <END> long time = tabletTime.setUpdateTimes(mutations); attempt.setCommitSession(finishPreparingMutations(time)); } return attempt; }</code><technical_language>this if(attempt.hasNonViolators()) {</technical_language>

Target:
public PreparedMutations prepareMutationsForCommit(final TservConstraintEnv cenv, final List<Mutation> mutations) { cenv.setExtent(extent); final ConstraintChecker constraints = constraintChecker.derive(); Violations violations = null; Set<Mutation> violators = null; List<Mutation> nonViolators = null; for (Mutation mutation : mutations) { Violations mutationViolations = constraints.check(cenv, mutation); if (mutationViolations != null) { if (violations == null) { violations = new Violations(); violators = new HashSet<>(); } violations.add(mutationViolations); violators.add(mutation); } } if (violations == null) { nonViolators = mutations; violators = Collections.emptySet(); violations = Violations.EMPTY; } else if (violators.size() != mutations.size()) { nonViolators = new ArrayList<>((mutations.size() - violators.size())); for (Mutation mutation : mutations) { if (!violators.contains(mutation)) { nonViolators.add(mutation); } } } else { nonViolators = Collections.emptyList(); } CommitSession cs = null; if (!nonViolators.isEmpty()) { long time = tabletTime.setUpdateTimes(nonViolators); cs = finishPreparingMutations(time); if (cs == null) { return new PreparedMutations(); } } return new PreparedMutations(cs, nonViolators, violations, violators); }
Source:
<code>public long lastSeen() { <START> return clock.millis() - healtcheckRefreshTime; <END> }</code><technical_language>healtcheckRefreshTime -> healt**hC**heckRefreshTime</technical_language>

Target:
public long lastSeen() { return clock.millis() - healthcheckRefreshTime; }