rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
else { setIcon(null); } setText("");
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); if (value instanceof Icon) { Icon iconValue = (Icon) value; setIcon(iconValue); setText(""); } return this; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JTable.java/clean/core/src/classpath/javax/javax/swing/JTable.java
if (isEditing()) editingCanceled(null);
public void columnMoved (TableColumnModelEvent event) { revalidate(); repaint(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JTable.java/clean/core/src/classpath/javax/javax/swing/JTable.java
if (getColumnCount() < 2) return; int x0 = 0; int idx0 = event.getFirstIndex(); int idxn = event.getLastIndex(); int i;
int idx0 = Math.max(0, Math.min(getColumnCount() - 1, event.getFirstIndex())); int idxn = Math.max(0, Math.min(getColumnCount() - 1, event.getLastIndex()));
public void columnSelectionChanged (ListSelectionEvent event) { // Does not make sense for the table with the single column. if (getColumnCount() < 2) return; int x0 = 0; int idx0 = event.getFirstIndex(); int idxn = event.getLastIndex(); int i; for (i = 0; i < idx0; i++) x0 += columnModel.getColumn(i).getWidth(); int xn = x0; for (i = idx0; i <= idxn; i++) xn += columnModel.getColumn(i).getWidth(); repaint(x0, 0, xn-x0, getHeight()); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JTable.java/clean/core/src/classpath/javax/javax/swing/JTable.java
for (i = 0; i < idx0; i++) x0 += columnModel.getColumn(i).getWidth(); int xn = x0; for (i = idx0; i <= idxn; i++) xn += columnModel.getColumn(i).getWidth(); repaint(x0, 0, xn-x0, getHeight());
int minRow = 0; int maxRow = getRowCount() - 1; if (getRowSelectionAllowed()) { minRow = selectionModel.getMinSelectionIndex(); maxRow = selectionModel.getMaxSelectionIndex(); int leadRow = selectionModel.getLeadSelectionIndex(); if (minRow == -1 && maxRow == -1) { minRow = leadRow; maxRow = leadRow; } else { if (leadRow != -1) { minRow = Math.min(minRow, leadRow); maxRow = Math.max(maxRow, leadRow); } } } if (minRow != -1 && maxRow != -1) { Rectangle first = getCellRect(minRow, idx0, false); Rectangle last = getCellRect(maxRow, idxn, false); Rectangle dirty = SwingUtilities.computeUnion(first.x, first.y, first.width, first.height, last); repaint(dirty); }
public void columnSelectionChanged (ListSelectionEvent event) { // Does not make sense for the table with the single column. if (getColumnCount() < 2) return; int x0 = 0; int idx0 = event.getFirstIndex(); int idxn = event.getLastIndex(); int i; for (i = 0; i < idx0; i++) x0 += columnModel.getColumn(i).getWidth(); int xn = x0; for (i = idx0; i <= idxn; i++) xn += columnModel.getColumn(i).getWidth(); repaint(x0, 0, xn-x0, getHeight()); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JTable.java/clean/core/src/classpath/javax/javax/swing/JTable.java
setDefaultEditor(Boolean.class, new DefaultCellEditor(box));
box.setBorder(BorderFactory.createLineBorder(getGridColor(), 2)); box.setBorderPainted(true); booleanInvertingEditor = new DefaultCellEditor(box); setDefaultEditor(Boolean.class, booleanInvertingEditor);
protected void createDefaultEditors() { JCheckBox box = new BooleanCellRenderer().getCheckBox(); setDefaultEditor(Boolean.class, new DefaultCellEditor(box)); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JTable.java/clean/core/src/classpath/javax/javax/swing/JTable.java
repaint(); if (tableHeader!=null) tableHeader.repaint();
int leftBoundary = getLeftResizingBoundary(); int width = getWidth() - leftBoundary; repaint(leftBoundary, 0, width, getHeight()); if (tableHeader != null) tableHeader.repaint(leftBoundary, 0, width, tableHeader.getHeight());
public void doLayout() { TableColumn resizingColumn = null; int ncols = getColumnCount(); if (ncols < 1) return; int prefSum = 0; int rCol = -1; if (tableHeader != null) resizingColumn = tableHeader.getResizingColumn(); for (int i = 0; i < ncols; ++i) { TableColumn col = columnModel.getColumn(i); int p = col.getPreferredWidth(); prefSum += p; if (resizingColumn == col) rCol = i; } int spill = getWidth() - prefSum; if (resizingColumn != null) { TableColumn col; TableColumn [] cols; switch (getAutoResizeMode()) { case AUTO_RESIZE_LAST_COLUMN: col = columnModel.getColumn(ncols-1); col.setWidth(col.getPreferredWidth() + spill); break; case AUTO_RESIZE_NEXT_COLUMN: col = columnModel.getColumn(ncols-1); col.setWidth(col.getPreferredWidth() + spill); break; case AUTO_RESIZE_ALL_COLUMNS: cols = new TableColumn[ncols]; for (int i = 0; i < ncols; ++i) cols[i] = columnModel.getColumn(i); distributeSpillResizing(cols, spill, resizingColumn); break; case AUTO_RESIZE_SUBSEQUENT_COLUMNS: // Subtract the width of the non-resized columns from the spill. int w = 0; int wp = 0; TableColumn column; for (int i = 0; i < rCol; i++) { column = columnModel.getColumn(i); w += column.getWidth(); wp+= column.getPreferredWidth(); } // The number of columns right from the column being resized. int n = ncols-rCol-1; if (n>0) { // If there are any columns on the right sied to resize. spill = (getWidth()-w) - (prefSum-wp); int average = spill / n; // For all columns right from the column being resized: for (int i = rCol+1; i < ncols; i++) { column = columnModel.getColumn(i); column.setWidth(column.getPreferredWidth() + average); } } resizingColumn.setWidth(resizingColumn.getPreferredWidth()); break; case AUTO_RESIZE_OFF: default: int prefWidth = resizingColumn.getPreferredWidth(); resizingColumn.setWidth(prefWidth); } } else { TableColumn [] cols = new TableColumn[ncols]; for (int i = 0; i < ncols; ++i) cols[i] = columnModel.getColumn(i); distributeSpill(cols, spill); } if (editorComp!=null) moveToCellBeingEdited(editorComp); // Repaint fixes the invalid view after the first keystroke if the cell // editing is started immediately after the program start or cell // resizing. repaint(); if (tableHeader!=null) tableHeader.repaint(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JTable.java/clean/core/src/classpath/javax/javax/swing/JTable.java
public boolean editCellAt (int row, int column)
public boolean editCellAt(int row, int column)
public boolean editCellAt (int row, int column) { // Complete the previous editing session, if still active. if (isEditing()) editingStopped(new ChangeEvent("editingStopped")); editingRow = row; editingColumn = column; setCellEditor(getCellEditor(row, column)); editorComp = prepareEditor(cellEditor, row, column); // Remove the previous editor components, if present. Only one // editor component at time is allowed in the table. removeAll(); add(editorComp); moveToCellBeingEdited(editorComp); scrollRectToVisible(editorComp.getBounds()); editorComp.requestFocusInWindow(); return true; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JTable.java/clean/core/src/classpath/javax/javax/swing/JTable.java
setCellEditor(getCellEditor(row, column));
setCellEditor(editor);
public boolean editCellAt (int row, int column) { // Complete the previous editing session, if still active. if (isEditing()) editingStopped(new ChangeEvent("editingStopped")); editingRow = row; editingColumn = column; setCellEditor(getCellEditor(row, column)); editorComp = prepareEditor(cellEditor, row, column); // Remove the previous editor components, if present. Only one // editor component at time is allowed in the table. removeAll(); add(editorComp); moveToCellBeingEdited(editorComp); scrollRectToVisible(editorComp.getBounds()); editorComp.requestFocusInWindow(); return true; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JTable.java/clean/core/src/classpath/javax/javax/swing/JTable.java
return true;
return editor.shouldSelectCell(null); }
public boolean editCellAt (int row, int column) { // Complete the previous editing session, if still active. if (isEditing()) editingStopped(new ChangeEvent("editingStopped")); editingRow = row; editingColumn = column; setCellEditor(getCellEditor(row, column)); editorComp = prepareEditor(cellEditor, row, column); // Remove the previous editor components, if present. Only one // editor component at time is allowed in the table. removeAll(); add(editorComp); moveToCellBeingEdited(editorComp); scrollRectToVisible(editorComp.getBounds()); editorComp.requestFocusInWindow(); return true; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JTable.java/clean/core/src/classpath/javax/javax/swing/JTable.java
if (accessibleContext == null) { AccessibleJTable ctx = new AccessibleJTable(); addPropertyChangeListener(ctx); TableColumnModel tcm = getColumnModel(); tcm.addColumnModelListener(ctx); tcm.getSelectionModel().addListSelectionListener(ctx); getSelectionModel().addListSelectionListener(ctx); accessibleContext = ctx; }
public AccessibleContext getAccessibleContext() { return accessibleContext; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JTable.java/clean/core/src/classpath/javax/javax/swing/JTable.java
int height = getRowHeight(row); int width = columnModel.getColumn(column).getWidth(); int x_gap = columnModel.getColumnMargin(); int y_gap = rowMargin;
Rectangle cellRect = new Rectangle(0, 0, 0, 0);
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(); Rectangle rect = new Rectangle(); if (includeSpacing) rect.setBounds(x, y, width, height +y_gap); else rect.setBounds(x, y, width - x_gap, height); return rect; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JTable.java/clean/core/src/classpath/javax/javax/swing/JTable.java
column = Math.max(0, Math.min(column, getColumnCount() - 1)); row = Math.max(0, Math.min(row, getRowCount() - 1));
if (row >= getRowCount()) { cellRect.height = getHeight(); } else if (row >= 0) { cellRect.height = getRowHeight(row); if (rowHeights == null) cellRect.y = row * cellRect.height; else cellRect.y = rowHeights.getPosition(row);
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(); Rectangle rect = new Rectangle(); if (includeSpacing) rect.setBounds(x, y, width, height +y_gap); else rect.setBounds(x, y, width - x_gap, height); return rect; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JTable.java/clean/core/src/classpath/javax/javax/swing/JTable.java
int x = 0; int y = (height + y_gap) * row;
if (! includeSpacing) { int rMargin = getRowMargin(); cellRect.y += rMargin / 2; cellRect.height -= rMargin; } }
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(); Rectangle rect = new Rectangle(); if (includeSpacing) rect.setBounds(x, y, width, height +y_gap); else rect.setBounds(x, y, width - x_gap, height); return rect; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JTable.java/clean/core/src/classpath/javax/javax/swing/JTable.java
for (int i = 0; i < column; ++i) x += columnModel.getColumn(i).getWidth();
if (column < 0) { if (! getComponentOrientation().isLeftToRight()) { cellRect.x = getWidth(); } } else if (column >= getColumnCount()) { if (getComponentOrientation().isLeftToRight()) { cellRect.x = getWidth(); } } else { TableColumnModel tcm = getColumnModel(); if (getComponentOrientation().isLeftToRight()) { for (int i = 0; i < column; i++) cellRect.x += tcm.getColumn(i).getWidth(); } else { for (int i = tcm.getColumnCount() - 1; i > column; i--) cellRect.x += tcm.getColumn(i).getWidth(); } cellRect.width = tcm.getColumn(column).getWidth(); if (! includeSpacing) { int cMargin = tcm.getColumnMargin(); cellRect.x += cMargin / 2; cellRect.width -= cMargin; } }
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(); Rectangle rect = new Rectangle(); if (includeSpacing) rect.setBounds(x, y, width, height +y_gap); else rect.setBounds(x, y, width - x_gap, height); return rect; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JTable.java/clean/core/src/classpath/javax/javax/swing/JTable.java
Rectangle rect = new Rectangle(); if (includeSpacing) rect.setBounds(x, y, width, height +y_gap); else rect.setBounds(x, y, width - x_gap, height); return rect;
return cellRect;
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(); Rectangle rect = new Rectangle(); if (includeSpacing) rect.setBounds(x, y, width, height +y_gap); else rect.setBounds(x, y, width - x_gap, height); return rect; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JTable.java/clean/core/src/classpath/javax/javax/swing/JTable.java
this.defaultRenderersByColumnClass = new Hashtable(); createDefaultRenderers(); this.defaultEditorsByColumnClass = new Hashtable(); createDefaultEditors();
protected void initializeLocalVars() { setTableHeader(createDefaultTableHeader()); if (autoCreateColumnsFromModel) createDefaultColumnsFromModel(); this.columnModel.addColumnModelListener(this); this.defaultRenderersByColumnClass = new Hashtable(); createDefaultRenderers(); this.defaultEditorsByColumnClass = new Hashtable(); createDefaultEditors(); this.autoResizeMode = AUTO_RESIZE_SUBSEQUENT_COLUMNS; this.rowHeight = 16; this.rowMargin = 1; this.rowSelectionAllowed = true; // this.accessibleContext = new AccessibleJTable(); this.cellEditor = null; // COMPAT: Both Sun and IBM have drag enabled this.dragEnabled = true; this.preferredViewportSize = new Dimension(450,400); this.showHorizontalLines = true; this.showVerticalLines = true; this.editingColumn = -1; this.editingRow = -1; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JTable.java/clean/core/src/classpath/javax/javax/swing/JTable.java
this.rowHeight = 16;
setRowHeight(16);
protected void initializeLocalVars() { setTableHeader(createDefaultTableHeader()); if (autoCreateColumnsFromModel) createDefaultColumnsFromModel(); this.columnModel.addColumnModelListener(this); this.defaultRenderersByColumnClass = new Hashtable(); createDefaultRenderers(); this.defaultEditorsByColumnClass = new Hashtable(); createDefaultEditors(); this.autoResizeMode = AUTO_RESIZE_SUBSEQUENT_COLUMNS; this.rowHeight = 16; this.rowMargin = 1; this.rowSelectionAllowed = true; // this.accessibleContext = new AccessibleJTable(); this.cellEditor = null; // COMPAT: Both Sun and IBM have drag enabled this.dragEnabled = true; this.preferredViewportSize = new Dimension(450,400); this.showHorizontalLines = true; this.showVerticalLines = true; this.editingColumn = -1; this.editingRow = -1; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JTable.java/clean/core/src/classpath/javax/javax/swing/JTable.java
public Component prepareRenderer(TableCellRenderer renderer, int row, int column) { boolean rowSelAllowed = getRowSelectionAllowed(); boolean colSelAllowed = getColumnSelectionAllowed(); boolean isSel = false; if (rowSelAllowed && colSelAllowed || !rowSelAllowed && !colSelAllowed) isSel = isCellSelected(row, column); else isSel = isRowSelected(row) && getRowSelectionAllowed() || isColumnSelected(column) && getColumnSelectionAllowed(); // Determine the focused cell. The focused cell is the cell at the // leadSelectionIndices of the row and column selection model. ListSelectionModel rowSel = getSelectionModel(); ListSelectionModel colSel = getColumnModel().getSelectionModel(); boolean hasFocus = hasFocus() && isEnabled() && rowSel.getLeadSelectionIndex() == row && colSel.getLeadSelectionIndex() == column; return renderer.getTableCellRendererComponent(this, dataModel.getValueAt(row, convertColumnIndexToModel(column)), isSel, hasFocus, row, column); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JTable.java/clean/core/src/classpath/javax/javax/swing/JTable.java
int height = getRowHeight() + getRowMargin();
int r;
public int rowAtPoint(Point point) { if (point != null) { int nrows = getRowCount(); int height = getRowHeight() + getRowMargin(); int y = point.y; int r = y / height; if (r < 0 || r >= nrows) return -1; else return r; } else return -1; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JTable.java/clean/core/src/classpath/javax/javax/swing/JTable.java
int r = y / height;
public int rowAtPoint(Point point) { if (point != null) { int nrows = getRowCount(); int height = getRowHeight() + getRowMargin(); int y = point.y; int r = y / height; if (r < 0 || r >= nrows) return -1; else return r; } else return -1; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JTable.java/clean/core/src/classpath/javax/javax/swing/JTable.java
if (getRowCount() == 0 || getColumnCount() == 0) return;
public void selectAll() { // rowLead and colLead store the current lead selection indices int rowLead = selectionModel.getLeadSelectionIndex(); int colLead = getColumnModel().getSelectionModel().getLeadSelectionIndex(); // the following calls to setSelectionInterval change the lead selection // indices setColumnSelectionInterval(0, getColumnCount() - 1); setRowSelectionInterval(0, getRowCount() - 1); // the following addSelectionInterval calls restore the lead selection // indices to their previous values addColumnSelectionInterval(colLead,colLead); addRowSelectionInterval(rowLead, rowLead); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JTable.java/clean/core/src/classpath/javax/javax/swing/JTable.java
tableChanged(new TableModelEvent(dataModel, TableModelEvent.HEADER_ROW));
public void setModel(TableModel m) { // Throw exception is m is null. if (m == null) throw new IllegalArgumentException(); // Don't do anything if setting the current model again. if (dataModel == m) return; TableModel oldModel = dataModel; // Remove table as TableModelListener from old model. if (dataModel != null) dataModel.removeTableModelListener(this); if (m != null) { // Set property. dataModel = m; // Add table as TableModelListener to new model. dataModel.addTableModelListener(this); // Automatically create columns. if (autoCreateColumnsFromModel) createDefaultColumnsFromModel(); } // This property is bound, so we fire a property change event. firePropertyChange("model", oldModel, dataModel); // Repaint table. revalidate(); repaint(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JTable.java/clean/core/src/classpath/javax/javax/swing/JTable.java
rowHeights = null;
public void setRowHeight(int r) { if (r < 1) throw new IllegalArgumentException(); clientRowHeightSet = true; rowHeight = r; revalidate(); repaint(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JTable.java/clean/core/src/classpath/javax/javax/swing/JTable.java
createDefaultEditors(); createDefaultRenderers();
public void setUI(TableUI ui) { super.setUI(ui); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JTable.java/clean/core/src/classpath/javax/javax/swing/JTable.java
if (!isCellEditable(row, column)) return;
public void setValueAt(Object value, int row, int column) { if (!isCellEditable(row, column)) return; dataModel.setValueAt(value, row, convertColumnIndexToModel(column)); repaint(getCellRect(row, column, true)); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JTable.java/clean/core/src/classpath/javax/javax/swing/JTable.java
if (rowHeights != null) rowHeights.removeEntries(first, last - first + 1);
public void tableChanged (TableModelEvent event) { // update the column model from the table model if the structure has // changed and the flag autoCreateColumnsFromModel is set if ((event == null || (event.getFirstRow() == TableModelEvent.HEADER_ROW)) && autoCreateColumnsFromModel) createDefaultColumnsFromModel(); // If the structure changes, we need to revalidate, since that might // affect the size parameters of the JTable. Otherwise we only need // to perform a repaint to update the view. if (event == null || event.getType() == TableModelEvent.INSERT) { // Sync selection model with data model. if (event != null) { int first = event.getFirstRow(); if (first < 0) first = 0; int last = event.getLastRow(); if (last < 0) last = getRowCount() - 1; selectionModel.insertIndexInterval(first, last - first + 1, true); } revalidate(); } if (event == null || event.getType() == TableModelEvent.DELETE) { // Sync selection model with data model. if (event != null) { int first = event.getFirstRow(); if (first < 0) first = 0; int last = event.getLastRow(); if (last < 0) last = getRowCount() - 1; selectionModel.removeIndexInterval(first, last); } if (dataModel.getRowCount() == 0) clearSelection(); revalidate(); } repaint(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JTable.java/clean/core/src/classpath/javax/javax/swing/JTable.java
if (getRowCount() < 2) return;
if (isEditing()) editingStopped(null);
public void valueChanged (ListSelectionEvent event) { // Does not make sense for the table with the single row. if (getRowCount() < 2) return; int y_gap = rowMargin; int y0 = (getRowHeight() + y_gap) * (event.getFirstIndex()); int yn = (getRowHeight() + y_gap) * (event.getLastIndex()+1); repaint(0, y0, getWidth(), yn-y0); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JTable.java/clean/core/src/classpath/javax/javax/swing/JTable.java
int y_gap = rowMargin; int y0 = (getRowHeight() + y_gap) * (event.getFirstIndex()); int yn = (getRowHeight() + y_gap) * (event.getLastIndex()+1); repaint(0, y0, getWidth(), yn-y0);
int first = Math.max(0, Math.min(getRowCount() - 1, event.getFirstIndex())); int last = Math.max(0, Math.min(getRowCount() - 1, event.getLastIndex())); Rectangle rect1 = getCellRect(first, 0, false); Rectangle rect2 = getCellRect(last, getColumnCount() - 1, false); Rectangle dirty = SwingUtilities.computeUnion(rect2.x, rect2.y, rect2.width, rect2.height, rect1); repaint(dirty);
public void valueChanged (ListSelectionEvent event) { // Does not make sense for the table with the single row. if (getRowCount() < 2) return; int y_gap = rowMargin; int y0 = (getRowHeight() + y_gap) * (event.getFirstIndex()); int yn = (getRowHeight() + y_gap) * (event.getLastIndex()+1); repaint(0, y0, getWidth(), yn-y0); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JTable.java/clean/core/src/classpath/javax/javax/swing/JTable.java
north.requestFocus();
public SwingTest(String title) { super(title); getRootPane().setDoubleBuffered(false); setLocation(100, 100); setSize(400, 400); getContentPane().add(north = new JButton("JButton north"), BorderLayout.NORTH); getContentPane().add(new JTextArea("JTextArea test"), BorderLayout.CENTER); getContentPane().add(south = new JButton("JButton south"), BorderLayout.SOUTH); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/eec21d2840b2faf24a31a4e64e995a4da3c3ff58/SwingTest.java/clean/gui/src/test/org/jnode/test/gui/SwingTest.java
System.out.println("frame.size: " + getSize()); System.out.println("frame.insets: " + getInsets()); System.out.println("frame.peer.insets: " + ((FramePeer)getPeer()).getInsets()); System.out.println("frame.cp.bounds: " + getContentPane().getBounds()); System.out.println("north.bounds " + north.getBounds()); System.out.println("south.bounds " + south.getBounds());
public void dumpInfo() { System.out.println("frame.size: " + getSize()); System.out.println("frame.insets: " + getInsets()); System.out.println("frame.peer.insets: " + ((FramePeer)getPeer()).getInsets()); System.out.println("frame.cp.bounds: " + getContentPane().getBounds()); System.out.println("north.bounds " + north.getBounds()); System.out.println("south.bounds " + south.getBounds()); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/eec21d2840b2faf24a31a4e64e995a4da3c3ff58/SwingTest.java/clean/gui/src/test/org/jnode/test/gui/SwingTest.java
public InterruptedException() { super();
public InterruptedException() {
public InterruptedException() { super(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b2ed890086e708f00d163f3e8514bfa8b353f662/InterruptedException.java/buggy/core/src/classpath/java/java/lang/InterruptedException.java
itemListener = new ItemHandler();
public BasicMenuItemUI() { mouseInputListener = createMouseInputListener(menuItem); menuDragMouseListener = createMenuDragMouseListener(menuItem); menuKeyListener = createMenuKeyListener(menuItem); propertyChangeListener = new PropertyChangeHandler(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/804045622bd8dd509311bab751f88cfa2f79345a/BasicMenuItemUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicMenuItemUI.java
menuItem.addItemListener(itemListener);
protected void installListeners() { menuItem.addMouseListener(mouseInputListener); menuItem.addMouseMotionListener(mouseInputListener); menuItem.addMenuDragMouseListener(menuDragMouseListener); menuItem.addMenuKeyListener(menuKeyListener); menuItem.addPropertyChangeListener(propertyChangeListener); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/804045622bd8dd509311bab751f88cfa2f79345a/BasicMenuItemUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicMenuItemUI.java
menuItem.removeItemListener(itemListener);
protected void uninstallListeners() { menuItem.removeMouseListener(mouseInputListener); menuItem.removeMenuDragMouseListener(menuDragMouseListener); menuItem.removeMenuKeyListener(menuKeyListener); menuItem.removePropertyChangeListener(propertyChangeListener); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/804045622bd8dd509311bab751f88cfa2f79345a/BasicMenuItemUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicMenuItemUI.java
attributes.put(RSAKeyPairGenerator.PREFERRED_ENCODING_FORMAT, new Integer(Registry.ASN1_ENCODING_ID));
public void initialize(int keysize, SecureRandom random) { HashMap attributes = new HashMap(); attributes.put(RSAKeyPairGenerator.MODULUS_LENGTH, new Integer(keysize)); if (random != null) { attributes.put(RSAKeyPairGenerator.SOURCE_OF_RANDOMNESS, random); } adaptee.setup(attributes); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/792415b1783f5e8798e64529a3048ed049193e55/RSAKeyPairGeneratorSpi.java/buggy/core/src/classpath/gnu/gnu/java/security/jce/sig/RSAKeyPairGeneratorSpi.java
public boolean hasNext() { int size = axisOrderList.size(); for (int i = 0; i < size ; i++) { AxisInterface axis = (AxisInterface) axisOrderList.get(i); int index = ((Integer) locations.get(axis)).intValue(); if (index < axis.getLength()-1) { return true; } } return false;
public boolean hasNext() { return HasNext;
public boolean hasNext() { int size = axisOrderList.size(); for (int i = 0; i < size ; i++) { AxisInterface axis = (AxisInterface) axisOrderList.get(i); int index = ((Integer) locations.get(axis)).intValue(); if (index < axis.getLength()-1) { return true; } } return false; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/898793a9cef85dbf7e6cce2b8c976e0a76683ab9/Locator.java/buggy/src/gov/nasa/gsfc/adc/xdf/Locator.java
boolean outofDataCells = true;
boolean outOfDataCells = true; HasNext = true;
public boolean next() { boolean outofDataCells = true; int size = axisOrderList.size(); for (int i = 0; i < size ; i++) { AxisInterface axis = (AxisInterface) axisOrderList.get(i); int index = ((Integer) locations.get(axis)).intValue(); if (index < axis.getLength()-1) { outofDataCells = false; index++; locations.put(axis, new Integer(index)); break; //get out of the for loop } locations.put(axis, new Integer(0)); } return !outofDataCells; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/898793a9cef85dbf7e6cce2b8c976e0a76683ab9/Locator.java/buggy/src/gov/nasa/gsfc/adc/xdf/Locator.java
outofDataCells = false;
outOfDataCells = false;
public boolean next() { boolean outofDataCells = true; int size = axisOrderList.size(); for (int i = 0; i < size ; i++) { AxisInterface axis = (AxisInterface) axisOrderList.get(i); int index = ((Integer) locations.get(axis)).intValue(); if (index < axis.getLength()-1) { outofDataCells = false; index++; locations.put(axis, new Integer(index)); break; //get out of the for loop } locations.put(axis, new Integer(0)); } return !outofDataCells; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/898793a9cef85dbf7e6cce2b8c976e0a76683ab9/Locator.java/buggy/src/gov/nasa/gsfc/adc/xdf/Locator.java
locations.put(axis, new Integer(index));
locations.put(axis, new Integer(index));
public boolean next() { boolean outofDataCells = true; int size = axisOrderList.size(); for (int i = 0; i < size ; i++) { AxisInterface axis = (AxisInterface) axisOrderList.get(i); int index = ((Integer) locations.get(axis)).intValue(); if (index < axis.getLength()-1) { outofDataCells = false; index++; locations.put(axis, new Integer(index)); break; //get out of the for loop } locations.put(axis, new Integer(0)); } return !outofDataCells; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/898793a9cef85dbf7e6cce2b8c976e0a76683ab9/Locator.java/buggy/src/gov/nasa/gsfc/adc/xdf/Locator.java
locations.put(axis, new Integer(0));
locations.put(axis, new Integer(0));
public boolean next() { boolean outofDataCells = true; int size = axisOrderList.size(); for (int i = 0; i < size ; i++) { AxisInterface axis = (AxisInterface) axisOrderList.get(i); int index = ((Integer) locations.get(axis)).intValue(); if (index < axis.getLength()-1) { outofDataCells = false; index++; locations.put(axis, new Integer(index)); break; //get out of the for loop } locations.put(axis, new Integer(0)); } return !outofDataCells; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/898793a9cef85dbf7e6cce2b8c976e0a76683ab9/Locator.java/buggy/src/gov/nasa/gsfc/adc/xdf/Locator.java
return !outofDataCells;
if (outOfDataCells) HasNext = false; return !outOfDataCells;
public boolean next() { boolean outofDataCells = true; int size = axisOrderList.size(); for (int i = 0; i < size ; i++) { AxisInterface axis = (AxisInterface) axisOrderList.get(i); int index = ((Integer) locations.get(axis)).intValue(); if (index < axis.getLength()-1) { outofDataCells = false; index++; locations.put(axis, new Integer(index)); break; //get out of the for loop } locations.put(axis, new Integer(0)); } return !outofDataCells; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/898793a9cef85dbf7e6cce2b8c976e0a76683ab9/Locator.java/buggy/src/gov/nasa/gsfc/adc/xdf/Locator.java
boolean outofDataCell = true;
boolean outOfDataCells = true; HasNext = true;
public boolean prev() { boolean outofDataCell = true; int size = axisOrderList.size(); for (int i = 0; i < size ; i++) { AxisInterface axis = (AxisInterface) axisOrderList.get(i); int index = ((Integer) locations.get(axis)).intValue(); index--; if (index < 0) { locations.put(axis, new Integer(axis.getLength()-1)); } else { locations.put(axis, new Integer(index)); outofDataCell = false; break; //get out of the for loop } } return !outofDataCell; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/898793a9cef85dbf7e6cce2b8c976e0a76683ab9/Locator.java/buggy/src/gov/nasa/gsfc/adc/xdf/Locator.java
outofDataCell = false;
outOfDataCells = false;
public boolean prev() { boolean outofDataCell = true; int size = axisOrderList.size(); for (int i = 0; i < size ; i++) { AxisInterface axis = (AxisInterface) axisOrderList.get(i); int index = ((Integer) locations.get(axis)).intValue(); index--; if (index < 0) { locations.put(axis, new Integer(axis.getLength()-1)); } else { locations.put(axis, new Integer(index)); outofDataCell = false; break; //get out of the for loop } } return !outofDataCell; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/898793a9cef85dbf7e6cce2b8c976e0a76683ab9/Locator.java/buggy/src/gov/nasa/gsfc/adc/xdf/Locator.java
return !outofDataCell;
if (outOfDataCells) HasNext = false; return !outOfDataCells;
public boolean prev() { boolean outofDataCell = true; int size = axisOrderList.size(); for (int i = 0; i < size ; i++) { AxisInterface axis = (AxisInterface) axisOrderList.get(i); int index = ((Integer) locations.get(axis)).intValue(); index--; if (index < 0) { locations.put(axis, new Integer(axis.getLength()-1)); } else { locations.put(axis, new Integer(index)); outofDataCell = false; break; //get out of the for loop } } return !outofDataCell; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/898793a9cef85dbf7e6cce2b8c976e0a76683ab9/Locator.java/buggy/src/gov/nasa/gsfc/adc/xdf/Locator.java
getView(i).setParent(this);
getView(i).setParent(null);
public void setParent(View parent) { if (parent == null) { int numChildren = getViewCount(); for (int i = 0; i < numChildren; i++) getView(i).setParent(this); } this.parent = parent; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/View.java/buggy/core/src/classpath/javax/javax/swing/text/View.java
header = null; tagTable = null;
protected void finalize() { // XXX What resources should we free? }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/511ee4599fec6e0fd95b9d64823beef0c7439ee1/ICC_Profile.java/buggy/core/src/classpath/java/java/awt/color/ICC_Profile.java
throw new Error("not implemented");
int size = getSize(); byte[] data = new byte[size]; System.arraycopy(header.getData(size), 0, data, 0, ProfileHeader.HEADERSIZE); byte[] tt = getTagTable(); System.arraycopy(tt, 0, data, ProfileHeader.HEADERSIZE, tt.length); Enumeration e = tagTable.elements(); while (e.hasMoreElements()) { TagEntry tag = (TagEntry) e.nextElement(); System.arraycopy(tag.getData(), 0, data, tag.getOffset(), tag.getSize()); } return data;
public byte[] getData() { throw new Error("not implemented"); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/511ee4599fec6e0fd95b9d64823beef0c7439ee1/ICC_Profile.java/buggy/core/src/classpath/java/java/awt/color/ICC_Profile.java
throw new Error("not implemented");
ProfileHeader header = new ProfileHeader(data); header.verifyHeader(data.length); Hashtable tags = createTagTable(data); if (isRGBProfile(header, tags)) return new ICC_ProfileRGB(data); if (isGrayProfile(header, tags)) return new ICC_ProfileGray(data); return new ICC_Profile(header, tags);
public static ICC_Profile getInstance(byte[] data) { throw new Error("not implemented"); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/511ee4599fec6e0fd95b9d64823beef0c7439ee1/ICC_Profile.java/buggy/core/src/classpath/java/java/awt/color/ICC_Profile.java
throw new Error("not implemented");
return header.getMajorVersion();
public int getMajorVersion() { throw new Error("not implemented"); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/511ee4599fec6e0fd95b9d64823beef0c7439ee1/ICC_Profile.java/buggy/core/src/classpath/java/java/awt/color/ICC_Profile.java
throw new Error("not implemented");
return header.getMinorVersion();
public int getMinorVersion() { throw new Error("not implemented"); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/511ee4599fec6e0fd95b9d64823beef0c7439ee1/ICC_Profile.java/buggy/core/src/classpath/java/java/awt/color/ICC_Profile.java
throw new Error("not implemented");
return header.getProfileColorSpace();
public int getPCSType() { throw new Error("not implemented"); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/511ee4599fec6e0fd95b9d64823beef0c7439ee1/ICC_Profile.java/buggy/core/src/classpath/java/java/awt/color/ICC_Profile.java
throw new Error("not implemented");
return header.getProfileClass();
public int getProfileClass() { throw new Error("not implemented"); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/511ee4599fec6e0fd95b9d64823beef0c7439ee1/ICC_Profile.java/buggy/core/src/classpath/java/java/awt/color/ICC_Profile.java
throws IOException, ClassNotFoundException
throws IOException, ClassNotFoundException
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { throw new Error("not implemented"); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/511ee4599fec6e0fd95b9d64823beef0c7439ee1/ICC_Profile.java/buggy/core/src/classpath/java/java/awt/color/ICC_Profile.java
throw new Error("not implemented");
s.defaultReadObject(); String predef = (String) s.readObject(); byte[] data = (byte[]) s.readObject(); if (data != null) { header = new ProfileHeader(data); tagTable = createTagTable(data); profileID = -1; } if (predef != null) { predef = predef.intern(); if (predef.equals("CS_sRGB")) createProfile(ColorSpace.CS_sRGB); if (predef.equals("CS_LINEAR_RGB")) createProfile(ColorSpace.CS_LINEAR_RGB); if (predef.equals("CS_CIEXYZ")) createProfile(ColorSpace.CS_CIEXYZ); if (predef.equals("CS_GRAY")) createProfile(ColorSpace.CS_GRAY); if (predef.equals("CS_PYCC")) createProfile(ColorSpace.CS_PYCC); }
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { throw new Error("not implemented"); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/511ee4599fec6e0fd95b9d64823beef0c7439ee1/ICC_Profile.java/buggy/core/src/classpath/java/java/awt/color/ICC_Profile.java
throw new Error("not implemented");
if (isRGBProfile(header, tagTable)) return new ICC_ProfileRGB(getData()); if (isGrayProfile(header, tagTable)) return new ICC_ProfileGray(getData()); return this;
protected Object readResolve() throws ObjectStreamException { throw new Error("not implemented"); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/511ee4599fec6e0fd95b9d64823beef0c7439ee1/ICC_Profile.java/buggy/core/src/classpath/java/java/awt/color/ICC_Profile.java
throw new Error("not implemented");
profileID = -1; if (tagSignature == icSigHead) header = new ProfileHeader(data); else { TagEntry t = new TagEntry(tagSignature, data); tagTable.put(t.hashKey(), t); }
public void setData(int tagSignature, byte[] data) { throw new Error("not implemented"); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/511ee4599fec6e0fd95b9d64823beef0c7439ee1/ICC_Profile.java/buggy/core/src/classpath/java/java/awt/color/ICC_Profile.java
write(new FileOutputStream(filename));
FileOutputStream out = new FileOutputStream(filename); write(out); out.flush(); out.close();
public void write(String filename) throws IOException { write(new FileOutputStream(filename)); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/511ee4599fec6e0fd95b9d64823beef0c7439ee1/ICC_Profile.java/buggy/core/src/classpath/java/java/awt/color/ICC_Profile.java
throw new Error("not implemented");
s.defaultWriteObject(); if (profileID == ColorSpace.CS_sRGB) s.writeObject("CS_sRGB"); else if (profileID == ColorSpace.CS_LINEAR_RGB) s.writeObject("CS_LINEAR_RGB"); else if (profileID == ColorSpace.CS_CIEXYZ) s.writeObject("CS_CIEXYZ"); else if (profileID == ColorSpace.CS_GRAY) s.writeObject("CS_GRAY"); else if (profileID == ColorSpace.CS_PYCC) s.writeObject("CS_PYCC"); else { s.writeObject(null); s.writeObject(getData()); return; } s.writeObject(null);
private void writeObject(ObjectOutputStream s) throws IOException { throw new Error("not implemented"); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/511ee4599fec6e0fd95b9d64823beef0c7439ee1/ICC_Profile.java/buggy/core/src/classpath/java/java/awt/color/ICC_Profile.java
System.arraycopy(c_as_bytes, 0, buf, pos, c_as_bytes.length);
final int c_length = c_as_bytes.length; System.arraycopy(c_as_bytes, 0, buf, pos, c_length); pos += c_length;
public static String unquote(String str) throws MalformedURLException { if (str == null) return null; final int MAX_BYTES_PER_UTF_8_CHAR = 3; byte[] buf = new byte[str.length()*MAX_BYTES_PER_UTF_8_CHAR]; int pos = 0; for (int i = 0; i < str.length(); i++) { char c = str.charAt(i); if (c == '%') { if (i + 2 >= str.length()) throw new MalformedURLException(str + " : Invalid quoted character"); int hi = Character.digit(str.charAt(++i), 16); int lo = Character.digit(str.charAt(++i), 16); if (lo < 0 || hi < 0) throw new MalformedURLException(str + " : Invalid quoted character"); buf[pos++] = (byte) (hi * 16 + lo); } else if (c > 127) { try { byte [] c_as_bytes = Character.toString(c).getBytes("utf-8"); System.arraycopy(c_as_bytes, 0, buf, pos, c_as_bytes.length); } catch (java.io.UnsupportedEncodingException x2) { throw (Error) new InternalError().initCause(x2); } } else buf[pos++] = (byte) c; } try { return new String(buf, 0, pos, "utf-8"); } catch (java.io.UnsupportedEncodingException x2) { throw (Error) new InternalError().initCause(x2); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/eea27f084742358ddb097f7118c05cd257029453/Connection.java/buggy/core/src/classpath/gnu/gnu/java/net/protocol/file/Connection.java
internalFrameVetoableChangeListener = new InternalFramePropertyChangeListener();
protected void installListeners() { glassPaneDispatcher = createGlassPaneDispatcher(); createInternalFrameListener(); borderListener = createBorderListener(frame); componentListener = createComponentListener(); propertyChangeListener = createPropertyChangeListener(); internalFrameVetoableChangeListener = new InternalFramePropertyChangeListener(); frame.addMouseListener(borderListener); frame.addMouseMotionListener(borderListener); frame.addInternalFrameListener(internalFrameListener); frame.addPropertyChangeListener(propertyChangeListener); frame.addVetoableChangeListener(internalFrameVetoableChangeListener); frame.getRootPane().getGlassPane().addMouseListener(glassPaneDispatcher); frame.getRootPane().getGlassPane().addMouseMotionListener(glassPaneDispatcher); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/49ad2f4c3e74f0a8e99b839c938a312898850fa0/BasicInternalFrameUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicInternalFrameUI.java
frame.addVetoableChangeListener(internalFrameVetoableChangeListener);
protected void installListeners() { glassPaneDispatcher = createGlassPaneDispatcher(); createInternalFrameListener(); borderListener = createBorderListener(frame); componentListener = createComponentListener(); propertyChangeListener = createPropertyChangeListener(); internalFrameVetoableChangeListener = new InternalFramePropertyChangeListener(); frame.addMouseListener(borderListener); frame.addMouseMotionListener(borderListener); frame.addInternalFrameListener(internalFrameListener); frame.addPropertyChangeListener(propertyChangeListener); frame.addVetoableChangeListener(internalFrameVetoableChangeListener); frame.getRootPane().getGlassPane().addMouseListener(glassPaneDispatcher); frame.getRootPane().getGlassPane().addMouseMotionListener(glassPaneDispatcher); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/49ad2f4c3e74f0a8e99b839c938a312898850fa0/BasicInternalFrameUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicInternalFrameUI.java
tags[i] = "d" + i;
tags[i] = "d" + i;
public String[] getAxisTags () { // List axisList = getIOAxesOrder(); // List axisList = getParentArray().getAxes(); int size = getParentArray().getAxes().size(); String[] tags = new String[size]; // String tag; for (int i = 0; i < size; i++) { // String axisId = ((AxisInterface) axisList.get(i)).getAxisId(); // tags[i] = (String) tagHash.get(axisId); tags[i] = "d" + i; }/* String axisId; String tempTag; int counter = stop; for (int i = 0; i < stop; i++) { counter--; tag = "d" + counter; //the default tag //should it exist, we use whats in the tag hash //otherwise we go with the default above axisId = ((AxisInterface) axisList.get(i)).getAxisId(); tempTag = (String) tagHash.get(axisId); if (tempTag!=null) tag = tempTag; tags[i] = tag; }*/ return tags; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/9a96821c74fdf7a098ba2f2431636b7965e3c4d0/TaggedXMLDataIOStyle.java/buggy/src/gov/nasa/gsfc/adc/xdf/TaggedXMLDataIOStyle.java
protected void specificIOStyleToXDF( Writer outputWriter, String indent) throws java.io.IOException { boolean niceOutput = Specification.getInstance().isPrettyXDFOutput(); //write out the tags info String[] tags = getAxisTags();/* List axisList = parentArray.getAxes(); List axisList = getIOAxesOrder(); // actually, for tagged data order isnt important // in the least, its tagToAxis that is important. int numberOfAxes = axisList.size(); */ for (int i = 0, size = tags.length; i < size; i++) { String tag = tags[i]; String axisId = (String) axisIdHash.get(tag); // ((AxisInterface) axisList.get(i)).getAxisId(); if (niceOutput) { outputWriter.write( Constants.NEW_LINE); outputWriter.write( indent); } outputWriter.write( "<" + TagToAxisNodeName + " axisIdRef=\""); writeOutAttribute(outputWriter, axisId); outputWriter.write( "\""); outputWriter.write( " tag=\""); writeOutAttribute(outputWriter, tag); outputWriter.write( "\"/>"); } // wrap up newline if (niceOutput) { outputWriter.write( Constants.NEW_LINE); } }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/9a96821c74fdf7a098ba2f2431636b7965e3c4d0/TaggedXMLDataIOStyle.java/buggy/src/gov/nasa/gsfc/adc/xdf/TaggedXMLDataIOStyle.java
throw new BAD_OPERATION();
BAD_OPERATION bad = new BAD_OPERATION(); bad.initCause(ex); bad.minor = Minor.Any; throw bad;
public static ServiceDetail extract(Any a) { try { return ((ServiceDetailHolder) a.extract_Streamable()).value; } catch (ClassCastException ex) { throw new BAD_OPERATION(); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/44e3ea509d80974dab547c4d1cf8c070d32bac86/ServiceDetailHelper.java/buggy/core/src/classpath/org/org/omg/CORBA/ServiceDetailHelper.java
ArrayList childList = childStruct.findAllChildHrefObjects(); if (childList.size() > 0) list.add(childList); }
if (childStruct != null) { ArrayList childList = childStruct.findAllChildHrefObjects(); if (childList != null && childList.size() > 0) { Iterator childIter = childList.iterator(); while (childIter.hasNext()) list.add(childIter.next()); } } }
protected ArrayList findAllChildHrefObjects () { ArrayList list = new ArrayList(); if (this instanceof Structure) { List arrayList = ((Structure) this).getArrayList(); synchronized (arrayList) { Iterator iter = arrayList.iterator(); // Must be in synchronized block while (iter.hasNext()) { Array childArray = (Array) iter.next(); Href hrefObj = childArray.getDataCube().getHref(); if (hrefObj != null) list.add(hrefObj); } } // sychronized arrayList List structList = ((Structure) this).getStructList(); synchronized (structList) { Iterator iter = structList.iterator(); // Must be in synchronized block while (iter.hasNext()) { Structure childStruct = (Structure) iter.next(); ArrayList childList = childStruct.findAllChildHrefObjects(); if (childList.size() > 0) list.add(childList); } } // sychronized structList } return list; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/e295a391c68e699d0ccbbd259471aadd645b36ac/BaseObject.java/buggy/src/gov/nasa/gsfc/adc/xdf/BaseObject.java
protected ArrayList findAllChildHrefObjects () { ArrayList list = new ArrayList(); if (this instanceof Structure) { List arrayList = ((Structure) this).getArrayList(); synchronized (arrayList) { Iterator iter = arrayList.iterator(); // Must be in synchronized block while (iter.hasNext()) { Array childArray = (Array) iter.next(); Href hrefObj = childArray.getDataCube().getHref(); if (hrefObj != null) list.add(hrefObj); } } // sychronized arrayList List structList = ((Structure) this).getStructList(); synchronized (structList) { Iterator iter = structList.iterator(); // Must be in synchronized block while (iter.hasNext()) { Structure childStruct = (Structure) iter.next(); ArrayList childList = childStruct.findAllChildHrefObjects(); if (childList.size() > 0) list.add(childList); } } // sychronized structList } return list; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/e295a391c68e699d0ccbbd259471aadd645b36ac/BaseObject.java/buggy/src/gov/nasa/gsfc/adc/xdf/BaseObject.java
protected ArrayList findAllChildHrefObjects () { ArrayList list = new ArrayList(); if (this instanceof Structure) { List arrayList = ((Structure) this).getArrayList(); synchronized (arrayList) { Iterator iter = arrayList.iterator(); // Must be in synchronized block while (iter.hasNext()) { Array childArray = (Array) iter.next(); Href hrefObj = childArray.getDataCube().getHref(); if (hrefObj != null) list.add(hrefObj); } } // sychronized arrayList List structList = ((Structure) this).getStructList(); synchronized (structList) { Iterator iter = structList.iterator(); // Must be in synchronized block while (iter.hasNext()) { Structure childStruct = (Structure) iter.next(); ArrayList childList = childStruct.findAllChildHrefObjects(); if (childList.size() > 0) list.add(childList); } } // sychronized structList } return list; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/e295a391c68e699d0ccbbd259471aadd645b36ac/BaseObject.java/buggy/src/gov/nasa/gsfc/adc/xdf/BaseObject.java
public abstract void getInts(int memPtr, char[] dst, int dstOfs, int length);
public abstract void getInts(int memPtr, int[] dst, int dstOfs, int length);
public abstract void getInts(int memPtr, char[] dst, int dstOfs, int length);
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/cf8ce2c5ba5a917561914a10973076ffaf84b47b/MemoryResource.java/buggy/core/src/core/org/jnode/system/MemoryResource.java
serverHostName = new String(tmp, "US-ASCII").trim();
try { serverHostName = new String(tmp, "US-ASCII").trim(); } catch(UnsupportedEncodingException ex) { throw new RuntimeException(ex); }
public BOOTPHeader(SocketBuffer skbuf) { this.opcode = skbuf.get(0); this.hwType = skbuf.get(1); this.hopCount = skbuf.get(3); this.transactionID = skbuf.get32(4); this.secondsElapsed = skbuf.get16(8); this.flags = skbuf.get16(10); this.clientIPAddress = IPv4Address.readFrom(skbuf, 12); this.yourIPAddress = IPv4Address.readFrom(skbuf, 16); this.serverIPAddress = IPv4Address.readFrom(skbuf, 20); this.gatewayIPAddress = IPv4Address.readFrom(skbuf, 24); if (hwType == 1) { clientHwAddress = new EthernetAddress(skbuf, 28); } else { clientHwAddress = null; } byte[] tmp = new byte[128]; skbuf.get(tmp, 0, 32, 64); serverHostName = new String(tmp, "US-ASCII").trim(); skbuf.get(tmp, 0, 96, 128); bootFileName = new String(tmp, "US-ASCII").trim(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1cf6508663161392ac4c2532ad2b53975eac8390/BOOTPHeader.java/clean/net/src/net/org/jnode/net/ipv4/bootp/BOOTPHeader.java
bootFileName = new String(tmp, "US-ASCII").trim();
try { bootFileName = new String(tmp, "US-ASCII").trim(); } catch(UnsupportedEncodingException ex) { throw new RuntimeException(ex); }
public BOOTPHeader(SocketBuffer skbuf) { this.opcode = skbuf.get(0); this.hwType = skbuf.get(1); this.hopCount = skbuf.get(3); this.transactionID = skbuf.get32(4); this.secondsElapsed = skbuf.get16(8); this.flags = skbuf.get16(10); this.clientIPAddress = IPv4Address.readFrom(skbuf, 12); this.yourIPAddress = IPv4Address.readFrom(skbuf, 16); this.serverIPAddress = IPv4Address.readFrom(skbuf, 20); this.gatewayIPAddress = IPv4Address.readFrom(skbuf, 24); if (hwType == 1) { clientHwAddress = new EthernetAddress(skbuf, 28); } else { clientHwAddress = null; } byte[] tmp = new byte[128]; skbuf.get(tmp, 0, 32, 64); serverHostName = new String(tmp, "US-ASCII").trim(); skbuf.get(tmp, 0, 96, 128); bootFileName = new String(tmp, "US-ASCII").trim(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1cf6508663161392ac4c2532ad2b53975eac8390/BOOTPHeader.java/clean/net/src/net/org/jnode/net/ipv4/bootp/BOOTPHeader.java
skbuf.set(32, serverHostName.getBytes("US-ASCII"), 0, serverHostName.length());
try { skbuf.set(32, serverHostName.getBytes("US-ASCII"), 0, serverHostName.length()); } catch(UnsupportedEncodingException ex) { throw new RuntimeException(ex); }
public void prefixTo(SocketBuffer skbuf) { skbuf.insert(SIZE); skbuf.set(0, opcode); skbuf.set(1, hwType); skbuf.set(2, clientHwAddress.getLength()); skbuf.set(3, hopCount); skbuf.set32(4, transactionID); skbuf.set16(8, secondsElapsed); skbuf.set16(10, flags); if (clientIPAddress != null) { IPv4Address.writeTo(skbuf, 12, clientIPAddress); } if (yourIPAddress != null) { IPv4Address.writeTo(skbuf, 16, yourIPAddress); } if (serverIPAddress != null) { IPv4Address.writeTo(skbuf, 20, serverIPAddress); } if (gatewayIPAddress != null) { IPv4Address.writeTo(skbuf, 24, gatewayIPAddress); } if (clientHwAddress != null) { clientHwAddress.writeTo(skbuf, 28); } if (serverHostName != null) { skbuf.set(32, serverHostName.getBytes("US-ASCII"), 0, serverHostName.length()); } if (bootFileName != null) { skbuf.set(96, bootFileName.getBytes("US-ASCII"), 0, bootFileName.length()); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1cf6508663161392ac4c2532ad2b53975eac8390/BOOTPHeader.java/clean/net/src/net/org/jnode/net/ipv4/bootp/BOOTPHeader.java
skbuf.set(96, bootFileName.getBytes("US-ASCII"), 0, bootFileName.length());
try { skbuf.set(96, bootFileName.getBytes("US-ASCII"), 0, bootFileName.length()); } catch(UnsupportedEncodingException ex) { throw new RuntimeException(ex); }
public void prefixTo(SocketBuffer skbuf) { skbuf.insert(SIZE); skbuf.set(0, opcode); skbuf.set(1, hwType); skbuf.set(2, clientHwAddress.getLength()); skbuf.set(3, hopCount); skbuf.set32(4, transactionID); skbuf.set16(8, secondsElapsed); skbuf.set16(10, flags); if (clientIPAddress != null) { IPv4Address.writeTo(skbuf, 12, clientIPAddress); } if (yourIPAddress != null) { IPv4Address.writeTo(skbuf, 16, yourIPAddress); } if (serverIPAddress != null) { IPv4Address.writeTo(skbuf, 20, serverIPAddress); } if (gatewayIPAddress != null) { IPv4Address.writeTo(skbuf, 24, gatewayIPAddress); } if (clientHwAddress != null) { clientHwAddress.writeTo(skbuf, 28); } if (serverHostName != null) { skbuf.set(32, serverHostName.getBytes("US-ASCII"), 0, serverHostName.length()); } if (bootFileName != null) { skbuf.set(96, bootFileName.getBytes("US-ASCII"), 0, bootFileName.length()); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1cf6508663161392ac4c2532ad2b53975eac8390/BOOTPHeader.java/clean/net/src/net/org/jnode/net/ipv4/bootp/BOOTPHeader.java
this.setUndecorated(true); this.getRootPane().setWindowDecorationStyle(JRootPane.PLAIN_DIALOG);
public HeavyWeightPopup(Container c) { this.setContentPane(c); }
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 abstract XMLEventWriter createXMLEventWriter(Result result)
public abstract XMLEventWriter createXMLEventWriter(OutputStream stream)
public abstract XMLEventWriter createXMLEventWriter(Result result) throws XMLStreamException;
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/045a5b41cdfa747889101d3993040acf89788bc4/XMLOutputFactory.java/buggy/core/src/classpath/javax/javax/xml/stream/XMLOutputFactory.java
public static XMLInputFactory newInstance(String factoryId, ClassLoader classLoader)
public static XMLInputFactory newInstance()
public static XMLInputFactory newInstance(String factoryId, ClassLoader classLoader) throws FactoryConfigurationError { ClassLoader loader = classLoader; if (loader == null) { loader = Thread.currentThread().getContextClassLoader(); } if (loader == null) { loader = XMLInputFactory.class.getClassLoader(); } String className = null; int count = 0; do { className = getFactoryClassName(loader, count++); if (className != null) { try { Class t = (loader != null) ? loader.loadClass(className) : Class.forName(className); return (XMLInputFactory) t.newInstance(); } catch (ClassNotFoundException e) { className = null; } catch (Exception e) { throw new FactoryConfigurationError(e, "error instantiating class " + className); } } } while (className == null && count < 3); //return new gnu.xml.stream.XMLInputFactoryImpl(); throw new FactoryConfigurationError(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/045a5b41cdfa747889101d3993040acf89788bc4/XMLInputFactory.java/buggy/core/src/classpath/javax/javax/xml/stream/XMLInputFactory.java
ClassLoader loader = classLoader; if (loader == null) { loader = Thread.currentThread().getContextClassLoader(); } if (loader == null) { loader = XMLInputFactory.class.getClassLoader(); } String className = null; int count = 0; do { className = getFactoryClassName(loader, count++); if (className != null) { try { Class t = (loader != null) ? loader.loadClass(className) : Class.forName(className); return (XMLInputFactory) t.newInstance(); } catch (ClassNotFoundException e) { className = null; } catch (Exception e) { throw new FactoryConfigurationError(e, "error instantiating class " + className); } } } while (className == null && count < 3); throw new FactoryConfigurationError();
return newInstance(null, null);
public static XMLInputFactory newInstance(String factoryId, ClassLoader classLoader) throws FactoryConfigurationError { ClassLoader loader = classLoader; if (loader == null) { loader = Thread.currentThread().getContextClassLoader(); } if (loader == null) { loader = XMLInputFactory.class.getClassLoader(); } String className = null; int count = 0; do { className = getFactoryClassName(loader, count++); if (className != null) { try { Class t = (loader != null) ? loader.loadClass(className) : Class.forName(className); return (XMLInputFactory) t.newInstance(); } catch (ClassNotFoundException e) { className = null; } catch (Exception e) { throw new FactoryConfigurationError(e, "error instantiating class " + className); } } } while (className == null && count < 3); //return new gnu.xml.stream.XMLInputFactoryImpl(); throw new FactoryConfigurationError(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/045a5b41cdfa747889101d3993040acf89788bc4/XMLInputFactory.java/buggy/core/src/classpath/javax/javax/xml/stream/XMLInputFactory.java
enableEvents(AWTEvent.MOUSE_EVENT_MASK);
enableEvents(AWTEvent.MOUSE_MOTION_EVENT_MASK);
public synchronized void addMouseMotionListener(MouseMotionListener listener) { mouseMotionListener = AWTEventMulticaster.add(mouseMotionListener, listener); if (mouseMotionListener != null) enableEvents(AWTEvent.MOUSE_EVENT_MASK); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c0997df57feec0722568b1f1cc390b475c418086/Component.java/buggy/core/src/classpath/java/java/awt/Component.java
if (e.id != PaintEvent.PAINT && e.id != PaintEvent.UPDATE)
if (e.id != PaintEvent.PAINT && e.id != PaintEvent.UPDATE && !ignoreFocus)
void dispatchEventImpl(AWTEvent e) { Event oldEvent = translateEvent (e); if (oldEvent != null) postEvent (oldEvent); if (eventTypeEnabled (e.id)) { // the trick we use to communicate between dispatch and redispatch // is to have KeyboardFocusManager.redispatch synchronize on the // object itself. we then do not redispatch to KeyboardFocusManager // if we are already holding the lock. if (! Thread.holdsLock(e)) { switch (e.id) { case WindowEvent.WINDOW_GAINED_FOCUS: case WindowEvent.WINDOW_LOST_FOCUS: case KeyEvent.KEY_PRESSED: case KeyEvent.KEY_RELEASED: case KeyEvent.KEY_TYPED: case FocusEvent.FOCUS_GAINED: case FocusEvent.FOCUS_LOST: if (KeyboardFocusManager .getCurrentKeyboardFocusManager() .dispatchEvent(e)) return; case MouseEvent.MOUSE_PRESSED: if (isLightweight()) requestFocus(); break; } } if (e.id != PaintEvent.PAINT && e.id != PaintEvent.UPDATE) processEvent(e); } if (peer != null) peer.handleEvent(e); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c0997df57feec0722568b1f1cc390b475c418086/Component.java/buggy/core/src/classpath/java/java/awt/Component.java
return (mouseListener != null || mouseMotionListener != null || (eventMask & AWTEvent.MOUSE_EVENT_MASK) != 0);
return (mouseMotionListener != null || (eventMask & AWTEvent.MOUSE_MOTION_EVENT_MASK) != 0);
boolean eventTypeEnabled (int type) { if (type > AWTEvent.RESERVED_ID_MAX) return true; switch (type) { case ComponentEvent.COMPONENT_HIDDEN: case ComponentEvent.COMPONENT_MOVED: case ComponentEvent.COMPONENT_RESIZED: case ComponentEvent.COMPONENT_SHOWN: return (componentListener != null || (eventMask & AWTEvent.COMPONENT_EVENT_MASK) != 0); case KeyEvent.KEY_PRESSED: case KeyEvent.KEY_RELEASED: case KeyEvent.KEY_TYPED: return (keyListener != null || (eventMask & AWTEvent.KEY_EVENT_MASK) != 0); case MouseEvent.MOUSE_CLICKED: case MouseEvent.MOUSE_ENTERED: case MouseEvent.MOUSE_EXITED: case MouseEvent.MOUSE_PRESSED: case MouseEvent.MOUSE_RELEASED: case MouseEvent.MOUSE_MOVED: case MouseEvent.MOUSE_DRAGGED: return (mouseListener != null || mouseMotionListener != null || (eventMask & AWTEvent.MOUSE_EVENT_MASK) != 0); case FocusEvent.FOCUS_GAINED: case FocusEvent.FOCUS_LOST: return (focusListener != null || (eventMask & AWTEvent.FOCUS_EVENT_MASK) != 0); case InputMethodEvent.INPUT_METHOD_TEXT_CHANGED: case InputMethodEvent.CARET_POSITION_CHANGED: return (inputMethodListener != null || (eventMask & AWTEvent.INPUT_METHOD_EVENT_MASK) != 0); case PaintEvent.PAINT: case PaintEvent.UPDATE: return (eventMask & AWTEvent.PAINT_EVENT_MASK) != 0; default: return false; } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c0997df57feec0722568b1f1cc390b475c418086/Component.java/buggy/core/src/classpath/java/java/awt/Component.java
if (peer != null) return peer.getGraphics().getFont();
public Font getFont() { Font f = font; if (f != null) return f; Component p = parent; if (p != null) return p.getFont(); return null; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c0997df57feec0722568b1f1cc390b475c418086/Component.java/buggy/core/src/classpath/java/java/awt/Component.java
if (parent != null && parent.valid)
if (parent != null && parent.isValid())
public void invalidate() { valid = false; prefSize = null; minSize = null; if (parent != null && parent.valid) parent.invalidate(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c0997df57feec0722568b1f1cc390b475c418086/Component.java/buggy/core/src/classpath/java/java/awt/Component.java
if(!isShowing()) { Component p = parent; if (p != null) p.repaint(0, getX(), getY(), width, height); } else
if (isShowing())
public void repaint() { if(!isShowing()) { Component p = parent; if (p != null) p.repaint(0, getX(), getY(), width, height); } else repaint(0, 0, 0, width, height); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c0997df57feec0722568b1f1cc390b475c418086/Component.java/buggy/core/src/classpath/java/java/awt/Component.java
if (isLightweight() && isShowing ())
if (isLightweight() && isShowing())
public void reshape(int x, int y, int width, int height) { int oldx = this.x; int oldy = this.y; int oldwidth = this.width; int oldheight = this.height; if (this.x == x && this.y == y && this.width == width && this.height == height) return; invalidate (); this.x = x; this.y = y; this.width = width; this.height = height; if (peer != null) peer.setBounds (x, y, width, height); // Erase old bounds and repaint new bounds for lightweights. if (isLightweight() && isShowing ()) { if (parent != null) { Rectangle parentBounds = parent.getBounds(); Rectangle oldBounds = new Rectangle(oldx, oldy, oldwidth, oldheight); Rectangle newBounds = new Rectangle(x, y, width, height); Rectangle destroyed = oldBounds.union(newBounds); if (!destroyed.isEmpty()) parent.repaint(0, destroyed.x, destroyed.y, destroyed.width, destroyed.height); } } // Only post event if this component is visible and has changed size. if (isShowing () && (oldx != x || oldy != y)) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_MOVED); getToolkit().getSystemEventQueue().postEvent(ce); } if (isShowing () && (oldwidth != width || oldheight != height)) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_RESIZED); getToolkit().getSystemEventQueue().postEvent(ce); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c0997df57feec0722568b1f1cc390b475c418086/Component.java/buggy/core/src/classpath/java/java/awt/Component.java
Rectangle parentBounds = parent.getBounds();
public void reshape(int x, int y, int width, int height) { int oldx = this.x; int oldy = this.y; int oldwidth = this.width; int oldheight = this.height; if (this.x == x && this.y == y && this.width == width && this.height == height) return; invalidate (); this.x = x; this.y = y; this.width = width; this.height = height; if (peer != null) peer.setBounds (x, y, width, height); // Erase old bounds and repaint new bounds for lightweights. if (isLightweight() && isShowing ()) { if (parent != null) { Rectangle parentBounds = parent.getBounds(); Rectangle oldBounds = new Rectangle(oldx, oldy, oldwidth, oldheight); Rectangle newBounds = new Rectangle(x, y, width, height); Rectangle destroyed = oldBounds.union(newBounds); if (!destroyed.isEmpty()) parent.repaint(0, destroyed.x, destroyed.y, destroyed.width, destroyed.height); } } // Only post event if this component is visible and has changed size. if (isShowing () && (oldx != x || oldy != y)) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_MOVED); getToolkit().getSystemEventQueue().postEvent(ce); } if (isShowing () && (oldwidth != width || oldheight != height)) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_RESIZED); getToolkit().getSystemEventQueue().postEvent(ce); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c0997df57feec0722568b1f1cc390b475c418086/Component.java/buggy/core/src/classpath/java/java/awt/Component.java
if (c == null && parent != null) c = parent.getBackground(); if (peer != null && c != null) peer.setBackground(c);
public void setBackground(Color c) { // return if the background is already set to that color. if ((c != null) && c.equals(background)) return; // If c is null, inherit from closest ancestor whose bg is set. if (c == null && parent != null) c = parent.getBackground(); if (peer != null && c != null) peer.setBackground(c); Color previous = background; background = c; firePropertyChange("background", previous, c); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c0997df57feec0722568b1f1cc390b475c418086/Component.java/buggy/core/src/classpath/java/java/awt/Component.java
if (peer != null && c != null) peer.setBackground(c);
public void setBackground(Color c) { // return if the background is already set to that color. if ((c != null) && c.equals(background)) return; // If c is null, inherit from closest ancestor whose bg is set. if (c == null && parent != null) c = parent.getBackground(); if (peer != null && c != null) peer.setBackground(c); Color previous = background; background = c; firePropertyChange("background", previous, c); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c0997df57feec0722568b1f1cc390b475c418086/Component.java/buggy/core/src/classpath/java/java/awt/Component.java
ValueListInterface valueListObj = (ValueListInterface) iter.next();
ValueList valueListObj = (ValueList) iter.next();
protected String basicXMLWriter ( Writer outputWriter, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) throws java.io.IOException { // while writing out, attribHash should not be changed synchronized (attribHash) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (Specification.getInstance().isPrettyXDFOutput()) outputWriter.write(indent); // indent node if desired outputWriter.write("<" + nodeNameString); // print opening statement } // gather info about Attributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { int size = attribs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) attribs.get(i); outputWriter.write( " " + item.get("name") + "=\""); // this slows things down, should we use? writeOutAttribute(outputWriter, (String) item.get("value")); // outputWriter.write( (String) item.get("value")); outputWriter.write( "\"" ); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); List childXMLElements = getElementNodeList(); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || childXMLElements.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { outputWriter.write( ">"); if ((Specification.getInstance().isPrettyXDFOutput()) && (pcdata == null)) outputWriter.write( Constants.NEW_LINE); } // by definition these are printed first int size = childXMLElements.size(); String childindent = indent + Specification.getInstance().getPrettyXDFOutputIndentation(); for (int i = 0; i < size; i++) { ((ElementNode) childXMLElements.get(i)).toXMLWriter(outputWriter, childindent); } // deal with object/list XML attributes, if any in our list size = childObjs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { if (hasValueListCompactDescription && valueListXMLItemName.equals(item.get("name"))) { Iterator iter = valueListObjects.iterator(); while(iter.hasNext()) { ValueListInterface valueListObj = (ValueListInterface) iter.next(); // first determine if groups should open or close // using the first value in the values list. List values = valueListObj.getValues(); Value valueObj = (Value) values.get(0); // *sigh* Yes, we have to check that all values belong to // the same groups, or problems will arise in the output. Do that here. boolean canUseCompactValueDescription = true; Set firstValueGroups = valueObj.openGroupNodeHash; Iterator valueIter = values.iterator(); valueIter.next(); // no need to do first group while (valueIter.hasNext()) { Value thisValue = (Value) valueIter.next(); if (thisValue != null) { Set thisValuesGroups = thisValue.openGroupNodeHash; if (!firstValueGroups.equals(thisValuesGroups)) { // Note this comparison also does size too Log.infoln("Cant use short description for values because some values have differing groups! Using long description instead."); canUseCompactValueDescription = false; break; } } } if (canUseCompactValueDescription) { // use compact description indent = dealWithClosingGroupNodes((BaseObject) valueObj, outputWriter, indent); indent = dealWithOpeningGroupNodes((BaseObject) valueObj, outputWriter, indent); String newindent = indent + Specification.getInstance().getPrettyXDFOutputIndentation(); // now print the valuelist itself valueListObj.toXMLWriter(outputWriter, newindent); } else { // use regular (long) method List objectList = (List) item.get("value"); indent = objectListToXMLWriter(outputWriter, objectList, indent); } } } else { // use regular method List objectList = (List) item.get("value"); indent = objectListToXMLWriter(outputWriter, objectList, indent); } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { indent = dealWithClosingGroupNodes(containedObj, outputWriter, indent); indent = dealWithOpeningGroupNodes(containedObj, outputWriter, indent); String newindent = indent + Specification.getInstance().getPrettyXDFOutputIndentation(); containedObj.toXMLWriter(outputWriter, newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.errorln("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) { outputWriter.write(entifyString(pcdata)); }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName and close the node if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (Specification.getInstance().isPrettyXDFOutput()) outputWriter.write( indent + Specification.getInstance().getPrettyXDFOutputIndentation()); outputWriter.write("<" + noChildObjectNodeName + "/>"); if (Specification.getInstance().isPrettyXDFOutput()) outputWriter.write( Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { indent = dealWithClosingGroupNodes((BaseObject) this, outputWriter, indent); if (Specification.getInstance().isPrettyXDFOutput() && pcdata == null) outputWriter.write( indent); if (!dontCloseNode) outputWriter.write( "</"+nodeNameString+">"); } } else { if (nodeNameString != null) { if (dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) outputWriter.write( ">"); } else { // no sub-objects, just close this node outputWriter.write( "/>"); } } } // if (Specification.getInstance().isPrettyXDFOutput() && nodeNameString != null ) // outputWriter.write( Constants.NEW_LINE); return nodeNameString; } //end synchronize }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/e92f58e5a11bd766546510f1fd24a8e2eb2b17a7/BaseObjectWithXMLElementsAndValueList.java/buggy/src/gov/nasa/gsfc/adc/xdf/BaseObjectWithXMLElementsAndValueList.java
protected void setValueListObj (ValueListInterface valueListObj)
protected void setValueListObj (ValueList valueListObj)
protected void setValueListObj (ValueListInterface valueListObj) { resetValueListObjects(); addValueListObj(valueListObj); }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/e92f58e5a11bd766546510f1fd24a8e2eb2b17a7/BaseObjectWithXMLElementsAndValueList.java/buggy/src/gov/nasa/gsfc/adc/xdf/BaseObjectWithXMLElementsAndValueList.java
public final void visit_checkcast(VmConstClass classRef) {
public final void visit_checkcast(VmConstClass classRef) {
public final void visit_checkcast(VmConstClass classRef) { // Pre-claim ECX requestRegister(ECX); requestRegister(EAX); // check that top item is a reference final RefItem ref = vstack.popRef(); // Load the ref ref.load(eContext); final Register refr = ref.getRegister(); final Register classr = EAX; final Register tmpr = requestRegister(JvmType.INT, false); // Resolve the class writeResolveAndLoadClassToReg(classRef, classr); final Label okLabel = new Label(this.curInstrLabel + "cc-ok"); /* Is objectref null? */ os.writeTEST(refr, refr); os.writeJCC(okLabel, X86Constants.JZ); /* Is instanceof? */ instanceOf(refr, classr, tmpr, okLabel, true); /* Not instanceof */ // Release temp registers here, so invokeJavaMethod can use it releaseRegister(ECX); releaseRegister(classr); releaseRegister(tmpr); // Call SoftByteCodes.systemException os.writePUSH(SoftByteCodes.EX_CLASSCAST); os.writePUSH(0); invokeJavaMethod(context.getSystemExceptionMethod()); final RefItem exi = vstack.popRef(); assertCondition(exi.uses(EAX), "item must be in eax"); exi.release(eContext); /* Exception in EAX, throw it */ helper.writeJumpTableCALL(X86JumpTable.VM_ATHROW_OFS); /* Normal exit */ os.setObjectRef(okLabel); // Leave ref on stack vstack.push(ref); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4210cbd2e8532c8a29412a6b016e4072578a8de8/X86BytecodeVisitor.java/buggy/core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java
public void endDraggingFrame(JComponent f) {// super.endDraggingFrame(f); JInternalFrame frame = (JInternalFrame)f;// JDesktopPane desk = frame.getDesktopPane();// desk.repaint();// frame.validate();// frame.repaint(); ((Gui5250)frame.getContentPane()).getScreen().gg2d = null; }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/54b8440b9e00d642deced8c7a38ca282d1727dbd/Gui5250MDIFrame.java/clean/tn5250j/src/org/tn5250j/Gui5250MDIFrame.java
public void endDraggingFrame(JComponent f) {// super.endDraggingFrame(f); JInternalFrame frame = (JInternalFrame)f;// JDesktopPane desk = frame.getDesktopPane();// desk.repaint();// frame.validate();// frame.repaint(); ((Gui5250)frame.getContentPane()).getScreen().gg2d = null; }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/54b8440b9e00d642deced8c7a38ca282d1727dbd/Gui5250MDIFrame.java/clean/tn5250j/src/org/tn5250j/Gui5250MDIFrame.java
public void endResizingFrame(JComponent f) { f.putClientProperty(RESIZING, Boolean.FALSE); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/54b8440b9e00d642deced8c7a38ca282d1727dbd/Gui5250MDIFrame.java/clean/tn5250j/src/org/tn5250j/Gui5250MDIFrame.java
public void setBoundsForFrame(JComponent f, int x, int y, int w, int h) { System.out.println(" we are adjusting "); if (f instanceof JInternalFrame == false) { super.setBoundsForFrame(f, x, y, w, h); // only deal w/internal frames } else { JInternalFrame frame = (JInternalFrame)f; // Figure out if we are being resized (otherwise it's just a move) boolean resizing = false; Object r = frame.getClientProperty(RESIZING); if (r != null && r instanceof Boolean) { resizing = ((Boolean)r).booleanValue(); } JDesktopPane desk = frame.getDesktopPane(); Dimension d = desk.getSize(); // Nothing all that fancy below, just figuring out how to adjust // to keep the frame on the desktop. if (x < 0) { // too far left? if (resizing) w += x; // don't get wider! x=0; // flush against the left side } else { if (x+w>d.width) { // too far right? if (resizing) w = d.width-x; // don't get wider! else x = d.width-w; // flush against the right side } } if (y < 0) { // too high? if (resizing) h += y; // don't get taller! y=0; // flush against the top } else { if (y+h > d.height) { // too low? if (resizing) h = d.height - y; // don't get taller! else y = d.height-h; // flush against the bottom } } // Set 'em the way we like 'em super.setBoundsForFrame(f, x, y, w, h); } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/54b8440b9e00d642deced8c7a38ca282d1727dbd/Gui5250MDIFrame.java/clean/tn5250j/src/org/tn5250j/Gui5250MDIFrame.java
repaint();
calculateVisibility();
public MyInternalFrame() { super("#" + (++openFrameCount), true, //resizable true, //closable true, //maximizable true);//iconifiable internalId = openFrameCount; //...Create the GUI and put it in the window... //...Then set the window size or call pack... setSize(600,500); //Set the window's location. setLocation(xOffset*openFrameCount, yOffset*openFrameCount); addInternalFrameListener(new InternalFrameAdapter() { public void internalFrameClosing(InternalFrameEvent e) {// displayMessage("Internal frame closing", e); disconnectMe(); } public void internalFrameClosed(InternalFrameEvent e) {// displayMessage("Internal frame closed", e); disconnectMe(); } public void internalFrameOpened(InternalFrameEvent e) {// displayMessage("Internal frame opened", e); } public void internalFrameIconified(InternalFrameEvent e) {// displayMessage("Internal frame iconified", e); } public void internalFrameDeiconified(InternalFrameEvent e) {// displayMessage("Internal frame deiconified", e); repaint(); } public void internalFrameActivated(InternalFrameEvent e) {// displayMessage("Internal frame activated", e); activated = true; repaint(); } public void internalFrameDeactivated(InternalFrameEvent e) { activated = false;// displayMessage("Internal frame deactivated", e); } }); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/54b8440b9e00d642deced8c7a38ca282d1727dbd/Gui5250MDIFrame.java/clean/tn5250j/src/org/tn5250j/Gui5250MDIFrame.java
repaint();
calculateVisibility();
public MyInternalFrame() { super("#" + (++openFrameCount), true, //resizable true, //closable true, //maximizable true);//iconifiable internalId = openFrameCount; //...Create the GUI and put it in the window... //...Then set the window size or call pack... setSize(600,500); //Set the window's location. setLocation(xOffset*openFrameCount, yOffset*openFrameCount); addInternalFrameListener(new InternalFrameAdapter() { public void internalFrameClosing(InternalFrameEvent e) {// displayMessage("Internal frame closing", e); disconnectMe(); } public void internalFrameClosed(InternalFrameEvent e) {// displayMessage("Internal frame closed", e); disconnectMe(); } public void internalFrameOpened(InternalFrameEvent e) {// displayMessage("Internal frame opened", e); } public void internalFrameIconified(InternalFrameEvent e) {// displayMessage("Internal frame iconified", e); } public void internalFrameDeiconified(InternalFrameEvent e) {// displayMessage("Internal frame deiconified", e); repaint(); } public void internalFrameActivated(InternalFrameEvent e) {// displayMessage("Internal frame activated", e); activated = true; repaint(); } public void internalFrameDeactivated(InternalFrameEvent e) { activated = false;// displayMessage("Internal frame deactivated", e); } }); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/54b8440b9e00d642deced8c7a38ca282d1727dbd/Gui5250MDIFrame.java/clean/tn5250j/src/org/tn5250j/Gui5250MDIFrame.java
calculateVisibility();
public MyInternalFrame() { super("#" + (++openFrameCount), true, //resizable true, //closable true, //maximizable true);//iconifiable internalId = openFrameCount; //...Create the GUI and put it in the window... //...Then set the window size or call pack... setSize(600,500); //Set the window's location. setLocation(xOffset*openFrameCount, yOffset*openFrameCount); addInternalFrameListener(new InternalFrameAdapter() { public void internalFrameClosing(InternalFrameEvent e) {// displayMessage("Internal frame closing", e); disconnectMe(); } public void internalFrameClosed(InternalFrameEvent e) {// displayMessage("Internal frame closed", e); disconnectMe(); } public void internalFrameOpened(InternalFrameEvent e) {// displayMessage("Internal frame opened", e); } public void internalFrameIconified(InternalFrameEvent e) {// displayMessage("Internal frame iconified", e); } public void internalFrameDeiconified(InternalFrameEvent e) {// displayMessage("Internal frame deiconified", e); repaint(); } public void internalFrameActivated(InternalFrameEvent e) {// displayMessage("Internal frame activated", e); activated = true; repaint(); } public void internalFrameDeactivated(InternalFrameEvent e) { activated = false;// displayMessage("Internal frame deactivated", e); } }); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/54b8440b9e00d642deced8c7a38ca282d1727dbd/Gui5250MDIFrame.java/clean/tn5250j/src/org/tn5250j/Gui5250MDIFrame.java
repaint();
calculateVisibility();
public void internalFrameActivated(InternalFrameEvent e) {// displayMessage("Internal frame activated", e); activated = true; repaint(); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/54b8440b9e00d642deced8c7a38ca282d1727dbd/Gui5250MDIFrame.java/clean/tn5250j/src/org/tn5250j/Gui5250MDIFrame.java
calculateVisibility();
public void internalFrameClosed(InternalFrameEvent e) {// displayMessage("Internal frame closed", e); disconnectMe(); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/54b8440b9e00d642deced8c7a38ca282d1727dbd/Gui5250MDIFrame.java/clean/tn5250j/src/org/tn5250j/Gui5250MDIFrame.java
calculateVisibility();
public void internalFrameClosing(InternalFrameEvent e) {// displayMessage("Internal frame closing", e); disconnectMe(); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/54b8440b9e00d642deced8c7a38ca282d1727dbd/Gui5250MDIFrame.java/clean/tn5250j/src/org/tn5250j/Gui5250MDIFrame.java
calculateVisibility();
public void internalFrameDeactivated(InternalFrameEvent e) { activated = false;// displayMessage("Internal frame deactivated", e); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/54b8440b9e00d642deced8c7a38ca282d1727dbd/Gui5250MDIFrame.java/clean/tn5250j/src/org/tn5250j/Gui5250MDIFrame.java