auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void close() throws Exception { for (ErrorReporter reporter : reporters) { reporter.close(); } }

Target:
public void close() { ConnectException e = null; for (ErrorReporter reporter : reporters) { try { reporter.close(); } catch (Throwable t) { e = e != null ? e : new ConnectException("Failed to close all reporters"); e.addSuppressed(t); } } if (e != null) { throw e; } }
Source:
public String putIfAbsent(String key, String value) { Assert.notNull(key, "'key' must not be null."); Assert.notNull(value, "'value' must not be null."); Object result = this.properties.putIfAbsent(key, value); if (result != null) { Assert.isInstanceOf(String.class, "This metadata store can only operate on String values"); } return (String) result; }

Target:
public String putIfAbsent(String key, String value) { Assert.notNull(key, "'key' must not be null."); Assert.notNull(value, "'value' must not be null."); Object oldValue = this.properties.putIfAbsent(key, value); if (oldValue != null) { Assert.isInstanceOf(String.class, oldValue, "Invalid type in the store"); } return (String) oldValue; }
Source:
public static String readDefaultMenuValueFromClasspath() { return new Scanner(MenuUtils.class.getResourceAsStream("/molgenis_ui.json")) .useDelimiter("\\A") .next(); }

Target:
public static String readDefaultMenuValueFromClasspath() { return new Scanner(MenuUtils.class.getResourceAsStream(DEFAULT_MENU_RESOURCE_NAME)) .useDelimiter(START_OF_STRING) .next(); }
Source:
public static void registerClipboardFormat(ClipboardFormat format) { checkNotNull(format); for (String key : format.getAliases()) { aliasMap.put(key.toLowerCase(Locale.ENGLISH), format); } registeredFormats.add(format); }

Target:
public static void registerClipboardFormat(ClipboardFormat format) { checkNotNull(format); for (String key : format.getAliases()) { String lowKey = key.toLowerCase(Locale.ENGLISH); ClipboardFormat old = aliasMap.put(lowKey, format); if (old != null) { aliasMap.put(lowKey, old); WorldEdit.logger.warning(format.getClass().getName() + " cannot override existing alias '" + lowKey + "' used by " + old.getClass().getName()); } } for (String ext : format.getFileExtensions()) { String lowExt = ext.toLowerCase(Locale.ENGLISH); fileExtensionMap.put(lowExt, format); } registeredFormats.add(format); }
Source:
private IStatus saveImpl(Writer bw, IProgressMonitor monitor) { ExportToTextRequest request = new ExportToTextRequest(bw, filter); trace.sendRequest(request); int currentIndex = 0; while (!request.isCompleted()) { if (monitor.isCanceled()) { request.cancel(); return Status.CANCEL_STATUS; } int index = (int) (request.getNbRead() * 100 / trace.getNbEvents()); if (index > currentIndex) { int progress = index - currentIndex; monitor.worked(progress); currentIndex = index; } try { Thread.sleep(100); } catch (InterruptedException e) { } } if (request.isFailed()) { Status status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, MessageFormat.format(Messages.ExportToTextJob_Unable_to_export_trace, destination), request.getIOException()); return status; } return Status.OK_STATUS; }

Target:
private IStatus saveImpl(Writer bw, IProgressMonitor monitor) { ExportToTextRequest request = new ExportToTextRequest(bw, fFilter, fTable); fTrace.sendRequest(request); int currentIndex = 0; while (!request.isCompleted()) { if (monitor.isCanceled()) { request.cancel(); return Status.CANCEL_STATUS; } int index = (int) (request.getNbRead() * TOTAL_WORK / fTrace.getNbEvents()); if (index > currentIndex) { int progress = index - currentIndex; monitor.worked(progress); currentIndex = index; } try { Thread.sleep(SLEEPING_INTERVAL); } catch (InterruptedException e) { } } if (request.isFailed()) { Status status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, MessageFormat.format(Messages.ExportToTextJob_Unable_to_export_trace, destination), request.getIOException()); return status; } return Status.OK_STATUS; }
Source:
protected TupleBatch fetchNextReady() throws DbException, IOException { final Operator child = getChild(); if (child.eos()) { return getResultBatch(); } TupleBatch tb = child.nextReady(); while (tb != null) { for (int row = 0; row < tb.numTuples(); ++row) { int rowHash = HashUtils.hashSubRow(tb, gfields, row); IntArrayList hashMatches = groupKeyMap.get(rowHash); if (hashMatches == null) { hashMatches = newKey(rowHash); newGroup(tb, row, hashMatches); continue; } boolean found = false; for (int i = 0; i < hashMatches.size(); i++) { int value = hashMatches.get(i); if (TupleUtils.tupleEquals(tb, gfields, row, groupKeys, grpRange, value)) { addBitSet(row, value); updateGroup(tb, row, aggStates.get(value)); found = true; break; } } if (!found) { newGroup(tb, row, hashMatches); } Preconditions.checkState(groupKeys.numTuples() == aggStates.size()); } updateGroups(tb); tb = child.nextReady(); } if (child.eos()) { return getResultBatch(); } return null; }

Target:
protected TupleBatch fetchNextReady() throws DbException { final Operator child = getChild(); if (child.eos()) { return getResultBatch(); } TupleBatch tb = child.nextReady(); while (tb != null) { for (int row = 0; row < tb.numTuples(); ++row) { int rowHash = HashUtils.hashSubRow(tb, gfields, row); IntArrayList hashMatches = groupKeyMap.get(rowHash); if (hashMatches == null) { hashMatches = newKey(rowHash); newGroup(tb, row, hashMatches); continue; } boolean found = false; for (int i = 0; i < hashMatches.size(); i++) { int value = hashMatches.get(i); if (TupleUtils.tupleEquals(tb, gfields, row, groupKeys, grpRange, value)) { addBitSet(row, value); updateGroup(tb, row, aggStates.get(value)); found = true; break; } } if (!found) { newGroup(tb, row, hashMatches); } Preconditions.checkState(groupKeys.numTuples() == aggStates.size()); } updateGroups(tb); tb = child.nextReady(); } if (child.eos()) { return getResultBatch(); } return null; }
Source:
public IClientRouter addClient(IClient client) { client.setRouter(this); try { client.getHandledTypes() .forEach(x -> { handlerMap.put(x, client); log.trace("Registered to handle messages of type {}", client, x); }); } catch (Exception ex) { } if (!client.getHandledCases().isEmpty()) { client.getHandledCases() .forEach(x -> { responseHandlerMap.put(x, client); log.trace("Registered to handle protobuf messages of type {}", client, x); }); } if (!client.getHandledErrors().isEmpty()) { client.getHandledErrors() .forEach(x -> { errorHandlerMap.put(x, client); log.trace("Registered to handle server error of type {}", client, x); }); } clientList.add(client); return this; }

