manifold-ij icon indicating copy to clipboard operation
manifold-ij copied to clipboard

Warning when Synchronize on @val property

Open EotT123 opened this issue 1 year ago • 0 comments

When using Manifold properties, annotating a field with @val makes the field final. However, when using that field in a synchronized block, I get a warning message: Synchronization on a non-final field. This warning should be suppressed.

public class Foo{
    @val Object object;
    
    public Foo(Object object){
        this.object = object;
    }

    public void doSomething(){
        synchronized(object){ // <-- Synchronization on a non-final field warning
            ...
        }
    }
}

EotT123 avatar Jun 02 '24 11:06 EotT123