auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testAlterStreamAddDropColumn() throws Exception { Client client = getClient(m_cluster); for (int i = 0; i < 100; i++) { Object[] data = new Object[3]; data[0] = 1; data[1] = i; data[2] = 1; m_verifier.addRow(client, "t", i, data); client.callProcedure("@AdHoc", "insert into t values(" + i + ", 1)"); } ClientResponse response = client.callProcedure("@AdHoc", "ALTER STREAM t ADD COLUMN new_column int BEFORE b"); assertEquals(ClientResponse.SUCCESS, response.getStatus()); for (int i = 100; i < 200; i++) { Object[] data = new Object[4]; data[0] = 1; data[1] = i; data[2] = i; data[3] = 1; m_verifier.addRow(client, "t", i, data); client.callProcedure("@AdHoc", "insert into t values(" + i + "," + i + ",1)"); } response = client.callProcedure("@AdHoc", "ALTER STREAM t DROP COLUMN new_column"); assertEquals(ClientResponse.SUCCESS, response.getStatus()); for (int i = 200; i < 300; i++) { Object[] data = new Object[3]; data[0] = 1; data[1] = i; data[2] = 1; m_verifier.addRow(client, "t", i, data); client.callProcedure("@AdHoc", "insert into t values(" + i + ", 1)"); } client.drain(); TestExportBaseSocketExport.waitForStreamedTargetAllocatedMemoryZero(client); m_verifier.verifyRows(); }

Target:
public void testAlterStreamAddDropColumn() throws Exception { Client client = getClient(m_cluster); Object[] data = new Object[3]; Arrays.fill(data, 1); insertToStream(0, 100, client, data); ClientResponse response = client.callProcedure("@AdHoc", "ALTER STREAM t ADD COLUMN new_column int BEFORE b"); assertEquals(ClientResponse.SUCCESS, response.getStatus()); Object[] data2 = new Object[4]; Arrays.fill(data2, 1); insertToStreamWithNewColumn(100, 100, client, data2); response = client.callProcedure("@AdHoc", "ALTER STREAM t DROP COLUMN new_column"); assertEquals(ClientResponse.SUCCESS, response.getStatus()); insertToStream(200, 100, client, data); client.drain(); TestExportBaseSocketExport.waitForStreamedTargetAllocatedMemoryZero(client); m_verifier.verifyRows(); }
Source:
public static <M extends MessageEnvelope> WindowFunction<M, Void, WindowKey<Void>, Collection<M>, WindowOutput<WindowKey<Void>, Collection<M>>> globalWindow() { BiFunction<M, Collection<M>, Collection<M>> aggregator = (m, c) -> { c.add(m); return c; }; return globalWindow(aggregator); }

Target:
public static <M extends MessageEnvelope> Window<M, Void, Collection<M>, WindowPane<Void, Collection<M>>> globalWindow() { BiFunction<M, Collection<M>, Collection<M>> aggregator = (m, c) -> { c.add(m); return c; }; return globalWindow(aggregator); }
Source:
static Result search(final Index index, final Parameter parameter, final String queryParameter, final String formatParameter, final int from, final int size) { List<Document> docs = new ArrayList<>(); final String field = formatParameter.contains(".") ? formatParameter.split("\\.")[1] : ""; final String format = formatParameter.contains(".") ? "full" : formatParameter; try { docs = Search.documents(queryParameter, index, parameter, from, size, field); } catch (IllegalArgumentException e) { Logger.error(e.getMessage(), e); return badRequest(e.getMessage()); } final ImmutableMap<ResultFormat, Result> results = results(parameter, queryParameter, docs, index, field); try { return results.get(ResultFormat.valueOf(format.toUpperCase())); } catch (IllegalArgumentException e) { Logger.error(e.getMessage(), e); return badRequest("Invalid 'format' parameter, use one of: " + Joiner.on(", ").join(results.keySet()).toLowerCase()); } }

Target:
static Result search(final Index index, final Parameter parameter, final String queryParameter, final String formatParameter, final int from, final int size) { List<Document> docs = new ArrayList<>(); Pair<String, String> fieldAndFormat; try { fieldAndFormat = getFieldAndFormat(formatParameter); docs = Search.documents(queryParameter, index, parameter, from, size, fieldAndFormat.getLeft()); } catch (IllegalArgumentException e) { Logger.error(e.getMessage(), e); return badRequest(e.getMessage()); } final ImmutableMap<ResultFormat, Result> results = results(parameter, queryParameter, docs, index, fieldAndFormat.getLeft()); try { return results.get(ResultFormat.valueOf(fieldAndFormat.getRight() .toUpperCase())); } catch (IllegalArgumentException e) { Logger.error(e.getMessage(), e); return badRequest("Invalid 'format' parameter, use one of: " + Joiner.on(", ").join(results.keySet()).toLowerCase()); } }
Source:
private Optional<Encryption> toEncryption(DwrfProto.Encryption encryption) { if (encryption.getEncryptionGroupsCount() == 0) { return Optional.empty(); } KeyProvider keyProvider = toKeyProvider(encryption.getKeyProvider()); List<EncryptionGroup> encryptionGroups = toEncryptionGroups(encryption.getEncryptionGroupsList()); return Optional.of(new Encryption(keyProvider, encryptionGroups)); }

Target:
private static DwrfEncryption toEncryption(DwrfProto.Encryption encryption) { KeyProvider keyProvider = toKeyProvider(encryption.getKeyProvider()); List<EncryptionGroup> encryptionGroups = toEncryptionGroups(encryption.getEncryptionGroupsList()); return new DwrfEncryption(keyProvider, encryptionGroups); }
Source:
private String messageFormatter(String msg, String vmid) { ObjectNode vmDetailNode = new ObjectMapper().createObjectNode(); vmDetailNode.put("status", msg); vmDetailNode.put("hash", Integer.toString(vmid.hashCode())); ObjectNode paramsNode = new ObjectMapper().createObjectNode(); paramsNode.put(vmid.toString(), vmDetailNode); paramsNode.put("notify_time", System.currentTimeMillis()); ObjectNode node = new ObjectMapper().createObjectNode(); node.put("params", paramsNode); node.put("jsonrpc","2.0"); node.put("method", "|virt|VM_status|" + vmid); return node.toString(); }

