bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
|---|---|---|
private boolean isBefore(int calYear, int calMonth, int calDayOfMonth, int calDayOfWeek, int calMillis, int mode, int month, int day, int dayOfWeek, int millis) { // This method is called by Calendar, so we mustn't use that class. // We have to do all calculations by hand. // check the months: // XXX - this is not correct: // for the DOW_GE_DOM and DOW_LE_DOM modes the change date may // be in a different month. if (calMonth != month) return calMonth < month; // check the day: switch (mode) { case DOM_MODE: if (calDayOfMonth != day) return calDayOfMonth < day; break; case DOW_IN_MONTH_MODE: { // This computes the day of month of the day of type // "dayOfWeek" that lies in the same (sunday based) week as cal. calDayOfMonth += (dayOfWeek - calDayOfWeek); // Now we convert it to 7 based number (to get a one based offset // after dividing by 7). If we count from the end of the // month, we get want a -7 based number counting the days from // the end: if (day < 0) calDayOfMonth -= getDaysInMonth(calMonth, calYear) + 7; else calDayOfMonth += 6; // day > 0 day < 0 // S M T W T F S S M T W T F S // 7 8 9 10 11 12 -36-35-34-33-32-31 // 13 14 15 16 17 18 19 -30-29-28-27-26-25-24 // 20 21 22 23 24 25 26 -23-22-21-20-19-18-17 // 27 28 29 30 31 32 33 -16-15-14-13-12-11-10 // 34 35 36 -9 -8 -7 // Now we calculate the day of week in month: int week = calDayOfMonth / 7; // day > 0 day < 0 // S M T W T F S S M T W T F S // 1 1 1 1 1 1 -5 -5 -4 -4 -4 -4 // 1 2 2 2 2 2 2 -4 -4 -4 -3 -3 -3 -3 // 2 3 3 3 3 3 3 -3 -3 -3 -2 -2 -2 -2 // 3 4 4 4 4 4 4 -2 -2 -2 -1 -1 -1 -1 // 4 5 5 -1 -1 -1 if (week != day) return week < day; if (calDayOfWeek != dayOfWeek) return calDayOfWeek < dayOfWeek; // daylight savings starts/ends on the given day. break; } case DOW_LE_DOM_MODE: // The greatest sunday before or equal December, 12 // is the same as smallest sunday after or equal December, 6. day -= 6; case DOW_GE_DOM_MODE: // Calculate the day of month of the day of type // "dayOfWeek" that lies before (or on) the given date. calDayOfMonth -= (calDayOfWeek < dayOfWeek ? 7 : 0) + calDayOfWeek - dayOfWeek; if (calDayOfMonth < day) return true; if (calDayOfWeek != dayOfWeek || calDayOfMonth >= day + 7) return false; // now we have the same day break; } // the millis decides: return (calMillis < millis); }
|
private boolean isBefore(int calYear, int calMonth, int calDayOfMonth, int calDayOfWeek, int calMillis, int mode, int month, int day, int dayOfWeek, int millis) { // This method is called by Calendar, so we mustn't use that class. // We have to do all calculations by hand. // check the months: // XXX - this is not correct: // for the DOW_GE_DOM and DOW_LE_DOM modes the change date may // be in a different month. if (calMonth != month) return calMonth < month; // check the day: switch (mode) { case DOM_MODE: if (calDayOfMonth != day) return calDayOfMonth < day; break; case DOW_IN_MONTH_MODE: { // This computes the day of month of the day of type // "dayOfWeek" that lies in the same (sunday based) week as cal. calDayOfMonth += (dayOfWeek - calDayOfWeek); // Now we convert it to 7 based number (to get a one based offset // after dividing by 7). If we count from the end of the // month, we get want a -7 based number counting the days from // the end: if (day < 0) calDayOfMonth -= getDaysInMonth(calMonth, calYear) + 7; else calDayOfMonth += 6; // day > 0 day < 0 // S M T W T F S S M T W T F S // 7 8 9 10 11 12 -36-35-34-33-32-31 // 13 14 15 16 17 18 19 -30-29-28-27-26-25-24 // 20 21 22 23 24 25 26 -23-22-21-20-19-18-17 // 27 28 29 30 31 32 33 -16-15-14-13-12-11-10 // 34 35 36 -9 -8 -7 // Now we calculate the day of week in month: int week = calDayOfMonth / 7; // day > 0 day < 0 // S M T W T F S S M T W T F S // 1 1 1 1 1 1 -5 -5 -4 -4 -4 -4 // 1 2 2 2 2 2 2 -4 -4 -4 -3 -3 -3 -3 // 2 3 3 3 3 3 3 -3 -3 -3 -2 -2 -2 -2 // 3 4 4 4 4 4 4 -2 -2 -2 -1 -1 -1 -1 // 4 5 5 -1 -1 -1 if (week != day) return week < day; if (calDayOfWeek != dayOfWeek) return calDayOfWeek < dayOfWeek; // daylight savings starts/ends on the given day. break; } case DOW_LE_DOM_MODE: // The greatest sunday before or equal December, 12 // is the same as smallest sunday after or equal December, 6. day = Math.abs(day) - 6; case DOW_GE_DOM_MODE: // Calculate the day of month of the day of type // "dayOfWeek" that lies before (or on) the given date. calDayOfMonth -= (calDayOfWeek < dayOfWeek ? 7 : 0) + calDayOfWeek - dayOfWeek; if (calDayOfMonth < day) return true; if (calDayOfWeek != dayOfWeek || calDayOfMonth >= day + 7) return false; // now we have the same day break; } // the millis decides: return (calMillis < millis); }
| 11,820
|
private void readObject(java.io.ObjectInputStream input) throws java.io.IOException, ClassNotFoundException { input.defaultReadObject(); if (serialVersionOnStream == 0) { // initialize the new fields to default values. dstSavings = 60 * 60 * 1000; endMode = DOW_IN_MONTH_MODE; startMode = DOW_IN_MONTH_MODE; serialVersionOnStream = 1; } else { int length = input.readInt(); byte[] byteArray = new byte[length]; input.read(byteArray, 0, length); if (length >= 4) { // Lets hope that Sun does extensions to the serialized // form in a sane manner. startDay = byteArray[0]; startDayOfWeek = byteArray[1]; endDay = byteArray[2]; endDayOfWeek = byteArray[3]; } } }
|
private void readObject(java.io.ObjectInputStream input) throws java.io.IOException, ClassNotFoundException { input.defaultReadObject(); if (serialVersionOnStream == 0) { // initialize the new fields to default values. dstSavings = 60 * 60 * 1000; endMode = DOW_IN_MONTH_MODE; startMode = DOW_IN_MONTH_MODE; serialVersionOnStream = 1; } else { int length = input.readInt(); byte[] byteArray = new byte[length]; input.read(byteArray, 0, length); if (length >= 4) { // Lets hope that Sun does extensions to the serialized // form in a sane manner. startDay = byteArray[0]; startDayOfWeek = byteArray[1]; endDay = byteArray[2]; endDayOfWeek = byteArray[3]; } } }
| 11,821
|
public void setEndRule(int month, int day, int dayOfWeek, int time) { this.endMode = checkRule(month, day, dayOfWeek); this.endMonth = month; // FIXME: XXX: JDK 1.2 allows negative values and has 2 new variations // of this method. this.endDay = Math.abs(day); this.endDayOfWeek = Math.abs(dayOfWeek); this.endTime = time; useDaylight = true; }
|
public void setEndRule(int month, int day, int dayOfWeek, int time) { this.endMode = checkRule(month, day, dayOfWeek); this.endMonth = month; // FIXME: XXX: JDK 1.2 allows negative values and has 2 new variations // of this method. this.endDay = day; this.endDayOfWeek = Math.abs(dayOfWeek); this.endTime = time; useDaylight = true; }
| 11,822
|
public void setStartRule(int month, int day, int dayOfWeek, int time) { this.startMode = checkRule(month, day, dayOfWeek); this.startMonth = month; // FIXME: XXX: JDK 1.2 allows negative values and has 2 new variations // of this method. this.startDay = Math.abs(day); this.startDayOfWeek = Math.abs(dayOfWeek); this.startTime = time; useDaylight = true; }
|
public void setStartRule(int month, int day, int dayOfWeek, int time) { this.startMode = checkRule(month, day, dayOfWeek); this.startMonth = month; // FIXME: XXX: JDK 1.2 allows negative values and has 2 new variations // of this method. this.startDay = day; this.startDayOfWeek = Math.abs(dayOfWeek); this.startTime = time; useDaylight = true; }
| 11,824
|
public void setStartRule(int month, int day, int dayOfWeek, int time) { this.startMode = checkRule(month, day, dayOfWeek); this.startMonth = month; // FIXME: XXX: JDK 1.2 allows negative values and has 2 new variations // of this method. this.startDay = Math.abs(day); this.startDayOfWeek = Math.abs(dayOfWeek); this.startTime = time; useDaylight = true; }
|
public void setStartRule(int month, int day, int dayOfWeek, int time) { this.startMode = checkRule(month, day, dayOfWeek); this.startMonth = month; // FIXME: XXX: JDK 1.2 allows negative values and has 2 new variations // of this method. this.startDay = Math.abs(day); this.startDayOfWeek = Math.abs(dayOfWeek); if (this.startTimeMode == WALL_TIME || this.startTimeMode == STANDARD_TIME) this.startTime = time; else this.startTime = time + this.rawOffset; useDaylight = true; }
| 11,825
|
public String toString() { // the test for useDaylight is an incompatibility to jdk1.2, but // I think this shouldn't hurt. return getClass().getName() + "[" + "id=" + getID() + ",offset=" + rawOffset + ",dstSavings=" + dstSavings + ",useDaylight=" + useDaylight + (useDaylight ? ",startYear=" + startYear + ",startMode=" + startMode + ",startMonth=" + startMonth + ",startDay=" + startDay + ",startDayOfWeek=" + startDayOfWeek + ",startTime=" + startTime + ",endMode=" + endMode + ",endMonth=" + endMonth + ",endDay=" + endDay + ",endDayOfWeek=" + endDayOfWeek + ",endTime=" + endTime : "") + "]"; }
|
public String toString() { // the test for useDaylight is an incompatibility to jdk1.2, but // I think this shouldn't hurt. return getClass().getName() + "[" + "id=" + getID() + ",offset=" + rawOffset + ",dstSavings=" + dstSavings + ",useDaylight=" + useDaylight + (useDaylight ? ",startYear=" + startYear + ",startMode=" + startMode + ",startMonth=" + startMonth + ",startDay=" + startDay + ",startDayOfWeek=" + startDayOfWeek + ",startTime=" + startTime + ",endMode=" + endMode + ",endMonth=" + endMonth + ",endDay=" + endDay + ",endDayOfWeek=" + endDayOfWeek + ",endTime=" + endTime + ",endTimeMode=" + endTimeMode : "") + "]"; }
| 11,826
|
public long write(ByteBuffer[] srcs) throws IOException;
|
long write(ByteBuffer[] srcs, int offset, int length) throws IOException;
| 11,827
|
public long read(ByteBuffer[] srcs) throws IOException;
|
long read(ByteBuffer[] srcs, int offset, int length) throws IOException;
| 11,828
|
getMaxExpansion(int value){ //************ Implement me!!!!!!!!! return(5);}
|
getMaxExpansion(int value){ //************ Implement me!!!!!!!!! return(5);}
| 11,829
|
getOffset(){ return(pos);}
|
getOffset(){ return(pos);}
| 11,830
|
previous(){ --pos; if (pos < 0) return(NULLORDER); String s = str.charAt(pos) + ""; return(rbc.getCollationElementValue(s));}
|
previous(){ --pos; if (pos < 0) return(NULLORDER); String s = str.charAt(pos) + ""; return(rbc.getCollationElementValue(s));}
| 11,831
|
previous(){ --pos; if (pos < 0) return(NULLORDER); String s = str.charAt(pos) + ""; return(rbc.getCollationElementValue(s));}
|
previous(){ --pos; if (pos < 0) return(NULLORDER); String s = str.charAt(pos) + ""; return(rbc.getCollationElementValue(s));}
| 11,832
|
setOffset(int offset){ if (offset < 0) throw new IllegalArgumentException("Negative offset: " + offset); if ((str.length() > 0) && (offset > 0)) throw new IllegalArgumentException("Offset too large: " + offset); else if (offset > (str.length() - 1)) throw new IllegalArgumentException("Offset too large: " + offset); pos = offset;}
|
setOffset(int offset){ if (offset < 0) throw new IllegalArgumentException("Negative offset: " + offset); if ((str.length() > 0) && (offset > 0)) throw new IllegalArgumentException("Offset too large: " + offset); else if (offset > (str.length() - 1)) throw new IllegalArgumentException("Offset too large: " + offset); pos = offset;}
| 11,833
|
setOffset(int offset){ if (offset < 0) throw new IllegalArgumentException("Negative offset: " + offset); if ((str.length() > 0) && (offset > 0)) throw new IllegalArgumentException("Offset too large: " + offset); else if (offset > (str.length() - 1)) throw new IllegalArgumentException("Offset too large: " + offset); pos = offset;}
|
setOffset(int offset){ if (offset < 0) throw new IllegalArgumentException("Negative offset: " + offset); if ((str.length() > 0) && (offset > 0)) throw new IllegalArgumentException("Offset too large: " + offset); else if (offset > (str.length() - 1)) throw new IllegalArgumentException("Offset too large: " + offset); pos = offset;}
| 11,834
|
setOffset(int offset){ if (offset < 0) throw new IllegalArgumentException("Negative offset: " + offset); if ((str.length() > 0) && (offset > 0)) throw new IllegalArgumentException("Offset too large: " + offset); else if (offset > (str.length() - 1)) throw new IllegalArgumentException("Offset too large: " + offset); pos = offset;}
|
setOffset(int offset){ if (offset < 0) throw new IllegalArgumentException("Negative offset: " + offset); if ((str.length() > 0) && (offset > 0)) throw new IllegalArgumentException("Offset too large: " + offset); else if (offset > (str.length() - 1)) throw new IllegalArgumentException("Offset too large: " + offset); pos = offset;}
| 11,835
|
setText(String str){ this.str = str; pos = 0;}
|
setText(String str){ this.str = str; pos = 0;}
| 11,836
|
public static String[] read(InputStream input) { WStringSeqHolder h = new WStringSeqHolder(); h._read(input); return h.value; }
|
public static String[] read(InputStream input) { WStringSeqHolder h = new WStringSeqHolder(); h._read(input); return h.value; }
| 11,837
|
public static void write(OutputStream output, String[] value) { WStringSeqHolder h = new WStringSeqHolder(value); h._write(output); }
|
public static void write(OutputStream output, String[] value) { WStringSeqHolder h = new WStringSeqHolder(value); h._write(output); }
| 11,838
|
public WStringSeqHolder(String[] initial_value) { value = initial_value; typecode.setLength(value.length); }
|
public WStringSeqHolder() { value = initial_value; typecode.setLength(value.length); }
| 11,839
|
public WStringSeqHolder(String[] initial_value) { value = initial_value; typecode.setLength(value.length); }
|
public WStringSeqHolder(String[] initial_value) { value = initial_value; typecode.setLength(value.length); }
| 11,840
|
public BigDecimal (BigInteger num, int scale) throws NumberFormatException { if (scale < 0) throw new NumberFormatException ("scale of " + scale + " is < 0"); this.intVal = num; this.scale = scale; }
|
public BigDecimal (BigInteger num) { if (scale < 0) throw new NumberFormatException ("scale of " + scale + " is < 0"); this.intVal = num; this.scale = scale; }
| 11,841
|
public BigDecimal (BigInteger num, int scale) throws NumberFormatException { if (scale < 0) throw new NumberFormatException ("scale of " + scale + " is < 0"); this.intVal = num; this.scale = scale; }
|
public BigDecimal (BigInteger num, int scale) throws NumberFormatException { if (scale < 0) throw new NumberFormatException ("scale of " + scale + " is < 0"); this.intVal = num; this.scale = scale; }
| 11,842
|
protected void paintString(Graphics g, int x, int y, int width, int height, int amountFull, Insets b) { String str = progressBar.getString(); int full = getAmountFull(b, width, height); Point placement = getStringPlacement(g, progressBar.getString(), x + b.left, y + b.top, width - b.left - b.right, height - b.top - b.bottom); Color savedColor = g.getColor(); Shape savedClip = g.getClip(); if (progressBar.getOrientation() == JProgressBar.VERTICAL) { AffineTransform rotate = AffineTransform.getRotateInstance(Math.PI / 2); g.setFont(progressBar.getFont().deriveFont(rotate)); } g.setColor(getSelectionForeground()); g.setClip(0, 0, full + b.left, height); g.drawString(str, placement.x, placement.y); g.setColor(getSelectionBackground()); g.setClip(full + b.left, 0, width - full, height); g.drawString(str, placement.x, placement.y); g.setClip(savedClip); g.setColor(savedColor); }
|
protected void paintString(Graphics g, int x, int y, int width, int height, int amountFull, Insets b) { String str = progressBar.getString(); int full = getAmountFull(b, width, height); Point placement = getStringPlacement(g, progressBar.getString(), x + b.left, y + b.top, width - b.left - b.right, height - b.top - b.bottom); Color savedColor = g.getColor(); Shape savedClip = g.getClip(); if (progressBar.getOrientation() == JProgressBar.VERTICAL) { AffineTransform rotate = AffineTransform.getRotateInstance(Math.PI / 2); g.setFont(progressBar.getFont().deriveFont(rotate)); } g.setColor(getSelectionForeground()); g.setClip(0, 0, full + b.left, height); g.drawString(str, placement.x, placement.y + fm.getAscent()); g.setColor(getSelectionBackground()); g.setClip(full + b.left, 0, width - full, height); g.drawString(str, placement.x, placement.y + fm.getAscent()); g.setClip(savedClip); g.setColor(savedColor); }
| 11,843
|
public Font deriveFont (AffineTransform a){ if (a == null) throw new IllegalArgumentException ("Affine transformation is null"); return peer.deriveFont (this, a);}
|
public Font deriveFont (int style, float size){ if (a == null) throw new IllegalArgumentException ("Affine transformation is null"); return peer.deriveFont (this, a);}
| 11,844
|
public Font deriveFont (AffineTransform a){ if (a == null) throw new IllegalArgumentException ("Affine transformation is null"); return peer.deriveFont (this, a);}
|
public Font deriveFont (AffineTransform a){ if (a == null) throw new IllegalArgumentException ("Affine transformation is null"); return peer.deriveFont (this, a);}
| 11,845
|
public final SelectableChannel configureBlocking (boolean block) throws IOException { synchronized (LOCK) { blocking = true; implConfigureBlocking (block); } return this; }
|
public final SelectableChannel configureBlocking(boolean blocking) throws IOException { synchronized (LOCK) { blocking = true; implConfigureBlocking (block); } return this; }
| 11,846
|
public final SelectableChannel configureBlocking (boolean block) throws IOException { synchronized (LOCK) { blocking = true; implConfigureBlocking (block); } return this; }
|
public final SelectableChannel configureBlocking (boolean block) throws IOException { synchronized (blockingLock()) { blocking = true; implConfigureBlocking (block); } return this; }
| 11,847
|
public final SelectableChannel configureBlocking (boolean block) throws IOException { synchronized (LOCK) { blocking = true; implConfigureBlocking (block); } return this; }
|
public final SelectableChannel configureBlocking (boolean block) throws IOException { synchronized (LOCK) { blocking = true; implConfigureBlocking (block); } return this; }
| 11,848
|
protected abstract void implConfigureBlocking (boolean block) throws IOException;
|
protected abstract void implConfigureBlocking(boolean blocking) throws IOException;
| 11,849
|
public final boolean isRegistered() { return registered > 0; }
|
public final boolean isRegistered() { return ! keys.isEmpty(); }
| 11,850
|
public final SelectionKey keyFor(Selector selector) { try { return register (selector, 0, null); } catch (Exception e) { return null; } }
|
public final SelectionKey keyFor(Selector selector) { try { synchronized (blockingLock()) { return locate(selector); } } catch (Exception e) { return null; } }
| 11,851
|
private SelectionKey locate (Selector selector) { if (keys == null) return null; SelectionKey k = null; ListIterator it = keys.listIterator (); while (it.hasNext ()) { k = (SelectionKey) it.next (); if (k.selector () == selector) { return k; } } return k; }
|
private SelectionKey locate (Selector selector) { if (keys == null) return null; SelectionKey k = null; ListIterator it = keys.listIterator (); while (it.hasNext ()) { k = (SelectionKey) it.next (); if (k.selector () == selector) { return k; } } return k; }
| 11,852
|
private SelectionKey locate (Selector selector) { if (keys == null) return null; SelectionKey k = null; ListIterator it = keys.listIterator (); while (it.hasNext ()) { k = (SelectionKey) it.next (); if (k.selector () == selector) { return k; } } return k; }
|
private SelectionKey locate (Selector selector) { if (keys == null) return null; SelectionKey k = null; ListIterator it = keys.listIterator (); while (it.hasNext ()) { k = (SelectionKey) it.next (); if (k.selector () == selector) { return k; } } return k; }
| 11,853
|
private SelectionKey locate (Selector selector) { if (keys == null) return null; SelectionKey k = null; ListIterator it = keys.listIterator (); while (it.hasNext ()) { k = (SelectionKey) it.next (); if (k.selector () == selector) { return k; } } return k; }
|
private SelectionKey locate (Selector selector) { if (keys == null) return null; SelectionKey k = null; ListIterator it = keys.listIterator (); while (it.hasNext ()) { k = (SelectionKey) it.next (); if (k.selector () == selector) { return k; } } return k; }
| 11,854
|
private SelectionKey locate (Selector selector) { if (keys == null) return null; SelectionKey k = null; ListIterator it = keys.listIterator (); while (it.hasNext ()) { k = (SelectionKey) it.next (); if (k.selector () == selector) { return k; } } return k; }
|
private SelectionKey locate (Selector selector) { if (keys == null) return null; SelectionKey k = null; ListIterator it = keys.listIterator (); while (it.hasNext ()) { k = (SelectionKey) it.next (); if (k.selector () == selector) { return null; } } return null; }
| 11,855
|
public final SelectionKey register (Selector selin, int ops, Object att) throws ClosedChannelException { if (!isOpen ()) throw new ClosedChannelException(); SelectionKey k = null; AbstractSelector selector = (AbstractSelector) selin; synchronized (LOCK) { k = locate (selector); if (k != null) { k.attach (att); } else { k = selector.register (this, ops, att); if (k != null) add (k); } } return k; }
|
public final SelectionKey register (Selector selin, int ops, Object att) throws ClosedChannelException { if (!isOpen ()) throw new ClosedChannelException(); if ((ops & ~validOps()) != 0) throw new IllegalArgumentException(); SelectionKey key = null; AbstractSelector selector = (AbstractSelector) selin; synchronized (LOCK) { k = locate (selector); if (k != null) { k.attach (att); } else { k = selector.register (this, ops, att); if (k != null) add (k); } } return k; }
| 11,856
|
public final SelectionKey register (Selector selin, int ops, Object att) throws ClosedChannelException { if (!isOpen ()) throw new ClosedChannelException(); SelectionKey k = null; AbstractSelector selector = (AbstractSelector) selin; synchronized (LOCK) { k = locate (selector); if (k != null) { k.attach (att); } else { k = selector.register (this, ops, att); if (k != null) add (k); } } return k; }
|
public final SelectionKey register (Selector selin, int ops, Object att) throws ClosedChannelException { if (!isOpen ()) throw new ClosedChannelException(); SelectionKey k = null; AbstractSelector selector = (AbstractSelector) selin; synchronized (blockingLock()) { k = locate (selector); if (k != null) { k.attach (att); } else { k = selector.register (this, ops, att); if (k != null) add (k); } } return k; }
| 11,857
|
public final SelectionKey register (Selector selin, int ops, Object att) throws ClosedChannelException { if (!isOpen ()) throw new ClosedChannelException(); SelectionKey k = null; AbstractSelector selector = (AbstractSelector) selin; synchronized (LOCK) { k = locate (selector); if (k != null) { k.attach (att); } else { k = selector.register (this, ops, att); if (k != null) add (k); } } return k; }
|
public final SelectionKey register (Selector selin, int ops, Object att) throws ClosedChannelException { if (!isOpen ()) throw new ClosedChannelException(); SelectionKey k = null; AbstractSelector selector = (AbstractSelector) selin; synchronized (LOCK) { key = locate(selector); if (k != null) { k.attach (att); } else { k = selector.register (this, ops, att); if (k != null) add (k); } } return k; }
| 11,858
|
public final SelectionKey register (Selector selin, int ops, Object att) throws ClosedChannelException { if (!isOpen ()) throw new ClosedChannelException(); SelectionKey k = null; AbstractSelector selector = (AbstractSelector) selin; synchronized (LOCK) { k = locate (selector); if (k != null) { k.attach (att); } else { k = selector.register (this, ops, att); if (k != null) add (k); } } return k; }
|
public final SelectionKey register (Selector selin, int ops, Object att) throws ClosedChannelException { if (!isOpen ()) throw new ClosedChannelException(); SelectionKey k = null; AbstractSelector selector = (AbstractSelector) selin; synchronized (LOCK) { k = locate (selector); if (key != null) { k.attach (att); } else { k = selector.register (this, ops, att); if (key != null) add (k); } } return k; }
| 11,859
|
public final SelectionKey register (Selector selin, int ops, Object att) throws ClosedChannelException { if (!isOpen ()) throw new ClosedChannelException(); SelectionKey k = null; AbstractSelector selector = (AbstractSelector) selin; synchronized (LOCK) { k = locate (selector); if (k != null) { k.attach (att); } else { k = selector.register (this, ops, att); if (k != null) add (k); } } return k; }
|
public final SelectionKey register (Selector selin, int ops, Object att) throws ClosedChannelException { if (!isOpen ()) throw new ClosedChannelException(); SelectionKey k = null; AbstractSelector selector = (AbstractSelector) selin; synchronized (LOCK) { k = locate (selector); if (k != null) { if (att != null) key.attach(att); } else { k = selector.register (this, ops, att); if (k != null) add (k); } } return k; }
| 11,860
|
public final SelectionKey register (Selector selin, int ops, Object att) throws ClosedChannelException { if (!isOpen ()) throw new ClosedChannelException(); SelectionKey k = null; AbstractSelector selector = (AbstractSelector) selin; synchronized (LOCK) { k = locate (selector); if (k != null) { k.attach (att); } else { k = selector.register (this, ops, att); if (k != null) add (k); } } return k; }
|
public final SelectionKey register (Selector selin, int ops, Object att) throws ClosedChannelException { if (!isOpen ()) throw new ClosedChannelException(); SelectionKey k = null; AbstractSelector selector = (AbstractSelector) selin; synchronized (LOCK) { k = locate (selector); if (k != null) { k.attach (att); } else { key = selector.register(this, ops, att); if (key != null) addSelectionKey(key); } } if (k != null) add (k); } } return k; }
| 11,861
|
public final SelectionKey register (Selector selin, int ops, Object att) throws ClosedChannelException { if (!isOpen ()) throw new ClosedChannelException(); SelectionKey k = null; AbstractSelector selector = (AbstractSelector) selin; synchronized (LOCK) { k = locate (selector); if (k != null) { k.attach (att); } else { k = selector.register (this, ops, att); if (k != null) add (k); } } return k; }
|
public final SelectionKey register (Selector selin, int ops, Object att) throws ClosedChannelException { if (!isOpen ()) throw new ClosedChannelException(); SelectionKey k = null; AbstractSelector selector = (AbstractSelector) selin; synchronized (LOCK) { k = locate (selector); if (k != null) { k.attach (att); } else { k = selector.register (this, ops, att); if (k != null) add (k); } } return k; }
| 11,862
|
public final SelectionKey register (Selector selin, int ops, Object att) throws ClosedChannelException { if (!isOpen ()) throw new ClosedChannelException(); SelectionKey k = null; AbstractSelector selector = (AbstractSelector) selin; synchronized (LOCK) { k = locate (selector); if (k != null) { k.attach (att); } else { k = selector.register (this, ops, att); if (k != null) add (k); } } return k; }
|
public final SelectionKey register (Selector selin, int ops, Object att) throws ClosedChannelException { if (!isOpen ()) throw new ClosedChannelException(); SelectionKey k = null; AbstractSelector selector = (AbstractSelector) selin; synchronized (LOCK) { k = locate (selector); if (k != null) { k.attach (att); } else { k = selector.register (this, ops, att); if (k != null) add (k); } } return k; }
| 11,863
|
public boolean equals(Object o) { if (! (o instanceof GregorianCalendar)) return false; GregorianCalendar cal = (GregorianCalendar) o; return (cal.getTimeInMillis() == getTimeInMillis()); }
|
public boolean equals(Object o) { if (! (o instanceof GregorianCalendar)) return false; GregorianCalendar cal = (GregorianCalendar) o; return (cal.gregorianCutover == gregorianCutover && super.equals(o)); }
| 11,864
|
public MetalButtonUI() { super(); focusColor = getFocusColor(); selectColor = getSelectColor(); disabledTextColor = getDisabledTextColor(); }
|
public MetalButtonUI() { super(); focusColor = getFocusColor(); selectColor = getSelectColor(); disabledTextColor = getDisabledTextColor(); }
| 11,865
|
public static ComponentUI createUI(JComponent component) { if (instance == null) instance = new MetalButtonUI(); return instance; }
|
public static ComponentUI createUI(JComponent component) { if (instance == null) instance = new MetalButtonUI(); return instance; }
| 11,866
|
public void installDefaults(AbstractButton button) { super.installDefaults(button); UIDefaults defaults = UIManager.getLookAndFeelDefaults(); button.setFont(defaults.getFont("Button.font")); if (button.getParent() instanceof JToolBar) button.setBorder(MetalBorders.getToolbarButtonBorder()); }
|
public void installDefaults(AbstractButton button) { super.installDefaults(button); UIDefaults defaults = UIManager.getLookAndFeelDefaults(); button.setFont(defaults.getFont("Button.font")); if (button.getParent() instanceof JToolBar) button.setBorder(MetalBorders.getToolbarButtonBorder()); }
| 11,867
|
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); menuBar.setBackground(defaults.getColor("MenuBar.background")); menuBar.setBorder(defaults.getBorder("MenuBar.border")); menuBar.setFont(defaults.getFont("MenuBar.font")); menuBar.setForeground(defaults.getColor("MenuBar.foreground")); menuBar.setOpaque(true); }
|
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); menuBar.setBackground(defaults.getColor("MenuBar.background")); menuBar.setBorder(defaults.getBorder("MenuBar.border")); menuBar.setFont(defaults.getFont("MenuBar.font")); menuBar.setForeground(defaults.getColor("MenuBar.foreground")); menuBar.setOpaque(true); }
| 11,868
|
public static void main(String[] args) throws SyntaxErrorException { ParsedArguments cmdLine = HELP_INFO.parse(args); DeviceManager dm; try { dm = InitialNaming.lookup(DeviceManager.NAME); boolean isAction = PARAM_ACTION.isSet(cmdLine); boolean isInitMBR = PARAM_INITMBR.isSet(cmdLine); boolean isDevice = PARAM_DEVICE.isSet(cmdLine); // no parameters if (!isDevice) { listAvailableDevice(dm); return; } // only device is set if (!isAction && !isInitMBR && isDevice) { printTable(ARG_DEVICE.getValue(cmdLine), dm); return; } // initMBR if (isInitMBR) { initMbr(ARG_DEVICE.getValue(cmdLine), dm); return; } // now it is a change on a specific partition so read the table IDEDevice current = (IDEDevice)dm.getDevice(ARG_DEVICE.getValue(cmdLine)); BlockDeviceAPI api = current.getAPI(BlockDeviceAPI.class); ByteBuffer mbr = ByteBuffer.allocate(IDEConstants.SECTOR_SIZE); api.read(0, mbr); if (!IBMPartitionTable.containsPartitionTable(mbr.array())) throw new IOException("This device doesn't contain a valid MBR, use --initmbr."); BootSector bs = new BootSector(mbr.array()); if (ACTION.getValue(cmdLine).intern() == "-m") { modifyPartition(PARTITION.getValue(cmdLine), api, bs); bs.write(api); return; } // it is not a modify so the PARTITION parameter is only a partition // number int partNumber; try { partNumber = Integer.parseInt(PARTITION.getValue(cmdLine)); } catch (NumberFormatException f) { throw new IllegalArgumentException("Partition number is invalid"); } if (partNumber > 3 || partNumber < 0) throw new IllegalArgumentException("Partition number is invalid"); if (ACTION.getValue(cmdLine).intern() == "-d") { deletePartition(bs, partNumber); bs.write(api); return; } if (ACTION.getValue(cmdLine).intern() == "-b") { toggleBootable(bs, partNumber); bs.write(api); } } catch (IOException e) { e.printStackTrace(); } catch (NameNotFoundException e) { e.printStackTrace(); } catch (ApiNotFoundException e) { e.printStackTrace(); } catch (DeviceNotFoundException e) { e.printStackTrace(); } }
|
public static void main(String[] args) throws SyntaxErrorException { ParsedArguments cmdLine = HELP_INFO.parse(args); DeviceManager dm; try { dm = InitialNaming.lookup(DeviceManager.NAME); boolean isAction = PARAM_ACTION.isSet(cmdLine); boolean isInitMBR = PARAM_INITMBR.isSet(cmdLine); boolean isDevice = PARAM_DEVICE.isSet(cmdLine); // no parameters if (!isDevice) { listAvailableDevice(dm); return; } // only device is set if (!isAction && !isInitMBR && isDevice) { printTable(ARG_DEVICE.getValue(cmdLine), dm); return; } // initMBR if (isInitMBR) { initMbr(ARG_DEVICE.getValue(cmdLine), dm); return; } // now it is a change on a specific partition so read the table IDEDevice current = (IDEDevice)dm.getDevice(ARG_DEVICE.getValue(cmdLine)); BlockDeviceAPI api = current.getAPI(BlockDeviceAPI.class); ByteBuffer mbr = ByteBuffer.allocate(IDEConstants.SECTOR_SIZE); api.read(0, mbr); if (!IBMPartitionTable.containsPartitionTable(mbr.array())) throw new IOException("This device doesn't contain a valid MBR, use --initmbr."); BootSector bs = new BootSector(mbr.array()); if (ACTION.getValue(cmdLine).intern() == "-m") { modifyPartition(PARTITION.getValue(cmdLine), api, bs, current); bs.write(api); return; } // it is not a modify so the PARTITION parameter is only a partition // number int partNumber; try { partNumber = Integer.parseInt(PARTITION.getValue(cmdLine)); } catch (NumberFormatException f) { throw new IllegalArgumentException("Partition number is invalid"); } if (partNumber > 3 || partNumber < 0) throw new IllegalArgumentException("Partition number is invalid"); if (ACTION.getValue(cmdLine).intern() == "-d") { deletePartition(bs, partNumber); bs.write(api); return; } if (ACTION.getValue(cmdLine).intern() == "-b") { toggleBootable(bs, partNumber); bs.write(api); } } catch (IOException e) { e.printStackTrace(); } catch (NameNotFoundException e) { e.printStackTrace(); } catch (ApiNotFoundException e) { e.printStackTrace(); } catch (DeviceNotFoundException e) { e.printStackTrace(); } }
| 11,869
|
private static void modifyPartition(String description, BlockDeviceAPI api, BootSector bs) throws IOException { // arg 1 should be in the form id:start:size:fs StringTokenizer st = new StringTokenizer(description, ":"); int id = Integer.parseInt(st.nextToken()); //BUG in long //long start = Long.parseLong(st.nextToken()); //long size = Long.parseLong(st.nextToken()); int start = Integer.parseInt(st.nextToken()); int size = Integer.parseInt(st.nextToken()); int fs = Integer.parseInt(st.nextToken(), 16); System.out.println( "Init " + id + " with start = " + start + ", size = " + size + ", fs = " + Integer.toHexString(fs & 0xff)); IBMPartitionTableEntry entry = bs.getPartition(id); entry.setBootIndicator(false); entry.setSystemIndicator(fs); entry.setStartLba(start); entry.setNrSectors(size); bs.write(api); return; }
|
private static void modifyPartition(String description, BlockDeviceAPI api, BootSector bs, Device dev) throws IOException { // arg 1 should be in the form id:start:size:fs StringTokenizer st = new StringTokenizer(description, ":"); int id = Integer.parseInt(st.nextToken()); //BUG in long //long start = Long.parseLong(st.nextToken()); //long size = Long.parseLong(st.nextToken()); int start = Integer.parseInt(st.nextToken()); int size = Integer.parseInt(st.nextToken()); int fs = Integer.parseInt(st.nextToken(), 16); System.out.println( "Init " + id + " with start = " + start + ", size = " + size + ", fs = " + Integer.toHexString(fs & 0xff)); IBMPartitionTableEntry entry = bs.getPartition(id); entry.setBootIndicator(false); entry.setSystemIndicator(fs); entry.setStartLba(start); entry.setNrSectors(size); bs.write(api); return; }
| 11,870
|
postEvent(Event event) { boolean retVal = false; MenuContainer parent = getParent(); if (parent == null) { if (this instanceof MenuBar) { MenuBar menuBar = (MenuBar) this; if (menuBar.frame != null) retVal = menuBar.frame.postEvent(event); } } else retVal = parent.postEvent(event); return retVal; }
|
postEvent(Event event) { boolean retVal = false; MenuContainer parent = getParent(); if (parent == null) { if (this instanceof MenuBar) { MenuBar menuBar = (MenuBar) this; if (menuBar.frame != null) retVal = menuBar.frame.postEvent(event); } } else retVal = parent.postEvent(event); return retVal; }
| 11,873
|
public float getLSB () throws NotImplementedException { throw new Error ("not implemented"); }
|
public float getLSB () throws NotImplementedException { throw new Error ("not implemented"); }
| 11,874
|
public float getLSB () throws NotImplementedException { throw new Error ("not implemented"); }
|
public float getLSB () throws NotImplementedException { if (horizontal) return (float) bounds.getX(); return (float) bounds.getY(); }
| 11,875
|
public float getRSB () throws NotImplementedException { throw new Error ("not implemented"); }
|
public float getRSB () throws NotImplementedException { throw new Error ("not implemented"); }
| 11,876
|
public float getRSB () throws NotImplementedException { throw new Error ("not implemented"); }
|
public float getRSB () throws NotImplementedException { if (horizontal) return (float) (advanceX - (bounds.getX() + bounds.getWidth())); return (float) (advanceY - (bounds.getY() + bounds.getHeight())); }
| 11,877
|
public boolean implies(Permission perm) { for (Iterator i = list.iterator(); i.hasNext(); ) { final Permission p = (Permission)i.next(); if (p.implies(perm)) { return true; } } return false; }
|
public boolean implies(Permission perm) { for (Iterator i = list.iterator(); i.hasNext(); ) { final Permission p = (Permission)i.next(); if (p.implies(perm)) { return true; } } return false; }
| 11,878
|
public ServerSocketChannel(SelectorProvider provider) { super(provider); }
|
protected ServerSocketChannel(SelectorProvider provider) { super(provider); }
| 11,879
|
public void actionPerformed(ActionEvent ev) { caret.setVisible(!caret.isVisible()); }
|
public void actionPerformed(ActionEvent ev) { Caret c = caret; if (c != null) c.setVisible(!c.isVisible()); }
| 11,881
|
public void update() { stop(); setDelay(caret.getBlinkRate()); if (editable) start(); else caret.setVisible(false); }
|
public void update() { stop(); Caret c = caret; if (c != null) { setDelay(c.getBlinkRate()); if (editable) start(); else caret.setVisible(false); }
| 11,882
|
public void update() { stop(); setDelay(caret.getBlinkRate()); if (editable) start(); else caret.setVisible(false); }
|
public void update() { stop(); setDelay(caret.getBlinkRate()); if (editable) start(); else c.setVisible(false); } }
| 11,883
|
public Object getObject() throws IOException, ClassNotFoundException { ByteArrayInputStream istream = new ByteArrayInputStream(content); return new ObjectInputStream(istream).readObject(); }
|
public Object getObject() throws IOException, ClassNotFoundException { ByteArrayInputStream bais = new ByteArrayInputStream(content); ObjectInput oi = new ObjectInputStream(bais); Object obj = oi.readObject(); oi.close(); bais.close(); return new ObjectInputStream(istream).readObject(); }
| 11,885
|
public Object getObject() throws IOException, ClassNotFoundException { ByteArrayInputStream istream = new ByteArrayInputStream(content); return new ObjectInputStream(istream).readObject(); }
|
public Object getObject() throws IOException, ClassNotFoundException { ByteArrayInputStream istream = new ByteArrayInputStream(content); return obj; }
| 11,886
|
public byte[] getSignature() { return signature; }
|
public byte[] getSignature() { return (byte[]) signature.clone(); }
| 11,887
|
private Provider () { extendedLoaded = false; canonicalNames = new HashMap (); charsets = new HashMap (); // US-ASCII aka ISO646-US addCharset (new US_ASCII ()); // ISO-8859-1 aka ISO-LATIN-1 addCharset (new ISO_8859_1 ()); // UTF-8 addCharset (new UTF_8 ()); // UTF-16BE addCharset (new UTF_16BE ()); // UTF-16LE addCharset (new UTF_16LE ()); // UTF-16 addCharset (new UTF_16 ()); // UTF-16LE (marked) addCharset (new UnicodeLittle ()); // Windows-1250 aka cp-1250 (East European) addCharset (new Windows1250 ()); // Windows-1251 (Cyrillic) addCharset (new Windows1251 ()); // Windows-1252 aka cp-1252 (Latin-1) addCharset (new Windows1252 ()); // Windows-1253 (Greek) addCharset (new Windows1253 ()); // Windows-1254 (Turkish) addCharset (new Windows1254 ()); // Windows-1257 (Baltic) addCharset (new Windows1257 ()); // ISO-8859-2 aka ISO-LATIN-2 addCharset (new ISO_8859_2 ()); // ISO-8859-4 aka ISO-LATIN-4 addCharset (new ISO_8859_4 ()); // ISO-8859-5 (Cyrillic) addCharset (new ISO_8859_5 ()); // ISO-8859-7 (Greek) addCharset (new ISO_8859_7 ()); // ISO-8859-9 aka ISO-LATIN-5 addCharset (new ISO_8859_9 ()); // ISO-8859-13 aka ISO-LATIN-7 addCharset (new ISO_8859_13 ()); // ISO-8859-15 aka ISO-LATIN-9 addCharset (new ISO_8859_15 ()); // KOI8 (Cyrillic) addCharset (new KOI_8 ()); }
|
Provider () { extendedLoaded = false; canonicalNames = new HashMap (); charsets = new HashMap (); // US-ASCII aka ISO646-US addCharset (new US_ASCII ()); // ISO-8859-1 aka ISO-LATIN-1 addCharset (new ISO_8859_1 ()); // UTF-8 addCharset (new UTF_8 ()); // UTF-16BE addCharset (new UTF_16BE ()); // UTF-16LE addCharset (new UTF_16LE ()); // UTF-16 addCharset (new UTF_16 ()); // UTF-16LE (marked) addCharset (new UnicodeLittle ()); // Windows-1250 aka cp-1250 (East European) addCharset (new Windows1250 ()); // Windows-1251 (Cyrillic) addCharset (new Windows1251 ()); // Windows-1252 aka cp-1252 (Latin-1) addCharset (new Windows1252 ()); // Windows-1253 (Greek) addCharset (new Windows1253 ()); // Windows-1254 (Turkish) addCharset (new Windows1254 ()); // Windows-1257 (Baltic) addCharset (new Windows1257 ()); // ISO-8859-2 aka ISO-LATIN-2 addCharset (new ISO_8859_2 ()); // ISO-8859-4 aka ISO-LATIN-4 addCharset (new ISO_8859_4 ()); // ISO-8859-5 (Cyrillic) addCharset (new ISO_8859_5 ()); // ISO-8859-7 (Greek) addCharset (new ISO_8859_7 ()); // ISO-8859-9 aka ISO-LATIN-5 addCharset (new ISO_8859_9 ()); // ISO-8859-13 aka ISO-LATIN-7 addCharset (new ISO_8859_13 ()); // ISO-8859-15 aka ISO-LATIN-9 addCharset (new ISO_8859_15 ()); // KOI8 (Cyrillic) addCharset (new KOI_8 ()); }
| 11,888
|
public Charset charsetForName (String charsetName) { Charset cs = (Charset) charsets.get(canonicalNames.get(charsetName.toLowerCase())); if(cs == null && !extendedLoaded) { loadExtended(); cs = (Charset) charsets.get(canonicalNames.get(charsetName.toLowerCase())); } return cs; }
|
public Charset charsetForName (String charsetName) { Charset cs = (Charset) charsets.get(canonicalNames.get(charsetName.toLowerCase())); if (cs == null) { loadExtended(); cs = (Charset) charsets.get(canonicalNames.get(charsetName.toLowerCase())); } return cs; }
| 11,889
|
private void loadExtended () { if(extendedLoaded) return; addCharset (new ISO_8859_3 ()); // ISO-8859-3 aka ISO-LATIN-3 addCharset (new ISO_8859_6 ()); // ISO-8859-6 (Arabic) addCharset (new ISO_8859_8 ()); // ISO-8859-8 (Hebrew) // Some more codepages addCharset (new Cp855()); // IBM Cyrillic addCharset (new Cp857()); // IBM Turkish addCharset (new Cp860()); // MSDOS Portugese addCharset (new Cp861()); // MSDOS Icelandic addCharset (new Cp862()); // PC Hebrew addCharset (new Cp863()); // MSDOS Can. French addCharset (new Cp864()); // PC Arabic addCharset (new Cp865()); // MSDOS Nordic addCharset (new Cp866()); // MSDOS Russian addCharset (new Cp869()); // IBM modern Greek addCharset (new Cp874()); // IBM Thai extendedLoaded = true; }
|
private synchronized void loadExtended () { if(extendedLoaded) return; addCharset (new ISO_8859_3 ()); // ISO-8859-3 aka ISO-LATIN-3 addCharset (new ISO_8859_6 ()); // ISO-8859-6 (Arabic) addCharset (new ISO_8859_8 ()); // ISO-8859-8 (Hebrew) // Some more codepages addCharset (new Cp855()); // IBM Cyrillic addCharset (new Cp857()); // IBM Turkish addCharset (new Cp860()); // MSDOS Portugese addCharset (new Cp861()); // MSDOS Icelandic addCharset (new Cp862()); // PC Hebrew addCharset (new Cp863()); // MSDOS Can. French addCharset (new Cp864()); // PC Arabic addCharset (new Cp865()); // MSDOS Nordic addCharset (new Cp866()); // MSDOS Russian addCharset (new Cp869()); // IBM modern Greek addCharset (new Cp874()); // IBM Thai extendedLoaded = true; }
| 11,890
|
public Windows1250() { super("Windows-1250", new String[] { "Windows1250", "ibm-5346_P100-1998", "ibm-5346", "cp1250", "cp-1250", "cp_1250", "windows1250", "windows_1250" }); lookupTable = lookup; }
|
public Windows1250() { super("windows-1250", new String[] { "Windows1250", "ibm-5346_P100-1998", "ibm-5346", "cp1250", "cp-1250", "cp_1250", "windows1250", "windows_1250" }); lookupTable = lookup; }
| 11,892
|
public Windows1252() { super("Windows-1252", new String[] { "Windows1252", "ibm-5348_P100-1997", "ibm-5348", "windows-1252", "cp1252", "cp-1252" }); lookupTable = lookup; }
|
public Windows1252() { super("windows-1252", new String[] { "Windows1252", "ibm-5348_P100-1997", "ibm-5348", "windows-1252", "cp1252", "cp-1252" }); lookupTable = lookup; }
| 11,893
|
public Windows1253() { super("Windows-1253", new String[] { "Windows1253", "cp1253", "cp-1253", "cp_1253", "windows1253", "windows_1253" }); lookupTable = lookup; }
|
public Windows1253() { super("windows-1253", new String[] { "Windows1253", "cp1253", "cp-1253", "cp_1253", "windows1253", "windows_1253" }); lookupTable = lookup; }
| 11,894
|
public Windows1254() { super("Windows-1254", new String[] { "Windows1254", "cp1254", "cp-1254", "cp_1254", "windows1254", "windows_1254" }); lookupTable = lookup; }
|
public Windows1254() { super("windows-1254", new String[] { "Windows1254", "cp1254", "cp-1254", "cp_1254", "windows1254", "windows_1254" }); lookupTable = lookup; }
| 11,895
|
public Windows1257() { super("Windows-1257", new String[] { "Windows1257", "cp1257", "cp-1257", "cp_1257", "windows1257", "windows_1257" }); lookupTable = lookup; }
|
public Windows1257() { super("windows-1257", new String[] { "Windows1257", "cp1257", "cp-1257", "cp_1257", "windows1257", "windows_1257" }); lookupTable = lookup; }
| 11,896
|
public Windows1255() { super("Windows-1255", new String[] { "Windows1255", "cp1255", "cp-1255", "cp_1255", "windows1255", "windows_1255" }); lookupTable = lookup; }
|
public Windows1255() { super("windows-1255", new String[] { "Windows1255", "cp1255", "cp-1255", "cp_1255", "windows1255", "windows_1255" }); lookupTable = lookup; }
| 11,897
|
public Windows1256() { super("Windows-1256", new String[] { "Windows1256", "cp1256", "cp-1256", "cp_1256", "windows1256", "windows_1256" }); lookupTable = lookup; }
|
public Windows1256() { super("windows-1256", new String[] { "Windows1256", "cp1256", "cp-1256", "cp_1256", "windows1256", "windows_1256" }); lookupTable = lookup; }
| 11,898
|
public Windows1258() { super("Windows-1258", new String[] { "Windows1258", "cp1258", "cp-1258", "cp_1258", "windows1258", "windows_1258" }); lookupTable = lookup; }
|
public Windows1258() { super("windows-1258", new String[] { "Windows1258", "cp1258", "cp-1258", "cp_1258", "windows1258", "windows_1258" }); lookupTable = lookup; }
| 11,899
|
public INode(Ext2FileSystem fs, byte[] data) { this.fs = fs; this.data = new byte[INODE_LENGTH]; System.arraycopy(data, 0, this.data, 0, INODE_LENGTH); }
|
public INode(Ext2FileSystem fs, INodeDescriptor desc, byte[] data) { this.fs = fs; this.data = new byte[INODE_LENGTH]; System.arraycopy(data, 0, this.data, 0, INODE_LENGTH); }
| 11,900
|
public byte[] getDataBlock(long i) throws IOException { //get the direct blocks (0; 11) if(i<12) return fs.getBlock( Ext2Utils.get32(data,40+(int)i*4) ); //see the indirect blocks (12; indirectCount-1) int indirectCount = fs.getSuperblock().getBlockSize() >> 2; //a block index is 4 bytes long if(i<12+indirectCount) { long offset=i-12; //the 12th index points to the indirect block byte[] indirectBlock = fs.getBlock( Ext2Utils.get32(data,40+12*4) ); long blockIndex = Ext2Utils.get32(indirectBlock, (int)offset*4); return fs.getBlock( blockIndex ); } //see the double indirect blocks (indirectCount; doubleIndirectCount-1) int doubleIndirectCount = indirectCount * indirectCount; if(i<12+indirectCount+doubleIndirectCount) { //the 13th index points to the double indirect block byte[] doubleIndirectBlock = fs.getBlock( Ext2Utils.get32(data,40+13*4) ); long offset = i-indirectCount-12; long indirectBlockNr = offset / indirectCount; long indirectBlockOffset= offset % indirectCount; byte[] indirectBlock = fs.getBlock( Ext2Utils.get32(doubleIndirectBlock, (int)indirectBlockNr) ); long blockIndex = Ext2Utils.get32(indirectBlock, (int)indirectBlockOffset*4); return fs.getBlock( blockIndex ); } //see the triple indirect blocks (doubleIndirectCount; tripleIndirectCount-1) int tripleIndirectCount = indirectCount * indirectCount * indirectCount; if(i<12+indirectCount+doubleIndirectCount+tripleIndirectCount) { //the 14th index points to the triple indirect block byte[] tripleIndirectBlock = fs.getBlock( Ext2Utils.get32(data,40+14*4) ); long offset = i-doubleIndirectCount-indirectCount-12; long doubleIndirectBlockNr = offset / (indirectCount * indirectCount); long doubleIndirectBlockOffset = offset % (indirectCount * indirectCount); byte[] doubleIndirectBlock = fs.getBlock( Ext2Utils.get32(tripleIndirectBlock, (int)doubleIndirectBlockNr) ); long indirectBlockIndex = Ext2Utils.get32( doubleIndirectBlock, (int)doubleIndirectBlockOffset*4); long indirectBlockOffset = offset % indirectCount; byte[] indirectBlock = fs.getBlock( Ext2Utils.get32(doubleIndirectBlock, (int)indirectBlockIndex*4) ); long blockIndex = Ext2Utils.get32( indirectBlock, (int)indirectBlockOffset*4 ); return fs.getBlock( blockIndex ); } else{ throw new IOException("file too big: more than "+12+indirectCount+doubleIndirectCount+tripleIndirectCount+" blocks"); } }
|
public byte[] getDataBlock(long i) throws IOException { //get the direct blocks (0; 11) if(i<12) return fs.getBlock( Ext2Utils.get32(data,40+(int)i*4) ); //see the indirect blocks (12; indirectCount-1) int indirectCount = fs.getSuperblock().getBlockSize() >> 2; //a block index is 4 bytes long if(i<12+indirectCount) { long offset=i-12; //the 12th index points to the indirect block byte[] indirectBlock = fs.getBlock( Ext2Utils.get32(data,40+12*4) ); long blockIndex = Ext2Utils.get32(indirectBlock, (int)offset*4); return fs.getBlock( blockIndex ); } //see the double indirect blocks (indirectCount; doubleIndirectCount-1) int doubleIndirectCount = indirectCount * indirectCount; if(i<12+indirectCount+doubleIndirectCount) { //the 13th index points to the double indirect block byte[] doubleIndirectBlock = fs.getBlock( Ext2Utils.get32(data,40+13*4) ); long offset = i-indirectCount-12; long indirectBlockNr = offset / indirectCount; long indirectBlockOffset= offset % indirectCount; byte[] indirectBlock = fs.getBlock( Ext2Utils.get32(doubleIndirectBlock, (int)indirectBlockNr) ); long blockIndex = Ext2Utils.get32(indirectBlock, (int)indirectBlockOffset*4); return fs.getBlock( blockIndex ); } //see the triple indirect blocks (doubleIndirectCount; tripleIndirectCount-1) int tripleIndirectCount = indirectCount * indirectCount * indirectCount; if(i<12+indirectCount+doubleIndirectCount+tripleIndirectCount) { //the 14th index points to the triple indirect block byte[] tripleIndirectBlock = fs.getBlock( Ext2Utils.get32(data,40+14*4) ); long offset = i-doubleIndirectCount-indirectCount-12; long doubleIndirectBlockNr = offset / (indirectCount * indirectCount); long doubleIndirectBlockOffset = offset % (indirectCount * indirectCount); byte[] doubleIndirectBlock = fs.getBlock( Ext2Utils.get32(tripleIndirectBlock, (int)doubleIndirectBlockNr) ); long indirectBlockIndex = Ext2Utils.get32( doubleIndirectBlock, (int)doubleIndirectBlockOffset*4); long indirectBlockOffset = offset % indirectCount; byte[] indirectBlock = fs.getBlock( Ext2Utils.get32(doubleIndirectBlock, (int)indirectBlockIndex*4) ); long blockIndex = Ext2Utils.get32( indirectBlock, (int)indirectBlockOffset*4 ); return fs.getBlock( blockIndex ); } else{ throw new IOException("file too big: more than "+12+indirectCount+doubleIndirectCount+tripleIndirectCount+" blocks"); } }
| 11,902
|
public int getMode() { int iMode=Ext2Utils.get16(data, 0); log.debug("INode.getIMode(): "+NumberUtils.hex(iMode)); return iMode; }
|
public int getMode() { int iMode=Ext2Utils.get16(data, 0); return iMode; }
| 11,903
|
public static void set32(byte[] data, int offset, int value) { data[offset] = (byte)(value & 0xFF); data[offset+1] = (byte)((value >> 8) & 0xFF); data[offset+2] = (byte)((value >> 16) & 0xFF); data[offset+3] = (byte)((value >> 32) & 0xFF); }
|
public static void set32(byte[] data, int offset, long value) { data[offset] = (byte)(value & 0xFF); data[offset+1] = (byte)((value >> 8) & 0xFF); data[offset+2] = (byte)((value >> 16) & 0xFF); data[offset+3] = (byte)((value >> 32) & 0xFF); }
| 11,904
|
public boolean isDescendant(TreePath path) { if (path == null) return false; int count = getPathCount(); if (path.getPathCount() < count) return false; for (int i = 0; i < count; i++) { if (!this.path[i].equals(path.getPathComponent(i))) return false; } return true; }
|
public boolean isDescendant(TreePath path) { if (path == null) return false; int count = getPathCount(); int otherPathLength = path.getPathCount(); if (otherPathLength < count) return false; for (int i = 0; i < count; i++) { if (!this.path[i].equals(path.getPathComponent(i))) return false; } return true; }
| 11,905
|
public boolean isDescendant(TreePath path) { if (path == null) return false; int count = getPathCount(); if (path.getPathCount() < count) return false; for (int i = 0; i < count; i++) { if (!this.path[i].equals(path.getPathComponent(i))) return false; } return true; }
|
public boolean isDescendant(TreePath path) { if (path == null) return false; int count = getPathCount(); if (path.getPathCount() < count) return false; while (otherPathLength > count) { if (!this.path[i].equals(path.getPathComponent(i))) return false; } return true; }
| 11,906
|
public boolean isDescendant(TreePath path) { if (path == null) return false; int count = getPathCount(); if (path.getPathCount() < count) return false; for (int i = 0; i < count; i++) { if (!this.path[i].equals(path.getPathComponent(i))) return false; } return true; }
|
public boolean isDescendant(TreePath path) { if (path == null) return false; int count = getPathCount(); if (path.getPathCount() < count) return false; for (int i = 0; i < count; i++) { if (!this.path[i].equals(path.getPathComponent(i))) return false; } return true; }
| 11,907
|
public boolean isDescendant(TreePath path) { if (path == null) return false; int count = getPathCount(); if (path.getPathCount() < count) return false; for (int i = 0; i < count; i++) { if (!this.path[i].equals(path.getPathComponent(i))) return false; } return true; }
|
public boolean isDescendant(TreePath path) { if (path == null) return false; int count = getPathCount(); if (path.getPathCount() < count) return false; for (int i = 0; i < count; i++) { if (!this.path[i].equals(path.getPathComponent(i))) return false; } return equals(path); }
| 11,908
|
public Image getVolatileOffscreenBuffer(Component comp, int proposedWidth, int proposedHeight) { int maxWidth = doubleBufferMaximumSize.width; int maxHeight = doubleBufferMaximumSize.height; return comp.createVolatileImage(Math.min(maxWidth, proposedWidth), Math.min(maxHeight, proposedHeight)); }
|
public Image getVolatileOffscreenBuffer(Component comp, int proposedWidth, int proposedHeight) { int maxWidth = doubleBufferMaximumSize.width; int maxHeight = doubleBufferMaximumSize.height; return comp.createVolatileImage(Math.min(maxWidth, proposedWidth), Math.min(maxHeight, proposedHeight)); }
| 11,909
|
public Object createValue(UIDefaults table) { throw new Error("not implemented"); }
|
public Object createValue(UIDefaults table) { InputMap im = new InputMap (); for (int i = 0; 2*i+1 < bind.length; ++i) { im.put (KeyStroke.getKeyStroke ((String) bind[2*i]), bind[2*i+1]); } return im; }
| 11,911
|
public ProxyLazyValue(String s) { throw new Error("not implemented"); }
|
public ProxyLazyValue(String s) { final String className = s; inner = new LazyValue () { public Object createValue (UIDefaults table) { try { return Class .forName (className) .getConstructor (new Class[] {}) .newInstance (new Object[] {}); } catch (Exception e) { return null; } } }; }
| 11,912
|
public Object createValue(UIDefaults table) { throw new Error("not implemented"); }
|
public Object createValue(UIDefaults table) { return inner.createValue (table); }
| 11,913
|
public void addPropertyChangeListener(PropertyChangeListener l) { throw new Error("not implemented"); }
|
void addPropertyChangeListener(PropertyChangeListener listener) { throw new Error("not implemented"); }
| 11,914
|
public void addPropertyChangeListener(PropertyChangeListener l) { throw new Error("not implemented"); }
|
public void addPropertyChangeListener(PropertyChangeListener l) { listeners.add (listener); }
| 11,915
|
public void addResourceBundle(String name) { throw new Error("not implemented"); }
|
void addResourceBundle(String name) { throw new Error("not implemented"); }
| 11,916
|
public void addResourceBundle(String name) { throw new Error("not implemented"); }
|
public void addResourceBundle(String name) { bundles.addFirst (name); }
| 11,917
|
protected void firePropertyChange(String property, Object o, Object n) { throw new Error("not implemented"); }
|
protected void firePropertyChange(String property, Object o, Object n) { Iterator i = listeners.iterator (); PropertyChangeEvent pce = new PropertyChangeEvent (this, property, o, n); while (i.hasNext ()) { PropertyChangeListener pcl = (PropertyChangeListener) i.next (); pcl.propertyChange (pce); } }
| 11,918
|
public Locale getDefaultLocale() { throw new Error("not implemented"); }
|
public Locale getDefaultLocale() { return defaultLocale; }
| 11,919
|
public PropertyChangeListener[] getPropertyChangeListeners() { throw new Error("not implemented"); }
|
public PropertyChangeListener[] getPropertyChangeListeners() { return (PropertyChangeListener[]) listeners.toArray (); }
| 11,920
|
public ComponentUI getUI(JComponent a) { String pp = a.getUIClassID(); ComponentUI p = (ComponentUI) get(pp); if (p == null) getUIError("failed to locate UI:" + pp); return p; }
|
public ComponentUI getUI(JComponent target) { String pp = a.getUIClassID(); ComponentUI p = (ComponentUI) get(pp); if (p == null) getUIError("failed to locate UI:" + pp); return p; }
| 11,921
|
public ComponentUI getUI(JComponent a) { String pp = a.getUIClassID(); ComponentUI p = (ComponentUI) get(pp); if (p == null) getUIError("failed to locate UI:" + pp); return p; }
|
public ComponentUI getUI(JComponent a) { String pp = a.getUIClassID(); ComponentUI p = (ComponentUI) get(pp); if (p == null) getUIError("failed to locate UI:" + pp); return p; }
| 11,922
|
public Class getUIClass(String id, ClassLoader loader) { throw new Error("not implemented"); }
|
public Class getUIClass(String id, ClassLoader loader) { String className = (String) get (id); if (className == null) return null; try { if (loader != null) return loader.loadClass (className); return Class.forName (className); } catch (Exception e) { return null; } }
| 11,924
|
public void removePropertyChangeListener(PropertyChangeListener l) { throw new Error("not implemented"); }
|
void removePropertyChangeListener(PropertyChangeListener listener) { throw new Error("not implemented"); }
| 11,926
|
public void removePropertyChangeListener(PropertyChangeListener l) { throw new Error("not implemented"); }
|
public void removePropertyChangeListener(PropertyChangeListener l) { listeners.remove (listener); }
| 11,927
|
public void removeResourceBundle(String name) { throw new Error("not implemented"); }
|
void removeResourceBundle(String name) { throw new Error("not implemented"); }
| 11,928
|
public void removeResourceBundle(String name) { throw new Error("not implemented"); }
|
public void removeResourceBundle(String name) { bundles.remove (name); }
| 11,929
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.