auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void writeResourceToZip( ZipOutputStream zipOutputStream, String filename, Resource resource) { try { ZipEntry zipEntry = new ZipEntry(filename); zipOutputStream.putNextEntry(zipEntry); InputStream inputStream = resource.getInputStream(); IOUtils.copy(inputStream, zipOutputStream); inputStream.close(); } catch (IOException e) { LOGGER.debug("Failed to add resource with id to zip.", resource.getName(), e); } }

Target:
private void writeResourceToZip( ZipOutputStream zipOutputStream, String filename, Resource resource) { try (InputStream inputStream = resource.getInputStream()) { ZipEntry zipEntry = new ZipEntry(filename); zipOutputStream.putNextEntry(zipEntry); IOUtils.copy(inputStream, zipOutputStream); } catch (IOException e) { LOGGER.debug("Failed to add resource with id to zip.", resource.getName(), e); } }
Source:
@Override public boolean value(VirtualFile virtualFile) { return openedFiles.contains(virtualFile); }

Target:
public boolean value(VirtualFile virtualFile) { return openedFiles.contains(virtualFile); }
Source:
private String inputStreamToString(InputStream inputStream){ InputStreamReader isReader = new InputStreamReader(inputStream); BufferedReader reader = new BufferedReader(isReader); StringBuilder sb = new StringBuilder(); String str; try{ while((str = reader.readLine())!= null){ sb.append(str); } return sb.toString(); } catch (IOException e) { e.printStackTrace(); logger.trace("Failed to read InputStreap." + e.getMessage().toString() ); } return ""; }

Target:
private String inputStreamToString(InputStream inputStream) { InputStreamReader isReader = new InputStreamReader(inputStream); BufferedReader reader = new BufferedReader(isReader); StringBuilder sb = new StringBuilder(); String str; try { while ((str = reader.readLine()) != null) { sb.append(str); } } catch (IOException e) { logger.error("Failed to read InputStream: {}", e.getMessage()); logger.trace("Failed to read InputStream.", e); } return sb.toString(); }
Source:
private static boolean isConstructor(FunctionTree tree) { if (tree.is(Kind.METHOD)) { MethodDeclarationTree constructor = (MethodDeclarationTree) tree; Tree nameTree = constructor.name(); if (nameTree.is(Kind.IDENTIFIER_NAME)) { String name = ((IdentifierTree) nameTree).name(); if ("constructor".equals(name)) { return true; } } } return false; }

Target:
private static boolean isConstructor(FunctionTree tree) { if (tree.is(Kind.METHOD)) { MethodDeclarationTree constructor = (MethodDeclarationTree) tree; Tree nameTree = constructor.name(); if (nameTree.is(Kind.IDENTIFIER_NAME)) { String name = ((IdentifierTree) nameTree).name(); return "constructor".equals(name); } } return false; }
Source:
public void onEventMainThread(MediaEvents.MediaUploadFailed event) { ToastUtils.showToast(this, event.mErrorMessage, ToastUtils.Duration.SHORT); }

Target:
public void onEventMainThread(MediaEvents.MediaUploadFailed event) { ToastUtils.showToast(this, event.mErrorMessage, ToastUtils.Duration.LONG); }
Source:
private static void verifyStateIntervals(String testId, @NonNull ITmfStateSystem ss, Integer quark, int[] expectedStarts, ITmfStateValue[] expectedValues) throws AttributeNotFoundException, StateSystemDisposedException { int expectedCount = expectedStarts.length - 1; List<ITmfStateInterval> intervals = StateSystemUtils.queryHistoryRange(ss, quark, expectedStarts[0] * 1000000000L, expectedStarts[expectedCount] * 1000000000L); assertEquals(testId + ": Interval count", expectedCount, intervals.size()); for (int i = 0; i < expectedCount; i++) { ITmfStateInterval interval = intervals.get(i); assertEquals(testId + ": Start time of interval " + i, expectedStarts[i] * 1000000000L, interval.getStartTime()); long actualEnd = (i == expectedCount - 1) ? (expectedStarts[i + 1] * 1000000000L) : (expectedStarts[i + 1] * 1000000000L) - 1; assertEquals(testId + ": End time of interval " + i, actualEnd, interval.getEndTime()); assertEquals(testId + ": Expected value of interval " + i, expectedValues[i], interval.getStateValue()); } }

Target:
private static void verifyStateIntervals(String testId, @NonNull ITmfStateSystem ss, Integer quark, int[] expectedStarts, ITmfStateValue[] expectedValues) throws AttributeNotFoundException, StateSystemDisposedException { int expectedCount = expectedStarts.length - 1; List<ITmfStateInterval> intervals = StateSystemUtils.queryHistoryRange(ss, quark, expectedStarts[0] * TO_NS, expectedStarts[expectedCount] * TO_NS); assertEquals(testId + ": Interval count", expectedCount, intervals.size()); for (int i = 0; i < expectedCount; i++) { ITmfStateInterval interval = intervals.get(i); assertEquals(testId + ": Start time of interval " + i, expectedStarts[i] * TO_NS, interval.getStartTime()); long actualEnd = (i == expectedCount - 1) ? (expectedStarts[i + 1] * TO_NS) : (expectedStarts[i + 1] * TO_NS) - 1; assertEquals(testId + ": End time of interval " + i, actualEnd, interval.getEndTime()); assertEquals(testId + ": Expected value of interval " + i, expectedValues[i], interval.getStateValue()); } }
Source:
public synchronized TopLevelItem createProjectFromXML(String name, InputStream xml) throws IOException { acl.checkPermission(Item.CREATE); Jenkins.getInstance().getProjectNamingStrategy().checkName(name); if (parent.getItem(name) != null) { throw new IllegalArgumentException(parent.getDisplayName() + " already contains an item '" + name + "'"); } File configXml = Items.getConfigFile(getRootDirFor(name)).getFile(); final File dir = configXml.getParentFile(); dir.mkdirs(); boolean success = false; try { XMLUtils.safeTransform((Source)new StreamSource(xml), new StreamResult(new FileOutputStream(configXml))); TopLevelItem result = Items.whileUpdatingByXml(new NotReallyRoleSensitiveCallable<TopLevelItem,IOException>() { @Override public TopLevelItem call() throws IOException { return (TopLevelItem) Items.load(parent, dir); } }); success = acl.getACL().hasCreatePermission(Jenkins.getAuthentication(), parent, result.getDescriptor()) && result.getDescriptor().isApplicableIn(parent); add(result); ItemListener.fireOnCreated(result); Jenkins.getInstance().rebuildDependencyGraphAsync(); return result; } catch (TransformerException e) { success = false; throw new IOException("Failed to persist config.xml", e); } catch (SAXException e) { success = false; throw new IOException("Failed to persist config.xml", e); } catch (IOException e) { success = false; throw e; } catch (RuntimeException e) { success = false; throw e; } finally { if (!success) { Util.deleteRecursive(dir); } } }

