auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
getMrrtReportTemplates_shouldReturnAllMrrtReportTemplatesThatMatchGivenLicenseAnywhereInDctermsLicenseInsensitiveToCase() throws Exception { MrrtReportTemplateSearchCriteria searchCriteria = new MrrtReportTemplateSearchCriteria.Builder().withLicense(EXISTING_TEMPLATE_LICENSE) .build(); List<MrrtReportTemplate> templates = mrrtReportTemplateService.getMrrtReportTemplates(searchCriteria); assertNotNull(templates); assertThat(templates.size(), is(1)); assertThat(templates.get(0) .getDcTermsLicense(), is("General Public License")); searchCriteria = new MrrtReportTemplateSearchCriteria.Builder().withLicense("public") .build(); templates = mrrtReportTemplateService.getMrrtReportTemplates(searchCriteria); List<String> licenses = new ArrayList<>(); templates.forEach(template -> licenses.add(template.getDcTermsLicense())); assertNotNull(licenses); assertThat(licenses.size(), is(2)); assertTrue(licenses.contains("Mozilla Public License")); assertTrue(licenses.contains("General Public License")); }

Target:
getMrrtReportTemplates_shouldReturnAllMrrtReportTemplatesThatMatchGivenLicenseAnywhereInDctermsLicenseInsensitiveToCase() throws Exception { MrrtReportTemplateSearchCriteria searchCriteria = new MrrtReportTemplateSearchCriteria.Builder().withLicense(EXISTING_TEMPLATE_LICENSE) .build(); List<MrrtReportTemplate> templates = mrrtReportTemplateService.getMrrtReportTemplates(searchCriteria); assertNotNull(templates); assertThat(templates.size(), is(1)); assertThat(templates.get(0) .getDcTermsLicense(), is(EXISTING_TEMPLATE_LICENSE)); searchCriteria = new MrrtReportTemplateSearchCriteria.Builder().withLicense("public") .build(); templates = mrrtReportTemplateService.getMrrtReportTemplates(searchCriteria); List<String> licenses = new ArrayList<>(); templates.forEach(template -> licenses.add(template.getDcTermsLicense())); assertNotNull(licenses); assertThat(licenses.size(), is(2)); assertThat(licenses, hasItem("Mozilla Public License")); assertThat(licenses, hasItem("General Public License")); }
Source:
private static ProxyConfiguration asProxyConfiguration(OxdServerConfiguration configuration) { try { JsonNode node = configuration.getProxyConfiguration(); if (node != null) { return Jackson2.createJsonMapper().treeToValue(node, ProxyConfiguration.class); } } catch (Exception e) { LOG.error("Failed to parse ProxyConfiguration.", e); } return new ProxyConfiguration(); }

Target:
private static Optional<ProxyConfiguration> asProxyConfiguration(OxdServerConfiguration configuration) { try { JsonNode node = configuration.getProxyConfiguration(); if (node != null) { return Optional.ofNullable(Jackson2.createJsonMapper().treeToValue(node, ProxyConfiguration.class)); } } catch (Exception e) { LOG.error("Failed to parse ProxyConfiguration.", e); } return Optional.empty(); }
Source:
public TmfExperiment(final Class<? extends ITmfEvent> type, final String path, final ITmfTrace[] traces, final int indexPageSize, IResource resource) { setCacheSize(indexPageSize); setStreamingInterval(0); setIndexer(new TmfCheckpointIndexer(this, indexPageSize)); setParser(this); try { super.initialize(resource, path, type); } catch (TmfTraceException e) { e.printStackTrace(); } fTraces = traces; if (resource != null) { try { this.synchronizeTraces(); } catch (TmfTraceException e) { e.printStackTrace(); } } }

Target:
public TmfExperiment(final Class<? extends ITmfEvent> type, final String path, final ITmfTrace[] traces, final int indexPageSize, IResource resource) { setCacheSize(indexPageSize); setStreamingInterval(0); setIndexer(new TmfCheckpointIndexer(this, indexPageSize)); setParser(this); try { super.initialize(resource, path, type); } catch (TmfTraceException e) { e.printStackTrace(); } fTraces = traces; if (resource != null) { try { this.synchronizeTraces(); } catch (TmfTraceException e) { Activator.logError("Error synchronizing experiment", e); } } }
Source:
public AuthenticationManagerResolver<HttpServletRequest> resolver() { return request -> { if (request .getPathInfo() .startsWith("/employee")) return employeesAuthenticationManager(); return customersAuthenticationManager(); }; }

Target:
public AuthenticationManagerResolver<HttpServletRequest> resolver() { return request -> { if (request .getPathInfo() .startsWith("/employee")) { return employeesAuthenticationManager(); } return customersAuthenticationManager(); }; }
Source:
private void initListeners() { notifyFactory = new NotificationFactory(); listen(Message.OPENED, (controller, subject, args) -> { assert controller instanceof MenuController; switch (subject) { case "graph": openGraph(args); unifiedEnd = getMaxUnifiedEnd(graph); break; case "known mutations": openKnownMutations(args); break; case "annotations": openAnnotations(args); break; default: return; } }); listen(Message.FILTERED, (controller, subject, args) -> { assert args.length == 1; assert args[0] instanceof Set<?>; @SuppressWarnings("unchecked") Set<Sequence> newSequences = (Set<Sequence>) args[0]; visibleSequences = newSequences; model.setVisible(visibleSequences); diagram = new StackedMutationContainer(model.getBucketCache(), visibleSequences); repaintNow = true; repaint(); }); listen(SequenceController.REFERENCE_SET, (controller, subject, args) -> { assert args.length == 1; assert args[0] instanceof Sequence; reference = (Sequence) args[0]; model = new GraphContainer(graph, reference); model.setVisible(visibleSequences); diagram = new StackedMutationContainer(model .getBucketCache(), visibleSequences); repaintNow = true; repaint(); }); listen(Message.GOTO, (controller, subject, args) -> { assert args[0] instanceof Long; Long position = ((Long) args[0]); double hValue = position.doubleValue() / (double) unifiedEnd; scrollPane.setHvalue(hValue); }); }

