auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void process(JSONRequestContext jsonRequestContext) { StudentGroupContactLogEntryDAO logEntryDAO = DAOFactory.getInstance().getStudentGroupContactLogEntryDAO(); try { Long entryId = jsonRequestContext.getLong("entryId"); <START> StudentGroupContactLogEntry entry = logEntryDAO.findById(entryId); <END> String entryText = jsonRequestContext.getRequest().getParameter("entryText"); String entryCreator = jsonRequestContext.getRequest().getParameter("entryCreatorName"); Date entryDate = new Date(NumberUtils.createLong(jsonRequestContext.getRequest().getParameter("entryDate"))); StudentContactLogEntryType entryType = StudentContactLogEntryType.valueOf(jsonRequestContext.getString("entryType")); logEntryDAO.update(entry, entryType, entryText, entryDate, entryCreator); Map<String, Object> info = new HashMap<String, Object>(); info.put("id", entry.getId()); info.put("creatorName", entry.getCreatorName()); info.put("timestamp", entry.getEntryDate().getTime()); info.put("text", entry.getText()); info.put("type", entry.getType()); info.put("studentGroupId", entry.getStudentGroup().getId()); jsonRequestContext.addResponseParameter("results", info); } catch (Exception e) { throw new SmvcRuntimeException(e); } }</code><technical_language>Null-check</technical_language>

Target:
public void process(JSONRequestContext jsonRequestContext) { StudentGroupContactLogEntryDAO logEntryDAO = DAOFactory.getInstance().getStudentGroupContactLogEntryDAO(); Long entryId = jsonRequestContext.getLong("entryId"); if (entryId == null) throw new SmvcRuntimeException(StatusCode.UNDEFINED, "EntryId was not defined."); try { StudentGroupContactLogEntry entry = logEntryDAO.findById(entryId); String entryText = jsonRequestContext.getString("entryText"); String entryCreator = jsonRequestContext.getString("entryCreatorName"); Date entryDate = jsonRequestContext.getDate("entryDate"); StudentContactLogEntryType entryType = StudentContactLogEntryType.valueOf(jsonRequestContext.getString("entryType")); logEntryDAO.update(entry, entryType, entryText, entryDate, entryCreator); Map<String, Object> info = new HashMap<String, Object>(); info.put("id", entry.getId()); info.put("creatorName", entry.getCreatorName()); info.put("timestamp", entry.getEntryDate() != null ? entry.getEntryDate().getTime() : ""); info.put("text", entry.getText()); info.put("type", entry.getType()); info.put("studentGroupId", entry.getStudentGroup().getId()); jsonRequestContext.addResponseParameter("results", info); } catch (Exception e) { throw new SmvcRuntimeException(e); } }
Source:
<code>public List<AbstractPlan> buildPlans(final AbstractDefinitions defs, final String csarName) { final List<AbstractPlan> plans = new ArrayList<>(); AbstractSimplePlanBuilder buildPlanBuilder = new BPELBuildProcessBuilder(); if (!new BPELSituationAwareBuildProcessBuilder().buildPlans(csarName, defs).isEmpty()) { <START> buildPlanBuilder = new BPELSituationAwareBuildProcessBuilder(); <END> } final AbstractSimplePlanBuilder terminationPlanBuilder = new BPELTerminationProcessBuilder(); final AbstractSimplePlanBuilder scalingPlanBuilder = new BPELScaleOutProcessBuilder(); final AbstractSimplePlanBuilder freezePlanBuilder = new BPELFreezeProcessBuilder(); final AbstractSimplePlanBuilder defreezePlanBuilder = new BPELDefrostProcessBuilder(); plans.addAll(scalingPlanBuilder.buildPlans(csarName, defs)); plans.addAll(buildPlanBuilder.buildPlans(csarName, defs)); plans.addAll(terminationPlanBuilder.buildPlans(csarName, defs)); plans.addAll(freezePlanBuilder.buildPlans(csarName, defs)); plans.addAll(defreezePlanBuilder.buildPlans(csarName, defs)); return plans; }</code><technical_language>instance unusable create builder twice</technical_language>

Target:
public List<AbstractPlan> buildPlans(final AbstractDefinitions defs, final String csarName) { final List<AbstractPlan> plans = new ArrayList<>(); AbstractSimplePlanBuilder buildPlanBuilder = new BPELBuildProcessBuilder(); BPELSituationAwareBuildProcessBuilder sitAwareBuilder = new BPELSituationAwareBuildProcessBuilder(); if (!sitAwareBuilder.buildPlans(csarName, defs).isEmpty()) { buildPlanBuilder = sitAwareBuilder; } final AbstractSimplePlanBuilder terminationPlanBuilder = new BPELTerminationProcessBuilder(); final AbstractSimplePlanBuilder scalingPlanBuilder = new BPELScaleOutProcessBuilder(); final AbstractSimplePlanBuilder freezePlanBuilder = new BPELFreezeProcessBuilder(); final AbstractSimplePlanBuilder defreezePlanBuilder = new BPELDefrostProcessBuilder(); plans.addAll(scalingPlanBuilder.buildPlans(csarName, defs)); plans.addAll(buildPlanBuilder.buildPlans(csarName, defs)); plans.addAll(terminationPlanBuilder.buildPlans(csarName, defs)); plans.addAll(freezePlanBuilder.buildPlans(csarName, defs)); plans.addAll(defreezePlanBuilder.buildPlans(csarName, defs)); return plans; }
Source:
<code><START> public static String calculateContentPreview(String text) { <END> if (text == null) { return null; } if (text.length() > 8192) { text = text.substring(0, 8192); } text = text.replaceAll("(?m)^----.*?$", ""); text = text.replaceAll("(?m)^[#>].*$", ""); text = text.replaceAll("(?m)^On .*wrote.?$", ""); text = text.replaceAll("(?m)^.*\\w+:$", ""); text = text.replaceAll("\\s*([-=_]{30,}+)\\s*", " "); text = text.replaceAll("https?://\\S+", "..."); text = text.replaceAll("(\\r|\\n)+", " "); text = text.replaceAll("\\s+", " "); text = text.trim(); return (text.length() <= 512) ? text : text.substring(0, 512); }</code><technical_language>this static? this method operate data a Message instance</technical_language>