Target:
private String messageFormatter(String msg, String vmid) { ObjectNode vmDetailNode = new ObjectMapper().createObjectNode(); vmDetailNode.put("status", msg); vmDetailNode.put("hash", Integer.toString(vmid.hashCode())); ObjectNode paramsNode = new ObjectMapper().createObjectNode(); paramsNode.put(vmid.toString(), vmDetailNode); paramsNode.put("notify_time", System.nanoTime()); ObjectNode node = new ObjectMapper().createObjectNode(); node.put("params", paramsNode); node.put("jsonrpc","2.0"); node.put("method", "|virt|VM_status|" + vmid); return node.toString(); }
Source:
private void setupExpectedGlusterServersInfo() { expectedServers = new ArrayList<GlusterServerInfo>(); GlusterServerInfo server = new GlusterServerInfo(); server = new GlusterServerInfo(); server.setUuid(server_id3); server.setHostnameOrIp(TEST_SERVER3); server.setStatus(PeerStatus.CONNECTED); expectedServers.add(server); }

Target:
private void setupExpectedGlusterServersInfo() { expectedServers = new ArrayList<GlusterServerInfo>(); GlusterServerInfo server = new GlusterServerInfo(); server.setUuid(server_id3); server.setHostnameOrIp(TEST_SERVER3); server.setStatus(PeerStatus.CONNECTED); expectedServers.add(server); }
Source:
public String getAllExtractedLines() throws NuxeoException { if (extractedAllAsString == null) { PDDocument pdfDoc = null; try { pdfDoc = PDFUtils.load(pdfBlob, password); PDFTextStripper stripper = new PDFTextStripper(); extractedAllAsString = stripper.getText(pdfDoc); } catch (IOException e) { throw new NuxeoException("Failed to handle the pdf", e); } finally { PDFUtils.closeSilently(pdfDoc); } } return extractedAllAsString; }

Target:
public String getAllExtractedLines() throws NuxeoException { if (extractedAllAsString == null) { try (PDDocument pdfDoc = PDFUtils.load(pdfBlob, password)) { PDFTextStripper stripper = new PDFTextStripper(); extractedAllAsString = stripper.getText(pdfDoc); } catch (IOException e) { throw new NuxeoException("Failed to handle the pdf", e); } } return extractedAllAsString; }
Source:
public void testCancelConsumerBeforeConsumeOk() throws Exception { ConnectionFactory mockCF = mock(ConnectionFactory.class); Connection connection = mock(Connection.class); Channel channel = mock(Channel.class); given(connection.isOpen()).willReturn(true); given(mockCF.createConnection()).willReturn(connection); given(connection.createChannel(false)).willReturn(channel); given(channel.isOpen()).willReturn(true); final CountDownLatch latch1 = new CountDownLatch(1); ArgumentCaptor<Consumer> consumerCaptor = ArgumentCaptor.forClass(Consumer.class); final String tag = "tag"; willAnswer(i -> { latch1.countDown(); return tag; }).given(channel).basicConsume(eq("foo"), anyBoolean(), anyString(), anyBoolean(), anyBoolean(), anyMap(), consumerCaptor.capture()); DirectMessageListenerContainer container = new DirectMessageListenerContainer(mockCF); container.setQueueNames("foo"); container.setBeanName("backOff"); container.setConsumerTagStrategy(q -> "tag"); container.afterPropertiesSet(); container.start(); assertTrue(latch1.await(10, TimeUnit.SECONDS)); Consumer consumer = consumerCaptor.getValue(); Executors.newSingleThreadExecutor().execute(() -> container.stop()); verify(channel).basicCancel(tag); consumer.handleCancelOk(tag); }

Target:
public void testCancelConsumerBeforeConsumeOk() throws Exception { ConnectionFactory mockCF = mock(ConnectionFactory.class); Connection connection = mock(Connection.class); Channel channel = mock(Channel.class); given(connection.isOpen()).willReturn(true); given(mockCF.createConnection()).willReturn(connection); given(connection.createChannel(false)).willReturn(channel); given(channel.isOpen()).willReturn(true); final CountDownLatch latch1 = new CountDownLatch(1); final CountDownLatch latch2 = new CountDownLatch(1); ArgumentCaptor<Consumer> consumerCaptor = ArgumentCaptor.forClass(Consumer.class); final String tag = "tag"; willAnswer(i -> { latch1.countDown(); return tag; }).given(channel).basicConsume(eq("foo"), anyBoolean(), anyString(), anyBoolean(), anyBoolean(), anyMap(), consumerCaptor.capture()); DirectMessageListenerContainer container = new DirectMessageListenerContainer(mockCF); container.setQueueNames("foo"); container.setBeanName("backOff"); container.setConsumerTagStrategy(q -> "tag"); container.setShutdownTimeout(1); container.afterPropertiesSet(); container.start(); assertTrue(latch1.await(10, TimeUnit.SECONDS)); Consumer consumer = consumerCaptor.getValue(); Executors.newSingleThreadExecutor().execute(() -> { container.stop(); latch2.countDown(); }); assertTrue(latch2.await(10, TimeUnit.SECONDS)); verify(channel).basicCancel(tag); consumer.handleCancelOk(tag); }
Source:
public boolean matches(Object item) { if(item instanceof Shell){ if(new WindowMatcher(org.eclipse.jface.dialogs.TitleAreaDialog.class).matches(item)){ DefaultShell shell = new DefaultShell((Shell)item); TitleAreaDialog ta = new TitleAreaDialog(shell); return matcher.matches(ta.getTitle()); } } return false; }

Target:
public boolean matches(Object item) { if(item instanceof Shell){ try{ if(new WindowMatcher(org.eclipse.jface.dialogs.TitleAreaDialog.class).matches(item)){ DefaultShell shell = new DefaultShell((Shell)item); TitleAreaDialog ta = new TitleAreaDialog(shell); return matcher.matches(ta.getTitle()); } } catch (RedDeerException e) { if(((Shell) item).isDisposed()){ return false; } throw e; } } return false; }
Source:
public void doTileProcessing() { final ThreadPoolExecutor completedWorkExecutor = new ThreadPoolExecutorWithExceptions(1); final CompletedWorkChecker workChecker = new CompletedWorkChecker(); completedWorkExecutor.submit(workChecker); completedWorkExecutor.shutdown(); final ThreadPoolExecutorWithExceptions tileProcessingExecutor = new ThreadPoolExecutorWithExceptions(numThreads); for (final Integer tile : tiles) { tileProcessingExecutor.submit(new TileProcessor(tile, barcodesFiles.get(tile))); } tileProcessingExecutor.shutdown(); awaitThreadPoolTermination("Reading executor", tileProcessingExecutor); if(tileProcessingExecutor.exception != null) { completedWorkExecutor.purge(); barcodeWriterThreads.values().forEach(ThreadPoolExecutor::purge); List<Runnable> tasksStillRunning = new ArrayList<>(completedWorkExecutor.shutdownNow()); barcodeWriterThreads.values().forEach(executor -> tasksStillRunning.addAll(executor.shutdownNow())); throw new PicardException("Reading executor had exceptions " + tasksStillRunning.size() + " tasks were still running or queued and have been cancelled.", tileProcessingExecutor.exception); } else { awaitThreadPoolTermination("Tile completion executor", completedWorkExecutor); barcodeWriterThreads.values().forEach(ThreadPoolExecutor::shutdown); barcodeWriterThreads.forEach((barcode, executor) -> awaitThreadPoolTermination(barcode + " writer", executor)); } }