Target:
public synchronized TopLevelItem createProjectFromXML(String name, InputStream xml) throws IOException { acl.checkPermission(Item.CREATE); Jenkins.getInstance().getProjectNamingStrategy().checkName(name); if (parent.getItem(name) != null) { throw new IllegalArgumentException(parent.getDisplayName() + " already contains an item '" + name + "'"); } File configXml = Items.getConfigFile(getRootDirFor(name)).getFile(); final File dir = configXml.getParentFile(); dir.mkdirs(); boolean success = false; FileOutputStream fos = null; try { fos = new FileOutputStream(configXml); XMLUtils.safeTransform((Source)new StreamSource(xml), new StreamResult(fos)); TopLevelItem result = Items.whileUpdatingByXml(new NotReallyRoleSensitiveCallable<TopLevelItem,IOException>() { @Override public TopLevelItem call() throws IOException { return (TopLevelItem) Items.load(parent, dir); } }); success = acl.getACL().hasCreatePermission(Jenkins.getAuthentication(), parent, result.getDescriptor()) && result.getDescriptor().isApplicableIn(parent); add(result); ItemListener.fireOnCreated(result); Jenkins.getInstance().rebuildDependencyGraphAsync(); return result; } catch (TransformerException e) { success = false; throw new IOException("Failed to persist config.xml", e); } catch (SAXException e) { success = false; throw new IOException("Failed to persist config.xml", e); } catch (IOException e) { success = false; throw e; } catch (RuntimeException e) { success = false; throw e; } finally { if (!success) { Util.deleteRecursive(dir); } if (fos != null) { fos.close(); } } }
Source:
public void closeSessionsByIp(final InetAddress ip) { sessions.stream() .filter(Session::isOpen) .filter(s -> InetExtractor.extract(s.getUserProperties()).equals(ip)) .forEach( s -> { try { s.close(); } catch (final IOException e) { log.warn("Could not close session (session is still open? {}", s.isOpen(), e); } }); removeClosedSessions(); }

Target:
public void closeSessionsByIp(final InetAddress ip) { sessions.stream() .filter(Session::isOpen) .filter(s -> InetExtractor.extract(s.getUserProperties()).equals(ip)) .forEach( s -> { try { s.close(); } catch (final IOException e) { log.warn("Could not close session (session is still open? {}", s.isOpen(), e); } }); }
Source:
public List<String> listConsumers(Properties props, String topic) { List<String> ret = new ArrayList<>(); List<String> consumers = listAllConsumers(props); for (String consumer : consumers) { if (getConsumerTopics(props, consumer).contains(topic)) { ret.add(consumer); } } return ret; }

Target:
public List<String> listConsumers(Properties props, String topic) { return listAllConsumers(props).stream() .filter(consumer -> getConsumerTopics(props, consumer).contains(topic)) .collect(Collectors.toList()); }
Source:
public <T extends BaseDTO<Entity>> T getDtoByUniqueField(DetachedCriteria criteria) throws AppException { List<T> result = findAll(criteria, null); if (result.size() == 0) { return null; } else if (result.size() == 1) { return result.get(0); } else { System.out.println(result.size()); throw new AppException("the value is not unique."); } }

Target:
public <T extends BaseDTO<Entity>> T getDtoByUniqueField(DetachedCriteria criteria) throws AppException { List<T> result = findAll(criteria, null); if (result.size() == 0) { return null; } else if (result.size() == 1) { return result.get(0); } else { throw new AppException("the value is not unique."); } }
Source:
public void testUsesCustomController() { AbstractController controller = app.createAndManageChild(EntitySpec.create(AbstractControllerTest.TrackingAbstractController.class).displayName("mycustom")); ControlledDynamicWebAppCluster cluster = app.createAndManageChild(EntitySpec.create(ControlledDynamicWebAppCluster.class) .configure("initialSize", 0) .configure(ControlledDynamicWebAppCluster.CONTROLLER, controller) .configure("memberSpec", EntitySpec.create(JBoss7Server.class).configure("war", warUrl.toString()))); app.start(locs); EntityTestUtils.assertAttributeEqualsEventually(controller, AbstractController.SERVICE_UP, true); assertEquals(cluster.getController(), controller); cluster.stop(); EntityTestUtils.assertAttributeEquals(controller, AbstractController.SERVICE_UP, true); }

Target:
public void testUsesCustomController() { AbstractController controller = app.createAndManageChild(EntitySpec.create(TrackingAbstractController.class).displayName("mycustom")); ControlledDynamicWebAppCluster cluster = app.createAndManageChild(EntitySpec.create(ControlledDynamicWebAppCluster.class) .configure("initialSize", 0) .configure(ControlledDynamicWebAppCluster.CONTROLLER, controller) .configure("memberSpec", EntitySpec.create(JBoss7Server.class).configure("war", warUrl.toString()))); app.start(locs); EntityTestUtils.assertAttributeEqualsEventually(controller, AbstractController.SERVICE_UP, true); assertEquals(cluster.getController(), controller); cluster.stop(); EntityTestUtils.assertAttributeEquals(controller, AbstractController.SERVICE_UP, true); }
Source:
protected String getBody() { if (bodyContent == null) { return ""; } else { if (doNotTrimBody == false && stripBodyLineBreaks == false) { return bodyContent.getString().trim(); } else { String whitespaceModifiedBodyContent = bodyContent.getString(); if (stripBodyLineBreaks) { whitespaceModifiedBodyContent = whitespaceModifiedBodyContent.replaceAll("[\r\n]+?", ""); } if (doNotTrimBody == false) { whitespaceModifiedBodyContent = whitespaceModifiedBodyContent.trim(); } return whitespaceModifiedBodyContent; } } }

