auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void handlePlayButton(View view) { <START> if (getCurrentFragment() instanceof ScriptFragment <END> && ((ScriptFragment) getCurrentFragment()).isCurrentlyHighlighted()) { ((ScriptFragment) getCurrentFragment()).cancelHighlighting(); } boolean isDragAndDropActiveInFragment = getCurrentFragment() instanceof DragAndDropInterface && ((DragAndDropInterface) getCurrentFragment()).isCurrentlyMoving(); if (isDragAndDropActiveInFragment) { ((DragAndDropInterface) getCurrentFragment()).highlightMovingItem(); return; } while (getSupportFragmentManager().getBackStackEntryCount() > 0) { getSupportFragmentManager().popBackStack(); } ProjectManager projectManager = ProjectManager.getInstance(); Scene currentScene = ProjectManager.getInstance().getCurrentlyEditedScene(); Scene defaultScene = projectManager.getCurrentProject().getDefaultScene(); if (currentScene.getName().equals(defaultScene.getName())) { projectManager.setCurrentlyPlayingScene(defaultScene); projectManager.setStartScene(defaultScene); startStageActivity(); } else { new PlaySceneDialog.Builder(this) .setPositiveButton(R.string.play, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { startStageActivity(); } }) .create() .show(); } }</code><technical_language>other suggestion I unify here. i.e. move cases if block checks if user is in ScriptFragment there. this easier read block. alternatively introduce a boolean variable for condition getCurrentFragment() instanceof ScriptFragment && ((ScriptFragment) getCurrentFragment()).isCurrentlyHighlighted() conditions stay separate, similar. do prefer :wink: if (isScriptFragment) { if (areBricksHighlighted) { ... } if (dragAndDropActive) { ... } } if (areBricksHighlightedInFragment) { ... } if (dragAndDropActiveInFragment) { ... }</technical_language>

Target:
public void handlePlayButton(View view) { Fragment currentFragment = getCurrentFragment(); if (currentFragment instanceof ScriptFragment) { if (((ScriptFragment) currentFragment).isCurrentlyHighlighted()) { ((ScriptFragment) currentFragment).cancelHighlighting(); } if (((DragAndDropInterface) currentFragment).isCurrentlyMoving()) { ((DragAndDropInterface) getCurrentFragment()).highlightMovingItem(); return; } } while (getSupportFragmentManager().getBackStackEntryCount() > 0) { getSupportFragmentManager().popBackStack(); } ProjectManager projectManager = ProjectManager.getInstance(); Scene currentScene = ProjectManager.getInstance().getCurrentlyEditedScene(); Scene defaultScene = projectManager.getCurrentProject().getDefaultScene(); if (currentScene.getName().equals(defaultScene.getName())) { projectManager.setCurrentlyPlayingScene(defaultScene); projectManager.setStartScene(defaultScene); startStageActivity(); } else { new PlaySceneDialog.Builder(this) .setPositiveButton(R.string.play, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { startStageActivity(); } }) .create() .show(); } }
Source:
<code>public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.MODULO, this::checkPrintfStyle); <START> context.registerSyntaxNodeConsumer(Tree.Kind.CALL_EXPR, ctx -> { <END> CallExpression callExpression = (CallExpression) ctx.syntaxNode(); Symbol symbol = callExpression.calleeSymbol(); if (symbol == null || symbol.fullyQualifiedName() == null) { return; } if (LOGGER_METHODS.contains(symbol.fullyQualifiedName())) { checkLoggerLog(ctx, callExpression); } else { this.checkStrFormatStyle(ctx); } }); context.registerSyntaxNodeConsumer(Tree.Kind.STRING_LITERAL, StringFormatCorrectnessCheck::checkFStringLiteral); }</code><technical_language>_Minor_: I find weird a lambda other cases delegate actual method</technical_language>

Target:
public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.MODULO, this::checkPrintfStyle); context.registerSyntaxNodeConsumer(Tree.Kind.CALL_EXPR, this::checkCallExpression); context.registerSyntaxNodeConsumer(Tree.Kind.STRING_LITERAL, StringFormatCorrectnessCheck::checkFStringLiteral); }
Source:
<code>private void updateQueuesLength(long ts) { try { <START> Integer fDriverQueueLength = fSs.getQuarkRelativeAndAdd(fDiskQuark, Attributes.DRIVER_QUEUE_LENGTH); <END> fSs.modifyAttribute(ts, TmfStateValue.newValueLong(getDriverQueueSize()), fDriverQueueLength); Integer fWaitinQueueLength = fSs.getQuarkRelativeAndAdd(fDiskQuark, Attributes.WAITING_QUEUE_LENGTH); fSs.modifyAttribute(ts, TmfStateValue.newValueLong(getWaitingQueueSize()), fWaitinQueueLength); } catch (StateValueTypeException | AttributeNotFoundException e) { Activator.getDefault().logError("Error updating queues lengths", e); } }</code><technical_language>int</technical_language>

Target:
private void updateQueuesLength(long ts) { try { int fDriverQueueLength = fSs.getQuarkRelativeAndAdd(fDiskQuark, Attributes.DRIVER_QUEUE_LENGTH); fSs.modifyAttribute(ts, TmfStateValue.newValueInt(getDriverQueueSize()), fDriverQueueLength); int fWaitinQueueLength = fSs.getQuarkRelativeAndAdd(fDiskQuark, Attributes.WAITING_QUEUE_LENGTH); fSs.modifyAttribute(ts, TmfStateValue.newValueInt(getWaitingQueueSize()), fWaitinQueueLength); } catch (StateValueTypeException | AttributeNotFoundException e) { Activator.getDefault().logError("Error updating queues lengths", e); } }
Source:
<code>protected Device findActiveDevice(final String deviceIdentification) throws FunctionalException { Device device; try { device = this.deviceDomainService.searchActiveDevice(deviceIdentification); } catch (final UnregisteredDeviceException e) { throw new FunctionalException(FunctionalExceptionType.UNREGISTERED_DEVICE, ComponentType.DOMAIN_TARIFF_SWITCHING, e); } catch (final InactiveDeviceException e) { <START> throw new FunctionalException(FunctionalExceptionType.INACTIVE_DEVICE, ComponentType.DOMAIN_CORE, e); <END> } catch (final UnknownEntityException e) { throw new FunctionalException(FunctionalExceptionType.UNKNOWN_DEVICE, ComponentType.DOMAIN_TARIFF_SWITCHING, e); } return device; }</code><technical_language>Component type for inactive device exception DOMAIN_TARIFF_SWITCHING here</technical_language>

