peichhorn/lombok-pg — Issue #55: @Cleanup without value is broken for non-Closeable classes
Author: abryzak
Created: 2011-11-24 05:30:24+00:00
State: open

After upgrading to the latest lombok-pg, `@Cleanup` is broken for classes that have a `close` method but don't implement `Closeable`. The following test demonstrates that `close` isn't called.

```java
import lombok.Cleanup;

public class CleanupTest {

public void close() {
System.out.println("close called");
}

public static void main(String[] args) throws Exception {
@Cleanup
CleanupTest closeable = new CleanupTest();
}

}
```

As a workaround, you can pass a `"close"` value to the annotation.