Target:
public void doTileProcessing() { final ThreadPoolExecutor completedWorkExecutor = new ThreadPoolExecutorWithExceptions(1); final CompletedWorkChecker workChecker = new CompletedWorkChecker(); completedWorkExecutor.submit(workChecker); completedWorkExecutor.shutdown(); final ThreadPoolExecutorWithExceptions tileProcessingExecutor = new ThreadPoolExecutorWithExceptions(numThreads); for (final Integer tile : tiles) { tileProcessingExecutor.submit(new TileProcessor(tile, barcodesFiles.get(tile))); } tileProcessingExecutor.shutdown(); awaitThreadPoolTermination("Reading executor", tileProcessingExecutor); if (tileProcessingExecutor.exception != null) { int tasksStillRunning = completedWorkExecutor.shutdownNow().size(); tasksStillRunning += barcodeWriterThreads.values().stream().mapToLong(executor -> executor.shutdownNow().size()).sum(); throw new PicardException("Reading executor had exceptions. There were " + tasksStillRunning + " tasks were still running or queued and have been cancelled.", tileProcessingExecutor.exception); } else { awaitThreadPoolTermination("Tile completion executor", completedWorkExecutor); barcodeWriterThreads.values().forEach(ThreadPoolExecutor::shutdown); barcodeWriterThreads.forEach((barcode, executor) -> awaitThreadPoolTermination(barcode + " writer", executor)); } }
Source:
private boolean addMessage(Message<?> message) { Object sequence = message.getHeaders().get(IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER); if (sequence instanceof Integer) { this.sequences.add((Integer) sequence); } return this.messages.add(message); }

Target:
private boolean addMessage(Message<?> message) { Integer sequence = message.getHeaders().get(IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER, Integer.class); this.sequences.add(sequence != null ? sequence : 0); return this.messages.add(message); }
Source:
public void pickBestPath() { BubbleMergeWithSearchVertexValueWritable vertex = getVertexValue(); int k = 1; VKmerList pathList = vertex.getArrayOfPathList().get(k); EdgeTypeList edgeTypes = vertex.getArrayOfEdgeTypes().get(k); for (EDGETYPE et : EDGETYPE.OUTGOING) { for (VKmer dest : vertex.getEdgeMap(et).keySet()) { if (edgeTypes.get(0) == et && pathList.getPosition(1).equals(dest)) continue; vertex.getEdgeMap(et).remove(dest); } } VKmerList kmerList = new VKmerList(); for (int i = 1; i < pathList.size(); i++) { VKmer dest = new VKmer(pathList.getPosition(i)); outgoingMsg.reset(); outgoingMsg.setFlag(BubbleMergeWithSearchState.KILL_MESSAGE_FROM_SOURCE); kmerList.reset(); kmerList.append(pathList.getPosition(i - 1)); if (i + 1 < pathList.size()) { kmerList.append(pathList.getPosition(i + 1)); } outgoingMsg.setPathList(kmerList); outgoingMsg.getEdgeTypeList().add(edgeTypes.get(i - 1).mirror()); if (i < edgeTypes.size()) outgoingMsg.getEdgeTypeList().add(edgeTypes.get(i)); sendMsg(dest, outgoingMsg); } }

Target:
public void pickBestPath() { BubbleMergeWithSearchVertexValueWritable vertex = getVertexValue(); int k = 1; VKmerList pathList = vertex.getArrayOfPathList().get(k); EdgeTypeList edgeTypes = vertex.getArrayOfEdgeTypes().get(k); for (EDGETYPE et : SEARCH_DIRECTION.edgeTypes()) { for (VKmer dest : vertex.getEdgeMap(et).keySet()) { if (edgeTypes.get(0) == et && pathList.getPosition(1).equals(dest)) continue; vertex.getEdgeMap(et).remove(dest); } } VKmerList kmerList = new VKmerList(); for (int i = 1; i < pathList.size(); i++) { VKmer dest = new VKmer(pathList.getPosition(i)); outgoingMsg.reset(); if (i == pathList.size() - 1) outgoingMsg.setFlag(BubbleMergeWithSearchState.SAVE_ONLY_PATH_NODES_LAST_NODE); else outgoingMsg.setFlag(BubbleMergeWithSearchState.SAVE_ONLY_PATH_NODES); kmerList.reset(); kmerList.append(pathList.getPosition(i - 1)); if (i + 1 < pathList.size()) { kmerList.append(pathList.getPosition(i + 1)); } outgoingMsg.setPathList(kmerList); outgoingMsg.getEdgeTypeList().add(edgeTypes.get(i - 1).mirror()); if (i < edgeTypes.size()) outgoingMsg.getEdgeTypeList().add(edgeTypes.get(i)); sendMsg(dest, outgoingMsg); } }
Source:
private boolean map(KeyCacheObject key, boolean forceKeys) { try { int keyPart = cctx.affinity().partition(key); GridDhtLocalPartition part = topVer.topologyVersion() > 0 ? cache().topology().localPartition(keyPart, topVer, true) : cache().topology().localPartition(keyPart); if (part == null) return false; assert this.part == -1; if (!forceKeys && part.state() == LOST && !recovery) { Throwable error = LostPolicyValidator.validate(cctx, key, READ, singleton(part.id())); if (error != null) { onDone(null, error); return false; } } if (part.reserve()) { boolean mvccNoOwners = false; if (cctx.mvccEnabled()) mvccNoOwners = cctx.topology().owners(cctx.affinity().partition(key), topVer).isEmpty(); if (forceKeys || (part.state() == OWNING || part.state() == LOST) || mvccNoOwners) { this.part = part.id(); return true; } else { part.release(); return false; } } else return false; } catch (GridDhtInvalidPartitionException ex) { return false; } }

