auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void checkNodeState() throws YarnException { GetClusterNodesRequest request = Records.newRecord(GetClusterNodesRequest.class); ClientRMService clientRMService = yarnCluster.getResourceManager().getClientRMService(); GetClusterNodesResponse response = clientRMService.getClusterNodes(request); List<NodeReport> nodeReports = response.getNodeReports(); LOG.info("{}", nodeReports); for (NodeReport nr: nodeReports) { <START> if (nr.getNodeState().isUnusable()) { <END> continue; } return; } fail("Yarn Mini cluster should have at least one usable node."); }</code><technical_language>simplify this if (!nr.getNodeState().isUnusable()) return; do is unusable continue for loop anyway</technical_language>

Target:
private void checkNodeState() throws YarnException { GetClusterNodesRequest request = Records.newRecord(GetClusterNodesRequest.class); ClientRMService clientRMService = yarnCluster.getResourceManager().getClientRMService(); GetClusterNodesResponse response = clientRMService.getClusterNodes(request); List<NodeReport> nodeReports = response.getNodeReports(); LOG.info("{}", nodeReports); for (NodeReport nr: nodeReports) { if (!nr.getNodeState().isUnusable()) { return; } } fail("Yarn Mini cluster should have at least one usable node."); }
Source:
<code><START> boolean abortUndrainedBatches(RuntimeException reason) { <END> boolean abortedSomeBatches = false; for (ProducerBatch batch : incomplete.copyAll()) { Deque<ProducerBatch> dq = getDeque(batch.topicPartition); boolean aborted = false; synchronized (dq) { if ((transactionManager != null && !batch.hasSequence()) || (transactionManager == null && !batch.isClosed())) { aborted = true; batch.abortRecordAppends(); dq.remove(batch); } } if (aborted) { batch.abort(reason); deallocate(batch); abortedSomeBatches = true; } } return abortedSomeBatches; }</code><technical_language>This function is called in line 432 of Sender well, return evaluated there</technical_language>

Target:
void abortUndrainedBatches(RuntimeException reason) { for (ProducerBatch batch : incomplete.copyAll()) { Deque<ProducerBatch> dq = getDeque(batch.topicPartition); boolean aborted = false; synchronized (dq) { if ((transactionManager != null && !batch.hasSequence()) || (transactionManager == null && !batch.isClosed())) { aborted = true; batch.abortRecordAppends(); dq.remove(batch); } } if (aborted) { batch.abort(reason); deallocate(batch); } } }
Source:
<code><START> public void updateComment_shouldNotUpdateTheCommentInTheDatabaseIfTheUserIsUnauthorized() throws Exception { <END> PipelineConfig pipelineConfig = PipelineConfigMother.createPipelineConfig("pipeline_name", "stage", "job"); goConfigService.addPipeline(pipelineConfig, "pipeline-group"); configHelper.addAuthorizedUserForPipelineGroup("valid-user"); dbHelper.newPipelineWithAllStagesPassed(pipelineConfig); HttpLocalizedOperationResult result = new HttpLocalizedOperationResult(); pipelineHistoryService.updateComment("pipeline_name", 1, "test comment", new Username(new CaseInsensitiveString("invalid-user")), result); PipelineInstanceModel pim = dbHelper.getPipelineDao().findPipelineHistoryByNameAndCounter("pipeline_name", 1); assertThat(pim.getComment(), is(nullValue())); assertThat(result.httpCode(), is(401)); }</code><technical_language>verify error message</technical_language>