Target:
public IClientRouter addClient(IClient client) { client.setRouter(this); try { client.getHandledTypes() .forEach(x -> { handlerMap.put(x, client); log.trace("Registered to handle messages of type {}", client, x); }); } catch (UnsupportedOperationException ex) { log.error("No registered CorfuMsg handler for client {}", client, ex); } if (!client.getHandledCases().isEmpty()) { client.getHandledCases() .forEach(x -> { responseHandlerMap.put(x, client); log.trace("Registered to handle protobuf messages of type {}", client, x); }); } if (!client.getHandledErrors().isEmpty()) { client.getHandledErrors() .forEach(x -> { errorHandlerMap.put(x, client); log.trace("Registered to handle server error of type {}", client, x); }); } clientList.add(client); return this; }
Source:
public void copyToDirectByteBufferFromReadPageCursorMustCheckBounds() throws Exception { configureStandardPageCache(); ByteBuffer buffer = ByteBuffer.allocate( filePageSize ); File file = file( "a" ); generateFileWithRecords( file, recordsPerFilePage, recordSize ); try ( PagedFile pf = pageCache.map( file, filePageSize ); PageCursor cursor = pf.io( 0, PF_SHARED_READ_LOCK ) ) { assertTrue( cursor.next() ); verifyCopyToBufferBounds( cursor, buffer ); } }

Target:
public void copyToDirectByteBufferFromReadPageCursorMustCheckBounds() throws Exception { configureStandardPageCache(); ByteBuffer buffer = ByteBuffer.allocateDirect( filePageSize ); File file = file( "a" ); generateFileWithRecords( file, recordsPerFilePage, recordSize ); try ( PagedFile pf = pageCache.map( file, filePageSize ); PageCursor cursor = pf.io( 0, PF_SHARED_READ_LOCK ) ) { assertTrue( cursor.next() ); verifyCopyToBufferBounds( cursor, buffer ); } }
Source:
private void load(Properties props) { enabled = props.get(ENABLED) != null ? Boolean.parseBoolean((String) props.get(ENABLED)) : true; context.put(ExtensionProperties.CONFIGURATION, props); context.put(ExtensionProperties.NAME, props.getProperty(NAME)); context.put(ExtensionProperties.PROVIDES, props.getProperty(PROVIDES)); }

Target:
private void load(Properties props) { enabled = props.get(ENABLED) != null ? Boolean.parseBoolean(props.getProperty(ENABLED)) : true; context.put(ExtensionProperties.CONFIGURATION, props); context.put(ExtensionProperties.NAME, props.getProperty(NAME)); context.put(ExtensionProperties.PROVIDES, props.getProperty(PROVIDES)); }
Source:
protected void appendRespondant() { try { logic.addStudentRespondant(getUserEmailForCourse(), feedbackSessionName, courseId); } catch (InvalidParametersException | EntityDoesNotExistException e) { Assumption.fail("Fail to append student respondant"); } }

Target:
protected void appendRespondant() { try { logic.addStudentRespondant(getUserEmailForCourse(), feedbackSessionName, courseId); } catch (InvalidParametersException | EntityDoesNotExistException e) { log.severe("Fail to append student respondant"); } }
Source:
public void shouldParsePayIQConfirmationSegment() { String routingResponse = "{\"booking\":" + "{\"confirmation\":{\"status\":{\"title\":\"1min ticket\",\"subtitle\":\"Valid from Friday, 14 October, 23:01\"}," + "\"purchase\":{\"price\":0.009999999776482582,\"currency\":\"EUR\",\"productName\":\"1min ticket\"," + "\"productType\":\"pt_pub\",\"id\":\"5801398e87d4abf77d7a70bd\"}," + "\"actions\":[{\"title\":\"Show Ticket\",\"type\":\"QRCODE\"," + "\"externalURL\":\"qrcode:4f9550149c8912c040090000:5801398e87d4abf77d7a70bd:1min ticket:20161014200117:20161014200217:null:iqt\"," + "\"isDestructive\":false}]}," + "\"title\":\"1min ticket\"," + "\"url\":\"<LINK_0>\"}," + "\"endTime\":1476475680,\"segmentTemplateHashCode\":-620371530,\"serviceDirection\":\"Lentoasema\",\"serviceName\":\"Lentoasema-Satama\",\"serviceNumber\":\"1\",\"serviceTripID\":\"14_260472\",\"startTime\":1476475560,\"stops\":2,\"ticketWebsiteURL\":\"<LINK_1>\"}"; TripSegment segment =bookingGson().fromJson(routingResponse, TripSegment.class); assertThat(segment.getBooking()).isNotNull(); assertThat(segment.getBooking().getConfirmation()).isNotNull(); }

Target:
public void shouldParsePayIQConfirmationSegment() throws IOException { String routingResponse = IOUtils.toString(getClass().getResourceAsStream("/booking-payiq.json")); TripSegment segment = bookingGson().fromJson(routingResponse, TripSegment.class); assertThat(segment.getBooking()).isNotNull(); assertThat(segment.getBooking().getConfirmation()).isNotNull(); }
Source:
public void testMerging() { List<Type> types = ImmutableList.of(INTEGER, INTEGER, INTEGER); List<Integer> sortIndexes = ImmutableList.of(2); List<SortOrder> sortOrders = ImmutableList.of(SortOrder.ASC_NULLS_FIRST); List<List<Page>> pageLists = new ArrayList<>(); PageBuilder pageBuilder = new PageBuilder(types); for (int i = 0; i < 10; i++) { Iterator<Integer> values = IntStream.range(0, 1000) .mapToObj(ignored -> ThreadLocalRandom.current().nextInt(100_000)) .sorted() .iterator(); List<Page> pages = new ArrayList<>(); for (int j = 0; j < 10; j++) { for (int k = 0; k < 100; k++) { int n = values.next(); pageBuilder.declarePosition(); INTEGER.writeLong(pageBuilder.getBlockBuilder(0), n); INTEGER.writeLong(pageBuilder.getBlockBuilder(1), n * 22L); INTEGER.writeLong(pageBuilder.getBlockBuilder(2), n * 33L); } pages.add(pageBuilder.build()); pageBuilder.reset(); } pageLists.add(pages); assertFalse(values.hasNext()); } List<Iterator<Page>> pages = pageLists.stream() .map(List::iterator) .collect(toList()); Iterator<Page> iterator = new MergingPageIterator(pages, types, sortIndexes, sortOrders); List<Long> values = new ArrayList<>(); while (iterator.hasNext()) { Page page = iterator.next(); for (int i = 0; i < page.getPositionCount(); i++) { long x = INTEGER.getLong(page.getBlock(0), i); long y = INTEGER.getLong(page.getBlock(1), i); long z = INTEGER.getLong(page.getBlock(2), i); assertEquals(y, x * 22); assertEquals(z, x * 33); values.add(x); } } assertThat(values).isSorted(); }

