auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void parseWordDocument(File officeFile, String objectID) { String filePath = officeFile.getAbsolutePath(); List<XWPFParagraph> paragraphs; try { <START> FileInputStream fs = new FileInputStream(filePath); <END> XWPFDocument xwpfDoc = new XWPFDocument(fs); paragraphs = (xwpfDoc).getParagraphs(); } catch (IOException e) { e.printStackTrace(); showMessage(viewer.getControl().getShell(), SWT.ERROR, "Error", "Couldn't open the file."); return; } catch (SchemaTypeLoaderException e) { e.printStackTrace(); showMessage(viewer.getControl().getShell(), SWT.ERROR, "Error", "Couldn't open the file."); return; } for (int i = 0; i < paragraphs.size(); i++) { XWPFParagraph paragraph = paragraphs.get(i); if (paragraph != null) { CapraWordRequirement cRequirement = new CapraWordRequirement(paragraph, officeFile, i); if (!objectID.equals(OBJECT_ID_NOT_SPECIFIED)) { if (cRequirement.getId().equals(objectID)) { selection.add(cRequirement); break; } } else if (!cRequirement.getData().isEmpty()) selection.add(cRequirement); } } }</code><technical_language>constructor takes a File instance directly</technical_language>

Target:
private void parseWordDocument(File officeFile, String objectID) { List<XWPFParagraph> paragraphs; try { FileInputStream fs = new FileInputStream(officeFile); XWPFDocument xwpfDoc = new XWPFDocument(fs); paragraphs = (xwpfDoc).getParagraphs(); } catch (IOException e) { e.printStackTrace(); showMessage(viewer.getControl().getShell(), SWT.ERROR, "Error", "Couldn't open the file."); return; } catch (SchemaTypeLoaderException e) { e.printStackTrace(); showMessage(viewer.getControl().getShell(), SWT.ERROR, "Error", "Couldn't open the file."); return; } for (int i = 0; i < paragraphs.size(); i++) { XWPFParagraph paragraph = paragraphs.get(i); if (paragraph != null) { CapraWordRequirement cRequirement = new CapraWordRequirement(paragraph, officeFile, i); if (!objectID.equals(OBJECT_ID_NOT_SPECIFIED)) { if (cRequirement.getId().equals(objectID)) { selection.add(cRequirement); break; } } else if (!cRequirement.getData().isEmpty()) selection.add(cRequirement); } } }
Source:
<code>public void whenEmptyResponseThenGetProjectFeatureFlagsShouldThrow() throws Exception { <START> when(restTemplate.getForObject(PROJECT_FEATURE_FLAGS_URI_PATTERN, ProjectFeatureFlags.class, PROJECT_ID)).thenReturn(null); <END> service.listProjectFeatureFlags(project); }</code><technical_language>missing matches()</technical_language>

Target:
public void whenEmptyResponseThenGetProjectFeatureFlagsShouldThrow() throws Exception { when(restTemplate.getForObject(new URI(PROJECT_FEATURE_FLAGS_URI), ProjectFeatureFlags.class)).thenReturn(null); service.listProjectFeatureFlags(project); }
Source:
<code><START> private boolean wrapInChannelEvent(ChannelEvent event, ChannelHandlerContext ctx, Runnable operation, <END> Runnable eventFillerBefore, Runnable eventFillerAfter) { event.begin(); eventFillerBefore.run(); try { operation.run(); } catch (Throwable t) { event.completedExceptionally(t); throw t; } finally { event.end(); if (event.shouldCommit()) { event.setChannel(ctx.channel()); eventFillerAfter.run(); } return event.shouldCommit(); } }</code><technical_language>static</technical_language>

Target:
private static boolean wrapInChannelEvent(ChannelEvent event, ChannelHandlerContext ctx, Runnable operation, Runnable eventFillerBefore, Runnable eventFillerAfter) { if (event.isEnabled()) { event.begin(); eventFillerBefore.run(); } operation.run(); if (event.isEnabled()) { event.end(); if (event.shouldCommit()) { event.setChannel(ctx.channel()); eventFillerAfter.run(); return true; } } return false; }
Source:
<code>ReferenceDialog(@NonNull Context context, int selectedIndex, List<ReferenceHandler.Reference> adjacentReferences, LinkHandler referenceLinkHandler) { super(context); View rootView = LayoutInflater.from(context).inflate(R.layout.fragment_references_pager, null); setContentView(rootView); ButterKnife.bind(this); this.referenceLinkHandler = referenceLinkHandler; referencesViewPager.setAdapter(new ReferencesAdapter(adjacentReferences)); referencesViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { } @Override public void onPageSelected(int position) { pageIndicatorView.setSelection(position); } @Override public void onPageScrollStateChanged(int state) { } }); if (adjacentReferences.size() <START> != 1) <END> { multipleCitationsContainer.setVisibility(View.VISIBLE); singleCitationContainer.setVisibility(View.GONE); pageIndicatorView.setCount(adjacentReferences.size()); referencesViewPager.setCurrentItem(selectedIndex, true); } else { multipleCitationsContainer.setVisibility(View.GONE); singleCitationContainer.setVisibility(View.VISIBLE); singleCitationReferenceText.setText(StringUtil.fromHtml(adjacentReferences.get(0).getHref())); singleCitationTitleText.setText(getContext().getString(R.string.reference_title, adjacentReferences.get(0).getLinkText())); } }</code><technical_language>this "> 1"? size 0? handle case</technical_language>

Target:
ReferenceDialog(@NonNull Context context, int selectedIndex, List<ReferenceHandler.Reference> adjacentReferences, LinkHandler referenceLinkHandler) { super(context); View rootView = LayoutInflater.from(context).inflate(R.layout.fragment_references_pager, null); setContentView(rootView); ButterKnife.bind(this); this.referenceLinkHandler = referenceLinkHandler; referencesViewPager.setAdapter(new ReferencesAdapter(adjacentReferences)); referencesViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { } @Override public void onPageSelected(int position) { pageIndicatorView.setSelection(position); } @Override public void onPageScrollStateChanged(int state) { } }); if (adjacentReferences.size() > 1) { multipleCitationsContainer.setVisibility(View.VISIBLE); singleCitationContainer.setVisibility(View.GONE); pageIndicatorView.setCount(adjacentReferences.size()); referencesViewPager.setCurrentItem(selectedIndex, true); } else { multipleCitationsContainer.setVisibility(View.GONE); singleCitationContainer.setVisibility(View.VISIBLE); singleCitationReferenceText.setText(StringUtil.fromHtml(adjacentReferences.get(0).getLinkHtml())); singleCitationTitleText.setText(getContext().getString(R.string.reference_title, adjacentReferences.get(0).getLinkText())); } }
Source:
<code><START> public void stopActionMode() { <END> Intent intent = new Intent("recent-list-stop-action-mode"); LocalBroadcastManager.getInstance(context).sendBroadcast(intent); }</code><technical_language>able put methods send broadcasts RecentListActionModeUtil</technical_language>

