rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
repaint();
calculateVisibility();
public void internalFrameDeiconified(InternalFrameEvent e) {// displayMessage("Internal frame deiconified", e); 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 internalFrameIconified(InternalFrameEvent e) {// displayMessage("Internal frame iconified", 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 void internalFrameOpened(InternalFrameEvent e) {// displayMessage("Internal frame opened", e); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/54b8440b9e00d642deced8c7a38ca282d1727dbd/Gui5250MDIFrame.java/clean/tn5250j/src/org/tn5250j/Gui5250MDIFrame.java
private void disconnectMe() { Session s = (Session)getContentPane(); me.closeSession(s);// this.setVisible(false);// disconnectMe(s); }
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 addSessionView(String tabText,Session session) { MyInternalFrame frame = new MyInternalFrame(); frame.setVisible(true); desktop.add(frame); myFrameList.add(frame); selectedIndex = desktop.getComponentCount(); frame.setContentPane(session); try { frame.setSelected(true); } catch (java.beans.PropertyVetoException e) {} session.addSessionListener(this); session.addSessionJumpListener(this); try { frame.setMaximum(true); } catch (java.beans.PropertyVetoException pve) { System.out.println("Can not set maximum " + pve.getMessage()); } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/54b8440b9e00d642deced8c7a38ca282d1727dbd/Gui5250MDIFrame.java/clean/tn5250j/src/org/tn5250j/Gui5250MDIFrame.java
if (mif.isIcon()) mif.setIcon(false);
private void nextSession() { MyInternalFrame mif = getNextInternalFrame(); if (mif != null) { try { mif.setSelected(true); if (mif.isIcon()) mif.setIcon(false); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } }// System.out.println(" current index " + index + " count " + desktop.getComponentCount()); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/54b8440b9e00d642deced8c7a38ca282d1727dbd/Gui5250MDIFrame.java/clean/tn5250j/src/org/tn5250j/Gui5250MDIFrame.java
System.out.println(" index of session " + index + " num frames " + desktop.getAllFrames().length);
public void onSessionChanged(SessionChangeEvent changeEvent) { Session ses = (Session)changeEvent.getSource(); switch (changeEvent.getState()) { case STATE_CONNECTED: final String d = ses.getAllocDeviceName(); if (d != null) { System.out.println(changeEvent.getState() + " " + d); final int index = getIndexOfSession(ses); System.out.println(" index of session " + index + " num frames " + desktop.getAllFrames().length); if (index == -1) return; Runnable tc = new Runnable () { public void run() { JInternalFrame[] frames = desktop.getAllFrames(); frames[index].setTitle(frames[index].getTitle() + " " + d); } }; SwingUtilities.invokeLater(tc); } break; } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/54b8440b9e00d642deced8c7a38ca282d1727dbd/Gui5250MDIFrame.java/clean/tn5250j/src/org/tn5250j/Gui5250MDIFrame.java
frames[index].setTitle(frames[index].getTitle() + " " + d);
int id = ((MyInternalFrame)frames[index]).getInternalId(); frames[index].setTitle("#" + id + " " + d);
public void onSessionChanged(SessionChangeEvent changeEvent) { Session ses = (Session)changeEvent.getSource(); switch (changeEvent.getState()) { case STATE_CONNECTED: final String d = ses.getAllocDeviceName(); if (d != null) { System.out.println(changeEvent.getState() + " " + d); final int index = getIndexOfSession(ses); System.out.println(" index of session " + index + " num frames " + desktop.getAllFrames().length); if (index == -1) return; Runnable tc = new Runnable () { public void run() { JInternalFrame[] frames = desktop.getAllFrames(); frames[index].setTitle(frames[index].getTitle() + " " + d); } }; SwingUtilities.invokeLater(tc); } break; } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/54b8440b9e00d642deced8c7a38ca282d1727dbd/Gui5250MDIFrame.java/clean/tn5250j/src/org/tn5250j/Gui5250MDIFrame.java
frames[index].setTitle(frames[index].getTitle() + " " + d);
int id = ((MyInternalFrame)frames[index]).getInternalId(); frames[index].setTitle("#" + id + " " + d);
public void run() { JInternalFrame[] frames = desktop.getAllFrames(); frames[index].setTitle(frames[index].getTitle() + " " + d); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/54b8440b9e00d642deced8c7a38ca282d1727dbd/Gui5250MDIFrame.java/clean/tn5250j/src/org/tn5250j/Gui5250MDIFrame.java
((MyInternalFrame)myFrameList.get(index)).setSelected(true); if (((MyInternalFrame)myFrameList.get(index)).isIcon()) ((MyInternalFrame)myFrameList.get(index)).setIcon(false);
MyInternalFrame mif = (MyInternalFrame)myFrameList.get(index); if (mif.isIcon()) { mif.setIcon(false); } mif.setSelected(true);
private void prevSession() { JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); JInternalFrame miv = desktop.getSelectedFrame(); if (miv == null) return; int index = desktop.getIndexOf(miv); if (index == -1) return; MyInternalFrame mix = (MyInternalFrame)frames[index]; int seq = mix.getInternalId(); index = 0; for (int x = 0; x < myFrameList.size(); x++) { MyInternalFrame mif = (MyInternalFrame)myFrameList.get(x);// System.out.println(" current index " + x + " count " + frames.length + " has focus " +// mif.isActive() + " title " + mif.getTitle() + " seq " + seq +// " id " + mif.getInternalId()); if (mix.equals(mif)) { index = x - 1; break; } } if (index < 0) { index = myFrameList.size() - 1; } try { ((MyInternalFrame)myFrameList.get(index)).setSelected(true); if (((MyInternalFrame)myFrameList.get(index)).isIcon()) ((MyInternalFrame)myFrameList.get(index)).setIcon(false); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); }// System.out.println(" current index " + index + " count " + desktop.getComponentCount()); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/54b8440b9e00d642deced8c7a38ca282d1727dbd/Gui5250MDIFrame.java/clean/tn5250j/src/org/tn5250j/Gui5250MDIFrame.java
if (!workStroke.equals(ke)) { workStroke.setAttributes(ke); lastKeyMnemonic = (String)mappedKeys.get(workStroke); } return lastKeyMnemonic;
return getKeyStrokeText(ke,false);
public final static String getKeyStrokeText(KeyEvent ke) { if (!workStroke.equals(ke)) { workStroke.setAttributes(ke); lastKeyMnemonic = (String)mappedKeys.get(workStroke); } return lastKeyMnemonic; }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/ea2c66f65284397fa600153ac59eb3c719efca18/KeyMapper.java/clean/tn5250j/src/org/tn5250j/tools/KeyMapper.java
protected RemoteServer() {
protected RemoteServer() {
protected RemoteServer() { super();}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/RemoteServer.java/buggy/core/src/classpath/java/java/rmi/server/RemoteServer.java
}
}
protected RemoteServer() { super();}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/RemoteServer.java/buggy/core/src/classpath/java/java/rmi/server/RemoteServer.java
public static String getClientHost() throws ServerNotActiveException {
public static String getClientHost() throws ServerNotActiveException {
public static String getClientHost() throws ServerNotActiveException { Thread currThread = Thread.currentThread(); if (currThread instanceof RMIIncomingThread) { RMIIncomingThread incomingThread = (RMIIncomingThread) currThread; return incomingThread.getClientHost(); } else { throw new ServerNotActiveException( "Unknown client host - current thread not instance of 'RMIIncomingThread'"); }}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/RemoteServer.java/buggy/core/src/classpath/java/java/rmi/server/RemoteServer.java
if (currThread instanceof RMIIncomingThread) {
if (currThread instanceof RMIIncomingThread) {
public static String getClientHost() throws ServerNotActiveException { Thread currThread = Thread.currentThread(); if (currThread instanceof RMIIncomingThread) { RMIIncomingThread incomingThread = (RMIIncomingThread) currThread; return incomingThread.getClientHost(); } else { throw new ServerNotActiveException( "Unknown client host - current thread not instance of 'RMIIncomingThread'"); }}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/RemoteServer.java/buggy/core/src/classpath/java/java/rmi/server/RemoteServer.java
} else {
} else {
public static String getClientHost() throws ServerNotActiveException { Thread currThread = Thread.currentThread(); if (currThread instanceof RMIIncomingThread) { RMIIncomingThread incomingThread = (RMIIncomingThread) currThread; return incomingThread.getClientHost(); } else { throw new ServerNotActiveException( "Unknown client host - current thread not instance of 'RMIIncomingThread'"); }}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/RemoteServer.java/buggy/core/src/classpath/java/java/rmi/server/RemoteServer.java
}
}
public static String getClientHost() throws ServerNotActiveException { Thread currThread = Thread.currentThread(); if (currThread instanceof RMIIncomingThread) { RMIIncomingThread incomingThread = (RMIIncomingThread) currThread; return incomingThread.getClientHost(); } else { throw new ServerNotActiveException( "Unknown client host - current thread not instance of 'RMIIncomingThread'"); }}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/RemoteServer.java/buggy/core/src/classpath/java/java/rmi/server/RemoteServer.java
public static PrintStream getLog() {
public static PrintStream getLog() {
public static PrintStream getLog() { throw new Error("Not implemented");}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/RemoteServer.java/buggy/core/src/classpath/java/java/rmi/server/RemoteServer.java
}
}
public static PrintStream getLog() { throw new Error("Not implemented");}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/RemoteServer.java/buggy/core/src/classpath/java/java/rmi/server/RemoteServer.java
public static void setLog(OutputStream out) {
public static void setLog(OutputStream out) {
public static void setLog(OutputStream out) { throw new Error("Not implemented");}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/RemoteServer.java/buggy/core/src/classpath/java/java/rmi/server/RemoteServer.java
}
}
public static void setLog(OutputStream out) { throw new Error("Not implemented");}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/RemoteServer.java/buggy/core/src/classpath/java/java/rmi/server/RemoteServer.java
settings.setProperty("emulator.settingsDirectory", System.getProperty("user.home") + File.separator + ".tn5250j" + File.separator);
private void checkLegacy() { // we check if the sessions file already exists in the directory // if it does exist we are working with an old install so we // need to set the settings directory to the users directory // SESSIONS is declared as a string, so we just can use the keyword here. if(ses.exists()) { int cfc; cfc = JOptionPane.showConfirmDialog(null, "Dear User,\n\n" + "Seems you are using an old version of tn5250j.\n" + "In meanwhile the application became multi-user capable,\n" + "which means ALL the config- and settings-files are\n" + "placed in your home-dir to avoid further problems in\n" + "the near future.\n\n" + "You have the choice to choose if you want the files\n" + "to be copied or not, please make your choice !\n\n" + "Shall we copy the files to the new location ?", "Old install detected", JOptionPane.WARNING_MESSAGE, JOptionPane.YES_NO_OPTION); if (cfc == 0) { settings.setProperty("emulator.settingsDirectory", System.getProperty("user.home") + File.separator + ".tn5250j" + File.separator); // Here we do a checkdir so we know the destination-dir exists checkDirs(); copyConfigs(SESSIONS); copyConfigs(MACROS); copyConfigs(KEYMAP); } else { JOptionPane.showMessageDialog(null, "Dear User,\n\n" + "You choosed not to copy the file.\n" + "This means the program will end here.\n\n" + "To use this NON-STANDARD behaviour start tn5250j\n" + "with -Demulator.settingsDirectory=<settings-dir> \n" + "as a parameter to avoid this question all the time.", "Using NON-STANDARD behaviour", JOptionPane.WARNING_MESSAGE); System.exit(0); } } else { settings.setProperty("emulator.settingsDirectory", System.getProperty("user.home") + File.separator + ".tn5250j" + File.separator); System.out.println("User Home = " + System.getProperty("user.home")); } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/bd4d9c4e863f49ac1fb9be3c8307ce53eb685185/GlobalConfigure.java/buggy/tn5250j/src/org/tn5250j/GlobalConfigure.java
else { settings.setProperty("emulator.settingsDirectory", System.getProperty("user.home") + File.separator + ".tn5250j" + File.separator); System.out.println("User Home = " + System.getProperty("user.home")); }
private void checkLegacy() { // we check if the sessions file already exists in the directory // if it does exist we are working with an old install so we // need to set the settings directory to the users directory // SESSIONS is declared as a string, so we just can use the keyword here. if(ses.exists()) { int cfc; cfc = JOptionPane.showConfirmDialog(null, "Dear User,\n\n" + "Seems you are using an old version of tn5250j.\n" + "In meanwhile the application became multi-user capable,\n" + "which means ALL the config- and settings-files are\n" + "placed in your home-dir to avoid further problems in\n" + "the near future.\n\n" + "You have the choice to choose if you want the files\n" + "to be copied or not, please make your choice !\n\n" + "Shall we copy the files to the new location ?", "Old install detected", JOptionPane.WARNING_MESSAGE, JOptionPane.YES_NO_OPTION); if (cfc == 0) { settings.setProperty("emulator.settingsDirectory", System.getProperty("user.home") + File.separator + ".tn5250j" + File.separator); // Here we do a checkdir so we know the destination-dir exists checkDirs(); copyConfigs(SESSIONS); copyConfigs(MACROS); copyConfigs(KEYMAP); } else { JOptionPane.showMessageDialog(null, "Dear User,\n\n" + "You choosed not to copy the file.\n" + "This means the program will end here.\n\n" + "To use this NON-STANDARD behaviour start tn5250j\n" + "with -Demulator.settingsDirectory=<settings-dir> \n" + "as a parameter to avoid this question all the time.", "Using NON-STANDARD behaviour", JOptionPane.WARNING_MESSAGE); System.exit(0); } } else { settings.setProperty("emulator.settingsDirectory", System.getProperty("user.home") + File.separator + ".tn5250j" + File.separator); System.out.println("User Home = " + System.getProperty("user.home")); } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/bd4d9c4e863f49ac1fb9be3c8307ce53eb685185/GlobalConfigure.java/buggy/tn5250j/src/org/tn5250j/GlobalConfigure.java
again = new FileInputStream(System.getProperty("user.home") + File.separator + ".tn5250j" + File.separator + settingsFile);
again = new FileInputStream(settingsDirectory() + settingsFile);
private void loadSettings() { FileInputStream in = null; FileInputStream again = null; settings = new Properties(); // here we will check for a system property is provided first. if (System.getProperties().containsKey("emulator.settingsDirectory")) { settings.setProperty("emulator.settingsDirectory", System.getProperty("emulator.settingsDirectory") + File.separator); checkDirs(); } else { try { in = new FileInputStream(settingsFile); settings.load(in); } catch (FileNotFoundException fnfe) { try { again = new FileInputStream(System.getProperty("user.home") + File.separator + ".tn5250j" + File.separator + settingsFile); settings.load(again); } catch (FileNotFoundException fnfea) { System.out.println(" Information Message: " + fnfea.getMessage() + ". The file " + settingsFile + " will be created for first time use."); checkLegacy(); saveSettings(); } catch (IOException ioea) { System.out.println("IO Exception accessing File " + settingsFile + " for the following reason : " + ioea.getMessage()); } catch (SecurityException sea) { System.out.println("Security Exception for file " + settingsFile + " This file can not be " + "accessed because : " + sea.getMessage()); } } catch (IOException ioe) { System.out.println("IO Exception accessing File " + settingsFile + " for the following reason : " + ioe.getMessage()); } catch (SecurityException se) { System.out.println("Security Exception for file " + settingsFile + " This file can not be " + "accessed because : " + se.getMessage()); } } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/bd4d9c4e863f49ac1fb9be3c8307ce53eb685185/GlobalConfigure.java/buggy/tn5250j/src/org/tn5250j/GlobalConfigure.java
FileOutputStream out = new FileOutputStream(settingsFile);
FileOutputStream out = new FileOutputStream(settingsDirectory() + settingsFile);
public void saveSettings() { try { FileOutputStream out = new FileOutputStream(settingsFile); settings.store(out,"----------------- tn5250j Global Settings --------------"); } catch (FileNotFoundException fnfe) {} catch (IOException ioe) {} }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/bd4d9c4e863f49ac1fb9be3c8307ce53eb685185/GlobalConfigure.java/buggy/tn5250j/src/org/tn5250j/GlobalConfigure.java
super(in);
this.in = in;
public ChunkedInputStream(InputStream in, Headers headers) { super(in); this.headers = headers; size = -1; count = 0; meta = true; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/eea27f084742358ddb097f7118c05cd257029453/ChunkedInputStream.java/buggy/core/src/classpath/gnu/gnu/java/net/protocol/http/ChunkedInputStream.java
throw new IllegalArgumentException();
throw new IllegalArgumentException(titleJustification + " is not a valid title justification.");
public void setTitleJustification(int titleJustification) { if ((titleJustification < DEFAULT_JUSTIFICATION) || (titleJustification > TRAILING)) throw new IllegalArgumentException(); // Swing borders are not JavaBeans, thus no need to fire an event. this.titleJustification = titleJustification; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/TitledBorder.java/clean/core/src/classpath/javax/javax/swing/border/TitledBorder.java
throw new IllegalArgumentException();
throw new IllegalArgumentException(titlePosition + " is not a valid title position.");
public void setTitlePosition(int titlePosition) { if ((titlePosition < DEFAULT_POSITION) || (titlePosition > BELOW_BOTTOM)) throw new IllegalArgumentException(); // Swing borders are not JavaBeans, thus no need to fire an event. this.titlePosition = titlePosition; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/TitledBorder.java/clean/core/src/classpath/javax/javax/swing/border/TitledBorder.java
if ((event.getPropertyName()).equals("rootVisible")) { validCachedPreferredSize = false; updateCurrentVisiblePath(); tree.revalidate(); tree.repaint(); }
public void propertyChange(PropertyChangeEvent event) { // TODO: What should be done here, if anything? }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4f54b4c49f6326d2bfe26573a0af55c73b713f0a/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
if (i-1 > 0)
if (i-1 >= 0)
Object getPreviousVisibleNode(Object node) { if (currentVisiblePath != null) { Object[] nodes = currentVisiblePath.getPath(); int i = 0; while (i < nodes.length && !node.equals(nodes[i])) i++; // return the next node if (i-1 > 0) return nodes[i-1]; } return null; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4f54b4c49f6326d2bfe26573a0af55c73b713f0a/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
updateCurrentVisiblePath();
public int getRowCount(JTree tree) { if (currentVisiblePath != null) return currentVisiblePath.getPathCount(); return 0; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4f54b4c49f6326d2bfe26573a0af55c73b713f0a/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
if (treeModel != null)
if (currentVisiblePath != null && treeModel != null)
public void paint(Graphics g, JComponent c) { JTree tree = (JTree) c; if (currentVisiblePath == null) updateCurrentVisiblePath(); if (treeModel != null) { Object root = treeModel.getRoot(); paintRecursive(g, 0, 0, 0, tree, treeModel, root); if (hasControlIcons()) paintControlIcons(g, 0, 0, 0, tree, treeModel, root); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4f54b4c49f6326d2bfe26573a0af55c73b713f0a/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
if (tree.isVisible(new TreePath(getPathToRoot(child, 0))))
int paintControlIcons(Graphics g, int indentation, int descent, int depth, JTree tree, TreeModel mod, Object node) { int rowHeight = getRowHeight(); TreePath path = new TreePath(getPathToRoot(node, 0)); Icon icon = getCurrentControlIcon(path); Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; if (mod.isLeaf(node)) descent += rowHeight; else { if (!node.equals(mod.getRoot()) && (tree.isRootVisible() || getLevel(node) != 1)) { int width = icon.getIconWidth(); int height = icon.getIconHeight() + 2; int posX = indentation - rightChildIndent; int posY = descent; if (width > rightChildIndent) posX -= gap; else posX += width/2; if (height < rowHeight) posY += height/2; icon.paintIcon(tree, g, posX, posY); } if (depth > 0 || tree.isRootVisible()) descent += rowHeight; if (tree.isExpanded(path)) { int max = 0; if (!mod.isLeaf(node)) max = mod.getChildCount(node); for (int i = 0; i < max; i++) { int indent = indentation + rightChildIndent; if (depth == 0 && !tree.isRootVisible()) indent = 1; descent = paintControlIcons(g, indent, descent, depth + 1, tree, mod, mod.getChild(node, i)); } } } return descent; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4f54b4c49f6326d2bfe26573a0af55c73b713f0a/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
tree, mod, mod.getChild(node, i));
tree, mod, child);
int paintControlIcons(Graphics g, int indentation, int descent, int depth, JTree tree, TreeModel mod, Object node) { int rowHeight = getRowHeight(); TreePath path = new TreePath(getPathToRoot(node, 0)); Icon icon = getCurrentControlIcon(path); Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; if (mod.isLeaf(node)) descent += rowHeight; else { if (!node.equals(mod.getRoot()) && (tree.isRootVisible() || getLevel(node) != 1)) { int width = icon.getIconWidth(); int height = icon.getIconHeight() + 2; int posX = indentation - rightChildIndent; int posY = descent; if (width > rightChildIndent) posX -= gap; else posX += width/2; if (height < rowHeight) posY += height/2; icon.paintIcon(tree, g, posX, posY); } if (depth > 0 || tree.isRootVisible()) descent += rowHeight; if (tree.isExpanded(path)) { int max = 0; if (!mod.isLeaf(node)) max = mod.getChildCount(node); for (int i = 0; i < max; i++) { int indent = indentation + rightChildIndent; if (depth == 0 && !tree.isRootVisible()) indent = 1; descent = paintControlIcons(g, indent, descent, depth + 1, tree, mod, mod.getChild(node, i)); } } } return descent; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4f54b4c49f6326d2bfe26573a0af55c73b713f0a/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
(!isRootVisible && !curr.equals(root)))
(!isRootVisible && !curr.equals(root)) && childVis)
int paintRecursive(Graphics g, int indentation, int descent, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; TreePath path = new TreePath(getPathToRoot(curr, 0)); int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; int heightOfLine = descent + halfHeight; int row = getRowForPath(tree, path); boolean isRootVisible = tree.isRootVisible(); boolean isExpanded = tree.isExpanded(path); boolean isLeaf = mod.isLeaf(curr); Rectangle bounds = getPathBounds(tree, path); Object root = mod.getRoot(); if (isLeaf) { paintRow(g, clip, null, bounds, path, row, true, false, true); descent += getRowHeight(); } else { if (depth > 0 || isRootVisible) { paintRow(g, clip, null, bounds, path, row, isExpanded, false, false); descent += getRowHeight(); y0 += halfHeight; } if (isExpanded) { int max = mod.getChildCount(curr); for (int i = 0; i < max; i++) { int indent = indentation + rightChildIndent; if (!isRootVisible && depth == 0) indent = 0; else if (isRootVisible || (!isRootVisible && !curr.equals(root))) { g.setColor(getHashColor()); heightOfLine = descent + halfHeight; paintHorizontalLine(g, (JComponent) tree, heightOfLine, indentation + halfWidth, indentation + rightChildIndent); } descent = paintRecursive(g, indent, descent, depth + 1, tree, mod, mod.getChild(curr, i)); } } } if (isExpanded) if (y0 != heightOfLine && !isLeaf && mod.getChildCount(curr) > 0) { g.setColor(getHashColor()); paintVerticalLine(g, (JComponent) tree, indentation + halfWidth, y0, heightOfLine); } return descent; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4f54b4c49f6326d2bfe26573a0af55c73b713f0a/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
tree, mod, mod.getChild(curr, i));
tree, mod, child);
int paintRecursive(Graphics g, int indentation, int descent, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; TreePath path = new TreePath(getPathToRoot(curr, 0)); int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; int heightOfLine = descent + halfHeight; int row = getRowForPath(tree, path); boolean isRootVisible = tree.isRootVisible(); boolean isExpanded = tree.isExpanded(path); boolean isLeaf = mod.isLeaf(curr); Rectangle bounds = getPathBounds(tree, path); Object root = mod.getRoot(); if (isLeaf) { paintRow(g, clip, null, bounds, path, row, true, false, true); descent += getRowHeight(); } else { if (depth > 0 || isRootVisible) { paintRow(g, clip, null, bounds, path, row, isExpanded, false, false); descent += getRowHeight(); y0 += halfHeight; } if (isExpanded) { int max = mod.getChildCount(curr); for (int i = 0; i < max; i++) { int indent = indentation + rightChildIndent; if (!isRootVisible && depth == 0) indent = 0; else if (isRootVisible || (!isRootVisible && !curr.equals(root))) { g.setColor(getHashColor()); heightOfLine = descent + halfHeight; paintHorizontalLine(g, (JComponent) tree, heightOfLine, indentation + halfWidth, indentation + rightChildIndent); } descent = paintRecursive(g, indent, descent, depth + 1, tree, mod, mod.getChild(curr, i)); } } } if (isExpanded) if (y0 != heightOfLine && !isLeaf && mod.getChildCount(curr) > 0) { g.setColor(getHashColor()); paintVerticalLine(g, (JComponent) tree, indentation + halfWidth, y0, heightOfLine); } return descent; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4f54b4c49f6326d2bfe26573a0af55c73b713f0a/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
if (y0 != heightOfLine && !isLeaf && mod.getChildCount(curr) > 0)
if (y0 != heightOfLine && (mod.getChildCount(curr) > 0 && tree.isVisible(new TreePath(getPathToRoot(mod.getChild (curr, 0), 0)))))
int paintRecursive(Graphics g, int indentation, int descent, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; TreePath path = new TreePath(getPathToRoot(curr, 0)); int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; int heightOfLine = descent + halfHeight; int row = getRowForPath(tree, path); boolean isRootVisible = tree.isRootVisible(); boolean isExpanded = tree.isExpanded(path); boolean isLeaf = mod.isLeaf(curr); Rectangle bounds = getPathBounds(tree, path); Object root = mod.getRoot(); if (isLeaf) { paintRow(g, clip, null, bounds, path, row, true, false, true); descent += getRowHeight(); } else { if (depth > 0 || isRootVisible) { paintRow(g, clip, null, bounds, path, row, isExpanded, false, false); descent += getRowHeight(); y0 += halfHeight; } if (isExpanded) { int max = mod.getChildCount(curr); for (int i = 0; i < max; i++) { int indent = indentation + rightChildIndent; if (!isRootVisible && depth == 0) indent = 0; else if (isRootVisible || (!isRootVisible && !curr.equals(root))) { g.setColor(getHashColor()); heightOfLine = descent + halfHeight; paintHorizontalLine(g, (JComponent) tree, heightOfLine, indentation + halfWidth, indentation + rightChildIndent); } descent = paintRecursive(g, indent, descent, depth + 1, tree, mod, mod.getChild(curr, i)); } } } if (isExpanded) if (y0 != heightOfLine && !isLeaf && mod.getChildCount(curr) > 0) { g.setColor(getHashColor()); paintVerticalLine(g, (JComponent) tree, indentation + halfWidth, y0, heightOfLine); } return descent; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4f54b4c49f6326d2bfe26573a0af55c73b713f0a/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
paintVerticalLine(g, (JComponent) tree, indentation + halfWidth, y0, heightOfLine);
paintVerticalLine(g, (JComponent) tree, indentation + halfWidth, y0, heightOfLine);
int paintRecursive(Graphics g, int indentation, int descent, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; TreePath path = new TreePath(getPathToRoot(curr, 0)); int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; int heightOfLine = descent + halfHeight; int row = getRowForPath(tree, path); boolean isRootVisible = tree.isRootVisible(); boolean isExpanded = tree.isExpanded(path); boolean isLeaf = mod.isLeaf(curr); Rectangle bounds = getPathBounds(tree, path); Object root = mod.getRoot(); if (isLeaf) { paintRow(g, clip, null, bounds, path, row, true, false, true); descent += getRowHeight(); } else { if (depth > 0 || isRootVisible) { paintRow(g, clip, null, bounds, path, row, isExpanded, false, false); descent += getRowHeight(); y0 += halfHeight; } if (isExpanded) { int max = mod.getChildCount(curr); for (int i = 0; i < max; i++) { int indent = indentation + rightChildIndent; if (!isRootVisible && depth == 0) indent = 0; else if (isRootVisible || (!isRootVisible && !curr.equals(root))) { g.setColor(getHashColor()); heightOfLine = descent + halfHeight; paintHorizontalLine(g, (JComponent) tree, heightOfLine, indentation + halfWidth, indentation + rightChildIndent); } descent = paintRecursive(g, indent, descent, depth + 1, tree, mod, mod.getChild(curr, i)); } } } if (isExpanded) if (y0 != heightOfLine && !isLeaf && mod.getChildCount(curr) > 0) { g.setColor(getHashColor()); paintVerticalLine(g, (JComponent) tree, indentation + halfWidth, y0, heightOfLine); } return descent; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4f54b4c49f6326d2bfe26573a0af55c73b713f0a/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
int paintRecursive(Graphics g, int indentation, int descent, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; TreePath path = new TreePath(getPathToRoot(curr, 0)); int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; int heightOfLine = descent + halfHeight; int row = getRowForPath(tree, path); boolean isRootVisible = tree.isRootVisible(); boolean isExpanded = tree.isExpanded(path); boolean isLeaf = mod.isLeaf(curr); Rectangle bounds = getPathBounds(tree, path); Object root = mod.getRoot(); if (isLeaf) { paintRow(g, clip, null, bounds, path, row, true, false, true); descent += getRowHeight(); } else { if (depth > 0 || isRootVisible) { paintRow(g, clip, null, bounds, path, row, isExpanded, false, false); descent += getRowHeight(); y0 += halfHeight; } if (isExpanded) { int max = mod.getChildCount(curr); for (int i = 0; i < max; i++) { int indent = indentation + rightChildIndent; if (!isRootVisible && depth == 0) indent = 0; else if (isRootVisible || (!isRootVisible && !curr.equals(root))) { g.setColor(getHashColor()); heightOfLine = descent + halfHeight; paintHorizontalLine(g, (JComponent) tree, heightOfLine, indentation + halfWidth, indentation + rightChildIndent); } descent = paintRecursive(g, indent, descent, depth + 1, tree, mod, mod.getChild(curr, i)); } } } if (isExpanded) if (y0 != heightOfLine && !isLeaf && mod.getChildCount(curr) > 0) { g.setColor(getHashColor()); paintVerticalLine(g, (JComponent) tree, indentation + halfWidth, y0, heightOfLine); } return descent; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4f54b4c49f6326d2bfe26573a0af55c73b713f0a/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
selected, isExpanded, isLeaf, row, false);
selected, isExpanded, isLeaf, row, true);
protected void paintRow(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { boolean selected = tree.isPathSelected(path); boolean hasIcons = false; Object node = path.getLastPathComponent(); if (tree.isVisible(path)) { if (!validCachedPreferredSize) updateCachedPreferredSize(); bounds.x += gap; bounds.width = preferredSize.width + bounds.x; if (editingComponent != null && editingPath != null && isEditing(tree) && node.equals(editingPath.getLastPathComponent())) { rendererPane.paintComponent(g, editingComponent.getParent(), null, bounds); } else { TreeCellRenderer dtcr = tree.getCellRenderer(); if (dtcr == null) dtcr = createDefaultCellRenderer(); Component c = dtcr.getTreeCellRendererComponent(tree, node, selected, isExpanded, isLeaf, row, false); rendererPane.paintComponent(g, c, c.getParent(), bounds); } } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4f54b4c49f6326d2bfe26573a0af55c73b713f0a/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
if ((bounds.width == 0 && bounds.height == 0) || (!isRootVisible()
if ((bounds.width == 0 && bounds.height == 0) || (!rootVisible
void updateCurrentVisiblePath() { if (treeModel == null) return; Object next = treeModel.getRoot(); Rectangle bounds = getCellBounds(0, 0, next); // If root is not a valid size to be visible, or is // not visible and the tree is expanded, then the next node acts // as the root if ((bounds.width == 0 && bounds.height == 0) || (!isRootVisible() && tree.isExpanded(new TreePath(next)))) next = getNextNode(next); TreePath current = null; while (next != null) { if (current == null) current = new TreePath(next); else current = current.pathByAddingChild(next); do { TreePath path = new TreePath(getPathToRoot(next, 0)); if (tree.isVisible(path) && tree.isExpanded(path)) next = getNextNode(next); else next = getNextSibling(next); } while (next != null && !tree.isVisible(new TreePath(getPathToRoot(next, 0)))); } currentVisiblePath = current; tree.setVisibleRowCount(getRowCount(tree)); if (tree.getSelectionModel() != null && tree.getSelectionCount() == 0 && currentVisiblePath != null) tree.addSelectionRow(0); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4f54b4c49f6326d2bfe26573a0af55c73b713f0a/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
if (tree.isVisible(path) && tree.isExpanded(path))
if ((tree.isVisible(path) && tree.isExpanded(path)) || treeModel.isLeaf(next))
void updateCurrentVisiblePath() { if (treeModel == null) return; Object next = treeModel.getRoot(); Rectangle bounds = getCellBounds(0, 0, next); // If root is not a valid size to be visible, or is // not visible and the tree is expanded, then the next node acts // as the root if ((bounds.width == 0 && bounds.height == 0) || (!isRootVisible() && tree.isExpanded(new TreePath(next)))) next = getNextNode(next); TreePath current = null; while (next != null) { if (current == null) current = new TreePath(next); else current = current.pathByAddingChild(next); do { TreePath path = new TreePath(getPathToRoot(next, 0)); if (tree.isVisible(path) && tree.isExpanded(path)) next = getNextNode(next); else next = getNextSibling(next); } while (next != null && !tree.isVisible(new TreePath(getPathToRoot(next, 0)))); } currentVisiblePath = current; tree.setVisibleRowCount(getRowCount(tree)); if (tree.getSelectionModel() != null && tree.getSelectionCount() == 0 && currentVisiblePath != null) tree.addSelectionRow(0); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4f54b4c49f6326d2bfe26573a0af55c73b713f0a/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
else next = getNextSibling(next);
else next = getNextSibling(next);
void updateCurrentVisiblePath() { if (treeModel == null) return; Object next = treeModel.getRoot(); Rectangle bounds = getCellBounds(0, 0, next); // If root is not a valid size to be visible, or is // not visible and the tree is expanded, then the next node acts // as the root if ((bounds.width == 0 && bounds.height == 0) || (!isRootVisible() && tree.isExpanded(new TreePath(next)))) next = getNextNode(next); TreePath current = null; while (next != null) { if (current == null) current = new TreePath(next); else current = current.pathByAddingChild(next); do { TreePath path = new TreePath(getPathToRoot(next, 0)); if (tree.isVisible(path) && tree.isExpanded(path)) next = getNextNode(next); else next = getNextSibling(next); } while (next != null && !tree.isVisible(new TreePath(getPathToRoot(next, 0)))); } currentVisiblePath = current; tree.setVisibleRowCount(getRowCount(tree)); if (tree.getSelectionModel() != null && tree.getSelectionCount() == 0 && currentVisiblePath != null) tree.addSelectionRow(0); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4f54b4c49f6326d2bfe26573a0af55c73b713f0a/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
tree.setVisibleRowCount(getRowCount(tree));
if (currentVisiblePath != null) tree.setVisibleRowCount(currentVisiblePath.getPathCount()); else tree.setVisibleRowCount(0);
void updateCurrentVisiblePath() { if (treeModel == null) return; Object next = treeModel.getRoot(); Rectangle bounds = getCellBounds(0, 0, next); // If root is not a valid size to be visible, or is // not visible and the tree is expanded, then the next node acts // as the root if ((bounds.width == 0 && bounds.height == 0) || (!isRootVisible() && tree.isExpanded(new TreePath(next)))) next = getNextNode(next); TreePath current = null; while (next != null) { if (current == null) current = new TreePath(next); else current = current.pathByAddingChild(next); do { TreePath path = new TreePath(getPathToRoot(next, 0)); if (tree.isVisible(path) && tree.isExpanded(path)) next = getNextNode(next); else next = getNextSibling(next); } while (next != null && !tree.isVisible(new TreePath(getPathToRoot(next, 0)))); } currentVisiblePath = current; tree.setVisibleRowCount(getRowCount(tree)); if (tree.getSelectionModel() != null && tree.getSelectionCount() == 0 && currentVisiblePath != null) tree.addSelectionRow(0); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4f54b4c49f6326d2bfe26573a0af55c73b713f0a/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
tree.addSelectionRow(0);
selectPath(tree, new TreePath(currentVisiblePath.getPathComponent(0)));
void updateCurrentVisiblePath() { if (treeModel == null) return; Object next = treeModel.getRoot(); Rectangle bounds = getCellBounds(0, 0, next); // If root is not a valid size to be visible, or is // not visible and the tree is expanded, then the next node acts // as the root if ((bounds.width == 0 && bounds.height == 0) || (!isRootVisible() && tree.isExpanded(new TreePath(next)))) next = getNextNode(next); TreePath current = null; while (next != null) { if (current == null) current = new TreePath(next); else current = current.pathByAddingChild(next); do { TreePath path = new TreePath(getPathToRoot(next, 0)); if (tree.isVisible(path) && tree.isExpanded(path)) next = getNextNode(next); else next = getNextSibling(next); } while (next != null && !tree.isVisible(new TreePath(getPathToRoot(next, 0)))); } currentVisiblePath = current; tree.setVisibleRowCount(getRowCount(tree)); if (tree.getSelectionModel() != null && tree.getSelectionCount() == 0 && currentVisiblePath != null) tree.addSelectionRow(0); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4f54b4c49f6326d2bfe26573a0af55c73b713f0a/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
if(getComponentOrientation().isLeftToRight())
if (getComponentOrientation().isLeftToRight())
public DefaultEditor(JSpinner spinner) { super(); setLayout(this); this.spinner = spinner; ftf = new JFormattedTextField(); add(ftf); ftf.setValue(spinner.getValue()); ftf.addPropertyChangeListener(this); if(getComponentOrientation().isLeftToRight()) ftf.setHorizontalAlignment(JTextField.RIGHT); else ftf.setHorizontalAlignment(JTextField.LEFT); spinner.addChangeListener(this); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JSpinner.java/buggy/core/src/classpath/javax/javax/swing/JSpinner.java
{
{
public void setHorizontalAlignment(int newAlign) { if (align == newAlign) return; int oldAlign = align; align = newAlign; firePropertyChange("horizontalAlignment", oldAlign, newAlign); invalidate(); repaint(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JTextField.java/buggy/core/src/classpath/javax/javax/swing/JTextField.java
throw new BAD_OPERATION(0, CompletionStatus.COMPLETED_MAYBE);
throw new BAD_OPERATION(Minor.Method, CompletionStatus.COMPLETED_MAYBE);
OutputStream super_invoke(String method, InputStream in, ResponseHandler rh) { OutputStream out = null; Integer call_method = (Integer) _NamingContextImplBase.methods.get(method); if (call_method == null) throw new BAD_OPERATION(0, CompletionStatus.COMPLETED_MAYBE); switch (call_method.intValue()) { case 0: // bind { try { NameComponent[] a_name = NameHelper.read(in); org.omg.CORBA.Object an_object = ObjectHelper.read(in); bind(a_name, an_object); out = rh.createReply(); } catch (NotFound ex) { out = rh.createExceptionReply(); NotFoundHelper.write(out, ex); } catch (CannotProceed ex) { out = rh.createExceptionReply(); CannotProceedHelper.write(out, ex); } catch (InvalidName ex) { out = rh.createExceptionReply(); InvalidNameHelper.write(out, ex); } catch (AlreadyBound ex) { out = rh.createExceptionReply(); AlreadyBoundHelper.write(out, ex); } break; } case 1: // rebind { try { NameComponent[] a_name = NameHelper.read(in); org.omg.CORBA.Object an_object = ObjectHelper.read(in); rebind(a_name, an_object); out = rh.createReply(); } catch (NotFound ex) { out = rh.createExceptionReply(); NotFoundHelper.write(out, ex); } catch (CannotProceed ex) { out = rh.createExceptionReply(); CannotProceedHelper.write(out, ex); } catch (InvalidName ex) { out = rh.createExceptionReply(); InvalidNameHelper.write(out, ex); } break; } case 2: // bind_context { try { NameComponent[] a_name = NameHelper.read(in); NamingContext a_context = NamingContextHelper.read(in); bind_context(a_name, a_context); out = rh.createReply(); } catch (NotFound ex) { out = rh.createExceptionReply(); NotFoundHelper.write(out, ex); } catch (CannotProceed ex) { out = rh.createExceptionReply(); CannotProceedHelper.write(out, ex); } catch (InvalidName ex) { out = rh.createExceptionReply(); InvalidNameHelper.write(out, ex); } catch (AlreadyBound ex) { out = rh.createExceptionReply(); AlreadyBoundHelper.write(out, ex); } break; } case 3: // rebind_context { try { NameComponent[] a_name = NameHelper.read(in); NamingContext a_context = NamingContextHelper.read(in); rebind_context(a_name, a_context); out = rh.createReply(); } catch (NotFound ex) { out = rh.createExceptionReply(); NotFoundHelper.write(out, ex); } catch (CannotProceed ex) { out = rh.createExceptionReply(); CannotProceedHelper.write(out, ex); } catch (InvalidName ex) { out = rh.createExceptionReply(); InvalidNameHelper.write(out, ex); } break; } case 4: // resolve { try { NameComponent[] a_name = NameHelper.read(in); org.omg.CORBA.Object __result = null; __result = resolve(a_name); out = rh.createReply(); ObjectHelper.write(out, __result); } catch (NotFound ex) { out = rh.createExceptionReply(); NotFoundHelper.write(out, ex); } catch (CannotProceed ex) { out = rh.createExceptionReply(); CannotProceedHelper.write(out, ex); } catch (InvalidName ex) { out = rh.createExceptionReply(); InvalidNameHelper.write(out, ex); } break; } case 5: // unbind { try { NameComponent[] a_name = NameHelper.read(in); unbind(a_name); out = rh.createReply(); } catch (NotFound ex) { out = rh.createExceptionReply(); NotFoundHelper.write(out, ex); } catch (CannotProceed ex) { out = rh.createExceptionReply(); CannotProceedHelper.write(out, ex); } catch (InvalidName ex) { out = rh.createExceptionReply(); InvalidNameHelper.write(out, ex); } break; } case 6: // new_context { NamingContext __result = null; __result = new_context(); out = rh.createReply(); NamingContextHelper.write(out, __result); break; } case 7: // bind_new_context { try { NameComponent[] a_name = NameHelper.read(in); NamingContext __result = null; __result = bind_new_context(a_name); out = rh.createReply(); NamingContextHelper.write(out, __result); } catch (NotFound ex) { out = rh.createExceptionReply(); NotFoundHelper.write(out, ex); } catch (AlreadyBound ex) { out = rh.createExceptionReply(); AlreadyBoundHelper.write(out, ex); } catch (CannotProceed ex) { out = rh.createExceptionReply(); CannotProceedHelper.write(out, ex); } catch (InvalidName ex) { out = rh.createExceptionReply(); InvalidNameHelper.write(out, ex); } break; } case 8: // destroy { try { destroy(); out = rh.createReply(); } catch (NotEmpty ex) { out = rh.createExceptionReply(); NotEmptyHelper.write(out, ex); } break; } case 9: // list { int amount = in.read_ulong(); BindingListHolder a_list = new BindingListHolder(); BindingIteratorHolder an_iter = new BindingIteratorHolder(); list(amount, a_list, an_iter); out = rh.createReply(); BindingListHelper.write(out, a_list.value); BindingIteratorHelper.write(out, an_iter.value); break; } default: throw new BAD_OPERATION(0, CompletionStatus.COMPLETED_MAYBE); } return out; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/44e3ea509d80974dab547c4d1cf8c070d32bac86/NamingContextExtPOA.java/clean/core/src/classpath/org/org/omg/CosNaming/NamingContextExtPOA.java
public ActivationDesc(String className, String location, MarshalledObject data) throws ActivationException {
public ActivationDesc(String className, String location, MarshalledObject data) throws ActivationException {
public ActivationDesc(String className, String location, MarshalledObject data) throws ActivationException { this(ActivationGroup.currentGroupID(), className, location, data, false);}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/ActivationDesc.java/buggy/core/src/classpath/java/java/rmi/activation/ActivationDesc.java
}
}
public ActivationDesc(String className, String location, MarshalledObject data) throws ActivationException { this(ActivationGroup.currentGroupID(), className, location, data, false);}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/ActivationDesc.java/buggy/core/src/classpath/java/java/rmi/activation/ActivationDesc.java
public boolean equals(Object obj) { if (!(obj instanceof ActivationDesc)) { return (false); } ActivationDesc that = (ActivationDesc)obj; if (this.groupid.equals(that.groupid) && this.classname.equals(that.classname) && this.location.equals(that.location) && this.data.equals(that.data) && this.restart == that.restart) { return (true); } return (false); }
public boolean equals(Object obj) { if (obj instanceof ActivationDesc) { ActivationDesc that = (ActivationDesc) obj; return groupid.equals(that.groupid) && classname.equals(that.classname) && location.equals(that.location) && data.equals(that.data) && restart == that.restart; } else return false; }
public boolean equals(Object obj) { if (!(obj instanceof ActivationDesc)) { return (false); } ActivationDesc that = (ActivationDesc)obj; if (this.groupid.equals(that.groupid) && this.classname.equals(that.classname) && this.location.equals(that.location) && this.data.equals(that.data) && this.restart == that.restart) { return (true); } return (false);}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/ActivationDesc.java/buggy/core/src/classpath/java/java/rmi/activation/ActivationDesc.java
public String getClassName() { return (classname); }
public String getClassName() { return classname; }
public String getClassName() { return (classname);}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/ActivationDesc.java/buggy/core/src/classpath/java/java/rmi/activation/ActivationDesc.java
public MarshalledObject getData() { return (data); }
public MarshalledObject getData() { return data; }
public MarshalledObject getData() { return (data);}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/ActivationDesc.java/buggy/core/src/classpath/java/java/rmi/activation/ActivationDesc.java
public ActivationGroupID getGroupID() { return (groupid); }
public ActivationGroupID getGroupID() { return groupid; }
public ActivationGroupID getGroupID() { return (groupid);}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/ActivationDesc.java/buggy/core/src/classpath/java/java/rmi/activation/ActivationDesc.java
public String getLocation() { return (location); }
public String getLocation() { return location; }
public String getLocation() { return (location);}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/ActivationDesc.java/buggy/core/src/classpath/java/java/rmi/activation/ActivationDesc.java
public boolean getRestartMode() { return (restart); }
public boolean getRestartMode() { return restart; }
public boolean getRestartMode() { return (restart);}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/ActivationDesc.java/buggy/core/src/classpath/java/java/rmi/activation/ActivationDesc.java
public int hashCode() { return (groupid.hashCode() ^ classname.hashCode() ^ location.hashCode() ^ data.hashCode()); }
public int hashCode() { return groupid.hashCode() ^ classname.hashCode() ^ location.hashCode() ^ data.hashCode(); }
public int hashCode() { return (groupid.hashCode() ^ classname.hashCode() ^ location.hashCode() ^ data.hashCode());}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/ActivationDesc.java/buggy/core/src/classpath/java/java/rmi/activation/ActivationDesc.java
Rectangle alloc = c.isValid() ? c.getBounds() : new Rectangle(c.getPreferredSize());
Rectangle alloc = new Rectangle(0, 0, getWidth(), getHeight());
protected int calculateBreakPosition(int p0, int p1) { Container c = getContainer(); Rectangle alloc = c.isValid() ? c.getBounds() : new Rectangle(c.getPreferredSize()); updateMetrics(); try { getDocument().getText(p0, p1 - p0, getLineBuffer()); } catch (BadLocationException ble) { // this shouldn't happen } // FIXME: Should we account for the insets of the container? if (wordWrap) return p0 + Utilities.getBreakLocation(lineBuffer, metrics, alloc.x, alloc.x + alloc.width, this, 0); else { return p0 + Utilities.getTabbedTextOffset(lineBuffer, metrics, alloc.x, alloc.x + alloc.width, this, 0); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/WrappedPlainView.java/buggy/core/src/classpath/javax/javax/swing/text/WrappedPlainView.java
HTMLDocument document = new HTMLDocument();
HTMLDocument document = new HTMLDocument(getStyleSheet());
public Document createDefaultDocument() { HTMLDocument document = new HTMLDocument(); document.setParser(getParser()); return document; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/a78ab2f492456918e4f5c52be600854882e139fc/HTMLEditorKit.java/buggy/core/src/classpath/javax/javax/swing/text/html/HTMLEditorKit.java
set.removeAttributes(set);
protected void createInputAttributes(Element element, MutableAttributeSet set) { set.addAttributes(element.getAttributes()); // FIXME: Not fully implemented. }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/a78ab2f492456918e4f5c52be600854882e139fc/HTMLEditorKit.java/buggy/core/src/classpath/javax/javax/swing/text/html/HTMLEditorKit.java
styleSheet.importStyleSheet(getClass().getResource(DEFAULT_CSS)); }
public StyleSheet getStyleSheet() { if (styleSheet == null) styleSheet = new StyleSheet(); return styleSheet; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/a78ab2f492456918e4f5c52be600854882e139fc/HTMLEditorKit.java/buggy/core/src/classpath/javax/javax/swing/text/html/HTMLEditorKit.java
{ super(elem); }
{ super(elem); }
public ComponentView(Element elem) { super(elem); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/ComponentView.java/buggy/core/src/classpath/javax/javax/swing/text/ComponentView.java
try { loadRules(new BufferedReader(new InputStreamReader(url.openStream())), url); } catch (IOException ioe) { }
public void importStyleSheet(URL url) { try { // FIXME: Need to make sure url points to a valid CSS document. loadRules(new BufferedReader(new InputStreamReader(url.openStream())), url); } catch (IOException ioe) { // Do nothing here. } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/a78ab2f492456918e4f5c52be600854882e139fc/StyleSheet.java/buggy/core/src/classpath/javax/javax/swing/text/html/StyleSheet.java
if (eq != - 1)
if (eq != -1)
private void handleLongOption(String real, int index) throws OptionException { String option = real.substring(index); String justName = option; int eq = option.indexOf('='); if (eq != - 1) justName = option.substring(0, eq); char shortName = 0; if (justName.length() == 1) shortName = justName.charAt(0); Option found = null; for (int i = options.size() - 1; i >= 0; --i) { Option opt = (Option) options.get(i); if (justName.equals(opt.getLongName())) { found = opt; break; } if (shortName != 0 && opt.getShortName() == shortName) { found = opt; break; } } if (found == null) { String msg = MessageFormat.format(Messages.getString("Parser.Unrecognized"), //$NON-NLS-1$ new Object[] { real }); throw new OptionException(msg); } String argument = null; if (found.getTakesArgument()) { if (eq == - 1) argument = getArgument(real); else argument = option.substring(eq + 1); } else if (eq != - 1) { String msg = MessageFormat.format(Messages.getString("Parser.NoArg"), //$NON-NLS-1$ new Object[] { real.substring(0, eq + index) }); throw new OptionException(msg); } found.parsed(argument); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/bd3c4af88fcde25afb91781dd0bd56ebcfa8a15b/Parser.java/clean/core/src/classpath/tools/gnu/classpath/tools/getopt/Parser.java
char shortName = 0; if (justName.length() == 1) shortName = justName.charAt(0);
boolean isPlainShort = justName.length() == 1; char shortName = justName.charAt(0);
private void handleLongOption(String real, int index) throws OptionException { String option = real.substring(index); String justName = option; int eq = option.indexOf('='); if (eq != - 1) justName = option.substring(0, eq); char shortName = 0; if (justName.length() == 1) shortName = justName.charAt(0); Option found = null; for (int i = options.size() - 1; i >= 0; --i) { Option opt = (Option) options.get(i); if (justName.equals(opt.getLongName())) { found = opt; break; } if (shortName != 0 && opt.getShortName() == shortName) { found = opt; break; } } if (found == null) { String msg = MessageFormat.format(Messages.getString("Parser.Unrecognized"), //$NON-NLS-1$ new Object[] { real }); throw new OptionException(msg); } String argument = null; if (found.getTakesArgument()) { if (eq == - 1) argument = getArgument(real); else argument = option.substring(eq + 1); } else if (eq != - 1) { String msg = MessageFormat.format(Messages.getString("Parser.NoArg"), //$NON-NLS-1$ new Object[] { real.substring(0, eq + index) }); throw new OptionException(msg); } found.parsed(argument); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/bd3c4af88fcde25afb91781dd0bd56ebcfa8a15b/Parser.java/clean/core/src/classpath/tools/gnu/classpath/tools/getopt/Parser.java
if (shortName != 0 && opt.getShortName() == shortName)
if ((isPlainShort || opt.isJoined()) && opt.getShortName() == shortName)
private void handleLongOption(String real, int index) throws OptionException { String option = real.substring(index); String justName = option; int eq = option.indexOf('='); if (eq != - 1) justName = option.substring(0, eq); char shortName = 0; if (justName.length() == 1) shortName = justName.charAt(0); Option found = null; for (int i = options.size() - 1; i >= 0; --i) { Option opt = (Option) options.get(i); if (justName.equals(opt.getLongName())) { found = opt; break; } if (shortName != 0 && opt.getShortName() == shortName) { found = opt; break; } } if (found == null) { String msg = MessageFormat.format(Messages.getString("Parser.Unrecognized"), //$NON-NLS-1$ new Object[] { real }); throw new OptionException(msg); } String argument = null; if (found.getTakesArgument()) { if (eq == - 1) argument = getArgument(real); else argument = option.substring(eq + 1); } else if (eq != - 1) { String msg = MessageFormat.format(Messages.getString("Parser.NoArg"), //$NON-NLS-1$ new Object[] { real.substring(0, eq + index) }); throw new OptionException(msg); } found.parsed(argument); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/bd3c4af88fcde25afb91781dd0bd56ebcfa8a15b/Parser.java/clean/core/src/classpath/tools/gnu/classpath/tools/getopt/Parser.java
if (eq == - 1)
if (eq == -1)
private void handleLongOption(String real, int index) throws OptionException { String option = real.substring(index); String justName = option; int eq = option.indexOf('='); if (eq != - 1) justName = option.substring(0, eq); char shortName = 0; if (justName.length() == 1) shortName = justName.charAt(0); Option found = null; for (int i = options.size() - 1; i >= 0; --i) { Option opt = (Option) options.get(i); if (justName.equals(opt.getLongName())) { found = opt; break; } if (shortName != 0 && opt.getShortName() == shortName) { found = opt; break; } } if (found == null) { String msg = MessageFormat.format(Messages.getString("Parser.Unrecognized"), //$NON-NLS-1$ new Object[] { real }); throw new OptionException(msg); } String argument = null; if (found.getTakesArgument()) { if (eq == - 1) argument = getArgument(real); else argument = option.substring(eq + 1); } else if (eq != - 1) { String msg = MessageFormat.format(Messages.getString("Parser.NoArg"), //$NON-NLS-1$ new Object[] { real.substring(0, eq + index) }); throw new OptionException(msg); } found.parsed(argument); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/bd3c4af88fcde25afb91781dd0bd56ebcfa8a15b/Parser.java/clean/core/src/classpath/tools/gnu/classpath/tools/getopt/Parser.java
for (int i = 1; i < option.length(); ++i)
for (int charIndex = 1; charIndex < option.length(); ++charIndex)
private void handleShortOptions(String option) throws OptionException { for (int i = 1; i < option.length(); ++i) { handleShortOption(option.charAt(i)); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/bd3c4af88fcde25afb91781dd0bd56ebcfa8a15b/Parser.java/clean/core/src/classpath/tools/gnu/classpath/tools/getopt/Parser.java
handleShortOption(option.charAt(i));
char optChar = option.charAt(charIndex); Option found = null; for (int i = options.size() - 1; i >= 0; --i) { Option opt = (Option) options.get(i); if (optChar == opt.getShortName()) { found = opt; break; } } if (found == null) { String msg = MessageFormat.format(Messages.getString("Parser.UnrecDash"), new Object[] { "" + optChar }); throw new OptionException(msg); } String argument = null; if (found.getTakesArgument()) { if (found.isJoined() && charIndex + 1 < option.length()) { argument = option.substring(charIndex + 1); charIndex = option.length(); } else argument = getArgument("-" + optChar); } found.parsed(argument);
private void handleShortOptions(String option) throws OptionException { for (int i = 1; i < option.length(); ++i) { handleShortOption(option.charAt(i)); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/bd3c4af88fcde25afb91781dd0bd56ebcfa8a15b/Parser.java/clean/core/src/classpath/tools/gnu/classpath/tools/getopt/Parser.java
if (option.getShortName() != 'J')
if (! option.isJoined())
public void printHelp(PrintStream out, boolean longOnly) { // Compute maximum lengths. int maxArgLen = 0; boolean shortOptionSeen = false; Iterator it; // The first pass only looks to see if we have a short option. it = options.iterator(); while (it.hasNext()) { Option option = (Option) it.next(); if (option.getShortName() != '\0') { shortOptionSeen = true; break; } } it = options.iterator(); while (it.hasNext()) { Option option = (Option) it.next(); String argName = option.getArgumentName(); // First compute the width required for the short // option. "2" is the initial indentation. In the // GNU style we don't print an argument name for // a short option if there is also a long name for // the option. int thisArgLen = 2; if (shortOptionSeen) thisArgLen += 4; if (option.getLongName() != null) { // Handle either '-' or '--'. thisArgLen += 1 + option.getLongName().length(); if (! longOnly) ++thisArgLen; } // Add in the width of the argument name. if (argName != null) thisArgLen += 1 + argName.length(); maxArgLen = Math.max(maxArgLen, thisArgLen); } // Print the help. if (name != null) out.println(name + ":"); it = options.iterator(); while (it.hasNext()) { Option option = (Option) it.next(); String argName = option.getArgumentName(); int column = 0; if (option.getShortName() != '\0') { out.print(" -"); out.print(option.getShortName()); column += 4; if (option.getLongName() == null) { if (argName != null) { // This is a silly hack just for '-J'. We don't // support joined options in general, but this option // is filtered out before argument processing can see it. if (option.getShortName() != 'J') { out.print(' '); ++column; } out.print(argName); column += argName.length(); } out.print(" "); } else out.print(", "); column += 2; } // Indent the long option past the short options, if one // was seen. for (; column < (shortOptionSeen ? 6 : 2); ++column) out.print(' '); if (option.getLongName() != null) { out.print(longOnly ? "-" : "--"); out.print(option.getLongName()); column += (longOnly ? 1 : 2) + option.getLongName().length(); if (argName != null) { out.print(" " + argName); column += 1 + argName.length(); } } // FIXME: should have a better heuristic for padding. out.print(FILLER.substring(0, maxArgLen + 4 - column)); formatText(out, option.getDescription(), maxArgLen + 4); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/bd3c4af88fcde25afb91781dd0bd56ebcfa8a15b/OptionGroup.java/buggy/core/src/classpath/tools/gnu/classpath/tools/getopt/OptionGroup.java
Unsafe.debug("loadFromBootClassArray");
protected static void loadFromBootClassArray(VmType[] bootClasses) { int count = bootClasses.length; for (int i = 0; i < count; i++) { VmType vmClass = bootClasses[i]; String name = vmClass.name; if (vmClass.isPrimitive()) { if (name.equals("boolean")) { BooleanClass = (VmNormalClass) vmClass; } else if (name.equals("byte")) { ByteClass = (VmNormalClass) vmClass; } else if (name.equals("char")) { CharClass = (VmNormalClass) vmClass; } else if (name.equals("short")) { ShortClass = (VmNormalClass) vmClass; } else if (name.equals("int")) { IntClass = (VmNormalClass) vmClass; } else if (name.equals("float")) { FloatClass = (VmNormalClass) vmClass; } else if (name.equals("long")) { LongClass = (VmNormalClass) vmClass; } else if (name.equals("double")) { DoubleClass = (VmNormalClass) vmClass; } else if (name.equals("void")) { VoidClass = (VmNormalClass) vmClass; } } else if (vmClass.isArray()) { if (name.equals("[Z")) { BooleanArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[B")) { ByteArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[C")) { CharArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[S")) { ShortArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[I")) { IntArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[F")) { FloatArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[J")) { LongArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[D")) { DoubleArrayClass = (VmArrayClass) vmClass; } } else if (name.equals("java.lang.Object")) { ObjectClass = (VmNormalClass) vmClass; } else if (name.equals("java.lang.Cloneable")) { CloneableClass = (VmInterfaceClass) vmClass; } else if (name.equals("java.io.Serializable")) { SerializableClass = (VmInterfaceClass) vmClass; } } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6c51b2252b587e401cd3a2b2e553206263541af7/VmType.java/clean/core/src/core/org/jnode/vm/classmgr/VmType.java
(new Thread(conn)).start();
(new RMIIncomingThread(conn, remoteHost)).start();
public void run() { for (;serverThread != null;) { // if serverThread==null, then exit thread try {//System.out.println("Waiting for connection on " + serverPort); UnicastConnection conn = getServerConnection(); // use a thread pool to improve performance //ConnectionRunnerPool.dispatchConnection(conn); (new Thread(conn)).start(); } catch (Exception e) { e.printStackTrace(); } }}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/UnicastConnectionManager.java/clean/core/src/classpath/gnu/gnu/java/rmi/server/UnicastConnectionManager.java
Thread.currentThread().sleep(100);
Thread.sleep(100);
public void connect() { failIfConnected(); if (!isSignificant(this.user)) { connectSimple(); } else { if (this.embeddedSignon) connectEmbedded(); else connectSimulated(); Runnable runnable = new Runnable() { int tryConnection; public void run() { if ((tryConnection++ < 30) && //If it is still not connected after 3 seconds, //stop with trying (session.isConnected() == false)) { try { Thread.currentThread().sleep(100); } catch (InterruptedException ex) { ; } SwingUtilities.invokeLater(this); } else { doAfterSignon(); doInitialCommand(); } } }; runnable.run(); } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/d3f4f0d032e4305c6a78bdb863ee5599f3e41633/ProtocolBean.java/clean/tn5250j/src/org/tn5250j/beans/ProtocolBean.java
Thread.currentThread().sleep(100);
Thread.sleep(100);
public void run() { if ((tryConnection++ < 30) && //If it is still not connected after 3 seconds, //stop with trying (session.isConnected() == false)) { try { Thread.currentThread().sleep(100); } catch (InterruptedException ex) { ; } SwingUtilities.invokeLater(this); } else { doAfterSignon(); doInitialCommand(); } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/d3f4f0d032e4305c6a78bdb863ee5599f3e41633/ProtocolBean.java/clean/tn5250j/src/org/tn5250j/beans/ProtocolBean.java
oout = conn.getObjectOutputStream();
oout = conn.startObjectOutputStream();
public void executeCall() throws Exception { byte returncode; ObjectInput oin; // signal the call when constructing try { DataOutputStream dout = conn.getDataOutputStream(); dout.write(MESSAGE_CALL); oout = conn.getObjectOutputStream(); objid.write(oout); oout.writeInt(opnum); oout.writeLong(hash); } catch(IOException ex) { throw new MarshalException("Try to write header but failed.", ex); } try { releaseOutputStream(); DataInputStream din = conn.getDataInputStream(); if (din.readByte() != MESSAGE_CALL_ACK) throw new RemoteException("Call not acked"); oin = getInputStream(); returncode = oin.readByte(); UID.read(oin); } catch(IOException ex) { throw new UnmarshalException("Try to read header but failed:", ex); } //check return code switch(returncode) { case RETURN_ACK: //it's ok return; case RETURN_NACK: Object returnobj; try { returnobj = oin.readObject(); } catch(Exception ex2) { throw new UnmarshalException ("Try to read exception object but failed", ex2); } if(!(returnobj instanceof Exception)) throw new UnmarshalException("Should be Exception type here: " + returnobj); throw (Exception)returnobj; default: throw new UnmarshalException("Invalid return code"); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/UnicastRemoteCall.java/clean/core/src/classpath/gnu/gnu/java/rmi/server/UnicastRemoteCall.java
oin = getInputStream();
oin = startInputStream();
public void executeCall() throws Exception { byte returncode; ObjectInput oin; // signal the call when constructing try { DataOutputStream dout = conn.getDataOutputStream(); dout.write(MESSAGE_CALL); oout = conn.getObjectOutputStream(); objid.write(oout); oout.writeInt(opnum); oout.writeLong(hash); } catch(IOException ex) { throw new MarshalException("Try to write header but failed.", ex); } try { releaseOutputStream(); DataInputStream din = conn.getDataInputStream(); if (din.readByte() != MESSAGE_CALL_ACK) throw new RemoteException("Call not acked"); oin = getInputStream(); returncode = oin.readByte(); UID.read(oin); } catch(IOException ex) { throw new UnmarshalException("Try to read header but failed:", ex); } //check return code switch(returncode) { case RETURN_ACK: //it's ok return; case RETURN_NACK: Object returnobj; try { returnobj = oin.readObject(); } catch(Exception ex2) { throw new UnmarshalException ("Try to read exception object but failed", ex2); } if(!(returnobj instanceof Exception)) throw new UnmarshalException("Should be Exception type here: " + returnobj); throw (Exception)returnobj; default: throw new UnmarshalException("Invalid return code"); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/UnicastRemoteCall.java/clean/core/src/classpath/gnu/gnu/java/rmi/server/UnicastRemoteCall.java
public void write(ObjectOutput out) throws IOException { DataOutput dout = (DataOutput)out;
public void write(ObjectOutput out) throws IOException { DataOutput dout = (DataOutput) out;
public void write(ObjectOutput out) throws IOException { DataOutput dout = (DataOutput)out; dout.writeLong(objNum); space.write(dout);}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/ObjID.java/buggy/core/src/classpath/java/java/rmi/server/ObjID.java
}
}
public void write(ObjectOutput out) throws IOException { DataOutput dout = (DataOutput)out; dout.writeLong(objNum); space.write(dout);}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/ObjID.java/buggy/core/src/classpath/java/java/rmi/server/ObjID.java
public static UID read(DataInput in) throws IOException { UID id = new UID(); id.unique = in.readInt(); id.time = in.readLong(); id.count = in.readShort(); return (id); }
public static UID read(DataInput in) throws IOException { UID uid = new UID(); uid.unique = in.readInt(); uid.time = in.readLong(); uid.count = in.readShort(); return (uid); }
public static UID read(DataInput in) throws IOException { UID id = new UID(); id.unique = in.readInt(); id.time = in.readLong(); id.count = in.readShort(); return (id);}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/UID.java/buggy/core/src/classpath/java/java/rmi/server/UID.java
rowSM.setSelectionMode(rowSM.SINGLE_SELECTION);
rowSM.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
private void jbInit() throws Exception { this.setTitle(LangTool.getString("spool.title")); this.setIconImage(GUIGraphicsUtils.getApplicationIcon().getImage()); this.getContentPane().add(createFilterPanel(), BorderLayout.NORTH); // get an instance of our table model stm = new SpoolTableModel(); // create a table using our custom table model spools = new JSortTable(stm); TableColumn column = null; for (int x = 0;x < stm.getColumnCount(); x++) { column = spools.getColumnModel().getColumn(x); column.setPreferredWidth(stm.getColumnPreferredSize(x)); } spools.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); // create our mouse listener on the table spools.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(MouseEvent e) { spools_mouseClicked(e); } public void mousePressed (MouseEvent event) { if (SwingUtilities.isRightMouseButton(event)) showPopupMenu(event); } public void mouseReleased (MouseEvent event) { if (SwingUtilities.isRightMouseButton(event)) showPopupMenu(event); } }); spools.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(spools); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // setup the number of rows we should be working with spools.setPreferredScrollableViewportSize( new Dimension( spools.getPreferredScrollableViewportSize().width, spools.getFontMetrics(spools.getFont()).getHeight() * 8) ); scrollPane.getViewport().setBackground(spools.getBackground()); scrollPane.setBackground(spools.getBackground()); //Setup our selection model listener rowSM = spools.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); } }); rowSM.setSelectionMode(rowSM.SINGLE_SELECTION); this.getContentPane().add(scrollPane, BorderLayout.CENTER); status = new JLabel("0 " + LangTool.getString("spool.count")); status.setBorder(BorderFactory.createEtchedBorder()); this.getContentPane().add(status, BorderLayout.SOUTH); pack(); //Center the window 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); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent event) { // close the spool file list// if (splfList != null)// splfList.close(); // close the system connection if (system != null) system.disconnectAllServices(); setVisible(false); dispose(); } }); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/a214bcb897ee9098f3737a95f7be3c969f3651cb/SpoolExporter.java/buggy/tn5250j/src/org/tn5250j/spoolfile/SpoolExporter.java
public void drawImageBuffer(Graphics2D gg2d,int x, int y, int width, int height) {
public synchronized void drawImageBuffer(Graphics2D gg2d,int x, int y, int width, int height) {
public void drawImageBuffer(Graphics2D gg2d,int x, int y, int width, int height) { /** * @todo this is a hack and should be fixed at the root of the problem */ if (gg2d == null) { System.out.println(" we got a null graphic object "); return; } synchronized (lock) { gg2d.drawImage(bi.getSubimage(x,y,width,height),null,x,y); // tell waiting threads to wake up lock.notifyAll(); } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/bc7e11ab017c3feeba41d87e99dba276258b7c41/GuiGraphicBuffer.java/clean/tn5250j/src/org/tn5250j/GuiGraphicBuffer.java
synchronized (lock) {
public void drawImageBuffer(Graphics2D gg2d,int x, int y, int width, int height) { /** * @todo this is a hack and should be fixed at the root of the problem */ if (gg2d == null) { System.out.println(" we got a null graphic object "); return; } synchronized (lock) { gg2d.drawImage(bi.getSubimage(x,y,width,height),null,x,y); // tell waiting threads to wake up lock.notifyAll(); } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/bc7e11ab017c3feeba41d87e99dba276258b7c41/GuiGraphicBuffer.java/clean/tn5250j/src/org/tn5250j/GuiGraphicBuffer.java
lock.notifyAll(); }
public void drawImageBuffer(Graphics2D gg2d,int x, int y, int width, int height) { /** * @todo this is a hack and should be fixed at the root of the problem */ if (gg2d == null) { System.out.println(" we got a null graphic object "); return; } synchronized (lock) { gg2d.drawImage(bi.getSubimage(x,y,width,height),null,x,y); // tell waiting threads to wake up lock.notifyAll(); } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/bc7e11ab017c3feeba41d87e99dba276258b7c41/GuiGraphicBuffer.java/clean/tn5250j/src/org/tn5250j/GuiGraphicBuffer.java
public Session getSessionAt( int index) { JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); Session s = (Session)frames[index].getContentPane(); return s; }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/b424408b7c5f668455972e5e401cbeda3a3ff25a/Gui5250MDIFrame.java/clean/tn5250j/src/org/tn5250j/Gui5250MDIFrame.java
this.string = str;
public URI(String str) throws URISyntaxException { parseURI(str); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/37d5fed12204d348d94cd6409a12ac3d0787ccc3/URI.java/buggy/core/src/classpath/java/java/net/URI.java
this.string = (String) is.readObject(); try { parseURI(this.string); } catch (URISyntaxException x) { throw new RuntimeException(x); }
private void readObject(ObjectInputStream is) throws ClassNotFoundException, IOException { }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/37d5fed12204d348d94cd6409a12ac3d0787ccc3/URI.java/buggy/core/src/classpath/java/java/net/URI.java
private void writeObject(ObjectOutputStream is) throws IOException
private void writeObject(ObjectOutputStream os) throws IOException
private void writeObject(ObjectOutputStream is) throws IOException { }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/37d5fed12204d348d94cd6409a12ac3d0787ccc3/URI.java/buggy/core/src/classpath/java/java/net/URI.java
if (string == null) string = toString(); os.writeObject(string);
private void writeObject(ObjectOutputStream is) throws IOException { }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/37d5fed12204d348d94cd6409a12ac3d0787ccc3/URI.java/buggy/core/src/classpath/java/java/net/URI.java
data[offset+3] = (byte)((value >> 32) & 0xFF);
data[offset+3] = (byte)((value >> 24) & 0xFF);
public static void set32(byte[] data, int offset, long value) { data[offset] = (byte)(value & 0xFF); data[offset+1] = (byte)((value >> 8) & 0xFF); data[offset+2] = (byte)((value >> 16) & 0xFF); data[offset+3] = (byte)((value >> 32) & 0xFF); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8d7f8ec2a541c65fe833a8aaf82952c0dc786fec/Ext2Utils.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2Utils.java
protected void handleComment(char[] comment) { }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/DocumentParser.java/buggy/core/src/classpath/javax/javax/swing/text/html/parser/DocumentParser.java
protected void handleEmptyTag(TagElement tag) throws javax.swing.text.ChangedCharSetException { }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/DocumentParser.java/buggy/core/src/classpath/javax/javax/swing/text/html/parser/DocumentParser.java
protected void handleEndTag(TagElement tag) { }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/DocumentParser.java/buggy/core/src/classpath/javax/javax/swing/text/html/parser/DocumentParser.java
protected void handleError(int line, String message) { }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/DocumentParser.java/buggy/core/src/classpath/javax/javax/swing/text/html/parser/DocumentParser.java
protected void handleStartTag(TagElement tag) { }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/DocumentParser.java/buggy/core/src/classpath/javax/javax/swing/text/html/parser/DocumentParser.java
protected void handleText(char[] text) { }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/DocumentParser.java/buggy/core/src/classpath/javax/javax/swing/text/html/parser/DocumentParser.java
public synchronized void setData(byte[] buf) { if (buf == null) throw new NullPointerException("Null buffer"); buffer = buf;
public void setData(byte[] buf) { setData(buf, 0, buf.length);
public synchronized void setData(byte[] buf) { // This form of setData requires setLength to be called separately // and subsequently. if (buf == null) throw new NullPointerException("Null buffer"); buffer = buf; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7c463aa3bd840a934d101c434976bb7b25d5b975/DatagramPacket.java/buggy/core/src/classpath/java/java/net/DatagramPacket.java
super();
this.choice = choice;
public SwingChoicePeer(Choice choice) { super(); SwingToolkit.add(choice, this); SwingToolkit.copyAwtProperties(choice, this); final int cnt = choice.getItemCount(); for (int i = 0; i < cnt; i++) { addItem(choice.getItem(i), i); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ae9db4fc68ede9647d01b988919ce05ed61bf034/SwingChoicePeer.java/clean/gui/src/awt/org/jnode/awt/swingpeers/SwingChoicePeer.java
return (childValue == null || !(childValue instanceof Hashtable || childValue instanceof Vector || childValue.getClass() .isArray()));
return childValue == null || !(childValue instanceof Hashtable || childValue instanceof Vector || childValue.getClass().isArray());
public boolean isLeaf() { return (childValue == null || !(childValue instanceof Hashtable || childValue instanceof Vector || childValue.getClass() .isArray())); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JTree.java/clean/core/src/classpath/javax/javax/swing/JTree.java
if (oldValue!=null)
if (oldValue != null)
public void setLeadSelectionPath(TreePath path) { if (selectionModel != null) { TreePath oldValue = selectionModel.getLeadSelectionPath(); if (path.equals(oldValue)) return; // Repaint the previous and current rows with the lead selection path. if (path != null) { repaint(getPathBounds(path)); selectionModel.addSelectionPath(path); } if (oldValue!=null) repaint(getPathBounds(oldValue)); firePropertyChange(LEAD_SELECTION_PATH_PROPERTY, oldValue, path); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JTree.java/clean/core/src/classpath/javax/javax/swing/JTree.java
}
}
public TreePath[] getPaths() { return (TreePath[]) paths.clone(); } // getPaths()
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/TreeSelectionEvent.java/buggy/core/src/classpath/javax/javax/swing/event/TreeSelectionEvent.java