Skip to content

Commit 448820c

Browse files
committed
Merge branch 'main' into 1371_java11_refactor
Signed-off-by: jarebudev <[email protected]>
2 parents edb26dc + b09e887 commit 448820c

File tree

7 files changed

+32
-12
lines changed

7 files changed

+32
-12
lines changed

.github/workflows/lint-pr.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ jobs:
1818
name: Validate PR title
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: amannn/action-semantic-pull-request@04501d43b574e4c1d23c629ffe4dcec27acfdeff
21+
- uses: amannn/action-semantic-pull-request@335288255954904a41ddda8947c8f2c844b8bfeb
2222
env:
2323
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pullrequest.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
cache: maven
3030

3131
- name: Initialize CodeQL
32-
uses: github/codeql-action/init@4ffa2364a07d4fa8656211f550f36d44e8148dae
32+
uses: github/codeql-action/init@ed51cb5abd90d0e898e492d5e3f24423da71c2fb
3333
with:
3434
languages: java
3535

@@ -55,4 +55,4 @@ jobs:
5555
verbose: true # optional (default = false)
5656

5757
- name: Perform CodeQL Analysis
58-
uses: github/codeql-action/analyze@4ffa2364a07d4fa8656211f550f36d44e8148dae
58+
uses: github/codeql-action/analyze@ed51cb5abd90d0e898e492d5e3f24423da71c2fb

.github/workflows/release.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@ jobs:
2020

2121
# Release-please creates a PR that tracks all changes
2222
steps:
23-
- uses: google-github-actions/release-please-action@e4dc86ba9405554aeba3c6bb2d169500e7d3b4ee
23+
- uses: googleapis/release-please-action@v4
2424
id: release
2525
with:
26-
token: ${{secrets.GITHUB_TOKEN}}
27-
target-branch: main
26+
token: ${{secrets.RELEASE_PLEASE_ACTION_TOKEN}}
2827

2928
# These steps are only run if this was a merged release-please PR
3029
- name: checkout

.github/workflows/static-code-scanning.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ jobs:
3333

3434
# Initializes the CodeQL tools for scanning.
3535
- name: Initialize CodeQL
36-
uses: github/codeql-action/init@4ffa2364a07d4fa8656211f550f36d44e8148dae
36+
uses: github/codeql-action/init@ed51cb5abd90d0e898e492d5e3f24423da71c2fb
3737
with:
3838
languages: java
3939

4040
- name: Autobuild
41-
uses: github/codeql-action/autobuild@4ffa2364a07d4fa8656211f550f36d44e8148dae
41+
uses: github/codeql-action/autobuild@ed51cb5abd90d0e898e492d5e3f24423da71c2fb
4242

4343
- name: Perform CodeQL Analysis
44-
uses: github/codeql-action/analyze@4ffa2364a07d4fa8656211f550f36d44e8148dae
44+
uses: github/codeql-action/analyze@ed51cb5abd90d0e898e492d5e3f24423da71c2fb

README.md

+12-2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,12 @@ public void example(){
104104

105105
// configure a provider
106106
OpenFeatureAPI api = OpenFeatureAPI.getInstance();
107-
api.setProviderAndWait(new InMemoryProvider(myFlags));
107+
try {
108+
api.setProviderAndWait(new InMemoryProvider(myFlags));
109+
} catch (Exception e) {
110+
// handle initialization failure
111+
e.printStackTrace();
112+
}
108113

109114
// create a client
110115
Client client = api.getClient();
@@ -149,7 +154,12 @@ To register a provider in a blocking manner to ensure it is ready before further
149154

150155
```java
151156
OpenFeatureAPI api = OpenFeatureAPI.getInstance();
152-
api.setProviderAndWait(new MyProvider());
157+
try {
158+
api.setProviderAndWait(new MyProvider());
159+
} catch (Exception e) {
160+
// handle initialization failure
161+
e.printStackTrace();
162+
}
153163
```
154164

155165
#### Asynchronous

release-please-config.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"bootstrap-sha": "c701a6c4ebbe1170a25ca7636a31508b9628831c",
3+
"signoff": "OpenFeature Bot <[email protected]>",
34
"packages": {
45
".": {
56
"package-name": "dev.openfeature.sdk",

src/main/java/dev/openfeature/sdk/OpenFeatureAPI.java

+11-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,13 @@ public void setProvider(String domain, FeatureProvider provider) {
207207
}
208208

209209
/**
210-
* Set the default provider and wait for initialization to finish.
210+
* Sets the default provider and waits for its initialization to complete.
211+
*
212+
* <p>Note: If the provider fails during initialization, an {@link OpenFeatureError} will be thrown.
213+
* It is recommended to wrap this call in a try-catch block to handle potential initialization failures gracefully.
214+
*
215+
* @param provider the {@link FeatureProvider} to set as the default.
216+
* @throws OpenFeatureError if the provider fails during initialization.
211217
*/
212218
public void setProviderAndWait(FeatureProvider provider) throws OpenFeatureError {
213219
try (AutoCloseableLock __ = lock.writeLockAutoCloseable()) {
@@ -224,8 +230,12 @@ public void setProviderAndWait(FeatureProvider provider) throws OpenFeatureError
224230
/**
225231
* Add a provider for a domain and wait for initialization to finish.
226232
*
233+
* <p>Note: If the provider fails during initialization, an {@link OpenFeatureError} will be thrown.
234+
* It is recommended to wrap this call in a try-catch block to handle potential initialization failures gracefully.
235+
*
227236
* @param domain The domain to bind the provider to.
228237
* @param provider The provider to set.
238+
* @throws OpenFeatureError if the provider fails during initialization.
229239
*/
230240
public void setProviderAndWait(String domain, FeatureProvider provider) throws OpenFeatureError {
231241
try (AutoCloseableLock __ = lock.writeLockAutoCloseable()) {

0 commit comments

Comments
 (0)