auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected SPMAsyncTask concreteCreateTask (AsyncTaskCreationInfo asyncTaskCreationInfo, VdcActionType parentCommand) { VdcActionParametersBase parametersForTask = getParametersForTask(parentCommand, getParameters()); if (parametersForTask.getParametersCurrentUser() == null && getCurrentUser() != null) { parametersForTask.setParametersCurrentUser(getCurrentUser()); } AsyncTaskParameters p = new AsyncTaskParameters(asyncTaskCreationInfo, new AsyncTasks(parentCommand, AsyncTaskResultEnum.success, AsyncTaskStatusEnum.running, asyncTaskCreationInfo.getTaskID(), <START> parametersForTask, <END> getParameters(), asyncTaskCreationInfo.getStepId(), getCommandId(),asyncTaskCreationInfo.getStoragePoolID(), asyncTaskCreationInfo.getTaskType())); p.setEntityId(getParameters().getEntityId()); return AsyncTaskManager.getInstance().CreateTask(internalGetTaskType(), p); }</code><technical_language>I CTOR of AsyncTasks param names is misleading - CTOR parameters of parameters: action, task while order is "parametersForTask", "getParameters" - is correct</technical_language>

Target:
protected SPMAsyncTask concreteCreateTask (AsyncTaskCreationInfo asyncTaskCreationInfo, VdcActionType parentCommand) { VdcActionParametersBase parentParameters = getParametersForTask(parentCommand, getParameters()); if (parentParameters.getParametersCurrentUser() == null && getCurrentUser() != null) { parentParameters.setParametersCurrentUser(getCurrentUser()); } AsyncTaskParameters p = new AsyncTaskParameters(asyncTaskCreationInfo, new AsyncTasks(parentCommand, AsyncTaskResultEnum.success, AsyncTaskStatusEnum.running, asyncTaskCreationInfo.getTaskID(), parentParameters, getParameters(), asyncTaskCreationInfo.getStepId(), getCommandId(),asyncTaskCreationInfo.getStoragePoolID(), asyncTaskCreationInfo.getTaskType())); p.setEntityId(getParameters().getEntityId()); return AsyncTaskManager.getInstance().CreateTask(internalGetTaskType(), p); }
Source:
<code>public void testK1UseCase() throws IOException { final Resource left = input.getK1Left(); final Resource origin = input.getK1Origin(); final Resource right = input.getK1Right(); final IComparisonScope scope = new DefaultComparisonScope(left, right, origin); final Comparison comparison = EMFCompare.builder().build().compare(scope); final List<Diff> differences = comparison.getDifferences(); final List<Conflict> conflicts = comparison.getConflicts(); assertEquals(6, differences.size()); assertEquals(2, conflicts.size()); Iterable<Conflict> realConflicts = Iterables.filter(conflicts, containsConflictOfTypes(REAL)); Iterable<Conflict> pseudoConflicts = Iterables.filter(conflicts, containsConflictOfTypes(PSEUDO)); <START> assertEquals(1, Iterables.size(realConflicts)); <END> assertEquals(1, Iterables.size(pseudoConflicts)); }</code><technical_language>Please static imports for Iterables.size, filter, (readability)</technical_language>

Target:
public void testK1UseCase() throws IOException { final Resource left = input.getK1Left(); final Resource origin = input.getK1Origin(); final Resource right = input.getK1Right(); final IComparisonScope scope = new DefaultComparisonScope(left, right, origin); final Comparison comparison = EMFCompare.builder().build().compare(scope); final List<Diff> differences = comparison.getDifferences(); final List<Conflict> conflicts = comparison.getConflicts(); assertEquals(6, differences.size()); assertEquals(2, conflicts.size()); Iterable<Conflict> realConflicts = filter(conflicts, containsConflictOfTypes(REAL)); Iterable<Conflict> pseudoConflicts = filter(conflicts, containsConflictOfTypes(PSEUDO)); assertEquals(1, size(realConflicts)); assertEquals(1, size(pseudoConflicts)); }
Source:
<code>public void sweepDeletesAllButLatestWithSingleDeleteAllTimestamps() { long numWrites = 1000L; for (long i = 1; i <= numWrites; i++) { sweepQueue.enqueue(writeToDefaultCell(TABLE_CONSERVATIVE, i), i); } sweepQueue.sweepNextBatch(ShardAndStrategy.conservative(CONS_SHARD)); assertSentinel(TABLE_CONSERVATIVE, numWrites); assertValue(TABLE_CONSERVATIVE, numWrites + 1, numWrites); <START> verify(kvs).deleteAllTimestamps(eq(TABLE_CONSERVATIVE), anyMap()); <END> }</code><technical_language>Do want add times(1) (or a once()) explicitly</technical_language>

Target:
public void sweepDeletesAllButLatestWithSingleDeleteAllTimestamps() { long numWrites = 1000L; for (long i = 1; i <= numWrites; i++) { enqueueWrite(TABLE_CONSERVATIVE, i); } sweepQueue.sweepNextBatch(ShardAndStrategy.conservative(CONS_SHARD)); assertReadAtTimestampReturnsSentinel(TABLE_CONSERVATIVE, numWrites); assertReadAtTimestampReturnsValue(TABLE_CONSERVATIVE, numWrites + 1, numWrites); verify(kvs, times(1)).deleteAllTimestamps(eq(TABLE_CONSERVATIVE), anyMap()); }
Source:
<code>public void in_stringNotNull() { populateNoPrimaryKeyNullTypesRows(); try { realm.where(NoPrimaryKeyNullTypes.class).in(NoPrimaryKeyNullTypes.FIELD_STRING_NOT_NULL, (String[]) null).findAll(); fail(); } catch (IllegalArgumentException ignored) { } try { realm.where(NoPrimaryKeyNullTypes.class).in(NoPrimaryKeyNullTypes.FIELD_STRING_NOT_NULL, new String[]{}).findAll(); fail(); } catch (IllegalArgumentException ignored) { } RealmResults<NoPrimaryKeyNullTypes> resultList = realm.where(NoPrimaryKeyNullTypes.class).in(NoPrimaryKeyNullTypes.FIELD_STRING_NOT_NULL, new String[]{"test data 14"}).findAll(); assertEquals(1, resultList.size()); resultList = realm.where(NoPrimaryKeyNullTypes.class).in(NoPrimaryKeyNullTypes.FIELD_STRING_NOT_NULL, new String[]{"test data 14", "test data 118", "test data 31", "test data 199"}).findAll(); assertEquals(4, resultList.size()); resultList = realm.where(NoPrimaryKeyNullTypes.class).in(NoPrimaryKeyNullTypes.FIELD_STRING_NOT_NULL, new String[]{"TEST data 14", "test data 118", "test data 31", "test DATA 199"}, Case.INSENSITIVE).findAll(); assertEquals(4, resultList.size()); resultList = realm.where(NoPrimaryKeyNullTypes.class).not().in(NoPrimaryKeyNullTypes.FIELD_STRING_NOT_NULL, new String[]{"TEST data 14", "test data 118", "test data 31", "test DATA 199"}, Case.INSENSITIVE).findAll(); assertEquals(196, resultList.size()); resultList = realm.where(NoPrimaryKeyNullTypes.class).not().in(NoPrimaryKeyNullTypes.FIELD_STRING_NOT_NULL, new String[]{"TEST data 14", "test data 118", "test data 31", "test DATA 199"}, Case.INSENSITIVE).findAll(); assertEquals(196, resultList.size( <START> <END> )); try { realm.where(NoPrimaryKeyNullTypes.class).not().in(NoPrimaryKeyNullTypes.FIELD_STRING_NOT_NULL, new String[]{"TEST data 14", "test data 118", null, "test DATA 199"}, Case.INSENSITIVE).findAll(); fail(); } catch (IllegalArgumentException ignored) { } }</code><technical_language>Please remove empty lines</technical_language>

