auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void readDataSource() { tableModel = new DataSourceTableModel(tableEditableElement); table.setModel(tableModel); table.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF); autoResizeColWidth(Math.min(5, tableModel.getRowCount()), new HashMap<String, Integer>(), <START> new HashMap<String, TableCellRenderer>()); <END> tableSorter = new DataSourceRowSorter(tableModel); tableSorter.addRowSorterListener( EventHandler.create(RowSorterListener.class,this, "onShownRowsChanged")); table.setRowSorter(tableSorter); tableRowHeader = new TableRowHeader(table); tableScrollPane.setRowHeaderView(tableRowHeader); setRowSelection((IntegerUnion)tableEditableElement.getSelection()); table.getSelectionModel().addListSelectionListener( EventHandler.create(ListSelectionListener.class,this, "onTableSelectionChange","")); add(makeFilterManager(),BorderLayout.SOUTH); dockingPanelParameters.addPropertyChangeListener( DockingPanelParameters.PROP_VISIBLE, EventHandler.create(PropertyChangeListener.class, this,"onChangeVisibility","newValue")); updateTitle(); tableEditableElement.addPropertyChangeListener(TableEditableElement.PROP_SELECTION, editableSelectionListener); }</code><technical_language>Please indent this a bit better, hard read : I thought calls, there"s one</technical_language>

Target:
private void readDataSource() { tableModel = new DataSourceTableModel(tableEditableElement); table.setModel(tableModel); table.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF); quickAutoResize(); tableSorter = new DataSourceRowSorter(tableModel); tableSorter.addRowSorterListener( EventHandler.create(RowSorterListener.class,this, "onShownRowsChanged")); table.setRowSorter(tableSorter); tableRowHeader = new TableRowHeader(table); tableScrollPane.setRowHeaderView(tableRowHeader); setRowSelection((IntegerUnion)tableEditableElement.getSelection()); table.getSelectionModel().addListSelectionListener( EventHandler.create(ListSelectionListener.class,this, "onTableSelectionChange","")); add(makeFilterManager(),BorderLayout.SOUTH); dockingPanelParameters.addPropertyChangeListener( DockingPanelParameters.PROP_VISIBLE, EventHandler.create(PropertyChangeListener.class, this,"onChangeVisibility","newValue")); updateTitle(); tableEditableElement.addPropertyChangeListener(TableEditableElement.PROP_SELECTION, editableSelectionListener); }
Source:
<code><START> protected String buildTooltipText() { <END> String tooltipText = null; StringBuilder sb = new StringBuilder(); if (!getCommand().getExecuteProhibitionReasons().isEmpty()) { for (String reason : getCommand().getExecuteProhibitionReasons()) { sb.append(reason).append(", "); } tooltipText = sb.toString(); if (tooltipText.length() != 0) { tooltipText = tooltipText.substring(0, tooltipText.length() -2); } } return tooltipText; }</code><technical_language>this read better? String tooltipText = null; if (!getCommand().getExecuteProhibitionReasons().isEmpty()) { tooltipText = ""; for (String reason: getCommand().getExecuteProhibitionReasons()) { if (!tooltipText.isEmpty()) { tooltipText += ", "; } tooltipText += reason; } } return tooltipText;</technical_language>

Target:
protected String buildTooltipText() { String tooltipText = null; if (!getCommand().getExecuteProhibitionReasons().isEmpty()) { tooltipText = ""; for (String reason: getCommand().getExecuteProhibitionReasons()) { if (!tooltipText.isEmpty()) { tooltipText += ", "; } tooltipText += reason; } } return tooltipText; }
Source:
<code>private RecordCursorFactory generateSelectDistinct(QueryModel model, SqlExecutionContext executionContext) throws SqlException { <START> final RecordCursorFactory factory = generateSubQuery(model, executionContext); <END> try { if (model.getColumns().size() == 1 && model.getNestedModel() != null && model.getNestedModel().getNestedModel() != null && model.getNestedModel().getNestedModel().getTableName() != null) { ExpressionNode tableName = model.getNestedModel().getNestedModel().getTableName(); TableReader reader = engine.getReader(executionContext.getCairoSecurityContext(), tableName.token); CharSequence columnName = model.getColumnNames().get(0); int columnIndex = reader.getMetadata().getColumnIndex(columnName); int columnType = reader.getMetadata().getColumnType(columnIndex); if (columnType == ColumnType.SYMBOL) { return new DistinctSymbolRecordCursorFactory( factory, entityColumnFilter, reader, columnName ); } } return new DistinctRecordCursorFactory( configuration, factory, entityColumnFilter, asm ); } catch (CairoException e) { factory.close(); throw e; } }</code><technical_language>this factory need creating if condition is met</technical_language>

