auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Block getLoadedBlock() { Block loadedValueBlock = value.getLoadedBlock(); if (loadedValueBlock == value) { return this; } else { <START> throw new IllegalArgumentException("Value block is not loaded"); <END> } }</code><technical_language>this throw? Is sources produce RLEs</technical_language>

Target:
public Block getLoadedBlock() { Block loadedValueBlock = value.getLoadedBlock(); if (loadedValueBlock == value) { return this; } return new RunLengthEncodedBlock(loadedValueBlock, positionCount); }
Source:
<code>private void deployNodeSourceOrFail(String nodeSourceName, NodeSourceDescriptor nodeSourceDescriptor) { try { NodeSource nodeSourceToDeploy = this.createNodeSourceInstance(nodeSourceDescriptor); NodeSourcePolicy nodeSourcePolicyStub = this.createNodeSourcePolicyActivity(nodeSourceDescriptor, nodeSourceToDeploy); NodeSource nodeSourceStub = this.createNodeSourceActivity(nodeSourceName, nodeSourceToDeploy); this.configureDeployedNodeSource(nodeSourceName, nodeSourceDescriptor, nodeSourceStub, nodeSourcePolicyStub); this.deployedNodeSources.put(nodeSourceName, nodeSourceStub); this.emitNodeSourceEvent(nodeSourceStub, RMEventType.NODESOURCE_CREATED); logger.info(NODE_SOURCE_STRING + nodeSourceName + " has been successfully deployed"); <START> } catch (RuntimeException e) { <END> this.updateNodeSourceDescriptorWithStatusAndPersist(nodeSourceDescriptor, NodeSourceStatus.NODES_UNDEPLOYED); logger.error(NODE_SOURCE_STRING + nodeSourceName + " failed to be deployed", e); throw e; } }</code><technical_language>I dunno, Exception</technical_language>

Target:
private void deployNodeSourceOrFail(String nodeSourceName, NodeSourceDescriptor nodeSourceDescriptor) { try { NodeSource nodeSourceToDeploy = this.createNodeSourceInstance(nodeSourceDescriptor); NodeSourcePolicy nodeSourcePolicyStub = this.createNodeSourcePolicyActivity(nodeSourceDescriptor, nodeSourceToDeploy); NodeSource nodeSourceStub = this.createNodeSourceActivity(nodeSourceName, nodeSourceToDeploy); this.configureDeployedNodeSource(nodeSourceName, nodeSourceDescriptor, nodeSourceStub, nodeSourcePolicyStub); this.deployedNodeSources.put(nodeSourceName, nodeSourceStub); this.emitNodeSourceEvent(nodeSourceStub, RMEventType.NODESOURCE_CREATED); logger.info(NODE_SOURCE_STRING + nodeSourceName + " has been successfully deployed"); } catch (Exception e) { this.updateNodeSourceDescriptorWithStatusAndPersist(nodeSourceDescriptor, NodeSourceStatus.NODES_UNDEPLOYED); logger.error(NODE_SOURCE_STRING + nodeSourceName + " failed to be deployed", e); throw e; } }
Source:
<code>public ExtractionFn getExtractionFn() { final LookupExtractor lookupExtractor = Strings.isNullOrEmpty(name) ? this.lookup : Preconditions.checkNotNull( Preconditions.checkNotNull( this.lookupReferencesManager, "can not find lookup manager" ).get(name).get(), "can not find lookup with name [%s]", name ); <START> return new DimExtractionFn() <END> { @Override public byte[] getCacheKey() { return lookupExtractor.getCacheKey(); } @Override public String apply(String value) { final String retVal = Strings.emptyToNull(lookupExtractor.apply(value)); if (retainMissingValues) { return retVal == null ? Strings.emptyToNull(value) : retVal; } else { return retVal == null ? replaceMissingWith : retVal; } } @Override public boolean preservesOrdering() { return false; } @Override public ExtractionType getExtractionType() { return lookupExtractor.isOneToOne() ? ExtractionType.ONE_TO_ONE : ExtractionType.MANY_TO_ONE; } }; }</code><technical_language>Suggest FunctionalExtraction nulls handled correctly</technical_language>

Target:
public ExtractionFn getExtractionFn() { final LookupExtractor lookupExtractor = Strings.isNullOrEmpty(name) ? this.lookup : Preconditions.checkNotNull( this.lookupReferencesManager.get(name).get(), "can not find lookup with name [%s]", name ); return new LookupExtractionFn( lookupExtractor, retainMissingValue, replaceMissingValueWith, lookupExtractor.isOneToOne(), optimize ); }
Source:
<code>public ZooKeeper( String connectString, int sessionTimeout, Watcher watcher, long sessionId, byte[] sessionPasswd, boolean canBeReadOnly, HostProvider aHostProvider, ZKClientConfig clientConfig) throws IOException { LOG.info( <START> "Initiating client connection, connectString={} sessionTimeout={} watcher={} sessionId={} sessionPasswd={}", <END> connectString, sessionTimeout, watcher, Long.toHexString(sessionId), (sessionPasswd == null ? "<null>" : "<hidden>")); if (clientConfig == null) { clientConfig = new ZKClientConfig(); } this.clientConfig = clientConfig; watchManager = defaultWatchManager(); watchManager.defaultWatcher = watcher; ConnectStringParser connectStringParser = new ConnectStringParser(connectString); hostProvider = aHostProvider; cnxn = new ClientCnxn( connectStringParser.getChrootPath(), hostProvider, sessionTimeout, this, watchManager, getClientCnxnSocket(), sessionId, sessionPasswd, canBeReadOnly); cnxn.seenRwServerBefore = true; cnxn.start(); }</code><technical_language>Add "0x" sessionId</technical_language>