Target:
public void testMerging() { List<Type> types = ImmutableList.of(INTEGER, INTEGER); List<Integer> sortIndexes = ImmutableList.of(1); List<SortOrder> sortOrders = ImmutableList.of(SortOrder.ASC_NULLS_FIRST); List<List<Page>> pageLists = new ArrayList<>(); PageBuilder pageBuilder = new PageBuilder(types); for (int i = 0; i < 10; i++) { Iterator<Integer> values = IntStream.range(0, 1000) .map(ignored -> ThreadLocalRandom.current().nextInt(100_000)) .mapToObj(n -> ((n % 100) == 0) ? null : n) .sorted(nullsFirst(naturalOrder())) .iterator(); List<Page> pages = new ArrayList<>(); for (int j = 0; j < 10; j++) { for (int k = 0; k < 100; k++) { Integer n = values.next(); pageBuilder.declarePosition(); if (n == null) { pageBuilder.getBlockBuilder(0).appendNull(); pageBuilder.getBlockBuilder(1).appendNull(); } else { INTEGER.writeLong(pageBuilder.getBlockBuilder(0), n); INTEGER.writeLong(pageBuilder.getBlockBuilder(1), n * 22L); } } pages.add(pageBuilder.build()); pageBuilder.reset(); } pageLists.add(pages); assertFalse(values.hasNext()); } List<Iterator<Page>> pages = pageLists.stream() .map(List::iterator) .collect(toList()); Iterator<Page> iterator = new MergingPageIterator(pages, types, sortIndexes, sortOrders); List<Long> values = new ArrayList<>(); while (iterator.hasNext()) { Page page = iterator.next(); for (int i = 0; i < page.getPositionCount(); i++) { if (page.getBlock(0).isNull(i)) { assertTrue(page.getBlock(1).isNull(i)); values.add(null); } else { long x = INTEGER.getLong(page.getBlock(0), i); long y = INTEGER.getLong(page.getBlock(1), i); assertEquals(y, x * 22); values.add(x); } } } assertThat(values).isSortedAccordingTo(nullsFirst(naturalOrder())); }
Source:
private void writeRepositoryState( SubscribedRepository repository, List<String> subscribeSpecs) throws IOException { for (Map.Entry<String, Ref> ref : repository.getPubSubRefs().entrySet()) { String refName = ref.getKey(); for (String spec : subscribeSpecs) { if ((RefSpec.isWildcard(spec) && refName.startsWith( spec.substring(0, spec.length() - 1))) || refName.equals(spec)) write("have " + ref.getValue().getLeaf().getObjectId().getName() + " " + refName); } } }

Target:
private void writeRepositoryState( SubscribedRepository repository, List<String> subscribeSpecs) throws IOException { for (Map.Entry<String, Ref> ref : repository.getPubSubRefs().entrySet()) { String refName = ref.getKey(); for (String spec : subscribeSpecs) { if (RefSpec.isWildcard(spec) && !refName.startsWith( spec.substring(0, spec.length() - 1))) continue; else if (!refName.equals(spec)) continue; String objId = ref.getValue().getLeaf().getObjectId().getName(); write("have " + objId + " " + refName); } } }
Source:
public static double estimateScanSelectivity(Optimizable innerTable, OptimizablePredicateList predList, JoinPredicateType predicateType) throws StandardException { double selectivity = 1d; if (innerTable == null) { return selectivity; } for (int i = 0; i < predList.size(); i++) { Predicate p = (Predicate) predList.getOptPredicate(i); if (!p.isJoinPredicate()) continue; if (predicateType == JoinPredicateType.HASH_SEARCH || predicateType == JoinPredicateType.MERGE_SEARCH) { ValueNode valueNode = p.getAndNode().getLeftOperand(); if (valueNode instanceof BinaryRelationalOperatorNode) { BinaryRelationalOperatorNode bron = (BinaryRelationalOperatorNode) valueNode; if (bron.getOperator() != RelationalOperator.EQUALS_RELOP) { continue; } if (predicateType == JoinPredicateType.MERGE_SEARCH) { if (p.getIndexPosition() < 0) { continue; } else { if (!(bron.getLeftOperand() instanceof ColumnReference) || !(bron.getRightOperand() instanceof ColumnReference)) continue; } } } else continue; } selectivity *= p.scanSelectivity(innerTable); } return selectivity; }

Target:
public static double estimateScanSelectivity(Optimizable innerTable, OptimizablePredicateList predList, JoinPredicateType predicateType) throws StandardException { double selectivity = 1d; if (innerTable == null) { return selectivity; } for (int i = 0; i < predList.size(); i++) { Predicate p = (Predicate) predList.getOptPredicate(i); if (!isTheRightJoinPredicate(p, predicateType)) continue; selectivity *= p.scanSelectivity(innerTable); } return selectivity; }
Source:
public ExecRow call(ExecRow execRow) throws Exception { if (!initialized) { op = (SpliceOperation) getOperation(); initialized = true; } this.operationContext.recordRead(); op.setCurrentRow(execRow); this.operationContext.recordProduced(); if(!op.isForUpdate()) { execRow.setKey(null); } return execRow; }

Target:
public ExecRow call(ExecRow execRow) throws Exception { if (!initialized) { op = getOperation(); initialized = true; } this.operationContext.recordRead(); op.setCurrentRow(execRow); op.setCurrentRowLocation(execRow == null ? null : new HBaseRowLocation(execRow.getKey())); this.operationContext.recordProduced(); if(execRow != null) { if (!op.isForUpdate()) { execRow.setKey(null); execRow.setBaseRowCols(null); } else { ExecRow baseRow = locatorFunction.apply(operationContext); op.setCurrentBaseRowLocation(baseRow); execRow.setBaseRowCols(baseRow.getRowArray()); } } return execRow; }
Source:
public void shouldBeOverdueWhenDueYesterday() throws Exception { Configuration config = new Configuration(); config.setValue("40"); config.setReferencePoint("end"); config.setAction("add"); Appraisal appraisal = new Appraisal(); DateTime endDate = new DateTime(); appraisal.setEndDate(endDate.plusDays(-41).toDate()); assert EvalsUtil.isOverdue(appraisal, config); assert EvalsUtil.isDue(appraisal, config) < 0; }

