== Why is this an issue?

include::../description.adoc[]

=== Noncompliant code example

[source,java]
----
public class MyClass {
  public void doSomething() {
    Lock lock = new Lock();
    lock.lock(); // Noncompliant
    if (isInitialized()) {
      // ...
      lock.unlock();
    }
  }
}
----

=== Compliant solution

[source,java]
----
public class MyClass {
  public void doSomething() {
    Lock lock = new Lock();
    if (isInitialized()) {
      lock.lock();
      // ...
      lock.unlock();
    }
  }
}
----

include::../see.adoc[]

include::../rspecator.adoc[]
