auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void createParameterNames(List<AnyParameter> parameterTrees, @Nullable String fileId) { ParameterState parameterState = new ParameterState(); for (AnyParameter anyParameter : parameterTrees) { if (anyParameter.is(Tree.Kind.PARAMETER)) { org.sonar.plugins.python.api.tree.Parameter parameter = (org.sonar.plugins.python.api.tree.Parameter) anyParameter; Token starToken = parameter.starToken(); if (starToken != null && "/".equals(starToken.value())) { <START> parameterState.positionalOnly = true; <END> } } } for (AnyParameter anyParameter : parameterTrees) { if (anyParameter.is(Tree.Kind.PARAMETER)) { addParameter((org.sonar.plugins.python.api.tree.Parameter) anyParameter, fileId, parameterState); } else { parameters.add(new ParameterImpl(null, InferredTypes.anyType(), false, false, parameterState, locationInFile(anyParameter, fileId))); } } }</code><technical_language>expected a break somewhere, set positionalOnly-flag soon find a single / - need further. Otherwise, a more explicit traversing parameters check for existence of (as opposed side-effects element) parameterState.positionalOnly = parameterTrees.stream().anyMatch(param -> Optional.of(param) .filter(p -> p.is(Tree.Kind.PARAMETER)) .map(p -> ((org.sonar.plugins.python.api.tree.Parameter) p).starToken()) .map(Token::value) .filter("/"::equals) .isPresent() ); This reported "code-smell" loop away. in case, a break hurt here, I think</technical_language>

Target:
private void createParameterNames(List<AnyParameter> parameterTrees, @Nullable String fileId) { ParameterState parameterState = new ParameterState(); parameterState.positionalOnly = parameterTrees.stream().anyMatch(param -> Optional.of(param) .filter(p -> p.is(Tree.Kind.PARAMETER)) .map(p -> ((org.sonar.plugins.python.api.tree.Parameter) p).starToken()) .map(Token::value) .filter("/"::equals) .isPresent() ); for (AnyParameter anyParameter : parameterTrees) { if (anyParameter.is(Tree.Kind.PARAMETER)) { addParameter((org.sonar.plugins.python.api.tree.Parameter) anyParameter, fileId, parameterState); } else { parameters.add(new ParameterImpl(null, InferredTypes.anyType(), false, false, parameterState, locationInFile(anyParameter, fileId))); } } }
Source:
<code>private ReplicaMetadataResponseInfo(PartitionId partitionId, FindToken findToken, List<MessageInfo> messageInfoList, long remoteReplicaLagInBytes, short replicaMetadataResponseVersion) { if (partitionId == null || findToken == null || messageInfoList == null) { throw new IllegalArgumentException( "Invalid partition or token or message info list for ReplicaMetadataResponseInfo"); } this.partitionId = partitionId; this.remoteReplicaLagInBytes = remoteReplicaLagInBytes; messageInfoAndMetadataListSerde = <START> new MessageInfoAndMetadataListSerde(messageInfoList, getMessageInfoListVersion(replicaMetadataResponseVersion)); <END> messageInfoListSize = messageInfoAndMetadataListSerde.getMessageInfoAndMetadataListSize(); this.token = findToken; this.errorCode = ServerErrorCode.No_Error; }</code><technical_language>add a TODO in PartitionResponseInfo calling other constructor</technical_language>

Target:
private ReplicaMetadataResponseInfo(PartitionId partitionId, FindToken findToken, List<MessageInfo> messageInfoList, long remoteReplicaLagInBytes, short replicaMetadataResponseVersion) { if (partitionId == null || findToken == null || messageInfoList == null) { throw new IllegalArgumentException( "Invalid partition or token or message info list for ReplicaMetadataResponseInfo"); } this.partitionId = partitionId; this.remoteReplicaLagInBytes = remoteReplicaLagInBytes; messageInfoAndMetadataListSerde = new MessageInfoAndMetadataListSerde(messageInfoList, getMessageInfoAndMetadataListSerDeVersion(replicaMetadataResponseVersion)); messageInfoListSize = messageInfoAndMetadataListSerde.getMessageInfoAndMetadataListSize(); this.token = findToken; this.errorCode = ServerErrorCode.No_Error; }
Source:
<code><START> public void makeSortable(String sortBy) { <END> setSortable(true); this.sortBy = sortBy; }</code><technical_language>Consider adding another override, accepts a Comparator<T> argument. This enable usage of this class a manual comparator, in case table of search query mechanism</technical_language>

Target:
public void makeSortable(String sortBy) { assert sortBy != null : "sortBy cannot be null"; this.sortBy = sortBy; this.comparator = null; setSortable(true); }
Source:
<code>private ImmutableList<UpdaterConfiguration> makeRoviConfigurations() { ImmutableSet<Publisher> targetSources = ImmutableSet.of( Publisher.BBC, Publisher.PA, Publisher.YOUVIEW, Publisher.BBC_NITRO, Publisher.BBC_REDUX, Publisher.ITV, Publisher.C4_PMLSD, Publisher.C4_PMLSD_P06, <START> FIVE <END> ); return ImmutableList.of(ROVI_EN_GB, ROVI_EN_US) .stream() .map(source -> UpdaterConfiguration.builder() .withSource(source) .withItemEquivalenceUpdater( ROVI_ITEM, targetSources ) .withTopLevelContainerEquivalenceUpdater( STANDARD_TOP_LEVEL_CONTAINER, targetSources ) .withNonTopLevelContainerEquivalenceUpdater( NOP_CONTAINER, ImmutableSet.of() ) .build()) .collect(MoreCollectors.toImmutableList()); }</code><technical_language>consistent. static imports, none</technical_language>