Target:
public void in_stringNotNull() { doTestForInString(NoPrimaryKeyNullTypes.FIELD_STRING_NOT_NULL); try { realm.where(NoPrimaryKeyNullTypes.class).not().in(NoPrimaryKeyNullTypes.FIELD_STRING_NOT_NULL, new String[]{"TEST data 14", "test data 118", null, "test DATA 199"}, Case.INSENSITIVE).findAll(); fail(); } catch (IllegalArgumentException ignored) { } }
Source:
<code>public WorkunitInfo getWUInfo(String wuid, boolean unarchive) throws Exception { WorkunitInfo workunit = null; if (wsWorkunitsServiceSoapProxy == null) throw new Exception("wsWorkunitsServiceSoapProxy not available"); else { WUInfoRequestWrapper wuinfodetailsparams = new WUInfoRequestWrapper(); wuinfodetailsparams.setIncludeApplicationValues(false); wuinfodetailsparams.setIncludeDebugValues(false); wuinfodetailsparams.setIncludeExceptions(true); wuinfodetailsparams.setIncludeGraphs(false); wuinfodetailsparams.setIncludeResults(true); wuinfodetailsparams.setWuid(wuid); WUInfoResponseWrapper wuInfoResponse = soapWrapper.WUInfo(wuinfodetailsparams); <START> <END> ArrayOfEspException exceptions = wuInfoResponse.getRawArrayOfEspExceptions(); if (exceptions == null && wuInfoResponse.getWorkunit() != null) { if (unarchive && wuInfoResponse.getWorkunit().getArchived()) { doWorkunitAction(wuid, ECLWUActions.Restore); return getWUInfo(wuid); } workunit = wuInfoResponse.getWorkunit(); workunit.setOriginalEclWatchUrl(getEclWatchUrl()); } else { throwWsWUExceptions(exceptions, "Could not fetch WU Info"); } } return workunit; }</code><technical_language>Minor, remove extra white spaces</technical_language>

Target:
public WorkunitInfo getWUInfo(String wuid, boolean unarchive) throws Exception { WorkunitInfo workunit = null; getSoapProxy(); WUInfoRequestWrapper wuinfodetailsparams = new WUInfoRequestWrapper(); wuinfodetailsparams.setIncludeApplicationValues(false); wuinfodetailsparams.setIncludeDebugValues(false); wuinfodetailsparams.setIncludeExceptions(true); wuinfodetailsparams.setIncludeGraphs(false); wuinfodetailsparams.setIncludeResults(true); wuinfodetailsparams.setWuid(wuid); WUInfoResponseWrapper wuInfoResponse = soapWrapper.WUInfo(wuinfodetailsparams); ArrayOfEspException exceptions = wuInfoResponse.getRawArrayOfEspExceptions(); if (exceptions == null && wuInfoResponse.getWorkunit() != null) { if (unarchive && wuInfoResponse.getWorkunit().getArchived()) { doWorkunitAction(wuid, ECLWUActions.Restore); return getWUInfo(wuid); } workunit = wuInfoResponse.getWorkunit(); workunit.setOriginalEclWatchUrl(getEclWatchUrl()); } else { throwWsWUExceptions(exceptions, "Could not fetch WU Info"); } return workunit; }
Source:
<code>public void setLinkForeground (Color color) { checkWidget(); <START> if (color != null && color.isDisposed ()) error(SWT.ERROR_INVALID_ARGUMENT); <END> linkColor = color; if (getEnabled()) { styleLinkParts(); redraw(); } }</code><technical_language>Please add a check simply return if color set is current foreground color (linkColor)</technical_language>

Target:
public void setLinkForeground (Color color) { checkWidget(); if (color != null) { if (color.isDisposed ()) error(SWT.ERROR_INVALID_ARGUMENT); if (color.equals(linkColor)) return; } else if (linkColor == null) return; linkColor = color; if (getEnabled()) { styleLinkParts(); redraw(); } }
Source:
<code>public List<LambdaEvent> getLambdaEventsByOrganization(@ApiParam(hidden = true) @Parameter(hidden = true, name = "user", in = ParameterIn.HEADER) @Auth User user, @ApiParam(value = "organization", required = true) @PathParam("organization") String organization, @ApiParam(value = PAGINATION_OFFSET_TEXT) @QueryParam("offset") @DefaultValue("0") String offset, @ApiParam(value = PAGINATION_LIMIT_TEXT, allowableValues = "range[1,100]", defaultValue = PAGINATION_LIMIT) @DefaultValue(PAGINATION_LIMIT) @QueryParam("limit") Integer limit) { List<Workflow> workflows = workflowDAO.findMyEntries(user.getId()); boolean canAccessOrganization = workflows.stream().anyMatch(workflow -> Objects.equals(workflow.getOrganization(), organization) && Objects.equals(workflow.getSourceControl(), SourceControl.GITHUB)); if (!canAccessOrganization) { <START> throw new CustomWebApplicationException("You do not have access to the GitHub organization '" + organization + "'", HttpStatus.SC_BAD_REQUEST); <END> } return lambdaEventDAO.findByOrganization(organization, offset, limit); }</code><technical_language>401 status code, 400</technical_language>