Target:
protected Device findActiveDevice(final String deviceIdentification) throws FunctionalException { Device device; try { device = this.deviceDomainService.searchActiveDevice(deviceIdentification); } catch (final UnregisteredDeviceException e) { throw new FunctionalException(FunctionalExceptionType.UNREGISTERED_DEVICE, ComponentType.DOMAIN_TARIFF_SWITCHING, e); } catch (final InactiveDeviceException e) { throw new FunctionalException(FunctionalExceptionType.INACTIVE_DEVICE, ComponentType.DOMAIN_TARIFF_SWITCHING, e); } catch (final UnknownEntityException e) { throw new FunctionalException(FunctionalExceptionType.UNKNOWN_DEVICE, ComponentType.DOMAIN_TARIFF_SWITCHING, e); } return device; }
Source:
<code>public void onLiveInstanceChange(List<LiveInstance> liveInstances, NotificationContext changeContext) { logger.info("Live instance change triggered with: " + liveInstances); Set<String> liveInstancesSet = new HashSet<>(); for (LiveInstance liveInstance : liveInstances) { liveInstancesSet.add(liveInstance.getInstanceName()); instanceNameToDataNodeIdMap.get(liveInstance.getInstanceName()).setState(HardwareState.AVAILABLE); } <START> Set<String> downInstancesSet = Sets.difference(allInstances, liveInstancesSet); <END> for (String instanceName : downInstancesSet) { instanceNameToDataNodeIdMap.get(instanceName).setState(HardwareState.UNAVAILABLE); } if (!liveInstanceChangeTriggered) { liveInstanceChangeTriggered = true; initialized.countDown(); } helixClusterManagerMetrics.liveInstanceChangeTriggerCount.inc(); }</code><technical_language>Is necessary introduce dependency Sets</technical_language>

Target:
public void onLiveInstanceChange(List<LiveInstance> liveInstances, NotificationContext changeContext) { synchronized (notificationLock) { logger.trace("Live instance change triggered with: {}", liveInstances); Set<String> liveInstancesSet = new HashSet<>(); for (LiveInstance liveInstance : liveInstances) { liveInstancesSet.add(liveInstance.getInstanceName()); } for (String instanceName : allInstances) { if (liveInstancesSet.contains(instanceName)) { instanceNameToAmbryDataNode.get(instanceName).setState(HardwareState.AVAILABLE); } else { instanceNameToAmbryDataNode.get(instanceName).setState(HardwareState.UNAVAILABLE); } } if (!liveInstanceChangeTriggered) { liveInstanceChangeTriggered = true; initialized.countDown(); } helixClusterManagerMetrics.liveInstanceChangeTriggerCount.inc(); } }
Source:
<code>protected TupleBatch fetchNextReady() throws DbException { final Operator child = getChild(); TupleBatch tb = child.nextReady(); while (tb != null) { for (int row = 0; row < tb.numTuples(); ++row) { IntIterator iter = groupStates.getIndices(tb, gfields, row).intIterator(); int index; if (!iter.hasNext()) { groupStates.addTuple(tb, gfields, row, true); int offset = gfields.length; for (Aggregator agg : internalAggs) { agg.initState(groupStates.getData(), offset); offset += agg.getStateSize(); } index = groupStates.getData().numTuples() - 1; } else { index = iter.next(); } int offset = gfields.length; for (Aggregator agg : internalAggs) { agg.addRow(tb, row, groupStates.getData(), index, offset); offset += agg.getStateSize(); } } tb = child.nextReady(); } if (child.eos()) { <START> if (!COUNTALL_ON_EMPTY <END> && gfields.length == 0 && groupStates.numTuples() == 0 && internalAggs.size() == 1 && internalAggs.get(0) instanceof PrimitiveAggregator && ((PrimitiveAggregator) (internalAggs.get(0))).aggOp == AggregationOp.COUNT) { COUNTALL_ON_EMPTY = true; resultBuffer.putLong(0, 0); } generateResult(); return resultBuffer.popAny(); } return null; }</code><technical_language>more broadly useful a boolean getter Operator indicating operator returned results (i.e. nextReady() != null)? If reused elsewhere, ad-hoc flag</technical_language>

Target:
protected TupleBatch fetchNextReady() throws DbException { final Operator child = getChild(); TupleBatch tb = child.nextReady(); while (tb != null) { for (int row = 0; row < tb.numTuples(); ++row) { IntIterator iter = groupStates.getIndices(tb, gfields, row).intIterator(); int index; if (!iter.hasNext()) { groupStates.addTuple(tb, gfields, row, true); int offset = gfields.length; for (Aggregator agg : internalAggs) { agg.initState(groupStates.getData(), offset); offset += agg.getStateSize(); } index = groupStates.getData().numTuples() - 1; } else { index = iter.next(); } int offset = gfields.length; for (Aggregator agg : internalAggs) { agg.addRow(tb, row, groupStates.getData(), index, offset); offset += agg.getStateSize(); } } tb = child.nextReady(); } if (child.eos()) { if (getNumOutputTuples() == 0 && groupStates.numTuples() == 0 && isCountAllOnlyAggregate()) { resultBuffer.putLong(0, 0); } generateResult(); return resultBuffer.popAny(); } return null; }
Source:
<code>public void testGetAndAppendMappingExists() { ServerStore store = newStore(); populateStore(store); Chain chain = store.getAndAppend(1, getPayload(22)); for (Element element : chain) { assertThat(readPayLoad(element.getPayload()), is(Long.valueOf(1))); } chain = store.get(1); Iterator<Element> linkIterator = chain.iterator(); Element element1 = linkIterator.next(); assertThat(readPayLoad(element1.getPayload()), is(Long.valueOf(1))); Element element2 = linkIterator.next(); assertThat(readPayLoad(element2.getPayload()), is(Long.valueOf(22))); <START> <END> }</code><technical_language>assert linkIterator.hasNext returns correctly here</technical_language>

