auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void edit(final VolumeBrickModel object) { bricksTable.asEditor().edit(object.getBricks()); driver.edit(object); addBrickButton.setCommand(object.getAddBrickCommand()); removeBricksButton.setCommand(object.getRemoveBricksCommand()); removeAllBricksButton.setCommand(object.getRemoveAllBricksCommand()); moveBricksUpButton.setCommand(object.getMoveBricksUpCommand()); moveBricksDownButton.setCommand(object.getMoveBricksDownCommand()); GlusterVolumeType volumeType = (GlusterVolumeType) object.getVolumeType().getEntity(); if (volumeType == GlusterVolumeType.DISTRIBUTED_REPLICATE) { infoLabel.setText(constants.distributedReplicateVolumeBrickInfoLabel()); } else if (volumeType == GlusterVolumeType.DISTRIBUTED_STRIPE) { infoLabel.setText(constants.distributedStripeVolumeBrickInfoLabel()); } else { infoLabel.setText(null); } <START> <END> forceWarningLabel.setVisible(false); object.getForce().getEntityChangedEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { forceWarningLabel.setVisible(object.getForce().getEntity()); } }); }</code><technical_language>I get visible status model set visibility of warning, if open close add bricks dialog box in create volume scenario, warnings shown</technical_language>

Target:
public void edit(final VolumeBrickModel object) { bricksTable.asEditor().edit(object.getBricks()); driver.edit(object); addBrickButton.setCommand(object.getAddBrickCommand()); removeBricksButton.setCommand(object.getRemoveBricksCommand()); removeAllBricksButton.setCommand(object.getRemoveAllBricksCommand()); moveBricksUpButton.setCommand(object.getMoveBricksUpCommand()); moveBricksDownButton.setCommand(object.getMoveBricksDownCommand()); GlusterVolumeType volumeType = (GlusterVolumeType) object.getVolumeType().getEntity(); if (volumeType == GlusterVolumeType.DISTRIBUTED_REPLICATE) { infoLabel.setText(constants.distributedReplicateVolumeBrickInfoLabel()); } else if (volumeType == GlusterVolumeType.DISTRIBUTED_STRIPE) { infoLabel.setText(constants.distributedStripeVolumeBrickInfoLabel()); } else { infoLabel.setText(null); } forceWarningLabel.setVisible(object.getForce().getEntity()); object.getForce().getEntityChangedEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { forceWarningLabel.setVisible(object.getForce().getEntity()); } }); }
Source:
<code>protected void syncSearch() { if (getEntity() == null) { return; } AsyncQuery asyncQuery = new AsyncQuery(); asyncQuery.setModel(this); asyncQuery.asyncCallback = new INewAsyncCallback() { @Override @SuppressWarnings("unchecked") public void onSuccess(Object model, Object returnValue) { NetworkExternalSubnetListModel.this.setItems((List<ExternalSubnet>) returnValue); } }; <START> AsyncDataProvider.getExternalSubnetsByNetworkId(asyncQuery, getEntity().getId()); <END> }</code><technical_language>This paragraph replaced super.syncSearch(), basically performs thing. need override special is performed, backend result is for setItems()</technical_language>

Target:
protected void syncSearch() { if (getEntity() == null) { return; } super.syncSearch(VdcQueryType.GetExternalSubnetsOnProviderByNetwork, new IdQueryParameters(getEntity().getId())); }
Source:
<code>public void bind(int position) { UploadableFile uploadableFile = uploadableFiles.get(position); Uri uri = uploadableFile.getMediaUri(); background.setImageURI(Uri.fromFile(new File(String.valueOf(uri)))); GradientDrawable drawable = new GradientDrawable(); if (position == callback.getCurrentSelectedFilePosition()) { drawable.setShape(GradientDrawable.RECTANGLE); <START> drawable.setStroke(6, Color.parseColor("#6187A1")); <END> rlContainer.setEnabled(true); rlContainer.setClickable(true); rlContainer.setAlpha(1.0f); rlContainer.setBackground(drawable); if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { rlContainer.setElevation(10); } } else { rlContainer.setEnabled(false); rlContainer.setClickable(false); rlContainer.setAlpha(0.7f); rlContainer.setBackgroundResource(0); if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { rlContainer.setElevation(0); } } }</code><technical_language>define this color in **colors.xml** file getColor() instead</technical_language>

Target:
public void bind(int position) { UploadableFile uploadableFile = uploadableFiles.get(position); Uri uri = uploadableFile.getMediaUri(); background.setImageURI(Uri.fromFile(new File(String.valueOf(uri)))); if (position == callback.getCurrentSelectedFilePosition()) { rlContainer.setEnabled(true); rlContainer.setClickable(true); rlContainer.setAlpha(1.0f); if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { rlContainer.setElevation(10); } } else { rlContainer.setEnabled(false); rlContainer.setClickable(false); rlContainer.setAlpha(0.5f); if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { rlContainer.setElevation(0); } } }
Source:
<code>public Aggregation(StreamInput in) throws IOException { functionInfo = new FunctionInfo(in); valueType = DataTypes.fromStream(in); if (in.getVersion().onOrAfter(Version.V_4_1_0)) { filter = Symbols.fromStream(in); } else { filter = Literal.BOOLEAN_TRUE; } inputs = Symbols.listFromStream(in); <START> if (in.getVersion().onOrAfter(Version.V_4_1_0) && in.readBoolean()) { <END> signature = new Signature(in); } else { signature = null; } }</code><technical_language>This 4.2, no</technical_language>

Target:
public Aggregation(StreamInput in) throws IOException { functionInfo = new FunctionInfo(in); valueType = DataTypes.fromStream(in); if (in.getVersion().onOrAfter(Version.V_4_1_0)) { filter = Symbols.fromStream(in); } else { filter = Literal.BOOLEAN_TRUE; } inputs = Symbols.listFromStream(in); if (in.getVersion().onOrAfter(Version.V_4_2_0) && in.readBoolean()) { signature = new Signature(in); } else { signature = null; } }
Source:
<code>public static gov.hhs.fha.nhinc.patientdiscovery.persistence.HibernateUtil getPatientDiscoveryHibernateUtil() { ClassPathXmlApplicationContext context = ClassPathSingleton.CONTEXT; <START> LOG.debug("Memory address getPatientDiscoveryHibernateUtil {}", context.getId()); <END> if (patientDiscoveryHibernateUtil == null) { patientDiscoveryHibernateUtil = context.getBean(NhincConstants.PATIENT_DISCOVERY_HIBERNATE_BEAN, gov.hhs.fha.nhinc.patientdiscovery.persistence.HibernateUtil.class); } return patientDiscoveryHibernateUtil; }</code><technical_language>Do need this</technical_language>