Target:
public List<LambdaEvent> getLambdaEventsByOrganization(@ApiParam(hidden = true) @Parameter(hidden = true, name = "user", in = ParameterIn.HEADER) @Auth User user, @ApiParam(value = "organization", required = true) @PathParam("organization") String organization, @ApiParam(value = PAGINATION_OFFSET_TEXT) @QueryParam("offset") @DefaultValue("0") String offset, @ApiParam(value = PAGINATION_LIMIT_TEXT, allowableValues = "range[1,100]", defaultValue = PAGINATION_LIMIT) @DefaultValue(PAGINATION_LIMIT) @QueryParam("limit") Integer limit) { User authUser = userDAO.findById(user.getId()); List<Token> githubToken = tokenDAO.findGithubByUserId(authUser.getId()); if (githubToken.size() == 0) { throw new CustomWebApplicationException("You do not have GitHub connected to your account.", HttpStatus.SC_BAD_REQUEST); } GitHubSourceCodeRepo sourceCodeRepoInterface = (GitHubSourceCodeRepo)SourceCodeRepoFactory.createSourceCodeRepo(githubToken.get(0), client); Set<String> organizations = sourceCodeRepoInterface.getMyOrganizations(); if (!organizations.contains(organization)) { throw new CustomWebApplicationException("You do not have access to the GitHub organization '" + organization + "'", HttpStatus.SC_UNAUTHORIZED); } return lambdaEventDAO.findByOrganization(organization, offset, limit); }
Source:
<code>static TransactionManager createTransactionManager(TestableTimelockCluster cluster) { List<String> serverUris = cluster.servers().stream() .map(server -> server.serverHolder().getTimelockUri()) <START> .collect(Collectors.toList()); <END> AtlasDbConfig config = ImmutableAtlasDbConfig.builder() .namespace(AGENT) .keyValueService(new InMemoryAtlasDbConfig()) .timelock(ImmutableTimeLockClientConfig.builder() .serversList(ImmutableServerListConfig.builder() .servers(serverUris) .sslConfiguration(SslConfiguration.of(Paths.get("var/security/trustStore.jks"))) .build()) .build()) .build(); return TransactionManagers.builder() .config(config) .userAgent(AGENT) .globalMetricsRegistry(new MetricRegistry()) .globalTaggedMetricRegistry(DefaultTaggedMetricRegistry.getDefault()) .build() .serializable(); }</code><technical_language>ha, agent smith ;)</technical_language>

Target:
static TransactionManager createTransactionManager(TestableTimelockCluster cluster) { return createTransactionManager(cluster, UUID.randomUUID().toString()); }
Source:
<code>public S3RecordReader createRecordReader() { S3RecordReader s3RecordReader = new S3RecordReader(); s3RecordReader.setBucketName(S3BlockReader.extractBucket(getFiles())); s3RecordReader.setAccessKey(S3BlockReader.extractAccessKey(getFiles())); s3RecordReader.setSecretAccessKey(S3BlockReader.extractSecretAccessKey(getFiles())); <START> s3RecordReader.setEndPoint(s3EndPoint); <END> s3RecordReader.setMode(this.getMode()); s3RecordReader.setRecordLength(this.getRecordLength()); if (overflowBlockSize != 0) { s3RecordReader.setOverflowBufferSize(overflowBlockSize); ; } return s3RecordReader; }</code><technical_language>s3EndPoint is optional. setting, please check this is null not</technical_language>

Target:
public S3RecordReader createRecordReader() { S3RecordReader s3RecordReader = new S3RecordReader(); s3RecordReader.setBucketName(S3BlockReader.extractBucket(getFiles())); s3RecordReader.setAccessKey(S3BlockReader.extractAccessKey(getFiles())); s3RecordReader.setSecretAccessKey(S3BlockReader.extractSecretAccessKey(getFiles())); s3RecordReader.setEndPoint(s3EndPoint); s3RecordReader.setMode(this.getMode()); s3RecordReader.setRecordLength(this.getRecordLength()); if (overflowBlockSize != 0) { s3RecordReader.setOverflowBufferSize(overflowBlockSize); } return s3RecordReader; }
Source:
<code>public PartitionState getPartitionState() { long currentSealedStateChangeCounter = clusterManagerCallback.getSealedStateChangeCounter(); if (currentSealedStateChangeCounter > lastUpdatedSealedStateChangeCounter.get()) { lastUpdatedSealedStateChangeCounter.set(currentSealedStateChangeCounter); boolean isSealed = false; for (AmbryReplica replica : clusterManagerCallback.getReplicaIdsForPartition(this)) { if (replica.isSealed()) { isSealed = true; break; } } <START> state = isSealed ? PartitionState.READ_ONLY : PartitionState.READ_WRITE; <END> } return state; }</code><technical_language>this concurrency problems hold stale state for a long time - need some concurrency control</technical_language>

Target:
public PartitionState getPartitionState() { long currentCounterValue = clusterManagerCallback.getSealedStateChangeCounter(); if (currentCounterValue > lastUpdatedSealedStateChangeCounter && stateChangeLock.tryLock()) { try { lastUpdatedSealedStateChangeCounter = currentCounterValue; boolean isSealed = false; for (AmbryReplica replica : clusterManagerCallback.getReplicaIdsForPartition(this)) { if (replica.isSealed()) { isSealed = true; break; } } state = isSealed ? PartitionState.READ_ONLY : PartitionState.READ_WRITE; } finally { stateChangeLock.unlock(); } } return state; }
Source:
<code>public void onNext(final AllocatedEvaluator allocatedEvaluator) { final int number = numAllocatedEvaluators.getAndIncrement(); final Configuration taskConf; final String taskId; final String endPointId; final Configuration iterationConf = Tang.Factory.getTang().newConfigurationBuilder() .bindNamedParameter(MessageExchangeParameters.TotalIterationNum.class, Integer.toString(numTotalIterations)) .build(); if (number < totalNumSenders) { endPointId = SENDER_PREFIX + number; <START> taskId = endPointId + "-TASK"; <END> taskConf = Configurations.merge(TaskConfiguration.CONF .set(TaskConfiguration.IDENTIFIER, taskId) .set(TaskConfiguration.TASK, SenderTask.class) .build(), iterationConf); } else if (number < totalNumSenders + totalNumReceivers) { endPointId = RECEIVER_PREFIX + (number - totalNumSenders); taskId = endPointId + "-TASK"; taskConf = Configurations.merge(TaskConfiguration.CONF .set(TaskConfiguration.IDENTIFIER, taskId) .set(TaskConfiguration.TASK, ReceiverTask.class) .build(), iterationConf); } else { throw new RuntimeException("Too many allocated evaluators"); } allocatedEvaluator.submitContextAndServiceAndTask( getContextConfiguration(endPointId), getServiceConfiguration(), taskConf ); }</code><technical_language>a variable TASK_POSTFIX that</technical_language>