Target:
public void updateComment_shouldNotUpdateTheCommentInTheDatabaseIfTheUserIsUnauthorized() throws Exception { PipelineConfig pipelineConfig = PipelineConfigMother.createPipelineConfig("pipeline_name", "stage", "job"); goConfigService.addPipeline(pipelineConfig, "pipeline-group"); configHelper.addAuthorizedUserForPipelineGroup("valid-user"); dbHelper.newPipelineWithAllStagesPassed(pipelineConfig); HttpLocalizedOperationResult result = new HttpLocalizedOperationResult(); pipelineHistoryService.updateComment("pipeline_name", 1, "test comment", new Username(new CaseInsensitiveString("invalid-user")), result); PipelineInstanceModel pim = dbHelper.getPipelineDao().findPipelineHistoryByNameAndCounter("pipeline_name", 1); assertThat(pim.getComment(), is(nullValue())); assertThat(result.httpCode(), is(401)); assertThat(result.message(localizer), is("You do not have operate permissions for pipeline 'pipeline_name'.")); }
Source:
<code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); EventBus.getDefault().register(this); if (discussionTopic == null) { String topicId = getArguments().getString(Router.EXTRA_DISCUSSION_TOPIC_ID); GetSpecificCourseTopicsTask getTopicsTask = new GetSpecificCourseTopicsTask(getContext(), courseData.getCourse().getId(), Collections.singletonList(topicId)) { @Override protected void onSuccess(CourseTopics courseTopics) throws Exception { super.onSuccess(courseTopics); discussionTopic = courseTopics.getCoursewareTopics().get(0).getChildren().get(0); getActivity().setTitle(discussionTopic.getName()); <START> deferredRunnable.run(); <END> } }; getTopicsTask.setProgressCallback(null); getTopicsTask.execute(); } else { getActivity().setTitle(discussionTopic.getName()); } }</code><technical_language>a null check this</technical_language>

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); EventBus.getDefault().register(this); if (discussionTopic == null) { String topicId = getArguments().getString(Router.EXTRA_DISCUSSION_TOPIC_ID); GetSpecificCourseTopicsTask getTopicsTask = new GetSpecificCourseTopicsTask(getContext(), courseData.getCourse().getId(), Collections.singletonList(topicId)) { @Override protected void onSuccess(CourseTopics courseTopics) throws Exception { discussionTopic = courseTopics.getCoursewareTopics().get(0).getChildren().get(0); if (!getArguments().getBoolean(ARG_DISCUSSION_HAS_TOPIC_NAME)) { getActivity().setTitle(discussionTopic.getName()); } if (populatePostListRunnable != null) { populatePostListRunnable.run(); } } }; getTopicsTask.setProgressCallback(null); getTopicsTask.execute(); } else { getActivity().setTitle(discussionTopic.getName()); } }
Source:
<code>public boolean submitTopology(String[] appConfs) { if (!this.topologyName.equals(this.topologyName.toLowerCase())) { LOG.log(Level.SEVERE, "K8s scheduler does not allow upper case topologies"); return false; } String deploymentURI = String.format( "%s/api/v1/namespaces/default/pods", this.kubernetesURI); boolean allSuccessful = true; <START> for (int i = 0; i < appConfs.length; i++) { <END> allSuccessful = deployContainer(appConfs[i]); if (!allSuccessful) { break; } } return allSuccessful; }</code><technical_language>for (String appConf : appConfs) {</technical_language>

Target:
protected boolean submitTopology(String[] appConfs) { if (!this.topologyName.equals(this.topologyName.toLowerCase())) { throw new TopologySubmissionException("K8S scheduler does not allow upper case topologies."); } for (String appConf : appConfs) { try { deployContainer(appConf); } catch (IOException ioe) { LOG.log(Level.SEVERE, "Problem deploying container with config: " + appConf); return false; } } return true; }
Source:
<code>private static void assertTimestampCorrect(String timestampString) { Timestamp timestamp = Timestamp.valueOf(timestampString); NanoTime nanoTime = NanoTimeUtils.getNanoTime(timestamp, false); <START> final ByteBuffer buffer = ByteBuffer.wrap(nanoTime.toBinary().getBytes()); <END> long decodedTimestampMillis = getTimestampMillis(Binary.fromConstantByteBuffer(buffer)); assertEquals(decodedTimestampMillis, timestamp.getTime()); }</code><technical_language>Remove final please</technical_language>

Target:
private static void assertTimestampCorrect(String timestampString) { Timestamp timestamp = Timestamp.valueOf(timestampString); NanoTime nanoTime = getNanoTime(timestamp, false); ByteBuffer buffer = ByteBuffer.wrap(nanoTime.toBinary().getBytes()); long decodedTimestampMillis = getTimestampMillis(fromConstantByteBuffer(buffer)); assertEquals(decodedTimestampMillis, timestamp.getTime()); }
Source:
<code>public boolean equals(Object obj) { if ( this == obj ) { return true; } if ( obj == null ) { return false; } if ( getClass() != obj.getClass() ) { return false; } MapMappingMethod other = (MapMappingMethod) obj; if ( !getResultType().equals( other.getResultType() ) ) { return false; } if ( getSourceParameters().size() != other.getSourceParameters().size() ) { return false; } for ( int i = 0; i < getSourceParameters().size(); i++ ) { if ( !getSourceParameters().get( i ).getType().equals( other.getSourceParameters().get( i ).getType() ) ) { return false; } <START> if ( !getSourceParameters().get( i ).getType().getTypeParameters().get( 0 ) <END> .equals( other.getSourceParameters().get( i ).getType().getTypeParameters().get( 0 ) ) ) { return false; } } return isMapNullToDefault() == other.isMapNullToDefault(); }</code><technical_language>touch this.. this code, line 325 correct. For Iterable types decide check type parameters. first..? Feels logical for maps. copy sam code for Iterable method? So: java List<Type> thisTypeParameters = getSourceParameters().get( i ).getType().getTypeParameters(); List<Type> otherTypeParameters = other.getSourceParameters().get( i ).getType().getTypeParameters(); if ( !thisTypeParameters.equals( otherTypeParameters ) ) { return false; }</technical_language>

Target:
public boolean equals(Object obj) { if ( this == obj ) { return true; } if ( obj == null ) { return false; } if ( getClass() != obj.getClass() ) { return false; } MapMappingMethod other = (MapMappingMethod) obj; if ( !getResultType().equals( other.getResultType() ) ) { return false; } if ( getSourceParameters().size() != other.getSourceParameters().size() ) { return false; } for ( int i = 0; i < getSourceParameters().size(); i++ ) { if ( !getSourceParameters().get( i ).getType().equals( other.getSourceParameters().get( i ).getType() ) ) { return false; } List<Type> thisTypeParameters = getSourceParameters().get( i ).getType().getTypeParameters(); List<Type> otherTypeParameters = other.getSourceParameters().get( i ).getType().getTypeParameters(); if ( !thisTypeParameters.equals( otherTypeParameters ) ) { return false; } } return isMapNullToDefault() == other.isMapNullToDefault(); }
Source:
<code>public void testAllocateWithFreeSlot() throws Exception { final CompletableFuture<SlotRequest> slotRequestFuture = new CompletableFuture<>(); resourceManagerGateway.setRequestSlotConsumer(slotRequestFuture::complete); try (SlotPoolImpl slotPool = createAndSetUpSlotPool()) { slotPool.registerTaskManager(taskManagerLocation.getResourceID()); SlotRequestId requestId1 = new SlotRequestId(); CompletableFuture<PhysicalSlot> future1 = requestNewAllocatedSlot( slotPool, requestId1 ); assertFalse(future1.isDone()); final SlotRequest slotRequest = slotRequestFuture.get(timeout.toMilliseconds(), TimeUnit.MILLISECONDS); final SlotOffer slotOffer = new SlotOffer( slotRequest.getAllocationId(), 0, DEFAULT_TESTING_PROFILE); assertTrue(slotPool.offerSlot(taskManagerLocation, taskManagerGateway, slotOffer)); PhysicalSlot slot1 = future1.get(1, TimeUnit.SECONDS); assertTrue(future1.isDone()); slotPool.releaseSlot(requestId1, null); assertEquals(1, slotPool.getAvailableSlots().size()); assertEquals(0, slotPool.getAllocatedSlots().size()); <START> Optional<PhysicalSlot> optional = slotPool.allocateAvailableSlot( <END> new SlotRequestId(), slotRequest.getAllocationId() ); assertTrue(optional.isPresent()); PhysicalSlot slot2 = optional.get(); assertEquals(slot1, slot2); } }</code><technical_language>name physicalSlot/allocatedSlot</technical_language>

Target:
public void testAllocateWithFreeSlot() throws Exception { final CompletableFuture<SlotRequest> slotRequestFuture = new CompletableFuture<>(); resourceManagerGateway.setRequestSlotConsumer(slotRequestFuture::complete); try (SlotPoolImpl slotPool = createAndSetUpSlotPool(resourceManagerGateway)) { final AllocationID allocationId = new AllocationID(); assertTrue(registerAndOfferSlot(taskManagerLocation, slotPool, allocationId)); assertEquals(1, slotPool.getAvailableSlots().size()); assertEquals(0, slotPool.getAllocatedSlots().size()); Optional<PhysicalSlot> physicalSlot = slotPool.allocateAvailableSlot( new SlotRequestId(), allocationId); assertTrue(physicalSlot.isPresent()); assertEquals(0, slotPool.getAvailableSlots().size()); assertEquals(1, slotPool.getAllocatedSlots().size()); } }
Source:
<code>public String toString(Integer value) throws ValueConverterException { if (value == -1) { <START> return "*"; <END> } else { return value.toString(); } }</code><technical_language>constant</technical_language>

Target:
public String toString(Integer value) throws ValueConverterException { if (value == -1) { return Ecl.ANY; } else { return value.toString(); } }
Source:
<code>private static void printEnvInfo(TestContext testCtx, PrintWriter out) { out.println( "" ); out.println( "TEST CONFIGURATION" ); out.println( " measure performance : " + TestConstants.arePerformanceTestsEnabled() ); out.println( " threads : " + THREADS_COUNT ); out.println( " measured cycles : " + testCtx.measuredCyclesCount ); out.println( " warmup cycles : " + testCtx.warmupCyclesCount ); out.println( " initial book count : " + testCtx.initialBookCount ); <START> out.println( " initial author count : " + testCtx.initialAuthorCount ); <END> out.println( " verbose : " + VERBOSE ); out.println( " measure memory : " + MEASURE_MEMORY ); out.println( " measure task time : " + MEASURE_TASK_TIME ); out.println( " check query results : " + ASSERT_QUERY_RESULTS ); out.println( " check index state : " + CHECK_INDEX_STATE ); out.println( "" ); out.println( "HIBERNATE SEARCH PROPERTIES" ); Map<String, Object> properties = testCtx.sessionFactory.getProperties(); for ( Entry<String, Object> e : properties.entrySet() ) { if ( e.getKey().toString().startsWith( "hibernate.search" ) ) { out.println( " " + e.getKey() + " = " + e.getValue() ); } } out.println( "" ); out.println( "VERSIONS" ); out.println( " org.hibernate.search : " + Version.getVersionString() ); out.println( " org.hibernate : " + org.hibernate.Version.getVersionString() ); out.println( "" ); }</code><technical_language>s/initial author count :/initial author count:/ ? semicolons nicely aligned ;)</technical_language>