Target:
private void initListeners() { notifyFactory = new NotificationFactory(); listen(Message.OPENED, (controller, subject, args) -> { assert controller instanceof MenuController; switch (subject) { case "graph": openGraph(args); maxUnifiedEnd = getMaxUnifiedEnd(graph); break; case "known mutations": openKnownMutations(args); break; case "annotations": openAnnotations(args); break; default: return; } maxUnifiedEnd = getMaxUnifiedEnd(graph); }); listen(Message.LOADED, (sender, subject, args) -> { if (!subject.equals("sequences")) { return; } assert (args[0] instanceof Map<?, ?>); Map<String, Sequence> sequences = (Map<String, Sequence>) args[0]; if (model != null) { model.setVisible(new HashSet<>(sequences.values())); } else { model = new GraphContainer(graph, null); } }); listen(Message.FILTERED, (controller, subject, args) -> { assert args.length == 1; assert args[0] instanceof Set<?>; @SuppressWarnings("unchecked") Set<Sequence> newSequences = (Set<Sequence>) args[0]; visibleSequences = newSequences; model.setVisible(visibleSequences); diagram = new StackedMutationContainer(model.getBucketCache(), visibleSequences); repaintNow = true; repaint(); }); listen(SequenceController.REFERENCE_SET, (controller, subject, args) -> { assert args.length == 1; assert args[0] instanceof Sequence; reference = (Sequence) args[0]; model = new GraphContainer(graph, reference); model.setVisible(visibleSequences); diagram = new StackedMutationContainer(model .getBucketCache(), visibleSequences); repaintNow = true; repaint(); }); listen(Message.GOTO, (controller, subject, args) -> { assert args[0] instanceof Long; Long position = (Long) args[0]; double hValue = position.doubleValue() / (double) maxUnifiedEnd; scrollPane.setHvalue(hValue); }); }
Source:
public long getSizeInBytes() { return INSTANCE_SIZE + IMMUTABLE_LIST_HEADER_SIZE + OBJECT_ARRAY_LIST_INSTANCE_SIZE * channels.size() + channels.stream() .flatMap(List::stream) .mapToLong(Block::getRetainedSizeInBytes) .sum(); }

Target:
public long getSizeInBytes() { return INSTANCE_SIZE + channels.stream() .flatMap(List::stream) .mapToLong(Block::getRetainedSizeInBytes) .sum(); }
Source:
public void emitImmediately(Map<AbstractKafkaPartitioner.PartitionMeta, Pair<Long, Long>> windowData) { for (Map.Entry<AbstractKafkaPartitioner.PartitionMeta, Pair<Long, Long>> windowEntry : windowData.entrySet()) { AbstractKafkaPartitioner.PartitionMeta meta = windowEntry.getKey(); Pair<Long, Long> replayOffsetSize = windowEntry.getValue(); KafkaConsumer<byte[], byte[]> kc = consumers.get(meta.getCluster()); if (kc == null && kc.assignment().contains(windowEntry.getKey().getTopicPartition())) { throw new RuntimeException("Coundn't find consumer to replay the message PartitionMeta : " + meta); } for (TopicPartition tp : kc.assignment()) { if (meta.getTopicPartition().equals(tp)) { kc.resume(tp); } else { try { kc.position(tp); } catch (NoOffsetForPartitionException e) { kc.seekToBeginning(tp); } kc.pause(tp); } } kc.seek(meta.getTopicPartition(), replayOffsetSize.getLeft()); long windowCount = replayOffsetSize.getRight(); while (windowCount > 0) { try { ConsumerRecords<byte[], byte[]> records = kc.poll(ownerOperator.getConsumerTimeout()); for (Iterator<ConsumerRecord<byte[], byte[]>> cri = records.iterator(); cri.hasNext() && windowCount > 0;) { ownerOperator.emitTuple(meta.getCluster(), cri.next()); windowCount--; } } catch (NoOffsetForPartitionException e) { throw new RuntimeException("Couldn't replay the offset", e); } } kc.seek(meta.getTopicPartition(), replayOffsetSize.getLeft() + replayOffsetSize.getRight()); } for (KafkaConsumer<byte[], byte[]> kc : consumers.values()) { kc.resume(Iterables.toArray(kc.assignment(), TopicPartition.class)); } }

Target:
public void emitImmediately(Map<AbstractKafkaPartitioner.PartitionMeta, Pair<Long, Long>> windowData) { for (Map.Entry<AbstractKafkaPartitioner.PartitionMeta, Pair<Long, Long>> windowEntry : windowData.entrySet()) { AbstractKafkaPartitioner.PartitionMeta meta = windowEntry.getKey(); Pair<Long, Long> replayOffsetSize = windowEntry.getValue(); KafkaConsumer<byte[], byte[]> kc = consumers.get(meta.getCluster()); if (kc == null && kc.assignment().contains(windowEntry.getKey().getTopicPartition())) { throw new RuntimeException("Coundn't find consumer to replay the message PartitionMeta : " + meta); } for (TopicPartition tp : kc.assignment()) { if (meta.getTopicPartition().equals(tp)) { kc.resume(tp); } else { try { kc.position(tp); } catch (NoOffsetForPartitionException e) { handleNoOffsetForPartitionException(e, kc); } kc.pause(tp); } } kc.seek(meta.getTopicPartition(), replayOffsetSize.getLeft()); long windowCount = replayOffsetSize.getRight(); while (windowCount > 0) { try { ConsumerRecords<byte[], byte[]> records = kc.poll(ownerOperator.getConsumerTimeout()); for (Iterator<ConsumerRecord<byte[], byte[]>> cri = records.iterator(); cri.hasNext() && windowCount > 0;) { ownerOperator.emitTuple(meta.getCluster(), cri.next()); windowCount--; } } catch (NoOffsetForPartitionException e) { throw new RuntimeException("Couldn't replay the offset", e); } } kc.seek(meta.getTopicPartition(), replayOffsetSize.getLeft() + replayOffsetSize.getRight()); } for (KafkaConsumer<byte[], byte[]> kc : consumers.values()) { kc.resume(Iterables.toArray(kc.assignment(), TopicPartition.class)); } }
Source:
private String getDeserializerPackageName(JArrayType targetType) { final String compSerializer = serializerCreator.serializerFor(targetType.getComponentType()); if (compSerializer.startsWith(CUSTOM_SERIALIZER_PACKAGE)) return CUSTOM_SERIALIZER_PACKAGE; else return ProxyCreator.synthesizeTopLevelClassName(targetType, DSER_SUFFIX)[0]; }