Target:
public static String calculateContentPreview(String text) { if (text == null) { return null; } if (text.length() > 8192) { text = text.substring(0, 8192); } text = text.replaceAll("(?ms)^-- [\\r\\n]+.*", ""); text = text.replaceAll("(?m)^----.*?$", ""); text = text.replaceAll("(?m)^[#>].*$", ""); text = text.replaceAll("(?m)^On .*wrote.?$", ""); text = text.replaceAll("(?m)^.*\\w+:$", ""); text = text.replaceAll("\\s*([-=_]{30,}+)\\s*", " "); text = text.replaceAll("https?://\\S+", "..."); text = text.replaceAll("(\\r|\\n)+", " "); text = text.replaceAll("\\s+", " "); text = text.trim(); return (text.length() <= 512) ? text : text.substring(0, 512); }
Source:
<code>public void checkProjectWithoutGitFolder() { projectExplorer.openContextMenuByPathSelectedItem(PROJECT_WITHOUT_GIT_FOLDER); projectExplorer.waitItemOnContexMenuIsNotVisible( <START> TestProjectExplorerContextMenuConstants.ContextMenuFirstLevelItems.OPEN_ON_GITHUB); <END> projectExplorer.clickOnItemInContextMenu( TestProjectExplorerContextMenuConstants.ContextMenuFirstLevelItems.COPY); }</code><technical_language>Static import</technical_language>

Target:
public void checkProjectWithoutGitFolder() { projectExplorer.openContextMenuByPathSelectedItem(PROJECT_WITHOUT_GIT_FOLDER); projectExplorer.waitContexMenuItemIsNotVisible( TestProjectExplorerContextMenuConstants.ContextMenuFirstLevelItems.OPEN_ON_GITHUB); projectExplorer.clickOnItemInContextMenu( TestProjectExplorerContextMenuConstants.ContextMenuFirstLevelItems.COPY); }
Source:
<code>public void testDoNotUpdateDeviceWhenReadOnlyIsNotChanged() { final UpdateVmDiskParameters parameters = createParameters(); parameters.getDiskInfo().setReadOnly(false); when(diskDao.get(diskImageGuid)).thenReturn(createDiskImage()); <START> VmDevice device = createVmDevice(diskImageGuid, vmId); <END> assertEquals(device.getIsReadOnly(), parameters.getDiskInfo().getReadOnly()); initializeCommand(parameters); command.executeVmCommand(); assertFalse(command.updateReadOnlyRequested()); verify(command, atLeast(1)).updateReadOnlyRequested(); verify(vmDeviceDAO, never()).update(any(VmDevice.class)); }</code><technical_language>This device unused. removed</technical_language>

Target:
public void testDoNotUpdateDeviceWhenReadOnlyIsNotChanged() { final UpdateVmDiskParameters parameters = createParameters(); parameters.getDiskInfo().setReadOnly(false); when(diskDao.get(diskImageGuid)).thenReturn(createDiskImage()); initializeCommand(parameters); command.executeVmCommand(); verify(command, atLeast(1)).updateReadOnlyRequested(); assertFalse(command.updateReadOnlyRequested()); verify(vmDeviceDAO, never()).update(any(VmDevice.class)); }
Source:
<code>private UserIdent(UUID identUuid, String identUsername, EntityPlayerMP identPlayer) { if (identUsername != null && identUsername.isEmpty()) identUsername = null; player = identPlayer == null ? null : new WeakReference<EntityPlayer>(identPlayer); if (identPlayer != null) { uuid = identPlayer.getPersistentID(); username = identPlayer.getCommandSenderName(); byUuid.put(uuid, this); byUsername.put(username.toLowerCase(), this); } else { uuid = identUuid; username = identUsername; if (uuid != null) byUuid.put(this.uuid, this); if (identUsername != null && identUsername.charAt(0) != '@') byUsername.put(identUsername.toLowerCase(), this); <START> if (uuid == null && username != null) <END> uuid = resolveMissingUUID(username); else if (uuid != null && username == null) username = resolveMissingUsername(uuid); } }</code><technical_language>Perfect, I expected work</technical_language>

Target:
private UserIdent(UUID identUuid, String identUsername, EntityPlayerMP identPlayer) { if (identUsername != null && identUsername.isEmpty()) identUsername = null; player = identPlayer == null ? null : new WeakReference<EntityPlayer>(identPlayer); if (identPlayer != null) { uuid = identPlayer.getPersistentID(); username = identPlayer.getCommandSenderName(); byUuid.put(uuid, this); byUsername.put(username.toLowerCase(), this); } else { uuid = identUuid; username = identUsername; if (uuid != null) byUuid.put(this.uuid, this); if (identUsername != null && identUsername.charAt(0) != '@') byUsername.put(identUsername.toLowerCase(), this); if (uuid == null && username != null) uuid = UserIdentUtils.resolveMissingUUID(username); else if (uuid != null && username == null) username = UserIdentUtils.resolveMissingUsername(uuid); } }
Source:
<code>PersistEvent get(int idx) { <START> Preconditions.checkState(numEvents > 0 && 0 <= idx && idx < numEvents); <END> return events[idx]; }</code><technical_language>nitpicking: error message human readable text throws IllegalArgumentException explanation</technical_language>

Target:
PersistEvent get(int idx) { Preconditions.checkState(numEvents > 0 && 0 <= idx && idx < numEvents, "Accessing Events array (Size = %s) with wrong index [%s]", numEvents, idx); return events[idx]; }
Source:
<code>public GatewaySession(SipGateway gateway) { this.sipGateway = gateway; this.sipProvider = gateway.getSipProvider(); this.jitsiMeetTools = sipProvider.getOperationSet( OperationSetJitsiMeetTools.class); JITSI_MEET_ROOM_PASS_HEADER = sipProvider.getAccountID() .getAccountPropertyString( JITSI_MEET_ROOM_PASS_HEADER_PROPERTY, JITSI_MEET_ROOM_PASS_HEADER); <START> JITSI_MEET_DOMAIN_BASE_HEADER = sipProvider.getAccountID() <END> .getAccountPropertyString( JITSI_MEET_DOMAIN_BASE_HEADER_PROPERTY, JITSI_MEET_DOMAIN_BASE_HEADER); }</code><technical_language>This is hard understand, a field a default time. interesting idea, I this else in Java code</technical_language>

Target:
public GatewaySession(SipGateway gateway) { this.sipGateway = gateway; this.sipProvider = gateway.getSipProvider(); this.jitsiMeetTools = sipProvider.getOperationSet( OperationSetJitsiMeetTools.class); roomPassHeaderName = sipProvider.getAccountID() .getAccountPropertyString( JITSI_MEET_ROOM_PASS_HEADER_PROPERTY, JITSI_MEET_ROOM_PASS_HEADER_DEFAULT); domainBaseHeaderName = sipProvider.getAccountID() .getAccountPropertyString( JITSI_MEET_DOMAIN_BASE_HEADER_PROPERTY, JITSI_MEET_DOMAIN_BASE_HEADER_DEFAULT); }
Source:
<code>private void <START> initCellularData() <END> { CellularData data = new CellularData(); data.ratType = DataStallEventProto.RADIO_TECHNOLOGY_UNKNOWN; data.networkMccmnc = ""; data.simMccmnc = ""; data.signalStrength = UNKNOWN_SIGNAL_STRENGTH; cellularInfo = MessageNano.toByteArray(data); }</code><technical_language>I return a byte[] cellularInfo final</technical_language>