Target:
private RecordCursorFactory generateSelectDistinct(QueryModel model, SqlExecutionContext executionContext) throws SqlException { if (model.getColumns().size() == 1 && model.getNestedModel() != null && model.getNestedModel().getNestedModel() != null && model.getNestedModel().getNestedModel().getTableName() != null) { ExpressionNode tableNameExpressionNode = model.getNestedModel().getNestedModel().getTableName(); CharSequence tableName = tableNameExpressionNode.token; try (TableReader reader = engine.getReader(executionContext.getCairoSecurityContext(), tableName);) { CharSequence columnName = model.getColumnNames().get(0); TableReaderMetadata readerMetadata = (TableReaderMetadata) reader.getMetadata(); int columnIndex = readerMetadata.getColumnIndex(columnName); int columnType = readerMetadata.getColumnType(columnIndex); if (readerMetadata.getVersion() >= 416 && columnType == ColumnType.SYMBOL) { final GenericRecordMetadata distinctSymbolMetadata = new GenericRecordMetadata(); long tableVersion = reader.getVersion(); distinctSymbolMetadata.add( new TableColumnMetadata( Chars.toString(columnName), readerMetadata.getColumnType(columnIndex), readerMetadata.isColumnIndexed(columnIndex), readerMetadata.getIndexValueBlockCapacity(columnIndex), readerMetadata.isSymbolTableStatic(columnIndex) ) ); return new DistinctSymbolRecordCursorFactory( engine, distinctSymbolMetadata, Chars.toString(tableName), columnIndex, tableVersion ); } } } final RecordCursorFactory factory = generateSubQuery(model, executionContext); try { return new DistinctRecordCursorFactory( configuration, factory, entityColumnFilter, asm ); } catch (CairoException e) { factory.close(); throw e; } }
Source:
<code>public void testGenerateSessionFromRequirements() { IPath sessionFolderPath = Activator.getDefault().getStateLocation(); IPath sessionFilePath = sessionFolderPath.addTrailingSeparator().append(SESSION_FILENAME).addFileExtension(SessionConfigStrings.DEFAULT_SESSION_CONFIG_FILE_EXTENSION); IStatus invalidStatusA = SessionConfigXML.generateSessionConfigFromRequirements(sessionFilePath, fInvalidRequirementsA); assertTrue(invalidStatusA.getSeverity() == IStatus.ERROR); IStatus invalidStatusB = SessionConfigXML.generateSessionConfigFromRequirements(sessionFilePath, fInvalidRequirementsB); assertTrue(invalidStatusB.getSeverity() == IStatus.ERROR); IStatus invalidStatusC = SessionConfigXML.generateSessionConfigFromRequirements(sessionFilePath, fInvalidRequirementsC); assertTrue(invalidStatusC.getSeverity() == IStatus.ERROR); IStatus validStatus = SessionConfigXML.generateSessionConfigFromRequirements(sessionFilePath, fValidRequirements); assertTrue(validStatus.isOK()); File sessionXMLFile = sessionFilePath.toFile(); URL url = SessionConfigXMLTest.class.getResource(SESSION_XSD_FILENAME); SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); Source xmlSource = new StreamSource(sessionXMLFile); try { Schema schema = schemaFactory.newSchema(url); Validator validator = schema.newValidator(); validator.validate(xmlSource); <START> } catch (Exception e) { <END> fail("The validation of the session configuration file has failed: " + e.getMessage()); } }</code><technical_language>catch Exception hide some other legitimate exception. catch is thrown called methods. XML parser exceptions. java 7 multi-catch catch (Exception1 | Exception2 | Exception3 e)</technical_language>

Target:
public void testGenerateSessionFromRequirements() { IPath sessionFolderPath = Activator.getDefault().getStateLocation(); IPath sessionFilePath = sessionFolderPath.addTrailingSeparator().append(SESSION_FILENAME).addFileExtension(SessionConfigStrings.DEFAULT_SESSION_CONFIG_FILE_EXTENSION); final List<TmfAnalysisRequirement> invalidRequirements = new ArrayList<>(); invalidRequirements.add(fInvalidRequirementType); IStatus invalidStatusA = SessionConfigXML.generateSessionConfigFromRequirements(sessionFilePath, invalidRequirements); assertTrue(invalidStatusA.getSeverity() == IStatus.ERROR); invalidRequirements.clear(); invalidRequirements.add(fValidRequirementEventA); invalidRequirements.add(fValidRequirementEventB); IStatus invalidStatusB = SessionConfigXML.generateSessionConfigFromRequirements(sessionFilePath, invalidRequirements); assertTrue(invalidStatusB.getSeverity() == IStatus.ERROR); invalidRequirements.clear(); invalidRequirements.add(fValidRequirementDomain); IStatus invalidStatusC = SessionConfigXML.generateSessionConfigFromRequirements(sessionFilePath, invalidRequirements); assertTrue(invalidStatusC.getSeverity() == IStatus.ERROR); IStatus validStatus = SessionConfigXML.generateSessionConfigFromRequirements(sessionFilePath, fValidRequirements); assertTrue(validStatus.isOK()); File sessionXMLFile = sessionFilePath.toFile(); assertTrue(SessionConfigXML.sessionValidate(sessionXMLFile).isOK()); }
Source:
<code>public double modify(double inputSpeed) { currentSpeed = calculate(inputSpeed); <START> LogKitten.w("AccelerationCap outputed: " + currentSpeed); <END> return currentSpeed; }</code><technical_language>is this a warn? spelling</technical_language>

Target:
public double modify(double inputSpeed) { currentSpeed = calculate(inputSpeed); LogKitten.d("AccelerationCap outputed: " + currentSpeed); return currentSpeed; }
Source:
<code>public ECGDataQuality(DataStreams datastreams, double qualityThreshold) { DataPointStream ecg = datastreams.getDataPointStream(StreamConstants.ORG_MD2K_CSTRESS_DATA_ECG); DataPointStream ecgQuality = datastreams.getDataPointStream(StreamConstants.ORG_MD2K_CSTRESS_DATA_ECG_QUALITY); <START> this.acceptableOutlierPercent = AUTOSENSE.QUALITY_acceptableOutlierPercent; <END> this.outlierThresholdHigh = AUTOSENSE.QUALITY_outlierThresholdHigh; this.outlierThresholdLow = AUTOSENSE.QUALITY_outlierThresholdLow; this.ecgThresholdBandLoose = AUTOSENSE.QUALITY_ecgThresholdBandLoose; this.bufferLength = AUTOSENSE.QUALITY_bufferLength; envelBuff = new int[bufferLength]; classBuff = new int[bufferLength]; for (int i = 0; i < bufferLength; i++) { envelBuff[i] = 2 * ecgThresholdBandLoose; classBuff[i] = 0; } envelHead = 0; classHead = 0; List<DataPoint> quality = computeQuality(ecg.data, AUTOSENSE.QUALITY_windowSize); double count = 0; for (DataPoint dp : quality) { ecgQuality.add(dp); if (dp.value == AUTOSENSE.QUALITY_GOOD) { count++; } } DataPointStream ecgWindowQuality = datastreams.getDataPointStream(StreamConstants.ORG_MD2K_CSTRESS_DATA_ECG_WINDOW_QUALITY); if ((count / quality.size()) > qualityThreshold) ecgWindowQuality.add(new DataPoint(quality.get(0).timestamp, AUTOSENSE.QUALITY_GOOD)); else ecgWindowQuality.add(new DataPoint(quality.get(0).timestamp, AUTOSENSE.QUALITY_BAD)); }</code><technical_language>Refactor call constants needed. is need introduce additional variables do this</technical_language>

Target:
public ECGDataQuality(DataStreams datastreams, double qualityThreshold) { this(datastreams, qualityThreshold, AUTOSENSE.QUALITY_acceptableOutlierPercent, AUTOSENSE.QUALITY_outlierThresholdHigh, AUTOSENSE.QUALITY_outlierThresholdLow, AUTOSENSE.QUALITY_ecgThresholdBandLoose, AUTOSENSE.QUALITY_bufferLength, AUTOSENSE.QUALITY_windowSizeEcg); }
Source:
<code>public void stop(IMethodEnvironmentData data){ try { CamelContext context = getOrMakeContextByRid(getDocument().getIdentity().toString(),data.getCurrentWidget()); try { context.stop(); } catch (Exception e) { <START> e.printStackTrace(); <END> } } catch (Exception e) { e.printStackTrace(); } }</code><technical_language>Serious</technical_language>