Target:
private String getDeserializerPackageName(JArrayType targetType) { final String compSerializer = serializerCreator.serializerFor(targetType.getComponentType()); final int end = compSerializer.lastIndexOf('.'); return end >= 0 ? compSerializer.substring(0, end) : ""; }
Source:
public void checkoutEntry(File f, DirCacheEntry entry, boolean config_filemode) throws IOException { ObjectLoader ol = repo.open(entry.getObjectId()); if (ol == null) throw new MissingObjectException(entry.getObjectId(), Constants.TYPE_BLOB); byte[] bytes = ol.getCachedBytes(); File parentDir = f.getParentFile(); File tmpFile = java.io.File .createTempFile("__"+f.getName(), null, parentDir); FileChannel channel = new FileOutputStream(tmpFile).getChannel(); ByteBuffer buffer = ByteBuffer.wrap(bytes); try { int j = channel.write(buffer); if (j != bytes.length) throw new IOException(MessageFormat.format( JGitText.get().couldNotWriteFile, tmpFile)); } finally { channel.close(); } FS fs = repo.getFS(); if (config_filemode && fs.supportsExecute()) { if (FileMode.EXECUTABLE_FILE.equals(entry.getRawMode())) { if (!fs.canExecute(tmpFile)) fs.setExecute(tmpFile, true); } else { if (fs.canExecute(tmpFile)) fs.setExecute(tmpFile, false); } } if (!tmpFile.renameTo(f)) { f.delete(); if (!tmpFile.renameTo(f)) { throw new IOException(MessageFormat.format( JGitText.get().couldNotWriteFile, tmpFile.getPath(), f.getPath())); } } entry.setLastModified(f.lastModified()); entry.setLength((int) ol.getSize()); }

Target:
public void checkoutEntry(File f, DirCacheEntry entry, boolean config_filemode) throws IOException { ObjectLoader ol = repo.open(entry.getObjectId()); if (ol == null) throw new MissingObjectException(entry.getObjectId(), Constants.TYPE_BLOB); byte[] bytes = ol.getCachedBytes(); File parentDir = f.getParentFile(); File tmpFile = File.createTempFile("__"+f.getName(), null, parentDir); FileChannel channel = new FileOutputStream(tmpFile).getChannel(); ByteBuffer buffer = ByteBuffer.wrap(bytes); try { int j = channel.write(buffer); if (j != bytes.length) throw new IOException(MessageFormat.format( JGitText.get().couldNotWriteFile, tmpFile)); } finally { channel.close(); } FS fs = repo.getFS(); if (config_filemode && fs.supportsExecute()) { if (FileMode.EXECUTABLE_FILE.equals(entry.getRawMode())) { if (!fs.canExecute(tmpFile)) fs.setExecute(tmpFile, true); } else { if (fs.canExecute(tmpFile)) fs.setExecute(tmpFile, false); } } if (!tmpFile.renameTo(f)) { f.delete(); if (!tmpFile.renameTo(f)) { throw new IOException(MessageFormat.format( JGitText.get().couldNotWriteFile, tmpFile.getPath(), f.getPath())); } } entry.setLastModified(f.lastModified()); entry.setLength((int) ol.getSize()); }
Source:
private <V> void executeOperation(final LongKeyOperation<V> operation) { final List<LongRange> dataKeyRanges = operation.getDataKeyRanges(); try { routerLock.readLock().lock(); final Pair<Map<Integer, Pair<Long, Long>>, Map<String, List<Pair<Long, Long>>>> routingResult = router.route(LongRangeUtils.fromRangesToPairs(dataKeyRanges)); final Map<Integer, Pair<Long, Long>> localBlockToSubKeyRangeMap = routingResult.getFirst(); final Map<String, List<Pair<Long, Long>>> remoteEvalToSubKeyRangesMap = routingResult.getSecond(); final int numSubOps = remoteEvalToSubKeyRangesMap.size() + 1; resultAggregator.registerOp(operation, numSubOps); sendOperationToRemoteStores(operation, remoteEvalToSubKeyRangesMap); final Map<Long, V> localOutputData = executeLocalOperation(operation, localBlockToSubKeyRangeMap); resultAggregator.submitLocalResult(operation, localOutputData, Collections.EMPTY_LIST); } finally { routerLock.readLock().unlock(); } }

Target:
private <V> void executeOperation(final LongKeyOperation<V> operation) { final List<LongRange> dataKeyRanges = operation.getDataKeyRanges(); final Map<Long, V> localOutputData; routerLock.readLock().lock(); try { final Pair<Map<Integer, Pair<Long, Long>>, Map<String, List<Pair<Long, Long>>>> routingResult = router.route(LongRangeUtils.fromRangesToPairs(dataKeyRanges)); final Map<Integer, Pair<Long, Long>> localBlockToSubKeyRangeMap = routingResult.getFirst(); final Map<String, List<Pair<Long, Long>>> remoteEvalToSubKeyRangesMap = routingResult.getSecond(); final int numSubOps = remoteEvalToSubKeyRangesMap.size() + 1; resultAggregator.registerOp(operation, numSubOps); sendOperationToRemoteStores(operation, remoteEvalToSubKeyRangesMap); localOutputData = executeLocalOperation(operation, localBlockToSubKeyRangeMap); } finally { routerLock.readLock().unlock(); } resultAggregator.submitLocalResult(operation, localOutputData, Collections.EMPTY_LIST); }
Source:
public void MobileLogin_003_failedLoginWrongLogin() { MobileBasePageObject mobile = new MobileBasePageObject(driver); mobile.openHome(wikiURL); mobile.openRandomPage(); System.out.println(credentials.userName12); MobileSpecialUserLogin login = mobile.loginFailedDropDown(mobile.getTimeStamp(), mobile.getTimeStamp()); login.verifyWrongLoginErrorMessage(); }

Target:
public void MobileLogin_003_failedLoginWrongLogin() { MobileBasePageObject mobile = new MobileBasePageObject(driver); mobile.openHome(wikiURL); mobile.openRandomPage(); MobileSpecialUserLogin login = mobile.loginFailedDropDown(mobile.getTimeStamp(), mobile.getTimeStamp()); login.verifyWrongLoginErrorMessage(); }
Source:
public T[] getClones(int num) { List<T> result = new ArrayList<>(); for (int i = 0; i < num; i++) { result.add(getClone()); } return (T[])result.toArray(); }

Target:
public T[] getClones(int num) { T[] ts = (T[])Array.newInstance(clazz, num); try (Input input = new Input(bin)) { for (int i = 0; i < ts.length; i++) { input.rewind(); ts[i] = kryo.readObject(input, clazz); } } return ts; }
Source:
NamedTableNode(String alias, TableName name,List<ColumnDef> dyn_columns) { super(alias, name); if(dyn_columns != null){ this.dyn_columns = dyn_columns; }else{ this.dyn_columns = new ArrayList<ColumnDef>(); } }