Target:
public void shouldBeOverdueWhenDueYesterday() throws Exception { Configuration config = new Configuration(); config.setValue("40"); config.setReferencePoint("end"); config.setAction("add"); Appraisal appraisal = new Appraisal(); DateTime endDate = new DateTime(); appraisal.setEndDate(endDate.plusDays(-41).toDate()); assert EvalsUtil.isOverdue(appraisal, config); assert EvalsUtil.isDue(appraisal, config) == -1; }
Source:
public void getSourceTest() throws CandybeanException { iface.go("<LINK_0>"); WebDriverElement searchBox = iface.getWebDriverElement(new Hook(Strategy.ID, "gbqfq")); Assert.assertEquals(searchBox.getCssValue("display"), "block"); }

Target:
public void getSourceTest() throws CandybeanException { iface.go("<LINK_0>"); WebDriverElement searchBox = iface.getWebDriverElement(new Hook(Strategy.ID, "lga")); String found = searchBox.getSource(); String expected = "id=\"hplogo\""; Assert.assertTrue("Src did not contain " + expected + "\nFound source:\n" + found, found.contains("id=\"hplogo\"")); }
Source:
private Iterable<Ref> getSortedRefs() throws Exception { List<Ref> all = db.getRefDatabase().getRefsByPrefix(ALL); if (all instanceof RefMap || (all instanceof SortedMap && ((SortedMap) all).comparator() == null)) { return all; } return RefComparator.sort(all); }

Target:
private Iterable<Ref> getSortedRefs() throws Exception { List<Ref> all = db.getRefDatabase().getRefsByPrefix(ALL); return RefComparator.sort(all); }
Source:
public Collection<Action> getActions() { return Collections.unmodifiableCollection(configuration.getActions()); }

Target:
protected Collection<Action> getActions() { return Collections.unmodifiableCollection(configuration.getActions()); }
Source:
private static HTableFactory getDefaultHTableFactory() { return new HTableFactory.HTableFactoryImpl(); }

Target:
private static HTableFactory getDefaultHTableFactory() { return DEFAULT; }
Source:
public synchronized void process(WatchedEvent event) { log.debug("event {}", event.getPath(), event.getType(), event.getState()); watchingParent = false; if (event.getState() == KeeperState.Expired && lock != null) { lostLock(LockLossReason.SESSION_EXPIRED); } else { try { zooKeeper.getStatus(path, this); watchingParent = true; } catch (KeeperException.ConnectionLossException ex) { log.warn("lost connection to zookeeper"); } catch (Exception ex) { if (lock != null || asyncLock != null) { lockWatcher.unableToMonitorLockNode(ex); log.error("Error resetting watch on ZooLock " + lock + " " + event, ex); } } } }

Target:
public synchronized void process(WatchedEvent event) { log.debug("event {}", event.getPath(), event.getType(), event.getState()); watchingParent = false; if (event.getState() == KeeperState.Expired && lock != null) { lostLock(LockLossReason.SESSION_EXPIRED); } else { try { zooKeeper.getStatus(path, this); watchingParent = true; } catch (KeeperException.ConnectionLossException ex) { log.warn("lost connection to zookeeper"); } catch (Exception ex) { if (lock != null || asyncLock != null) { lockWatcher.unableToMonitorLockNode(ex); log.error("Error resetting watch on ZooLock {}", lock != null ? lock : asyncLock, event, ex); } } } }
Source:
private PlanNodeCostEstimate calculateJoinCost(PlanNode probe, PlanNode build, boolean replicated) { if (replicated) { PlanNodeCostEstimate replicateCost = CostCalculatorUsingExchanges.calculateExchangeCost( numberOfNodes, getStats(build), REPLICATE, REMOTE); PlanNodeCostEstimate localRepartitionCost = CostCalculatorUsingExchanges.calculateExchangeCost( numberOfNodes, getStats(build), REPARTITION, LOCAL); return replicateCost.add(localRepartitionCost); } else { PlanNodeCostEstimate probeCost = CostCalculatorUsingExchanges.calculateExchangeCost( numberOfNodes, getStats(probe), REPARTITION, REMOTE); PlanNodeCostEstimate buildRemoteRepartitionCost = CostCalculatorUsingExchanges.calculateExchangeCost( numberOfNodes, getStats(build), REPARTITION, REMOTE); PlanNodeCostEstimate buildLocalRepartitionCost = CostCalculatorUsingExchanges.calculateExchangeCost( numberOfNodes, getStats(build), REPARTITION, LOCAL); return probeCost .add(buildRemoteRepartitionCost) .add(buildLocalRepartitionCost); } }

Target:
private PlanNodeCostEstimate calculateJoinCost(PlanNode probe, PlanNode build, boolean replicated) { if (replicated) { PlanNodeCostEstimate replicateCost = CostCalculatorUsingExchanges.calculateExchangeCost( numberOfNodes, getStats(build), build.getOutputSymbols(), REPLICATE, REMOTE); PlanNodeCostEstimate localRepartitionCost = CostCalculatorUsingExchanges.calculateExchangeCost( numberOfNodes, getStats(build), build.getOutputSymbols(), REPARTITION, LOCAL); return replicateCost.add(localRepartitionCost); } else { PlanNodeCostEstimate probeCost = CostCalculatorUsingExchanges.calculateExchangeCost( numberOfNodes, getStats(probe), probe.getOutputSymbols(), REPARTITION, REMOTE); PlanNodeCostEstimate buildRemoteRepartitionCost = CostCalculatorUsingExchanges.calculateExchangeCost( numberOfNodes, getStats(build), build.getOutputSymbols(), REPARTITION, REMOTE); PlanNodeCostEstimate buildLocalRepartitionCost = CostCalculatorUsingExchanges.calculateExchangeCost( numberOfNodes, getStats(build), build.getOutputSymbols(), REPARTITION, LOCAL); return probeCost .add(buildRemoteRepartitionCost) .add(buildLocalRepartitionCost); } }
Source:
protected void cacheForever(final HttpServletResponse rsp) { final long now = System.currentTimeMillis(); rsp.setHeader("Cache-Control", "public, max-age=31536000"); rsp.setDateHeader("Expires", now + 31536000000L); rsp.setDateHeader("Date", now); }

