| 5 | import java.util.concurrent.atomic.*; |
| 6 | |
| 7 | class SyncConstructor implements HasID { |
| 8 | private final int id; |
| 9 | private static Object |
| 10 | constructorLock = new Object(); |
| 11 | SyncConstructor(SharedArg sa) { |
| 12 | synchronized(constructorLock) { |
| 13 | id = sa.get(); |
| 14 | } |
| 15 | } |
| 16 | @Override public int getID() { return id; } |
| 17 | } |
| 18 | |
| 19 | public class SynchronizedConstructor { |
| 20 | public static void main(String[] args) { |
nothing calls this directly
no outgoing calls
no test coverage detected