src/jdk.jshell/share/classes/jdk/internal/jshell/tool/StopDetectingInputStream.java
changeset 53003 ff1c86e85d02
parent 47216 71c04702a3d5
equal deleted inserted replaced
53002:9d60798b21af 53003:ff1c86e85d02
   111         state = State.CLOSED;
   111         state = State.CLOSED;
   112         notifyAll();
   112         notifyAll();
   113     }
   113     }
   114 
   114 
   115     public synchronized void write(int b) {
   115     public synchronized void write(int b) {
   116         if (state != State.BUFFER) {
   116         if (state == State.READ) {
   117             state = State.WAIT;
   117             state = State.WAIT;
   118         }
   118         }
   119         int newEnd = (end + 1) % buffer.length;
   119         int newEnd = (end + 1) % buffer.length;
   120         if (newEnd == start) {
   120         if (newEnd == start) {
   121             //overflow:
   121             //overflow: