-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* EPMRPP-94504 improve saucelabs plugin
- Loading branch information
Showing
24 changed files
with
571 additions
and
519 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
version=5.11.0 | ||
lombokVersion=1.18.34 | ||
testsEnabled=false |
108 changes: 0 additions & 108 deletions
108
src/main/java/com/epam/reportportal/saucelabs/AssetsCommand.java
This file was deleted.
Oops, something went wrong.
89 changes: 0 additions & 89 deletions
89
src/main/java/com/epam/reportportal/saucelabs/JobInfoCommand.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,41 +13,42 @@ | |
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.epam.reportportal.saucelabs; | ||
|
||
import static com.google.common.base.Preconditions.checkNotNull; | ||
|
||
import java.util.concurrent.atomic.AtomicBoolean; | ||
import java.util.function.Supplier; | ||
|
||
import static com.google.common.base.Preconditions.checkNotNull; | ||
|
||
/** | ||
* @author <a href="mailto:[email protected]">Ivan Budayeu</a> | ||
*/ | ||
public class MemoizingSupplier<T> implements Supplier<T> { | ||
|
||
private final Supplier<T> delegate; | ||
|
||
private AtomicBoolean initialized = new AtomicBoolean(false); | ||
|
||
private T value; | ||
|
||
public MemoizingSupplier(Supplier<T> delegate) { | ||
this.delegate = checkNotNull(delegate); | ||
} | ||
|
||
@Override | ||
public T get() { | ||
if (!initialized.get()) { | ||
synchronized (this) { | ||
if (!initialized.get()) { | ||
T t = delegate.get(); | ||
value = t; | ||
initialized.set(true); | ||
return t; | ||
} | ||
} | ||
} | ||
return value; | ||
} | ||
private final Supplier<T> delegate; | ||
|
||
private AtomicBoolean initialized = new AtomicBoolean(false); | ||
|
||
private T value; | ||
|
||
public MemoizingSupplier(Supplier<T> delegate) { | ||
this.delegate = checkNotNull(delegate); | ||
} | ||
|
||
@Override | ||
public T get() { | ||
if (!initialized.get()) { | ||
synchronized (this) { | ||
if (!initialized.get()) { | ||
T t = delegate.get(); | ||
value = t; | ||
initialized.set(true); | ||
return t; | ||
} | ||
} | ||
} | ||
return value; | ||
} | ||
|
||
} |
Oops, something went wrong.