bugged
stringlengths
6
599k
fixed
stringlengths
6
40.8M
__index_level_0__
int64
0
3.24M
public void run() { running = true; try { sleep(initialDelay); queueEvent(); while (running) { try { sleep(delay); } catch (InterruptedException e) { return; } queueEvent(); if (logTimers...
public void run() { running = true; try { sleep(initialDelay); queueEvent(); while (running) { try { sleep(delay); } catch (InterruptedException e) { return; } queueEvent(); if (logTimers...
2,026
public void run() { running = true; try { sleep(initialDelay); queueEvent(); while (running) { try { sleep(delay); } catch (InterruptedException e) { return; } queueEvent(); if (logTimers...
public void run() { running = true; try { sleep(initialDelay); queueEvent(); while (running) { try { sleep(delay); } catch (InterruptedException e) { return; } queueEvent(); if (logTimers...
2,027
protected final void processEvent(AWTEvent event) { awtComponent.dispatchEvent(SwingToolkit.convertEvent(event, awtComponent)); }
protected final void processEvent(AWTEvent event) { awtComponent.dispatchEvent(SwingToolkit.convertEvent(event, awtComponent)); }
2,029
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()); }
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()); }
2,030
public void setAlignment(int alignment) { //TODO implement it }
public void setAlignment(int alignment) { //TODO implement it }
2,031
public void setText(String text) { ((JLabel) jComponent).setText(text); }
public void setText(String text) { ((JLabel) jComponent).setText(text); }
2,032
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()); }
2,033
public void addCommandToHistory(String cmdLineStr) { // Add this command to the history. 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); }
2,034
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.has...
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.has...
2,035
public AliasManager getAliasManager() { return aliasMgr; }
public AliasManager getAliasManager() { return aliasMgr; }
2,036
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); } }
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); } }
2,037
public CommandHistory getCommandHistory() { return history; }
public CommandHistory getCommandHistory() { return history; }
2,038
public Console getConsole() { return console; }
public Console getConsole() { return console; }
2,039
public PrintStream getErrorStream() { return err; }
public PrintStream getErrorStream() { return err; }
2,040
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 = histor...
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 = histor...
2,041
public void keyReleased(KeyboardEvent ke) { // do nothing }
public void keyReleased(KeyboardEvent ke) { // do nothing }
2,042
public void list(String[] items) { 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; }
2,043
protected void processCommand(String cmdLineStr) { commandInvoker.invoke(cmdLineStr); }
protected void processCommand(String cmdLineStr) { commandInvoker.invoke(cmdLineStr); }
2,044
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) { s...
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) { s...
2,045
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(historyInd...
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(historyInd...
2,046
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); ...
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); ...
2,047
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...
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...
2,048
public void setDefaultCommandInvoker() { this.commandInvoker = defaultCommandInvoker; }
public void setDefaultCommandInvoker() { this.commandInvoker = defaultCommandInvoker; }
2,049
public void setThreadCommandInvoker() { this.commandInvoker = threadCommandInvoker; }
public void setThreadCommandInvoker() { this.commandInvoker = threadCommandInvoker; }
2,050
public AliasArgument(String name, String description) { super(name, description); }
public AliasArgument(String name, String description) { super(name, description); }
2,051
public ShellException(String message, Throwable cause) { super(message, cause); }
public ShellException(String message, Throwable cause) { super(message, cause); }
2,052
public abstract StringBuffer format (Date date, StringBuffer buf, FieldPosition pos);
public abstract StringBuffer format (Date date, StringBuffer buf, FieldPosition pos);
2,053
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; }
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; }
2,054
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; }
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; }
2,055
public short loadShort(Offset offset) { return (short) 0; }
public short loadShort() { return (short) 0; }
2,056
public char loadChar(Offset offset) { return (char) 0; }
public char loadChar() { return (char) 0; }
2,057
public DDC1NoSignalException(String s) { super(s); }
public DDC1NoSignalException(String s) { super(s); }
2,058
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(...
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(...
2,059
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) ...
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) ...
2,060
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(); i...
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(); i...
2,061
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(); i...
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(); i...
2,062
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(); i...
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(); i...
2,063
public void disconnect() { if (! isConnected()) return; try { getImpl().disconnect(); } catch (SocketException e) { // This cannot happen as we are connected. } finally { remoteAddress = null; remotePort = -1; } }
public void disconnect() { if (! isConnected()) return; try { getImpl().disconnect(); } catch (SocketException e) { // This cannot happen as we are connected. } finally { remoteAddress = null; remotePort = -1; } }
2,064
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"); }
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"); }
2,065
public DatagramChannel getChannel() { return null; }
public DatagramChannel getChannel() { return null; }
2,066
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; } }
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; } }
2,067
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; } }
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; } }
2,068
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; } }
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; } }
2,069
public InetAddress getInetAddress() { return remoteAddress; }
public InetAddress getInetAddress() { return remoteAddress; }
2,070
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 ...
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 ...
2,071
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 ...
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.getHostAddress(), -1); } cat...
2,072
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 ...
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 ...
2,073
public int getLocalPort() { if (isClosed()) return -1; try { return getImpl().getLocalPort(); } catch (SocketException e) { // This cannot happen as we are bound. return 0; } }
public int getLocalPort() { if (isClosed()) return -1; try { return getImpl().getLocalPort(); } catch (SocketException e) { // This cannot happen as we are bound. return 0; } }
2,074
public SocketAddress getLocalSocketAddress() { if (! isBound()) return null; return new InetSocketAddress(getLocalAddress(), getLocalPort()); }
public SocketAddress getLocalSocketAddress() { if (! isBound()) return null; return new InetSocketAddress(getLocalAddress(), getLocalPort()); }
2,075
public SocketAddress getLocalSocketAddress() { if (! isBound()) return null; return new InetSocketAddress(getLocalAddress(), getLocalPort()); }
public SocketAddress getLocalSocketAddress() { if (! isBound()) return null; return new InetSocketAddress(getLocalAddress(), getLocalPort()); }
2,076
public int getPort() { return remotePort; }
public int getPort() { return remotePort; }
2,077
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"); }
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"); }
2,078
public SocketAddress getRemoteSocketAddress() { if (! isConnected()) return null; return new InetSocketAddress(remoteAddress, remotePort); }
public SocketAddress getRemoteSocketAddress() { if (! isConnected()) return null; return new InetSocketAddress(remoteAddress, remotePort); }
2,079
public SocketAddress getRemoteSocketAddress() { if (! isConnected()) return null; return new InetSocketAddress(remoteAddress, remotePort); }
public SocketAddress getRemoteSocketAddress() { if (! isConnected()) return null; return new InetSocketAddress(remoteAddress, remotePort); }
2,080
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");...
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");...
2,081
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"); }
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"); }
2,082
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");...
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");...
2,083
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"); }
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"); }
2,084
public boolean isBound() { return bound; }
public boolean isBound() { return bound; }
2,085
public boolean isClosed() { return impl == null; }
public boolean isClosed() { return impl == null; }
2,086
public boolean isConnected() { return remoteAddress != null; }
public boolean isConnected() { return remoteAddress != null; }
2,087
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()...
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()...
2,088
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()...
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()...
2,089
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 a...
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 a...
2,090
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 a...
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 a...
2,091
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 a...
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 a...
2,092
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 a...
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 a...
2,093
public void setBroadcast(boolean enable) throws SocketException { if (isClosed()) throw new SocketException("socket is closed"); getImpl().setOption(SocketOptions.SO_BROADCAST, Boolean.valueOf(enable)); }
public void setBroadcast(boolean enable) throws SocketException { if (isClosed()) throw new SocketException("socket is closed"); getImpl().setOption(SocketOptions.SO_BROADCAST, Boolean.valueOf(enable)); }
2,094
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; }
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; }
2,095
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; }
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; }
2,096
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; }
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; }
2,097
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)); }
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)); }
2,098
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)); }
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)); }
2,099
public void setReuseAddress(boolean on) throws SocketException { if (isClosed()) throw new SocketException("socket is closed"); getImpl().setOption(SocketOptions.SO_REUSEADDR, Boolean.valueOf(on)); }
public void setReuseAddress(boolean on) throws SocketException { if (isClosed()) throw new SocketException("socket is closed"); getImpl().setOption(SocketOptions.SO_REUSEADDR, Boolean.valueOf(on)); }
2,100
public void setSendBufferSize(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_SNDBUF, new Integer(size)); }
public void setSendBufferSize(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_SNDBUF, new Integer(size)); }
2,101
public void setSendBufferSize(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_SNDBUF, new Integer(size)); }
public void setSendBufferSize(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_SNDBUF, new Integer(size)); }
2,102
public synchronized void setSoTimeout(int timeout) throws SocketException { if (isClosed()) throw new SocketException("socket is closed"); if (timeout < 0) throw new IllegalArgumentException("Invalid timeout: " + timeout); getImpl().setOption(SocketOptions.SO_TIMEOUT, new Integer(timeout)); }
public synchronized void setSoTimeout(int timeout) throws SocketException { if (isClosed()) throw new SocketException("socket is closed"); if (timeout < 0) throw new IllegalArgumentException("Invalid timeout: " + timeout); getImpl().setOption(SocketOptions.SO_TIMEOUT, new Integer(timeout)); }
2,103
public synchronized void setSoTimeout(int timeout) throws SocketException { if (isClosed()) throw new SocketException("socket is closed"); if (timeout < 0) throw new IllegalArgumentException("Invalid timeout: " + timeout); getImpl().setOption(SocketOptions.SO_TIMEOUT, new Integer(timeout)); }
public synchronized void setSoTimeout(int timeout) throws SocketException { if (isClosed()) throw new SocketException("socket is closed"); if (timeout < 0) throw new IllegalArgumentException("Invalid timeout: " + timeout); getImpl().setOption(SocketOptions.SO_TIMEOUT, new Integer(timeout)); }
2,104
public void setTrafficClass(int tc) throws SocketException { if (isClosed()) throw new SocketException("socket is closed"); if (tc < 0 || tc > 255) throw new IllegalArgumentException(); getImpl().setOption(SocketOptions.IP_TOS, new Integer(tc)); }
public void setTrafficClass(int tc) throws SocketException { if (isClosed()) throw new SocketException("socket is closed"); if (tc < 0 || tc > 255) throw new IllegalArgumentException(); getImpl().setOption(SocketOptions.IP_TOS, new Integer(tc)); }
2,105
public void setTrafficClass(int tc) throws SocketException { if (isClosed()) throw new SocketException("socket is closed"); if (tc < 0 || tc > 255) throw new IllegalArgumentException(); getImpl().setOption(SocketOptions.IP_TOS, new Integer(tc)); }
public void setTrafficClass(int tc) throws SocketException { if (isClosed()) throw new SocketException("socket is closed"); if (tc < 0 || tc > 255) throw new IllegalArgumentException(); getImpl().setOption(SocketOptions.IP_TOS, new Integer(tc)); }
2,106
public synchronized void setAddress(InetAddress iaddr) { if (iaddr == null) throw new NullPointerException("Null address"); address = iaddr; }
public synchronized void setAddress(InetAddress iaddr) { if (iaddr == null) throw new NullPointerException("Null address"); address = iaddr; }
2,107
public synchronized void setAddress(InetAddress iaddr) { if (iaddr == null) throw new NullPointerException("Null address"); address = iaddr; }
public synchronized void setAddress(InetAddress iaddr) { if (iaddr == null) throw new NullPointerException("Null address"); address = iaddr; }
2,108
public synchronized void setPort(int iport) { if (iport < 0 || iport > 65535) throw new IllegalArgumentException("Invalid port: " + iport); port = iport; }
public synchronized void setPort(int iport) { if (iport < 0 || iport > 65535) throw new IllegalArgumentException("Invalid port: " + iport); port = iport; }
2,109
public synchronized void setPort(int iport) { if (iport < 0 || iport > 65535) throw new IllegalArgumentException("Invalid port: " + iport); port = iport; }
public synchronized void setPort(int iport) { if (iport < 0 || iport > 65535) throw new IllegalArgumentException("Invalid port: " + iport); port = iport; }
2,110
public static BigInteger generateRandomPrime( int pmin, int pmax, BigInteger f ) { BigInteger d; //Step 1 - generate prime BigInteger p = new BigInteger( (pmax + pmin)/2, new Random() ); if( p.compareTo( BigInteger.valueOf( 1 ).shiftLeft( pmin ) ) <= 0 ) { p.add( BigInteger.valueOf( 1 ).shiftLeft( p...
public static BigInteger generateRandomPrime( int pmin, int pmax, BigInteger f ) { BigInteger d; //Step 1 - generate prime BigInteger p = new BigInteger( (pmax + pmin)/2, new Random() ); if( p.compareTo( BigInteger.valueOf( 1 ).shiftLeft( pmin ) ) <= 0 ) { p = p.add( BigInteger.valueOf( 1 ).shiftLef...
2,111
public static BigInteger generateRandomPrime( int pmin, int pmax, BigInteger f ) { BigInteger d; //Step 1 - generate prime BigInteger p = new BigInteger( (pmax + pmin)/2, new Random() ); if( p.compareTo( BigInteger.valueOf( 1 ).shiftLeft( pmin ) ) <= 0 ) { p.add( BigInteger.valueOf( 1 ).shiftLeft( p...
public static BigInteger generateRandomPrime( int pmin, int pmax, BigInteger f ) { BigInteger d; //Step 1 - generate prime BigInteger p = new BigInteger( (pmax + pmin)/2, new Random() ); if( p.compareTo( BigInteger.valueOf( 1 ).shiftLeft( pmin ) ) <= 0 ) { p.add( BigInteger.valueOf( 1 ).shiftLeft( p...
2,112
public static BigInteger generateRandomPrime( int pmin, int pmax, BigInteger f ) { BigInteger d; //Step 1 - generate prime BigInteger p = new BigInteger( (pmax + pmin)/2, new Random() ); if( p.compareTo( BigInteger.valueOf( 1 ).shiftLeft( pmin ) ) <= 0 ) { p.add( BigInteger.valueOf( 1 ).shiftLeft( p...
public static BigInteger generateRandomPrime( int pmin, int pmax, BigInteger f ) { BigInteger d; //Step 1 - generate prime BigInteger p = new BigInteger( (pmax + pmin)/2, new Random() ); if( p.compareTo( BigInteger.valueOf( 1 ).shiftLeft( pmin ) ) <= 0 ) { p.add( BigInteger.valueOf( 1 ).shiftLeft( p...
2,113
protected void installKeyboardActions() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); InputMap focusInputMap = (InputMap)defaults.get("List.focusInputMap"); InputMapUIResource parentInputMap = new InputMapUIResource(); // FIXME: The JDK uses a LazyActionMap for parentActionMap ActionMap ...
protected void installKeyboardActions(){UIDefaults defaults = UIManager.getLookAndFeelDefaults();InputMap focusInputMap = (InputMap)defaults.get("List.focusInputMap");InputMapUIResource parentInputMap = new InputMapUIResource();// FIXME: The JDK uses a LazyActionMap for parentActionMapActionMap parentActionMap = new Ac...
2,114
protected void installKeyboardActions() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); InputMap focusInputMap = (InputMap)defaults.get("List.focusInputMap"); InputMapUIResource parentInputMap = new InputMapUIResource(); // FIXME: The JDK uses a LazyActionMap for parentActionMap ActionMap ...
protected void installKeyboardActions() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); InputMap focusInputMap = (InputMap)defaults.get("List.focusInputMap"); InputMapUIResource parentInputMap = new InputMapUIResource(); // FIXME: The JDK uses a LazyActionMap for parentActionMap ActionMap ...
2,115
protected void installKeyboardActions() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); InputMap focusInputMap = (InputMap)defaults.get("List.focusInputMap"); InputMapUIResource parentInputMap = new InputMapUIResource(); // FIXME: The JDK uses a LazyActionMap for parentActionMap ActionMap ...
protected void installKeyboardActions() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); InputMap focusInputMap = (InputMap)defaults.get("List.focusInputMap"); InputMapUIResource parentInputMap = new InputMapUIResource(); // FIXME: The JDK uses a LazyActionMap for parentActionMap ActionMap ...
2,116
public int getLastVisibleIndex() { ComponentOrientation or = getComponentOrientation(); Rectangle r = getVisibleRect(); r.translate(0, (int) r.getHeight() - 1); if (or == ComponentOrientation.LEFT_TO_RIGHT) r.translate((int) r.getWidth() - 1, 0); if (getUI().locationToIndex(this, r.getLocation())...
public int getLastVisibleIndex() { ComponentOrientation or = getComponentOrientation(); Rectangle r = getVisibleRect(); r.translate(0, (int) r.getHeight() - 1); if (or == ComponentOrientation.LEFT_TO_RIGHT) r.translate((int) r.getWidth() - 1, 0); if (getUI().locationToIndex(this, r.getLocation())...
2,118
protected void setXMLAttributes (AttributeList attrs) { // set object attributes from an AttributeList if (attrs != null) { // whip thru the list, setting each value int size = attrs.getLength(); for (int i = 0; i < size; i++) { String name = attrs.getName(i); String v...
protected void setXMLAttributes (AttributeList attrs) { // set object attributes from an AttributeList if (attrs != null) { // whip thru the list, setting each value int size = attrs.getLength(); for (int i = 0; i < size; i++) { String name = attrs.getName(i); String v...
2,119
public static Border createBevelBorder (int type, Color highlightOuter, Color highlightInner, Color shadowOuter, Color shadowInner) { return new BevelBorder (type, highlightOuter, highlightInner, shadowOuter, shadowInner); }
public static Border createBevelBorder (int type, Color highlightOuter, Color highlightInner, Color shadowOuter, Color shadowInner) { return new BevelBorder (type, highlightOuter, highlightInner, shadowOuter, shadowInner); }
2,120
public static Border createBevelBorder (int type, Color highlightOuter, Color highlightInner, Color shadowOuter, Color shadowInner) { return new BevelBorder (type, highlightOuter, highlightInner, shadowOuter, shadowInner); }
public static Border createBevelBorder (int type, Color highlightOuter, Color highlightInner, Color shadowOuter, Color shadowInner) { return new BevelBorder (type, highlightOuter, highlightInner, shadowOuter, shadowInner); }
2,121
public static CompoundBorder createCompoundBorder () { return new CompoundBorder (); }
public static CompoundBorder createCompoundBorder() { return new CompoundBorder (); }
2,122
public static CompoundBorder createCompoundBorder () { return new CompoundBorder (); }
public static CompoundBorder createCompoundBorder () { return new CompoundBorder(); }
2,123
public static Border createEmptyBorder (int top, int left, int bottom, int right) { return new EmptyBorder (top, left, bottom, right); }
public static Border createEmptyBorder (int top, int left, int bottom, int right) { return new EmptyBorder (top, left, bottom, right); }
2,124
public static Border createEmptyBorder (int top, int left, int bottom, int right) { return new EmptyBorder (top, left, bottom, right); }
public static Border createEmptyBorder (int top, int left, int bottom, int right) { return new EmptyBorder(0, 0, 0, 0); }
2,125
public static Border createLineBorder (Color color, int thickness) { return new LineBorder (color, thickness); }
public static Border createLineBorder(Color color) { return new LineBorder (color, thickness); }
2,126
public static Border createLineBorder (Color color, int thickness) { return new LineBorder (color, thickness); }
public static Border createLineBorder (Color color, int thickness) { return null; }
2,127