Target:
public void onNext(final AllocatedEvaluator allocatedEvaluator) { final int number = numAllocatedEvaluators.getAndIncrement(); final Configuration taskConf; final String taskId; final String endPointId; final Configuration iterationConf = Tang.Factory.getTang().newConfigurationBuilder() .bindNamedParameter(MessageExchangeParameters.TotalIterationNum.class, Integer.toString(numTotalIterations)) .build(); if (number < totalNumSenders) { endPointId = SENDER_PREFIX + number; taskId = endPointId + TASK_POSTFIX; taskConf = Configurations.merge(TaskConfiguration.CONF .set(TaskConfiguration.IDENTIFIER, taskId) .set(TaskConfiguration.TASK, SenderTask.class) .build(), iterationConf); } else if (number < totalNumSenders + totalNumReceivers) { endPointId = RECEIVER_PREFIX + (number - totalNumSenders); taskId = endPointId + TASK_POSTFIX; taskConf = Configurations.merge(TaskConfiguration.CONF .set(TaskConfiguration.IDENTIFIER, taskId) .set(TaskConfiguration.TASK, ReceiverTask.class) .build(), iterationConf); } else { throw new RuntimeException("Too many allocated evaluators"); } allocatedEvaluator.submitContextAndServiceAndTask( getContextConfiguration(endPointId), getServiceConfiguration(), taskConf ); }
Source:
<code>public void unknownUserID() throws Exception { this.exception.expect(AuthenticationException.class); this.exception <START> .expectMessage(containsString("You have not supplied an unknown user ID.")); <END> this.client.country(InetAddress.getByName("2.2.3.1")); }</code><technical_language>I number of negations is here</technical_language>

Target:
public void unknownUserID() throws Exception { this.exception.expect(AuthenticationException.class); this.exception .expectMessage(containsString("You have supplied an unknown user ID.")); this.client.country(InetAddress.getByName("2.2.3.1")); }
Source:
<code>public void testToXml() throws OseeCoreException { ITestUnitStore testUnitStore = new MockTestUnitStore(); TestUnitCache tc = new TestUnitCache(testUnitStore); HashMap<Integer, String> entries = new HashMap<Integer, String>(); for (int i = 0; i < 10; i++) { entries.put(i, "test" + Integer.toString(i)); tc.put(testUnitStore.getNextTestUnitId(), "test" + Integer.toString(i)); } CoverageItem ci = createCoverageItem(tc); tc.addTestUnit(ci, "test2"); tc.addTestUnit(ci, "test1"); tc.addTestUnit(ci, "test10"); String expected = "1;2;10"; String actual = tc.toXml(ci); Assert.assertTrue(expected.equals(actual)); <START> } <END></code><technical_language>assertEquals instead</technical_language>

Target:
public void testToXml() throws OseeCoreException { HashMap<Integer, String> entries = new HashMap<Integer, String>(); for (int i = 0; i < 10; i++) { entries.put(i, "test" + Integer.toString(i)); tc.put(testUnitStore.getNextTestUnitId(), "test" + Integer.toString(i)); } CoverageItem ci = createCoverageItem(tc); tc.addTestUnit(ci, "test2"); tc.addTestUnit(ci, "test1"); tc.addTestUnit(ci, "test10"); String expected = "1;2;10"; String actual = tc.toXml(ci); Assert.assertEquals(expected, actual); }
Source:
<code>protected void buildVmVideoCards() { createInfo.add(VdsProperties.display, vm.getdisplay_type().toString()); createInfo.add(VdsProperties.num_of_monitors, <START> (new Integer(vm.getnum_of_monitors())).toString()); <END> }</code><technical_language>String.valueOf(vm.getnum_of_monitors()) instead</technical_language>

Target:
protected void buildVmVideoCards() { createInfo.add(VdsProperties.display, vm.getdisplay_type().toString()); createInfo.add(VdsProperties.num_of_monitors, String.valueOf(vm.getnum_of_monitors())); }
Source:
<code>public PalantirContent setAndVerifyPlayerPosition(double lat, double lng, double zoom, boolean centerMap) { waitForElementVisibleByElement(mapFrame); driver.switchTo().activeElement(); JavascriptExecutor jsexec = (JavascriptExecutor) driver; driver.manage().timeouts().setScriptTimeout(20, TimeUnit.SECONDS); Object res = jsexec.executeAsyncScript( PalantirContent.PONTO_SETPLAYER, lat, lng, zoom, centerMap ); PalantirContent handle = new PalantirContent(); <START> try { <END> JSONObject json = new JSONObject(res.toString()); handle.success = json.getString(PalantirContent.PONTO_MSG_SUCCESS); handle.responseCode = json.getString(PalantirContent.PONTO_MSG_RESPONSECODE); handle.message = json.getString(PalantirContent.PONTO_MSG_MESSAGE); PageObjectLogging.log( "setAndVerifyPlayerPosition", handle.message, true, driver ); }catch (JSONException e) { PageObjectLogging.log( "setAndVerifyPlayerPosition", "Position was not set", false, driver ); } return handle; }</code><technical_language>Consider adding additional layer of abstraction for this block. This similar lines other methods</technical_language>

Target:
public PalantirContent setAndVerifyPlayerPosition(double lat, double lng, double zoom, boolean centerMap) { waitForElementVisibleByElement(mapFrame); JavascriptExecutor jsexec = (JavascriptExecutor) driver; driver.manage().timeouts().setScriptTimeout(20, TimeUnit.SECONDS); Object res = jsexec.executeAsyncScript( PalantirContent.PONTO_SETPLAYER, lat, lng, zoom, centerMap ); return getResponse(res, "setAndVerifyPlayerPosition"); }
Source:
<code>if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 0)) { if (OS.WIN32_VERSION < OS.VERSION(10, 0)){ OS.SetProcessDPIAware(); } else { long hResult = <START> OS.SetProcessDpiAwareness(2); <END> if (hResult == SWT.E_ACCESSDENIED) System.out.println("The DPI awareness is already set.."); } }</code><technical_language>constants <LINK_0></technical_language>