Target:
private byte[] initCellularData() { CellularData data = new CellularData(); data.ratType = DataStallEventProto.RADIO_TECHNOLOGY_UNKNOWN; data.networkMccmnc = ""; data.simMccmnc = ""; data.signalStrength = UNKNOWN_SIGNAL_STRENGTH; return MessageNano.toByteArray(data); }
Source:
<code>public void testConvertBedToTargetFile() { final String[] arguments = { "-" + ConvertBedToTargetFile.BED_INPUT_SHORT_NAME, TEST_BED_INPUT.getAbsolutePath(), "-" + ConvertBedToTargetFile.TARGET_OUTPUT_SHORT_NAME, TEST_TARGET_OUTPUT.getAbsolutePath(), }; runCommandLine(arguments); Assert.assertTrue(TEST_TARGET_OUTPUT.exists()); List<Target> outputTestTargets = TargetTableReader.readTargetFile(TEST_TARGET_OUTPUT); Assert.assertNotNull(outputTestTargets); List<Target> gtTargets = TargetTableReader.readTargetFile(TARGET_FILE_GT); Assert.assertEquals(outputTestTargets.size(), gtTargets.size()); <START> for(int i=0; i<gtTargets.size(); i++){ <END> Assert.assertEquals(outputTestTargets.get(i), gtTargets.get(i)); } }</code><technical_language>Space for ... e.g. for ( ... )</technical_language>

Target:
public void testConvertBedToTargetFile() { final String[] arguments = { "-" + ConvertBedToTargetFile.BED_INPUT_SHORT_NAME, TEST_BED_INPUT.getAbsolutePath(), "-" + ConvertBedToTargetFile.TARGET_OUTPUT_SHORT_NAME, TEST_TARGET_OUTPUT.getAbsolutePath(), }; runCommandLine(arguments); Assert.assertTrue(TEST_TARGET_OUTPUT.exists()); final List<Target> outputTestTargets = TargetTableReader.readTargetFile(TEST_TARGET_OUTPUT); Assert.assertNotNull(outputTestTargets); final List<Target> gtTargets = TargetTableReader.readTargetFile(TARGET_FILE_GT); Assert.assertEquals(outputTestTargets.size(), gtTargets.size()); for(int i=0; i<gtTargets.size(); i++){ Assert.assertEquals(outputTestTargets.get(i), gtTargets.get(i)); } }
Source:
<code><START> private String uploadPartCopy( <END> String bucketName, String objectName, String uploadId, int partNumber, Multimap<String, String> headerMap) throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, ServerException, XmlParserException, ErrorResponseException, InternalException, InvalidResponseException { Multimap<String, String> queryParamMap = HashMultimap.create(); queryParamMap.put("partNumber", Integer.toString(partNumber)); queryParamMap.put("uploadId", uploadId); Response response = execute( Method.PUT, bucketName, objectName, getRegion(bucketName), headerMap, queryParamMap, "", 0); try (ResponseBody body = response.body()) { CopyPartResult result = Xml.unmarshal(CopyPartResult.class, body.charStream()); return result.etag(); } }</code><technical_language>1. providing core level support protected. reason ti change private? 2. Create more method Multimap change here</technical_language>

Target:
protected String uploadPartCopy( String bucketName, String objectName, String uploadId, int partNumber, Multimap<String, String> headerMap) throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, ServerException, XmlParserException, ErrorResponseException, InternalException, InvalidResponseException { Multimap<String, String> queryParamMap = HashMultimap.create(); queryParamMap.put("partNumber", Integer.toString(partNumber)); queryParamMap.put("uploadId", uploadId); Response response = execute( Method.PUT, bucketName, objectName, getRegion(bucketName), headerMap, queryParamMap, "", 0); try (ResponseBody body = response.body()) { CopyPartResult result = Xml.unmarshal(CopyPartResult.class, body.charStream()); return result.etag(); } }
Source:
<code>public String getGuiID() { <START> return archetype.getProperty(GuiIDProperty.class, GuiIDProperty.class.getSimpleName().toLowerCase()).map(p -> p.getValue()).orElse("minecraft:chest"); <END> }</code><technical_language>this</technical_language>