Target:
public void stopActionMode() { recentListActionModeUtil.stopActionMode(); }
Source:
<code>public void setFecPacket(FlexFec03Packet p) { logger.debug("Have " + mediaPackets.size() + " saved media packets"); numMissing = 0; logger.debug("Reconstructor checking if recovery is " + "possible: fec packet " + p.getSequenceNumber() + " protects packets:\n" + p.getProtectedSequenceNumbers()); this.fecPacket = p; <START> if (p == null) <END> { logger.error("Error creating flexfec packet"); return; } for (Integer protectedSeqNum : fecPacket.getProtectedSequenceNumbers()) { logger.debug("Checking if we've received media " + "packet " + protectedSeqNum); if (!mediaPackets.containsKey(protectedSeqNum)) { logger.debug("We haven't, mark as missing"); numMissing++; missingSequenceNumber = protectedSeqNum; } } logger.debug("There were " + numMissing + " missing media " + "packets for flexfec " + p.getSequenceNumber()); if (numMissing > 1) { missingSequenceNumber = -1; } }</code><technical_language>If p null produced a NPE in debug logs above. missing docs method</technical_language>

Target:
public void setFecPacket(FlexFec03Packet p) { if (p == null) { logger.error("Error setting flexfec packet"); return; } this.fecPacket = p; if (logger.isDebugEnabled()) { logger.debug("Have " + mediaPackets.size() + " saved media packets"); } numMissing = 0; if (logger.isDebugEnabled()) { logger.debug("Reconstructor checking if recovery is " + "possible: fec packet " + p.getSequenceNumber() + " protects packets:\n" + p.getProtectedSequenceNumbers()); } for (Integer protectedSeqNum : fecPacket.getProtectedSequenceNumbers()) { if (logger.isDebugEnabled()) { logger.debug("Checking if we've received media " + "packet " + protectedSeqNum); } if (!mediaPackets.containsKey(protectedSeqNum)) { if (logger.isDebugEnabled()) { logger.debug("We haven't, mark as missing"); } numMissing++; missingSequenceNumber = protectedSeqNum; } } if (logger.isDebugEnabled()) { logger.debug("There were " + numMissing + " missing media " + "packets for flexfec " + p.getSequenceNumber()); } if (numMissing > 1) { missingSequenceNumber = -1; } }
Source:
<code><START> public void canSerializeAndDeserializeKeepingNonLoggability() { <END> TableMetadataPersistence.NamedColumnDescription.Builder builder = NAME_NOT_LOGGABLE_DESCRIPTION.persistToProto(); assertThat(NamedColumnDescription.hydrateFromProto(builder.build())) .isEqualTo(NAME_NOT_LOGGABLE_DESCRIPTION) .matches(description -> !description.isNameLoggable()); }</code><technical_language>idea ensuring (de)serialise unspecified loggability</technical_language>

Target:
public void canSerializeAndDeserializeKeepingNonLoggability() { assertCanSerializeAndDeserializeWithLoggability(NAME_NOT_LOGGABLE_DESCRIPTION, false); }
Source:
<code>public Object visitLockControlCommand(TxInvocationContext ctx, LockControlCommand command) throws Throwable { if (!ctx.isOriginLocal()) { return invokeNext(ctx, command); } return invokeNextThenApply(ctx, command, (rCtx, rCommand, rv) -> { LockControlCommand lockControlCommand = (LockControlCommand) rCommand; boolean sync = !lockControlCommand.isUnlock(); ((LocalTxInvocationContext) rCtx).remoteLocksAcquired(rpcManager.getTransport().getMembers()); CompletionStage<Map<Address, Response>> remoteInvocation = <START> rpcManager.invokeCommandOnAll(lockControlCommand, new MapResponseCollector(true), <END> rpcManager.getSyncRpcOptions()); return asyncValue(remoteInvocation.thenApply(responses -> null)); }); }</code><technical_language>need create response map in here..</technical_language>

Target:
public Object visitLockControlCommand(TxInvocationContext ctx, LockControlCommand command) throws Throwable { if (!ctx.isOriginLocal()) { return invokeNext(ctx, command); } return invokeNextThenApply(ctx, command, (rCtx, rCommand, rv) -> { LockControlCommand lockControlCommand = (LockControlCommand) rCommand; boolean sync = !lockControlCommand.isUnlock(); ((LocalTxInvocationContext) rCtx).remoteLocksAcquired(rpcManager.getTransport().getMembers()); if (sync) { CompletionStage<Void> remoteInvocation = rpcManager.invokeCommandOnAll(lockControlCommand, new VoidResponseCollector(true), rpcManager.getSyncRpcOptions()); return asyncValue(remoteInvocation); } else { rpcManager.sendToAll(lockControlCommand, DeliverOrder.PER_SENDER); return null; } }); }
Source:
<code><START> public void requestExactCompletesImmediately() { <END> TestSubscriber<Integer> ts = TestSubscriber.create(10); Observable.range(1, 10).observeOn(Schedulers.computation()).subscribe(ts); ts.awaitTerminalEvent(1, TimeUnit.SECONDS); ts.assertValueCount(10); ts.assertNoErrors(); ts.assertCompleted(); }</code><technical_language>if tests "immediately", this test passes changes in this PR. avoid another thread awaitTerminalEvent()</technical_language>

Target:
public void requestExactCompletesImmediately() { TestSubscriber<Integer> ts = TestSubscriber.create(0); TestScheduler test = Schedulers.test(); Observable.range(1, 10).observeOn(test).subscribe(ts); test.advanceTimeBy(1, TimeUnit.SECONDS); ts.assertNoValues(); ts.assertNoErrors(); ts.assertNotCompleted(); ts.requestMore(10); test.advanceTimeBy(1, TimeUnit.SECONDS); ts.assertValueCount(10); ts.assertNoErrors(); ts.assertCompleted(); }
Source:
<code>public void definitionList() { BlockStrategies strategies = new BlockStrategies(Sets.newHashSet(BlockType.DEFINITION_LIST)); assertTrue(strategies.getBlockStrategy(BlockType.DEFINITION_LIST) instanceof SupportedBlockStrategy); assertTrue(strategies.getBlockStrategy(BlockType.DEFINITION_ITEM) instanceof SupportedBlockStrategy); assertTrue(strategies.getBlockStrategy(BlockType.DEFINITION_TERM) instanceof SupportedBlockStrategy); <START> } <END></code><technical_language>consider a assertSupported(BlockTypeStrategy) altenative instance of checks</technical_language>