Target:
if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 0)) { { long hResult1; int[] value1 = new int[1]; hResult1 = OS.GetProcessDpiAwareness(-1, value1); DPIUtil.BEFORE = value1[0]; int value = 2; long hResult = OS.SetProcessDpiAwareness(value); DPIUtil.RESULT = hResult; int[] value2 = new int[1]; hResult1 = OS.GetProcessDpiAwareness(-1, value2); DPIUtil.AFTER = value2[0]; if (hResult == SWT.E_ACCESSDENIED) System.out.println("The DPI awareness is already set.."); else System.err.println("hResult: " + hResult); } }
Source:
<code>public AmbientOcclusionNode(Context context) { <START> displayResolutionDependentFBOs = context.get(DisplayResolutionDependentFBOs.class); <END> RenderingConfig renderingConfig = context.get(Config.class).getRendering(); renderingConfig.subscribe(RenderingConfig.SSAO, this); requiresCondition(renderingConfig::isSsao); addDesiredStateChange(new EnableMaterial(SSAO_MATERIAL)); ssaoMaterial = getMaterial(SSAO_MATERIAL); requiresFBO(new FBOConfig(SSAO_FBO, FULL_SCALE, FBO.Type.DEFAULT), displayResolutionDependentFBOs); addDesiredStateChange(new BindFBO(SSAO_FBO, displayResolutionDependentFBOs)); addDesiredStateChange(new SetViewportToSizeOf(SSAO_FBO, displayResolutionDependentFBOs)); update(); displayResolutionDependentFBOs.subscribe(this); }</code><technical_language>move this line below, requiresFBO line</technical_language>

Target:
public AmbientOcclusionNode(Context context) { super(context); RenderingConfig renderingConfig = context.get(Config.class).getRendering(); renderingConfig.subscribe(RenderingConfig.SSAO, this); requiresCondition(renderingConfig::isSsao); addDesiredStateChange(new EnableMaterial(SSAO_MATERIAL)); ssaoMaterial = getMaterial(SSAO_MATERIAL); displayResolutionDependentFBOs = context.get(DisplayResolutionDependentFBOs.class); requiresFBO(new FBOConfig(SSAO_FBO, FULL_SCALE, FBO.Type.DEFAULT), displayResolutionDependentFBOs); addDesiredStateChange(new BindFBO(SSAO_FBO, displayResolutionDependentFBOs)); addDesiredStateChange(new SetViewportToSizeOf(SSAO_FBO, displayResolutionDependentFBOs)); update(); displayResolutionDependentFBOs.subscribe(this); }
Source:
<code>private static Boolean getBooleanValue(String value) { <START> return !Strings.isNullOrEmpty(value); <END> }</code><technical_language>This return true if is "no". this changed</technical_language>

Target:
private static Boolean getBooleanValue(String value) { if (value != null) { return value.equalsIgnoreCase(YES); } return null; }
Source:
<code>protected FenceOperationResult changeStatus(FenceActionType fenceAction) { FenceAgentExecutor agentExecutor = createAgentExecutor(); FenceOperationResult statusResult = null; int fenceRetries = -1; do { FenceOperationResult result = agentExecutor.fence(fenceAction, fenceAgent); if (result.getStatus() == Status.SKIPPED_ALREADY_IN_STATUS) { return new FenceOperationResult( <START> Status.SKIPPED_ALREADY_IN_STATUS, <END> fenceAction == FenceActionType.START ? PowerStatus.ON : PowerStatus.OFF); } else if (result.getStatus() == Status.SKIPPED_DUE_TO_POLICY) { return result; } if (result.getStatus() == Status.SUCCESS) { statusResult = waitForStatus(fenceAction); if (isRequestedStatusAchieved(statusResult)) { return statusResult; } } fenceRetries++; } while (fenceRetries < allowedFenceActionRetries); return new FenceOperationResult( Status.ERROR, statusResult == null ? PowerStatus.UNKNOWN : statusResult.getPowerStatus(), "Allowed retries to verify host power status exceeded"); }</code><technical_language>afraid this change require a change in <LINK_0></technical_language>

Target:
protected FenceOperationResult changeStatus(FenceActionType fenceAction) { FenceAgentExecutor agentExecutor = createAgentExecutor(); FenceOperationResult statusResult = null; int fenceRetries = -1; do { FenceOperationResult result = agentExecutor.fence(fenceAction, fenceAgent); if (result.getStatus() == Status.SKIPPED_ALREADY_IN_STATUS) { return new FenceOperationResult( Status.SUCCESS, fenceAction == FenceActionType.START ? PowerStatus.ON : PowerStatus.OFF); } else if (result.getStatus() == Status.SKIPPED_DUE_TO_POLICY) { return result; } if (result.getStatus() == Status.SUCCESS) { statusResult = waitForStatus(fenceAction); if (isRequestedStatusAchieved(statusResult)) { return statusResult; } } fenceRetries++; } while (fenceRetries < allowedFenceActionRetries); return new FenceOperationResult( Status.ERROR, statusResult == null ? PowerStatus.UNKNOWN : statusResult.getPowerStatus(), "Allowed retries to verify host power status exceeded"); }
Source:
<code>protected void reportError(String message, Exception ex, Object... args) { if (ex == null) { <START> Activator.getDefault().getReportService().report(new AbstractReport(message, args)); <END> } else { Activator.getDefault().getReportService().report(new AbstractReport(ex, message, args)); } showErrorMessageDialog(message); }</code><technical_language>retrieve report service in instantiate method</technical_language>

Target:
protected void reportError(String message, Exception ex, Object... args) { if (ex == null) { reportService.report(new AbstractReport(message, args)); } else { reportService.report(new AbstractReport(ex, message, args)); } showErrorMessageDialog(message); }
Source:
<code>public static Map<Item, Integer> getBurnTimes() { <START> return burnTimes != null ? burnTimes : (burnTimes = Maps.newLinkedHashMap()); <END> }</code><technical_language>real reason linkedhashmap</technical_language>

Target:
private static Map<Item, Integer> getBurnTimes() { return burnTimes != null ? burnTimes : (burnTimes = Collections.unmodifiableMap(TileEntityFurnace.getBurnTimes())); }
Source:
<code>public void openItemByPath(String path) { Actions action = actionsFactory.createAction(seleniumWebDriver); waitItem(path); selectItem(path); waitItemIsSelected(path); try { getProjectExplorerItem(path).click(); waitItemIsSelected(path); action.moveToElement(getProjectExplorerItem(path)).perform(); action.doubleClick().perform(); } catch (StaleElementReferenceException ex) { <START> LOG.error(ex.getLocalizedMessage(), ex); <END> clickOnRefreshTreeButton(); waitItem(path); getProjectExplorerItem(path).click(); waitItemIsSelected(path); action.moveToElement(getProjectExplorerItem(path)).perform(); action.doubleClick().perform(); } loader.waitOnClosed(); }</code><technical_language>IMHO log exception warn() interrupt execution of tests</technical_language>