Target:
public void stop(IMethodEnvironmentData data){ CamelContext context = getOrMakeContextByRid(getDocument().getIdentity().toString(),data.getCurrentWidget()); try { context.stop(); } catch (Exception e) { LOG.error("Cannot stop Camel Context",e); } waitingRefresh(context); }
Source:
<code>public void populateDatastreamDestination(List<Datastream> datastreams) { <START> HashMap<String, String> sourceDestinationMapping = new HashMap<>(); <END> datastreams.stream().filter(d -> !d.getDestination().isEmpty()) .forEach(d -> sourceDestinationMapping.put(d.getSource(), d.getDestination())); datastreams.stream().filter(d -> d.getDestination().isEmpty() && sourceDestinationMapping.containsKey(d.getSource())) .forEach(d -> d.setDestination(sourceDestinationMapping.get(d.getSource()))); datastreams.stream().filter(d -> d.getDestination().isEmpty()) .forEach(d -> { if (sourceDestinationMapping.containsKey(d.getSource())) { d.setDestination(sourceDestinationMapping.get(d.getSource())); } else { String destination = createTopic(d); sourceDestinationMapping.put(d.getSource(), destination); d.setDestination(destination); } }); }</code><technical_language>argument validation</technical_language>

Target:
public void populateDatastreamDestination(List<Datastream> datastreams) { Objects.requireNonNull(datastreams, "Datastream should not be null"); HashMap<String, String> sourceDestinationMapping = new HashMap<>(); datastreams.stream().filter(d -> !d.getDestination().isEmpty()) .forEach(d -> sourceDestinationMapping.put(d.getSource(), d.getDestination())); LOG.debug("Datastream Source -> Destination mapping before populating new datastream destinations", sourceDestinationMapping); for (Datastream datastream : datastreams) { if (!datastream.getDestination().isEmpty()) { continue; } if (sourceDestinationMapping.containsKey(datastream.getSource())) { String destination = sourceDestinationMapping.get(datastream.getSource()); LOG.info(String.format("Datastream %s has same source as existing datastream, Setting the destination %s", datastream.getName(), destination)); datastream.setDestination(destination); } else { String destination = createTopic(datastream); LOG.info(String .format("Datastream %s has an unique source, Creating a new destination topic %s", datastream.getName(), destination)); sourceDestinationMapping.put(datastream.getSource(), destination); datastream.setDestination(destination); } } LOG.debug("Datastream Source -> Destination mapping after the populating new datastream destinations", sourceDestinationMapping); }
Source:
<code>public HttpClient get() { KerberosConfig kerberosConfig = injector.getInstance(KerberosConfig.class); HttpClientConfig config = injector.getInstance(Key.get(HttpClientConfig.class, annotation)); Set<HttpRequestFilter> filters = ImmutableSet.<HttpRequestFilter>builder() .addAll(injector.getInstance(Key.get(new TypeLiteral<Set<HttpRequestFilter>>() {}, GlobalFilter.class))) .addAll(injector.getInstance(Key.get(new TypeLiteral<Set<HttpRequestFilter>>() {}, annotation))) .build(); <START> verify(injector.getExistingBinding(Key.get(JettyIoPoolManager.class, annotation)) != null, "binding should exist"); <END> JettyIoPoolManager ioPoolProvider = injector.getInstance(Key.get(JettyIoPoolManager.class, annotation)); JettyHttpClient client = new JettyHttpClient(config, kerberosConfig, Optional.of(ioPoolProvider.get()), ImmutableList.copyOf(filters)); ioPoolProvider.addClient(client); return client; }</code><technical_language>This check needed anymore. exists bound time created this provider. Previously, this detect private/shared</technical_language>

Target:
public HttpClient get() { KerberosConfig kerberosConfig = injector.getInstance(KerberosConfig.class); HttpClientConfig config = injector.getInstance(Key.get(HttpClientConfig.class, annotation)); Set<HttpRequestFilter> filters = ImmutableSet.<HttpRequestFilter>builder() .addAll(injector.getInstance(Key.get(new TypeLiteral<Set<HttpRequestFilter>>() {}, GlobalFilter.class))) .addAll(injector.getInstance(Key.get(new TypeLiteral<Set<HttpRequestFilter>>() {}, annotation))) .build(); JettyIoPoolManager ioPoolProvider = injector.getInstance(Key.get(JettyIoPoolManager.class, annotation)); JettyHttpClient client = new JettyHttpClient(config, kerberosConfig, Optional.of(ioPoolProvider.get()), ImmutableList.copyOf(filters)); ioPoolProvider.setClient(client); return client; }
Source:
<code>public void testFailedRun() { final MockExecutorLoader loader = new MockExecutorLoader(); final EventCollectorListener eventCollector = new EventCollectorListener(); final JobRunner runner = createJobRunner(1, "testJob", 0, true, loader, eventCollector); final ExecutableNode node = runner.getNode(); Assert.assertTrue(runner.getStatus() != Status.SUCCEEDED || runner.getStatus() != Status.FAILED); runner.run(); Assert.assertTrue(runner.getStatus() == node.getStatus()); Assert.assertTrue(node.getStatus() == Status.FAILED); Assert.assertTrue(node.getStartTime() > 0 && node.getEndTime() >= 0); Assert.assertTrue(node.getEndTime() - node.getStartTime() >= 0); final File logFile = new File(runner.getLogFilePath()); final Props outputProps = runner.getNode().getOutputProps(); <START> Assert.assertTrue(outputProps.toProperties().isEmpty()); <END> Assert.assertTrue(logFile.exists()); Assert.assertTrue(eventCollector.checkOrdering()); Assert.assertTrue(!runner.isKilled()); Assert.assertTrue(loader.getNodeUpdateCount(node.getId()) == 3); eventCollector .assertEvents(EventType.JOB_STARTED, EventType.JOB_STATUS_CHANGED, EventType.JOB_FINISHED); }</code><technical_language>azkaban/utils/Props.java#size toProperties</technical_language>