Target:
NamedTableNode(String alias, TableName name,List<ColumnDef> dyn_columns) { super(alias, name); if(dyn_columns != null){ this.dyncolumns = ImmutableList.copyOf(dyn_columns); }else{ this.dyncolumns = Collections.<ColumnDef>emptyList(); } }
Source:
private void emailObservable() { Observable<String> observable = RxTextView.textChanges(emailEditText).skip(1).debounce(600,TimeUnit.MILLISECONDS) .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(AndroidSchedulers.mainThread()) .map(new Function<CharSequence, String>() { @Override public String apply(CharSequence charSequence) throws Exception { return charSequence.toString(); } }); observable.subscribe(new DisposableObserver<String>() { @Override public void onNext(String s) { checkValidEmail(s); } @Override public void onError(Throwable e) { } @Override public void onComplete() { } }); }

Target:
private void emailObservable() { RxTextView.textChanges(emailEditText). skipInitialValue() .debounce(600, TimeUnit.MILLISECONDS) .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(AndroidSchedulers.mainThread()) .map(CharSequence::toString) .subscribe(this::checkValidEmail, LOG::error); }
Source:
public void should_create_span_instrumented_by_a_handler_interceptor() { Collection<String> names = names(); then(names).isNotEmpty(); then(this.arrayListSpanAccumulator.getSpans()).isNotEmpty(); then(new ListOfSpans(this.arrayListSpanAccumulator.getSpans())).hasASpanWithTagKeyEqualTo("http.class.name"); then(this.tracer.getCurrentSpan()).isNull(); }

Target:
public void should_create_span_instrumented_by_a_handler_interceptor() { Collection<String> names = names(); then(names).isNotEmpty(); then(this.arrayListSpanAccumulator.getSpans()).isNotEmpty(); Awaitility.await().until( () -> { then(new ListOfSpans(this.arrayListSpanAccumulator.getSpans())).hasASpanWithName("http:/reservations") .hasASpanWithTagKeyEqualTo("mvc.controller.class"); }); then(this.tracer.getCurrentSpan()).isNull(); then(ExceptionUtils.getLastException()).isNull(); }
Source:
private EstablishingWebsocketConnectionStateDescriptor() { super(XmppWebsocketTransportModule.EstablishingWebsocketConnectionState.class); addPredeccessor(LookupRemoteConnectionEndpointsStateDescriptor.class); addSuccessor(ConnectedButUnauthenticatedStateDescriptor.class); declareInferiortyTo(EstablishingTcpConnectionStateDescriptor.class); }

