mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-17 07:20:53 +07:00
Added SurroundResult#collapse method to collapse expanded code block back. Now, InlineMethodProcessor is simpler and preserves semantics at the call site more often. Fixes IDEA-297364 Inline Method changes semantic for a method throwing exception GitOrigin-RevId: 2ceb23e372e2876202dac687048ac86fb23cfc3b
23 lines
527 B
Java
23 lines
527 B
Java
import java.util.NoSuchElementException;
|
|
|
|
public class MyQueue {
|
|
private long[] items = new long[16];
|
|
|
|
private int head;
|
|
private int tail;
|
|
|
|
public boolean isEmpty() { return head == tail; }
|
|
|
|
public long getFirst() {
|
|
if (isEmpty())
|
|
throw new NoSuchElementException("Queue is empty");
|
|
return items[head];
|
|
}
|
|
|
|
// true if the first element of the queue is greater than specified number
|
|
public boolean firstIsGreaterThan(int x) {
|
|
return !isEmpty() && g<caret>etFirst() > x;
|
|
}
|
|
|
|
// other methods
|
|
} |