Target:
public static gov.hhs.fha.nhinc.patientdiscovery.persistence.HibernateUtil getPatientDiscoveryHibernateUtil() { ClassPathXmlApplicationContext context = ClassPathSingleton.CONTEXT; if (patientDiscoveryHibernateUtil == null) { patientDiscoveryHibernateUtil = context.getBean(NhincConstants.PATIENT_DISCOVERY_HIBERNATE_BEAN, gov.hhs.fha.nhinc.patientdiscovery.persistence.HibernateUtil.class); } return patientDiscoveryHibernateUtil; }
Source:
<code>public String preparePdfHeader(Study study, Study site, String studySubjectIdentifier) { String siteName = null; String studyName = null; String participantID = studySubjectIdentifier.trim(); <START> MessageFormat pdfHeaderFormat1 = new MessageFormat("{0}: {1} - Participant {2}"); <END> MessageFormat pdfHeaderFormat2 = new MessageFormat("{0} - Participant {2}"); if(study != null) { studyName = study.getName(); } if(site !=null) { siteName = site.getName(); } Object[] headerArgs = {studyName, siteName,participantID}; String pdfHeader; if(siteName !=null) { pdfHeader = pdfHeaderFormat1.format(headerArgs); }else { pdfHeader = pdfHeaderFormat2.format(headerArgs); } return pdfHeader; }</code><technical_language>variables static final, initialize time</technical_language>

Target:
public String preparePdfHeader(Study study, Study site, String studySubjectIdentifier) { String siteName = null; String studyName = null; String participantID = studySubjectIdentifier.trim(); if(study != null) { studyName = study.getName(); } if(site !=null) { siteName = site.getName(); } Object[] headerArgs = {studyName, siteName,participantID}; String pdfHeader; if(siteName !=null) { pdfHeader = pdfHeaderFormat1.format(headerArgs); }else { pdfHeader = pdfHeaderFormat2.format(headerArgs); } return pdfHeader; }
Source:
<code>public void localSegments(IntSet localSegments) { <START> segments.forEach((int s) -> { <END> if (!localSegments.contains(s)) { if (trace) { log.tracef("Could not process segment %s", s); } segmentsLost.add(s); } }); }</code><technical_language>I lambdas again, lostSegments() enhanced for loop :)</technical_language>

Target:
public void localSegments(IntSet localSegments) { for (PrimitiveIterator.OfInt segmentIterator = segments.iterator(); segmentIterator.hasNext(); ) { int segment = segmentIterator.nextInt(); if (!localSegments.contains(segment)) { if (trace) { log.tracef("Could not process segment %s", segment); } segmentsLost.add(segment); } } }
Source:
<code>public void testFailWithMultipleDisksWhichOneInBackupStorage() { final VM vm = new VM(); command.setVm(vm); when(vmDao.get(command.getParameters().getVmId())).thenReturn(vm); command.setCluster(new Cluster()); Guid storageDomainId1 = initDiskImage(vm); when(storageDomainStaticDao.get(storageDomainId1)).thenReturn(backupStorageDomain(false)); Guid storageDomainId2 = initDiskImage(vm); when(storageDomainStaticDao.get(storageDomainId2)).thenReturn(backupStorageDomain(true)); <START> assertFalse("checkDisksNotInBackupStorage() fails to run because one or more disk is in backup domain", <END> command.checkDisksInBackupStorage()); }</code><technical_language>assertTrue</technical_language>

Target:
public void testFailWithMultipleDisksWhichOneInBackupStorage() { final VM vm = new VM(); command.setVm(vm); when(vmDao.get(command.getParameters().getVmId())).thenReturn(vm); command.setCluster(new Cluster()); Guid storageDomainId1 = initDiskImage(vm); when(storageDomainStaticDao.get(storageDomainId1)).thenReturn(backupStorageDomain(false)); Guid storageDomainId2 = initDiskImage(vm); when(storageDomainStaticDao.get(storageDomainId2)).thenReturn(backupStorageDomain(true)); assertTrue("checkDisksNotInBackupStorage() fails to run because one or more disk is in backup domain", command.checkDisksInBackupStorage()); }
Source:
<code>public List<Tree.Kind> nodesToVisit() { <START> return ImmutableList.of(Tree.Kind.CLASS, Tree.Kind.METHOD); <END> }</code><technical_language>need Classes Methods registering CLASS, iterate members (Trees)? 2 cases handle: * a VariableTree, necessarily a field, declaration... in cases absolutely need rely isField() method. * a MethodTree, a method... need check parameters already. * else (inner class for instance), do</technical_language>

Target:
public List<Tree.Kind> nodesToVisit() { return ImmutableList.of(Tree.Kind.CLASS); }
Source:
<code>private void takeEvidenceAndAnswerQuery() { Map<Timestep, Evidence> slicedEvidence = DBLOGUtil .splitEvidenceInTime(evidence); Map<Timestep, List<Query>> slicedQueries = DBLOGUtil .splitQueriesInTime((List<Query>) queries); if (slicedEvidence.containsKey(null)) { take(slicedEvidence.get(null)); } <START> List<Timestep> nonNullTimesteps = new ArrayList<Timestep>(); <END> nonNullTimesteps.addAll(slicedEvidence.keySet()); nonNullTimesteps.addAll(slicedQueries.keySet()); nonNullTimesteps.remove(null); Collections.sort(nonNullTimesteps); for (Timestep timestep : nonNullTimesteps) { if (slicedEvidence.containsKey(timestep)) { take(slicedEvidence.get(timestep)); } if (slicedQueries.containsKey(timestep)) { List<Query> currentQueries = slicedQueries.get(timestep); for (Particle particle : particles) { particle.answer(currentQueries); } if (timestep.intValue() % queryReportInterval == 0) { System.out.println("======== Query Results ========="); System.out.println("After timestep " + timestep.intValue()); for (Query q : currentQueries) { q.printResults(System.out); } } } removePriorTimeSlice(timestep); } if (slicedQueries.containsKey(null)) { List<Query> currentQueries = slicedQueries.get(null); for (Particle particle : particles) { particle.answer(currentQueries); } } }</code><technical_language>TreeSet (can remove duplicate automatically sort). timestep this is fine</technical_language>