Target:
public void openItemByPath(String path) { Actions action = actionsFactory.createAction(seleniumWebDriver); waitItem(path); selectItem(path); waitItemIsSelected(path); try { getProjectExplorerItem(path).click(); waitItemIsSelected(path); action.moveToElement(getProjectExplorerItem(path)).perform(); action.doubleClick().perform(); } catch (StaleElementReferenceException ex) { LOG.warn(ex.getLocalizedMessage(), ex); clickOnRefreshTreeButton(); waitItem(path); getProjectExplorerItem(path).click(); waitItemIsSelected(path); action.moveToElement(getProjectExplorerItem(path)).perform(); action.doubleClick().perform(); } loader.waitOnClosed(); }
Source:
<code>protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException { <START> String fullName = aliases.getOrDefault(name, name); <END> PluginClassLoader pluginLoader = pluginClassLoader(fullName); if (pluginLoader != null) { log.trace("Retrieving loaded class '{}' from '{}'", fullName, pluginLoader); ClassLoader oldClassloader = Plugins.compareAndSwapLoaders(pluginLoader); try { Class<?> clazz = pluginLoader.loadClass(fullName, resolve); Plugins.compareAndSwapLoaders(oldClassloader); return clazz; } catch (Throwable t) { Plugins.compareAndSwapLoaders(oldClassloader); throw t; } } return super.loadClass(fullName, resolve); }</code><technical_language>break in 0.11.0.4</technical_language>

Target:
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException { String fullName = aliases.containsKey(name) ? aliases.get(name) : name; PluginClassLoader pluginLoader = pluginClassLoader(fullName); if (pluginLoader != null) { log.trace("Retrieving loaded class '{}' from '{}'", fullName, pluginLoader); return pluginLoader.loadClass(fullName, resolve); } return super.loadClass(fullName, resolve); }
Source:
<code><START> public static JoystickControl getJoystickButtonFromControllerButton(ControllerButton controllerButton) { <END> switch (controllerButton) { case A: return JoystickControl.A; case B: return JoystickControl.B; case X: return JoystickControl.X; case Y: return JoystickControl.Y; case BACK: return JoystickControl.BACK; case GUIDE: return JoystickControl.GUIDE; case START: return JoystickControl.START; case LEFTSTICK: return JoystickControl.LEFT_STICK; case RIGHTSTICK: return JoystickControl.RIGHT_STICK; case LEFTBUMPER: return JoystickControl.LEFT_BUMPER; case RIGHTBUMPER: return JoystickControl.RIGHT_BUMPER; case DPAD_UP: return JoystickControl.DPAD_UP; case DPAD_DOWN: return JoystickControl.DPAD_DOWN; case DPAD_LEFT: return JoystickControl.DPAD_LEFT; case DPAD_RIGHT: return JoystickControl.DPAD_RIGHT; default: throw new IllegalArgumentException("Unknown button type: " + controllerButton); } }</code><technical_language>a confused ControllerButton JoystickControl, needed</technical_language>