Target:
public String getGuiID() { String key = AbstractInventoryProperty.getDefaultKey(GuiIdProperty.class).toString(); InventoryProperty<?, ?> property = this.properties.get(key); if (property instanceof GuiIdProperty) { if (property.getValue() instanceof SpongeGuiId) { return ((SpongeGuiId) property.getValue()).getInternalId(); } return ((GuiIdProperty) property).getValue().getId(); } GuiId guiId = this.archetype.getProperty(GuiIdProperty.class, key).map(GuiIdProperty::getValue).orElse(GuiIds.CHEST); if (guiId instanceof SpongeGuiId) { return ((SpongeGuiId) guiId).getInternalId(); } return guiId.getId(); }
Source:
<code>protected abstract int peekData(DatagramPacket pack) throws IOException; <START> protected void initBound(InetAddress localAddress, int localPort) { <END> this.localPort = localPort; }</code><technical_language>this class DatagramSocket designed for inheritance ? If so, programs derive this class able override methods (they're hidden). break classes ? Is case methods *only* NIO channels, subclasses safe build a channel out of classes</technical_language>

Target:
protected abstract int peekData(DatagramPacket pack) throws IOException; protected void onBind(InetAddress localAddress, int localPort) { this.localPort = localPort; }
Source:
<code>public void handleDatastream(List<DatastreamGroup> datastreamGroups) { List<String> dgNames = datastreamGroups.stream().map(DatastreamGroup::getTaskPrefix).collect(Collectors.toList()); List<String> obsoleteDgs = new ArrayList<>(_partitionDiscoveryThreadMap.keySet()); obsoleteDgs.removeAll(dgNames); <START> obsoleteDgs.stream().forEach(name -> { <END> LOG.info("remove datastream group {}", name); Optional.ofNullable(_partitionDiscoveryThreadMap.remove(name)).ifPresent(Thread::interrupt); }); datastreamGroups.stream().forEach(datastreamGroup -> { String datastreamGroupName = datastreamGroup.getTaskPrefix(); PartitionDiscoveryThread partitionDiscoveryThread; if (_partitionDiscoveryThreadMap.containsKey(datastreamGroupName)) { partitionDiscoveryThread = _partitionDiscoveryThreadMap.get(datastreamGroupName); partitionDiscoveryThread.setDatastreamGroup(datastreamGroup); } else { if (_partitionChangeCallback != null) { partitionDiscoveryThread = new PartitionDiscoveryThread(datastreamGroup); partitionDiscoveryThread.start(); _partitionDiscoveryThreadMap.put(datastreamGroupName, partitionDiscoveryThread); LOG.info("DatastreamChangeListener for registered", datastreamGroupName); } } }); }</code><technical_language>forEach() instead of stream().forEach()</technical_language>

Target:
public void handleDatastream(List<DatastreamGroup> datastreamGroups) { if (!_enablePartitionAssignment) { return; } if (_partitionChangeCallback == null) { throw new DatastreamRuntimeException("Partition change callback is not defined"); } LOG.info("handleDatastream: original datastream groups: {}, received datastream group {}", _partitionDiscoveryThreadMap.keySet(), datastreamGroups); List<String> dgNames = datastreamGroups.stream().map(DatastreamGroup::getName).collect(Collectors.toList()); List<String> obsoleteDgs = new ArrayList<>(_partitionDiscoveryThreadMap.keySet()); obsoleteDgs.removeAll(dgNames); obsoleteDgs.forEach(name -> Optional.ofNullable(_partitionDiscoveryThreadMap.remove(name)).ifPresent(PartitionDiscoveryThread::shutdown)); datastreamGroups.forEach(datastreamGroup -> { String datastreamGroupName = datastreamGroup.getName(); PartitionDiscoveryThread partitionDiscoveryThread; if (!_partitionDiscoveryThreadMap.containsKey(datastreamGroupName)) { partitionDiscoveryThread = new PartitionDiscoveryThread(datastreamGroup); partitionDiscoveryThread.start(); _partitionDiscoveryThreadMap.put(datastreamGroupName, partitionDiscoveryThread); LOG.info("DatastreamChangeListener for registered", datastreamGroupName); } }); LOG.info("handleDatastream: new datastream groups: {}", _partitionDiscoveryThreadMap.keySet()); }
Source:
<code>public void verifyDescriptionFieldIsDisplayed() { waitForElementByElement(descriptionField); <START> PageObjectLogging.log("verifyPinCategorySelector", "Pin category selector is visible", true, driver); <END> }</code><technical_language>log a copy & paste error</technical_language>

Target:
public void verifyDescriptionFieldIsDisplayed() { waitForElementByElement(descriptionField); PageObjectLogging.log("verifyDescriptionFieldIsDisplayed", "Description field is visible", true, driver); }
Source:
<code>public void setup() { nakadiSettings = new NakadiSettings( MAX_TOPIC_PARTITION_COUNT, DEFAULT_PARTITION_COUNT, DEFAULT_REPLICA_FACTOR, DEFAULT_TOPIC_RETENTION, DEFAULT_TOPIC_ROTATION, DEFAULT_COMMIT_TIMEOUT, NAKADI_POLL_TIMEOUT, NAKADI_SEND_TIMEOUT, TIMELINE_WAIT_TIMEOUT, NAKADI_EVENT_MAX_BYTES, <START> 0); <END> kafkaSettings = new KafkaSettings(KAFKA_REQUEST_TIMEOUT, KAFKA_BATCH_SIZE, KAFKA_LINGER_MS, KAFKA_ENABLE_AUTO_COMMIT); zookeeperSettings = new ZookeeperSettings(ZK_SESSION_TIMEOUT, ZK_CONNECTION_TIMEOUT); kafkaHelper = new KafkaTestHelper(KAFKA_URL); kafkaTopicRepository = createKafkaTopicRepository(); }</code><technical_language>this magic value</technical_language>

Target:
public void setup() { nakadiSettings = new NakadiSettings( MAX_TOPIC_PARTITION_COUNT, DEFAULT_PARTITION_COUNT, DEFAULT_REPLICA_FACTOR, DEFAULT_TOPIC_RETENTION, DEFAULT_TOPIC_ROTATION, DEFAULT_COMMIT_TIMEOUT, NAKADI_POLL_TIMEOUT, NAKADI_SEND_TIMEOUT, TIMELINE_WAIT_TIMEOUT, NAKADI_EVENT_MAX_BYTES, NAKADI_SUBSCRIPTION_MAX_PARTITIONS); kafkaSettings = new KafkaSettings(KAFKA_REQUEST_TIMEOUT, KAFKA_BATCH_SIZE, KAFKA_LINGER_MS, KAFKA_ENABLE_AUTO_COMMIT); zookeeperSettings = new ZookeeperSettings(ZK_SESSION_TIMEOUT, ZK_CONNECTION_TIMEOUT); kafkaHelper = new KafkaTestHelper(KAFKA_URL); kafkaTopicRepository = createKafkaTopicRepository(); }
Source:
<code>public InfoboxBuilderPage changeHeaderCollapsibilityState(int index) { <START> JavascriptExecutor js = (JavascriptExecutor) driver; <END> headers.get(index).click(); wait.forElementClickable(sidebarCheckbox); sidebarCheckbox.click(); String script = "return window.getComputedStyle(document" + ".querySelector('.pi-header'),':after').content"; String chevronContent = js.executeScript(script).toString(); if (sidebarCheckbox.isSelected()) { Assertion.assertFalse(chevronContent.isEmpty()); } else { Assertion.assertTrue(chevronContent.isEmpty()); } return this; }</code><technical_language>I is need cast driver JS executor</technical_language>

Target:
public InfoboxBuilderPage changeHeaderCollapsibilityState(int index) { headers.get(index).click(); wait.forElementClickable(sidebarCheckbox); sidebarCheckbox.click(); String script = "return window.getComputedStyle(document" + ".querySelector('.pi-header'),':after').content"; String chevronContent = driver.executeScript(script).toString(); if (sidebarCheckbox.isSelected()) { Assertion.assertFalse(chevronContent.isEmpty()); } else { Assertion.assertTrue(chevronContent.isEmpty()); } return this; }
Source:
<code>public String getServiceUrl() { String context = getContext(); if ("HIVE".equals(getServiceName())) { return String.format(Locale.ROOT, "jdbc:hive2://%s:%d/;?hive.server2.transport.mode=http;hive.server2.thrift.http.path=/%s/%s%s", request.getServerName(), request.getServerPort(), gatewayPath, topologyName, context); } else { if (context.indexOf("{{BACKEND_HOST}}") > -1) { <START> context = context.replaceAll("\\{\\{BACKEND_HOST\\}\\}", getBackendServiceUrl()); <END> } return String.format(Locale.ROOT, "%s://%s:%s/%s/%s%s", request.getScheme(), request.getServerName(), request.getServerPort(), gatewayPath, topologyName, context); } }</code><technical_language>I need replaceAll replace replaceAll is for regex</technical_language>

Target:
public String getServiceUrl() { String context = getContext(); if ("HIVE".equals(getServiceName())) { return String.format(Locale.ROOT, "jdbc:hive2://%s:%d/;?hive.server2.transport.mode=http;hive.server2.thrift.http.path=/%s/%s%s", request.getServerName(), request.getServerPort(), gatewayPath, topologyName, context); } else { if (context.indexOf("{{BACKEND_HOST}}") > -1) { context = context.replace("{{BACKEND_HOST}}", getBackendServiceUrl()); } return String.format(Locale.ROOT, "%s://%s:%s/%s/%s%s", request.getScheme(), request.getServerName(), request.getServerPort(), gatewayPath, topologyName, context); } }
Source:
<code>public void multiIndex_incompatibleAnalyzer_overrideAnalyzer() { StubMappingSearchScope scope = indexManager.createSearchScope( incompatibleAnalyzerIndexManager ); String absoluteFieldPath = indexMapping.analyzedStringField.relativeFieldName; IndexSearchQuery<DocumentReference> query = scope.query().asReference() .predicate( f -> f.match().onField( absoluteFieldPath ).matching( "fox" ) .analyzer( OverrideAnalysisDefinitions.ANALYZER_WHITESPACE_LOWERCASE.name ) ) .toQuery(); <START> assertThat( query ).assertThat( query ).hasDocRefHitsAnyOrder( b -> { <END> b.doc( INDEX_NAME, DOCUMENT_1 ); b.doc( INCOMPATIBLE_ANALYZER_INDEX_NAME, INCOMPATIBLE_ANALYZER_INDEX_DOCUMENT_1 ); } ); }</code><technical_language>assertThat( query ).assertThat( query )</technical_language>

Target:
public void multiIndex_incompatibleAnalyzer_overrideAnalyzer() { StubMappingSearchScope scope = indexManager.createSearchScope( incompatibleAnalyzerIndexManager ); String absoluteFieldPath = indexMapping.analyzedStringField.relativeFieldName; IndexSearchQuery<DocumentReference> query = scope.query().asReference() .predicate( f -> f.match().onField( absoluteFieldPath ).matching( "fox" ) .analyzer( OverrideAnalysisDefinitions.ANALYZER_WHITESPACE_LOWERCASE.name ) ) .toQuery(); assertThat( query ).hasDocRefHitsAnyOrder( b -> { b.doc( INDEX_NAME, DOCUMENT_1 ); b.doc( INCOMPATIBLE_ANALYZER_INDEX_NAME, INCOMPATIBLE_ANALYZER_INDEX_DOCUMENT_1 ); } ); }
Source:
<code>private static List<String> getUserList(JdbcRealm obj) { List<String> userlist = new ArrayList<>(); Connection con = null; PreparedStatement ps = null; ResultSet rs = null; DataSource dataSource = null; String authQuery = ""; String retval[]; String tablename = ""; String username = ""; String userquery; try { dataSource = (DataSource) FieldUtils.readField(obj, "dataSource", true); authQuery = (String) FieldUtils.readField(obj, "authenticationQuery", true); LOGGER.info(authQuery); String authQueryLowerCase = authQuery.toLowerCase(); retval = authQueryLowerCase.split("from", 2); if (retval.length >= 2) { retval = retval[1].split("with|where", 2); tablename = retval[0]; retval = retval[1].split("where", 2); if (retval.length >= 2) { retval = retval[1].split("=", 2); } else { retval = retval[0].split("=", 2); } username = retval[0]; } if (StringUtils.isBlank(username) || StringUtils.isBlank(tablename)) { return userlist; } userquery = String.format("SELECT %s FROM %s", username, tablename); } catch (IllegalAccessException e) { LOGGER.error("Error while accessing dataSource for JDBC Realm", e); <START> return null; <END> } try { con = dataSource.getConnection(); ps = con.prepareStatement(userquery); rs = ps.executeQuery(); while (rs.next()) { userlist.add(rs.getString(1).trim()); } } catch (Exception e) { LOGGER.error("Error retrieving User list from JDBC Realm", e); } finally { JdbcUtils.closeResultSet(rs); JdbcUtils.closeStatement(ps); JdbcUtils.closeConnection(con); } return userlist; }</code><technical_language>return userlist (would empty) here? L475 return null? need consistent</technical_language>

Target:
private static List<String> getUserList(JdbcRealm obj) { List<String> userlist = new ArrayList<>(); Connection con = null; PreparedStatement ps = null; ResultSet rs = null; DataSource dataSource = null; String authQuery = ""; String retval[]; String tablename = ""; String username = ""; String userquery; try { dataSource = (DataSource) FieldUtils.readField(obj, "dataSource", true); authQuery = (String) FieldUtils.readField(obj, "authenticationQuery", true); LOGGER.info(authQuery); String authQueryLowerCase = authQuery.toLowerCase(); retval = authQueryLowerCase.split("from", 2); if (retval.length >= 2) { retval = retval[1].split("with|where", 2); tablename = retval[0]; retval = retval[1].split("where", 2); if (retval.length >= 2) { retval = retval[1].split("=", 2); } else { retval = retval[0].split("=", 2); } username = retval[0]; } if (StringUtils.isBlank(username) || StringUtils.isBlank(tablename)) { return userlist; } userquery = String.format("SELECT %s FROM %s", username, tablename); } catch (IllegalAccessException e) { LOGGER.error("Error while accessing dataSource for JDBC Realm", e); return Lists.newArrayList(); } try { con = dataSource.getConnection(); ps = con.prepareStatement(userquery); rs = ps.executeQuery(); while (rs.next()) { userlist.add(rs.getString(1).trim()); } } catch (Exception e) { LOGGER.error("Error retrieving User list from JDBC Realm", e); } finally { JdbcUtils.closeResultSet(rs); JdbcUtils.closeStatement(ps); JdbcUtils.closeConnection(con); } return userlist; }
Source:
<code>private String invokeAntiSamy( String context, String input ) throws ValidationException { if ( StringUtilities.isEmpty(input) ) { if (allowNull) { return null; } throw new ValidationException( context + " is required", "AntiSamy validation error: context=" + context + ", input=" + input, context ); } String canonical = super.getValid( context, input ); try { AntiSamy as = new AntiSamy(); CleanResults test = as.scan(canonical, antiSamyPolicy); List<String> errors = test.getErrorMessages(); if ( !errors.isEmpty() ) { <START> StringBuilder sb = new StringBuilder(); <END> for ( int i = 0; i < errors.size(); i++ ) { sb.append(errors.get(i)); if ( i != errors.size() - 1 ) { sb.append(","); } } throw new ValidationException( context + ": Invalid HTML input", "Invalid HTML input does not follow rules in antisamy-esapi.xml: context=" + context + " errors=" + sb.toString()); } return test.getCleanHTML().trim(); } catch (ScanException e) { throw new ValidationException( context + ": Invalid HTML input", "Invalid HTML input: context=" + context + " error=" + e.getMessage(), e, context ); } catch (PolicyException e) { throw new ValidationException( context + ": Invalid HTML input", "Invalid HTML input does not follow rules in antisamy-esapi.xml: context=" + context + " error=" + e.getMessage(), e, context ); } }</code><technical_language>I agree @jeremiahjstacey needing StringBuilder here. This in fact is a pretty common pattern ESAPI prefer this occurrence others, work do right thing</technical_language>

Target:
private String invokeAntiSamy( String context, String input ) throws ValidationException { if ( StringUtilities.isEmpty(input) ) { if (allowNull) { return null; } throw new ValidationException( context + " is required", "AntiSamy validation error: context=" + context + ", input=" + input, context ); } String canonical = super.getValid( context, input ); try { AntiSamy as = new AntiSamy(); CleanResults test = as.scan(canonical, antiSamyPolicy); List<String> errors = test.getErrorMessages(); if ( !errors.isEmpty() ) { throw new ValidationException( context + ": Invalid HTML input", "Invalid HTML input does not follow rules in antisamy-esapi.xml: context=" + context + " errors=" + errors.toString()); } return test.getCleanHTML().trim(); } catch (ScanException e) { throw new ValidationException( context + ": Invalid HTML input", "Invalid HTML input: context=" + context + " error=" + e.getMessage(), e, context ); } catch (PolicyException e) { throw new ValidationException( context + ": Invalid HTML input", "Invalid HTML input does not follow rules in antisamy-esapi.xml: context=" + context + " error=" + e.getMessage(), e, context ); } }
Source:
<code>public void setParallel(XmlSuite.ParallelMode parallel) { if (parallel == XmlSuite.ParallelMode.FALSE || parallel == XmlSuite.ParallelMode.TRUE) { <START> Utils.log("TestNG", 1, "[WARN] 'parallel' value 'true' and 'false' are deprecated, use 'none' instead."); <END> parallel = XmlSuite.ParallelMode.NONE; } m_parallelMode = parallel; }</code><technical_language>users replace true well</technical_language>

Target:
public void setParallel(XmlSuite.ParallelMode parallel) { m_parallelMode = skipDeprecatedValues(parallel); }
Source:
<code>DeadLetterQueueReporter(KafkaProducer<byte[], byte[]> kafkaProducer, SinkConnectorConfig connConfig, ConnectorTaskId id, ErrorHandlingMetrics errorHandlingMetrics) { Objects.requireNonNull(kafkaProducer); Objects.requireNonNull(connConfig); Objects.requireNonNull(id); Objects.requireNonNull(errorHandlingMetrics); this.kafkaProducer = kafkaProducer; this.connConfig = connConfig; this.connectorTaskId = id; this.errorHandlingMetrics = errorHandlingMetrics; <START> this.dlqTopicName = connConfig.dlqTopicName(); <END> }</code><technical_language>trim this? suggestion this.dlqTopicName = connConfig.dlqTopicName().trim();</technical_language>

Target:
DeadLetterQueueReporter(KafkaProducer<byte[], byte[]> kafkaProducer, SinkConnectorConfig connConfig, ConnectorTaskId id, ErrorHandlingMetrics errorHandlingMetrics) { Objects.requireNonNull(kafkaProducer); Objects.requireNonNull(connConfig); Objects.requireNonNull(id); Objects.requireNonNull(errorHandlingMetrics); this.kafkaProducer = kafkaProducer; this.connConfig = connConfig; this.connectorTaskId = id; this.errorHandlingMetrics = errorHandlingMetrics; this.dlqTopicName = connConfig.dlqTopicName().trim(); }
Source:
<code>@Override public ClientListenerResponse handle(ClientListenerRequest req) { try { if (req instanceof ClientTxAwareRequest) { <START> if (((ClientTxAwareRequest)req).isTransactional()) { <END> int txId = ((ClientTxAwareRequest)req).txId(); ClientTxContext txCtx = ctx.txContext(txId); if (txCtx != null) { try { txCtx.aquire(); return ((ClientRequest)req).process(ctx); } catch (IgniteCheckedException e) { throw e.getCause() instanceof IgniteClientException ? (IgniteClientException)e.getCause() : new IgniteClientException(ClientStatus.FAILED, e.getMessage(), e); } finally { try { txCtx.release(); } catch (Exception e) { log.warning("Failed to release client transaction context", e); } } } } } return ((ClientRequest)req).process(ctx); } catch (SecurityException ex) { throw new IgniteClientException( ClientStatus.SECURITY_VIOLATION, "Client is not authorized to perform this operation", ex ); } }</code><technical_language>Please introduce a variable reduce casts</technical_language>

Target:
@Override public ClientListenerResponse handle(ClientListenerRequest req) { try { if (req instanceof ClientTxAwareRequest) { ClientTxAwareRequest req0 = (ClientTxAwareRequest)req; if (req0.isTransactional()) { int txId = req0.txId(); ClientTxContext txCtx = ctx.txContext(txId); if (txCtx != null) { try { txCtx.acquire(true); return ((ClientRequest)req).process(ctx); } catch (IgniteCheckedException e) { throw new IgniteClientException(ClientStatus.FAILED, e.getMessage(), e); } finally { try { txCtx.release(true); } catch (Exception e) { log.warning("Failed to release client transaction context", e); } } } } } return ((ClientRequest)req).process(ctx); } catch (SecurityException ex) { throw new IgniteClientException( ClientStatus.SECURITY_VIOLATION, "Client is not authorized to perform this operation", ex ); } }
Source:
<code>public String toString() { <START> return "Configuration [clusteringConfiguration=" + clusteringConfiguration + ", customInterceptorsConfiguration=" <END> + customInterceptorsConfiguration + ", dataContainerConfiguration=" + dataContainerConfiguration + ", deadlockDetectionConfiguration=" + deadlockDetectionConfiguration + ", evictionConfiguration=" + evictionConfiguration + ", expirationConfiguration=" + expirationConfiguration + ", indexingConfiguration=" + indexingConfiguration + ", invocationBatchingConfiguration=" + invocationBatchingConfiguration + ", jmxStatisticsConfiguration=" + jmxStatisticsConfiguration + ", persistenceConfiguration=" + persistenceConfiguration + ", lockingConfiguration=" + lockingConfiguration + ", storeAsBinaryConfiguration=" + storeAsBinaryConfiguration + ", transactionConfiguration=" + transactionConfiguration + ", versioningConfiguration=" + versioningConfiguration + ", unsafeConfiguration=" + unsafeConfiguration + ", moduleConfiguration=" + moduleConfiguration + ", securityConfiguration=" + securityConfiguration + ", sitesConfiguration=" + sitesConfiguration + ", compatibilityConfiguration=" + compatibilityConfiguration + "]"; }</code><technical_language>Is this a formatting change? :) PR is big enough add cosmetic changes :)</technical_language>