Target:
private void takeEvidenceAndAnswerQuery() { Map<Timestep, Evidence> slicedEvidence = DBLOGUtil .splitEvidenceInTime(evidence); Map<Timestep, List<Query>> slicedQueries = DBLOGUtil .splitQueriesInTime((List<Query>) queries); if (slicedEvidence.containsKey(null)) { take(slicedEvidence.get(null)); } List<Timestep> nonNullTimesteps = new ArrayList<Timestep>(); nonNullTimesteps.addAll(slicedEvidence.keySet()); nonNullTimesteps.addAll(slicedQueries.keySet()); nonNullTimesteps.remove(null); TreeSet<Timestep> sortedTimesteps = new TreeSet<Timestep>(nonNullTimesteps); for (Timestep timestep : sortedTimesteps) { if (slicedEvidence.containsKey(timestep)) { take(slicedEvidence.get(timestep)); } if (slicedQueries.containsKey(timestep)) { List<Query> currentQueries = slicedQueries.get(timestep); for (Particle particle : particles) { particle.answer(currentQueries); } if (timestep.intValue() % queryReportInterval == 0) { TableWriter tableWriter = new TableWriter(queries); tableWriter.setHeader("After timestep " + timestep.intValue()); tableWriter.writeResults(System.out); } } removePriorTimeSlice(timestep); } if (slicedQueries.containsKey(null)) { List<Query> currentQueries = slicedQueries.get(null); for (Particle particle : particles) { particle.answer(currentQueries); } } }
Source:
<code><START> public void migrate() <END> { MigrationContext context = new MigrationContext(databaseType); try (Handle handle = dbi.open()) { boolean isInitial = !existsSchemaMigrationsTable(handle); if (isInitial) { createSchemaMigrationsTable(handle, context); } for (Migration m : migrations) { Set<String> appliedSet = getAppliedMigrationNames(handle); if (appliedSet.add(m.getVersion())) { logger.info("Applying database migration:" + m.getVersion()); if (m.noTransaction()) { applyMigration(m, handle, context); } else { handle.inTransaction((h, session) -> { if (context.isPostgres()) { h.update("LOCK TABLE schema_migrations IN EXCLUSIVE MODE"); } applyMigration(m, handle, context); return true; }); } } } } }</code><technical_language>minor: method modifier changed "private"</technical_language>

Target:
public int migrate() { int numApplied = 0; MigrationContext context = new MigrationContext(databaseType); try (Handle handle = dbi.open()) { boolean isInitial = !existsSchemaMigrationsTable(handle); if (isInitial) { createSchemaMigrationsTable(handle, context); } for (Migration m : migrations) { Set<String> appliedSet = getAppliedMigrationNames(handle); if (appliedSet.add(m.getVersion())) { logger.info("Applying database migration:" + m.getVersion()); numApplied++; if (m.noTransaction()) { applyMigration(m, handle, context); } else { handle.inTransaction((h, session) -> { if (context.isPostgres()) { h.update("LOCK TABLE schema_migrations IN EXCLUSIVE MODE"); } applyMigration(m, handle, context); return true; }); } } } } return numApplied; }
Source:
<code>public void onDeploy(DeploymentEvent event) { InternalRuntimeManager runtimeManager = (InternalRuntimeManager) event.getDeployedUnit().getRuntimeManager(); if (runtimeManager instanceof PerCaseRuntimeManager) { List<CaseEventListener> caseEventListeners = getEventListenerFromDescriptor(runtimeManager); logger.debug("Adding following case event listeners for deployment {}", caseEventListeners, event.getDeploymentId()); TransactionalCommandService commandService = transactionalCommandService; if (commandService == null) { commandService = new TransactionalCommandService(((SimpleRuntimeEnvironment) runtimeManager.getEnvironment()).getEmf()); } <START> CaseEventListener auditEventListener = getCaseAuditEventListner(runtimeManager, commandService); <END> caseEventListeners.add(auditEventListener); caseEventListeners.add(new NotifyParentCaseEventListener(identityProvider)); CaseEventSupport caseEventSupport = new CaseEventSupport(identityProvider, caseEventListeners); ((PerCaseRuntimeManager) runtimeManager).setCaseEventSupport(caseEventSupport); logger.debug("CaseEventSupport configured for deployment {}", event.getDeploymentId()); } }</code><technical_language>noticed getCaseAuditEvent*Listner* typo N&N :)</technical_language>

Target:
public void onDeploy(DeploymentEvent event) { InternalRuntimeManager runtimeManager = (InternalRuntimeManager) event.getDeployedUnit().getRuntimeManager(); if (runtimeManager instanceof PerCaseRuntimeManager) { List<CaseEventListener> caseEventListeners = getEventListenerFromDescriptor(runtimeManager); logger.debug("Adding following case event listeners for deployment {}", caseEventListeners, event.getDeploymentId()); TransactionalCommandService commandService = transactionalCommandService; if (commandService == null) { commandService = new TransactionalCommandService(((SimpleRuntimeEnvironment) runtimeManager.getEnvironment()).getEmf()); } CaseEventListener auditEventListener = getCaseAuditEventListener(runtimeManager, commandService); caseEventListeners.add(auditEventListener); caseEventListeners.add(new NotifyParentCaseEventListener(identityProvider)); CaseEventSupport caseEventSupport = new CaseEventSupport(identityProvider, caseEventListeners); ((PerCaseRuntimeManager) runtimeManager).setCaseEventSupport(caseEventSupport); logger.debug("CaseEventSupport configured for deployment {}", event.getDeploymentId()); } }
Source:
<code>public void setSpmMap(String spId, Host host) { <START> spmMap.put(spId, host); <END> }</code><technical_language>refer spmMap "this". Please consistent</technical_language>

Target:
public void setSpmMap(String spId, Host host) { this.spmMap.put(spId, host); }
Source:
<code>protected void relayout(ToolBar layoutBar, int oldCount, int newCount) { if (oldCount != newCount && newCount != 0) { <START> Point beforePack = layoutBar.getSize(); <END> layoutBar.pack(true); Point afterPack = layoutBar.getSize(); if (beforePack.equals(afterPack)) { return; } layoutBar.getParent().layout(); if (layoutBar.getParent() instanceof CoolBar) { CoolBar cb = (CoolBar) layoutBar.getParent(); CoolItem[] items = cb.getItems(); for (CoolItem item : items) { if (item.getControl() == layoutBar) { Point curSize = item.getSize(); item.setSize(curSize.x + (afterPack.x - beforePack.x), curSize.y + (afterPack.y - beforePack.y)); return; } } } layoutBar.getParent().requestLayout(); } }</code><technical_language>Suggestion for future work: This work if deleted body of this if statement replaced a single call layoutBar.requestLayout()... work of CoolBar relies explicit setSize call determine CoolItem sizes. If fix CoolBar's layout computed sizes of children directly, simplify this code</technical_language>

