rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
| meta
stringlengths 141
403
|
---|---|---|---|
final X86RegisterPool pool = ec.getPool(); final Register newLsb = request(ec, pool); final Register newMsb = request(ec, pool); loadTo(ec, newLsb, newMsb); pool.transferOwnerTo(newLsb, this); pool.transferOwnerTo(newMsb, this); } | final X86RegisterPool pool = ec.getPool(); final Register newLsb = request(ec, pool); final Register newMsb = request(ec, pool); loadTo(ec, newLsb, newMsb); pool.transferOwnerTo(newLsb, this); pool.transferOwnerTo(newMsb, this); } | final void spill(EmitterContext ec, Register reg) { assertCondition((getKind() == Kind.REGISTER) && ((this.lsb == reg) || (this.msb == reg)), "spill1"); ec.getVStack().push(ec); if (isStack()) { return; } final X86RegisterPool pool = ec.getPool(); final Register newLsb = request(ec, pool); final Register newMsb = request(ec, pool); loadTo(ec, newLsb, newMsb); pool.transferOwnerTo(newLsb, this); pool.transferOwnerTo(newMsb, this); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e304bedac9ab86f88bdb27ffd782a9777505c449/DoubleWordItem.java/clean/core/src/core/org/jnode/vm/x86/compiler/l1a/DoubleWordItem.java |
return ((kind == Kind.REGISTER) && (msb.equals(reg) || lsb.equals(reg))); } | return ((kind == Kind.REGISTER) && (msb.equals(reg) || lsb.equals(reg))); } | final boolean uses(Register reg) { return ((kind == Kind.REGISTER) && (msb.equals(reg) || lsb.equals(reg))); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e304bedac9ab86f88bdb27ffd782a9777505c449/DoubleWordItem.java/clean/core/src/core/org/jnode/vm/x86/compiler/l1a/DoubleWordItem.java |
return ((kind == Kind.REGISTER) && !(pool.isCallerSaved(lsb) && pool.isCallerSaved(msb))); } | return ((kind == Kind.REGISTER) && !(pool.isCallerSaved(lsb) && pool .isCallerSaved(msb))); } | final boolean usesVolatileRegister(X86RegisterPool pool) { return ((kind == Kind.REGISTER) && !(pool.isCallerSaved(lsb) && pool.isCallerSaved(msb))); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e304bedac9ab86f88bdb27ffd782a9777505c449/DoubleWordItem.java/clean/core/src/core/org/jnode/vm/x86/compiler/l1a/DoubleWordItem.java |
static final void fxch(AbstractX86Stream os, FPUStack fpuStack, Register fpuReg) { if (fpuReg == Register.ST0) { throw new StackException("Cannot fxch ST0"); | static final void fxch(AbstractX86Stream os, FPUStack fpuStack, Item item) { if (!fpuStack.isTos(item)) { final Register fpuReg = fpuStack.getRegister(item); fxch(os, fpuStack, fpuReg); | static final void fxch(AbstractX86Stream os, FPUStack fpuStack, Register fpuReg) { if (fpuReg == Register.ST0) { throw new StackException("Cannot fxch ST0"); } os.writeFXCH(fpuReg); fpuStack.fxch(fpuReg); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4210cbd2e8532c8a29412a6b016e4072578a8de8/FPUHelper.java/buggy/core/src/core/org/jnode/vm/x86/compiler/l1a/FPUHelper.java |
os.writeFXCH(fpuReg); fpuStack.fxch(fpuReg); | static final void fxch(AbstractX86Stream os, FPUStack fpuStack, Register fpuReg) { if (fpuReg == Register.ST0) { throw new StackException("Cannot fxch ST0"); } os.writeFXCH(fpuReg); fpuStack.fxch(fpuReg); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4210cbd2e8532c8a29412a6b016e4072578a8de8/FPUHelper.java/buggy/core/src/core/org/jnode/vm/x86/compiler/l1a/FPUHelper.java |
|
public X500Principal (String name) | private X500Principal() | public X500Principal (String name) { this(); if (name == null) throw new NullPointerException(); try { parseString (name); } catch (IOException ioe) { IllegalArgumentException iae = new IllegalArgumentException("malformed name"); iae.initCause (ioe); throw iae; } } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c6ebf1f74ce34c04205e65bfd96c25a18c5a0861/X500Principal.java/clean/core/src/classpath/javax/javax/security/auth/x500/X500Principal.java |
this(); if (name == null) throw new NullPointerException(); try { parseString (name); } catch (IOException ioe) { IllegalArgumentException iae = new IllegalArgumentException("malformed name"); iae.initCause (ioe); throw iae; } } | components = new LinkedList(); currentRdn = new LinkedHashMap(); components.add (currentRdn); } | public X500Principal (String name) { this(); if (name == null) throw new NullPointerException(); try { parseString (name); } catch (IOException ioe) { IllegalArgumentException iae = new IllegalArgumentException("malformed name"); iae.initCause (ioe); throw iae; } } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c6ebf1f74ce34c04205e65bfd96c25a18c5a0861/X500Principal.java/clean/core/src/classpath/javax/javax/security/auth/x500/X500Principal.java |
public OID(String strRep) | public OID(int[] components) | public OID(String strRep) { this(strRep, false); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e81465c8dc08fe3c0a055c4bb1c2588e37b39c25/OID.java/buggy/core/src/classpath/gnu/gnu/java/security/OID.java |
this(strRep, false); | this(components, false); | public OID(String strRep) { this(strRep, false); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e81465c8dc08fe3c0a055c4bb1c2588e37b39c25/OID.java/buggy/core/src/classpath/gnu/gnu/java/security/OID.java |
encoded = new byte[0]; | IllegalArgumentException iae = new IllegalArgumentException (); iae.initCause (ioe); throw iae; | public byte[] getEncoded() { if (encoded == null) { try { ByteArrayOutputStream out = new ByteArrayOutputStream(); length = DERWriter.write(out, this); encoded = out.toByteArray(); } catch (IOException ioe) { encoded = new byte[0]; } } return (byte[]) encoded.clone(); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/DERValue.java/buggy/core/src/classpath/gnu/gnu/java/security/der/DERValue.java |
encoded = new byte[0]; | IllegalArgumentException iae = new IllegalArgumentException (); iae.initCause (ioe); throw iae; | public int getLength() { if (encoded == null) { try { ByteArrayOutputStream out = new ByteArrayOutputStream(); length = DERWriter.write(out, this); encoded = out.toByteArray(); } catch (IOException ioe) { encoded = new byte[0]; } } return length; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/DERValue.java/buggy/core/src/classpath/gnu/gnu/java/security/der/DERValue.java |
encoded = new byte[0]; | IllegalArgumentException iae = new IllegalArgumentException (); iae.initCause (ioe); throw iae; | public int getEncodedLength() { if (encoded == null) { try { ByteArrayOutputStream out = new ByteArrayOutputStream(); length = DERWriter.write(out, this); encoded = out.toByteArray(); } catch (IOException ioe) { encoded = new byte[0]; } } return encoded.length; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/DERValue.java/buggy/core/src/classpath/gnu/gnu/java/security/der/DERValue.java |
Toolkit tk = getToolkit(); if (! (tk instanceof EmbeddedWindowSupport)) throw new UnsupportedOperationException ("Embedded windows are not supported by the current peers: " + tk.getClass()); | ClasspathToolkit tk = (ClasspathToolkit) getToolkit(); | public void addNotify() { Toolkit tk = getToolkit(); if (! (tk instanceof EmbeddedWindowSupport)) throw new UnsupportedOperationException ("Embedded windows are not supported by the current peers: " + tk.getClass()); // Circumvent the package-privateness of the AWT internal // java.awt.Component.peer member variable. try { Field peerField = Component.class.getDeclaredField("peer"); AccessController.doPrivileged(new SetAccessibleAction(peerField)); peerField.set(this, ((EmbeddedWindowSupport) tk).createEmbeddedWindow (this)); } catch (IllegalAccessException e) { // This should never happen. } catch (NoSuchFieldException e) { // This should never happen. } super.addNotify(); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/50cfc3ee73e2e377b07c91f0e40a2f172b10fd27/EmbeddedWindow.java/clean/core/src/classpath/gnu/gnu/java/awt/EmbeddedWindow.java |
peerField.set(this, ((EmbeddedWindowSupport) tk).createEmbeddedWindow (this)); | peerField.set(this, tk.createEmbeddedWindow (this)); | public void addNotify() { Toolkit tk = getToolkit(); if (! (tk instanceof EmbeddedWindowSupport)) throw new UnsupportedOperationException ("Embedded windows are not supported by the current peers: " + tk.getClass()); // Circumvent the package-privateness of the AWT internal // java.awt.Component.peer member variable. try { Field peerField = Component.class.getDeclaredField("peer"); AccessController.doPrivileged(new SetAccessibleAction(peerField)); peerField.set(this, ((EmbeddedWindowSupport) tk).createEmbeddedWindow (this)); } catch (IllegalAccessException e) { // This should never happen. } catch (NoSuchFieldException e) { // This should never happen. } super.addNotify(); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/50cfc3ee73e2e377b07c91f0e40a2f172b10fd27/EmbeddedWindow.java/clean/core/src/classpath/gnu/gnu/java/awt/EmbeddedWindow.java |
addNotify() { | public void addNotify() { | addNotify(){ if (menuBar != null) menuBar.addNotify(); if (peer == null) peer = getToolkit ().createFrame (this); super.addNotify();} | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/Frame.java/buggy/core/src/classpath/java/java/awt/Frame.java |
} | } | addNotify(){ if (menuBar != null) menuBar.addNotify(); if (peer == null) peer = getToolkit ().createFrame (this); super.addNotify();} | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/Frame.java/buggy/core/src/classpath/java/java/awt/Frame.java |
public SetAccessibleAction(AccessibleObject member) | public SetAccessibleAction() | public SetAccessibleAction(AccessibleObject member) { this.member = member; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e81465c8dc08fe3c0a055c4bb1c2588e37b39c25/SetAccessibleAction.java/buggy/core/src/classpath/gnu/gnu/java/security/action/SetAccessibleAction.java |
this.member = member; | public SetAccessibleAction(AccessibleObject member) { this.member = member; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e81465c8dc08fe3c0a055c4bb1c2588e37b39c25/SetAccessibleAction.java/buggy/core/src/classpath/gnu/gnu/java/security/action/SetAccessibleAction.java |
|
File ses = new File(SESSIONS); | 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. File ses = new File(SESSIONS); if(ses.exists()) { settings.setProperty("emulator.settingsDirectory", System.getProperty("user.dir") + File.separator); } 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/c91e1701e94caeff60dd19745948841b95027425/GlobalConfigure.java/clean/tn5250j/src/org/tn5250j/GlobalConfigure.java |
|
settings.setProperty("emulator.settingsDirectory", System.getProperty("user.dir") + File.separator); | int cfc; settings.setProperty("emulator.settingsDirectory", System.getProperty("user.dir") + File.separator); 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); 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 the -Duser.home=<your home dir> parameter\n" + "to avoid this question popping up all the time.", "Using NON-STANDARD behaviour", JOptionPane.WARNING_MESSAGE); System.exit(0); } | 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. File ses = new File(SESSIONS); if(ses.exists()) { settings.setProperty("emulator.settingsDirectory", System.getProperty("user.dir") + File.separator); } 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/c91e1701e94caeff60dd19745948841b95027425/GlobalConfigure.java/clean/tn5250j/src/org/tn5250j/GlobalConfigure.java |
File sd = new File(settings.getProperty("emulator.settingsDirectory")); if (!sd.isDirectory()) sd.mkdirs(); | private void loadSettings() { FileInputStream in = 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); } else { try { in = new FileInputStream(settingsFile); settings.load(in); } catch (FileNotFoundException fnfe) { System.out.println(" Information Message: " + fnfe.getMessage() + ". The file " + settingsFile + " will" + " be created for first time use."); checkLegacy(); saveSettings(); } 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()); } } // we now check to see if the settings directory is a directory. If not then we create it File sd = new File(settings.getProperty("emulator.settingsDirectory")); if (!sd.isDirectory()) sd.mkdirs(); } | 1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/c91e1701e94caeff60dd19745948841b95027425/GlobalConfigure.java/clean/tn5250j/src/org/tn5250j/GlobalConfigure.java |
|
abstract public String getProperty(String regKey, String defaultValue); | abstract public String getProperty(String regKey); | abstract public String getProperty(String regKey, String defaultValue); | 1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/d176b045eb10d934c5b8bbe4ce787a7bbc5a271e/ConfigureFactory.java/buggy/tn5250j/src/org/tn5250j/interfaces/ConfigureFactory.java |
} | } | public void run() { drainEvents(); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/Timer.java/buggy/core/src/classpath/javax/javax/swing/Timer.java |
try | try | public void run() { running = true; try { sleep(initialDelay); queueEvent(); while (running) { try { sleep(delay); } catch (InterruptedException e) { return; } queueEvent(); if (logTimers) System.out.println("javax.swing.Timer -> clocktick"); if ( ! repeats) break; } running = false; } catch (Exception e) { // The timer is no longer running. running = false; } } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/Timer.java/buggy/core/src/classpath/javax/javax/swing/Timer.java |
public void run() { running = true; try { sleep(initialDelay); queueEvent(); while (running) { try { sleep(delay); } catch (InterruptedException e) { return; } queueEvent(); if (logTimers) System.out.println("javax.swing.Timer -> clocktick"); if ( ! repeats) break; } running = false; } catch (Exception e) { // The timer is no longer running. running = false; } } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/Timer.java/buggy/core/src/classpath/javax/javax/swing/Timer.java |
||
while (running) { try { sleep(delay); } catch (InterruptedException e) { return; } queueEvent(); | if (repeats) while (running) { try { sleep(delay); } catch (InterruptedException e) { return; } queueEvent(); | public void run() { running = true; try { sleep(initialDelay); queueEvent(); while (running) { try { sleep(delay); } catch (InterruptedException e) { return; } queueEvent(); if (logTimers) System.out.println("javax.swing.Timer -> clocktick"); if ( ! repeats) break; } running = false; } catch (Exception e) { // The timer is no longer running. running = false; } } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/Timer.java/buggy/core/src/classpath/javax/javax/swing/Timer.java |
if (logTimers) System.out.println("javax.swing.Timer -> clocktick"); if ( ! repeats) break; } running = false; } catch (Exception e) | if (logTimers) System.out.println("javax.swing.Timer -> clocktick"); if ( ! repeats) break; } running = false; } catch (Exception e) | public void run() { running = true; try { sleep(initialDelay); queueEvent(); while (running) { try { sleep(delay); } catch (InterruptedException e) { return; } queueEvent(); if (logTimers) System.out.println("javax.swing.Timer -> clocktick"); if ( ! repeats) break; } running = false; } catch (Exception e) { // The timer is no longer running. running = false; } } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/Timer.java/buggy/core/src/classpath/javax/javax/swing/Timer.java |
} | } | public void run() { running = true; try { sleep(initialDelay); queueEvent(); while (running) { try { sleep(delay); } catch (InterruptedException e) { return; } queueEvent(); if (logTimers) System.out.println("javax.swing.Timer -> clocktick"); if ( ! repeats) break; } running = false; } catch (Exception e) { // The timer is no longer running. running = false; } } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/Timer.java/buggy/core/src/classpath/javax/javax/swing/Timer.java |
setOpaque(true); | public SwingLabel(Label awtComponent) { this.awtComponent = awtComponent; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/dd5ff39999544f9f37603e35023d112e22fdd049/SwingLabelPeer.java/buggy/gui/src/awt/org/jnode/awt/swingpeers/SwingLabelPeer.java |
|
awtComponent.dispatchEvent(SwingToolkit.convertEvent(event, awtComponent)); | awtComponent.dispatchEvent(SwingToolkit.convertEvent(event, awtComponent)); | protected final void processEvent(AWTEvent event) { awtComponent.dispatchEvent(SwingToolkit.convertEvent(event, awtComponent)); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/dd5ff39999544f9f37603e35023d112e22fdd049/SwingLabelPeer.java/buggy/gui/src/awt/org/jnode/awt/swingpeers/SwingLabelPeer.java |
super(toolkit, label, new SwingLabel(label)); final JLabel jLabel = (JLabel) jComponent; SwingToolkit.add(label, jLabel); SwingToolkit.copyAwtProperties(label, jLabel); setText(label.getText()); } | super(toolkit, label, new SwingLabel(label)); SwingToolkit.add(label, jComponent); SwingToolkit.copyAwtProperties(label, jComponent); setText(label.getText()); setAlignment(label.getAlignment()); } | public SwingLabelPeer(SwingToolkit toolkit, Label label) { super(toolkit, label, new SwingLabel(label)); final JLabel jLabel = (JLabel) jComponent; SwingToolkit.add(label, jLabel); SwingToolkit.copyAwtProperties(label, jLabel); setText(label.getText()); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/dd5ff39999544f9f37603e35023d112e22fdd049/SwingLabelPeer.java/buggy/gui/src/awt/org/jnode/awt/swingpeers/SwingLabelPeer.java |
} | switch (alignment) { case Label.LEFT: jComponent.setHorizontalAlignment(SwingConstants.LEFT); break; case Label.CENTER: jComponent.setHorizontalAlignment(SwingConstants.CENTER); break; case Label.RIGHT: jComponent.setHorizontalAlignment(SwingConstants.RIGHT); break; } } | public void setAlignment(int alignment) { //TODO implement it } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/dd5ff39999544f9f37603e35023d112e22fdd049/SwingLabelPeer.java/buggy/gui/src/awt/org/jnode/awt/swingpeers/SwingLabelPeer.java |
((JLabel) jComponent).setText(text); } | jComponent.setText(text); } | public void setText(String text) { ((JLabel) jComponent).setText(text); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/dd5ff39999544f9f37603e35023d112e22fdd049/SwingLabelPeer.java/buggy/gui/src/awt/org/jnode/awt/swingpeers/SwingLabelPeer.java |
public CommandShell() throws NameNotFoundException, ShellException { this((ScrollableShellConsole) ((ConsoleManager) InitialNaming.lookup(ConsoleManager.NAME)).getFocus()); } | public CommandShell() throws NameNotFoundException, ShellException { this((ScrollableShellConsole) ((ConsoleManager) InitialNaming .lookup(ConsoleManager.NAME)).getFocus()); } | public CommandShell() throws NameNotFoundException, ShellException { this((ScrollableShellConsole) ((ConsoleManager) InitialNaming.lookup(ConsoleManager.NAME)).getFocus()); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/CommandShell.java/buggy/shell/src/shell/org/jnode/shell/CommandShell.java |
if (!cmdLineStr.equals(newestLine)) history.addCommand(cmdLineStr); } | if (!cmdLineStr.equals(newestLine)) history.addCommand(cmdLineStr); } | public void addCommandToHistory(String cmdLineStr) { // Add this command to the history. if (!cmdLineStr.equals(newestLine)) history.addCommand(cmdLineStr); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/CommandShell.java/buggy/shell/src/shell/org/jnode/shell/CommandShell.java |
try { ShellUtils.getShellManager().registerShell(this); } catch (NameNotFoundException ex) { } dirty = false; String result = null; try { CommandLine cl = new CommandLine(partial); String cmd = ""; if (cl.hasNext()) { cmd = cl.next(); if (!cmd.trim().equals("") && cl.hasNext()) try { Class cmdClass = getCommandClass(cmd); Help.Info info = Help.getInfo(cmdClass); result = cmd + " " + info.complete(cl); } catch (ClassNotFoundException ex) { throw new CompletionException("Command class not found"); } } if (result == null) result = defaultArg.complete(cmd); if (!partial.equals(result) && !dirty) { dirty = true; for (int i = 0; i < partial.length() + currentPrompt.length(); i++) System.out.print("\b"); } } catch (CompletionException ex) { System.out.println(); System.err.println(ex.getMessage()); result = partial; dirty = true; } if (dirty) { dirty = false; System.out.print(currentPrompt + result); } return result; } | try { ShellUtils.getShellManager().registerShell(this); } catch (NameNotFoundException ex) { } dirty = false; String result = null; try { CommandLine cl = new CommandLine(partial); String cmd = ""; if (cl.hasNext()) { cmd = cl.next(); if (!cmd.trim().equals("") && cl.hasNext()) try { Class cmdClass = getCommandClass(cmd); Help.Info info = Help.getInfo(cmdClass); result = cmd + " " + info.complete(cl); } catch (ClassNotFoundException ex) { throw new CompletionException( "Command class not found"); } catch (HelpException ex) { ex.printStackTrace(); throw new CompletionException( "Command class not found"); } } if (result == null) result = defaultArg.complete(cmd); if (!partial.equals(result) && !dirty) { dirty = true; for (int i = 0; i < partial.length() + currentPrompt.length(); i++) System.out.print("\b"); } } catch (CompletionException ex) { System.out.println(); System.err.println(ex.getMessage()); result = partial; dirty = true; } if (dirty) { dirty = false; System.out.print(currentPrompt + result); } return result; } | private String complete(String partial) { // workaround to set the currentShell to this shell try { ShellUtils.getShellManager().registerShell(this); } catch (NameNotFoundException ex) { } dirty = false; String result = null; try { CommandLine cl = new CommandLine(partial); String cmd = ""; if (cl.hasNext()) { cmd = cl.next(); if (!cmd.trim().equals("") && cl.hasNext()) try { // get command's help info Class cmdClass = getCommandClass(cmd); Help.Info info = Help.getInfo(cmdClass); // perform completion result = cmd + " " + info.complete(cl); // prepend command name and space // again } catch (ClassNotFoundException ex) { throw new CompletionException("Command class not found"); } } if (result == null) // assume this is the alias to be called result = defaultArg.complete(cmd); if (!partial.equals(result) && !dirty) { // performed direct completion without listing dirty = true; // indicate we want to have a new prompt for (int i = 0; i < partial.length() + currentPrompt.length(); i++) System.out.print("\b"); // clear line (cheap approach) } } catch (CompletionException ex) { System.out.println(); // next line System.err.println(ex.getMessage()); // print the error (optional) // this debug output is to trace where the Exception came from //ex.printStackTrace(System.err); result = partial; // restore old value dirty = true; // we need a new prompt } if (dirty) { dirty = false; System.out.print(currentPrompt + result); // print the prompt and go on with normal // operation } return result; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/CommandShell.java/buggy/shell/src/shell/org/jnode/shell/CommandShell.java |
return aliasMgr; } | return aliasMgr; } | public AliasManager getAliasManager() { return aliasMgr; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/CommandShell.java/buggy/shell/src/shell/org/jnode/shell/CommandShell.java |
try { return aliasMgr.getAliasClass(cmd); } catch (NoSuchAliasException ex) { final ClassLoader cl = Thread.currentThread().getContextClassLoader(); return cl.loadClass(cmd); } } | try { return aliasMgr.getAliasClass(cmd); } catch (NoSuchAliasException ex) { final ClassLoader cl = Thread.currentThread() .getContextClassLoader(); return cl.loadClass(cmd); } } | protected Class getCommandClass(String cmd) throws ClassNotFoundException { try { return aliasMgr.getAliasClass(cmd); } catch (NoSuchAliasException ex) { final ClassLoader cl = Thread.currentThread().getContextClassLoader(); return cl.loadClass(cmd); } } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/CommandShell.java/buggy/shell/src/shell/org/jnode/shell/CommandShell.java |
return history; } | return history; } | public CommandHistory getCommandHistory() { return history; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/CommandShell.java/buggy/shell/src/shell/org/jnode/shell/CommandShell.java |
return console; } | return console; } | public Console getConsole() { return console; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/CommandShell.java/buggy/shell/src/shell/org/jnode/shell/CommandShell.java |
return err; } | return err; } | public PrintStream getErrorStream() { return err; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/CommandShell.java/buggy/shell/src/shell/org/jnode/shell/CommandShell.java |
if (!isActive) return; switch(ke.getKeyCode()) { case KeyEvent.VK_UP: ke.consume(); if (historyIndex == -1) { newestLine = currentLine; historyIndex = history.size(); } historyIndex--; redisplay(); break; case KeyEvent.VK_DOWN: ke.consume(); if (historyIndex == history.size() - 1) historyIndex = -2; else if (historyIndex == -1) newestLine = currentLine; historyIndex++; redisplay(); break; case KeyEvent.VK_LEFT: ke.consume(); if(posOnCurrentLine > 0) { posOnCurrentLine--; refreshCurrentLine(); } break; case KeyEvent.VK_RIGHT: ke.consume(); if(posOnCurrentLine < currentLine.length()) { posOnCurrentLine++; refreshCurrentLine(); } break; case KeyEvent.VK_HOME: ke.consume(); posOnCurrentLine = 0; refreshCurrentLine(); break; case KeyEvent.VK_END: ke.consume(); posOnCurrentLine = currentLine.length(); refreshCurrentLine(); break; case KeyEvent.VK_BACK_SPACE: ke.consume(); if (currentLine.length() != 0 && posOnCurrentLine > 0) { posOnCurrentLine --; currentLine = currentLine.substring(0, posOnCurrentLine)+ currentLine.substring(posOnCurrentLine+1, currentLine.length()); refreshCurrentLine(); } break; case KeyEvent.VK_DELETE: ke.consume(); if(posOnCurrentLine == 0 && currentLine.length() > 0) { currentLine = currentLine.substring(1); } else if(posOnCurrentLine < currentLine.length()) { currentLine = currentLine.substring(0, posOnCurrentLine)+ currentLine.substring(posOnCurrentLine+1, currentLine.length()); } refreshCurrentLine(); break; case KeyEvent.VK_ENTER: out.print(ke.getKeyChar()); ke.consume(); posOnCurrentLine = 0; synchronized (this) { isActive = false; threadSuspended = false; notifyAll(); } break; case KeyEvent.VK_TAB: ke.consume(); if(posOnCurrentLine != currentLine.length()) { String ending = currentLine.substring(posOnCurrentLine); currentLine = complete(currentLine.substring(0, posOnCurrentLine))+ending; posOnCurrentLine = currentLine.length() - ending.length(); } else { currentLine = complete(currentLine); posOnCurrentLine = currentLine.length(); } break; default: if (!Character.isISOControl(ke.getKeyChar())) { ke.consume(); if(posOnCurrentLine == currentLine.length()) { currentLine += ke.getKeyChar(); } else { currentLine = currentLine.substring(0, posOnCurrentLine) + ke.getKeyChar() + currentLine.substring(posOnCurrentLine); } posOnCurrentLine++; refreshCurrentLine(); } } } | if (!isActive) return; switch (ke.getKeyCode()) { case KeyEvent.VK_UP: ke.consume(); if (historyIndex == -1) { newestLine = currentLine; historyIndex = history.size(); } historyIndex--; redisplay(); break; case KeyEvent.VK_DOWN: ke.consume(); if (historyIndex == history.size() - 1) historyIndex = -2; else if (historyIndex == -1) newestLine = currentLine; historyIndex++; redisplay(); break; case KeyEvent.VK_LEFT: ke.consume(); if (posOnCurrentLine > 0) { posOnCurrentLine--; refreshCurrentLine(); } break; case KeyEvent.VK_RIGHT: ke.consume(); if (posOnCurrentLine < currentLine.length()) { posOnCurrentLine++; refreshCurrentLine(); } break; case KeyEvent.VK_HOME: ke.consume(); posOnCurrentLine = 0; refreshCurrentLine(); break; case KeyEvent.VK_END: ke.consume(); posOnCurrentLine = currentLine.length(); refreshCurrentLine(); break; case KeyEvent.VK_BACK_SPACE: ke.consume(); if (currentLine.length() != 0 && posOnCurrentLine > 0) { posOnCurrentLine--; currentLine = currentLine.substring(0, posOnCurrentLine) + currentLine.substring(posOnCurrentLine + 1, currentLine.length()); refreshCurrentLine(); } break; case KeyEvent.VK_DELETE: ke.consume(); if (posOnCurrentLine == 0 && currentLine.length() > 0) { currentLine = currentLine.substring(1); } else if (posOnCurrentLine < currentLine.length()) { currentLine = currentLine.substring(0, posOnCurrentLine) + currentLine.substring(posOnCurrentLine + 1, currentLine.length()); } refreshCurrentLine(); break; case KeyEvent.VK_ENTER: out.print(ke.getKeyChar()); ke.consume(); posOnCurrentLine = 0; synchronized (this) { isActive = false; threadSuspended = false; notifyAll(); } break; case KeyEvent.VK_TAB: ke.consume(); if (posOnCurrentLine != currentLine.length()) { String ending = currentLine.substring(posOnCurrentLine); currentLine = complete(currentLine.substring(0, posOnCurrentLine)) + ending; posOnCurrentLine = currentLine.length() - ending.length(); } else { currentLine = complete(currentLine); posOnCurrentLine = currentLine.length(); } break; default: if (!Character.isISOControl(ke.getKeyChar())) { ke.consume(); if (posOnCurrentLine == currentLine.length()) { currentLine += ke.getKeyChar(); } else { currentLine = currentLine.substring(0, posOnCurrentLine) + ke.getKeyChar() + currentLine.substring(posOnCurrentLine); } posOnCurrentLine++; refreshCurrentLine(); } } } | public void keyPressed(KeyboardEvent ke) { // make sure we are ready to intercept the keyboard if (!isActive) return; switch(ke.getKeyCode()) { // intercept the up and down arrow keys case KeyEvent.VK_UP: ke.consume(); if (historyIndex == -1) { newestLine = currentLine; historyIndex = history.size(); } historyIndex--; redisplay(); break; case KeyEvent.VK_DOWN: ke.consume(); if (historyIndex == history.size() - 1) historyIndex = -2; else if (historyIndex == -1) newestLine = currentLine; historyIndex++; redisplay(); break; case KeyEvent.VK_LEFT: //Left the cursor goes left ke.consume(); if(posOnCurrentLine > 0) { posOnCurrentLine--; refreshCurrentLine(); } break; case KeyEvent.VK_RIGHT: // Right the cursor goes right ke.consume(); if(posOnCurrentLine < currentLine.length()) { posOnCurrentLine++; refreshCurrentLine(); } break; case KeyEvent.VK_HOME: // The cursor goes at the start ke.consume(); posOnCurrentLine = 0; refreshCurrentLine(); break; case KeyEvent.VK_END: // the cursor goes at the end of line ke.consume(); posOnCurrentLine = currentLine.length(); refreshCurrentLine(); break; // if its a backspace we want to remove one from the end of our current line case KeyEvent.VK_BACK_SPACE: ke.consume(); if (currentLine.length() != 0 && posOnCurrentLine > 0) { posOnCurrentLine --; currentLine = currentLine.substring(0, posOnCurrentLine)+ currentLine.substring(posOnCurrentLine+1, currentLine.length()); refreshCurrentLine(); } break; // if its a delete we want to remove one under the cursor case KeyEvent.VK_DELETE: ke.consume(); if(posOnCurrentLine == 0 && currentLine.length() > 0) { currentLine = currentLine.substring(1); } else if(posOnCurrentLine < currentLine.length()) { currentLine = currentLine.substring(0, posOnCurrentLine)+ currentLine.substring(posOnCurrentLine+1, currentLine.length()); } refreshCurrentLine(); break; // if its an enter key we want to process the command, and then resume the thread case KeyEvent.VK_ENTER: out.print(ke.getKeyChar()); ke.consume(); posOnCurrentLine = 0; synchronized (this) { isActive = false; threadSuspended = false; notifyAll(); } break; // if it's the tab key, we want to trigger command line completion case KeyEvent.VK_TAB: ke.consume(); if(posOnCurrentLine != currentLine.length()) { String ending = currentLine.substring(posOnCurrentLine); currentLine = complete(currentLine.substring(0, posOnCurrentLine))+ending; posOnCurrentLine = currentLine.length() - ending.length(); } else { currentLine = complete(currentLine); posOnCurrentLine = currentLine.length(); } break; default: // if its a useful key we want to add it to our current line if (!Character.isISOControl(ke.getKeyChar())) { ke.consume(); if(posOnCurrentLine == currentLine.length()) { currentLine += ke.getKeyChar(); } else { currentLine = currentLine.substring(0, posOnCurrentLine) + ke.getKeyChar() + currentLine.substring(posOnCurrentLine); } posOnCurrentLine++; refreshCurrentLine(); } } } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/CommandShell.java/buggy/shell/src/shell/org/jnode/shell/CommandShell.java |
} | } | public void keyReleased(KeyboardEvent ke) { // do nothing } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/CommandShell.java/buggy/shell/src/shell/org/jnode/shell/CommandShell.java |
System.out.println(); for (int i = 0; i < items.length; i++) System.out.println(items[i]); dirty = true; } | System.out.println(); for (int i = 0; i < items.length; i++) System.out.println(items[ i]); dirty = true; } | public void list(String[] items) { System.out.println(); for (int i = 0; i < items.length; i++) System.out.println(items[i]); dirty = true; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/CommandShell.java/buggy/shell/src/shell/org/jnode/shell/CommandShell.java |
commandInvoker.invoke(cmdLineStr); } | commandInvoker.invoke(cmdLineStr); } | protected void processCommand(String cmdLineStr) { commandInvoker.invoke(cmdLineStr); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/CommandShell.java/buggy/shell/src/shell/org/jnode/shell/CommandShell.java |
String prompt = System.getProperty(PROMPT_PROPERTY_NAME); final StringBuffer result = new StringBuffer(); boolean commandMode = false; try { StringReader reader = new StringReader(prompt); int i; while ((i = reader.read()) != -1) { char c = (char) i; if (commandMode) { switch (c) { case 'P' : result.append(new File((String)AccessController.doPrivileged(new GetPropertyAction("user.dir")))); break; case 'G' : result.append("> "); break; case 'D' : final Date now = new Date(); DateFormat.getDateTimeInstance().format(now, result, null); break; default : result.append(c); } commandMode = false; } else { switch (c) { case '$' : commandMode = true; break; default : result.append(c); } } } } catch (Exception ioex) { log.error("Error in prompt()", ioex); } return result.toString(); } | String prompt = System.getProperty(PROMPT_PROPERTY_NAME); final StringBuffer result = new StringBuffer(); boolean commandMode = false; try { StringReader reader = new StringReader(prompt); int i; while ((i = reader.read()) != -1) { char c = (char) i; if (commandMode) { switch (c) { case 'P': result.append(new File( (String) AccessController .doPrivileged(new GetPropertyAction( "user.dir")))); break; case 'G': result.append("> "); break; case 'D': final Date now = new Date(); DateFormat.getDateTimeInstance().format(now, result, null); break; default: result.append(c); } commandMode = false; } else { switch (c) { case '$': commandMode = true; break; default: result.append(c); } } } } catch (Exception ioex) { log.error("Error in prompt()", ioex); } return result.toString(); } | protected String prompt() { String prompt = System.getProperty(PROMPT_PROPERTY_NAME); final StringBuffer result = new StringBuffer(); boolean commandMode = false; try { StringReader reader = new StringReader(prompt); int i; while ((i = reader.read()) != -1) { char c = (char) i; if (commandMode) { switch (c) { case 'P' : result.append(new File((String)AccessController.doPrivileged(new GetPropertyAction("user.dir")))); break; case 'G' : result.append("> "); break; case 'D' : final Date now = new Date(); DateFormat.getDateTimeInstance().format(now, result, null); break; default : result.append(c); } commandMode = false; } else { switch (c) { case '$' : commandMode = true; break; default : result.append(c); } } } } catch (Exception ioex) { // This should never occur log.error("Error in prompt()", ioex); } return result.toString(); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/CommandShell.java/buggy/shell/src/shell/org/jnode/shell/CommandShell.java |
if (console != null) { console.clearLine(console.getCursorY()); } out.print(currentPrompt); if (historyIndex == -1) currentLine = newestLine; else currentLine = history.getCommand(historyIndex); out.print(currentLine); posOnCurrentLine = currentLine.length(); } | if (console != null) { console.clearLine(console.getCursorY()); } out.print(currentPrompt); if (historyIndex == -1) currentLine = newestLine; else currentLine = history.getCommand(historyIndex); out.print(currentLine); posOnCurrentLine = currentLine.length(); } | private void redisplay() { // clear the line if (console != null) { console.clearLine(console.getCursorY()); } // display the prompt out.print(currentPrompt); // display the required history/current line if (historyIndex == -1) currentLine = newestLine; else currentLine = history.getCommand(historyIndex); out.print(currentLine); posOnCurrentLine = currentLine.length(); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/CommandShell.java/buggy/shell/src/shell/org/jnode/shell/CommandShell.java |
try { int y = console.getCursorY(); console.clearLine(y); /* Uncomment this to display cursor position console.clearLine(y-25); console.setCursor(0, y-1); err.print("Cursor pos : x = "+currentPrompt.length() + posOnCurrentLine+", y = "+y); console.setCursor(0, y); */ out.print(currentPrompt + currentLine + " "); console.setCursor(currentPrompt.length() + posOnCurrentLine, console.getCursorY()); } catch (Exception e) { } } | try { int y = console.getCursorY(); console.clearLine(y); /* * Uncomment this to display cursor position * console.clearLine(y-25); console.setCursor(0, y-1); * err.print("Cursor pos : x = "+currentPrompt.length() + * posOnCurrentLine+", y = "+y); console.setCursor(0, y); */ out.print(currentPrompt + currentLine + " "); console.setCursor(currentPrompt.length() + posOnCurrentLine, console.getCursorY()); } catch (Exception e) { } } | private void refreshCurrentLine() { try { int y = console.getCursorY(); console.clearLine(y); /* Uncomment this to display cursor position console.clearLine(y-25); console.setCursor(0, y-1); err.print("Cursor pos : x = "+currentPrompt.length() + posOnCurrentLine+", y = "+y); console.setCursor(0, y); */ out.print(currentPrompt + currentLine + " "); console.setCursor(currentPrompt.length() + posOnCurrentLine, console.getCursorY()); } catch (Exception e) { } } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/CommandShell.java/buggy/shell/src/shell/org/jnode/shell/CommandShell.java |
final String cmdLine = (String)AccessController.doPrivileged(new GetPropertyAction("jnode.cmdline", "")); final StringTokenizer tok = new StringTokenizer(cmdLine); while (tok.hasMoreTokens()) { final String e = tok.nextToken(); try { if (e.startsWith("cmd=")) { final String cmd = e.substring("cmd=".length()); currentPrompt = prompt(); out.println(currentPrompt + cmd); processCommand(cmd); } } catch (Throwable ex) { ex.printStackTrace(err); } } boolean halt = false; while (!halt) { try { synchronized (this) { isActive = true; currentPrompt = prompt(); out.print(currentPrompt); threadSuspended = true; while (threadSuspended) wait(); if (currentLine.length() > 0) processCommand(currentLine.trim()); if (currentLine.trim().equals("halt")) halt = true; currentLine = ""; historyIndex = -1; } } catch (Throwable ex) { ex.printStackTrace(err); } } } | final String cmdLine = (String) AccessController .doPrivileged(new GetPropertyAction("jnode.cmdline", "")); final StringTokenizer tok = new StringTokenizer(cmdLine); while (tok.hasMoreTokens()) { final String e = tok.nextToken(); try { if (e.startsWith("cmd=")) { final String cmd = e.substring("cmd=".length()); currentPrompt = prompt(); out.println(currentPrompt + cmd); processCommand(cmd); } } catch (Throwable ex) { ex.printStackTrace(err); } } boolean halt = false; while (!halt) { try { synchronized (this) { isActive = true; currentPrompt = prompt(); out.print(currentPrompt); threadSuspended = true; while (threadSuspended) wait(); if (currentLine.length() > 0) processCommand(currentLine.trim()); if (currentLine.trim().equals("halt")) halt = true; currentLine = ""; historyIndex = -1; } } catch (Throwable ex) { ex.printStackTrace(err); } } } | public void run() { // Run commands from the JNode commandline first final String cmdLine = (String)AccessController.doPrivileged(new GetPropertyAction("jnode.cmdline", "")); final StringTokenizer tok = new StringTokenizer(cmdLine); while (tok.hasMoreTokens()) { final String e = tok.nextToken(); try { if (e.startsWith("cmd=")) { final String cmd = e.substring("cmd=".length()); currentPrompt = prompt(); out.println(currentPrompt + cmd); processCommand(cmd); } } catch (Throwable ex) { ex.printStackTrace(err); } } // Now become interactive boolean halt = false; while (!halt) { try { synchronized (this) { // Catch keyboard events isActive = true; currentPrompt = prompt(); out.print(currentPrompt); // wait until enter is hit threadSuspended = true; while (threadSuspended) wait(); if (currentLine.length() > 0) processCommand(currentLine.trim()); if (currentLine.trim().equals("halt")) halt = true; currentLine = ""; historyIndex = -1; } } catch (Throwable ex) { ex.printStackTrace(err); } } } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/CommandShell.java/buggy/shell/src/shell/org/jnode/shell/CommandShell.java |
this.commandInvoker = defaultCommandInvoker; } | this.commandInvoker = defaultCommandInvoker; } | public void setDefaultCommandInvoker() { this.commandInvoker = defaultCommandInvoker; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/CommandShell.java/buggy/shell/src/shell/org/jnode/shell/CommandShell.java |
this.commandInvoker = threadCommandInvoker; } | this.commandInvoker = threadCommandInvoker; } | public void setThreadCommandInvoker() { this.commandInvoker = threadCommandInvoker; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/CommandShell.java/buggy/shell/src/shell/org/jnode/shell/CommandShell.java |
public AliasArgument(String name, String description) { super(name, description); | public AliasArgument(String name, String description, boolean multi) { super(name, description, multi); | public AliasArgument(String name, String description) { super(name, description); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/AliasArgument.java/buggy/shell/src/shell/org/jnode/shell/help/AliasArgument.java |
public ShellException(String message, Throwable cause) { super(message, cause); | public ShellException() { super(); | public ShellException(String message, Throwable cause) { super(message, cause); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/ShellException.java/buggy/shell/src/shell/org/jnode/shell/ShellException.java |
public abstract StringBuffer format (Date date, StringBuffer buf, FieldPosition pos); | public final StringBuffer format (Object obj, StringBuffer buf, FieldPosition pos) { if (obj instanceof Number) obj = new Date(((Number) obj).longValue()); else if (! (obj instanceof Date)) throw new IllegalArgumentException ("Cannot format given Object as a Date"); return format ((Date) obj, buf, pos); } | public abstract StringBuffer format (Date date, StringBuffer buf, FieldPosition pos); | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1a6944e2b647ccd9f0a45036fbe2dcd289ca1699/DateFormat.java/buggy/core/src/classpath/java/java/text/DateFormat.java |
public int add(SocketBuffer skbuf, int index, int length) { | public int add(byte[] src, int srcOffset, int length) { | public int add(SocketBuffer skbuf, int index, int length) { if (length > getFreeSize()) { throw new IllegalArgumentException("Not enough free space"); } final int dstOffset = this.used; skbuf.get(this.data, dstOffset, index, length); this.used += length; return dstOffset; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/TCPDataBuffer.java/buggy/net/src/net/org/jnode/net/ipv4/tcp/TCPDataBuffer.java |
skbuf.get(this.data, dstOffset, index, length); | System.arraycopy(src, srcOffset, this.data, dstOffset, length); | public int add(SocketBuffer skbuf, int index, int length) { if (length > getFreeSize()) { throw new IllegalArgumentException("Not enough free space"); } final int dstOffset = this.used; skbuf.get(this.data, dstOffset, index, length); this.used += length; return dstOffset; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/TCPDataBuffer.java/buggy/net/src/net/org/jnode/net/ipv4/tcp/TCPDataBuffer.java |
public short loadShort(Offset offset) { | public short loadShort() { | public short loadShort(Offset offset) { return (short) 0; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/Address.java/buggy/core/src/vmmagic/org/vmmagic/unboxed/Address.java |
public char loadChar(Offset offset) { | public char loadChar() { | public char loadChar(Offset offset) { return (char) 0; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/Address.java/buggy/core/src/vmmagic/org/vmmagic/unboxed/Address.java |
public DDC1NoSignalException(String s) { super(s); | public DDC1NoSignalException() { super(); | public DDC1NoSignalException(String s) { super(s); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/DDC1NoSignalException.java/buggy/gui/src/driver/org/jnode/driver/video/ddc/DDC1NoSignalException.java |
SecurityManager s = System.getSecurityManager(); if (s != null) | SecurityManager s = System.getSecurityManager(); if (s != null) | public void bind(SocketAddress address) throws SocketException { if (isClosed()) throw new SocketException("socket is closed"); if (! (address instanceof InetSocketAddress)) throw new IllegalArgumentException("unsupported address type"); InetAddress addr = ((InetSocketAddress) address).getAddress(); int port = ((InetSocketAddress) address).getPort(); if (port < 0 || port > 65535) throw new IllegalArgumentException("Invalid port: " + port); SecurityManager s = System.getSecurityManager(); if (s != null) s.checkListen(port); if (addr == null) addr = InetAddress.ANY_IF; try { getImpl().bind(port, addr); bound = true; } catch (SocketException exception) { getImpl().close(); throw exception; } catch (RuntimeException exception) { getImpl().close(); throw exception; } catch (Error error) { getImpl().close(); throw error; } } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
} | } | public void close() { if (isClosed()) return; try { getImpl().close(); } catch (SocketException e) { // Ignore this case, just close the socket in finally clause. } finally { remoteAddress = null; remotePort = -1; impl = null; } try { if (getChannel() != null) getChannel().close(); } catch (IOException e) { // Do nothing. } } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
if ((port < 1) || (port > 65535)) | if ((port < 1) || (port > 65535)) | public void connect(InetAddress address, int port) { if (address == null) throw new IllegalArgumentException("Connect address may not be null"); if ((port < 1) || (port > 65535)) throw new IllegalArgumentException("Port number is illegal: " + port); SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkConnect(address.getHostName(), port); try { getImpl().connect(address, port); remoteAddress = address; remotePort = port; } catch (SocketException e) { // This means simply not connected or connect not implemented. } } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkConnect(address.getHostName(), port); | SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkConnect(address.getHostAddress(), port); | public void connect(InetAddress address, int port) { if (address == null) throw new IllegalArgumentException("Connect address may not be null"); if ((port < 1) || (port > 65535)) throw new IllegalArgumentException("Port number is illegal: " + port); SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkConnect(address.getHostName(), port); try { getImpl().connect(address, port); remoteAddress = address; remotePort = port; } catch (SocketException e) { // This means simply not connected or connect not implemented. } } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
} | } | public void connect(InetAddress address, int port) { if (address == null) throw new IllegalArgumentException("Connect address may not be null"); if ((port < 1) || (port > 65535)) throw new IllegalArgumentException("Port number is illegal: " + port); SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkConnect(address.getHostName(), port); try { getImpl().connect(address, port); remoteAddress = address; remotePort = port; } catch (SocketException e) { // This means simply not connected or connect not implemented. } } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
} | } | public void disconnect() { if (! isConnected()) return; try { getImpl().disconnect(); } catch (SocketException e) { // This cannot happen as we are connected. } finally { remoteAddress = null; remotePort = -1; } } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
} | } | public boolean getBroadcast() throws SocketException { if (isClosed()) throw new SocketException("socket is closed"); Object buf = getImpl().getOption(SocketOptions.SO_BROADCAST); if (buf instanceof Boolean) return ((Boolean) buf).booleanValue(); throw new SocketException("unexpected type"); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
} | } | public DatagramChannel getChannel() { return null; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
} | } | DatagramSocketImpl getImpl() throws SocketException { try { if (! implCreated) { impl.create(); implCreated = true; } return impl; } catch (IOException e) { SocketException se = new SocketException(); se.initCause(e); throw se; } } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
} | } | DatagramSocketImpl getImpl() throws SocketException { try { if (! implCreated) { impl.create(); implCreated = true; } return impl; } catch (IOException e) { SocketException se = new SocketException(); se.initCause(e); throw se; } } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
} } | } } | DatagramSocketImpl getImpl() throws SocketException { try { if (! implCreated) { impl.create(); implCreated = true; } return impl; } catch (IOException e) { SocketException se = new SocketException(); se.initCause(e); throw se; } } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
return remoteAddress; } | return remoteAddress; } | public InetAddress getInetAddress() { return remoteAddress; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
return null; | return null; | public InetAddress getLocalAddress() { if (! isBound()) return null; InetAddress localAddr; try { localAddr = (InetAddress) getImpl().getOption(SocketOptions.SO_BINDADDR); SecurityManager s = System.getSecurityManager(); if (s != null) s.checkConnect(localAddr.getHostName(), -1); } catch (SecurityException e) { localAddr = InetAddress.ANY_IF; } catch (SocketException e) { // This cannot happen as we are bound. return null; } return localAddr; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
s.checkConnect(localAddr.getHostName(), -1); | s.checkConnect(localAddr.getHostAddress(), -1); | public InetAddress getLocalAddress() { if (! isBound()) return null; InetAddress localAddr; try { localAddr = (InetAddress) getImpl().getOption(SocketOptions.SO_BINDADDR); SecurityManager s = System.getSecurityManager(); if (s != null) s.checkConnect(localAddr.getHostName(), -1); } catch (SecurityException e) { localAddr = InetAddress.ANY_IF; } catch (SocketException e) { // This cannot happen as we are bound. return null; } return localAddr; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
} | } | public InetAddress getLocalAddress() { if (! isBound()) return null; InetAddress localAddr; try { localAddr = (InetAddress) getImpl().getOption(SocketOptions.SO_BINDADDR); SecurityManager s = System.getSecurityManager(); if (s != null) s.checkConnect(localAddr.getHostName(), -1); } catch (SecurityException e) { localAddr = InetAddress.ANY_IF; } catch (SocketException e) { // This cannot happen as we are bound. return null; } return localAddr; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
} | } | public int getLocalPort() { if (isClosed()) return -1; try { return getImpl().getLocalPort(); } catch (SocketException e) { // This cannot happen as we are bound. return 0; } } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
return null; | return null; | public SocketAddress getLocalSocketAddress() { if (! isBound()) return null; return new InetSocketAddress(getLocalAddress(), getLocalPort()); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
} | } | public SocketAddress getLocalSocketAddress() { if (! isBound()) return null; return new InetSocketAddress(getLocalAddress(), getLocalPort()); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
return remotePort; } | return remotePort; } | public int getPort() { return remotePort; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
} | } | public int getReceiveBufferSize() throws SocketException { if (isClosed()) throw new SocketException("socket is closed"); Object buf = getImpl().getOption(SocketOptions.SO_RCVBUF); if (buf instanceof Integer) return ((Integer) buf).intValue(); throw new SocketException("unexpected type"); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
return null; | return null; | public SocketAddress getRemoteSocketAddress() { if (! isConnected()) return null; return new InetSocketAddress(remoteAddress, remotePort); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
return new InetSocketAddress(remoteAddress, remotePort); } | return new InetSocketAddress(remoteAddress, remotePort); } | public SocketAddress getRemoteSocketAddress() { if (! isConnected()) return null; return new InetSocketAddress(remoteAddress, remotePort); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
} | } | public boolean getReuseAddress() throws SocketException { if (isClosed()) throw new SocketException("socket is closed"); Object buf = getImpl().getOption(SocketOptions.SO_REUSEADDR); if (buf instanceof Boolean) return ((Boolean) buf).booleanValue(); throw new SocketException("unexpected type"); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
} | } | public int getSendBufferSize() throws SocketException { if (isClosed()) throw new SocketException("socket is closed"); Object buf = getImpl().getOption(SocketOptions.SO_SNDBUF); if (buf instanceof Integer) return ((Integer) buf).intValue(); throw new SocketException("unexpected type"); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
} | } | public synchronized int getSoTimeout() throws SocketException { if (isClosed()) throw new SocketException("socket is closed"); Object buf = getImpl().getOption(SocketOptions.SO_TIMEOUT); if (buf instanceof Integer) return ((Integer) buf).intValue(); throw new SocketException("unexpected type"); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
} | } | public int getTrafficClass() throws SocketException { if (isClosed()) throw new SocketException("socket is closed"); Object buf = getImpl().getOption(SocketOptions.IP_TOS); if (buf instanceof Integer) return ((Integer) buf).intValue(); throw new SocketException("unexpected type"); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
} | } | public boolean isBound() { return bound; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
} | } | public boolean isClosed() { return impl == null; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
return remoteAddress != null; } | return remoteAddress != null; } | public boolean isConnected() { return remoteAddress != null; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
getImpl().receive(p); | DatagramPacket p2 = new DatagramPacket(p.getData(), p.getOffset(), p.maxlen); getImpl().receive(p2); p.length = p2.length; if (p2.getAddress() != null) p.setAddress(p2.getAddress()); if (p2.getPort() != -1) p.setPort(p2.getPort()); | public synchronized void receive(DatagramPacket p) throws IOException { if (isClosed()) throw new SocketException("socket is closed"); if (remoteAddress != null && remoteAddress.isMulticastAddress()) throw new IOException ("Socket connected to a multicast address my not receive"); if (getChannel() != null && ! getChannel().isBlocking() && ! ((DatagramChannelImpl) getChannel()).isInChannelOperation()) throw new IllegalBlockingModeException(); getImpl().receive(p); SecurityManager s = System.getSecurityManager(); if (s != null && isConnected()) s.checkAccept(p.getAddress().getHostName(), p.getPort()); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
SecurityManager s = System.getSecurityManager(); if (s != null && isConnected()) s.checkAccept(p.getAddress().getHostName(), p.getPort()); } | SecurityManager s = System.getSecurityManager(); if (s != null && isConnected()) s.checkAccept(p.getAddress().getHostAddress(), p.getPort()); } | public synchronized void receive(DatagramPacket p) throws IOException { if (isClosed()) throw new SocketException("socket is closed"); if (remoteAddress != null && remoteAddress.isMulticastAddress()) throw new IOException ("Socket connected to a multicast address my not receive"); if (getChannel() != null && ! getChannel().isBlocking() && ! ((DatagramChannelImpl) getChannel()).isInChannelOperation()) throw new IllegalBlockingModeException(); getImpl().receive(p); SecurityManager s = System.getSecurityManager(); if (s != null && isConnected()) s.checkAccept(p.getAddress().getHostName(), p.getPort()); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
SecurityManager s = System.getSecurityManager(); | SecurityManager s = System.getSecurityManager(); | public void send(DatagramPacket p) throws IOException { if (isClosed()) throw new SocketException("socket is closed"); // JDK1.2: Don't do security checks if socket is connected; see jdk1.2 api. SecurityManager s = System.getSecurityManager(); if (s != null && ! isConnected()) { InetAddress addr = p.getAddress(); if (addr.isMulticastAddress()) s.checkMulticast(addr); else s.checkConnect(addr.getHostAddress(), p.getPort()); } if (isConnected()) { if (p.getAddress() != null && (remoteAddress != p.getAddress() || remotePort != p.getPort())) throw new IllegalArgumentException ("DatagramPacket address does not match remote address"); } // FIXME: if this is a subclass of MulticastSocket, // use getTimeToLive for TTL val. if (getChannel() != null && ! getChannel().isBlocking() && ! ((DatagramChannelImpl) getChannel()).isInChannelOperation()) throw new IllegalBlockingModeException(); getImpl().send(p); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
InetAddress addr = p.getAddress(); if (addr.isMulticastAddress()) s.checkMulticast(addr); else s.checkConnect(addr.getHostAddress(), p.getPort()); } | InetAddress addr = p.getAddress(); if (addr.isMulticastAddress()) s.checkMulticast(addr); else s.checkConnect(addr.getHostAddress(), p.getPort()); } | public void send(DatagramPacket p) throws IOException { if (isClosed()) throw new SocketException("socket is closed"); // JDK1.2: Don't do security checks if socket is connected; see jdk1.2 api. SecurityManager s = System.getSecurityManager(); if (s != null && ! isConnected()) { InetAddress addr = p.getAddress(); if (addr.isMulticastAddress()) s.checkMulticast(addr); else s.checkConnect(addr.getHostAddress(), p.getPort()); } if (isConnected()) { if (p.getAddress() != null && (remoteAddress != p.getAddress() || remotePort != p.getPort())) throw new IllegalArgumentException ("DatagramPacket address does not match remote address"); } // FIXME: if this is a subclass of MulticastSocket, // use getTimeToLive for TTL val. if (getChannel() != null && ! getChannel().isBlocking() && ! ((DatagramChannelImpl) getChannel()).isInChannelOperation()) throw new IllegalBlockingModeException(); getImpl().send(p); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
} | } | public void send(DatagramPacket p) throws IOException { if (isClosed()) throw new SocketException("socket is closed"); // JDK1.2: Don't do security checks if socket is connected; see jdk1.2 api. SecurityManager s = System.getSecurityManager(); if (s != null && ! isConnected()) { InetAddress addr = p.getAddress(); if (addr.isMulticastAddress()) s.checkMulticast(addr); else s.checkConnect(addr.getHostAddress(), p.getPort()); } if (isConnected()) { if (p.getAddress() != null && (remoteAddress != p.getAddress() || remotePort != p.getPort())) throw new IllegalArgumentException ("DatagramPacket address does not match remote address"); } // FIXME: if this is a subclass of MulticastSocket, // use getTimeToLive for TTL val. if (getChannel() != null && ! getChannel().isBlocking() && ! ((DatagramChannelImpl) getChannel()).isInChannelOperation()) throw new IllegalBlockingModeException(); getImpl().send(p); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
} | } | public void send(DatagramPacket p) throws IOException { if (isClosed()) throw new SocketException("socket is closed"); // JDK1.2: Don't do security checks if socket is connected; see jdk1.2 api. SecurityManager s = System.getSecurityManager(); if (s != null && ! isConnected()) { InetAddress addr = p.getAddress(); if (addr.isMulticastAddress()) s.checkMulticast(addr); else s.checkConnect(addr.getHostAddress(), p.getPort()); } if (isConnected()) { if (p.getAddress() != null && (remoteAddress != p.getAddress() || remotePort != p.getPort())) throw new IllegalArgumentException ("DatagramPacket address does not match remote address"); } // FIXME: if this is a subclass of MulticastSocket, // use getTimeToLive for TTL val. if (getChannel() != null && ! getChannel().isBlocking() && ! ((DatagramChannelImpl) getChannel()).isInChannelOperation()) throw new IllegalBlockingModeException(); getImpl().send(p); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
} | } | public void setBroadcast(boolean enable) throws SocketException { if (isClosed()) throw new SocketException("socket is closed"); getImpl().setOption(SocketOptions.SO_BROADCAST, Boolean.valueOf(enable)); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
if (factory != null) throw new SocketException("DatagramSocketImplFactory already defined"); | if (factory != null) throw new SocketException("DatagramSocketImplFactory already defined"); | public static void setDatagramSocketImplFactory(DatagramSocketImplFactory fac) throws IOException { if (factory != null) throw new SocketException("DatagramSocketImplFactory already defined"); SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkSetFactory(); factory = fac; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkSetFactory(); | SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkSetFactory(); | public static void setDatagramSocketImplFactory(DatagramSocketImplFactory fac) throws IOException { if (factory != null) throw new SocketException("DatagramSocketImplFactory already defined"); SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkSetFactory(); factory = fac; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
factory = fac; } | factory = fac; } | public static void setDatagramSocketImplFactory(DatagramSocketImplFactory fac) throws IOException { if (factory != null) throw new SocketException("DatagramSocketImplFactory already defined"); SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkSetFactory(); factory = fac; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
if (size < 0) throw new IllegalArgumentException("Buffer size is less than 0"); | if (size < 0) throw new IllegalArgumentException("Buffer size is less than 0"); | public void setReceiveBufferSize(int size) throws SocketException { if (isClosed()) throw new SocketException("socket is closed"); if (size < 0) throw new IllegalArgumentException("Buffer size is less than 0"); getImpl().setOption(SocketOptions.SO_RCVBUF, new Integer(size)); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
} | } | public void setReceiveBufferSize(int size) throws SocketException { if (isClosed()) throw new SocketException("socket is closed"); if (size < 0) throw new IllegalArgumentException("Buffer size is less than 0"); getImpl().setOption(SocketOptions.SO_RCVBUF, new Integer(size)); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6cac04c48e1afad0cfbb014fb4ace224bd84bfaf/DatagramSocket.java/clean/core/src/classpath/java/java/net/DatagramSocket.java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.