Target:
public void testFailedRun() { final MockExecutorLoader loader = new MockExecutorLoader(); final EventCollectorListener eventCollector = new EventCollectorListener(); final JobRunner runner = createJobRunner(1, "testJob", 0, true, loader, eventCollector); final ExecutableNode node = runner.getNode(); Assert.assertTrue(runner.getStatus() != Status.SUCCEEDED || runner.getStatus() != Status.FAILED); runner.run(); Assert.assertTrue(runner.getStatus() == node.getStatus()); Assert.assertTrue(node.getStatus() == Status.FAILED); Assert.assertTrue(node.getStartTime() > 0 && node.getEndTime() >= 0); final File logFile = new File(runner.getLogFilePath()); final Props outputProps = runner.getNode().getOutputProps(); Assert.assertEquals(0, outputProps.size()); Assert.assertTrue(logFile.exists()); Assert.assertTrue(eventCollector.checkOrdering()); Assert.assertTrue(!runner.isKilled()); Assert.assertTrue(loader.getNodeUpdateCount(node.getId()) == 3); eventCollector .assertEvents(EventType.JOB_STARTED, EventType.JOB_STATUS_CHANGED, EventType.JOB_FINISHED); }
Source:
<code>private static String fetchLatestStableChromeDriverVersion() { String version = null; try { URL url = new URL(CHROME_DRIVER_LATEST_RELEASE_URL); URLConnection urlConnection = url.openConnection(); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(urlConnection.getInputStream())); StringBuilder content = new StringBuilder(); content.append(bufferedReader.readLine()); bufferedReader.close(); version = content.toString(); logger.info("Latest Chrome Driver Release found: " + version); <START> } catch(Exception exception){ <END> logger.error("Failed to fetch latest Chrome Driver Release"); } return version; }</code><technical_language>Is possibility some more specific exception ot catch all</technical_language>

Target:
private static String fetchLatestStableChromeDriverVersion() { String version = ""; try { URL url = new URL(CHROME_DRIVER_LATEST_RELEASE_URL); URLConnection urlConnection = url.openConnection(); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(urlConnection.getInputStream())); StringBuilder content = new StringBuilder(); content.append(bufferedReader.readLine()); bufferedReader.close(); version = content.toString(); logger.info("Latest Chrome Driver Release found: " + version); } catch (MalformedURLException exception) { logger.error("URL for fetching Chrome Release is malformed."); } catch (IOException exception) { logger.error("Failed to fetch latest Chrome Driver Release"); } return version; }
Source:
<code>public static List<DiffEntry> scan(TreeWalk walk, boolean includeTrees) throws IOException { if (includeTrees && walk.isRecursive()) <START> throw new IllegalAccessError( <END> JGitText.get().cannotBeRecursiveWhenTreesAreIncluded); List<DiffEntry> r = new ArrayList<DiffEntry>(); MutableObjectId idBuf = new MutableObjectId(); while (walk.next()) { DiffEntry entry = new DiffEntry(); walk.getObjectId(idBuf, 0); entry.oldId = AbbreviatedObjectId.fromObjectId(idBuf); walk.getObjectId(idBuf, 1); entry.newId = AbbreviatedObjectId.fromObjectId(idBuf); entry.oldMode = walk.getFileMode(0); entry.newMode = walk.getFileMode(1); entry.newPath = entry.oldPath = walk.getPathString(); if (entry.oldMode == FileMode.MISSING) { entry.oldPath = DiffEntry.DEV_NULL; entry.changeType = ChangeType.ADD; r.add(entry); } else if (entry.newMode == FileMode.MISSING) { entry.newPath = DiffEntry.DEV_NULL; entry.changeType = ChangeType.DELETE; r.add(entry); } else { entry.changeType = ChangeType.MODIFY; if (RenameDetector.sameType(entry.oldMode, entry.newMode)) r.add(entry); else r.addAll(breakModify(entry)); } if (includeTrees && walk.isSubtree()) walk.enterSubtree(); } return r; }</code><technical_language>I meant IllegalAccessError</technical_language>

Target:
public static List<DiffEntry> scan(TreeWalk walk, boolean includeTrees) throws IOException { if (includeTrees && walk.isRecursive()) throw new IllegalArgumentException( JGitText.get().cannotBeRecursiveWhenTreesAreIncluded); List<DiffEntry> r = new ArrayList<DiffEntry>(); MutableObjectId idBuf = new MutableObjectId(); while (walk.next()) { DiffEntry entry = new DiffEntry(); walk.getObjectId(idBuf, 0); entry.oldId = AbbreviatedObjectId.fromObjectId(idBuf); walk.getObjectId(idBuf, 1); entry.newId = AbbreviatedObjectId.fromObjectId(idBuf); entry.oldMode = walk.getFileMode(0); entry.newMode = walk.getFileMode(1); entry.newPath = entry.oldPath = walk.getPathString(); if (entry.oldMode == FileMode.MISSING) { entry.oldPath = DiffEntry.DEV_NULL; entry.changeType = ChangeType.ADD; r.add(entry); } else if (entry.newMode == FileMode.MISSING) { entry.newPath = DiffEntry.DEV_NULL; entry.changeType = ChangeType.DELETE; r.add(entry); } else { entry.changeType = ChangeType.MODIFY; if (RenameDetector.sameType(entry.oldMode, entry.newMode)) r.add(entry); else r.addAll(breakModify(entry)); } if (includeTrees && walk.isSubtree()) walk.enterSubtree(); } return r; }
Source:
<code>public void onPartitionsRevoked(Collection<TopicPartition> topicPartitions) { _logger.info("Partition ownership revoked for {}, checkpointing.", topicPartitions); if (!_shutdown && !topicPartitions.isEmpty()) { try { maybeCommitOffsets(_consumer, true); } catch (Exception e) { _logger.warn("Caught exception while trying to commit offsets in onPartitionsRevoked with partitions {}.", topicPartitions, e); } } <START> synchronized (_consumerAssignment) { <END> _consumerAssignment.clear(); _consumerAssignment.addAll(_consumer.assignment()); } _logger.info("Current assignment is {}", _consumerAssignment); _kafkaPositionTrackerTask.retainAll(_consumerAssignment); _taskUpdates.add(DatastreamConstants.UpdateType.PAUSE_RESUME_PARTITIONS); }</code><technical_language>I need wrap in synchronized {}. onPartitionsRevoked onPartitionsAssigned called simultaneously threads</technical_language>