Target:
private ImmutableList<UpdaterConfiguration> makeRoviConfigurations() { ImmutableSet<Publisher> targetSources = ImmutableSet.of( Publisher.BBC, Publisher.PA, Publisher.YOUVIEW, Publisher.BBC_NITRO, Publisher.BBC_REDUX, Publisher.ITV, Publisher.C4_PMLSD, Publisher.C4_PMLSD_P06, Publisher.FIVE ); return ImmutableList.of(ROVI_EN_GB, ROVI_EN_US) .stream() .map(source -> UpdaterConfiguration.builder() .withSource(source) .withItemEquivalenceUpdater( ROVI_ITEM, targetSources ) .withTopLevelContainerEquivalenceUpdater( STANDARD_TOP_LEVEL_CONTAINER, targetSources ) .withNonTopLevelContainerEquivalenceUpdater( NOP_CONTAINER, ImmutableSet.of() ) .build()) .collect(MoreCollectors.toImmutableList()); }
Source:
<code>private Path findFilteredPaths(OverridableConf queryContext, String tableName, Schema partitionColumns, EvalNode conjunctiveForms, Path tablePath) throws IOException, UndefinedDatabaseException, UndefinedTableException, UndefinedPartitionMethodException, UndefinedOperatorException, UnsupportedException { Path filteredPaths = null; FileSystem fs = tablePath.getFileSystem(queryContext.getConf()); String splits = CatalogUtil.splitFQTableName(tableName); List<PartitionDescProto> partitions = null; try { if (conjunctiveForms == null) { partitions = catalog.getPartitionsOfTable(splits[0], splits[1]); if (partitions.isEmpty()) { filteredPaths = findFilteredPathsFromFileSystem(partitionColumns, conjunctiveForms, fs, tablePath); } else { filteredPaths = findFilteredPathsByPartitionDesc(partitions); } } else { if (catalog.existPartitions(splits[0], splits[1])) { PartitionsByAlgebraProto request = getPartitionsAlgebraProto(splits[0], splits[1], conjunctiveForms); partitions = catalog.getPartitionsByAlgebra(request); filteredPaths = findFilteredPathsByPartitionDesc(partitions); } else { filteredPaths = findFilteredPathsFromFileSystem(partitionColumns, conjunctiveForms, fs, tablePath); } } <START> } catch (UnsupportedException ue) { <END> LOG.warn(ue.getMessage()); filteredPaths = findFilteredPathsFromFileSystem(partitionColumns, conjunctiveForms, fs, tablePath); } LOG.info("Filtered directory or files: " + filteredPaths.length); return filteredPaths; }</code><technical_language>IMO, this case is regarded full scan partitions. So, routine if (conjunctiveForms == null) clause is required here</technical_language>

Target:
private Path findFilteredPaths(OverridableConf queryContext, String tableName, Schema partitionColumns, EvalNode conjunctiveForms, Path tablePath) throws IOException, UndefinedDatabaseException, UndefinedTableException, UndefinedPartitionMethodException, UndefinedOperatorException, UnsupportedException { return findFilteredPaths(queryContext, tableName, partitionColumns, conjunctiveForms, tablePath, null); }
Source:
<code>public void stop() { log.info("Stopping announcer"); synchronized (toAnnounce) { if (!started) { return; } started = false; <START> Closer closer = Closer.create(); <END> for (NodeCache cache : listeners.values()) { closer.register(cache); } CloseQuietly.close(closer); for (String announcementPath : announcedPaths.keySet()) { unannounce(announcementPath); } if (!pathsCreatedInThisAnnouncer.isEmpty()) { final List<CuratorOp> deleteOps = new ArrayList<>(pathsCreatedInThisAnnouncer.size()); for (String parent : pathsCreatedInThisAnnouncer) { try { deleteOps.add(curator.transactionOp().delete().forPath(parent)); } catch (Exception e) { log.error(e, "Unable to delete parent[%s].", parent); } } try { curator.transaction().forOperations(deleteOps); } catch (Exception e) { log.error(e, "Unable to commit transaction."); } } } }</code><technical_language>I add unannouncements, pathsCreatedInThisAnnouncer deletion operation Closer too, attempted in case of problems</technical_language>

Target:
public void stop() { log.info("Stopping announcer"); synchronized (toAnnounce) { if (!started) { return; } started = false; Closer closer = Closer.create(); for (NodeCache cache : listeners.values()) { closer.register(cache); } for (String announcementPath : announcedPaths.keySet()) { closer.register(() -> unannounce(announcementPath)); } CloseQuietly.close(closer); if (!pathsCreatedInThisAnnouncer.isEmpty()) { final List<CuratorOp> deleteOps = new ArrayList<>(pathsCreatedInThisAnnouncer.size()); for (String parent : pathsCreatedInThisAnnouncer) { try { deleteOps.add(curator.transactionOp().delete().forPath(parent)); } catch (Exception e) { log.error(e, "Unable to delete parent[%s].", parent); } } try { curator.transaction().forOperations(deleteOps); } catch (Exception e) { log.error(e, "Unable to commit transaction."); } } } }
Source:
<code>public void repositorySelectorTest() { File testConfig = new File(Preferences.DIRECTORY, Preferences.TEST_CONFIG_FILE); if (!(testConfig.exists() && testConfig.isFile())) fail(); assertNodeExists("#repoOwnerField"); type("dummy").push(KeyCode.TAB).type("dummy").push(KeyCode.ENTER); ComboBox<String> comboBox = find("#repositorySelector"); assertEquals(1, comboBox.getItems().size()); assertEquals("dummy/dummy", primaryRepo); click("#dummy/dummy_col0_filterTextField"); type("repo"); press(KeyCode.SHIFT).press(KeyCode.SEMICOLON).release(KeyCode.SEMICOLON).release(KeyCode.SHIFT); type("dummy2/dummy2"); push(KeyCode.ENTER); assertEquals(2, comboBox.getItems().size()); assertEquals("dummy/dummy", primaryRepo); doubleClick(comboBox); doubleClick(); type("dummy3/dummy3"); push(KeyCode.ENTER); assertEquals(3, comboBox.getItems().size()); assertEquals("dummy3/dummy3", primaryRepo); doubleClick(comboBox); doubleClick(); type(" dummy4 / dummy4 "); push(KeyCode.ENTER); assertEquals(4, comboBox.getItems().size()); assertEquals("dummy4/dummy4", primaryRepo); click("Repos"); push(KeyCode.DOWN); push(KeyCode.RIGHT); push(KeyCode.DOWN); push(KeyCode.ENTER); <START> sleep(5000); <END> assertEquals(3, comboBox.getItems().size()); click("File"); click("Quit"); if (!(testConfig.exists() && testConfig.isFile())) fail(); Preferences testPref = new Preferences(true); RepositoryId lastViewedRepository = testPref.getLastViewedRepository().get(); assertEquals("dummy4/dummy4", lastViewedRepository.generateId()); }</code><technical_language>This replaced a combination of PlatformEx.waitOnFxThread UITest.waitForValue/UITest.waitUntilNodeAppears</technical_language>