Target:
public String toString() { return "Configuration{" + "clustering=" + clusteringConfiguration + ", customInterceptors=" + customInterceptorsConfiguration + ", dataContainer=" + dataContainerConfiguration + ", deadlockDetection=" + deadlockDetectionConfiguration + ", eviction=" + evictionConfiguration + ", expiration=" + expirationConfiguration + ", indexing=" + indexingConfiguration + ", invocationBatching=" + invocationBatchingConfiguration + ", jmxStatistics=" + jmxStatisticsConfiguration + ", persistence=" + persistenceConfiguration + ", locking=" + lockingConfiguration + ", modules=" + moduleConfiguration + ", security=" + securityConfiguration + ", storeAsBinary=" + storeAsBinaryConfiguration + ", transaction=" + transactionConfiguration + ", versioning=" + versioningConfiguration + ", unsafe=" + unsafeConfiguration + ", sites=" + sitesConfiguration + ", compatibility=" + compatibilityConfiguration + '}'; }
Source:
<code>private static synchronized void removeSession(SyncConfiguration syncConfiguration) { if (syncConfiguration == null) { throw new IllegalArgumentException("A non-empty 'syncConfiguration' is required."); } SyncSession syncSession = sessions.remove(syncConfiguration.getPath()); if (syncSession != null) { syncSession.close(); } <START> if (sessions.size() == 0) { <END> RealmLog.debug("last session dropped, remove network listener"); NetworkStateReceiver.removeListener(networkListener); } }</code><technical_language>I prefer isEmpty() size() == 0</technical_language>