Target:
public static JoystickControl getJoystickButtonFromControllerButton(ControllerButton controllerButton) { switch (controllerButton) { case A: return JoystickControl.A; case B: return JoystickControl.B; case X: return JoystickControl.X; case Y: return JoystickControl.Y; case BACK: return JoystickControl.BACK; case GUIDE: return JoystickControl.SELECT; case START: return JoystickControl.START; case LEFTSTICK: return JoystickControl.L3; case RIGHTSTICK: return JoystickControl.R3; case LEFTBUMPER: return JoystickControl.L; case RIGHTBUMPER: return JoystickControl.R; case DPAD_UP: return JoystickControl.DPAD_UP; case DPAD_DOWN: return JoystickControl.DPAD_DOWN; case DPAD_LEFT: return JoystickControl.DPAD_LEFT; case DPAD_RIGHT: return JoystickControl.DPAD_RIGHT; default: throw new IllegalArgumentException("Unknown button type: " + controllerButton); } }
Source:
<code>protected void parseTransformer(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { String jsonSerializer = element.getAttribute("json-serializer"); if (StringUtils.hasText(jsonSerializer)) { builder.addConstructorArgReference(jsonSerializer); } <START> if (element.hasAttribute("content-type")){ <END> builder.addPropertyValue("contentType", element.getAttribute("content-type")); } }</code><technical_language>change constant a literal here</technical_language>

Target:
protected void parseTransformer(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { String objectMapper = element.getAttribute("object-mapper"); if (StringUtils.hasText(objectMapper)) { builder.addConstructorArgReference(objectMapper); } if (element.hasAttribute("content-type")){ builder.addPropertyValue("contentType", element.getAttribute("content-type")); } }
Source:
<code>public void setLogLikelihoods(final double[] ll) { ValidationUtils.validateArg(ll.length == NUM_GENOTYPES, () -> "logLikelihood must have length 3, found " + ll.length); double max = MathUtil.max(ll); <START> final double[] maxRemoved = MathUtil.sum(ll, -max); <END> double sum = MathUtil.sum(MathUtil.getProbabilityFromLog(maxRemoved)); System.arraycopy(MathUtil.sum(maxRemoved, -Math.log10(sum)), 0, loglikelihoods, 0, NUM_GENOTYPES); likelihoodsNeedUpdating = true; updateDependentValues(); }</code><technical_language>This operation is done in CappedHaplotypeProbabilities, sense a method for in MathUtil</technical_language>

Target:
public void setLogLikelihoods(final double[] ll) { ValidationUtils.validateArg(ll.length == NUM_GENOTYPES, () -> String.format("logLikelihood must have length %d, found %d", NUM_GENOTYPES, ll.length)); final double[] maxRemoved = MathUtil.subtractMax(ll); double sum = MathUtil.sum(MathUtil.getProbabilityFromLog(maxRemoved)); System.arraycopy(MathUtil.sum(maxRemoved, -Math.log10(sum)), 0, loglikelihoods, 0, NUM_GENOTYPES); likelihoodsNeedUpdating = true; updateDependentValues(); }
Source:
<code><START> private void updateGpuEnabledHostsDetails(List<HostVO> hosts) { <END> List<HostVO> gpuEnabledHosts = new ArrayList<HostVO>(); if (hostIds != null) { for (HostVO host : hosts) { if (hostIds.contains(host.getId())) { gpuEnabledHosts.add(host); } } } else { gpuEnabledHosts = hosts; } for (HostVO host : gpuEnabledHosts) { HashMap<String, HashMap<String, VgpuTypesInfo>> groupDetails = _resourceMgr.getGPUStatistics(host); if (groupDetails != null) { _resourceMgr.updateGPUDetails(host.getId(), groupDetails); } } hostIds = _hostGpuGroupsDao.listHostIds(); }</code><technical_language>This method is odd. load host ids GPUs thing? proceed execution? is weird execute once, load some state data, in execution, data (in this context, is making sense)</technical_language>

Target:
private void updateGpuEnabledHostsDetails(List<HostVO> hosts) { List<HostVO> gpuEnabledHosts = new ArrayList<HostVO>(); List<Long> hostIds = _hostGpuGroupsDao.listHostIds(); if (CollectionUtils.isEmpty(hostIds)) { return; } for (HostVO host : hosts) { if (hostIds.contains(host.getId())) { gpuEnabledHosts.add(host); } } for (HostVO host : gpuEnabledHosts) { HashMap<String, HashMap<String, VgpuTypesInfo>> groupDetails = _resourceMgr.getGPUStatistics(host); if (MapUtils.isEmpty(groupDetails)) { _resourceMgr.updateGPUDetails(host.getId(), groupDetails); } } }
Source:
<code>public SimpleSearcher(String indexDir, Analyzer analyzer) throws IOException { Path indexPath = Paths.get(indexDir); if (!Files.exists(indexPath) || !Files.isDirectory(indexPath) || !Files.isReadable(indexPath)) { throw new IllegalArgumentException(indexDir + " does not exist or is not a directory."); } this.reader = DirectoryReader.open(FSDirectory.open(indexPath)); this.similarity = new BM25Similarity(0.9f, 0.4f); this.analyzer = analyzer; this.searchtweets = false; this.isRerank = false; <START> cascade = new RerankerCascade("default"); <END> cascade.add(new ScoreTiesAdjusterReranker()); }</code><technical_language>above, default constructor</technical_language>

Target:
public SimpleSearcher(String indexDir, Analyzer analyzer) throws IOException { Path indexPath = Paths.get(indexDir); if (!Files.exists(indexPath) || !Files.isDirectory(indexPath) || !Files.isReadable(indexPath)) { throw new IllegalArgumentException(indexDir + " does not exist or is not a directory."); } this.reader = DirectoryReader.open(FSDirectory.open(indexPath)); this.similarity = new BM25Similarity(0.9f, 0.4f); this.analyzer = analyzer; this.searchtweets = false; this.isRerank = false; cascade = new RerankerCascade(); cascade.add(new ScoreTiesAdjusterReranker()); }
Source:
<code>public void prepareRun(BatchSourceContext context) throws Exception { Job job = JobUtils.createInstance(); Configuration conf = job.getConfiguration(); if (StringUtils.isNotEmpty(config.pattern)) { conf.set(XMLInputFormat.XML_INPUTFORMAT_PATTERN, config.pattern); } XMLInputFormat.addInputPaths(job, config.path); <START> conf.set(XMLInputFormat.XML_INPUTFORMAT_REPROCESSING_REQUIRED, this.config.reprocessingRequired); <END> setFileTrackingInfo(context, conf); if (StringUtils.isNotEmpty(this.config.actionAfterProcess)) { conf.set(XMLInputFormat.XML_INPUTFORMAT_FILE_ACTION, this.config.actionAfterProcess); } if (StringUtils.isNotEmpty(this.config.targetFolder)) { conf.set(XMLInputFormat.XML_INPUTFORMAT_TARGET_FOLDER, this.config.targetFolder); } conf.set(XMLInputFormat.XML_INPUTFORMAT_NODE_PATH, this.config.nodePath); conf.set(XMLInputFormat.XML_INPUT_NAME_CONFIG, config.path); XMLInputFormat.setInputPathFilter(job, BatchXMLFileFilter.class); context.setInput(Input.of(config.referenceName, new SourceInputFormatProvider(XMLInputFormat.class, conf))); }</code><technical_language>is this attribute conf? I usage of: java conf.get(XMLInputFormat.XML_INPUTFORMAT_REPROCESSING_REQUIRED);</technical_language>

Target:
public void prepareRun(BatchSourceContext context) throws Exception { Job job = JobUtils.createInstance(); Configuration conf = job.getConfiguration(); conf.set(XMLInputFormat.XML_INPUTFORMAT_PATH_NAME, config.path); conf.set(XMLInputFormat.XML_INPUTFORMAT_NODE_PATH, config.nodePath); if (StringUtils.isNotEmpty(config.pattern)) { conf.set(XMLInputFormat.XML_INPUTFORMAT_PATTERN, config.pattern); } conf.set(XMLInputFormat.XML_INPUTFORMAT_FILE_ACTION, config.actionAfterProcess); if (StringUtils.isNotEmpty(config.targetFolder)) { conf.set(XMLInputFormat.XML_INPUTFORMAT_TARGET_FOLDER, config.targetFolder); } setFileTrackingInfo(context, conf); fileSystem = FileSystem.get(conf); long startTime = context.getLogicalStartTime(); String tempDirectory = config.tableName + startTime; tempDirectoryPath = new Path(config.temporaryFolder, tempDirectory); fileSystem.mkdirs(tempDirectoryPath); fileSystem.deleteOnExit(tempDirectoryPath); conf.set(XMLInputFormat.XML_INPUTFORMAT_PROCESSED_DATA_TEMP_FOLDER, tempDirectoryPath.toUri().toString()); XMLInputFormat.setInputPathFilter(job, BatchXMLFileFilter.class); XMLInputFormat.addInputPath(job, new Path(config.path)); context.setInput(Input.of(config.referenceName, new SourceInputFormatProvider(XMLInputFormat.class, conf))); }
Source:
<code>public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } VdcParametersMap otherParamsMap = (VdcParametersMap) obj; <START> return paramsMap.equals(otherParamsMap.paramsMap); <END> }</code><technical_language>I I out of this world... do temp vars... :) Please ignore! return paramsMap.equals(((VdcParametersMap) obj).paramsMap)</technical_language>

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } return paramsMap.equals(((VdcParametersMap) obj).paramsMap); }
Source:
<code>public boolean get(URIish uri, CredentialItem... items) throws UnsupportedCredentialItem { for (CredentialItem i : items) { if (i instanceof CredentialItem.Username) { ((CredentialItem.Username) i).setValue(username); continue; } if (i instanceof CredentialItem.Password) { ((CredentialItem.Password) i).setValue(password); continue; } if (i instanceof CredentialItem.StringType) { if (i.getPromptText().equals("Password: ")) { ((CredentialItem.StringType) i).setValue(new String( password)); continue; } } <START> if(i instanceof CredentialItem.YesNoType) { <END> ((CredentialItem.YesNoType)i).setValue(true); return true; } throw new UnsupportedCredentialItem(uri, i.getClass().getName() + ":" + i.getPromptText()); } return true; }</code><technical_language>spacing</technical_language>