Target:
public ZooKeeper( String connectString, int sessionTimeout, Watcher watcher, long sessionId, byte[] sessionPasswd, boolean canBeReadOnly, HostProvider aHostProvider, ZKClientConfig clientConfig) throws IOException { LOG.info( "Initiating client connection, connectString={} " + "sessionTimeout={} watcher={} sessionId=0x{} sessionPasswd={}", connectString, sessionTimeout, watcher, Long.toHexString(sessionId), (sessionPasswd == null ? "<null>" : "<hidden>")); if (clientConfig == null) { clientConfig = new ZKClientConfig(); } this.clientConfig = clientConfig; watchManager = defaultWatchManager(); watchManager.defaultWatcher = watcher; ConnectStringParser connectStringParser = new ConnectStringParser(connectString); hostProvider = aHostProvider; cnxn = new ClientCnxn( connectStringParser.getChrootPath(), hostProvider, sessionTimeout, this, watchManager, getClientCnxnSocket(), sessionId, sessionPasswd, canBeReadOnly); cnxn.seenRwServerBefore = true; cnxn.start(); }
Source:
<code><START> public void cleanupLiveInstanceOwners() throws InterruptedException { <END> String testClassName = this.getShortClassName(); System.out.println("AfterClass:" + testClassName + " afterclass of ZkTestBase called!"); for (String cluster : _liveInstanceOwners.keySet()) { Map<String, HelixZkClient> clientMap = _liveInstanceOwners.get(cluster); for (HelixZkClient client : clientMap.values()) { client.close(); } clientMap.clear(); } _liveInstanceOwners.clear(); boolean status = false; try { status = ThreadLeakageChecker.afterClassCheck(testClassName); } catch (Exception e) { System.out.println("ThreadLeakageChecker exception:" + e.getStackTrace()); } if (!status) { System.out.println("---------- Test Class " + testClassName + " thread leakage detected! ---------------"); } }</code><technical_language>this method called test classes</technical_language>

Target:
public void cleanupLiveInstanceOwners() throws InterruptedException { String testClassName = this.getShortClassName(); for (String cluster : _liveInstanceOwners.keySet()) { Map<String, HelixZkClient> clientMap = _liveInstanceOwners.get(cluster); for (HelixZkClient client : clientMap.values()) { client.close(); } clientMap.clear(); } _liveInstanceOwners.clear(); boolean status = false; try { status = ThreadLeakageChecker.afterClassCheck(testClassName); } catch (Exception e) { LOG.error("ThreadLeakageChecker exception:", e); } if (!status) { System.out.println("---------- Test Class " + testClassName + " thread leakage detected! ---------------"); } }
Source:
<code>private static int getRowCountForEmptyColValue(Connection conn, String tableName, byte[] valueBytes) throws IOException, SQLException { PTable table = PhoenixRuntime.getTable(conn, tableName); byte[] emptyCF = SchemaUtil.getEmptyColumnFamily(table); byte[] emptyCQ = EncodedColumnsUtil.getEmptyKeyValueInfo(table).getFirst(); <START> HTable htable = (HTable) conn.unwrap(PhoenixConnection.class).getQueryServices().getTable(table.getPhysicalName().getBytes()); <END> Scan scan = new Scan(); scan.addColumn(emptyCF, emptyCQ); ResultScanner resultScanner = htable.getScanner(scan); int count = 0; for (Result result = resultScanner.next(); result != null; result = resultScanner.next()) { if (Bytes.compareTo(result.getValue(emptyCF, emptyCQ), 0, valueBytes.length, valueBytes, 0, valueBytes.length) == 0) { ++count; } } return count; }</code><technical_language>nit: line> 100 difficult</technical_language>

Target:
private static int getRowCountForEmptyColValue(Connection conn, String tableName, byte[] valueBytes) throws IOException, SQLException { PTable table = PhoenixRuntime.getTable(conn, tableName); byte[] emptyCF = SchemaUtil.getEmptyColumnFamily(table); byte[] emptyCQ = EncodedColumnsUtil.getEmptyKeyValueInfo(table).getFirst(); ConnectionQueryServices queryServices = conn.unwrap(PhoenixConnection.class).getQueryServices(); HTable htable = (HTable) queryServices.getTable(table.getPhysicalName().getBytes()); Scan scan = new Scan(); scan.addColumn(emptyCF, emptyCQ); ResultScanner resultScanner = htable.getScanner(scan); int count = 0; for (Result result = resultScanner.next(); result != null; result = resultScanner.next()) { if (Bytes.compareTo(result.getValue(emptyCF, emptyCQ), 0, valueBytes.length, valueBytes, 0, valueBytes.length) == 0) { ++count; } } return count; }
Source:
<code>public void update(long nowMs) { synchronized (SendSideBandwidthEstimation.this) { long time_since_packet_report_ms = nowMs - last_packet_report_ms_; boolean currentStateHasTimedOut <START> = time_since_packet_report_ms < 1.2 * kFeedbackIntervalMs; <END> update(nowMs, currentStateHasTimedOut, null); } }</code><technical_language>extract 1.2 a constant? match other reference 1.2 I presume</technical_language>

Target:
public void update(long nowMs) { synchronized (SendSideBandwidthEstimation.this) { long time_since_packet_report_ms = nowMs - last_packet_report_ms_; boolean currentStateHasTimedOut = time_since_packet_report_ms < kPacketReportTimeoutIntervals * kFeedbackIntervalMs; update(nowMs, currentStateHasTimedOut, null); } }
Source:
<code><START> public int getHeadwayForStopByRoute (String stop_id, String route_id, LocalDate date, LocalTime from, LocalTime to) { <END> List<Trip> tripsForStop = feed.getStopTimesForStop(stop_id).stream() .filter(t -> feed.trips.get(t.a).route_id.equals(route_id)) .map(t -> feed.trips.get(t.b.a)) .filter(trip -> feed.services.get(trip.service_id).activeOn(date)) .collect(Collectors.toList()); return getStopHeadwayForTrips(stop_id, tripsForStop, from, to); }</code><technical_language>Units</technical_language>

Target:
public int getHeadwayForStopByRoute (String stop_id, String route_id, LocalDate date, LocalTime from, LocalTime to) { List<Trip> tripsForStop = feed.getDistinctTripsForStop(stop_id).stream() .filter(trip -> feed.trips.get(trip.trip_id).route_id.equals(route_id)) .filter(trip -> feed.services.get(trip.service_id).activeOn(date)) .collect(Collectors.toList()); return getStopHeadwayForTrips(stop_id, tripsForStop, from, to); }
Source:
<code>private void createTabletDirectories(VolumeManager fs, SortedSet<Text> dirInfo) throws IOException { for (Text info : dirInfo) { <START> if (fs.exists(new Path(info.toString()))) <END> throw new IllegalStateException("Dir exists when it should not: " + info); if (!fs.mkdirs(new Path(info.toString()))) throw new IOException("Failed to create tablet directory: " + info); } }</code><technical_language>If Repo fails is run again, this fail</technical_language>

