bugged stringlengths 6 599k | fixed stringlengths 10 599k | __index_level_0__ int64 0 1.13M |
|---|---|---|
public float getSpan(GlyphView view, int p0, int p1, TabExpander te, float x) { Font font = view.getFont(); FontMetrics fm = Toolkit.getDefaultToolkit().getFontMetrics(font); Segment txt = view.getText(p0, p1); int span = Utilities.getTabbedTextWidth(txt, fm, (int) x, ... | public float getSpan(GlyphView view, int p0, int p1, TabExpander te, float x) { Font font = view.getFont(); FontMetrics fm = Toolkit.getDefaultToolkit().getFontMetrics(font); Segment txt = view.getText(p0, p1); int span = Utilities.getTabbedTextWidth(txt, fontMetrics, ... | 24,585 |
public Shape modelToView(GlyphView view, int pos, Position.Bias b, Shape a) throws BadLocationException { Element el = view.getElement(); Font font = view.getFont(); FontMetrics fm = view.getContainer().getFontMetrics(font); Segment txt = view.getText(el.getSt... | public Shape modelToView(GlyphView view, int pos, Position.Bias b, Shape a) throws BadLocationException { Element el = view.getElement(); Font font = view.getFont(); FontMetrics fm = view.getContainer().getFontMetrics(font); Segment txt = view.getText(el.getSt... | 24,586 |
public Shape modelToView(GlyphView view, int pos, Position.Bias b, Shape a) throws BadLocationException { Element el = view.getElement(); Font font = view.getFont(); FontMetrics fm = view.getContainer().getFontMetrics(font); Segment txt = view.getText(el.getSt... | public Shape modelToView(GlyphView view, int pos, Position.Bias b, Shape a) throws BadLocationException { Element el = view.getElement(); Font font = view.getFont(); FontMetrics fm = view.getContainer().getFontMetrics(font); Segment txt = view.getText(el.getSt... | 24,587 |
public Shape modelToView(GlyphView view, int pos, Position.Bias b, Shape a) throws BadLocationException { Element el = view.getElement(); Font font = view.getFont(); FontMetrics fm = view.getContainer().getFontMetrics(font); Segment txt = view.getText(el.getSt... | public Shape modelToView(GlyphView view, int pos, Position.Bias b, Shape a) throws BadLocationException { Element el = view.getElement(); Font font = view.getFont(); FontMetrics fm = view.getContainer().getFontMetrics(font); Segment txt = view.getText(el.getSt... | 24,588 |
public void paint(GlyphView view, Graphics g, Shape a, int p0, int p1) { Color oldColor = g.getColor(); int height = (int) getHeight(view); Segment txt = view.getText(p0, p1); Rectangle bounds = a.getBounds(); TabExpander tabEx = null; View parent = view.getPare... | public void paint(GlyphView view, Graphics g, Shape a, int p0, int p1) { Color oldColor = g.getColor(); int height = (int) getHeight(view); Segment txt = view.getText(p0, p1); Rectangle bounds = a.getBounds(); TabExpander tabEx = null; View parent = view.getPare... | 24,589 |
public void paint(GlyphView view, Graphics g, Shape a, int p0, int p1) { Color oldColor = g.getColor(); int height = (int) getHeight(view); Segment txt = view.getText(p0, p1); Rectangle bounds = a.getBounds(); TabExpander tabEx = null; View parent = view.getPare... | public void paint(GlyphView view, Graphics g, Shape a, int p0, int p1) { Color oldColor = g.getColor(); int height = (int) getHeight(view); Segment txt = view.getText(p0, p1); Rectangle bounds = a.getBounds(); TabExpander tabEx = null; View parent = view.getPare... | 24,590 |
public void paint(GlyphView view, Graphics g, Shape a, int p0, int p1) { Color oldColor = g.getColor(); int height = (int) getHeight(view); Segment txt = view.getText(p0, p1); Rectangle bounds = a.getBounds(); TabExpander tabEx = null; View parent = view.getPare... | public void paint(GlyphView view, Graphics g, Shape a, int p0, int p1) { Color oldColor = g.getColor(); int height = (int) getHeight(view); Segment txt = view.getText(p0, p1); Rectangle bounds = a.getBounds(); TabExpander tabEx = null; View parent = view.getPare... | 24,591 |
public void paint(GlyphView view, Graphics g, Shape a, int p0, int p1) { Color oldColor = g.getColor(); int height = (int) getHeight(view); Segment txt = view.getText(p0, p1); Rectangle bounds = a.getBounds(); TabExpander tabEx = null; View parent = view.getPare... | public void paint(GlyphView view, Graphics g, Shape a, int p0, int p1) { Color oldColor = g.getColor(); int height = (int) getHeight(view); Segment txt = view.getText(p0, p1); Rectangle bounds = a.getBounds(); TabExpander tabEx = null; View parent = view.getPare... | 24,592 |
public void paint(GlyphView view, Graphics g, Shape a, int p0, int p1) { Color oldColor = g.getColor(); int height = (int) getHeight(view); Segment txt = view.getText(p0, p1); Rectangle bounds = a.getBounds(); TabExpander tabEx = null; View parent = view.getPare... | public void paint(GlyphView view, Graphics g, Shape a, int p0, int p1) { Color oldColor = g.getColor(); int height = (int) getHeight(view); Segment txt = view.getText(p0, p1); Rectangle bounds = a.getBounds(); TabExpander tabEx = null; View parent = view.getPare... | 24,593 |
public void paint(GlyphView view, Graphics g, Shape a, int p0, int p1) { Color oldColor = g.getColor(); int height = (int) getHeight(view); Segment txt = view.getText(p0, p1); Rectangle bounds = a.getBounds(); TabExpander tabEx = null; View parent = view.getPare... | public void paint(GlyphView view, Graphics g, Shape a, int p0, int p1) { Color oldColor = g.getColor(); int height = (int) getHeight(view); Segment txt = view.getText(p0, p1); Rectangle bounds = a.getBounds(); TabExpander tabEx = null; View parent = view.getPare... | 24,594 |
public int viewToModel(GlyphView v, float x, float y, Shape a, Bias[] biasRet) { Rectangle b = a.getBounds(); int pos = getBoundedPosition(v, v.getStartOffset(), b.x, x - b.x); return pos; } | public int viewToModel(GlyphView v, float x, float y, Shape a, Bias[] biasRet) { Rectangle b = a.getBounds(); int pos = getBoundedPosition(v, v.getStartOffset(), b.x, x - b.x); return pos; } | 24,595 |
public GlyphView(Element element) { super(element); startOffset = -1; endOffset = -1; } | public GlyphView(Element element) { super(element); startOffset = -1; endOffset = -1; } | 24,596 |
public View breakView(int axis, int p0, float pos, float len) { if (axis == Y_AXIS) return this; checkPainter(); // Try to find a suitable line break. Segment txt = new Segment(); try { int start = getStartOffset(); int length = getEndOffset() - start; getDocument().getT... | public View breakView(int axis, int p0, float pos, float len) { if (axis == Y_AXIS) return this; checkPainter(); // Try to find a suitable line break. Segment txt = new Segment(); try { int start = getStartOffset(); int length = getEndOffset() - start; getDocument().getT... | 24,597 |
public View breakView(int axis, int p0, float pos, float len) { if (axis == Y_AXIS) return this; checkPainter(); // Try to find a suitable line break. Segment txt = new Segment(); try { int start = getStartOffset(); int length = getEndOffset() - start; getDocument().getT... | public View breakView(int axis, int p0, float pos, float len) { if (axis == Y_AXIS) return this; checkPainter(); // Try to find a suitable line break. Segment txt = new Segment(); try { int start = getStartOffset(); int length = getEndOffset() - start; getDocument().getT... | 24,598 |
public View breakView(int axis, int p0, float pos, float len) { if (axis == Y_AXIS) return this; checkPainter(); // Try to find a suitable line break. Segment txt = new Segment(); try { int start = getStartOffset(); int length = getEndOffset() - start; getDocument().getT... | public View breakView(int axis, int p0, float pos, float len) { if (axis == Y_AXIS) return this; checkPainter(); // Try to find a suitable line break. Segment txt = new Segment(); try { int start = getStartOffset(); int length = getEndOffset() - start; getDocument().getT... | 24,599 |
public View breakView(int axis, int p0, float pos, float len) { if (axis == Y_AXIS) return this; checkPainter(); // Try to find a suitable line break. Segment txt = new Segment(); try { int start = getStartOffset(); int length = getEndOffset() - start; getDocument().getT... | public View breakView(int axis, int p0, float pos, float len) { if (axis == Y_AXIS) return this; checkPainter(); // Try to find a suitable line break. Segment txt = new Segment(); try { int start = getStartOffset(); int length = getEndOffset() - start; getDocument().getT... | 24,600 |
public void changedUpdate(DocumentEvent e, Shape a, ViewFactory vf) { preferenceChanged(this, true, true); } | public void changedUpdate(DocumentEvent e, Shape a, ViewFactory vf) { preferenceChanged(null, true, true); } | 24,601 |
public View createFragment(int p0, int p1) { GlyphView fragment = (GlyphView) clone(); if (p0 != getStartOffset()) fragment.startOffset = p0; if (p1 != getEndOffset()) fragment.endOffset = p1; return fragment; } | public View createFragment(int p0, int p1) { GlyphView fragment = (GlyphView) clone(); if (p0 != getStartOffset()) fragment.startOffset = p0; if (p1 != getEndOffset()) fragment.endOffset = p1; return fragment; } | 24,603 |
public int getEndOffset() { int end = endOffset; if (end < 0) end = super.getEndOffset(); return end; } | public int getEndOffset() { int end = endOffset; if (end < 0) end = super.getEndOffset(); return end; } | 24,606 |
public float getPartialSpan(int p0, int p1) { Element el = getElement(); Document doc = el.getDocument(); Segment seg = new Segment(); try { doc.getText(p0, p1 - p0, seg); } catch (BadLocationException ex) { AssertionError ae; ae = new AssertionError("BadLocationException ... | public float getPartialSpan(int p0, int p1) { Element el = getElement(); Document doc = el.getDocument(); Segment seg = new Segment(); try { doc.getText(p0, p1 - p0, seg); } catch (BadLocationException ex) { AssertionError ae; ae = new AssertionError("BadLocationException ... | 24,607 |
public int getStartOffset() { int start = startOffset; if (start < 0) start = super.getStartOffset(); return start; } | public int getStartOffset() { int start = startOffset; if (start < 0) start = super.getStartOffset(); return start; } | 24,608 |
public TabExpander getTabExpander() { TabExpander te = null; View parent = getParent(); if (parent instanceof TabExpander) te = (TabExpander) parent; return te; } | public TabExpander getTabExpander() { TabExpander te = null; View parent = getParent(); if (parent instanceof TabExpander) te = (TabExpander) parent; return te; } | 24,609 |
public float getTabbedSpan(float x, TabExpander te) { Element el = getElement(); return getGlyphPainter().getSpan(this, el.getStartOffset(), el.getEndOffset(), te, x); } | public float getTabbedSpan(float x, TabExpander te) { Element el = getElement(); return getGlyphPainter().getSpan(this, el.getStartOffset(), el.getEndOffset(), te, x); } | 24,610 |
public Segment getText(int p0, int p1) { Segment txt = new Segment(); try { getDocument().getText(p0, p1 - p0, txt); } catch (BadLocationException ex) { AssertionError ae; ae = new AssertionError("BadLocationException should not be " + "thrown her... | public Segment getText(int p0, int p1) { try { getDocument().getText(p0, p1 - p0, txt); } catch (BadLocationException ex) { AssertionError ae; ae = new AssertionError("BadLocationException should not be " + "thrown here. p0 = " + p0 + ", p1 = " +... | 24,611 |
public Segment getText(int p0, int p1) { Segment txt = new Segment(); try { getDocument().getText(p0, p1 - p0, txt); } catch (BadLocationException ex) { AssertionError ae; ae = new AssertionError("BadLocationException should not be " + "thrown her... | public Segment getText(int p0, int p1) { Segment txt = new Segment(); try { getDocument().getText(p0, p1 - p0, cached); } catch (BadLocationException ex) { AssertionError ae; ae = new AssertionError("BadLocationException should not be " + "thrown ... | 24,612 |
public Segment getText(int p0, int p1) { Segment txt = new Segment(); try { getDocument().getText(p0, p1 - p0, txt); } catch (BadLocationException ex) { AssertionError ae; ae = new AssertionError("BadLocationException should not be " + "thrown her... | public Segment getText(int p0, int p1) { Segment txt = new Segment(); try { getDocument().getText(p0, p1 - p0, txt); } catch (BadLocationException ex) { AssertionError ae; ae = new AssertionError("BadLocationException should not be " + "thrown her... | 24,613 |
public void insertUpdate(DocumentEvent e, Shape a, ViewFactory vf) { preferenceChanged(this, true, false); } | public void insertUpdate(DocumentEvent e, Shape a, ViewFactory vf) { preferenceChanged(null, true, false); } | 24,614 |
public void paint(Graphics g, Shape a) { checkPainter(); int p0 = getStartOffset(); int p1 = getEndOffset(); Container c = getContainer(); // Paint layered highlights if there are any. if (c instanceof JTextComponent) { JTextComponent tc = (JTextComponent) c; Highlighter h = tc.g... | public void paint(Graphics g, Shape a) { checkPainter(); int p0 = getStartOffset(); int p1 = getEndOffset(); Container c = getContainer(); // Paint layered highlights if there are any. if (c instanceof JTextComponent) { tc = (JTextComponent) c; if (! tc.isEnabled()) fg = tc.getDisabledT... | 24,616 |
public void paint(Graphics g, Shape a) { checkPainter(); int p0 = getStartOffset(); int p1 = getEndOffset(); Container c = getContainer(); // Paint layered highlights if there are any. if (c instanceof JTextComponent) { JTextComponent tc = (JTextComponent) c; Highlighter h = tc.g... | public void paint(Graphics g, Shape a) { checkPainter(); int p0 = getStartOffset(); int p1 = getEndOffset(); Container c = getContainer(); // Paint layered highlights if there are any. if (c instanceof JTextComponent) { JTextComponent tc = (JTextComponent) c; Highlighter h = tc.g... | 24,617 |
public void removeUpdate(DocumentEvent e, Shape a, ViewFactory vf) { preferenceChanged(this, true, false); } | public void removeUpdate(DocumentEvent e, Shape a, ViewFactory vf) { preferenceChanged(null, true, false); } | 24,618 |
public MainThread(String classname, String[] args) throws ClassNotFoundException, NoSuchMethodException { Class found = Class.forName(classname); Class[] argTypes = new Class[1]; argTypes[0] = args.getClass(); mainMethod = found.getMethod("main", argTypes); this.args = args; } | public MainThread(String classname, String[] args) throws ClassNotFoundException, NoSuchMethodException { Class found = Class.forName(classname, true, ClassLoader.getSystemClassLoader()); Class[] argTypes = new Class[1]; argTypes[0] = args.getClass(); mainMethod = found.getMethod("main", argTypes); this.args... | 24,619 |
JTree() { updateUI(); } | JTree() { updateUI(); } | 24,620 |
Clipboard(String name){ this.name = name;} | Clipboard(String name){ this.name = name;} | 24,621 |
getContents(Object requestor){ return(contents);} | getContents(Object requestor){ return(contents);} | 24,622 |
setContents(Transferable contents, ClipboardOwner owner){ if (this.owner != owner) if (this.owner != null) this.owner.lostOwnership(this, contents); this.owner = owner; this.contents = contents;} | setContents(Transferable contents, ClipboardOwner owner){ if (this.owner != owner) if (this.owner != null) this.owner.lostOwnership(this, contents); this.owner = owner; this.contents = contents;} | 24,623 |
protected Rectangle getVisibleEditorRect() { int width = textComponent.getWidth(); int height = textComponent.getHeight(); if (width <= 0 || height <= 0) return new Rectangle(0, 0, 0, 0); Insets insets = textComponent.getInsets(); return new Rectangle(insets.left, insets.top, width - insets.l... | protected Rectangle getVisibleEditorRect() { int width = textComponent.getWidth(); int height = textComponent.getHeight(); if (width <= 0 || height <= 0) return null; Insets insets = textComponent.getInsets(); return new Rectangle(insets.left, insets.top, width - insets.left - insets.right, ... | 24,624 |
public int getIndexOf(Component c) { Integer layer = getLayer (c); int[] range = layerToRange (layer); Component[] comps = getComponents(); for (int i = range[0]; i < range[1]; ++i) { if (comps[i] == c) return i; } // should have found the component during iteration throw n... | public int getIndexOf(Component c) { Integer layer = getLayer (c); int[] range = layerToRange (layer); Component[] comps = getComponents(); for (int i = range[0]; i < range[1]; ++i) { if (comps[i] == c) return i; } // should have found the component during iteration throw n... | 24,625 |
protected Integer getLayer (Component c) { if (! componentToLayer.containsKey (c)) throw new IllegalArgumentException (); return (Integer) componentToLayer.get (c); } | public int getLayer(Component c) { if (! componentToLayer.containsKey (c)) throw new IllegalArgumentException (); return (Integer) componentToLayer.get (c); } | 24,626 |
protected Integer getLayer (Component c) { if (! componentToLayer.containsKey (c)) throw new IllegalArgumentException (); return (Integer) componentToLayer.get (c); } | protected Integer getLayer (Component c) { if (! componentToLayer.containsKey (c)) throw new IllegalArgumentException (); return ((Integer) componentToLayer.get(c)).intValue(); } | 24,627 |
public int getPosition(Component c) { Integer layer = getLayer (c); int[] range = layerToRange (layer); int top = range[0]; int bot = range[1]; Component[] comps = getComponents (); for (int i = top; i < bot; ++i) { if (comps[i] == c) return i - top; } // should have foun... | public int getPosition(Component c) { Integer layer = getLayer (c); int[] range = layerToRange (layer); int top = range[0]; int bot = range[1]; Component[] comps = getComponents (); for (int i = top; i < bot; ++i) { if (comps[i] == c) return i - top; } // should have foun... | 24,628 |
public void remove (int index) { Component c = getComponent (index); Integer layer = getLayer (c); decrLayer (layer); componentToLayer.remove (c); super.remove (index); revalidate(); repaint(); } | public void remove (int index) { Component c = getComponent (index); Integer layer = getLayer (c); decrLayer (layer); componentToLayer.remove (c); super.remove (index); revalidate(); repaint(); } | 24,629 |
public void setPosition(Component c, int position) { Integer layer = getLayer (c); int[] range = layerToRange (layer); if (range[0] == range[1]) throw new IllegalArgumentException (); int top = range[0]; int bot = range[1]; if (position == -1) position = (bot - top) - 1; int targ = Math.... | public void setPosition(Component c, int position) { Integer layer = getLayer (c); int[] range = layerToRange (layer); if (range[0] == range[1]) throw new IllegalArgumentException (); int top = range[0]; int bot = range[1]; if (position == -1) position = (bot - top) - 1; int targ = Math.... | 24,630 |
public static int toCodePoint(char high, char low) { return ((high - MIN_HIGH_SURROGATE) << 10) + (low - MIN_LOW_SURROGATE); } | public static int toCodePoint(char high, char low) { return ((high - MIN_HIGH_SURROGATE) * 0x400) + (low - MIN_LOW_SURROGATE) + 0x10000; } | 24,635 |
public DefaultDocumentEvent(int offset, int length, DocumentEvent.EventType type) { this.offset = offset; this.length = length; this.type = type; changes = new Hashtable(); modified = false; } | public DefaultDocumentEvent(int offset, int length, DocumentEvent.EventType type) { this.offset = offset; this.length = length; this.type = type; modified = false; } | 24,636 |
public boolean addEdit(UndoableEdit edit) { // XXX - Fully qualify ElementChange to work around gcj bug #2499. if (edit instanceof DocumentEvent.ElementChange) { modified = true; DocumentEvent.ElementChange elEdit = (DocumentEvent.ElementChange) edit; change... | public boolean addEdit(UndoableEdit edit) { // XXX - Fully qualify ElementChange to work around gcj bug #2499. if (changes == null && edits.size() > THRESHOLD) { modified = true; DocumentEvent.ElementChange elEdit = (DocumentEvent.ElementChange) edit; change... | 24,637 |
public boolean addEdit(UndoableEdit edit) { // XXX - Fully qualify ElementChange to work around gcj bug #2499. if (edit instanceof DocumentEvent.ElementChange) { modified = true; DocumentEvent.ElementChange elEdit = (DocumentEvent.ElementChange) edit; change... | public boolean addEdit(UndoableEdit edit) { // XXX - Fully qualify ElementChange to work around gcj bug #2499. if (edit instanceof DocumentEvent.ElementChange) { changes = new HashMap(); int count = edits.size(); for (int i = 0; i < count; i++) { Object o = edits.elementAt(i); if (o ins... | 24,638 |
public DocumentEvent.ElementChange getChange(Element elem) { // XXX - Fully qualify ElementChange to work around gcj bug #2499. return (DocumentEvent.ElementChange) changes.get(elem); } | public DocumentEvent.ElementChange getChange(Element elem) { // XXX - Fully qualify ElementChange to work around gcj bug #2499. DocumentEvent.ElementChange change = null; if (changes != null) { change = (DocumentEvent.ElementChange) changes.get(elem); } else { int count = edits.size(); for (int i = 0; ... | 24,639 |
public Position createPosition(final int offset) throws BadLocationException { return content.createPosition(offset); } | public synchronized Position createPosition(final int offset) throws BadLocationException { return content.createPosition(offset); } | 24,640 |
protected final Thread getCurrentWriter() { return currentWriter; } | protected final synchronized Thread getCurrentWriter() { return currentWriter; } | 24,644 |
public final void readLock() { if (currentWriter != null && currentWriter.equals(Thread.currentThread())) return; synchronized (documentCV) { while (currentWriter != null || numWritersWaiting > 0) { try { documentCV.wait(); ... | public final synchronized void readLock() { if (currentWriter != null && currentWriter.equals(Thread.currentThread())) return; synchronized (documentCV) { while (currentWriter != null || numWritersWaiting > 0) { try { documentCV.wait(... | 24,645 |
public final void readLock() { if (currentWriter != null && currentWriter.equals(Thread.currentThread())) return; synchronized (documentCV) { while (currentWriter != null || numWritersWaiting > 0) { try { documentCV.wait(); ... | public final void readLock() { if (currentWriter != null && currentWriter.equals(Thread.currentThread())) return; synchronized (documentCV) { while (currentWriter != null || numWritersWaiting > 0) { try { documentCV.wait(); ... | 24,646 |
public final void readLock() { if (currentWriter != null && currentWriter.equals(Thread.currentThread())) return; synchronized (documentCV) { while (currentWriter != null || numWritersWaiting > 0) { try { documentCV.wait(); ... | public final void readLock() { if (currentWriter != null && currentWriter.equals(Thread.currentThread())) return; synchronized (documentCV) { while (currentWriter != null || numWritersWaiting > 0) { try { documentCV.wait(); ... | 24,647 |
public final void readLock() { if (currentWriter != null && currentWriter.equals(Thread.currentThread())) return; synchronized (documentCV) { while (currentWriter != null || numWritersWaiting > 0) { try { documentCV.wait(); ... | public final void readLock() { if (currentWriter != null && currentWriter.equals(Thread.currentThread())) return; synchronized (documentCV) { while (currentWriter != null || numWritersWaiting > 0) { try { documentCV.wait(); ... | 24,648 |
public final void readUnlock() { // Note we could have a problem here if readUnlock was called without a // prior call to readLock but the specs simply warn users to ensure that // balance by using a finally block: // readLock() // try // { // doSomethingHere // } // finally // { ... | public final synchronized void readUnlock() { // Note we could have a problem here if readUnlock was called without a // prior call to readLock but the specs simply warn users to ensure that // balance by using a finally block: // readLock() // try // { // doSomethingHere // } // final... | 24,650 |
public final void readUnlock() { // Note we could have a problem here if readUnlock was called without a // prior call to readLock but the specs simply warn users to ensure that // balance by using a finally block: // readLock() // try // { // doSomethingHere // } // finally // { ... | public final void readUnlock() { // Note we could have a problem here if readUnlock was called without a // prior call to readLock but the specs simply warn users to ensure that // balance by using a finally block: // readLock() // try // { // doSomethingHere // } // finally // { ... | 24,651 |
public final void readUnlock() { // Note we could have a problem here if readUnlock was called without a // prior call to readLock but the specs simply warn users to ensure that // balance by using a finally block: // readLock() // try // { // doSomethingHere // } // finally // { ... | public final void readUnlock() { // Note we could have a problem here if readUnlock was called without a // prior call to readLock but the specs simply warn users to ensure that // balance by using a finally block: // readLock() // try // { // doSomethingHere // } // finally // { ... | 24,652 |
public final void readUnlock() { // Note we could have a problem here if readUnlock was called without a // prior call to readLock but the specs simply warn users to ensure that // balance by using a finally block: // readLock() // try // { // doSomethingHere // } // finally // { ... | public final void readUnlock() { // Note we could have a problem here if readUnlock was called without a // prior call to readLock but the specs simply warn users to ensure that // balance by using a finally block: // readLock() // try // { // doSomethingHere // } // finally // { ... | 24,653 |
public void remove(int offset, int length) throws BadLocationException { if (documentFilter == null) removeImpl(offset, length); else documentFilter.remove(getBypass(), offset, length); } | public void remove(int offset, int length) throws BadLocationException { writeLock(); try { DocumentFilter f = getDocumentFilter(); if (f == null) removeImpl(offset, length); else documentFilter.remove(getBypass(), offset, length); } | 24,654 |
public void remove(int offset, int length) throws BadLocationException { if (documentFilter == null) removeImpl(offset, length); else documentFilter.remove(getBypass(), offset, length); } | public void remove(int offset, int length) throws BadLocationException { if (documentFilter == null) removeImpl(offset, length); else f.remove(getBypass(), offset, length); } finally { writeUnlock(); } } | 24,655 |
void removeImpl(int offset, int length) throws BadLocationException { // The RI silently ignores all requests that have a negative length. // Don't ask my why, but that's how it is. if (length > 0) { if (offset < 0 || offset > getLength()) throw new BadLocationException("Invalid remove ... | void removeImpl(int offset, int length) throws BadLocationException { // The RI silently ignores all requests that have a negative length. // Don't ask my why, but that's how it is. if (length > 0) { if (offset < 0 || offset > getLength()) throw new BadLocationException("Invalid remove ... | 24,656 |
void removeImpl(int offset, int length) throws BadLocationException { // The RI silently ignores all requests that have a negative length. // Don't ask my why, but that's how it is. if (length > 0) { if (offset < 0 || offset > getLength()) throw new BadLocationException("Invalid remove ... | void removeImpl(int offset, int length) throws BadLocationException { // The RI silently ignores all requests that have a negative length. // Don't ask my why, but that's how it is. if (length > 0) { if (offset < 0 || offset > getLength()) throw new BadLocationException("Invalid remove ... | 24,657 |
void removeImpl(int offset, int length) throws BadLocationException { // The RI silently ignores all requests that have a negative length. // Don't ask my why, but that's how it is. if (length > 0) { if (offset < 0 || offset > getLength()) throw new BadLocationException("Invalid remove ... | void removeImpl(int offset, int length) throws BadLocationException { // The RI silently ignores all requests that have a negative length. // Don't ask my why, but that's how it is. if (length > 0) { if (offset < 0 || offset > getLength()) throw new BadLocationException("Invalid remove ... | 24,658 |
protected final void writeLock() { if (currentWriter != null && currentWriter.equals(Thread.currentThread())) return; synchronized (documentCV) { numWritersWaiting++; while (numReaders > 0) { try { documentCV.wait(); } ... | protected final void writeLock() { if (currentWriter != null && currentWriter.equals(Thread.currentThread())) return; synchronized (documentCV) { numWritersWaiting++; while (numReaders > 0) { try { documentCV.wait(); } ... | 24,659 |
protected final void writeLock() { if (currentWriter != null && currentWriter.equals(Thread.currentThread())) return; synchronized (documentCV) { numWritersWaiting++; while (numReaders > 0) { try { documentCV.wait(); } ... | protected final void writeLock() { if (currentWriter != null && currentWriter.equals(Thread.currentThread())) return; synchronized (documentCV) { numWritersWaiting++; while (numReaders > 0) { try { while (numReaders > 0 || currentWriter !=... | 24,660 |
protected final void writeLock() { if (currentWriter != null && currentWriter.equals(Thread.currentThread())) return; synchronized (documentCV) { numWritersWaiting++; while (numReaders > 0) { try { documentCV.wait(); } ... | protected final void writeLock() { if (currentWriter != null && currentWriter.equals(Thread.currentThread())) return; synchronized (documentCV) { numWritersWaiting++; while (numReaders > 0) { try { documentCV.wait(); } ... | 24,661 |
protected final void writeLock() { if (currentWriter != null && currentWriter.equals(Thread.currentThread())) return; synchronized (documentCV) { numWritersWaiting++; while (numReaders > 0) { try { documentCV.wait(); } ... | protected final void writeLock() { if (currentWriter != null && currentWriter.equals(Thread.currentThread())) return; synchronized (documentCV) { numWritersWaiting++; while (numReaders > 0) { try { documentCV.wait(); } ... | 24,662 |
protected final void writeUnlock() { synchronized (documentCV) { if (Thread.currentThread().equals(currentWriter)) { currentWriter = null; documentCV.notifyAll(); } } } | protected final synchronized void writeUnlock() { synchronized (documentCV) { if (Thread.currentThread().equals(currentWriter)) { currentWriter = null; documentCV.notifyAll(); } } } | 24,664 |
protected final void writeUnlock() { synchronized (documentCV) { if (Thread.currentThread().equals(currentWriter)) { currentWriter = null; documentCV.notifyAll(); } } } | protected final void writeUnlock() { synchronized (documentCV) { if (Thread.currentThread().equals(currentWriter)) { currentWriter = null; documentCV.notifyAll(); } } } | 24,665 |
protected final void writeUnlock() { synchronized (documentCV) { if (Thread.currentThread().equals(currentWriter)) { currentWriter = null; documentCV.notifyAll(); } } } | protected final void writeUnlock() { synchronized (documentCV) { if (Thread.currentThread().equals(currentWriter)) { currentWriter = null; documentCV.notifyAll(); } } } | 24,666 |
protected CoderResult encodeLoop (CharBuffer in, ByteBuffer out) { // TODO: Optimize this in the case in.hasArray() / out.hasArray() if (needsByteOrderMark) { if (out.remaining () < 2) return CoderResult.OVERFLOW; put (out, BYTE_ORDER_MARK); needsByteOrderMark = false; }... | protected CoderResult encodeLoop (CharBuffer in, ByteBuffer out) { // TODO: Optimize this in the case in.hasArray() / out.hasArray() if (needsByteOrderMark) { if (out.remaining () < 2) return CoderResult.OVERFLOW; } out.putChar (BYTE_ORDER_MARK); needsByteOrderMark = false; ... | 24,667 |
protected CoderResult encodeLoop (CharBuffer in, ByteBuffer out) { // TODO: Optimize this in the case in.hasArray() / out.hasArray() if (needsByteOrderMark) { if (out.remaining () < 2) return CoderResult.OVERFLOW; put (out, BYTE_ORDER_MARK); needsByteOrderMark = false; }... | protected CoderResult encodeLoop (CharBuffer in, ByteBuffer out) { // TODO: Optimize this in the case in.hasArray() / out.hasArray() if (needsByteOrderMark) { if (out.remaining () < 2) return CoderResult.OVERFLOW; put (out, BYTE_ORDER_MARK); needsByteOrderMark = false; }... | 24,668 |
protected CoderResult encodeLoop (CharBuffer in, ByteBuffer out) { // TODO: Optimize this in the case in.hasArray() / out.hasArray() if (needsByteOrderMark) { if (out.remaining () < 2) return CoderResult.OVERFLOW; put (out, BYTE_ORDER_MARK); needsByteOrderMark = false; }... | protected CoderResult encodeLoop (CharBuffer in, ByteBuffer out) { // TODO: Optimize this in the case in.hasArray() / out.hasArray() if (needsByteOrderMark) { if (out.remaining () < 2) return CoderResult.OVERFLOW; put (out, BYTE_ORDER_MARK); needsByteOrderMark = false; }... | 24,669 |
public ProtocolHandlerFactoryPlugin(PluginDescriptor descriptor) { super(descriptor); this.handlersEp = descriptor.getExtensionPoint("protocols"); reloadHandlers(); } | public ProtocolHandlerFactoryPlugin(PluginDescriptor descriptor) { super(descriptor); this.handlersEp = descriptor.getExtensionPoint("handlers"); reloadHandlers(); } | 24,671 |
protected void dispatchEvent(AWTEvent evt) { if (evt instanceof ActiveEvent) { ActiveEvent active_evt = (ActiveEvent) evt; active_evt.dispatch(); } else { Object source = evt.getSource(); if (source instanceof Component) { Component srccmp = (Component) source; srccmp.dispatchEvent(evt); } else if (s... | protected void dispatchEvent(AWTEvent evt) { if (evt instanceof ActiveEvent) { ActiveEvent active_evt = (ActiveEvent) evt; active_evt.dispatch(); } else { Object source = evt.getSource(); if (source instanceof Component) { Component srccmp = (Component) source; srccmp.dispatchEvent(evt); } else if (s... | 24,672 |
public static long getMostRecentEventTime() { // XXX For now, this ONLY does the current time. return System.currentTimeMillis(); } | public static long getMostRecentEventTime() { EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue(); if (Thread.currentThread() != eq.dispatchThread) // XXX For now, this ONLY does the current time. return System.currentTimeMillis(); } | 24,673 |
public static void invokeAndWait(Runnable runnable) throws InterruptedException, InvocationTargetException { EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue(); Thread current = Thread.currentThread(); if (current == eq.dispatchThread) throw new Error("Can't call invokeAndWait from event dispatch t... | public static void invokeAndWait(Runnable runnable) throws InterruptedException, InvocationTargetException { if (isDispatchThread ()) throw new Error("Can't call invokeAndWait from event dispatch thread"); EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue(); Thread current = Thread.currentThread(); if... | 24,675 |
public static void invokeAndWait(Runnable runnable) throws InterruptedException, InvocationTargetException { EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue(); Thread current = Thread.currentThread(); if (current == eq.dispatchThread) throw new Error("Can't call invokeAndWait from event dispatch t... | public static void invokeAndWait(Runnable runnable) throws InterruptedException, InvocationTargetException { EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue(); Thread current = Thread.currentThread(); if (current == eq.dispatchThread) throw new Error("Can't call invokeAndWait from event dispatch t... | 24,676 |
protected void pop() throws EmptyStackException { if (prev == null) throw new EmptyStackException(); // Don't synchronize both this and prev at the same time, or deadlock could // occur. synchronized (prev) { prev.next = null; } synchronized (this) { int i = next_out; while (i != next_in) { prev.postE... | protected void pop() throws EmptyStackException { if (prev == null) throw new EmptyStackException(); // Don't synchronize both this and prev at the same time, or deadlock could // occur. synchronized (prev) { prev.next = null; } synchronized (this) { int i = next_out; while (i != next_in) { prev.postE... | 24,678 |
public synchronized void postEvent(AWTEvent evt) { if (next != null) { next.postEvent(evt); return; } // FIXME: Security checks? /* Check for any events already on the queue with the same source and ID. */ int i = next_out; while (i != next_in) { AWTEvent qevt = queue[i]; Object src; if (qevt.id =... | public synchronized void postEvent(AWTEvent evt) { if (next != null) { next.postEvent(evt); return; } // FIXME: Security checks? /* Check for any events already on the queue with the same source and ID. */ int i = next_out; while (i != next_in) { AWTEvent qevt = queue[i]; Object src; if (qevt.id =... | 24,680 |
public synchronized void push(EventQueue newEventQueue) { int i = next_out; while (i != next_in) { newEventQueue.postEvent(queue[i]); next_out = i; if (++i == queue.length) i = 0; } next = newEventQueue; newEventQueue.prev = this; } | public synchronized void push(EventQueue newEventQueue) { if (newEventQueue == null) throw new NullPointerException (); if (next != null) { next.push (newEventQueue); return; } if (dispatchThread == null) dispatchThread = new EventDispatchThread(this); int i = next_out; while (i != next_in) { newEventQueue.pos... | 24,681 |
public static View createHTMLView(JComponent c, String html) { // TODO: This might be wrong. Lets see if it turns out good when // the javax.swing.text.html package is in a good shape. HTMLDocument doc = new HTMLDocument(); HTMLEditorKit kit = new HTMLEditorKit(); StringReader reader = new StringReade... | public static View createHTMLView(JComponent c, String html) { // TODO: This might be wrong. Lets see if it turns out good when // the javax.swing.text.html package is in a good shape. HTMLDocument doc = new HTMLDocument(); HTMLEditorKit kit = new HTMLEditorKit(); StringReader reader = new StringReade... | 24,682 |
public static boolean isHTMLString(String s) { // We consider a string to be HTML if it contains both the '<' and '>' // character at least once. return s.contains("<") && s.contains(">"); } | public static boolean isHTMLString(String s) { // We consider a string to be HTML if it contains both the '<' and '>' // character at least once. return (s != null) && s.contains("<") && s.contains(">"); } | 24,683 |
public boolean equals(final Object obj) { if (obj == null) { return false; } if (!(obj instanceof RSAKey)) { return false; } final RSAKey that = (RSAKey) obj; return n.equals(that.getModulus()); } | public boolean equals(final Object obj) if (obj == null) return false; } if (!(obj instanceof RSAKey)) return false; } final RSAKey that = (RSAKey) obj; return n.equals(that.getModulus()); } | 24,684 |
public boolean equals(final Object obj) { if (obj == null) { return false; } if (!(obj instanceof RSAKey)) { return false; } final RSAKey that = (RSAKey) obj; return n.equals(that.getModulus()); } | public boolean equals(final Object obj) { if (obj == null) { return false; } if (!(obj instanceof RSAKey)) { return false; } final RSAKey that = (RSAKey) obj; return n.equals(that.getModulus()); } | 24,685 |
public boolean equals(final Object obj) { if (obj == null) { return false; } if (!(obj instanceof RSAKey)) { return false; } final RSAKey that = (RSAKey) obj; return n.equals(that.getModulus()); } | public boolean equals(final Object obj) { if (obj == null) { return false; if (!(obj instanceof RSAKey)) { return false; final RSAKey that = (RSAKey) obj; return n.equals(that.getModulus()); | 24,686 |
public String toString() { if (str == null) { String ls = SystemProperties.getProperty("line.separator"); str = new StringBuilder().append(ls) .append("defaultFormat=").append(defaultFormat).append(",").append(ls) .append("n=0x").append(n.toString(16)).append(",").append(l... | public String toString() { if (str == null) { String ls = SystemProperties.getProperty("line.separator"); str = new StringBuilder().append(ls) .append("defaultFormat=").append(defaultFormat).append(",").append(ls) .append("n=0x").append(n.toString(16)).append(",").append(l... | 24,687 |
public DataRun(NTFSNonResidentAttribute attr, int offset, long vcn, long previousLCN) { super(attr, offset); // read first byte in type attribute this.type = getUInt8(0); final int lenlen = type & 0xF; final int clusterlen = type >>> 4; this.size = lenlen + clust... | public DataRun(NTFSNonResidentAttribute attr, int offset, long vcn, long previousLCN) { super(attr, offset); // read first byte in type attribute this.type = getUInt8(0); final int lenlen = type & 0xF; final int clusterlen = type >>> 4; this.size = lenlen + clust... | 24,688 |
public DataRun(NTFSNonResidentAttribute attr, int offset, long vcn, long previousLCN) { super(attr, offset); // read first byte in type attribute this.type = getUInt8(0); final int lenlen = type & 0xF; final int clusterlen = type >>> 4; this.size = lenlen + clust... | public DataRun(NTFSNonResidentAttribute attr, int offset, long vcn, long previousLCN) { super(attr, offset); // read first byte in type attribute this.type = getUInt8(0); final int lenlen = type & 0xF; final int clusterlen = type >>> 4; this.size = lenlen + clust... | 24,689 |
public DataRun(NTFSNonResidentAttribute attr, int offset, long vcn, long previousLCN) { super(attr, offset); // read first byte in type attribute this.type = getUInt8(0); final int lenlen = type & 0xF; final int clusterlen = type >>> 4; this.size = lenlen + clust... | public DataRun(NTFSNonResidentAttribute attr, int offset, long vcn, long previousLCN) { super(attr, offset); // read first byte in type attribute this.type = getUInt8(0); final int lenlen = type & 0xF; final int clusterlen = type >>> 4; this.size = lenlen + clust... | 24,690 |
public DataRun(NTFSNonResidentAttribute attr, int offset, long vcn, long previousLCN) { super(attr, offset); // read first byte in type attribute this.type = getUInt8(0); final int lenlen = type & 0xF; final int clusterlen = type >>> 4; this.size = lenlen + clust... | public DataRun(NTFSNonResidentAttribute attr, int offset, long vcn, long previousLCN) { super(attr, offset); // read first byte in type attribute this.type = getUInt8(0); final int lenlen = type & 0xF; final int clusterlen = type >>> 4; this.size = lenlen + clust... | 24,691 |
public DataRun(NTFSNonResidentAttribute attr, int offset, long vcn, long previousLCN) { super(attr, offset); // read first byte in type attribute this.type = getUInt8(0); final int lenlen = type & 0xF; final int clusterlen = type >>> 4; this.size = lenlen + clust... | public DataRun(NTFSNonResidentAttribute attr, int offset, long vcn, long previousLCN) { super(attr, offset); // read first byte in type attribute this.type = getUInt8(0); final int lenlen = type & 0xF; final int clusterlen = type >>> 4; this.size = lenlen + clust... | 24,692 |
public int readClusters(long vcn, byte[] dst, int dstOffset, int nrClusters, int clusterSize, NTFSVolume volume) throws IOException { final long myFirstVcn = getFirstVcn(); final int myLength = getLength(); final long myLastVcn = myFirstVcn + myLength - 1; final long r... | public int readClusters(long vcn, byte[] dst, int dstOffset, int nrClusters, int clusterSize, NTFSVolume volume) throws IOException { final long myFirstVcn = getFirstVcn(); final int myLength = getLength(); final long myLastVcn = myFirstVcn + myLength - 1; final long r... | 24,693 |
protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; // The default Look and Feel happens to use these three purple shades // extensively. Color lightPurple = new Color(0xCC, 0xCC, 0xFF); Color midPurple = new Color(0x99, 0x99, 0xCC); Color darkPurple = new Color(0x6... | protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; // The default Look and Feel happens to use these three purple shades // extensively. Color lightPurple = new Color(0xCC, 0xCC, 0xFF); Color midPurple = new Color(0x99, 0x99, 0xCC); Color darkPurple = new Color(0x6... | 24,695 |
protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; // The default Look and Feel happens to use these three purple shades // extensively. Color lightPurple = new Color(0xCC, 0xCC, 0xFF); Color midPurple = new Color(0x99, 0x99, 0xCC); Color darkPurple = new Color(0x6... | protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; // The default Look and Feel happens to use these three purple shades // extensively. Color lightPurple = new Color(0xCC, 0xCC, 0xFF); Color midPurple = new Color(0x99, 0x99, 0xCC); Color darkPurple = new Color(0x6... | 24,696 |
protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; // The default Look and Feel happens to use these three purple shades // extensively. Color lightPurple = new Color(0xCC, 0xCC, 0xFF); Color midPurple = new Color(0x99, 0x99, 0xCC); Color darkPurple = new Color(0x6... | protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; // The default Look and Feel happens to use these three purple shades // extensively. Color lightPurple = new Color(0xCC, 0xCC, 0xFF); Color midPurple = new Color(0x99, 0x99, 0xCC); Color darkPurple = new Color(0x6... | 24,697 |
public int read() throws IOException { byte[] buf = new byte[1]; int len = read(buf, 0, 1); if (len == -1) { return -1; } int ret = (int) buf[0]; if (ret < 0) { ret += 0x100; } return ret; } | public int read() throws IOException { byte[] buf = new byte[1]; int len = read(buf, 0, 1); if (len == -1) { return -1; } int ret = (int) buf[0]; if (ret < 0) { ret += 0x100; } return ret; } | 24,698 |
public void doPass2(BootableHashMap liveVariables) { setDeadCode(true); if (refs[0] instanceof Variable) { Variable v = (Variable) refs[0]; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } } | public void doPass2(BootableHashMap liveVariables) { setDeadCode(true); if (refs[0] instanceof Variable) { Variable v = (Variable) refs[0]; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } } | 24,699 |
public final Class getCategory() { return Media.class; } | public Class getCategory() { return Media.class; } | 24,701 |
public final String getName() { return "media"; } | public String getName() { return "media"; } | 24,702 |
public static void readAttributeSet(ObjectInputStream in, MutableAttributeSet a) throws ClassNotFoundException, IOException { throw new InternalError("not implemented"); } | public static void readAttributeSet(ObjectInputStream in, MutableAttributeSet a) throws ClassNotFoundException, IOException, NotImplementedException { throw new InternalError("not implemented"); } | 24,705 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.