Target:
private EstablishingWebsocketConnectionStateDescriptor() { super(XmppWebsocketTransportModule.EstablishingWebsocketConnectionState.class); addPredeccessor(LookupRemoteConnectionEndpointsStateDescriptor.class); addSuccessor(ConnectedButUnauthenticatedStateDescriptor.class); declareInferiorityTo("org.jivesoftware.smack.tcp.XmppTcpTransportModule$EstablishingTcpConnectionStateDescriptor"); }
Source:
private void initWebView() { WebSettings webSettings = mWebView.getSettings(); webSettings.setJavaScriptEnabled(true); webSettings.setDefaultTextEncodingName("utf-8"); mWebView.setWebViewClient(new WebViewClient() { public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { AppLog.e(T.EDITOR, description); } }); mWebView.setWebChromeClient(new WebChromeClient() { public boolean onConsoleMessage(ConsoleMessage cm) { AppLog.d(T.EDITOR, cm.message() + " -- From line " + cm.lineNumber() + " of " + cm.sourceId()); return true; } @Override public boolean onJsAlert(WebView view, String url, String message, JsResult result) { AppLog.d(T.EDITOR, message); return true; } @Override public void onConsoleMessage(String message, int lineNumber, String sourceId) { AppLog.d(T.EDITOR, message + " -- from line " + lineNumber + " of " + sourceId); } }); String htmlEditor = getHtmlEditor(); mWebView.addJavascriptInterface(new JsCallbackHandler(), "nativeCallbackHandler"); mWebView.loadDataWithBaseURL("file:/ enableWebDebugging(true); }

Target:
private void initWebView() { WebSettings webSettings = mWebView.getSettings(); webSettings.setJavaScriptEnabled(true); webSettings.setDefaultTextEncodingName("utf-8"); mWebView.setWebViewClient(new WebViewClient() { public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { AppLog.e(T.EDITOR, description); } }); mWebView.setWebChromeClient(new WebChromeClient() { public boolean onConsoleMessage(ConsoleMessage cm) { AppLog.d(T.EDITOR, cm.message() + " -- From line " + cm.lineNumber() + " of " + cm.sourceId()); return true; } @Override public boolean onJsAlert(WebView view, String url, String message, JsResult result) { AppLog.d(T.EDITOR, message); return true; } @Override public void onConsoleMessage(String message, int lineNumber, String sourceId) { AppLog.d(T.EDITOR, message + " -- from line " + lineNumber + " of " + sourceId); } }); String htmlEditor = getHtmlFromFile("android-editor.html"); mWebView.addJavascriptInterface(new JsCallbackHandler(), JS_CALLBACK_HANDLER); mWebView.loadDataWithBaseURL("file:/ enableWebDebugging(true); }
Source:
public boolean isClosed() { return clientState.isClosedOrClosingIsTriggered(); }

Target:
public boolean isClosed() { return clientState.isCloseTriggered(); }
Source:
public boolean isUsable() { Boolean discardConn = getChannelHandlerContext().channel() .attr(ClientRequestResponseConverter.DISCARD_CONNECTION).get(); if (!getChannelHandlerContext().channel().isActive() || null != discardConn && discardConn) { return false; } long nowMillis = System.currentTimeMillis(); long idleTime = nowMillis - lastReturnToPoolTimeMillis; return idleTime < maxIdleTimeMillis; }

Target:
public boolean isUsable() { Boolean discardConn = getChannelHandlerContext().channel() .attr(ClientRequestResponseConverter.DISCARD_CONNECTION).get(); if (!getChannelHandlerContext().channel().isActive() || Boolean.TRUE == discardConn) { return false; } long nowMillis = System.currentTimeMillis(); long idleTime = nowMillis - lastReturnToPoolTimeMillis; return idleTime < maxIdleTimeMillis; }
Source:
public void prepare(Map<String, Object> config, TopologyContext context, OutputCollector collector) { this.collector = collector; logger.info(String.format("Conn String: %s, PartitionMode: %s", boltConfig.getConnectionString(), String.valueOf(boltConfig.getPartitionMode()))); try { executorService = Executors.newSingleThreadExecutor(); ehClient = EventHubClient.createSync(boltConfig.getConnectionString(), executorService); if (boltConfig.getPartitionMode()) { String partitionId = String.valueOf(context.getThisTaskIndex()); logger.info("Writing to partition id: " + partitionId); sender = ehClient.createPartitionSenderSync(partitionId); } } catch (Exception ex) { collector.reportError(ex); throw new RuntimeException(ex); } }

Target:
public void prepare(Map<String, Object> config, TopologyContext context, OutputCollector collector) { this.collector = collector; logger.info(String.format("Connection String: %s, PartitionMode: %s", removeSecretFromConnectionString(boltConfig.getConnectionString()), String.valueOf(boltConfig.getUseTaskIndexAsPartitionId()))); try { executorService = Executors.newSingleThreadExecutor(); ehClient = EventHubClient.createSync(boltConfig.getConnectionString(), executorService); if (boltConfig.getUseTaskIndexAsPartitionId()) { final String partitionId = String.valueOf(context.getThisTaskIndex()); logger.info("Writing to partition id: " + partitionId); sender = ehClient.createPartitionSenderSync(partitionId); } } catch (Exception ex) { collector.reportError(ex); throw new RuntimeException(ex); } }
Source:
@Override public<K, V> KNNClassificationModel fit(DatasetBuilder<K, V> datasetBuilder, IgniteBiFunction<K, V, double[]> featureExtractor, IgniteBiFunction<K, V, Double> lbExtractor) { PartitionDataBuilder<K, V, KNNPartitionContext, LabeledDataset<Double, LabeledVector>> partDataBuilder = new KNNPartitionDataBuilderOnHeap<>( featureExtractor, lbExtractor ); Dataset<KNNPartitionContext, LabeledDataset<Double, LabeledVector>> dataset = null; if (datasetBuilder != null) { dataset = datasetBuilder.build( (upstream, upstreamSize) -> new KNNPartitionContext(), partDataBuilder ); } return new KNNClassificationModel<>(dataset); }

Target:
@Override public <K, V> KNNClassificationModel fit(DatasetBuilder<K, V> datasetBuilder, IgniteBiFunction<K, V, double[]> featureExtractor, IgniteBiFunction<K, V, Double> lbExtractor) { PartitionDataBuilder<K, V, KNNPartitionContext, LabeledDataset<Double, LabeledVector>> partDataBuilder = new LabeledDatasetPartitionDataBuilderOnHeap<>( featureExtractor, lbExtractor ); Dataset<KNNPartitionContext, LabeledDataset<Double, LabeledVector>> dataset = null; if (datasetBuilder != null) { dataset = datasetBuilder.build( (upstream, upstreamSize) -> new KNNPartitionContext(), partDataBuilder ); } return new KNNClassificationModel<>(dataset); }
Source:
public Object apply(ChangeResource rsrc, Input input) throws AuthException, InterruptedException, ExecutionException { CurrentUser caller = rsrc.getControl().getCurrentUser(); if (!caller.getCapabilities().canAdministrateServer()) { throw new AuthException("index not permitted"); } indexer.index(rsrc.getChange()).get(); return Response.none(); }

Target:
public Object apply(ChangeResource rsrc, Input input) throws AuthException, InterruptedException, ExecutionException { indexer.index(rsrc.getChange()).get(); return Response.none(); }
Source:
public int hashCode() { return this.toString().hashCode(); }

Target:
public int hashCode() { return Objects.hash(message, resourcePath, start, end, severity); }
Source:
public boolean isStackCompliant(Consumer consumer, String stackId, List<Entitlement> entsToConsider) { Stream<EntitlementDTO> entStream = entsToConsider == null ? Stream.empty() : entsToConsider.stream() .map(this.translator.getStreamMapper(Entitlement.class, EntitlementDTO.class)); Stream<GuestIdDTO> guestIdStream = consumer.getGuestIds() == null ? Stream.empty() : consumer.getGuestIds().stream() .map(this.translator.getStreamMapper(GuestId.class, GuestIdDTO.class)); JsonJsContext args = new JsonJsContext(mapper); args.put("stack_id", stackId); args.put("consumer", this.translator.translate(consumer, ConsumerDTO.class)); args.put("entitlements", entStream.collect(Collectors.toSet())); args.put("log", log, false); args.put("guestIds", guestIdStream.collect(Collectors.toList())); return jsRules.runJsFunction(Boolean.class, "is_stack_compliant", args); }

Target:
public boolean isStackCompliant(Consumer consumer, String stackId, List<Entitlement> entsToConsider) { Stream<EntitlementDTO> entStream = entsToConsider == null ? Stream.empty() : entsToConsider.stream() .map(this.translator.getStreamMapper(Entitlement.class, EntitlementDTO.class)); Stream<GuestIdDTO> guestIdStream = consumer.getGuestIds() == null ? Stream.empty() : consumer.getGuestIds().stream() .map(this.translator.getStreamMapper(GuestId.class, GuestIdDTO.class)); JsonJsContext args = new JsonJsContext(mapper); args.put("stack_id", stackId); args.put("consumer", this.translator.translate(consumer, ConsumerDTO.class)); args.put("entitlements", entStream); args.put("log", log, false); args.put("guestIds", guestIdStream); return jsRules.runJsFunction(Boolean.class, "is_stack_compliant", args); }
Source:
public List<FolderItem> getProjectAssets( final Project project ) { if ( project == null ) { return null; } final Package defaultPackage = projectService.resolveDefaultPackage( project ); return explorerServiceHelper.getAssetsRecursively( defaultPackage, new ActiveOptions( Option.BUSINESS_CONTENT ) ); }

Target:
public List<FolderItem> getProjectAssets( final Project project ) { checkNotNull( "project", project ); final Package defaultPackage = projectService.resolveDefaultPackage( project ); return explorerServiceHelper.getAssetsRecursively( defaultPackage, new ActiveOptions( Option.BUSINESS_CONTENT ) ); }
Source:
public void cleanup() { int numRetries = NUM_VALIDATE_RETRIES; while (numRetries-- > 0) { if (validate()) { LOG.log(Level.WARNING, "Validation success"); return; } try { Thread.sleep(VALIDATE_SLEEP_MS); } catch (final InterruptedException e) { LOG.log(Level.WARNING, "Interrupted while sleeping to compare the result with expected value", e); } } LOG.log(Level.WARNING, "Validation failed"); }

Target:
public void cleanup() { int numRemainingRetries = NUM_VALIDATE_RETRIES; while (numRemainingRetries-- > 0) { if (validate()) { LOG.log(Level.INFO, "Validation success"); return; } try { Thread.sleep(VALIDATE_SLEEP_MS); } catch (final InterruptedException e) { LOG.log(Level.WARNING, "Interrupted while sleeping to compare the result with expected value", e); } } LOG.log(Level.WARNING, "Validation failed"); }
Source:
public void createProject(IProject project, boolean defaults, boolean onFinish, IProgressMonitor monitor) throws CoreException { SubMonitor subMonitor = SubMonitor.convert(monitor, 100); setProjectDescription(project, defaults, onFinish, subMonitor.split(70)); doTemplatesPostProcess(project); doCustom(project); monitor.worked(30); }

Target:
public void createProject(IProject project, boolean defaults, boolean onFinish, IProgressMonitor monitor) throws CoreException { SubMonitor subMonitor = SubMonitor.convert(monitor, 100); setProjectDescription(project, defaults, onFinish, subMonitor.split(70)); doTemplatesPostProcess(project); doCustom(project); subMonitor.worked(30); }
Source:
private void resetLabels() { if (Boolean.valueOf(Library.getProperty("org.zkoss.util.label.reload", "false"))) Labels.reset(); }

Target:
private void resetLabels() { if (!Boolean.valueOf(Library.getProperty("org.zkoss.util.label.cache", "true"))) Labels.reset(); }
Source:
public void testInfo() throws Exception { final Info info = sut.info(); assertThat(info.driverStatus(), any(List.class)); assertThat(info.executionDriver(), not(isEmptyOrNullString())); assertThat(info.initPath(), not(isEmptyOrNullString())); assertThat(info.kernelVersion(), not(isEmptyOrNullString())); assertThat(info.cpus(), instanceOf(int.class)); assertThat(info.memTotal(), instanceOf(long.class)); assertThat(info.storageDriver(), not(isEmptyOrNullString())); assertThat(info.sockets(), not(empty())); assertThat(info.memoryLimit(), not(nullValue())); assertThat(info.swapLimit(), not(nullValue())); }

Target:
public void testInfo() throws Exception { final Info info = sut.info(); assertThat(info.executionDriver(), not(isEmptyOrNullString())); assertThat(info.initPath(), not(isEmptyOrNullString())); assertThat(info.kernelVersion(), not(isEmptyOrNullString())); assertThat(info.storageDriver(), not(isEmptyOrNullString())); assertThat(info.sockets(), not(empty())); assertThat(info.memoryLimit(), not(nullValue())); assertThat(info.swapLimit(), not(nullValue())); }
Source:
private void checkRecord(MockId id, BlobReadOptions options) throws IOException { List<BlobReadOptions> optionsList = new ArrayList<>(); optionsList.add(options); MessageReadSet readSet = new StoreMessageReadSet(optionsList); IndexValue value = state.getExpectedValue(id, true); assertEquals("Unexpected key in BlobReadOptions", id, options.getStoreKey()); assertEquals("Unexpected size in BlobReadOptions", value.getSize(), options.getSize()); assertEquals("Unexpected expiresAtMs in BlobReadOptions", value.getExpiresAtMs(), options.getExpiresAtMs()); if (state.index.hardDeleter.enabled.get() && !state.deletedKeys.contains(id)) { ByteBuffer readBuf = ByteBuffer.allocate((int) value.getSize()); ByteBufferOutputStream stream = new ByteBufferOutputStream(readBuf); WritableByteChannel channel = Channels.newChannel(stream); readSet.writeTo(0, channel, 0, value.getSize()); byte[] expectedData = state.getExpectedData(id, true); assertArrayEquals("Data obtained from reset does not match original", expectedData, readBuf.array()); } }

Target:
private void checkRecord(MockId id, BlobReadOptions options) throws IOException { MessageReadSet readSet = new StoreMessageReadSet(Arrays.asList(options)); IndexValue value = state.getExpectedValue(id, true); assertEquals("Unexpected key in BlobReadOptions", id, options.getStoreKey()); assertEquals("Unexpected size in BlobReadOptions", value.getSize(), options.getSize()); assertEquals("Unexpected expiresAtMs in BlobReadOptions", value.getExpiresAtMs(), options.getExpiresAtMs()); if (state.index.hardDeleter.enabled.get() && !state.deletedKeys.contains(id)) { ByteBuffer readBuf = ByteBuffer.allocate((int) value.getSize()); ByteBufferOutputStream stream = new ByteBufferOutputStream(readBuf); WritableByteChannel channel = Channels.newChannel(stream); readSet.writeTo(0, channel, 0, value.getSize()); byte[] expectedData = state.getExpectedData(id, true); assertArrayEquals("Data obtained from reset does not match original", expectedData, readBuf.array()); } }
Source:
private void saveChanges() { if (!mConfigFile.canWrite() && !Util.fixAppDataPermissions(mContext)) { Log.w(TAG, "Failed to save updated config. Cannot change the owner of the config file."); return; } Log.i(TAG, "Writing updated config file"); File mConfigTempFile = Constants.getConfigTempFile(mContext); try { TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = transformerFactory.newTransformer(); DOMSource domSource = new DOMSource(mConfig); StreamResult streamResult = new StreamResult(mConfigTempFile); transformer.transform(domSource, streamResult); } catch (TransformerException e) { Log.w(TAG, "Failed to save temporary config file", e); return; } try { mConfigFile.delete(); mConfigTempFile.renameTo(mConfigFile); } catch (Exception e) { Log.w(TAG, "Failed to rename temporary config file to original file"); } }

Target:
private void saveChanges() { if (!mConfigFile.canWrite() && !Util.fixAppDataPermissions(mContext)) { Log.w(TAG, "Failed to save updated config. Cannot change the owner of the config file."); return; } Log.i(TAG, "Writing updated config file"); File mConfigTempFile = Constants.getConfigTempFile(mContext); try { TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = transformerFactory.newTransformer(); DOMSource domSource = new DOMSource(mConfig); StreamResult streamResult = new StreamResult(mConfigTempFile); transformer.transform(domSource, streamResult); } catch (TransformerException e) { Log.w(TAG, "Failed to save temporary config file", e); return; } try { mConfigTempFile.renameTo(mConfigFile); } catch (Exception e) { Log.w(TAG, "Failed to rename temporary config file to original file"); } }
Source:
public void visitClass(ClassTree tree) { boolean generatesEquals = usesAnnotation(tree, GENERATE_EQUALS); excludeLinesIfTrue(generatesEquals || usesAnnotation(tree, GENERATE_UNUSED_FIELD_RELATED_METHODS), tree, UnusedPrivateFieldCheck.class, PrivateFieldUsedLocallyCheck.class); excludeLinesIfTrue(usesAnnotation(tree, GENERATE_CONSTRUCTOR), tree, AtLeastOneConstructorCheck.class); excludeLinesIfTrue(generatesEquals, tree, EqualsNotOverriddenInSubclassCheck.class, EqualsNotOverridenWithCompareToCheck.class); excludeLinesIfTrue(generatesPrivateConstructor(tree), tree, UtilityClassWithPublicConstructorCheck.class); excludeLinesIfTrue(usesAnnotation(tree, UTILITY_CLASS), tree, BadFieldNameCheck.class, ConstantsShouldBeStaticFinalCheck.class); super.visitClass(tree); }

Target:
public void visitClass(ClassTree tree) { boolean generatesEquals = usesAnnotation(tree, GENERATE_EQUALS); excludeLinesIfTrue(generatesEquals || usesAnnotation(tree, GENERATE_UNUSED_FIELD_RELATED_METHODS), tree, UnusedPrivateFieldCheck.class, PrivateFieldUsedLocallyCheck.class); excludeLinesIfTrue(usesAnnotation(tree, GENERATE_CONSTRUCTOR), tree, AtLeastOneConstructorCheck.class); excludeLinesIfTrue(generatesEquals, tree, EqualsNotOverriddenInSubclassCheck.class, EqualsNotOverridenWithCompareToCheck.class); excludeLinesIfTrue(generatesPrivateConstructor(tree), tree, UtilityClassWithPublicConstructorCheck.class); excludeLinesIfTrue(usesAnnotation(tree, UTILITY_CLASS), tree, BadFieldNameCheck.class, ConstantsShouldBeStaticFinalCheck.class); if(usesAnnotation(tree, GENERATES_MODIFIERS)) { tree.members().forEach(this::visitFieldModifierVariable); } super.visitClass(tree); }
Source:
public void testLinkSize() throws IOException { ReactorSender reactorSender = new ReactorSender(entityPath, sender, handler, reactorProvider, tokenManager, messageSerializer, Duration.ofSeconds(1), new ExponentialAmqpRetryPolicy(new AmqpRetryOptions())); StepVerifier.create(reactorSender.getLinkSize()) .expectNext(1000) .verifyComplete(); StepVerifier.create(reactorSender.getLinkSize()) .expectNext(1000) .verifyComplete(); verify(sender, times(1)).getRemoteMaxMessageSize(); }

Target:
public void testLinkSize() { ReactorSender reactorSender = new ReactorSender(entityPath, sender, handler, reactorProvider, tokenManager, messageSerializer, Duration.ofSeconds(1), new ExponentialAmqpRetryPolicy(new AmqpRetryOptions())); StepVerifier.create(reactorSender.getLinkSize()) .expectNext(1000) .verifyComplete(); StepVerifier.create(reactorSender.getLinkSize()) .expectNext(1000) .verifyComplete(); verify(sender, times(1)).getRemoteMaxMessageSize(); }
Source:
public ValidationResult canDisableVirtioScsi(Collection<? extends Disk> vmDisks) { if (vmDisks == null) { vmDisks = getDiskDao().getAllForVm(vms.iterator().next().getId(), true); } return vmDisks.stream() .filter(d -> d.getDiskInterface() == DiskInterface.VirtIO_SCSI) .findFirst() .map(x -> new ValidationResult(EngineMessage.CANNOT_DISABLE_VIRTIO_SCSI_PLUGGED_DISKS)) .orElse(ValidationResult.VALID); }

Target:
public ValidationResult canDisableVirtioScsi(Collection<? extends Disk> vmDisks) { if (vmDisks == null) { vmDisks = getDiskDao().getAllForVm(vms.iterator().next().getId(), true); } boolean isVirtioScsiDiskExist = vmDisks.stream().anyMatch(d -> d.getDiskInterface() == DiskInterface.VirtIO_SCSI); if (isVirtioScsiDiskExist) { return new ValidationResult(EngineMessage.CANNOT_DISABLE_VIRTIO_SCSI_PLUGGED_DISKS); } return ValidationResult.VALID; }
Source:
public ConfigurationProvider(String adUserName, String adUserPassword, String domainName, String ldapSecurityAuthentication, String ldapServers, String adUserId, String ldapProviderTypes, String engineConfigExecutable, String engineConfigProperties, String ldapServerPort) { super(); configVals.put(AdUserName, adUserName); configVals.put(AdUserPassword, adUserPassword); configVals.put(DomainName, domainName); configVals.put(LDAPSecurityAuthentication, ldapSecurityAuthentication); configVals.put(LdapServers, ldapServers); configVals.put(AdUserId, adUserId); configVals.put(LDAPProviderTypes, ldapProviderTypes); configVals.put(ConfigValues.LDAPServerPort, ldapServerPort); this.engineConfigExecutable = engineConfigExecutable; this.engineConfigProperties = engineConfigProperties; }

Target:
public ConfigurationProvider(String adUserName, String adUserPassword, String domainName, String ldapSecurityAuthentication, String ldapServers, String adUserId, String ldapProviderTypes, String engineConfigExecutable, String engineConfigProperties, String ldapServerPort) { super(); configVals.put(AdUserName, adUserName); configVals.put(AdUserPassword, adUserPassword); configVals.put(DomainName, domainName); configVals.put(LDAPSecurityAuthentication, ldapSecurityAuthentication); configVals.put(LdapServers, ldapServers); configVals.put(AdUserId, adUserId); configVals.put(LDAPProviderTypes, ldapProviderTypes); configVals.put(LDAPServerPort, ldapServerPort); this.engineConfigExecutable = engineConfigExecutable; this.engineConfigProperties = engineConfigProperties; }
Source:
@BeforeClass public static void beforeClass() throws MalformedURLException, UnknownHostException { AppiumServiceBuilder appiumServiceBuilder = new AppiumServiceBuilder() .usingPort(4357); service = appiumServiceBuilder.build(); service.start(); InetAddress ipadd =InetAddress.getLocalHost(); String n=ipadd.toString(); String ip = n.substring(n.indexOf("/")+1); System.out.println("-------------------------------------------"); System.out.println("IP address :"+n.substring(n.indexOf("/")+1)); System.out.println(service.isRunning()); System.out.println("SERVICE_URL: " + service.getUrl()); System.out.println("-------------------------------------------"); if (service == null || !service.isRunning()) { throw new AppiumServerHasNotBeenStartedLocallyException( "An appium server node is not started!"); } File appDir = new File("src/test/java/io/appium/java_client"); File app = new File(appDir, "ApiDemos-debug.apk"); DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "Android Emulator"); capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath()); capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, AutomationName.ANDROID_UIAUTOMATOR2); capabilities.setCapability("uiautomator2ServerInstallTimeout", 60000); driver = new AndroidDriver<>(service.getUrl(), capabilities); driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); }