Target:
public void testGetAndAppendMappingExists() { ServerStore store = newStore(); populateStore(store); Chain chain = store.getAndAppend(1, createPayload(22)); for (Element element : chain) { assertThat(readPayLoad(element.getPayload()), is(Long.valueOf(1))); } chain = store.get(1); assertChainAndReverseChainOnlyHave(chain, 1, 22); }
Source:
<code>public boolean match(ChangeData object) throws OrmException { Change c = object.change(dbProvider); <START> if (c == null) { return false; } return c.isMergeable(); <END> }</code><technical_language>return c != null && c.isMergeable();</technical_language>

Target:
public boolean match(ChangeData object) throws OrmException { Change c = object.change(dbProvider); return c != null && c.isMergeable(); }
Source:
<code>public void testValidateDataEnabledWithDataMismatch() throws IOException { byte[] inputData = new byte[] {1, 2, 3}; byte[] corruptedData = new byte[] {1, 3, 3}; FSDataInputStream dataTierInputStream = new TestFSDataInputStream(inputData); FileInStream fileInStream = new TestFileInStream(corruptedData); AlluxioCachingHdfsFileInputStream fileInputStream = new AlluxioCachingHdfsFileInputStream(fileInStream, Optional.of(dataTierInputStream), true); <START> byte[] buf = new byte[3]; <END> try { fileInputStream.readFully(0, buf, 0, buf.length); fail("Data validation didn't work for mismatched data."); } catch (VerifyException ex) { assertEquals(ex.getMessage(), "corrupted buffer at position 1"); } }</code><technical_language>spell out buffer</technical_language>

Target:
public void testValidateDataEnabledWithDataMismatch() throws IOException { byte[] inputData = new byte[] {1, 2, 3}; byte[] corruptedData = new byte[] {1, 3, 3}; FSDataInputStream dataTierInputStream = new TestFSDataInputStream(inputData); FileInStream fileInStream = new TestFileInStream(corruptedData); AlluxioCachingHdfsFileInputStream fileInputStream = new AlluxioCachingHdfsFileInputStream(fileInStream, Optional.of(dataTierInputStream), true); byte[] buffer = new byte[3]; try { fileInputStream.readFully(0, buffer, 0, buffer.length); fail("Data validation didn't work for mismatched data."); } catch (VerifyException ex) { assertEquals(ex.getMessage(), "corrupted buffer at position 1"); } }
Source:
<code>public boolean hasDerivedMeasure() { <START> List<Measure> measures = getMeasures(); <END> return measures.stream().anyMatch(measure -> measure.isPop() || measure.hasComputeRatio()); }</code><technical_language>need for extra variable</technical_language>

Target:
public boolean hasDerivedMeasure() { return getMeasures().stream().anyMatch(measure -> measure.isPop() || measure.hasComputeRatio()); }
Source:
<code>public String render(T size) { if (isUnavailable(size)) { return CONSTANTS.unAvailablePropertyLabel(); } double sizeInGB = getSizeInGigabytes(size); <START> if (format == Format.DEFAULT) { <END> return (sizeInGB >= 1) ? Double.valueOf(sizeInGB).longValue() + " GB" : "< 1 GB"; } else { return format(sizeInGB); } }</code><technical_language>If gonna more rendering in future convert a switch block, more readable</technical_language>

Target:
public String render(T size) { if (isUnavailable(size)) { return CONSTANTS.unAvailablePropertyLabel(); } String res; switch (format) { case LEGACY: res = renderLegacySize(size.longValue()); break; case HUMAN_READABLE: res = renderHumanReadableSize(size.longValue()); break; default: throw new RuntimeException("Format '" + format + "' is not supported!"); } return res; }
Source:
<code>protected void onPreExecute() { super.onPreExecute(); <START> if (context == null) { <END> return; } String title = context.getString(R.string.please_wait); String message = context.getString(R.string.status_downloading); progressDialog = ProgressDialog.show(context, title, message); }</code><technical_language>This is a member of class... This happened..</technical_language>

Target:
protected void onPreExecute() { super.onPreExecute(); if (context == null) { return; } String title = context.getString(R.string.please_wait); String progressMessage = context.getString(R.string.status_downloading); progressDialog = ProgressDialog.show(context, title, progressMessage); }
Source:
<code><START> public void queryFile2FullHistory() throws CoreException { <END> final List<RevCommit> expectedHistory = Arrays.asList(masterCommit2, masterCommit3); for (RevCommit ref : commits) { testRepository.checkoutBranch(ref.getName()); final IFileHistory history = historyProvider.getFileHistoryFor( iFile2, IFileHistoryProvider.NONE, new NullProgressMonitor()); assertNotNull(history); final IFileRevision[] revisions = history.getFileRevisions(); assertEquals(2, revisions.length); final List<RevCommit> commitList = new ArrayList<RevCommit>( expectedHistory); assertMatchingRevisions(Arrays.asList(revisions), commitList); } }</code><technical_language>I factor out common code this test shares previous</technical_language>

Target:
public void queryFile2FullHistory() throws CoreException { final List<RevCommit> expectedHistory = Arrays.asList(masterCommit2, masterCommit3); assertFullHistoryMatches(iFile2, expectedHistory); }
Source:
<code><START> protected static String getMessageId(String rawMessageHref) { <END> return rawMessageHref.substring(rawMessageHref.lastIndexOf('/')+1); }</code><technical_language>injectable "hrefToMessageId" function</technical_language>

Target:
private static String getMessageId(String rawMessageHref) { return rawMessageHref.substring(rawMessageHref.lastIndexOf('/')+1); }
Source:
<code>public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; CommandEntity other = (CommandEntity) obj; return ObjectUtils.objectsEqual(commandId, other.commandId) <START> && commandType == other.commandType <END> && ObjectUtils.objectsEqual(getGuid(rootCommandId), getGuid(other.rootCommandId)); }</code><technical_language>add parentCommandId hashCode() relies</technical_language>

Target:
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; CommandEntity other = (CommandEntity) obj; return ObjectUtils.objectsEqual(commandId, other.commandId) && commandType == other.commandType && ObjectUtils.objectsEqual(getGuid(parentCommandId), getGuid(other.parentCommandId)) && ObjectUtils.objectsEqual(getGuid(rootCommandId), getGuid(other.rootCommandId)); }
Source:
<code>public boolean equals(Object o) { if(!(o instanceof MethodKey)) return false; MethodKey m = (MethodKey) o; if(m.k != k) return false; if(m.nArgs != nArgs) return false; <START> if(!m.method.equals(method)) return false; <END> return true; }</code><technical_language>return m.method.equals(method);, instead of this line next</technical_language>