Target:
public void repositorySelectorTest() { File testConfig = new File(Preferences.DIRECTORY, Preferences.TEST_CONFIG_FILE); if (!(testConfig.exists() && testConfig.isFile())) fail(); assertNodeExists("#repoOwnerField"); type("dummy").push(KeyCode.TAB).type("dummy").push(KeyCode.ENTER); ComboBox<String> comboBox = find("#repositorySelector"); assertEquals(1, comboBox.getItems().size()); assertEquals("dummy/dummy", primaryRepo); click("#dummy/dummy_col0_filterTextField"); type("repo"); press(KeyCode.SHIFT).press(KeyCode.SEMICOLON).release(KeyCode.SEMICOLON).release(KeyCode.SHIFT); type("dummy2/dummy2"); push(KeyCode.ENTER); assertEquals(2, comboBox.getItems().size()); assertEquals("dummy/dummy", primaryRepo); doubleClick(comboBox); doubleClick(); type("dummy3/dummy3"); push(KeyCode.ENTER); assertEquals(3, comboBox.getItems().size()); assertEquals("dummy3/dummy3", primaryRepo); doubleClick(comboBox); doubleClick(); type(" dummy4 / dummy4 "); push(KeyCode.ENTER); assertEquals(4, comboBox.getItems().size()); assertEquals("dummy4/dummy4", primaryRepo); click("Repos"); push(KeyCode.DOWN); push(KeyCode.RIGHT); push(KeyCode.DOWN); push(KeyCode.ENTER); PlatformEx.waitOnFxThread(); assertEquals(3, comboBox.getItems().size()); click("File"); click("Quit"); if (!(testConfig.exists() && testConfig.isFile())) fail(); Preferences testPref = new Preferences(true); RepositoryId lastViewedRepository = testPref.getLastViewedRepository().get(); assertEquals("dummy4/dummy4", lastViewedRepository.generateId()); }
Source:
<code>public boolean isBehaviour() { ErlangFunction function = getFunction("behaviour_info", 1); <START> return !getCallbackMap().isEmpty() || function != null && function.isExported(); <END> }</code><technical_language>This method attempt get result a file stub</technical_language>