Target:
@BeforeClass public static void beforeClass() { service = AppiumDriverLocalService.buildDefaultService(); service.start(); if (service == null || !service.isRunning()) { throw new AppiumServerHasNotBeenStartedLocallyException( "An appium server node is not started!"); } File appDir = new File("src/test/java/io/appium/java_client"); File app = new File(appDir, "ApiDemos-debug.apk"); DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "Android Emulator"); capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath()); capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, AutomationName.ANDROID_UIAUTOMATOR2); driver = new AndroidDriver<>(service.getUrl(), capabilities); driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); }
Source:
protected String determinePrincipalId(final RequestContext requestContext, final Credential credential) { if (StringUtils.isBlank(properties.getJdbc().getPrincipalIdAttribute())) { return credential.getId(); } @NonNull final Principal principal = WebUtils.getAuthentication(requestContext).getPrincipal(); final String pIdAttribName = properties.getJdbc().getPrincipalIdAttribute(); if (!principal.getAttributes().containsKey(pIdAttribName)) { throw new IllegalStateException("Principal attribute [" + pIdAttribName + "] cannot be found"); } final Object pIdAttributeValue = principal.getAttributes().get(pIdAttribName); final Set<Object> pIdAttributeValues = CollectionUtils.toCollection(pIdAttributeValue); if (pIdAttributeValues.size() != 1) { throw new IllegalStateException("Principal attribute [" + pIdAttribName + "] was found, but its value [" + pIdAttributeValue + "] is either empty or multi-valued"); } return pIdAttributeValues.iterator().next().toString(); }