Target:
public boolean equals(Object o) { if(!(o instanceof MethodKey)) return false; MethodKey m = (MethodKey) o; if(m.k != k) return false; if(m.nArgs != nArgs) return false; return m.method.equals(method)); }
Source:
<code>public void testResetTruncateZero() throws Exception { RaftLog log = createLog(); RaftLogWriter writer = log.writer(); RaftLogReader reader = log.openReader(1, RaftLogReader.Mode.ALL); assertEquals(0, writer.getLastIndex()); <START> writer.append(ENTRY); <END> writer.append(ENTRY); writer.reset(1); assertEquals(0, writer.getLastIndex()); writer.append(ENTRY); assertEquals(1, reader.next().entry().term()); writer.reset(1); assertEquals(0, writer.getLastIndex()); writer.append(ENTRY); assertEquals(1, writer.getLastIndex()); assertEquals(1, writer.getLastEntry().index()); assertTrue(reader.hasNext()); assertEquals(1, reader.next().index()); writer.truncate(0); assertEquals(0, writer.getLastIndex()); assertNull(writer.getLastEntry()); writer.append(ENTRY); assertEquals(1, writer.getLastIndex()); assertEquals(1, writer.getLastEntry().index()); assertTrue(reader.hasNext()); assertEquals(1, reader.next().index()); }</code><technical_language>matter longer increment parameter</technical_language>

Target:
public void testResetTruncateZero() throws Exception { try (RaftLog log = createLog()) { RaftLogWriter writer = log.writer(); RaftLogReader reader = log.openReader(1, RaftLogReader.Mode.ALL); assertEquals(0, writer.getLastIndex()); writer.append(ENTRY); writer.append(ENTRY); writer.reset(1); assertEquals(0, writer.getLastIndex()); writer.append(ENTRY); assertEquals(1, reader.next().entry().term()); writer.reset(1); assertEquals(0, writer.getLastIndex()); writer.append(ENTRY); assertEquals(1, writer.getLastIndex()); assertEquals(1, writer.getLastEntry().index()); assertTrue(reader.hasNext()); assertEquals(1, reader.next().index()); writer.truncate(0); assertEquals(0, writer.getLastIndex()); assertNull(writer.getLastEntry()); writer.append(ENTRY); assertEquals(1, writer.getLastIndex()); assertEquals(1, writer.getLastEntry().index()); assertTrue(reader.hasNext()); assertEquals(1, reader.next().index()); } }
Source:
<code>ColumnWriterBase( ColumnDescriptor path, PageWriter pageWriter, BloomFilterWriter bloomFilterWriter, ParquetProperties props ) { this(path, pageWriter, props); if (path.getPath().length != 1 || bloomFilterWriter == null) { return; } String column = path.getPath()[0]; this.bloomFilterWriter = bloomFilterWriter; Set<String> bloomFilterColumns = props.getBloomFilterColumns(); if (!bloomFilterColumns.contains(column)) { return; } int maxBloomFilterSize = props.getMaxBloomFilterBytes(); Map<String, Long> bloomFilterColumnExpectedNDVs = props.getBloomFilterColumnExpectedNDVs(); if (bloomFilterColumnExpectedNDVs.size() > 0) { if (bloomFilterColumnExpectedNDVs.keySet().contains(column)) { int optimalNumOfBits = BlockSplitBloomFilter.optimalNumOfBits(bloomFilterColumnExpectedNDVs.get(column).intValue(), BlockSplitBloomFilter.DEFAULT_FPP); <START> this.bloomFilter = new BlockSplitBloomFilter(optimalNumOfBits / 8, maxBloomFilterSize); <END> } } else { this.bloomFilter = new BlockSplitBloomFilter(maxBloomFilterSize); } }</code><technical_language>Is fine bytes optimal if optimalNumOfBits % 8 != 0</technical_language>

Target:
ColumnWriterBase( ColumnDescriptor path, PageWriter pageWriter, BloomFilterWriter bloomFilterWriter, ParquetProperties props ) { this.path = path; this.pageWriter = pageWriter; resetStatistics(); this.repetitionLevelColumn = createRLWriter(props, path); this.definitionLevelColumn = createDLWriter(props, path); this.dataColumn = props.newValuesWriter(path); this.bloomFilterWriter = bloomFilterWriter; Set<String> bloomFilterColumns = props.getBloomFilterColumns(); String column = String.join(".", path.getPath()); if (!bloomFilterColumns.contains(column)) { this.bloomFilter = null; return; } int maxBloomFilterSize = props.getMaxBloomFilterBytes(); Map<String, Long> bloomFilterColumnExpectedNDVs = props.getBloomFilterColumnExpectedNDVs(); if (bloomFilterColumnExpectedNDVs.size() > 0) { if (bloomFilterColumnExpectedNDVs.containsKey(column)) { int optimalNumOfBits = BlockSplitBloomFilter.optimalNumOfBits( bloomFilterColumnExpectedNDVs.get(column).intValue(), BlockSplitBloomFilter.DEFAULT_FPP); this.bloomFilter = new BlockSplitBloomFilter(optimalNumOfBits / 8, maxBloomFilterSize); } else { this.bloomFilter = null; } } else { this.bloomFilter = new BlockSplitBloomFilter(maxBloomFilterSize); } }
Source:
<code>public void initialize() { <START> directory = System.getProperty("user.dir").toString() + "\\src\\test\\resources\\loadTest"; <END> array = new ArrayList<String>(); }</code><technical_language>This is window-specific stuff. A idea File.separator instead of \'s</technical_language>

Target:
public void initialize() { directory = System.getProperty("user.dir").toString() + File.separator + "src" + File.separator + "test" + File.separator + "resources" + File.separator + "loadTest"; array = new ArrayList<String>(); }
Source:
<code>private void configureGerrit(Repository repository) { StoredConfig config = repository.getConfig(); RemoteConfig remoteConfig; try { remoteConfig = GerritUtil.findRemoteConfig(config, remoteName); if (remoteConfig == null) { return; } GerritUtil.configurePushURI(remoteConfig, new URIish(uri)); GerritUtil.configurePushRefSpec(remoteConfig, Constants.MASTER); GerritUtil.configureFetchNotes(remoteConfig); GerritUtil.setCreateChangeId(config); remoteConfig.update(config); config.save(); <START> } catch (Exception e) { <END> Activator.logError(e.getMessage(), e); } }</code><technical_language>method declare "throws URISyntaxException, IOException" extra try/catch/log removed</technical_language>

Target:
private void configureGerrit(Repository repository) throws URISyntaxException, IOException { StoredConfig config = repository.getConfig(); RemoteConfig remoteConfig; remoteConfig = GerritUtil.findRemoteConfig(config, remoteName); if (remoteConfig == null) { return; } GerritUtil.configurePushURI(remoteConfig, new URIish(uri)); GerritUtil.configurePushRefSpec(remoteConfig, Constants.MASTER); GerritUtil.configureFetchNotes(remoteConfig); GerritUtil.setCreateChangeId(config); remoteConfig.update(config); config.save(); }
Source:
<code><START> public void enableDiversity() throws KuraException { <END> synchronized (this.atLock) { CommConnection commAtConnection = null; try { String port = getUnusedAtPort(); logger.info("sendCommand enable CELL Diversity antenna :: command to port {}", TelitLe910v2AtCommands.ENABLE_CELL_DIV.getCommand(), port); commAtConnection = openSerialPort(port); if (!isAtReachable(commAtConnection)) { throw new KuraException(KuraErrorCode.NOT_CONNECTED, MODEM_NOT_AVAILABLE_FOR_AT_CMDS_MSG); } byte[] reply = commAtConnection.sendCommand( TelitLe910v2AtCommands.ENABLE_CELL_DIV.getCommand().getBytes(StandardCharsets.US_ASCII), 1000, 100); if (reply != null) { String resp = new String(reply); if (resp.contains("OK")) { logger.info("CELL DIV successfully enabled"); this.setDiversityEnabled(true); } else logger.info("Command returns : {}", resp); } else { logger.error("No answer"); } } catch (IOException e) { throw new KuraException(KuraErrorCode.CONNECTION_FAILED, e); } finally { closeSerialPort(commAtConnection); } } }</code><technical_language>enable disable diversity code pretty minor things. Is optimise code</technical_language>

Target:
public void enableDiversity() throws KuraException { programDiversity(true); }
Source:
<code>public static SampleAdditionalInfo to(SampleAdditionalInfoDto from) { SampleAdditionalInfo to = new SampleAdditionalInfoImpl(); to.setPassageNumber(from.getPassageNumber()); to.setTimesReceived(from.getTimesReceived()); to.setTubeNumber(from.getTubeNumber()); to.setVolume(from.getVolume()); to.setConcentration(from.getConcentration()); to.setTubeNumber(from.getTubeNumber()); <START> return to; <END> }</code><technical_language>is set in this method, lines up</technical_language>

Target:
public static SampleAdditionalInfo to(SampleAdditionalInfoDto from) { SampleAdditionalInfo to = new SampleAdditionalInfoImpl(); to.setPassageNumber(from.getPassageNumber()); to.setTimesReceived(from.getTimesReceived()); to.setTubeNumber(from.getTubeNumber()); to.setVolume(from.getVolume()); to.setConcentration(from.getConcentration()); return to; }
Source:
<code>public void compute() { List<Element> eventEls = getDocument().getRootElement().getChildren("event", PREMIS_V2_NS); for (Element eventEl: eventEls) { List<String> eventTypes = getEventTypes(eventEl); if (eventTypes.isEmpty()) { log.error("No type present on event for record {}", pid); continue; } if (eventTypes.contains(VIRUS_CHECK_TYPE)) { addVirusCheckEvent(eventEl); } else if (eventTypes.contains(Premis2Constants.INGESTION_TYPE)) { addIngestionEvent(eventEl); <START> } else if (eventTypes.contains(Premis2Constants.ACCESSION_TYPE)) { <END> transformAccessionEvent(eventEl); } else if (eventTypes.contains(Premis2Constants.VALIDATION_TYPE)) { addValidationEvent(eventEl); } else { log.error("Unknown event types for {}: {}", pid, eventTypes); } } }</code><technical_language>This defines migrating from, migrating boxc3 data currently Normalization event, need leave NORMALIZATION in this case. need change event type is stored in boxc5</technical_language>