Target:
public void onPartitionsRevoked(Collection<TopicPartition> topicPartitions) { _logger.info("Partition ownership revoked for {}, checkpointing.", topicPartitions); if (!_shutdown && !topicPartitions.isEmpty()) { try { maybeCommitOffsets(_consumer, true); } catch (Exception e) { _logger.warn("Caught exception while trying to commit offsets in onPartitionsRevoked with partitions {}.", topicPartitions, e); } } _consumerAssignment.clear(); _consumerAssignment.addAll(_consumer.assignment()); _logger.info("Current assignment is {}", _consumerAssignment); _kafkaPositionTracker.retainAll(_consumerAssignment); _taskUpdates.add(DatastreamConstants.UpdateType.PAUSE_RESUME_PARTITIONS); }
Source:
<code>private List<Pair<Guid, Boolean>> <START> disconnectOrConnectHostsInUpToDomainStorageServer(ActionType actionType) <END> { List<VDS> hostsInStatusUp = getAllRunningVdssInPool(); List<Callable<Pair<Guid, Boolean>>> callables = new LinkedList<>(); for (final VDS vds : hostsInStatusUp) { callables.add(() -> { Pair<Guid, Boolean> toReturn = new Pair<>(vds.getId(), Boolean.FALSE); try { boolean connectResult = false; switch (actionType) { case CONNECT: connectResult = StorageHelperDirector.getInstance().getItem(getStorageDomain().getStorageType()) .connectStorageToDomainByVdsId(getStorageDomain(), vds.getId()); break; case DISCONNECT: connectResult = StorageHelperDirector.getInstance().getItem(getStorageDomain().getStorageType()) .disconnectStorageFromDomainByVdsId(getStorageDomain(), vds.getId()); } toReturn.setSecond(connectResult); } catch (RuntimeException e) { log.error("Failed to host '{}' to storage domain (name '{}', id '{}'): {}", actionType.actionDescription, vds.getName(), getStorageDomain().getName(), getStorageDomain().getId(), e.getMessage()); log.debug("Exception", e); } return toReturn; }); } return ThreadPoolUtil.invokeAll(callables); }</code><technical_language>do need enum here? a flag enough? is other action types add on</technical_language>

Target:
private List<Pair<Guid, Boolean>> disconnectOrConnectHostsInUpToDomainStorageServer(ActionType actionType) { List<VDS> hostsInStatusUp = getAllRunningVdssInPool(); List<Callable<Pair<Guid, Boolean>>> callables = new LinkedList<>(); for (final VDS vds : hostsInStatusUp) { callables.add(() -> { Pair<Guid, Boolean> toReturn = new Pair<>(vds.getId(), Boolean.FALSE); try { boolean connectResult = false; switch (actionType) { case CONNECT: connectResult = StorageHelperDirector.getInstance().getItem(getStorageDomain().getStorageType()) .connectStorageToDomainByVdsId(getStorageDomain(), vds.getId()); break; case DISCONNECT: connectResult = StorageHelperDirector.getInstance().getItem(getStorageDomain().getStorageType()) .disconnectStorageFromDomainByVdsId(getStorageDomain(), vds.getId()); break; } toReturn.setSecond(connectResult); } catch (RuntimeException e) { log.error("Failed to host '{}' to storage domain (name '{}', id '{}'): {}", actionType.actionDescription, vds.getName(), getStorageDomain().getName(), getStorageDomain().getId(), e.getMessage()); log.debug("Exception", e); } return toReturn; }); } return ThreadPoolUtil.invokeAll(callables); }
Source:
<code>private void DiskInterface_SelectedItemChanged() { boolean isLunDisk = getDiskStorageType().getEntity() == DiskStorageType.LUN; DiskInterface diskInterface = getDiskInterface().getSelectedItem(); getIsSgIoUnfiltered().setIsAvailable(isLunDisk && DiskInterface.VirtIO_SCSI.equals(diskInterface)); getIsScsiPassthrough().setIsAvailable(isLunDisk && DiskInterface.VirtIO_SCSI.equals(diskInterface)); getIsUsingScsiReservation().setIsAvailable(isLunDisk && DiskInterface.VirtIO_SCSI.equals(diskInterface)); updateScsiPassthroguhChangeability(); <START> changeScsiReservationChangeability(); <END> updateReadOnlyChangeability(); updatePlugChangeability(); }</code><technical_language>NIT: consistency call 'update'</technical_language>

Target:
private void DiskInterface_SelectedItemChanged() { boolean isLunDisk = getDiskStorageType().getEntity() == DiskStorageType.LUN; DiskInterface diskInterface = getDiskInterface().getSelectedItem(); getIsSgIoUnfiltered().setIsAvailable(isLunDisk && DiskInterface.VirtIO_SCSI.equals(diskInterface)); getIsScsiPassthrough().setIsAvailable(isLunDisk && DiskInterface.VirtIO_SCSI.equals(diskInterface)); getIsUsingScsiReservation().setIsAvailable(isLunDisk && DiskInterface.VirtIO_SCSI.equals(diskInterface)); updateScsiPassthroguhChangeability(); updateScsiReservationChangeability(); updateReadOnlyChangeability(); updatePlugChangeability(); }
Source:
<code>public double pidGet() { <START> switch (pidSource) { <END> case kRate: return getRate(); case kDisplacement: default: return getDistance(); } }</code><technical_language>Is a switch statement necessary? PIDSourceType is enum</technical_language>

Target:
public double pidGet() { if (pidSource == PIDSourceType.kDisplacement) { return getDistance(); } return getRate(); }
Source:
<code>private void getImageChildren(Guid snapshot, List<DiskImage> children) { List<DiskImage> snapshots = <START> diskImageDao.getAllSnapshotsForParent(snapshot).stream() .collect(Collectors.toList()); <END> children.addAll(snapshots); snapshots.forEach(s -> getImageChildren(s.getId(), children)); }</code><technical_language>I this is redundant, receive a list of disk images, add children list</technical_language>

Target:
private void getImageChildren(Guid snapshot, List<DiskImage> children) { List<DiskImage> snapshots = diskImageDao.getAllSnapshotsForParent(snapshot); children.addAll(snapshots); snapshots.forEach(s -> getImageChildren(s.getId(), children)); }
Source:
<code>private void applyHttp1xConnectionOptions(ChannelPipeline pipeline) { if (options.getIdleTimeout() > 0) { pipeline.addLast("idle", new IdleStateHandler(0, 0, options.getIdleTimeout(), options.getIdleTimeoutUnit())); } if (options.getLogActivity()) { pipeline.addLast("logging", new LoggingHandler()); } pipeline.addLast("codec", new HttpClientCodec( options.getMaxInitialLineLength(), options.getMaxHeaderSize(), options.getMaxChunkSize(), false, false, options.getDecoderInitialBufferSize())); if (options.isTryUseCompression()) { <START> pipeline.addLast("inflater", new HttpContentDecompressor()); <END> } }</code><technical_language>false instead explicit rely default constructor</technical_language>