Target:
protected String determinePrincipalId(final RequestContext requestContext, final Credential credential) { if (StringUtils.isBlank(properties.getJdbc().getPrincipalIdAttribute())) { return credential.getId(); } @NonNull final Principal principal = WebUtils.getAuthentication(requestContext).getPrincipal(); final String pIdAttribName = properties.getJdbc().getPrincipalIdAttribute(); if (!principal.getAttributes().containsKey(pIdAttribName)) { throw new IllegalStateException("Principal attribute [" + pIdAttribName + "] cannot be found"); } final Object pIdAttributeValue = principal.getAttributes().get(pIdAttribName); final Set<Object> pIdAttributeValues = CollectionUtils.toCollection(pIdAttributeValue); String principalId = ""; if (!pIdAttributeValues.isEmpty()) { principalId = pIdAttributeValues.iterator().next().toString().trim(); } if (pIdAttributeValues.size() > 1) { LOGGER.warn("Principal attribute was found, but its value is multi-valued. " + "Proceeding with the first element [{}]", pIdAttribName, pIdAttributeValue, principalId); } if (principalId.isEmpty()) { throw new IllegalStateException("Principal attribute [" + pIdAttribName + "] was found, but it is either empty" + " or multi-valued with an empty element"); } return principalId; }
Source:
public ElasticsearchRecordSet(ElasticsearchSplit split, ElasticsearchConnectorConfig config, List<ElasticsearchColumnHandle> columnHandles) { this.split = requireNonNull(split, "split is null"); this.config = requireNonNull(config, "config is null"); this.columnHandles = requireNonNull(columnHandles, "column handles is null"); ImmutableList.Builder<Type> types = ImmutableList.builder(); for (ElasticsearchColumnHandle column : columnHandles) { types.add(column.getColumnType()); } this.columnTypes = types.build(); }