Target:
private static void printEnvInfo(TestContext testCtx, PrintWriter out) { out.println( "" ); out.println( "TEST CONFIGURATION" ); out.println( " measure performance : " + TestConstants.arePerformanceTestsEnabled() ); out.println( " threads : " + testCtx.threadCount ); out.println( " measured cycles : " + testCtx.measuredCyclesCount ); out.println( " warmup cycles : " + testCtx.warmupCyclesCount ); out.println( " initial book count : " + testCtx.initialBookCount ); out.println( " initial author count: " + testCtx.initialAuthorCount ); out.println( " verbose : " + testCtx.verbose ); out.println( " measure memory : " + testCtx.measureMemory ); out.println( " measure task time : " + testCtx.measureTaskTime ); out.println( " check query results : " + testCtx.assertQueryResults ); out.println( " check index state : " + testCtx.checkIndexState ); out.println( "" ); out.println( "HIBERNATE SEARCH PROPERTIES" ); Map<String, Object> properties = testCtx.sessionFactory.getProperties(); for ( Entry<String, Object> e : properties.entrySet() ) { if ( e.getKey().toString().startsWith( "hibernate.search" ) ) { out.println( " " + e.getKey() + " = " + e.getValue() ); } } out.println( "" ); out.println( "VERSIONS" ); out.println( " org.hibernate.search : " + Version.getVersionString() ); out.println( " org.hibernate : " + org.hibernate.Version.getVersionString() ); out.println( "" ); }
Source:
<code>static Uri createResourceUri(Context context, int resourceId) { <START> return Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE <END> + "://" + context.getPackageName() + "/" + resourceId); }</code><technical_language>Uri.Builder</technical_language>

Target:
static Uri createResourceUri(Context context, int resourceId) { return new Uri.Builder().scheme(Picasso.SCHEME_RESOURCES) .appendPath(String.valueOf(resourceId)) .build(); }
Source:
<code>private boolean shouldRunLogDeletion() { <START> long lastLogDeletionRun = HiddenPreferences.getLastLogDeletionTime(); <END> long aWeekBeforeNow = new Date().getTime() - (MILLISECONDS_IN_A_DAY * 7L); return new Date(lastLogDeletionRun).before(new Date(aWeekBeforeNow)); }</code><technical_language>Nit, this body replaced PendingCalcs.isPending(HiddenPreferences.getLastLogDeletionTime(), DateUtils.DAY_IN_MILLIS*7) remove redundancy</technical_language>

Target:
private boolean shouldRunLogDeletion() { long lastLogDeletionRun = HiddenPreferences.getLastLogDeletionTime(); long aWeekBeforeNow = new Date().getTime() - (DateUtils.DAY_IN_MILLIS * 7L); return new Date(lastLogDeletionRun).before(new Date(aWeekBeforeNow)); }
Source:
<code>public JpaMetamodelEntityInformation(Class<T> domainClass, Metamodel metamodel) { super(domainClass); <START> this.metamodel = metamodel; <END> Assert.notNull(metamodel); ManagedType<T> type = metamodel.managedType(domainClass); if (type == null) { throw new IllegalArgumentException("The given domain class can not be found in the given Metamodel!"); } if (!(type instanceof IdentifiableType)) { throw new IllegalArgumentException("The given domain class does not contain an id attribute!"); } this.idMetadata = new IdMetadata<T>((IdentifiableType<T>) type); this.versionAttribute = findVersionAttribute(type); }</code><technical_language>Please assert first</technical_language>

Target:
public JpaMetamodelEntityInformation(Class<T> domainClass, Metamodel metamodel) { super(domainClass); Assert.notNull(metamodel); this.metamodel = metamodel; ManagedType<T> type = metamodel.managedType(domainClass); if (type == null) { throw new IllegalArgumentException("The given domain class can not be found in the given Metamodel!"); } if (!(type instanceof IdentifiableType)) { throw new IllegalArgumentException("The given domain class does not contain an id attribute!"); } this.idMetadata = new IdMetadata<T>((IdentifiableType<T>) type); this.versionAttribute = findVersionAttribute(type); }
Source:
<code>public MergingDigest fromByteBuffer(ByteBuffer buffer, int numBytes) { if (numBytes == 0) { return null; } <START> buffer.limit(buffer.position() + numBytes); <END> return MergingDigest.fromBytes(buffer); }</code><technical_language>Is safe set limit for buffer here? sure. Suggest get a read-only buffer</technical_language>