Target:
public void definitionList() { BlockStrategies strategies = new BlockStrategies(Sets.newHashSet(BlockType.DEFINITION_LIST)); assertSupported(strategies, BlockType.DEFINITION_LIST); assertSupported(strategies, BlockType.DEFINITION_ITEM); assertSupported(strategies, BlockType.DEFINITION_TERM); }
Source:
<code>public Set<PushServerInfo> getAvailablePushTargets() { try { XWikiContext context = getXContext(); XWiki xwiki = context.getWiki(); XWikiDocument prefsDoc = xwiki.getDocument(new DocumentReference(context.getWikiId(), "XWiki", "XWikiPreferences"), context); List<BaseObject> servers = prefsDoc.getXObjects(new DocumentReference(context.getWikiId(), Constants.CODE_SPACE, "PushPatientServer")); Set<PushServerInfo> response = new TreeSet<>(); if (servers == null || servers.isEmpty()) { return response; } for (BaseObject serverConfiguration : servers) { if (serverConfiguration == null) { continue; } this.logger.debug(" ...available: [{}]", serverConfiguration.getStringValue(DefaultPushPatientData.PUSH_SERVER_CONFIG_ID_PROPERTY_NAME)); String name = serverConfiguration.getStringValue(DefaultPushPatientData.PUSH_SERVER_CONFIG_ID_PROPERTY_NAME); String url = serverConfiguration.getStringValue(DefaultPushPatientData.PUSH_SERVER_CONFIG_URL_PROPERTY_NAME); if (StringUtils.isEmpty(name) || StringUtils.isEmpty(url)) { <START> continue; <END> } PushServerInfo info = new DefaultPushServerInfo(name, url, serverConfiguration.displayView(DefaultPushPatientData.PUSH_SERVER_CONFIG_DESC_PROPERTY_NAME, context)); response.add(info); } return response; } catch (Exception ex) { this.logger.error("Failed to get server list: {}", ex.getMessage(), ex); return Collections.emptySet(); } }</code><technical_language>I suggest isBlank instead</technical_language>

Target:
public Set<PushServerInfo> getAvailablePushTargets() { try { XWikiContext context = getXContext(); XWiki xwiki = context.getWiki(); XWikiDocument prefsDoc = xwiki.getDocument(new DocumentReference(context.getWikiId(), "XWiki", "XWikiPreferences"), context); List<BaseObject> servers = prefsDoc.getXObjects(new DocumentReference(context.getWikiId(), Constants.CODE_SPACE, "PushPatientServer")); Set<PushServerInfo> response = new TreeSet<>(); if (servers == null || servers.isEmpty()) { return response; } for (BaseObject serverConfiguration : servers) { if (serverConfiguration == null) { continue; } this.logger.debug(" ...available: [{}]", serverConfiguration.getStringValue(DefaultPushPatientData.PUSH_SERVER_CONFIG_ID_PROPERTY_NAME)); String name = serverConfiguration.getStringValue(DefaultPushPatientData.PUSH_SERVER_CONFIG_ID_PROPERTY_NAME); String url = serverConfiguration.getStringValue(DefaultPushPatientData.PUSH_SERVER_CONFIG_URL_PROPERTY_NAME); if (StringUtils.isBlank(name) || StringUtils.isBlank(url)) { continue; } PushServerInfo info = new DefaultPushServerInfo(name, url, serverConfiguration.displayView(DefaultPushPatientData.PUSH_SERVER_CONFIG_DESC_PROPERTY_NAME, context)); response.add(info); } return response; } catch (Exception ex) { this.logger.error("Failed to get server list: {}", ex.getMessage(), ex); return Collections.emptySet(); } }
Source:
<code>public WordsObject createObject(String objectName, String className, WordsPosition position) throws WordsRuntimeException { try { getObject(objectName); throw new WordsObjectAlreadyExistsException(objectName); } catch (WordsObjectNotFoundException e){ WordsClass wordsClass = getClass(className); if (wordsClass == null) { <START> throw new WordsClassNotFoundException(className); <END> } WordsObject newObject = new WordsObject(objectName, wordsClass, position); objects.put(objectName, newObject); newObject.enqueueAction(new WordsWait(1)); return newObject; } }</code><technical_language>I WordsEnvironment.getClass throw class exception, instead of checking for null here. pattern established .getObject</technical_language>

Target:
public WordsObject createObject(String objectName, String className, WordsPosition position) throws WordsRuntimeException { try { getObject(objectName); throw new WordsObjectAlreadyExistsException(objectName); } catch (WordsObjectNotFoundException e){ WordsClass wordsClass = getClass(className); WordsObject newObject = new WordsObject(objectName, wordsClass, position); objects.put(objectName, newObject); newObject.enqueueAction(new WordsWait(1)); return newObject; } }
Source:
<code>public View getView(int position, View convertView, ViewGroup parent) { PollingLocation location = getItem(position); ViewHolder viewHolder; if (convertView == null) { viewHolder = new ViewHolder(); LayoutInflater inflater = LayoutInflater.from(getContext()); convertView = inflater.inflate(R.layout.location_list_item, parent, false); viewHolder.name = (TextView) convertView.findViewById(R.id.location_list_item_name); viewHolder.address = (TextView) convertView.findViewById(R.id.location_list_item_address); viewHolder.distance = (TextView) convertView.findViewById(R.id.location_list_item_distance); convertView.setTag(viewHolder); } else { viewHolder = (ViewHolder) convertView.getTag(); } if (location.name != null && !location.name.isEmpty()) { viewHolder.name.setText(location.name); } else if (location.address.locationName != null && !location.address.locationName.isEmpty()) { viewHolder.name.setText(location.address.locationName); } String addr = location.address.toGeocodeString(); if (!addr.isEmpty()) { viewHolder.address.setText(addr); } else { viewHolder.address.setVisibility(View.GONE); } if (location.address.distance > 0) { <START> viewHolder.distance.setText(distanceFormat.format(location.address.distance) + " mi."); <END> } if (location.id != null) { viewHolder.distance.setTag(location.id); } else { viewHolder.distance.setTag(addr); } return convertView; }</code><technical_language>Add "mi." R.string a locale aware formatter (if a exists) automagically create unit suffix</technical_language>