Target:
public boolean isBehaviour() { ErlangFileStub stub = getStub(); if (stub != null) return stub.isBehaviour(); ErlangFunction function = getFunction("behaviour_info", 1); return !getCallbackMap().isEmpty() || function != null && function.isExported(); }
Source:
<code>static void purgeOlderSnapshots(FileTxnSnapLog txnLog, File snapShot) { final long leastZxidToBeRetain = Util.getZxidFromName( snapShot.getName(), PREFIX_SNAPSHOT); final Set<File> retainedTxnLogs = new HashSet<File>(); retainedTxnLogs.addAll(Arrays.asList(txnLog.getSnapshotLogs(leastZxidToBeRetain))); class MyFileFilter implements FileFilter{ private final String prefix; MyFileFilter(String prefix){ this.prefix=prefix; } public boolean accept(File f){ if(!f.getName().startsWith(prefix + ".")) return false; if (retainedTxnLogs.contains(f)) { return false; } long fZxid = Util.getZxidFromName(f.getName(), prefix); if (fZxid >= leastZxidToBeRetain) { return false; } return true; } } List<File> files = new ArrayList<File>(); File[] fileArray; <START> if ((fileArray = txnLog.getDataDir().listFiles(new MyFileFilter(PREFIX_LOG))) != null) { <END> files.addAll(Arrays.asList(fileArray)); } if ((fileArray = txnLog.getSnapDir().listFiles(new MyFileFilter(PREFIX_SNAPSHOT))) != null) { files.addAll(Arrays.asList(fileArray)); } for(File f: files) { final String msg = "Removing file: "+ DateFormat.getDateTimeInstance().format(f.lastModified())+ "\t"+f.getPath(); LOG.info(msg); System.out.println(msg); if(!f.delete()){ System.err.println("Failed to remove "+f.getPath()); } } }</code><technical_language>var assignment File[] fileArray object reference instead of clubbing if check. File[] fileArray = txnLog.getDataDir().listFiles(new MyFileFilter(PREFIX_LOG);</technical_language>

Target:
static void purgeOlderSnapshots(FileTxnSnapLog txnLog, File snapShot) { final long leastZxidToBeRetain = Util.getZxidFromName( snapShot.getName(), PREFIX_SNAPSHOT); final Set<File> retainedTxnLogs = new HashSet<File>(); retainedTxnLogs.addAll(Arrays.asList(txnLog.getSnapshotLogs(leastZxidToBeRetain))); class MyFileFilter implements FileFilter{ private final String prefix; MyFileFilter(String prefix){ this.prefix=prefix; } public boolean accept(File f){ if(!f.getName().startsWith(prefix + ".")) return false; if (retainedTxnLogs.contains(f)) { return false; } long fZxid = Util.getZxidFromName(f.getName(), prefix); if (fZxid >= leastZxidToBeRetain) { return false; } return true; } } List<File> files = new ArrayList<File>(); File[] fileArray = txnLog.getDataDir().listFiles(new MyFileFilter(PREFIX_LOG)); if (fileArray != null) { files.addAll(Arrays.asList(fileArray)); } fileArray = txnLog.getSnapDir().listFiles(new MyFileFilter(PREFIX_SNAPSHOT)); if (fileArray != null) { files.addAll(Arrays.asList(fileArray)); } for(File f: files) { final String msg = "Removing file: "+ DateFormat.getDateTimeInstance().format(f.lastModified())+ "\t"+f.getPath(); LOG.info(msg); System.out.println(msg); if(!f.delete()){ System.err.println("Failed to remove "+f.getPath()); } } }
Source:
<code>protected void registerAfterCompletionWithExistingTransaction( Object transaction, List<TransactionSynchronization> synchronizations) throws TransactionException { <START> if(logger.isDebugEnabled()){ logger.debug("Cannot register Spring after-completion synchronization with existing transaction - " + "processing Spring after-completion callbacks immediately, with outcome status 'unknown'"); } <END> invokeAfterCompletion(synchronizations, TransactionSynchronization.STATUS_UNKNOWN); }</code><technical_language>need for isDebugEnabled() check this is effectively a constant string. In other words, is dynamic this string concatenation converted a single string compiler. suggestion logger.debug("Cannot register Spring after-completion synchronization existing transaction - " + "processing Spring after-completion callbacks immediately, outcome status 'unknown'");</technical_language>

Target:
protected void registerAfterCompletionWithExistingTransaction( Object transaction, List<TransactionSynchronization> synchronizations) throws TransactionException { logger.debug("Cannot register Spring after-completion synchronization with existing transaction - " + "processing Spring after-completion callbacks immediately, with outcome status 'unknown'"); invokeAfterCompletion(synchronizations, TransactionSynchronization.STATUS_UNKNOWN); }
Source:
<code>public void boundaryError() { <START> PublishSubject<Integer> pp = PublishSubject.create(); <END> CompletableSubject cs = CompletableSubject.create(); TestObserver<Void> to = pp.concatMapCompletableDelayError( Functions.justFunction(cs), false).test(); to.assertEmpty(); assertTrue(pp.hasObservers()); assertFalse(cs.hasObservers()); pp.onNext(1); assertTrue(cs.hasObservers()); pp.onError(new TestException()); assertTrue(cs.hasObservers()); to.assertEmpty(); cs.onComplete(); to.assertFailure(TestException.class); }</code><technical_language>ps</technical_language>

Target:
public void boundaryError() { PublishSubject<Integer> ps = PublishSubject.create(); CompletableSubject cs = CompletableSubject.create(); TestObserver<Void> to = ps.concatMapCompletableDelayError( Functions.justFunction(cs), false).test(); to.assertEmpty(); assertTrue(ps.hasObservers()); assertFalse(cs.hasObservers()); ps.onNext(1); assertTrue(cs.hasObservers()); ps.onError(new TestException()); assertTrue(cs.hasObservers()); to.assertEmpty(); cs.onComplete(); to.assertFailure(TestException.class); }
Source:
<code>public void testBlobFromFileURL() throws Exception { String contentType = "image/png"; Blob blob = null; URL url = null; File path = folder.newFile("attachment.png"); InputStream is = getAsset("attachment.png"); try { byte[] bytes = IOUtils.toByteArray(is); FileOutputStream fos = new FileOutputStream(path); fos.write(bytes); fos.close(); blob = new Blob(contentType, path.toURI().toURL()); } catch(Exception e) { <START> fail(" failed at " + e); <END> } finally { is.close(); } byte[] bytes = IOUtils.toByteArray(path); byte[] content = blob.getContent(); assertTrue(Arrays.equals(content, bytes)); thrown.expect(IllegalArgumentException.class); blob = new Blob(null, url); thrown.expect(IllegalArgumentException.class); blob = new Blob(contentType, (URL) null); thrown.expect(IllegalArgumentException.class); blob = new Blob(contentType, new URL("<LINK_0>")); }</code><technical_language>is a space " failed</technical_language>

Target:
public void testBlobFromFileURL() throws Exception { String contentType = "image/png"; Blob blob = null; URL url = null; File path = tempFolder.newFile("attachment.png"); InputStream is = getAsset("attachment.png"); try { byte[] bytes = IOUtils.toByteArray(is); FileOutputStream fos = new FileOutputStream(path); fos.write(bytes); fos.close(); blob = new Blob(contentType, path.toURI().toURL()); } catch(Exception e) { fail("Failed when writing to tempFile " + e); } finally { is.close(); } byte[] bytes = IOUtils.toByteArray(path); byte[] content = blob.getContent(); assertTrue(Arrays.equals(content, bytes)); thrown.expect(IllegalArgumentException.class); blob = new Blob(null, url); thrown.expect(IllegalArgumentException.class); blob = new Blob(contentType, (URL) null); thrown.expect(IllegalArgumentException.class); blob = new Blob(contentType, new URL("<LINK_0>")); }
Source:
<code>private void makeSockDiagMsg() { try { for (int family : ADDRESS_FAMILIES) { mSockDiagMsg.put( family, <START> InetDiagMessageShimImpl.newInstance().makeInetDiagReqV2( <END> IPPROTO_TCP, null , null , family, (short) (NLM_F_REQUEST | NLM_F_DUMP) , 0 , 1 << 1 , TCP_MONITOR_STATE_FILTER)); } } catch (ApiNotSupportedException e) { log("Method is not available in this version."); mIsTcpInfoParsingSupported = false; } }</code><technical_language>Do need create a new instance of shims for run of loop ? +reminv@ shims implementation a singleton global network stack, tied some context</technical_language>

Target:
private void makeSockDiagMsg() { try { final InetDiagMessageShim instance = InetDiagMessageShimImpl.newInstance(); for (int family : ADDRESS_FAMILIES) { mSockDiagMsg.put( family, instance.makeInetDiagReqV2( IPPROTO_TCP, null , null , family, (short) (NLM_F_REQUEST | NLM_F_DUMP) , 0 , 1 << INET_DIAG_MEMINFO , TCP_MONITOR_STATE_FILTER)); } } catch (ApiNotSupportedException e) { log("Method is not available in this version."); mIsTcpInfoParsingSupported = false; } }
Source:
<code>private IModel runModelHooks(IModel base, Optional<Boolean> smooth, Optional<Boolean> gui3d, boolean uvlock, ImmutableMap<String, String> textureMap, ImmutableMap<String, String> customData) { base = base.process(customData); base = base.retexture(textureMap); <START> base = smooth.isPresent() ? base.smoothLighting(smooth.get()) : base; <END> base = gui3d.isPresent() ? base.gui3d(gui3d.get()) : base; base = base.uvlock(uvlock); return base; }</code><technical_language>expressed suggestion base = smooth.map(base::smoothLighting).orElse(base);</technical_language>

Target:
private IModel runModelHooks(IModel base, Optional<Boolean> smooth, Optional<Boolean> gui3d, boolean uvlock, ImmutableMap<String, String> textureMap, ImmutableMap<String, String> customData) { base = base.process(customData); base = base.retexture(textureMap); base = smooth.map(base::smoothLighting).orElse(base); base = gui3d.map(base::gui3d).orElse(base); base = base.uvlock(uvlock); return base; }
Source:
<code>public void mergeLots(final String keepLotUUID, final LotsSearchDto lotsSearchDto) { final List<ExtendedLotDto> lotDtos = this.lotService.searchLots(lotsSearchDto, null); this.lotMergeValidator.validate(keepLotUUID, lotDtos); <START> lotsSearchDto.setLotIds(lotDtos.stream().map(LotDto::getLotId).collect(Collectors.toList())); <END> final ExtendedLotDto lotDto = lotDtos.stream() .filter(extendedLotDto -> keepLotUUID.equals(extendedLotDto.getLotUUID())) .findFirst() .get(); final WorkbenchUser loggedInUser = this.securityService.getCurrentlyLoggedInUser(); this.lotService.mergeLots(loggedInUser.getUserid(), lotDto.getLotId(), lotsSearchDto); }</code><technical_language>this assignment is needed @lik-83</technical_language>

Target:
public void mergeLots(final String keepLotUUID, final LotsSearchDto lotsSearchDto) { final List<ExtendedLotDto> lotDtos = this.lotService.searchLots(lotsSearchDto, null); this.lotMergeValidator.validate(keepLotUUID, lotDtos); final ExtendedLotDto lotDto = lotDtos.stream() .filter(extendedLotDto -> keepLotUUID.equals(extendedLotDto.getLotUUID())) .findFirst() .get(); final WorkbenchUser loggedInUser = this.securityService.getCurrentlyLoggedInUser(); this.lotService.mergeLots(loggedInUser.getUserid(), lotDto.getLotId(), lotsSearchDto); }
Source:
<code>public void updateTitle(@StringRes int title) { final int toolbarId = getToolbarId(); final FragmentManager fm = getSupportFragmentManager(); Fragment actionBarGeoTag = fm.findFragmentById(toolbarId); <START> if (actionBarGeoTag != null && actionBarGeoTag instanceof ActionBarGeoTagFragment) { <END> ((ActionBarGeoTagFragment) actionBarGeoTag).updateTitle(title); } }</code><technical_language>@chaviw here. skip check for null</technical_language>

Target:
public void updateTitle(@StringRes int title) { final int toolbarId = getToolbarId(); final FragmentManager fm = getSupportFragmentManager(); Fragment actionBarGeoTag = fm.findFragmentById(toolbarId); if (actionBarGeoTag instanceof ActionBarGeoTagFragment) { ((ActionBarGeoTagFragment) actionBarGeoTag).updateTitle(title); } }
Source:
<code>public boolean advanceNextPosition() <START> { <END> if (this.closed) { return false; } try { boolean result = this.resultSet.next(); if (!result) { this.close(); } return result; } catch (SQLException | RuntimeException e) { throw this.handleSqlException(e); } }</code><technical_language>body of this method com.facebook.presto.plugin.jdbc.JdbcRecordCursor#advanceNextPosition. is a possibility retain reuse? applies other methods too. if need copy (i hope don't), separate copying enhancements separate commits, I review</technical_language>

Target:
public boolean advanceNextPosition() { if (closed) { return false; } try { boolean result = resultSet.next(); if (!result) { close(); } return result; } catch (SQLException | RuntimeException e) { throw handleSqlException(e); } }
Source:
<code>public void testJdk8DateTimeSerialization() throws IOException { assertThat(MAPPER.writeValueAsString(Duration.ofDays(2))).isEqualTo("172800.000000000"); assertThat(MAPPER.readValue("172800.000000000", Duration.class)).isEqualTo(Duration.ofDays(2)); assertThat(MAPPER.readValue("172800", Duration.class)).isEqualTo(Duration.ofDays(2)); ZonedDateTime now = ZonedDateTime.now().withZoneSameInstant(ZoneId.of("GMT")); <START> assertThat(MAPPER.readValue(MAPPER.writeValueAsString(now), ZonedDateTime.class)).isEqualTo(now); <END> now = ZonedDateTime.now().withZoneSameInstant(ZoneId.of(ZoneId.SHORT_IDS.get("EST"))); assertThat(MAPPER.readValue(MAPPER.writeValueAsString(now), ZonedDateTime.class)).isNotEqualTo(now); }</code><technical_language>assert this ISO-8601 compatible string</technical_language>

Target:
public void testJdk8DateTimeSerialization() throws IOException { Duration duration = Duration.ofMinutes(60 * 50 + 1); assertThat(ser(duration)).isEqualTo("\"PT50H1M\""); assertThat(serDe(duration, Duration.class)).isEqualTo(duration); OffsetDateTime offsetDateTime = OffsetDateTime.of(2001, 2, 3, 4, 5, 6, 7, ZoneOffset.ofHours(-5)); assertThat(ser(offsetDateTime)).isEqualTo("\"2001-02-03T04:05:06.000000007-05:00\""); assertThat(serDe(offsetDateTime, OffsetDateTime.class)).isEqualTo(offsetDateTime); ZonedDateTime zoneDateTime = ZonedDateTime.of(2001, 2, 3, 4, 5, 6, 7, ZoneId.of(ZoneId.SHORT_IDS.get("EST"))); assertThat(ser(zoneDateTime)).isEqualTo("\"2001-02-03T04:05:06.000000007-05:00\""); assertThat(serDe(zoneDateTime, ZonedDateTime.class)).isEqualTo(zoneDateTime); LocalDate localDate = LocalDate.of(2001, 2, 3); assertThat(ser(localDate)).isEqualTo("\"2001-02-03\""); assertThat(serDe(localDate, LocalDate.class)).isEqualTo(localDate); }
Source:
<code>private MultiResult getMultiValue(JsonParser parser, JsonPathCursor pathCursor) throws IOException { pathCursor.getNext(); MultiResult<Object> multiResult = new MultiResult<>(); JsonToken currentToken = parser.currentToken(); if (currentToken != JsonToken.START_ARRAY) { return null; } while (true) { currentToken = parser.nextToken(); if (currentToken == JsonToken.END_ARRAY) { break; } if (pathCursor.getCurrent() == null) { if (currentToken.isScalarValue()) { multiResult.add(convertJsonTokenToValue(parser)); } else { parser.skipChildren(); } } else { if (currentToken == JsonToken.START_OBJECT) { do { boolean attributeFound = findAttribute(parser, pathCursor); if (attributeFound && parser.currentToken() != JsonToken.START_OBJECT && !pathCursor.hasNext()) { addToMultiResult(multiResult, parser); break; } else if (attributeFound) { if (pathCursor.getNext() == null) { addToMultiResult(multiResult, parser); break; } } else { break; } } <START> while (true); <END> } else if (currentToken == JsonToken.START_ARRAY) { parser.skipChildren(); } } } return multiResult; }</code><technical_language>Minor: move this a line bracket</technical_language>

Target:
private MultiResult getMultiValue(JsonParser parser, JsonPathCursor pathCursor) throws IOException { pathCursor.getNext(); MultiResult<Object> multiResult = new MultiResult<>(); JsonToken currentToken = parser.currentToken(); if (currentToken != JsonToken.START_ARRAY) { return null; } while (true) { currentToken = parser.nextToken(); if (currentToken == JsonToken.END_ARRAY) { break; } if (pathCursor.getCurrent() == null) { if (currentToken.isScalarValue()) { multiResult.add(convertJsonTokenToValue(parser)); } else { parser.skipChildren(); } } else { if (currentToken == START_OBJECT) { do { if (!findAttribute(parser, pathCursor)) { break; } if ((parser.currentToken() != START_OBJECT && !pathCursor.hasNext()) || pathCursor.getNext() == null) { addToMultiResult(multiResult, parser); break; } } while (true); } else if (currentToken == JsonToken.START_ARRAY) { parser.skipChildren(); } } } return multiResult; }
Source:
<code>private boolean deleteTable() { try { TableConfig tableConfig = JsonUtils.fileToObject(new File(_tableConfigFileName), TableConfig.class); ControllerTest.sendDeleteRequest( ControllerRequestURLBuilder.baseUrl(CONTROLLER_URL).forTableDelete(tableConfig.getTableName())); return true; } catch (IOException e) { <START> System.out.println(e.getMessage()); <END> return false; } }</code><technical_language>change error log</technical_language>

Target:
private boolean deleteTable() { try { TableConfig tableConfig = JsonUtils.fileToObject(new File(_tableConfigFileName), TableConfig.class); ControllerTest.sendDeleteRequest( ControllerRequestURLBuilder.baseUrl(ClusterDescriptor.CONTROLLER_URL).forTableDelete(tableConfig.getTableName())); return true; } catch (IOException e) { LOGGER.error("Failed to delete table with file: {}", _tableConfigFileName, e); return false; } }
Source:
<code>protected void postLoad(DAnalysis dAnalysis, Version loadedVersion) { if (loadedVersion.compareTo(MIGRATION_VERSION) < 0) { for (DView dView : dAnalysis.getOwnedViews()) { for (DDiagram dDiagram : Iterables.filter(dView.getOwnedRepresentations(), DDiagram.class)) { for (DDiagramElementContainer diagramElement : <START> new DDiagramInternalQuery(dDiagram).getContainers()) { <END> if (diagramElement.getStyle() instanceof BorderedStyle) { BorderedStyle containerBorderedStyle = (BorderedStyle) diagramElement.getStyle(); if (containerBorderedStyle.getBorderSize().intValue() == 0) { containerBorderedStyle.setBorderSize(1); } if ("0".equals(containerBorderedStyle.getBorderSizeComputationExpression())) { containerBorderedStyle.setBorderSizeComputationExpression("1"); } } } } } } }</code><technical_language>simply call dDiagram.getContainers()</technical_language>

Target:
protected void postLoad(DAnalysis dAnalysis, Version loadedVersion) { if (loadedVersion.compareTo(MIGRATION_VERSION) < 0) { for (DView dView : dAnalysis.getOwnedViews()) { for (DDiagram dDiagram : Iterables.filter(dView.getOwnedRepresentations(), DDiagram.class)) { for (DDiagramElementContainer diagramElement : dDiagram.getContainers()) { if (diagramElement.getStyle() instanceof BorderedStyle) { BorderedStyle containerBorderedStyle = (BorderedStyle) diagramElement.getStyle(); if ("0".equals(containerBorderedStyle.getBorderSizeComputationExpression())) { containerBorderedStyle.setBorderSizeComputationExpression("1"); if (containerBorderedStyle.getBorderSize().intValue() == 0) { containerBorderedStyle.setBorderSize(1); } } } } } } } }
Source:
<code>public void setAttribute(final String key, final String value) { String tempVal = value; if (key.equals(SORT_ORDER_TAG)) { try { <START> this.sortOrder = null; <END> tempVal = SortOrder.valueOf(value).toString(); } catch (IllegalArgumentException e) { tempVal = "unknown"; } } else if (key.equals(GROUP_ORDER_TAG)) { this.groupOrder = null; } super.setAttribute(key, tempVal); }</code><technical_language>move this line try clause</technical_language>

Target:
public void setAttribute(final String key, final String value) { String tempVal = value; if (key.equals(SORT_ORDER_TAG)) { this.sortOrder = null; try { tempVal = SortOrder.valueOf(value).toString(); } catch (IllegalArgumentException e) { tempVal = SortOrder.unknown.toString(); } } else if (key.equals(GROUP_ORDER_TAG)) { this.groupOrder = null; } super.setAttribute(key, tempVal); }
Source:
<code>private List<InternalHiveSplit> getBucketedSplits(Path path, FileSystem fileSystem, InternalHiveSplitFactory splitFactory, BucketSplitInfo bucketSplitInfo) { int bucketCount = bucketSplitInfo.getBucketCount(); ArrayList<LocatedFileStatus> files = new ArrayList<>(bucketCount); try { Iterators.addAll(files, new HiveFileIterator(path, fileSystem, directoryLister, namenodeStats, FAIL)); } catch (NestedDirectoryNotAllowedException e) { throw new PrestoException(HIVE_INVALID_BUCKET_FILES, format("%s Found sub-directory in bucket directory for partition: %s", getCorruptBucketingMsg(), splitFactory.getPartitionName())); } if (files.size() != bucketCount) { <START> throw new PrestoException(HIVE_INVALID_BUCKET_FILES, format("%s The number of files in the directory (%s) does not match the declared bucket count (%s) for partition: %s", getCorruptBucketingMsg(), files.size(), <END> bucketCount, splitFactory.getPartitionName())); } files.sort(null); List<InternalHiveSplit> splitList = new ArrayList<>(); for (int bucketNumber = 0; bucketNumber < bucketCount; bucketNumber++) { if (bucketSplitInfo.isBucketEnabled(bucketNumber)) { LocatedFileStatus file = files.get(bucketNumber); splitFactory.createInternalHiveSplit(file, bucketNumber) .ifPresent(splitList::add); } } return splitList; }</code><technical_language>argument wrapping is wrong. style is wrap arguments none, arguments format() wrapped (the existing code is wrong fix changing it)</technical_language>

Target:
private List<InternalHiveSplit> getBucketedSplits(Path path, FileSystem fileSystem, InternalHiveSplitFactory splitFactory, BucketSplitInfo bucketSplitInfo) { int bucketCount = bucketSplitInfo.getBucketCount(); ArrayList<LocatedFileStatus> files = new ArrayList<>(bucketCount); try { Iterators.addAll(files, new HiveFileIterator(path, fileSystem, directoryLister, namenodeStats, FAIL)); } catch (NestedDirectoryNotAllowedException e) { throw new PrestoException( HIVE_INVALID_BUCKET_FILES, format("Hive table '%s' is corrupt. Found sub-directory in bucket directory for partition: %s", new SchemaTableName(table.getDatabaseName(), table.getTableName()), splitFactory.getPartitionName())); } if (files.size() != bucketCount) { throw new PrestoException( HIVE_INVALID_BUCKET_FILES, format("Hive table '%s' is corrupt. The number of files in the directory (%s) does not match the declared bucket count (%s) for partition: %s", new SchemaTableName(table.getDatabaseName(), table.getTableName()), files.size(), bucketCount, splitFactory.getPartitionName())); } files.sort(null); List<InternalHiveSplit> splitList = new ArrayList<>(); for (int bucketNumber = 0; bucketNumber < bucketCount; bucketNumber++) { if (bucketSplitInfo.isBucketEnabled(bucketNumber)) { LocatedFileStatus file = files.get(bucketNumber); splitFactory.createInternalHiveSplit(file, bucketNumber) .ifPresent(splitList::add); } } return splitList; }
Source:
<code>public void testUnmarshallTopLevelEmptyEventProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateMessageEventCatching emptyTopEvent = getCatchingIntermediateNodeById(diagram, EMPTY_TOP_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptyTopEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); <START> assertMessageEventExecutionSet(emptyTopEvent.getExecutionSet(), EMPTY_VALUE, CANCELLING, ""); <END> assertDataIOSet(emptyTopEvent.getDataIOSet(), EMPTY_VALUE); }</code><technical_language>suggestion assertMessageEventExecutionSet(emptyTopEvent.getExecutionSet(), EMPTY_VALUE, CANCELLING, EMPTY_VALUE);</technical_language>