Target:
protected void relayout(ToolBar layoutBar, int oldCount, int newCount) { if (oldCount != newCount && newCount != 0) { Point beforePack = layoutBar.getSize(); layoutBar.pack(true); Point afterPack = layoutBar.getSize(); if (beforePack.equals(afterPack)) { return; } layoutBar.requestLayout(); if (layoutBar.getParent() instanceof CoolBar) { CoolBar cb = (CoolBar) layoutBar.getParent(); CoolItem[] items = cb.getItems(); for (CoolItem item : items) { if (item.getControl() == layoutBar) { Point curSize = item.getSize(); item.setSize(curSize.x + (afterPack.x - beforePack.x), curSize.y + (afterPack.y - beforePack.y)); return; } } } } }
Source:
<code>public void exportCsv() throws IOException { bootstrap("--input", "../test-files/Windup1x-javaee-example-tiny.war", "--output", tmp.getRoot().getAbsolutePath(), "--target", "eap7", "--exportCSV"); File csv = new File(tmp.getRoot(), "Windup1x_javaee_example_tiny_war.csv"); assertTrue(csv.exists()); String csvContent = new String(Files.readAllBytes(csv.toPath()), "UTF-8"); assertTrue(csvContent.contains("Windup1x-javaee-example-tiny.war")); File allIssuesCsv = new File(tmp.getRoot(), "AllIssues.csv"); assertTrue(allIssuesCsv.exists()); File appTagsCsv = new File(tmp.getRoot(), "ApplicationFileTechnologies.csv"); <START> assertTrue(appTagsCsv.exists()); <END> }</code><technical_language>I understood problem....but, goal of ticket provide a sort tags in CSV file generated ? checking content of CSV file is</technical_language>

Target:
public void exportCsv() throws IOException { bootstrap("--input", "../test-files/Windup1x-javaee-example-tiny.war", "--output", tmp.getRoot().getAbsolutePath(), "--target", "eap7", "--exportCSV"); File csv = new File(tmp.getRoot(), "Windup1x_javaee_example_tiny_war.csv"); assertTrue(csv.exists()); String csvContent = new String(Files.readAllBytes(csv.toPath()), "UTF-8"); assertTrue(csvContent.contains("Windup1x-javaee-example-tiny.war")); File allIssuesCsv = new File(tmp.getRoot(), "AllIssues.csv"); assertTrue(allIssuesCsv.exists()); File appTagsCsv = new File(tmp.getRoot(), "ApplicationFileTechnologies.csv"); assertTrue(appTagsCsv.exists()); List<List<String>> records = readCSVFile(appTagsCsv); assertTrue(records.stream().allMatch(this::isRowSorted)); }
Source:
<code>public QuotaStorageConsumptionParameter clone() { return new QuotaStorageConsumptionParameter( this.quotaGuid, this.quota, this.action, this.storageDomainId, <START> this.requestedStorageGB); <END> }</code><technical_language>need for 'this'</technical_language>

Target:
public QuotaStorageConsumptionParameter clone() { return new QuotaStorageConsumptionParameter( this.getQuotaGuid(), this.getQuota(), this.getAction(), this.storageDomainId, this.requestedStorageGB); }
Source:
<code>public static <T extends Serializable> T roundtrip(final T msg) { <START> return SerializationUtils.deserialize(SerializationUtils.serialize(msg)); <END> }</code><technical_language>whoops, removing this again? :-)</technical_language>

Target:
public static <T extends Serializable> T roundtrip(final T msg) { return (T) SerializationUtils.deserialize(SerializationUtils.serialize(msg)); }
Source:
<code>private List<AbstractInsnNode> createInstructionList() { final List<AbstractInsnNode> list = new LinkedList<>(); for (AbstractInsnNode abstractInsnNode : this.rawNode.instructions) { list.add(abstractInsnNode); } <START> this.lazyInstructions = new ArrayList<>(list); <END> return this.lazyInstructions; }</code><technical_language>wondering is a double copy of list. iterating this.rawNode.instructions instructions "copied" list. list copied new ArraList<>(list) . I copy is necessary. ArrayList beginning. Is size/number of instructions known? sense initialize ArrayList number of items copying instructions</technical_language>

Target:
private List<AbstractInsnNode> createInstructionList() { final List<AbstractInsnNode> list = new ArrayList<>(); for (AbstractInsnNode abstractInsnNode : this.rawNode.instructions) { list.add(abstractInsnNode); } this.lazyInstructions = list; return this.lazyInstructions; }
Source:
<code>public static boolean containsControlCharacters( String path ) { if ( StringUtils.isNotBlank( path ) ) { <START> Pattern pattern = Pattern.compile( "[\\x00-\\x1F\\x7F]" ); Matcher matcher = pattern.matcher( path ); return matcher.find(); <END> } return false; }</code><technical_language>just: RegExp pattern = RegExp.compile( "[\\x00-\\x1F\\x7F]" ); return pattern.test( path );</technical_language>

Target:
public static boolean containsControlCharacters( String path ) { RegExp pattern = RegExp.compile( "[\\x00-\\x1F\\x7F]" ); return pattern.test( path ); }
Source:
<code>public void simple_for() { verifyBlockCfg("" + <START> "before(succ = [cond], elem = 1);" + <END> "for ($i=1, $j=1 ; $i < 1, $j < 1, cond(succ=[forBody, END], elem=5); update(succ=[cond], elem=2), $i++) {" + " forBody( succ = [update], elem = 1 );" + "}"); verifyBlockCfg("" + "for ($i=1 ; cond(succ=[forBody, END], elem=2); $i++, $i++, update(succ=[cond], elem=3)) :" + " forBody(succ=[update], elem=1 );" + "endfor;"); }</code><technical_language>1 elem</technical_language>