Target:
public View getView(int position, View convertView, ViewGroup parent) { PollingLocation location = getItem(position); ViewHolder viewHolder; if (convertView == null) { viewHolder = new ViewHolder(); LayoutInflater inflater = LayoutInflater.from(getContext()); convertView = inflater.inflate(R.layout.location_list_item, parent, false); viewHolder.name = (TextView) convertView.findViewById(R.id.location_list_item_name); viewHolder.address = (TextView) convertView.findViewById(R.id.location_list_item_address); viewHolder.distance = (TextView) convertView.findViewById(R.id.location_list_item_distance); convertView.setTag(viewHolder); } else { viewHolder = (ViewHolder) convertView.getTag(); } if (location.name != null && !location.name.isEmpty()) { viewHolder.name.setText(location.name); } else if (location.address.locationName != null && !location.address.locationName.isEmpty()) { viewHolder.name.setText(location.address.locationName); } String addr = location.address.toGeocodeString(); if (!addr.isEmpty()) { viewHolder.address.setText(addr); } else { viewHolder.address.setVisibility(View.GONE); } if (location.address.distance > 0) { viewHolder.distance.setText(distanceFormat.format(location.address.distance) + distanceSuffix); } if (location.id != null) { viewHolder.distance.setTag(location.id); } else { viewHolder.distance.setTag(addr); } return convertView; }
Source:
<code>public void shutdown() { <START> scheduler.shutdownNow(); <END> }</code><technical_language>nit: useful add a log line Line 77 shutdown invoked this scheduler instance</technical_language>

Target:
public void shutdown() { LOG.info("Shutting down HeartbeatScheduler"); scheduler.shutdownNow(); }
Source:
<code>private @Nullable Map<@NonNull String, @NonNull SegmentStoreStatistics> getPerTypeStats(long start, long end , IProgressMonitor monitor) { Collection<@NonNull ISegment> store = getSegmentStore(start, end); if (store == null) { <START> return null; <END> } if (monitor.isCanceled()) { return Collections.EMPTY_MAP; } return calculateTotalPerType(store, monitor); }</code><technical_language>this return emptyMap? another clause of if below</technical_language>

Target:
private @Nullable Map<@NonNull String, @NonNull SegmentStoreStatistics> getPerTypeStats(long start, long end , IProgressMonitor monitor) { Collection<@NonNull ISegment> store = getSegmentStore(start, end); if (store == null || monitor.isCanceled()) { return null; } return calculateTotalPerType(store, monitor); }
Source:
<code>public VR transform(K k, V v) { Span span = kafkaStreamsTracing.nextSpan(processorContext); if (!span.isNoop()) { span.name(spanName); span.start(); } Tracer.SpanInScope ws = tracer.withSpanInScope(span); Throwable error = null; try { return delegateTransformer.transform(k, v); } catch (Throwable e) { <START> error = e; <END> throw e; } finally { kafkaStreamsTracing.injector.inject(span.context(), processorContext.headers()); if (error != null) span.error(error); span.finish(); ws.close(); } }</code><technical_language>Is this missing Call.propagateIfFatal(e);</technical_language>

Target:
public VR transform(K k, V v) { Span span = kafkaStreamsTracing.nextSpan(processorContext); if (!span.isNoop()) { span.name(spanName); span.start(); } Tracer.SpanInScope ws = tracer.withSpanInScope(span); Throwable error = null; try { return delegateTransformer.transform(k, v); } catch (Throwable e) { error = e; propagateIfFatal(e); throw e; } finally { kafkaStreamsTracing.injector.inject(span.context(), processorContext.headers()); if (error != null) span.error(error); span.finish(); ws.close(); } }
Source:
<code>public void testLoadAccountMRUObjectsFromCache() throws Exception { final List<SalesforceObject> mruObjects_before = metadataManager.loadMRUObjects(Constants.ACCOUNT, MAX_QUERY_LIMIT, CachePolicy.RELOAD_AND_RETURN_CACHE_DATA, REFRESH_INTERVAL, null); Map<String, String> idToNames = new HashMap<String, String>(); <START> idToNames = createRecordsOnServer(1, Constants.ACCOUNT); <END> String[] names = idToNames.values().toArray(new String[1]);; String[] ids = idToNames.keySet().toArray(new String[1]); try { Thread.sleep(2000); final List<SalesforceObject> mruObjects = metadataManager.loadMRUObjects(Constants.ACCOUNT, MAX_QUERY_LIMIT, CachePolicy.RETURN_CACHE_DATA_DONT_RELOAD, REFRESH_INTERVAL, null); assertNotNull("MRU list should not be null", mruObjects); assertEquals("MRU list size should not be changed", mruObjects_before.size(), mruObjects.size()); assertEquals("Recently viewed object name is incorrect", mruObjects_before.get(0).getName(), mruObjects.get(0).getName()); } finally { deleteRecordsOnServer(ids, Constants.ACCOUNT); } }</code><technical_language>initialize this line 224</technical_language>

Target:
public void testLoadAccountMRUObjectsFromCache() throws Exception { final List<SalesforceObject> mruObjects_before = metadataManager.loadMRUObjects(Constants.ACCOUNT, MAX_QUERY_LIMIT, CachePolicy.RELOAD_AND_RETURN_CACHE_DATA, REFRESH_INTERVAL, null); Map<String, String> idToNames = createRecordsOnServer(1, Constants.ACCOUNT); Set<String> ids = idToNames.keySet(); try { Thread.sleep(2000); final List<SalesforceObject> mruObjects = metadataManager.loadMRUObjects(Constants.ACCOUNT, MAX_QUERY_LIMIT, CachePolicy.RETURN_CACHE_DATA_DONT_RELOAD, REFRESH_INTERVAL, null); assertNotNull("MRU list should not be null", mruObjects); assertEquals("MRU list size should not be changed", mruObjects_before.size(), mruObjects.size()); assertEquals("Recently viewed object name is incorrect", mruObjects_before.get(0).getName(), mruObjects.get(0).getName()); } finally { deleteRecordsOnServer(ids, Constants.ACCOUNT); } }
Source:
<code>public void init() { post( "/login", (req, res) -> { Map<String, String> formParams = new HashMap<>(); String body = req.body(); Pattern regExp = Pattern.compile( <START> "^Content-Disposition: form-data; name=\"(.+)\"$[\r\n]+(.+)$", Pattern.MULTILINE); <END> Matcher matcher = regExp.matcher(body); while (matcher.find()) { String key = matcher.group(1); String value = matcher.group(2); formParams.put(key, value); } authenticationService.login( req.raw(), formParams.get("username"), formParams.get("password"), formParams.get("prevurl")); res.redirect(formParams.get("prevurl"), 303); return res; }); }</code><technical_language>unclear of this regex. Is this standard/approved of extracting multipart data Spark? brittle</technical_language>