Target:
private void createTabletDirectories(VolumeManager fs, SortedSet<Text> dirInfo) throws IOException { for (Text dir : dirInfo) { if (!fs.mkdirs(new Path(dir.toString()))) throw new IOException("Failed to create tablet directory: " + dir); } }
Source:
<code>private QueryTraversal(GraphQLSchema schema, Document document, String operation, Map<String, Object> variables) { assertNotNull(document, "document can't be null"); NodeUtil.GetOperationResult getOperationResult = NodeUtil.getOperation(document, operation); this.schema = assertNotNull(schema, "schema can't be null"); this.variables = assertNotNull(variables, "variables can't be null"); this.fragmentsByName = getOperationResult.fragmentsByName; <START> this.roots = Collections.singletonList(getOperationResult.operationDefinition); <END> this.rootParentType = getRootTypeFromOperation(getOperationResult.operationDefinition); }</code><technical_language>I a fan of static imports for readability</technical_language>

Target:
private QueryTraversal(GraphQLSchema schema, Document document, String operation, Map<String, Object> variables) { assertNotNull(document, "document can't be null"); NodeUtil.GetOperationResult getOperationResult = NodeUtil.getOperation(document, operation); this.schema = assertNotNull(schema, "schema can't be null"); this.variables = assertNotNull(variables, "variables can't be null"); this.fragmentsByName = getOperationResult.fragmentsByName; this.roots = singletonList(getOperationResult.operationDefinition); this.rootParentType = getRootTypeFromOperation(getOperationResult.operationDefinition); }
Source:
<code>void openFragmentAddDiet () { <START> Log.i("INFO", "Début de onClick sur fab de FragmentDiets"); <END> Fragment fragment = new EditDietFragment(); FragmentTransaction transaction = getFragmentManager().beginTransaction(); transaction.replace(R.id.fragment_container, fragment ); transaction.addToBackStack(null); transaction.commit(); }</code><technical_language>suggestion Log.i("INFO", "Starting onClick fab FragmentDiets");</technical_language>

Target:
void openFragmentAddDiet () { Log.i("INFO", "Starting onClick on fab from FragmentDiets"); Fragment fragment = new EditDietFragment(); FragmentTransaction transaction = getFragmentManager().beginTransaction(); transaction.replace(R.id.fragment_container, fragment ); transaction.addToBackStack(null); transaction.commit(); }
Source:
<code>private JSONObject getTopology(StartAction startAction, Map<Integer, String> hostGroups, JoinCoordinator joinCoordinator) { JSONObject topo = null; if (startAction == StartAction.JOIN) { assert(joinCoordinator != null); topo = joinCoordinator.getTopology(); } else if (!startAction.doesRejoin()) { Map<Integer, Integer> sphMap = new HashMap<>(); try { List<String> children; <START> children = m_messenger.getZK().getChildren(VoltZK.sitesPerHost, false); <END> for (String child : children) { byte[] payload = m_messenger.getZK().getData( ZKUtil.joinZKPath(VoltZK.sitesPerHost, child), false, new Stat()); int sitesperhost = ByteBuffer.wrap(payload).getInt(); int hostId = Integer.parseInt(child.split("_")[1]); sphMap.put(hostId, sitesperhost); } } catch (Exception e) { VoltDB.crashGlobalVoltDB("Unable to get sitesperhost from Zookeeper", false, e); } int hostcount = m_clusterSettings.get().hostcount(); int kfactor = m_catalogContext.getDeployment().getCluster().getKfactor(); ClusterConfig clusterConfig = new ClusterConfig(hostcount, sphMap, kfactor); if (!clusterConfig.validate()) { VoltDB.crashLocalVoltDB(clusterConfig.getErrorMsg(), false, null); } topo = registerClusterConfig(clusterConfig, hostGroups); } else { Stat stat = new Stat(); try { topo = new JSONObject(new String(m_messenger.getZK().getData(VoltZK.topology, false, stat), "UTF-8")); } catch (Exception e) { VoltDB.crashLocalVoltDB("Unable to get topology from ZK", true, e); } } return topo; }</code><technical_language>combine line 1593 1594</technical_language>

Target:
private JSONObject getTopology(StartAction startAction, Map<Integer, String> hostGroups, JoinCoordinator joinCoordinator) { JSONObject topo = null; if (startAction == StartAction.JOIN) { assert(joinCoordinator != null); topo = joinCoordinator.getTopology(); } else if (!startAction.doesRejoin()) { Map<Integer, Integer> sphMap = new HashMap<>(); try { List<String> children = m_messenger.getZK().getChildren(VoltZK.sitesPerHost, false); for (String child : children) { byte[] payload = m_messenger.getZK().getData( ZKUtil.joinZKPath(VoltZK.sitesPerHost, child), false, new Stat()); int sitesperhost = ByteBuffer.wrap(payload).getInt(); int hostId = Integer.parseInt(child); sphMap.put(hostId, sitesperhost); } } catch (Exception e) { VoltDB.crashGlobalVoltDB("Unable to get sitesperhost from Zookeeper", false, e); } int hostcount = m_clusterSettings.get().hostcount(); int kfactor = m_catalogContext.getDeployment().getCluster().getKfactor(); ClusterConfig clusterConfig = new ClusterConfig(hostcount, sphMap, kfactor); if (!clusterConfig.validate()) { VoltDB.crashLocalVoltDB(clusterConfig.getErrorMsg(), false, null); } topo = registerClusterConfig(clusterConfig, hostGroups); } else { Stat stat = new Stat(); try { topo = new JSONObject(new String(m_messenger.getZK().getData(VoltZK.topology, false, stat), "UTF-8")); } catch (Exception e) { VoltDB.crashLocalVoltDB("Unable to get topology from ZK", true, e); } } return topo; }
Source:
<code>public void getSubtreeRoots() { final CategoryTree tree = createAbcCategoryTree(); final Category a = tree.findById("A").get(); final Category b1 = tree.findById("B-1").get(); final Category c22 = tree.findById("C-2-2").get(); final CategoryTree subtree = tree.getSubtree(asList(a, b1, c22)); assertThat(subtree.getRoots()).extracting(c -> c.getId()) .as("roots are still categories which have no parent and are included in this tree") .containsOnly("A") .doesNotContain("B-1", "C-2-2", "B", "C"); assertThat(subtree.getSubtreeRoots()).extracting(c -> c.getId()) <START> .as("subtree rootes are the categories at the top," + <END> "no matter if they have a parent reference") .containsOnly("A", "B-1", "C-2-2") .doesNotContain("B", "C", "B-2"); }</code><technical_language>*roots</technical_language>