Target:
protected void cacheForever(final HttpServletResponse rsp) { final long now = System.currentTimeMillis(); rsp.setDateHeader(HDR_DATE, now); rsp.setDateHeader(HDR_EXPIRES, now + 31536000000L); rsp.setHeader(HDR_CACHE_CONTROL, "public, max-age=31536000"); }
Source:
public void init() { subscribeTo(PythonGrammar.FUNCDEF); cognitiveComplexity.init(); astWalker = new AstWalker(cognitiveComplexity); }

Target:
public void init() { subscribeTo( PythonGrammar.IF_STMT, PythonKeyword.ELIF, PythonKeyword.ELSE, PythonGrammar.WHILE_STMT, PythonGrammar.FOR_STMT, PythonGrammar.EXCEPT_CLAUSE, PythonGrammar.AND_TEST, PythonGrammar.OR_TEST, PythonGrammar.TEST, PythonGrammar.FUNCDEF, PythonGrammar.SUITE); }
Source:
private boolean connectFileStorageServers(StorageType storageType, List<StorageServerConnections> connections) { Map<StorageDomainType, List<StorageServerConnections>> connByType = connections.stream() .collect(Collectors.groupingBy(c -> storageDomainDao.getAllByConnectionId(Guid.createGuidFromString( c.getId())).get(0) .getStorageDomainType())); boolean connectSucceeded = connectStorageServer(storageType, connByType.get(StorageDomainType.Data), true); connectStorageServerIgnoreFailure(storageType, connByType.get(StorageDomainType.ISO), StorageDomainType.ISO); connectStorageServerIgnoreFailure(storageType, connByType.get(StorageDomainType.ImportExport), StorageDomainType.ImportExport); return connectSucceeded; }

Target:
private boolean connectFileStorageServers(StorageType storageType, List<StorageServerConnections> connections) { Map<StorageDomainType, List<StorageServerConnections>> connByType = connections.stream() .collect(Collectors.groupingBy(c -> storageDomainDao.getAllByConnectionId(Guid.createGuidFromString( c.getId())).get(0) .getStorageDomainType())); boolean connectSucceeded = connectStorageServer(storageType, connByType.get(StorageDomainType.Master), true); connectSucceeded &= connectStorageServer(storageType, connByType.get(StorageDomainType.Data), true); connectStorageServerIgnoreFailure(storageType, connByType.get(StorageDomainType.ISO), StorageDomainType.ISO); connectStorageServerIgnoreFailure(storageType, connByType.get(StorageDomainType.ImportExport), StorageDomainType.ImportExport); return connectSucceeded; }
Source:
public void close() throws IOException { boolean done = isDone(); baseYielder.close(); if (done) { executor.execute(runnable); } }

Target:
public void close() throws IOException { boolean done = isDone(); Throwable thrown = null; try { baseYielder.close(); } catch (Throwable t) { thrown = t; throw t; } finally { if (done) { if (thrown != null) { try { executor.execute(runnable); } catch (Throwable t) { thrown.addSuppressed(t); } } else { executor.execute(runnable); } } } }
Source:
public void testWriteReadStatisticsAllNulls() throws Exception { File testFile = new File("target/test/TestParquetFileWriter/testParquetFile").getAbsoluteFile(); testFile.delete(); writeSchema = "message example {\n" + "required binary content;\n" + "}"; Path path = new Path(testFile.toURI()); MessageType schema = MessageTypeParser.parseMessageType(writeSchema); Configuration configuration = new Configuration(); GroupWriteSupport.setSchema(schema, configuration); ParquetWriter<Group> writer = new ParquetWriter<Group>(path, configuration, new GroupWriteSupport()); Group r1 = new SimpleGroup(schema); writer.write(r1); writer.close(); ParquetMetadata readFooter = ParquetFileReader.readFooter(configuration, path); for (BlockMetaData block : readFooter.getBlocks()) { for (ColumnChunkMetaData col : block.getColumns()) { col.getPath(); } } { assertEquals(1, (readFooter.getBlocks().get(0).getColumns().get(0).getStatistics().getNumNulls())); } }

Target:
public void testWriteReadStatisticsAllNulls() throws Exception { File testFile = new File("target/test/TestParquetFileWriter/testParquetFile").getAbsoluteFile(); testFile.delete(); writeSchema = "message example {\n" + "required binary content;\n" + "}"; Path path = new Path(testFile.toURI()); MessageType schema = MessageTypeParser.parseMessageType(writeSchema); Configuration configuration = new Configuration(); GroupWriteSupport.setSchema(schema, configuration); ParquetWriter<Group> writer = new ParquetWriter<Group>(path, configuration, new GroupWriteSupport()); Group r1 = new SimpleGroup(schema); writer.write(r1); writer.close(); ParquetMetadata readFooter = ParquetFileReader.readFooter(configuration, path); assertTrue((readFooter.getBlocks().get(0).getColumns().get(0).getStatistics().isEmpty()) == false); assertEquals(1, (readFooter.getBlocks().get(0).getColumns().get(0).getStatistics().getNumNulls())); }
Source:
public void displayAvatarImage(String uri, ImageView imageView) { int prefSize = (int) (20 * Resources.getSystem().getDisplayMetrics().density); Glide.with(context) .load(uri) .listener(null) .override(prefSize, prefSize) .dontTransform() .error(R.drawable.ic_error) .into(imageView); }

Target:
public void displayAvatarImage(String uri, ImageView imageView) { }
Source:
private <T extends GenericTimestampRecord> List<T> parsePage(byte[] data, Class<T> clazz) { PageHeader pageHeader = new PageHeader(data); List<T> records = Lists.newArrayList(); try { for (int i = 0; i < pageHeader.getNumOfRecords(); i++) { int startIdx; switch (pageHeader.getRecordType()) { case EGV_DATA: startIdx = PageHeader.HEADER_SIZE + (EGVRecord.RECORD_SIZE + 1) * i; records.add(clazz.cast(new EGVRecord(Arrays.copyOfRange(data, startIdx, startIdx + EGVRecord.RECORD_SIZE)))); break; case CAL_SET: int recordLength = (pageHeader.getRevision() <= 2) ? CalRecord.RECORD_SIZE : CalRecord.RECORD_V2_SIZE; startIdx = PageHeader.HEADER_SIZE + (recordLength + 1) * i; records.add(clazz.cast(new CalRecord(Arrays.copyOfRange(data, startIdx, startIdx + recordLength)))); break; case METER_DATA: startIdx = PageHeader.HEADER_SIZE + (MeterRecord.RECORD_SIZE + 1) * i; records.add(clazz.cast(new MeterRecord(Arrays.copyOfRange(data, startIdx, startIdx + MeterRecord.RECORD_SIZE)))); break; case SENSOR_DATA: startIdx = PageHeader.HEADER_SIZE + (SensorRecord.RECORD_SIZE + 1) * i; records.add(clazz.cast(new SensorRecord(Arrays.copyOfRange(data, startIdx, startIdx + SensorRecord.RECORD_SIZE)))); break; default: throw new IllegalArgumentException(String.format("Unknown record type: %s", pageHeader.getRecordType().name())); } } } catch (IllegalArgumentException e) { e.printStackTrace(); } return records; }

