auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testDefault() throws Exception { final DefaultConfiguration checkConfig = createConfig(false); final String[] expected = { "19:25: " + getCheckMessage(MSG_FILE_CONTAINS_TAB), }; final File[] files = { <START> new File(getPath("SimpleFileTabCharacterInput.java")), <END> }; verify(createChecker(checkConfig), files, getPath("SimpleFileTabCharacterInput.java"), expected); }</code><technical_language>Input files named tests. FileTabCharacterCheckTest's inputs named InputFileTabCharacter...</technical_language>

Target:
public void testDefault() throws Exception { final DefaultConfiguration checkConfig = createConfig(false); final String[] expected = { "19:25: " + getCheckMessage(MSG_FILE_CONTAINS_TAB), }; final File[] files = { new File(getPath("InputFileTabCharacterSimple.java")), }; verify(createChecker(checkConfig), files, getPath("InputFileTabCharacterSimple.java"), expected); }
Source:
<code>public void checkInConnection(ConnectedChannel connectedChannel) { final Timer.Context context = connectionCheckInTime.time(); try { BlockingChannelInfo blockingChannelInfo = connections.get(connectedChannel.getRemoteHost() + connectedChannel.getRemotePort()); if (blockingChannelInfo == null) { logger.error("Unexpected state in connection pool. Host and port not found to checkin connection", connectedChannel.getRemoteHost(), connectedChannel.getRemotePort()); throw new IllegalArgumentException("Connection does not belong to the pool"); } blockingChannelInfo.releaseBlockingChannel((BlockingChannel) connectedChannel); <START> logger.trace("CheckingIn connection for host and port {}", connectedChannel.getRemoteHost(), <END> connectedChannel.getRemotePort()); } finally { context.stop(); } }</code><technical_language>"checking in"</technical_language>

Target:
public void checkInConnection(ConnectedChannel connectedChannel) { final Timer.Context context = connectionCheckInTime.time(); try { BlockingChannelInfo blockingChannelInfo = connections.get(connectedChannel.getRemoteHost() + connectedChannel.getRemotePort()); if (blockingChannelInfo == null) { logger.error("Unexpected state in connection pool. Host and port not found to checkin connection", connectedChannel.getRemoteHost(), connectedChannel.getRemotePort()); throw new IllegalArgumentException("Connection does not belong to the pool"); } blockingChannelInfo.releaseBlockingChannel((BlockingChannel) connectedChannel); logger.trace("Checking in connection for host and port {}", connectedChannel.getRemoteHost(), connectedChannel.getRemotePort()); } finally { context.stop(); } }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_image); ButterKnife.bind(this); FirebaseAuth.getInstance().signInAnonymously() .addOnCompleteListener(new OnCompleteListener<AuthResult>() { @Override public void onComplete(@NonNull Task<AuthResult> task) { Log.d(TAG, "signInAnonymously:" + task.isSuccessful()); if (!task.isSuccessful()) { Log.w(TAG, "signInAnonymously", task.getException()); Toast.makeText(ImageActivity.this, <START> "Authentication failed, uploads and downloads will not work.", <END> Toast.LENGTH_SHORT).show(); } } }); }</code><technical_language>include a resolution step here: enable auth change rules (or strange happened)</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_image); ButterKnife.bind(this); FirebaseAuth.getInstance().signInAnonymously() .addOnCompleteListener(new OnCompleteListener<AuthResult>() { @Override public void onComplete(@NonNull Task<AuthResult> task) { Log.d(TAG, "signInAnonymously:" + task.isSuccessful()); if (!task.isSuccessful()) { Log.w(TAG, "signInAnonymously", task.getException()); Log.w(TAG, getString(R.string.anonymous_auth_failed_msg)); Toast.makeText(ImageActivity.this, getString(R.string.anonymous_auth_failed_toast), Toast.LENGTH_SHORT).show(); } } }); }
Source:
<code>public void matchesDifferentTypes() throws IOException { MatcherAssert.assertThat( new FkContentType( "application/json charset=utf-8", FkContentTypeTest.createTakeWithEmptyResponse() <START> ).route( <END> new RqWithHeader( new RqFake(), FkContentTypeTest.CONTENT_TYPE, "images/*" ) ).has(), Matchers.is(false) ); }</code><technical_language>@dalifreire wrong indentation</technical_language>

Target:
public void matchesDifferentTypes() throws IOException { MatcherAssert.assertThat( new FkContentType( "application/json charset=utf-8", FkContentTypeTest.emptyResponse() ).route( new RqWithHeader( new RqFake(), FkContentTypeTest.CONTENT_TYPE, "images/*" ) ).has(), Matchers.is(false) ); }
Source:
<code>public static void reset() { injectors.clear(); resourceListeners.clear(); viewListeners.clear(); try { Guice.setAnnotationDatabasePackageNames(null); Guice.setHierarchyTraversalFilterFactory(new HierarchyTraversalFilterFactory()); } catch (AnnotationDatabaseNotFoundException e) { <START> Log.e(RoboGuice.class.getName(), "Unable to clear annotation database.", e); <END> } }</code><technical_language>Is a reason Ln? use: Ln.e(e, "Unable clear annotation database.");</technical_language>

Target:
public static void reset() { injectors.clear(); resourceListeners.clear(); viewListeners.clear(); try { Guice.setAnnotationDatabasePackageNames(null); Guice.setHierarchyTraversalFilterFactory(new HierarchyTraversalFilterFactory()); } catch (AnnotationDatabaseNotFoundException e) { Ln.e(e, "Unable to clear annotation database."); } }
Source:
<code>public void shouldNotSaveTaskWithDuplicateName() { when(tasksDataService.findTasksByName("name")).thenReturn( asList(new Task("name", trigger, asList(action)))); Task t = new Task("name", trigger, asList(action), null, false, false); <START> taskService.save(t); <END> }</code><technical_language>verify in finally block, more interactions TasksDataService</technical_language>

Target:
public void shouldNotSaveTaskWithDuplicateName() { when(tasksDataService.findTasksByName("name")).thenReturn( asList(new Task("name", trigger, asList(action)))); Task t = new Task("name", trigger, asList(action), null, false, false); try { taskService.save(t); } finally { verify(tasksDataService, times(1)).findTasksByName(t.getName()); verifyNoMoreInteractions(tasksDataService); } }
Source:
<code>void recognizeNotScheduled() { <START> final Command cmd = requestFactory.createCommand(StringValue.getDefaultInstance()); <END> assertFalse(Commands.isScheduled(cmd)); }</code><technical_language>do final again</technical_language>

Target:
void recognizeNotScheduled() { Command cmd = requestFactory.createCommand(STR_MSG); assertFalse(Commands.isScheduled(cmd)); }
Source:
<code>private PositionalBufferedStream initIndexablePositionalStream(final File inputFile) { try { final FileInputStream fileStream = new FileInputStream(inputFile); return new PositionalBufferedStream(fileStream); } catch (final FileNotFoundException e) { throw new TribbleException.FeatureFileDoesntExist("Unable to open the input file, most likely the file doesn't exist.", inputFile.getAbsolutePath()); <START> } catch (final IOException e) { <END> throw new TribbleException.MalformedFeatureFile("Error initializing stream", inputFile.getAbsolutePath(), e); } }</code><technical_language>lets get npr in exceptions</technical_language>

Target:
private PositionalBufferedStream initIndexablePositionalStream(final File inputFile) { try { final FileInputStream fileStream = new FileInputStream(inputFile); return new PositionalBufferedStream(fileStream); } catch (final FileNotFoundException e) { throw new TribbleException.FeatureFileDoesntExist("Unable to open the input file, most likely the file doesn't exist.", inputFile.getAbsolutePath()); } }
Source:
<code>private void normalizeMemory(Container container, InternalMachineConfig machineConfig) { long ramLimit = Containers.getRamLimit(container); if (ramLimit == 0) { machineConfig.getAttributes().put(MEMORY_LIMIT_ATTRIBUTE, defaultSidecarMemoryLimitBytes); } String overriddenSidecarMemLimit = <START> wsAttributes.get(format(SIDECAR_MEMORY_LIMIT_ATTR_TEMPLATE, pluginPublisherName)); <END> if (!isNullOrEmpty(overriddenSidecarMemLimit)) { machineConfig .getAttributes() .put( MEMORY_LIMIT_ATTRIBUTE, Long.toString(KubernetesSize.toBytes(overriddenSidecarMemLimit))); } }</code><technical_language>Please java doc of this constant[1] is date usages correct, I suppose pluginPublisherName/pluginName instead of pluginPublisherName [1] <LINK_0></technical_language>

Target:
private void normalizeMemory(Container container, InternalMachineConfig machineConfig) { long ramLimit = Containers.getRamLimit(container); if (ramLimit == 0) { machineConfig.getAttributes().put(MEMORY_LIMIT_ATTRIBUTE, defaultSidecarMemoryLimitBytes); } String overriddenSidecarMemLimit = wsAttributes.get(format(SIDECAR_MEMORY_LIMIT_ATTR_TEMPLATE, pluginPublisherAndName)); if (!isNullOrEmpty(overriddenSidecarMemLimit)) { machineConfig .getAttributes() .put( MEMORY_LIMIT_ATTRIBUTE, Long.toString(KubernetesSize.toBytes(overriddenSidecarMemLimit))); } }
Source:
<code>public StorageBlockingStub buildBlockingStub() { return StorageGrpc.newBlockingStub( <START> ComputeEngineChannelBuilder.forAddress(readOptions.getGrpcHostname(), 443) <END> .defaultServiceConfig(getGrpcServiceConfig()) .build()); }</code><technical_language>ComputeEngineChannelBuilder.forTarget(String) method allow override a hostname scheme port too. sue instead a greater flexibility</technical_language>

Target:
public StorageBlockingStub buildBlockingStub() { return StorageGrpc.newBlockingStub( ComputeEngineChannelBuilder.forTarget(readOptions.getGrpcServerAddress()) .defaultServiceConfig(getGrpcServiceConfig()) .build()); }
Source:
<code><START> @Override public void publish(Payload<?, ?, ?, ?> requestPayload, Message originalMessage) { <END> publish(requestPayload, originalMessage, null); }</code><technical_language>newline missing</technical_language>

Target:
public void publish(Payload<?, ?, ?, ?> requestPayload, Message originalMessage) { publish(requestPayload, originalMessage, null); }
Source:
<code>private void configurePropertyValues() { appExtPropertiesFile = Utils.loadProperties(CCM_PROPERTY_FILE_PATH); appExtSecurePropertiesFile = Utils.loadProperties(CCM_SECURE_PROPERTY_FILE_PATH); if(appExtSecurePropertiesFile!=null) { canvasToken = appExtSecurePropertiesFile.getProperty(SectionUtilityToolFilter.PROPERTY_CANVAS_ADMIN); canvasURL = appExtSecurePropertiesFile.getProperty(SectionUtilityToolFilter.PROPERTY_CANVAS_URL); isStubTesting = Boolean.valueOf( appExtPropertiesFile.getProperty(SectionUtilityToolFilter.PROPERTY_TEST_STUB)); <START> Utils.canvasToken = canvasToken; <END> Utils.canvasURL = canvasURL; M_log.debug("isStubTesting: " + isStubTesting); } else { M_log.error("Failed to load system properties(sectionsToolProps.properties) for SectionsTool"); } }</code><technical_language>1 variable holding canvasToken(URL)</technical_language>

Target:
private void configurePropertyValues() { appExtPropertiesFile = Utils.loadProperties(CCM_PROPERTY_FILE_PATH); appExtSecurePropertiesFile = Utils.loadProperties(CCM_SECURE_PROPERTY_FILE_PATH); if(appExtSecurePropertiesFile!=null) { Utils.canvasToken = appExtSecurePropertiesFile.getProperty(SectionUtilityToolFilter.PROPERTY_CANVAS_ADMIN); Utils.canvasURL = appExtSecurePropertiesFile.getProperty(SectionUtilityToolFilter.PROPERTY_CANVAS_URL); isStubTesting = Boolean.valueOf(appExtPropertiesFile.getProperty(SectionUtilityToolFilter.PROPERTY_TEST_STUB)); M_log.debug("isStubTesting: " + isStubTesting); } else { M_log.error("Failed to load system properties(sectionsToolProps.properties) for SectionsTool"); } }
Source:
<code><START> public Boolean loadGestures(String directory) { <END> String extension = "py"; Integer totalLoaded = 0; Integer totalError = 0; File dir = Utils.makeDirectory(directory); if (dir.exists()) { for (File f : dir.listFiles()) { if (FilenameUtils.getExtension(f.getAbsolutePath()).equalsIgnoreCase(extension)) { if (Utils.loadFile(f.getAbsolutePath()) == true) { totalLoaded += 1; gesturesList.add(f.getName()); } else { totalError += 1; } } else { log.warn("{} is not a file", f.getAbsolutePath(), extension); } } } info("%s Gestures loaded, %s Gestures with error", totalLoaded, totalError); return ((totalError == 0) ? true : false); }</code><technical_language>return a native "boolean" a Boolean here. Booleans null. This method, if returns true false. "null" is a Boolean a return type</technical_language>