Target:
public void getSubtreeRoots() { final CategoryTree tree = createAbcCategoryTree(); final Category a = tree.findById("A").get(); final Category b1 = tree.findById("B-1").get(); final Category c22 = tree.findById("C-2-2").get(); final CategoryTree subtree = tree.getSubtree(asList(a, b1, c22)); assertThat(subtree.getRoots()).extracting(c -> c.getId()) .as("roots are still categories which have no parent and are included in this tree") .containsOnly("A") .doesNotContain("B-1", "C-2-2", "B", "C"); assertThat(subtree.getSubtreeRoots()).extracting(c -> c.getId()) .as("subtree roots are the categories at the top," + "no matter if they have a parent reference") .containsOnly("A", "B-1", "C-2-2") .doesNotContain("B", "C", "B-2"); }
Source:
<code>public void addContents(@NonNull Container result) { <START> for (final Node node : Jenkins.getInstance().getNodes()) { <END> result.add( new TruncatedContent("nodes/slave/" + node.getNodeName() + "/exportTable.txt") { @Override protected void printTo(PrintWriter out) throws IOException { try { VirtualChannel channel = node.getChannel(); if (channel instanceof Channel) { ((Channel)channel).dumpExportTable(out); } } catch (TruncationException e) { logger.log(Level.WARNING, "Truncated the output of export table for node: " + node.getNodeName(), e); } catch (IOException e) { logger.log(Level.WARNING, "Could not record environment of node " + node.getNodeName(), e); } } } ); } }</code><technical_language>Minor: Jenkins.getInstance() return null</technical_language>

Target:
public void addContents(@NonNull Container result) { Jenkins instance = Jenkins.getInstance(); if (instance == null) { return; } for (final Node node : instance.getNodes()) { result.add( new TruncatedContent("nodes/slave/" + node.getNodeName() + "/exportTable.txt") { @Override protected void printTo(PrintWriter out) throws IOException { try { VirtualChannel channel = node.getChannel(); if (channel instanceof Channel) { ((Channel)channel).dumpExportTable(out); } } catch (TruncationException e) { logger.log(Level.WARNING, "Truncated the output of export table for node: " + node.getNodeName(), e); } catch (IOException e) { logger.log(Level.WARNING, "Could not record environment of node " + node.getNodeName(), e); } } } ); } }
Source:
<code>public void processMessageToForwardAsAttachment(MessageViewInfo messageViewInfo) { boolean isMissingParts = !allPartsAvailable(messageViewInfo, false); if (isMissingParts) { attachmentMvpView.showMissingAttachmentsPartialMessageForwardWarning(); } else { try { File tempFile = File.createTempFile("pre", ".tmp"); tempFile.deleteOnExit(); FileOutputStream fileOutputStream = new FileOutputStream(tempFile); messageViewInfo.message.writeTo(fileOutputStream); fileOutputStream.close(); int loaderId = getNextFreeLoaderId(); Attachment attachment = Attachment.createAttachment(null, loaderId, "message/rfc822") .deriveWithMetadataLoaded("message/rfc822", messageViewInfo.message.getSubject(), tempFile.length()) .deriveWithLoadComplete(tempFile.getAbsolutePath()); attachments.put(attachment.uri, attachment); attachmentMvpView.addAttachmentView(attachment); } catch (java.io.IOException e) { <START> throw new IllegalStateException("Error storing the message to a temporary file: " + e.getMessage()); <END> } catch (MessagingException e) { throw new IllegalStateException("Received the same attachmentViewInfo twice!"); } } }</code><technical_language>Pass original exception instead of swallowing it</technical_language>

Target:
public void processMessageToForwardAsAttachment(MessageViewInfo messageViewInfo) throws IOException, MessagingException { boolean isMissingParts = !allPartsAvailable(messageViewInfo, false); if (isMissingParts) { attachmentMvpView.showMissingAttachmentsPartialMessageForwardWarning(); } else { File tempFile = File.createTempFile("pre", ".tmp"); tempFile.deleteOnExit(); FileOutputStream fileOutputStream = new FileOutputStream(tempFile); messageViewInfo.message.writeTo(fileOutputStream); fileOutputStream.close(); int loaderId = getNextFreeLoaderId(); Attachment attachment = Attachment.createAttachment(null, loaderId, "message/rfc822") .deriveWithMetadataLoaded("message/rfc822", messageViewInfo.message.getSubject(), tempFile.length()) .deriveWithLoadComplete(tempFile.getAbsolutePath()); attachments.put(attachment.uri, attachment); attachmentMvpView.addAttachmentView(attachment); } }
Source:
<code>public boolean apply(BlockVector3 position, int depth) throws WorldEditException { if (mask.test(position)) { <START> if (makeChangeTo(position, depth)) { <END> ++affected; } } return true; }</code><technical_language>Combine previous if statement? Feels a more me</technical_language>

Target:
public boolean apply(BlockVector3 position, int depth) throws WorldEditException { if (mask.test(position)) { if (naturalize(position, depth)) { ++affected; } } return true; }
Source:
<code>public void testCheckAccessThread() { carbonSecurityManager = mock(CarbonSecurityManager.class); Thread thread = mock(Thread.class); <START> carbonSecurityManager.checkAccess(thread); <END> }</code><technical_language>testing method checkAccess, mock carbonSecurityManager class. need create a real object of carbonSecurityManager class call method</technical_language>

Target:
public void testCheckAccessThread() { System.setProperty("denied.system.properties", "mockDeniedProperty"); carbonSecurityManager = new CarbonSecurityManager(); Thread thread = mock(Thread.class); carbonSecurityManager.checkAccess(thread); }
Source:
<code>MockBlobStore(StoreStats storeStats) { super(UtilsTest.getRandomString(10), null, null, null, new StorageManagerMetrics(new MetricRegistry()), null, <START> 1024, null, null, null, null); <END> this.storeStats = storeStats; }</code><technical_language>ensure capacity in line 189</technical_language>