Target:
private static synchronized void removeSession(SyncConfiguration syncConfiguration) { if (syncConfiguration == null) { throw new IllegalArgumentException("A non-empty 'syncConfiguration' is required."); } SyncSession syncSession = sessions.remove(syncConfiguration.getPath()); if (syncSession != null) { syncSession.close(); } if (sessions.isEmpty()) { RealmLog.debug("last session dropped, remove network listener"); NetworkStateReceiver.removeListener(networkListener); } }
Source:
<code>public int[][] getDrops(Item item) { if (item.getTier() >= ItemTool.TIER_WOODEN) { <START> return new int[][]{{}}; <END> } return new int[0][0]; }</code><technical_language>wrong, drop in other blocks</technical_language>

Target:
public int[][] getDrops(Item item) { if (item.getTier() >= ItemTool.TIER_WOODEN) { return new int[][]{{Item.CAULDRON, 0, 1}}; } return new int[0][0]; }
Source:
<code>protected void updateWipeAfterDeleteChangeability() { if (isVmAttachedToPool()) { getIsWipeAfterDelete().setIsChangeable(false); } else { <START> getIsWipeAfterDelete().setIsChangeable(true); <END> } }</code><technical_language>getIsWipeAfterDelete().setIsChangeable(!isVmAttachedToPool());</technical_language>