Target:
public void simple_for() { verifyBlockCfg("" + "before(succ = [cond], elem = 3);" + "for ($i=1, $j=1 ; cond(succ = [forBody, END], elem=3), $i < 1, $j < 1; update(succ = [cond], elem=2), $i++) {" + " forBody( succ = [update], elem = 1 );" + "}"); verifyBlockCfg("" + "for (before(succ = [cond], elem = 2), $i=1; cond(succ = [forBody, END], elem=2), $i < 10; update(succ = [cond], elem = 2), $i++ ) :" + " forBody(succ = [update], elem=1 );" + "endfor;"); }
Source:
<code>public <T> FieldProjectionBuilder<T> createFieldValueProjectionBuilder(String absoluteFieldPath, Class<T> expectedType, ProjectionConverter projectionConverter) { checkProjectable( absoluteFieldPath, projectable ); <START> if ( projectionConverter.isEnabled() && !converter.isConvertedTypeAssignableTo( expectedType ) ) { <END> throw log.invalidProjectionInvalidType( absoluteFieldPath, expectedType, EventContexts.fromIndexFieldAbsolutePath( absoluteFieldPath ) ); } return (FieldProjectionBuilder<T>) new LuceneFieldProjectionBuilder<>( absoluteFieldPath, getConverter( projectionConverter ), codec ); }</code><technical_language>check type is assignable in cases. Just, projection converter is disabled, call isConvertedTypeAssignableTo *raw* converter. Note tests fail, missing a test try pass wrong type rawField(String, Class)</technical_language>

Target:
public <T> FieldProjectionBuilder<T> createFieldValueProjectionBuilder(String absoluteFieldPath, Class<T> expectedType, ProjectionConverter projectionConverter) { checkProjectable( absoluteFieldPath, projectable ); FromDocumentFieldValueConverter<? super F, ?> requestConverter = getConverter( projectionConverter ); if ( !requestConverter.isConvertedTypeAssignableTo( expectedType ) ) { throw log.invalidProjectionInvalidType( absoluteFieldPath, expectedType, EventContexts.fromIndexFieldAbsolutePath( absoluteFieldPath ) ); } return (FieldProjectionBuilder<T>) new LuceneFieldProjectionBuilder<>( absoluteFieldPath, requestConverter, codec ); }
Source:
<code>private final void populateGrouplessLabels(List<String> finalLabels, List<String> matchedLabels, Optional<String> suggestion) { FlowPane groupless = createGroupPane(GROUPLESS_PAD); allLabels.stream() .filter(label -> !label.isInGroup()) .map(label -> new PickerLabel(label, false)) .forEach(label -> groupless.getChildren().add(processMatchedLabel( label.getFullName(), matchedLabels, finalLabels, suggestion))); <START> if (!groupless.getChildren().isEmpty()) feedbackLabels.getChildren().add(groupless); <END> }</code><technical_language>if add checking for empty list? result</technical_language>

Target:
private final void populateGrouplessLabels(List<String> finalLabels, List<String> matchedLabels, Optional<String> suggestion) { FlowPane groupless = createGroupPane(GROUPLESS_PAD); allLabels.stream() .filter(label -> !label.isInGroup()) .map(label -> new PickerLabel(label, false)) .forEach(label -> groupless.getChildren().add(processMatchedLabel( label.getFullName(), matchedLabels, finalLabels, suggestion))); feedbackLabels.getChildren().add(groupless); }
Source:
<code><START> public List<IAtsConfigObject> getProgramInsertions(@PathParam("uuid") long uuid) throws Exception { <END> ArtifactReadable programArt = atsServer.getQuery().andUuid(uuid).getResults().getExactlyOne(); if (!programArt.getArtifactType().equals(AtsArtifactTypes.Program)) { throw new OseeCoreException("Given uuid not program type"); } ResultSet<ArtifactReadable> results = programArt.getRelated(AtsRelationTypes.ProgramToInsertion_Insertion); List<IAtsConfigObject> insertions = new LinkedList<IAtsConfigObject>(); for (ArtifactReadable insertion : results) { insertions.add(atsServer.getConfigItemFactory().getInsertion(insertion)); } return insertions; }</code><technical_language>switch this other getQuery.andUuid calls atsServer.getArtifactByUuid(uuid)</technical_language>

Target:
public Response getProgramInsertions(@PathParam("uuid") long uuid) throws Exception { ArtifactReadable programArt = atsServer.getArtifactByUuid(uuid); if (programArt == null) { throw new OseeCoreException("Given uuid not found"); } if (!programArt.getArtifactType().equals(AtsArtifactTypes.Program)) { throw new OseeCoreException("Given uuid not program type"); } ResultSet<ArtifactReadable> results = programArt.getRelated(AtsRelationTypes.ProgramToInsertion_Insertion); List<IAtsConfigObject> insertions = new LinkedList<IAtsConfigObject>(); for (ArtifactReadable insertion : results) { insertions.add(atsServer.getConfigItemFactory().getInsertion(insertion)); } GenericEntity<List<IAtsConfigObject>> entity = new GenericEntity<List<IAtsConfigObject>>(insertions) { }; return Response.ok(entity).build(); }
Source:
<code>private String formatColumnDefinition(ColumnDefinition column) { StringBuilder sb = new StringBuilder(formatExpression(column.getName(), parameters)) .append(" ").append(column.getType()); if (column.getComment().isPresent()) { sb.append(" COMMENT ").append(formatStringLiteral(column.getComment().get())); } sb.append(formatPropertiesSingleLine(column.getProperties())); if (!column.isNullable()) { <START> sb.append(" NOT NULL "); <END> } if (column.getDefaultValue().isPresent()) { sb.append(" DEFAULT ").append(column.getDefaultValue().get()); } return sb.toString(); }</code><technical_language>Nit: trailing space here, this result in extra space</technical_language>