Target:
public MergingDigest fromByteBuffer(ByteBuffer buffer, int numBytes) { if (numBytes == 0) { return null; } ByteBuffer readOnlyBuffer = buffer.asReadOnlyBuffer(); readOnlyBuffer.limit(buffer.position() + numBytes); return MergingDigest.fromBytes(readOnlyBuffer); }
Source:
<code>void buildClause(StringBuilder sb) { if (ctes.isEmpty()) { return; } sb.append("WITH "); if (recursive) { sb.append("RECURSIVE "); } boolean first = true; for (CTEInfo cte : ctes.values()) { if (first) { first = false; } else { sb.append(", "); } sb.append(cte.name); sb.append('('); <START> final List<String> columnNames = cte.columnNames; <END> sb.append(columnNames.get(0)); for (int i = 1; i < columnNames.size(); i++) { sb.append(", "); sb.append(columnNames.get(i)); } sb.append(')'); sb.append(" AS(\n"); sb.append(cte.nonRecursiveCriteriaBuilder.getQueryString()); if (cte.recursive) { sb.append("\nUNION ALL\n"); sb.append(cte.recursiveCriteriaBuilder.getQueryString()); } sb.append("\n)"); } sb.append("\n"); }</code><technical_language>good. sense this is required for multi-column associations</technical_language>

Target:
void buildClause(StringBuilder sb) { if (ctes.isEmpty()) { return; } sb.append("WITH "); if (recursive) { sb.append("RECURSIVE "); } boolean first = true; for (CTEInfo cte : ctes.values()) { if (first) { first = false; } else { sb.append(", "); } sb.append(cte.name); sb.append('('); final List<String> attributes = cte.attributes; sb.append(attributes.get(0)); for (int i = 1; i < attributes.size(); i++) { sb.append(", "); sb.append(attributes.get(i)); } sb.append(')'); sb.append(" AS(\n"); sb.append(cte.nonRecursiveCriteriaBuilder.getQueryString()); if (cte.recursive) { sb.append("\nUNION ALL\n"); sb.append(cte.recursiveCriteriaBuilder.getQueryString()); } sb.append("\n)"); } sb.append("\n"); }
Source:
<code>public void onClickAd(@NonNull NendAdNativeVideo nendAdNativeVideo) { forwarder.adClicked(); <START> handler.postDelayed(new Runnable() { @Override public void run() { forwarder.leftApplication(); } }, 1000); <END> }</code><technical_language>Is delay necessary here? I call leftApplication() waiting</technical_language>

Target:
public void onClickAd(@NonNull NendAdNativeVideo nendAdNativeVideo) { forwarder.adClicked(); forwarder.leftApplication(); }
Source:
<code>private void extractLambdaFromMethodCall(MethodCallExpr methodCallExpr, Supplier<MaterializedLambda> lambdaExtractor) { <START> List<VariableDeclarator> bitMaskVariables = new ArrayList<>(); <END> if (lambdaExtractor.get() instanceof MaterializedLambdaConsequence) { methodCallExpr.findAncestor(MethodDeclaration.class).ifPresent(node -> { bitMaskVariables.addAll(node.findAll(VariableDeclarator.class).stream() .filter(vd -> vd.getType().asString().equals(BitMask.class.getCanonicalName())) .collect(Collectors.toList())); }); } methodCallExpr.getArguments().forEach(a -> { if (a.isLambdaExpr()) { LambdaExpr lambdaExpr = a.asLambdaExpr(); try { CreatedClass aClass = lambdaExtractor.get().create(lambdaExpr.toString(), imports, staticImports, bitMaskVariables); lambdaClasses.put(aClass.getClassNameWithPackage(), aClass); ClassOrInterfaceType type = StaticJavaParser.parseClassOrInterfaceType(aClass.getClassNameWithPackage()); a.replace(lambdaInstance(type)); } catch(DoNotConvertLambdaException e) { logger.debug("Cannot externalize lambdas {}", e.getMessage()); } } }); }</code><technical_language>JP types input for model compiler, for output. This is in future emit JP code end, processing types owned us</technical_language>

Target:
private void extractLambdaFromMethodCall(MethodCallExpr methodCallExpr, Supplier<MaterializedLambda> lambdaExtractor) { methodCallExpr.getArguments().forEach(a -> { if (a.isLambdaExpr()) { LambdaExpr lambdaExpr = a.asLambdaExpr(); try { CreatedClass aClass = lambdaExtractor.get().create(lambdaExpr.toString(), imports, staticImports); lambdaClasses.put(aClass.getClassNameWithPackage(), aClass); ClassOrInterfaceType type = StaticJavaParser.parseClassOrInterfaceType(aClass.getClassNameWithPackage()); a.replace(lambdaInstance(type)); } catch(DoNotConvertLambdaException e) { logger.debug("Cannot externalize lambdas {}", e.getMessage()); } } }); }
Source:
<code><START> public void processProfilesQueuedDuringInitialization_shouldNotThrowIndexOutOfBoundsException() { <END> RegionAdvisor.QueuedBucketProfile qbp = new RegionAdvisor.QueuedBucketProfile(mock(InternalDistributedMember.class), serials, true); DistributionManager distributionManager = mock(DistributionManager.class); when(regionAdvisor.getDistributionManager()).thenReturn(distributionManager); when(distributionManager.isCurrentMember(any())).thenReturn(true); regionAdvisor.preInitQueue.add(qbp); ProxyBucketRegion pbr = mock(ProxyBucketRegion.class); when(pbr.getBucketAdvisor()).thenReturn(mock(BucketAdvisor.class)); regionAdvisor.buckets = new ProxyBucketRegion[] {pbr, pbr, pbr}; regionAdvisor.processProfilesQueuedDuringInitialization(); }</code><technical_language>of variable names in this test, qbp pbr a bit more descriptive. I wrong long variable names, providing providing extra clarity</technical_language>

