google / google/guice

Documentation of PersistService does not match its implementation

Open
#947 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
12.7k
Forks
1.7k
Avg merge
11m
Merged PRs (30d)
2

Description

The JavaDoc on its `start()` and `stop()` method states that nothing should happen if service is already started or stopped respectively. However, trying to call those methods twice results in an IllegalStateException being thrown by the implementation due to these checks:

``` java
public synchronized void start() {
Preconditions.checkState(null == emFactory, "Persistence service was already initialized.");
...
}
```

``` java
public synchronized void stop() {
Preconditions.checkState(emFactory.isOpen(), "Persistence service was already shut down.");
....
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.