Target:
protected void updateWipeAfterDeleteChangeability() { getIsWipeAfterDelete().setIsChangeable(!isVmAttachedToPool()); }
Source:
<code>protected IOReport execute(ProgressIndicator progress, IOReporter reporter) throws IOProviderConfigurationException, IOException { progress.begin("Inspecting GeoPackage", ProgressIndicator.UNKNOWN); try { URI loc = getSource().getLocation(); File file; try { file = new File(loc); } catch (Exception e) { throw new IllegalArgumentException("Only files are supported as data source", e); } GeoPackage gpkg = GeoPackageManager.open(file, true); Map<TypeDefinition, InstanceCollection> collections = new HashMap<>(); for (String table : gpkg.getFeatureTables()) { QName defTypeName = new QName(GeopackageSchemaBuilder.DEFAULT_NAMESPACE, table); TypeDefinition type = getSourceSchema().getType(defTypeName); if (!type.getConstraint(MappingRelevantFlag.class).isEnabled()) { type = null; } <START> if (type == null) { <END> for (TypeDefinition candidate : getSourceSchema().getMappingRelevantTypes()) { if (table.equals(candidate.getName().getLocalPart())) { type = candidate; break; } } } if (type == null) { reporter.warn("For table {0} no matching schema type could be identified", table); } else { FeatureDao features = gpkg.getFeatureDao(table); collections.put(type, new GeopackageFeatureCollection(features, type)); } } collection = new PerTypeInstanceCollection(collections); reporter.setSuccess(true); } catch (Exception e) { reporter.error(new IOMessageImpl("Error configuring database connection", e)); reporter.setSuccess(false); } finally { progress.end(); } return reporter; }</code><technical_language>type null in this case</technical_language>