Target:
public void processProfilesQueuedDuringInitialization_shouldNotThrowIndexOutOfBoundsException() { RegionAdvisor.QueuedBucketProfile queuedBucketProfile = new RegionAdvisor.QueuedBucketProfile(mock(InternalDistributedMember.class), serials, true); DistributionManager distributionManager = mock(DistributionManager.class); when(regionAdvisor.getDistributionManager()).thenReturn(distributionManager); when(distributionManager.isCurrentMember(any())).thenReturn(true); regionAdvisor.preInitQueue.add(queuedBucketProfile); ProxyBucketRegion proxyBucketRegion = mock(ProxyBucketRegion.class); BucketAdvisor bucketAdvisor = mock(BucketAdvisor.class); when(proxyBucketRegion.getBucketAdvisor()).thenReturn(bucketAdvisor); regionAdvisor.buckets = new ProxyBucketRegion[] {proxyBucketRegion, proxyBucketRegion, proxyBucketRegion}; regionAdvisor.processProfilesQueuedDuringInitialization(); verify(bucketAdvisor, times(0)).removeIdWithSerial(any(InternalDistributedMember.class), anyInt(), anyBoolean()); }
Source:
<code>public void revokeSession(String user) { String sql = "UPDATE " + tableName + " SET " + col.HAS_SESSION + "=? WHERE LOWER(" + col.NAME + ")=?;"; <START> if (user != null) { <END> try (PreparedStatement pst = con.prepareStatement(sql)) { pst.setInt(1, 0); pst.setString(2, user); pst.executeUpdate(); } catch (SQLException ex) { logSqlException(ex); } } }</code><technical_language>check user != null if this is done in MySQL in SQLite#grantSession? I necessary</technical_language>

Target:
public void revokeSession(String user) { String sql = "UPDATE " + tableName + " SET " + col.HAS_SESSION + "=? WHERE LOWER(" + col.NAME + ")=?;"; try (PreparedStatement pst = con.prepareStatement(sql)) { pst.setInt(1, 0); pst.setString(2, user); pst.executeUpdate(); } catch (SQLException ex) { logSqlException(ex); } }
Source:
<code>public void setup() throws NamingException { TestUtil.cleanupSingletonSessionId(); Properties properties= new Properties(); properties.setProperty("mary", "HR"); properties.setProperty("john", "HR"); userGroupCallback = new JBossUserGroupCallbackImpl(properties); createRuntimeManager(); new InitialContext().rebind("java:comp/UserTransaction", com.arjuna.ats.jta.UserTransaction.userTransaction()); new InitialContext().rebind("java:comp/TransactionManager", TransactionManager.transactionManager()); <START> new InitialContext().rebind("java:comp/TransactionSynchronizationRegistry", new com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple()); <END> }</code><technical_language>needed, I a this test</technical_language>

Target:
public void setup() throws NamingException { TestUtil.cleanupSingletonSessionId(); Properties properties= new Properties(); properties.setProperty("mary", "HR"); properties.setProperty("john", "HR"); userGroupCallback = new JBossUserGroupCallbackImpl(properties); createRuntimeManager(); }
Source:
<code>private Collection<MpackRecommendationResponse.HostGroup> getHostgroups(ClusterTopology topology) { Map<StackId, String> mpackNameByStackId = topology.getMpacks().stream().collect( toMap( MpackInstance::getStackId, MpackInstance::getMpackName )); topology.getComponentsByHostgroup().entrySet().stream().collect( toMap( e -> e.getKey(), components -> components.getValue().stream() .map(comp -> MpackRecommendationResponse.HostGroup.createComponent(comp.componentName(), mpackNameByStackId.get(comp.stackId()), comp.serviceName().orElseGet(() -> comp.serviceType()))) .collect(toSet()) ) ); <START> return null; <END> }</code><technical_language>this method return map created previous statement, instead of null</technical_language>

Target:
private Collection<MpackRecommendationResponse.HostGroup> getHostgroups(ClusterTopology topology) { Map<StackId, String> mpackNameByStackId = topology.getMpacks().stream().collect( toMap( MpackInstance::getStackId, MpackInstance::getMpackName )); topology.getComponentsByHostGroup().entrySet().stream().collect( toMap( e -> e.getKey(), components -> components.getValue().stream() .map(comp -> MpackRecommendationResponse.HostGroup.createComponent(comp.componentName(), mpackNameByStackId.get(comp.stackId()), comp.serviceName().orElseGet(() -> comp.serviceType()))) .collect(toSet()) ) ); return null; }
Source:
<code>public void testPopulateMenu() { <START> placeManager = mock(PlaceManager.class); <END> final DMNEditorMenuSessionItems menuItems = spy(new DMNEditorMenuSessionItems(builder, sessionCommands, placeManager)); final MenuItem menuItem = mock(MenuItem.class); doNothing().when(menuItems).superPopulateMenu(any()); doReturn(menuItem).when(menuItems).newPerformAutomaticLayout(); menuItems.populateMenu(fileMenuBuilder); verify(menuItems).addPerformAutomaticLayout(any()); }</code><technical_language>need mock(..) if @Mock'ed it</technical_language>

Target:
public void testPopulateMenu() { final DMNEditorMenuSessionItems menuItems = spy(new DMNEditorMenuSessionItems(builder, sessionCommands, placeManager)); final MenuItem menuItem = mock(MenuItem.class); doNothing().when(menuItems).superPopulateMenu(any()); doReturn(menuItem).when(menuItems).newPerformAutomaticLayout(); menuItems.populateMenu(fileMenuBuilder); verify(menuItems).addPerformAutomaticLayout(any()); }
Source:
<code>public static PcapFile getPcapFile(Path filePath) throws IOException, BadPcapFileException { <START> if (filePath.getFileName().toString().endsWith(PCAPNG_EXTENSION)) { try (PcapFile dummy = new PcapNgFile(filePath)) { return dummy; } } try (PcapFile dummy = new PcapOldFile(filePath)) { return dummy; } <END> }</code><technical_language>I return file caller handle close. if (filePath.getFileName().toString().endsWith(PCAPNG_EXTENSION)) { return new PcapNgFile(filePath); } return new PcapOldFile(filePath);</technical_language>