Target:
private <T extends GenericTimestampRecord> List<T> parsePage(byte[] data, Class<T> clazz) { PageHeader pageHeader = new PageHeader(data); List<T> records = new ArrayList<>(); try { for (int i = 0; i < pageHeader.getNumOfRecords(); i++) { int startIdx; switch (pageHeader.getRecordType()) { case EGV_DATA: startIdx = PageHeader.HEADER_SIZE + (EGVRecord.RECORD_SIZE + 1) * i; records.add(clazz.cast(new EGVRecord(Arrays.copyOfRange(data, startIdx, startIdx + EGVRecord.RECORD_SIZE)))); break; case CAL_SET: int recordLength = (pageHeader.getRevision() <= 2) ? CalRecord.RECORD_SIZE : CalRecord.RECORD_V2_SIZE; startIdx = PageHeader.HEADER_SIZE + (recordLength + 1) * i; records.add(clazz.cast(new CalRecord(Arrays.copyOfRange(data, startIdx, startIdx + recordLength)))); break; case METER_DATA: startIdx = PageHeader.HEADER_SIZE + (MeterRecord.RECORD_SIZE + 1) * i; records.add(clazz.cast(new MeterRecord(Arrays.copyOfRange(data, startIdx, startIdx + MeterRecord.RECORD_SIZE)))); break; case SENSOR_DATA: startIdx = PageHeader.HEADER_SIZE + (SensorRecord.RECORD_SIZE + 1) * i; records.add(clazz.cast(new SensorRecord(Arrays.copyOfRange(data, startIdx, startIdx + SensorRecord.RECORD_SIZE)))); break; default: throw new IllegalArgumentException(String.format("Unknown record type: %s", pageHeader.getRecordType().name())); } } } catch (IllegalArgumentException e) { e.printStackTrace(); } return records; }
Source:
protected int getInsertRow(Comparator<RowItem> comparator, RowItem item) { int left = 1; int right = table.getRowCount() - 1; while (left <= right) { int middle = (left + right) >>> 1; RowItem i = getRowItem(middle); int cmp = comparator.compare(i, item); if (cmp < 0) { left = middle + 1; } else if (cmp > 0) { right = middle - 1; } else { return -1; } } return left; }

Target:
protected int getInsertRow(Comparator<RowItem> comparator, RowItem item) { int row = lookupRowItem(comparator, item); if (row >= table.getRowCount() || comparator.compare(item, getRowItem(row)) != 0) { return row; } return -1; }
Source:
private void applyAccessibilityStyles() { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this); if (sharedPreferences.getBoolean("settings_accessibility_large_text", false)) { getTheme().applyStyle(R.style.FontSizeLarge, true); } if (sharedPreferences.getBoolean("settings_accessibility_high_contrast", false)) { getTheme().applyStyle(R.style.ContrastHigh, true); } if (sharedPreferences.getBoolean("settings_accessibility_element_spacing", false)) { getTheme().applyStyle(R.style.SpacingLarge, true); } if (sharedPreferences.getBoolean("settings_accessibility_category_icons_high_contrast", false)) { getTheme().applyStyle(R.style.CategoryIconContrastHigh, true); } if (sharedPreferences.getBoolean("settings_accessibility_category_icons", false)) { getTheme().applyStyle(R.style.CategoryIconVisible, true); } if (sharedPreferences.getBoolean("settings_accessibility_category_icons_big", false)) { getTheme().applyStyle(R.style.CategoryIconSizeLarge, true); } @AccessibilitySettingsFragment.FontStyle String fontStyle = sharedPreferences.getString("settings_accessibility_font_style", "regular"); switch (fontStyle) { case AccessibilitySettingsFragment.SERIF: getTheme().applyStyle(R.style.FontSerif, true); break; case AccessibilitySettingsFragment.DYSLEXIC: getTheme().applyStyle(R.style.FontDyslexic, true); break; case AccessibilitySettingsFragment.SAUDI: getTheme().applyStyle(R.style.FontSaudi, true); break; case AccessibilitySettingsFragment.STC: getTheme().applyStyle(R.style.FontStc, true); break; default: break; } }

Target:
private void applyAccessibilityStyles() { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this); if (sharedPreferences.getBoolean("settings_accessibility_large_text", false)) { getTheme().applyStyle(R.style.FontSizeLarge, true); } if (sharedPreferences.getBoolean("settings_accessibility_high_contrast", false)) { getTheme().applyStyle(R.style.ContrastHigh, true); } if (sharedPreferences.getBoolean("settings_accessibility_element_spacing", false)) { getTheme().applyStyle(R.style.SpacingLarge, true); } if (sharedPreferences.getBoolean("settings_accessibility_category_icons_high_contrast", false)) { getTheme().applyStyle(R.style.CategoryIconContrastHigh, true); } if (sharedPreferences.getBoolean("settings_accessibility_category_icons", false)) { getTheme().applyStyle(R.style.CategoryIconVisible, true); } if (sharedPreferences.getBoolean("settings_accessibility_category_icons_big", false)) { getTheme().applyStyle(R.style.CategoryIconSizeLarge, true); } @AccessibilitySettingsFragment.FontStyle String fontStyle = sharedPreferences.getString("settings_accessibility_font_style", AccessibilitySettingsFragment.REGULAR); switch (fontStyle) { case AccessibilitySettingsFragment.SERIF: getTheme().applyStyle(R.style.FontSerif, true); break; case AccessibilitySettingsFragment.DYSLEXIC: getTheme().applyStyle(R.style.FontDyslexic, true); break; default: break; } }
Source:
void highCollisionBroadcast(Control event) { if (System.currentTimeMillis() > lastHighCollisionBroadcast + minTimeBetweenBroadcast) { try { WebSocketBroadcast.Message message = WebSocketBroadcast.newMessage(getClass(), event); eventBus.post(message); lastHighCollisionBroadcast = System.currentTimeMillis(); log.warn("Sent high collision broadcast"); } catch (JsonProcessingException ex) { log.error("Unable to convert control message", ex); } } }

