Skip to content

Commit 2d3606a

Browse files
authored
Update README.md
Fixed incorrect example
1 parent b18ee1e commit 2d3606a

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,8 @@ public class GettingStarted {
116116
public static void main(String[] args) {
117117
System.out.println("Harness SDK Getting Started");
118118

119-
try {
120-
//Create a Feature Flag Client
121-
CfClient cfClient = new CfClient(apiKey);
119+
//Create a Feature Flag Client
120+
try (CfClient cfClient = new CfClient(apiKey)) {
122121
cfClient.waitForInitialization();
123122

124123
// Create a target (different targets can get different results based on rules. This includes a custom attribute 'location')
@@ -140,9 +139,6 @@ public class GettingStarted {
140139

141140
} catch (Exception e) {
142141
e.printStackTrace();
143-
} finally {
144-
// Close the SDK
145-
CfClient.getInstance().close();
146142
}
147143
}
148144

0 commit comments

Comments
 (0)