Target:
private void applyHttp1xConnectionOptions(ChannelPipeline pipeline) { if (options.getIdleTimeout() > 0) { pipeline.addLast("idle", new IdleStateHandler(0, 0, options.getIdleTimeout(), options.getIdleTimeoutUnit())); } if (options.getLogActivity()) { pipeline.addLast("logging", new LoggingHandler()); } pipeline.addLast("codec", new HttpClientCodec( options.getMaxInitialLineLength(), options.getMaxHeaderSize(), options.getMaxChunkSize(), false, false, options.getDecoderInitialBufferSize())); if (options.isTryUseCompression()) { pipeline.addLast("inflater", new HttpContentDecompressor(false)); } }
Source:
<code>public void channelRead0(ChannelHandlerContext ctx, Batch batch) throws Exception { if(logger.isDebugEnabled()) { <START> logger.debug(format("XXXXXXXReceived a new payload")); <END> } ctx.channel().attr(PROCESSING_BATCH).set(true); for(Message message : batch.getMessages()) { if(logger.isDebugEnabled()) { logger.debug(format("Sending a new message for the listener, sequence: " + message.getSequence())); } messageListener.onNewMessage(ctx, message); if(needAck(message)) { ack(ctx, message); } } ctx.flush(); ctx.channel().attr(PROCESSING_BATCH).set(false); }</code><technical_language>Another left laptop? ;)</technical_language>

Target:
public void channelRead0(ChannelHandlerContext ctx, Batch batch) throws Exception { if(logger.isDebugEnabled()) { logger.debug(format("Received a new payload")); } ctx.channel().attr(PROCESSING_BATCH).set(true); for(Message message : batch.getMessages()) { if(logger.isDebugEnabled()) { logger.debug(format("Sending a new message for the listener, sequence: " + message.getSequence())); } messageListener.onNewMessage(ctx, message); if(needAck(message)) { ack(ctx, message); } } ctx.flush(); ctx.channel().attr(PROCESSING_BATCH).set(false); }
Source:
<code><START> private static GoStructType getLiteralStructType(@Nullable GoLiteralValue literalValue) { <END> GoCompositeLit parentLit = GoPsiTreeUtil.getDirectParentOfType(literalValue, GoCompositeLit.class); if (parentLit != null && !isStructLit(parentLit)) return null; GoStructType litType = ObjectUtils.tryCast(GoPsiImplUtil.getLiteralType(literalValue, parentLit == null), GoStructType.class); String definitionName = getFieldDefinitionName(GoPsiTreeUtil.getDirectParentOfType(literalValue, GoValue.class)); return definitionName != null && litType != null ? getFieldDefinitionType(litType, definitionName) : litType; }</code><technical_language>this example is invalid type S struct { r, t int } type B struct{ S } var _ = []B{ S: {2, 3}}</technical_language>

Target:
private static GoStructType getLiteralStructType(@Nullable GoLiteralValue literalValue) { GoCompositeLit parentLit = GoPsiTreeUtil.getDirectParentOfType(literalValue, GoCompositeLit.class); if (parentLit != null && !isStructLit(parentLit)) return null; GoStructType litType = ObjectUtils.tryCast(GoPsiImplUtil.getLiteralType(literalValue, parentLit == null), GoStructType.class); GoNamedElement definition = getFieldDefinition(GoPsiTreeUtil.getDirectParentOfType(literalValue, GoValue.class)); return definition != null && litType != null ? getUnderlyingStructType(definition.getGoType(null)) : litType; }
Source:
<code>public void setDeviceLifecycleStatus(final String organisationIdentification, final String deviceIdentification, final String correlationUid, final DeviceLifecycleStatus deviceLifecycleStatus) throws FunctionalException { LOGGER.debug( "SetDeviceLifecycleStatus called with organisation {}, deviceLifecycleStatus and deviceIdentification {}", organisationIdentification, deviceLifecycleStatus.name(), deviceIdentification); this.findOrganisation(organisationIdentification); final Device device = this.deviceDomainService.searchDevice(deviceIdentification); device.setDeviceLifecycleStatus(deviceLifecycleStatus); this.deviceDomainService.saveDevice(device); final ResponseMessageResultType result = ResponseMessageResultType.OK; <START> this.webServiceResponseMessageSender.send(ResponseMessage.newResponseMessageBuilder() <END> .withCorrelationUid(correlationUid).withOrganisationIdentification(organisationIdentification) .withDeviceIdentification(deviceIdentification).withResult(result).build()); }</code><technical_language>Extract building of ResponseMessage variable (in eclipse, select text, right-click > refactor > extract local variable / select code + shift+alt+L). This code a bit more readable, especially passing in other besides ResponseMessage</technical_language>

Target:
public void setDeviceLifecycleStatus(final String organisationIdentification, final String deviceIdentification, final String correlationUid, final DeviceLifecycleStatus deviceLifecycleStatus) throws FunctionalException { LOGGER.debug( "SetDeviceLifecycleStatus called with organisation {}, deviceLifecycleStatus and deviceIdentification {}", organisationIdentification, deviceLifecycleStatus.name(), deviceIdentification); this.findOrganisation(organisationIdentification); final Device device = this.deviceDomainService.searchDevice(deviceIdentification); device.setDeviceLifecycleStatus(deviceLifecycleStatus); this.deviceDomainService.saveDevice(device); final ResponseMessageResultType result = ResponseMessageResultType.OK; ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(correlationUid).withOrganisationIdentification(organisationIdentification) .withDeviceIdentification(deviceIdentification).withResult(result).build(); this.webServiceResponseMessageSender.send(responseMessage); }
Source:
<code>public String encodeSCIMException(AbstractCharonException exception) { JSONObject rootErrorObject = new JSONObject(); JSONObject errorObject = new JSONObject(); try { <START> JSONArray arrSchemas = new JSONArray(Arrays.asList(new String[]{exception.getSchemas()})); <END> errorObject.put(ResponseCodeConstants.SCHEMAS, arrSchemas); errorObject.put(ResponseCodeConstants.SCIM_TYPE, String.valueOf(exception.getScimType())); errorObject.put(ResponseCodeConstants.DETAIL, String.valueOf(exception.getDetail())); errorObject.put(ResponseCodeConstants.STATUS, String.valueOf(exception.getStatus())); rootErrorObject = errorObject; } catch (JSONException e) { logger.error("SCIMException encoding error"); } return rootErrorObject.toString(); }</code><technical_language>@rohitsoni77 suggestion JSONArray arrSchemas = new JSONArray(Collections.singletonList(exception.getSchemas())); simplify array generation</technical_language>