Target:
void highCollisionBroadcast(Control event) { long now = System.currentTimeMillis(); long lastCheckTimeExpected = lastHighCollisionBroadcast.get(); if (now > lastCheckTimeExpected + minTimeBetweenBroadcast && lastHighCollisionBroadcast.compareAndSet(lastCheckTimeExpected, now)) { try { WebSocketBroadcast.Message message = WebSocketBroadcast.newMessage(getClass(), event); eventBus.post(message); log.warn("Sent high collision broadcast"); } catch (JsonProcessingException ex) { log.error("Unable to convert control message", ex); } } }
Source:
protected Object parseValue(CommandSource source, CommandArgs args) throws ArgumentParseException { return args.hasNext() ? this.element.parseValue(source, args) : this.value; }

Target:
protected Object parseValue(CommandSource source, CommandArgs args) throws ArgumentParseException { return args.hasNext() ? null : this.element.parseValue(source, args); }
Source:
public Set<String> keySet() { final ImmutableSet.Builder<String> builder = ImmutableSet.builder(); final ImmutableSet<String> keySet = ImmutableSet.copyOf(headers.keySet()); for (final String key: keySet) { builder.add(toDecodedString(key)); } return builder.build(); }

Target:
public Set<String> keySet() { final ImmutableSet.Builder<String> builder = ImmutableSet.builder(); for (final String key: headers.keySet()) { builder.add(toDecodedString(key)); } return builder.build(); }
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } StorageDomainDynamic other = (StorageDomainDynamic) obj; return (ObjectUtils.objectsEqual(id, other.id) && ObjectUtils.objectsEqual(availableDiskSize, other.availableDiskSize) && ObjectUtils.objectsEqual(usedDiskSize, other.usedDiskSize) && ObjectUtils.objectsEqual(externalStatus, other.externalStatus)); }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } StorageDomainDynamic other = (StorageDomainDynamic) obj; return (ObjectUtils.objectsEqual(id, other.id) && ObjectUtils.objectsEqual(availableDiskSize, other.availableDiskSize) && ObjectUtils.objectsEqual(usedDiskSize, other.usedDiskSize) && Objects.equals(externalStatus, other.externalStatus)); }
Source:
private void replaceTarget(String target, @StringRes int replacementRes, String url) { char[] currentPreambleChars = new char[mBuilder.length()]; mBuilder.getChars(0, mBuilder.length(), currentPreambleChars, 0); String currentPreamble = String.valueOf(currentPreambleChars); int targetIndex = currentPreamble.indexOf(target); if (targetIndex != -1) { String replacement = mContext.getString(replacementRes); mBuilder.replace(targetIndex, targetIndex + target.length(), replacement); int end = targetIndex + replacement.length(); mBuilder.setSpan(mLinkSpan, targetIndex, end, 0); mBuilder.setSpan(new CustomTabsSpan(url), targetIndex, end, 0); } }

Target:
private void replaceTarget(String target, @StringRes int replacementRes, String url) { int targetIndex = mBuilder.toString().indexOf(target); if (targetIndex != -1) { String replacement = mContext.getString(replacementRes); mBuilder.replace(targetIndex, targetIndex + target.length(), replacement); int end = targetIndex + replacement.length(); mBuilder.setSpan(mLinkSpan, targetIndex, end, 0); mBuilder.setSpan(new CustomTabsSpan(url), targetIndex, end, 0); } }
Source:
public boolean isModified() { return this.modified || config.isModified() || configNaiveBayes.isModified() || configRandomForest.isModified() || configSVM.isModified(); }

Target:
public boolean isModified() { return this.modified || getLogisticRegressionConfiguration().isModified() || getNaiveBayesConfiguration().isModified() || getRandomForestConfiguration().isModified() || getSVMConfiguration().isModified(); }
Source:
private void validateUpdateWipeAfterDelete(VMStatus status, boolean isFloating) { DiskImage disk = createDiskImage(); when(diskDao.get(diskImageGuid)).thenReturn(disk); command.getParameters().getDiskInfo().setWipeAfterDelete(true); if (isFloating) { initializeCommand(); command.getParameters().setDiskVmElement(null); mockNullVm(); } else { initializeCommand(createVm(status)); } ValidateTestUtils.runAndAssertValidateSuccess(command); }

Target:
private void validateUpdateWipeAfterDelete(VMStatus status, boolean isFloating) { DiskImage disk = createDiskImage(); when(diskDao.get(diskImageGuid)).thenReturn(disk); command.getParameters().getDiskInfo().setWipeAfterDelete(true); initCommandForDisk(status, isFloating); ValidateTestUtils.runAndAssertValidateSuccess(command); }
Source:
protected void setUp() throws Exception { sessionManagerListener = new SessionManagerListener.Stub() { @Override public void notify(Session updated, int notification) { super.notify(updated, notification); if (notification == SessionListener.OPENING) { ResourceSet resourceSet = session.getTransactionalEditingDomain().getResourceSet(); EList<Resource> resources = resourceSet.getResources(); for (Resource resource : resources) { assertFalse("test.ecore semantic resource is loaded at SessionListener.OPENING notification", resource.getURI().toString().contains(SEMANTIC_MODEL_FILENAME)); } } } @Override public void notifyAddSession(Session newSession) { ResourceSet resourceSet = session.getTransactionalEditingDomain().getResourceSet(); EList<Resource> resources = resourceSet.getResources(); for (Resource resource : resources) { assertFalse("test.ecore semantic resource is loaded at notifyAddSession", resource.getURI().toString().contains(SEMANTIC_MODEL_FILENAME)); } } }; SessionManager.INSTANCE.addSessionsListener(sessionManagerListener); super.setUp(); }

Target:
protected void setUp() throws Exception { sessionManagerListener = new SessionManagerListener.Stub() { @Override public void notify(Session updated, int notification) { super.notify(updated, notification); if (notification == SessionListener.OPENING) { ResourceSet resourceSet = session.getTransactionalEditingDomain().getResourceSet(); EList<Resource> resources = resourceSet.getResources(); for (Resource resource : resources) { assertFalse(SEMANTIC_MODEL_FILENAME + " semantic resource is loaded at SessionListener.OPENING notification", resource.getURI().toString().contains(SEMANTIC_MODEL_FILENAME)); } } } @Override public void notifyAddSession(Session newSession) { ResourceSet resourceSet = session.getTransactionalEditingDomain().getResourceSet(); EList<Resource> resources = resourceSet.getResources(); for (Resource resource : resources) { assertFalse(SEMANTIC_MODEL_FILENAME + " semantic resource is loaded at notifyAddSession", resource.getURI().toString().contains(SEMANTIC_MODEL_FILENAME)); } } }; SessionManager.INSTANCE.addSessionsListener(sessionManagerListener); super.setUp(); }
Source:
public Integer count(List<Object> sequence, Object object) { int result = 0; if (object == null) { for (Object input : sequence) { if (input == null) { ++result; } } } else { for (Object input : sequence) { if (object.equals(input)) { ++result; } } } return Integer.valueOf(result); }