Target:
public void compute() { List<Element> eventEls = getDocument().getRootElement().getChildren("event", PREMIS_V2_NS); for (Element eventEl: eventEls) { List<String> eventTypes = getEventTypes(eventEl); if (eventTypes.isEmpty()) { log.error("No type present on event for record {}", pid); continue; } if (eventTypes.contains(VIRUS_CHECK_TYPE)) { addVirusCheckEvent(eventEl); } else if (eventTypes.contains(Premis2Constants.INGESTION_TYPE)) { addIngestionEvent(eventEl); } else if (eventTypes.contains(Premis2Constants.NORMALIZATION_TYPE)) { transformNormalizationEvent(eventEl); } else if (eventTypes.contains(Premis2Constants.VALIDATION_TYPE)) { addValidationEvent(eventEl); } else { log.error("Unknown event types for {}: {}", pid, eventTypes); } } }
Source:
<code>public Response saveAuxiliaryFileWithVersion(@PathParam("fileId") Long fileId, @PathParam("formatTag") String formatTag, @PathParam("formatVersion") String formatVersion, @FormDataParam("origin") String origin, @FormDataParam("isPublic") boolean isPublic, @FormDataParam("file") InputStream fileInputStream ) { AuthenticatedUser authenticatedUser; try { authenticatedUser = findAuthenticatedUserOrDie(); } catch (WrappedResponse ex) { return error(FORBIDDEN, "Authorized users only."); } DataFile dataFile = dataFileService.find(fileId); if (dataFile == null) { return error(BAD_REQUEST, "File not found based on id " + fileId + "."); } if (!permissionService.userOn(authenticatedUser, dataFile.getOwner()).has(Permission.EditDataset)) { return error(FORBIDDEN, "User not authorized to edit the dataset."); } if (!dataFile.isTabularData()) { return error(BAD_REQUEST, "Not a tabular DataFile (db id=" + fileId + ")"); } AuxiliaryFile saved = auxiliaryFileService.processAuxiliaryFile(fileInputStream, dataFile, formatTag, formatVersion, origin, isPublic); if (saved!=null) { <START> return created(saved.getId().toString(),JsonPrinter.json(saved)); <END> } else { return error(BAD_REQUEST, "Error saving Auxiliary file."); } }</code><technical_language>@landreev I talked this out in Slack decided switching created ok in 471dd25 (which is this pull request started</technical_language>

Target:
public Response saveAuxiliaryFileWithVersion(@PathParam("fileId") Long fileId, @PathParam("formatTag") String formatTag, @PathParam("formatVersion") String formatVersion, @FormDataParam("origin") String origin, @FormDataParam("isPublic") boolean isPublic, @FormDataParam("file") InputStream fileInputStream ) { AuthenticatedUser authenticatedUser; try { authenticatedUser = findAuthenticatedUserOrDie(); } catch (WrappedResponse ex) { return error(FORBIDDEN, "Authorized users only."); } DataFile dataFile = dataFileService.find(fileId); if (dataFile == null) { return error(BAD_REQUEST, "File not found based on id " + fileId + "."); } if (!permissionService.userOn(authenticatedUser, dataFile.getOwner()).has(Permission.EditDataset)) { return error(FORBIDDEN, "User not authorized to edit the dataset."); } if (!dataFile.isTabularData()) { return error(BAD_REQUEST, "Not a tabular DataFile (db id=" + fileId + ")"); } AuxiliaryFile saved = auxiliaryFileService.processAuxiliaryFile(fileInputStream, dataFile, formatTag, formatVersion, origin, isPublic); if (saved!=null) { return ok(json(saved)); } else { return error(BAD_REQUEST, "Error saving Auxiliary file."); } }
Source:
<code>public void setup() { <START> this.literalExpression = spy(new LiteralExpression()); <END> }</code><technical_language>Do need spy in this case</technical_language>

Target:
public void setup() { this.literalExpression = new LiteralExpression(); }
Source:
<code>public void testGetData() { doAnswer(new Answer() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { ((DataSetReadyCallback) invocation.getArguments()[1]).callback(dataSet); return null; } }).when(dataSetQueryHelper).lookupDataSet(anyInt(), any(DataSetReadyCallback.class)); dataSetQueryHelper.setCurrentTableSettings(filterSettings); when(errorHandlerBuilder.get()).thenReturn(errorHandler); when(dataSetQueryHelper.getCurrentTableSettings()).thenReturn(filterSettings); when(presenter.getDataSetQueryHelper()).thenReturn(dataSetQueryHelper); <START> presenter.getData(new Range(0, <END> 5)); verify(dataSetQueryHelper).lookupDataSet(anyInt(), any(DataSetReadyCallback.class)); }</code><technical_language>need break line</technical_language>

Target:
public void testGetData() { doAnswer(invocation -> { ((DataSetReadyCallback) invocation.getArguments()[1]).callback(dataSet); return null; }).when(dataSetQueryHelper).lookupDataSet(anyInt(), any(DataSetReadyCallback.class)); dataSetQueryHelper.setCurrentTableSettings(filterSettings); when(errorHandlerBuilder.get()).thenReturn(errorHandler); when(dataSetQueryHelper.getCurrentTableSettings()).thenReturn(filterSettings); when(presenter.getDataSetQueryHelper()).thenReturn(dataSetQueryHelper); presenter.getData(new Range(0, 5)); verify(dataSetQueryHelper).lookupDataSet(anyInt(), any(DataSetReadyCallback.class)); }
Source:
<code>public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } final WorkflowVersion other = (WorkflowVersion)obj; <START> return Objects.equals(super.getName(), other.getName()) && Objects.equals(super.getReference(), other.getReference()) <END> && Objects.equals(this.lastModified, other.lastModified); }</code><technical_language>this, confusing calling super.getName() super.getReference, 1. This class override methods 2. If override methods, want compare this class' result, super class</technical_language>

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } final WorkflowVersion other = (WorkflowVersion)obj; return Objects.equals(this.getName(), other.getName()) && Objects.equals(this.getReference(), other.getReference()); }
Source:
<code>private static boolean isConstant(@Nullable ExpressionTree returnedExpression) { <START> return returnedExpression != null && returnedExpression.is(Kind.INT_LITERAL, Kind.CHAR_LITERAL, Kind.STRING_LITERAL, Kind.DOUBLE_LITERAL, Kind.FLOAT_LITERAL); <END> }</code><technical_language>Kind.LONG_LITERAL, Kind.BOOLEAN_LITERAL, Kind.NULL_LITERAL</technical_language>

Target:
private static boolean isConstant(@Nullable ExpressionTree returnedExpression) { return returnedExpression != null && returnedExpression.is(Kind.INT_LITERAL, Kind.LONG_LITERAL, Kind.CHAR_LITERAL, Kind.STRING_LITERAL, Kind.DOUBLE_LITERAL, Kind.FLOAT_LITERAL); }
Source:
<code>public boolean restart(Integer containerId) { if (containerId == null || containerId == 0) { return cliController.restart(containerId); } if (stateMgrAdaptor == null) { LOG.warning("SchedulerStateManagerAdaptor not initialized"); return false; } String host = "x"; int port = -1; int offset = "stmgr-".length(); for (StMgr sm : stateMgrAdaptor.getPhysicalPlan(topologyName).getStmgrsList()) { Integer id = Integer.valueOf(sm.getId().substring(offset)); LOG.info("comparing container " + offset + " " + sm.getId() + " with " + containerId); if (containerId.equals(id)) { host = sm.getHostName(); port = sm.getShellPort(); <START> break; <END> } } String url = "http://" + host + ":" + port + "/killexecutor"; String payload = "secret=" + stateMgrAdaptor.getExecutionState(topologyName).getTopologyId(); LOG.info("sending `kill container` to " + url + "; payload: " + payload); HttpURLConnection con = NetworkUtils.getHttpConnection(url); try { if (NetworkUtils.sendHttpPostRequest(con, "X", payload.getBytes())) { return NetworkUtils.checkHttpResponseCode(con, 200); } else { LOG.info("heron-shell killexecutor failed; try aurora client .."); return cliController.restart(containerId); } } finally { con.disconnect(); } }</code><technical_language>if id is found? protective code instead of creating a connection "http://x:-1/killexecutor"</technical_language>