Target:
public String encodeSCIMException(AbstractCharonException exception) { JSONObject rootErrorObject = new JSONObject(); JSONObject errorObject = new JSONObject(); try { JSONArray arrSchemas = new JSONArray(Collections.singletonList(exception.getSchemas())); errorObject.put(ResponseCodeConstants.SCHEMAS, arrSchemas); errorObject.put(ResponseCodeConstants.SCIM_TYPE, String.valueOf(exception.getScimType())); errorObject.put(ResponseCodeConstants.DETAIL, String.valueOf(exception.getDetail())); errorObject.put(ResponseCodeConstants.STATUS, String.valueOf(exception.getStatus())); rootErrorObject = errorObject; } catch (JSONException e) { logger.error("SCIMException encoding error"); } return rootErrorObject.toString(); }
Source:
<code>public void start() throws Exception { CompletableFuture future = startRunnableBase(); runnableBase.start(solution); <START> Thread.sleep(1000); <END> assertTrue(runnableBase.isStarted()); verify(solver).addEventListener(eventListenerCaptor.capture()); eventListenerCaptor.getValue().bestSolutionChanged(event); verify(eventListener).bestSolutionChanged(event); runnableBase.destroy(); future.get(); }</code><technical_language>test is active, this Thread.sleep possibly a of instability</technical_language>

Target:
public void start() throws Exception { CompletableFuture future = startRunnableBase(); runnableBase.start(solution); startFinished.await(); assertTrue(runnableBase.isStarted()); verify(solver).addEventListener(eventListenerCaptor.capture()); eventListenerCaptor.getValue().bestSolutionChanged(event); verify(eventListener).bestSolutionChanged(event); runnableBase.destroy(); future.get(); assertTrue(runnableBase.isDestroyed()); }
Source:
<code>private void setupListView() { setVgrow(listView, Priority.ALWAYS); setupKeyboardShortcuts(); setupContextMenu(); <START> listView.setOnItemSelected((i, e) -> { <END> updateContextMenu(contextMenu); TurboIssue issue = listView.getItems().get(i).getIssue(); if (e.booleanValue() == listView.SHOULD_LOAD_BVIEW_ISSUE) { ui.triggerEvent( new IssueSelectedEvent(issue.getRepoId(), issue.getId(), panelIndex, issue.isPullRequest()) ); } issueCommentCounts.put(issue.getId(), issue.getCommentCount()); issueNonSelfCommentCounts.put(issue.getId(), issue.getMetadata().getNonSelfCommentCount()); refreshItems(); }); }</code><technical_language>e parameter a name. wasRightClick something? do if (wasRightClick) { ... } below</technical_language>

Target:
private void setupListView() { setVgrow(listView, Priority.ALWAYS); setupKeyboardShortcuts(); setupContextMenu(); listView.setOnItemSelected(i -> { updateContextMenu(contextMenu); TurboIssue issue = listView.getItems().get(i).getIssue(); ui.triggerEvent( new IssueSelectedEvent(issue.getRepoId(), issue.getId(), panelIndex, issue.isPullRequest()) ); issueCommentCounts.put(issue.getId(), issue.getCommentCount()); issueNonSelfCommentCounts.put(issue.getId(), issue.getMetadata().getNonSelfCommentCount()); refreshItems(); }); }
Source:
<code>private void startUploadService(MediaModel media) { final ArrayList<MediaModel> mediaList = new ArrayList<>(); <START> if (MediaUploadState.QUEUED.toString().equals(media.getUploadState())) { <END> mediaList.add(media); } if (!mediaList.isEmpty()) { savePostAsync(new AfterSavePostListener() { @Override public void onPostSave() { UploadService.uploadMedia(EditPostActivity.this, mediaList); } }); } }</code><technical_language>I this method simplified a return if media is queued. So: private void startUploadService(MediaModel media) { if (MediaUploadState.QUEUED.toString().equals(media.getUploadState())) { return; } final ArrayList<MediaModel> mediaList = new ArrayList<>(); mediaList.add(media); // starting service, need update posts' contents service // retrieve savePostAsync(new AfterSavePostListener() { @Override public void onPostSave() { UploadService.uploadMedia(EditPostActivity.this, mediaList); } }); }</technical_language>

Target:
private void startUploadService(MediaModel media) { if (!MediaUploadState.QUEUED.toString().equals(media.getUploadState())) { return; } final ArrayList<MediaModel> mediaList = new ArrayList<>(); mediaList.add(media); savePostAsync(new AfterSavePostListener() { @Override public void onPostSave() { UploadService.uploadMedia(EditPostActivity.this, mediaList); } }); }
Source:
<code>public void testDefaultLogPerNRowsArgument() throws Exception { String[] args = {"-listFiles"}; <START> Pherf pherf = new Pherf(args); <END> Properties prop = pherf.getProperties(); assertEquals(Long.valueOf(PherfConstants.LOG_PER_NROWS), Long.valueOf(prop.getProperty(PherfConstants.LOG_PER_N_ROWS))); }</code><technical_language>a constant called LOG_PER_NROWS another called LOG_PER_N_ROWS in class is pretty confusing, especially refers a key other a value. :-)</technical_language>

Target:
public void testDefaultLogPerNRowsArgument() throws Exception { String[] args = {"-listFiles"}; assertEquals(Long.valueOf(PherfConstants.LOG_PER_NROWS), getLogPerNRowsValue(new Pherf(args).getProperties())); }
Source:
<code>protected TransactionManager getManager() { return new SerializableTransactionManager( keyValueService, timestampService, lockClient, lockService, transactionService, Suppliers.ofInstance(AtlasDbConstraintCheckingMode.FULL_CONSTRAINT_CHECKING_THROWS_EXCEPTIONS), conflictDetectionManager, SweepStrategyManagers.createDefault(keyValueService), NoOpCleaner.INSTANCE, <START> GET_RANGES_CONCURRENCY, <END> GET_RANGES_CONCURRENT_REQUEST_TIMEOUT); }</code><technical_language>do constants live? (it a weird e.g. AbstractTransactionTest.CONSTANT) (edit: answered scrolling a bit. weird)</technical_language>