Target:
protected String getBody() { if (trimBody) { return super.getBody(); } else { return (bodyContent == null ? "" : bodyContent.getString()); } }
Source:
public void testBingTilesAround() { assertFunction("transform(bing_tiles_around(30.12, 60, 15), x -> bing_tile_quadkey(x))", new ArrayType(VARCHAR), ImmutableList.of( "123030123010112", "123030123010103", "123030123010130", "123030123010102", "123030123010121", "123030123010132", "123030123010120", "123030123010123", "123030123010122")); }

Target:
public void testBingTilesAround() { assertFunction("transform(bing_tiles_around(30.12, 60, 1), x -> bing_tile_quadkey(x))", new ArrayType(VARCHAR), ImmutableList.of("0", "3", "1", "2")); assertFunction("transform(bing_tiles_around(30.12, 60, 15), x -> bing_tile_quadkey(x))", new ArrayType(VARCHAR), ImmutableList.of( "123030123010112", "123030123010103", "123030123010130", "123030123010102", "123030123010121", "123030123010132", "123030123010120", "123030123010123", "123030123010122")); assertFunction("transform(bing_tiles_around(30.12, 60, 23), x -> bing_tile_quadkey(x))", new ArrayType(VARCHAR), ImmutableList.of( "12303012301012121210132", "12303012301012121210123", "12303012301012121210310", "12303012301012121210302", "12303012301012121210122", "12303012301012121210301", "12303012301012121210312", "12303012301012121210300", "12303012301012121210303")); }
Source:
public void shouldCreateNewAutoGenerationOption() throws Exception { long originalCount = getAllCount(); boolean automaticGenerationEnabled = true; boolean manualEntryEnabled = true; SimpleObject autoGenerationOption = new SimpleObject(); autoGenerationOption.add("identifierType", getUuid()); autoGenerationOption.add("location", "8d6c993e-c2cc-11de-8d13-0010c6dffd0f"); autoGenerationOption.add("source", "0d47284f-9e9b-4a81-a88b-8bb42bc0a901"); autoGenerationOption.add("automaticGenerationEnabled", automaticGenerationEnabled); autoGenerationOption.add("manualEntryEnabled", manualEntryEnabled); String json = new ObjectMapper().writeValueAsString(autoGenerationOption); MockHttpServletRequest req = request(RequestMethod.POST, getURI()); req.setContent(json.getBytes()); SimpleObject newAutoGenerationOption = deserialize(handle(req)); assertNotNull(PropertyUtils.getProperty(newAutoGenerationOption, "uuid")); assertEquals(originalCount + 1, getAllCount()); }

Target:
public void shouldCreateNewAutoGenerationOption() throws Exception { long originalCount = getAllCount(); SimpleObject autoGenerationOption = new SimpleObject(); autoGenerationOption.add("identifierType", IDENTIFIER_TYPE_UUID); autoGenerationOption.add("location", LOCATION); autoGenerationOption.add("source", SOURCE); autoGenerationOption.add("automaticGenerationEnabled", true); autoGenerationOption.add("manualEntryEnabled", true); String json = new ObjectMapper().writeValueAsString(autoGenerationOption); MockHttpServletRequest req = request(RequestMethod.POST, getURI()); req.setContent(json.getBytes()); SimpleObject newAutoGenerationOption = deserialize(handle(req)); assertNotNull(PropertyUtils.getProperty(newAutoGenerationOption, "uuid")); assertEquals(originalCount + 1, getAllCount()); assertEquals(SOURCE, PropertyUtils.getProperty(newAutoGenerationOption, "source")); assertEquals(LOCATION, PropertyUtils.getProperty(newAutoGenerationOption, "location")); assertEquals(IDENTIFIER_TYPE_UUID, PropertyUtils.getProperty(newAutoGenerationOption, "identifierType")); assertEquals(true, PropertyUtils.getProperty(newAutoGenerationOption, "automaticGenerationEnabled")); assertEquals(true, PropertyUtils.getProperty(newAutoGenerationOption, "manualEntryEnabled")); }
Source:
public void startPolling(AuthenticatedContext ac, AzureManagedImageCreationCheckerContext checkerContext) { PollTask<Boolean> managedImageCreationStatusCheckerTask = azurePollTaskFactory.managedImageCreationCheckerTask(ac, checkerContext); try { LOGGER.info("Start polling managed image creation: {}", checkerContext.getImageName()); syncPollingScheduler.schedule(managedImageCreationStatusCheckerTask, MANAGED_IMAGE_CREATION_CHECKING_INTERVAL, MANAGED_IMAGE_CREATION_CHECKING_MAX_ATTEMPT, MAX_FAILURE_TOLERANT); } catch (Exception e) { LOGGER.debug("Managed image creation failed.", e); } }

Target:
public void startPolling(AuthenticatedContext ac, AzureManagedImageCreationCheckerContext checkerContext) { PollTask<Boolean> managedImageCreationStatusCheckerTask = azurePollTaskFactory.managedImageCreationCheckerTask(ac, checkerContext); try { LOGGER.info("Start polling managed image creation: {}", checkerContext.getImageName()); syncPollingScheduler.schedule(managedImageCreationStatusCheckerTask, MANAGED_IMAGE_CREATION_CHECKING_INTERVAL, MANAGED_IMAGE_CREATION_CHECKING_MAX_ATTEMPT, MAX_FAILURE_TOLERANT); } catch (Exception e) { LOGGER.error("Managed image creation failed.", e); throw new CloudConnectorException(e); } }
Source:
public void stop() { LOG.debug("stop"); }

Target:
public void stop() { LOG.debug("stopping AxisToClientConnectorBridge"); }
Source:
protected boolean validatePage() { if (nattableConfigurationFileName != null) { if (nattableConfigurationFileName.getText().equals("")) { this.setErrorMessage("Set nattable configuration file name"); return false; } } return super.validatePage(); }

Target:
protected boolean validatePage() { if (null != nattableConfigurationFileName) { if ("".equals(nattableConfigurationFileName.getText())) { this.setErrorMessage("Set nattable configuration file name"); return false; } } return super.validatePage(); }
Source:
private TreeMap<Integer, Integer> generateColumnPositionList(String rawQuery, TreeMap<String, Integer> columnNames) { TreeMap<Integer, Integer> columnPositionList = new TreeMap<>(new Comparator<Integer>() { @Override public int compare(Integer val1, Integer val2) { return val1 - val2; } }); for (Entry<String, Integer> column : columnNames.entrySet()) { int lastIndex = 0; while (true) { int index = rawQuery.indexOf(":" + column.getKey(), lastIndex); if (index == -1) { break; } if (!columnPositionList.containsKey(index)) { columnPositionList.put(index, column.getValue()); } lastIndex = index + 2; } } return columnPositionList; }