Target:
private boolean map(KeyCacheObject key, boolean forceKeys) { try { int keyPart = cctx.affinity().partition(key); if (cctx.mvccEnabled()) { boolean noOwners = cctx.topology().owners(keyPart, topVer).isEmpty(); if (noOwners) forceKeys = true; } GridDhtLocalPartition part = topVer.topologyVersion() > 0 ? cache().topology().localPartition(keyPart, topVer, true) : cache().topology().localPartition(keyPart); if (part == null) return false; assert this.part == -1; if (!forceKeys && part.state() == LOST && !recovery) { Throwable error = LostPolicyValidator.validate(cctx, key, READ, singleton(part.id())); if (error != null) { onDone(null, error); return false; } } if (part.reserve()) { if (forceKeys || (part.state() == OWNING || part.state() == LOST)) { this.part = part.id(); return true; } else { part.release(); return false; } } else return false; } catch (GridDhtInvalidPartitionException ex) { return false; } }
Source:
private FileMetadata putSingleBody(Exchange exchange, String dropboxPath, DropboxUploadMode mode) throws Exception { byte[] data = exchange.getIn().getMandatoryBody(byte[].class); InputStream is = new ByteArrayInputStream(data); try { FileMetadata uploadedFile; WriteMode uploadMode; if (mode == DropboxUploadMode.force) { uploadMode = WriteMode.OVERWRITE; } else { uploadMode = WriteMode.ADD; } uploadedFile = client.files().upload(dropboxPath).uploadAndFinish(is, data.length); return uploadedFile; } finally { IOHelper.close(is); } }

Target:
private FileMetadata putSingleBody(Exchange exchange, String dropboxPath, DropboxUploadMode mode) throws Exception { byte[] data = exchange.getIn().getMandatoryBody(byte[].class); InputStream is = new ByteArrayInputStream(data); try { FileMetadata uploadedFile; WriteMode uploadMode; if (mode == DropboxUploadMode.force) { uploadMode = WriteMode.OVERWRITE; } else { uploadMode = WriteMode.ADD; } uploadedFile = client.files().uploadBuilder(dropboxPath).withMode(uploadMode).uploadAndFinish(is, data.length); return uploadedFile; } finally { IOHelper.close(is); } }
Source:
private void generatePathLocator() { javaBuffer.addImport(BASE_PACKAGE + ".Service"); javaBuffer.addDocComment("Resource locator method, returns individual resource on which the URI is dispatched."); javaBuffer.addLine("Service service(String path);"); }

Target:
private void generatePathLocator() { javaBuffer.addImport(BASE_PACKAGE + ".Service"); javaBuffer.addDocComment("Service locator method, returns individual service on which the URI is dispatched."); javaBuffer.addLine("Service service(String path);"); }
Source:
public DependencyState( final Properties userProps ) { overrideTransitive = Boolean.valueOf( userProps.getProperty( "overrideTransitive", "true" ) ); overrideDependencies = Boolean.valueOf( userProps.getProperty( "overrideDependencies", "true" ) ); strict = Boolean.valueOf( userProps.getProperty( STRICT_DEPENDENCIES, "false" ) ); ignoreSuffix = Boolean.valueOf( userProps.getProperty( STRICT_ALIGNMENT_IGNORE_SUFFIX, "false" ) ); failOnStrictViolation = Boolean.valueOf( userProps.getProperty( STRICT_VIOLATION_FAILS, "false" ) ); remoteBOMdepMgmt = IdUtils.parseGAVs( userProps.getProperty( DEPENDENCY_MANAGEMENT_POM_PROPERTY ) ); dependencyExclusions = PropertiesUtils.getPropertiesByPrefix( userProps, DEPENDENCY_EXCLUSION_PREFIX ); if ( dependencyExclusions.isEmpty()) { dependencyExclusions = PropertiesUtils.getPropertiesByPrefix( userProps, DEPENDENCY_OVERRIDE_PREFIX ); } }

Target:
public DependencyState( final Properties userProps ) throws ManipulationException { overrideTransitive = Boolean.valueOf( userProps.getProperty( "overrideTransitive", "true" ) ); overrideDependencies = Boolean.valueOf( userProps.getProperty( "overrideDependencies", "true" ) ); strict = Boolean.valueOf( userProps.getProperty( STRICT_DEPENDENCIES, "false" ) ); ignoreSuffix = Boolean.valueOf( userProps.getProperty( STRICT_ALIGNMENT_IGNORE_SUFFIX, "false" ) ); failOnStrictViolation = Boolean.valueOf( userProps.getProperty( STRICT_VIOLATION_FAILS, "false" ) ); remoteBOMdepMgmt = IdUtils.parseGAVs( userProps.getProperty( DEPENDENCY_MANAGEMENT_POM_PROPERTY ) ); dependencyExclusions = getPropertiesByPrefix( userProps, DEPENDENCY_EXCLUSION_PREFIX ); Map<String, String> oP = PropertiesUtils.getPropertiesByPrefix( userProps, DEPENDENCY_OVERRIDE_PREFIX ); for ( String s : oP.keySet() ) { if ( dependencyExclusions.put( s, oP.get( s ) ) != null ) { throw new ManipulationException( "Property clash between dependencyOverride and dependencyExclusion for " + s ); } } }
Source:
static RestTemplate createRestTemplate(GoodDataEndpoint endpoint, HttpClient httpClient) { final UriPrefixingClientHttpRequestFactory factory = new UriPrefixingClientHttpRequestFactory( new HttpComponentsClientHttpRequestFactory(httpClient), endpoint.getHostname(), endpoint.getPort(), endpoint.getProtocol() ); final RestTemplate restTemplate = new RestTemplate(factory); restTemplate.setInterceptors(Arrays.<ClientHttpRequestInterceptor>asList( new HeaderSettingRequestInterceptor(singletonMap("Accept", getAcceptHeaderValue())))); restTemplate.setErrorHandler(new ResponseErrorHandler(restTemplate.getMessageConverters())); return restTemplate; }