Target:
public void testUnmarshallTopLevelEmptyEventProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateMessageEventCatching emptyTopEvent = getCatchingIntermediateNodeById(diagram, EMPTY_TOP_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptyTopEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertMessageEventExecutionSet(emptyTopEvent.getExecutionSet(), EMPTY_VALUE, CANCELLING, EMPTY_VALUE); assertDataIOSet(emptyTopEvent.getDataIOSet(), EMPTY_VALUE); }
Source:
<code>public void initWeights() { <START> InitMethod defaultMode = InitMethod.ZERO; <END> initWeight(defaultMode); }</code><technical_language>if is default, remote TODO</technical_language>

Target:
public void initWeights() { InitMethod defaultMode = InitMethod.ZERO_ONE_RANGE_RANDOM; initWeight(defaultMode); }
Source:
<code><START> public void testDistributedSQLForOnlyLOCAL_KEYIterationType() <END> throws InterruptedException { dsDistributedMap3.put(1, new User(1, "TestName1", "TestSurname1", 10)); dsDistributedMap3.put(2, new User(2, "TestName2", "TestSurname2", 20)); dsDistributedMap3.put(3, new User(3, "TestName3", "TestSurname3", 30)); Message<?> msg = null; for (int i = 0; i < 10; i++) { msg = dsMapChannel3.receive(); if (((Collection) msg.getPayload()).iterator().hasNext()) { break; } Thread.sleep(1_000); } Assert.assertNotNull(msg); Assert.assertNotNull(msg.getPayload()); Assert.assertTrue(msg.getPayload() instanceof Collection); Assert.assertEquals(2, ((Collection) msg.getPayload()).iterator().next()); }</code><technical_language>Duration pass 2.002s</technical_language>