Target:
public static PcapFile getPcapFile(Path filePath) throws IOException, BadPcapFileException { if (filePath.getFileName().toString().endsWith(PCAPNG_EXTENSION)) { return new PcapNgFile(filePath); } return new PcapOldFile(filePath); }
Source:
<code>static Realm createAndValidate(RealmConfiguration configuration, ColumnIndices[] globalCacheArray) { Realm realm = new Realm(configuration); long currentVersion = realm.getVersion(); long requiredVersion = configuration.getSchemaVersion(); final ColumnIndices columnIndices = RealmCache.findColumnIndices(globalCacheArray, requiredVersion); if (!configuration.isSyncConfiguration()) { if (currentVersion != UNVERSIONED && currentVersion < requiredVersion && columnIndices == null) { realm.doClose(); <START> throw new RealmMigrationNeededException(configuration.getPath(), String.format("Realm on disk need to migrate from v%s to v%s", currentVersion, requiredVersion)); <END> } if (currentVersion != UNVERSIONED && requiredVersion < currentVersion && columnIndices == null) { realm.doClose(); throw new IllegalArgumentException(String.format("Realm on disk is newer than the one specified: v%s vs. v%s", currentVersion, requiredVersion)); } } if (columnIndices == null) { try { initializeRealm(realm); } catch (RuntimeException e) { realm.doClose(); throw e; } } else { realm.schema.columnIndices = columnIndices.clone(); } return realm; }</code><technical_language>%s -> %d</technical_language>

Target:
static Realm createAndValidate(RealmConfiguration configuration, ColumnIndices[] globalCacheArray) { Realm realm = new Realm(configuration); final long currentVersion = realm.getVersion(); final long requiredVersion = configuration.getSchemaVersion(); final ColumnIndices columnIndices = RealmCache.findColumnIndices(globalCacheArray, requiredVersion); if (columnIndices != null) { realm.schema.columnIndices = columnIndices.clone(); } else { final boolean syncingConfig = configuration.isSyncConfiguration(); if (!syncingConfig && (currentVersion != UNVERSIONED)) { if (currentVersion < requiredVersion) { realm.doClose(); throw new RealmMigrationNeededException( configuration.getPath(), String.format("Realm on disk need to migrate from v%s to v%s", currentVersion, requiredVersion)); } if (requiredVersion < currentVersion) { realm.doClose(); throw new IllegalArgumentException( String.format("Realm on disk is newer than the one specified: v%s vs. v%s", currentVersion, requiredVersion)); } } try { if (!syncingConfig) { initializeRealm(realm); } else { initializeSyncedRealm(realm); } } catch (RuntimeException e) { realm.doClose(); throw e; } } return realm; }
Source:
<code>public void filterConfigurationChangesCapabilities() throws Exception { List<ConfigurationChange> filtered_S_configurationChanges = page.filter().setFilter("s").getAllConfigurationChanges(); <START> Assert.assertTrue("Some unexpected differences found! Either some changes are not displayed or some extra appeared. Some could fail due to the <LINK_0>", <END> isChangesListsEqual(changesResource.getFilteredConfigurationChanges(page.filter().getCurrentFilter()), filtered_S_configurationChanges)); List<ConfigurationChange> filtered_SU_configurationChanges = page.filter().appendSymbol('u').getAllConfigurationChanges(); Assert.assertTrue("Some unexpected differences found! Either some changes are not displayed or some extra appeared. Some could fail due to the <LINK_0>", isChangesListsEqual(changesResource.getFilteredConfigurationChanges(page.filter().getCurrentFilter()), filtered_SU_configurationChanges)); List<ConfigurationChange> filtered_STAR_configurationChanges = page.filter().appendSymbol('*').getAllConfigurationChanges(); Assert.assertTrue("Some unexpected configuration changes appeared.", filtered_STAR_configurationChanges.isEmpty()); Assert.assertTrue("Some unexpected differences found! Either some changes are not displayed or some extra appeared. Some could fail due to the <LINK_0>", isChangesListsEqual(filtered_SU_configurationChanges, page.filter().removeSymbol().getAllConfigurationChanges())); }</code><technical_language>update sentence describe situation in case fails due HAL-1182. putting message some constant good idea repeating assert message multiple times</technical_language>

Target:
public void filterConfigurationChangesCapabilities() throws Exception { List<ConfigurationChange> filtered_S_configurationChanges = page.filter().setFilter("s").getAllConfigurationChanges(); Assert.assertTrue(LISTS_NOT_EQUAL_MESSAGE, isChangesListsEqual(changesResource.getFilteredConfigurationChanges(page.filter().getCurrentFilter()), filtered_S_configurationChanges)); List<ConfigurationChange> filtered_SU_configurationChanges = page.filter().appendSymbol('u').getAllConfigurationChanges(); Assert.assertTrue(LISTS_NOT_EQUAL_MESSAGE, isChangesListsEqual(changesResource.getFilteredConfigurationChanges(page.filter().getCurrentFilter()), filtered_SU_configurationChanges)); List<ConfigurationChange> filtered_STAR_configurationChanges = page.filter().appendSymbol('*').getAllConfigurationChanges(); Assert.assertTrue("Some unexpected configuration changes appeared.", filtered_STAR_configurationChanges.isEmpty()); Assert.assertTrue(LISTS_NOT_EQUAL_MESSAGE, isChangesListsEqual(filtered_SU_configurationChanges, page.filter().removeSymbol().getAllConfigurationChanges())); }
Source:
<code>private DataFetcher buildDataFetcher(BuildContext buildCtx, TypeDefinition parentType, FieldDefinition fieldDef) { String fieldName = fieldDef.getName(); String parentTypeName = parentType.getName(); TypeDefinitionRegistry typeRegistry = buildCtx.getTypeRegistry(); RuntimeWiring runtimeWiring = buildCtx.getWiring(); WiringFactory wiringFactory = runtimeWiring.getWiringFactory(); FieldWiringEnvironment wiringEnvironment = new FieldWiringEnvironment(typeRegistry, parentType, fieldDef); DataFetcher dataFetcher; if (wiringFactory.providesDataFetcher(wiringEnvironment)) { dataFetcher = wiringFactory.getDataFetcher(wiringEnvironment); assertNotNull(dataFetcher, "The WiringFactory indicated it provides a data fetcher but then returned null"); } else { dataFetcher = runtimeWiring.getDataFetcherForType(parentTypeName).get(fieldName); if (dataFetcher == null) { dataFetcher = runtimeWiring.getDefaultDataFetcherForType(parentTypeName); if (dataFetcher == null) { dataFetcher = wiringFactory.getDefaultDataFetcher(wiringEnvironment); <START> assertNotNull(dataFetcher, "The WiringFactory indicated MUST provide a data fetcher of last resort as part of its contract"); <END> } } } return dataFetcher; }</code><technical_language>naming: is called resort</technical_language>