Target:
private String formatColumnDefinition(ColumnDefinition column) { StringBuilder sb = new StringBuilder(formatExpression(column.getName(), parameters)) .append(" ").append(column.getType()); if (column.getDefaultValue().isPresent()) { sb.append(" DEFAULT ").append(column.getDefaultValue().get()); } if (!column.isNullable()) { sb.append(" NOT NULL"); } if (column.getComment().isPresent()) { sb.append(" COMMENT ").append(formatStringLiteral(column.getComment().get())); } sb.append(formatPropertiesSingleLine(column.getProperties())); return sb.toString(); }
Source:
<code>private CompletableFuture<RestResponse> getCacheKeys(RestRequest request) throws RestResponseException { String cacheName = request.variables().get("cacheName"); String accept = request.getAcceptHeader(); if (accept == null) accept = MediaType.MATCH_ALL_TYPE; MediaType contentType = negotiateMediaType(accept, cacheName); AdvancedCache<Object, Object> cache = restCacheManager.getCache(cacheName, TEXT_PLAIN, TEXT_PLAIN); Charset mediaCharset = Charset.fromMediaType(accept); Charset charset = mediaCharset == null ? Charset.UTF8 : mediaCharset; <START> return CompletableFuture.supplyAsync(cache::keySet, executor).thenApply(keys -> { <END> NettyRestResponse.Builder responseBuilder = new NettyRestResponse.Builder(); responseBuilder.contentType(contentType); responseBuilder.header(HttpHeaderNames.CACHE_CONTROL.toString(), CacheControl.noCache()); OutputPrinter outputPrinter = EntrySetFormatter.forMediaType(contentType); responseBuilder.entity(outputPrinter.print(cacheName, keys, charset)); return responseBuilder.build(); }); }</code><technical_language>keySet method is blocking already. worry is iterator hasNext method instead</technical_language>

Target:
private CompletionStage<RestResponse> getCacheKeys(RestRequest request) throws RestResponseException { String cacheName = request.variables().get("cacheName"); String accept = request.getAcceptHeader(); if (accept == null) accept = MediaType.MATCH_ALL_TYPE; MediaType contentType = negotiateMediaType(accept, cacheName); AdvancedCache<Object, Object> cache = restCacheManager.getCache(cacheName, TEXT_PLAIN, TEXT_PLAIN); Charset mediaCharset = Charset.fromMediaType(accept); Charset charset = mediaCharset == null ? Charset.UTF8 : mediaCharset; return CompletableFuture.supplyAsync(() -> { NettyRestResponse.Builder responseBuilder = new NettyRestResponse.Builder(); responseBuilder.contentType(contentType); responseBuilder.header(HttpHeaderNames.CACHE_CONTROL.toString(), CacheControl.noCache()); OutputPrinter outputPrinter = EntrySetFormatter.forMediaType(contentType); responseBuilder.entity(outputPrinter.print(cacheName, cache.keySet(), charset)); return responseBuilder.build(); }, executor); }
Source:
<code><START> static <E,T> Validation<E,T> valid(Supplier<? extends T> supplier) { <END> return new Valid<>(supplier.get()); }</code><technical_language>Please add a check Objects.requireNonNull(supplier, "supplier is null");</technical_language>

Target:
static <E,T> Validation<E,T> valid(Supplier<? extends T> supplier) { Objects.requireNonNull(supplier, "supplier is null"); return new Valid<>(supplier.get()); }
Source:
<code>private void saveUsageEvent(String usageType, long accountId, long zoneId, long resourceId, String resourceName, Long offeringId, Long templateId, String resourceType, Map<String, String> details) { UsageEventVO usageEvent = new UsageEventVO(usageType, accountId, zoneId, resourceId, resourceName, offeringId, templateId, resourceType); <START> _usageEventDao.persist(usageEvent); <END> _usageEventDao.saveDetails(usageEvent.getId(), details); }</code><technical_language>please change usageEventDao. reason in modern days prefixes</technical_language>

Target:
private void saveUsageEvent(String usageType, long accountId, long zoneId, long resourceId, String resourceName, Long offeringId, Long templateId, String resourceType, Map<String, String> details) { UsageEventVO usageEvent = new UsageEventVO(usageType, accountId, zoneId, resourceId, resourceName, offeringId, templateId, resourceType); usageEventDao.persist(usageEvent); usageEventDao.saveDetails(usageEvent.getId(), details); }
Source:
<code>private static void start() { if (!isProperlyConfigured) { return; } try { logger.debug("Creating Cisco Spark client..."); CiscoSpark.spark = createSpark(); logger.debug("Retrieving user..."); Person person = CiscoSpark.spark.people().path("/me").get(); <START> logger.info("Cisco Spark logged in as " + person.getDisplayName()); <END> } catch (SparkException se) { logger.error("Failed to initialized Cisco Spark", se); } catch (Exception e) { logger.error("Failed to initialized Cisco Spark!", e); } logger.info("Cisco Spark has been successfully started"); }</code><technical_language>parameterized logging instead of string concatenation</technical_language>

Target:
private void start() { if (!isProperlyConfigured) { return; } try { logger.debug("Creating Cisco Spark client..."); CiscoSpark.spark = createSpark(); logger.debug("Retrieving user..."); Person person = CiscoSpark.spark.people().path("/me").get(); logger.info("Cisco Spark logged in as {}", person.getDisplayName()); } catch (SparkException se) { logger.warn("Failed to initialized Cisco Spark", se); } catch (Exception e) { logger.warn("Failed to initialized Cisco Spark!", e); } logger.info("Cisco Spark has been successfully started"); }
Source:
<code>public SegmentKeyTracker(SegmentConsistentHash segmentConsistentHash, Set<Integer> segments) { int numSegments = segmentConsistentHash.getNumSegments(); keysPerSegment = new AtomicReferenceArray<>(numSegments); if (log.isDebugEnabled()) log.debugf("Created SegmentKeyTracker with %d segments", numSegments); this.segmentConsistentHash = segmentConsistentHash; <START> Stream<Integer> segmentStream = segments == null ? <END> IntStream.range(0, segmentConsistentHash.getNumSegments()).boxed() : segments.stream(); segmentStream.forEach(i -> keysPerSegment.set(i, CollectionFactory.makeSet(ByteArrayEquivalence.INSTANCE))); }</code><technical_language>I thinking this IntStream instead. Stream<Integer> case segments is null box N values unbox N values in forEach consumer segments is null unbox N values in forEach consumer IntStream case segments is null 0 unboxing segment is null N unboxing in a call mapToInt In case same</technical_language>

Target:
public SegmentKeyTracker(SegmentConsistentHash segmentConsistentHash, Set<Integer> segments) { int numSegments = segmentConsistentHash.getNumSegments(); keysPerSegment = new AtomicReferenceArray<>(numSegments); if (log.isDebugEnabled()) log.debugf("Created SegmentKeyTracker with %d segments", numSegments); this.segmentConsistentHash = segmentConsistentHash; IntStream segmentStream = segments == null ? IntStream.range(0, segmentConsistentHash.getNumSegments()) : segments.stream().mapToInt(i -> i); segmentStream.forEach(i -> keysPerSegment.set(i, CollectionFactory.makeSet(ByteArrayEquivalence.INSTANCE))); }
Source:
<code>public Context startSavedSearchRequest(String searchName, String entity, String version) { return new DropwizardContext(name(API, "savedsearch", searchName, entity, version)); <START> } <END></code><technical_language>For of version, if version is null, this roll "operation.entity" means technically lose ability distinguish default version searches other versions. if version is null, string "default" instead? (for example "find.user.default" a peer "find.user.1.0.0" etc)</technical_language>