Target:
public void testDistributedSQLForOnlyLOCAL_KEYIterationType() throws InterruptedException { dsDistributedMap3.put(1, new HazelcastIntegrationTestUser(1, "TestName1", "TestSurname1", 10)); dsDistributedMap3.put(2, new HazelcastIntegrationTestUser(2, "TestName2", "TestSurname2", 20)); dsDistributedMap3.put(3, new HazelcastIntegrationTestUser(3, "TestName3", "TestSurname3", 30)); Message<?> msg = dsMapChannel3.receive(2_000); Assert.assertNotNull(msg); Assert.assertNotNull(msg.getPayload()); Assert.assertTrue(msg.getPayload() instanceof Collection); Assert.assertEquals(2, ((Collection<?>) msg.getPayload()).iterator().next()); }
Source:
<code>protected void ExecuteVmCommand() { <START> if (getVm().getstatus() == VMStatus.Up) { <END> runVdsCommand(getParameters().getAction().getCommandType(), new HotPlugUnplgNicVDSParameters(getVm().getrun_on_vds().getValue(), getVm().getId(), DbFacade.getInstance().getVmNetworkInterfaceDAO().get(getParameters().getNicId()), vmDevice)); } TransactionSupport.executeInNewTransaction(updateDevice()); VmDeviceUtils.updateBootOrderInVmDevice(getVm().getStaticData()); setSucceeded(true); }</code><technical_language>vm status PoweringUp supported</technical_language>