Target:
static RestTemplate createRestTemplate(GoodDataEndpoint endpoint, HttpClient httpClient) { notNull(endpoint, "endpoint"); notNull(httpClient, "httpClient"); final UriPrefixingClientHttpRequestFactory factory = new UriPrefixingClientHttpRequestFactory( new HttpComponentsClientHttpRequestFactory(httpClient), endpoint.getHostname(), endpoint.getPort(), endpoint.getProtocol() ); final RestTemplate restTemplate = new RestTemplate(factory); restTemplate.setInterceptors(Arrays.<ClientHttpRequestInterceptor>asList( new HeaderSettingRequestInterceptor(singletonMap("Accept", getAcceptHeaderValue())))); restTemplate.setErrorHandler(new ResponseErrorHandler(restTemplate.getMessageConverters())); return restTemplate; }
Source:
private static <D, T, S> double[] calculateLogBackwardProbabilities(final HiddenMarkovModel<D, T, S> model, final List<D> dataList, final List<T> positionList) { final List<S> states = model.hiddenStates(); final int width = states.size(); final int length = dataList.size(); final double[] result = new double[width * length]; if (length == 0) { return result; } final double[] logSumBuffer = new double[states.size()]; for (int t = length - 2; t >= 0; --t) { final int u = t + 1; final int tOffset = width * t; final int uOffset = tOffset + width; final T positionT = positionList.get(t); final T positionU = positionList.get(u); for (int sT = 0; sT < width; sT++) { final S stateT = states.get(sT); for (int sU = 0; sU < width; sU++) { logSumBuffer[sU] = result[sU + uOffset] + model.logTransitionProbability(stateT, positionT, states.get(sU), positionU) + model.logEmissionProbability(dataList.get(u), states.get(sU), positionU); } result[sT + tOffset] = MathUtils.approximateLogSumLog(logSumBuffer); } } return result; }

Target:
private static <D, T, S> double[][] calculateLogBackwardProbabilities(final HiddenMarkovModel<D, T, S> model, final List<D> dataList, final List<T> positionList) { final List<S> states = model.hiddenStates(); final int numStates = states.size(); final int length = dataList.size(); final double[][] result = new double[length][numStates]; if (length == 0) { return result; } final double[] logSumBuffer = new double[states.size()]; for (int thisPositionIndex = length - 2; thisPositionIndex >= 0; --thisPositionIndex) { final int nextPositionIndex = thisPositionIndex + 1; final T thisPosition = positionList.get(thisPositionIndex); final T nextPosition = positionList.get(nextPositionIndex); for (int thisStateIndex = 0; thisStateIndex < numStates; thisStateIndex++) { final S thisState = states.get(thisStateIndex); for (int nextStateIndex = 0; nextStateIndex < numStates; nextStateIndex++) { logSumBuffer[nextStateIndex] = result[nextPositionIndex][nextStateIndex] + model.logTransitionProbability(thisState, thisPosition, states.get(nextStateIndex), nextPosition) + model.logEmissionProbability(dataList.get(nextPositionIndex), states.get(nextStateIndex), nextPosition); } result[thisPositionIndex][thisStateIndex] = MathUtils.approximateLogSumLog(logSumBuffer); } } return result; }
Source:
public void testSortByPriority() { ProviderFactory pf = ServerProviderFactory.getInstance(); List<Object> providers = new ArrayList<>(); BookReaderWriter bookHandler = new BookReaderWriter(); providers.add(bookHandler); HighPriorityBookReaderWriter highPriorityBookHandler = new HighPriorityBookReaderWriter(); providers.add(highPriorityBookHandler); pf.setUserProviders(providers); assertSame(highPriorityBookHandler, pf.createMessageBodyReader(Book.class, Book.class, new Annotation[]{}, MediaType.APPLICATION_XML_TYPE, new MessageImpl())); assertSame(highPriorityBookHandler, pf.createMessageBodyWriter(Book.class, Book.class, new Annotation[]{}, MediaType.APPLICATION_XML_TYPE, new MessageImpl())); pf = ServerProviderFactory.getInstance(); providers = new ArrayList<>(); highPriorityBookHandler = new HighPriorityBookReaderWriter(); providers.add(highPriorityBookHandler); bookHandler = new BookReaderWriter(); providers.add(bookHandler); pf.setUserProviders(providers); assertSame(highPriorityBookHandler, pf.createMessageBodyReader(Book.class, Book.class, new Annotation[]{}, MediaType.APPLICATION_XML_TYPE, new MessageImpl())); assertSame(highPriorityBookHandler, pf.createMessageBodyWriter(Book.class, Book.class, new Annotation[]{}, MediaType.APPLICATION_XML_TYPE, new MessageImpl())); }

Target:
public void testSortByPriority() { ProviderFactory pf = ServerProviderFactory.getInstance(); List<Object> providers = new ArrayList<>(); BookReaderWriter bookHandler = new BookReaderWriter(); providers.add(bookHandler); HighPriorityBookReaderWriter highPriorityBookHandler = new HighPriorityBookReaderWriter(); providers.add(highPriorityBookHandler); pf.setUserProviders(providers); assertSame(highPriorityBookHandler, pf.createMessageBodyReader(Book.class, Book.class, new Annotation[]{}, MediaType.APPLICATION_XML_TYPE, new MessageImpl())); assertSame(highPriorityBookHandler, pf.createMessageBodyWriter(Book.class, Book.class, new Annotation[]{}, MediaType.APPLICATION_XML_TYPE, new MessageImpl())); }
Source:
public void testGetWithSource() throws Exception { config(null); File jar = repo.get("org.osgi.dto", new Version("1.0.0.201505202023"), null); assertThat(jar.isFile()).isTrue(); File sources = repo.get("org.osgi.dto.source", new Version("1.0.0.201505202023"), null); assertThat(sources.isFile()).isTrue(); }

Target:
public void testGetWithSource() throws Exception { config(null); File jar = repo.get("org.osgi.dto", new Version("1.0.0.201505202023"), null); assertThat(jar).isFile(); File sources = repo.get("org.osgi.dto.source", new Version("1.0.0.201505202023"), null); assertThat(sources).isFile(); }
Source:
private StudyDetails convertToStudyDetails(final UserSelection userSelection) { final StudyDetails studyDetails = new StudyDetails(); studyDetails.setStudyName(userSelection.getStudyName()); studyDetails.setEndDate(ETLServiceImpl.formatDate(userSelection.getStudyEndDate())); studyDetails.setObjective(userSelection.getStudyObjective()); studyDetails.setDescription(userSelection.getStudyDescription()); if (!StringUtils.isEmpty(userSelection.getStudyType())) { studyDetails.setStudyType(StudyType.valueOf(userSelection.getStudyType())); } else { studyDetails.setStudyType(StudyType.N); } studyDetails.setDescription(userSelection.getStudyDescription()); studyDetails.setStartDate(ETLServiceImpl.formatDate(userSelection.getStudyStartDate())); if (userSelection.getStudyId() != null) { studyDetails.setId(userSelection.getStudyId()); } return studyDetails; }