Target:
public boolean restart(Integer containerId) { if (containerId == null || containerId == 0) { return cliController.restart(containerId); } if (stateMgrAdaptor == null) { LOG.warning("SchedulerStateManagerAdaptor not initialized"); return false; } StMgr sm = searchContainer(containerId); if (sm == null) { LOG.warning("container not found in pplan " + containerId); return false; } String url = "http://" + sm.getHostName() + ":" + sm.getShellPort() + "/killexecutor"; String payload = "secret=" + stateMgrAdaptor.getExecutionState(topologyName).getTopologyId(); LOG.info("sending `kill container` to " + url + "; payload: " + payload); HttpURLConnection con = NetworkUtils.getHttpConnection(url); try { if (NetworkUtils.sendHttpPostRequest(con, "X", payload.getBytes())) { return NetworkUtils.checkHttpResponseCode(con, 200); } else { LOG.info("heron-shell killexecutor failed; try aurora client .."); return cliController.restart(containerId); } } finally { con.disconnect(); } }
Source:
<code>private boolean canDeclare(AbstractProject owner) { String ownerClassName = owner.getClass().getName(); <START> return DependencyGraph.class.getClasses().length > 0 <END> && !ownerClassName.equals("hudson.plugins.promoted_builds.PromotionProcess"); }</code><technical_language>plugin requires newer Jenkins core version in 2016, this check is required anymore</technical_language>

Target:
private boolean canDeclare(AbstractProject owner) { return !owner.getClass().getName().equals("hudson.plugins.promoted_builds.PromotionProcess"); }
Source:
<code>public void testCreateGetAllDatastreams() throws Exception { DatastreamResources resource = new DatastreamResources(_datastreamKafkaCluster.getPrimaryDatastreamServer()); <START> <END> String datastreamName = "TestDatastream-"; List<Datastream> datastreams = createDataStreams(resource, datastreamName, 10); List<Datastream> queryStreams = resource.getAll(new PagingContext(0, 0, false, false)); queryStreams.forEach(queryStream -> Assert.assertNotNull(queryStream.getDestination())); Assert.assertEquals(datastreams.stream().map(Datastream::getName).collect(Collectors.toSet()), queryStreams.stream().map(Datastream::getName).collect(Collectors.toSet())); Datastream removed = queryStreams.remove(0); Assert.assertTrue(resource.delete(removed.getName()).getStatus() == HttpStatus.S_200_OK); List<Datastream> remainingQueryStreams = resource.getAll(new PagingContext(0, 0, false, false)); Assert.assertEquals(queryStreams.stream().map(Datastream::getName).collect(Collectors.toSet()), remainingQueryStreams.stream().map(Datastream::getName).collect(Collectors.toSet())); }</code><technical_language>do a getAll assert returned list is empty cover basis</technical_language>

Target:
public void testCreateGetAllDatastreams() throws Exception { DatastreamResources resource = new DatastreamResources(_datastreamKafkaCluster.getPrimaryDatastreamServer()); Assert.assertEquals(resource.getAll(NO_PAGING).size(), 0); String datastreamName = "TestDatastream-"; List<Datastream> datastreams = createDataStreams(resource, datastreamName, 10); Optional<List<Datastream>> result = PollUtils.poll(() -> resource.getAll(NO_PAGING), streams -> streams.size() == datastreams.size(), 100, 1000); Assert.assertTrue(result.isPresent()); List<Datastream> queryStreams = result.get(); queryStreams.forEach(queryStream -> Assert.assertNotNull(queryStream.getDestination())); Assert.assertEquals(datastreams.stream().map(Datastream::getName).collect(Collectors.toSet()), queryStreams.stream().map(Datastream::getName).collect(Collectors.toSet())); Datastream removed = queryStreams.remove(0); Assert.assertTrue(resource.delete(removed.getName()).getStatus() == HttpStatus.S_200_OK); List<Datastream> remainingQueryStreams = resource.getAll(NO_PAGING); Assert.assertEquals(queryStreams.stream().map(Datastream::getName).collect(Collectors.toSet()), remainingQueryStreams.stream().map(Datastream::getName).collect(Collectors.toSet())); }
Source:
<code>public void stop() { if (channel != null) { channel.getProtocolStack().getTransport().unregisterProbeHandler(probeHandler); } String clusterName = configuration.transport().clusterName(); try { if (disconnectChannel && channel != null && channel.isConnected()) { log.disconnectJGroups(clusterName); if (globalStatsEnabled) { JmxConfigurator.unregisterChannel(channel, mbeanServer, domain, channel.getClusterName()); } channel.disconnect(); } if (closeChannel && channel != null && channel.isOpen()) { channel.close(); } } catch (Exception toLog) { log.problemClosingChannel(toLog, clusterName); } if (requests != null) { requests.forEach(request -> request.cancel(log.cacheManagerIsStopping())); } channel = null; address = null; clusterView = new ClusterView(ClusterView.FINAL_VIEW_ID, Collections.emptyList(), null); requests = null; <START> address = null; <END> physicalAddress = null; CompletableFuture<Void> oldFuture = null; viewUpdateLock.lock(); try { oldFuture = nextViewFuture; nextViewFuture = new CompletableFuture<>(); viewUpdateCondition.signalAll(); } finally { viewUpdateLock.unlock(); if (oldFuture != null) { oldFuture.complete(null); } } }</code><technical_language>address nulled out above. move physicalAddress</technical_language>