Target:
public boolean get(URIish uri, CredentialItem... items) throws UnsupportedCredentialItem { for (CredentialItem i : items) { if (i instanceof CredentialItem.Password) { ((CredentialItem.Password) i).setValue(password); continue; } if (i instanceof CredentialItem.StringType && PASSWORD_PROMPT.equals(i.getPromptText())) { ((CredentialItem.StringType) i).setValue(new String(password)); continue; } if (i instanceof CredentialItem.Username) { ((CredentialItem.Username) i).setValue(username); continue; } if (i instanceof CredentialItem.YesNoType) { ((CredentialItem.YesNoType) i).setValue(true); return true; } throw new UnsupportedCredentialItem(uri, i.getClass().getName() + ":" + i.getPromptText()); } return true; }
Source:
<code>public RabbitMQConsumer(RabbitMQStore store) { if (store == null) { <START> log.error("Cannot initialize."); <END> return; } this.store = store; cachedMessage = new CachedMessage(); }</code><technical_language>initialise what? initialise RabbitMQ message processor + message processor name? suggestion is handle a situation exceptions returning null. deployment, this fail deployment (ultimately CAR file deployment fails)</technical_language>

Target:
public RabbitMQConsumer(RabbitMQStore store) { if (store == null) { log.error("Cannot initialize consumer: " + getId()); return; } this.store = store; cachedMessage = new CachedMessage(); }
Source:
<code>public void createTable(HTableDescriptor desc, byte[][] splitKeys) throws IOException { <START> CreateTableRequest createReq = CreateTableRequest.of(desc.getTableName().getNameAsString()); <END> for (HColumnDescriptor column : desc.getColumnFamilies()) { String columnName = column.getNameAsString(); createReq.addFamily(columnName, buildGarbageCollectionRule(column)); } if (splitKeys != null) { for (byte[] splitKey : splitKeys) { createReq.addSplit(ByteString.copyFrom(splitKey)); } } createTable(desc.getTableName(), createReq); }</code><technical_language>this done in TableAdapter</technical_language>

Target:
public void createTable(HTableDescriptor desc, byte[][] splitKeys) throws IOException { createTable(desc.getTableName(), TableAdapter.adapt(desc, splitKeys)); }
Source:
<code>public void testCaseSensitiveField() { String indexName = "machine"; <START> Map<String, Object> docAsSource = new HashMap<>(); <END> docAsSource.put("ProductionCount", 32L); docAsSource.put("Name", "A Big Machine"); addElasticDocumentToIndex(indexName, docAsSource); embeddedElasticsearchNode.getClient().admin().indices().refresh(refreshRequest(indexName)).actionGet(); MaterializedResult actualColumns = computeActual("SELECT name, ProductionCount FROM telemetry.Machine").toTestTypes(); MaterializedResult.Builder builder = resultBuilder(getQueryRunner().getDefaultSession(), VARCHAR, BIGINT); for (MaterializedRow row : actualColumns.getMaterializedRows()) { builder.row(row.getField(0), row.getField(1)); } MaterializedResult actualResult = builder.build(); builder = resultBuilder(getQueryRunner().getDefaultSession(), VARCHAR, BIGINT); MaterializedResult expectedColumns = builder .row("A Big Machine", 32L).build(); assertEquals(actualResult, expectedColumns, format("%s != %s", actualResult, expectedColumns)); }</code><technical_language>s/docAsSource/source/g</technical_language>

Target:
public void testCaseSensitiveField() { String indexName = "machine"; String tableName = "telemetry.Machine"; Map<String, Object> source = new HashMap<>(); source.put("ProductionCount", 32L); source.put("Name", "A Big Machine"); embeddedElasticsearchNode.getClient().prepareIndex(indexName.toLowerCase(ENGLISH), "doc").setSource(source).get(); embeddedElasticsearchNode.getClient().admin().indices().refresh(refreshRequest(indexName)).actionGet(); MaterializedResult actualColumns = computeActual("SELECT name, ProductionCount FROM " + tableName).toTestTypes(); MaterializedResult.Builder builder = resultBuilder(getQueryRunner().getDefaultSession(), VARCHAR, BIGINT); for (MaterializedRow row : actualColumns.getMaterializedRows()) { builder.row(row.getField(0), row.getField(1)); } MaterializedResult actualResult = builder.build(); builder = resultBuilder(getQueryRunner().getDefaultSession(), VARCHAR, BIGINT); MaterializedResult expectedColumns = builder .row("A Big Machine", 32L).build(); assertEquals(actualResult, expectedColumns, format("%s != %s", actualResult, expectedColumns)); }
Source:
<code>public SearchServiceClientBuilder addPolicy(HttpPipelinePolicy policy) { <START> this.policies.add(policy); <END> return this; }</code><technical_language>Generally addPolicy verifies HttpPipelinePolicy null if is throws exception</technical_language>

Target:
public SearchServiceClientBuilder addPolicy(HttpPipelinePolicy policy) { Objects.requireNonNull(policy); this.policies.add(policy); return this; }
Source:
<code>private void processConfigData(byte[] data) throws Exception { Properties properties = new Properties(); properties.load(new ByteArrayInputStream(data)); QuorumMaj newConfig = new QuorumMaj(properties); currentConfig.set(newConfig); <START> if ( log.isInfoEnabled() ) <END> { log.info("New config event received: " + properties.toString()); } String connectionString = configToConnectionString(newConfig); if ( connectionString.trim().length() > 0 ) { ensembleProvider.setConnectionString(connectionString); } else { log.debug("Ignoring new config as it is empty"); } }</code><technical_language>Instead of this check do: java log.info("New config event received: {}", properties);</technical_language>

Target:
private void processConfigData(byte[] data) throws Exception { Properties properties = new Properties(); properties.load(new ByteArrayInputStream(data)); log.info("New config event received: {}", properties); QuorumMaj newConfig = new QuorumMaj(properties); currentConfig.set(newConfig); String connectionString = configToConnectionString(newConfig); if ( connectionString.trim().length() > 0 ) { ensembleProvider.setConnectionString(connectionString); } else { log.debug("Ignoring new config as it is empty"); } }