Target:
MockBlobStore(StoreStats storeStats) { super(UtilsTest.getRandomString(10), null, null, null, new StorageManagerMetrics(new MetricRegistry()), null, CAPACITY, null, null, null, null); this.storeStats = storeStats; }
Source:
<code>public ProgressInformationPanel(final boolean running) { super(WidgetUtils.COLOR_DEFAULT_BACKGROUND); setLayout(new BorderLayout()); _tableProgressInformationPanels = new ConcurrentHashMap<>(); _progressTimingCounters = new ConcurrentHashMap<>(); _stopWatch = Stopwatch.createUnstarted(); _executionLogTextArea = new JTextArea(); _executionLogTextArea.setText("--- DataCleaner progress information user-log ---"); _executionLogTextArea.setEditable(false); _executionLogTextArea.setBackground(WidgetUtils.COLOR_DEFAULT_BACKGROUND); _progressBarPanel = new DCPanel(WidgetUtils.COLOR_ALTERNATIVE_BACKGROUND); _progressBarPanel.setLayout(new VerticalLayout(4)); final JXTaskPane progressTaskPane = WidgetFactory.createTaskPane("Progress", IconUtils.ACTION_EXECUTE); progressTaskPane.add(_progressBarPanel); final JXTitledPanel executionLogPanel = WidgetFactory.createTitledPanel("Execution log", WidgetUtils.scrolleable(_executionLogTextArea)); executionLogPanel.setBorder(new MatteBorder(1, 1, 1, 1, WidgetUtils.COLOR_ALTERNATIVE_BACKGROUND)); final DCTaskPaneContainer taskPaneContainer = WidgetFactory.createTaskPaneContainer(); <START> final int margin = 10; <END> taskPaneContainer.setLayout(new BorderLayout(margin, margin)); if (running) { taskPaneContainer.add(progressTaskPane, BorderLayout.NORTH); } setBorder(new MatteBorder(0, 0, margin, 0, WidgetUtils.COLOR_DEFAULT_BACKGROUND)); taskPaneContainer.add(executionLogPanel, BorderLayout.CENTER); add(taskPaneContainer, BorderLayout.CENTER); }</code><technical_language>a static final field for this</technical_language>

Target:
public ProgressInformationPanel(final boolean running) { super(WidgetUtils.COLOR_DEFAULT_BACKGROUND); setLayout(new BorderLayout()); _tableProgressInformationPanels = new ConcurrentHashMap<>(); _progressTimingCounters = new ConcurrentHashMap<>(); _stopWatch = Stopwatch.createUnstarted(); _executionLogTextArea = new JTextArea(); _executionLogTextArea.setText("--- DataCleaner progress information user-log ---"); _executionLogTextArea.setEditable(false); _executionLogTextArea.setBackground(WidgetUtils.COLOR_DEFAULT_BACKGROUND); _progressBarPanel = new DCPanel(WidgetUtils.COLOR_ALTERNATIVE_BACKGROUND); _progressBarPanel.setLayout(new VerticalLayout(4)); final JXTaskPane progressTaskPane = WidgetFactory.createTaskPane("Progress", IconUtils.ACTION_EXECUTE); progressTaskPane.add(_progressBarPanel); final JXTitledPanel executionLogPanel = WidgetFactory.createTitledPanel("Execution log", WidgetUtils.scrolleable(_executionLogTextArea)); executionLogPanel.setBorder(new MatteBorder(1, 1, 1, 1, WidgetUtils.COLOR_ALTERNATIVE_BACKGROUND)); final DCTaskPaneContainer taskPaneContainer = WidgetFactory.createTaskPaneContainer(); taskPaneContainer.setLayout(new BorderLayout(MARGIN, MARGIN)); if (running) { taskPaneContainer.add(progressTaskPane, BorderLayout.NORTH); } setBorder(new MatteBorder(0, 0, MARGIN, 0, WidgetUtils.COLOR_DEFAULT_BACKGROUND)); taskPaneContainer.add(executionLogPanel, BorderLayout.CENTER); add(taskPaneContainer, BorderLayout.CENTER); }
Source:
<code>public String verifyRefundSubmittedEvent() throws JsonProcessingException { RefundHistory refundHistory = aValidRefundHistoryEntity() .build(); <START> RefundSubmitted refundCreatedByUser = RefundSubmitted.from(refundHistory); <END> return refundCreatedByUser.toJsonString(); }</code><technical_language>refundSubmitted</technical_language>

Target:
public String verifyRefundSubmittedEvent() throws JsonProcessingException { RefundHistory refundHistory = aValidRefundHistoryEntity() .build(); RefundSubmitted refundSubmitted = RefundSubmitted.from(refundHistory); return refundSubmitted.toJsonString(); }
Source:
<code>public <T extends ArtifactId> ResultSet<T> getResultArtifacts() { List<T> items = new ArrayList<>(); for (IAtsConfigObject configObject : getResults()) { if (configObject == null) { <START> System.err.println("Unexpected null workitem"); <END> } else { items.add((T) configObject.getStoreObject()); } } List<T> artifacts = new LinkedList<>(); for (ArtifactId artifact : items) { boolean artifactTypeMatch = isArtifactTypeMatch(artifact, artifactType); if (artifactTypeMatch) { artifacts.add((T) artifact); } } return ResultSets.newResultSet(artifacts); }</code><technical_language>Consider error logging instead of println</technical_language>

Target:
public <T extends ArtifactId> ResultSet<T> getResultArtifacts() { List<T> items = new ArrayList<>(); for (IAtsConfigObject configObject : getResults()) { if (configObject == null) { OseeLog.log(AbstractAtsConfigQueryImpl.class, Level.SEVERE, "Null found in results"); } else { items.add((T) configObject.getStoreObject()); } } List<T> artifacts = new LinkedList<>(); for (ArtifactId artifact : items) { boolean artifactTypeMatch = isArtifactTypeMatch(artifact, artifactType); if (artifactTypeMatch) { artifacts.add((T) artifact); } } return ResultSets.newResultSet(artifacts); }
Source:
<code>public Response unregisteredStorageDomainsDiscover(Action action) { StorageType storageType = StorageType.ISCSI; IscsiDetails iscsiDetails = action.getIscsi(); if ((iscsiDetails != null) && (iscsiDetails.getAddress() != null)) { storageType = StorageType.FCP; <START> } <END> getEntity(); List<StorageServerConnections> storageServerConnections = new ArrayList<>(); if (storageType == StorageType.ISCSI) { for (String iscsiTarget : action.getIscsiTargets()) { StorageServerConnections connectionDetails = getInitializedConnectionIscsiDetails(action); connectionDetails.setiqn(iscsiTarget); storageServerConnections.add(connectionDetails); } } GetUnregisteredBlockStorageDomainsParameters unregisteredBlockStorageDomainsParameters = new GetUnregisteredBlockStorageDomainsParameters(guid, storageType, storageServerConnections); try { Pair<List<StorageDomain>, List<StorageServerConnections>> pair = getEntity(Pair.class, VdcQueryType.GetUnregisteredBlockStorageDomains, unregisteredBlockStorageDomainsParameters, "GetUnregisteredBlockStorageDomains", true); List<StorageDomain> storageDomains = pair.getFirst(); return actionSuccess(mapToStorageDomains(action, storageDomains)); } catch (Exception e) { return handleError(e, false); } }</code><technical_language>initialize type more elegantly a trinary if</technical_language>