Target:
private DataFetcher buildDataFetcher(BuildContext buildCtx, TypeDefinition parentType, FieldDefinition fieldDef) { String fieldName = fieldDef.getName(); String parentTypeName = parentType.getName(); TypeDefinitionRegistry typeRegistry = buildCtx.getTypeRegistry(); RuntimeWiring runtimeWiring = buildCtx.getWiring(); WiringFactory wiringFactory = runtimeWiring.getWiringFactory(); FieldWiringEnvironment wiringEnvironment = new FieldWiringEnvironment(typeRegistry, parentType, fieldDef); DataFetcher dataFetcher; if (wiringFactory.providesDataFetcher(wiringEnvironment)) { dataFetcher = wiringFactory.getDataFetcher(wiringEnvironment); assertNotNull(dataFetcher, "The WiringFactory indicated it provides a data fetcher but then returned null"); } else { dataFetcher = runtimeWiring.getDataFetcherForType(parentTypeName).get(fieldName); if (dataFetcher == null) { dataFetcher = runtimeWiring.getDefaultDataFetcherForType(parentTypeName); if (dataFetcher == null) { dataFetcher = wiringFactory.getDefaultDataFetcher(wiringEnvironment); assertNotNull(dataFetcher, "The WiringFactory indicated MUST provide a default data fetcher as part of its contract"); } } } return dataFetcher; }
Source:
<code>private void doSave() { final Path path = getCanvasHandler().getDiagram().getMetadata().getPath(); stateHolder.saveFile(path, new ServiceCallback<String>() { @Override public void onSuccess(final String xml) { resetContentHash(); <START> notificationEvent.fire(new NotificationEvent(org.uberfire.ext.editor.commons.client.resources.i18n.CommonConstants.INSTANCE.ItemSavedSuccessfully())); <END> hideLoadingViews(); } @Override public void onError(final ClientRuntimeError error) { onSaveError(error); } }); }</code><technical_language>FQN ------------ favorite Objects.equals a rival</technical_language>

Target:
private void doSave() { final Path path = getCanvasHandler().getDiagram().getMetadata().getPath(); getContent().then(xml -> { vfsService.saveFile(path, (String) xml, new ServiceCallback<String>() { @Override public void onSuccess(final String xml) { resetContentHash(); notificationEvent.fire(new NotificationEvent(INSTANCE.ItemSavedSuccessfully())); hideLoadingViews(); } @Override public void onError(final ClientRuntimeError error) { onSaveError(error); } }); return promises.resolve(); }); }
Source:
<code><START> public final int hashCode() { return (int) (w2 >>> 32); } <END></code><technical_language>w2? right shift? matter</technical_language>

Target:
public final int hashCode() { return (int) (w2); }
Source:
<code>public static void imputeZeroCountsAsTargetMedians(final ReadCountCollection readCounts, final Logger logger) { final RealMatrix counts = readCounts.counts(); final int targetCount = counts.getRowDimension(); final Median medianCalculator = new Median(); int totalCounts = counts.getColumnDimension() * counts.getRowDimension(); final long totalZeroCounts = IntStream.range(0, targetCount) .mapToLong(t -> DoubleStream.of(counts.getRow(t)) <START> .filter(c -> c == 0.0).count()).sum(); <END> final double[] medians = IntStream.range(0, targetCount) .mapToDouble(t -> medianCalculator.evaluate( DoubleStream.of(counts.getRow(t)) .filter(c -> c != 0.0) .toArray() )).toArray(); counts.walkInOptimizedOrder(new DefaultRealMatrixChangingVisitor() { @Override public double visit(final int row, final int column, final double value) { return value != 0 ? value : medians[row]; } }); if (totalZeroCounts > 0) { logger.info(String.format("Some 0.0 counts, %d of %d (%.2f%%), were imputed to their enclosing target non-zero median", totalZeroCounts, totalZeroCounts, 100.0 * (totalZeroCounts / totalCounts))); } else { logger.info("No count is 0.0 thus no count needed to be imputed."); } }</code><technical_language>lines align</technical_language>

Target:
public static void imputeZeroCountsAsTargetMedians(final ReadCountCollection readCounts, final Logger logger) { final RealMatrix counts = readCounts.counts(); final int targetCount = counts.getRowDimension(); final Median medianCalculator = new Median(); int totalCounts = counts.getColumnDimension() * counts.getRowDimension(); final long totalZeroCounts = IntStream.range(0, targetCount) .mapToLong(t -> DoubleStream.of(counts.getRow(t)) .filter(c -> c == 0.0).count()).sum(); final double[] medians = IntStream.range(0, targetCount) .mapToDouble(t -> medianCalculator.evaluate( DoubleStream.of(counts.getRow(t)) .filter(c -> c != 0.0) .toArray() )).toArray(); counts.walkInOptimizedOrder(new DefaultRealMatrixChangingVisitor() { @Override public double visit(final int row, final int column, final double value) { return value != 0 ? value : medians[row]; } }); if (totalZeroCounts > 0) { final double totalZeroCountsPercentage = 100.0 * (totalZeroCounts / totalCounts); logger.info(String.format("Some 0.0 counts (%d out of %d, %.2f%%) were imputed to their enclosing target " + "non-zero median", totalZeroCounts, totalZeroCounts, totalZeroCountsPercentage)); } else { logger.info("No count is 0.0 thus no count needed to be imputed."); } }
Source:
<code>protected ImmutableValue<TreeType> constructImmutableValue(TreeType value) { <START> return new ImmutableSpongeValue<>(Keys.TREE_TYPE, value); <END> }</code><technical_language>this.key</technical_language>

Target:
protected ImmutableValue<TreeType> constructImmutableValue(TreeType value) { return new ImmutableSpongeValue<>(this.key, value); }
Source:
<code>public void getSystemProperty( @Option(value = "named", description = "The property name") final String propertyName, final UIOutput output) { <START> if (propertyName != null && !propertyName.trim().isEmpty()) { <END> output.out().println(System.getProperty(propertyName)); } else { for (final Map.Entry<Object, Object> entry : System.getProperties().entrySet()) { output.out().println(entry.getKey() + " = " + entry.getValue()); } } }</code><technical_language>This replaced !Strings.isNullOrEmpty() in furnace-api</technical_language>