Target:
public boolean loadGestures(String directory) { String extension = "py"; Integer totalLoaded = 0; Integer totalError = 0; File dir = Utils.makeDirectory(directory); if (dir.exists()) { for (File f : dir.listFiles()) { if (FilenameUtils.getExtension(f.getAbsolutePath()).equalsIgnoreCase(extension)) { if (Utils.loadFile(f.getAbsolutePath()) == true) { totalLoaded += 1; gesturesList.add(f.getName()); } else { totalError += 1; } } else { log.warn("{} is not a file", f.getAbsolutePath(), extension); } } } info("%s Gestures loaded, %s Gestures with error", totalLoaded, totalError); return ((totalError == 0) ? true : false); }
Source:
<code>public void setReplyAddress(String replyAddress) { <START> synchronized (this) { <END> this.replyAddress = replyAddress; this.evaluatedFastReplyTo = false; } }</code><technical_language>I need in setter. This method is called application context initialization is done in single. Thread. properties concurrent environment, is done this initialization phase. So, point is safe do synchronize in setter. hurt anyway. Especially for case create this RabbitTemplate object manually run time forget synchronize it... @garyrussell , WDYT</technical_language>

Target:
public synchronized void setReplyAddress(String replyAddress) { this.replyAddress = replyAddress; this.evaluatedFastReplyTo = false; }
Source:
<code>public void endWindow() { if (--maxCountOfWindows == 0) { <START> throw new RuntimeException(new InterruptedException("Finished generating data.")); <END> } }</code><technical_language>throw ShutdownException if need gracefully shutdown Operator</technical_language>

Target:
public void endWindow() { if (--maxCountOfWindows == 0) { throw new ShutdownException(); } }
Source:
<code>public void close(ErrorCondition errorCondition) { <START> if (scheduledPool != null && scheduledPool instanceof ThreadPoolExecutor && <END> scheduledFuture != null && scheduledFuture instanceof RunnableScheduledFuture) { ((ThreadPoolExecutor) scheduledPool).remove((RunnableScheduledFuture)scheduledFuture); } handler.close(errorCondition, this); }</code><technical_language>call cancel future pool remove (just for likelihood other similar declarations) wildcard typed version of ScheduledFuture<?></technical_language>

Target:
public void close(ErrorCondition errorCondition) { synchronized (schedulingLock) { isSchedulingCancelled = true; if (scheduledPool != null && scheduledPool instanceof ThreadPoolExecutor && scheduledFuture != null && scheduledFuture instanceof Runnable) { if (!((ThreadPoolExecutor) scheduledPool).remove((Runnable) scheduledFuture)) { log.warn("Scheduled task can't be removed from scheduledPool."); } } } handler.close(errorCondition, this); }
Source:
<code>public BulkResponse executeRequest() { if (bulkRequest.numberOfActions() == 0) { return null; } <START> logger.trace("[{}] ES API CALL: bulk request with actions", jobId, bulkRequest.numberOfActions()); <END> BulkResponse bulkResponse = resultsPersisterService.bulkIndexWithRetry( bulkRequest, jobId, shouldRetry, msg -> auditor.warning(jobId, "Bulk indexing of annotations failed " + msg)); bulkRequest = new BulkRequest(AnnotationIndex.WRITE_ALIAS_NAME); return bulkResponse; }</code><technical_language>nit: bulkRequest.numberOfActions() a Supplier is called if trace logging is enabled. suggestion logger.trace("[{}] ES API CALL: bulk request actions", () -> jobId, () -> bulkRequest.numberOfActions());</technical_language>