Target:
public Context startSavedSearchRequest(String searchName, String entity, String version) { return new DropwizardContext(name(API, "savedsearch", searchName, entity, formatVersion(version))); }
Source:
<code>private boolean isInProvidedNamespace(Node node) { for (String providedNamespace : providedNamespaces) { @Nullable String rhsQualifiedName = node.getQualifiedName(); <START> if ((null != rhsQualifiedName) && providedNamespace.startsWith(node.getQualifiedName())) { <END> return true; } } return false; }</code><technical_language>nit: reverse null check? rhsQualifedName != null</technical_language>

Target:
private boolean isInProvidedNamespace(Node node) { for (String providedNamespace : providedNamespaces) { @Nullable String rhsQualifiedName = node.getQualifiedName(); if ((rhsQualifiedName != null) && providedNamespace.startsWith(node.getQualifiedName())) { return true; } } return false; }
Source:
<code><START> private File createTempIoFile(VirtualFile parent, String prefix, String suffix) throws IOException { <END> File vfsDir = new File(ioRoot, toIoPath(parent.getPath().newPath(VFS_SERVICE_DIR))); vfsDir.mkdirs(); return File.createTempFile("modify", ".tmp", vfsDir); }</code><technical_language>parameters prefix suffix - sense remove them</technical_language>

Target:
private File createTempIoFile(VirtualFile parent, String prefix, String suffix) throws IOException { File vfsDir = new File(ioRoot, toIoPath(parent.getPath().newPath(VFS_SERVICE_DIR))); vfsDir.mkdirs(); return File.createTempFile(prefix, suffix, vfsDir); }
Source:
<code>private void shutdown(boolean fail) { <START> this.ttlLatch.countDown(); <END> if (fail) { transportConnection.forceClose(); } else { transportConnection.close(); } }</code><technical_language>If a thread need this. scheduled executor send pings client please. Cancel executor a future</technical_language>

Target:
private void shutdown(boolean fail) { if (fail) { transportConnection.forceClose(); } else { transportConnection.close(); } }
Source:
<code>private String getDefaultBrowserLanguage() { String defaultBrowserLanguage = null; switch (paymentLanguage) { case ENGLISH: <START> defaultBrowserLanguage = Locale.forLanguageTag("en-GB").toLanguageTag(); <END> break; case WELSH: defaultBrowserLanguage = Locale.forLanguageTag("cy-GB").toLanguageTag(); break; } return defaultBrowserLanguage; }</code><technical_language>""en-GB" is a constant, result of Locale.forLanguageTag("en-GB").toLanguageTag() (it "en-GB") "en-GB" here</technical_language>

Target:
private String getDefaultBrowserLanguage() { if (paymentLanguage == SupportedLanguage.ENGLISH) { return "en-GB"; } return paymentLanguage.toString(); }
Source:
<code>public void testOnStartCommandStartReplicationWaitsForSetReplicators() { PeriodicReplicationService service = new TestReplicationService(mMockContext); Intent intent = new Intent(mMockContext, TestReplicationService.class); intent.putExtra(PeriodicReplicationService.EXTRA_COMMAND, PeriodicReplicationService.COMMAND_START_REPLICATION); service.setReplicationPolicyManager(mMockReplicationPolicyManager); service.onCreate(); final CountDownLatch latch = new CountDownLatch(1); service.setOperationStartedListener(new PeriodicReplicationService .OperationStartedListener() { @Override public void operationStarted(int operationId) { if (operationId == PeriodicReplicationService.COMMAND_START_REPLICATION) { latch.countDown(); } } }); service.onStartCommand(intent, 0, 0); try { latch.await(1000, TimeUnit.MILLISECONDS); assertEquals("CountDownLatch should not be decremented", latch.getCount(), 1); service.setReplicators(mMockReplicators); <START> latch.await(); <END> } catch (InterruptedException e) { e.printStackTrace(); } }</code><technical_language>I this (and subsequent occurrences) like: assertTrue("The countdown reach zero", latch.await(1, TimeUnit.MINUTES)); if end a failure path waiting indefinitely relying a global test timeout abort a build</technical_language>

Target:
public void testOnStartCommandStartReplicationWaitsForSetReplicators() { PeriodicReplicationService service = new TestReplicationService(mMockContext); Intent intent = new Intent(mMockContext, TestReplicationService.class); intent.putExtra(PeriodicReplicationService.EXTRA_COMMAND, PeriodicReplicationService.COMMAND_START_REPLICATION); service.setReplicationPolicyManager(mMockReplicationPolicyManager); service.onCreate(); final CountDownLatch latch = new CountDownLatch(1); service.setOperationStartedListener(new PeriodicReplicationService .OperationStartedListener() { @Override public void operationStarted(int operationId) { assertEquals("Unexpected command received", PeriodicReplicationService.COMMAND_START_REPLICATION, operationId); latch.countDown(); } }); service.onStartCommand(intent, 0, 0); try { latch.await(1000, TimeUnit.MILLISECONDS); assertEquals("CountDownLatch should not be decremented", latch.getCount(), 1); service.setReplicators(mMockReplicators); assertTrue("The countdown should reach zero", latch.await(DEFAULT_WAIT_SECONDS, TimeUnit.SECONDS)); } catch (InterruptedException e) { e.printStackTrace(); } }
Source:
<code>private URIBuilder getFingerIdURI(String path) throws URISyntaxException { if (path == null) path = ""; URIBuilder builder = new URIBuilder(FINGERID_SOURCE); <START> builder.setPath("/csi-fingerid-" + FingerIdWebMethod.fingerIdVersion() + path); <END> return builder; }</code><technical_language>constant FINGERID_VERSION instead of calling a private method fingerIdVersion()</technical_language>

Target:
private URIBuilder getFingerIdURI(String path) throws URISyntaxException { if (path == null) path = ""; URIBuilder builder = new URIBuilder(FINGERID_SOURCE); builder.setPath("/csi-fingerid-" + FINGERID_VERSION + path); return builder; }
Source:
<code>public ParsedSql parse(String sql, StatementContext ctx) { <START> return PARSED_SQL_CACHE.get(sql, ctx); <END> }</code><technical_language>exception thrown ANTLR parser is unintuitive for Jdbi users. continue wrapping parse exception in a Jdbi exception parsing exceptions easier recognize</technical_language>

