rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
};
return p;
public final Position getStartPosition() { // FIXME: Properly implement this using Content.createPosition(). return new Position() { public int getOffset() { return 0; } }; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/AbstractDocument.java/clean/core/src/classpath/javax/javax/swing/text/AbstractDocument.java
finally { writeUnlock(); } }
public void insertString(int offset, String text, AttributeSet attributes) throws BadLocationException { // Bail out if we have a bogus insertion (Behavior observed in RI). if (text == null || text.length() == 0) return; if (documentFilter == null) insertStringImpl(offset, text, attributes); else documentFilter.insertString(getBypass(), offset, text, attributes); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/AbstractDocument.java/clean/core/src/classpath/javax/javax/swing/text/AbstractDocument.java
try { writeLock();
void insertStringImpl(int offset, String text, AttributeSet attributes) throws BadLocationException { // Just return when no text to insert was given. if (text == null || text.length() == 0) return; DefaultDocumentEvent event = new DefaultDocumentEvent(offset, text.length(), DocumentEvent.EventType.INSERT); try { writeLock(); UndoableEdit undo = content.insertString(offset, text); if (undo != null) event.addEdit(undo); insertUpdate(event, attributes); fireInsertUpdate(event); if (undo != null) fireUndoableEditUpdate(new UndoableEditEvent(this, undo)); } finally { writeUnlock(); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/AbstractDocument.java/clean/core/src/classpath/javax/javax/swing/text/AbstractDocument.java
finally { writeUnlock(); } }
void insertStringImpl(int offset, String text, AttributeSet attributes) throws BadLocationException { // Just return when no text to insert was given. if (text == null || text.length() == 0) return; DefaultDocumentEvent event = new DefaultDocumentEvent(offset, text.length(), DocumentEvent.EventType.INSERT); try { writeLock(); UndoableEdit undo = content.insertString(offset, text); if (undo != null) event.addEdit(undo); insertUpdate(event, attributes); fireInsertUpdate(event); if (undo != null) fireUndoableEditUpdate(new UndoableEditEvent(this, undo)); } finally { writeUnlock(); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/AbstractDocument.java/clean/core/src/classpath/javax/javax/swing/text/AbstractDocument.java
if (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng);
protected void insertUpdate(DefaultDocumentEvent chng, AttributeSet attr) { // Do nothing here. Subclasses may want to override this. }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/AbstractDocument.java/clean/core/src/classpath/javax/javax/swing/text/AbstractDocument.java
if (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng);
protected void postRemoveUpdate(DefaultDocumentEvent chng) { // Do nothing here. Subclasses may want to override this. }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/AbstractDocument.java/clean/core/src/classpath/javax/javax/swing/text/AbstractDocument.java
if (TextAttribute.RUN_DIRECTION.equals(key)) { if (TextAttribute.RUN_DIRECTION_RTL.equals(value) && Boolean.FALSE.equals(getProperty(I18N))) putProperty(I18N, Boolean.TRUE); if (Boolean.TRUE.equals(getProperty(I18N))) { writeLock(); try { DefaultDocumentEvent ev = new DefaultDocumentEvent(0, getLength(), DocumentEvent.EventType.INSERT); updateBidi(ev); } finally { writeUnlock(); } } }
public final void putProperty(Object key, Object value) { // FIXME: make me thread-safe if (properties == null) properties = new Hashtable(); properties.put(key, value); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/AbstractDocument.java/clean/core/src/classpath/javax/javax/swing/text/AbstractDocument.java
public final void readLock() { if (currentWriter != null && currentWriter.equals(Thread.currentThread())) return; synchronized (documentCV) { while (currentWriter != null || numWritersWaiting > 0) { try { documentCV.wait(); } catch (InterruptedException ie) { throw new Error("interrupted trying to get a readLock"); } } numReaders++; } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/AbstractDocument.java/clean/core/src/classpath/javax/javax/swing/text/AbstractDocument.java
if (length <= 0) return;
if (length > 0) { if (offset < 0 || offset > getLength()) throw new BadLocationException("Invalid remove position", offset); if (offset + length > getLength()) throw new BadLocationException("Invalid remove length", offset);
void removeImpl(int offset, int length) throws BadLocationException { // Prevent some unneccessary method invocation (observed in the RI). if (length <= 0) return; DefaultDocumentEvent event = new DefaultDocumentEvent(offset, length, DocumentEvent.EventType.REMOVE); try { writeLock(); // The order of the operations below is critical! removeUpdate(event); UndoableEdit temp = content.remove(offset, length); postRemoveUpdate(event); fireRemoveUpdate(event); } finally { writeUnlock(); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/AbstractDocument.java/clean/core/src/classpath/javax/javax/swing/text/AbstractDocument.java
}
void removeImpl(int offset, int length) throws BadLocationException { // Prevent some unneccessary method invocation (observed in the RI). if (length <= 0) return; DefaultDocumentEvent event = new DefaultDocumentEvent(offset, length, DocumentEvent.EventType.REMOVE); try { writeLock(); // The order of the operations below is critical! removeUpdate(event); UndoableEdit temp = content.remove(offset, length); postRemoveUpdate(event); fireRemoveUpdate(event); } finally { writeUnlock(); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/AbstractDocument.java/clean/core/src/classpath/javax/javax/swing/text/AbstractDocument.java
} finally { writeUnlock(); }
public void replace(int offset, int length, String text, AttributeSet attributes) throws BadLocationException { // Bail out if we have a bogus replacement (Behavior observed in RI). if (length == 0 && (text == null || text.length() == 0)) return; if (documentFilter == null) { // It is important to call the methods which again do the checks // of the arguments and the DocumentFilter because subclasses may // have overridden these methods and provide crucial behavior // which would be skipped if we call the non-checking variants. // An example for this is PlainDocument where insertString can // provide a filtering of newlines. remove(offset, length); insertString(offset, text, attributes); } else documentFilter.replace(getBypass(), offset, length, text, attributes); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/AbstractDocument.java/clean/core/src/classpath/javax/javax/swing/text/AbstractDocument.java
Integer val = p >= 0 ? new Integer(p) : null; putProperty(AsyncLoadPriority, val);
public void setAsynchronousLoadPriority(int p) { // TODO: Implement this properly. }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/AbstractDocument.java/clean/core/src/classpath/javax/javax/swing/text/AbstractDocument.java
public UndoableEditEvent(Object source, UndoableEdit edit) {
public UndoableEditEvent(Object source, UndoableEdit edit) {
public UndoableEditEvent(Object source, UndoableEdit edit) { super(source); this.edit = edit; } // UndoableEditEvent()
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/UndoableEditEvent.java/buggy/core/src/classpath/javax/javax/swing/event/UndoableEditEvent.java
}
}
public UndoableEditEvent(Object source, UndoableEdit edit) { super(source); this.edit = edit; } // UndoableEditEvent()
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/UndoableEditEvent.java/buggy/core/src/classpath/javax/javax/swing/event/UndoableEditEvent.java
public PrincipalHolder(Principal initial_value)
public PrincipalHolder()
public PrincipalHolder(Principal initial_value) { value = initial_value; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b9b55eb78411ab1a82da7ba097b7b93a8cd80865/PrincipalHolder.java/clean/core/src/classpath/org/org/omg/CORBA/PrincipalHolder.java
value = initial_value;
public PrincipalHolder(Principal initial_value) { value = initial_value; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b9b55eb78411ab1a82da7ba097b7b93a8cd80865/PrincipalHolder.java/clean/core/src/classpath/org/org/omg/CORBA/PrincipalHolder.java
assert(mark <= gapStart || mark > gapEnd);
public int getOffset() { if (mark <= gapStart) return mark; else return mark - (gapEnd - gapStart); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/045a5b41cdfa747889101d3993040acf89788bc4/GapContent.java/buggy/core/src/classpath/javax/javax/swing/text/GapContent.java
if (newGapStart == gapStart) return; else if (newGapStart < gapStart)
if (newGapStart < gapStart)
protected void shiftGap(int newGapStart) { int newGapEnd = newGapStart + (gapEnd - gapStart); // Update the positions between newGapEnd and (old) gapEnd. The marks // must be shifted by (gapEnd - newGapEnd). int index1 = Collections.binarySearch(positions, new GapContentPosition(gapEnd)); int index2 = Collections.binarySearch(positions, new GapContentPosition(newGapEnd)); if (index1 > 0 && index2 > 0) { int i1 = Math.min(index1, index2); int i2 = Math.max(index1, index2); for (ListIterator i = positions.listIterator(i1); i.hasNext();) { if (i.nextIndex() > i2) break; GapContentPosition p = (GapContentPosition) i.next(); p.mark += gapEnd - newGapEnd; } } if (newGapStart == gapStart) return; else if (newGapStart < gapStart) { System.arraycopy(buffer, newGapStart, buffer, newGapEnd, gapStart - newGapStart); gapStart = newGapStart; gapEnd = newGapEnd; } else { System.arraycopy(buffer, gapEnd, buffer, gapStart, newGapStart - gapStart); gapStart = newGapStart; gapEnd = newGapEnd; } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/045a5b41cdfa747889101d3993040acf89788bc4/GapContent.java/buggy/core/src/classpath/javax/javax/swing/text/GapContent.java
private byte[] assembleEM(final byte[] PS, final byte[] M) { // b. Concatenate PS, the message M, and other padding to form an // encoded message EM of length k octets as // // EM = 0x00 || 0x02 || PS || 0x00 || M. baos.reset(); baos.write(0x00); baos.write(0x02); baos.write(PS, 0, PS.length); baos.write(0x00); baos.write(M, 0, M.length); final byte[] result = baos.toByteArray(); baos.reset(); return result; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/EME_PKCS1_V1_5.java/clean/core/src/classpath/gnu/gnu/java/security/sig/rsa/EME_PKCS1_V1_5.java
SecureRandom rnd = new SecureRandom (); rnd.nextBytes(PS);
prng.nextBytes(PS);
public byte[] encode(final byte[] M) { // a. Generate an octet string PS of length k - mLen - 3 consisting // of pseudo-randomly generated nonzero octets. The length of PS // will be at least eight octets. final byte[] PS = new byte[k - M.length - 3]; // FIXME. This should be configurable, somehow. SecureRandom rnd = new SecureRandom (); rnd.nextBytes(PS); int i = 0; for (; i < PS.length; i++) { if (PS[i] == 0) PS[i] = 1; } // b. Concatenate PS, the message M, and other padding to form an // encoded message EM of length k octets as // // EM = 0x00 || 0x02 || PS || 0x00 || M. return assembleEM(PS, M); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/EME_PKCS1_V1_5.java/clean/core/src/classpath/gnu/gnu/java/security/sig/rsa/EME_PKCS1_V1_5.java
{ new SecureRandom ().nextBytes(buffer);
getDefaultPRNG().nextBytes(buffer);
private void nextRandomBytes(byte[] buffer) { if (rnd != null) { rnd.nextBytes(buffer); } else { new SecureRandom ().nextBytes(buffer); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/FIPS186.java/clean/core/src/classpath/gnu/gnu/java/security/key/dss/FIPS186.java
}
private void nextRandomBytes(byte[] buffer) { if (rnd != null) { rnd.nextBytes(buffer); } else { new SecureRandom ().nextBytes(buffer); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/FIPS186.java/clean/core/src/classpath/gnu/gnu/java/security/key/dss/FIPS186.java
public BigInteger add(BigInteger val)
private static BigInteger add(int x, int y)
public BigInteger add(BigInteger val) { return add(this, val, 1); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e81465c8dc08fe3c0a055c4bb1c2588e37b39c25/BigInteger.java/buggy/core/src/classpath/java/java/math/BigInteger.java
return add(this, val, 1);
return valueOf((long) x + (long) y);
public BigInteger add(BigInteger val) { return add(this, val, 1); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e81465c8dc08fe3c0a055c4bb1c2588e37b39c25/BigInteger.java/buggy/core/src/classpath/java/java/math/BigInteger.java
public BigInteger divide(BigInteger val)
private static void divide(long x, long y, BigInteger quotient, BigInteger remainder, int rounding_mode)
public BigInteger divide(BigInteger val) { if (val.isZero()) throw new ArithmeticException("divisor is zero"); BigInteger quot = new BigInteger(); divide(this, val, quot, null, TRUNCATE); return quot.canonicalize(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e81465c8dc08fe3c0a055c4bb1c2588e37b39c25/BigInteger.java/buggy/core/src/classpath/java/java/math/BigInteger.java
if (val.isZero()) throw new ArithmeticException("divisor is zero");
boolean xNegative, yNegative; if (x < 0) { xNegative = true; if (x == Long.MIN_VALUE) { divide(valueOf(x), valueOf(y), quotient, remainder, rounding_mode); return; } x = -x; } else xNegative = false;
public BigInteger divide(BigInteger val) { if (val.isZero()) throw new ArithmeticException("divisor is zero"); BigInteger quot = new BigInteger(); divide(this, val, quot, null, TRUNCATE); return quot.canonicalize(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e81465c8dc08fe3c0a055c4bb1c2588e37b39c25/BigInteger.java/buggy/core/src/classpath/java/java/math/BigInteger.java
BigInteger quot = new BigInteger(); divide(this, val, quot, null, TRUNCATE); return quot.canonicalize();
if (y < 0) { yNegative = true; if (y == Long.MIN_VALUE) { if (rounding_mode == TRUNCATE) { if (quotient != null) quotient.set(0); if (remainder != null) remainder.set(x); } else divide(valueOf(x), valueOf(y), quotient, remainder, rounding_mode); return; } y = -y; } else yNegative = false; long q = x / y; long r = x % y; boolean qNegative = xNegative ^ yNegative; boolean add_one = false; if (r != 0) { switch (rounding_mode) { case TRUNCATE: break; case CEILING: case FLOOR: if (qNegative == (rounding_mode == FLOOR)) add_one = true; break; case ROUND: add_one = r > ((y - (q & 1)) >> 1); break; } } if (quotient != null) { if (add_one) q++; if (qNegative) q = -q; quotient.set(q); } if (remainder != null) { if (add_one) { r = y - r; xNegative = ! xNegative; } else { } if (xNegative) r = -r; remainder.set(r); }
public BigInteger divide(BigInteger val) { if (val.isZero()) throw new ArithmeticException("divisor is zero"); BigInteger quot = new BigInteger(); divide(this, val, quot, null, TRUNCATE); return quot.canonicalize(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e81465c8dc08fe3c0a055c4bb1c2588e37b39c25/BigInteger.java/buggy/core/src/classpath/java/java/math/BigInteger.java
public TransformerException(String msg, Throwable cause)
public TransformerException(String msg)
public TransformerException(String msg, Throwable cause) { this(msg, null, cause); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/TransformerException.java/buggy/core/src/classpath/javax/javax/xml/transform/TransformerException.java
this(msg, null, cause); }
this(msg, null, null); }
public TransformerException(String msg, Throwable cause) { this(msg, null, cause); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/TransformerException.java/buggy/core/src/classpath/javax/javax/xml/transform/TransformerException.java
SizeRequirements[] childReqs = getChildRequirements(axis);
updateChildRequirements(axis); updateRequirements(axis);
protected void baselineLayout(int span, int axis, int[] offsets, int[] spans) { SizeRequirements[] childReqs = getChildRequirements(axis); // Calculate the spans and offsets using the SizeRequirements uility // methods. SizeRequirements.calculateAlignedPositions(span, requirements[axis], childReqs, offsets, spans); layoutValid[axis] = true; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BoxView.java/buggy/core/src/classpath/javax/javax/swing/text/BoxView.java
childReqs, offsets, spans); layoutValid[axis] = true;
childReqs[axis], offsets, spans);
protected void baselineLayout(int span, int axis, int[] offsets, int[] spans) { SizeRequirements[] childReqs = getChildRequirements(axis); // Calculate the spans and offsets using the SizeRequirements uility // methods. SizeRequirements.calculateAlignedPositions(span, requirements[axis], childReqs, offsets, spans); layoutValid[axis] = true; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BoxView.java/buggy/core/src/classpath/javax/javax/swing/text/BoxView.java
SizeRequirements[] childReqs = getChildRequirements(axis); return SizeRequirements.getAlignedSizeRequirements(childReqs);
updateChildRequirements(axis); SizeRequirements res = sr; if (res == null) res = new SizeRequirements(); float minLeft = 0; float minRight = 0; float prefLeft = 0; float prefRight = 0; float maxLeft = 0; float maxRight = 0; for (int i = 0; i < childReqs[axis].length; i++) { float myMinLeft = childReqs[axis][i].minimum * childReqs[axis][i].alignment; float myMinRight = childReqs[axis][i].minimum - myMinLeft; minLeft = Math.max(myMinLeft, minLeft); minRight = Math.max(myMinRight, minRight); float myPrefLeft = childReqs[axis][i].preferred * childReqs[axis][i].alignment; float myPrefRight = childReqs[axis][i].preferred - myPrefLeft; prefLeft = Math.max(myPrefLeft, prefLeft); prefRight = Math.max(myPrefRight, prefRight); float myMaxLeft = childReqs[axis][i].maximum * childReqs[axis][i].alignment; float myMaxRight = childReqs[axis][i].maximum - myMaxLeft; maxLeft = Math.max(myMaxLeft, maxLeft); maxRight = Math.max(myMaxRight, maxRight); } int minSize = (int) (minLeft + minRight); int prefSize = (int) (prefLeft + prefRight); int maxSize = (int) (maxLeft + maxRight); float align = prefLeft / (prefRight + prefLeft); if (Float.isNaN(align)) align = 0; res.alignment = align; res.maximum = maxSize; res.preferred = prefSize; res.minimum = minSize; return res;
protected SizeRequirements baselineRequirements(int axis, SizeRequirements sr) { SizeRequirements[] childReqs = getChildRequirements(axis); return SizeRequirements.getAlignedSizeRequirements(childReqs); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BoxView.java/buggy/core/src/classpath/javax/javax/swing/text/BoxView.java
SizeRequirements[] childReqs = getChildRequirements(axis); return SizeRequirements.getTiledSizeRequirements(childReqs);
updateChildRequirements(axis); SizeRequirements result = sr; if (result == null) result = new SizeRequirements(); long minimum = 0; long preferred = 0; long maximum = 0; for (int i = 0; i < children.length; i++) { minimum += childReqs[axis][i].minimum; preferred += childReqs[axis][i].preferred; maximum += childReqs[axis][i].maximum; } if (minimum > Integer.MAX_VALUE) minimum = Integer.MAX_VALUE; if (preferred > Integer.MAX_VALUE) preferred = Integer.MAX_VALUE; if (maximum > Integer.MAX_VALUE) maximum = Integer.MAX_VALUE; result.minimum = (int) minimum; result.preferred = (int) preferred; result.maximum = (int) maximum; result.alignment = 0.5F; return result;
protected SizeRequirements calculateMajorAxisRequirements(int axis, SizeRequirements sr) { SizeRequirements[] childReqs = getChildRequirements(axis); return SizeRequirements.getTiledSizeRequirements(childReqs); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BoxView.java/buggy/core/src/classpath/javax/javax/swing/text/BoxView.java
SizeRequirements[] childReqs = getChildRequirements(axis); return SizeRequirements.getAlignedSizeRequirements(childReqs);
updateChildRequirements(axis); SizeRequirements res = sr; if (res == null) res = new SizeRequirements(); float minLeft = 0; float minRight = 0; float prefLeft = 0; float prefRight = 0; float maxLeft = 0; float maxRight = 0; for (int i = 0; i < childReqs[axis].length; i++) { float myMinLeft = childReqs[axis][i].minimum * childReqs[axis][i].alignment; float myMinRight = childReqs[axis][i].minimum - myMinLeft; minLeft = Math.max(myMinLeft, minLeft); minRight = Math.max(myMinRight, minRight); float myPrefLeft = childReqs[axis][i].preferred * childReqs[axis][i].alignment; float myPrefRight = childReqs[axis][i].preferred - myPrefLeft; prefLeft = Math.max(myPrefLeft, prefLeft); prefRight = Math.max(myPrefRight, prefRight); float myMaxLeft = childReqs[axis][i].maximum * childReqs[axis][i].alignment; float myMaxRight = childReqs[axis][i].maximum - myMaxLeft; maxLeft = Math.max(myMaxLeft, maxLeft); maxRight = Math.max(myMaxRight, maxRight); } int minSize = (int) (minLeft + minRight); int prefSize = (int) (prefLeft + prefRight); int maxSize = (int) (maxLeft + maxRight); float align = prefLeft / (prefRight + prefLeft); if (Float.isNaN(align)) align = 0; res.alignment = align; res.maximum = maxSize; res.preferred = prefSize; res.minimum = minSize; return res;
protected SizeRequirements calculateMinorAxisRequirements(int axis, SizeRequirements sr) { SizeRequirements[] childReqs = getChildRequirements(axis); return SizeRequirements.getAlignedSizeRequirements(childReqs); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BoxView.java/buggy/core/src/classpath/javax/javax/swing/text/BoxView.java
if (! isLayoutValid(axis)) requirements[axis] = calculateMinorAxisRequirements(axis, requirements[axis]);
updateRequirements(axis);
public float getAlignment(int axis) { float align; if (axis == myAxis) align = 0.5F; else { if (! isLayoutValid(axis)) requirements[axis] = calculateMinorAxisRequirements(axis, requirements[axis]); align = requirements[axis].alignment; } return align; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BoxView.java/buggy/core/src/classpath/javax/javax/swing/text/BoxView.java
if (!isLayoutValid(axis)) {
float max;
public float getMaximumSpan(int axis) { if (!isLayoutValid(axis)) { if (axis == myAxis) requirements[axis] = calculateMajorAxisRequirements(axis, requirements[axis]); else requirements[axis] = calculateMinorAxisRequirements(axis, requirements[axis]); } return requirements[axis].maximum; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BoxView.java/buggy/core/src/classpath/javax/javax/swing/text/BoxView.java
requirements[axis] = calculateMajorAxisRequirements(axis, requirements[axis]);
max = getPreferredSpan(axis);
public float getMaximumSpan(int axis) { if (!isLayoutValid(axis)) { if (axis == myAxis) requirements[axis] = calculateMajorAxisRequirements(axis, requirements[axis]); else requirements[axis] = calculateMinorAxisRequirements(axis, requirements[axis]); } return requirements[axis].maximum; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BoxView.java/buggy/core/src/classpath/javax/javax/swing/text/BoxView.java
requirements[axis] = calculateMinorAxisRequirements(axis, requirements[axis]); } return requirements[axis].maximum;
max = Integer.MAX_VALUE; return max;
public float getMaximumSpan(int axis) { if (!isLayoutValid(axis)) { if (axis == myAxis) requirements[axis] = calculateMajorAxisRequirements(axis, requirements[axis]); else requirements[axis] = calculateMinorAxisRequirements(axis, requirements[axis]); } return requirements[axis].maximum; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BoxView.java/buggy/core/src/classpath/javax/javax/swing/text/BoxView.java
if (!isLayoutValid(axis)) { if (axis == myAxis) requirements[axis] = calculateMajorAxisRequirements(axis, requirements[axis]); else requirements[axis] = calculateMinorAxisRequirements(axis, requirements[axis]); }
updateRequirements(axis);
public float getMinimumSpan(int axis) { if (!isLayoutValid(axis)) { if (axis == myAxis) requirements[axis] = calculateMajorAxisRequirements(axis, requirements[axis]); else requirements[axis] = calculateMinorAxisRequirements(axis, requirements[axis]); } return requirements[axis].minimum; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BoxView.java/buggy/core/src/classpath/javax/javax/swing/text/BoxView.java
if (!isLayoutValid(axis)) { if (axis == myAxis) requirements[axis] = calculateMajorAxisRequirements(axis, requirements[axis]); else requirements[axis] = calculateMinorAxisRequirements(axis, requirements[axis]); }
updateRequirements(axis);
public float getPreferredSpan(int axis) { if (!isLayoutValid(axis)) { if (axis == myAxis) requirements[axis] = calculateMajorAxisRequirements(axis, requirements[axis]); else requirements[axis] = calculateMinorAxisRequirements(axis, requirements[axis]); } return requirements[axis].preferred; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BoxView.java/buggy/core/src/classpath/javax/javax/swing/text/BoxView.java
requirements[minorAxis] = calculateMinorAxisRequirements(minorAxis, requirements[minorAxis]); layoutMinorAxis(newSpan[minorAxis], minorAxis, offsets[minorAxis],
layoutValid[minorAxis] = false; span[minorAxis] = newSpan[minorAxis]; layoutMinorAxis(span[minorAxis], minorAxis, offsets[minorAxis],
protected void layout(int width, int height) { int[] newSpan = new int[]{ width, height }; int count = getViewCount(); // Update minor axis as appropriate. We need to first update the minor // axis layout because that might affect the children's preferences along // the major axis. int minorAxis = myAxis == X_AXIS ? Y_AXIS : X_AXIS; if ((! isLayoutValid(minorAxis)) || newSpan[minorAxis] != span[minorAxis]) { requirements[minorAxis] = calculateMinorAxisRequirements(minorAxis, requirements[minorAxis]); layoutMinorAxis(newSpan[minorAxis], minorAxis, offsets[minorAxis], spans[minorAxis]); span[myAxis] = newSpan[myAxis]; // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[minorAxis] = true; } // Update major axis as appropriate. if ((! isLayoutValid(myAxis)) || newSpan[myAxis] != span[myAxis]) { requirements[myAxis] = calculateMajorAxisRequirements(myAxis, requirements[myAxis]); layoutMajorAxis(newSpan[myAxis], myAxis, offsets[myAxis], spans[myAxis]); span[myAxis] = newSpan[myAxis]; // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[myAxis] = true; } assert layoutValid[myAxis] == true : "Major axis layout must be valid after layout"; assert layoutValid[minorAxis] == true : "Minor axis layout must be valid after layout"; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BoxView.java/buggy/core/src/classpath/javax/javax/swing/text/BoxView.java
span[myAxis] = newSpan[myAxis];
protected void layout(int width, int height) { int[] newSpan = new int[]{ width, height }; int count = getViewCount(); // Update minor axis as appropriate. We need to first update the minor // axis layout because that might affect the children's preferences along // the major axis. int minorAxis = myAxis == X_AXIS ? Y_AXIS : X_AXIS; if ((! isLayoutValid(minorAxis)) || newSpan[minorAxis] != span[minorAxis]) { requirements[minorAxis] = calculateMinorAxisRequirements(minorAxis, requirements[minorAxis]); layoutMinorAxis(newSpan[minorAxis], minorAxis, offsets[minorAxis], spans[minorAxis]); span[myAxis] = newSpan[myAxis]; // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[minorAxis] = true; } // Update major axis as appropriate. if ((! isLayoutValid(myAxis)) || newSpan[myAxis] != span[myAxis]) { requirements[myAxis] = calculateMajorAxisRequirements(myAxis, requirements[myAxis]); layoutMajorAxis(newSpan[myAxis], myAxis, offsets[myAxis], spans[myAxis]); span[myAxis] = newSpan[myAxis]; // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[myAxis] = true; } assert layoutValid[myAxis] == true : "Major axis layout must be valid after layout"; assert layoutValid[minorAxis] == true : "Minor axis layout must be valid after layout"; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BoxView.java/buggy/core/src/classpath/javax/javax/swing/text/BoxView.java
requirements[myAxis] = calculateMajorAxisRequirements(myAxis, requirements[myAxis]); layoutMajorAxis(newSpan[myAxis], myAxis, offsets[myAxis],
layoutValid[myAxis] = false; span[myAxis] = newSpan[myAxis]; layoutMajorAxis(span[myAxis], myAxis, offsets[myAxis],
protected void layout(int width, int height) { int[] newSpan = new int[]{ width, height }; int count = getViewCount(); // Update minor axis as appropriate. We need to first update the minor // axis layout because that might affect the children's preferences along // the major axis. int minorAxis = myAxis == X_AXIS ? Y_AXIS : X_AXIS; if ((! isLayoutValid(minorAxis)) || newSpan[minorAxis] != span[minorAxis]) { requirements[minorAxis] = calculateMinorAxisRequirements(minorAxis, requirements[minorAxis]); layoutMinorAxis(newSpan[minorAxis], minorAxis, offsets[minorAxis], spans[minorAxis]); span[myAxis] = newSpan[myAxis]; // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[minorAxis] = true; } // Update major axis as appropriate. if ((! isLayoutValid(myAxis)) || newSpan[myAxis] != span[myAxis]) { requirements[myAxis] = calculateMajorAxisRequirements(myAxis, requirements[myAxis]); layoutMajorAxis(newSpan[myAxis], myAxis, offsets[myAxis], spans[myAxis]); span[myAxis] = newSpan[myAxis]; // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[myAxis] = true; } assert layoutValid[myAxis] == true : "Major axis layout must be valid after layout"; assert layoutValid[minorAxis] == true : "Minor axis layout must be valid after layout"; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BoxView.java/buggy/core/src/classpath/javax/javax/swing/text/BoxView.java
span[myAxis] = newSpan[myAxis];
protected void layout(int width, int height) { int[] newSpan = new int[]{ width, height }; int count = getViewCount(); // Update minor axis as appropriate. We need to first update the minor // axis layout because that might affect the children's preferences along // the major axis. int minorAxis = myAxis == X_AXIS ? Y_AXIS : X_AXIS; if ((! isLayoutValid(minorAxis)) || newSpan[minorAxis] != span[minorAxis]) { requirements[minorAxis] = calculateMinorAxisRequirements(minorAxis, requirements[minorAxis]); layoutMinorAxis(newSpan[minorAxis], minorAxis, offsets[minorAxis], spans[minorAxis]); span[myAxis] = newSpan[myAxis]; // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[minorAxis] = true; } // Update major axis as appropriate. if ((! isLayoutValid(myAxis)) || newSpan[myAxis] != span[myAxis]) { requirements[myAxis] = calculateMajorAxisRequirements(myAxis, requirements[myAxis]); layoutMajorAxis(newSpan[myAxis], myAxis, offsets[myAxis], spans[myAxis]); span[myAxis] = newSpan[myAxis]; // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[myAxis] = true; } assert layoutValid[myAxis] == true : "Major axis layout must be valid after layout"; assert layoutValid[minorAxis] == true : "Minor axis layout must be valid after layout"; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BoxView.java/buggy/core/src/classpath/javax/javax/swing/text/BoxView.java
assert layoutValid[myAxis] == true : "Major axis layout must be valid after layout"; assert layoutValid[minorAxis] == true : "Minor axis layout must be valid after layout";
if (layoutValid[myAxis] == false) System.err.println("WARNING: Major axis layout must be valid after layout"); if (layoutValid[minorAxis] == false) System.err.println("Minor axis layout must be valid after layout");
protected void layout(int width, int height) { int[] newSpan = new int[]{ width, height }; int count = getViewCount(); // Update minor axis as appropriate. We need to first update the minor // axis layout because that might affect the children's preferences along // the major axis. int minorAxis = myAxis == X_AXIS ? Y_AXIS : X_AXIS; if ((! isLayoutValid(minorAxis)) || newSpan[minorAxis] != span[minorAxis]) { requirements[minorAxis] = calculateMinorAxisRequirements(minorAxis, requirements[minorAxis]); layoutMinorAxis(newSpan[minorAxis], minorAxis, offsets[minorAxis], spans[minorAxis]); span[myAxis] = newSpan[myAxis]; // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[minorAxis] = true; } // Update major axis as appropriate. if ((! isLayoutValid(myAxis)) || newSpan[myAxis] != span[myAxis]) { requirements[myAxis] = calculateMajorAxisRequirements(myAxis, requirements[myAxis]); layoutMajorAxis(newSpan[myAxis], myAxis, offsets[myAxis], spans[myAxis]); span[myAxis] = newSpan[myAxis]; // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[myAxis] = true; } assert layoutValid[myAxis] == true : "Major axis layout must be valid after layout"; assert layoutValid[minorAxis] == true : "Minor axis layout must be valid after layout"; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BoxView.java/buggy/core/src/classpath/javax/javax/swing/text/BoxView.java
SizeRequirements[] childReqs = getChildRequirements(axis);
updateChildRequirements(axis); updateRequirements(axis);
protected void layoutMajorAxis(int targetSpan, int axis, int[] offsets, int[] spans) { SizeRequirements[] childReqs = getChildRequirements(axis); // Calculate the spans and offsets using the SizeRequirements uility // methods. SizeRequirements.calculateTiledPositions(targetSpan, null, childReqs, offsets, spans); layoutValid[axis] = true; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BoxView.java/buggy/core/src/classpath/javax/javax/swing/text/BoxView.java
SizeRequirements.calculateTiledPositions(targetSpan, null, childReqs,
SizeRequirements.calculateTiledPositions(targetSpan, requirements[axis], childReqs[axis],
protected void layoutMajorAxis(int targetSpan, int axis, int[] offsets, int[] spans) { SizeRequirements[] childReqs = getChildRequirements(axis); // Calculate the spans and offsets using the SizeRequirements uility // methods. SizeRequirements.calculateTiledPositions(targetSpan, null, childReqs, offsets, spans); layoutValid[axis] = true; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BoxView.java/buggy/core/src/classpath/javax/javax/swing/text/BoxView.java
layoutValid[axis] = true;
protected void layoutMajorAxis(int targetSpan, int axis, int[] offsets, int[] spans) { SizeRequirements[] childReqs = getChildRequirements(axis); // Calculate the spans and offsets using the SizeRequirements uility // methods. SizeRequirements.calculateTiledPositions(targetSpan, null, childReqs, offsets, spans); layoutValid[axis] = true; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BoxView.java/buggy/core/src/classpath/javax/javax/swing/text/BoxView.java
SizeRequirements[] childReqs = getChildRequirements(axis);
updateChildRequirements(axis); updateRequirements(axis);
protected void layoutMinorAxis(int targetSpan, int axis, int[] offsets, int[] spans) { SizeRequirements[] childReqs = getChildRequirements(axis); // Calculate the spans and offsets using the SizeRequirements uility // methods. SizeRequirements.calculateAlignedPositions(targetSpan, requirements[axis], childReqs, offsets, spans); layoutValid[axis] = true; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BoxView.java/buggy/core/src/classpath/javax/javax/swing/text/BoxView.java
childReqs, offsets, spans); layoutValid[axis] = true;
childReqs[axis], offsets, spans);
protected void layoutMinorAxis(int targetSpan, int axis, int[] offsets, int[] spans) { SizeRequirements[] childReqs = getChildRequirements(axis); // Calculate the spans and offsets using the SizeRequirements uility // methods. SizeRequirements.calculateAlignedPositions(targetSpan, requirements[axis], childReqs, offsets, spans); layoutValid[axis] = true; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BoxView.java/buggy/core/src/classpath/javax/javax/swing/text/BoxView.java
public void paint(Graphics g, Shape a) { Rectangle inside = getInsideAllocation(a); Rectangle copy = new Rectangle(inside); int count = getViewCount(); for (int i = 0; i < count; ++i) { copy.setBounds(inside); childAllocation(i, copy); if (!copy.isEmpty() && g.hitClip(copy.x, copy.y, copy.width, copy.height)) paintChild(g, copy, i); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BoxView.java/buggy/core/src/classpath/javax/javax/swing/text/BoxView.java
public void preferenceChanged (View child, boolean width, boolean height)
public void preferenceChanged(View child, boolean width, boolean height)
public void preferenceChanged (View child, boolean width, boolean height) { if (width) layoutValid[X_AXIS] = false; if (height) layoutValid[Y_AXIS] = false; super.preferenceChanged(child, width, height); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BoxView.java/buggy/core/src/classpath/javax/javax/swing/text/BoxView.java
{
{
public float getAlignment(int axis) { return 0.5f; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/View.java/buggy/core/src/classpath/javax/javax/swing/text/View.java
}
}
public float getAlignment(int axis) { return 0.5f; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/View.java/buggy/core/src/classpath/javax/javax/swing/text/View.java
{
{
public boolean hitClip(int x, int y, int width, int height){ return getClip().intersects(x, y, width, height);}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c0997df57feec0722568b1f1cc390b475c418086/Graphics.java/buggy/core/src/classpath/java/java/awt/Graphics.java
}
}
public boolean hitClip(int x, int y, int width, int height){ return getClip().intersects(x, y, width, height);}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c0997df57feec0722568b1f1cc390b475c418086/Graphics.java/buggy/core/src/classpath/java/java/awt/Graphics.java
TableColumnModel cols = table.getColumnModel();
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/49ad2f4c3e74f0a8e99b839c938a312898850fa0/BasicTableUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicTableUI.java
int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0;
Point p1 = new Point(clip.x, clip.y); int c0 = table.columnAtPoint(p1); if (c0 == -1) c0 = 0; int r0 = table.rowAtPoint(p1); if (r0 == -1) r0 = 0; Point p2 = new Point(clip.x + clip.width, clip.y + clip.height); int cn = table.columnAtPoint(p2); if (cn == -1) cn = table.getColumnCount() - 1; int rn = table.rowAtPoint(p2); if (rn == -1) rn = table.getRowCount() - 1;
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/49ad2f4c3e74f0a8e99b839c938a312898850fa0/BasicTableUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicTableUI.java
Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle();
TableColumnModel cmodel = table.getColumnModel(); int [] widths = new int[cn+1]; for (int i = c0; i <=cn ; i++) { widths[i] = cmodel.getColumn(i).getWidth(); } Rectangle bounds = table.getCellRect(r0, c0, false); bounds.height = table.getRowHeight()+table.getRowMargin(); int left = bounds.x; int top = bounds.y; int bottom; int height = bounds.height;
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/49ad2f4c3e74f0a8e99b839c938a312898850fa0/BasicTableUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicTableUI.java
for (int c = 0; c < ncols && x < xmax; ++c)
Color grid = table.getGridColor(); for (int r = r0; r <= rn; ++r)
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/49ad2f4c3e74f0a8e99b839c938a312898850fa0/BasicTableUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicTableUI.java
y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip))
for (int c = c0; c <= cn; ++c)
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/49ad2f4c3e74f0a8e99b839c938a312898850fa0/BasicTableUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicTableUI.java
y += height; } x += width;
bounds.y += height; bounds.x = left;
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/49ad2f4c3e74f0a8e99b839c938a312898850fa0/BasicTableUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicTableUI.java
ymax = y; xmax = x; Color grid = table.getGridColor();
bottom = bounds.y;
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/49ad2f4c3e74f0a8e99b839c938a312898850fa0/BasicTableUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicTableUI.java
x = x0;
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/49ad2f4c3e74f0a8e99b839c938a312898850fa0/BasicTableUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicTableUI.java
for (int c = 0; c < ncols && x < xmax; ++c)
int x = left; for (int c = c0; c <= cn; ++c)
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/49ad2f4c3e74f0a8e99b839c938a312898850fa0/BasicTableUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicTableUI.java
x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax);
gfx.drawLine(x, top, x, bottom); x += widths[c];
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/49ad2f4c3e74f0a8e99b839c938a312898850fa0/BasicTableUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicTableUI.java
y = y0;
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/49ad2f4c3e74f0a8e99b839c938a312898850fa0/BasicTableUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicTableUI.java
for (int r = 0; r < nrows && y < ymax; ++r)
int y = top; for (int r = r0; r <= rn; ++r)
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/49ad2f4c3e74f0a8e99b839c938a312898850fa0/BasicTableUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicTableUI.java
gfx.drawLine(x0, y, xmax, y);
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/49ad2f4c3e74f0a8e99b839c938a312898850fa0/BasicTableUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicTableUI.java
int y0 = getLocation().y; int nrows = getRowCount(); Dimension gap = getIntercellSpacing(); int height = getRowHeight() + (gap == null ? 0 : gap.height); int y = point.y; for (int i = 0; i < nrows; ++i) { if (0 <= y && y < height) return i; y -= height; }
int y0 = getLocation().y; int nrows = getRowCount(); Dimension gap = getIntercellSpacing(); int height = getRowHeight() + (gap == null ? 0 : gap.height); int y = point.y; for (int i = 0; i < nrows; ++i) { if (0 <= y && y < height) return i; y -= height; }
public int rowAtPoint(Point point) { if (point != null) { int y0 = getLocation().y; int nrows = getRowCount(); Dimension gap = getIntercellSpacing(); int height = getRowHeight() + (gap == null ? 0 : gap.height); int y = point.y; for (int i = 0; i < nrows; ++i) { if (0 <= y && y < height) return i; y -= height; } } return -1; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JTable.java/buggy/core/src/classpath/javax/javax/swing/JTable.java
int x0 = getLocation().x; int ncols = getColumnCount(); Dimension gap = getIntercellSpacing(); TableColumnModel cols = getColumnModel(); int x = point.x; for (int i = 0; i < ncols; ++i) {
int x0 = getLocation().x; int ncols = getColumnCount(); Dimension gap = getIntercellSpacing(); TableColumnModel cols = getColumnModel(); int x = point.x; for (int i = 0; i < ncols; ++i) {
public int columnAtPoint(Point point) { if (point != null) { int x0 = getLocation().x; int ncols = getColumnCount(); Dimension gap = getIntercellSpacing(); TableColumnModel cols = getColumnModel(); int x = point.x; for (int i = 0; i < ncols; ++i) { int width = cols.getColumn(i).getWidth() + (gap == null ? 0 : gap.width); if (0 <= x && x < width) return i; x -= width; } } return -1; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JTable.java/buggy/core/src/classpath/javax/javax/swing/JTable.java
if (0 <= x && x < width) return i; x -= width; }
if (0 <= x && x < width) return i; x -= width; }
public int columnAtPoint(Point point) { if (point != null) { int x0 = getLocation().x; int ncols = getColumnCount(); Dimension gap = getIntercellSpacing(); TableColumnModel cols = getColumnModel(); int x = point.x; for (int i = 0; i < ncols; ++i) { int width = cols.getColumn(i).getWidth() + (gap == null ? 0 : gap.width); if (0 <= x && x < width) return i; x -= width; } } return -1; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JTable.java/buggy/core/src/classpath/javax/javax/swing/JTable.java
public int getClickCountToStart() {
public int getClickCountToStart() {
public int getClickCountToStart() { return 0; // TODO } // getClickCountToStart()
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/DefaultCellEditor.java/buggy/core/src/classpath/javax/javax/swing/DefaultCellEditor.java
void removeSelectionInterval(int index0, int index1);
void removeSelectionInterval(int index0, int index1);
void removeSelectionInterval(int index0, int index1);
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/ListSelectionModel.java/buggy/core/src/classpath/javax/javax/swing/ListSelectionModel.java
void addSelectionInterval(int index0, int index1);
void addSelectionInterval(int index0, int index1);
void addSelectionInterval(int index0, int index1);
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/ListSelectionModel.java/buggy/core/src/classpath/javax/javax/swing/ListSelectionModel.java
{ x += columnModel.getColumn(i).getWidth(); x += x_gap; }
x += columnModel.getColumn(i).getWidth();
public Rectangle getCellRect(int row, int column, boolean includeSpacing) { int height = getRowHeight(row); int width = columnModel.getColumn(column).getWidth(); int x_gap = columnModel.getColumnMargin(); int y_gap = rowMargin; column = Math.max(0, Math.min(column, getColumnCount() - 1)); row = Math.max(0, Math.min(row, getRowCount() - 1)); int x = 0; int y = (height + y_gap) * row; for (int i = 0; i < column; ++i) { x += columnModel.getColumn(i).getWidth(); x += x_gap; } if (includeSpacing) return new Rectangle(x, y, width, height); else return new Rectangle(x, y, width - x_gap, height - y_gap); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JTable.java/buggy/core/src/classpath/javax/javax/swing/JTable.java
return maxWidth;
return maxWidth;
public int getMaxWidth() { return maxWidth; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/TableColumn.java/buggy/core/src/classpath/javax/javax/swing/table/TableColumn.java
return minWidth;
return minWidth;
public int getMinWidth() { return minWidth; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/TableColumn.java/buggy/core/src/classpath/javax/javax/swing/table/TableColumn.java
return width;
return width;
public int getWidth() { return width; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/TableColumn.java/buggy/core/src/classpath/javax/javax/swing/table/TableColumn.java
bad.minor = Minor.Any;
public static ServantAlreadyActive extract(Any any) { try { EmptyExceptionHolder h = (EmptyExceptionHolder) any.extract_Streamable(); return (ServantAlreadyActive) h.value; } catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("ServantAlreadyActive expected"); bad.initCause(cex); throw bad; } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/44e3ea509d80974dab547c4d1cf8c070d32bac86/ServantAlreadyActiveHelper.java/clean/core/src/classpath/org/org/omg/PortableServer/POAPackage/ServantAlreadyActiveHelper.java
builder.emitObject(os, object);
throw new RuntimeException("Unresolved object " + object);
public int addressOf32(Object object) { final NativeStream.ObjectRef ref = os.getObjectRef(object); try { if (!ref.isResolved()) { builder.emitObject(os, object); } final int offset = (int) os.getBaseAddr() + ref.getOffset(); return offset; } catch (ClassNotFoundException ex) { throw new RuntimeException("Unresolved object ref", ex); } catch (UnresolvedObjectRefException ex) { throw new RuntimeException("Unresolved object ref", ex); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6c51b2252b587e401cd3a2b2e553206263541af7/BuildObjectResolver.java/clean/builder/src/builder/org/jnode/build/BuildObjectResolver.java
} catch (ClassNotFoundException ex) { throw new RuntimeException("Unresolved object ref", ex);
public int addressOf32(Object object) { final NativeStream.ObjectRef ref = os.getObjectRef(object); try { if (!ref.isResolved()) { builder.emitObject(os, object); } final int offset = (int) os.getBaseAddr() + ref.getOffset(); return offset; } catch (ClassNotFoundException ex) { throw new RuntimeException("Unresolved object ref", ex); } catch (UnresolvedObjectRefException ex) { throw new RuntimeException("Unresolved object ref", ex); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6c51b2252b587e401cd3a2b2e553206263541af7/BuildObjectResolver.java/clean/builder/src/builder/org/jnode/build/BuildObjectResolver.java
builder.emitObject(os, object);
throw new RuntimeException("Unresolved object " + object);
public long addressOf64(Object object) { final NativeStream.ObjectRef ref = os.getObjectRef(object); try { if (!ref.isResolved()) { builder.emitObject(os, object); } final long offset = os.getBaseAddr() + ref.getOffset(); return offset; } catch (ClassNotFoundException ex) { throw new RuntimeException("Unresolved object ref", ex); } catch (UnresolvedObjectRefException ex) { throw new RuntimeException("Unresolved object ref", ex); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6c51b2252b587e401cd3a2b2e553206263541af7/BuildObjectResolver.java/clean/builder/src/builder/org/jnode/build/BuildObjectResolver.java
} catch (ClassNotFoundException ex) { throw new RuntimeException("Unresolved object ref", ex);
public long addressOf64(Object object) { final NativeStream.ObjectRef ref = os.getObjectRef(object); try { if (!ref.isResolved()) { builder.emitObject(os, object); } final long offset = os.getBaseAddr() + ref.getOffset(); return offset; } catch (ClassNotFoundException ex) { throw new RuntimeException("Unresolved object ref", ex); } catch (UnresolvedObjectRefException ex) { throw new RuntimeException("Unresolved object ref", ex); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6c51b2252b587e401cd3a2b2e553206263541af7/BuildObjectResolver.java/clean/builder/src/builder/org/jnode/build/BuildObjectResolver.java
if (e.getPropertyName().equals(JComboBox.RENDERER_CHANGED_PROPERTY))
if (e.getPropertyName().equals("renderer"))
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals(JComboBox.RENDERER_CHANGED_PROPERTY)) { list.setCellRenderer((ListCellRenderer) e.getNewValue()); revalidate(); repaint(); } if (e.getPropertyName().equals(JComboBox.MODEL_CHANGED_PROPERTY)) { list.setModel((ComboBoxModel) e.getNewValue()); revalidate(); repaint(); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/53b78dd1e4587254262f4618d2aa7551de8e0cbf/BasicComboPopup.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicComboPopup.java
if (e.getPropertyName().equals(JComboBox.MODEL_CHANGED_PROPERTY))
if (e.getPropertyName().equals("dataModel"))
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals(JComboBox.RENDERER_CHANGED_PROPERTY)) { list.setCellRenderer((ListCellRenderer) e.getNewValue()); revalidate(); repaint(); } if (e.getPropertyName().equals(JComboBox.MODEL_CHANGED_PROPERTY)) { list.setModel((ComboBoxModel) e.getNewValue()); revalidate(); repaint(); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/53b78dd1e4587254262f4618d2aa7551de8e0cbf/BasicComboPopup.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicComboPopup.java
layeredPane = SwingUtilities.getRootPane(invoker) .getLayeredPane();
layeredPane = SwingUtilities.getRootPane(invoker).getLayeredPane();
public void setVisible(boolean visible) { if (visible == isVisible()) return; boolean old = isVisible(); this.visible = visible; if (old != isVisible()) { firePropertyChange("visible", old, isVisible()); if (visible) { firePopupMenuWillBecomeVisible(); Container rootContainer = (Container) SwingUtilities.getRoot(invoker); boolean fit = true; Dimension size; // Determine the size of the popup menu if (this.getSize().width == 0 && this.getSize().width == 0) size = this.getPreferredSize(); else size = this.getSize(); if ((size.width > (rootContainer.getWidth() - popupLocation.x)) || (size.height > (rootContainer.getHeight() - popupLocation.y))) fit = false; if (lightWeightPopupEnabled && fit) popup = new LightWeightPopup(this); else { if (fit) popup = new MediumWeightPopup(this); else popup = new HeavyWeightPopup(this); } if (popup instanceof LightWeightPopup || popup instanceof MediumWeightPopup) { JLayeredPane layeredPane; layeredPane = SwingUtilities.getRootPane(invoker) .getLayeredPane(); Point p = new Point(popupLocation.x, popupLocation.y); SwingUtilities.convertPointFromScreen(p, layeredPane); popup.show(p.x, p.y, size.width, size.height); } else { // Subtract insets of the top-level container if popup menu's // top-left corner is inside it. Insets insets = rootContainer.getInsets(); popup.show(popupLocation.x - insets.left, popupLocation.y - insets.top, size.width, size.height); } } else { firePopupMenuWillBecomeInvisible(); popup.hide(); } } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/045a5b41cdfa747889101d3993040acf89788bc4/JPopupMenu.java/buggy/core/src/classpath/javax/javax/swing/JPopupMenu.java
popupLocation.y - insets.top, size.width, size.height);
popupLocation.y - insets.top, size.width, size.height);
public void setVisible(boolean visible) { if (visible == isVisible()) return; boolean old = isVisible(); this.visible = visible; if (old != isVisible()) { firePropertyChange("visible", old, isVisible()); if (visible) { firePopupMenuWillBecomeVisible(); Container rootContainer = (Container) SwingUtilities.getRoot(invoker); boolean fit = true; Dimension size; // Determine the size of the popup menu if (this.getSize().width == 0 && this.getSize().width == 0) size = this.getPreferredSize(); else size = this.getSize(); if ((size.width > (rootContainer.getWidth() - popupLocation.x)) || (size.height > (rootContainer.getHeight() - popupLocation.y))) fit = false; if (lightWeightPopupEnabled && fit) popup = new LightWeightPopup(this); else { if (fit) popup = new MediumWeightPopup(this); else popup = new HeavyWeightPopup(this); } if (popup instanceof LightWeightPopup || popup instanceof MediumWeightPopup) { JLayeredPane layeredPane; layeredPane = SwingUtilities.getRootPane(invoker) .getLayeredPane(); Point p = new Point(popupLocation.x, popupLocation.y); SwingUtilities.convertPointFromScreen(p, layeredPane); popup.show(p.x, p.y, size.width, size.height); } else { // Subtract insets of the top-level container if popup menu's // top-left corner is inside it. Insets insets = rootContainer.getInsets(); popup.show(popupLocation.x - insets.left, popupLocation.y - insets.top, size.width, size.height); } } else { firePopupMenuWillBecomeInvisible(); popup.hide(); } } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/045a5b41cdfa747889101d3993040acf89788bc4/JPopupMenu.java/buggy/core/src/classpath/javax/javax/swing/JPopupMenu.java
public void setPopupSize(int width, int height)
public void setPopupSize(Dimension size)
public void setPopupSize(int width, int height) { super.setSize(width, height); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/045a5b41cdfa747889101d3993040acf89788bc4/JPopupMenu.java/buggy/core/src/classpath/javax/javax/swing/JPopupMenu.java
super.setSize(width, height);
super.setSize(size);
public void setPopupSize(int width, int height) { super.setSize(width, height); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/045a5b41cdfa747889101d3993040acf89788bc4/JPopupMenu.java/buggy/core/src/classpath/javax/javax/swing/JPopupMenu.java
public void propertyChange(PropertyChangeEvent e) { }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/BasicButtonListener.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicButtonListener.java
throws NotImplementedException
protected void installKeyboardActions() throws NotImplementedException { // FIXME: implement }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicMenuBarUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicMenuBarUI.java
Object[] bindings = (Object[]) SharedUIDefaults.get("MenuBar.windowBindings"); InputMap inputMap = LookAndFeel.makeComponentInputMap(menuBar, bindings); SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap); SwingUtilities.replaceUIActionMap(menuBar, getActionMap());
protected void installKeyboardActions() throws NotImplementedException { // FIXME: implement }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicMenuBarUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicMenuBarUI.java
throws NotImplementedException
protected void uninstallKeyboardActions() throws NotImplementedException { // FIXME: implement. }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicMenuBarUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicMenuBarUI.java
SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, null); SwingUtilities.replaceUIActionMap(menuBar, null);
protected void uninstallKeyboardActions() throws NotImplementedException { // FIXME: implement. }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicMenuBarUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicMenuBarUI.java
public AbstractAction(String name)
public AbstractAction()
public AbstractAction(String name) { this(name, null); // TODO: default icon?? }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/50cfc3ee73e2e377b07c91f0e40a2f172b10fd27/AbstractAction.java/buggy/core/src/classpath/javax/javax/swing/AbstractAction.java
this(name, null);
this("");
public AbstractAction(String name) { this(name, null); // TODO: default icon?? }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/50cfc3ee73e2e377b07c91f0e40a2f172b10fd27/AbstractAction.java/buggy/core/src/classpath/javax/javax/swing/AbstractAction.java
return;
return;
public void setSelectedPath(MenuElement[] path) { if (path == null) { clearSelectedPath(); return; } int i; int minSize = path.length; // size of the smaller path. if (path.length > selectedPath.size()) { minSize = selectedPath.size(); // if new selected path contains more elements then current // selection then first add all elements at // the indexes > selectedPath.size for (i = selectedPath.size(); i < path.length; i++) { selectedPath.add(path[i]); path[i].menuSelectionChanged(true); } } else if (path.length < selectedPath.size()) { // if new selected path contains less elements then current // selection then first remove all elements from the selection // at the indexes > path.length for (i = selectedPath.size() - 1; i >= path.length; i--) { ((MenuElement) selectedPath.get(i)).menuSelectionChanged(false); selectedPath.remove(i); } minSize = path.length; } // Now compare elements in new and current selection path at the // same location and adjust selection until // same menu elements will be encountered at the // same index in both current and new selection path. MenuElement oldSelectedItem; for (i = minSize - 1; i >= 0; i--) { oldSelectedItem = (MenuElement) selectedPath.get(i); if (path[i].equals(oldSelectedItem)) break; oldSelectedItem.menuSelectionChanged(false); path[i].menuSelectionChanged(true); selectedPath.setElementAt(path[i], i); } fireStateChanged(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/MenuSelectionManager.java/buggy/core/src/classpath/javax/javax/swing/MenuSelectionManager.java
public void setSelectedPath(MenuElement[] path) { if (path == null) { clearSelectedPath(); return; } int i; int minSize = path.length; // size of the smaller path. if (path.length > selectedPath.size()) { minSize = selectedPath.size(); // if new selected path contains more elements then current // selection then first add all elements at // the indexes > selectedPath.size for (i = selectedPath.size(); i < path.length; i++) { selectedPath.add(path[i]); path[i].menuSelectionChanged(true); } } else if (path.length < selectedPath.size()) { // if new selected path contains less elements then current // selection then first remove all elements from the selection // at the indexes > path.length for (i = selectedPath.size() - 1; i >= path.length; i--) { ((MenuElement) selectedPath.get(i)).menuSelectionChanged(false); selectedPath.remove(i); } minSize = path.length; } // Now compare elements in new and current selection path at the // same location and adjust selection until // same menu elements will be encountered at the // same index in both current and new selection path. MenuElement oldSelectedItem; for (i = minSize - 1; i >= 0; i--) { oldSelectedItem = (MenuElement) selectedPath.get(i); if (path[i].equals(oldSelectedItem)) break; oldSelectedItem.menuSelectionChanged(false); path[i].menuSelectionChanged(true); selectedPath.setElementAt(path[i], i); } fireStateChanged(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/MenuSelectionManager.java/buggy/core/src/classpath/javax/javax/swing/MenuSelectionManager.java
{
{
public void setSelectedPath(MenuElement[] path) { if (path == null) { clearSelectedPath(); return; } int i; int minSize = path.length; // size of the smaller path. if (path.length > selectedPath.size()) { minSize = selectedPath.size(); // if new selected path contains more elements then current // selection then first add all elements at // the indexes > selectedPath.size for (i = selectedPath.size(); i < path.length; i++) { selectedPath.add(path[i]); path[i].menuSelectionChanged(true); } } else if (path.length < selectedPath.size()) { // if new selected path contains less elements then current // selection then first remove all elements from the selection // at the indexes > path.length for (i = selectedPath.size() - 1; i >= path.length; i--) { ((MenuElement) selectedPath.get(i)).menuSelectionChanged(false); selectedPath.remove(i); } minSize = path.length; } // Now compare elements in new and current selection path at the // same location and adjust selection until // same menu elements will be encountered at the // same index in both current and new selection path. MenuElement oldSelectedItem; for (i = minSize - 1; i >= 0; i--) { oldSelectedItem = (MenuElement) selectedPath.get(i); if (path[i].equals(oldSelectedItem)) break; oldSelectedItem.menuSelectionChanged(false); path[i].menuSelectionChanged(true); selectedPath.setElementAt(path[i], i); } fireStateChanged(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/MenuSelectionManager.java/buggy/core/src/classpath/javax/javax/swing/MenuSelectionManager.java