Target:
public BulkResponse executeRequest() { if (bulkRequest.numberOfActions() == 0) { return null; } logger.trace("[{}] ES API CALL: bulk request with actions", () -> jobId, () -> bulkRequest.numberOfActions()); BulkResponse bulkResponse = resultsPersisterService.bulkIndexWithRetry( bulkRequest, jobId, shouldRetry, msg -> auditor.warning(jobId, "Bulk indexing of annotations failed " + msg)); bulkRequest = new BulkRequest(AnnotationIndex.WRITE_ALIAS_NAME); return bulkResponse; }
Source:
<code>protected SearchQuery setTextFilter(String textField, String queryString){ String sanitizedQueryString; <START> if(isValidEmailAddress(queryString)){ <END> sanitizedQueryString = queryString.toLowerCase().trim(); }else{ sanitizedQueryString = Sanitizer.sanitizeForSearch(queryString).toLowerCase().trim(); } if(!sanitizedQueryString.isEmpty()){ String preparedOrQueryString = prepareOrQueryString(sanitizedQueryString); this.textQueryStrings.add(textField + ":" + preparedOrQueryString); } return this; }</code><technical_language>Please put a space parenthesis. if (isValidEmailAddress(queryString)) {</technical_language>

Target:
protected SearchQuery setTextFilter(String textField, String queryString){ String sanitizedQueryString; if(FieldValidator.isValidEmailAddress(queryString)){ sanitizedQueryString = queryString.toLowerCase().trim(); } else { sanitizedQueryString = Sanitizer.sanitizeForSearch(queryString).toLowerCase().trim(); } if(!sanitizedQueryString.isEmpty()){ String preparedOrQueryString = prepareOrQueryString(sanitizedQueryString); this.textQueryStrings.add(textField + ":" + preparedOrQueryString); } return this; }
Source:
<code>public synchronized void runInner() { if (LOGGER.isTraceEnabled()) { LOGGER.trace("sending heartbeat to server"); } sendMessageToMaster(IPCUtils.CONTROL_WORKER_HEARTBEAT).awaitUninterruptibly(); List<ResourceStats> resourceUsage = new ArrayList<ResourceStats>(); collectResourceMeasurements(resourceUsage); sendMessageToMaster(IPCUtils.resourceReport(resourceUsage)).awaitUninterruptibly(); <START> for (ResourceStats stats : resourceUsage) { <END> profilingLogger.recordResource(stats); } }</code><technical_language>if resource profiling mode is enabled only</technical_language>

Target:
public synchronized void runInner() { LOGGER.trace("sending heartbeat to server"); sendMessageToMaster(IPCUtils.CONTROL_WORKER_HEARTBEAT).awaitUninterruptibly(); List<ResourceStats> resourceUsage = new ArrayList<ResourceStats>(); collectResourceMeasurements(resourceUsage); sendMessageToMaster(IPCUtils.resourceReport(resourceUsage)).awaitUninterruptibly(); for (ResourceStats stats : resourceUsage) { try { getProfilingLogger().recordResource(stats); } catch (DbException e) { LOGGER.error("Error flushing profiling logger", e); } } }
Source:
<code>private void parseUpdate(final ReceiveCommand cmd) { RefControl ctl = projectControl.controlForRef(cmd.getRefName()); if (ctl.canUpdate()) { if (isHead(cmd) && !isCommit(cmd)) { return; } validateNewCommits(ctl, cmd); <START> if (cmd.getResult().equals(ReceiveCommand.Result.NOT_ATTEMPTED)) { <END> cmd.execute(rp); } } else { if (GitRepositoryManager.REF_CONFIG.equals(ctl.getRefName())) { errors.put(Error.CONFIG_UPDATE, GitRepositoryManager.REF_CONFIG); } else { errors.put(Error.UPDATE, ctl.getRefName()); } reject(cmd, "can not update the reference as a fast forward"); } }</code><technical_language>Is this change related supporting commit validation plugins</technical_language>

Target:
private void parseUpdate(final ReceiveCommand cmd) { RefControl ctl = projectControl.controlForRef(cmd.getRefName()); if (ctl.canUpdate()) { if (isHead(cmd) && !isCommit(cmd)) { return; } validateNewCommits(ctl, cmd); batch.addCommand(cmd); } else { if (GitRepositoryManager.REF_CONFIG.equals(ctl.getRefName())) { errors.put(Error.CONFIG_UPDATE, GitRepositoryManager.REF_CONFIG); } else { errors.put(Error.UPDATE, ctl.getRefName()); } reject(cmd); } }
Source:
<code>public void resetCursors(final String subscriptionId, final List<NakadiCursor> cursors) throws ServiceUnavailableException, NoSuchSubscriptionException, UnableProcessException, OperationTimeoutException, ZookeeperException, InternalNakadiException, NoSuchEventTypeException, InvalidCursorException { if (cursors.isEmpty()) { throw new UnableProcessException("Cursors are absent"); } final Subscription subscription = subscriptionRepository.getSubscription(subscriptionId); validateCursorsBelongToSubscription(subscription, cursors); for (final NakadiCursor cursor : cursors) { <START> cursor.validate(); <END> } final ZkSubscriptionClient zkClient = zkSubscriptionFactory.createClient( subscription, "subscription." + subscriptionId + ".reset_cursors"); final long timeout = TimeUnit.SECONDS.toMillis(nakadiSettings.getDefaultCommitTimeoutSeconds()) + TimeUnit.SECONDS.toMillis(1); zkClient.resetCursors( cursors.stream().map(cursorConverter::convertToNoToken).collect(Collectors.toList()), timeout); }</code><technical_language>this method validates validateSubscriptionResetCursors validate</technical_language>

Target:
public void resetCursors(final String subscriptionId, final List<NakadiCursor> cursors) throws ServiceUnavailableException, NoSuchSubscriptionException, UnableProcessException, OperationTimeoutException, ZookeeperException, InternalNakadiException, NoSuchEventTypeException, InvalidCursorException { final Subscription subscription = subscriptionRepository.getSubscription(subscriptionId); validateCursorsBelongToSubscription(subscription, cursors); for (final NakadiCursor cursor : cursors) { cursor.checkStorageAvailability(); } final Map<TopicRepository, List<NakadiCursor>> topicRepositories = cursors.stream().collect( Collectors.groupingBy( c -> timelineService.getTopicRepository(c.getTimeline()))); for (final Map.Entry<TopicRepository, List<NakadiCursor>> entry: topicRepositories.entrySet()) { entry.getKey().validateReadCursors(entry.getValue()); } final ZkSubscriptionClient zkClient = zkSubscriptionFactory.createClient( subscription, "subscription." + subscriptionId + ".reset_cursors"); final long timeout = TimeUnit.SECONDS.toMillis(nakadiSettings.getDefaultCommitTimeoutSeconds()) + TimeUnit.SECONDS.toMillis(1); zkClient.resetCursors( cursors.stream().map(cursorConverter::convertToNoToken).collect(Collectors.toList()), timeout); }
Source:
<code>private static boolean implementsSerializable(@Nullable Type type) { if (type == null || type.isUnknown()) { return true; } <START> if (type.isPrimitive()) { <END> return true; } if (type.isArray()) { return implementsSerializable(((Type.ArrayType) type).elementType()); } if (type.isClass() || ((JavaType) type).isTagged(JavaType.TYPEVAR)) { return type.erasure().isSubtypeOf("java.io.Serializable"); } return false; }</code><technical_language>merged expression of this if previous one</technical_language>

Target:
private static boolean implementsSerializable(@Nullable Type type) { if (type == null || type.isUnknown() || type.isPrimitive()) { return true; } if (type.isArray()) { return implementsSerializable(((Type.ArrayType) type).elementType()); } if (type.isClass() || ((JavaType) type).isTagged(JavaType.TYPEVAR)) { return type.erasure().isSubtypeOf("java.io.Serializable"); } return false; }
Source:
<code><START> public void setScanId(int scanId) { <END> this.scanId = scanId; }</code><technical_language>This package visibility external code accidentally change it</technical_language>

Target:
void setScanId(int scanId) { this.scanId = scanId; }
Source:
<code>void initSeek() throws IOException { byte[] rawId = new byte[OBJECT_ID_LENGTH]; match.copyRawTo(rawId, 0); byte[] key = Arrays.copyOf(rawId, objIdLen); BlockReader b = objIndex; do { if (b.seekKey(key) > 0) { blockPos = <START> new LongList(0); <END> return; } long pos = b.readPositionFromIndex(); b = readBlock(pos, objEnd); } while (b.type() == INDEX_BLOCK_TYPE); b.seekKey(key); while (b.next()) { b.parseKey(); if (b.match(key, false)) { blockPos = b.readBlockPositionList(); if (blockPos == null) { initScan(); return; } break; } b.skipValue(); } if (blockPos == null) { blockPos = new LongList(0); } if (blockPos.size() > 0) { long pos = blockPos.get(listIdx++); block = readBlock(pos, scanEnd); } }</code><technical_language>Avoid lots of small allocations returning a static EMPTY_LONG_LIST? below</technical_language>

Target:
void initSeek() throws IOException { byte[] rawId = new byte[OBJECT_ID_LENGTH]; match.copyRawTo(rawId, 0); byte[] key = Arrays.copyOf(rawId, objIdLen); BlockReader b = objIndex; do { if (b.seekKey(key) > 0) { blockPos = EMPTY_LONG_LIST; return; } long pos = b.readPositionFromIndex(); b = readBlock(pos, objEnd); } while (b.type() == INDEX_BLOCK_TYPE); b.seekKey(key); while (b.next()) { b.parseKey(); if (b.match(key, false)) { blockPos = b.readBlockPositionList(); if (blockPos == null) { initScan(); return; } break; } b.skipValue(); } if (blockPos == null) { blockPos = EMPTY_LONG_LIST; } if (blockPos.size() > 0) { long pos = blockPos.get(listIdx++); block = readBlock(pos, scanEnd); } }
Source:
<code>public CommonFilterDescriptor[] findVisibleFilters(INavigatorContentService contentService, boolean forUI) { List<CommonFilterDescriptor> visibleFilters = new ArrayList<CommonFilterDescriptor>(); <START> CommonFilterDescriptor descriptor; for (Object element : filters.entrySet()) { descriptor = (CommonFilterDescriptor) ((Map.Entry)element).getValue(); <END> if (forUI && !descriptor.isVisibleInUi()) continue; if (contentService.isVisible(descriptor.getId())) { visibleFilters.add(descriptor); } } if (visibleFilters.size() == 0) { return NO_FILTER_DESCRIPTORS; } return visibleFilters .toArray(new CommonFilterDescriptor[visibleFilters.size()]); }</code><technical_language>replace 3 lines with: for (CommonFilterDescriptor descriptor : filters.values()) {</technical_language>

Target:
public CommonFilterDescriptor[] findVisibleFilters(INavigatorContentService contentService, boolean forUI) { List<CommonFilterDescriptor> visibleFilters = new ArrayList<CommonFilterDescriptor>(); for (CommonFilterDescriptor descriptor : filters.values()) { if (forUI && !descriptor.isVisibleInUi()) continue; if (contentService.isVisible(descriptor.getId())) { visibleFilters.add(descriptor); } } if (visibleFilters.size() == 0) { return NO_FILTER_DESCRIPTORS; } return visibleFilters .toArray(new CommonFilterDescriptor[visibleFilters.size()]); }
Source:
<code>public void testSanityCommand(String... args) { SanityTestCommand cmd = new SanityTestCommand(); <START> assertTrue(cmd.apply(bkFlags, args)); <END> }</code><technical_language>I suggest verifying methods called expected</technical_language>

Target:
public void testSanityCommand(String... args) { SanityTestCommand cmd = new SanityTestCommand(); assertTrue(cmd.apply(bkFlags, args)); try { verifyNew(ClientConfiguration.class, times(1)).withNoArguments(); verify(clientConf, times(1)).addConfiguration(any(Configuration.class)); verify(clientConf, times(1)).setEnsemblePlacementPolicy(LocalBookieEnsemblePlacementPolicy.class); verifyNew(BookKeeper.class).withArguments(clientConf); verify(bk, times(1)).createLedger(1, 1, BookKeeper.DigestType.MAC, new byte[0]); verify(lh, times(6)).getId(); verify(bk, times(1)).openLedger(anyLong(), eq(BookKeeper.DigestType.MAC), eq(new byte[0])); verify(lh, times(1)).getLastAddConfirmed(); verify(bk, times(1)).deleteLedger(anyLong()); verify(bk, times(1)).close(); } catch (Exception e) { throw new UncheckedExecutionException(e.getMessage(), e); } }
Source:
<code>public void testBinaryMinMaxForReusedBackingByteArray() { BinaryStatistics stats = new BinaryStatistics(); byte[] bytes = new byte[] { 10 }; <START> stats.updateStats(Binary.fromReusedByteArray(bytes)); <END> bytes[0] = 20; stats.updateStats(Binary.fromReusedByteArray(bytes)); bytes[0] = 15; stats.updateStats(Binary.fromReusedByteArray(bytes)); assertArrayEquals(new byte[] { 20 }, stats.getMaxBytes()); assertArrayEquals(new byte[] { 10 }, stats.getMinBytes()); }</code><technical_language>able create Binary once, change backing bytes, in call updateStats</technical_language>

Target:
public void testBinaryMinMaxForReusedBackingByteArray() { BinaryStatistics stats = new BinaryStatistics(); byte[] bytes = new byte[] { 10 }; final Binary value = Binary.fromReusedByteArray(bytes); stats.updateStats(value); bytes[0] = 20; stats.updateStats(value); bytes[0] = 15; stats.updateStats(value); assertArrayEquals(new byte[] { 20 }, stats.getMaxBytes()); assertArrayEquals(new byte[] { 10 }, stats.getMinBytes()); }
Source:
<code>public StreamOpenAndCloseFactory getStreamOpenAndCloseFactory() { return new StreamOpenAndCloseFactory() { @Override public StreamOpen createStreamOpen(CharSequence to, CharSequence from, String id, String lang) { <START> StreamOpen streamOpen = new StreamOpen(to, from, id, connectionInternal.connection.getConfiguration().getXmlLang(), StreamOpen.StreamContentNamespace.client); <END> return streamOpen; } @Override public StreamClose createStreamClose() { return StreamClose.INSTANCE; } }; }</code><technical_language>line is pretty long, I method calls fetch arguments. Please introduce a variable for xmlLang it. This improves readability of code</technical_language>

Target:
public StreamOpenAndCloseFactory getStreamOpenAndCloseFactory() { return new StreamOpenAndCloseFactory() { @Override public StreamOpen createStreamOpen(CharSequence to, CharSequence from, String id, String lang) { String xmlLang = connectionInternal.connection.getConfiguration().getXmlLang(); StreamOpen streamOpen = new StreamOpen(to, from, id, xmlLang, StreamOpen.StreamContentNamespace.client); return streamOpen; } @Override public StreamClose createStreamClose() { return StreamClose.INSTANCE; } }; }
Source:
<code>public void unregisterCriticalComponent(CriticalComponent criticalComponent) { for (CriticalComponentImpl csi : this.criticalServiceList) { if (criticalComponent.equals(csi.getCriticalComponent())) { this.criticalServiceList.remove(csi); logger.debug("Critical service " + criticalComponent.getCriticalComponentName() + " removed, " <START> + System.currentTimeMillis()); <END> } } }</code><technical_language>Add break statement</technical_language>

Target:
public void unregisterCriticalComponent(CriticalComponent criticalComponent) { for (CriticalComponentImpl csi : this.criticalComponentList) { if (criticalComponent.equals(csi.getCriticalComponent())) { this.criticalComponentList.remove(csi); logger.debug(new StringBuffer("Critical service ").append(criticalComponent.getCriticalComponentName()) .append(" removed, ").append(System.currentTimeMillis()).toString()); break; } } }
Source:
<code>public boolean apply(final String serverId) { checkNotNull(serverId, "serverId"); <START> logger.trace("looking for state on Server %s", serverId); <END> final Server server = api.getServer(serverId); if (server == null) { throw new IllegalStateException(MessageFormat.format("Server {0} is not found", serverId)); } final VmTools vmTools = server.guest().vmTools(); return vmTools != null && vmTools.runningStatus().equals(VmTools.RunningStatus.RUNNING); }</code><technical_language>"Looking for guest tools state"</technical_language>

Target:
public boolean apply(final String serverId) { checkNotNull(serverId, "serverId"); logger.trace("looking for guest tools state on Server %s", serverId); final Server server = api.getServer(serverId); if (server == null) { throw new IllegalStateException(String.format("Server %s is not found", serverId)); } final VmTools vmTools = server.guest().vmTools(); return vmTools != null && vmTools.runningStatus() == VmTools.RunningStatus.RUNNING; }
Source:
<code>public void shouldReportXssInParagraph() throws NullPointerException, IOException { String test = "/shouldReportXssInParagraph/"; this.nano.addHandler(new NanoServerHandler(test) { @Override protected Response serve(IHTTPSession session) { <START> List<String> nameList = session.getParameters().get("name"); <END> String response; if (nameList != null) { response = getHtml("InputInParagraph.html", createResponseMatrix("name",nameList)); } else { response = getHtml("NoInput.html"); } return newFixedLengthResponse(response); } }); HttpMessage msg = this.getHttpMessage(test + "?name=test"); this.rule.init(msg, this.parent); this.rule.scan(); assertThat(alertsRaised.size(), equalTo(1)); assertThat(alertsRaised.get(0).getEvidence(), equalTo("</p><script>alert(1);</script><p>")); assertThat(alertsRaised.get(0).getParam(), equalTo("name")); assertThat(alertsRaised.get(0).getAttack(), equalTo("</p><script>alert(1);</script><p>")); assertThat(alertsRaised.get(0).getRisk(), equalTo(Alert.RISK_HIGH)); assertThat(alertsRaised.get(0).getConfidence(), equalTo(Alert.CONFIDENCE_MEDIUM)); }</code><technical_language>introduce a new class method in NanoServerHandler instead (e.g. protected static String getFirstParamValue(IHTTPSession session, String param)) simplify common test case, parameter name</technical_language>

Target:
public void shouldReportXssInParagraph() throws NullPointerException, IOException { String test = "/shouldReportXssInParagraph/"; this.nano.addHandler(new NanoServerHandler(test) { @Override protected Response serve(IHTTPSession session) { String name = getFirstParamValue(session,"name"); String response; if (name != null) { response = getHtml("InputInParagraph.html", new String[][] {{"name", name}}); } else { response = getHtml("NoInput.html"); } return newFixedLengthResponse(response); } }); HttpMessage msg = this.getHttpMessage(test + "?name=test"); this.rule.init(msg, this.parent); this.rule.scan(); assertThat(alertsRaised.size(), equalTo(1)); assertThat(alertsRaised.get(0).getEvidence(), equalTo("</p><script>alert(1);</script><p>")); assertThat(alertsRaised.get(0).getParam(), equalTo("name")); assertThat(alertsRaised.get(0).getAttack(), equalTo("</p><script>alert(1);</script><p>")); assertThat(alertsRaised.get(0).getRisk(), equalTo(Alert.RISK_HIGH)); assertThat(alertsRaised.get(0).getConfidence(), equalTo(Alert.CONFIDENCE_MEDIUM)); }
Source:
<code>private void setContextParameterIfAbsent(final JBossWebMetaData webMetaData, final String name, final String value) { List<ParamValueMetaData> contextParams = webMetaData.getContextParams(); if (contextParams == null) { contextParams = new ArrayList<ParamValueMetaData>(); webMetaData.setContextParams(contextParams); } <START> boolean paramFound = contextParams.stream().anyMatch(param -> name.equals(param.getParamName()) && param.getParamValue() != null); <END> if (! paramFound) { ParamValueMetaData param = new ParamValueMetaData(); param.setParamName(name); param.setParamValue(value); contextParams.add(param); } }</code><technical_language>Please switch a basic for loop. Lambdas expensive in terms of class storage space</technical_language>

Target:
private void setContextParameterIfAbsent(final JBossWebMetaData webMetaData, final String name, final String value) { List<ParamValueMetaData> contextParams = webMetaData.getContextParams(); if (contextParams == null) { contextParams = new ArrayList<>(); webMetaData.setContextParams(contextParams); } for (ParamValueMetaData param : contextParams) { if (name.equals(param.getParamName()) && param.getParamValue() != null) { return; } } ParamValueMetaData param = new ParamValueMetaData(); param.setParamName(name); param.setParamValue(value); contextParams.add(param); }
Source:
<code>private void configurePipes(URL backendUrl, Persona persona) { URL pipeUrl = Urls.getUrl(backendUrl, BackendPipes.Paths.ROOT); <START> URL alertReslveUrl = Urls.getUrl(pipeUrl, BackendPipes.Paths.ALERT_RESOLVE); <END> URL alertAckUrl = Urls.getUrl(pipeUrl, BackendPipes.Paths.ALERT_ACKNOWLEDGE); List<PipeModule> pipeModules = Arrays.asList( getAuthorizationModule(), getPersonnelModule(persona)); configurePipe(BackendPipes.Names.ALERTS, pipeUrl, pipeModules, Alert.class); configurePipe(BackendPipes.Names.ALERT_ACKNOWLEDGE, alertAckUrl, pipeModules, String.class); configurePipe(BackendPipes.Names.ALERT_RESOLVE, alertReslveUrl, pipeModules, String.class); configurePipe(BackendPipes.Names.ENVIRONMENTS, pipeUrl, pipeModules, Environment.class); configurePipe(BackendPipes.Names.METRICS, pipeUrl, pipeModules, Metric.class); configurePipe(BackendPipes.Names.METRIC_DATA_AVAILABILITY, pipeUrl, pipeModules, MetricData.class); configurePipe(BackendPipes.Names.METRIC_DATA_GAUGE, pipeUrl, pipeModules, MetricData.class); configurePipe(BackendPipes.Names.PERSONA, backendUrl, pipeModules, Persona.class); configurePipe(BackendPipes.Names.PERSONAS, backendUrl, pipeModules, Persona.class); configurePipe(BackendPipes.Names.RESOURCES, pipeUrl, pipeModules, Resource.class); configurePipe(BackendPipes.Names.TRIGGERS, pipeUrl, pipeModules, Trigger.class); }</code><technical_language>Minor (and blocker, of course). Suggestion: alertResolveUrl a name of variable</technical_language>

Target:
private void configurePipes(URL backendUrl, Persona persona) { URL pipeUrl = Urls.getUrl(backendUrl, BackendPipes.Paths.ROOT); URL alertResolveUrl = Urls.getUrl(pipeUrl, BackendPipes.Paths.ALERT_RESOLVE); URL alertAckUrl = Urls.getUrl(pipeUrl, BackendPipes.Paths.ALERT_ACKNOWLEDGE); List<PipeModule> pipeModules = Arrays.asList( getAuthorizationModule(), getPersonnelModule(persona)); configurePipe(BackendPipes.Names.ALERTS, pipeUrl, pipeModules, Alert.class); configurePipe(BackendPipes.Names.ALERT_ACKNOWLEDGE, alertAckUrl, pipeModules, String.class); configurePipe(BackendPipes.Names.ALERT_RESOLVE, alertResolveUrl, pipeModules, String.class); configurePipe(BackendPipes.Names.ENVIRONMENTS, pipeUrl, pipeModules, Environment.class); configurePipe(BackendPipes.Names.METRICS, pipeUrl, pipeModules, Metric.class); configurePipe(BackendPipes.Names.METRIC_DATA_AVAILABILITY, pipeUrl, pipeModules, MetricData.class); configurePipe(BackendPipes.Names.METRIC_DATA_GAUGE, pipeUrl, pipeModules, MetricData.class); configurePipe(BackendPipes.Names.PERSONA, backendUrl, pipeModules, Persona.class); configurePipe(BackendPipes.Names.PERSONAS, backendUrl, pipeModules, Persona.class); configurePipe(BackendPipes.Names.RESOURCES, pipeUrl, pipeModules, Resource.class); configurePipe(BackendPipes.Names.TRIGGERS, pipeUrl, pipeModules, Trigger.class); }
Source:
<code>private List<Boolean> createBooleanValuesNoNull() { List<Boolean> values = new ArrayList<>(); <START> for (int i = 0; i < 10_000_000; ++i) { <END> values.add(random.nextBoolean()); } return values; }</code><technical_language>want 10_000_000 a constant</technical_language>

Target:
private List<Boolean> createBooleanValuesNoNull() { List<Boolean> values = new ArrayList<>(); for (int i = 0; i < ROWS; ++i) { values.add(random.nextBoolean()); } return values; }
Source:
<code>public boolean isEmpty(){ <START> return getItems() == null || getItems().size() == 0; <END> }</code><technical_language>items null, ArrayList (as List Collection) isEmpty() method itself..</technical_language>

Target:
public boolean isEmpty(){ return getItems() == null || getItems().isEmpty(); }
Source:
<code>static Image getAmiImage(AmazonEC2 ec2, String ami) { <START> List<String> images = new LinkedList<>(); <END> images.add(ami); List<String> owners = new LinkedList<>(); List<String> users = new LinkedList<>(); DescribeImagesRequest request = new DescribeImagesRequest(); request.setImageIds(images); request.setOwners(owners); request.setExecutableUsers(users); List<Image> img = ec2.describeImages(request).getImages(); if (img == null || img.isEmpty()) { return null; } else { return img.get(0); } }</code><technical_language>Collections.singleton() empty() simplify this (even if moved this)</technical_language>

Target:
static Image getAmiImage(AmazonEC2 ec2, String ami) { List<String> images = Collections.singletonList(ami); List<String> owners = Collections.emptyList(); List<String> users = Collections.emptyList(); DescribeImagesRequest request = new DescribeImagesRequest(); request.setImageIds(images); request.setOwners(owners); request.setExecutableUsers(users); List<Image> img = ec2.describeImages(request).getImages(); if (img == null || img.isEmpty()) { return null; } else { return img.get(0); } }
Source:
<code>public int available() { return readableStreamChannel.getSize() - totalBytesRead.get() < Integer.MAX_VALUE ? <START> (int) readableStreamChannel.getSize() - totalBytesRead.get() : Integer.MAX_VALUE; <END> }</code><technical_language>careful casting long int - basically cast a long > Integer.MAX_VALUE int. casting early, cast finding difference is guaranteed Integer.MAX_VALUE. This return readableStreamChannel.getSize() - totalBytesRead.get() < Integer.MAX_VALUE ? (int) (readableStreamChannel.getSize() - totalBytesRead.get()) : Integer.MAX_VALUE;</technical_language>

Target:
public int available() { return readableStreamChannel.getSize() - totalBytesRead < Integer.MAX_VALUE ? (int) (readableStreamChannel.getSize() - totalBytesRead) : Integer.MAX_VALUE; }
Source:
<code>public void onValueChanged() { view.setEnableCommitButton( <START> !view.getMessage().isEmpty() <END> && (!selectableChangesPanelPresenter.getSelectedFiles().isEmpty() || view.isAmend())); }</code><technical_language>Rename getCommitMessage</technical_language>

Target:
public void onValueChanged() { view.setEnableCommitButton( !view.getCommitMessage().isEmpty() && (!selectableChangesPanelPresenter.getSelectedFiles().isEmpty() || view.isAmend())); }
Source:
<code>private static boolean isRaise(AstNode statementList) { <START> return statementList.getFirstChild().getFirstDescendant(PythonGrammar.RAISE_STMT) != null; <END> }</code><technical_language>@ivandalbosco minor: replace ... getFirstDescendant(PythonGrammar.RAISE_STMT) != null hasDescendant(...)</technical_language>

Target:
private static boolean isRaise(AstNode statementList) { return statementList.getFirstChild().hasDescendant(PythonGrammar.RAISE_STMT); }
Source:
<code>public void testCXidRollover() throws Exception { TestableZooKeeper zk = null; try { zk = createClient(); zk.setXid(Integer.MAX_VALUE - 10); zk.create("/testnode", "".getBytes(), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); for (int i = 0; i < 20; ++i) { final CountDownLatch latch = new CountDownLatch(1); final AtomicInteger rc = new AtomicInteger(0); zk.setData("/testnode", "".getBytes(), -1, new AsyncCallback.StatCallback() { @Override public void processResult(int retcode, String path, Object ctx, Stat stat) { rc.set(retcode); latch.countDown(); } }, null); Assert.assertTrue("setData should complete within 5s", <START> latch.await(5, TimeUnit.SECONDS)); <END> Assert.assertEquals("setData should have succeeded", Code.OK.intValue(), rc.get()); } zk.delete("/testnode", -1); Assert.assertTrue("xid should be positive", zk.checkXid() > 0); } finally { if (zk != null) { zk.close(); } } }</code><technical_language>this is generally anti-pattern in tests leads flakey tests. e.g. some test environments oversubscribed. suggest large, e.g. 30 seconds session timeout</technical_language>

Target:
public void testCXidRollover() throws Exception { TestableZooKeeper zk = null; try { zk = createClient(); zk.setXid(Integer.MAX_VALUE - 10); zk.create("/testnode", "".getBytes(), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); for (int i = 0; i < 20; ++i) { final CountDownLatch latch = new CountDownLatch(1); final AtomicInteger rc = new AtomicInteger(0); zk.setData("/testnode", "".getBytes(), -1, new AsyncCallback.StatCallback() { @Override public void processResult(int retcode, String path, Object ctx, Stat stat) { rc.set(retcode); latch.countDown(); } }, null); Assert.assertTrue("setData should complete within 5s", latch.await(zk.getSessionTimeout(), TimeUnit.MILLISECONDS)); Assert.assertEquals("setData should have succeeded", Code.OK.intValue(), rc.get()); } zk.delete("/testnode", -1); Assert.assertTrue("xid should be positive", zk.checkXid() > 0); } finally { if (zk != null) { zk.close(); } } }
Source:
<code>protected String parseString(GraphicalEditPart editPart, Collection<String> displayValue) { NamedElement namedElement = getUMLElement(editPart); StringBuilder buffer = new StringBuilder(); if <START> (displayValue.contains("stereotype")) <END> { buffer.append(stereotypesToDisplay((GraphicalEditPart) editPart.getParent())); } if (namedElement != null) { buffer.append(getCustomLabel(namedElement, displayValue)); } return buffer.toString(); }</code><technical_language>Move a Constant</technical_language>

Target:
protected String parseString(GraphicalEditPart editPart, Collection<String> displayValue) { NamedElement namedElement = getUMLElement(editPart); StringBuilder buffer = new StringBuilder(); if (displayValue.contains(STEREOTYPE)) { buffer.append(stereotypesToDisplay((GraphicalEditPart) editPart.getParent())); } if (namedElement != null) { buffer.append(getCustomLabel(namedElement, displayValue)); } return buffer.toString(); }
Source:
<code>public void onAttach(@NonNull Context context) { super.onAttach(context); mCameraController = new <START> CameraController(getContext()); <END> }</code><technical_language>nit: context ? reason getContext()</technical_language>

Target:
public void onAttach(@NonNull Context context) { super.onAttach(context); mCameraController = new CameraController(context); }
Source:
<code>public Task getLatestTask(ItemGroup context, AbstractBuild firstBuild) { AbstractProject<?, ?> project = getProject(this, context); AbstractBuild build = null; if (!ProjectUtil.isQueued(project, firstBuild)) { build = BuildUtil.match(project.getBuilds(), firstBuild); } final Status taskStatus = SimpleStatus.resolveStatus(project, build, firstBuild); final String taskLink = resolveTaskLink(taskStatus, build); final String taskBuildId = resolveBuildId(taskStatus, build); final ManualStep manualStep = ManualStep.getManualStepLatest(project, build, firstBuild); final String buildDescription = TokenUtils.decodedTemplate(build, resolveBuildDescription(build)); final String name = TokenUtils.decodedTemplate(build, this.getName()); <START> final String taskName = (TokenUtils.stringIsNotEmpy(name) ? name : project.getName()); <END> return new Task(this, taskName, taskBuildId, taskStatus, taskLink, manualStep, TestResult.getTestResult(build), buildDescription); }</code><technical_language>I fallback project.getDisplayName()</technical_language>

Target:
public Task getLatestTask(ItemGroup context, AbstractBuild firstBuild) { AbstractProject<?, ?> project = getProject(this, context); AbstractBuild<?, ?> build = null; if (!ProjectUtil.isQueued(project, firstBuild)) { build = BuildUtil.match(project.getBuilds(), firstBuild); } final Status taskStatus = SimpleStatus.resolveStatus(project, build, firstBuild); final String taskLink = resolveTaskLink(taskStatus, build); final String taskBuildId = resolveBuildId(taskStatus, build); final ManualStep manualStep = ManualStep.getManualStepLatest(project, build, firstBuild); final String buildDescription = TokenUtils.decodedTemplate(build, resolveBuildDescription(build)); final String name = TokenUtils.decodedTemplate(build, this.getName()); final String taskName = (TokenUtils.stringIsNotEmpy(name) ? name : project.getDisplayName()); return new Task(this, taskName, taskBuildId, taskStatus, taskLink, manualStep, TestResult.getTestResult(build), buildDescription); }