Target:
public ParsedSql parse(String sql, StatementContext ctx) { try { return PARSED_SQL_CACHE.get(sql, ctx); } catch (IllegalArgumentException e) { throw new UnableToCreateStatementException("Exception parsing for named parameter replacement", e, ctx); } }
Source:
<code>public List<HaxeModel> getExposedMembers() { HaxeClassBody body = UsefulPsiTreeUtil.getChild(haxeClass, HaxeClassBody.class); ArrayList<HaxeModel> out = new ArrayList<>(); if (body != null) { for (HaxeNamedComponent declaration : PsiTreeUtil.getChildrenOfAnyType(body, HaxeVarDeclaration.class, HaxeMethod.class)) { if (!(declaration instanceof PsiMember)) continue; if (declaration instanceof HaxeVarDeclaration) { HaxeVarDeclaration varDeclaration = (HaxeVarDeclaration)declaration; <START> if (varDeclaration.getContainingClass() == haxeClass && varDeclaration.isPublic() && varDeclaration.isStatic()) { <END> out.add(new HaxeFieldModel((HaxeVarDeclaration)declaration)); } } else { HaxeMethod method = (HaxeMethod)declaration; if (method.getContainingClass() == haxeClass && method.isStatic() && method.isPublic()) { out.add(new HaxeMethodModel(method)); } } } } return out; }</code><technical_language>do need varDeclaration.getContainingClass() == haxeclass here? fact varDeclaration a direct child of body imply that</technical_language>

Target:
public List<HaxeModel> getExposedMembers() { HaxeClassBody body = UsefulPsiTreeUtil.getChild(haxeClass, HaxeClassBody.class); ArrayList<HaxeModel> out = new ArrayList<>(); if (body != null) { for (HaxeNamedComponent declaration : PsiTreeUtil.getChildrenOfAnyType(body, HaxeVarDeclaration.class, HaxeMethod.class)) { if (!(declaration instanceof PsiMember)) continue; if (declaration instanceof HaxeVarDeclaration) { HaxeVarDeclaration varDeclaration = (HaxeVarDeclaration)declaration; if (varDeclaration.isPublic() && varDeclaration.isStatic()) { out.add(new HaxeFieldModel((HaxeVarDeclaration)declaration)); } } else { HaxeMethod method = (HaxeMethod)declaration; if (method.isStatic() && method.isPublic()) { out.add(new HaxeMethodModel(method)); } } } } return out; }
Source:
<code>public void validateSpaceNotEnough() throws Exception { AddVmCommand<VmManagementParametersBase> command = setupCanAddVmTests(0, 0); doReturn(ValidationResult.VALID).when(storageDomainValidator).isDomainWithinThresholds(); doReturn(new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_TARGET_STORAGE_DOMAIN)). <START> when(storageDomainValidator).hasSpaceForNewDisks(any(List.class)); <END> doReturn(storageDomainValidator).when(command).createStorageDomainValidator(any(StorageDomain.class)); assertFalse(command.validateSpaceRequirements()); verify(storageDomainValidator).hasSpaceForNewDisks(any(List.class)); verify(storageDomainValidator, never()).hasSpaceForClonedDisks(any(List.class)); }</code><technical_language>s/any(List.class)/anyList/</technical_language>

Target:
public void validateSpaceNotEnough() throws Exception { AddVmCommand<VmManagementParametersBase> command = setupCanAddVmTests(0, 0); doReturn(ValidationResult.VALID).when(storageDomainValidator).isDomainWithinThresholds(); doReturn(new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_TARGET_STORAGE_DOMAIN)). when(storageDomainValidator).hasSpaceForNewDisks(anyList()); doReturn(storageDomainValidator).when(command).createStorageDomainValidator(any(StorageDomain.class)); assertFalse(command.validateSpaceRequirements()); verify(storageDomainValidator).hasSpaceForNewDisks(anyList()); verify(storageDomainValidator, never()).hasSpaceForClonedDisks(anyList()); }
Source:
<code>protected boolean canDoAction() { if (!super.canDoAction()) return false; if (getGeoRepSession().getStatus() == GeoRepSessionStatus.PASSIVE) { <START> addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GEOREP_SESSION_ALREADY_PAUSED); <END> return false; } return true; }</code><technical_language>return failCanDoAction</technical_language>

Target:
protected boolean canDoAction() { if (!super.canDoAction()) { return false; } if (getGeoRepSession().getStatus() == GeoRepSessionStatus.PASSIVE) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GEOREP_SESSION_ALREADY_PAUSED); } return true; }
Source:
<code>public void run() { Multimap<String, Serializable> map = ArrayListMultimap.create(possibleKeys, possibleValues); while (!Thread.interrupted()){ int size = 0; boolean need_to_flash = false; Log current = null; while(size <= flushSize){ try { current = buffer.take(); if (isFlushLog(current)){ need_to_flash = true; break; }else{ map.put(current.getPath(), current.getValue()); size++; } } catch (InterruptedException e) { <START> e.printStackTrace(); <END> } } writeToFileStorage(map, need_to_flash); map.clear(); } }</code><technical_language>swallow interrupts! <LINK_0></technical_language>

Target:
public void run() { ArrayList<Log> temp = new ArrayList<Log>(flushSize+flushSize/2); boolean shutdown = false; while (!shutdown){ Multimap<String, Serializable> map = LinkedHashMultimap.create(); int size = 0; boolean need_to_flash = false; try { while (size < flushSize){ temp.add(buffer.take()); size++; size += buffer.drainTo(temp); need_to_flash = drainToMap(temp, map); if (need_to_flash){ break; } } } catch (InterruptedException e) { shutdown = true; }finally { writeToFileStorage(map, need_to_flash); } } }
Source:
<code>public void onAuthCreated(BoxAuthentication.BoxAuthenticationInfo info) { mFolderApi = new BoxApiFolder(mSession); mFileApi = new BoxApiFile(mSession); <START> mMetadataApi = new BoxApiMetadata(mSession); <END> loadRootFolder(); }</code><technical_language>Remove</technical_language>

Target:
public void onAuthCreated(BoxAuthentication.BoxAuthenticationInfo info) { mFolderApi = new BoxApiFolder(mSession); mFileApi = new BoxApiFile(mSession); loadRootFolder(); }