Target:
public String getSystemProperty( @Option(value = "named", description = "The property name") final String propertyName, final UIOutput output) throws IOException { if (!Strings.isNullOrEmpty(propertyName)) { return System.getProperty(propertyName); } else { System.getProperties().store(output.out(), null); } return Strings.EMPTY; }
Source:
<code>public void testGetLoadBalancer() { LoadBalancer loadBalancer = api.loadBalancerApi().getLoadBalancer(loadBalancerID); <START> System.out.println(loadBalancer); <END> assertNotNull(loadBalancer); }</code><technical_language>Remove this</technical_language>

Target:
public void testGetLoadBalancer() { LoadBalancer loadBalancer = api.loadBalancerApi().getLoadBalancer(loadBalancerID); assertNotNull(loadBalancer); }
Source:
<code>private ClientMessage encodeAuthenticationRequest() { InternalSerializationService ss = client.getSerializationService(); byte serializationVersion = ss.getVersion(); CandidateClusterContext currentClusterContext = discoveryService.current(); Credentials credentials = currentClusterContext.getCredentialsFactory().newCredentials(); String clusterName = currentClusterContext.getClusterName(); currentCredentials = credentials; if (credentials instanceof PasswordCredentials) { <START> PasswordCredentials cr = (PasswordCredentials) credentials; <END> return ClientAuthenticationCodec .encodeRequest(clusterName, cr.getName(), cr.getPassword(), clientUuid, ClientTypes.JAVA, serializationVersion, BuildInfoProvider.getBuildInfo().getVersion(), client.getName(), labels); } else { Data data; if (credentials instanceof TokenCredentials) { data = new HeapData(((TokenCredentials) credentials).getToken()); } else { data = ss.toData(credentials); } return ClientAuthenticationCustomCodec.encodeRequest(clusterName, data, clientUuid, ClientTypes.JAVA, serializationVersion, BuildInfoProvider.getBuildInfo().getVersion(), client.getName(), labels); } }</code><technical_language>this blocking</technical_language>

Target:
private ClientMessage encodeAuthenticationRequest() { InternalSerializationService ss = client.getSerializationService(); byte serializationVersion = ss.getVersion(); CandidateClusterContext currentClusterContext = discoveryService.current(); Credentials credentials = currentClusterContext.getCredentialsFactory().newCredentials(); String clusterName = currentClusterContext.getClusterName(); currentCredentials = credentials; if (credentials instanceof PasswordCredentials) { PasswordCredentials cr = (PasswordCredentials) credentials; return ClientAuthenticationCodec .encodeRequest(clusterName, cr.getName(), cr.getPassword(), clientUuid, connectionType, serializationVersion, BuildInfoProvider.getBuildInfo().getVersion(), client.getName(), labels); } else { Data data; if (credentials instanceof TokenCredentials) { data = new HeapData(((TokenCredentials) credentials).getToken()); } else { data = ss.toData(credentials); } return ClientAuthenticationCustomCodec.encodeRequest(clusterName, data, clientUuid, connectionType, serializationVersion, BuildInfoProvider.getBuildInfo().getVersion(), client.getName(), labels); } }
Source:
<code>public void testAssetReviews() throws InvalidJsonAssetException, IOException { Asset a = addLittleAsset("weather", "hot", "ground", "flat", "description", "lovely"); List<Map<String, Object>> ars = repository.getAssetReviews(a.get_id()); assertEquals("Should be an empty List", 0, ars.size()); RepositoryContext userRepo = RepositoryContext.toUserContext(repository); <START> try { <END> userRepo.getAssetReviews(a.get_id()); } catch (AssertionError e) { assertThat(e.getMessage(), containsString("Unexpected status code: 404")); } }</code><technical_language>Generally, catching AssertionError, methods for operation RepositoryContext: expects succeed returns result another expects fail a error code returns nothing</technical_language>

Target:
public void testAssetReviews() throws InvalidJsonAssetException, IOException { Asset a = addLittleAsset("weather", "hot", "ground", "flat", "description", "lovely"); List<Map<String, Object>> ars = repository.getAssetReviews(a.get_id()); assertEquals("Should be an empty List", 0, ars.size()); RepositoryContext userRepo = RepositoryContext.toUserContext(repository); userRepo.getAssetReviewsBad(a.get_id(), 404, "asset not found for id: " + a.get_id()); }
Source:
<code><START> public String sameSite() { <END> return sameSite; }</code><technical_language>@dvlato please add some java docs</technical_language>

Target:
public SameSite sameSite() { return sameSite; }
Source:
<code><START> public List<FieldInfo> createFieldInfoMap(String str) <END> { fieldInfos = new ArrayList<FieldInfo>(); StringTokenizer strtok = new StringTokenizer(str, RECORD_SEPARATOR); while (strtok.hasMoreTokens()) { String[] token = strtok.nextToken().split(FIELD_SEPARATOR); fieldInfos.add(new FieldInfo(token[0], token[1], SupportType.valueOf(token[2]))); } return fieldInfos; }</code><technical_language>this private</technical_language>

Target:
private List<FieldInfo> createFieldInfoMap(String str) { fieldInfos = new ArrayList<FieldInfo>(); StringTokenizer strtok = new StringTokenizer(str, RECORD_SEPARATOR); while (strtok.hasMoreTokens()) { String[] token = strtok.nextToken().split(FIELD_SEPARATOR); try { fieldInfos.add(new FieldInfo(token[0], token[1], SupportType.valueOf(token[2]))); } catch (Exception e) { LOG.error("Invalid support type", e); } } return fieldInfos; }
Source:
<code>public void emitsError_whenResponseCodeIsInvalid() throws IOException { given(httpClient.execute(requestCreator.createDownloadRequest(ANY_RAW_URL))).willReturn(INVALID_RESPONSE); networkFileDownloader.startDownloading(ANY_RAW_URL, UNKNOWN_FILE_SIZE, callback); String expectedCause = String.format( "Request: %s with response code: %s failed.", ANY_RAW_URL, 418 <START> ); <END> verify(callback).onError(expectedCause); }</code><technical_language>define a constant string. feels code test</technical_language>

Target:
public void emitsError_whenResponseCodeIsInvalid() throws IOException { given(httpClient.execute(requestCreator.createDownloadRequest(ANY_RAW_URL))).willReturn(INVALID_RESPONSE); networkFileDownloader.startDownloading(ANY_RAW_URL, UNKNOWN_FILE_SIZE, callback); String expectedCause = "Request: <LINK_0> with response code: 418 failed."; verify(callback).onError(expectedCause); }