fork download
  1. import java.io.ByteArrayOutputStream;
  2. import java.io.ObjectOutputStream;
  3. import java.io.Serializable;
  4.  
  5. public class Main {
  6.  
  7. static class BusinessObject implements Serializable{
  8.  
  9. Object lock = new Object();
  10.  
  11. public void buisinessMethod(){
  12. synchronized (lock){
  13. //...
  14. }
  15. }
  16.  
  17. private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
  18. }
  19.  
  20. }
  21.  
  22. public static void main(String[] args) throws Exception{
  23. new ObjectOutputStream(new ByteArrayOutputStream()).writeObject(new BusinessObject());
  24. }
  25. }
Success #stdin #stdout 0.1s 380480KB
stdin
Standard input is empty
stdout
Standard output is empty