Target:
public void init() { post( "/login", (req, res) -> { authenticationService.login( req.raw(), req.queryParams("username"), req.queryParams("password"), req.queryParams("prevurl")); res.redirect(req.queryParams("prevurl"), HttpStatus.SC_SEE_OTHER); return res; }); }
Source:
<code>public FlowIdentifier restoreClusterDatabase(@NotNull NameOrCrn nameOrCrn, Long workspaceId, String location, String backupId) { LOGGER.debug("Starting cluster database restore: " + nameOrCrn); <START> if (nameOrCrn.hasName()) { <END> return databaseBackupRestoreService.restoreDatabase(workspaceId, nameOrCrn.getName(), location, backupId); } else { LOGGER.debug("No stack name provided for restore, found: " + nameOrCrn); throw new BadRequestException("Please provide a stack name for restore"); } }</code><technical_language>same, is restricted name</technical_language>

Target:
public FlowIdentifier restoreClusterDatabase(@NotNull NameOrCrn nameOrCrn, Long workspaceId, String location, String backupId) { databaseBackupRestoreService.validate(workspaceId, nameOrCrn, location, backupId); LOGGER.debug("Starting cluster database restore: " + nameOrCrn); return databaseBackupRestoreService.restoreDatabase(workspaceId, nameOrCrn, location, backupId); }
Source:
<code>public String toString() { if (format != null) { if (format.equals("epoch")) { return String.valueOf(date.getTime()); } if (format.equals("unix")) { <START> return String.valueOf(date.getTime() / 1000L); <END> } return formatCustom(); } return timezoneName != null ? ISO8601Utils.format(date, false, TimeZone.getTimeZone(timezoneName)) : ISO8601Utils.format(date, false); }</code><technical_language>1000 is a magic number. Please extract constant Duration transform time</technical_language>

Target:
public String toString() { if (format != null) { if (format.equals("epoch")) { return String.valueOf(date.getTime()); } if (format.equals("unix")) { return String.valueOf(date.getTime() / DIVIDE_MILLISECONDS_TO_SECONDS); } return formatCustom(); } return timezoneName != null ? ISO8601Utils.format(date, false, TimeZone.getTimeZone(timezoneName)) : ISO8601Utils.format(date, false); }
Source:
<code>public void testQueryByNoBusinessAdmin() { String role1 = "role1"; <START> String role2 = "role2"; <END> String userId = "userId"; when(identityProvider.getRoles()).thenReturn(Arrays.asList(role1, role2)); when(identityProvider.getName()).thenReturn(userId); businessAdminPreprocessor.preprocess(dataSetLookup); assertEquals("TASKID = -1", dataSetLookup.getFirstFilterOp().getColumnFilterList().get(0).toString()); when(identityProvider.getRoles()).thenReturn(Collections.emptyList()); when(identityProvider.getName()).thenReturn(userId); dataSetLookup= new DataSetLookup(); businessAdminPreprocessor.preprocess(dataSetLookup); assertEquals("TASKID = -1", dataSetLookup.getFirstFilterOp().getColumnFilterList().get(0).toString()); }</code><technical_language>I recommend replacing this assertion adding @Spy annotation dataSetLookup field verifying interaction object i.e. _verifyZeroInteractions(dataSetLookup)_</technical_language>