Target:
protected void ExecuteVmCommand() { if (vmStatusDemandsHotPlugNic(getVm().getstatus())) { runVdsCommand(getParameters().getAction().getCommandType(), new HotPlugUnplgNicVDSParameters(getVm().getrun_on_vds().getValue(), getVm().getId(), DbFacade.getInstance().getVmNetworkInterfaceDAO().get(getParameters().getNicId()), vmDevice)); } TransactionSupport.executeInNewTransaction(updateDevice()); VmDeviceUtils.updateBootOrderInVmDevice(getVm().getStaticData()); setSucceeded(true); }
Source:
<code>public Response importDevice( @MultipartForm ImporterForm form, @Context HttpServletRequest request) { final Variant variant = loadVariantWhenAuthorized(request); if (variant == null) { return appendAllowOriginHeader( Response.status(Status.UNAUTHORIZED) .header("WWW-Authenticate", "Basic realm=\"AeroGear UnifiedPush Server\"") .entity("Unauthorized Request"), request); } List<Installation> devices = null; try { devices = mapper.readValue(form.getJsonFile(), new TypeReference<List<Installation>>() {}); } catch (IOException e) { logger.log(Level.SEVERE, "Error when parsing importer json file"); } <START> logger.log(Level.INFO, "Devices to import: " + devices.size()); <END> clientInstallationService.addInstallations(variant, devices); return Response.status(Status.OK) .entity("Job submitted for processing").build(); }</code><technical_language>if parsing fails line 261, null pointer happen devices.size() some code restructure is needed</technical_language>

Target:
public Response importDevice( @MultipartForm ImporterForm form, @Context HttpServletRequest request) { final Variant variant = loadVariantWhenAuthorized(request); if (variant == null) { return appendAllowOriginHeader( Response.status(Status.UNAUTHORIZED) .header("WWW-Authenticate", "Basic realm=\"AeroGear UnifiedPush Server\"") .entity("Unauthorized Request"), request); } List<Installation> devices; try { devices = mapper.readValue(form.getJsonFile(), new TypeReference<List<Installation>>() {}); } catch (IOException e) { logger.log(Level.SEVERE, "Error when parsing importer json file", e); return Response.status(Status.BAD_REQUEST).build(); } logger.log(Level.INFO, "Devices to import: " + devices.size()); clientInstallationService.addInstallations(variant, devices); return Response.status(Status.OK) .entity("Job submitted for processing").build(); }
Source:
<code>private Object onMutation(MutationRecord[] records) { for (MutationRecord r : records) { <START> System.out.println(r.target.nodeName + " " + r.attributeName + ": " + r.oldValue + " type: " + r.type); <END> Element element = Js.cast(r.target); for (Widget w : getChildren()) { if (w instanceof MaterialCollapsibleItem && element.equals(w.getElement())) { fireCollapsibleHandler((MaterialCollapsibleItem) w); break; } } } return null; }</code><technical_language>this removed :smile:</technical_language>