Target:
public ElasticsearchRecordSet(ElasticsearchSplit split, ElasticsearchConnectorConfig config, List<ElasticsearchColumnHandle> columnHandles) { this.split = requireNonNull(split, "split is null"); this.config = requireNonNull(config, "config is null"); this.columnHandles = requireNonNull(columnHandles, "columnHandles is null"); this.columnTypes = columnHandles.stream() .map(ElasticsearchColumnHandle::getColumnType) .collect(toImmutableList()); }
Source:
public static HpackEncoder newTestEncoder(boolean ignoreMaxHeaderListSize, long maxHeaderListSize, long maxHeaderTableSize) throws Http2Exception { HpackEncoder hpackEncoder = new HpackEncoder(false, 16, true); ByteBuf buf = Unpooled.buffer(); try { hpackEncoder.setMaxHeaderTableSize(buf, maxHeaderTableSize); hpackEncoder.setMaxHeaderListSize(maxHeaderListSize); } finally { buf.release(); } return hpackEncoder; }

Target:
public static HpackEncoder newTestEncoder(boolean ignoreMaxHeaderListSize, long maxHeaderListSize, long maxHeaderTableSize) throws Http2Exception { HpackEncoder hpackEncoder = new HpackEncoder(false, 16, 0); ByteBuf buf = Unpooled.buffer(); try { hpackEncoder.setMaxHeaderTableSize(buf, maxHeaderTableSize); hpackEncoder.setMaxHeaderListSize(maxHeaderListSize); } finally { buf.release(); } return hpackEncoder; }
Source:
public void testBuildCriteriaURI(ResourceContextImpl resourceContext, RecordTemplate criteria, String batchParameterName, URI uri, URI expectedURI) throws CloneNotSupportedException { URI generatedURI = BatchFinderResponseBuilder.buildCriteriaURI(resourceContext, criteria, batchParameterName, uri); Assert.assertEquals(generatedURI.toString(), expectedURI.toString()); }

Target:
public void testBuildCriteriaURI(ResourceContextImpl resourceContext, RecordTemplate criteria, String batchParameterName, URI uri, URI expectedURI) { URI generatedURI = BatchFinderResponseBuilder.buildCriteriaURI(resourceContext, criteria, batchParameterName, uri); Assert.assertEquals(generatedURI.toString(), expectedURI.toString()); }
Source:
private Description describeCause(Throwable child) { return Description.createTestDescription(fTestClass, "initializationError: " + child); }

Target:
private Description describeCause(Throwable child) { return Description.createTestDescription(fTestClass, "initializationError"); }