Target:
public void testQueryByNoBusinessAdmin() { dataSetLookup = new DataSetLookup(); String role1 = "role1"; String role2 = "role2"; String userId = "userId"; when(identityProvider.getRoles()).thenReturn(Arrays.asList(role1, role2)); when(identityProvider.getName()).thenReturn(userId); businessAdminPreprocessor.preprocess(dataSetLookup); assertEquals("TASKID = -1", dataSetLookup.getFirstFilterOp().getColumnFilterList().get(0).toString()); }
Source:
<code>String getPathToImageDirectory() { return Utils.buildPath(Utils.buildProjectPath(ProjectManager.getInstance().getCurrentProject().getName()), <START> getSceneNameByLookData(), Constants.IMAGE_DIRECTORY); <END> }</code><technical_language>Utils.buildScenePath. internally encodes project scene names. Eventually create a handful of helper methods for scenarios. e.g. in this case buildImagePath(Project, Scene) [Replace String paths File](<LINK_0></technical_language>

Target:
String getPathToImageDirectory() { return Utils.buildPath(Utils.buildScenePath(ProjectManager.getInstance().getCurrentProject().getName(), getSceneNameByLookData()), Constants.IMAGE_DIRECTORY); }
Source:
<code>public boolean doSupportClouderaNavigator() { <START> return true; <END> }</code><technical_language>I cloudera navigator is integrated distribution. If this is case, please change this boolean false</technical_language>

Target:
public boolean doSupportClouderaNavigator() { return false; }
Source:
<code>public LockResource lockShared() throws InterruptedException { if (LOG.isDebugEnabled()) { <START> LOG.debug("Thread-%d entered lockShared().", Thread.currentThread().getId()); <END> } long exclusiveOnlyRemainingMs = mExclusiveOnlyDeadlineMs - System.currentTimeMillis(); if (exclusiveOnlyRemainingMs > 0) { String safeModeMsg = String.format( "Master still in exclusive-only phase (%dms remaining) for the state-lock. " + "Please see documentation for %s.", exclusiveOnlyRemainingMs, PropertyKey.Name.MASTER_BACKUP_STATE_LOCK_EXCLUSIVE_DURATION); throw new IllegalStateException(safeModeMsg); } mSharedWaitersAndHolders.add(Thread.currentThread()); mStateLock.readLock().lockInterruptibly(); return new LockResource(mStateLock.readLock(), false, false, () -> { mSharedWaitersAndHolders.remove(Thread.currentThread()); }); }</code><technical_language>do want thread name, id? Also, I for logging need "{}", "%d". "%d" I is for String.format()</technical_language>

Target:
public LockResource lockShared() throws InterruptedException { LOG.debug("Thread-{} entered lockShared().", ThreadUtils.getCurrentThreadIdentifier()); long exclusiveOnlyRemainingMs = mExclusiveOnlyDeadlineMs - System.currentTimeMillis(); if (exclusiveOnlyRemainingMs > 0) { String safeModeMsg = String.format( "Master still in exclusive-only phase (%dms remaining) for the state-lock. " + "Please see documentation for %s.", exclusiveOnlyRemainingMs, PropertyKey.Name.MASTER_BACKUP_STATE_LOCK_EXCLUSIVE_DURATION); throw new IllegalStateException(safeModeMsg); } mSharedWaitersAndHolders.add(Thread.currentThread()); mStateLock.readLock().lockInterruptibly(); return new LockResource(mStateLock.readLock(), false, false, () -> { mSharedWaitersAndHolders.remove(Thread.currentThread()); }); }
Source:
<code>@Test public void testAddElementToQueueAboutToOverrun() throws IOException { QueueFile queue = new QueueFile(file); final int elementSize = QueueFile.MAX_ELEMENT_SIZE / 2; byte[] expected = new byte[elementSize]; for (int i = 0; i < (Integer.MAX_VALUE / 2 / elementSize - 1); i++) { queue.add(expected); } try { queue.add(expected); fail("Should have failed with IllegalArgumentException for element too large."); } catch (IllegalArgumentException e) { assertThat(e).hasMessage("Cannot add data of length " + elementSize + " to the " + "queue which already has a length of " + (Integer.MAX_VALUE / 2 + 1) + ". The max file size is " <START> + "1,073,741,823 (half of Integer.MAX_VALUE)."); <END> } finally { queue.close(); } }</code><technical_language>nit: generally avoid asserting full details of exception message hard change later. Focus pieces interesting in message</technical_language>

Target:
@Test public void testAddElementToQueueAboutToOverrun() throws IOException { QueueFile queue = new QueueFile(file); final int elementSize = Integer.MAX_VALUE / 8; byte[] expected = new byte[elementSize]; for (int i = 0; i < (Integer.MAX_VALUE / 2 / elementSize - 1); i++) { queue.add(expected); } try { queue.add(expected); fail("Should have failed with IllegalArgumentException for element too large."); } catch (IllegalArgumentException e) { String message = e.getMessage(); assertThat(message).contains("Cannot add data of length " + elementSize); } finally { queue.close(); } }
Source:
<code>public void createInstructorAccount(String googleId, String courseId, String name, String email, Boolean isArchived, String roleParam, boolean isDisplayedToStudents, String displayedNameParam, String privileges, String institute) throws EntityAlreadyExistsException, InvalidParametersException { Assumption.assertNotNull(googleId); Assumption.assertNotNull(courseId); Assumption.assertNotNull(name); Assumption.assertNotNull(email); Assumption.assertNotNull(institute); if (accountsLogic.getAccount(googleId) == null) { AccountAttributes account = new AccountAttributes(googleId, name, true, email, institute); accountsLogic.createAccount(account); } InstructorAttributes instructor = InstructorAttributes.builder(googleId, courseId, name, email) .withRole(roleParam).withDisplayedName(displayedNameParam) .withPrivileges(privileges).withIsDisplayedToStudents(isDisplayedToStudents) .withIsArchived(isArchived) .build(); if (privileges == null && roleParam != null) { <START> instructor.privileges = new InstructorPrivileges(roleParam); <END> } instructorsLogic.createInstructor(instructor); }</code><technical_language>do this. is a good practice change field in object (although is public). Try shift logic building process</technical_language>

Target:
public void createInstructorAccount(String googleId, String courseId, String name, String email, Boolean isArchived, String roleParam, boolean isDisplayedToStudents, String displayedNameParam, String privileges, String institute) throws EntityAlreadyExistsException, InvalidParametersException { Assumption.assertNotNull(googleId); Assumption.assertNotNull(courseId); Assumption.assertNotNull(name); Assumption.assertNotNull(email); Assumption.assertNotNull(institute); if (accountsLogic.getAccount(googleId) == null) { AccountAttributes account = new AccountAttributes(googleId, name, true, email, institute); accountsLogic.createAccount(account); } InstructorAttributes instructor = InstructorAttributes.builder(googleId, courseId, name, email) .withRole(roleParam).withDisplayedName(displayedNameParam) .withPrivileges(privileges).withIsDisplayedToStudents(isDisplayedToStudents) .withIsArchived(isArchived) .build(); instructorsLogic.createInstructor(instructor); }
Source:
<code>public void process(IncomingMessageEnvelope envelope, ReadableCoordinator coordinator, TaskCallbackFactory callbackFactory) { TaskCallback callback = callbackFactory.createCallback(); <START> this.metrics.processes().inc(); <END> try { this.taskSideInputHandler.process(envelope); this.metrics.messagesActuallyProcessed().inc(); callback.complete(); } catch (Exception e) { callback.failure(e); } }</code><technical_language>regular task's process side input task's process essentially treated (as implement RunLoopTask.process) - this increase process_ns metric of task include side input processing time? offline discussion, I understand prefixing source "side-input" avoid this issue. Additional doubt: a metric for process_ns of side input processing time change in this PR? changing metric name end user? if so, i count API change</technical_language>

Target:
synchronized public void process(IncomingMessageEnvelope envelope, ReadableCoordinator coordinator, TaskCallbackFactory callbackFactory) { TaskCallback callback = callbackFactory.createCallback(); this.metrics.processes().inc(); try { this.taskSideInputHandler.process(envelope); this.metrics.messagesActuallyProcessed().inc(); callback.complete(); } catch (Exception e) { callback.failure(e); } }
Source:
<code>public Mono<Void> cancelScheduledMessage(long sequenceNumber) { <START> return isAuthorized(CANCEL_SCHEDULED_MESSAGE_OPERATION).thenMany(createRequestResponse.flatMap(channel -> { <END> Message requestMessage = createManagementMessage(CANCEL_SCHEDULED_MESSAGE_OPERATION, channel.getReceiveLinkName()); requestMessage.setBody(new AmqpValue(Collections.singletonMap(SEQUENCE_NUMBERS, new Long[]{sequenceNumber}))); return channel.sendWithAck(requestMessage); }).map(responseMessage -> { int statusCode = RequestResponseUtils.getResponseStatusCode(responseMessage); if (statusCode == AmqpResponseCode.OK.getValue()) { return Mono.empty(); } return Mono.error(new AmqpException(false, "Could not cancel scheduled message with sequence number " + sequenceNumber, getErrorContext())); })).then(); }</code><technical_language>thenMany .then? returning a stream of items, a Mono</technical_language>

Target:
public Mono<Void> cancelScheduledMessage(long sequenceNumber) { return isAuthorized(CANCEL_SCHEDULED_MESSAGE_OPERATION).then(createRequestResponse.flatMap(channel -> { Message requestMessage = createManagementMessage(CANCEL_SCHEDULED_MESSAGE_OPERATION, channel.getReceiveLinkName()); requestMessage.setBody(new AmqpValue(Collections.singletonMap(SEQUENCE_NUMBERS, new Long[]{sequenceNumber}))); return channel.sendWithAck(requestMessage); }).map(responseMessage -> { int statusCode = RequestResponseUtils.getResponseStatusCode(responseMessage); if (statusCode == AmqpResponseCode.OK.getValue()) { return Mono.empty(); } return Mono.error(new AmqpException(false, "Could not cancel scheduled message with sequence number " + sequenceNumber, getErrorContext())); })).then(); }
Source:
<code>public String toString() { <START> return getLang(); <END> }</code><technical_language>show confidence well, imagine a this object in debugger</technical_language>

Target:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append(getLang()).append(" (").append(this.confidence).append(")"); return sb.toString(); }
Source:
<code>public Map<Integer, Integer> getSitesPerHostMapFromZK() throws KeeperException, InterruptedException, JSONException { Map<Integer, Integer> sphMap = new HashMap<>(); List<String> children = m_zk.getChildren(CoreZK.hosts, false); for (String child : children) { <START> byte[] payload = m_zk.getData( ZKUtil.joinZKPath(CoreZK.hosts, child), false, new Stat()); <END> final HostInfo info = HostInfo.fromBytes(payload); sphMap.put(parseHostId(child), info.m_localSitesCount); } return sphMap; }</code><technical_language>do this more effectively if queued data asynchronous zookeeper calls. ZkUtils asyncRmdir create dirs</technical_language>