Target:
private StudyDetails convertToStudyDetails(final UserSelection userSelection) { final StudyDetails studyDetails = new StudyDetails(); studyDetails.setStudyName(userSelection.getStudyName()); studyDetails.setEndDate(ETLServiceImpl.formatDate(userSelection.getStudyEndDate())); studyDetails.setObjective(userSelection.getStudyObjective()); if (!StringUtils.isEmpty(userSelection.getStudyType())) { studyDetails.setStudyType(StudyType.valueOf(userSelection.getStudyType())); } else { studyDetails.setStudyType(StudyType.N); } studyDetails.setDescription(userSelection.getStudyDescription()); studyDetails.setStartDate(ETLServiceImpl.formatDate(userSelection.getStudyStartDate())); if (userSelection.getStudyId() != null) { studyDetails.setId(userSelection.getStudyId()); } return studyDetails; }
Source:
public void setAlphabeticallySortActive(boolean sort) { this.alphabeticallySort = sort; }

Target:
private void setAlphabeticallySortActive(boolean sort) { this.alphabeticallySort = sort; }
Source:
public static boolean shouldUseBitmapIndex( Filter filter, BitmapIndexSelector indexSelector, @Nullable FilterTuning filterTuning ) { final FilterTuning tuning = filterTuning != null ? filterTuning : FilterTuning.createDefault(filter, indexSelector); if (filter.supportsBitmapIndex(indexSelector) && tuning.getUseBitmapIndex()) { return filter.getRequiredColumns().stream().allMatch(column -> { final BitmapIndex index = indexSelector.getBitmapIndex(column); Preconditions.checkNotNull(index, "WTF?! column doesn't have a bitmap index"); final int cardinality = index.getCardinality(); return cardinality >= tuning.getMinCardinalityToUseBitmapIndex() && cardinality <= tuning.getMaxCardinalityToUseBitmapIndex(); }); } return false; }

Target:
public static boolean shouldUseBitmapIndex( Filter filter, BitmapIndexSelector indexSelector, @Nullable FilterTuning filterTuning ) { final FilterTuning tuning = filterTuning != null ? filterTuning : FilterTuning.createDefault(filter, indexSelector); if (filter.supportsBitmapIndex(indexSelector) && tuning.getUseBitmapIndex()) { return filter.getRequiredColumns().stream().allMatch(column -> { final BitmapIndex index = indexSelector.getBitmapIndex(column); Preconditions.checkNotNull(index, "Column does not have a bitmap index"); final int cardinality = index.getCardinality(); return cardinality >= tuning.getMinCardinalityToUseBitmapIndex() && cardinality <= tuning.getMaxCardinalityToUseBitmapIndex(); }); } return false; }
Source:
private void addVote() { List<Vote> votes = new Vector<>(); Collections.addAll(votes, evaluator.getPredictionVotes()); Vote[] finalVotes = votes.toArray(new Vote[votes.size()]); learningCurve.setVote(finalVotes); logger.debug("evaluator id = {}", this.id); if (immediatePredictionStream != null) { if (firstVoteDump) { immediatePredictionStream.println(learningCurve.voteHeaderToString()); firstVoteDump = false; } immediatePredictionStream.println(learningCurve.voteEntryToString()); immediatePredictionStream.flush(); } }

Target:
private void addVote() { Vote[] finalVotes = evaluator.getPredictionVotes(); learningCurve.setVote(finalVotes); logger.debug("evaluator id = {}", this.id); if (immediatePredictionStream != null) { if (firstVoteDump) { immediatePredictionStream.println(learningCurve.voteHeaderToString()); firstVoteDump = false; } immediatePredictionStream.println(learningCurve.voteEntryToString()); immediatePredictionStream.flush(); } }
Source:
protected void initialize(AFCliRequest cliRequest) throws ExitException { if (cliRequest.getWorkingDirectory() == null) { cliRequest.setWorkingDirectory(System.getProperty("user.dir")); } if (cliRequest.getMultiModuleProjectDirectory() == null) { String basedirProperty = System.getProperty(MULTIMODULE_PROJECT_DIRECTORY); if (basedirProperty == null) { System.err.format("-D%s system propery is not set." + " Check $M2_HOME environment variable and mvn script match.", MULTIMODULE_PROJECT_DIRECTORY); throw new ExitException(1); } Path basedir = Paths.get(basedirProperty); cliRequest.setMultiModuleProjectDirectory(basedir.toAbsolutePath().toString()); } }

Target:
protected void initialize(AFCliRequest cliRequest) throws ExitException { if (cliRequest.getWorkingDirectory() == null) { cliRequest.setWorkingDirectory(System.getProperty("user.dir")); } if (cliRequest.getMultiModuleProjectDirectory() == null) { String basedirProperty = System.getProperty(MULTIMODULE_PROJECT_DIRECTORY); if (basedirProperty == null) { System.err.format("-D%s system propery is not set." + " Check $M2_HOME environment variable and mvn script match.", MULTIMODULE_PROJECT_DIRECTORY); throw new ExitException(1); } Path basedir = basedirProperty != null ? Paths.get(basedirProperty) : Paths.get(""); cliRequest.setMultiModuleProjectDirectory(basedir.toAbsolutePath().toString()); } }
Source:
private String heidelTimeNormalize(Constituent temporal_phrase) throws Exception { if (this.dct == null) { this.dct = new Date(); } String xml_res = this.heidelTime.process(temporal_phrase.toString(), this.dct); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse(new InputSource(new StringReader(xml_res))); Element rootElement = document.getDocumentElement(); String res = recurseNormalizedTimeML(rootElement); return res; }

Target:
private String heidelTimeNormalize(Constituent temporal_phrase) throws Exception { if (this.dct == null) { this.dct = new Date(); timexNormalizer.setTime(this.dct); } String xml_res = this.heidelTime.process(temporal_phrase.toString(), this.dct); int startIndex = xml_res.indexOf("<TimeML>"); xml_res = xml_res.substring(startIndex); Interval interval_res = timexNormalizer.normalize(xml_res); String string_res = interval_res==null?"":interval_res.toString(); return string_res; }
Source:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append("filter="); sb.append(filter); sb.append(",startIndex="); sb.append(startIndex); sb.append(",pageSize="); sb.append(pageSize); sb.append(",requestsTotalResultsCount="); sb.append(requestsTotalResultsCount); sb.append(",timeoutMillis="); sb.append(timeoutMillis); sb.append(",sortBy="); sb.append(sortBy); sb.append(",properties="); sb.append(properties); return sb.toString(); }