Target:
private TreeMap<Integer, Integer> generateColumnPositionList(String rawQuery, TreeMap<String, Integer> columnNames) { TreeMap<Integer, Integer> columnPositionList = new TreeMap<>(); for (Entry<String, Integer> column : columnNames.entrySet()) { int lastIndex = 0; while (true) { int index = rawQuery.indexOf(":" + column.getKey(), lastIndex); if (index == -1) { break; } if (!columnPositionList.containsKey(index)) { columnPositionList.put(index, column.getValue()); } lastIndex = index + 2; } } return columnPositionList; }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.recycler_view_demo); final String name = "Android User"; mSendButton = (Button) findViewById(R.id.sendButton); mMessageEdit = (EditText) findViewById(R.id.messageEdit); final RecyclerView messages = (RecyclerView) findViewById(R.id.messagesList); messages.setHasFixedSize(true); messages.setLayoutManager(new LinearLayoutManager(this)); mRef = new Firebase("<LINK_1>"); mSendButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Chat chat = new Chat(name, mMessageEdit.getText().toString()); mRef.push().setValue(chat, new Firebase.CompletionListener() { @Override public void onComplete(FirebaseError firebaseError, Firebase firebase) { if (firebaseError != null) { Log.e(TAG, firebaseError.toString()); } } }); mMessageEdit.setText(""); } }); Query recentMessages = mRef.limitToLast(50); FirebaseRecyclerViewAdapter<Chat, ChatHolder> adapter = new FirebaseRecyclerViewAdapter<Chat, ChatHolder>(Chat.class, android.R.layout.two_line_list_item, ChatHolder.class, recentMessages) { @Override public void populateViewHolder(ChatHolder chatView, Chat chat) { chatView.textView.setText(chat.getText()); chatView.textView.setPadding(10, 0, 10, 0); chatView.nameView.setText(chat.getName()); chatView.nameView.setPadding(10, 0, 10, 15); if (chat.getName().equals(name)) { chatView.textView.setGravity(Gravity.END); chatView.nameView.setGravity(Gravity.END); chatView.nameView.setTextColor(Color.parseColor("#8BC34A")); } else { chatView.nameView.setTextColor(Color.parseColor("#00BCD4")); } } }; messages.setAdapter(adapter); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.recycler_view_demo); mSendButton = (Button) findViewById(R.id.sendButton); mMessageEdit = (EditText) findViewById(R.id.messageEdit); mRef = new Firebase("<LINK_0>"); mChatRef = mRef.limitToLast(50); mSendButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Chat chat = new Chat(name, mAuthData.getUid(), mMessageEdit.getText().toString()); mRef.push().setValue(chat, new Firebase.CompletionListener() { @Override public void onComplete(FirebaseError firebaseError, Firebase firebase) { if (firebaseError != null) { Log.e(TAG, firebaseError.toString()); } } }); mMessageEdit.setText(""); } }); mMessages = (RecyclerView) findViewById(R.id.messagesList); LinearLayoutManager manager = new LinearLayoutManager(this); manager.setStackFromEnd(true); mMessages.setHasFixedSize(true); mMessages.setLayoutManager(manager); updateChat(); }
Source:
public void bank() { System.out.println("banking"); ctx.bank.open(); ctx.bank.depositAllExcept(tinder_id); ctx.bank.withdraw(logChoiceID, 27); ctx.bank.close(); }

Target:
public void bank() { System.out.println("banking"); ctx.bank.open(); Condition.wait(new Callable<Boolean>() { @Override public Boolean call() throws Exception { return ctx.bank.opened(); } }); ctx.bank.depositAllExcept(tinder_id); Condition.wait(new Callable<Boolean>() { @Override public Boolean call() throws Exception { return ctx.inventory.count() == 1; } }); boolean successfulWithdraw = ctx.bank.withdraw(logChoiceID, 27); if (!successfulWithdraw) { boolean tryAgain = ctx.bank.withdraw(logChoiceID, 27); if (!tryAgain) { System.out.println("failed withdraw twice"); stop(); } } Condition.wait(new Callable<Boolean>() { @Override public Boolean call() throws Exception { return ctx.inventory.count() > 1; } }); ctx.bank.close(); }
Source:
public String getTitle() { return isSameDay(date, new Date()) ? "Today Messages" : "Messages"; }

Target:
public String getTitle() { return isSameDay(date, new Date()) ? ZulipApp.get().getString(R.string.today_messages) : ZulipApp.get().getString(R.string.messages); }
Source:
public List<String> getConflictList() { return conflictList; }

Target:
public List<File> getConflictList() { return conflictList; }
Source:
static boolean initializeUnityAds(Activity activity, String gameId) { if (!UnityAds.isSupported()) { Log.w(UnityAdapter.TAG, "The current device is not supported by Unity Ads."); return false; } if (UnityAds.isInitialized()) { return true; } UnitySingleton.activity = new WeakReference<>(activity); MediationMetaData mediationMetaData = new MediationMetaData(activity); mediationMetaData.setName("AdMob"); mediationMetaData.setVersion(BuildConfig.VERSION_NAME); mediationMetaData.set("adapter_version", "3.1.0"); mediationMetaData.commit(); UnitySingletonListener unitySingleton = UnitySingleton.getInstance(); UnityBanners.setBannerListener(unitySingleton); bool testMode = false; bool enablePerPlacementLoad = true; initialize(activity, gameId, UnitySingleton.getInstance(), testMode, enablePerPlacementLoad); return true; }

Target:
static boolean initializeUnityAds(Activity activity, String gameId) { currentGameID = gameId; if (!UnityAds.isSupported()) { Log.w(UnityAdapter.TAG, "The current device is not supported by Unity Ads."); return false; } if (UnityAds.isInitialized()) { return true; } UnitySingleton.activity = new WeakReference<>(activity); MediationMetaData mediationMetaData = new MediationMetaData(activity); mediationMetaData.setName("AdMob"); mediationMetaData.setVersion(BuildConfig.VERSION_NAME); mediationMetaData.set("adapter_version", "3.2.0"); mediationMetaData.commit(); UnitySingletonListener unitySingleton = UnitySingleton.getInstance(); UnityBanners.setBannerListener(unitySingleton); UnityAds.initialize(activity, gameId, UnitySingleton.getInstance(), false, true); return true; }
Source:
public void removeStream(int ssrc) { }