Target:
private Object onMutation(MutationRecord[] records) { for (MutationRecord r : records) { Element element = Js.cast(r.target); for (Widget w : getChildren()) { if (w instanceof MaterialCollapsibleItem && element.equals(w.getElement())) { fireCollapsibleHandler((MaterialCollapsibleItem) w); break; } } } return null; }
Source:
<code>public void updateDroneLeashPath(PathSource pathSource) { final BaiduMap map = getBaiduMap(); if (map == null) return; List<LatLong> pathCoords = pathSource.getPathPoints(); final List<LatLng> pathPoints = new ArrayList<LatLng>(pathCoords.size()); for (LatLong coord : pathCoords) { pathPoints.add(CoordToLatLang(coord)); } if (pathPoints.size() < 2) { if (mDroneLeashPath != null) { mDroneLeashPath.remove(); mDroneLeashPath = null; } return; } if (mDroneLeashPath == null) { PolylineOptions flightPath = new PolylineOptions(); flightPath.color(DRONE_LEASH_DEFAULT_COLOR).width( DroneHelper.scaleDpToPixels(DRONE_LEASH_DEFAULT_WIDTH, getResources())); <START> mDroneLeashPath = (Polyline)getBaiduMap().addOverlay(flightPath); <END> } else { mDroneLeashPath.setPoints(pathPoints); } }</code><technical_language>@droneboost forgot include points in pathPoints for this branch</technical_language>

Target:
public void updateDroneLeashPath(PathSource pathSource) { @PolyLineType int PolyLineType = LEASH_PATH; mDroneLeashPath = updatePath(mDroneLeashPath, pathSource, PolyLineType); }
Source:
<code>public void viewEvent() { LOG.debug("view-event: begin"); if (null == selectedEvent) { LOG.info("no event selected for view."); <START> HelperUtil.addMessageError(null, "You need to selected an event."); <END> return; } selectedEvent = service.getLogEvent(selectedEvent.getId()); if (StringUtils.isNotBlank(selectedEvent.getDescription())) { selectedEventJson = new JSONObject(selectedEvent.getDescription()); } HelperUtil.execPFShowDialog("wgvDlgViewEventErrorlog"); }</code><technical_language>Fix error message like, Select event view. is labeled event screen, Service exception? Replace event label</technical_language>

Target:
public void viewEvent() { if (null == selectedEvent) { return; } selectedEvent = service.getLogEvent(selectedEvent.getId()); if (StringUtils.isNotBlank(selectedEvent.getDescription())) { selectedEventJson = new JSONObject(selectedEvent.getDescription()); } HelperUtil.execPFShowDialog("wgvDlgViewEventErrorlog"); }
Source:
<code>private void handleFinishRollup(final FinishRollupMessage message) { _metrics.recordCounter("rollup/executor/finish_rollup_message/received", 1); _rollupManager.tell(message, getSelf()); final RollupDefinition defn = message.getRollupDefinition(); <START> if (shouldRequestConsistencyCheck(message)) { <END> requestConsistencyCheck(defn); } fetchRollup(); }</code><technical_language>This responsibility of RollupManager. a check for rollup failure in places</technical_language>

Target:
private void handleFinishRollup(final FinishRollupMessage message) { _metrics.recordCounter("rollup/executor/finish_rollup_message/received", 1); _rollupManager.tell(message, getSelf()); fetchRollup(); }
Source:
<code><START> public void shouldThrowException_whenUpdatingToInvalidState() throws Exception { <END> PaymentRequestEntity paymentRequestEntity = aValidPaymentRequestEntity() .withGatewayAccountEntity(gatewayAccount) .build(); paymentRequestDao.persist(paymentRequestEntity); paymentRequestDao.updateChargeTransactionStatus(paymentRequestEntity.getExternalId(), ChargeStatus.AUTHORISATION_READY); }</code><technical_language>nice if initial state explicitly, er, stated in this test</technical_language>

Target:
public void shouldThrowException_whenUpdatingToInvalidState() throws Exception { ChargeStatus initialStatus = ChargeStatus.CREATED; PaymentRequestEntity paymentRequestEntity = aValidPaymentRequestEntity() .withGatewayAccountEntity(gatewayAccount) .withTransactions(aChargeTransactionEntity().withStatus(initialStatus).build()) .build(); paymentRequestDao.persist(paymentRequestEntity); statusUpdater.updateChargeTransactionStatus(paymentRequestEntity.getExternalId(), ChargeStatus.AUTHORISATION_READY); }
Source:
<code><START> @Override <END> public Card getCard() { return null; }</code><technical_language>overridden this method dropped @Nullable annotation</technical_language>

Target:
@Override @Nullable public Card getCard() { return null; }
Source:
<code>public void testIPV6EncodeProxyV1() { HAProxyMessageEncoder encoder = new HAProxyMessageEncoder(); EmbeddedChannel ch = new EmbeddedChannel(encoder); HAProxyMessage message = new HAProxyMessage( HAProxyProtocolVersion.V1, HAProxyCommand.PROXY, HAProxyProxiedProtocol.TCP6, "2001:0db8:85a3:0000:0000:8a2e:0370:7334", "1050:0:0:0:5:600:300c:326b", 56324, 443); assertTrue(ch.writeOutbound(message)); ByteBuf byteBuf = ch.readOutbound(); assertEquals("PROXY TCP6 2001:0db8:85a3:0000:0000:8a2e:0370:7334 1050:0:0:0:5:600:300c:326b 56324 443\r\n", <START> byteBuf.toString(CharsetUtil.US_ASCII)); <END> }</code><technical_language>call byteBuf.release(); add assertFalse(ch.finish());</technical_language>

Target:
public void testIPV6EncodeProxyV1() { EmbeddedChannel ch = new EmbeddedChannel(INSTANCE); HAProxyMessage message = new HAProxyMessage( HAProxyProtocolVersion.V1, HAProxyCommand.PROXY, HAProxyProxiedProtocol.TCP6, "2001:0db8:85a3:0000:0000:8a2e:0370:7334", "1050:0:0:0:5:600:300c:326b", 56324, 443); assertTrue(ch.writeOutbound(message)); ByteBuf byteBuf = ch.readOutbound(); assertEquals("PROXY TCP6 2001:0db8:85a3:0000:0000:8a2e:0370:7334 1050:0:0:0:5:600:300c:326b 56324 443\r\n", byteBuf.toString(CharsetUtil.US_ASCII)); byteBuf.release(); assertFalse(ch.finish()); }