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) System.out.println("javax.swing.Timer -> clocktick"); if ( ! repeats) break; } running = false; } catch (Exception e) { // The timer is no longer running. running = false; } }
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; } }
2,026
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; } }
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; } }
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.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; }
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; }
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 = 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(); } } }
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(); } } }
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) { 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(); }
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(); }
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(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(); }
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); */ 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) { } }
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.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); } } }
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); } } }
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(); 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; } }
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; } }
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) getChannel().close(); } catch (IOException e) { // Do nothing. } }
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. } }
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(); 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. } }
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. } }
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(); 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. } }
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. } }
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(); 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. } }
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. } }
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 (SecurityException e) { localAddr = InetAddress.ANY_IF; } catch (SocketException e) { // This cannot happen as we are bound. return null; } return localAddr; }
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; }
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 (SecurityException e) { localAddr = InetAddress.ANY_IF; } catch (SocketException e) { // This cannot happen as we are bound. return null; } return localAddr; }
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); } catch (SecurityException e) { localAddr = InetAddress.ANY_IF; } catch (SocketException e) { // This cannot happen as we are bound. return null; } return localAddr; }
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 (SecurityException e) { localAddr = InetAddress.ANY_IF; } catch (SocketException e) { // This cannot happen as we are bound. return null; } return localAddr; }
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; }
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() != 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()); }
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()); }
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() != 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()); }
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()); }
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 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); }
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); }
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 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); }
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); }
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 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); }
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); }
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 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); }
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); }
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( pmin ).subtract( p ) ); } //Step 2 - test for even if( p.mod( BigInteger.valueOf(2) ).compareTo( BigInteger.valueOf( 0 )) == 0) p.add( BigInteger.valueOf( 1 ) ); for(;;) { //Step 3 if( p.compareTo( BigInteger.valueOf( 1 ).shiftLeft( pmax)) > 0) { //Step 3.1 p = p.subtract( BigInteger.valueOf( 1 ).shiftLeft( pmax) ); p = p.add( BigInteger.valueOf( 1 ).shiftLeft( pmin) ); p = p.subtract( BigInteger.valueOf( 1 ) ); //Step 3.2 // put step 2 code here so looping code is cleaner //Step 2 - test for even if( p.mod( BigInteger.valueOf(2) ).compareTo( BigInteger.valueOf( 0 )) == 0) p.add( BigInteger.valueOf( 1 ) ); continue; } //Step 4 - compute GCD d = p.subtract( BigInteger.valueOf(1) ); d = d.gcd( f ); //Step 5 - test d if( d.compareTo( BigInteger.valueOf( 1 ) ) == 0) { //Step 5.1 - test primality if( p.isProbablePrime( 1 ) == true ) { //Step 5.2; return p; } } //Step 6 p = p.add( BigInteger.valueOf( 2 ) ); //Step 7 } }
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 ).shiftLeft( pmin ).subtract( p ) ); } //Step 2 - test for even if( p.mod( BigInteger.valueOf(2) ).compareTo( BigInteger.valueOf( 0 )) == 0) p.add( BigInteger.valueOf( 1 ) ); for(;;) { //Step 3 if( p.compareTo( BigInteger.valueOf( 1 ).shiftLeft( pmax)) > 0) { //Step 3.1 p = p.subtract( BigInteger.valueOf( 1 ).shiftLeft( pmax) ); p = p.add( BigInteger.valueOf( 1 ).shiftLeft( pmin) ); p = p.subtract( BigInteger.valueOf( 1 ) ); //Step 3.2 // put step 2 code here so looping code is cleaner //Step 2 - test for even if( p.mod( BigInteger.valueOf(2) ).compareTo( BigInteger.valueOf( 0 )) == 0) p.add( BigInteger.valueOf( 1 ) ); continue; } //Step 4 - compute GCD d = p.subtract( BigInteger.valueOf(1) ); d = d.gcd( f ); //Step 5 - test d if( d.compareTo( BigInteger.valueOf( 1 ) ) == 0) { //Step 5.1 - test primality if( p.isProbablePrime( 1 ) == true ) { //Step 5.2; return p; } } //Step 6 p = p.add( BigInteger.valueOf( 2 ) ); //Step 7 } }
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( pmin ).subtract( p ) ); } //Step 2 - test for even if( p.mod( BigInteger.valueOf(2) ).compareTo( BigInteger.valueOf( 0 )) == 0) p.add( BigInteger.valueOf( 1 ) ); for(;;) { //Step 3 if( p.compareTo( BigInteger.valueOf( 1 ).shiftLeft( pmax)) > 0) { //Step 3.1 p = p.subtract( BigInteger.valueOf( 1 ).shiftLeft( pmax) ); p = p.add( BigInteger.valueOf( 1 ).shiftLeft( pmin) ); p = p.subtract( BigInteger.valueOf( 1 ) ); //Step 3.2 // put step 2 code here so looping code is cleaner //Step 2 - test for even if( p.mod( BigInteger.valueOf(2) ).compareTo( BigInteger.valueOf( 0 )) == 0) p.add( BigInteger.valueOf( 1 ) ); continue; } //Step 4 - compute GCD d = p.subtract( BigInteger.valueOf(1) ); d = d.gcd( f ); //Step 5 - test d if( d.compareTo( BigInteger.valueOf( 1 ) ) == 0) { //Step 5.1 - test primality if( p.isProbablePrime( 1 ) == true ) { //Step 5.2; return p; } } //Step 6 p = p.add( BigInteger.valueOf( 2 ) ); //Step 7 } }
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( pmin ).subtract( p ) ); } //Step 2 - test for even if( p.mod( BigInteger.valueOf(2) ).compareTo( BigInteger.valueOf( 0 )) == 0) p = p.add( BigInteger.valueOf( 1 ) ); for(;;) { //Step 3 if( p.compareTo( BigInteger.valueOf( 1 ).shiftLeft( pmax)) > 0) { //Step 3.1 p = p.subtract( BigInteger.valueOf( 1 ).shiftLeft( pmax) ); p = p.add( BigInteger.valueOf( 1 ).shiftLeft( pmin) ); p = p.subtract( BigInteger.valueOf( 1 ) ); //Step 3.2 // put step 2 code here so looping code is cleaner //Step 2 - test for even if( p.mod( BigInteger.valueOf(2) ).compareTo( BigInteger.valueOf( 0 )) == 0) p.add( BigInteger.valueOf( 1 ) ); continue; } //Step 4 - compute GCD d = p.subtract( BigInteger.valueOf(1) ); d = d.gcd( f ); //Step 5 - test d if( d.compareTo( BigInteger.valueOf( 1 ) ) == 0) { //Step 5.1 - test primality if( p.isProbablePrime( 1 ) == true ) { //Step 5.2; return p; } } //Step 6 p = p.add( BigInteger.valueOf( 2 ) ); //Step 7 } }
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( pmin ).subtract( p ) ); } //Step 2 - test for even if( p.mod( BigInteger.valueOf(2) ).compareTo( BigInteger.valueOf( 0 )) == 0) p.add( BigInteger.valueOf( 1 ) ); for(;;) { //Step 3 if( p.compareTo( BigInteger.valueOf( 1 ).shiftLeft( pmax)) > 0) { //Step 3.1 p = p.subtract( BigInteger.valueOf( 1 ).shiftLeft( pmax) ); p = p.add( BigInteger.valueOf( 1 ).shiftLeft( pmin) ); p = p.subtract( BigInteger.valueOf( 1 ) ); //Step 3.2 // put step 2 code here so looping code is cleaner //Step 2 - test for even if( p.mod( BigInteger.valueOf(2) ).compareTo( BigInteger.valueOf( 0 )) == 0) p.add( BigInteger.valueOf( 1 ) ); continue; } //Step 4 - compute GCD d = p.subtract( BigInteger.valueOf(1) ); d = d.gcd( f ); //Step 5 - test d if( d.compareTo( BigInteger.valueOf( 1 ) ) == 0) { //Step 5.1 - test primality if( p.isProbablePrime( 1 ) == true ) { //Step 5.2; return p; } } //Step 6 p = p.add( BigInteger.valueOf( 2 ) ); //Step 7 } }
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( pmin ).subtract( p ) ); } //Step 2 - test for even if( p.mod( BigInteger.valueOf(2) ).compareTo( BigInteger.valueOf( 0 )) == 0) p = p.add( BigInteger.valueOf( 1 ) ); for(;;) { //Step 3 if( p.compareTo( BigInteger.valueOf( 1 ).shiftLeft( pmax)) > 0) { //Step 3.1 p = p.subtract( BigInteger.valueOf( 1 ).shiftLeft( pmax) ); p = p.add( BigInteger.valueOf( 1 ).shiftLeft( pmin) ); p = p.subtract( BigInteger.valueOf( 1 ) ); //Step 3.2 // put step 2 code here so looping code is cleaner //Step 2 - test for even if( p.mod( BigInteger.valueOf(2) ).compareTo( BigInteger.valueOf( 0 )) == 0) p.add( BigInteger.valueOf( 1 ) ); continue; } //Step 4 - compute GCD d = p.subtract( BigInteger.valueOf(1) ); d = d.gcd( f ); //Step 5 - test d if( d.compareTo( BigInteger.valueOf( 1 ) ) == 0) { //Step 5.1 - test primality if( p.isProbablePrime( 1 ) == true ) { //Step 5.2; return p; } } //Step 6 p = p.add( BigInteger.valueOf( 2 ) ); //Step 7 } }
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 parentActionMap = new ActionMap(); action = new ListAction(); Object keys[] = focusInputMap.allKeys(); // Register key bindings in the UI InputMap-ActionMap pair // Note that we register key bindings with both the old and new modifier // masks: InputEvent.SHIFT_MASK and InputEvent.SHIFT_DOWN_MASK and so on. for (int i = 0; i < keys.length; i++) { parentInputMap.put(KeyStroke.getKeyStroke (((KeyStroke)keys[i]).getKeyCode(), convertModifiers (((KeyStroke)keys[i]).getModifiers())), (String)focusInputMap.get((KeyStroke)keys[i])); parentInputMap.put(KeyStroke.getKeyStroke (((KeyStroke)keys[i]).getKeyCode(), ((KeyStroke)keys[i]).getModifiers()), (String)focusInputMap.get((KeyStroke)keys[i])); parentActionMap.put ((String)focusInputMap.get((KeyStroke)keys[i]), new ActionListenerProxy (action, (String)focusInputMap.get((KeyStroke)keys[i]))); } parentInputMap.setParent(list.getInputMap().getParent()); parentActionMap.setParent(list.getActionMap().getParent()); list.getInputMap().setParent(parentInputMap); list.getActionMap().setParent(parentActionMap); }
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 ActionMap();action = new ListAction();Object keys[] = focusInputMap.allKeys();// Register key bindings in the UI InputMap-ActionMap pair// Note that we register key bindings with both the old and new modifier// masks: InputEvent.SHIFT_MASK and InputEvent.SHIFT_DOWN_MASK and so on.for (int i = 0; i < keys.length; i++){parentInputMap.put(KeyStroke.getKeyStroke (((KeyStroke)keys[i]).getKeyCode(), convertModifiers(((KeyStroke)keys[i]).getModifiers())),(String)focusInputMap.get((KeyStroke)keys[i]));parentInputMap.put(KeyStroke.getKeyStroke (((KeyStroke)keys[i]).getKeyCode(), ((KeyStroke)keys[i]).getModifiers()),(String)focusInputMap.get((KeyStroke)keys[i]));parentActionMap.put((String)focusInputMap.get((KeyStroke)keys[i]), new ActionListenerProxy (action, (String)focusInputMap.get((KeyStroke)keys[i])));}parentInputMap.setParent(list.getInputMap().getParent());parentActionMap.setParent(list.getActionMap().getParent());list.getInputMap().setParent(parentInputMap);list.getActionMap().setParent(parentActionMap);}
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 parentActionMap = new ActionMap(); action = new ListAction(); Object keys[] = focusInputMap.allKeys(); // Register key bindings in the UI InputMap-ActionMap pair // Note that we register key bindings with both the old and new modifier // masks: InputEvent.SHIFT_MASK and InputEvent.SHIFT_DOWN_MASK and so on. for (int i = 0; i < keys.length; i++) { parentInputMap.put(KeyStroke.getKeyStroke (((KeyStroke)keys[i]).getKeyCode(), convertModifiers (((KeyStroke)keys[i]).getModifiers())), (String)focusInputMap.get((KeyStroke)keys[i])); parentInputMap.put(KeyStroke.getKeyStroke (((KeyStroke)keys[i]).getKeyCode(), ((KeyStroke)keys[i]).getModifiers()), (String)focusInputMap.get((KeyStroke)keys[i])); parentActionMap.put ((String)focusInputMap.get((KeyStroke)keys[i]), new ActionListenerProxy (action, (String)focusInputMap.get((KeyStroke)keys[i]))); } parentInputMap.setParent(list.getInputMap().getParent()); parentActionMap.setParent(list.getActionMap().getParent()); list.getInputMap().setParent(parentInputMap); list.getActionMap().setParent(parentActionMap); }
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 parentActionMap = new ActionMap(); action = new ListAction(); Object keys[] = focusInputMap.allKeys(); // Register key bindings in the UI InputMap-ActionMap pair // Note that we register key bindings with both the old and new modifier // masks: InputEvent.SHIFT_MASK and InputEvent.SHIFT_DOWN_MASK and so on. for (int i = 0; i < keys.length; i++) { parentInputMap.put(KeyStroke.getKeyStroke (((KeyStroke)keys[i]).getKeyCode(), convertModifiers (((KeyStroke)keys[i]).getModifiers())), (String)focusInputMap.get((KeyStroke)keys[i])); parentInputMap.put(KeyStroke.getKeyStroke (((KeyStroke)keys[i]).getKeyCode(), ((KeyStroke)keys[i]).getModifiers()), (String)focusInputMap.get((KeyStroke)keys[i])); parentActionMap.put ((String)focusInputMap.get((KeyStroke)keys[i]), new ActionListenerProxy (action, (String)focusInputMap.get((KeyStroke)keys[i]))); } parentInputMap.setParent(list.getInputMap().getParent()); parentActionMap.setParent(list.getActionMap().getParent()); list.getInputMap().setParent(parentInputMap); list.getActionMap().setParent(parentActionMap); }
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 parentActionMap = new ActionMap(); action = new ListAction(); Object keys[] = focusInputMap.allKeys(); // Register key bindings in the UI InputMap-ActionMap pair // Note that we register key bindings with both the old and new modifier // masks: InputEvent.SHIFT_MASK and InputEvent.SHIFT_DOWN_MASK and so on. for (int i = 0; i < keys.length; i++) { parentInputMap.put(KeyStroke.getKeyStroke (((KeyStroke)keys[i]).getKeyCode(), convertModifiers (((KeyStroke)keys[i]).getModifiers())), (String)focusInputMap.get((KeyStroke)keys[i])); parentInputMap.put(KeyStroke.getKeyStroke (((KeyStroke)keys[i]).getKeyCode(), ((KeyStroke)keys[i]).getModifiers()), (String)focusInputMap.get((KeyStroke)keys[i])); parentActionMap.put ((String)focusInputMap.get((KeyStroke)keys[i]), new ActionListenerProxy (action, (String)focusInputMap.get((KeyStroke)keys[i]))); } parentInputMap.setParent(list.getInputMap().getParent()); parentActionMap.setParent(list.getActionMap().getParent()); list.getInputMap().setParent(parentInputMap); list.getActionMap().setParent(parentActionMap); }
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 parentActionMap = new ActionMap(); action = new ListAction(); Object keys[] = focusInputMap.allKeys(); // Register key bindings in the UI InputMap-ActionMap pair // Note that we register key bindings with both the old and new modifier // masks: InputEvent.SHIFT_MASK and InputEvent.SHIFT_DOWN_MASK and so on. for (int i = 0; i < keys.length; i++) { parentInputMap.put(KeyStroke.getKeyStroke (((KeyStroke)keys[i]).getKeyCode(), convertModifiers (((KeyStroke)keys[i]).getModifiers())), (String)focusInputMap.get((KeyStroke)keys[i])); parentInputMap.put(KeyStroke.getKeyStroke (((KeyStroke)keys[i]).getKeyCode(), ((KeyStroke)keys[i]).getModifiers()), (String)focusInputMap.get((KeyStroke)keys[i])); parentActionMap.put ((String)focusInputMap.get((KeyStroke)keys[i]), new ActionListenerProxy (action, (String)focusInputMap.get((KeyStroke)keys[i]))); } parentInputMap.setParent(list.getInputMap().getParent()); parentActionMap.setParent(list.getActionMap().getParent()); list.getInputMap().setParent(parentInputMap); list.getActionMap().setParent(parentActionMap); }
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()) == -1 && indexToLocation(getModel().getSize() - 1).y < r.y) return getModel().getSize() - 1; return 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()) == -1 && indexToLocation(getModel().getSize() - 1).y < r.y) return getModel().getSize() - 1; return 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 value = attrs.getValue(i); if (name != null && value != null) ((XMLAttribute) this.attribHash.get(name)).setAttribValue(value); } } }
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 value = attrs.getValue(i); if (name != null && value != null) ((XMLAttribute) this.attribHash.get(name)).setAttribValue(value); } } }
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