Target:
public void removeStream(int ssrc) { synchronized (critSect) { try { ssrcs_.remove(ssrc & 0xFFFF_FFFFL); } catch (ArrayIndexOutOfBoundsException e) { logger.info("Cannot remove SSRC, " + "SSRC not found"); } } }
Source:
private InternalDistributedMember readServerMember(DataInputStream p_dis) throws IOException { byte[] memberBytes = DataSerializer.readByteArray(p_dis); final VersionOrdinal v = StaticSerialization.getVersionForDataStreamOrNull(p_dis); ByteArrayDataInput dis = new ByteArrayDataInput(memberBytes, v); try { return DataSerializer.readObject(dis); } catch (EOFException e) { throw e; } catch (Exception e) { throw new InternalGemFireException( "Unable to deserialize member", e); } }

Target:
private InternalDistributedMember readServerMember(DataInputStream p_dis) throws IOException { byte[] memberBytes = DataSerializer.readByteArray(p_dis); Version v = StaticSerialization.getVersionForDataStreamOrNull(p_dis); ByteArrayDataInput dis = new ByteArrayDataInput(memberBytes, v); try { return DataSerializer.readObject(dis); } catch (EOFException e) { throw e; } catch (Exception e) { throw new InternalGemFireException( "Unable to deserialize member", e); } }
Source:
public void testMultipleContentLengthHeaders() { EmbeddedChannel channel = new EmbeddedChannel(new HttpRequestDecoder()); String requestStr = "GET /some/path HTTP/1.1\r\n" + "Content-Length: 1\r\n" + "Content-Length: 0\r\n\r\n" + "b"; assertTrue(channel.writeInbound(Unpooled.copiedBuffer(requestStr, CharsetUtil.US_ASCII))); HttpRequest request = channel.readInbound(); assertTrue(request.decoderResult().isFailure()); assertTrue(request.decoderResult().cause() instanceof IllegalArgumentException); assertFalse(channel.finish()); }

Target:
public void testMultipleContentLengthHeaders() { String requestStr = "GET /some/path HTTP/1.1\r\n" + "Content-Length: 1\r\n" + "Content-Length: 0\r\n\r\n" + "b"; testInvalidHeaders0(requestStr); }
Source:
public Promise<Object> submit(CheckType checkType, Runnable runnable) { final Job job = new ValidationJob(checkType.getName(), runnable); String uniqueRuleId = UUID.randomUUID().toString(); final ISchedulingRule schedulingRule = new ValidationRuleSchedulingRule(checkType, maxValidationThreadCount, uniqueRuleId); final Promise<Object> isRuleDonePromise = new Promise<>(); job.setSystem(true); job.setRule(schedulingRule); job.addJobChangeListener(new JobChangeAdapter() { public void done(IJobChangeEvent event) { if (event.getResult().isOK()) { isRuleDonePromise.resolve(Boolean.TRUE); } else { isRuleDonePromise.reject(new ValidationException(String.format("Validation job failed with status %s.", event.getResult()))); } }; }); job.schedule(); return isRuleDonePromise; }

Target:
public Promise<Object> submit(CheckType checkType, Runnable runnable) { final Job job = new ValidationJob(checkType.getName(), runnable); final String uniqueRuleId = UUID.randomUUID().toString(); final ISchedulingRule schedulingRule = new ValidationRuleSchedulingRule(checkType, maxValidationThreadCount, maxConcurrentExpensiveJobs, maxConcurrentNormalJobs, uniqueRuleId); final Promise<Object> promise = new Promise<>(); job.setSystem(true); job.setRule(schedulingRule); job.addJobChangeListener(new JobChangeAdapter() { @Override public void done(IJobChangeEvent event) { if (event.getResult().isOK()) { promise.resolve(Boolean.TRUE); } else { promise.reject(new ValidationException(String.format("Validation job failed with status %s.", event.getResult()))); } } }); job.schedule(); return promise; }
Source:
public void testExpressionPerformance() throws Exception { System.out.println("===Expression performance tests==="); System.out.println("---1 million---"); runExpressionPerformance(1000000); System.out.println("---10 million---"); runExpressionPerformance(10000000); System.out.println("---100 million---"); runExpressionPerformance(100000000); System.out.println("---1 billion---"); runExpressionPerformance(1000000000); }

Target:
public void testExpressionPerformance() throws Exception { logger.info("===Expression performance tests==="); logger.info("---1 million---"); runExpressionPerformance(1000000); logger.info("---10 million---"); runExpressionPerformance(10000000); logger.info("---100 million---"); runExpressionPerformance(100000000); logger.info("---1 billion---"); runExpressionPerformance(1000000000); }
Source:
private DashboardResource parse(ProjectControl ctl, String ref, String path, ProjectControl myCtl) throws ResourceNotFoundException, IOException, ConfigInvalidException { String id = ref + ":" + path; if (!ref.startsWith(REFS_DASHBOARDS)) { ref = REFS_DASHBOARDS + ref; } if (!Repository.isValidRefName(ref) || !ctl.controlForRef(ref).canRead()) { throw new ResourceNotFoundException(id); } Repository git; try { git = gitManager.openRepository(ctl.getProject().getNameKey()); } catch (RepositoryNotFoundException e) { throw new ResourceNotFoundException(id); } try { ObjectId objId; try { objId = git.resolve(id); } catch (AmbiguousObjectException e) { throw new ResourceNotFoundException(id); } catch (IncorrectObjectTypeException e) { throw new ResourceNotFoundException(id); } if (objId == null) { throw new ResourceNotFoundException(id); } BlobBasedConfig cfg = new BlobBasedConfig(null, git, objId); return new DashboardResource(myCtl, ref, path, cfg, false); } finally { git.close(); } }