Target:
protected IOReport execute(ProgressIndicator progress, IOReporter reporter) throws IOProviderConfigurationException, IOException { progress.begin("Inspecting GeoPackage", ProgressIndicator.UNKNOWN); try { URI loc = getSource().getLocation(); File file; try { file = new File(loc); } catch (Exception e) { throw new IllegalArgumentException("Only files are supported as data source", e); } GeoPackage gpkg = GeoPackageManager.open(file, true); Map<TypeDefinition, InstanceCollection> collections = new HashMap<>(); for (String table : gpkg.getFeatureTables()) { QName defTypeName = new QName(GeopackageSchemaBuilder.DEFAULT_NAMESPACE, table); TypeDefinition type = getSourceSchema().getType(defTypeName); if (type != null && !type.getConstraint(MappingRelevantFlag.class).isEnabled()) { type = null; } if (type == null) { for (TypeDefinition candidate : getSourceSchema().getMappingRelevantTypes()) { if (table.equals(candidate.getName().getLocalPart())) { type = candidate; break; } } } if (type == null) { reporter.warn("For table {0} no matching schema type could be identified", table); } else { FeatureDao features = gpkg.getFeatureDao(table); collections.put(type, new GeopackageFeatureCollection(features, type)); } } collection = new PerTypeInstanceCollection(collections); reporter.setSuccess(true); } catch (Exception e) { reporter.error(new IOMessageImpl("Error configuring database connection", e)); reporter.setSuccess(false); } finally { progress.end(); } return reporter; }
Source:
<code>public GlusterStatus isVDORunning(Guid vdsId) { VDSReturnValue returnValue = resourceManager.runVdsCommand(VDSCommandType.ManageGlusterService, new GlusterServiceVDSParameters(vdsId, Arrays.asList("vdo"), "status")); if (!returnValue.getSucceeded()) { log.error("Failed to check VDO running status of host : '{}' ", vdsId); return GlusterStatus.UNKNOWN; } ArrayList<GlusterServerService> returnList = (ArrayList<GlusterServerService>) returnValue.getReturnValue(); if (returnList == null || returnList.isEmpty()) { log.error("Failed to check VDO running status of host : '{}' returned empty object", vdsId); return GlusterStatus.UNKNOWN; } GlusterServerService gss = returnList.get(0); if (gss != null) { return gss.getStatus().getStatusMsg().equalsIgnoreCase("Up") ? GlusterStatus.UP : GlusterStatus.DOWN; } <START> return GlusterStatus.UNKNOWN; <END> }</code><technical_language>need log in this case</technical_language>

Target:
public GlusterStatus isVDORunning(Guid vdsId) { VDSReturnValue returnValue = resourceManager.runVdsCommand(VDSCommandType.ManageGlusterService, new GlusterServiceVDSParameters(vdsId, Arrays.asList("vdo"), "status")); if (!returnValue.getSucceeded()) { log.error("Failed to check VDO running status of host : '{}' ", vdsId); return GlusterStatus.UNKNOWN; } ArrayList<GlusterServerService> returnList = (ArrayList<GlusterServerService>) returnValue.getReturnValue(); if (returnList == null || returnList.isEmpty()) { log.error("Failed to check VDO running status of host : '{}' returned empty object", vdsId); return GlusterStatus.UNKNOWN; } GlusterServerService gss = returnList.get(0); if (gss != null) { return gss.getStatus().getStatusMsg().equalsIgnoreCase("Up") ? GlusterStatus.UP : GlusterStatus.DOWN; } log.info("Failed to check VDO running status of host : '{}' ", vdsId); return GlusterStatus.UNKNOWN; }
Source:
<code>private boolean checkFieldPresent(@NonNull String field) { final Multimap<@NonNull String, @NonNull String> traceEvents = TmfEventTypeCollectionHelper.getEventFieldNames((getContainedEventTypes())); Optional<@NonNull String> event = traceEvents.values().stream() .filter(fieldName -> fieldName.equals(field)) .findAny(); return <START> event.isPresent(); <END> }</code><technical_language>traceEvents.containsValue(field)</technical_language>

Target:
private boolean checkFieldPresent(@NonNull String field) { final Multimap<@NonNull String, @NonNull String> traceEvents = TmfEventTypeCollectionHelper.getEventFieldNames((getContainedEventTypes())); return traceEvents.containsValue(field); }
Source:
<code>@Override protected DescriptionEditSuccessFragment createFragment() { DescriptionEditSuccessFragment fragment = DescriptionEditSuccessFragment.newInstance(); <START> fragment.setCallback(this); <END> return fragment; }</code><technical_language>Fragment obtain host calling FragmentUtil.getCallback(). I if Activity is ratained in a Fragment instance, a memory leak</technical_language>

Target:
@Override protected DescriptionEditSuccessFragment createFragment() { return DescriptionEditSuccessFragment.newInstance(); }
Source:
<code>if (!isLoaded()) { log.error("Tried and failed to load Accumulo native library from " + accumuloNativeLibDirs); String ldLibraryPath = System.getProperty("java.library.path"); try { System.loadLibrary("accumulo"); loadedNativeLibraries.set(true); log.info("Loaded native map shared library from " + ldLibraryPath); <START> } catch (Exception | UnsatisfiedLinkError e) { <END> log.error("Tried and failed to load Accumulo native library from " + ldLibraryPath, e); } }</code><technical_language>multi-catch. Nice :)</technical_language>

Target:
if (!isLoaded()) { log.error("Tried and failed to load Accumulo native library from {}", accumuloNativeLibDirs); String ldLibraryPath = System.getProperty("java.library.path"); try { System.loadLibrary("accumulo"); loadedNativeLibraries.set(true); log.info("Loaded native map shared library from " + ldLibraryPath); } catch (Exception | UnsatisfiedLinkError e) { log.error("Tried and failed to load Accumulo native library from {}", ldLibraryPath, e); } }
Source:
<code>public synchronized void onWorkerAdded(final boolean addedEval, final String workerId) { if (addedEval) { return; } <START> workerClockMap.put(workerId, globalMinimumClock); <END> minimumClockWorkers.add(workerId); }</code><technical_language>globalMinimumClock of greater 0, parameter addedEval false. Handling this case throwing RuntimeException sense</technical_language>

Target:
public synchronized void onWorkerAdded(final boolean addedEval, final String workerId) { if (addedEval) { return; } if (!addedEval && globalMinimumClock != INITIAL_GLOBAL_MINIMUM_CLOCK) { throw new RuntimeException( String.format("Initial worker %s is added after global minimum clock changes", workerId)); } workerClockMap.put(workerId, globalMinimumClock); minimumClockWorkers.add(workerId); }
Source:
<code>public void shouldConcatenateOneEmptyAndOneNonEmptyLists() { final List<Integer> list = Collections.unmodifiableList( <START> IntStream.range(0, 4) <END> .boxed() .collect(Collectors.toList()) ); final List<Integer> actual = ListOps.concat(list, EMPTY_LIST); final List<Integer> expected = IntStream.range(0, 4) .boxed() .collect(Collectors.toList()); assertNotNull(actual); assertFalse(actual.isEmpty()); assertEquals(expected, actual); }</code><technical_language>Arrays.asList(...) for short lists</technical_language>

Target:
public void shouldConcatenateOneEmptyAndOneNonEmptyLists() { final List<Integer> list = Collections.unmodifiableList( Arrays.asList(0, 1, 2, 3, 4) ); final List<Integer> actual = ListOps.concat(list, EMPTY_LIST); final List<Integer> expected = Arrays.asList(0, 1, 2, 3, 4); assertNotNull(actual); assertFalse(actual.isEmpty()); assertEquals(expected, actual); }