Target:
protected TransactionManager getManager() { return new SerializableTransactionManager( keyValueService, timestampService, lockClient, lockService, transactionService, Suppliers.ofInstance(AtlasDbConstraintCheckingMode.FULL_CONSTRAINT_CHECKING_THROWS_EXCEPTIONS), conflictDetectionManager, SweepStrategyManagers.createDefault(keyValueService), NoOpCleaner.INSTANCE, AbstractTransactionTest.GET_RANGES_CONCURRENCY); }
Source:
<code>public void validate(ValidationContext validationContext) { for (EnvironmentPipelineConfig pipelineRefConfig : this.pipelines) { PipelineConfig pipelineConfig = validationContext.getPipelineConfigByName(pipelineRefConfig.getName()); if (pipelineConfig == null) continue; if (validationContext.shouldCheckConfigRepo()) { <START> if (!validationContext.getConfigRepos().isReferenceAllowed(this.origin, pipelineConfig.getOrigin())) <END> pipelineRefConfig.addError(EnvironmentPipelineConfig.ORIGIN, String.format("Environment defined in %s cannot reference a pipeline in %s", this.origin, displayNameFor(pipelineConfig.getOrigin()))); } } }</code><technical_language>Pull validationContext.getConfigRepos() out of loop</technical_language>

Target:
public void validate(ValidationContext validationContext) { for (EnvironmentPipelineConfig pipelineRefConfig : this.pipelines) { ConfigReposConfig configRepos = validationContext.getConfigRepos(); PipelineConfig pipelineConfig = validationContext.getPipelineConfigByName(pipelineRefConfig.getName()); if (pipelineConfig == null) { continue; } if (validationContext.shouldCheckConfigRepo()) { if (!configRepos.isReferenceAllowed(this.origin, pipelineConfig.getOrigin())) pipelineRefConfig.addError(EnvironmentPipelineConfig.ORIGIN, String.format("Environment defined in %s cannot reference a pipeline in %s", this.origin, displayNameFor(pipelineConfig.getOrigin()))); } } }
Source:
<code>public int getConsumptionRate(State state) { <START> return GeneralConfig.panelDisplayBaseConsumption; <END> }</code><technical_language>add panelDisplayBaseConsumptionEnabled panelDisplayBaseConsumptionDisabled instead</technical_language>

Target:
public int getConsumptionRate(State state) { return state.hasVariable() ? GeneralConfig.panelDisplayBaseConsumptionEnabled : GeneralConfig.panelDisplayBaseConsumptionDisabled; }
Source:
<code>public void support_custom_timeouts() { int readTimeout = 2000; <START> System.setProperty("sonar.ws.timeout", String.valueOf(readTimeout)); <END> Logger logger = mock(Logger.class); OkHttpClient underTest = OkHttpClientFactory.create(logger); assertThat(underTest.readTimeoutMillis()).isEqualTo(readTimeout); }</code><technical_language>Setting system properties in unit test is dangerous impact other tests. clear after</technical_language>

Target:
public void support_custom_timeouts() { int readTimeout = 2000; System.setProperty(SONAR_WS_TIMEOUT, String.valueOf(readTimeout)); Logger logger = mock(Logger.class); OkHttpClient underTest = OkHttpClientFactory.create(logger); assertThat(underTest.readTimeoutMillis()).isEqualTo(readTimeout); }
Source:
<code>public void select_by_organization_and_name() { OrganizationDto organization = db.organizations().insert(); <START> QualityGateDto sonarWay = db.qualityGates().insertQualityGate(organization, g -> g.setName("Sonar way")); <END> QualityGateDto veryStrict = db.qualityGates().insertQualityGate(organization, g -> g.setName("Very strict")); OrganizationDto otherOrganization = db.organizations().insert(); QualityGateDto otherSonarWay = db.qualityGates().insertQualityGate(otherOrganization, g -> g.setName("Sonar way")); assertThat(underTest.selectByOrganizationAndName(dbSession, organization, sonarWay.getName()).getUuid()).isEqualTo(sonarWay.getUuid()); assertThat(underTest.selectByOrganizationAndName(dbSession, otherOrganization, sonarWay.getName()).getUuid()).isEqualTo(otherSonarWay.getUuid()); assertThat(underTest.selectByOrganizationAndName(dbSession, organization, "Unknown")).isNull(); }</code><technical_language>I another name for test (because expecting "Sonar way" builtIn unique)</technical_language>

Target:
public void select_by_organization_and_name() { OrganizationDto organization = db.organizations().insert(); QGateWithOrgDto qualityGate1 = db.qualityGates().insertQualityGate(organization); QGateWithOrgDto qualityGate2 = db.qualityGates().insertQualityGate(organization); OrganizationDto otherOrganization = db.organizations().insert(); QGateWithOrgDto qualityGate3 = db.qualityGates().insertQualityGate(otherOrganization); assertThat(underTest.selectByOrganizationAndName(dbSession, organization, qualityGate1.getName()).getUuid()).isEqualTo(qualityGate1.getUuid()); assertThat(underTest.selectByOrganizationAndName(dbSession, otherOrganization, qualityGate3.getName()).getUuid()).isEqualTo(qualityGate3.getUuid()); assertThat(underTest.selectByOrganizationAndName(dbSession, organization, "Unknown")).isNull(); }
Source:
<code>public void pushDirectory(IPath dir) { if (dir != null) { URI uri; URI workingDirectoryURI = getWorkingDirectoryURI(); <START> if (!dir.isAbsolute()) <END> uri = URIUtil.append(workingDirectoryURI, dir.toString()); else { uri = toURI(dir); if (uri == null) return; } pushDirectoryURI(uri); } }</code><technical_language>Please bring braces back</technical_language>

Target:
public void pushDirectory(IPath dir) { if (dir != null) { URI uri; URI workingDirectoryURI = getWorkingDirectoryURI(); if (!dir.isAbsolute()) { uri = URIUtil.append(workingDirectoryURI, dir.toString()); } else { uri = toURI(dir); if (uri == null) { return; } } pushDirectoryURI(uri); } }