Target:
public String toString() { return "QueryImpl{" + "filter=" + filter + ", startIndex=" + startIndex + ", pageSize=" + pageSize + ", requestsTotalResultsCount=" + requestsTotalResultsCount + ", timeoutMillis=" + timeoutMillis + ", sortBy=" + sortBy + ", properties=" + properties + '}'; }
Source:
public void move(@Nullable Collection<Path> pathsToDelete, @Nullable Collection<PathMetadata> pathsToCreate, @Nullable final BulkOperationState operationState) throws IOException { if (pathsToDelete == null && pathsToCreate == null) { return; } LOG.debug("Moving paths of table in region {}: paths to delete and {}" + " paths to create", tableName, region, pathsToDelete == null ? 0 : pathsToDelete.size(), pathsToCreate == null ? 0 : pathsToCreate.size()); LOG.trace("move: pathsToDelete = {}, pathsToCreate = {}", pathsToDelete, pathsToCreate); AncestorState ancestorState = extractOrCreate(operationState, BulkOperationState.OperationType.Rename); List<DDBPathMetadata> newItems = new ArrayList<>(); if (pathsToCreate != null) { synchronized (ancestorState) { newItems.addAll( completeAncestry( pathMetaToDDBPathMeta(pathsToCreate), ancestorState, extractTimeProvider(ttlTimeProvider))); } } newItems.sort(PathOrderComparators.TOPMOST_PM_FIRST); if (pathsToDelete != null) { List<DDBPathMetadata> tombstones = new ArrayList<>(pathsToDelete.size()); for (Path meta : pathsToDelete) { Preconditions.checkArgument(ttlTimeProvider != null, "ttlTimeProvider" + " must not be null"); final PathMetadata pmTombstone = PathMetadata.tombstone(meta); pmTombstone.setLastUpdated(ttlTimeProvider.getNow()); tombstones.add(new DDBPathMetadata(pmTombstone)); } tombstones.sort(PathOrderComparators.TOPMOST_PM_LAST); newItems.addAll(tombstones); } processBatchWriteRequest(null, pathMetadataToItem(newItems)); }

Target:
public void move(@Nullable Collection<Path> pathsToDelete, @Nullable Collection<PathMetadata> pathsToCreate, @Nullable final BulkOperationState operationState) throws IOException { if (pathsToDelete == null && pathsToCreate == null) { return; } LOG.debug("Moving paths of table in region {}: paths to delete and {}" + " paths to create", tableName, region, pathsToDelete == null ? 0 : pathsToDelete.size(), pathsToCreate == null ? 0 : pathsToCreate.size()); LOG.trace("move: pathsToDelete = {}, pathsToCreate = {}", pathsToDelete, pathsToCreate); AncestorState ancestorState = extractOrCreate(operationState, BulkOperationState.OperationType.Rename); List<DDBPathMetadata> newItems = new ArrayList<>(); if (pathsToCreate != null) { synchronized (ancestorState) { newItems.addAll( completeAncestry( pathMetaToDDBPathMeta(pathsToCreate), ancestorState)); } } newItems.sort(PathOrderComparators.TOPMOST_PM_FIRST); if (pathsToDelete != null) { List<DDBPathMetadata> tombstones = new ArrayList<>(pathsToDelete.size()); for (Path meta : pathsToDelete) { Preconditions.checkArgument(ttlTimeProvider != null, "ttlTimeProvider" + " must not be null"); final PathMetadata pmTombstone = PathMetadata.tombstone(meta); pmTombstone.setLastUpdated(ttlTimeProvider.getNow()); tombstones.add(new DDBPathMetadata(pmTombstone)); } tombstones.sort(PathOrderComparators.TOPMOST_PM_LAST); newItems.addAll(tombstones); } processBatchWriteRequest(ancestorState, null, pathMetadataToItem(newItems)); }
Source:
protected ConcurrentClassLoader(final ConcurrentClassLoader parent, final String name) { super(parent == null ? ConcurrentClassLoader.class.getClassLoader() : parent, name); if (getClassLoadingLock("$TEST$") == this) { throw new Error("Cannot instantiate non-parallel subclass"); } }

Target:
protected ConcurrentClassLoader(final ConcurrentClassLoader parent, final String name) { super(parent == null ? ConcurrentClassLoader.class.getClassLoader() : parent, name); if (! JDKSpecific.isParallelCapable(this)) { throw new Error("Cannot instantiate non-parallel subclass"); } }
Source:
public void run(SourceContext<T> ctx) throws Exception { double taskRowsPerSecond = (double) rowsPerSecond / getRuntimeContext().getNumberOfParallelSubtasks(); long nextReadTime = System.currentTimeMillis(); while (isRunning) { for (int i = 0; i < taskRowsPerSecond; i++) { if (isRunning && generator.hasNext() && (numberOfRows == null || outputSoFar < toOutput)) { synchronized (ctx.getCheckpointLock()) { if (numberOfRows != null) { outputSoFar++; } ctx.collect(this.generator.next()); } } else { return; } } nextReadTime += 1000; long toWaitMs = nextReadTime - System.currentTimeMillis(); while (toWaitMs > 0) { Thread.sleep(toWaitMs); toWaitMs = nextReadTime - System.currentTimeMillis(); } } }

Target:
public void run(SourceContext<T> ctx) throws Exception { double taskRowsPerSecond = (double) rowsPerSecond / getRuntimeContext().getNumberOfParallelSubtasks(); long nextReadTime = System.currentTimeMillis(); while (isRunning) { for (int i = 0; i < taskRowsPerSecond; i++) { if (isRunning && generator.hasNext() && (numberOfRows == null || outputSoFar < toOutput)) { synchronized (ctx.getCheckpointLock()) { outputSoFar++; ctx.collect(this.generator.next()); } } else { return; } } nextReadTime += 1000; long toWaitMs = nextReadTime - System.currentTimeMillis(); while (toWaitMs > 0) { Thread.sleep(toWaitMs); toWaitMs = nextReadTime - System.currentTimeMillis(); } } }
Source:
JSONObject getDebugState() { JSONObject debugState = new JSONObject(); debugState.put("octoReceiver", octoReceiver.getDebugState()); debugState.put("mediaStreamTracks", mediaStreamTracks.getNodeStats().toJson()); return debugState; }

Target:
JSONObject getDebugState() { JSONObject debugState = new JSONObject(); debugState.put("octoReceiver", octoReceiver.getDebugState()); debugState.put("octoSender", octoSender.getDebugState()); debugState.put("mediaStreamTracks", mediaStreamTracks.getNodeStats().toJson()); return debugState; }
Source:
public List<Integer> queryYearlyMetrics(String targetType, String targetId, String name, LocalDate from, LocalDate to) { List<Integer> result = new ArrayList<>(); LocalDate date = from; while (!date.isAfter(to)) { result.add(queryMetric(getYearlyMetricType(), targetType, targetId, name, date.getYear(), null, null)); date = date.plusYears(1); } return result; }