Target:
public void stop() { if (channel != null) { channel.getProtocolStack().getTransport().unregisterProbeHandler(probeHandler); } String clusterName = configuration.transport().clusterName(); try { if (disconnectChannel && channel != null && channel.isConnected()) { log.disconnectJGroups(clusterName); if (globalStatsEnabled) { JmxConfigurator.unregisterChannel(channel, mbeanServer, domain, channel.getClusterName()); } channel.disconnect(); } if (closeChannel && channel != null && channel.isOpen()) { channel.close(); } } catch (Exception toLog) { log.problemClosingChannel(toLog, clusterName); } if (requests != null) { requests.forEach(request -> request.cancel(log.cacheManagerIsStopping())); } channel = null; address = null; physicalAddress = null; clusterView = new ClusterView(ClusterView.FINAL_VIEW_ID, Collections.emptyList(), null); requests = null; CompletableFuture<Void> oldFuture = null; viewUpdateLock.lock(); try { oldFuture = nextViewFuture; nextViewFuture = new CompletableFuture<>(); viewUpdateCondition.signalAll(); } finally { viewUpdateLock.unlock(); if (oldFuture != null) { oldFuture.complete(null); } } }
Source:
<code>public void testAsynchronousPutting() throws Exception { final EntityId entityId = mTable.getEntityId("foo"); final KijiDataRequest request = KijiDataRequest.create("info", "name"); final CountDownLatch latch = new CountDownLatch(1); final boolean success; KijiTableWriter writer = mTable.openTableWriter(); writer.put(entityId, "info", "name", 123L, "old"); writer.close(); KijiFuture<Object> future = mBufferedWriter.put(entityId, KijiColumnName.create("info", "name"), 123L, "baz"); Futures.addCallback(future, new FutureCallback<Object>() { @Override public void onSuccess(@Nullable final Object o) { latch.countDown(); } @Override public void onFailure(final Throwable throwable) { Assert.fail("Put should not fail"); <START> latch.countDown(); <END> } }); final String actual = mReader.get(entityId, request).getValue("info", "name", 123L).toString(); assertEquals("old", actual); mBufferedWriter.flush(); latch.await(5, TimeUnit.SECONDS); assertEquals("baz", mReader.get(entityId, request).getValue("info", "name", 123L).toString()); }</code><technical_language>This code is unreachable Assert.fail() throws exception</technical_language>

Target:
public void testAsynchronousPutting() throws Exception { final EntityId entityId = mTable.getEntityId("foo"); final KijiDataRequest request = KijiDataRequest.create("info", "name"); final CountDownLatch latch = new CountDownLatch(1); final Boolean success; KijiTableWriter writer = mTable.openTableWriter(); try { writer.put(entityId, "info", "name", 123L, "old"); } finally { writer.close(); } KijiFuture<Object> future = mBufferedWriter.put(entityId, KijiColumnName.create("info", "name"), 123L, "baz"); Futures.addCallback(future, new FutureCallback<Object>() { @Override public void onSuccess(@Nullable final Object o) { latch.countDown(); } @Override public void onFailure(final Throwable throwable) { Assert.fail("Put should not fail"); } }); final String actual = mReader.get(entityId, request).getValue("info", "name", 123L).toString(); assertEquals("old", actual); mBufferedWriter.flush(); assertTrue(latch.await(5, TimeUnit.SECONDS)); assertEquals("baz", mReader.get(entityId, request).getValue("info", "name", 123L).toString()); }
Source:
<code>protected final void waitUntil(ConfigToolExecutionResult result, Matcher<ConfigToolExecutionResult> matcher) { <START> waitUntil(() -> result, matcher, OP_TIMEOUT); <END> }</code><technical_language>overridable getOperationTimeout() method instead</technical_language>

Target:
protected final void waitUntil(ConfigToolExecutionResult result, Matcher<ConfigToolExecutionResult> matcher) { waitUntil(() -> result, matcher, getAssertTimeout()); }
Source:
<code>public RsWithStatus(final Response res, final int code, final CharSequence rsn) { super( <START> new RsOf( <END> () -> RsWithStatus.head(res, code, rsn), res::body ) ); }</code><technical_language>@fanifieiev above</technical_language>

Target:
public RsWithStatus(final Response res, final int code, final CharSequence rsn) { super( new ResponseOf( () -> RsWithStatus.head(res, code, rsn), res::body ) ); }
Source:
<code>public void shouldHandleNotification() { String requestBody = getNotificationString(); AbstractNotificationPayload finalPayload = webhookService.process(requestBody); <START> OrderStatusChangeNotificationPayload orderNotification = (OrderStatusChangeNotificationPayload)finalPayload; <END> assertThat(orderNotification, is(notNullValue())); assertThat(orderNotification.getPaymentStatus(), is(paymentStatus)); assertThat(orderNotification.getOrderCode(), is(orderCode)); assertThat(orderNotification.getEnvironment(), is(environment)); assertThat(orderNotification.getAdminCode(), is(adminCode)); assertThat(orderNotification.getMerchantId(), is(merchantId)); assertThat(orderNotification.getNotificationEventType(), is(notificationEventType)); }</code><technical_language>assertThat("Notification Type", orderNotification, instanceOf(OrderStatusChangeNotificationPayload));</technical_language>

Target:
public void shouldHandleNotification() { String requestBody = getNotificationString(); AbstractNotificationPayload finalPayload = webhookService.process(requestBody); assertThat("Notification Type", finalPayload, instanceOf(OrderStatusChangeNotificationPayload.class)); OrderStatusChangeNotificationPayload orderNotification = (OrderStatusChangeNotificationPayload)finalPayload; assertThat("Order notification", orderNotification, is(notNullValue())); assertThat("Payment status", orderNotification.getPaymentStatus(), is(paymentStatus)); assertThat("Order code", orderNotification.getOrderCode(), is(orderCode)); assertThat("Environment", orderNotification.getEnvironment(), is(environment)); assertThat("Admin code", orderNotification.getAdminCode(), is(adminCode)); assertThat("Merchant id", orderNotification.getMerchantId(), is(merchantId)); assertThat("Notification event type", orderNotification.getNotificationEventType(), is(notificationEventType)); }
Source:
<code>public static void showRateDialogIfMeetsConditions(final Activity activity) { if (shouldShowRateDialog()) { <START> if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { <END> showRateDialog((FragmentActivity) activity); } else { showRateDialog(activity); } } }</code><technical_language>java if (activity instanceof FragmentActivity) { showRateDialog((FragmentActivity) activity); } I is developer FragmentActivity if SDK_INIT HONEYCOMS</technical_language>

Target:
public static void showRateDialogIfMeetsConditions(final Activity activity) { if (shouldShowRateDialog()) { if (activity instanceof FragmentActivity) { showRateDialog((FragmentActivity) activity); } else { showRateDialog(activity); } } }
Source:
<code>public RexNode visitDynamicParam(RexDynamicParam dynamicParam) { <START> return new RexDynamicParam(copy(dynamicParam.getType()), dynamicParam.getIndex()); <END> }</code><technical_language>Please builder.xxx(...) instead of new ...</technical_language>

Target:
public RexNode visitDynamicParam(RexDynamicParam dynamicParam) { return builder.makeDynamicParam(copy(dynamicParam.getType()), dynamicParam.getIndex()); }