Target:
public Integer count(List<Object> sequence, Object object) { return Integer.valueOf(Collections.frequency(sequence, object)); }
Source:
public DeferredQueryTreeContentManager(AbstractTreeViewer viewer) { super(viewer); listeners = new ArrayList<IDeferredQueryTreeListener>(); }

Target:
public DeferredQueryTreeContentManager(AbstractTreeViewer viewer) { super(viewer); listeners = new ListenerList<IDeferredQueryTreeListener>(); }
Source:
protected void createTableWidget(final EObject sourceElement, final EStructuralFeature feature, final Collection<?> rows) { final Table table = createTable(sourceElement, feature, rows); if (table == null) { displayError("Cannot initialize the table"); return; } nattableManager = NattableModelManagerFactory.INSTANCE.createNatTableModelManager(table, new EObjectSelectionExtractor()); natTableWidget = nattableManager.createNattable(self, SWT.NONE, null); if (nattableManager instanceof TreeNattableModelManager) { if (null != rows && !rows.isEmpty()) { final RowHideShowLayer layer = nattableManager.getBodyLayerStack().getRowHideShowLayer(); for (int cpt = 0; cpt < rows.size(); cpt++) { natTableWidget.doCommand(new RowHideCommand(layer, 0)); } } ((TreeNattableModelManager) nattableManager).doCollapseExpandAction(CollapseAndExpandActionsEnum.EXPAND_ALL, null); } self.addDisposeListener(getDisposeListener()); natTableWidget.setBackground(self.getBackground()); natTableWidget.layout(); self.layout(); }

Target:
protected void createTableWidget(final EObject sourceElement, final EStructuralFeature feature, final Collection<?> rows) { final Table table = createTable(sourceElement, feature, rows); if (table == null) { displayError("Cannot initialize the table"); return; } nattableManager = NattableModelManagerFactory.INSTANCE.createNatTableModelManager(table, new EObjectSelectionExtractor()); natTableWidget = nattableManager.createNattable(self, SWT.NONE, null); if (nattableManager instanceof TreeNattableModelManager) { ((TreeNattableModelManager) nattableManager).doCollapseExpandAction(CollapseAndExpandActionsEnum.EXPAND_ALL, null); } self.addDisposeListener(getDisposeListener()); natTableWidget.setBackground(self.getBackground()); natTableWidget.layout(); self.layout(); }
Source:
public void testCorruptStageInstallUpdate() throws IOException, BundleException, URISyntaxException { File config = OSGiTestsActivator.getContext().getDataFile(getName()); final Equinox equinox = new Equinox( Collections.singletonMap(Constants.FRAMEWORK_STORAGE, config.getAbsolutePath())); try { equinox.init(); } catch (BundleException e) { fail("Unexpected exception in init()", e); } File dirBundleFile = createBundle(config, "dir.bundle", false, true); File jarBundleFile = createBundle(config, "jar.bundle", false, false); BundleContext bc = equinox.getBundleContext(); Bundle dirBundle = bc.installBundle(dirBundleFile.toURI().toASCIIString()); URLConverter converter = bc.getService(bc.getServiceReference(URLConverter.class)); URL dirFileURL = converter.resolve(dirBundle.getEntry("/")); File dirFile = new File(dirFileURL.getPath()); File rootStore = dirFile.getParentFile().getParentFile().getParentFile(); File nextIDBundleDir = new File(rootStore, (dirBundle.getBundleId() + 1) + "/0/bundleFile"); Files.createDirectories(nextIDBundleDir.toPath()); Bundle jarBundle = bc.installBundle(jarBundleFile.toURI().toASCIIString()); assertEquals("Wrong BSN", "bundlejar.bundle", jarBundle.getSymbolicName()); }

Target:
public void testCorruptStageInstallUpdate() throws IOException, BundleException { File config = OSGiTestsActivator.getContext().getDataFile(getName()); final Equinox equinox = new Equinox( Collections.singletonMap(Constants.FRAMEWORK_STORAGE, config.getAbsolutePath())); try { equinox.init(); } catch (BundleException e) { fail("Unexpected exception in init()", e); } File dirBundleFile = createBundle(config, "dir.bundle", false, true); File jarBundleFile = createBundle(config, "jar.bundle", false, false); BundleContext bc = equinox.getBundleContext(); Bundle dirBundle = bc.installBundle(dirBundleFile.toURI().toASCIIString()); assertEquals("Wrong BSN", "bundledir.bundle", dirBundle.getSymbolicName()); URLConverter converter = bc.getService(bc.getServiceReference(URLConverter.class)); URL dirFileURL = converter.resolve(dirBundle.getEntry("/")); File dirFile = new File(dirFileURL.getPath()); File rootStore = dirFile.getParentFile().getParentFile().getParentFile(); dirBundle.uninstall(); long next = dirBundle.getBundleId() + 1; next = doTestExistingBundleFile(bc, next, rootStore, jarBundleFile, "bundlejar.bundle", true); next = doTestExistingBundleFile(bc, next, rootStore, jarBundleFile, "bundlejar.bundle", false); next = doTestExistingBundleFile(bc, next, rootStore, dirBundleFile, "bundledir.bundle", true); next = doTestExistingBundleFile(bc, next, rootStore, dirBundleFile, "bundledir.bundle", false); }
Source:
public PagedFlux<ContainerItem> listContainers(ListContainersOptions options) { return new PagedFlux<>( () -> listContainersSegment(null, options) .map(response -> new PagedResponseBase<>( response.request(), response.statusCode(), response.headers(), response.value().containerItems(), response.value().nextMarker(), response.deserializedHeaders())), (marker) -> listContainersSegment(marker, options) .map(response -> new PagedResponseBase<>( response.request(), response.statusCode(), response.headers(), response.value().containerItems(), response.value().nextMarker(), response.deserializedHeaders()))); }

Target:
public PagedFlux<ContainerItem> listContainers(ListContainersOptions options) { return listContainersWithOptionalTimeout(options, null); }
Source:
public String toString() { if (getBuild() != null) { return getBuild().toString(); } return getProject().getName(); }

Target:
public String toString() { String s; if (getBuild() != null) { s = getBuild().toString(); } else { s = getProject().getName(); } if (isBuildCompleted()) { s += " (completed)"; } return s; }