Target:
public Response unregisteredStorageDomainsDiscover(Action action) { StorageType storageType = ((action.getIscsi() != null) && (action.getIscsi().getAddress() != null)) ? StorageType.FCP : StorageType.ISCSI; getEntity(); List<StorageServerConnections> storageServerConnections = new ArrayList<>(); if (storageType == StorageType.ISCSI) { for (String iscsiTarget : action.getIscsiTargets()) { StorageServerConnections connectionDetails = getInitializedConnectionIscsiDetails(action); connectionDetails.setiqn(iscsiTarget); storageServerConnections.add(connectionDetails); } } else { } GetUnregisteredBlockStorageDomainsParameters unregisteredBlockStorageDomainsParameters = new GetUnregisteredBlockStorageDomainsParameters(guid, storageType, storageServerConnections); try { Pair<List<StorageDomain>, List<StorageServerConnections>> pair = getEntity(Pair.class, VdcQueryType.GetUnregisteredBlockStorageDomains, unregisteredBlockStorageDomainsParameters, "GetUnregisteredBlockStorageDomains", true); List<StorageDomain> storageDomains = pair.getFirst(); return actionSuccess(mapToStorageDomains(action, storageDomains)); } catch (Exception e) { return handleError(e, false); } }
Source:
<code>protected RevCommit getSelectedCommit(ExecutionEvent event) throws ExecutionException { List<RevCommit> commits = getSelectedCommits(event); <START> if (commits.size() != 1) <END> throw new ExecutionException( UIText.AbstractHistoryCommandHandler_CouldNotGetSelectedCommitMessage); return commits.get(0); }</code><technical_language>Some callers of this method previously selected element. I graceful wrt. multiple selected commits is okay. throw a more specific error message in case, stating operation is supported for multiple commits</technical_language>

Target:
protected RevCommit getSelectedCommit(ExecutionEvent event) throws ExecutionException { List<RevCommit> commits = getSelectedCommits(event); if (commits.size() != 1) throw new ExecutionException( UIText.AbstractHistoryCommandHandler_ActionRequiresOneSelectedCommitMessage); return commits.get(0); }
Source:
<code>public void not_store_enrichment_for_origin_of_RejectionContext_type() { final RejectionContext origin = RejectionContext.newBuilder() .setEnrichment(newEnrichment()) .build(); final Event event = projectCreated(Time.getCurrentTime()); final Event enriched = event.toBuilder() .setContext(event.getContext() .toBuilder() .setRejectionContext(origin)) .build(); eventStore.append(enriched); final MemoizingObserver<Event> observer = memoizingObserver(); eventStore.read(EventStreamQuery.getDefaultInstance(), observer); <START> final RejectionContext modifiedOrigin = observer.responses() <END> .get(0) .getContext() .getRejectionContext(); assertTrue(isDefault(modifiedOrigin.getEnrichment())); }</code><technical_language>modifiedOrigin? This question applies this variable similar below</technical_language>

Target:
public void not_store_enrichment_for_origin_of_RejectionContext_type() { final RejectionContext originContext = RejectionContext.newBuilder() .setEnrichment(newEnrichment()) .build(); final Event event = projectCreated(Time.getCurrentTime()); final Event enriched = event.toBuilder() .setContext(event.getContext() .toBuilder() .setRejectionContext(originContext)) .build(); eventStore.append(enriched); final MemoizingObserver<Event> observer = memoizingObserver(); eventStore.read(EventStreamQuery.getDefaultInstance(), observer); final RejectionContext loadedOriginContext = observer.responses() .get(0) .getContext() .getRejectionContext(); assertTrue(isDefault(loadedOriginContext.getEnrichment())); }
Source:
<code>public void providesAnnotatedMethodsSortedByName() { TestClass tc = new TestClass(MethodsAnnotated.class); List<FrameworkMethod> annotatedMethods = tc.getAnnotatedMethods(); assertThat(extractNames(annotatedMethods), anyOf( equalTo(asList("methodA", "methodB", "methodC")), <START> equalTo(asList("clone", "finalize", "getClass", "hashCode", <END> "methodA", "methodB", "methodC", "notify", "notifyAll")) )); }</code><technical_language>I suggest ignoring jdk.internal.* annotations completely</technical_language>

Target:
public void providesAnnotatedMethodsSortedByName() { TestClass tc = new TestClass(MethodsAnnotated.class); List<FrameworkMethod> annotatedMethods = tc.getAnnotatedMethods(); List<String> methodNames = extractNames(annotatedMethods); assertThat(methodNames.indexOf("methodA"), lessThan(methodNames.indexOf("methodB"))); }
Source:
<code>public Set<Project> getDefaultProjects() { <START> return (Set<Project>)getConfigurationValue("defaultProjects"); <END> }</code><technical_language>if modify returned set multiple threads a problem</technical_language>

Target:
public Set<Project> getDefaultProjects() { Set<Project> projects = (Set<Project>)getConfigurationValue("defaultProjects"); if (projects == null) { return null; } return Collections.unmodifiableSet(projects); }
Source:
<code><START> @Override public <T> T to(HttpEntity entity, Type type) throws ConversionException { <END> try { InputStreamReader isr = new InputStreamReader(entity.getContent(), "UTF-8"); return gson.fromJson(isr, type); } catch (IOException e) { throw new ConversionException(e); } catch (JsonParseException e) { throw new ConversionException(e); } }</code><technical_language>nit: typesafe, above</technical_language>

Target:
@Override public Object to(HttpEntity entity, Type type) throws ConversionException { try { InputStreamReader isr = new InputStreamReader(entity.getContent(), "UTF-8"); return gson.fromJson(isr, type); } catch (IOException e) { throw new ConversionException(e); } catch (JsonParseException e) { throw new ConversionException(e); } }
Source:
<code>public CallBatcher<CallArgs, E> forArgsGenerator(CallArgsGenerator<E> generator) { <START> return new CallBatcherImpl(client, caller, java.lang.Void.class, generator); <END> }</code><technical_language>Void is imported in file, is reason package name prefix</technical_language>