Target:
public List<Integer> queryYearlyMetrics(String targetType, String targetId, String name, LocalDate from, LocalDate to) { List<Integer> result = new ArrayList<>(); LocalDate date = from; AtomicInteger limit = new AtomicInteger(MAX_YEARLY_METRICS); while (!date.isAfter(to) && limit.decrementAndGet() > 0) { result.add(queryMetric(getYearlyMetricType(), targetType, targetId, name, date.getYear(), null, null)); date = date.plusYears(1); } return result; }
Source:
private static String getNodeOpeningTag(Node currentNode) { StringBuilder openingTag = new StringBuilder(); openingTag.append("<" + currentNode.getNodeName().toLowerCase()); NamedNodeMap attributes = currentNode.getAttributes(); if (attributes != null) { for (int i = 0; i < attributes.getLength(); i++) { Node attribute = attributes.item(i); openingTag.append(" " + attribute.getNodeName().toLowerCase() + "=" + "\"" + attribute.getNodeValue().replace("\"", "&quot;") + "\""); } } openingTag.append(getEndOfOpeningTag(currentNode) + "\n"); return openingTag.toString(); }

Target:
private static String getNodeOpeningTag(Node currentNode) { StringBuilder openingTag = new StringBuilder(); openingTag.append("<" + currentNode.getNodeName().toLowerCase()); NamedNodeMap attributes = currentNode.getAttributes(); for (int i = 0; i < attributes.getLength(); i++) { Node attribute = attributes.item(i); openingTag.append(" " + attribute.getNodeName().toLowerCase() + "=" + "\"" + attribute.getNodeValue().replace("\"", "&quot;") + "\""); } openingTag.append(getEndOfOpeningTag(currentNode) + "\n"); return openingTag.toString(); }
Source:
public void handle_missing_node() throws Exception { EslintBridgeServerImpl eslintBridgeServer = new EslintBridgeServerImpl(NodeCommand.builder(), tempFolder); eslintBridgeServer = spy(eslintBridgeServer); doThrow(new NodeCommandException("Exception Message", new IOException())).when(eslintBridgeServer).deploy(); AnalysisWarningsWrapper analysisWarnings = mock(AnalysisWarningsWrapper.class); EslintBasedRulesSensor eslintBasedRulesSensor = new EslintBasedRulesSensor(checkFactory(ESLINT_BASED_RULE), eslintBridgeServer, analysisWarnings); eslintBasedRulesSensor.execute(context); assertThat(logTester.logs(LoggerLevel.ERROR)).contains("Exception Message"); verify(analysisWarnings).addUnique("Some JavaScript rules were not executed. Exception Message"); }

Target:
public void handle_missing_node() throws Exception { doThrow(new NodeCommandException("Exception Message", new IOException())).when(eslintBridgeServerMock).startServerLazily(any()); AnalysisWarningsWrapper analysisWarnings = mock(AnalysisWarningsWrapper.class); EslintBasedRulesSensor eslintBasedRulesSensor = new EslintBasedRulesSensor(checkFactory(ESLINT_BASED_RULE), eslintBridgeServerMock, analysisWarnings); eslintBasedRulesSensor.execute(context); assertThat(logTester.logs(LoggerLevel.ERROR)).contains("Exception Message"); verify(analysisWarnings).addUnique("Some JavaScript rules were not executed. Exception Message"); }
Source:
public Collection<Path> branchChangedFiles(String targetBranchName, Path rootBaseDir) { RepositoryBuilder builder = new RepositoryBuilder().findGitDir(rootBaseDir.toFile()); if (builder.getGitDir() == null) { LOG.warn("Not inside a Git work tree: {}", rootBaseDir); return null; } try { Repository repo = builder.build(); Ref targetRef = repo.exactRef("refs/heads/" + targetBranchName); if (targetRef == null) { LOG.warn("Could not find ref: {}", targetBranchName); return null; } Git git = new Git(repo); return git.diff().setShowNameAndStatusOnly(true).setOldTree(prepareTreeParser(repo, targetRef)).call().stream() .map(diffEntry -> repo.getWorkTree().toPath().resolve(diffEntry.getNewPath())) .collect(Collectors.toList()); } catch (IOException | GitAPIException e) { LOG.warn(e.getMessage(), e); } return null; }

Target:
public Set<Path> branchChangedFiles(String targetBranchName, Path rootBaseDir) { try (Repository repo = getVerifiedRepositoryBuilder(rootBaseDir).build()) { Ref targetRef = repo.exactRef("refs/heads/" + targetBranchName); if (targetRef == null) { LOG.warn("Could not find ref: {}", targetBranchName); return null; } try (Git git = new Git(repo)) { return git.diff().setShowNameAndStatusOnly(true).setOldTree(prepareTreeParser(repo, targetRef)).call().stream() .filter(diffEntry -> diffEntry.getChangeType() == DiffEntry.ChangeType.ADD || diffEntry.getChangeType() == DiffEntry.ChangeType.MODIFY) .map(diffEntry -> repo.getWorkTree().toPath().resolve(diffEntry.getNewPath())) .collect(Collectors.toSet()); } } catch (IOException | GitAPIException e) { LOG.warn(e.getMessage(), e); } return null; }
Source:
public SamLocusAndReferenceIterator(final ReferenceSequenceFileWalker referenceFile, final SamLocusIterator locusIterator) { this.referenceSequenceFileWalker = referenceFile; this.locusIterator = locusIterator; }

Target:
public SamLocusAndReferenceIterator(final ReferenceSequenceFileWalker referenceFile, final SamLocusIterator locusIterator) throws IllegalArgumentException { if(!SequenceUtil.areSequenceDictionariesEqual( locusIterator.getHeader().getSequenceDictionary(), referenceFile.getSequenceDictionary())) { throw new IllegalArgumentException("reference and locus iterator have difference dictionaries." + locusIterator.getHeader().getSequenceDictionary().toString() + referenceFile.getSequenceDictionary().toString()); } this.referenceSequenceFileWalker = referenceFile; this.locusIterator = locusIterator; }
Source:
public boolean getRewriteBatchedStatements() { final String isRewrite = super.connectionProperties.getProperty(REWRITE_BATCHED_STATEMENTS); return isRewrite == null ? null : Boolean.valueOf(isRewrite); }

Target:
public boolean getRewriteBatchedStatements() { final String isRewrite = super.connectionProperties.getProperty(REWRITE_BATCHED_STATEMENTS); return isRewrite == null ? false : Boolean.valueOf(isRewrite); }