diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000000..def5ba5d90
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,12 @@
+version: 2
+updates:
+
+ - package-ecosystem: "github-actions"
+ directory: "/"
+ schedule:
+ interval: "daily"
+
+ - package-ecosystem: "gradle"
+ directory: "/"
+ schedule:
+ interval: "daily"
diff --git a/.github/workflows/gradle-wrapper-validation.yml b/.github/workflows/gradle-wrapper-validation.yml
new file mode 100644
index 0000000000..3e905f1c92
--- /dev/null
+++ b/.github/workflows/gradle-wrapper-validation.yml
@@ -0,0 +1,13 @@
+name: "Validate Gradle Wrapper"
+on: [push, pull_request]
+
+permissions:
+ contents: read
+
+jobs:
+ validation:
+ name: "Validation"
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
+ - uses: gradle/wrapper-validation-action@f9c9c575b8b21b6485636a91ffecd10e558c62f6 # v3.5.0
diff --git a/.github/workflows/gradle_branch.yml b/.github/workflows/gradle_branch.yml
new file mode 100644
index 0000000000..cb7231a7bf
--- /dev/null
+++ b/.github/workflows/gradle_branch.yml
@@ -0,0 +1,37 @@
+# This workflow will build a Java project with Gradle
+# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
+
+name: Branch
+
+on:
+ push:
+ branches-ignore: [ '3.x' ]
+
+permissions:
+ contents: read
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
+ - name: Set up JDK 11
+ uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
+ with:
+ distribution: 'zulu'
+ java-version: '11'
+ - name: Cache Gradle packages
+ uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
+ with:
+ path: ~/.gradle/caches
+ key: ${{ runner.os }}-gradle-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/*.gradle') }}
+ restore-keys: ${{ runner.os }}-gradle-${{ secrets.CACHE_VERSION }}
+ - name: Grant execute permission for gradlew
+ run: chmod +x gradlew
+ - name: Build RxJava
+ run: ./gradlew build --stacktrace
+ - name: Upload to Codecov
+ uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
+ - name: Generate Javadoc
+ run: ./gradlew javadoc --stacktrace
diff --git a/.github/workflows/gradle_jdk11.yml b/.github/workflows/gradle_jdk11.yml
new file mode 100644
index 0000000000..771a1afe0f
--- /dev/null
+++ b/.github/workflows/gradle_jdk11.yml
@@ -0,0 +1,42 @@
+# This workflow will build a Java project with Gradle
+# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
+
+name: JDK 11
+
+on:
+ push:
+ branches: [ 3.x ]
+ pull_request:
+ branches: [ 3.x ]
+
+permissions:
+ contents: read
+
+env:
+ BUILD_WITH_11: true
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
+ - name: Set up JDK 11
+ uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
+ with:
+ distribution: 'zulu'
+ java-version: '11'
+ - name: Cache Gradle packages
+ uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
+ with:
+ path: ~/.gradle/caches
+ key: ${{ runner.os }}-gradle-1-${{ hashFiles('**/*.gradle') }}
+ restore-keys: ${{ runner.os }}-gradle-1-
+ - name: Grant execute permission for gradlew
+ run: chmod +x gradlew
+ - name: Verify generated module-info
+ run: ./gradlew -PjavaCompatibility=9 jar
+ - name: Build RxJava
+ run: ./gradlew build --stacktrace
+# - name: Generate Javadoc
+# run: ./gradlew javadoc --stacktrace
diff --git a/.github/workflows/gradle_pr.yml b/.github/workflows/gradle_pr.yml
new file mode 100644
index 0000000000..f76409cd46
--- /dev/null
+++ b/.github/workflows/gradle_pr.yml
@@ -0,0 +1,37 @@
+# This workflow will build a Java project with Gradle
+# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
+
+name: Pull Request
+
+on:
+ pull_request:
+ branches: [ 3.x ]
+
+permissions:
+ contents: read
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
+ - name: Set up JDK 11
+ uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
+ with:
+ distribution: 'zulu'
+ java-version: '11'
+ - name: Cache Gradle packages
+ uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
+ with:
+ path: ~/.gradle/caches
+ key: ${{ runner.os }}-gradle-1-${{ hashFiles('**/*.gradle') }}
+ restore-keys: ${{ runner.os }}-gradle-1-
+ - name: Grant execute permission for gradlew
+ run: chmod +x gradlew
+ - name: Build RxJava
+ run: ./gradlew build --stacktrace
+ - name: Upload to Codecov
+ uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
+ - name: Generate Javadoc
+ run: ./gradlew javadoc --stacktrace
diff --git a/.github/workflows/gradle_release.yml b/.github/workflows/gradle_release.yml
new file mode 100644
index 0000000000..b08c3fe08e
--- /dev/null
+++ b/.github/workflows/gradle_release.yml
@@ -0,0 +1,70 @@
+# This workflow will build a Java project with Gradle
+# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
+
+name: Release
+
+on:
+ release:
+ types: [ released, prereleased ]
+ branches: [ '3.x' ]
+ tags:
+ - 'v3.*.*'
+
+permissions:
+ contents: read
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+ permissions:
+ contents: write
+ env:
+ CI_BUILD_NUMBER: ${{ github.run_number }}
+ steps:
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
+ - name: Set up JDK 11
+ uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
+ with:
+ distribution: 'zulu'
+ java-version: '11'
+ - name: Cache Gradle packages
+ uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
+ with:
+ path: ~/.gradle/caches
+ key: ${{ runner.os }}-gradle-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/*.gradle') }}
+ restore-keys: ${{ runner.os }}-gradle-${{ secrets.CACHE_VERSION }}
+ - name: Grant execute permission for gradlew
+ run: chmod +x gradlew
+ - name: Grant execute permission for push
+ run: chmod +x push_javadoc.sh
+ - name: Extract version tag
+ run: echo "BUILD_TAG=${GITHUB_REF:10}" >> $GITHUB_ENV
+ - name: Build RxJava
+ run: ./gradlew build --stacktrace --no-daemon
+ - name: Upload to Codecov
+ uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
+# - name: Upload release
+# run: ./gradlew -PreleaseMode=full publish --no-daemon --no-parallel --stacktrace
+# env:
+# # Define secrets at https://github.com/ReactiveX/RxJava/settings/secrets/actions
+# # ------------------------------------------------------------------------------
+# ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USER }}
+# ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
+# ORG_GRADLE_PROJECT_SIGNING_PRIVATE_KEY: ${{ secrets.SIGNING_PRIVATE_KEY }}
+# ORG_GRADLE_PROJECT_SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
+ - name: Publish release
+ run: ./gradlew -PreleaseMode=full publishAndReleaseToMavenCentral --no-configuration-cache --no-daemon --no-parallel --stacktrace
+ env:
+ # Define secrets at https://github.com/ReactiveX/RxJava/settings/secrets/actions
+ # ------------------------------------------------------------------------------
+ ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USER }}
+ ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
+ ORG_GRADLE_PROJECT_SIGNING_PRIVATE_KEY: ${{ secrets.SIGNING_PRIVATE_KEY }}
+ ORG_GRADLE_PROJECT_SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
+ - name: Push Javadoc
+ run: ./push_javadoc.sh
+ env:
+ # Define secrets at https://github.com/ReactiveX/RxJava/settings/secrets/actions
+ # ------------------------------------------------------------------------------
+ JAVADOCS_TOKEN: ${{ secrets.JAVADOCS_TOKEN }}
diff --git a/.github/workflows/gradle_snapshot.yml b/.github/workflows/gradle_snapshot.yml
new file mode 100644
index 0000000000..5dca06b523
--- /dev/null
+++ b/.github/workflows/gradle_snapshot.yml
@@ -0,0 +1,56 @@
+# This workflow will build a Java project with Gradle
+# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
+
+name: Snapshot
+
+on:
+ push:
+ branches: [ '3.x' ]
+
+permissions:
+ contents: read
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+ if: github.repository == 'ReactiveX/RxJava'
+ permissions:
+ contents: write
+ env:
+ # ------------------------------------------------------------------------------
+ CI_BUILD_NUMBER: ${{ github.run_number }}
+ steps:
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
+ - name: Set up JDK 11
+ uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
+ with:
+ distribution: 'zulu'
+ java-version: '11'
+ - name: Cache Gradle packages
+ uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
+ with:
+ path: ~/.gradle/caches
+ key: ${{ runner.os }}-gradle-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/*.gradle') }}
+ restore-keys: ${{ runner.os }}-gradle-${{ secrets.CACHE_VERSION }}
+ - name: Grant execute permission for gradlew
+ run: chmod +x gradlew
+ - name: Grant execute permission for push
+ run: chmod +x push_javadoc.sh
+ - name: Build RxJava
+ run: ./gradlew build --stacktrace --no-daemon
+ - name: Upload Snapshot
+ run: ./gradlew -PreleaseMode=branch publishAllPublicationsToMavenCentralRepository --no-daemon --no-parallel --stacktrace
+ env:
+ # Define secrets at https://github.com/ReactiveX/RxJava/settings/secrets/actions
+ # ------------------------------------------------------------------------------
+ ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USER }}
+ ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
+ - name: Upload to Codecov
+ uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
+ - name: Push Javadoc
+ run: ./push_javadoc.sh
+ # Define secrets at https://github.com/ReactiveX/RxJava/settings/secrets/actions
+ # ------------------------------------------------------------------------------
+ env:
+ JAVADOCS_TOKEN: ${{ secrets.JAVADOCS_TOKEN }}
diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml
new file mode 100644
index 0000000000..1ebd21eb28
--- /dev/null
+++ b/.github/workflows/scorecard.yml
@@ -0,0 +1,59 @@
+name: Scorecard supply-chain security
+on:
+ # For Branch-Protection check. Only the default branch is supported. See
+ # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
+ branch_protection_rule:
+ # To guarantee Maintained check is occasionally updated. See
+ # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
+ schedule:
+ - cron: '43 12 * * 4'
+ push:
+ branches: [ "3.x" ]
+
+permissions: read-all
+
+jobs:
+ analysis:
+ name: Scorecard analysis
+ runs-on: ubuntu-latest
+ permissions:
+ # Needed to upload the results to code-scanning dashboard.
+ security-events: write
+ # Needed to publish results and get a badge (see publish_results below).
+ id-token: write
+
+ steps:
+ - name: "Checkout code"
+ uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
+ with:
+ persist-credentials: false
+
+ - name: "Run analysis"
+ uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
+ with:
+ results_file: results.sarif
+ results_format: sarif
+ # (Optional) "write" PAT token. Uncomment the `repo_token` line below if
+ # you want to enable the Branch-Protection check on a *public* repository
+ # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-fine-grained-pat-optional.
+ # repo_token: ${{ secrets.SCORECARD_TOKEN }}
+
+ # - Publish results to OpenSSF REST API for easy access by consumers
+ # - Allows the repository to include the Scorecard badge.
+ # - See https://github.com/ossf/scorecard-action#publishing-results.
+ publish_results: true
+
+ # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
+ # format to the repository Actions tab.
+ - name: "Upload artifact"
+ uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
+ with:
+ name: SARIF file
+ path: results.sarif
+ retention-days: 5
+
+ # Upload the results to GitHub's code scanning dashboard.
+ - name: "Upload to code-scanning"
+ uses: github/codeql-action/upload-sarif@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v3.29.5
+ with:
+ sarif_file: results.sarif
diff --git a/.gitignore b/.gitignore
index 428d55b2fb..b60171cf2d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -73,4 +73,10 @@ bin/
# PMD files
.pmd
.ruleset
-test-output/
\ No newline at end of file
+test-output/
+
+# Checkstyle local config
+.checkstyle
+
+# Some editor's config
+.editorconfig
diff --git a/.gitpod.yml b/.gitpod.yml
new file mode 100644
index 0000000000..954870bba6
--- /dev/null
+++ b/.gitpod.yml
@@ -0,0 +1,139 @@
+## Learn more about this file at 'https://www.gitpod.io/docs/references/gitpod-yml'
+##
+## This '.gitpod.yml' file when placed at the root of a project instructs
+## Gitpod how to prepare & build the project, start development environments
+## and configure continuous prebuilds. Prebuilds when enabled builds a project
+## like a CI server so you can start coding right away - no more waiting for
+## dependencies to download and builds to finish when reviewing pull-requests
+## or hacking on something new.
+##
+## With Gitpod you can develop software from any device (even iPads) via
+## desktop or browser based versions of VS Code or any JetBrains IDE and
+## customise it to your individual needs - from themes to extensions, you
+## have full control.
+##
+## The easiest way to try out Gitpod is install the browser extenion:
+## 'https://www.gitpod.io/docs/browser-extension' or by prefixing
+## 'https://gitpod.io#' to the source control URL of any project.
+##
+## For example: 'https://gitpod.io#https://github.com/gitpod-io/gitpod'
+
+
+## The 'image' section defines which Docker image Gitpod should use.
+## By default, Gitpod uses a standard Docker Image called 'workspace-full'
+## which can be found at 'https://github.com/gitpod-io/workspace-images'
+##
+## Workspaces started based on this default image come pre-installed with
+## Docker, Go, Java, Node.js, C/C++, Python, Ruby, Rust, PHP as well as
+## tools such as Homebrew, Tailscale, Nginx and several more.
+##
+## If this image does not include the tools needed for your project then
+## a public Docker image or your own Docker file can be configured.
+##
+## Learn more about images at 'https://www.gitpod.io/docs/config-docker'
+
+#image: node:buster # use 'https://hub.docker.com/_/node'
+#
+#image: # leave image undefined if using a Dockerfile
+# file: .gitpod.Dockerfile # relative path to the Dockerfile from the
+# # root of the project
+
+## The 'tasks' section defines how Gitpod prepares and builds this project
+## or how Gitpod can start development servers. With Gitpod, there are three
+## types of tasks:
+##
+## - before: Use this for tasks that need to run before init and before command.
+## - init: Use this to configure prebuilds of heavy-lifting tasks such as
+## downloading dependencies or compiling source code.
+## - command: Use this to start your database or application when the workspace starts.
+##
+## Learn more about these tasks at 'https://www.gitpod.io/docs/config-start-tasks'
+
+#tasks:
+# - before: |
+# # commands to execute...
+#
+# - init: |
+# # sudo apt-get install python3 # can be used to install operating system
+# # dependencies but these are not kept after the
+# # prebuild completes thus Gitpod recommends moving
+# # operating system dependency installation steps
+# # to a custom Dockerfile to make prebuilds faster
+# # and to keep your codebase DRY.
+# # 'https://www.gitpod.io/docs/config-docker'
+#
+# # pip install -r requirements.txt # install codebase dependencies
+# # cmake # precompile codebase
+#
+# - name: Web Server
+# openMode: split-left
+# env:
+# WEBSERVER_PORT: 8080
+# command: |
+# python3 -m http.server $WEBSERVER_PORT
+#
+# - name: Web Browser
+# openMode: split-right
+# env:
+# WEBSERVER_PORT: 8080
+# command: |
+# gp await-port $WEBSERVER_PORT
+# lynx `gp url`
+
+tasks:
+ - command: ./gradlew build
+
+## The 'ports' section defines various ports your may listen on are
+## configured in Gitpod on an authenticated URL. By default, all ports
+## are in private visibility state.
+##
+## Learn more about ports at 'https://www.gitpod.io/docs/config-ports'
+
+#ports:
+# - port: 8080 # alternatively configure entire ranges via '8080-8090'
+# visibility: private # either 'public' or 'private' (default)
+# onOpen: open-browser # either 'open-browser', 'open-preview' or 'ignore'
+
+
+## The 'vscode' section defines a list of Visual Studio Code extensions from
+## the OpenVSX.org registry to be installed upon workspace startup. OpenVSX
+## is an open alternative to the proprietary Visual Studio Code Marketplace
+## and extensions can be added by sending a pull-request with the extension
+## identifier to https://github.com/open-vsx/publish-extensions
+##
+## The identifier of an extension is always ${publisher}.${name}.
+##
+## For example: 'vscodevim.vim'
+##
+## Learn more at 'https://www.gitpod.io/docs/ides-and-editors/vscode'
+
+#vscode:
+# extensions:
+# - vscodevim.vim
+# - esbenp.prettier-vscode@9.5.0
+# - https://example.com/abc/releases/extension-0.26.0.vsix
+
+
+## The 'github' section defines configuration of continuous prebuilds
+## for GitHub repositories when the GitHub application
+## 'https://github.com/apps/gitpod-io' is installed in GitHub and granted
+## permissions to access the repository.
+##
+## Learn more at 'https://www.gitpod.io/docs/prebuilds'
+
+github:
+ prebuilds:
+ # enable for the default branch
+ master: true
+ # enable for all branches in this repo
+ branches: true
+ # enable for pull requests coming from this repo
+ pullRequests: true
+ # enable for pull requests coming from forks
+ pullRequestsFromForks: true
+ # add a check to pull requests
+ addCheck: true
+ # add a "Review in Gitpod" button as a comment to pull requests
+ addComment: false
+ # add a "Review in Gitpod" button to the pull request's description
+ addBadge: true
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 6e595b4e93..0000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,29 +0,0 @@
-language: java
-jdk:
-- openjdk8
-
-# prevent travis running gradle assemble; let the build script do it anyway
-install: true
-
-# running in container causes test failures and 2x-3x longer build, use standalone instances
-sudo: required
-
-# script for build and release via Travis to Bintray
-script: gradle/buildViaTravis.sh
-
-# Code coverage
-after_success:
- - bash <(curl -s --retry 10 https://codecov.io/bash)
- - bash gradle/push_javadoc.sh
-
-# cache between builds
-cache:
- directories:
- - $HOME/.m2
- - $HOME/.gradle
-env:
- global:
- - secure: YcLpYfNc/dyDON+oDvnJK5pFNhpPeJHxlAHV8JBt42e51prAl6njqrg1Qlfdp0pvBiskTPQHUxbFy9DOB1Z+43lPj5vlqz6qBgtS3vtBnsrczr+5Xx7NTdVKq6oZGl45VjfNPT7zdM6GQ5ifdzOid6kJIFu34g9JZkCzOY3BWGM=
- - secure: WVmfSeW1UMNdem7+X4cVDjkEkqdeNavYH4udn3bFN1IFaWdliWFp4FYVBVi+p1T/IgkRSqzoW9Bm43DABe1UMFoErFCbfd7B0Ofgb4NZAsxFgokHGVLCe6k5+rQyASseiO7k0itSj3Kq9TrDueKPhv+g+IG0w1A8yZTnXdhXHvY=
- - secure: Xt8E09nmSr+5r7ly95hG/EiBitZbhFGPRGp8oqPkNn1A2fzG9+hnvlNLgQhVPsISZGzJwkWa3LGBxAVGmuysVOz7eCwkoqlDZaaSLYAPfWXqkr+cmYGPkErgHSp+n/hnQG4TylX0YxzqX8flr6db21zWyNduiyHmo+xFydI5LeM=
- - secure: RmpIsmYa5BdLLWR6DILjhEE/dx2q3O0NIkvnMx5G1cyRCNCrOf1B7fYFHnsTDwpvRA+6H6dZinmeyf6D3G+czOG5q/TW2jcu5nh+YOLhBb6jPIqRDfq/WHAa5Lkdssxs5g9RdWlEDVFMoE62lGc4cnfJz5F5puH29dy2SvXxIQw=
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 4547f563a8..98ae7225f3 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -13,19 +13,16 @@ All files are released with the Apache 2.0 license.
If you are adding a new file it should have a header like this:
```
-/**
+/*
* Copyright (c) 2016-present, RxJava Contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
+ * the License for the specific language governing permissions and limitations under the License.
*/
```
diff --git a/COPYRIGHT b/COPYRIGHT
new file mode 100644
index 0000000000..5d2c6e53f3
--- /dev/null
+++ b/COPYRIGHT
@@ -0,0 +1,13 @@
+Copyright (c) 2016-present, RxJava Contributors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
\ No newline at end of file
diff --git a/README.md b/README.md
index 7c120db700..5276c0bd37 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,10 @@
# RxJava: Reactive Extensions for the JVM
-
+
[](https://codecov.io/gh/ReactiveX/RxJava/branch/3.x)
-[](https://maven-badges.herokuapp.com/maven-central/io.reactivex.rxjava3/rxjava)
+[](https://maven-badges.sml.io/sonatype-central/io.reactivex.rxjava3/rxjava)
+[](https://gitpod.io/#https://github.com/ReactiveX/RxJava)
+[](https://securityscorecards.dev/viewer/?uri=github.com/ReactiveX/RxJava)
RxJava is a Java VM implementation of [Reactive Extensions](http://reactivex.io): a library for composing asynchronous and event-based programs by using observable sequences.
@@ -10,22 +12,27 @@ It extends the [observer pattern](http://en.wikipedia.org/wiki/Observer_pattern)
#### Version 3.x ([Javadoc](http://reactivex.io/RxJava/3.x/javadoc/))
-- single dependency: [Reactive-Streams](https://github.com/reactive-streams/reactive-streams-jvm)
-- continued support for Java 6+ & [Android](https://github.com/ReactiveX/RxAndroid) 2.3+
-- fixed API mistakes and many limits of RxJava 2
-- intended to be a replacement for RxJava 2 with relatively few binary incompatible changes
-- Java 8 lambda-friendly API
-- non-opinionated about the source of concurrency (threads, pools, event loops, fibers, actors, etc.)
-- async or synchronous execution
-- virtual time and schedulers for parameterized concurrency
-- test and diagnostic support via test schedulers, test consumers and plugin hooks
+- Single dependency: [Reactive-Streams](https://github.com/reactive-streams/reactive-streams-jvm).
+- Java 8+ or Android API 21+ required.
+- Java 8 lambda-friendly API.
+- [Android](https://github.com/ReactiveX/RxAndroid) desugar friendly.
+- Fixed API mistakes and many limits of RxJava 2.
+- Intended to be a replacement for RxJava 2 with relatively few binary incompatible changes.
+- Non-opinionated about the source of concurrency (threads, pools, event loops, fibers, actors, etc.).
+- Async or synchronous execution.
+- Virtual time and schedulers for parameterized concurrency.
+- Test and diagnostic support via test schedulers, test consumers and plugin hooks.
+- Interop with newer JDK versions via 3rd party libraries, such as
+ - [Java 9 Flow API](https://github.com/akarnokd/RxJavaJdk9Interop#rxjavajdk9interop)
+ - [Java 21 Virtual Threads](https://github.com/akarnokd/RxJavaFiberInterop#rxjavafiberinterop)
Learn more about RxJava in general on the Wiki Home .
+:information_source: Please read the [What's different in 3.0](https://github.com/ReactiveX/RxJava/wiki/What's-different-in-3.0) for details on the changes and migration information when upgrading from 2.x.
+
#### Version 2.x
-The [2.x version](https://github.com/ReactiveX/RxJava/tree/2.x) will be supported with bugfixes and important documentation updates until
-**December 31, 2020**. No new features will be added to 2.x.
+The [2.x version](https://github.com/ReactiveX/RxJava/tree/2.x) is end-of-life as of **February 28, 2021**. No further development, support, maintenance, PRs and updates will happen. The [Javadoc]([Javadoc](http://reactivex.io/RxJava/2.x/javadoc/)) of the very last version, **2.2.21**, will remain accessible.
#### Version 1.x
@@ -41,7 +48,7 @@ The first step is to include RxJava 3 into your project, for example, as a Gradl
implementation "io.reactivex.rxjava3:rxjava:3.x.y"
```
-(Please replace `x` and `y` with the latest version numbers: [](https://maven-badges.herokuapp.com/maven-central/io.reactivex.rxjava3/rxjava)
+(Please replace `x` and `y` with the latest version numbers: [](https://maven-badges.sml.io/sonatype-central/io.reactivex.rxjava3/rxjava)
)
### Hello World
@@ -60,19 +67,6 @@ public class HelloWorld {
}
```
-If your platform doesn't support Java 8 lambdas (yet), you have to create an inner class of `Consumer` manually:
-
-```java
-import io.reactivex.rxjava3.functions.Consumer;
-
-Flowable.just("Hello world")
- .subscribe(new Consumer() {
- @Override public void accept(String s) {
- System.out.println(s);
- }
- });
-```
-
Note that RxJava 3 components now live under `io.reactivex.rxjava3` and the base classes and interfaces live under `io.reactivex.rxjava3.core`.
### Base classes
@@ -207,7 +201,7 @@ RxJava operators don't work with `Thread`s or `ExecutorService`s directly but wi
- `Schedulers.single()`: Run work on a single thread in a sequential and FIFO manner.
- `Schedulers.trampoline()`: Run work in a sequential and FIFO manner in one of the participating threads, usually for testing purposes.
-These are available on all JVM platforms but some specific platforms, such as Android, have their own typical `Scheduler`s defined: `AndroidSchedulers.mainThread()`, `SwingScheduler.instance()` or `JavaFXSchedulers.gui()`.
+These are available on all JVM platforms but some specific platforms, such as Android, have their own typical `Scheduler`s defined: `AndroidSchedulers.mainThread()`, `SwingScheduler.instance()` or `JavaFXScheduler.platform()`.
In addition, there is an option to wrap an existing `Executor` (and its subtypes such as `ExecutorService`) into a `Scheduler` via `Schedulers.from(Executor)`. This can be used, for example, to have a larger but still fixed pool of threads (unlike `computation()` and `io()` respectively).
@@ -516,7 +510,7 @@ For further details, consult the [wiki](https://github.com/ReactiveX/RxJava/wiki
- Google Group: [RxJava](http://groups.google.com/d/forum/rxjava)
- Twitter: [@RxJava](http://twitter.com/RxJava)
- [GitHub Issues](https://github.com/ReactiveX/RxJava/issues)
-- StackOverflow: [rx-java](http://stackoverflow.com/questions/tagged/rx-java) and [rx-java2](http://stackoverflow.com/questions/tagged/rx-java2)
+- StackOverflow: [rx-java](http://stackoverflow.com/questions/tagged/rx-java), [rx-java2](http://stackoverflow.com/questions/tagged/rx-java2) and [rx-java3](http://stackoverflow.com/questions/tagged/rx-java3)
- [Gitter.im](https://gitter.im/ReactiveX/RxJava)
## Versioning
@@ -537,7 +531,7 @@ APIs marked with the [`@Experimental`][experimental source link] annotation at t
#### @Deprecated
-APIs marked with the `@Deprecated` annotation at the class or method level will remain supported until the next major release but it is recommended to stop using them.
+APIs marked with the `@Deprecated` annotation at the class or method level will remain supported until the next major release, but it is recommended to stop using them.
#### io.reactivex.rxjava3.internal.*
@@ -557,7 +551,7 @@ Binaries and dependency information for Maven, Ivy, Gradle and others can be fou
Example for Gradle:
```groovy
-compile 'io.reactivex.rxjava3:rxjava:x.y.z'
+implementation 'io.reactivex.rxjava3:rxjava:x.y.z'
```
and for Maven:
@@ -575,18 +569,22 @@ and for Ivy:
```
-Snapshots are available via https://oss.jfrog.org/libs-snapshot/io/reactivex/rxjava3/rxjava/
+### Snapshots
+
+Snapshots after May 19st, 2025 are available via https://central.sonatype.com/repository/maven-snapshots/io/reactivex/rxjava3/rxjava/
```groovy
repositories {
- maven { url 'https://oss.jfrog.org/libs-snapshot' }
+ maven { url 'https://central.sonatype.com/repository/maven-snapshots' }
}
dependencies {
- compile 'io.reactivex.rxjava3:rxjava:3.0.0-SNAPSHOT'
+ implementation 'io.reactivex.rxjava3:rxjava:3.0.0-SNAPSHOT'
}
```
+JavaDoc snapshots are available at https://reactivex.io/RxJava/3.x/javadoc/snapshot
+
## Build
To build:
@@ -620,5 +618,5 @@ For bugs, questions and discussions please use the [Github Issues](https://githu
See the License for the specific language governing permissions and
limitations under the License.
-[beta source link]: https://github.com/ReactiveX/RxJava/blob/3.x/src/main/java/io/reactivex/annotations/Beta.java
-[experimental source link]: https://github.com/ReactiveX/RxJava/blob/3.x/src/main/java/io/reactivex/annotations/Experimental.java
+[beta source link]: https://github.com/ReactiveX/RxJava/blob/3.x/src/main/java/io/reactivex/rxjava3/annotations/Beta.java
+[experimental source link]: https://github.com/ReactiveX/RxJava/blob/3.x/src/main/java/io/reactivex/rxjava3/annotations/Experimental.java
diff --git a/SECURITY.md b/SECURITY.md
new file mode 100644
index 0000000000..1003574331
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,7 @@
+# Security Policy
+
+If you have discovered a security vulnerability in this project, please report it privately. **Do not disclose it as a public issue.** This gives us time to work with you to fix the issue before public exposure, reducing the chance that the exploit will be used before a patch is released.
+
+Please disclose it at [security advisory](https://github.com/ReactiveX/RxJava/security/advisories/new).
+
+This project is maintained by a team of volunteers on a reasonable-effort basis. As such, please give us at least 90 days to work on a fix before public exposure.
diff --git a/build.gradle b/build.gradle
index aaef86c824..8bcfddb717 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,80 +1,43 @@
-buildscript {
-
- // Dependency versions
- // ---------------------------------------
-
- ext.reactiveStreamsVersion = "1.0.3"
- ext.junitVersion = "4.12"
- ext.testNgVersion = "7.0.0"
- ext.mockitoVersion = "3.2.0"
- ext.jmhLibVersion = "1.21"
- ext.jmhGradleVersion = "0.5.0"
- ext.guavaVersion = "28.1-jre"
- ext.jacocoVersion = "0.8.4"
- ext.animalSnifferVersion = "1.5.0"
- ext.licenseVersion = "0.15.0"
- ext.bintrayVersion = "1.8.4"
- ext.jfrogExtractorVersion = "4.11.0"
- ext.bndVersion = "4.3.1"
- ext.checkstyleVersion = "6.19"
-
- // --------------------------------------
-
- repositories {
- jcenter()
- mavenCentral()
- maven {
- url "https://plugins.gradle.org/m2/"
- }
- }
- dependencies {
- classpath "ru.vyarus:gradle-animalsniffer-plugin:$animalSnifferVersion"
- classpath "gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:$licenseVersion"
- classpath "me.champeau.gradle:jmh-gradle-plugin:$jmhGradleVersion"
- classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$bintrayVersion"
- classpath "org.jfrog.buildinfo:build-info-extractor-gradle:$jfrogExtractorVersion"
- classpath "biz.aQute.bnd:biz.aQute.bnd.gradle:$bndVersion"
- }
-}
-
-group = "io.reactivex.rxjava3"
-ext.githubProjectName = "rxjava"
-
-version = project.properties["release.version"]
-
-def releaseTag = System.getenv("TRAVIS_TAG");
+plugins {
+ id("java-library")
+ id("checkstyle")
+ id("eclipse")
+ id("jacoco")
+ id("maven-publish")
+ id("ru.vyarus.animalsniffer") version "2.0.1"
+ id("me.champeau.jmh") version "0.7.3"
+ id("com.github.hierynomus.license") version "0.16.1"
+ id("biz.aQute.bnd.builder") version "6.4.0"
+ id("com.vanniktech.maven.publish") version "0.33.0"
+ id("org.beryx.jar") version "2.0.0"
+ id("signing")
+}
+
+ext {
+ reactiveStreamsVersion = "1.0.4"
+ junitVersion = "4.13.2"
+ testNgVersion = "7.5"
+ mockitoVersion = "4.11.0"
+ jmhLibVersion = "1.21"
+ guavaVersion = "33.5.0-jre"
+}
+
+def releaseTag = System.getenv("BUILD_TAG")
if (releaseTag != null && !releaseTag.isEmpty()) {
if (releaseTag.startsWith("v")) {
- releaseTag = releaseTag.substring(1);
+ releaseTag = releaseTag.substring(1)
}
- version = releaseTag;
- project.properties.put("release.version", releaseTag);
+ project.version = releaseTag
- println("Releasing with version " + version);
+ logger.lifecycle("Releasing with version: " + project.version)
}
-description = "RxJava: Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM."
-
-apply plugin: "java-library"
-apply plugin: "checkstyle"
-apply plugin: "jacoco"
-apply plugin: "ru.vyarus.animalsniffer"
-apply plugin: "maven"
-apply plugin: "me.champeau.gradle.jmh"
-apply plugin: "com.github.hierynomus.license"
-apply plugin: "com.jfrog.bintray"
-apply plugin: "com.jfrog.artifactory"
-apply plugin: "eclipse"
-
-sourceCompatibility = JavaVersion.VERSION_1_6
-targetCompatibility = JavaVersion.VERSION_1_6
-
repositories {
- mavenCentral()
+ mavenCentral()
}
dependencies {
- signature "org.codehaus.mojo.signature:java16:1.1@signature"
+ signature "org.codehaus.mojo.signature:java18:1.0@signature"
api "org.reactivestreams:reactive-streams:$reactiveStreamsVersion"
jmh "org.reactivestreams:reactive-streams:$reactiveStreamsVersion"
@@ -87,8 +50,27 @@ dependencies {
testImplementation "com.google.guava:guava:$guavaVersion"
}
+def buildWith11 = System.getenv("BUILD_WITH_11")
+java {
+ toolchain {
+ vendor = JvmVendorSpec.ADOPTIUM
+ if ("true".equals(buildWith11)) {
+ languageVersion = JavaLanguageVersion.of(11)
+ } else {
+ languageVersion = JavaLanguageVersion.of(8)
+ }
+ }
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
+}
+
+tasks.withType(JavaCompile) {
+ options.compilerArgs << "-parameters"
+}
+
+apply from: file("gradle/javadoc_cleanup.gradle")
+
javadoc {
- failOnError = false
exclude "**/internal/**"
exclude "**/test/**"
exclude "**/perf/**"
@@ -100,116 +82,57 @@ javadoc {
options.addStringOption("top").value = ""
options.addStringOption("doctitle").value = ""
options.addStringOption("header").value = ""
- options.stylesheetFile = new File(projectDir, "gradle/stylesheet.css");
+ options.stylesheetFile = project.file("gradle/stylesheet.css")
options.links(
- "https://docs.oracle.com/javase/7/docs/api/",
- "http://www.reactive-streams.org/reactive-streams-${reactiveStreamsVersion}-javadoc/"
+ "https://docs.oracle.com/javase/8/docs/api/",
+ "https://reactivex.io/RxJava/org.reactivestreams.javadoc/${reactiveStreamsVersion}/"
)
- if (JavaVersion.current().isJava7()) {
- // "./gradle/stylesheet.css" only supports Java 7
- options.addStringOption("stylesheetfile", rootProject.file("./gradle/stylesheet.css").toString())
- }
+ finalizedBy javadocCleanup
}
animalsniffer {
annotation = "io.reactivex.rxjava3.internal.util.SuppressAnimalSniffer"
}
-task sourcesJar(type: Jar, dependsOn: classes) {
- classifier = "sources"
- from sourceSets.main.allSource
+moduleConfig {
+ moduleInfoPath = 'src/main/module/module-info.java'
+ multiReleaseVersion = 9
+ version = project.version
}
-task javadocJar(type: Jar, dependsOn: javadoc) {
- classifier = "javadoc"
- from javadoc.destinationDir
-}
-
-artifacts {
- archives jar
- archives sourcesJar
- archives javadocJar
-}
-
-apply plugin: 'biz.aQute.bnd.builder'
-
jar {
- bnd ('Bundle-Name': 'rxjava',
- 'Bundle-Vendor': 'RxJava Contributors',
- 'Bundle-Description': 'Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM.',
- 'Import-Package': '!org.junit,!junit.framework,!org.mockito.*,!org.testng.*,*',
- 'Bundle-DocURL': 'https://github.com/ReactiveX/RxJava',
- 'Eclipse-ExtensibleAPI': 'true',
- 'Automatic-Module-Name': 'io.reactivex.rxjava3',
- 'Export-Package': '!io.reactivex.rxjava3.internal.*, io.reactivex.rxjava3.*'
+ from('.') {
+ include 'LICENSE'
+ include 'COPYRIGHT'
+ into('META-INF/')
+ }
+ exclude("module-info.class")
+
+ // Cover for bnd still not supporting MR Jars: https://github.com/bndtools/bnd/issues/2227
+ bnd('-fixupmessages': '^Classes found in the wrong directory: \\\\{META-INF/versions/9/module-info\\\\.class=module-info}$')
+ bnd(
+ "Bundle-Name": "rxjava",
+ "Bundle-Vendor": "RxJava Contributors",
+ "Bundle-Description": "Reactive Extensions for the JVM - a library for composing asynchronous and event-based programs using observable sequences for the Java VM.",
+ "Import-Package": "!org.junit,!junit.framework,!org.mockito.*,!org.testng.*,*",
+ "Bundle-DocURL": "https://github.com/ReactiveX/RxJava",
+ "Eclipse-ExtensibleAPI": "true",
+ "Export-Package": "!io.reactivex.rxjava3.internal.*, io.reactivex.rxjava3.*",
+ "Bundle-SymbolicName": "io.reactivex.rxjava3.rxjava",
+ "Multi-Release": "true"
)
}
license {
- header rootProject.file("HEADER")
+ header project.file("config/license/HEADER")
ext.year = Calendar.getInstance().get(Calendar.YEAR)
skipExistingHeaders true
ignoreFailures true
excludes(["**/*.md", "**/*.txt"])
}
-apply plugin: "maven-publish"
-
-install {
- repositories.mavenInstaller.pom.project {
- name "RxJava"
- description "Reactive Extensions for Java"
- url "https://github.com/ReactiveX/RxJava"
- licenses {
- license {
- name "The Apache Software License, Version 2.0"
- url "http://www.apache.org/licenses/LICENSE-2.0.txt"
- distribution "repo"
- }
- }
- developers {
- developer {
- id "akarnokd"
- name "David Karnok"
- email "akarnokd@gmail.com"
- }
- }
- scm {
- connection "scm:git:git@github.com:ReactiveX/RxJava.git"
- url "scm:git:git@github.com:ReactiveX/RxJava.git"
- developerConnection "scm:git:git@github.com:ReactiveX/RxJava.git"
- }
- issueManagement {
- system "github"
- url "https://github.com/ReactiveX/RxJava/issues"
- }
- }
-}
-
-publishing {
- publications {
- mavenJava(MavenPublication) {
- from components.java
- artifact (sourcesJar) {
- classifier = "sources"
- }
- }
- }
-}
-
-// Reactive-Streams as compile dependency
-publishing.publications.all {
- pom.withXml {
- asNode().dependencies."*".findAll() {
- it.scope.text() == "runtime" && project.configurations.compile.allDependencies.find { dep ->
- dep.name == it.artifactId.text()
- }
- }.each { it.scope*.value = "compile"}
- }
-}
-
jmh {
jmhVersion = jmhLibVersion
humanOutputFile = null
@@ -218,162 +141,79 @@ jmh {
jvmArgsAppend = ["-Djmh.separateClasspathJAR=true"]
if (project.hasProperty("jmh")) {
- include = ".*" + project.jmh + ".*"
- println("JMH: " + include);
+ includes = [".*" + project.jmh + ".*"]
+ logger.info("JMH: {}", includes)
}
+}
+test {
+ maxHeapSize = "1200m"
}
-plugins.withType(EclipsePlugin) {
- project.eclipse.classpath.plusConfigurations += [ configurations.jmh ]
+task testNG(type: Test) {
+ useTestNG()
}
-test {
-
- testLogging {
- // showing skipped occasionally should prevent CI timeout due to lack of standard output
- events=["skipped", "failed"] // "started", "passed"
- // showStandardStreams = true
- exceptionFormat="full"
+check.dependsOn testNG
+
+tasks.withType(Test) {
+ testLogging {
+ events = ["skipped", "failed"]
+ exceptionFormat = "full"
debug.events = ["skipped", "failed"]
- debug.exceptionFormat="full"
+ debug.exceptionFormat = "full"
info.events = ["failed", "skipped"]
- info.exceptionFormat="full"
-
+ info.exceptionFormat = "full"
+
warn.events = ["failed", "skipped"]
- warn.exceptionFormat="full"
+ warn.exceptionFormat = "full"
}
- maxHeapSize = "1200m"
-
if (System.getenv("CI") == null) {
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
}
}
-task testng(type: Test) {
- useTestNG()
- testLogging {
- events=["skipped", "failed"]
- exceptionFormat="full"
-
- debug.events = ["skipped", "failed"]
- debug.exceptionFormat="full"
-
- info.events = ["failed", "skipped"]
- info.exceptionFormat="full"
-
- warn.events = ["failed", "skipped"]
- warn.exceptionFormat="full"
- }
-}
-
-check.dependsOn testng
-
-jacoco {
- toolVersion = jacocoVersion // See http://www.eclemma.org/jacoco/.
-}
-
-task GCandMem(dependsOn: "check") doLast {
- print("Memory usage before: ")
- println(java.lang.management.ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getUsed() / 1024.0 / 1024.0)
- System.gc()
- Thread.sleep(200)
- print("Memory usage: ")
- println(java.lang.management.ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getUsed() / 1024.0 / 1024.0)
-}
-
-task GCandMem2(dependsOn: "test") doLast {
- print("Memory usage before: ")
- println(java.lang.management.ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getUsed() / 1024.0 / 1024.0)
- System.gc()
- Thread.sleep(200)
- print("Memory usage: ")
- println(java.lang.management.ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getUsed() / 1024.0 / 1024.0)
-}
-
-testng.dependsOn GCandMem2
-
jacocoTestReport {
+ dependsOn test
+ dependsOn testNG
+
reports {
- xml.enabled = true
- html.enabled = true
+ xml.required.set(true)
+ csv.required.set(false)
+ html.required.set(true)
}
}
-jacocoTestReport.dependsOn GCandMem
-
-build.dependsOn jacocoTestReport
+check.dependsOn jacocoTestReport
checkstyle {
- configFile file("checkstyle.xml")
- ignoreFailures = true
- toolVersion = checkstyleVersion
+ configFile = project.file("config/checkstyle/checkstyle.xml")
+ configProperties = [
+ "checkstyle.suppressions.file": project.file("config/checkstyle/suppressions.xml"),
+ "checkstyle.header.file" : project.file("config/license/HEADER_JAVA")
+ ]
+ checkstyleMain.exclude '**/module-info.java'
}
-if (rootProject.hasProperty("releaseMode")) {
-
- if ("branch".equals(rootProject.releaseMode)) {
- // From https://github.com/ReactiveX/RxAndroid/blob/2.x/rxandroid/build.gradle#L94
-
- println("ReleaseMode: " + rootProject.releaseMode);
- artifactory {
- contextUrl = "https://oss.jfrog.org"
-
- publish {
- repository {
- repoKey = "oss-snapshot-local"
-
- username = rootProject.bintrayUser
- password = rootProject.bintrayKey
- }
-
- defaults {
- publishConfigs("archives")
- }
- }
+if (project.hasProperty("releaseMode")) {
+ logger.lifecycle("ReleaseMode: {}", project.releaseMode)
+
+
+ if ("full" == project.releaseMode) {
+ signing {
+ if (project.hasProperty("SIGNING_PRIVATE_KEY") && project.hasProperty("SIGNING_PASSWORD")) {
+ useInMemoryPgpKeys(project.getProperty("SIGNING_PRIVATE_KEY"), project.getProperty("SIGNING_PASSWORD"))
+ sign(publishing.publications)
+ }
}
-
- build.finalizedBy(artifactoryPublish)
}
+ mavenPublishing {
+ // or when publishing to https://central.sonatype.com/
+ publishToMavenCentral(com.vanniktech.maven.publish.SonatypeHost.CENTRAL_PORTAL)
- if ("full".equals(rootProject.releaseMode)) {
- // based on https://github.com/bintray/gradle-bintray-plugin
- def rver = version;
-
- println("ReleaseMode: " + rootProject.releaseMode + " version " + rver);
-
- bintray {
- user = rootProject.bintrayUser
- key = rootProject.bintrayKey
- configurations = ["archives"]
- publish = true
- pkg {
- repo = "RxJava"
- name = "RxJava"
- userOrg = "reactivex"
- labels = ["rxjava", "reactivex"]
- licenses = ["Apache-2.0"]
- vcsUrl = "https://github.com/ReactiveX/RxJava.git"
- version {
- name = rver
- gpg {
- sign = true
- }
- mavenCentralSync {
- sync = true
- user = rootProject.sonatypeUsername
- password = rootProject.sonatypePassword
- close = "1"
- }
- }
- }
- }
-
- build.finalizedBy(bintrayUpload)
- }
+ // signAllPublications()
+ }
}
-
-apply from: file("gradle/javadoc_cleanup.gradle")
diff --git a/checkstyle.xml b/checkstyle.xml
deleted file mode 100644
index 3e7ba879da..0000000000
--- a/checkstyle.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml
new file mode 100644
index 0000000000..05896aee12
--- /dev/null
+++ b/config/checkstyle/checkstyle.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/config/checkstyle/suppressions.xml b/config/checkstyle/suppressions.xml
new file mode 100644
index 0000000000..cf580e45e6
--- /dev/null
+++ b/config/checkstyle/suppressions.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/HEADER b/config/license/HEADER
similarity index 100%
rename from HEADER
rename to config/license/HEADER
diff --git a/config/license/HEADER_JAVA b/config/license/HEADER_JAVA
new file mode 100644
index 0000000000..d95b44938b
--- /dev/null
+++ b/config/license/HEADER_JAVA
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2016-present, RxJava Contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
+ * the License for the specific language governing permissions and limitations under the License.
+ */
diff --git a/docs/Additional-Reading.md b/docs/Additional-Reading.md
index 85e7d47077..4badd81308 100644
--- a/docs/Additional-Reading.md
+++ b/docs/Additional-Reading.md
@@ -3,7 +3,7 @@ A more complete and up-to-date list of resources can be found at the [reactivex.
# Introducing Reactive Programming
* [Introduction to Rx](http://www.introtorx.com/): a free, on-line book by Lee Campbell **(1.x)**
* [The introduction to Reactive Programming you've been missing](https://gist.github.com/staltz/868e7e9bc2a7b8c1f754) by Andre Staltz
-* [Mastering Observables](http://docs.couchbase.com/developer/java-2.0/observables.html) from the Couchbase documentation **(1.x)**
+* [Mastering Observables](https://docs.huihoo.com/couchbase/developer-guide/java-2.0/observables.html) from the Couchbase documentation **(1.x)**
* [Reactive Programming in Java 8 With RxJava](http://pluralsight.com/training/Courses/TableOfContents/reactive-programming-java-8-rxjava), a course designed by Russell Elledge **(1.x)**
* [33rd Degree Reactive Java](http://www.slideshare.net/tkowalcz/33rd-degree-reactive-java) by Tomasz Kowalczewski **(1.x)**
* [What Every Hipster Should Know About Functional Reactive Programming](http://www.infoq.com/presentations/game-functional-reactive-programming) - Bodil Stokke demos the creation of interactive game mechanics in RxJS
diff --git a/docs/Backpressure-(2.0).md b/docs/Backpressure-(2.0).md
index 61361d21c4..6b2f2860af 100644
--- a/docs/Backpressure-(2.0).md
+++ b/docs/Backpressure-(2.0).md
@@ -172,7 +172,7 @@ If some of the values can be safely ignored, one can use the sampling (with time
}
```
-Note hovewer that these operators only reduce the rate of value reception by the downstream and thus they may still lead to `MissingBackpressureException`.
+Note however that these operators only reduce the rate of value reception by the downstream and thus they may still lead to `MissingBackpressureException`.
## onBackpressureBuffer()
@@ -229,7 +229,7 @@ Note that the last two strategies cause discontinuity in the stream as they drop
## onBackpressureDrop()
-Whenever the downstream is not ready to receive values, this operator will drop that elemenet from the sequence. One can think of it as a 0 capacity `onBackpressureBuffer` with strategy `ON_OVERFLOW_DROP_LATEST`.
+Whenever the downstream is not ready to receive values, this operator will drop that element from the sequence. One can think of it as a 0 capacity `onBackpressureBuffer` with strategy `ON_OVERFLOW_DROP_LATEST`.
This operator is useful when one can safely ignore values from a source (such as mouse moves or current GPS location signals) as there will be more up-to-date values later on.
diff --git a/docs/Backpressure.md b/docs/Backpressure.md
index 8feec0d487..8529ec0995 100644
--- a/docs/Backpressure.md
+++ b/docs/Backpressure.md
@@ -20,7 +20,7 @@ Cold Observables are ideal for the reactive pull model of backpressure described
Your first line of defense against the problems of over-producing Observables is to use some of the ordinary set of Observable operators to reduce the number of emitted items to a more manageable number. The examples in this section will show how you might use such operators to handle a bursty Observable like the one illustrated in the following marble diagram:
-
+
By fine-tuning the parameters to these operators you can ensure that a slow-consuming observer is not overwhelmed by a fast-producing Observable.
@@ -33,26 +33,26 @@ The following diagrams show how you could use each of these operators on the bur
### sample (or throttleLast)
The `sample` operator periodically "dips" into the sequence and emits only the most recently emitted item during each dip:
-
-````groovy
+
+```java
Observable burstySampled = bursty.sample(500, TimeUnit.MILLISECONDS);
-````
+```
### throttleFirst
The `throttleFirst` operator is similar, but emits not the most recently emitted item, but the first item that was emitted after the previous "dip":
-
-````groovy
+
+```java
Observable burstyThrottled = bursty.throttleFirst(500, TimeUnit.MILLISECONDS);
-````
+```
### debounce (or throttleWithTimeout)
The `debounce` operator emits only those items from the source Observable that are not followed by another item within a specified duration:
-
-````groovy
+
+```java
Observable burstyDebounced = bursty.debounce(10, TimeUnit.MILLISECONDS);
-````
+```
## Buffers and windows
@@ -64,15 +64,15 @@ The following diagrams show how you could use each of these operators on the bur
You could, for example, close and emit a buffer of items from the bursty Observable periodically, at a regular interval of time:
-
-````groovy
+
+```java
Observable> burstyBuffered = bursty.buffer(500, TimeUnit.MILLISECONDS);
-````
+```
Or you could get fancy, and collect items in buffers during the bursty periods and emit them at the end of each burst, by using the `debounce` operator to emit a buffer closing indicator to the `buffer` operator:
-
-````groovy
+
+```java
// we have to multicast the original bursty Observable so we can use it
// both as our source and as the source for our buffer closing selector:
Observable burstyMulticast = bursty.publish().refCount();
@@ -86,17 +86,17 @@ Observable> burstyBuffered = burstyMulticast.buffer(burstyDebounce
`window` is similar to `buffer`. One variant of `window` allows you to periodically emit Observable windows of items at a regular interval of time:
-
-````groovy
+
+```java
Observable> burstyWindowed = bursty.window(500, TimeUnit.MILLISECONDS);
````
You could also choose to emit a new window each time you have collected a particular number of items from the source Observable:
-
-````groovy
+
+```java
Observable> burstyWindowed = bursty.window(5);
-````
+```
# Callstack blocking as a flow-control alternative to backpressure
@@ -110,8 +110,8 @@ When you subscribe to an `Observable` with a `Subscriber`, you can request react
Then, after handling this item (or these items) in `onNext()`, you can call `request()` again to instruct the `Observable` to emit another item (or items). Here is an example of a `Subscriber` that requests one item at a time from `someObservable`:
-````java
-someObservable.subscribe(new Subscriber() {
+```java
+someObservable.subscribe(new Subscriber() {
@Override
public void onStart() {
request(1);
@@ -128,13 +128,13 @@ someObservable.subscribe(new Subscriber() {
}
@Override
- public void onNext(t n) {
+ public void onNext(T n) {
// do something with the emitted item "n"
// request another item:
request(1);
}
});
-````
+```
You can pass a magic number to `request`, `request(Long.MAX_VALUE)`, to disable reactive pull backpressure and to ask the Observable to emit items at its own pace. `request(0)` is a legal call, but has no effect. Passing values less than zero to `request` will cause an exception to be thrown.
@@ -158,18 +158,18 @@ For this to work, though, Observables _A_ and _B_ must respond correctly to the
onBackpressureBuffer
- maintains a buffer of all emissions from the source Observable and emits them to downstream Subscribers according to the request s they generate an experimental version of this operator (not available in RxJava 1.0) allows you to set the capacity of the buffer; applying this operator will cause the resulting Observable to terminate with an error if this buffer is overrun
+ maintains a buffer of all emissions from the source Observable and emits them to downstream Subscribers according to the request s they generate an experimental version of this operator (not available in RxJava 1.0) allows you to set the capacity of the buffer; applying this operator will cause the resulting Observable to terminate with an error if this buffer is overrun
onBackpressureDrop
- drops emissions from the source Observable unless there is a pending request from a downstream Subscriber, in which case it will emit enough items to fulfill the request
+ drops emissions from the source Observable unless there is a pending request from a downstream Subscriber, in which case it will emit enough items to fulfill the request
onBackpressureBlock (experimental, not in RxJava 1.0)
- blocks the thread on which the source Observable is operating until such time as a Subscriber issues a request for items, and then unblocks the thread only so long as there are pending requests
+ blocks the thread on which the source Observable is operating until such time as a Subscriber issues a request for items, and then unblocks the thread only so long as there are pending requests
If you do not apply any of these operators to an Observable that does not support backpressure, _and_ if either you as the Subscriber or some operator between you and the Observable attempts to apply reactive pull backpressure, you will encounter a `MissingBackpressureException` which you will be notified of via your `onError()` callback.
# Further reading
-If the standard operators are providing the expected behavior, [one can write custom operators in RxJava](https://github.com/ReactiveX/RxJava/wiki/Implementing-custom-operators-(draft)).
+If the standard operators aren't providing the expected behavior, [one can write custom operators in RxJava](https://github.com/ReactiveX/RxJava/wiki/Implementing-custom-operators-(draft)).
# See also
* [RxJava 0.20.0-RC1 release notes](https://github.com/ReactiveX/RxJava/releases/tag/0.20.0-RC1)
diff --git a/docs/Blocking-Observable-Operators.md b/docs/Blocking-Observable-Operators.md
index 64d6e1b40a..fe2a640f49 100644
--- a/docs/Blocking-Observable-Operators.md
+++ b/docs/Blocking-Observable-Operators.md
@@ -18,7 +18,7 @@ To transform an `Observable` into a `BlockingObservable`, use the [`Observable.t
> This documentation accompanies its explanations with a modified form of "marble diagrams." Here is how these marble diagrams represent Blocking Observables:
-
+
#### see also:
* javadoc: `BlockingObservable`
diff --git a/docs/Combining-Observables.md b/docs/Combining-Observables.md
index bcc19f6b0f..fcde91b76b 100644
--- a/docs/Combining-Observables.md
+++ b/docs/Combining-Observables.md
@@ -2,13 +2,13 @@ This section explains operators you can use to combine multiple Observables.
# Outline
-- [`combineLatest`](#combineLatest)
+- [`combineLatest`](#combinelatest)
- [`join` and `groupJoin`](#joins)
- [`merge`](#merge)
-- [`mergeDelayError`](#mergeDelayError)
+- [`mergeDelayError`](#mergedelayerror)
- [`rxjava-joins`](#rxjava-joins)
-- [`startWith`](#startWith)
-- [`switchOnNext`](#switchOnNext)
+- [`startWith`](#startwith)
+- [`switchOnNext`](#switchonnext)
- [`zip`](#zip)
## startWith
diff --git a/docs/Conditional-and-Boolean-Operators.md b/docs/Conditional-and-Boolean-Operators.md
index f7ed64ce34..e6d1358e31 100644
--- a/docs/Conditional-and-Boolean-Operators.md
+++ b/docs/Conditional-and-Boolean-Operators.md
@@ -1,21 +1,169 @@
This section explains operators with which you conditionally emit or transform Observables, or can do boolean evaluations of them:
### Conditional Operators
-* [**`amb( )`**](http://reactivex.io/documentation/operators/amb.html) — given two or more source Observables, emits all of the items from the first of these Observables to emit an item
-* [**`defaultIfEmpty( )`**](http://reactivex.io/documentation/operators/defaultifempty.html) — emit items from the source Observable, or emit a default item if the source Observable completes after emitting no items
-* (`rxjava-computation-expressions`) [**`doWhile( )`**](http://reactivex.io/documentation/operators/repeat.html) — emit the source Observable's sequence, and then repeat the sequence as long as a condition remains true
-* (`rxjava-computation-expressions`) [**`ifThen( )`**](http://reactivex.io/documentation/operators/defer.html) — only emit the source Observable's sequence if a condition is true, otherwise emit an empty or default sequence
-* [**`skipUntil( )`**](http://reactivex.io/documentation/operators/skipuntil.html) — discard items emitted by a source Observable until a second Observable emits an item, then emit the remainder of the source Observable's items
-* [**`skipWhile( )`**](http://reactivex.io/documentation/operators/skipwhile.html) — discard items emitted by an Observable until a specified condition is false, then emit the remainder
-* (`rxjava-computation-expressions`) [**`switchCase( )`**](http://reactivex.io/documentation/operators/defer.html) — emit the sequence from a particular Observable based on the results of an evaluation
-* [**`takeUntil( )`**](http://reactivex.io/documentation/operators/takeuntil.html) — emits the items from the source Observable until a second Observable emits an item or issues a notification
-* [**`takeWhile( )` and `takeWhileWithIndex( )`**](http://reactivex.io/documentation/operators/takewhile.html) — emit items emitted by an Observable as long as a specified condition is true, then skip the remainder
-* (`rxjava-computation-expressions`) [**`whileDo( )`**](http://reactivex.io/documentation/operators/repeat.html) — if a condition is true, emit the source Observable's sequence and then repeat the sequence as long as the condition remains true
-
-> (`rxjava-computation-expressions`) — indicates that this operator is currently part of the optional `rxjava-computation-expressions` package under `rxjava-contrib` and is not included with the standard RxJava set of operators
+
+### Outline
+
+- [`amb`](#all)
+- [`defaultIfEmpty`](#defaultIfEmpty)
+- [`skipUntil`](#skipUntil)
+- [`skipWhile`](#skipWhile)
+- [`takeUntil`](#takeUntil)
+- [`takeWhile`](#takeUntil)
+
+## amb
+
+**Available in:**  `Flowable`,  `Observable`,  `Maybe`,  `Single`,  `Completable`
+
+**ReactiveX documentation:** [http://reactivex.io/documentation/operators/amb.html](http://reactivex.io/documentation/operators/amb.html)
+
+given two or more source Observables, emits all of the items from the first of these Observables to emit an item
+
+```java
+ Observable source1 = Observable.range(1, 5);
+ Observable source2 = Observable.range(6, 5);
+ Observable.amb(new ArrayList(Arrays.asList(source1, source2)))
+ .subscribe(next -> System.out.printf("next: %s\n", next), // onNext
+ throwable -> System.out.printf("error: %s\n", throwable), //onError
+ () -> System.out.println("Completed") //onComplete
+ );
+```
+## defaultIfEmpty
+
+**Available in:**  `Flowable`,  `Observable`,  `Maybe`,  `Single`,  `Completable`
+
+**ReactiveX documentation:** [http://reactivex.io/documentation/operators/defaultifempty.html](http://reactivex.io/documentation/operators/defaultifempty.html)
+
+emit items from the source Observable, or emit a default item if the source Observable completes after emitting no items
+
+```java
+ Observable.empty().defaultIfEmpty(1).blockingSubscribe(next -> System.out.printf("next: %s\n", next), // onNext
+ throwable -> System.out.printf("error: %s", throwable), //onError
+ () -> System.out.println("Completed") //onComplete
+ );
+```
+
+## skipUntil
+
+**Available in:**  `Flowable`,  `Observable`,  `Maybe`,  `Single`,  `Completable`
+
+**ReactiveX documentation:** [http://reactivex.io/documentation/operators/skipuntil.html](http://reactivex.io/documentation/operators/skipuntil.html)
+
+discard items emitted by a source Observable until a second Observable emits an item, then emit the remainder of the source Observable's items
+
+```java
+Observable observable1 = Observable.range(1, 10).doOnNext(next -> Thread.sleep(1000));
+
+observable1.skipUntil(Observable.timer(3, TimeUnit.SECONDS))
+ .subscribe(next -> System.out.printf("next: %s\n", next), // onNext
+ throwable -> System.out.printf("error: %s", throwable), //onError
+ () -> System.out.println("Completed") //onComplete
+ );
+```
+## skipWhile
+
+**Available in:**  `Flowable`,  `Observable`,  `Maybe`,  `Single`,  `Completable`
+
+**ReactiveX documentation:** [http://reactivex.io/documentation/operators/skipwhile.html](http://reactivex.io/documentation/operators/skipwhile.html)
+
+discard items emitted by an Observable until a specified condition is false, then emit the remainder
+
+```java
+Observable.range(1, 10).skipWhile(next -> next < 5)
+ .subscribe(next -> System.out.printf("next: %s\n", next), // onNext
+ throwable -> System.out.printf("error: %s", throwable), //onError
+ () -> System.out.println("Completed") //onComplete
+ );
+```
+
+## takeUntil
+
+**Available in:**  `Flowable`,  `Observable`,  `Maybe`,  `Single`,  `Completable`
+
+**ReactiveX documentation:** [http://reactivex.io/documentation/operators/takeuntil.html](http://reactivex.io/documentation/operators/takeuntil.html)
+
+emits the items from the source Observable until a second Observable emits an item or issues a notification
+
+```java
+Observable.range(1, 10).takeUntil(value -> value >= 5)
+ .subscribe(next -> System.out.printf("next: %s\n", next), // onNext
+ throwable -> System.out.printf("error: %s", throwable), //onError
+ () -> System.out.println("Completed") //onComplete
+ );
+```
+
+## takeWhile
+
+**Available in:**  `Flowable`,  `Observable`,  `Maybe`,  `Single`,  `Completable`
+
+**ReactiveX documentation:** [http://reactivex.io/documentation/operators/takewhile.html](http://reactivex.io/documentation/operators/takewhile.html)
+
+emit items emitted by an Observable as long as a specified condition is true, then skip the remainder
+
+```java
+ Observable.range(1, 10).takeWhile(value -> value <= 5)
+ .subscribe(next -> System.out.printf("next: %s\n", next), // onNext
+ throwable -> System.out.printf("error: %s", throwable), //onError
+ () -> System.out.println("Completed") //onComplete
+ );
+```
### Boolean Operators
-* [**`all( )`**](http://reactivex.io/documentation/operators/all.html) — determine whether all items emitted by an Observable meet some criteria
-* [**`contains( )`**](http://reactivex.io/documentation/operators/contains.html) — determine whether an Observable emits a particular item or not
-* [**`exists( )` and `isEmpty( )`**](http://reactivex.io/documentation/operators/contains.html) — determine whether an Observable emits any items or not
-* [**`sequenceEqual( )`**](http://reactivex.io/documentation/operators/sequenceequal.html) — test the equality of the sequences emitted by two Observables
+
+### Outline
+
+- [`all`](#all)
+- [`contains`](#contains)
+- [`isEmpty`](#isEmpty)
+- [`sequenceEqual`](#sequenceEqual)
+
+## all
+**Available in:**  `Flowable`,  `Observable`,  `Maybe`,  `Single`,  `Completable`
+
+**ReactiveX documentation:** [http://reactivex.io/documentation/operators/all.html](http://reactivex.io/documentation/operators/all.html)
+
+determine whether all items emitted by an Observable meet some criteria
+
+```java
+Flowable.range(0,10).doOnNext(next -> System.out.println(next)).all(integer -> integer<10).
+ blockingSubscribe(success->System.out.println("Success: "+success));
+```
+
+## contains
+**Available in:**  `Flowable`,  `Observable`,  `Maybe`,  `Single`,  `Completable`
+
+**ReactiveX documentation:** [http://reactivex.io/documentation/operators/contains.html](http://reactivex.io/documentation/operators/contains.html)
+
+determine whether an Observable emits a particular item or not
+
+```java
+Flowable.range(1,10).doOnNext(next->System.out.println(next))
+ .contains(4).blockingSubscribe(contains->System.out.println("contains: "+contains));
+```
+
+## isEmpty
+**Available in:**  `Flowable`,  `Observable`,  `Maybe`,  `Single`,  `Completable`
+
+**ReactiveX documentation:** [http://reactivex.io/documentation/operators/contains.html](http://reactivex.io/documentation/operators/contains.html)
+
+determine whether the source Publisher is empty
+
+```java
+Flowable.empty().isEmpty().subscribe(isEmpty -> System.out.printf("isEmpty: %s", isEmpty));
+```
+
+## sequenceEqual
+**Available in:**  `Flowable`,  `Observable`,  `Maybe`,  `Single`,  `Completable`
+
+**ReactiveX documentation:** [http://reactivex.io/documentation/operators/sequenceequal.html](http://reactivex.io/documentation/operators/sequenceequal.html)
+
+test the equality of the sequences emitted by two Observables
+
+```java
+Flowable flowable1 = Flowable.range(1,3).doOnNext(next-> System.out.print("flowable1: "+next + " "));
+
+Flowable flowable2 = Flowable.range(1,3).doOnNext(next-> System.out.println("flowable2: "+next));
+
+Flowable.sequenceEqual(Flowable.fromPublisher(flowable1),Flowable.fromPublisher(flowable2))
+ .blockingSubscribe(sequenceEqual->System.out.println("sequenceEqual: "+sequenceEqual));
+```
diff --git a/docs/Connectable-Observable-Operators.md b/docs/Connectable-Observable-Operators.md
index a048547529..157ded821b 100644
--- a/docs/Connectable-Observable-Operators.md
+++ b/docs/Connectable-Observable-Operators.md
@@ -7,25 +7,22 @@ This section explains the [`ConnectableObservable`](http://reactivex.io/RxJava/j
A Connectable Observable resembles an ordinary Observable, except that it does not begin emitting items when it is subscribed to, but only when its `connect()` method is called. In this way you can wait for all intended Subscribers to subscribe to the Observable before the Observable begins emitting items.
-
+
The following example code shows two Subscribers subscribing to the same Observable. In the first case, they subscribe to an ordinary Observable; in the second case, they subscribe to a Connectable Observable that only connects after both Subscribers subscribe. Note the difference in the output:
**Example #1:**
-```groovy
-def firstMillion = Observable.range( 1, 1000000 ).sample(7, java.util.concurrent.TimeUnit.MILLISECONDS);
+```java
+Observable firstMillion = Observable.range(1, 1000000).sample(7, java.util.concurrent.TimeUnit.MILLISECONDS);
-firstMillion.subscribe(
- { println("Subscriber #1:" + it); }, // onNext
- { println("Error: " + it.getMessage()); }, // onError
- { println("Sequence #1 complete"); } // onCompleted
-);
-
-firstMillion.subscribe(
- { println("Subscriber #2:" + it); }, // onNext
- { println("Error: " + it.getMessage()); }, // onError
- { println("Sequence #2 complete"); } // onCompleted
-);
+firstMillion.subscribe(next -> System.out.println("Subscriber #1: " + next), // onNext
+ throwable -> System.out.println("Error: " + throwable), // onError
+ () -> System.out.println("Sequence #1 complete") // onComplete
+ );
+firstMillion.subscribe(next -> System.out.println("Subscriber #2: " + next), // onNext
+ throwable -> System.out.println("Error: " + throwable), // onError
+ () -> System.out.println("Sequence #2 complete") // onComplete
+ );
```
```
Subscriber #1:211128
@@ -40,20 +37,18 @@ Subscriber #2:826996
Sequence #2 complete
```
**Example #2:**
-```groovy
-def firstMillion = Observable.range( 1, 1000000 ).sample(7, java.util.concurrent.TimeUnit.MILLISECONDS).publish();
+```java
+ConnectableObservable firstMillion = Observable.range(1, 1000000).sample(7, java.util.concurrent.TimeUnit.MILLISECONDS).publish();
-firstMillion.subscribe(
- { println("Subscriber #1:" + it); }, // onNext
- { println("Error: " + it.getMessage()); }, // onError
- { println("Sequence #1 complete"); } // onCompleted
-);
+firstMillion.subscribe(next -> System.out.println("Subscriber #1: " + next), // onNext
+ throwable -> System.out.println("Error: " + throwable), // onError
+ () -> System.out.println("Sequence #1 complete") // onComplete
+ );
-firstMillion.subscribe(
- { println("Subscriber #2:" + it); }, // onNext
- { println("Error: " + it.getMessage()); }, // onError
- { println("Sequence #2 complete"); } // onCompleted
-);
+firstMillion.subscribe(next -> System.out.println("Subscriber #2: " + next), // onNext
+ throwable -> System.out.println("Error: " + throwable), // onError
+ () -> System.out.println("Sequence #2 complete") // onComplete
+ );
firstMillion.connect();
```
diff --git a/docs/Filtering-Observables.md b/docs/Filtering-Observables.md
index 620800dc8c..512b69ba8a 100644
--- a/docs/Filtering-Observables.md
+++ b/docs/Filtering-Observables.md
@@ -259,7 +259,7 @@ firstOrError.subscribe(
**ReactiveX documentation:** [http://reactivex.io/documentation/operators/ignoreelements.html](http://reactivex.io/documentation/operators/ignoreelements.html)
-Ignores the single item emitted by a `Single` or `Maybe` source, and returns a `Completable` that signals only the error or completion event from the the source.
+Ignores the single item emitted by a `Single` or `Maybe` source, and returns a `Completable` that signals only the error or completion event from the source.
### ignoreElement example
diff --git a/docs/Getting-Started.md b/docs/Getting-Started.md
index fb9baa47dd..69b69a8ca6 100644
--- a/docs/Getting-Started.md
+++ b/docs/Getting-Started.md
@@ -1,20 +1,20 @@
## Getting Binaries
-You can find binaries and dependency information for Maven, Ivy, Gradle, SBT, and others at [http://search.maven.org](http://search.maven.org/#search%7Cga%7C1%7Cg%3A"io.reactivex.rxjava2"%20AND%20"rxjava2").
+You can find binaries and dependency information for Maven, Ivy, Gradle, SBT, and others at [http://search.maven.org](https://search.maven.org/search?q=g:io.reactivex.rxjava3%20AND%20rxjava).
Example for Maven:
```xml
- io.reactivex.rxjava2
+ io.reactivex.rxjava3
rxjava
- 2.2.0
+ 3.0.4
```
and for Ivy:
```xml
-
+
```
and for SBT:
@@ -22,12 +22,12 @@ and for SBT:
```scala
libraryDependencies += "io.reactivex" %% "rxscala" % "0.26.5"
-libraryDependencies += "io.reactivex.rxjava2" % "rxjava" % "2.2.0"
+libraryDependencies += "io.reactivex.rxjava3" % "rxjava" % "3.0.4"
```
and for Gradle:
```groovy
-compile 'io.reactivex.rxjava2:rxjava:2.2.0'
+implementation 'io.reactivex.rxjava3:rxjava:3.0.4'
```
If you need to download the jars instead of using a build system, create a Maven `pom` file like this with the desired version:
@@ -38,17 +38,17 @@ If you need to download the jars instead of using a build system, create a Maven
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
- io.reactivex.rxjava2
+ io.reactivex.rxjava3
rxjava
- 2.2.0
+ 3.0.4
RxJava
Reactive Extensions for Java
https://github.com/ReactiveX/RxJava
- io.reactivex.rxjava2
+ io.reactivex.rxjava3
rxjava
- 2.2.0
+ 3.0.4
@@ -66,18 +66,21 @@ You need Java 6 or later.
### Snapshots
-Snapshots are available via [JFrog](https://oss.jfrog.org/libs-snapshot/io/reactivex/rxjava2/rxjava/):
+Snapshots after May 1st, 2021 are available via https://oss.sonatype.org/content/repositories/snapshots/io/reactivex/rxjava3/rxjava/
```groovy
repositories {
- maven { url 'https://oss.jfrog.org/libs-snapshot' }
+ maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}
dependencies {
- compile 'io.reactivex.rxjava2:rxjava:2.2.0-SNAPSHOT'
+ implementation 'io.reactivex.rxjava3:rxjava:3.0.0-SNAPSHOT'
}
```
+JavaDoc snapshots are available at http://reactivex.io/RxJava/3.x/javadoc/snapshot
+
+
## Building
To check out and build the RxJava source, issue the following commands:
diff --git a/docs/How-To-Use-RxJava.md b/docs/How-To-Use-RxJava.md
index 16d156caa9..41a46bb75d 100644
--- a/docs/How-To-Use-RxJava.md
+++ b/docs/How-To-Use-RxJava.md
@@ -96,9 +96,9 @@ You use the Observable [`just( )`](http://reactivex.io/documentation/operators
Observable o = Observable.from("a", "b", "c");
def list = [5, 6, 7, 8]
-Observable o = Observable.from(list);
+Observable o2 = Observable.from(list);
-Observable o = Observable.just("one object");
+Observable o3 = Observable.just("one object");
```
These converted Observables will synchronously invoke the [`onNext( )`](Observable#onnext-oncompleted-and-onerror) method of any subscriber that subscribes to them, for each item to be emitted by the Observable, and will then invoke the subscriber’s [`onCompleted( )`](Observable#onnext-oncompleted-and-onerror) method.
@@ -285,7 +285,7 @@ onNext => value_14_xform
Here is a marble diagram that illustrates this transformation:
-
+
This next example, in Clojure, consumes three asynchronous Observables, including a dependency from one to another, and emits a single response item by combining the items emitted by each of the three Observables with the [`zip`](http://reactivex.io/documentation/operators/zip.html) operator and then transforming the result with [`map`](http://reactivex.io/documentation/operators/map.html):
@@ -333,7 +333,7 @@ The response looks like this:
And here is a marble diagram that illustrates how that code produces that response:
-
+
The following example, in Groovy, comes from [Ben Christensen’s QCon presentation on the evolution of the Netflix API](https://speakerdeck.com/benjchristensen/evolution-of-the-netflix-api-qcon-sf-2013). It combines two Observables with the [`merge`](http://reactivex.io/documentation/operators/merge.html) operator, then uses the [`reduce`](http://reactivex.io/documentation/operators/reduce.html) operator to construct a single item out of the resulting sequence, then transforms that item with [`map`](http://reactivex.io/documentation/operators/map.html) before emitting it:
@@ -350,7 +350,7 @@ public Observable getVideoSummary(APIVideo video) {
And here is a marble diagram that illustrates how that code uses the [`reduce`](http://reactivex.io/documentation/operators/reduce.html) operator to bring the results from multiple Observables together in one structure:
-
+
## Error Handling
diff --git a/docs/Operator-Matrix.md b/docs/Operator-Matrix.md
new file mode 100644
index 0000000000..afeb8e4182
--- /dev/null
+++ b/docs/Operator-Matrix.md
@@ -0,0 +1,359 @@
+Operator |  |  |  |  |  |
+-----|---|---|---|---|---|
+ `all`||| ([1](#notes-1)) | ([1](#notes-1)) | ([2](#notes-2)) |
+ `amb`||||||
+ `ambArray`||||||
+ `ambWith`||||||
+ `andThen`| ([3](#notes-3)) | ([3](#notes-3)) | ([3](#notes-3)) | ([3](#notes-3)) ||
+ `any`||| ([1](#notes-1)) | ([1](#notes-1)) | ([2](#notes-2)) |
+ `blockingAwait`| ([4](#notes-4)) | ([4](#notes-4)) | ([5](#notes-5)) | ([5](#notes-5)) ||
+ `blockingFirst`||| ([6](#notes-6)) | ([6](#notes-6)) | ([7](#notes-7)) |
+ `blockingForEach`||| ([8](#notes-8)) | ([8](#notes-8)) | ([8](#notes-8)) |
+ `blockingGet`| ([4](#notes-4)) | ([4](#notes-4)) ||| ([7](#notes-7)) |
+ `blockingIterable`||| ([6](#notes-6)) | ([6](#notes-6)) | ([7](#notes-7)) |
+ `blockingLast`||| ([6](#notes-6)) | ([6](#notes-6)) | ([7](#notes-7)) |
+ `blockingLatest`||| ([6](#notes-6)) | ([6](#notes-6)) | ([7](#notes-7)) |
+ `blockingMostRecent`||| ([6](#notes-6)) | ([6](#notes-6)) | ([7](#notes-7)) |
+ `blockingNext`||| ([6](#notes-6)) | ([6](#notes-6)) | ([7](#notes-7)) |
+ `blockingSingle`||| ([6](#notes-6)) | ([6](#notes-6)) | ([7](#notes-7)) |
+ `blockingStream`||| ([6](#notes-6)) | ([6](#notes-6)) | ([7](#notes-7)) |
+ `blockingSubscribe`||||||
+ `buffer`||| ([9](#notes-9)) | ([10](#notes-10)) | ([11](#notes-11)) |
+ `cache`||||||
+ `cacheWithInitialCapacity`||| ([12](#notes-12)) | ([12](#notes-12)) | ([12](#notes-12)) |
+ `cast`||||| ([2](#notes-2)) |
+ `collect`||| ([13](#notes-13)) | ([14](#notes-14)) | ([15](#notes-15)) |
+ `collectInto`||| ([13](#notes-13)) | ([14](#notes-14)) | ([15](#notes-15)) |
+ `combineLatest`||| ([16](#notes-16)) | ([16](#notes-16)) | ([17](#notes-17)) |
+ `combineLatestArray`||| ([18](#notes-18)) | ([18](#notes-18)) | ([19](#notes-19)) |
+ `combineLatestArrayDelayError`||| ([18](#notes-18)) | ([18](#notes-18)) | ([20](#notes-20)) |
+ `combineLatestDelayError`||| ([16](#notes-16)) | ([16](#notes-16)) | ([21](#notes-21)) |
+ `complete`| ([22](#notes-22)) | ([22](#notes-22)) | ([22](#notes-22)) | ([23](#notes-23)) ||
+ `compose`||||||
+ `concat`||||||
+ `concatArray`||||||
+ `concatArrayDelayError`||||||
+ `concatArrayEager`||||| ([24](#notes-24)) |
+ `concatArrayEagerDelayError`||||| ([25](#notes-25)) |
+ `concatDelayError`||||||
+ `concatEager`||||| ([26](#notes-26)) |
+ `concatEagerDelayError`||||| ([27](#notes-27)) |
+ `concatMap`||||| ([28](#notes-28)) |
+ `concatMapCompletable`||||| ([28](#notes-28)) |
+ `concatMapCompletableDelayError`||| ([29](#notes-29)) | ([29](#notes-29)) | ([28](#notes-28)) |
+ `concatMapDelayError`||| ([30](#notes-30)) | ([30](#notes-30)) | ([28](#notes-28)) |
+ `concatMapEager`||| ([31](#notes-31)) | ([31](#notes-31)) | ([28](#notes-28)) |
+ `concatMapEagerDelayError`||| ([31](#notes-31)) | ([31](#notes-31)) | ([28](#notes-28)) |
+ `concatMapIterable`||| ([32](#notes-32)) | ([32](#notes-32)) | ([28](#notes-28)) |
+ `concatMapMaybe`||| ([33](#notes-33)) || ([28](#notes-28)) |
+ `concatMapMaybeDelayError`||| ([34](#notes-34)) | ([34](#notes-34)) | ([28](#notes-28)) |
+ `concatMapSingle`|||| ([35](#notes-35)) | ([28](#notes-28)) |
+ `concatMapSingleDelayError`||| ([36](#notes-36)) | ([36](#notes-36)) | ([28](#notes-28)) |
+ `concatMapStream`||| ([37](#notes-37)) | ([37](#notes-37)) | ([28](#notes-28)) |
+ `concatWith`||||||
+ `contains`||||| ([2](#notes-2)) |
+ `count`|||| ([38](#notes-38)) | ([39](#notes-39)) |
+ `create`||||||
+ `debounce`||| ([40](#notes-40)) | ([40](#notes-40)) | ([41](#notes-41)) |
+ `defaultIfEmpty`|||| ([23](#notes-23)) | ([42](#notes-42)) |
+ `defer`||||||
+ `delay`||||||
+ `delaySubscription`||||||
+ `dematerialize`||||| ([41](#notes-41)) |
+ `distinct`||| ([43](#notes-43)) | ([43](#notes-43)) | ([41](#notes-41)) |
+ `distinctUntilChanged`||| ([43](#notes-43)) | ([43](#notes-43)) | ([41](#notes-41)) |
+ `doAfterNext`||| ([44](#notes-44)) | ([44](#notes-44)) | ([2](#notes-2)) |
+ `doAfterSuccess`| ([45](#notes-45)) | ([45](#notes-45)) ||| ([41](#notes-41)) |
+ `doAfterTerminate`||||||
+ `doFinally`||||||
+ `doOnCancel`|| ([46](#notes-46)) | ([46](#notes-46)) | ([46](#notes-46)) | ([46](#notes-46)) |
+ `doOnComplete`|||| ([47](#notes-47)) ||
+ `doOnDispose`| ([48](#notes-48)) |||||
+ `doOnEach`||| ([49](#notes-49)) | ([49](#notes-49)) | ([41](#notes-41)) |
+ `doOnError`||||||
+ `doOnEvent`| ([50](#notes-50)) | ([50](#notes-50)) ||||
+ `doOnLifecycle`||||||
+ `doOnNext`||| ([51](#notes-51)) | ([51](#notes-51)) | ([41](#notes-41)) |
+ `doOnRequest`|| ([52](#notes-52)) | ([52](#notes-52)) | ([52](#notes-52)) | ([52](#notes-52)) |
+ `doOnSubscribe`||||||
+ `doOnSuccess`| ([53](#notes-53)) | ([53](#notes-53)) ||| ([41](#notes-41)) |
+ `doOnTerminate`||||||
+ `elementAt`||| ([54](#notes-54)) | ([55](#notes-55)) | ([41](#notes-41)) |
+ `elementAtOrError`||| ([56](#notes-56)) | ([55](#notes-55)) | ([41](#notes-41)) |
+ `empty`|||| ([23](#notes-23)) | ([57](#notes-57)) |
+ `error`||||||
+ `filter`||||| ([41](#notes-41)) |
+ `first`||| ([58](#notes-58)) | ([59](#notes-59)) | ([42](#notes-42)) |
+ `firstElement`||| ([60](#notes-60)) | ([61](#notes-61)) | ([2](#notes-2)) |
+ `firstOrError`||| ([60](#notes-60)) | ([61](#notes-61)) | ([62](#notes-62)) |
+ `firstOrErrorStage`||| ([63](#notes-63)) | ([63](#notes-63)) | ([64](#notes-64)) |
+ `firstStage`||| ([63](#notes-63)) | ([63](#notes-63)) | ([63](#notes-63)) |
+ `flatMap`||||| ([28](#notes-28)) |
+ `flatMapCompletable`||||| ([28](#notes-28)) |
+ `flatMapIterable`||| ([32](#notes-32)) | ([32](#notes-32)) | ([28](#notes-28)) |
+ `flatMapMaybe`||| ([65](#notes-65)) || ([28](#notes-28)) |
+ `flatMapObservable`| ([66](#notes-66)) | ([67](#notes-67)) ||| ([28](#notes-28)) |
+ `flatMapPublisher`| ([67](#notes-67)) | ([68](#notes-68)) ||| ([28](#notes-28)) |
+ `flatMapSingle`|||| ([65](#notes-65)) | ([28](#notes-28)) |
+ `flatMapStream`||| ([37](#notes-37)) | ([37](#notes-37)) | ([28](#notes-28)) |
+ `flattenAsFlowable`| ([69](#notes-69)) | ([69](#notes-69)) ||| ([28](#notes-28)) |
+ `flattenAsObservable`| ([69](#notes-69)) | ([69](#notes-69)) ||| ([28](#notes-28)) |
+ `flattenStreamAsFlowable`| ([70](#notes-70)) | ([70](#notes-70)) ||| ([28](#notes-28)) |
+ `flattenStreamAsObservable`| ([70](#notes-70)) | ([70](#notes-70)) ||| ([28](#notes-28)) |
+ `forEach`||| ([71](#notes-71)) | ([71](#notes-71)) | ([71](#notes-71)) |
+ `forEachWhile`||| ([71](#notes-71)) | ([71](#notes-71)) | ([71](#notes-71)) |
+ `fromAction`|||| ([23](#notes-23)) ||
+ `fromArray`||| ([72](#notes-72)) | ([73](#notes-73)) | ([74](#notes-74)) |
+ `fromCallable`||||||
+ `fromCompletable`|||| ([75](#notes-75)) | ([76](#notes-76)) |
+ `fromCompletionStage`||||||
+ `fromFuture`||||||
+ `fromIterable`||| ([72](#notes-72)) | ([73](#notes-73)) | ([74](#notes-74)) |
+ `fromMaybe`||| ([76](#notes-76)) |||
+ `fromObservable`|| ([76](#notes-76)) ||||
+ `fromOptional`|||| ([73](#notes-73)) | ([74](#notes-74)) |
+ `fromPublisher`||||||
+ `fromRunnable`|||| ([23](#notes-23)) ||
+ `fromSingle`|||| ([76](#notes-76)) ||
+ `fromStream`||| ([72](#notes-72)) | ([73](#notes-73)) | ([74](#notes-74)) |
+ `fromSupplier`||||||
+ `generate`||| ([77](#notes-77)) | ([77](#notes-77)) | ([77](#notes-77)) |
+ `groupBy`||| ([78](#notes-78)) | ([78](#notes-78)) | ([79](#notes-79)) |
+ `groupJoin`||| ([78](#notes-78)) | ([78](#notes-78)) | ([80](#notes-80)) |
+ `hide`||||||
+ `ignoreElement`| ([81](#notes-81)) | ([81](#notes-81)) ||| ([2](#notes-2)) |
+ `ignoreElements`||| ([82](#notes-82)) | ([82](#notes-82)) | ([2](#notes-2)) |
+ `interval`||| ([83](#notes-83)) | ([83](#notes-83)) | ([83](#notes-83)) |
+ `intervalRange`||| ([83](#notes-83)) | ([83](#notes-83)) | ([83](#notes-83)) |
+ `isEmpty`|||| ([59](#notes-59)) | ([2](#notes-2)) |
+ `join`||| ([84](#notes-84)) | ([84](#notes-84)) | ([80](#notes-80)) |
+ `just`||||| ([2](#notes-2)) |
+ `last`||| ([58](#notes-58)) | ([59](#notes-59)) | ([42](#notes-42)) |
+ `lastElement`||| ([60](#notes-60)) | ([61](#notes-61)) | ([2](#notes-2)) |
+ `lastOrError`||| ([60](#notes-60)) | ([61](#notes-61)) | ([62](#notes-62)) |
+ `lastOrErrorStage`||| ([63](#notes-63)) | ([63](#notes-63)) | ([64](#notes-64)) |
+ `lastStage`||| ([63](#notes-63)) | ([63](#notes-63)) | ([63](#notes-63)) |
+ `lift`||||||
+ `map`||||| ([28](#notes-28)) |
+ `mapOptional`||||| ([28](#notes-28)) |
+ `materialize`||||||
+ `merge`||||||
+ `mergeArray`||||||
+ `mergeArrayDelayError`||||||
+ `mergeDelayError`||||||
+ `mergeWith`||||||
+ `never`||||||
+ `observeOn`||||||
+ `ofType`||||| ([85](#notes-85)) |
+ `onBackpressureBuffer`|| ([52](#notes-52)) | ([52](#notes-52)) | ([52](#notes-52)) | ([52](#notes-52)) |
+ `onBackpressureDrop`|| ([52](#notes-52)) | ([52](#notes-52)) | ([52](#notes-52)) | ([52](#notes-52)) |
+ `onBackpressureLatest`|| ([52](#notes-52)) | ([52](#notes-52)) | ([52](#notes-52)) | ([52](#notes-52)) |
+ `onErrorComplete`||||||
+ `onErrorResumeNext`||||||
+ `onErrorResumeWith`||||||
+ `onErrorReturn`||||||
+ `onErrorReturnItem`||||||
+ `onTerminateDetach`||||||
+ `parallel`|| ([86](#notes-86)) | ([86](#notes-86)) | ([86](#notes-86)) | ([86](#notes-86)) |
+ `publish`||| ([87](#notes-87)) | ([88](#notes-88)) | ([89](#notes-89)) |
+ `range`||| ([90](#notes-90)) | ([90](#notes-90)) | ([74](#notes-74)) |
+ `rangeLong`||| ([90](#notes-90)) | ([90](#notes-90)) | ([74](#notes-74)) |
+ `rebatchRequests`|| ([52](#notes-52)) | ([52](#notes-52)) | ([52](#notes-52)) | ([52](#notes-52)) |
+ `reduce`||| ([91](#notes-91)) | ([91](#notes-91)) | ([92](#notes-92)) |
+ `reduceWith`||| ([91](#notes-91)) | ([91](#notes-91)) | ([92](#notes-92)) |
+ `repeat`||||||
+ `repeatUntil`||||||
+ `repeatWhen`||||||
+ `replay`||| ([87](#notes-87)) | ([88](#notes-88)) | ([89](#notes-89)) |
+ `retry`||||||
+ `retryUntil`||||||
+ `retryWhen`||||||
+ `safeSubscribe`||||||
+ `sample`||| ([60](#notes-60)) | ([60](#notes-60)) | ([41](#notes-41)) |
+ `scan`||| ([91](#notes-91)) | ([91](#notes-91)) | ([92](#notes-92)) |
+ `scanWith`||| ([91](#notes-91)) | ([91](#notes-91)) | ([92](#notes-92)) |
+ `sequenceEqual`||||||
+ `serialize`||| ([93](#notes-93)) | ([93](#notes-93)) | ([93](#notes-93)) |
+ `share`||| ([87](#notes-87)) | ([88](#notes-88)) | ([89](#notes-89)) |
+ `single`||| ([58](#notes-58)) | ([59](#notes-59)) | ([42](#notes-42)) |
+ `singleElement`||| ([60](#notes-60)) | ([61](#notes-61)) | ([2](#notes-2)) |
+ `singleOrError`||| ([60](#notes-60)) | ([61](#notes-61)) | ([62](#notes-62)) |
+ `singleOrErrorStage`||| ([63](#notes-63)) | ([63](#notes-63)) | ([64](#notes-64)) |
+ `singleStage`||| ([63](#notes-63)) | ([63](#notes-63)) | ([63](#notes-63)) |
+ `skip`||| ([60](#notes-60)) | ([60](#notes-60)) | ([60](#notes-60)) |
+ `skipLast`||| ([60](#notes-60)) | ([60](#notes-60)) | ([60](#notes-60)) |
+ `skipUntil`||| ([94](#notes-94)) | ([94](#notes-94)) | ([94](#notes-94)) |
+ `skipWhile`||| ([95](#notes-95)) | ([95](#notes-95)) | ([2](#notes-2)) |
+ `sorted`||| ([78](#notes-78)) | ([78](#notes-78)) | ([78](#notes-78)) |
+ `startWith`||||||
+ `startWithArray`||| ([96](#notes-96)) | ([96](#notes-96)) | ([96](#notes-96)) |
+ `startWithItem`||| ([97](#notes-97)) | ([97](#notes-97)) | ([97](#notes-97)) |
+ `startWithIterable`||| ([98](#notes-98)) | ([98](#notes-98)) | ([98](#notes-98)) |
+ `subscribe`||||||
+ `subscribeOn`||||||
+ `subscribeWith`||||||
+ `switchIfEmpty`|||| ([23](#notes-23)) | ([99](#notes-99)) |
+ `switchMap`||| ([100](#notes-100)) | ([100](#notes-100)) | ([28](#notes-28)) |
+ `switchMapCompletable`||| ([100](#notes-100)) | ([100](#notes-100)) | ([28](#notes-28)) |
+ `switchMapCompletableDelayError`||| ([100](#notes-100)) | ([100](#notes-100)) | ([28](#notes-28)) |
+ `switchMapDelayError`||| ([100](#notes-100)) | ([100](#notes-100)) | ([28](#notes-28)) |
+ `switchMapMaybe`||| ([100](#notes-100)) | ([100](#notes-100)) | ([28](#notes-28)) |
+ `switchMapMaybeDelayError`||| ([100](#notes-100)) | ([100](#notes-100)) | ([28](#notes-28)) |
+ `switchMapSingle`||| ([100](#notes-100)) | ([100](#notes-100)) | ([28](#notes-28)) |
+ `switchMapSingleDelayError`||| ([100](#notes-100)) | ([100](#notes-100)) | ([28](#notes-28)) |
+ `switchOnNext`||||||
+ `switchOnNextDelayError`||||||
+ `take`||| ([60](#notes-60)) | ([60](#notes-60)) | ([60](#notes-60)) |
+ `takeLast`||| ([60](#notes-60)) | ([60](#notes-60)) | ([60](#notes-60)) |
+ `takeUntil`||||||
+ `takeWhile`||| ([95](#notes-95)) | ([95](#notes-95)) | ([2](#notes-2)) |
+ `test`||||||
+ `throttleFirst`||| ([40](#notes-40)) | ([40](#notes-40)) | ([41](#notes-41)) |
+ `throttleLast`||| ([40](#notes-40)) | ([40](#notes-40)) | ([41](#notes-41)) |
+ `throttleLatest`||| ([40](#notes-40)) | ([40](#notes-40)) | ([41](#notes-41)) |
+ `throttleWithTimeout`||| ([40](#notes-40)) | ([40](#notes-40)) | ([41](#notes-41)) |
+ `timeInterval`||||| ([41](#notes-41)) |
+ `timeout`||||||
+ `timer`||||||
+ `timestamp`||||| ([41](#notes-41)) |
+ `to`||||||
+ `toCompletionStage`| ([101](#notes-101)) | ([101](#notes-101)) ||||
+ `toFlowable`| ([102](#notes-102)) |||||
+ `toFuture`||||||
+ `toList`||| ([13](#notes-13)) | ([14](#notes-14)) | ([15](#notes-15)) |
+ `toMap`||| ([13](#notes-13)) | ([14](#notes-14)) | ([15](#notes-15)) |
+ `toMaybe`| ([103](#notes-103)) | ([103](#notes-103)) | ([102](#notes-102)) |||
+ `toMultimap`||| ([13](#notes-13)) | ([14](#notes-14)) | ([15](#notes-15)) |
+ `toObservable`|| ([102](#notes-102)) ||||
+ `toSingle`| ([104](#notes-104)) | ([104](#notes-104)) || ([102](#notes-102)) ||
+ `toSingleDefault`| ([105](#notes-105)) | ([105](#notes-105)) | ([106](#notes-106)) | ([102](#notes-102)) ||
+ `toSortedList`||| ([13](#notes-13)) | ([14](#notes-14)) | ([15](#notes-15)) |
+ `unsafeCreate`||||||
+ `unsubscribeOn`||||||
+ `using`||||||
+ `window`||| ([107](#notes-107)) | ([108](#notes-108)) | ([109](#notes-109)) |
+ `withLatestFrom`||| ([16](#notes-16)) | ([16](#notes-16)) | ([17](#notes-17)) |
+ `wrap`| ([110](#notes-110)) |||||
+ `zip`||||| ([111](#notes-111)) |
+ `zipArray`||||| ([112](#notes-112)) |
+ `zipWith`||||| ([113](#notes-113)) |
+ **237 operators** | **216** | **210** | **118** | **108** | **84** |
+
+#### Notes
+1 Use [`contains()`](#contains).
+2 Always empty.
+3 Use [`concatWith`](#concatWith).
+4 Use [`blockingFirst()`](#blockingFirst), [`blockingSingle()`](#blockingSingle) or [`blockingLast()`](#blockingLast).
+5 Use [`blockingGet()`](#blockingGet).
+6 At most one element to get. Use [`blockingGet()`](#blockingGet).
+7 No elements to get. Use [`blockingAwait()`](#blockingAwait).
+8 Use [`blockingSubscribe()`](#blockingSubscribe)
+9 Use [`map()`](#map) and [`switchIfEmpty()`](#switchIfEmpty) to transform into a list/collection.
+10 Use [`map()`](#map) to transform into a list/collection.
+11 Always empty. Use [`andThen()`](#andThen) to bring in a list/collection.
+12 At most one element to store. Use [`cache()`](#cache).
+13 At most one element to collect. Use [`map()`](#map) and [`switchIfEmpty()`](#switchIfEmpty) to transform into a list/collection.
+14 One element to collect. Use [`map()`](#map) to transform into a list/collection.
+15 Always empty. Use [`andThen()`](#andThen) to bring in a collection.
+16 At most one element per source. Use [`zip()`](#zip).
+17 Always empty. Use [`merge()`](#merge).
+18 At most one element per source. Use [`zipArray()`](#zipArray).
+19 Always empty. Use [`mergeArray()`](#mergeArray).
+20 Always empty. Use [`mergeArrayDelayError()`](#mergeArrayDelayError).
+21 Always empty. Use [`mergeDelayError()`](#mergeDelayError).
+22 Use [`empty()`](#empty).
+23 Never empty.
+24 No items to keep ordered. Use [`mergeArray()`](#mergeArray).
+25 No items to keep ordered. Use [`mergeArrayDelayError()`](#mergeArrayDelayError).
+26 No items to keep ordered. Use [`merge()`](#merge).
+27 No items to keep ordered. Use [`mergeDelayError()`](#mergeDelayError).
+28 Always empty thus no items to map.
+29 Either the upstream fails (thus no inner) or the mapped-in source, but never both. Use [`concatMapCompletable`](#concatMapCompletable).
+30 Either the upstream fails (thus no inner) or the mapped-in source, but never both. Use [`concatMap`](#concatMap).
+31 At most one item to map. Use [`concatMap()`](#concatMap).
+32 At most one item. Use [`flattenAsFlowable`](#flattenAsFlowable) or [`flattenAsObservable`](#flattenAsObservable).
+33 Use [`concatMap`](#concatMap).
+34 Either the upstream fails (thus no inner) or the mapped-in source, but never both. Use [`concatMapMaybe`](#concatMapMaybe).
+35 Use [`concatMap()`](#concatMap).
+36 Either the upstream fails (thus no inner) or the mapped-in source, but never both. Use [`concatMapSingle`](#concatMapSingle).
+37 At most one item. Use [`flattenStreamAsFlowable`](#flattenStreamAsFlowable) or [`flattenStreamAsObservable`](#flattenStreamAsObservable).
+38 Never empty thus always 1.
+39 Always empty thus always 0.
+40 At most one item signaled so no subsequent items to work with.
+41 Always empty thus no items to work with.
+42 Always empty. Use [`andThen()`](#andThen) to chose the follow-up sequence.
+43 At most one item, always distinct.
+44 Different terminology. Use [`doAfterSuccess()`](#doAfterSuccess).
+45 Different terminology. Use [`doAfterNext()`](#doAfterNext).
+46 Different terminology. Use [`doOnDispose()`](#doOnDispose).
+47 Always succeeds or fails, there is no `onComplete` signal.
+48 Different terminology. Use [`doOnCancel()`](#doOnCancel).
+49 At most one item. Use [`doOnEvent()`](#doOnEvent).
+50 Use [`doOnEach()`](#doOnEach).
+51 Different terminology. Use [`doOnSuccess()`](#doOnSuccess).
+52 Backpressure related and not supported outside `Flowable`.
+53 Different terminology. Use [`doOnNext()`](#doOnNext).
+54 At most one item with index 0. Use [`defaultIfEmpty`](#defaultIfEmpty).
+55 Always one item with index 0.
+56 At most one item with index 0. Use [`toSingle`](#toSingle).
+57 Use [`complete()`](#complete).
+58 At most one item. Use [`defaultIfEmpty`](#defaultIfEmpty).
+59 Always one item.
+60 At most one item, would be no-op.
+61 Always one item, would be no-op.
+62 Always empty. Use [`andThen()`](#andThen) and [`error()`](#error).
+63 At most one item. Use [`toCompletionStage()`](#toCompletionStage).
+64 Always empty. Use [`andThen()`](#andThen), [`error()`](#error) and [`toCompletionStage()`](#toCompletionStage).
+65 Use [`flatMap()`](#flatMap).
+66 Not supported. Use [`flatMap`](#flatMap) and [`toFlowable()`](#toFlowable).
+67 Use [`flatMap`](#flatMap).
+68 Not supported. Use [`flatMap`](#flatMap) and [`toObservable()`](#toFlowable).
+69 Use [`flatMapIterable()`](#flatMapIterable).
+70 Use [`flatMapStream()`](#flatMapStream).
+71 Use [`subscribe()`](#subscribe).
+72 At most one item. Use [`just()`](#just) or [`empty()`](#empty).
+73 Always one item. Use [`just()`](#just).
+74 Always empty. Use [`complete()`](#complete).
+75 Always error.
+76 Use [`wrap()`](#wrap).
+77 Use [`fromSupplier()`](#fromSupplier).
+78 At most one item.
+79 Always empty thus no items to group.
+80 Always empty thus no items to join.
+81 Use [`ignoreElements()`](#ignoreElements).
+82 Use [`ignoreElement()`](#ignoreElement).
+83 At most one item. Use [`timer()`](#timer).
+84 At most one item. Use [`zip()`](#zip)
+85 Always empty thus no items to filter.
+86 Needs backpressure thus not supported outside `Flowable`.
+87 Connectable sources not supported outside `Flowable` and `Observable`. Use a `MaybeSubject`.
+88 Connectable sources not supported outside `Flowable` and `Observable`. Use a `SingleSubject`.
+89 Connectable sources not supported outside `Flowable` and `Observable`. Use a `ConnectableSubject`.
+90 At most one item. Use [`just()`](#just).
+91 At most one item. Use [`map()`](#map).
+92 Always empty thus no items to reduce.
+93 At most one signal type.
+94 At most one item. Use [`takeUntil()`](#takeUntil).
+95 At most one item. Use [`filter()`](#filter).
+96 Use [`startWith()`](#startWith) and [`fromArray()`](#fromArray) of `Flowable` or `Observable`.
+97 Use [`startWith()`](#startWith) and [`just()`](#just) of another reactive type.
+98 Use [`startWith()`](#startWith) and [`fromIterable()`](#fromArray) of `Flowable` or `Observable`.
+99 Always empty. Use [`defaultIfEmpty()`](#defaultIfEmpty).
+100 At most one item. Use [`flatMap()`](#flatMap).
+101 Use [`firstStage`](#firstStage), [`lastStage`](#lastStage) or [`singleStage`](#singleStage).
+102 Would be no-op.
+103 Use [`firstElement`](#firstElement), [`lastElement`](#lastElement) or [`singleElement`](#singleElement).
+104 Use [`firstOrError`](#firstOrError), [`lastOrError`](#lastOrError) or [`singleOrError`](#singleOrError).
+105 Use [`first`](#first), [`last`](#last) or [`single`](#single).
+106 Use [`defaultIfEmpty()`](#defaultIfEmpty).
+107 Use [`map()`](#map) and [`switchIfEmpty()`](#switchIfEmpty) to transform into a nested source.
+108 Use [`map()`](#map) to transform into a nested source.
+109 Always empty. Use [`andThen()`](#andThen) to bring in a nested source.
+110 Use [`fromPublisher()`](#fromPublisher).
+111 Use [`merge()`](#merge).
+112 Use [`mergeArray()`](#mergeArray).
+113 Use [`mergeWith()`](#mergeWith).
+
+#### Under development
+
+*Currently, all intended operators are implemented.*
diff --git a/docs/Phantom-Operators.md b/docs/Phantom-Operators.md
index 60da4a1a40..5193147a22 100644
--- a/docs/Phantom-Operators.md
+++ b/docs/Phantom-Operators.md
@@ -19,7 +19,7 @@ These operators have been proposed but are not part of the 1.0 release of RxJava
## chunkify( )
#### returns an iterable that periodically returns a list of items emitted by the source Observable since the last list
-
+
The `chunkify( )` operator represents a blocking observable as an Iterable, that, each time you iterate over it, returns a list of items emitted by the source Observable since the previous iteration. These lists may be empty if there have been no such items emitted.
@@ -27,7 +27,7 @@ The `chunkify( )` operator represents a blocking observable as an Iterable, th
## fromFuture( )
#### convert a Future into an Observable, but do not attempt to get the Future's value until a Subscriber subscribes
-
+
The `fromFuture( )` method also converts a Future into an Observable, but it obtains this Future indirectly, by means of a function you provide. It creates the Observable immediately, but waits to call the function and to obtain the Future until a Subscriber subscribes to it.
@@ -35,7 +35,7 @@ The `fromFuture( )` method also converts a Future into an Observable, but it o
## forEachFuture( )
#### create a futureTask that will invoke a specified function on each item emitted by an Observable
-
+
The `forEachFuture( )` returns a `FutureTask` for each item emitted by the source Observable (or each item and each notification) that, when executed, will apply a function you specify to each such item (or item and notification).
@@ -43,7 +43,7 @@ The `forEachFuture( )` returns a `FutureTask` for each item emitted by the sou
## forIterable( )
#### apply a function to the elements of an Iterable to create Observables which are then concatenated
-
+
`forIterable( )` is similar to `from(Iterable )` but instead of the resulting Observable emitting the elements of the Iterable as its own emitted items, it applies a specified function to each of these elements to generate one Observable per element, and then concatenates the emissions of these Observables to be its own sequence of emitted items.
@@ -58,7 +58,7 @@ If the a subscriber to the Observable that results when a Future is converted to
## generate( ) and generateAbsoluteTime( )
#### create an Observable that emits a sequence of items as generated by a function of your choosing
-
+
The basic form of `generate( )` takes four parameters. These are `initialState` and three functions: `iterate( )`, `condition( )`, and `resultSelector( )`. `generate( )` uses these four parameters to generate an Observable sequence, which is its return value. It does so in the following way.
@@ -66,7 +66,7 @@ The basic form of `generate( )` takes four parameters. These are `initialState
There are also versions of `generate( )` that allow you to do the work of generating the sequence on a particular `Scheduler` and that allow you to set the time interval between emissions by applying a function to the current state. The `generateAbsoluteTime( )` allows you to control the time at which an item is emitted by applying a function to the state to get an absolute system clock time (rather than an interval from the previous emission).
-
+
#### see also:
* Introduction to Rx: Generate
@@ -79,7 +79,7 @@ There are also versions of `generate( )` that allow you to do the work of gene
This version of `groupBy` adds another parameter: an Observable that emits duration markers. When a duration marker is emitted by this Observable, any grouped Observables that have been opened are closed, and `groupByUntil( )` will create new grouped Observables for any subsequent emissions by the source Observable.
-
+
Another variety of `groupByUntil( )` limits the number of groups that can be active at any particular time. If an item is emitted by the source Observable that would cause the number of groups to exceed this maximum, before the new group is emitted, one of the existing groups is closed (that is, the Observable it represents terminates by calling its Subscribers' `onCompleted` methods and then expires).
@@ -101,7 +101,7 @@ To represent an Observable as a Connectable Observable, use the `multicast( )`
## onErrorFlatMap( )
#### instructs an Observable to emit a sequence of items whenever it encounters an error
-
+
The `onErrorFlatMap( )` method is similar to `onErrorResumeNext( )` except that it does not assume the source Observable will correctly terminate when it issues an error. Because of this, after emitting its backup sequence of items, `onErrorFlatMap( )` relinquishes control of the emitted sequence back to the source Observable. If that Observable again issues an error, `onErrorFlatMap( )` will again emit its backup sequence.
@@ -111,13 +111,13 @@ Because `onErrorFlatMap( )` is designed to work with pathological source Obser
Note that you should apply `onErrorFlatMap( )` directly to the pathological source Observable, and not to that Observable after it has been modified by additional operators, as such operators may effectively renormalize the source Observable by unsubscribing from it immediately after it issues an error. Below, for example, is an illustration showing how `onErrorFlatMap( )` will respond to two error-generating Observables that have been merged by the `merge( )` operator. Note that it will *not* react to both errors generated by both Observables, but only to the single error passed along by `merge( )`:
-
+
***
## parallel( )
#### split the work done on the emissions from an Observable into multiple Observables each operating on its own parallel thread
-
+
The `parallel( )` method splits an Observable into as many Observables as there are available processors, and does work in parallel on each of these Observables. `parallel( )` then merges the results of these parallel computations back into a single, well-behaved Observable sequence.
@@ -127,7 +127,7 @@ streamOfItems.flatMap(item -> {
itemToObservable(item).subscribeOn(Schedulers.io());
});
```
-Kick off your work for each item inside [`flatMap`](Transforming-Observables#flatmap-concatmap-and-flatmapiterable) using [`subscribeOn`](Observable-Utility-Operators#subscribeon) to make it asynchronous, or by using a function that already makes asychronous calls.
+Kick off your work for each item inside [`flatMap`](Transforming-Observables#flatmap-concatmap-and-flatmapiterable) using [`subscribeOn`](Observable-Utility-Operators#subscribeon) to make it asynchronous, or by using a function that already makes asynchronous calls.
#### see also:
* RxJava Threading Examples by Graham Lea
@@ -136,7 +136,7 @@ Kick off your work for each item inside [`flatMap`](Transforming-Observables#fla
## parallelMerge( )
#### combine multiple Observables into a smaller number of Observables, to facilitate parallelism
-
+
Use the `parallelMerge( )` method to take an Observable that emits a large number of Observables and to reduce it to an Observable that emits a particular, smaller number of Observables that emit the same set of items as the original larger set of Observables: for instance a number of Observables that matches the number of parallel processes that you want to use when processing the emissions from the complete set of Observables.
@@ -144,7 +144,7 @@ Use the `parallelMerge( )` method to take an Observable that emits a large num
## pivot( )
#### combine multiple sets of grouped observables so that they are arranged primarily by group rather than by set
-
+
If you combine multiple sets of grouped observables, such as those created by [`groupBy( )` and `groupByUntil( )`](Transforming-Observables#wiki-groupby-and-groupbyuntil), then even if those grouped observables have been grouped by a similar differentiation function, the resulting grouping will be primarily based on which set the observable came from, not on which group the observable belonged to.
@@ -152,13 +152,13 @@ An example may make this clearer. Imagine you use `groupBy( )` to group the em
The result will be a grouped observable that emits two groups: the grouped observable resulting from transforming Observable1, and the grouped observable resulting from transforming Observable2. Each of those grouped observables emit observables that in turn emit the odds and evens from the source observables. You can use `pivot( )` to change this around: by applying `pivot( )` to this grouped observable it will transform into one that emits two different groups: the odds group and the evens group, with each of these groups emitting a separate observable corresponding to which source observable its set of integers came from. Here is an illustration:
-
+
***
## publishLast( )
#### represent an Observable as a Connectable Observable that emits only the last item emitted by the source Observable
-
+
#### see also:
* RxJS: `publishLast`
diff --git a/docs/What's-different-in-2.0.md b/docs/What's-different-in-2.0.md
index fac50df56d..edc681fa7f 100644
--- a/docs/What's-different-in-2.0.md
+++ b/docs/What's-different-in-2.0.md
@@ -450,12 +450,12 @@ Before 2.0.7, the operator `strict()` had to be applied in order to achieve the
As one of the primary goals of RxJava 2, the design focuses on performance and in order enable it, RxJava 2.0.7 adds a custom `io.reactivex.FlowableSubscriber` interface (extends `org.reactivestreams.Subscriber`) but adds no new methods to it. The new interface is **constrained to RxJava 2** and represents a consumer to `Flowable` that is able to work in a mode that relaxes the Reactive-Streams version 1.0.0 specification in rules §1.3, §2.3, §2.12 and §3.9:
- - §1.3 relaxation: `onSubscribe` may run concurrently with `onNext` in case the `FlowableSubscriber` calls `request()` from inside `onSubscribe` and it is the resposibility of `FlowableSubscriber` to ensure thread-safety between the remaining instructions in `onSubscribe` and `onNext`.
+ - §1.3 relaxation: `onSubscribe` may run concurrently with `onNext` in case the `FlowableSubscriber` calls `request()` from inside `onSubscribe` and it is the responsibility of `FlowableSubscriber` to ensure thread-safety between the remaining instructions in `onSubscribe` and `onNext`.
- §2.3 relaxation: calling `Subscription.cancel` and `Subscription.request` from `FlowableSubscriber.onComplete()` or `FlowableSubscriber.onError()` is considered a no-operation.
- §2.12 relaxation: if the same `FlowableSubscriber` instance is subscribed to multiple sources, it must ensure its `onXXX` methods remain thread safe.
- §3.9 relaxation: issuing a non-positive `request()` will not stop the current stream but signal an error via `RxJavaPlugins.onError`.
-From a user's perspective, if one was using the the `subscribe` methods other than `Flowable.subscribe(Subscriber super T>)`, there is no need to do anything regarding this change and there is no extra penalty for it.
+From a user's perspective, if one was using the `subscribe` methods other than `Flowable.subscribe(Subscriber super T>)`, there is no need to do anything regarding this change and there is no extra penalty for it.
If one was using `Flowable.subscribe(Subscriber super T>)` with the built-in RxJava `Subscriber` implementations such as `DisposableSubscriber`, `TestSubscriber` and `ResourceSubscriber`, there is a small runtime overhead (one `instanceof` check) associated when the code is not recompiled against 2.0.7.
diff --git a/docs/Writing-operators-for-2.0.md b/docs/Writing-operators-for-2.0.md
index 7b6e57666e..1a51664880 100644
--- a/docs/Writing-operators-for-2.0.md
+++ b/docs/Writing-operators-for-2.0.md
@@ -1,7 +1,7 @@
##### Table of contents
- [Introduction](#introduction)
- - [Warning on internal components](warning-on-internal-components)
+ - [Warning on internal components](#warning-on-internal-components)
- [Atomics, serialization, deferred actions](#atomics-serialization-deferred-actions)
- [Field updaters and Android](#field-updaters-and-android)
- [Request accounting](#request-accounting)
@@ -565,7 +565,7 @@ Version 2.0.7 introduced a new interface, `FlowableSubscriber` that extends `Sub
The rule relaxations are as follows:
-- §1.3 relaxation: `onSubscribe` may run concurrently with onNext in case the `FlowableSubscriber` calls `request()` from inside `onSubscribe` and it is the resposibility of `FlowableSubscriber` to ensure thread-safety between the remaining instructions in `onSubscribe` and `onNext`.
+- §1.3 relaxation: `onSubscribe` may run concurrently with onNext in case the `FlowableSubscriber` calls `request()` from inside `onSubscribe` and it is the responsibility of `FlowableSubscriber` to ensure thread-safety between the remaining instructions in `onSubscribe` and `onNext`.
- §2.3 relaxation: calling `Subscription.cancel` and `Subscription.request` from `FlowableSubscriber.onComplete()` or `FlowableSubscriber.onError()` is considered a no-operation.
- §2.12 relaxation: if the same `FlowableSubscriber` instance is subscribed to multiple sources, it must ensure its `onXXX` methods remain thread safe.
- §3.9 relaxation: issuing a non-positive `request()` will not stop the current stream but signal an error via `RxJavaPlugins.onError`.
diff --git a/docs/_Sidebar.md b/docs/_Sidebar.md
index 1fe0339407..22961acec3 100644
--- a/docs/_Sidebar.md
+++ b/docs/_Sidebar.md
@@ -21,11 +21,12 @@
* [Transformation](https://github.com/ReactiveX/RxJava/wiki/Transforming-Observables)
* [Utility](https://github.com/ReactiveX/RxJava/wiki/Observable-Utility-Operators)
* [Notable 3rd party Operators (Alphabetical List)](https://github.com/ReactiveX/RxJava/wiki/Alphabetical-List-of-3rd-party-Operators)
+ * [Operator matrix](https://github.com/ReactiveX/RxJava/wiki/Operator-Matrix)
* [Plugins](https://github.com/ReactiveX/RxJava/wiki/Plugins)
* [How to Contribute](https://github.com/ReactiveX/RxJava/wiki/How-to-Contribute)
* [Writing operators](https://github.com/ReactiveX/RxJava/wiki/Writing-operators-for-2.0)
* [Backpressure](https://github.com/ReactiveX/RxJava/wiki/Backpressure-(2.0))
* [another explanation](https://github.com/ReactiveX/RxJava/wiki/Backpressure)
-* [JavaDoc](http://reactivex.io/RxJava/2.x/javadoc)
+* JavaDoc: [1.x](http://reactivex.io/RxJava/1.x/javadoc), [2.x](http://reactivex.io/RxJava/2.x/javadoc), [3.x](http://reactivex.io/RxJava/3.x/javadoc)
* [Coming from RxJava 1](https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0)
* [Additional Reading](https://github.com/ReactiveX/RxJava/wiki/Additional-Reading)
diff --git a/docs/_Sidebar.md.md b/docs/_Sidebar.md.md
index 1fe0339407..32e201fc46 100644
--- a/docs/_Sidebar.md.md
+++ b/docs/_Sidebar.md.md
@@ -21,6 +21,7 @@
* [Transformation](https://github.com/ReactiveX/RxJava/wiki/Transforming-Observables)
* [Utility](https://github.com/ReactiveX/RxJava/wiki/Observable-Utility-Operators)
* [Notable 3rd party Operators (Alphabetical List)](https://github.com/ReactiveX/RxJava/wiki/Alphabetical-List-of-3rd-party-Operators)
+ * [Operator matrix](https://github.com/ReactiveX/RxJava/wiki/Operator-Matrix)
* [Plugins](https://github.com/ReactiveX/RxJava/wiki/Plugins)
* [How to Contribute](https://github.com/ReactiveX/RxJava/wiki/How-to-Contribute)
* [Writing operators](https://github.com/ReactiveX/RxJava/wiki/Writing-operators-for-2.0)
diff --git a/gradle.properties b/gradle.properties
index 820b2a5bc1..e685b8103a 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,2 +1,24 @@
-release.scope=patch
-release.version=3.0.0-SNAPSHOT
+group=io.reactivex.rxjava3
+version=3.0.0-SNAPSHOT
+description=RxJava: Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM.
+
+POM_ARTIFACT_ID=rxjava
+POM_NAME=RxJava
+POM_PACKAGING=jar
+
+POM_DESCRIPTION=Reactive Extensions for Java
+POM_INCEPTION_YEAR=2013
+
+POM_URL=https://github.com/ReactiveX/RxJava
+POM_SCM_URL=https://github.com/ReactiveX/RxJava
+POM_SCM_CONNECTION=scm:git:git://github.com/ReactiveX/RxJava.git
+POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/ReactiveX/RxJava.git
+
+POM_LICENCE_NAME=The Apache Software License, Version 2.0
+POM_LICENCE_URL=https://www.apache.org/licenses/LICENSE-2.0.txt
+POM_LICENCE_DIST=repo
+
+POM_DEVELOPER_ID=akarnokd
+POM_DEVELOPER_NAME=David Karnok
+POM_DEVELOPER_URL=https://github.com/akarnokd/
+POM_DEVELOPER_EMAIL=akarnokd@gmail.com
diff --git a/gradle/buildViaTravis.sh b/gradle/buildViaTravis.sh
deleted file mode 100755
index ea385c3e92..0000000000
--- a/gradle/buildViaTravis.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash
-# This script will build the project.
-
-buildTag="$TRAVIS_TAG"
-
-if [ "$buildTag" != "" ] && [ "${buildTag:0:3}" != "v3." ]; then
- echo -e "Wrong tag on the 3.x brach: $buildTag : build stopped"
- exit 1
-fi
-
-export GRADLE_OPTS=-Xmx1024m
-
-if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
- echo -e "Build Pull Request #$TRAVIS_PULL_REQUEST => Branch [$TRAVIS_BRANCH]"
- ./gradlew -PreleaseMode=pr build --stacktrace
-elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" == "" ]; then
- if [ "$TRAVIS_BRANCH" != "3.x" ]; then
- echo -e 'Build secondary Branch (no snapshot) => Branch ['$TRAVIS_BRANCH']'
- ./gradlew -PreleaseMode=pr build --stacktrace
- else
- echo -e 'Build Branch with Snapshot => Branch ['$TRAVIS_BRANCH']'
- ./gradlew -PreleaseMode=branch -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" build --stacktrace
- fi
-elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" != "" ]; then
- echo -e 'Build Branch for Release => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG']'
- ./gradlew -PreleaseMode=full -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" build --stacktrace
-else
- echo -e 'WARN: Should not be here => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG'] Pull Request ['$TRAVIS_PULL_REQUEST']'
-fi
diff --git a/gradle/javadoc_cleanup.gradle b/gradle/javadoc_cleanup.gradle
index 12216464a7..63b4f7f045 100644
--- a/gradle/javadoc_cleanup.gradle
+++ b/gradle/javadoc_cleanup.gradle
@@ -1,36 +1,74 @@
// remove the excessive whitespaces between method arguments in the javadocs
task javadocCleanup(dependsOn: "javadoc") doLast {
- fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/core/Flowable.html'));
- fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/core/Observable.html'));
- fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/core/Single.html'));
- fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/core/Maybe.html'));
- fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/core/Completable.html'));
+ fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/core/Flowable.html'))
+ fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/core/Observable.html'))
+ fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/core/Single.html'))
+ fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/core/Maybe.html'))
+ fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/core/Completable.html'))
- fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/flowables/ConnectableFlowable.html'));
- fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/observables/ConnectableObservable.html'));
+ fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/flowables/ConnectableFlowable.html'))
+ fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/observables/ConnectableObservable.html'))
- fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/subjects/ReplaySubject.html'));
- fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/processors/ReplayProcessor.html'));
- fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/plugins/RxJavaPlugins.html'));
+ fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/subjects/ReplaySubject.html'))
+ fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/processors/ReplayProcessor.html'))
+ fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/subjects/PublishSubject.html'))
+ fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/processors/PublishProcessor.html'))
+ fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/subjects/AsyncSubject.html'))
+ fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/processors/AsyncProcessor.html'))
+ fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/subjects/BehaviorSubject.html'))
+ fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/processors/BehaviorProcessor.html'))
+ fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/processors/MulticastProcessor.html'))
+ fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/subjects/UnicastSubject.html'))
+ fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/processors/UnicastProcessor.html'))
- fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/parallel/ParallelFlowable.html'));
+ fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/plugins/RxJavaPlugins.html'))
+
+ fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/parallel/ParallelFlowable.html'))
+
+ fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/disposables/Disposable.html'))
+
+ fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/observers/TestObserver.html'))
+ fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/observers/BaseTestConsumer.html'))
+ fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/subscribers/TestSubscriber.html'))
}
def fixJavadocFile(file) {
- println("Cleaning up: " + file);
+ logger.lifecycle("Cleaning up: " + file)
String fileContents = file.getText('UTF-8')
// lots of spaces after the previous method argument
- fileContents = fileContents.replaceAll(",\\s{4,}", ",\n ");
+ fileContents = fileContents.replaceAll(",\\s{4,}", ",\n ")
// lots of spaces after the @NonNull annotations
- fileContents = fileContents.replaceAll("@NonNull\\s{4,}", "@NonNull ");
+ fileContents = fileContents.replaceAll("@NonNull\\s{4,}", "@NonNull ")
// lots of spaces after the @Nullable annotations
- fileContents = fileContents.replaceAll("@Nullable\\s{4,}", "@Nullable ");
+ fileContents = fileContents.replaceAll("@Nullable\\s{4,}", "@Nullable ")
- file.setText(fileContents, 'UTF-8');
-}
+ // javadoc bug: duplicates the link to @NonNull for some reason
+ def nonNullText1 = "@NonNull "
+
+ fileContents = fileContents.replace(nonNullText1 + " " + nonNullText1, nonNullText1)
+ fileContents = fileContents.replace(nonNullText1 + "\n " + nonNullText1, nonNullText1)
+ fileContents = fileContents.replace(nonNullText1 + "\r\n " + nonNullText1, nonNullText1)
+
+ def nonNullText2 = "@NonNull "
+ fileContents = fileContents.replace(nonNullText2 + " " + nonNullText2, nonNullText2)
+ fileContents = fileContents.replace(nonNullText2 + "\n " + nonNullText2, nonNullText2)
+ fileContents = fileContents.replace(nonNullText2 + "\r\n " + nonNullText2, nonNullText2)
-javadocJar.dependsOn javadocCleanup
-build.dependsOn javadocCleanup
\ No newline at end of file
+ // javadoc bug: duplicates the link to @Nullable for some reason
+ def nullableText1 = "@Nullable "
+
+ fileContents = fileContents.replace(nullableText1 + " " + nullableText1, nullableText1)
+ fileContents = fileContents.replace(nullableText1 + "\n " + nullableText1, nullableText1)
+ fileContents = fileContents.replace(nullableText1 + "\r\n " + nullableText1, nullableText1)
+
+ def nullableText2 = "@Nullable "
+
+ fileContents = fileContents.replace(nullableText2 + " " + nullableText2, nullableText2)
+ fileContents = fileContents.replace(nullableText2 + "\n " + nullableText2, nullableText2)
+ fileContents = fileContents.replace(nullableText2 + "\r\n " + nullableText2, nullableText2)
+
+ file.setText(fileContents, 'UTF-8')
+}
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index 5c2d1cf016..afba109285 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 94920145f3..3c44eb1b6f 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
+networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
index 83f2acfdc3..65dcd68d65 100755
--- a/gradlew
+++ b/gradlew
@@ -1,7 +1,7 @@
-#!/usr/bin/env sh
+#!/bin/sh
#
-# Copyright 2015 the original author or authors.
+# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -17,78 +17,113 @@
#
##############################################################################
-##
-## Gradle start up script for UN*X
-##
+#
+# Gradle start up script for POSIX generated by Gradle.
+#
+# Important for running:
+#
+# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
+# noncompliant, but you have some other compliant shell such as ksh or
+# bash, then to run this script, type that shell name before the whole
+# command line, like:
+#
+# ksh Gradle
+#
+# Busybox and similar reduced shells will NOT work, because this script
+# requires all of these POSIX shell features:
+# * functions;
+# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
+# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
+# * compound commands having a testable exit status, especially «case»;
+# * various built-in commands including «command», «set», and «ulimit».
+#
+# Important for patching:
+#
+# (2) This script targets any POSIX shell, so it avoids extensions provided
+# by Bash, Ksh, etc; in particular arrays are avoided.
+#
+# The "traditional" practice of packing multiple parameters into a
+# space-separated string is a well documented source of bugs and security
+# problems, so this is (mostly) avoided, by progressively accumulating
+# options in "$@", and eventually passing that to Java.
+#
+# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
+# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
+# see the in-line comments for details.
+#
+# There are tweaks for specific operating systems such as AIX, CygWin,
+# Darwin, MinGW, and NonStop.
+#
+# (3) This script is generated from the Groovy template
+# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+# within the Gradle project.
+#
+# You can find Gradle at https://github.com/gradle/gradle/.
+#
##############################################################################
# Attempt to set APP_HOME
+
# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG=`dirname "$PRG"`"/$link"
- fi
+app_path=$0
+
+# Need this for daisy-chained symlinks.
+while
+ APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
+ [ -h "$app_path" ]
+do
+ ls=$( ls -ld "$app_path" )
+ link=${ls#*' -> '}
+ case $link in #(
+ /*) app_path=$link ;; #(
+ *) app_path=$APP_HOME$link ;;
+ esac
done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >/dev/null
-APP_HOME="`pwd -P`"
-cd "$SAVED" >/dev/null
-APP_NAME="Gradle"
-APP_BASE_NAME=`basename "$0"`
+# This is normally unused
+# shellcheck disable=SC2034
+APP_BASE_NAME=${0##*/}
+APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD="maximum"
+MAX_FD=maximum
warn () {
echo "$*"
-}
+} >&2
die () {
echo
echo "$*"
echo
exit 1
-}
+} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
-case "`uname`" in
- CYGWIN* )
- cygwin=true
- ;;
- Darwin* )
- darwin=true
- ;;
- MINGW* )
- msys=true
- ;;
- NONSTOP* )
- nonstop=true
- ;;
+case "$( uname )" in #(
+ CYGWIN* ) cygwin=true ;; #(
+ Darwin* ) darwin=true ;; #(
+ MSYS* | MINGW* ) msys=true ;; #(
+ NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
+ JAVACMD=$JAVA_HOME/jre/sh/java
else
- JAVACMD="$JAVA_HOME/bin/java"
+ JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@@ -97,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
- JAVACMD="java"
+ JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
@@ -105,84 +140,105 @@ location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
- MAX_FD_LIMIT=`ulimit -H -n`
- if [ $? -eq 0 ] ; then
- if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
- MAX_FD="$MAX_FD_LIMIT"
- fi
- ulimit -n $MAX_FD
- if [ $? -ne 0 ] ; then
- warn "Could not set maximum file descriptor limit: $MAX_FD"
- fi
- else
- warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
- fi
+if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
+ case $MAX_FD in #(
+ max*)
+ # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
+ # shellcheck disable=SC3045
+ MAX_FD=$( ulimit -H -n ) ||
+ warn "Could not query maximum file descriptor limit"
+ esac
+ case $MAX_FD in #(
+ '' | soft) :;; #(
+ *)
+ # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
+ # shellcheck disable=SC3045
+ ulimit -n "$MAX_FD" ||
+ warn "Could not set maximum file descriptor limit to $MAX_FD"
+ esac
fi
-# For Darwin, add options to specify how the application appears in the dock
-if $darwin; then
- GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
-fi
+# Collect all arguments for the java command, stacking in reverse order:
+# * args from the command line
+# * the main class name
+# * -classpath
+# * -D...appname settings
+# * --module-path (only if needed)
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
-if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
- APP_HOME=`cygpath --path --mixed "$APP_HOME"`
- CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
- JAVACMD=`cygpath --unix "$JAVACMD"`
-
- # We build the pattern for arguments to be converted via cygpath
- ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
- SEP=""
- for dir in $ROOTDIRSRAW ; do
- ROOTDIRS="$ROOTDIRS$SEP$dir"
- SEP="|"
- done
- OURCYGPATTERN="(^($ROOTDIRS))"
- # Add a user-defined pattern to the cygpath arguments
- if [ "$GRADLE_CYGPATTERN" != "" ] ; then
- OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
- fi
+if "$cygwin" || "$msys" ; then
+ APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
+ CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
+
+ JAVACMD=$( cygpath --unix "$JAVACMD" )
+
# Now convert the arguments - kludge to limit ourselves to /bin/sh
- i=0
- for arg in "$@" ; do
- CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
- CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
-
- if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
- eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
- else
- eval `echo args$i`="\"$arg\""
+ for arg do
+ if
+ case $arg in #(
+ -*) false ;; # don't mess with options #(
+ /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
+ [ -e "$t" ] ;; #(
+ *) false ;;
+ esac
+ then
+ arg=$( cygpath --path --ignore --mixed "$arg" )
fi
- i=$((i+1))
+ # Roll the args list around exactly as many times as the number of
+ # args, so each arg winds up back in the position where it started, but
+ # possibly modified.
+ #
+ # NB: a `for` loop captures its iteration list before it begins, so
+ # changing the positional parameters here affects neither the number of
+ # iterations, nor the values presented in `arg`.
+ shift # remove old arg
+ set -- "$@" "$arg" # push replacement arg
done
- case $i in
- (0) set -- ;;
- (1) set -- "$args0" ;;
- (2) set -- "$args0" "$args1" ;;
- (3) set -- "$args0" "$args1" "$args2" ;;
- (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
- (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
- (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
- (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
- (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
- (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
- esac
fi
-# Escape application args
-save () {
- for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
- echo " "
-}
-APP_ARGS=$(save "$@")
+# Collect all arguments for the java command;
+# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
+# shell script including quotes and variable substitutions, so put them in
+# double quotes to make sure that they get re-expanded; and
+# * put everything else in single quotes, so that it's not re-expanded.
+
+set -- \
+ "-Dorg.gradle.appname=$APP_BASE_NAME" \
+ -classpath "$CLASSPATH" \
+ org.gradle.wrapper.GradleWrapperMain \
+ "$@"
+
+# Stop when "xargs" is not available.
+if ! command -v xargs >/dev/null 2>&1
+then
+ die "xargs is not available"
+fi
-# Collect all arguments for the java command, following the shell quoting and substitution rules
-eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+# Use "xargs" to parse quoted args.
+#
+# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
+#
+# In Bash we could simply go:
+#
+# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
+# set -- "${ARGS[@]}" "$@"
+#
+# but POSIX shell has neither arrays nor command substitution, so instead we
+# post-process each arg (as a line of input to sed) to backslash-escape any
+# character that might be a shell metacharacter, then use eval to reverse
+# that process (while maintaining the separation between arguments), and wrap
+# the whole thing up as a single "set" statement.
+#
+# This will of course break if any of these variables contains a newline or
+# an unmatched quote.
+#
-# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
-if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
- cd "$(dirname "$0")"
-fi
+eval "set -- $(
+ printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
+ xargs -n1 |
+ sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
+ tr '\n' ' '
+ )" '"$@"'
exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
index 9618d8d960..93e3f59f13 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -14,7 +14,7 @@
@rem limitations under the License.
@rem
-@if "%DEBUG%" == "" @echo off
+@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@@ -25,10 +25,14 @@
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
+if "%DIRNAME%"=="" set DIRNAME=.
+@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@@ -37,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
+if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -51,7 +55,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-if exist "%JAVA_EXE%" goto init
+if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@@ -61,38 +65,26 @@ echo location of your Java installation.
goto fail
-:init
-@rem Get command-line arguments, handling Windows variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
+if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
+set EXIT_CODE=%ERRORLEVEL%
+if %EXIT_CODE% equ 0 set EXIT_CODE=1
+if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
+exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
diff --git a/gradle/push_javadoc.sh b/push_javadoc.sh
similarity index 78%
rename from gradle/push_javadoc.sh
rename to push_javadoc.sh
index c8f648258e..28ce74f1db 100644
--- a/gradle/push_javadoc.sh
+++ b/push_javadoc.sh
@@ -8,21 +8,9 @@
targetRepo=github.com/ReactiveX/RxJava.git
# =======================================================================
-# only for main pushes, for now
-if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
- echo -e "Pull request detected, skipping JavaDocs pushback."
- exit 0
-fi
-
-# only when on the 3.x branch and not tagged
-if [ "$TRAVIS_BRANCH" != "3.x" ] && [ "$TRAVIS_TAG" == "" ]; then
- echo -e "On a secondary branch '$TRAVIS_BRANCH', skipping JavaDocs pushback."
- exit 0
-fi
-
# get the current build tag if any
-buildTag="$TRAVIS_TAG"
-echo -e "Travis tag: '$buildTag'"
+buildTag="$BUILD_TAG"
+echo -e "Build tag: '$buildTag'"
if [ "$buildTag" == "" ]; then
buildTag="snapshot"
@@ -33,18 +21,18 @@ fi
echo -e "JavaDocs pushback for tag: $buildTag"
# check if the token is actually there
-if [ "$GITHUB_TOKEN" == "" ]; then
+if [ "$JAVADOCS_TOKEN" == "" ]; then
echo -e "No access to GitHub, skipping JavaDocs pushback."
exit 0
fi
# prepare the git information
-git config --global user.email "travis@travis-ci.org"
-git config --global user.name "Travis CI"
+git config --global user.email "akarnokd+ci@gmail.com"
+git config --global user.name "akarnokd+ci"
# setup the remote
echo -e "Adding the target repository to git"
-git remote add origin-pages https://${GITHUB_TOKEN}@${targetRepo} > /dev/null 2>&1
+git remote add origin-pages https://${JAVADOCS_TOKEN}@${targetRepo} > /dev/null 2>&1
# stash changes due to chmod
echo -e "Stashing any local non-ignored changes"
@@ -119,8 +107,8 @@ echo -e "Removing deleted files"
git add -u
# commit all
-echo -e "commit Travis build: $TRAVIS_BUILD_NUMBER for $buildTag"
-git commit --message "Travis build: $TRAVIS_BUILD_NUMBER for $buildTag"
+echo -e "commit CI build: $CI_BUILD_NUMBER for $buildTag"
+git commit --message "CI build: $CI_BUILD_NUMBER for $buildTag"
# debug file list
#find -name "*.html"
diff --git a/src/jmh/java/io/reactivex/rxjava3/core/BinaryFlatMapPerf.java b/src/jmh/java/io/reactivex/rxjava3/core/BinaryFlatMapPerf.java
index 6d5bb44b23..6e6ae7e3c6 100644
--- a/src/jmh/java/io/reactivex/rxjava3/core/BinaryFlatMapPerf.java
+++ b/src/jmh/java/io/reactivex/rxjava3/core/BinaryFlatMapPerf.java
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
@@ -86,48 +86,42 @@ public void setup() {
singleFlatMapPublisher = Single.just(1).flatMapPublisher(new Function>() {
@Override
- public Publisher extends Integer> apply(Integer v)
- throws Exception {
+ public Publisher extends Integer> apply(Integer v) {
return arrayFlowable;
}
});
singleFlatMapHidePublisher = Single.just(1).flatMapPublisher(new Function>() {
@Override
- public Publisher extends Integer> apply(Integer v)
- throws Exception {
+ public Publisher extends Integer> apply(Integer v) {
return arrayFlowableHide;
}
});
singleFlattenAsPublisher = Single.just(1).flattenAsFlowable(new Function>() {
@Override
- public Iterable extends Integer> apply(Integer v)
- throws Exception {
+ public Iterable extends Integer> apply(Integer v) {
return list;
}
});
maybeFlatMapPublisher = Maybe.just(1).flatMapPublisher(new Function>() {
@Override
- public Publisher extends Integer> apply(Integer v)
- throws Exception {
+ public Publisher extends Integer> apply(Integer v) {
return arrayFlowable;
}
});
maybeFlatMapHidePublisher = Maybe.just(1).flatMapPublisher(new Function>() {
@Override
- public Publisher extends Integer> apply(Integer v)
- throws Exception {
+ public Publisher extends Integer> apply(Integer v) {
return arrayFlowableHide;
}
});
maybeFlattenAsPublisher = Maybe.just(1).flattenAsFlowable(new Function>() {
@Override
- public Iterable extends Integer> apply(Integer v)
- throws Exception {
+ public Iterable extends Integer> apply(Integer v) {
return list;
}
});
@@ -140,48 +134,42 @@ public Iterable extends Integer> apply(Integer v)
singleFlatMapObservable = Single.just(1).flatMapObservable(new Function>() {
@Override
- public Observable extends Integer> apply(Integer v)
- throws Exception {
+ public Observable extends Integer> apply(Integer v) {
return arrayObservable;
}
});
- singleFlatMapHideObservable = Single.just(1).flatMapObservable(new Function>() {
+ singleFlatMapHideObservable = Single.just(1).flatMapObservable(new Function>() {
@Override
- public Observable extends Integer> apply(Integer v)
- throws Exception {
+ public Observable apply(Integer v) {
return arrayObservableHide;
}
});
singleFlattenAsObservable = Single.just(1).flattenAsObservable(new Function>() {
@Override
- public Iterable extends Integer> apply(Integer v)
- throws Exception {
+ public Iterable extends Integer> apply(Integer v) {
return list;
}
});
- maybeFlatMapObservable = Maybe.just(1).flatMapObservable(new Function>() {
+ maybeFlatMapObservable = Maybe.just(1).flatMapObservable(new Function>() {
@Override
- public Observable extends Integer> apply(Integer v)
- throws Exception {
+ public Observable apply(Integer v) {
return arrayObservable;
}
});
- maybeFlatMapHideObservable = Maybe.just(1).flatMapObservable(new Function>() {
+ maybeFlatMapHideObservable = Maybe.just(1).flatMapObservable(new Function>() {
@Override
- public Observable extends Integer> apply(Integer v)
- throws Exception {
+ public Observable apply(Integer v) {
return arrayObservableHide;
}
});
maybeFlattenAsObservable = Maybe.just(1).flattenAsObservable(new Function>() {
@Override
- public Iterable extends Integer> apply(Integer v)
- throws Exception {
+ public Iterable extends Integer> apply(Integer v) {
return list;
}
});
diff --git a/src/jmh/java/io/reactivex/rxjava3/core/BlockingGetPerf.java b/src/jmh/java/io/reactivex/rxjava3/core/BlockingGetPerf.java
index f40a8ca55b..7f3711788a 100644
--- a/src/jmh/java/io/reactivex/rxjava3/core/BlockingGetPerf.java
+++ b/src/jmh/java/io/reactivex/rxjava3/core/BlockingGetPerf.java
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
diff --git a/src/jmh/java/io/reactivex/rxjava3/core/BlockingPerf.java b/src/jmh/java/io/reactivex/rxjava3/core/BlockingPerf.java
index 020befc21a..5fb2825b3e 100644
--- a/src/jmh/java/io/reactivex/rxjava3/core/BlockingPerf.java
+++ b/src/jmh/java/io/reactivex/rxjava3/core/BlockingPerf.java
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
diff --git a/src/jmh/java/io/reactivex/rxjava3/core/CallableAsyncPerf.java b/src/jmh/java/io/reactivex/rxjava3/core/CallableAsyncPerf.java
index 4afa54ecc8..1bae28f9f9 100644
--- a/src/jmh/java/io/reactivex/rxjava3/core/CallableAsyncPerf.java
+++ b/src/jmh/java/io/reactivex/rxjava3/core/CallableAsyncPerf.java
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
@@ -68,7 +68,7 @@ public void setup() {
Callable c = new Callable() {
@Override
- public Integer call() throws Exception {
+ public Integer call() {
return 1;
}
};
@@ -120,71 +120,71 @@ public void subscribeOnFlowable(Blackhole bh) {
@Benchmark
public void observeOnFlowable(Blackhole bh) {
observeOnFlowable.subscribeWith(new PerfAsyncConsumer(bh)).await(1);
- };
+ }
@Benchmark
public void pipelineFlowable(Blackhole bh) {
pipelineFlowable.subscribeWith(new PerfAsyncConsumer(bh)).await(1);
- };
+ }
@Benchmark
public void subscribeOnObservable(Blackhole bh) {
subscribeOnObservable.subscribeWith(new PerfAsyncConsumer(bh)).await(1);
- };
+ }
@Benchmark
public void observeOnObservable(Blackhole bh) {
observeOnObservable.subscribeWith(new PerfAsyncConsumer(bh)).await(1);
- };
+ }
@Benchmark
public void pipelineObservable(Blackhole bh) {
pipelineObservable.subscribeWith(new PerfAsyncConsumer(bh)).await(1);
- };
+ }
@Benchmark
public void observeOnSingle(Blackhole bh) {
observeOnSingle.subscribeWith(new PerfAsyncConsumer(bh)).await(1);
- };
+ }
@Benchmark
public void subscribeOnSingle(Blackhole bh) {
subscribeOnSingle.subscribeWith(new PerfAsyncConsumer(bh)).await(1);
- };
+ }
@Benchmark
public void pipelineSingle(Blackhole bh) {
pipelineSingle.subscribeWith(new PerfAsyncConsumer(bh)).await(1);
- };
+ }
@Benchmark
public void observeOnCompletable(Blackhole bh) {
observeOnCompletable.subscribeWith(new PerfAsyncConsumer(bh)).await(1);
- };
+ }
@Benchmark
public void subscribeOnCompletable(Blackhole bh) {
subscribeOnCompletable.subscribeWith(new PerfAsyncConsumer(bh)).await(1);
- };
+ }
@Benchmark
public void pipelineCompletable(Blackhole bh) {
pipelineCompletable.subscribeWith(new PerfAsyncConsumer(bh)).await(1);
- };
+ }
@Benchmark
public void observeOnMaybe(Blackhole bh) {
observeOnMaybe.subscribeWith(new PerfAsyncConsumer(bh)).await(1);
- };
+ }
@Benchmark
public void subscribeOnMaybe(Blackhole bh) {
subscribeOnMaybe.subscribeWith(new PerfAsyncConsumer(bh)).await(1);
- };
+ }
@Benchmark
public void pipelineMaybe(Blackhole bh) {
pipelineMaybe.subscribeWith(new PerfAsyncConsumer(bh)).await(1);
- };
+ }
}
diff --git a/src/jmh/java/io/reactivex/rxjava3/core/EachTypeFlatMapPerf.java b/src/jmh/java/io/reactivex/rxjava3/core/EachTypeFlatMapPerf.java
index e05921c531..14aa8c3605 100644
--- a/src/jmh/java/io/reactivex/rxjava3/core/EachTypeFlatMapPerf.java
+++ b/src/jmh/java/io/reactivex/rxjava3/core/EachTypeFlatMapPerf.java
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
@@ -114,11 +114,11 @@ public void nbpRangeMapRange(Blackhole bh) {
@Benchmark
public void singleJust(Blackhole bh) {
- singleJust.subscribe(new LatchedSingleObserver(bh));
+ singleJust.subscribe(new LatchedSingleObserver<>(bh));
}
@Benchmark
public void singleJustMapJust(Blackhole bh) {
- singleJustMapJust.subscribe(new LatchedSingleObserver(bh));
+ singleJustMapJust.subscribe(new LatchedSingleObserver<>(bh));
}
}
diff --git a/src/jmh/java/io/reactivex/rxjava3/core/FlatMapJustPerf.java b/src/jmh/java/io/reactivex/rxjava3/core/FlatMapJustPerf.java
index 8541f92834..597fae480d 100644
--- a/src/jmh/java/io/reactivex/rxjava3/core/FlatMapJustPerf.java
+++ b/src/jmh/java/io/reactivex/rxjava3/core/FlatMapJustPerf.java
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
@@ -41,14 +41,14 @@ public void setup() {
flowable = Flowable.fromArray(array).flatMap(new Function>() {
@Override
- public Publisher apply(Integer v) throws Exception {
+ public Publisher apply(Integer v) {
return Flowable.just(v);
}
});
observable = Observable.fromArray(array).flatMap(new Function>() {
@Override
- public Observable apply(Integer v) throws Exception {
+ public Observable apply(Integer v) {
return Observable.just(v);
}
});
diff --git a/src/jmh/java/io/reactivex/rxjava3/core/FlattenCrossMapPerf.java b/src/jmh/java/io/reactivex/rxjava3/core/FlattenCrossMapPerf.java
index cfc5a1af97..c5d516423f 100644
--- a/src/jmh/java/io/reactivex/rxjava3/core/FlattenCrossMapPerf.java
+++ b/src/jmh/java/io/reactivex/rxjava3/core/FlattenCrossMapPerf.java
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
@@ -47,14 +47,14 @@ public void setup() {
flowable = Flowable.fromArray(array).flatMapIterable(new Function>() {
@Override
- public Iterable apply(Integer v) throws Exception {
+ public Iterable apply(Integer v) {
return list;
}
});
observable = Observable.fromArray(array).flatMapIterable(new Function>() {
@Override
- public Iterable apply(Integer v) throws Exception {
+ public Iterable apply(Integer v) {
return list;
}
});
diff --git a/src/jmh/java/io/reactivex/rxjava3/core/FlattenJustPerf.java b/src/jmh/java/io/reactivex/rxjava3/core/FlattenJustPerf.java
index bb2394a053..3bb1ad1473 100644
--- a/src/jmh/java/io/reactivex/rxjava3/core/FlattenJustPerf.java
+++ b/src/jmh/java/io/reactivex/rxjava3/core/FlattenJustPerf.java
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
@@ -44,14 +44,14 @@ public void setup() {
flowable = Flowable.fromArray(array).flatMapIterable(new Function>() {
@Override
- public Iterable apply(Integer v) throws Exception {
+ public Iterable apply(Integer v) {
return singletonList;
}
});
observable = Observable.fromArray(array).flatMapIterable(new Function>() {
@Override
- public Iterable apply(Integer v) throws Exception {
+ public Iterable apply(Integer v) {
return singletonList;
}
});
diff --git a/src/jmh/java/io/reactivex/rxjava3/core/FlattenRangePerf.java b/src/jmh/java/io/reactivex/rxjava3/core/FlattenRangePerf.java
index 663fd8cdde..0339f345c3 100644
--- a/src/jmh/java/io/reactivex/rxjava3/core/FlattenRangePerf.java
+++ b/src/jmh/java/io/reactivex/rxjava3/core/FlattenRangePerf.java
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
@@ -44,14 +44,14 @@ public void setup() {
flowable = Flowable.fromArray(array).flatMapIterable(new Function>() {
@Override
- public Iterable apply(Integer v) throws Exception {
+ public Iterable apply(Integer v) {
return list;
}
});
observable = Observable.fromArray(array).flatMapIterable(new Function>() {
@Override
- public Iterable apply(Integer v) throws Exception {
+ public Iterable apply(Integer v) {
return list;
}
});
diff --git a/src/jmh/java/io/reactivex/rxjava3/core/FlowableFlatMapCompletableAsyncPerf.java b/src/jmh/java/io/reactivex/rxjava3/core/FlowableFlatMapCompletableAsyncPerf.java
index 83f2d4c4f4..0ebb2d4458 100644
--- a/src/jmh/java/io/reactivex/rxjava3/core/FlowableFlatMapCompletableAsyncPerf.java
+++ b/src/jmh/java/io/reactivex/rxjava3/core/FlowableFlatMapCompletableAsyncPerf.java
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
@@ -45,7 +45,7 @@ public class FlowableFlatMapCompletableAsyncPerf implements Action {
Flowable flatMap;
@Override
- public void run() throws Exception {
+ public void run() {
Blackhole.consumeCPU(work);
}
diff --git a/src/jmh/java/io/reactivex/rxjava3/core/FlowableFlatMapCompletableSyncPerf.java b/src/jmh/java/io/reactivex/rxjava3/core/FlowableFlatMapCompletableSyncPerf.java
index 34f53a954a..400e0609a8 100644
--- a/src/jmh/java/io/reactivex/rxjava3/core/FlowableFlatMapCompletableSyncPerf.java
+++ b/src/jmh/java/io/reactivex/rxjava3/core/FlowableFlatMapCompletableSyncPerf.java
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
diff --git a/src/jmh/java/io/reactivex/rxjava3/core/InputWithIncrementingInteger.java b/src/jmh/java/io/reactivex/rxjava3/core/InputWithIncrementingInteger.java
index 24c4e016d3..44d109fb4d 100644
--- a/src/jmh/java/io/reactivex/rxjava3/core/InputWithIncrementingInteger.java
+++ b/src/jmh/java/io/reactivex/rxjava3/core/InputWithIncrementingInteger.java
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
@@ -43,7 +43,7 @@ public void onNext(Integer t) {
}
}
- final class IncrementingIterable implements Iterable {
+ static final class IncrementingIterable implements Iterable {
final class IncrementingIterator implements Iterator {
int i;
@@ -77,7 +77,7 @@ public Iterator iterator() {
}
}
- final class IncrementingPublisher implements Publisher {
+ static final class IncrementingPublisher implements Publisher {
final int size;
diff --git a/src/jmh/java/io/reactivex/rxjava3/core/JustAsyncPerf.java b/src/jmh/java/io/reactivex/rxjava3/core/JustAsyncPerf.java
index d22c1699e5..6906470aea 100644
--- a/src/jmh/java/io/reactivex/rxjava3/core/JustAsyncPerf.java
+++ b/src/jmh/java/io/reactivex/rxjava3/core/JustAsyncPerf.java
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
@@ -113,71 +113,71 @@ public void subscribeOnFlowable(Blackhole bh) {
@Benchmark
public void observeOnFlowable(Blackhole bh) {
observeOnFlowable.subscribeWith(new PerfAsyncConsumer(bh)).await(1);
- };
+ }
@Benchmark
public void pipelineFlowable(Blackhole bh) {
pipelineFlowable.subscribeWith(new PerfAsyncConsumer(bh)).await(1);
- };
+ }
@Benchmark
public void subscribeOnObservable(Blackhole bh) {
subscribeOnObservable.subscribeWith(new PerfAsyncConsumer(bh)).await(1);
- };
+ }
@Benchmark
public void observeOnObservable(Blackhole bh) {
observeOnObservable.subscribeWith(new PerfAsyncConsumer(bh)).await(1);
- };
+ }
@Benchmark
public void pipelineObservable(Blackhole bh) {
pipelineObservable.subscribeWith(new PerfAsyncConsumer(bh)).await(1);
- };
+ }
@Benchmark
public void observeOnSingle(Blackhole bh) {
observeOnSingle.subscribeWith(new PerfAsyncConsumer(bh)).await(1);
- };
+ }
@Benchmark
public void subscribeOnSingle(Blackhole bh) {
subscribeOnSingle.subscribeWith(new PerfAsyncConsumer(bh)).await(1);
- };
+ }
@Benchmark
public void pipelineSingle(Blackhole bh) {
pipelineSingle.subscribeWith(new PerfAsyncConsumer(bh)).await(1);
- };
+ }
@Benchmark
public void observeOnCompletable(Blackhole bh) {
observeOnCompletable.subscribeWith(new PerfAsyncConsumer(bh)).await(1);
- };
+ }
@Benchmark
public void subscribeOnCompletable(Blackhole bh) {
subscribeOnCompletable.subscribeWith(new PerfAsyncConsumer(bh)).await(1);
- };
+ }
@Benchmark
public void pipelineCompletable(Blackhole bh) {
pipelineCompletable.subscribeWith(new PerfAsyncConsumer(bh)).await(1);
- };
+ }
@Benchmark
public void observeOnMaybe(Blackhole bh) {
observeOnMaybe.subscribeWith(new PerfAsyncConsumer(bh)).await(1);
- };
+ }
@Benchmark
public void subscribeOnMaybe(Blackhole bh) {
subscribeOnMaybe.subscribeWith(new PerfAsyncConsumer(bh)).await(1);
- };
+ }
@Benchmark
public void pipelineMaybe(Blackhole bh) {
pipelineMaybe.subscribeWith(new PerfAsyncConsumer(bh)).await(1);
- };
+ }
}
diff --git a/src/jmh/java/io/reactivex/rxjava3/core/LatchedSingleObserver.java b/src/jmh/java/io/reactivex/rxjava3/core/LatchedSingleObserver.java
index 1b908ac6b2..6bcdba465e 100644
--- a/src/jmh/java/io/reactivex/rxjava3/core/LatchedSingleObserver.java
+++ b/src/jmh/java/io/reactivex/rxjava3/core/LatchedSingleObserver.java
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
diff --git a/src/jmh/java/io/reactivex/rxjava3/core/MemoryPerf.java b/src/jmh/java/io/reactivex/rxjava3/core/MemoryPerf.java
index 7679ec5346..7cd45de74e 100644
--- a/src/jmh/java/io/reactivex/rxjava3/core/MemoryPerf.java
+++ b/src/jmh/java/io/reactivex/rxjava3/core/MemoryPerf.java
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
@@ -143,31 +143,31 @@ public static void main(String[] args) throws Exception {
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.core.Observable.just(1);
}
}, "just", "Rx2Observable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.core.Observable.range(1, 10);
}
}, "range", "Rx2Observable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.core.Observable.empty();
}
}, "empty", "Rx2Observable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.core.Observable.fromCallable(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return 1;
}
});
@@ -176,38 +176,38 @@ public Object call() throws Exception {
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return new MyRx2Observer();
}
}, "consumer", "Rx2Observable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
- return new io.reactivex.rxjava3.observers.TestObserver();
+ public Object call() {
+ return new io.reactivex.rxjava3.observers.TestObserver<>();
}
}, "test-consumer", "Rx2Observable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.core.Observable.just(1).subscribeWith(new MyRx2Observer());
}
}, "just+consumer", "Rx2Observable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.core.Observable.range(1, 10).subscribeWith(new MyRx2Observer());
}
}, "range+consumer", "Rx2Observable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.core.Observable.range(1, 10).map(new Function() {
@Override
- public Object apply(Integer v) throws Exception {
+ public Object apply(Integer v) {
return v;
}
}).subscribeWith(new MyRx2Observer());
@@ -216,15 +216,15 @@ public Object apply(Integer v) throws Exception {
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.core.Observable.range(1, 10).map(new Function() {
@Override
- public Object apply(Integer v) throws Exception {
+ public Object apply(Integer v) {
return v;
}
}).filter(new Predicate() {
@Override
- public boolean test(Object v) throws Exception {
+ public boolean test(Object v) {
return true;
}
}).subscribeWith(new MyRx2Observer());
@@ -233,91 +233,91 @@ public boolean test(Object v) throws Exception {
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.core.Observable.range(1, 10).subscribeOn(io.reactivex.rxjava3.schedulers.Schedulers.computation()).subscribeWith(new MyRx2Observer());
}
}, "range+subscribeOn+consumer", "Rx2Observable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.core.Observable.range(1, 10).observeOn(io.reactivex.rxjava3.schedulers.Schedulers.computation()).subscribeWith(new MyRx2Observer());
}
}, "range+observeOn+consumer", "Rx2Observable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.core.Observable.range(1, 10).subscribeOn(io.reactivex.rxjava3.schedulers.Schedulers.computation()).observeOn(io.reactivex.rxjava3.schedulers.Schedulers.computation()).subscribeWith(new MyRx2Observer());
}
}, "range+subscribeOn+observeOn+consumer", "Rx2Observable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.subjects.AsyncSubject.create();
}
}, "Async", "Rx2Observable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.subjects.PublishSubject.create();
}
}, "Publish", "Rx2Observable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.subjects.ReplaySubject.create();
}
}, "Replay", "Rx2Observable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.subjects.BehaviorSubject.create();
}
}, "Behavior", "Rx2Observable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.subjects.UnicastSubject.create();
}
}, "Unicast", "Rx2Observable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.subjects.AsyncSubject.create().subscribeWith(new MyRx2Observer());
}
}, "Async+consumer", "Rx2Observable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.subjects.PublishSubject.create().subscribeWith(new MyRx2Observer());
}
}, "Publish+consumer", "Rx2Observable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.subjects.ReplaySubject.create().subscribeWith(new MyRx2Observer());
}
}, "Replay+consumer", "Rx2Observable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.subjects.BehaviorSubject.create().subscribeWith(new MyRx2Observer());
}
}, "Behavior+consumer", "Rx2Observable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.subjects.UnicastSubject.create().subscribeWith(new MyRx2Observer());
}
}, "Unicast+consumer", "Rx2Observable");
@@ -326,38 +326,38 @@ public Object call() throws Exception {
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.core.Flowable.just(1);
}
}, "just", "Rx2Flowable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.core.Flowable.range(1, 10);
}
}, "range", "Rx2Flowable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.core.Flowable.empty();
}
}, "empty", "Rx2Flowable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.core.Flowable.empty();
}
}, "empty", "Rx2Flowable", 10000000);
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.core.Flowable.fromCallable(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return 1;
}
});
@@ -366,38 +366,38 @@ public Object call() throws Exception {
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return new MyRx2Subscriber();
}
}, "consumer", "Rx2Flowable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
- return new io.reactivex.rxjava3.observers.TestObserver();
+ public Object call() {
+ return new io.reactivex.rxjava3.observers.TestObserver<>();
}
}, "test-consumer", "Rx2Flowable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.core.Flowable.just(1).subscribeWith(new MyRx2Subscriber());
}
}, "just+consumer", "Rx2Flowable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.core.Flowable.range(1, 10).subscribeWith(new MyRx2Subscriber());
}
}, "range+consumer", "Rx2Flowable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.core.Flowable.range(1, 10).map(new Function() {
@Override
- public Object apply(Integer v) throws Exception {
+ public Object apply(Integer v) {
return v;
}
}).subscribeWith(new MyRx2Subscriber());
@@ -406,15 +406,15 @@ public Object apply(Integer v) throws Exception {
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.core.Flowable.range(1, 10).map(new Function() {
@Override
- public Object apply(Integer v) throws Exception {
+ public Object apply(Integer v) {
return v;
}
}).filter(new Predicate() {
@Override
- public boolean test(Object v) throws Exception {
+ public boolean test(Object v) {
return true;
}
}).subscribeWith(new MyRx2Subscriber());
@@ -423,91 +423,91 @@ public boolean test(Object v) throws Exception {
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.core.Flowable.range(1, 10).subscribeOn(io.reactivex.rxjava3.schedulers.Schedulers.computation()).subscribeWith(new MyRx2Subscriber());
}
}, "range+subscribeOn+consumer", "Rx2Flowable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.core.Flowable.range(1, 10).observeOn(io.reactivex.rxjava3.schedulers.Schedulers.computation()).subscribeWith(new MyRx2Subscriber());
}
}, "range+observeOn+consumer", "Rx2Flowable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.core.Flowable.range(1, 10).subscribeOn(io.reactivex.rxjava3.schedulers.Schedulers.computation()).observeOn(io.reactivex.rxjava3.schedulers.Schedulers.computation()).subscribeWith(new MyRx2Subscriber());
}
}, "range+subscribeOn+observeOn+consumer", "Rx2Flowable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.processors.AsyncProcessor.create();
}
}, "Async", "Rx2Flowable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.processors.PublishProcessor.create();
}
}, "Publish", "Rx2Flowable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.processors.ReplayProcessor.create();
}
}, "Replay", "Rx2Flowable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.processors.BehaviorProcessor.create();
}
}, "Behavior", "Rx2Flowable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.processors.UnicastProcessor.create();
}
}, "Unicast", "Rx2Flowable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.processors.AsyncProcessor.create().subscribeWith(new MyRx2Subscriber());
}
}, "Async+consumer", "Rx2Flowable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.processors.PublishProcessor.create().subscribeWith(new MyRx2Subscriber());
}
}, "Publish+consumer", "Rx2Flowable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.processors.ReplayProcessor.create().subscribeWith(new MyRx2Subscriber());
}
}, "Replay+consumer", "Rx2Flowable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.processors.BehaviorProcessor.create().subscribeWith(new MyRx2Subscriber());
}
}, "Behavior+consumer", "Rx2Flowable");
checkMemory(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
return io.reactivex.rxjava3.processors.UnicastProcessor.create().subscribeWith(new MyRx2Subscriber());
}
}, "Unicast+consumer", "Rx2Flowable");
diff --git a/src/jmh/java/io/reactivex/rxjava3/core/ObservableFlatMapPerf.java b/src/jmh/java/io/reactivex/rxjava3/core/ObservableFlatMapPerf.java
index d0d75e78d4..65145b07b4 100644
--- a/src/jmh/java/io/reactivex/rxjava3/core/ObservableFlatMapPerf.java
+++ b/src/jmh/java/io/reactivex/rxjava3/core/ObservableFlatMapPerf.java
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
diff --git a/src/jmh/java/io/reactivex/rxjava3/core/OperatorFlatMapPerf.java b/src/jmh/java/io/reactivex/rxjava3/core/OperatorFlatMapPerf.java
index 621894bd74..777fc9e1a6 100644
--- a/src/jmh/java/io/reactivex/rxjava3/core/OperatorFlatMapPerf.java
+++ b/src/jmh/java/io/reactivex/rxjava3/core/OperatorFlatMapPerf.java
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
@@ -40,7 +40,7 @@ public int getSize() {
}
@Benchmark
- public void flatMapIntPassthruSync(Input input) throws InterruptedException {
+ public void flatMapIntPassthruSync(Input input) {
input.flowable.flatMap(new Function>() {
@Override
public Publisher apply(Integer v) {
@@ -66,7 +66,7 @@ public Publisher apply(Integer i) {
}
@Benchmark
- public void flatMapTwoNestedSync(final Input input) throws InterruptedException {
+ public void flatMapTwoNestedSync(final Input input) {
Flowable.range(1, 2).flatMap(new Function>() {
@Override
public Publisher apply(Integer i) {
diff --git a/src/jmh/java/io/reactivex/rxjava3/core/OperatorMergePerf.java b/src/jmh/java/io/reactivex/rxjava3/core/OperatorMergePerf.java
index 7d68316c83..24605fc02a 100644
--- a/src/jmh/java/io/reactivex/rxjava3/core/OperatorMergePerf.java
+++ b/src/jmh/java/io/reactivex/rxjava3/core/OperatorMergePerf.java
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
@@ -134,7 +134,7 @@ public static class InputForMergeN {
@Setup
public void setup(final Blackhole bh) {
this.bh = bh;
- observables = new ArrayList>();
+ observables = new ArrayList<>();
for (int i = 0; i < size; i++) {
observables.add(Flowable.just(i));
}
diff --git a/src/jmh/java/io/reactivex/rxjava3/core/PerfAsyncConsumer.java b/src/jmh/java/io/reactivex/rxjava3/core/PerfAsyncConsumer.java
index 7c222fddab..ccaaf75573 100644
--- a/src/jmh/java/io/reactivex/rxjava3/core/PerfAsyncConsumer.java
+++ b/src/jmh/java/io/reactivex/rxjava3/core/PerfAsyncConsumer.java
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
diff --git a/src/jmh/java/io/reactivex/rxjava3/core/PerfBoundedSubscriber.java b/src/jmh/java/io/reactivex/rxjava3/core/PerfBoundedSubscriber.java
index 8ec19a833a..68083976be 100644
--- a/src/jmh/java/io/reactivex/rxjava3/core/PerfBoundedSubscriber.java
+++ b/src/jmh/java/io/reactivex/rxjava3/core/PerfBoundedSubscriber.java
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
diff --git a/src/jmh/java/io/reactivex/rxjava3/core/PerfConsumer.java b/src/jmh/java/io/reactivex/rxjava3/core/PerfConsumer.java
index 6025438218..60f93f089a 100644
--- a/src/jmh/java/io/reactivex/rxjava3/core/PerfConsumer.java
+++ b/src/jmh/java/io/reactivex/rxjava3/core/PerfConsumer.java
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
diff --git a/src/jmh/java/io/reactivex/rxjava3/core/PerfInteropConsumer.java b/src/jmh/java/io/reactivex/rxjava3/core/PerfInteropConsumer.java
index 6dfbac7a31..fc7f0b04b0 100644
--- a/src/jmh/java/io/reactivex/rxjava3/core/PerfInteropConsumer.java
+++ b/src/jmh/java/io/reactivex/rxjava3/core/PerfInteropConsumer.java
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
diff --git a/src/jmh/java/io/reactivex/rxjava3/core/PerfObserver.java b/src/jmh/java/io/reactivex/rxjava3/core/PerfObserver.java
index 5f09b97ffe..a62a1e68f6 100644
--- a/src/jmh/java/io/reactivex/rxjava3/core/PerfObserver.java
+++ b/src/jmh/java/io/reactivex/rxjava3/core/PerfObserver.java
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
diff --git a/src/jmh/java/io/reactivex/rxjava3/core/PerfSubscriber.java b/src/jmh/java/io/reactivex/rxjava3/core/PerfSubscriber.java
index e4c52b5040..8c0f30cffa 100644
--- a/src/jmh/java/io/reactivex/rxjava3/core/PerfSubscriber.java
+++ b/src/jmh/java/io/reactivex/rxjava3/core/PerfSubscriber.java
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
@@ -20,7 +20,7 @@
public class PerfSubscriber implements FlowableSubscriber {
- public CountDownLatch latch = new CountDownLatch(1);
+ public final CountDownLatch latch = new CountDownLatch(1);
private final Blackhole bh;
public PerfSubscriber(Blackhole bh) {
diff --git a/src/jmh/java/io/reactivex/rxjava3/core/PublishProcessorPerf.java b/src/jmh/java/io/reactivex/rxjava3/core/PublishProcessorPerf.java
index c64e1f794d..1278bfd641 100644
--- a/src/jmh/java/io/reactivex/rxjava3/core/PublishProcessorPerf.java
+++ b/src/jmh/java/io/reactivex/rxjava3/core/PublishProcessorPerf.java
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
diff --git a/src/jmh/java/io/reactivex/rxjava3/core/RangePerf.java b/src/jmh/java/io/reactivex/rxjava3/core/RangePerf.java
index c9723b086d..0773cd4f72 100644
--- a/src/jmh/java/io/reactivex/rxjava3/core/RangePerf.java
+++ b/src/jmh/java/io/reactivex/rxjava3/core/RangePerf.java
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
diff --git a/src/jmh/java/io/reactivex/rxjava3/core/ReducePerf.java b/src/jmh/java/io/reactivex/rxjava3/core/ReducePerf.java
index 0282aa31e5..3d2bb476c8 100644
--- a/src/jmh/java/io/reactivex/rxjava3/core/ReducePerf.java
+++ b/src/jmh/java/io/reactivex/rxjava3/core/ReducePerf.java
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
@@ -40,7 +40,7 @@ public class ReducePerf implements BiFunction {
Maybe flowMaybe;
@Override
- public Integer apply(Integer t1, Integer t2) throws Exception {
+ public Integer apply(Integer t1, Integer t2) {
return t1 + t2;
}
diff --git a/src/jmh/java/io/reactivex/rxjava3/core/RxVsStreamPerf.java b/src/jmh/java/io/reactivex/rxjava3/core/RxVsStreamPerf.java
index 74c8952c7a..8861a6cdf5 100644
--- a/src/jmh/java/io/reactivex/rxjava3/core/RxVsStreamPerf.java
+++ b/src/jmh/java/io/reactivex/rxjava3/core/RxVsStreamPerf.java
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
diff --git a/src/jmh/java/io/reactivex/rxjava3/core/StrictPerf.java b/src/jmh/java/io/reactivex/rxjava3/core/StrictPerf.java
index 59d17f4d60..23315ef617 100644
--- a/src/jmh/java/io/reactivex/rxjava3/core/StrictPerf.java
+++ b/src/jmh/java/io/reactivex/rxjava3/core/StrictPerf.java
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
diff --git a/src/jmh/java/io/reactivex/rxjava3/core/TakeUntilPerf.java b/src/jmh/java/io/reactivex/rxjava3/core/TakeUntilPerf.java
index 71161b32d3..a6a3949605 100644
--- a/src/jmh/java/io/reactivex/rxjava3/core/TakeUntilPerf.java
+++ b/src/jmh/java/io/reactivex/rxjava3/core/TakeUntilPerf.java
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
@@ -39,7 +39,7 @@ public class TakeUntilPerf implements Consumer {
Observable observable;
@Override
- public void accept(Integer t) throws Exception {
+ public void accept(Integer t) {
items++;
}
@@ -48,7 +48,7 @@ public void setup() {
flowable = Flowable.range(1, 1000 * 1000).takeUntil(Flowable.fromCallable(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
int c = count;
while (items < c) { }
return 1;
@@ -57,7 +57,7 @@ public Object call() throws Exception {
observable = Observable.range(1, 1000 * 1000).takeUntil(Observable.fromCallable(new Callable() {
@Override
- public Object call() throws Exception {
+ public Object call() {
int c = count;
while (items < c) { }
return 1;
@@ -71,7 +71,7 @@ public void flowable() {
flowable.subscribe(this, Functions.emptyConsumer(), new Action() {
@Override
- public void run() throws Exception {
+ public void run() {
cdl.countDown();
}
});
@@ -85,7 +85,7 @@ public void observable() {
observable.subscribe(this, Functions.emptyConsumer(), new Action() {
@Override
- public void run() throws Exception {
+ public void run() {
cdl.countDown();
}
});
diff --git a/src/jmh/java/io/reactivex/rxjava3/core/ToFlowablePerf.java b/src/jmh/java/io/reactivex/rxjava3/core/ToFlowablePerf.java
index 28b1d050fc..7b7f0dc36d 100644
--- a/src/jmh/java/io/reactivex/rxjava3/core/ToFlowablePerf.java
+++ b/src/jmh/java/io/reactivex/rxjava3/core/ToFlowablePerf.java
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
@@ -48,7 +48,7 @@ public void setup() {
final BiFunction second = new BiFunction() {
@Override
- public Integer apply(Integer a, Integer b) throws Exception {
+ public Integer apply(Integer a, Integer b) {
return b;
}
};
@@ -57,7 +57,7 @@ public Integer apply(Integer a, Integer b) throws Exception {
flowableInner = source.concatMap(new Function>() {
@Override
- public Publisher apply(Integer v) throws Exception {
+ public Publisher apply(Integer v) {
return Flowable.range(1, 50).reduce(second).toFlowable();
}
});
@@ -68,7 +68,7 @@ public Publisher apply(Integer v) throws Exception {
observableInner = sourceObs.concatMap(new Function>() {
@Override
- public Observable apply(Integer v) throws Exception {
+ public Observable apply(Integer v) {
return Observable.range(1, 50).reduce(second).toObservable();
}
});
diff --git a/src/jmh/java/io/reactivex/rxjava3/core/XMapYPerf.java b/src/jmh/java/io/reactivex/rxjava3/core/XMapYPerf.java
index 582d9da8dc..b95d76ffe4 100644
--- a/src/jmh/java/io/reactivex/rxjava3/core/XMapYPerf.java
+++ b/src/jmh/java/io/reactivex/rxjava3/core/XMapYPerf.java
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
@@ -103,84 +103,84 @@ public void setup() {
flowFlatMapFlowable1 = fsource.flatMap(new Function>() {
@Override
- public Publisher apply(Integer v) throws Exception {
+ public Publisher apply(Integer v) {
return Flowable.just(v);
}
});
flowFlatMapFlowable0 = fsource.flatMap(new Function>() {
@Override
- public Publisher apply(Integer v) throws Exception {
+ public Publisher apply(Integer v) {
return Flowable.empty();
}
});
flowFlatMapSingle1 = fsource.flatMapSingle(new Function>() {
@Override
- public SingleSource apply(Integer v) throws Exception {
+ public SingleSource apply(Integer v) {
return Single.just(v);
}
});
flowFlatMapMaybe1 = fsource.flatMapMaybe(new Function>() {
@Override
- public MaybeSource apply(Integer v) throws Exception {
+ public MaybeSource apply(Integer v) {
return Maybe.just(v);
}
});
flowFlatMapMaybe0 = fsource.flatMapMaybe(new Function>() {
@Override
- public MaybeSource apply(Integer v) throws Exception {
+ public MaybeSource apply(Integer v) {
return Maybe.empty();
}
});
flowFlatMapCompletable0 = fsource.flatMapCompletable(new Function() {
@Override
- public CompletableSource apply(Integer v) throws Exception {
+ public CompletableSource apply(Integer v) {
return Completable.complete();
}
});
flowFlatMapIterable1 = fsource.flatMapIterable(new Function>() {
@Override
- public Iterable apply(Integer v) throws Exception {
+ public Iterable apply(Integer v) {
return Collections.singletonList(v);
}
});
flowFlatMapIterable0 = fsource.flatMapIterable(new Function>() {
@Override
- public Iterable apply(Integer v) throws Exception {
- return Collections.emptyList();
+ public Iterable apply(Integer v) {
+ return Collections.emptyList();
}
});
flowFlatMapSingle1 = fsource.flatMapSingle(new Function>() {
@Override
- public SingleSource apply(Integer v) throws Exception {
+ public SingleSource apply(Integer v) {
return Single.just(v);
}
});
flowFlatMapMaybe1 = fsource.flatMapMaybe(new Function>() {
@Override
- public MaybeSource apply(Integer v) throws Exception {
+ public MaybeSource apply(Integer v) {
return Maybe.just(v);
}
});
flowFlatMapMaybe0 = fsource.flatMapMaybe(new Function>() {
@Override
- public MaybeSource apply(Integer v) throws Exception {
+ public MaybeSource apply(Integer v) {
return Maybe.empty();
}
});
flowFlatMapCompletable0 = fsource.flatMapCompletable(new Function() {
@Override
- public CompletableSource apply(Integer v) throws Exception {
+ public CompletableSource apply(Integer v) {
return Completable.complete();
}
});
@@ -189,43 +189,43 @@ public CompletableSource apply(Integer v) throws Exception {
flowFlatMapSingleAsFlow1 = fsource.flatMap(new Function>() {
@Override
- public Publisher apply(Integer v) throws Exception {
+ public Publisher apply(Integer v) {
return Single.just(v).toFlowable();
}
});
flowFlatMapMaybeAsFlow1 = fsource.flatMap(new Function>() {
@Override
- public Publisher apply(Integer v) throws Exception {
+ public Publisher apply(Integer v) {
return Maybe.just(v).toFlowable();
}
});
flowFlatMapMaybeAsFlow0 = fsource.flatMap(new Function>() {
@Override
- public Publisher apply(Integer v) throws Exception {
+ public Publisher apply(Integer v) {
return Maybe.empty().toFlowable();
}
});
flowFlatMapCompletableAsFlow0 = fsource.flatMap(new Function>() {
@Override
- public Publisher apply(Integer v) throws Exception {
- return Completable.complete().toFlowable();
+ public Publisher apply(Integer v) {
+ return Completable.complete().toFlowable();
}
});
flowFlatMapIterableAsFlow1 = fsource.flatMap(new Function>() {
@Override
- public Publisher apply(Integer v) throws Exception {
+ public Publisher apply(Integer v) {
return Flowable.fromIterable(Collections.singletonList(v));
}
});
flowFlatMapIterableAsFlow0 = fsource.flatMap(new Function>() {
@Override
- public Publisher apply(Integer v) throws Exception {
- return Flowable.fromIterable(Collections.emptyList());
+ public Publisher apply(Integer v) {
+ return Flowable.fromIterable(Collections.emptyList());
}
});
@@ -235,57 +235,57 @@ public Publisher apply(Integer v) throws Exception {
obsFlatMapObservable1 = osource.flatMap(new Function>() {
@Override
- public Observable apply(Integer v) throws Exception {
+ public Observable apply(Integer v) {
return Observable.just(v);
}
});
obsFlatMapObservable0 = osource.flatMap(new Function>() {
@Override
- public Observable apply(Integer v) throws Exception {
+ public Observable apply(Integer v) {
return Observable.empty();
}
});
obsFlatMapSingle1 = osource.flatMapSingle(new Function>() {
@Override
- public SingleSource apply(Integer v) throws Exception {
+ public SingleSource apply(Integer v) {
return Single.just(v);
}
});
obsFlatMapMaybe1 = osource.flatMapMaybe(new Function>() {
@Override
- public MaybeSource apply(Integer v) throws Exception {
+ public MaybeSource apply(Integer v) {
return Maybe.just(v);
}
});
obsFlatMapMaybe0 = osource.flatMapMaybe(new Function>() {
@Override
- public MaybeSource apply(Integer v) throws Exception {
+ public MaybeSource apply(Integer v) {
return Maybe.empty();
}
});
obsFlatMapCompletable0 = osource.flatMapCompletable(new Function() {
@Override
- public CompletableSource apply(Integer v) throws Exception {
+ public CompletableSource apply(Integer v) {
return Completable.complete();
}
});
obsFlatMapIterable1 = osource.flatMapIterable(new Function>() {
@Override
- public Iterable apply(Integer v) throws Exception {
+ public Iterable apply(Integer v) {
return Collections.singletonList(v);
}
});
obsFlatMapIterable0 = osource.flatMapIterable(new Function>() {
@Override
- public Iterable apply(Integer v) throws Exception {
- return Collections.emptyList();
+ public Iterable apply(Integer v) {
+ return Collections.emptyList();
}
});
@@ -293,43 +293,43 @@ public Iterable apply(Integer v) throws Exception {
obsFlatMapSingleAsObs1 = osource.flatMap(new Function>() {
@Override
- public Observable apply(Integer v) throws Exception {
+ public Observable apply(Integer v) {
return Single.just(v).toObservable();
}
});
obsFlatMapMaybeAsObs1 = osource.flatMap(new Function>() {
@Override
- public Observable apply(Integer v) throws Exception {
+ public Observable apply(Integer v) {
return Maybe.just(v).toObservable();
}
});
obsFlatMapMaybeAsObs0 = osource.flatMap(new Function>() {
@Override
- public Observable apply(Integer v) throws Exception {
+ public Observable apply(Integer v) {
return Maybe.empty().toObservable();
}
});
obsFlatMapCompletableAsObs0 = osource.flatMap(new Function>() {
@Override
- public Observable apply(Integer v) throws Exception {
- return Completable.complete().toObservable();
+ public Observable apply(Integer v) {
+ return Completable.complete().toObservable();
}
});
obsFlatMapIterableAsObs1 = osource.flatMap(new Function>() {
@Override
- public Observable apply(Integer v) throws Exception {
+ public Observable apply(Integer v) {
return Observable.fromIterable(Collections.singletonList(v));
}
});
obsFlatMapIterableAsObs0 = osource.flatMap(new Function>() {
@Override
- public Observable apply(Integer v) throws Exception {
- return Observable.fromIterable(Collections.emptyList());
+ public Observable apply(Integer v) {
+ return Observable.fromIterable(Collections.emptyList());
}
});
}
diff --git a/src/jmh/java/io/reactivex/rxjava3/parallel/ParallelPerf.java b/src/jmh/java/io/reactivex/rxjava3/parallel/ParallelPerf.java
index 31d0ecc8c5..c6fd16ffb6 100644
--- a/src/jmh/java/io/reactivex/rxjava3/parallel/ParallelPerf.java
+++ b/src/jmh/java/io/reactivex/rxjava3/parallel/ParallelPerf.java
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
@@ -49,7 +49,7 @@ public class ParallelPerf implements Function {
Flowable parallel;
@Override
- public Integer apply(Integer t) throws Exception {
+ public Integer apply(Integer t) {
Blackhole.consumeCPU(compute);
return t;
}
@@ -66,7 +66,7 @@ public void setup() {
flatMap = source.flatMap(new Function>() {
@Override
- public Publisher