Target:
private DashboardResource parse(ProjectControl ctl, String ref, String path, ProjectControl myCtl) throws ResourceNotFoundException, IOException, AmbiguousObjectException, IncorrectObjectTypeException, ConfigInvalidException { String id = ref + ":" + path; if (!ref.startsWith(REFS_DASHBOARDS)) { ref = REFS_DASHBOARDS + ref; } if (!Repository.isValidRefName(ref) || !ctl.controlForRef(ref).canRead()) { throw new ResourceNotFoundException(id); } Repository git; try { git = gitManager.openRepository(ctl.getProject().getNameKey()); } catch (RepositoryNotFoundException e) { throw new ResourceNotFoundException(id); } try { ObjectId objId = git.resolve(ref + ":" + path); if (objId == null) { throw new ResourceNotFoundException(id); } BlobBasedConfig cfg = new BlobBasedConfig(null, git, objId); return new DashboardResource(myCtl, ref, path, cfg, false); } finally { git.close(); } }
Source:
public static void setUpBeforeClass() throws CoreException, IOException { provider = new MockConnectionProvider(); provider.start(); project = TestUtils.createProject(EditorToOutlineAdapterFactoryTest.class.getName() + System.currentTimeMillis()); testFile = TestUtils.createUniqueTestFile(project, "Hello World !!"); IViewPart viewPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() .findView("org.eclipse.ui.views.ContentOutline"); if (viewPart instanceof ContentOutline) { outline = (ContentOutline) viewPart; } Assert.assertNotNull(outline); }

Target:
public static void setUpBeforeClass() throws CoreException, IOException { project = TestUtils .createProject(EditorToOutlineAdapterFactoryTest.class.getName() + System.currentTimeMillis()); testFile = TestUtils.createUniqueTestFile(project, "Hello World !!"); IViewPart viewPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() .findView("org.eclipse.ui.views.ContentOutline"); if (viewPart instanceof ContentOutline) { outline = (ContentOutline) viewPart; } Assert.assertNotNull(outline); }
Source:
Flux<ByteBuffer> getBody() { if (batchOperationQueue.isEmpty()) { throw logger.logExceptionAsError(new UnsupportedOperationException("Empty batch requests aren't allowed.")); } Disposable disposable = Flux.fromStream(batchOperationQueue.stream()) .flatMap(batchOperation -> batchOperation) .subscribe(); while (!disposable.isDisposed()) { } this.batchRequest.add(ByteBuffer .wrap(String.format("--%s--NEWLINE", batchBoundary).getBytes(StandardCharsets.UTF_8))); return Flux.fromIterable(batchRequest); }

Target:
Flux<ByteBuffer> getBody() { if (batchOperationQueue.isEmpty()) { throw logger.logExceptionAsError(new UnsupportedOperationException("Empty batch requests aren't allowed.")); } Disposable disposable = Flux.fromStream(batchOperationQueue.stream()) .flatMap(batchOperation -> batchOperation) .subscribe(); while (!disposable.isDisposed()) { } this.batchRequest.add(ByteBuffer.wrap( String.format("--%s--%s", batchBoundary, BlobBatchHelper.HTTP_NEWLINE).getBytes(StandardCharsets.UTF_8))); return Flux.fromIterable(batchRequest); }
Source:
public static Map<String, GeneAnnotation> parseGeneAnnotations( final File file) throws IOException { Map<String, GeneAnnotation> genomeAnnotations = new HashMap<String, GeneAnnotation>(); Stream<String> annotationFile = Files.lines(file.toPath()); annotationFile.forEach(line -> { GeneAnnotation genome = parseGeneAnnotation(line); if (genome != null) { genomeAnnotations.put(genome.getName(), genome); } }); annotationFile.close(); return genomeAnnotations; }

Target:
public static Set<GeneAnnotation> parseGeneAnnotations(final File file) throws IOException { Set<GeneAnnotation> genomeAnnotations = new HashSet<>(); Stream<String> annotationLines = Files.lines(file.toPath()); annotationLines.map(GeneAnnotationParser::parseGeneAnnotation) .filter(genome -> genome != null) .forEach(genome -> genomeAnnotations.add(genome)); annotationLines.close(); return genomeAnnotations; }
Source:
public static void trimMemory() { synchronized (sAppIconCache) { sAppIconCache.clear(); } System.gc(); }

Target:
public static void trimMemory() { synchronized (sAppIconCache) { sAppIconCache.clear(); } }
Source:
protected void setUp() throws Exception { source = "void foo(int x) {\n\tx += 1;\n}"; expectedSource = "void foo(int x) {\n\tx++;\n}"; super.setUp(); }

Target:
protected void setUp() throws Exception { source = "void foo(int x) {\n" + " x += 1;\n" + "}"; expectedSource = "void foo(int x) {\n" + " x++;\n" + "}"; super.setUp(); }
Source:
public SimpleDeadlineManager(ScopeAwareProvider scopeAwareProvider) { this(scopeAwareProvider, Executors.newSingleThreadScheduledExecutor(), NoTransactionManager.INSTANCE); }

Target:
public SimpleDeadlineManager(ScopeAwareProvider scopeAwareProvider) { this(scopeAwareProvider, NoTransactionManager.INSTANCE); }
Source:
public AuthenticationEventExecutionPlanConfigurer ldapPasswordSynchronizationAuthenticationEventExecutionPlanConfigurer( @Qualifier("ldapPasswordSynchronizationAuthenticationPostProcessorListFactoryBean") final ListFactoryBean ldapPasswordSynchronizationAuthenticationPostProcessorListFactoryBean) { return plan -> { try { val postProcessorList = Objects.requireNonNull(ldapPasswordSynchronizationAuthenticationPostProcessorListFactoryBean.getObject()); val ldap = casProperties.getAuthn().getPasswordSync().getLdap(); ldap.stream() .filter(LdapPasswordSynchronizationProperties::isEnabled) .forEach(instance -> { val postProcessor = new LdapPasswordSynchronizationAuthenticationPostProcessor(instance); postProcessorList.add(postProcessor); plan.registerAuthenticationPostProcessor(postProcessor); }); } catch (final Exception e) { throw new BeanCreationException("Error creating ldapPasswordSynchronizationAuthenticationPostProcessorListFactoryBean: {}", e.getMessage(), e); } }; }

Target:
public AuthenticationEventExecutionPlanConfigurer ldapPasswordSynchronizationAuthenticationEventExecutionPlanConfigurer( @Qualifier("ldapPasswordSynchronizationAuthenticationPostProcessorListFactoryBean") final ListFactoryBean ldapPasswordSynchronizationAuthenticationPostProcessorListFactoryBean) { return plan -> { try { val postProcessorList = Objects.requireNonNull(ldapPasswordSynchronizationAuthenticationPostProcessorListFactoryBean.getObject()); val ldap = casProperties.getAuthn().getPasswordSync().getLdap(); ldap.stream() .filter(LdapPasswordSynchronizationProperties::isEnabled) .forEach(instance -> { val postProcessor = new LdapPasswordSynchronizationAuthenticationPostProcessor(instance); postProcessorList.add(postProcessor); plan.registerAuthenticationPostProcessor(postProcessor); }); } catch (final Exception e) { throw new BeanCreationException("Error creating ldapPasswordSynchronizationAuthenticationEventExecutionPlanConfigurer: " + e.getMessage(), e); } }; }
Source:
public void testLinkToConvertedMarkupDocument_WithAnchor() throws URISyntaxException { final File file = new File("/base/2/with space/"); builder.setConvertMarkupPageLinks(true); builder.setBase(file.toURI()); parser.parse("\"An URL\":foo/bar#bar"); String html = out.toString(); TestUtil.println("HTML: \n" + html); Pattern pattern = Pattern.compile("<a href=\"file:(/[A-Z]{1}:)?/base/2/with%20space/foo/bar.html#bar\">An URL</a>"); assertTrue(pattern.matcher(html).find()); }