Target:
public Map<Integer, Integer> getSitesPerHostMapFromZK() throws KeeperException, InterruptedException, JSONException { Map<Integer, Integer> sphMap = Maps.newHashMap(); List<String> children = m_zk.getChildren(CoreZK.hosts, false); Queue<ZKUtil.ByteArrayCallback> callbacks = new ArrayDeque<ZKUtil.ByteArrayCallback>(); for (int i = 0; i < children.size() - 1; i++) { ZKUtil.ByteArrayCallback cb = new ZKUtil.ByteArrayCallback(); m_zk.getData(ZKUtil.joinZKPath(CoreZK.hosts, children.get(i)), false, cb, null); callbacks.offer(cb); } ZKUtil.ByteArrayCallback lastCallback = new ZKUtil.ByteArrayCallback(); String lastChild = children.get(children.size() - 1); m_zk.getData(ZKUtil.joinZKPath(CoreZK.hosts, lastChild), false, lastCallback, null); byte[] lastPayload = lastCallback.getData(); final HostInfo lastOne = HostInfo.fromBytes(lastPayload); sphMap.put(parseHostId(lastChild), lastOne.m_localSitesCount); for (int i = 0; i < children.size() - 1; i++) { byte[] payload = callbacks.poll().getData(); final HostInfo info = HostInfo.fromBytes(payload); sphMap.put(parseHostId(children.get(i)), info.m_localSitesCount); } return sphMap; }
Source:
<code>private VirtualFile createPlaceholder(VirtualFile parent, String name) { <START> MutableVirtualFile file = new MutableVirtualFile(parent, name); <END> file.withCanProvideOutputStream(ignored -> true); file.withDirectoryFlagSupplier(ignored -> false); file.withOutputStreamSupplier(ignored -> { VirtualFile storedFile = createFile(name); JobPreset jobPreset = getPreset(parent); OutputStream out = storedFile.createOutputStream(); return overrideOutputStream(out, jobPreset, storedFile); }); return file; }</code><technical_language>file -> placeholder</technical_language>

Target:
private VirtualFile createPlaceholder(VirtualFile parent, String name) { MutableVirtualFile placeholder = new MutableVirtualFile(parent, name); placeholder.withCanProvideOutputStream(ignored -> true); placeholder.withDirectoryFlagSupplier(ignored -> false); placeholder.withOutputStreamSupplier(ignored -> { VirtualFile storedFile = createFile(name); JobPreset jobPreset = getPreset(parent); OutputStream out = storedFile.createOutputStream(); return overrideOutputStream(out, jobPreset, storedFile); }); return placeholder; }
Source:
<code>public void close() { <START> if (httpClient != null) { <END> httpClient.close(); } }</code><technical_language>need check for null this set in constructor</technical_language>

Target:
public void close() { httpClient.close(); }
Source:
<code>protected String makeFieldKey(String schema, String element, String qualifier) { if (StringUtils.isBlank(qualifier)) { <START> return schema + "_" + element; <END> } else { return schema + "_" + element + "_" + qualifier; } }</code><technical_language>reuse Utils.tokenize method introduced</technical_language>

