File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
src/main/java/com/zendesk/maxwell/util Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -39,11 +39,6 @@ public void add(T element) throws IOException {
39
39
40
40
os .writeUnshared (this .list .removeFirst ());
41
41
42
- if ( is == null && os != null ) {
43
- os .flush ();
44
- is = new ObjectInputStream (new BufferedInputStream (new FileInputStream (file )));
45
- }
46
-
47
42
elementsInFile ++;
48
43
}
49
44
}
@@ -57,7 +52,12 @@ public T getLast() {
57
52
}
58
53
59
54
public T removeFirst () throws IOException , ClassNotFoundException {
60
- if ( elementsInFile > 0 && is != null ) {
55
+ if ( elementsInFile > 0 ) {
56
+ if ( is == null ) {
57
+ os .flush ();
58
+ is = new ObjectInputStream (new BufferedInputStream (new FileInputStream (file )));
59
+ }
60
+
61
61
T element = (T ) is .readUnshared ();
62
62
elementsInFile --;
63
63
return element ;
You can’t perform that action at this time.
0 commit comments