rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
| meta
stringlengths 141
403
|
---|---|---|---|
if (listingMode == JFileChooser.FILES_ONLY) return contents.get(directories + index); else
|
public Object getElementAt(int index) { if (index > getSize() - 1) return null; if (listingMode == JFileChooser.FILES_ONLY) return contents.get(directories + index); else return contents.elementAt(index); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicDirectoryModel.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicDirectoryModel.java
|
|
Vector tmp = new Vector(); for (int i = directories; i < getSize(); i++) tmp.add(contents.get(i)); return tmp;
|
synchronized (contents) { Vector f = files; if (f == null) { f = new Vector(); Vector d = new Vector(); for (Iterator i = contents.iterator(); i.hasNext();) { File file = (File) i.next(); if (filechooser.isTraversable(file)) d.add(file); else f.add(file); } files = f; directories = d; } return f; }
|
public Vector getFiles() { Vector tmp = new Vector(); for (int i = directories; i < getSize(); i++) tmp.add(contents.get(i)); return tmp; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicDirectoryModel.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicDirectoryModel.java
|
if (listingMode == JFileChooser.DIRECTORIES_ONLY) return directories; else if (listingMode == JFileChooser.FILES_ONLY) return contents.size() - directories;
|
public int getSize() { if (listingMode == JFileChooser.DIRECTORIES_ONLY) return directories; else if (listingMode == JFileChooser.FILES_ONLY) return contents.size() - directories; return contents.size(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicDirectoryModel.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicDirectoryModel.java
|
|
if (listingMode == JFileChooser.FILES_ONLY) return contents.indexOf(o) - directories;
|
public int indexOf(Object o) { if (listingMode == JFileChooser.FILES_ONLY) return contents.indexOf(o) - directories; return contents.indexOf(o); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicDirectoryModel.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicDirectoryModel.java
|
|
if (e.getPropertyName().equals(JFileChooser.FILE_SELECTION_MODE_CHANGED_PROPERTY)) listingMode = filechooser.getFileSelectionMode();
|
String property = e.getPropertyName(); if (property.equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || property.equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || property.equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY) || property.equals(JFileChooser.FILE_SELECTION_MODE_CHANGED_PROPERTY) || property.equals(JFileChooser.FILE_VIEW_CHANGED_PROPERTY) ) { validateFileCache(); }
|
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals(JFileChooser.FILE_SELECTION_MODE_CHANGED_PROPERTY)) listingMode = filechooser.getFileSelectionMode(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicDirectoryModel.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicDirectoryModel.java
|
return false;
|
return oldFile.renameTo( newFile );
|
public boolean renameFile(File oldFile, File newFile) { // FIXME: implement return false; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicDirectoryModel.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicDirectoryModel.java
|
Enumeration e = Collections.enumeration(v); Vector tmp = new Vector(); for (; e.hasMoreElements();) tmp.add(e.nextElement()); contents = tmp;
|
protected void sort(Vector v) { Collections.sort(v, comparator); Enumeration e = Collections.enumeration(v); Vector tmp = new Vector(); for (; e.hasMoreElements();) tmp.add(e.nextElement()); contents = tmp; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicDirectoryModel.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicDirectoryModel.java
|
|
contents.clear(); directories = 0; FileSystemView fsv = filechooser.getFileSystemView(); File[] list = fsv.getFiles(filechooser.getCurrentDirectory(), filechooser.isFileHidingEnabled()); if (list == null) return; for (int i = 0; i < list.length; i++)
|
File dir = filechooser.getCurrentDirectory(); if (dir != null)
|
public void validateFileCache() { contents.clear(); directories = 0; FileSystemView fsv = filechooser.getFileSystemView(); File[] list = fsv.getFiles(filechooser.getCurrentDirectory(), filechooser.isFileHidingEnabled()); if (list == null) return; for (int i = 0; i < list.length; i++) { if (list[i] == null) continue; if (filechooser.accept(list[i])) { contents.add(list[i]); if (filechooser.isTraversable(list[i])) directories++; } } sort(contents); filechooser.revalidate(); filechooser.repaint(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicDirectoryModel.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicDirectoryModel.java
|
if (list[i] == null) continue; if (filechooser.accept(list[i]))
|
if (loadThread != null)
|
public void validateFileCache() { contents.clear(); directories = 0; FileSystemView fsv = filechooser.getFileSystemView(); File[] list = fsv.getFiles(filechooser.getCurrentDirectory(), filechooser.isFileHidingEnabled()); if (list == null) return; for (int i = 0; i < list.length; i++) { if (list[i] == null) continue; if (filechooser.accept(list[i])) { contents.add(list[i]); if (filechooser.isTraversable(list[i])) directories++; } } sort(contents); filechooser.revalidate(); filechooser.repaint(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicDirectoryModel.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicDirectoryModel.java
|
contents.add(list[i]); if (filechooser.isTraversable(list[i])) directories++;
|
loadThread.interrupt(); loadThread.cancelPending();
|
public void validateFileCache() { contents.clear(); directories = 0; FileSystemView fsv = filechooser.getFileSystemView(); File[] list = fsv.getFiles(filechooser.getCurrentDirectory(), filechooser.isFileHidingEnabled()); if (list == null) return; for (int i = 0; i < list.length; i++) { if (list[i] == null) continue; if (filechooser.accept(list[i])) { contents.add(list[i]); if (filechooser.isTraversable(list[i])) directories++; } } sort(contents); filechooser.revalidate(); filechooser.repaint(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicDirectoryModel.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicDirectoryModel.java
|
sort(contents); filechooser.revalidate(); filechooser.repaint();
|
public void validateFileCache() { contents.clear(); directories = 0; FileSystemView fsv = filechooser.getFileSystemView(); File[] list = fsv.getFiles(filechooser.getCurrentDirectory(), filechooser.isFileHidingEnabled()); if (list == null) return; for (int i = 0; i < list.length; i++) { if (list[i] == null) continue; if (filechooser.accept(list[i])) { contents.add(list[i]); if (filechooser.isTraversable(list[i])) directories++; } } sort(contents); filechooser.revalidate(); filechooser.repaint(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicDirectoryModel.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicDirectoryModel.java
|
|
new SecureRandom ().nextBytes(cIV);
|
getDefaultPRNG().nextBytes(cIV);
|
private String createO(final String aol) throws AuthenticationException { if (DEBUG && debuglevel > 8) debug(TRACE, "==> createO(\"" + aol + "\")"); boolean replaydetectionAvailable = false; boolean integrityAvailable = false; boolean confidentialityAvailable = false; String option, mandatory = SRPRegistry.DEFAULT_MANDATORY; int i; String mdName = SRPRegistry.SRP_DEFAULT_DIGEST_NAME; final StringTokenizer st = new StringTokenizer(aol, ","); while (st.hasMoreTokens()) { option = st.nextToken(); if (option.startsWith(SRPRegistry.OPTION_SRP_DIGEST + "=")) { option = option.substring(option.indexOf('=') + 1); if (DEBUG && debuglevel > 6) debug(TRACE, "mda: <" + option + ">"); for (i = 0; i < SRPRegistry.INTEGRITY_ALGORITHMS.length; i++) { if (SRPRegistry.SRP_ALGORITHMS[i].equals(option)) { mdName = option; break; } } } else if (option.equals(SRPRegistry.OPTION_REPLAY_DETECTION)) { replaydetectionAvailable = true; } else if (option.startsWith(SRPRegistry.OPTION_INTEGRITY + "=")) { option = option.substring(option.indexOf('=') + 1); if (DEBUG && debuglevel > 6) debug(TRACE, "ialg: <" + option + ">"); for (i = 0; i < SRPRegistry.INTEGRITY_ALGORITHMS.length; i++) { if (SRPRegistry.INTEGRITY_ALGORITHMS[i].equals(option)) { chosenIntegrityAlgorithm = option; integrityAvailable = true; break; } } } else if (option.startsWith(SRPRegistry.OPTION_CONFIDENTIALITY + "=")) { option = option.substring(option.indexOf('=') + 1); if (DEBUG && debuglevel > 6) debug(TRACE, "calg: <" + option + ">"); for (i = 0; i < SRPRegistry.CONFIDENTIALITY_ALGORITHMS.length; i++) { if (SRPRegistry.CONFIDENTIALITY_ALGORITHMS[i].equals(option)) { chosenConfidentialityAlgorithm = option; confidentialityAvailable = true; break; } } } else if (option.startsWith(SRPRegistry.OPTION_MANDATORY + "=")) { mandatory = option.substring(option.indexOf('=') + 1); } else if (option.startsWith(SRPRegistry.OPTION_MAX_BUFFER_SIZE + "=")) { final String maxBufferSize = option.substring(option.indexOf('=') + 1); try { rawSendSize = Integer.parseInt(maxBufferSize); if (rawSendSize > Registry.SASL_BUFFER_MAX_LIMIT || rawSendSize < 1) { throw new AuthenticationException( "Illegal value for 'maxbuffersize' option"); } } catch (NumberFormatException x) { throw new AuthenticationException( SRPRegistry.OPTION_MAX_BUFFER_SIZE + "=" + String.valueOf(maxBufferSize), x); } } } replayDetection = replaydetectionAvailable && Boolean.valueOf( (String) properties.get(SRPRegistry.SRP_REPLAY_DETECTION)).booleanValue(); boolean integrity = integrityAvailable && Boolean.valueOf( (String) properties.get(SRPRegistry.SRP_INTEGRITY_PROTECTION)).booleanValue(); boolean confidentiality = confidentialityAvailable && Boolean.valueOf( (String) properties.get(SRPRegistry.SRP_CONFIDENTIALITY)).booleanValue(); // make sure we do the right thing if (SRPRegistry.OPTION_REPLAY_DETECTION.equals(mandatory)) { replayDetection = true; integrity = true; } else if (SRPRegistry.OPTION_INTEGRITY.equals(mandatory)) { integrity = true; } else if (SRPRegistry.OPTION_CONFIDENTIALITY.equals(mandatory)) { confidentiality = true; } if (replayDetection) { if (chosenIntegrityAlgorithm == null) { throw new AuthenticationException( "Replay detection is required but no " + "integrity protection algorithm was chosen"); } } if (integrity) { if (chosenIntegrityAlgorithm == null) { throw new AuthenticationException( "Integrity protection is required but no " + "algorithm was chosen"); } } if (confidentiality) { if (chosenConfidentialityAlgorithm == null) { throw new AuthenticationException( "Confidentiality protection is required " + "but no algorithm was chosen"); } } // 1. check if we'll be using confidentiality; if not set IV to 0-byte if (chosenConfidentialityAlgorithm == null) { cIV = new byte[0]; } else { // 2. get the block size of the cipher final IBlockCipher cipher = CipherFactory.getInstance(chosenConfidentialityAlgorithm); if (cipher == null) { throw new AuthenticationException("createO()", new NoSuchAlgorithmException()); } final int blockSize = cipher.defaultBlockSize(); // 3. generate random iv cIV = new byte[blockSize]; new SecureRandom ().nextBytes(cIV); } srp = SRP.instance(mdName); // Now create the options list specifying which of the available options // we have chosen. // For now we just select the defaults. Later we need to add support for // properties (perhaps in a file) where a user can specify the list of // algorithms they would prefer to use. final StringBuffer sb = new StringBuffer(); sb.append(SRPRegistry.OPTION_SRP_DIGEST).append("=").append(mdName).append( ","); if (replayDetection) { sb.append(SRPRegistry.OPTION_REPLAY_DETECTION).append(","); } if (integrity) { sb.append(SRPRegistry.OPTION_INTEGRITY).append("=").append( chosenIntegrityAlgorithm).append( ","); } if (confidentiality) { sb.append(SRPRegistry.OPTION_CONFIDENTIALITY).append("=").append( chosenConfidentialityAlgorithm).append( ","); } final String result = sb.append(SRPRegistry.OPTION_MAX_BUFFER_SIZE).append( "=").append( Registry.SASL_BUFFER_MAX_LIMIT).toString(); if (DEBUG && debuglevel > 8) debug(TRACE, "<== createO() --> " + result); return result; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/SRPClient.java/clean/core/src/classpath/gnu/gnu/javax/crypto/sasl/srp/SRPClient.java
|
cn = new SecureRandom ().generateSeed (16);
|
cn = new byte[16]; getDefaultPRNG().nextBytes(cn);
|
private byte[] sendIdentities() throws SaslException { if (DEBUG && debuglevel > 8) debug(TRACE, "==> sendIdentities()"); // If necessary, prompt the client for the username and password getUsernameAndPassword(); if (DEBUG && debuglevel > 6) debug(TRACE, "Password: \"" + new String(password.getPassword()) + "\""); if (DEBUG && debuglevel > 6) debug(TRACE, "Encoding U (username): \"" + U + "\""); if (DEBUG && debuglevel > 6) debug(TRACE, "Encoding I (userid): \"" + authorizationID + "\""); // if session re-use generate new 16-byte nonce if (sid.length != 0) { cn = new SecureRandom ().generateSeed (16); } else { cn = new byte[0]; } final OutputBuffer frameOut = new OutputBuffer(); try { frameOut.setText(U); frameOut.setText(authorizationID); frameOut.setEOS(sid); // session ID to re-use frameOut.setOS(cn); // client nonce frameOut.setEOS(channelBinding); } catch (IOException x) { if (x instanceof SaslException) { throw (SaslException) x; } throw new AuthenticationException("sendIdentities()", x); } final byte[] result = frameOut.encode(); if (DEBUG && debuglevel > 8) debug(TRACE, "<== sendIdentities()"); if (DEBUG && debuglevel > 2) debug(INFO, "C: " + Util.dumpString(result)); if (DEBUG && debuglevel > 2) debug(INFO, " U = " + U); if (DEBUG && debuglevel > 2) debug(INFO, " I = " + authorizationID); if (DEBUG && debuglevel > 2) debug(INFO, "sid = " + new String(sid)); if (DEBUG && debuglevel > 2) debug(INFO, " cn = " + Util.dumpString(cn)); if (DEBUG && debuglevel > 2) debug(INFO, "cCB = " + Util.dumpString(channelBinding)); return result; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/SRPClient.java/clean/core/src/classpath/gnu/gnu/javax/crypto/sasl/srp/SRPClient.java
|
invalidate(); RepaintManager.currentManager(this).addInvalidComponent(this);
|
if (! EventQueue.isDispatchThread()) SwingUtilities.invokeLater(new Runnable() { public void run() { revalidate(); } }); else { invalidate(); RepaintManager.currentManager(this).addInvalidComponent(this); }
|
public void revalidate() { invalidate(); RepaintManager.currentManager(this).addInvalidComponent(this); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5edad632205aa44aca51004923ae52d754cced11/JComponent.java/buggy/core/src/classpath/javax/javax/swing/JComponent.java
|
Container parent = getParent(); if (parent != null) parent.repaint(getX(), getY(), getWidth(), getHeight()); revalidate();
|
public void setVisible(boolean v) { super.setVisible(v); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5edad632205aa44aca51004923ae52d754cced11/JComponent.java/buggy/core/src/classpath/javax/javax/swing/JComponent.java
|
|
public abstract FileLock lock(long position, long size, boolean shared) throws IOException;
|
public final FileLock lock() throws IOException { return lock(0, Long.MAX_VALUE, false); }
|
public abstract FileLock lock(long position, long size, boolean shared) throws IOException;
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/FileChannel.java/buggy/core/src/classpath/java/java/nio/channels/FileChannel.java
|
public abstract int read(ByteBuffer dst) throws IOException;
|
public abstract long read(ByteBuffer[] dsts, int offset, int length) throws IOException;
|
public abstract int read(ByteBuffer dst) throws IOException;
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/FileChannel.java/buggy/core/src/classpath/java/java/nio/channels/FileChannel.java
|
public abstract FileLock tryLock(long position, long size, boolean shared) throws IOException;
|
public final FileLock tryLock() throws IOException { return tryLock(0, Long.MAX_VALUE, false); }
|
public abstract FileLock tryLock(long position, long size, boolean shared) throws IOException;
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/FileChannel.java/buggy/core/src/classpath/java/java/nio/channels/FileChannel.java
|
public abstract int write(ByteBuffer src) throws IOException;
|
public final long write(ByteBuffer[] srcs) throws IOException { long result = 0; for (int i = 0; i < srcs.length; i++) result += write(srcs[i]); return result; }
|
public abstract int write(ByteBuffer src) throws IOException;
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/FileChannel.java/buggy/core/src/classpath/java/java/nio/channels/FileChannel.java
|
buf.append(Thread.currentThread().hashCode()); buf.append('@');
|
HTTPConnection getConnection(String host, int port, boolean secure) throws IOException { HTTPConnection connection; if (keepAlive) { StringBuffer buf = new StringBuffer(secure ? "https://" : "http://"); buf.append(host); buf.append(':'); buf.append(port); String key = buf.toString(); synchronized (connectionPool) { connection = (HTTPConnection) connectionPool.get(key); if (connection == null) { connection = new HTTPConnection(host, port, secure); // Good housekeeping if (connectionPool.size() == maxConnections) { // maxConnections must always be >= 1 Object lru = connectionPool.keySet().iterator().next(); connectionPool.remove(lru); } connectionPool.put(key, connection); } } } else { connection = new HTTPConnection(host, port, secure); } return connection; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/68a6301301378680519f2b146daec37812a1bc22/HTTPURLConnection.java/buggy/core/src/classpath/gnu/gnu/java/net/protocol/http/HTTPURLConnection.java
|
|
void jbInit() throws Exception { // make it non resizable setResizable(true); this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); // create some reusable borders and layouts Border etchedBorder = BorderFactory.createEtchedBorder(); BorderLayout borderLayout = new BorderLayout(); // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JTable(ctm); // Add enter as default key for connect with this session KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0); sessions.registerKeyboardAction(new ActionListener() { public void actionPerformed(ActionEvent e) { doActionConnect(); } },enter,JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); connectButton = addOptButton(LangTool.getString("ss.optConnect"),"CONNECT",options,false); addOptButton(LangTool.getString("ss.optCancel"),"DONE",options); // add the panels to our dialog getContentPane().add(sessionPanel,BorderLayout.CENTER); getContentPane().add(options, BorderLayout.SOUTH); // pack it and center it on the screen pack(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = getSize(); if (frameSize.height > screenSize.height) frameSize.height = screenSize.height; if (frameSize.width > screenSize.width) frameSize.width = screenSize.width; setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); // set default selection value as the first row if (sessions.getRowCount() > 0) { sessions.getSelectionModel().setSelectionInterval(0,0); } // now show the world what we and they can do this.setVisible(true); }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/99debc0e39981c309029bd7389a7d7c50837d87b/Connect.java/buggy/tn5250j/src/org/tn5250j/Connect.java
|
||
getContentPane().add(interfacePanel,BorderLayout.NORTH);
|
void jbInit() throws Exception { // make it non resizable setResizable(true); this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); // create some reusable borders and layouts Border etchedBorder = BorderFactory.createEtchedBorder(); BorderLayout borderLayout = new BorderLayout(); // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JTable(ctm); // Add enter as default key for connect with this session KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0); sessions.registerKeyboardAction(new ActionListener() { public void actionPerformed(ActionEvent e) { doActionConnect(); } },enter,JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); connectButton = addOptButton(LangTool.getString("ss.optConnect"),"CONNECT",options,false); addOptButton(LangTool.getString("ss.optCancel"),"DONE",options); // add the panels to our dialog getContentPane().add(sessionPanel,BorderLayout.CENTER); getContentPane().add(options, BorderLayout.SOUTH); // pack it and center it on the screen pack(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = getSize(); if (frameSize.height > screenSize.height) frameSize.height = screenSize.height; if (frameSize.width > screenSize.width) frameSize.width = screenSize.width; setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); // set default selection value as the first row if (sessions.getRowCount() > 0) { sessions.getSelectionModel().setSelectionInterval(0,0); } // now show the world what we and they can do this.setVisible(true); }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/99debc0e39981c309029bd7389a7d7c50837d87b/Connect.java/buggy/tn5250j/src/org/tn5250j/Connect.java
|
|
if (e.getPropertyName().equals(JTabbedPane.TAB_LAYOUT_POLICY_CHANGED_PROPERTY))
|
if (e.getPropertyName().equals("tabLayoutPolicy"))
|
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals(JTabbedPane.TAB_LAYOUT_POLICY_CHANGED_PROPERTY)) { layoutManager = createLayoutManager(); tabPane.setLayout(layoutManager); } else if (e.getPropertyName().equals(JTabbedPane.TAB_PLACEMENT_CHANGED_PROPERTY) && tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { incrButton = createIncreaseButton(); decrButton = createDecreaseButton(); } tabPane.layout(); tabPane.repaint(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/53b78dd1e4587254262f4618d2aa7551de8e0cbf/BasicTabbedPaneUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
|
else if (e.getPropertyName().equals(JTabbedPane.TAB_PLACEMENT_CHANGED_PROPERTY)
|
else if (e.getPropertyName().equals("tabPlacement")
|
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals(JTabbedPane.TAB_LAYOUT_POLICY_CHANGED_PROPERTY)) { layoutManager = createLayoutManager(); tabPane.setLayout(layoutManager); } else if (e.getPropertyName().equals(JTabbedPane.TAB_PLACEMENT_CHANGED_PROPERTY) && tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { incrButton = createIncreaseButton(); decrButton = createDecreaseButton(); } tabPane.layout(); tabPane.repaint(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/53b78dd1e4587254262f4618d2aa7551de8e0cbf/BasicTabbedPaneUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
|
public LayoutManager createLayoutManager()
|
protected LayoutManager createLayoutManager()
|
public LayoutManager createLayoutManager() { if (tabPane.getTabLayoutPolicy() == JTabbedPane.WRAP_TAB_LAYOUT) return new TabbedPaneLayout(); else { incrButton = createIncreaseButton(); decrButton = createDecreaseButton(); viewport = new ScrollingViewport(); viewport.setLayout(null); panel = new ScrollingPanel(); viewport.setView(panel); tabPane.add(incrButton); tabPane.add(decrButton); tabPane.add(viewport); currentScrollLocation = 0; decrButton.setEnabled(false); panel.addMouseListener(mouseListener); incrButton.addMouseListener(mouseListener); decrButton.addMouseListener(mouseListener); viewport.setBackground(Color.LIGHT_GRAY); return new TabbedPaneScrollLayout(); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/53b78dd1e4587254262f4618d2aa7551de8e0cbf/BasicTabbedPaneUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
|
public void addAccessibleSelection(int value0) throws NotImplementedException
|
public void addAccessibleSelection(int index)
|
public void addAccessibleSelection(int value0) throws NotImplementedException { // TODO: Implement this properly. }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
|
setSelectedIndex(index);
|
public void addAccessibleSelection(int value0) throws NotImplementedException { // TODO: Implement this properly. }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
|
|
throws NotImplementedException
|
public void clearAccessibleSelection() throws NotImplementedException { // TODO: Implement this properly. }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
|
|
setSelectedIndex(-1);
|
public void clearAccessibleSelection() throws NotImplementedException { // TODO: Implement this properly. }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
|
|
public boolean doAccessibleAction(int value0) throws NotImplementedException
|
public boolean doAccessibleAction(int actionIndex)
|
public boolean doAccessibleAction(int value0) throws NotImplementedException { return false; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
|
return false;
|
boolean actionPerformed = false; if (actionIndex == 0) { setPopupVisible(! isPopupVisible()); actionPerformed = true; } return actionPerformed;
|
public boolean doAccessibleAction(int value0) throws NotImplementedException { return false; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
|
throws NotImplementedException
|
public AccessibleAction getAccessibleAction() throws NotImplementedException { return null; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
|
|
return null;
|
return this;
|
public AccessibleAction getAccessibleAction() throws NotImplementedException { return null; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
|
throws NotImplementedException
|
public int getAccessibleActionCount() throws NotImplementedException { return 0; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
|
|
return 0;
|
return 1;
|
public int getAccessibleActionCount() throws NotImplementedException { return 0; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
|
public String getAccessibleActionDescription(int value0) throws NotImplementedException
|
public String getAccessibleActionDescription(int actionIndex)
|
public String getAccessibleActionDescription(int value0) throws NotImplementedException { return null; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
|
return null;
|
return UIManager.getString("ComboBox.togglePopupText");
|
public String getAccessibleActionDescription(int value0) throws NotImplementedException { return null; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
|
public Accessible getAccessibleChild(int value0) throws NotImplementedException
|
public Accessible getAccessibleChild(int index)
|
public Accessible getAccessibleChild(int value0) throws NotImplementedException { return null; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
|
return null;
|
ComponentUI ui = getUI(); Accessible child = null; if (ui != null) child = ui.getAccessibleChild(JComboBox.this, index); else child = super.getAccessibleChild(index); return child;
|
public Accessible getAccessibleChild(int value0) throws NotImplementedException { return null; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
|
throws NotImplementedException
|
public int getAccessibleChildrenCount() throws NotImplementedException { return 0; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
|
|
return 0;
|
ComponentUI ui = getUI(); int count; if (ui != null) count = ui.getAccessibleChildrenCount(JComboBox.this); else count = super.getAccessibleChildrenCount(); return count;
|
public int getAccessibleChildrenCount() throws NotImplementedException { return 0; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
|
throws NotImplementedException
|
public AccessibleSelection getAccessibleSelection() throws NotImplementedException { return null; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
|
|
return null;
|
return this;
|
public AccessibleSelection getAccessibleSelection() throws NotImplementedException { return null; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
|
throws NotImplementedException
|
public int getAccessibleSelectionCount() throws NotImplementedException { return 0; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
|
|
return 0;
|
Object sel = getSelectedItem(); int count = 0; if (sel != null) count = 1; return count;
|
public int getAccessibleSelectionCount() throws NotImplementedException { return 0; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
|
public boolean isAccessibleChildSelected(int value0) throws NotImplementedException
|
public boolean isAccessibleChildSelected(int index)
|
public boolean isAccessibleChildSelected(int value0) throws NotImplementedException { return false; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
|
return false;
|
return getSelectedIndex() == index;
|
public boolean isAccessibleChildSelected(int value0) throws NotImplementedException { return false; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
|
public void removeAccessibleSelection(int value0) throws NotImplementedException
|
public void removeAccessibleSelection(int index)
|
public void removeAccessibleSelection(int value0) throws NotImplementedException { // TODO: Implement this properly. }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
|
if (getSelectedIndex() == index) clearAccessibleSelection();
|
public void removeAccessibleSelection(int value0) throws NotImplementedException { // TODO: Implement this properly. }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
|
|
throws NotImplementedException
|
public void selectAllAccessibleSelection() throws NotImplementedException { // TODO: Implement this properly. }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
|
|
public void selectAllAccessibleSelection() throws NotImplementedException { // TODO: Implement this properly. }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
|
||
for(int i = 0; i < listeners.length; i++)
|
for (int i = 0; i < listeners.length; i++)
|
public void firePopupMenuCanceled() { PopupMenuListener[] listeners = getPopupMenuListeners(); PopupMenuEvent e = new PopupMenuEvent(this); for(int i = 0; i < listeners.length; i++) listeners[i].popupMenuCanceled(e); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
|
for(int i = 0; i < listeners.length; i++)
|
for (int i = 0; i < listeners.length; i++)
|
public void firePopupMenuWillBecomeInvisible() { PopupMenuListener[] listeners = getPopupMenuListeners(); PopupMenuEvent e = new PopupMenuEvent(this); for(int i = 0; i < listeners.length; i++) listeners[i].popupMenuWillBecomeInvisible(e); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
|
for(int i = 0; i < listeners.length; i++)
|
for (int i = 0; i < listeners.length; i++)
|
public void firePopupMenuWillBecomeVisible() { PopupMenuListener[] listeners = getPopupMenuListeners(); PopupMenuEvent e = new PopupMenuEvent(this); for(int i = 0; i < listeners.length; i++) listeners[i].popupMenuWillBecomeVisible(e); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
|
+"model it is not an instance of "
|
+ "model it is not an instance of "
|
public void removeAllItems() { if (dataModel instanceof DefaultComboBoxModel) // Uses special method if we have a DefaultComboBoxModel. ((DefaultComboBoxModel) dataModel).removeAllElements(); else if (dataModel instanceof MutableComboBoxModel) { // Iterates over all items and removes each. MutableComboBoxModel mcbm = (MutableComboBoxModel) dataModel; // We intentionally remove the items backwards to support models which // shift their content to the beginning (e.g. linked lists) for (int i = mcbm.getSize() - 1; i >= 0; i--) mcbm.removeElementAt(i); } else throw new RuntimeException("Unable to remove the items because the data " +"model it is not an instance of " + "MutableComboBoxModel."); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
|
start();
|
EventDispatchThread(EventQueue queue) { super(); setName("AWT-EventQueue-" + ++dispatchThreadNum); this.queue = queue; setPriority(NORM_PRIORITY + 1); start(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b0bcdc7c5655d1ed77837894a9de15b7556d346b/EventDispatchThread.java/buggy/core/src/classpath/java/java/awt/EventDispatchThread.java
|
|
while (true) { try { AWTEvent evt = queue.getNextEvent(); if (isInterrupted ()) { return; }
|
System.out.println("run of dispatch thread"); while (true) { try { AWTEvent evt = queue.getNextEvent();
|
public void run() { while (true) { try { AWTEvent evt = queue.getNextEvent(); if (isInterrupted ()) { // We are interrupted when we should finish executing return; } KeyboardFocusManager manager; manager = KeyboardFocusManager.getCurrentKeyboardFocusManager (); // Try to dispatch this event to the current keyboard focus // manager. It will dispatch all FocusEvents, all // WindowEvents related to focus, and all KeyEvents, // returning true. Otherwise, it returns false and we // dispatch the event normally. if (!manager.dispatchEvent (evt)) queue.dispatchEvent(evt); } catch (ThreadDeath death) { // If someone wants to kill us, let them. return; } catch (InterruptedException ie) { // We are interrupted when we should finish executing return; } catch (Throwable x) { System.err.println("Exception during event dispatch:"); x.printStackTrace(System.err); } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b0bcdc7c5655d1ed77837894a9de15b7556d346b/EventDispatchThread.java/buggy/core/src/classpath/java/java/awt/EventDispatchThread.java
|
KeyboardFocusManager manager; manager = KeyboardFocusManager.getCurrentKeyboardFocusManager ();
|
KeyboardFocusManager manager; manager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
|
public void run() { while (true) { try { AWTEvent evt = queue.getNextEvent(); if (isInterrupted ()) { // We are interrupted when we should finish executing return; } KeyboardFocusManager manager; manager = KeyboardFocusManager.getCurrentKeyboardFocusManager (); // Try to dispatch this event to the current keyboard focus // manager. It will dispatch all FocusEvents, all // WindowEvents related to focus, and all KeyEvents, // returning true. Otherwise, it returns false and we // dispatch the event normally. if (!manager.dispatchEvent (evt)) queue.dispatchEvent(evt); } catch (ThreadDeath death) { // If someone wants to kill us, let them. return; } catch (InterruptedException ie) { // We are interrupted when we should finish executing return; } catch (Throwable x) { System.err.println("Exception during event dispatch:"); x.printStackTrace(System.err); } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b0bcdc7c5655d1ed77837894a9de15b7556d346b/EventDispatchThread.java/buggy/core/src/classpath/java/java/awt/EventDispatchThread.java
|
if (!manager.dispatchEvent (evt)) queue.dispatchEvent(evt); } catch (ThreadDeath death) { return;
|
if (!manager.dispatchEvent(evt)) { queue.dispatchEvent(evt); } } catch (ThreadDeath death) { System.out.println("dispatch thread:threaddeath"); return; } catch (InterruptedException ie) { System.out.println("dispatch thread:interrupted"); return; } catch (Throwable x) { System.out.println("dispatch thread:exception"); x.printStackTrace(); System.err.println("Exception during event dispatch:"); x.printStackTrace(System.err); }
|
public void run() { while (true) { try { AWTEvent evt = queue.getNextEvent(); if (isInterrupted ()) { // We are interrupted when we should finish executing return; } KeyboardFocusManager manager; manager = KeyboardFocusManager.getCurrentKeyboardFocusManager (); // Try to dispatch this event to the current keyboard focus // manager. It will dispatch all FocusEvents, all // WindowEvents related to focus, and all KeyEvents, // returning true. Otherwise, it returns false and we // dispatch the event normally. if (!manager.dispatchEvent (evt)) queue.dispatchEvent(evt); } catch (ThreadDeath death) { // If someone wants to kill us, let them. return; } catch (InterruptedException ie) { // We are interrupted when we should finish executing return; } catch (Throwable x) { System.err.println("Exception during event dispatch:"); x.printStackTrace(System.err); } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b0bcdc7c5655d1ed77837894a9de15b7556d346b/EventDispatchThread.java/buggy/core/src/classpath/java/java/awt/EventDispatchThread.java
|
catch (InterruptedException ie) { return; } catch (Throwable x) { System.err.println("Exception during event dispatch:"); x.printStackTrace(System.err); } } }
|
}
|
public void run() { while (true) { try { AWTEvent evt = queue.getNextEvent(); if (isInterrupted ()) { // We are interrupted when we should finish executing return; } KeyboardFocusManager manager; manager = KeyboardFocusManager.getCurrentKeyboardFocusManager (); // Try to dispatch this event to the current keyboard focus // manager. It will dispatch all FocusEvents, all // WindowEvents related to focus, and all KeyEvents, // returning true. Otherwise, it returns false and we // dispatch the event normally. if (!manager.dispatchEvent (evt)) queue.dispatchEvent(evt); } catch (ThreadDeath death) { // If someone wants to kill us, let them. return; } catch (InterruptedException ie) { // We are interrupted when we should finish executing return; } catch (Throwable x) { System.err.println("Exception during event dispatch:"); x.printStackTrace(System.err); } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b0bcdc7c5655d1ed77837894a9de15b7556d346b/EventDispatchThread.java/buggy/core/src/classpath/java/java/awt/EventDispatchThread.java
|
VmAbstractHeap heap = heapManager.getFirstHeap();
|
VmAbstractHeap heap = heapManager.getHeapList();
|
private final void runFinalization() { VmAbstractHeap heap = heapManager.getFirstHeap(); while (heap != null) { visitor.setCurrentHeap(heap); heap.walk(visitor, true, ObjectFlags.GC_COLOUR_MASK, ObjectFlags.GC_YELLOW); heap = heap.getNext(); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/17c5c434010c98f6a1acae0cf9ca6782f92f1dfc/FinalizerThread.java/buggy/core/src/core/org/jnode/vm/memmgr/def/FinalizerThread.java
|
public ViewportLayout() { }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/ViewportLayout.java/buggy/core/src/classpath/javax/javax/swing/ViewportLayout.java
|
||
public void addLayoutComponent(String name, Component c) { }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/ViewportLayout.java/buggy/core/src/classpath/javax/javax/swing/ViewportLayout.java
|
||
public void removeLayoutComponent(Component c) { }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/ViewportLayout.java/buggy/core/src/classpath/javax/javax/swing/ViewportLayout.java
|
||
responseHeaders.remove("Content-Encoding");
|
private InputStream createResponseBodyStream(Headers responseHeaders, int majorVersion, int minorVersion, InputStream in) throws IOException { long contentLength = -1; Headers trailer = null; // Persistent connections are the default in HTTP/1.1 boolean doClose = "close".equalsIgnoreCase(getHeader("Connection")) || "close".equalsIgnoreCase(responseHeaders.getValue("Connection")) || (connection.majorVersion == 1 && connection.minorVersion == 0) || (majorVersion == 1 && minorVersion == 0); String transferCoding = responseHeaders.getValue("Transfer-Encoding"); if ("chunked".equalsIgnoreCase(transferCoding)) { in = new LimitedLengthInputStream(in, -1, false, connection, doClose); in = new ChunkedInputStream(in, responseHeaders); } else { contentLength = responseHeaders.getLongValue("Content-Length"); if (contentLength < 0) doClose = true; // No Content-Length, must close. in = new LimitedLengthInputStream(in, contentLength, contentLength >= 0, connection, doClose); } String contentCoding = responseHeaders.getValue("Content-Encoding"); if (contentCoding != null && !"identity".equals(contentCoding)) { if ("gzip".equals(contentCoding)) { in = new GZIPInputStream(in); } else if ("deflate".equals(contentCoding)) { in = new InflaterInputStream(in); } else { throw new ProtocolException("Unsupported Content-Encoding: " + contentCoding); } } return in; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/Request.java/clean/core/src/classpath/gnu/gnu/java/net/protocol/http/Request.java
|
|
addLayoutComponent(Component component, Object constraints) {
|
public void addLayoutComponent(Component component, Object constraints) {
|
addLayoutComponent(Component component, Object constraints){ if (constraints != null && ! (constraints instanceof String)) throw new IllegalArgumentException("Constraint must be a string"); addLayoutComponent((String) constraints, component);}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/BorderLayout.java/buggy/core/src/classpath/java/java/awt/BorderLayout.java
|
}
|
}
|
addLayoutComponent(Component component, Object constraints){ if (constraints != null && ! (constraints instanceof String)) throw new IllegalArgumentException("Constraint must be a string"); addLayoutComponent((String) constraints, component);}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/BorderLayout.java/buggy/core/src/classpath/java/java/awt/BorderLayout.java
|
calcCompSize(Component comp, int what) {
|
private Dimension calcCompSize(Component comp, int what) {
|
calcCompSize(Component comp, int what){ if (comp == null || !comp.isVisible()) return new Dimension(0, 0); if (what == MIN) return comp.getMinimumSize(); else if (what == MAX) return comp.getMaximumSize(); return comp.getPreferredSize();}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/BorderLayout.java/buggy/core/src/classpath/java/java/awt/BorderLayout.java
|
}
|
}
|
calcCompSize(Component comp, int what){ if (comp == null || !comp.isVisible()) return new Dimension(0, 0); if (what == MIN) return comp.getMinimumSize(); else if (what == MAX) return comp.getMaximumSize(); return comp.getPreferredSize();}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/BorderLayout.java/buggy/core/src/classpath/java/java/awt/BorderLayout.java
|
calcSize(Container target, int what) {
|
private Dimension calcSize(Container target, int what) {
|
calcSize(Container target, int what){ synchronized (target.getTreeLock ()) { Insets ins = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_south = south; Component my_west = west; // Note that we currently don't handle vertical layouts. Neither // does JDK 1.3. if (firstLine != null) my_north = firstLine; if (lastLine != null) my_south = lastLine; if (firstItem != null) { if (left_to_right) my_west = firstItem; else my_east = firstItem; } if (lastItem != null) { if (left_to_right) my_east = lastItem; else my_west = lastItem; } Dimension ndim = calcCompSize(my_north, what); Dimension sdim = calcCompSize(my_south, what); Dimension edim = calcCompSize(my_east, what); Dimension wdim = calcCompSize(my_west, what); Dimension cdim = calcCompSize(center, what); int width = edim.width + cdim.width + wdim.width + (hgap * 2); // check for overflow if (width < edim.width || width < cdim.width || width < cdim.width) width = Integer.MAX_VALUE; if (ndim.width > width) width = ndim.width; if (sdim.width > width) width = sdim.width; width += (ins.left + ins.right); int height = edim.height; if (cdim.height > height) height = cdim.height; if (wdim.height > height) height = wdim.height; int addedHeight = height + (ndim.height + sdim.height + (vgap * 2) + ins.top + ins.bottom); // check for overflow if (addedHeight < height) height = Integer.MAX_VALUE; else height = addedHeight; return(new Dimension(width, height)); }}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/BorderLayout.java/buggy/core/src/classpath/java/java/awt/BorderLayout.java
|
calcSize(Container target, int what){ synchronized (target.getTreeLock ()) { Insets ins = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_south = south; Component my_west = west; // Note that we currently don't handle vertical layouts. Neither // does JDK 1.3. if (firstLine != null) my_north = firstLine; if (lastLine != null) my_south = lastLine; if (firstItem != null) { if (left_to_right) my_west = firstItem; else my_east = firstItem; } if (lastItem != null) { if (left_to_right) my_east = lastItem; else my_west = lastItem; } Dimension ndim = calcCompSize(my_north, what); Dimension sdim = calcCompSize(my_south, what); Dimension edim = calcCompSize(my_east, what); Dimension wdim = calcCompSize(my_west, what); Dimension cdim = calcCompSize(center, what); int width = edim.width + cdim.width + wdim.width + (hgap * 2); // check for overflow if (width < edim.width || width < cdim.width || width < cdim.width) width = Integer.MAX_VALUE; if (ndim.width > width) width = ndim.width; if (sdim.width > width) width = sdim.width; width += (ins.left + ins.right); int height = edim.height; if (cdim.height > height) height = cdim.height; if (wdim.height > height) height = wdim.height; int addedHeight = height + (ndim.height + sdim.height + (vgap * 2) + ins.top + ins.bottom); // check for overflow if (addedHeight < height) height = Integer.MAX_VALUE; else height = addedHeight; return(new Dimension(width, height)); }}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/BorderLayout.java/buggy/core/src/classpath/java/java/awt/BorderLayout.java
|
||
calcSize(Container target, int what){ synchronized (target.getTreeLock ()) { Insets ins = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_south = south; Component my_west = west; // Note that we currently don't handle vertical layouts. Neither // does JDK 1.3. if (firstLine != null) my_north = firstLine; if (lastLine != null) my_south = lastLine; if (firstItem != null) { if (left_to_right) my_west = firstItem; else my_east = firstItem; } if (lastItem != null) { if (left_to_right) my_east = lastItem; else my_west = lastItem; } Dimension ndim = calcCompSize(my_north, what); Dimension sdim = calcCompSize(my_south, what); Dimension edim = calcCompSize(my_east, what); Dimension wdim = calcCompSize(my_west, what); Dimension cdim = calcCompSize(center, what); int width = edim.width + cdim.width + wdim.width + (hgap * 2); // check for overflow if (width < edim.width || width < cdim.width || width < cdim.width) width = Integer.MAX_VALUE; if (ndim.width > width) width = ndim.width; if (sdim.width > width) width = sdim.width; width += (ins.left + ins.right); int height = edim.height; if (cdim.height > height) height = cdim.height; if (wdim.height > height) height = wdim.height; int addedHeight = height + (ndim.height + sdim.height + (vgap * 2) + ins.top + ins.bottom); // check for overflow if (addedHeight < height) height = Integer.MAX_VALUE; else height = addedHeight; return(new Dimension(width, height)); }}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/BorderLayout.java/buggy/core/src/classpath/java/java/awt/BorderLayout.java
|
||
}
|
}
|
calcSize(Container target, int what){ synchronized (target.getTreeLock ()) { Insets ins = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_south = south; Component my_west = west; // Note that we currently don't handle vertical layouts. Neither // does JDK 1.3. if (firstLine != null) my_north = firstLine; if (lastLine != null) my_south = lastLine; if (firstItem != null) { if (left_to_right) my_west = firstItem; else my_east = firstItem; } if (lastItem != null) { if (left_to_right) my_east = lastItem; else my_west = lastItem; } Dimension ndim = calcCompSize(my_north, what); Dimension sdim = calcCompSize(my_south, what); Dimension edim = calcCompSize(my_east, what); Dimension wdim = calcCompSize(my_west, what); Dimension cdim = calcCompSize(center, what); int width = edim.width + cdim.width + wdim.width + (hgap * 2); // check for overflow if (width < edim.width || width < cdim.width || width < cdim.width) width = Integer.MAX_VALUE; if (ndim.width > width) width = ndim.width; if (sdim.width > width) width = sdim.width; width += (ins.left + ins.right); int height = edim.height; if (cdim.height > height) height = cdim.height; if (wdim.height > height) height = wdim.height; int addedHeight = height + (ndim.height + sdim.height + (vgap * 2) + ins.top + ins.bottom); // check for overflow if (addedHeight < height) height = Integer.MAX_VALUE; else height = addedHeight; return(new Dimension(width, height)); }}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/BorderLayout.java/buggy/core/src/classpath/java/java/awt/BorderLayout.java
|
getHgap() {
|
public int getHgap() {
|
getHgap(){ return(hgap);}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/BorderLayout.java/buggy/core/src/classpath/java/java/awt/BorderLayout.java
|
}
|
}
|
getHgap(){ return(hgap);}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/BorderLayout.java/buggy/core/src/classpath/java/java/awt/BorderLayout.java
|
getLayoutAlignmentX(Container parent) {
|
public float getLayoutAlignmentX(Container parent) {
|
getLayoutAlignmentX(Container parent){ return(parent.getAlignmentX());}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/BorderLayout.java/buggy/core/src/classpath/java/java/awt/BorderLayout.java
|
}
|
}
|
getLayoutAlignmentX(Container parent){ return(parent.getAlignmentX());}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/BorderLayout.java/buggy/core/src/classpath/java/java/awt/BorderLayout.java
|
getLayoutAlignmentY(Container parent) {
|
public float getLayoutAlignmentY(Container parent) {
|
getLayoutAlignmentY(Container parent){ return(parent.getAlignmentY());}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/BorderLayout.java/buggy/core/src/classpath/java/java/awt/BorderLayout.java
|
}
|
}
|
getLayoutAlignmentY(Container parent){ return(parent.getAlignmentY());}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/BorderLayout.java/buggy/core/src/classpath/java/java/awt/BorderLayout.java
|
getVgap() {
|
public int getVgap() {
|
getVgap(){ return(vgap);}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/BorderLayout.java/buggy/core/src/classpath/java/java/awt/BorderLayout.java
|
}
|
}
|
getVgap(){ return(vgap);}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/BorderLayout.java/buggy/core/src/classpath/java/java/awt/BorderLayout.java
|
invalidateLayout(Container parent) { }
|
public void invalidateLayout(Container parent) { }
|
invalidateLayout(Container parent){}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/BorderLayout.java/buggy/core/src/classpath/java/java/awt/BorderLayout.java
|
layoutContainer(Container target) {
|
public void layoutContainer(Container target) {
|
layoutContainer(Container target){ synchronized (target.getTreeLock ()) { Insets i = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_south = south; Component my_west = west; // Note that we currently don't handle vertical layouts. Neither // does JDK 1.3. if (firstLine != null) my_north = firstLine; if (lastLine != null) my_south = lastLine; if (firstItem != null) { if (left_to_right) my_west = firstItem; else my_east = firstItem; } if (lastItem != null) { if (left_to_right) my_east = lastItem; else my_west = lastItem; } Dimension c = calcCompSize(center, PREF); Dimension n = calcCompSize(my_north, PREF); Dimension s = calcCompSize(my_south, PREF); Dimension e = calcCompSize(my_east, PREF); Dimension w = calcCompSize(my_west, PREF); Dimension t = target.getSize(); /* <-> hgap <-> hgap +----------------------------+ } |t | } i.top | +----------------------+ | --- y1 } | |n | | | +----------------------+ | } vgap | +---+ +----------+ +---+ | --- y2 } } | |w | |c | |e | | } hh | +---+ +----------+ +---+ | } vgap } | +----------------------+ | --- y3 } | |s | | | +----------------------+ | } | | } i.bottom +----------------------------+ } |x1 |x2 |x3 <----------------------> <--> ww <--> i.left i.right */ int x1 = i.left; int x2 = x1 + w.width + (w.width == 0 ? 0 : hgap); int x3; if (t.width <= i.right + e.width) x3 = x2 + w.width + (w.width == 0 ? 0 : hgap); else x3 = t.width - i.right - e.width; int ww = t.width - i.right - i.left; int y1 = i.top; int y2 = y1 + n.height + (n.height == 0 ? 0 : vgap); int midh = Math.max(e.height, Math.max(w.height, c.height)); int y3; if (t.height <= i.bottom + s.height) y3 = y2 + midh + vgap; else y3 = t.height - i.bottom - s.height; int hh = y3-y2-(s.height == 0 ? 0 : vgap); setBounds(center, x2, y2, x3-x2-(w.width == 0 ? 0 : hgap), hh); setBounds(my_north, x1, y1, ww, n.height); setBounds(my_south, x1, y3, ww, s.height); setBounds(my_west, x1, y2, w.width, hh); setBounds(my_east, x3, y2, e.width, hh); }}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/BorderLayout.java/buggy/core/src/classpath/java/java/awt/BorderLayout.java
|
Dimension t = target.getSize();
|
int targetWidth = target.getWidth(); int targetHeight = target.getHeight();
|
layoutContainer(Container target){ synchronized (target.getTreeLock ()) { Insets i = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_south = south; Component my_west = west; // Note that we currently don't handle vertical layouts. Neither // does JDK 1.3. if (firstLine != null) my_north = firstLine; if (lastLine != null) my_south = lastLine; if (firstItem != null) { if (left_to_right) my_west = firstItem; else my_east = firstItem; } if (lastItem != null) { if (left_to_right) my_east = lastItem; else my_west = lastItem; } Dimension c = calcCompSize(center, PREF); Dimension n = calcCompSize(my_north, PREF); Dimension s = calcCompSize(my_south, PREF); Dimension e = calcCompSize(my_east, PREF); Dimension w = calcCompSize(my_west, PREF); Dimension t = target.getSize(); /* <-> hgap <-> hgap +----------------------------+ } |t | } i.top | +----------------------+ | --- y1 } | |n | | | +----------------------+ | } vgap | +---+ +----------+ +---+ | --- y2 } } | |w | |c | |e | | } hh | +---+ +----------+ +---+ | } vgap } | +----------------------+ | --- y3 } | |s | | | +----------------------+ | } | | } i.bottom +----------------------------+ } |x1 |x2 |x3 <----------------------> <--> ww <--> i.left i.right */ int x1 = i.left; int x2 = x1 + w.width + (w.width == 0 ? 0 : hgap); int x3; if (t.width <= i.right + e.width) x3 = x2 + w.width + (w.width == 0 ? 0 : hgap); else x3 = t.width - i.right - e.width; int ww = t.width - i.right - i.left; int y1 = i.top; int y2 = y1 + n.height + (n.height == 0 ? 0 : vgap); int midh = Math.max(e.height, Math.max(w.height, c.height)); int y3; if (t.height <= i.bottom + s.height) y3 = y2 + midh + vgap; else y3 = t.height - i.bottom - s.height; int hh = y3-y2-(s.height == 0 ? 0 : vgap); setBounds(center, x2, y2, x3-x2-(w.width == 0 ? 0 : hgap), hh); setBounds(my_north, x1, y1, ww, n.height); setBounds(my_south, x1, y3, ww, s.height); setBounds(my_west, x1, y2, w.width, hh); setBounds(my_east, x3, y2, e.width, hh); }}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/BorderLayout.java/buggy/core/src/classpath/java/java/awt/BorderLayout.java
|
if (t.width <= i.right + e.width)
|
if (targetWidth <= i.right + e.width)
|
layoutContainer(Container target){ synchronized (target.getTreeLock ()) { Insets i = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_south = south; Component my_west = west; // Note that we currently don't handle vertical layouts. Neither // does JDK 1.3. if (firstLine != null) my_north = firstLine; if (lastLine != null) my_south = lastLine; if (firstItem != null) { if (left_to_right) my_west = firstItem; else my_east = firstItem; } if (lastItem != null) { if (left_to_right) my_east = lastItem; else my_west = lastItem; } Dimension c = calcCompSize(center, PREF); Dimension n = calcCompSize(my_north, PREF); Dimension s = calcCompSize(my_south, PREF); Dimension e = calcCompSize(my_east, PREF); Dimension w = calcCompSize(my_west, PREF); Dimension t = target.getSize(); /* <-> hgap <-> hgap +----------------------------+ } |t | } i.top | +----------------------+ | --- y1 } | |n | | | +----------------------+ | } vgap | +---+ +----------+ +---+ | --- y2 } } | |w | |c | |e | | } hh | +---+ +----------+ +---+ | } vgap } | +----------------------+ | --- y3 } | |s | | | +----------------------+ | } | | } i.bottom +----------------------------+ } |x1 |x2 |x3 <----------------------> <--> ww <--> i.left i.right */ int x1 = i.left; int x2 = x1 + w.width + (w.width == 0 ? 0 : hgap); int x3; if (t.width <= i.right + e.width) x3 = x2 + w.width + (w.width == 0 ? 0 : hgap); else x3 = t.width - i.right - e.width; int ww = t.width - i.right - i.left; int y1 = i.top; int y2 = y1 + n.height + (n.height == 0 ? 0 : vgap); int midh = Math.max(e.height, Math.max(w.height, c.height)); int y3; if (t.height <= i.bottom + s.height) y3 = y2 + midh + vgap; else y3 = t.height - i.bottom - s.height; int hh = y3-y2-(s.height == 0 ? 0 : vgap); setBounds(center, x2, y2, x3-x2-(w.width == 0 ? 0 : hgap), hh); setBounds(my_north, x1, y1, ww, n.height); setBounds(my_south, x1, y3, ww, s.height); setBounds(my_west, x1, y2, w.width, hh); setBounds(my_east, x3, y2, e.width, hh); }}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/BorderLayout.java/buggy/core/src/classpath/java/java/awt/BorderLayout.java
|
x3 = t.width - i.right - e.width; int ww = t.width - i.right - i.left;
|
x3 = targetWidth - i.right - e.width; int ww = targetWidth - i.right - i.left;
|
layoutContainer(Container target){ synchronized (target.getTreeLock ()) { Insets i = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_south = south; Component my_west = west; // Note that we currently don't handle vertical layouts. Neither // does JDK 1.3. if (firstLine != null) my_north = firstLine; if (lastLine != null) my_south = lastLine; if (firstItem != null) { if (left_to_right) my_west = firstItem; else my_east = firstItem; } if (lastItem != null) { if (left_to_right) my_east = lastItem; else my_west = lastItem; } Dimension c = calcCompSize(center, PREF); Dimension n = calcCompSize(my_north, PREF); Dimension s = calcCompSize(my_south, PREF); Dimension e = calcCompSize(my_east, PREF); Dimension w = calcCompSize(my_west, PREF); Dimension t = target.getSize(); /* <-> hgap <-> hgap +----------------------------+ } |t | } i.top | +----------------------+ | --- y1 } | |n | | | +----------------------+ | } vgap | +---+ +----------+ +---+ | --- y2 } } | |w | |c | |e | | } hh | +---+ +----------+ +---+ | } vgap } | +----------------------+ | --- y3 } | |s | | | +----------------------+ | } | | } i.bottom +----------------------------+ } |x1 |x2 |x3 <----------------------> <--> ww <--> i.left i.right */ int x1 = i.left; int x2 = x1 + w.width + (w.width == 0 ? 0 : hgap); int x3; if (t.width <= i.right + e.width) x3 = x2 + w.width + (w.width == 0 ? 0 : hgap); else x3 = t.width - i.right - e.width; int ww = t.width - i.right - i.left; int y1 = i.top; int y2 = y1 + n.height + (n.height == 0 ? 0 : vgap); int midh = Math.max(e.height, Math.max(w.height, c.height)); int y3; if (t.height <= i.bottom + s.height) y3 = y2 + midh + vgap; else y3 = t.height - i.bottom - s.height; int hh = y3-y2-(s.height == 0 ? 0 : vgap); setBounds(center, x2, y2, x3-x2-(w.width == 0 ? 0 : hgap), hh); setBounds(my_north, x1, y1, ww, n.height); setBounds(my_south, x1, y3, ww, s.height); setBounds(my_west, x1, y2, w.width, hh); setBounds(my_east, x3, y2, e.width, hh); }}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/BorderLayout.java/buggy/core/src/classpath/java/java/awt/BorderLayout.java
|
if (t.height <= i.bottom + s.height)
|
if (targetHeight <= i.bottom + s.height)
|
layoutContainer(Container target){ synchronized (target.getTreeLock ()) { Insets i = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_south = south; Component my_west = west; // Note that we currently don't handle vertical layouts. Neither // does JDK 1.3. if (firstLine != null) my_north = firstLine; if (lastLine != null) my_south = lastLine; if (firstItem != null) { if (left_to_right) my_west = firstItem; else my_east = firstItem; } if (lastItem != null) { if (left_to_right) my_east = lastItem; else my_west = lastItem; } Dimension c = calcCompSize(center, PREF); Dimension n = calcCompSize(my_north, PREF); Dimension s = calcCompSize(my_south, PREF); Dimension e = calcCompSize(my_east, PREF); Dimension w = calcCompSize(my_west, PREF); Dimension t = target.getSize(); /* <-> hgap <-> hgap +----------------------------+ } |t | } i.top | +----------------------+ | --- y1 } | |n | | | +----------------------+ | } vgap | +---+ +----------+ +---+ | --- y2 } } | |w | |c | |e | | } hh | +---+ +----------+ +---+ | } vgap } | +----------------------+ | --- y3 } | |s | | | +----------------------+ | } | | } i.bottom +----------------------------+ } |x1 |x2 |x3 <----------------------> <--> ww <--> i.left i.right */ int x1 = i.left; int x2 = x1 + w.width + (w.width == 0 ? 0 : hgap); int x3; if (t.width <= i.right + e.width) x3 = x2 + w.width + (w.width == 0 ? 0 : hgap); else x3 = t.width - i.right - e.width; int ww = t.width - i.right - i.left; int y1 = i.top; int y2 = y1 + n.height + (n.height == 0 ? 0 : vgap); int midh = Math.max(e.height, Math.max(w.height, c.height)); int y3; if (t.height <= i.bottom + s.height) y3 = y2 + midh + vgap; else y3 = t.height - i.bottom - s.height; int hh = y3-y2-(s.height == 0 ? 0 : vgap); setBounds(center, x2, y2, x3-x2-(w.width == 0 ? 0 : hgap), hh); setBounds(my_north, x1, y1, ww, n.height); setBounds(my_south, x1, y3, ww, s.height); setBounds(my_west, x1, y2, w.width, hh); setBounds(my_east, x3, y2, e.width, hh); }}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/BorderLayout.java/buggy/core/src/classpath/java/java/awt/BorderLayout.java
|
y3 = t.height - i.bottom - s.height;
|
y3 = targetHeight - i.bottom - s.height;
|
layoutContainer(Container target){ synchronized (target.getTreeLock ()) { Insets i = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_south = south; Component my_west = west; // Note that we currently don't handle vertical layouts. Neither // does JDK 1.3. if (firstLine != null) my_north = firstLine; if (lastLine != null) my_south = lastLine; if (firstItem != null) { if (left_to_right) my_west = firstItem; else my_east = firstItem; } if (lastItem != null) { if (left_to_right) my_east = lastItem; else my_west = lastItem; } Dimension c = calcCompSize(center, PREF); Dimension n = calcCompSize(my_north, PREF); Dimension s = calcCompSize(my_south, PREF); Dimension e = calcCompSize(my_east, PREF); Dimension w = calcCompSize(my_west, PREF); Dimension t = target.getSize(); /* <-> hgap <-> hgap +----------------------------+ } |t | } i.top | +----------------------+ | --- y1 } | |n | | | +----------------------+ | } vgap | +---+ +----------+ +---+ | --- y2 } } | |w | |c | |e | | } hh | +---+ +----------+ +---+ | } vgap } | +----------------------+ | --- y3 } | |s | | | +----------------------+ | } | | } i.bottom +----------------------------+ } |x1 |x2 |x3 <----------------------> <--> ww <--> i.left i.right */ int x1 = i.left; int x2 = x1 + w.width + (w.width == 0 ? 0 : hgap); int x3; if (t.width <= i.right + e.width) x3 = x2 + w.width + (w.width == 0 ? 0 : hgap); else x3 = t.width - i.right - e.width; int ww = t.width - i.right - i.left; int y1 = i.top; int y2 = y1 + n.height + (n.height == 0 ? 0 : vgap); int midh = Math.max(e.height, Math.max(w.height, c.height)); int y3; if (t.height <= i.bottom + s.height) y3 = y2 + midh + vgap; else y3 = t.height - i.bottom - s.height; int hh = y3-y2-(s.height == 0 ? 0 : vgap); setBounds(center, x2, y2, x3-x2-(w.width == 0 ? 0 : hgap), hh); setBounds(my_north, x1, y1, ww, n.height); setBounds(my_south, x1, y3, ww, s.height); setBounds(my_west, x1, y2, w.width, hh); setBounds(my_east, x3, y2, e.width, hh); }}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/BorderLayout.java/buggy/core/src/classpath/java/java/awt/BorderLayout.java
|
}
|
}
|
layoutContainer(Container target){ synchronized (target.getTreeLock ()) { Insets i = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_south = south; Component my_west = west; // Note that we currently don't handle vertical layouts. Neither // does JDK 1.3. if (firstLine != null) my_north = firstLine; if (lastLine != null) my_south = lastLine; if (firstItem != null) { if (left_to_right) my_west = firstItem; else my_east = firstItem; } if (lastItem != null) { if (left_to_right) my_east = lastItem; else my_west = lastItem; } Dimension c = calcCompSize(center, PREF); Dimension n = calcCompSize(my_north, PREF); Dimension s = calcCompSize(my_south, PREF); Dimension e = calcCompSize(my_east, PREF); Dimension w = calcCompSize(my_west, PREF); Dimension t = target.getSize(); /* <-> hgap <-> hgap +----------------------------+ } |t | } i.top | +----------------------+ | --- y1 } | |n | | | +----------------------+ | } vgap | +---+ +----------+ +---+ | --- y2 } } | |w | |c | |e | | } hh | +---+ +----------+ +---+ | } vgap } | +----------------------+ | --- y3 } | |s | | | +----------------------+ | } | | } i.bottom +----------------------------+ } |x1 |x2 |x3 <----------------------> <--> ww <--> i.left i.right */ int x1 = i.left; int x2 = x1 + w.width + (w.width == 0 ? 0 : hgap); int x3; if (t.width <= i.right + e.width) x3 = x2 + w.width + (w.width == 0 ? 0 : hgap); else x3 = t.width - i.right - e.width; int ww = t.width - i.right - i.left; int y1 = i.top; int y2 = y1 + n.height + (n.height == 0 ? 0 : vgap); int midh = Math.max(e.height, Math.max(w.height, c.height)); int y3; if (t.height <= i.bottom + s.height) y3 = y2 + midh + vgap; else y3 = t.height - i.bottom - s.height; int hh = y3-y2-(s.height == 0 ? 0 : vgap); setBounds(center, x2, y2, x3-x2-(w.width == 0 ? 0 : hgap), hh); setBounds(my_north, x1, y1, ww, n.height); setBounds(my_south, x1, y3, ww, s.height); setBounds(my_west, x1, y2, w.width, hh); setBounds(my_east, x3, y2, e.width, hh); }}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/BorderLayout.java/buggy/core/src/classpath/java/java/awt/BorderLayout.java
|
maximumLayoutSize(Container target) {
|
public Dimension maximumLayoutSize(Container target) {
|
maximumLayoutSize(Container target){ return calcSize(target, MAX);}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/BorderLayout.java/buggy/core/src/classpath/java/java/awt/BorderLayout.java
|
}
|
}
|
maximumLayoutSize(Container target){ return calcSize(target, MAX);}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/BorderLayout.java/buggy/core/src/classpath/java/java/awt/BorderLayout.java
|
minimumLayoutSize(Container target) {
|
public Dimension minimumLayoutSize(Container target) {
|
minimumLayoutSize(Container target){ return calcSize(target, MIN);}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/BorderLayout.java/buggy/core/src/classpath/java/java/awt/BorderLayout.java
|
}
|
}
|
minimumLayoutSize(Container target){ return calcSize(target, MIN);}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/BorderLayout.java/buggy/core/src/classpath/java/java/awt/BorderLayout.java
|
preferredLayoutSize(Container target) {
|
public Dimension preferredLayoutSize(Container target) {
|
preferredLayoutSize(Container target){ return calcSize(target, PREF);}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/BorderLayout.java/buggy/core/src/classpath/java/java/awt/BorderLayout.java
|
}
|
}
|
preferredLayoutSize(Container target){ return calcSize(target, PREF);}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/BorderLayout.java/buggy/core/src/classpath/java/java/awt/BorderLayout.java
|
removeLayoutComponent(Component component) {
|
public void removeLayoutComponent(Component component) {
|
removeLayoutComponent(Component component){ if (north == component) north = null; if (south == component) south = null; if (east == component) east = null; if (west == component) west = null; if (center == component) center = null; if (firstItem == component) firstItem = null; if (lastItem == component) lastItem = null; if (firstLine == component) firstLine = null; if (lastLine == component) lastLine = null;}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/BorderLayout.java/buggy/core/src/classpath/java/java/awt/BorderLayout.java
|
}
|
}
|
removeLayoutComponent(Component component){ if (north == component) north = null; if (south == component) south = null; if (east == component) east = null; if (west == component) west = null; if (center == component) center = null; if (firstItem == component) firstItem = null; if (lastItem == component) lastItem = null; if (firstLine == component) firstLine = null; if (lastLine == component) lastLine = null;}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/BorderLayout.java/buggy/core/src/classpath/java/java/awt/BorderLayout.java
|
setBounds(Component comp, int x, int y, int w, int h) {
|
private void setBounds(Component comp, int x, int y, int w, int h) {
|
setBounds(Component comp, int x, int y, int w, int h){ if (comp == null) return; comp.setBounds(x, y, w, h);}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/BorderLayout.java/buggy/core/src/classpath/java/java/awt/BorderLayout.java
|
}
|
}
|
setBounds(Component comp, int x, int y, int w, int h){ if (comp == null) return; comp.setBounds(x, y, w, h);}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/BorderLayout.java/buggy/core/src/classpath/java/java/awt/BorderLayout.java
|
setHgap(int hgap) {
|
public void setHgap(int hgap) {
|
setHgap(int hgap){ this.hgap = hgap;}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/BorderLayout.java/buggy/core/src/classpath/java/java/awt/BorderLayout.java
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.