Target:
protected String makeFieldKey(String schema, String element, String qualifier) { return Utils.standardize(schema, element, qualifier, "_"); }
Source:
<code>public LinkedHashMap<String, String> getAPIPacketParameters() { LinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>(); parameters.put("Source address", sourceAddress.toString()); parameters.put("RSSI", String.valueOf(rssi)); parameters.put("Receive options", String.valueOf(receiveOptions)); <START> if (ioSample != null) <END> parameters.put("IO sample", ioSample.toString()); return parameters; }</code><technical_language>I add more detailed information sample here: if (ioSample != null) { parameters.put("Number of samples", HexUtils.prettyHexString(HexUtils.integerToHexString(1, 1))); // is 1 sample. parameters.put("Digital channel mask", HexUtils.prettyHexString(HexUtils.integerToHexString(ioSample.getDigitalMask(), 2))); parameters.put("Analog channel mask", HexUtils.prettyHexString(HexUtils.integerToHexString(ioSample.getAnalogMask(), 2))); for (int i = 0; i < 16; i++) { if (ioSample.hasDigitalValue(IOLine.getDIO(i))) parameters.put(IOLine.getDIO(i).getName() + " digital value", ioSample.getDigitalValue(IOLine.getDIO(i)).getName()); } for (int i = 0; i < 6; i++) { if (ioSample.hasAnalogValue(IOLine.getDIO(i))) parameters.put(IOLine.getDIO(i).getName() + " analog value", HexUtils.prettyHexString(HexUtils.integerToHexString(ioSample.getAnalogValue(IOLine.getDIO(i)), 2))); } } else if (rfData != null) parameters.put("RF data", HexUtils.prettyHexString(HexUtils.byteArrayToHexString(rfData)));</technical_language>

Target:
public LinkedHashMap<String, String> getAPIPacketParameters() { LinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>(); parameters.put("Source address", "00 00 00 00 " + HexUtils.prettyHexString(HexUtils.byteArrayToHexString(sourceAddress.getValue())) + " (" + sourceAddress.toString() + ")"); parameters.put("RSSI", HexUtils.prettyHexString(HexUtils.integerToHexString(rssi, 1))); parameters.put("Receive options", HexUtils.prettyHexString(HexUtils.integerToHexString(receiveOptions, 1))); if (ioSample != null) { parameters.put("Number of samples", HexUtils.prettyHexString(HexUtils.integerToHexString(1, 1))); parameters.put("Digital channel mask", HexUtils.prettyHexString(HexUtils.integerToHexString(ioSample.getDigitalMask(), 2))); parameters.put("Analog channel mask", HexUtils.prettyHexString(HexUtils.integerToHexString(ioSample.getAnalogMask(), 2))); for (int i = 0; i < 16; i++) { if (ioSample.hasDigitalValue(IOLine.getDIO(i))) parameters.put(IOLine.getDIO(i).getName() + " digital value", ioSample.getDigitalValue(IOLine.getDIO(i)).getName()); } for (int i = 0; i < 6; i++) { if (ioSample.hasAnalogValue(IOLine.getDIO(i))) parameters.put(IOLine.getDIO(i).getName() + " analog value", HexUtils.prettyHexString(HexUtils.integerToHexString(ioSample.getAnalogValue(IOLine.getDIO(i)), 2))); } } return parameters; }
Source:
<code><START> public BigtableInstanceAdminSettings getInstanceAdminSettings() throws IOException { <END> Preconditions.checkState( isNullOrEmpty(configuration.get(BIGTABLE_EMULATOR_HOST_KEY)), "Instance admin does not support emulator"); if (instanceAdminSettings == null) { BigtableInstanceAdminSettings.Builder builder = BigtableInstanceAdminSettings.newBuilder().setProjectId(projectId); String adminHostOverride = configuration.get(BIGTABLE_ADMIN_HOST_KEY); String endpoint = adminHostOverride + ":" + getPort(); LOG.debug("Instance Admin endpoint host:port is %s.", endpoint); builder.stubSettings().setHeaderProvider(buildHeaderProvider()); if (configuration instanceof BigtableExtendedConfiguration || Boolean.parseBoolean(configuration.get(BIGTABLE_USE_SERVICE_ACCOUNTS_KEY))) { builder.stubSettings().setCredentialsProvider(buildCredentialProvider()); } else if (Boolean.parseBoolean(configuration.get(BIGTABLE_NULL_CREDENTIAL_ENABLE_KEY))) { builder.stubSettings().setCredentialsProvider(NoCredentialsProvider.create()); } instanceAdminSettings = builder.build(); } return instanceAdminSettings; }</code><technical_language>Please build this is eagerly, duplicate emulator check in getter</technical_language>

Target:
public BigtableInstanceAdminSettings getInstanceAdminSettings() { return instanceAdminSettings; }
Source:
<code>public SensorRecord[] getRecentSensorRecords(int numOfRecentPages) { if (numOfRecentPages < 1) { throw new IllegalArgumentException("Number of pages must be greater than 1."); } log.debug("Reading Sensor page range..."); int endPage = readDataBasePageRange(RecordType.SENSOR_DATA); <START> log.debug("Reading " + numOfRecentPages + " Sensor page(s)..."); <END> numOfRecentPages = numOfRecentPages - 1; SensorRecord[] allPages = new SensorRecord[0]; for (int i = Math.min(numOfRecentPages,endPage); i >= 0; i--) { int nextPage = endPage - i; log.debug("Reading #" + i + " Sensor pages (page number " + nextPage + ")"); SensorRecord[] ithSensorRecordPage = readDataBasePage(RecordType.SENSOR_DATA, nextPage); SensorRecord[] result = Arrays.copyOf(allPages, allPages.length + ithSensorRecordPage.length); System.arraycopy(ithSensorRecordPage, 0, result, allPages.length, ithSensorRecordPage.length); allPages = result; } log.debug("Read complete of Sensor pages."); return allPages; }</code><technical_language>slf4j-style formatting</technical_language>

Target:
public SensorRecord[] getRecentSensorRecords(int numOfRecentPages) { if (numOfRecentPages < 1) { throw new IllegalArgumentException("Number of pages must be greater than 1."); } log.debug("Reading Sensor page range..."); int endPage = readDataBasePageRange(RecordType.SENSOR_DATA); log.debug("Reading Sensor page(s)...", numOfRecentPages); numOfRecentPages = numOfRecentPages - 1; SensorRecord[] allPages = new SensorRecord[0]; for (int i = Math.min(numOfRecentPages,endPage); i >= 0; i--) { int nextPage = endPage - i; log.debug("Reading #{} Sensor pages (page number {})", i, nextPage); SensorRecord[] ithSensorRecordPage = readDataBasePage(RecordType.SENSOR_DATA, nextPage); SensorRecord[] result = Arrays.copyOf(allPages, allPages.length + ithSensorRecordPage.length); System.arraycopy(ithSensorRecordPage, 0, result, allPages.length, ithSensorRecordPage.length); allPages = result; } log.debug("Read complete of Sensor pages."); return allPages; }
Source:
<code>private ParseResultCallable(String testResults, long buildTime, long nowMaster, boolean keepLongStdio) { this.buildTime = buildTime; this.testResults = testResults; this.nowMaster = nowMaster; this.keepLongStdio = keepLongStdio; <START> this.listener = null; <END> }</code><technical_language>This constructor call generic <code>this()</code></technical_language>

Target:
private ParseResultCallable(String testResults, long buildTime, long nowMaster, boolean keepLongStdio) { this.buildTime = buildTime; this.testResults = testResults; this.nowMaster = nowMaster; this.keepLongStdio = keepLongStdio; }