Target:
public CallBatcher<Void, E> forArgsGenerator(CallArgsGenerator<E> generator) { return new CallBatcherImpl(client, caller, Void.class, generator); }
Source:
<code>public void producesPartsWithContentLength() throws IOException { final RqMultipart.Base multipart = new RqMultipart.Base( new RqFake( Arrays.asList( "POST /h?a=4 HTTP/1.1", "Host: rtw.example.com", "Content-Type: multipart/form-data; boundary=AaB01x", "Content-Length: 100007" ), Joiner.on("\r\n").join( "--AaB01x", "Content-Disposition: form-data; name=\"t2\"", "", "447 N Wolfe Rd, Sunnyvale, CA 94085", "--AaB01x" ) ) ); MatcherAssert.assertThat( Integer.parseInt( <START> new RqHeaders.Base( <END> multipart.part("t2") .iterator() .next() ).header("Content-Length") .get(0) ), Matchers.equalTo(102) ); }</code><technical_language>@exper0 HmRsHeader class instead</technical_language>

Target:
public void producesPartsWithContentLength() throws IOException { final RqMultipart.Base multipart = new RqMultipart.Base( new RqFake( Arrays.asList( "POST /h?a=4 HTTP/1.1", "Host: rtw.example.com", "Content-Type: multipart/form-data; boundary=AaB01x", "Content-Length: 100007" ), Joiner.on("\r\n").join( "--AaB01x", "Content-Disposition: form-data; name=\"t2\"", "", "447 N Wolfe Rd, Sunnyvale, CA 94085", "--AaB01x" ) ) ); MatcherAssert.assertThat( multipart.part("t2") .iterator() .next(), new HmRqHeader( "content-length", "102" ) ); }
Source:
<code>private void fillContactDataFromNickname(String nickname, List<Recipient> recipients, Map<String, Recipient> recipientMap) { Uri queryUri = ContactsContract.CommonDataKinds.Email.CONTENT_URI; final ContentResolver contentResolver = getContext().getContentResolver(); final int INDEX_CONTACT_ID = 0; final int INDEX_NICKNAME = 1; Cursor nicknameCursor = getNicknameCursor(nickname); if (nicknameCursor != null && nicknameCursor.moveToFirst()) { while (!nicknameCursor.isAfterLast()) { String id = nicknameCursor.getString(INDEX_CONTACT_ID); String selection = ContactsContract.Data.CONTACT_ID + " = ?"; Cursor cursor = contentResolver .query(queryUri, PROJECTION, selection, new String[] { id }, SORT_ORDER); fillContactDataFromCursor(cursor, recipients, recipientMap, nicknameCursor.getString(INDEX_NICKNAME)); nicknameCursor.moveToNext(); } <START> nicknameCursor.close(); <END> } }</code><technical_language>calling close() if cursor is empty (i.e. moveToFirst returns false)</technical_language>

Target:
private boolean fillContactDataFromNickname(String nickname, List<Recipient> recipients, Map<String, Recipient> recipientMap) { boolean hasContact = false; final ContentResolver contentResolver = getContext().getContentResolver(); Uri queryUri = Email.CONTENT_URI; Cursor nicknameCursor = getNicknameCursor(nickname); if (nicknameCursor == null) { return hasContact; } try { while (nicknameCursor.moveToNext()) { String id = nicknameCursor.getString(INDEX_CONTACT_ID_FOR_NICKNAME); String selection = ContactsContract.Data.CONTACT_ID + " = ?"; Cursor cursor = contentResolver .query(queryUri, PROJECTION, selection, new String[] { id }, SORT_ORDER); fillContactDataFromCursor(cursor, recipients, recipientMap, nicknameCursor.getString(INDEX_NICKNAME)); hasContact = true; } } finally { nicknameCursor.close(); } return hasContact; }
Source:
<code>@Override public Object[] toRow(final ConsumerRecord<String, String> message) { <START> Object[] fields = new Object[4]; <END> fields[0] = message.topic(); fields[1] = message.partition(); fields[2] = message.timestampType().name; return fields; }</code><technical_language>a array of size 4 3</technical_language>

Target:
@Override public Object[] toRow(final ConsumerRecord<String, String> message) { Object[] fields = new Object[3]; fields[0] = message.topic(); fields[1] = message.partition(); fields[2] = message.timestampType().name; return fields; }
Source:
<code>public void build() throws BuildException { if ( baseColumn instanceof ActionCol52 ) { final Action action = builderFactory.getActionBuilder() .with( rule ) .with( row ) .with( columnIndex ) .with( (ActionCol52) baseColumn ) .build(); <START> if ( action != null ) { <END> rule.getActions() .add( action ); } } else if ( baseColumn instanceof ConditionCol52 ) { if ( baseColumn instanceof BRLConditionVariableColumn ) { final Condition condition = builderFactory.getBRLConditionBuilder() .with( (BRLConditionVariableColumn) baseColumn ) .with( getRealCellValue( (BRLConditionVariableColumn) baseColumn, row.get( columnIndex ) ) ) .with( columnIndex ) .build(); rule.getConditions() .add( condition ); } else { final Condition condition = builderFactory.getFieldConditionsBuilder() .with( resolvePattern( rule ) ) .with( (ConditionCol52) baseColumn ) .with( getRealCellValue( (ConditionCol52) baseColumn, row.get( columnIndex ) ) ) .with( columnIndex ) .build(); rule.getConditions() .add( condition ); } } }</code><technical_language>"action" null do similar checks for "condition" below</technical_language>