Target:
public void testLinkToConvertedMarkupDocument_WithAnchor() throws URISyntaxException { final File file = new File("/base/2/with space/"); builder.setHtmlFilenameFormat("$1.html"); builder.setBase(file.toURI()); parser.parse("\"An URL\":foo/bar#bar"); assertMatch("<a href=\"file:(/[A-Z]{1}:)?/base/2/with%20space/foo/bar.html#bar\">An URL</a>"); }
Source:
public void addPrivateEndpointNetworkPolicies(CloudSubnet cloudSubnet, String state) { cloudSubnet.putParameter(PRIVATE_ENDPOINT_NETWORK_POLICIES, "Disabled".equals(state) ? DISABLED : ENABLED); }

Target:
public void addPrivateEndpointNetworkPolicies(CloudSubnet cloudSubnet, String state) { cloudSubnet.putParameter(PRIVATE_ENDPOINT_NETWORK_POLICIES, "Disabled".equalsIgnoreCase(state) ? DISABLED : ENABLED); }
Source:
public boolean hasPermission(String sid, Permission p, boolean principal) { final SecurityRealm securityRealm = Jenkins.getInstance().getSecurityRealm(); final IdStrategy strategy = principal ? securityRealm.getUserIdStrategy() : securityRealm.getGroupIdStrategy(); for (; p != null; p = p.impliedBy) { if (!p.getEnabled()) { continue; } Set<String> set = grantedPermissions.get(p); if (set != null && set.contains(sid)) return true; if (set != null) { for (String s: set) { if (strategy.equals(s, sid)) { return true; } } } } return false; }

Target:
public boolean hasPermission(String sid, Permission p, boolean principal) { final SecurityRealm securityRealm = Jenkins.getActiveInstance().getSecurityRealm(); final IdStrategy strategy = principal ? securityRealm.getUserIdStrategy() : securityRealm.getGroupIdStrategy(); for (; p != null; p = p.impliedBy) { if (!p.getEnabled()) { continue; } Set<String> set = grantedPermissions.get(p); if (set == null) { continue; } if (set.contains(sid)) { return true; } for (String s : set) { if (strategy.equals(s, sid)) { return true; } } } return false; }
Source:
public void run() { while (true) { try { ErrorInfoItem currItem; currItem = m_errorInfo.take(); if (currItem.lineNumber == -1) { return; } if (currItem.errorInfo.length != 2) { System.out.println("internal error, information is not enough"); } out_invaliderowfile.write(currItem.errorInfo[0] + "\n"); String message = "Invalid input on line " + currItem.lineNumber + ". " + currItem.errorInfo[1]; out_logfile.write(message + "\n Content: " + currItem.errorInfo[0] + "\n"); m_errorCount++; } catch (Exception x) { try { out_logfile.write(x.getMessage()); } catch (IOException e) { e.printStackTrace(); } } } }

Target:
public void run() { while (true) { try { ErrorInfoItem currItem; currItem = m_errorInfo.take(); if (currItem.lineNumber == -1) { return; } if (currItem.errorInfo.length != 2) { System.out.println("internal error, information is not enough"); } out_invaliderowfile.write(currItem.errorInfo[0] + "\n"); String message = "Invalid input on line " + currItem.lineNumber + ". " + currItem.errorInfo[1]; out_logfile.write(message + "\n Content: " + currItem.errorInfo[0] + "\n"); m_errorCount++; } catch (Exception x) { System.err.println(x.getMessage()); } } }
Source:
StatementClient startQuery(String sql, Map<String, String> sessionPropertiesOverride) { String source = firstNonNull(clientInfo.get("ApplicationName"), "presto-jdbc"); Map<String, String> allProperties = new HashMap<>(sessionProperties); allProperties.putAll(sessionPropertiesOverride); int millis = networkTimeoutMillis.get(); Duration timeout = (millis > 0) ? new Duration(millis, MILLISECONDS) : new Duration(1, DAYS); ClientSession session = new ClientSession( httpUri, user, source, ImmutableSet.of(), clientInfo.get("ClientInfo"), catalog.get(), schema.get(), timeZoneId.get(), locale.get(), ImmutableMap.copyOf(allProperties), ImmutableMap.copyOf(preparedStatements), transactionId.get(), false, timeout); return queryExecutor.startQuery(session, sql); }

Target:
StatementClient startQuery(String sql, Map<String, String> sessionPropertiesOverride) { String source = firstNonNull(clientInfo.get("ApplicationName"), "presto-jdbc"); Iterable<String> clientTags = Splitter.on(',').trimResults().omitEmptyStrings() .split(nullToEmpty(clientInfo.get("ClientTags"))); Map<String, String> allProperties = new HashMap<>(sessionProperties); allProperties.putAll(sessionPropertiesOverride); int millis = networkTimeoutMillis.get(); Duration timeout = (millis > 0) ? new Duration(millis, MILLISECONDS) : new Duration(999, DAYS); ClientSession session = new ClientSession( httpUri, user, source, ImmutableSet.copyOf(clientTags), clientInfo.get("ClientInfo"), catalog.get(), schema.get(), timeZoneId.get(), locale.get(), ImmutableMap.copyOf(allProperties), ImmutableMap.copyOf(preparedStatements), transactionId.get(), false, timeout); return queryExecutor.startQuery(session, sql); }
Source:
public boolean isThisType(String name, boolean open) { Location location = new Location(name); if (!location.exists()) { return false; } if (checkSuffix(name, ND_SUFFIX)) return true; if (open) { location = location.getAbsoluteFile(); Location parent = location.getParentFile(); String baseName = location.getName(); while (baseName.indexOf('_') >= 0) { baseName = baseName.substring(0, baseName.lastIndexOf("_")); if (checkSuffix(name, suffixes)) { for (String ext : PARENT_INDEX_SUFFIX) { if ((new Location(parent, baseName + "." + ext)).exists() || (new Location(parent, baseName + "." + ext.toUpperCase())).exists()) { return true; } } } } } return super.isThisType(name, open); }

Target:
public boolean isThisType(String name, boolean open) { Location location = new Location(name); if (!location.exists()) { return false; } if (checkSuffix(name, ND_SUFFIX)) return true; if (open) { location = location.getAbsoluteFile(); Location parent = location.getParentFile(); String baseName = location.getName(); while (baseName.indexOf('_') >= 0) { baseName = baseName.substring(0, baseName.lastIndexOf("_")); if (checkSuffix(name, suffixes)) { for (String ext : ND_SUFFIX) { if (new Location(parent, baseName + "." + ext).exists() || new Location(parent, baseName + "." + ext.toUpperCase()).exists()) { return true; } } if (new Location(parent, baseName + ".htd").exists() || new Location(parent, baseName + ".HTD").exists()) { return false; } } } } return super.isThisType(name, open); }
Source:
public Schema createSchema(DocumentType input) { Schema schema = Schema.createRecord(getName(input), null, input.getNamespace().prefix, false); List<Field> fields = new ArrayList<>(input.getSchemas().size()); for (org.nuxeo.ecm.core.schema.types.Schema s : context.sort(input.getSchemas())) { Schema fieldSchema = context.createSchema(s); if (fieldSchema != null) { fields.add(new Field(s.getName(), fieldSchema, null, (Object) null)); } else { log.error("field schema is null for : " + s.getName()); } } schema.setFields(fields); return schema; }

Target:
public Schema createSchema(DocumentType input) { Schema schema = Schema.createRecord(getName(input), null, input.getNamespace().prefix, false); List<Field> fields = new ArrayList<>(input.getSchemas().size()); for (org.nuxeo.ecm.core.schema.types.Schema s : context.sort(input.getSchemas())) { fields.add(new Field(s.getName(), context.createSchema(s), null, (Object) null)); } schema.setFields(fields); return schema; }
Source:
protected float getAssignmentScore(AssignableNode node, AssignableReplica replica, ClusterContext clusterContext) { Map<String, String> bestPossibleStateMap = getStateMap(replica, clusterContext.getBestPossibleAssignment()); if (!bestPossibleStateMap.isEmpty()) { return calculateAssignmentScale(node, replica, bestPossibleStateMap); } Map<String, String> baselineStateMap = getStateMap(replica, clusterContext.getBaselineAssignment()); if (!baselineStateMap.isEmpty()) { return calculateAssignmentScale(node, replica, baselineStateMap); } return 0; }

Target:
protected double getAssignmentScore(AssignableNode node, AssignableReplica replica, ClusterContext clusterContext) { Map<String, String> bestPossibleAssignment = getStateMap(replica, clusterContext.getBestPossibleAssignment()); if (!bestPossibleAssignment.isEmpty()) { return calculateAssignmentScale(node, replica, bestPossibleAssignment); } Map<String, String> baselineAssignment = getStateMap(replica, clusterContext.getBaselineAssignment()); if (!baselineAssignment.isEmpty()) { return calculateAssignmentScale(node, replica, baselineAssignment); } return 0; }
Source:
public Tenant createTenant(final TenantData data, final CallContext context) throws TenantApiException { final Tenant tenant = new DefaultTenant(data); if (null != tenant.getExternalKey() && tenant.getExternalKey().length() > 255) { throw new TenantApiException(ErrorCode.EXTERNAL_KEY_LIMIT_EXCEEDED); } if (data.getApiKey() != null && getTenantByApiKey(data.getApiKey()) != null) { throw new TenantApiException(ErrorCode.TENANT_ALREADY_EXISTS, data.getExternalKey()); } try { tenantDao.create(new TenantModelDao(tenant), internalCallContextFactory.createInternalCallContextWithoutAccountRecordId(context)); } catch (final TenantApiException e) { throw new TenantApiException(e, ErrorCode.TENANT_CREATION_FAILED); } return tenant; }

Target:
public Tenant createTenant(final TenantData data, final CallContext context) throws TenantApiException { final Tenant tenant = new DefaultTenant(data); if (null != tenant.getExternalKey() && tenant.getExternalKey().length() > 255) { throw new TenantApiException(ErrorCode.EXTERNAL_KEY_LIMIT_EXCEEDED); } try { if (data.getApiKey() != null && getTenantByApiKey(data.getApiKey()) != null) { throw new TenantApiException(ErrorCode.TENANT_ALREADY_EXISTS, data.getExternalKey()); } } catch (final RuntimeException e) { if (e.getCause() instanceof IllegalStateException) { } else { throw e; } } try { tenantDao.create(new TenantModelDao(tenant), internalCallContextFactory.createInternalCallContextWithoutAccountRecordId(context)); } catch (final TenantApiException e) { throw new TenantApiException(e, ErrorCode.TENANT_CREATION_FAILED); } return tenant; }
Source:
CosmosPagedFlux<CosmosDatabaseProperties> readAllDatabases(CosmosQueryRequestOptions options) { return UtilBridgeInternal.createCosmosPagedFlux(pagedFluxOptions -> { String spanName = "readAllDatabases"; pagedFluxOptions.setTracerInformation(this.tracerProvider, spanName, this.serviceEndpoint, null); setContinuationTokenAndMaxItemCount(pagedFluxOptions, options); return getDocClientWrapper().readDatabases(options) .map(response -> BridgeInternal.createFeedResponse( ModelBridgeInternal.getCosmosDatabasePropertiesFromV2Results(response.getResults()), response.getResponseHeaders())); }); }

Target:
CosmosPagedFlux<CosmosDatabaseProperties> readAllDatabases(CosmosQueryRequestOptions options) { return UtilBridgeInternal.createCosmosPagedFlux(pagedFluxOptions -> { pagedFluxOptions.setTracerInformation(this.tracerProvider, "readAllDatabases", this.serviceEndpoint, null); setContinuationTokenAndMaxItemCount(pagedFluxOptions, options); return getDocClientWrapper().readDatabases(options) .map(response -> BridgeInternal.createFeedResponse( ModelBridgeInternal.getCosmosDatabasePropertiesFromV2Results(response.getResults()), response.getResponseHeaders())); }); }