Target:
public void build() throws BuildException { if ( baseColumn instanceof ActionCol52 ) { final Action action = builderFactory.getActionBuilder() .with( rule ) .with( row ) .with( columnIndex ) .with( (ActionCol52) baseColumn ) .build(); rule.getActions() .add( action ); } else if ( baseColumn instanceof ConditionCol52 ) { if ( baseColumn instanceof BRLConditionVariableColumn ) { final Condition condition = builderFactory.getBRLConditionBuilder() .with( (BRLConditionVariableColumn) baseColumn ) .with( getRealCellValue( (BRLConditionVariableColumn) baseColumn, row.get( columnIndex ) ) ) .with( columnIndex ) .build(); rule.getConditions() .add( condition ); } else { final Condition condition = builderFactory.getFieldConditionsBuilder() .with( resolvePattern( rule ) ) .with( (ConditionCol52) baseColumn ) .with( getRealCellValue( (ConditionCol52) baseColumn, row.get( columnIndex ) ) ) .with( columnIndex ) .build(); rule.getConditions() .add( condition ); } } }
Source:
<code>public void testTimestamp() throws InvalidParametersException, EntityAlreadyExistsException, EntityDoesNotExistException { ______TS("success : created"); StudentAttributes s = new StudentAttributes(); s.name = "valid student"; s.lastName = "student"; s.email = "valid-fresh@email.com"; s.team = "validTeamName"; s.section = "validSectionName"; s.comments = ""; s.googleId = "validGoogleId"; s.course = "valid-course"; studentsDb.createEntity(s); StudentAttributes student = studentsDb.getStudentForGoogleId(s.course, s.googleId); assertNotNull(student); AssertHelper.assertDateIsNow(student.getCreatedAt()); AssertHelper.assertDateIsNow(student.getUpdatedAt()); <START> ______TS("success : lastUpdated"); <END> s.name = "new-name"; studentsDb.updateStudentWithoutSearchability(s.course, s.email, s.name, s.team, s.section, s.email, s.googleId, s.comments); StudentAttributes updatedStudent = studentsDb.getStudentForGoogleId(s.course, s.googleId); assertFalse(student.getUpdatedAt().equals(updatedStudent.getUpdatedAt())); AssertHelper.assertDateIsNow(updatedStudent.getUpdatedAt()); ______TS("success : keep lastUpdated"); s.name = "new-name-2"; studentsDb.updateStudentWithoutSearchability(s.course, s.email, s.name, s.team, s.section, s.email, s.googleId, s.comments, true); StudentAttributes updatedStudent2 = studentsDb.getStudentForGoogleId(s.course, s.googleId); assertTrue(updatedStudent.getUpdatedAt().equals(updatedStudent2.getUpdatedAt())); }</code><technical_language>update lastUpdated? next test case lastUpdated</technical_language>

Target:
public void testTimestamp() throws InvalidParametersException, EntityAlreadyExistsException, EntityDoesNotExistException { ______TS("success : created"); StudentAttributes s = new StudentAttributes(); s.name = "valid student"; s.lastName = "student"; s.email = "valid-fresh@email.com"; s.team = "validTeamName"; s.section = "validSectionName"; s.comments = ""; s.googleId = "validGoogleId"; s.course = "valid-course"; studentsDb.createEntity(s); StudentAttributes student = studentsDb.getStudentForGoogleId(s.course, s.googleId); assertNotNull(student); AssertHelper.assertDateIsNow(student.getCreatedAt()); AssertHelper.assertDateIsNow(student.getUpdatedAt()); ______TS("success : update lastUpdated"); s.name = "new-name"; studentsDb.updateStudentWithoutSearchability(s.course, s.email, s.name, s.team, s.section, s.email, s.googleId, s.comments); StudentAttributes updatedStudent = studentsDb.getStudentForGoogleId(s.course, s.googleId); assertFalse(student.getUpdatedAt().equals(updatedStudent.getUpdatedAt())); AssertHelper.assertDateIsNow(updatedStudent.getUpdatedAt()); ______TS("success : keep lastUpdated"); s.name = "new-name-2"; studentsDb.updateStudentWithoutSearchability(s.course, s.email, s.name, s.team, s.section, s.email, s.googleId, s.comments, true); StudentAttributes updatedStudent2 = studentsDb.getStudentForGoogleId(s.course, s.googleId); assertTrue(updatedStudent.getUpdatedAt().equals(updatedStudent2.getUpdatedAt())); }
Source:
<code>protected void createExtend(TypeConstraint typeConstraint, Map<PVariable, Integer> variableMapping) { IInputKey inputKey = typeConstraint.getSupplierKey(); Tuple tuple = typeConstraint.getVariablesTuple(); int[] positions = new int[tuple.getSize()]; List<Integer> boundVariableIndices = new ArrayList<>(); Set<Integer> boundVariables = new HashSet<>(); for (int i = 0; i < tuple.getSize(); i++) { PVariable variable = (PVariable) tuple.get(i); Integer position = variableMapping.get(variable); positions[i] = position; if (variableBindings.get(typeConstraint).contains(position)) { boundVariables.add(position); boundVariableIndices.add(i); } } TupleMask indexerMask = TupleMask.fromSelectedIndices(inputKey.getArity(), boundVariableIndices); <START> TupleMask callMask = TupleMask.fromSelectedIndices(variableMapping.size(), positions); <END> operations.add(new GenericTypeExtend(inputKey, positions, callMask, indexerMask, boundVariables)); }</code><technical_language>this is incorrect; is a frame mask selects "wide" tuple - 'positions' argument is for that; 'thin' mask instead, callMask operation produce seed ITuple</technical_language>

Target:
protected void createExtend(TypeConstraint typeConstraint, Map<PVariable, Integer> variableMapping) { IInputKey inputKey = typeConstraint.getSupplierKey(); Tuple tuple = typeConstraint.getVariablesTuple(); int[] positions = new int[tuple.getSize()]; List<Integer> boundVariableIndices = new ArrayList<>(); Set<Integer> boundVariables = new HashSet<>(); for (int i = 0; i < tuple.getSize(); i++) { PVariable variable = (PVariable) tuple.get(i); Integer position = variableMapping.get(variable); positions[i] = position; if (variableBindings.get(typeConstraint).contains(position)) { boundVariables.add(position); boundVariableIndices.add(i); } } TupleMask indexerMask = TupleMask.fromSelectedIndices(inputKey.getArity(), boundVariableIndices); TupleMask callMask = TupleMask.fromSelectedIndices(variableMapping.size(), boundVariables); operations.add(new GenericTypeExtend(inputKey, positions, callMask, indexerMask, boundVariables)); }
Source:
<code>private File handleFileMessage(final File sourceFile, File tempFile, final File resultFile) throws IOException { if (!FileExistsMode.APPEND.equals(this.fileExistsMode) && this.deleteSourceFiles) { try { rename(sourceFile, resultFile); return resultFile; } catch (IOException e) { if (this.logger.isInfoEnabled()) { this.logger.info("Failed to move file '" + sourceFile + "'. Using copy and delete fallback.", e); } <START> } <END> } BufferedInputStream bis = new BufferedInputStream(new FileInputStream(sourceFile)); return handleInputStreamMessage(bis, sourceFile, tempFile, resultFile); }</code><technical_language>I is a need for this longer - Files.move() copy file if necessary - I tested OS X Files.move() moved file another physical disk. I suppose hurt leave here. WDYT</technical_language>

Target:
private File handleFileMessage(final File sourceFile, File tempFile, final File resultFile) throws IOException { if (!FileExistsMode.APPEND.equals(this.fileExistsMode) && this.deleteSourceFiles) { rename(sourceFile, resultFile); return resultFile; } else { BufferedInputStream bis = new BufferedInputStream(new FileInputStream(sourceFile)); return handleInputStreamMessage(bis, sourceFile, tempFile, resultFile); } }