bugged
stringlengths
6
599k
fixed
stringlengths
10
599k
__index_level_0__
int64
0
1.13M
AbstractButton(String txt, Icon icon) { text = txt; default_icon = icon; model = new DefaultButtonModel(); actionListener = createActionListener(); changeListener = createChangeListener(); itemListener = createItemListener(); model.addActionListener(actionListener); model.addChangeListener(changeListener); model.addItemListener(itemListener); hori_align = CENTER; hori_text_pos = TRAILING; vert_align = CENTER; vert_text_pos = CENTER; paint_border = true; content_area_filled = true; setAlignmentX(LEFT_ALIGNMENT); setAlignmentY(CENTER_ALIGNMENT); addFocusListener(new ButtonFocusListener()); updateUI(); }
AbstractButton(String txt, Icon icon) { text = txt; default_icon = icon; model = new DefaultButtonModel(); actionListener = createActionListener(); changeListener = createChangeListener(); itemListener = createItemListener(); model.addActionListener(actionListener); model.addChangeListener(changeListener); model.addItemListener(itemListener); hori_align = CENTER; hori_text_pos = TRAILING; vert_align = CENTER; vert_text_pos = CENTER; paint_border = true; content_area_filled = true; setAlignmentX(LEFT_ALIGNMENT); setAlignmentY(CENTER_ALIGNMENT); addFocusListener(new ButtonFocusListener()); updateUI(); }
16,421
public void setAction(Action a) { if (action != null) { action.removePropertyChangeListener(actionPropertyChangeListener); removeActionListener(action); if (actionPropertyChangeListener != null) { action.removePropertyChangeListener(actionPropertyChangeListener); actionPropertyChangeListener = null; } actionPropertyChangeListener = createActionPropertyChangeListener(a); } Action old = action; action = a; configurePropertiesFromAction(action); if (action != null) { action.addPropertyChangeListener(actionPropertyChangeListener); addActionListener(action); } }
public void setAction(Action a) { if (action != null) { action.removePropertyChangeListener(actionPropertyChangeListener); removeActionListener(action); if (actionPropertyChangeListener != null) { action.removePropertyChangeListener(actionPropertyChangeListener); actionPropertyChangeListener = null; } } Action old = action; action = a; configurePropertiesFromAction(action); if (action != null) { action.addPropertyChangeListener(actionPropertyChangeListener); addActionListener(action); } }
16,422
protected PropertyChangeListener createActionPropertyChangeListener(Action a) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { Action act = (Action)(e.getSource()); AbstractButton.this.configurePropertiesFromAction(act); } }; }
protected PropertyChangeListener createActionPropertyChangeListener(Action a) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { Action act = (Action)(e.getSource()); AbstractButton.this.configurePropertiesFromAction(act); } }; }
16,425
public DefaultButtonModel() { stateMask = ENABLED; mnemonic = java.awt.event.KeyEvent.VK_UNDEFINED; listenerList = new EventListenerList(); changeEvent = new ChangeEvent(this); }
public DefaultButtonModel() { stateMask = ENABLED; mnemonic = java.awt.event.KeyEvent.VK_UNDEFINED; listenerList = new EventListenerList(); changeEvent = new ChangeEvent(this); }
16,426
void addChangeListener(ChangeListener l);
void addChangeListener(ChangeListener listener);
16,427
void removeChangeListener(ChangeListener l);
void removeChangeListener(ChangeListener listener);
16,428
public SimpleAttributeSet(AttributeSet a) { tab = new Hashtable(); addAttributes(a); }
public SimpleAttributeSet() { tab = new Hashtable(); addAttributes(a); }
16,429
public SimpleAttributeSet(AttributeSet a) { tab = new Hashtable(); addAttributes(a); }
public SimpleAttributeSet(AttributeSet a) { tab = new Hashtable(); addAttributes(a); }
16,430
public Enumeration<K> keys() { return new Enumerator<K>(KEYS); }
public Enumeration<K> keys() { return new KeyEnumerator(); }
16,431
public Dimension getPreferredSize(JComponent c) { TableColumnModel cmod = header.getColumnModel(); TableCellRenderer defaultRend = header.getDefaultRenderer(); int ncols = cmod.getColumnCount(); Dimension ret = new Dimension(0,0); int spacing = 0; if (header.getTable() != null && header.getTable().getInterCellSpacing() != null) spacing = header.getTable().getInterCellSpacing().width; for (int i = 0; i < ncols; ++i) { TableColumn col = cmod.getColumn(i); TableCellRenderer rend = col.getHeaderRenderer(); if (rend == null) rend = defaultRend; Object val = col.getHeaderValue(); Component comp = rend.getTableCellRendererComponent(header.getTable(), val, false, // isSelected false, // isFocused -1, i); comp.setFont(header.getFont()); comp.setBackground(header.getBackground()); comp.setForeground(header.getForeground()); if (comp instanceof JComponent) ((JComponent)comp).setBorder(cellBorder); Dimension d = comp.getPreferredSize(); ret.width += d.width; ret.width += spacing; ret.height = Math.max(d.height, ret.height); } return ret; }
public Dimension getPreferredSize(JComponent c) { TableColumnModel cmod = header.getColumnModel(); TableCellRenderer defaultRend = header.getDefaultRenderer(); int ncols = cmod.getColumnCount(); Dimension ret = new Dimension(0,0); int spacing = 0; if (header.getTable() != null && header.getTable().getInterCellSpacing() != null) spacing = header.getTable().getInterCellSpacing().width; for (int i = 0; i < ncols; ++i) { TableColumn col = cmod.getColumn(i); TableCellRenderer rend = col.getHeaderRenderer(); if (rend == null) rend = defaultRend; Object val = col.getHeaderValue(); Component comp = rend.getTableCellRendererComponent(header.getTable(), val, false, // isSelected false, // isFocused -1, i); comp.setFont(header.getFont()); comp.setBackground(header.getBackground()); comp.setForeground(header.getForeground()); if (comp instanceof JComponent) ((JComponent)comp).setBorder(cellBorder); Dimension d = comp.getPreferredSize(); ret.width += spacing; ret.height = Math.max(d.height, ret.height); } return ret; }
16,432
public Rectangle getBoundingBox() { return getBounds(); }
public Rectangle getBoundingBox() { if (bounds == null) { if (npoints == 0) return bounds = new Rectangle (); int i = npoints - 1; int minx = xpoints[i]; int maxx = minx; int miny = ypoints[i]; int maxy = miny; while (--i >= 0) { int x = xpoints[i]; int y = ypoints[i]; if (x < minx) minx = x; else if (x > maxx) maxx = x; if (y < miny) miny = y; else if (y > maxy) maxy = y; } bounds = new Rectangle (minx, miny, maxx - minx, maxy - miny); } return bounds; }
16,435
public Rectangle getBounds() { if (bounds == null) { if (npoints == 0) return bounds = new Rectangle(); int i = npoints - 1; int minx = xpoints[i]; int maxx = minx; int miny = ypoints[i]; int maxy = miny; while (--i >= 0) { int x = xpoints[i]; int y = ypoints[i]; if (x < minx) minx = x; else if (x > maxx) maxx = x; if (y < miny) miny = y; else if (y > maxy) maxy = y; } bounds = new Rectangle(minx, maxy, maxx - minx, maxy - miny); } return bounds; }
public Rectangle getBounds() { if (bounds == null) { if (npoints == 0) return bounds = new Rectangle(); int i = npoints - 1; int minx = xpoints[i]; int maxx = minx; int miny = ypoints[i]; int maxy = miny; while (--i >= 0) { int x = xpoints[i]; int y = ypoints[i]; if (x < minx) minx = x; else if (x > maxx) maxx = x; if (y < miny) miny = y; else if (y > maxy) maxy = y; } bounds = new Rectangle(minx, maxy, maxx - minx, maxy - miny); } return bounds; }
16,436
public void translate(int dx, int dy) { int i = npoints; while (--i >= 0) { xpoints[i] += dx; xpoints[i] += dy; } if (bounds != null) { bounds.x += dx; bounds.y += dy; } condensed = null; }
public void translate(int dx, int dy) { int i = npoints; while (--i >= 0) { xpoints[i] += dx; ypoints[i] += dy; } if (bounds != null) { bounds.x += dx; bounds.y += dy; } condensed = null; }
16,437
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { String s = value.toString(); // String maybe larger than comboBox. FontMetrics fm = getToolkit().getFontMetrics(list.getFont()); int strWidth = SwingUtilities.computeStringWidth(fm, s); int cbWidth = getSize().width; if (cbWidth != 0 && strWidth > cbWidth) { char[] str = s.toCharArray(); int currWidth = 0; int i = 0; String postStr = "... "; cbWidth -= SwingUtilities.computeStringWidth(fm, postStr); while (i < str.length && currWidth < cbWidth) { ++i; currWidth = SwingUtilities.computeStringWidth(fm, new String(str, 0, i)); } setText(new String(str, 0, i) + postStr); } else setText(s); setOpaque(true); if (isSelected || cellHasFocus) { setBackground(list.getSelectionBackground()); setForeground(list.getSelectionForeground()); } else { setBackground(list.getBackground()); setForeground(list.getForeground()); } setEnabled(list.isEnabled()); setFont(list.getFont()); return this; }
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { String s = value.toString(); // String maybe larger than comboBox. FontMetrics fm = getToolkit().getFontMetrics(list.getFont()); int strWidth = SwingUtilities.computeStringWidth(fm, s); int cbWidth = getSize().width; if (cbWidth != 0 && strWidth > cbWidth) { char[] str = s.toCharArray(); int currWidth = 0; int i = 0; String postStr = "... "; cbWidth -= SwingUtilities.computeStringWidth(fm, postStr); while (i < str.length && currWidth < cbWidth) { ++i; currWidth = SwingUtilities.computeStringWidth(fm, new String(str, 0, i)); } setText(new String(str, 0, i) + postStr); } else setText(s); setOpaque(true); if (isSelected || cellHasFocus) { setBackground(list.getSelectionBackground()); setForeground(list.getSelectionForeground()); } else { setBackground(list.getBackground()); setForeground(list.getForeground()); } setEnabled(list.isEnabled()); setFont(list.getFont()); return this; }
16,438
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { String s = value.toString(); // String maybe larger than comboBox. FontMetrics fm = getToolkit().getFontMetrics(list.getFont()); int strWidth = SwingUtilities.computeStringWidth(fm, s); int cbWidth = getSize().width; if (cbWidth != 0 && strWidth > cbWidth) { char[] str = s.toCharArray(); int currWidth = 0; int i = 0; String postStr = "... "; cbWidth -= SwingUtilities.computeStringWidth(fm, postStr); while (i < str.length && currWidth < cbWidth) { ++i; currWidth = SwingUtilities.computeStringWidth(fm, new String(str, 0, i)); } setText(new String(str, 0, i) + postStr); } else setText(s); setOpaque(true); if (isSelected || cellHasFocus) { setBackground(list.getSelectionBackground()); setForeground(list.getSelectionForeground()); } else { setBackground(list.getBackground()); setForeground(list.getForeground()); } setEnabled(list.isEnabled()); setFont(list.getFont()); return this; }
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { String s = value.toString(); // String maybe larger than comboBox. FontMetrics fm = getToolkit().getFontMetrics(list.getFont()); int strWidth = SwingUtilities.computeStringWidth(fm, s); int cbWidth = getSize().width; if (cbWidth != 0 && strWidth > cbWidth) { char[] str = s.toCharArray(); int currWidth = 0; int i = 0; String postStr = "... "; cbWidth -= SwingUtilities.computeStringWidth(fm, postStr); while (i < str.length && currWidth < cbWidth) { ++i; currWidth = SwingUtilities.computeStringWidth(fm, new String(str, 0, i)); } setText(new String(str, 0, i) + postStr); } else setText(s); setOpaque(true); if (isSelected || cellHasFocus) { setBackground(list.getSelectionBackground()); setForeground(list.getSelectionForeground()); } else { setBackground(list.getBackground()); setForeground(list.getForeground()); } setEnabled(list.isEnabled()); setFont(list.getFont()); return this; }
16,439
public void setBounds(int x, int y, int width, int height) { this.x = x; this.y = y; this.width = width; this.height = height; }
public void setBounds(int x, int y, int width, int height) { this.x = x; this.y = y; this.width = width; this.height = height; }
16,440
public MouseEvent(Component source, int id, long when, int modifiers, int x, int y, int clickCount, boolean popupTrigger, int button) { super(source, id, when, modifiers); this.x = x; this.y = y; this.clickCount = clickCount; this.popupTrigger = popupTrigger; this.button = button; if (button < NOBUTTON || button > BUTTON3) throw new IllegalArgumentException(); if ((modifiers & EventModifier.OLD_MASK) != 0) { if ((modifiers & BUTTON1_MASK) != 0) button = BUTTON1; else if ((modifiers & BUTTON2_MASK) != 0) button = BUTTON2; else if ((modifiers & BUTTON3_MASK) != 0) button = BUTTON3; } }
public MouseEvent(Component source, int id, long when, int modifiers, int x, int y, int clickCount, boolean popupTrigger, int button) { super(source, id, when, modifiers); this.x = x; this.y = y; this.clickCount = clickCount; this.popupTrigger = popupTrigger; this.button = button; if (button < NOBUTTON || button > BUTTON3) throw new IllegalArgumentException(); if ((modifiers & EventModifier.OLD_MASK) != 0) { if ((modifiers & BUTTON1_MASK) != 0) this.button = BUTTON1; else if ((modifiers & BUTTON2_MASK) != 0) button = BUTTON2; else if ((modifiers & BUTTON3_MASK) != 0) button = BUTTON3; } }
16,441
public MouseEvent(Component source, int id, long when, int modifiers, int x, int y, int clickCount, boolean popupTrigger, int button) { super(source, id, when, modifiers); this.x = x; this.y = y; this.clickCount = clickCount; this.popupTrigger = popupTrigger; this.button = button; if (button < NOBUTTON || button > BUTTON3) throw new IllegalArgumentException(); if ((modifiers & EventModifier.OLD_MASK) != 0) { if ((modifiers & BUTTON1_MASK) != 0) button = BUTTON1; else if ((modifiers & BUTTON2_MASK) != 0) button = BUTTON2; else if ((modifiers & BUTTON3_MASK) != 0) button = BUTTON3; } }
public MouseEvent(Component source, int id, long when, int modifiers, int x, int y, int clickCount, boolean popupTrigger, int button) { super(source, id, when, modifiers); this.x = x; this.y = y; this.clickCount = clickCount; this.popupTrigger = popupTrigger; this.button = button; if (button < NOBUTTON || button > BUTTON3) throw new IllegalArgumentException(); if ((modifiers & EventModifier.OLD_MASK) != 0) { if ((modifiers & BUTTON1_MASK) != 0) button = BUTTON1; else if ((modifiers & BUTTON2_MASK) != 0) this.button = BUTTON2; else if ((modifiers & BUTTON3_MASK) != 0) button = BUTTON3; } }
16,442
public MouseEvent(Component source, int id, long when, int modifiers, int x, int y, int clickCount, boolean popupTrigger, int button) { super(source, id, when, modifiers); this.x = x; this.y = y; this.clickCount = clickCount; this.popupTrigger = popupTrigger; this.button = button; if (button < NOBUTTON || button > BUTTON3) throw new IllegalArgumentException(); if ((modifiers & EventModifier.OLD_MASK) != 0) { if ((modifiers & BUTTON1_MASK) != 0) button = BUTTON1; else if ((modifiers & BUTTON2_MASK) != 0) button = BUTTON2; else if ((modifiers & BUTTON3_MASK) != 0) button = BUTTON3; } }
public MouseEvent(Component source, int id, long when, int modifiers, int x, int y, int clickCount, boolean popupTrigger, int button) { super(source, id, when, modifiers); this.x = x; this.y = y; this.clickCount = clickCount; this.popupTrigger = popupTrigger; this.button = button; if (button < NOBUTTON || button > BUTTON3) throw new IllegalArgumentException(); if ((modifiers & EventModifier.OLD_MASK) != 0) { if ((modifiers & BUTTON1_MASK) != 0) button = BUTTON1; else if ((modifiers & BUTTON2_MASK) != 0) button = BUTTON2; else if ((modifiers & BUTTON3_MASK) != 0) this.button = BUTTON3; } }
16,443
public Component getFocusOwner() { // XXX Need an easy way to test if this thread is in the context of the // global focus owner, to avoid creating the exception in the first place. try { return getGlobalFocusOwner(); } catch (SecurityException e) { return null; } }
public Component getFocusOwner() { // XXX Need an easy way to test if this thread is in the context of the // global focus owner, to avoid creating the exception in the first place. try { return getGlobalFocusOwner(); } catch (SecurityException e) { return null; } }
16,444
public Component getFocusOwner() { // XXX Need an easy way to test if this thread is in the context of the // global focus owner, to avoid creating the exception in the first place. try { return getGlobalFocusOwner(); } catch (SecurityException e) { return null; } }
public Component getFocusOwner() { // XXX Need an easy way to test if this thread is in the context of the // global focus owner, to avoid creating the exception in the first place. try { return getGlobalFocusOwner(); } catch (SecurityException e) { return null; } }
16,445
public ActionEvent(Object source, int id, String command, int modifiers) { this(source, id, command, EventQueue.getMostRecentEventTime(), modifiers); }
public ActionEvent(Object source, int id, String command) { this(source, id, command, EventQueue.getMostRecentEventTime(), modifiers); }
16,446
public ActionEvent(Object source, int id, String command, int modifiers) { this(source, id, command, EventQueue.getMostRecentEventTime(), modifiers); }
public ActionEvent(Object source, int id, String command, int modifiers) { this(source, id, command, EventQueue.getMostRecentEventTime(), 0); }
16,447
public UserException() { }
protected UserException() { }
16,449
public DataBufferFloat(int size) { super(TYPE_FLOAT, size); data = new float[size]; }
public DataBufferFloat(int size) { super(TYPE_FLOAT, size, 1, 0); bankData = new float[1][]; data = new float[size]; }
16,450
public UnsupportedLookAndFeelException(String a) { super(a); }
public UnsupportedLookAndFeelException(String s) { super(a); }
16,452
public UnsupportedLookAndFeelException(String a) { super(a); }
public UnsupportedLookAndFeelException(String a) { super(s); }
16,453
public Point2D inverseTransform(Point2D src, Point2D dst) throws NoninvertibleTransformException { double det = getDeterminant(); if (det == 0) throw new NoninvertibleTransformException("couldn't invert transform"); if (dst == null) dst = new Point2D.Double(); double x = src.getX(); double y = src.getY(); double nx = (m11 * x + -m10 * y) / det - m02; double ny = (m01 * x + -m00 * y) / det - m12; dst.setLocation(nx, ny); return dst; }
public Point2D inverseTransform(Point2D src, Point2D dst) throws NoninvertibleTransformException { double det = getDeterminant(); if (det == 0) throw new NoninvertibleTransformException("couldn't invert transform"); if (dst == null) dst = new Point2D.Double(); double x = src.getX(); double y = src.getY(); double nx = (m11 * x + -m10 * y) / det - m02; double ny = (m01 * x + -m00 * y) / det - m12; dst.setLocation(nx, ny); return dst; }
16,455
public GeneralPath(Shape s) { types = new byte[INIT_SIZE]; xpoints = new float[INIT_SIZE]; ypoints = new float[INIT_SIZE]; PathIterator pi = s.getPathIterator(null); setWindingRule(pi.getWindingRule()); append(pi, false); }
public GeneralPath() { types = new byte[INIT_SIZE]; xpoints = new float[INIT_SIZE]; ypoints = new float[INIT_SIZE]; PathIterator pi = s.getPathIterator(null); setWindingRule(pi.getWindingRule()); append(pi, false); }
16,456
public GeneralPath(Shape s) { types = new byte[INIT_SIZE]; xpoints = new float[INIT_SIZE]; ypoints = new float[INIT_SIZE]; PathIterator pi = s.getPathIterator(null); setWindingRule(pi.getWindingRule()); append(pi, false); }
public GeneralPath(Shape s) { types = new byte[INIT_SIZE]; xpoints = new float[INIT_SIZE]; ypoints = new float[INIT_SIZE]; PathIterator pi = s.getPathIterator(null); setWindingRule(pi.getWindingRule()); append(pi, false); }
16,457
public final Class getCategory() { return JobImpressionsCompleted.class; }
public Class getCategory() { return JobImpressionsCompleted.class; }
16,458
public final String getName() { return "job-impressions"; }
public String getName() { return "job-impressions"; }
16,459
public UnicastServerRef(ObjID id, int port, RMIServerSocketFactory ssf) throws RemoteException { super(id); manager = UnicastConnectionManager.getInstance(port, ssf); }
public UnicastServerRef(ObjID id, int port, RMIServerSocketFactory ssf) throws RemoteException { super(id); manager = UnicastConnectionManager.getInstance(port, ssf); }
16,460
public UnicastServerRef(ObjID id, int port, RMIServerSocketFactory ssf) throws RemoteException { super(id); manager = UnicastConnectionManager.getInstance(port, ssf); }
public UnicastServerRef(ObjID id, int port, RMIServerSocketFactory ssf) throws RemoteException { super(id); manager = UnicastConnectionManager.getInstance(port, ssf); }
16,461
public Object incomingMessageCall(UnicastConnection conn, int method, long hash) throws Exception { // System.out.println("method = " + method + ", hash = " + hash); // If method is -1 then this is JDK 1.2 RMI - so use the hash // to locate the method if (method == - 1) { Method meth = (Method) methods.get(new Long(hash)); // System.out.println("class = " + myself.getClass() + ", meth = " + // meth); if (meth == null) { throw new NoSuchMethodException(); } ObjectInputStream in = conn.getObjectInputStream(); int nrargs = meth.getParameterTypes().length; Object[] args = new Object[nrargs]; for (int i = 0; i < nrargs; i++) { /** * For debugging purposes - we don't handle CodeBases quite right so * we don't always find the stubs. This lets us know that. */ try { // need to handle primitive types args[i] = ((RMIObjectInputStream) in) .readValue(meth.getParameterTypes()[i]); } catch (Exception t) { t.printStackTrace(); throw t; } } //We must reinterpret the exception thrown by meth.invoke() //return (meth.invoke(myself, args)); Object ret = null; try { ret = meth.invoke(myself, args); } catch (InvocationTargetException e) { Throwable cause = e.getTargetException(); if (cause instanceof Exception) { throw (Exception) cause; } else if (cause instanceof Error) { throw (Error) cause; } else { throw new Error( "The remote method threw a java.lang.Throwable that"+ " is neither java.lang.Exception nor java.lang.Error.", e); } } return ret; } // Otherwise this is JDK 1.1 style RMI - we find the skeleton // and invoke it using the method number. We wrap up our // connection system in a UnicastRemoteCall so it appears in a // way the Skeleton can handle. else { if (skel == null) { throw new NoSuchMethodException(); } UnicastRemoteCall call = new UnicastRemoteCall(conn); skel.dispatch(myself, call, method, hash); if (! call.isReturnValue()) return RMIVoidValue.INSTANCE; else return (call.returnValue()); } }
public Object incomingMessageCall(UnicastConnection conn, int method, long hash) throws Exception { // System.out.println("method = " + method + ", hash = " + hash); // If method is -1 then this is JDK 1.2 RMI - so use the hash // to locate the method if (method == - 1) { Method meth = (Method) methods.get(new Long(hash)); // System.out.println("class = " + myself.getClass() + ", meth = " + // meth); if (meth == null) { throw new NoSuchMethodException( myself.getClass().getName()+" hash "+hash); } ObjectInputStream in = conn.getObjectInputStream(); int nrargs = meth.getParameterTypes().length; Object[] args = new Object[nrargs]; for (int i = 0; i < nrargs; i++) { /** * For debugging purposes - we don't handle CodeBases quite right so * we don't always find the stubs. This lets us know that. */ try { // need to handle primitive types args[i] = ((RMIObjectInputStream) in) .readValue(meth.getParameterTypes()[i]); } catch (Exception t) { t.printStackTrace(); throw t; } } //We must reinterpret the exception thrown by meth.invoke() //return (meth.invoke(myself, args)); Object ret = null; try { ret = meth.invoke(myself, args); } catch (InvocationTargetException e) { Throwable cause = e.getTargetException(); if (cause instanceof Exception) { throw (Exception) cause; } else if (cause instanceof Error) { throw (Error) cause; } else { throw new Error( "The remote method threw a java.lang.Throwable that"+ " is neither java.lang.Exception nor java.lang.Error.", e); } } return ret; } // Otherwise this is JDK 1.1 style RMI - we find the skeleton // and invoke it using the method number. We wrap up our // connection system in a UnicastRemoteCall so it appears in a // way the Skeleton can handle. else { if (skel == null) { throw new NoSuchMethodException( myself.getClass().getName()+" hash "+hash); } UnicastRemoteCall call = new UnicastRemoteCall(conn); skel.dispatch(myself, call, method, hash); if (! call.isReturnValue()) return RMIVoidValue.INSTANCE; else return (call.returnValue()); } }
16,462
public Object incomingMessageCall(UnicastConnection conn, int method, long hash) throws Exception { // System.out.println("method = " + method + ", hash = " + hash); // If method is -1 then this is JDK 1.2 RMI - so use the hash // to locate the method if (method == - 1) { Method meth = (Method) methods.get(new Long(hash)); // System.out.println("class = " + myself.getClass() + ", meth = " + // meth); if (meth == null) { throw new NoSuchMethodException(); } ObjectInputStream in = conn.getObjectInputStream(); int nrargs = meth.getParameterTypes().length; Object[] args = new Object[nrargs]; for (int i = 0; i < nrargs; i++) { /** * For debugging purposes - we don't handle CodeBases quite right so * we don't always find the stubs. This lets us know that. */ try { // need to handle primitive types args[i] = ((RMIObjectInputStream) in) .readValue(meth.getParameterTypes()[i]); } catch (Exception t) { t.printStackTrace(); throw t; } } //We must reinterpret the exception thrown by meth.invoke() //return (meth.invoke(myself, args)); Object ret = null; try { ret = meth.invoke(myself, args); } catch (InvocationTargetException e) { Throwable cause = e.getTargetException(); if (cause instanceof Exception) { throw (Exception) cause; } else if (cause instanceof Error) { throw (Error) cause; } else { throw new Error( "The remote method threw a java.lang.Throwable that"+ " is neither java.lang.Exception nor java.lang.Error.", e); } } return ret; } // Otherwise this is JDK 1.1 style RMI - we find the skeleton // and invoke it using the method number. We wrap up our // connection system in a UnicastRemoteCall so it appears in a // way the Skeleton can handle. else { if (skel == null) { throw new NoSuchMethodException(); } UnicastRemoteCall call = new UnicastRemoteCall(conn); skel.dispatch(myself, call, method, hash); if (! call.isReturnValue()) return RMIVoidValue.INSTANCE; else return (call.returnValue()); } }
public Object incomingMessageCall(UnicastConnection conn, int method, long hash) throws Exception { // System.out.println("method = " + method + ", hash = " + hash); // If method is -1 then this is JDK 1.2 RMI - so use the hash // to locate the method if (method == - 1) { Method meth = (Method) methods.get(new Long(hash)); // System.out.println("class = " + myself.getClass() + ", meth = " + // meth); if (meth == null) { throw new NoSuchMethodException(); } ObjectInputStream in = conn.getObjectInputStream(); int nrargs = meth.getParameterTypes().length; Object[] args = new Object[nrargs]; for (int i = 0; i < nrargs; i++) { /** * For debugging purposes - we don't handle CodeBases quite right so * we don't always find the stubs. This lets us know that. */ try { // need to handle primitive types args[i] = ((RMIObjectInputStream) in) .readValue(meth.getParameterTypes()[i]); } catch (Exception t) { t.printStackTrace(); throw t; } } //We must reinterpret the exception thrown by meth.invoke() //return (meth.invoke(myself, args)); Object ret = null; try { ret = meth.invoke(myself, args); } catch (InvocationTargetException e) { Throwable cause = e.getTargetException(); if (cause instanceof Exception) { throw (Exception) cause; } else if (cause instanceof Error) { throw (Error) cause; } else { throw new Error( "The remote method threw a java.lang.Throwable that"+ " is neither java.lang.Exception nor java.lang.Error.", e); } } return ret; } // Otherwise this is JDK 1.1 style RMI - we find the skeleton // and invoke it using the method number. We wrap up our // connection system in a UnicastRemoteCall so it appears in a // way the Skeleton can handle. else { if (skel == null) { throw new NoSuchMethodException(); } UnicastRemoteCall call = new UnicastRemoteCall(conn); skel.dispatch(myself, call, method, hash); if (! call.isReturnValue()) return RMIVoidValue.INSTANCE; else return (call.returnValue()); } }
16,463
public UnicastRef(ObjID objid) { this.objid = objid; }
public UnicastRef() { this.objid = objid; }
16,464
public UnicastRef(ObjID objid) { this.objid = objid; }
public UnicastRef(ObjID objid) { }
16,465
public NoSuchMethodException(String s) { super(s); }
public NoSuchMethodException() { super(s); }
16,466
public NoSuchMethodException(String s) { super(s); }
public NoSuchMethodException(String s) { }
16,467
public abstract void setEnabled(boolean enabled);
void setEnabled(boolean enabled);
16,469
void actionPerformed(ActionEvent e);
void actionPerformed(ActionEvent event);
16,470
public abstract void setLabel(String text);
void setLabel(String text);
16,471
public ConstantRefAssignQuad(int address, IRBasicBlock block, int lhsIndex, Constant rhs) { super(address, block, lhsIndex); this.rhs = rhs; setDeadCode(true); // this will change if this is a phi operand }
public ConstantRefAssignQuad(int address, IRBasicBlock block, int lhsIndex, Constant rhs) { super(address, block, lhsIndex); this.rhs = rhs; // this will change if this is a phi operand }
16,472
public void doPass2(BootableHashMap liveVariables) { setDeadCode(true); }
public void doPass2(BootableHashMap liveVariables) { setDeadCode(true); }
16,473
public abstract void doPass2(BootableHashMap liveVariables);
public abstract void doPass2();
16,475
public static void main(String[] args) { int port = PORT; String iorf = null; try { // Create and initialize the ORB final Functional_ORB orb = new Functional_ORB(); if (args.length > 1) for (int i = 0; i < args.length - 1; i++) { if (args [ i ].endsWith("ORBInitialPort")) port = Integer.parseInt(args [ i + 1 ]); if (args [ i ].equals("-ior")) iorf = args [ i + 1 ]; } Functional_ORB.setPort(port); // Create the servant and register it with the ORB NamingContextExt namer = new Ext(new TransientContext()); orb.connect(namer, getDefaultKey()); // Storing the IOR reference. String ior = orb.object_to_string(namer); if (iorf != null) { FileOutputStream f = new FileOutputStream(iorf); PrintStream p = new PrintStream(f); p.print(ior); p.close(); } System.out.println("GNU Classpath, transient naming service. " + "Copyright (C) 2005 Free Software Foundation\n" + "This tool comes with ABSOLUTELY NO WARRANTY. " + "This is free software, and you are\nwelcome to " + "redistribute it under conditions, defined in " + "GNU Classpath license.\n\n" + ior ); new Thread() { public void run() { // Wait for invocations from clients. orb.run(); } }.start(); } catch (Exception e) { System.err.println("ERROR: " + e); e.printStackTrace(System.out); } // Restore the default value for allocating ports for the subsequent objects. Functional_ORB.setPort(Functional_ORB.DEFAULT_INITIAL_PORT); }
public static void main(String[] args) { int port = PORT; String iorf = null; try { // Create and initialize the ORB final Functional_ORB orb = new Functional_ORB(); if (args.length > 1) for (int i = 0; i < args.length - 1; i++) { if (args [ i ].endsWith("ORBInitialPort")) port = Integer.parseInt(args [ i + 1 ]); if (args [ i ].equals("-ior")) iorf = args [ i + 1 ]; } Functional_ORB.setPort(port); // Create the servant and register it with the ORB NamingContextExt namer = new Ext(new TransientContext()); orb.connect(namer, "NameService".getBytes()); // Storing the IOR reference. String ior = orb.object_to_string(namer); if (iorf != null) { FileOutputStream f = new FileOutputStream(iorf); PrintStream p = new PrintStream(f); p.print(ior); p.close(); } System.out.println("GNU Classpath, transient naming service. " + "Copyright (C) 2005 Free Software Foundation\n" + "This tool comes with ABSOLUTELY NO WARRANTY. " + "This is free software, and you are\nwelcome to " + "redistribute it under conditions, defined in " + "GNU Classpath license.\n\n" + ior ); new Thread() { public void run() { // Wait for invocations from clients. orb.run(); } }.start(); } catch (Exception e) { System.err.println("ERROR: " + e); e.printStackTrace(System.out); } // Restore the default value for allocating ports for the subsequent objects. Functional_ORB.setPort(Functional_ORB.DEFAULT_INITIAL_PORT); }
16,476
public static void main(String[] args) { int port = PORT; String iorf = null; try { // Create and initialize the ORB final Functional_ORB orb = new Functional_ORB(); if (args.length > 1) for (int i = 0; i < args.length - 1; i++) { if (args [ i ].endsWith("ORBInitialPort")) port = Integer.parseInt(args [ i + 1 ]); if (args [ i ].equals("-ior")) iorf = args [ i + 1 ]; } Functional_ORB.setPort(port); // Create the servant and register it with the ORB NamingContextExt namer = new Ext(new TransientContext()); orb.connect(namer, getDefaultKey()); // Storing the IOR reference. String ior = orb.object_to_string(namer); if (iorf != null) { FileOutputStream f = new FileOutputStream(iorf); PrintStream p = new PrintStream(f); p.print(ior); p.close(); } System.out.println("GNU Classpath, transient naming service. " + "Copyright (C) 2005 Free Software Foundation\n" + "This tool comes with ABSOLUTELY NO WARRANTY. " + "This is free software, and you are\nwelcome to " + "redistribute it under conditions, defined in " + "GNU Classpath license.\n\n" + ior ); new Thread() { public void run() { // Wait for invocations from clients. orb.run(); } }.start(); } catch (Exception e) { System.err.println("ERROR: " + e); e.printStackTrace(System.out); } // Restore the default value for allocating ports for the subsequent objects. Functional_ORB.setPort(Functional_ORB.DEFAULT_INITIAL_PORT); }
public static void main(String[] args) { int port = PORT; String iorf = null; try { // Create and initialize the ORB final Functional_ORB orb = new Functional_ORB(); if (args.length > 1) for (int i = 0; i < args.length - 1; i++) { if (args [ i ].endsWith("ORBInitialPort")) port = Integer.parseInt(args [ i + 1 ]); if (args [ i ].equals("-ior")) iorf = args [ i + 1 ]; } Functional_ORB.setPort(port); // Create the servant and register it with the ORB NamingContextExt namer = new Ext(new TransientContext()); orb.connect(namer, getDefaultKey()); // Storing the IOR reference. String ior = orb.object_to_string(namer); if (iorf != null) { FileOutputStream f = new FileOutputStream(iorf); PrintStream p = new PrintStream(f); p.print(ior); p.close(); } System.out.println("GNU Classpath, transient naming service. " + "Copyright (C) 2005 Free Software Foundation\n" + "This tool comes with ABSOLUTELY NO WARRANTY. " + "This is free software, and you are\nwelcome to " + "redistribute it under conditions, defined in " + "GNU Classpath license.\n\n" + ior ); new Thread() { public void run() { // Wait for invocations from clients. orb.run(); } }.start(); } catch (Exception e) { System.err.println("ERROR: " + e); e.printStackTrace(System.out); } // Restore the default value for allocating ports for the subsequent objects. Functional_ORB.setPort(Functional_ORB.DEFAULT_INITIAL_PORT); }
16,477
public byte[] getBytes(String enc) throws UnsupportedEncodingException { try { CharsetEncoder cse = Charset.forName(enc).newEncoder(); cse.onMalformedInput(CodingErrorAction.REPLACE); cse.onUnmappableCharacter(CodingErrorAction.REPLACE); ByteBuffer bbuf = cse.encode(CharBuffer.wrap(value, offset, count)); if(bbuf.hasArray()) return bbuf.array(); // Doubt this will happen. But just in case. byte[] bytes = new byte[bbuf.remaining()]; bbuf.get(bytes); return bytes; } catch(IllegalCharsetNameException e) { throw new UnsupportedEncodingException("Encoding: " + enc + " not found."); } catch(UnsupportedCharsetException e) { throw new UnsupportedEncodingException("Encoding: " + enc + " not found."); } catch(CharacterCodingException e) { // This shouldn't ever happen. throw (InternalError) new InternalError().initCause(e); } }
public void getBytes(int srcBegin, int srcEnd, byte dst[], int dstBegin) { try { CharsetEncoder cse = Charset.forName(enc).newEncoder(); cse.onMalformedInput(CodingErrorAction.REPLACE); cse.onUnmappableCharacter(CodingErrorAction.REPLACE); ByteBuffer bbuf = cse.encode(CharBuffer.wrap(value, offset, count)); if(bbuf.hasArray()) return bbuf.array(); // Doubt this will happen. But just in case. byte[] bytes = new byte[bbuf.remaining()]; bbuf.get(bytes); return bytes; } catch(IllegalCharsetNameException e) { throw new UnsupportedEncodingException("Encoding: " + enc + " not found."); } catch(UnsupportedCharsetException e) { throw new UnsupportedEncodingException("Encoding: " + enc + " not found."); } catch(CharacterCodingException e) { // This shouldn't ever happen. throw (InternalError) new InternalError().initCause(e); } }
16,478
public byte[] getBytes(String enc) throws UnsupportedEncodingException { try { CharsetEncoder cse = Charset.forName(enc).newEncoder(); cse.onMalformedInput(CodingErrorAction.REPLACE); cse.onUnmappableCharacter(CodingErrorAction.REPLACE); ByteBuffer bbuf = cse.encode(CharBuffer.wrap(value, offset, count)); if(bbuf.hasArray()) return bbuf.array(); // Doubt this will happen. But just in case. byte[] bytes = new byte[bbuf.remaining()]; bbuf.get(bytes); return bytes; } catch(IllegalCharsetNameException e) { throw new UnsupportedEncodingException("Encoding: " + enc + " not found."); } catch(UnsupportedCharsetException e) { throw new UnsupportedEncodingException("Encoding: " + enc + " not found."); } catch(CharacterCodingException e) { // This shouldn't ever happen. throw (InternalError) new InternalError().initCause(e); } }
public byte[] getBytes(String enc) throws UnsupportedEncodingException { try { CharsetEncoder cse = Charset.forName(enc).newEncoder(); cse.onMalformedInput(CodingErrorAction.REPLACE); cse.onUnmappableCharacter(CodingErrorAction.REPLACE); ByteBuffer bbuf = cse.encode(CharBuffer.wrap(value, offset, count)); if(bbuf.hasArray()) return bbuf.array(); // Doubt this will happen. But just in case. byte[] bytes = new byte[bbuf.remaining()]; bbuf.get(bytes); return bytes; } catch(IllegalCharsetNameException e) { throw new UnsupportedEncodingException("Encoding: " + enc + " not found."); } catch(UnsupportedCharsetException e) { throw new UnsupportedEncodingException("Encoding: " + enc + " not found."); } catch(CharacterCodingException e) { // This shouldn't ever happen. throw (InternalError) new InternalError().initCause(e); } }
16,479
public void load(InputStream inStream) throws IOException { // The spec says that the file must be encoded using ISO-8859-1. BufferedReader reader = new BufferedReader(new InputStreamReader(inStream, "ISO-8859-1")); String line; while ((line = reader.readLine()) != null) { char c = 0; int pos = 0; // Leading whitespaces must be deleted first. while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; // If empty line or begins with a comment character, skip this line. if ((line.length() - pos) == 0 || line.charAt(pos) == '#' || line.charAt(pos) == '!') continue; // The characters up to the next Whitespace, ':', or '=' // describe the key. But look for escape sequences. StringBuffer key = new StringBuffer(); while (pos < line.length() && ! Character.isWhitespace(c = line.charAt(pos++)) && c != '=' && c != ':') { if (c == '\\') { if (pos == line.length()) { // The line continues on the next line. If there // is no next line, just treat it as a key with an // empty value. line = reader.readLine(); if (line == null) line = ""; pos = 0; while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; } else { c = line.charAt(pos++); switch (c) { case 'n': key.append('\n'); break; case 't': key.append('\t'); break; case 'r': key.append('\r'); break; case 'u': if (pos + 4 <= line.length()) { char uni = (char) Integer.parseInt (line.substring(pos, pos + 4), 16); key.append(uni); pos += 4; } // else throw exception? break; default: key.append(c); break; } } } else key.append(c); } boolean isDelim = (c == ':' || c == '='); while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; if (! isDelim && (c == ':' || c == '=')) { pos++; while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; } StringBuffer element = new StringBuffer(line.length() - pos); while (pos < line.length()) { c = line.charAt(pos++); if (c == '\\') { if (pos == line.length()) { // The line continues on the next line. line = reader.readLine(); // We might have seen a backslash at the end of // the file. The JDK ignores the backslash in // this case, so we follow for compatibility. if (line == null) break; pos = 0; while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; element.ensureCapacity(line.length() - pos + element.length()); } else { c = line.charAt(pos++); switch (c) { case 'n': element.append('\n'); break; case 't': element.append('\t'); break; case 'r': element.append('\r'); break; case 'u': if (pos + 4 <= line.length()) { char uni = (char) Integer.parseInt (line.substring(pos, pos + 4), 16); element.append(uni); pos += 4; } // else throw exception? break; default: element.append(c); break; } } } else element.append(c); } put(key.toString(), element.toString()); } }
public void load(InputStream inStream) throws IOException { // The spec says that the file must be encoded using ISO-8859-1. BufferedReader reader = new BufferedReader(new InputStreamReader(inStream, "ISO-8859-1")); String line; while ((line = reader.readLine()) != null) { char c = 0; int pos = 0; // Leading whitespaces must be deleted first. while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; // If empty line or begins with a comment character, skip this line. if ((line.length() - pos) == 0 || line.charAt(pos) == '#' || line.charAt(pos) == '!') continue; // The characters up to the next Whitespace, ':', or '=' // describe the key. But look for escape sequences. int start = pos; boolean needsEscape = line.indexOf('\\', pos) != -1; StringBuilder key = needsEscape ? new StringBuilder() : null; while (pos < line.length() && ! Character.isWhitespace(c = line.charAt(pos++)) && c != '=' && c != ':') { if (c == '\\') { if (pos == line.length()) { // The line continues on the next line. If there // is no next line, just treat it as a key with an // empty value. line = reader.readLine(); if (line == null) line = ""; pos = 0; while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; } else { c = line.charAt(pos++); switch (c) { case 'n': key.append('\n'); break; case 't': key.append('\t'); break; case 'r': key.append('\r'); break; case 'u': if (pos + 4 <= line.length()) { char uni = (char) Integer.parseInt (line.substring(pos, pos + 4), 16); key.append(uni); pos += 4; } // else throw exception? break; default: key.append(c); break; } } } else key.append(c); } boolean isDelim = (c == ':' || c == '='); while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; if (! isDelim && (c == ':' || c == '=')) { pos++; while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; } StringBuffer element = new StringBuffer(line.length() - pos); while (pos < line.length()) { c = line.charAt(pos++); if (c == '\\') { if (pos == line.length()) { // The line continues on the next line. line = reader.readLine(); // We might have seen a backslash at the end of // the file. The JDK ignores the backslash in // this case, so we follow for compatibility. if (line == null) break; pos = 0; while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; element.ensureCapacity(line.length() - pos + element.length()); } else { c = line.charAt(pos++); switch (c) { case 'n': element.append('\n'); break; case 't': element.append('\t'); break; case 'r': element.append('\r'); break; case 'u': if (pos + 4 <= line.length()) { char uni = (char) Integer.parseInt (line.substring(pos, pos + 4), 16); element.append(uni); pos += 4; } // else throw exception? break; default: element.append(c); break; } } } else element.append(c); } put(key.toString(), element.toString()); } }
16,480
public void load(InputStream inStream) throws IOException { // The spec says that the file must be encoded using ISO-8859-1. BufferedReader reader = new BufferedReader(new InputStreamReader(inStream, "ISO-8859-1")); String line; while ((line = reader.readLine()) != null) { char c = 0; int pos = 0; // Leading whitespaces must be deleted first. while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; // If empty line or begins with a comment character, skip this line. if ((line.length() - pos) == 0 || line.charAt(pos) == '#' || line.charAt(pos) == '!') continue; // The characters up to the next Whitespace, ':', or '=' // describe the key. But look for escape sequences. StringBuffer key = new StringBuffer(); while (pos < line.length() && ! Character.isWhitespace(c = line.charAt(pos++)) && c != '=' && c != ':') { if (c == '\\') { if (pos == line.length()) { // The line continues on the next line. If there // is no next line, just treat it as a key with an // empty value. line = reader.readLine(); if (line == null) line = ""; pos = 0; while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; } else { c = line.charAt(pos++); switch (c) { case 'n': key.append('\n'); break; case 't': key.append('\t'); break; case 'r': key.append('\r'); break; case 'u': if (pos + 4 <= line.length()) { char uni = (char) Integer.parseInt (line.substring(pos, pos + 4), 16); key.append(uni); pos += 4; } // else throw exception? break; default: key.append(c); break; } } } else key.append(c); } boolean isDelim = (c == ':' || c == '='); while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; if (! isDelim && (c == ':' || c == '=')) { pos++; while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; } StringBuffer element = new StringBuffer(line.length() - pos); while (pos < line.length()) { c = line.charAt(pos++); if (c == '\\') { if (pos == line.length()) { // The line continues on the next line. line = reader.readLine(); // We might have seen a backslash at the end of // the file. The JDK ignores the backslash in // this case, so we follow for compatibility. if (line == null) break; pos = 0; while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; element.ensureCapacity(line.length() - pos + element.length()); } else { c = line.charAt(pos++); switch (c) { case 'n': element.append('\n'); break; case 't': element.append('\t'); break; case 'r': element.append('\r'); break; case 'u': if (pos + 4 <= line.length()) { char uni = (char) Integer.parseInt (line.substring(pos, pos + 4), 16); element.append(uni); pos += 4; } // else throw exception? break; default: element.append(c); break; } } } else element.append(c); } put(key.toString(), element.toString()); } }
public void load(InputStream inStream) throws IOException { // The spec says that the file must be encoded using ISO-8859-1. BufferedReader reader = new BufferedReader(new InputStreamReader(inStream, "ISO-8859-1")); String line; while ((line = reader.readLine()) != null) { char c = 0; int pos = 0; // Leading whitespaces must be deleted first. while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; // If empty line or begins with a comment character, skip this line. if ((line.length() - pos) == 0 || line.charAt(pos) == '#' || line.charAt(pos) == '!') continue; // The characters up to the next Whitespace, ':', or '=' // describe the key. But look for escape sequences. StringBuffer key = new StringBuffer(); while (pos < line.length() && ! Character.isWhitespace(c = line.charAt(pos++)) && c != '=' && c != ':') { if (needsEscape && c == '\\') { if (pos == line.length()) { // The line continues on the next line. If there // is no next line, just treat it as a key with an // empty value. line = reader.readLine(); if (line == null) line = ""; pos = 0; while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; } else { c = line.charAt(pos++); switch (c) { case 'n': key.append('\n'); break; case 't': key.append('\t'); break; case 'r': key.append('\r'); break; case 'u': if (pos + 4 <= line.length()) { char uni = (char) Integer.parseInt (line.substring(pos, pos + 4), 16); key.append(uni); pos += 4; } // else throw exception? break; default: key.append(c); break; } } } else key.append(c); } boolean isDelim = (c == ':' || c == '='); while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; if (! isDelim && (c == ':' || c == '=')) { pos++; while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; } StringBuffer element = new StringBuffer(line.length() - pos); while (pos < line.length()) { c = line.charAt(pos++); if (needsEscape && c == '\\') { if (pos == line.length()) { // The line continues on the next line. line = reader.readLine(); // We might have seen a backslash at the end of // the file. The JDK ignores the backslash in // this case, so we follow for compatibility. if (line == null) break; pos = 0; while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; element.ensureCapacity(line.length() - pos + element.length()); } else { c = line.charAt(pos++); switch (c) { case 'n': element.append('\n'); break; case 't': element.append('\t'); break; case 'r': element.append('\r'); break; case 'u': if (pos + 4 <= line.length()) { char uni = (char) Integer.parseInt (line.substring(pos, pos + 4), 16); element.append(uni); pos += 4; } // else throw exception? break; default: element.append(c); break; } } } else element.append(c); } put(key.toString(), element.toString()); } }
16,481
public void load(InputStream inStream) throws IOException { // The spec says that the file must be encoded using ISO-8859-1. BufferedReader reader = new BufferedReader(new InputStreamReader(inStream, "ISO-8859-1")); String line; while ((line = reader.readLine()) != null) { char c = 0; int pos = 0; // Leading whitespaces must be deleted first. while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; // If empty line or begins with a comment character, skip this line. if ((line.length() - pos) == 0 || line.charAt(pos) == '#' || line.charAt(pos) == '!') continue; // The characters up to the next Whitespace, ':', or '=' // describe the key. But look for escape sequences. StringBuffer key = new StringBuffer(); while (pos < line.length() && ! Character.isWhitespace(c = line.charAt(pos++)) && c != '=' && c != ':') { if (c == '\\') { if (pos == line.length()) { // The line continues on the next line. If there // is no next line, just treat it as a key with an // empty value. line = reader.readLine(); if (line == null) line = ""; pos = 0; while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; } else { c = line.charAt(pos++); switch (c) { case 'n': key.append('\n'); break; case 't': key.append('\t'); break; case 'r': key.append('\r'); break; case 'u': if (pos + 4 <= line.length()) { char uni = (char) Integer.parseInt (line.substring(pos, pos + 4), 16); key.append(uni); pos += 4; } // else throw exception? break; default: key.append(c); break; } } } else key.append(c); } boolean isDelim = (c == ':' || c == '='); while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; if (! isDelim && (c == ':' || c == '=')) { pos++; while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; } StringBuffer element = new StringBuffer(line.length() - pos); while (pos < line.length()) { c = line.charAt(pos++); if (c == '\\') { if (pos == line.length()) { // The line continues on the next line. line = reader.readLine(); // We might have seen a backslash at the end of // the file. The JDK ignores the backslash in // this case, so we follow for compatibility. if (line == null) break; pos = 0; while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; element.ensureCapacity(line.length() - pos + element.length()); } else { c = line.charAt(pos++); switch (c) { case 'n': element.append('\n'); break; case 't': element.append('\t'); break; case 'r': element.append('\r'); break; case 'u': if (pos + 4 <= line.length()) { char uni = (char) Integer.parseInt (line.substring(pos, pos + 4), 16); element.append(uni); pos += 4; } // else throw exception? break; default: element.append(c); break; } } } else element.append(c); } put(key.toString(), element.toString()); } }
public void load(InputStream inStream) throws IOException { // The spec says that the file must be encoded using ISO-8859-1. BufferedReader reader = new BufferedReader(new InputStreamReader(inStream, "ISO-8859-1")); String line; while ((line = reader.readLine()) != null) { char c = 0; int pos = 0; // Leading whitespaces must be deleted first. while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; // If empty line or begins with a comment character, skip this line. if ((line.length() - pos) == 0 || line.charAt(pos) == '#' || line.charAt(pos) == '!') continue; // The characters up to the next Whitespace, ':', or '=' // describe the key. But look for escape sequences. StringBuffer key = new StringBuffer(); while (pos < line.length() && ! Character.isWhitespace(c = line.charAt(pos++)) && c != '=' && c != ':') { if (c == '\\') { if (pos == line.length()) { // The line continues on the next line. If there // is no next line, just treat it as a key with an // empty value. line = reader.readLine(); if (line == null) line = ""; pos = 0; while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; } else if (needsEscape) { c = line.charAt(pos++); switch (c) { case 'n': key.append('\n'); break; case 't': key.append('\t'); break; case 'r': key.append('\r'); break; case 'u': if (pos + 4 <= line.length()) { char uni = (char) Integer.parseInt (line.substring(pos, pos + 4), 16); key.append(uni); pos += 4; } // else if (needsEscape) throw exception? break; default: key.append(c); break; } } } else if (needsEscape) key.append(c); } boolean isDelim = (c == ':' || c == '='); while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; if (! isDelim && (c == ':' || c == '=')) { pos++; while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; } StringBuffer element = new StringBuffer(line.length() - pos); while (pos < line.length()) { c = line.charAt(pos++); if (c == '\\') { if (pos == line.length()) { // The line continues on the next line. line = reader.readLine(); // We might have seen a backslash at the end of // the file. The JDK ignores the backslash in // this case, so we follow for compatibility. if (line == null) break; pos = 0; while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; element.ensureCapacity(line.length() - pos + element.length()); } else if (needsEscape) { c = line.charAt(pos++); switch (c) { case 'n': element.append('\n'); break; case 't': element.append('\t'); break; case 'r': element.append('\r'); break; case 'u': if (pos + 4 <= line.length()) { char uni = (char) Integer.parseInt (line.substring(pos, pos + 4), 16); element.append(uni); pos += 4; } // else if (needsEscape) throw exception? break; default: element.append(c); break; } } } else if (needsEscape) element.append(c); } put(key.toString(), element.toString()); } }
16,482
public void load(InputStream inStream) throws IOException { // The spec says that the file must be encoded using ISO-8859-1. BufferedReader reader = new BufferedReader(new InputStreamReader(inStream, "ISO-8859-1")); String line; while ((line = reader.readLine()) != null) { char c = 0; int pos = 0; // Leading whitespaces must be deleted first. while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; // If empty line or begins with a comment character, skip this line. if ((line.length() - pos) == 0 || line.charAt(pos) == '#' || line.charAt(pos) == '!') continue; // The characters up to the next Whitespace, ':', or '=' // describe the key. But look for escape sequences. StringBuffer key = new StringBuffer(); while (pos < line.length() && ! Character.isWhitespace(c = line.charAt(pos++)) && c != '=' && c != ':') { if (c == '\\') { if (pos == line.length()) { // The line continues on the next line. If there // is no next line, just treat it as a key with an // empty value. line = reader.readLine(); if (line == null) line = ""; pos = 0; while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; } else { c = line.charAt(pos++); switch (c) { case 'n': key.append('\n'); break; case 't': key.append('\t'); break; case 'r': key.append('\r'); break; case 'u': if (pos + 4 <= line.length()) { char uni = (char) Integer.parseInt (line.substring(pos, pos + 4), 16); key.append(uni); pos += 4; } // else throw exception? break; default: key.append(c); break; } } } else key.append(c); } boolean isDelim = (c == ':' || c == '='); while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; if (! isDelim && (c == ':' || c == '=')) { pos++; while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; } StringBuffer element = new StringBuffer(line.length() - pos); while (pos < line.length()) { c = line.charAt(pos++); if (c == '\\') { if (pos == line.length()) { // The line continues on the next line. line = reader.readLine(); // We might have seen a backslash at the end of // the file. The JDK ignores the backslash in // this case, so we follow for compatibility. if (line == null) break; pos = 0; while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; element.ensureCapacity(line.length() - pos + element.length()); } else { c = line.charAt(pos++); switch (c) { case 'n': element.append('\n'); break; case 't': element.append('\t'); break; case 'r': element.append('\r'); break; case 'u': if (pos + 4 <= line.length()) { char uni = (char) Integer.parseInt (line.substring(pos, pos + 4), 16); element.append(uni); pos += 4; } // else throw exception? break; default: element.append(c); break; } } } else element.append(c); } put(key.toString(), element.toString()); } }
public void load(InputStream inStream) throws IOException { // The spec says that the file must be encoded using ISO-8859-1. BufferedReader reader = new BufferedReader(new InputStreamReader(inStream, "ISO-8859-1")); String line; while ((line = reader.readLine()) != null) { char c = 0; int pos = 0; // Leading whitespaces must be deleted first. while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; // If empty line or begins with a comment character, skip this line. if ((line.length() - pos) == 0 || line.charAt(pos) == '#' || line.charAt(pos) == '!') continue; // The characters up to the next Whitespace, ':', or '=' // describe the key. But look for escape sequences. StringBuffer key = new StringBuffer(); while (pos < line.length() && ! Character.isWhitespace(c = line.charAt(pos++)) && c != '=' && c != ':') { if (c == '\\') { if (pos == line.length()) { // The line continues on the next line. If there // is no next line, just treat it as a key with an // empty value. line = reader.readLine(); if (line == null) line = ""; pos = 0; while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; } else { c = line.charAt(pos++); switch (c) { case 'n': key.append('\n'); break; case 't': key.append('\t'); break; case 'r': key.append('\r'); break; case 'u': if (pos + 4 <= line.length()) { char uni = (char) Integer.parseInt (line.substring(pos, pos + 4), 16); key.append(uni); pos += 4; } // else throw exception? break; default: key.append(c); break; } } } else key.append(c); } boolean isDelim = (c == ':' || c == '='); while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; if (! isDelim && (c == ':' || c == '=')) { pos++; while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; } if (!needsEscape) { put(keyString, line.substring(pos)); continue; } StringBuilder element = new StringBuilder(line.length() - pos); while (pos < line.length()) { c = line.charAt(pos++); if (c == '\\') { if (pos == line.length()) { // The line continues on the next line. line = reader.readLine(); // We might have seen a backslash at the end of // the file. The JDK ignores the backslash in // this case, so we follow for compatibility. if (line == null) break; pos = 0; while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; element.ensureCapacity(line.length() - pos + element.length()); } else { c = line.charAt(pos++); switch (c) { case 'n': element.append('\n'); break; case 't': element.append('\t'); break; case 'r': element.append('\r'); break; case 'u': if (pos + 4 <= line.length()) { char uni = (char) Integer.parseInt (line.substring(pos, pos + 4), 16); element.append(uni); pos += 4; } // else throw exception? break; default: element.append(c); break; } } } else element.append(c); } put(key.toString(), element.toString()); } }
16,483
public void load(InputStream inStream) throws IOException { // The spec says that the file must be encoded using ISO-8859-1. BufferedReader reader = new BufferedReader(new InputStreamReader(inStream, "ISO-8859-1")); String line; while ((line = reader.readLine()) != null) { char c = 0; int pos = 0; // Leading whitespaces must be deleted first. while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; // If empty line or begins with a comment character, skip this line. if ((line.length() - pos) == 0 || line.charAt(pos) == '#' || line.charAt(pos) == '!') continue; // The characters up to the next Whitespace, ':', or '=' // describe the key. But look for escape sequences. StringBuffer key = new StringBuffer(); while (pos < line.length() && ! Character.isWhitespace(c = line.charAt(pos++)) && c != '=' && c != ':') { if (c == '\\') { if (pos == line.length()) { // The line continues on the next line. If there // is no next line, just treat it as a key with an // empty value. line = reader.readLine(); if (line == null) line = ""; pos = 0; while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; } else { c = line.charAt(pos++); switch (c) { case 'n': key.append('\n'); break; case 't': key.append('\t'); break; case 'r': key.append('\r'); break; case 'u': if (pos + 4 <= line.length()) { char uni = (char) Integer.parseInt (line.substring(pos, pos + 4), 16); key.append(uni); pos += 4; } // else throw exception? break; default: key.append(c); break; } } } else key.append(c); } boolean isDelim = (c == ':' || c == '='); while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; if (! isDelim && (c == ':' || c == '=')) { pos++; while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; } StringBuffer element = new StringBuffer(line.length() - pos); while (pos < line.length()) { c = line.charAt(pos++); if (c == '\\') { if (pos == line.length()) { // The line continues on the next line. line = reader.readLine(); // We might have seen a backslash at the end of // the file. The JDK ignores the backslash in // this case, so we follow for compatibility. if (line == null) break; pos = 0; while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; element.ensureCapacity(line.length() - pos + element.length()); } else { c = line.charAt(pos++); switch (c) { case 'n': element.append('\n'); break; case 't': element.append('\t'); break; case 'r': element.append('\r'); break; case 'u': if (pos + 4 <= line.length()) { char uni = (char) Integer.parseInt (line.substring(pos, pos + 4), 16); element.append(uni); pos += 4; } // else throw exception? break; default: element.append(c); break; } } } else element.append(c); } put(key.toString(), element.toString()); } }
public void load(InputStream inStream) throws IOException { // The spec says that the file must be encoded using ISO-8859-1. BufferedReader reader = new BufferedReader(new InputStreamReader(inStream, "ISO-8859-1")); String line; while ((line = reader.readLine()) != null) { char c = 0; int pos = 0; // Leading whitespaces must be deleted first. while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; // If empty line or begins with a comment character, skip this line. if ((line.length() - pos) == 0 || line.charAt(pos) == '#' || line.charAt(pos) == '!') continue; // The characters up to the next Whitespace, ':', or '=' // describe the key. But look for escape sequences. StringBuffer key = new StringBuffer(); while (pos < line.length() && ! Character.isWhitespace(c = line.charAt(pos++)) && c != '=' && c != ':') { if (c == '\\') { if (pos == line.length()) { // The line continues on the next line. If there // is no next line, just treat it as a key with an // empty value. line = reader.readLine(); if (line == null) line = ""; pos = 0; while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; } else { c = line.charAt(pos++); switch (c) { case 'n': key.append('\n'); break; case 't': key.append('\t'); break; case 'r': key.append('\r'); break; case 'u': if (pos + 4 <= line.length()) { char uni = (char) Integer.parseInt (line.substring(pos, pos + 4), 16); key.append(uni); pos += 4; } // else throw exception? break; default: key.append(c); break; } } } else key.append(c); } boolean isDelim = (c == ':' || c == '='); while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; if (! isDelim && (c == ':' || c == '=')) { pos++; while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; } StringBuffer element = new StringBuffer(line.length() - pos); while (pos < line.length()) { c = line.charAt(pos++); if (c == '\\') { if (pos == line.length()) { // The line continues on the next line. line = reader.readLine(); // We might have seen a backslash at the end of // the file. The JDK ignores the backslash in // this case, so we follow for compatibility. if (line == null) break; pos = 0; while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; element.ensureCapacity(line.length() - pos + element.length()); } else { c = line.charAt(pos++); switch (c) { case 'n': element.append('\n'); break; case 't': element.append('\t'); break; case 'r': element.append('\r'); break; case 'u': if (pos + 4 <= line.length()) { char uni = (char) Integer.parseInt (line.substring(pos, pos + 4), 16); element.append(uni); pos += 4; } // else throw exception? break; default: element.append(c); break; } } } else element.append(c); } put(keyString, element.toString()); } }
16,484
public UnsupportedOperationException(String s) { super(s); }
public UnsupportedOperationException() { super(s); }
16,485
public UnsupportedOperationException(String s) { super(s); }
public UnsupportedOperationException(String s) { }
16,486
public int[] getPixels(int x, int y, int w, int h, int[] iArray, DataBuffer data) { //int size = w * h; int outOffset = 0; int[] pixel = null; if (iArray == null) iArray = new int[w * h * numBands]; for (int yy = y; yy < (y + h); yy++) { for (int xx = x; xx < (x + w); xx++) { getPixel(xx, yy, pixel, data); System.arraycopy(pixel, 0, iArray, outOffset, numBands); outOffset += numBands; } } return iArray; }
public int[] getPixels(int x, int y, int w, int h, int[] iArray, DataBuffer data) { int size = w*h; //int size = w * h; int outOffset = 0; int[] pixel = null; if (iArray == null) iArray = new int[w * h * numBands]; for (int yy = y; yy < (y + h); yy++) { for (int xx = x; xx < (x + w); xx++) { getPixel(xx, yy, pixel, data); System.arraycopy(pixel, 0, iArray, outOffset, numBands); outOffset += numBands; } } return iArray; }
16,487
public int[] getSamples(int x, int y, int w, int h, int b, int[] iArray, DataBuffer data) { int size = w * h; int outOffset = 0; if (iArray == null) { iArray = new int[size]; } for (int yy = y; yy < (y + h); yy++) { for (int xx = x; xx < (x + w); xx++) { iArray[outOffset++] = getSample(xx, yy, b, data); } } return iArray; }
public int[] getSamples(int x, int y, int w, int h, int b, int[] iArray, DataBuffer data) { int size = w * h; int outOffset = 0; if (iArray == null) { iArray = new int[size]; } for (int yy = y; yy < (y + h); yy++) { for (int xx = x; xx < (x + w); xx++) { iArray[outOffset++] = getSample(xx, yy, b, data); } } return iArray; }
16,488
void fireStateChanged() { ChangeListener[] listeners = getChangeListeners(); for (int i = 0; i < listeners.length; ++i) listeners[i].stateChanged(changeEvent); }
protected void fireStateChanged() { ChangeListener[] listeners = getChangeListeners(); for (int i = 0; i < listeners.length; ++i) listeners[i].stateChanged(changeEvent); }
16,489
public abstract TypeCode member_type(int index) throws BadKind, Bounds;
public abstract TypeCode member_type(int index) throws BadKind, org.omg.CORBA.TypeCodePackage.Bounds;
16,491
public abstract String member_name(int index) throws BadKind, Bounds;
public abstract String member_name(int index) throws BadKind, org.omg.CORBA.TypeCodePackage.Bounds;
16,492
public String getPropertyPrefix() { return super.getPropertyPrefix(); }
public String getPropertyPrefix() { return "CheckBox."; }
16,493
public Icon getDefaultIcon() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); return defaults.getIcon(getPropertyPrefix() + ".icon"); }
public Icon getDefaultIcon() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); return defaults.getIcon(getPropertyPrefix() + "icon"); }
16,494
protected String getPropertyPrefix() { return "RadioButton"; }
protected String getPropertyPrefix() { return "RadioButton."; }
16,495
private Decoder (Charset cs) { super (cs, 1.0f, 1.0f); }
Decoder (Charset cs) { super (cs, 1.0f, 1.0f); }
16,496
private Encoder (Charset cs) { super (cs, 1.0f, 1.0f); }
Encoder (Charset cs) { super (cs, 1.0f, 1.0f); }
16,497
protected CharsetDecoder (Charset cs, float averageCharsPerByte, float maxCharsPerByte) { this (cs, averageCharsPerByte, maxCharsPerByte, DEFAULT_REPLACEMENT); }
protected CharsetDecoder (Charset cs, float averageCharsPerByte, float maxCharsPerByte) { this (cs, averageCharsPerByte, maxCharsPerByte, DEFAULT_REPLACEMENT); }
16,498
protected CharsetDecoder (Charset cs, float averageCharsPerByte, float maxCharsPerByte) { this (cs, averageCharsPerByte, maxCharsPerByte, DEFAULT_REPLACEMENT); }
protected CharsetDecoder (Charset cs, float averageCharsPerByte, float maxCharsPerByte) { if (averageCharsPerByte <= 0.0f) throw new IllegalArgumentException ("Non-positive averageCharsPerByte"); if (maxCharsPerByte <= 0.0f) throw new IllegalArgumentException ("Non-positive maxCharsPerByte"); this.charset = cs; this.averageCharsPerByte = averageCharsPerByte; this.maxCharsPerByte = maxCharsPerByte; this.replacement = replacement; implReplaceWith (replacement); }
16,499
public abstract CharBuffer put (char b);
public CharBuffer put (CharBuffer src) { if (src == this) throw new IllegalArgumentException (); checkForOverflow(src.remaining()); if (src.remaining () > 0) { char[] toPut = new char [src.remaining ()]; src.get (toPut); put (toPut); } return this; }
16,500
public abstract char get ();
public CharBuffer get (char[] dst, int offset, int length) { checkArraySize(dst.length, offset, length); checkForUnderflow(length); for (int i = offset; i < offset + length; i++) { dst [i] = get (); } return this; }
16,501
protected void resolve(AbstractVmClassLoader clc) throws ClassNotFoundException { if (resolvedClass == null) { final VmType type = clc.loadClass(className, true); if (type instanceof VmInterfaceClass) { this.resolvedClass = (VmInterfaceClass)type; } else { throw new ClassNotFoundException("Class " + className + " is not an interface"); } } }
protected void resolve(VmClassLoader clc) throws ClassNotFoundException { if (resolvedClass == null) { final VmType type = clc.loadClass(className, true); if (type instanceof VmInterfaceClass) { this.resolvedClass = (VmInterfaceClass)type; } else { throw new ClassNotFoundException("Class " + className + " is not an interface"); } } }
16,503
static void paintGradient(Graphics g, int x, int y, int w, int h, int dir, String uiProp) { List params = (List) UIManager.get(uiProp); double g1 = ((Double) params.get(0)).doubleValue(); double g2 = ((Double) params.get(1)).doubleValue(); Color c1 = (Color) params.get(2); Color c2 = (Color) params.get(3); Color c3 = (Color) params.get(4); paintGradient(g, x, y, w, h, g1, g2, c1, c2, c3, dir); }
static void paintGradient(Graphics g, int x, int y, int w, int h, int dir, String uiProp) { List params = (List) UIManager.get(uiProp); double g1 = ((Double) params.get(0)).doubleValue(); double g2 = ((Double) params.get(1)).doubleValue(); Color c1 = (Color) params.get(2); Color c2 = (Color) params.get(3); Color c3 = (Color) params.get(4); paintGradient(g, x, y, w, h, g1, g2, c1, c2, c3, dir); }
16,505
public void close() throws IOException { if (isClosed()) return; impl.close(); impl = null; bound = false; if (getChannel() != null) getChannel().close(); }
public void close() throws IOException { if (isClosed()) return; impl.close(); impl = null; if (getChannel() != null) getChannel().close(); }
16,506
public InetAddress getInetAddress() { if (! isBound()) return null; try { return (InetAddress) impl.getOption(SocketOptions.SO_BINDADDR); } catch (SocketException e) { // This never happens as we are bound. return null; } }
public InetAddress getInetAddress() { if (local == null) return null; try { return (InetAddress) impl.getOption(SocketOptions.SO_BINDADDR); } catch (SocketException e) { // This never happens as we are bound. return null; } }
16,507
public InetAddress getInetAddress() { if (! isBound()) return null; try { return (InetAddress) impl.getOption(SocketOptions.SO_BINDADDR); } catch (SocketException e) { // This never happens as we are bound. return null; } }
public InetAddress getInetAddress() { if (! isBound()) return null; try { return (InetAddress) impl.getOption(SocketOptions.SO_BINDADDR); } catch (SocketException e) { // This never happens as we are bound. return null; } }
16,508
public int getLocalPort() { if (! isBound()) return -1; return impl.getLocalPort(); }
public int getLocalPort() { if (local == null) return -1; return impl.getLocalPort(); }
16,509
public int getLocalPort() { if (! isBound()) return -1; return impl.getLocalPort(); }
public int getLocalPort() { if (! isBound()) return -1; return local.getPort(); }
16,510
public SocketAddress getLocalSocketAddress() { if (! isBound()) return null; return new InetSocketAddress(getInetAddress(), getLocalPort()); }
public SocketAddress getLocalSocketAddress() { if (! isBound()) return null; return new InetSocketAddress(getInetAddress(), getLocalPort()); }
16,511
public boolean isBound() { return bound; }
public boolean isBound() { return local != null; }
16,512
createSocketImpl();
SocketImpl createSocketImpl();
16,513
public InetSocketAddress(InetAddress addr, int port) throws IllegalArgumentException { if (port < 0 || port > 65535) throw new IllegalArgumentException("Bad port number: " + port); if (addr == null) addr = InetAddress.ANY_IF; this.addr = addr; this.port = port; this.hostname = addr.getHostName(); }
public InetSocketAddress(InetAddress addr, int port) throws IllegalArgumentException { if (port < 0 || port > 65535) throw new IllegalArgumentException("Bad port number: " + port); if (addr == null) addr = InetAddress.ANY_IF; this.addr = addr; this.port = port; }
16,514
public Socket() { if (factory != null) impl = factory.createSocketImpl(); else impl = new PlainSocketImpl(); inputShutdown = false; outputShutdown = false; }
public Socket() { if (factory != null) impl = factory.createSocketImpl(); else impl = new PlainSocketImpl(); inputShutdown = false; outputShutdown = false; }
16,515
public synchronized void close() throws IOException { if (impl != null) impl.close(); if (ch != null) ch.close(); closed = true; }
public synchronized void close() throws IOException { if (impl != null) impl.close(); if (ch != null) ch.close(); closed = true; }
16,516
public synchronized void close() throws IOException { if (impl != null) impl.close(); if (ch != null) ch.close(); closed = true; }
public synchronized void close() throws IOException { if (impl != null) impl.close(); if (ch != null) ch.close(); closed = true; }
16,517
public synchronized void close() throws IOException { if (impl != null) impl.close(); if (ch != null) ch.close(); closed = true; }
public synchronized void close() throws IOException { if (impl != null) impl.close(); if (ch != null) ch.close(); if (getChannel() != null) getChannel().close(); }
16,518
public X86BytecodeVisitor(NativeStream outputStream, CompiledMethod cm, boolean isBootstrap, X86CompilerContext context) { this.os = (AbstractX86Stream) outputStream; this.context = context; this.vstack = new VirtualStack(os); this.helper = new X86CompilerHelper(os, vstack.createStackMgr(), context, isBootstrap); this.cm = cm; this.slotSize = VmX86Architecture.SLOT_SIZE; this.log = os.isLogEnabled(); this.eContext = new EmitterContext(os, helper, vstack); }
public X86BytecodeVisitor(NativeStream outputStream, CompiledMethod cm, boolean isBootstrap, X86CompilerContext context) { this.os = (AbstractX86Stream) outputStream; this.context = context; this.vstack = new VirtualStack(os); this.helper = new X86CompilerHelper(os, vstack.createStackMgr(), context, isBootstrap); this.cm = cm; this.slotSize = VmX86Architecture.SLOT_SIZE; this.log = os.isLogEnabled(); this.eContext = new EmitterContext(os, helper, vstack); }
16,520
private final void checkBounds(RefItem ref, IntItem index) { final Label ok = new Label(curInstrLabel + "$$cbok"); // CMP length, index assertCondition(ref.isRegister(), "ref must be in a register"); final Register r = ref.getRegister(); if (index.isConstant()) { //TODO: implement CMP dist[reg], imm32 // final int val = ((IntConstant)index.getConstant()).getValue(); index.load(eContext); os.writeCMP(r, VmArray.LENGTH_OFFSET * slotSize, index .getRegister()); } else { os.writeCMP(r, VmArray.LENGTH_OFFSET * slotSize, index .getRegister()); } os.writeJCC(ok, X86Constants.JA); // Signal ArrayIndexOutOfBounds os.writeINT(5); os.setObjectRef(ok); }
private final void checkBounds(RefItem ref, IntItem index) { final Label ok = new Label(curInstrLabel + "$$cbok"); // CMP length, index assertCondition(ref.isRegister(), "ref must be in a register"); final Register r = ref.getRegister(); if (index.isConstant()) { //TODO: implement CMP dist[reg], imm32 // final int val = ((IntConstant)index.getConstant()).getValue(); index.load(eContext); os.writeCMP(r, VmArray.LENGTH_OFFSET * slotSize, index .getRegister()); } else { os.writeCMP(r, VmArray.LENGTH_OFFSET * slotSize, index .getRegister()); } os.writeJCC(ok, X86Constants.JA); // Signal ArrayIndexOutOfBounds os.writeINT(5); os.setObjectRef(ok); }
16,521
public void endInlinedMethod(VmMethod previousMethod) { helper.setMethod(previousMethod); os.setObjectRef(endOfInlineLabel); this.currentMethod = previousMethod; this.outerMethodStack = null; if (debug) { BootLog.debug("endInlinedMethod"); } }
public void endInlinedMethod(VmMethod previousMethod) { helper.setMethod(previousMethod); os.setObjectRef(endOfInlineLabel); this.currentMethod = previousMethod; this.outerMethodStack = null; if (debug) { BootLog.debug("endInlinedMethod"); } }
16,522
public void endInstruction() { // Verify the register usage // No registers can be in use, unless they are on the virtual stack. final X86RegisterPool pool = eContext.getPool(); pool.visitUsedRegisters(new RegisterVisitor() { public void visit(Register reg) { if (!vstack.uses(reg)) { throw new InternalError( "Register " + reg + " is in use outsite of the vstack at bytecode address " + curAddress); } } }); // Nothing to do here }
public void endInstruction() { // Verify the register usage // No registers can be in use, unless they are on the virtual stack. final X86RegisterPool pool = eContext.getPool(); pool.visitUsedRegisters(new RegisterVisitor() { public void visit(Register reg) { if (!vstack.uses(reg)) { throw new InternalError( "Register " + reg + " is in use outsite of the vstack at bytecode address " + curAddress); } } }); // Nothing to do here }
16,523
public void visit(Register reg) { if (!vstack.uses(reg)) { throw new InternalError( "Register " + reg + " is in use outsite of the vstack at bytecode address " + curAddress); } }
public void visit(Register reg) { if (!vstack.uses(reg)) { throw new InternalError( "Register " + reg + " is in use outsite of the vstack at bytecode address " + curAddress); } }
16,524
private final void instanceOf(Register objectr, Label trueLabel) { //TODO: port to orp-style final Label loopLabel = new Label(this.curInstrLabel + "loop"); final Label notInstanceOfLabel = new Label(this.curInstrLabel + "notInstanceOf"); /* Is objectref null? */ os.writeTEST(objectr, objectr); os.writeJCC(notInstanceOfLabel, X86Constants.JZ); /* vmType -> edx */ os.writeMOV(INTSIZE, EDX, EAX); /* TIB -> ESI */ os.writeMOV(INTSIZE, Register.ESI, objectr, ObjectLayout.TIB_SLOT * slotSize); /* SuperClassesArray -> ESI */ os .writeMOV(INTSIZE, Register.ESI, Register.ESI, (VmArray.DATA_OFFSET + TIBLayout.SUPERCLASSES_INDEX) * slotSize); /* SuperClassesArray.length -> ECX */ os.writeMOV(INTSIZE, ECX, Register.ESI, VmArray.LENGTH_OFFSET * slotSize); /* &superClassesArray[0] -> esi */ os.writeLEA(Register.ESI, Register.ESI, VmArray.DATA_OFFSET * slotSize); os.setObjectRef(loopLabel); /* superClassesArray[index++] -> eax */ os.writeLODSD(); /* Is equal? */ os.writeCMP(EAX, EDX); os.writeJCC(trueLabel, X86Constants.JE); try { os.writeLOOP(loopLabel); } catch (UnresolvedObjectRefException ex) { throw new CompileError(ex); } os.setObjectRef(notInstanceOfLabel); }
private final void instanceOf(Register objectr, Label trueLabel) { //TODO: port to orp-style final Label loopLabel = new Label(this.curInstrLabel + "loop"); final Label notInstanceOfLabel = new Label(this.curInstrLabel + "notInstanceOf"); /* Is objectref null? */ os.writeTEST(objectr, objectr); os.writeJCC(notInstanceOfLabel, X86Constants.JZ); /* vmType -> edx */ os.writeMOV(INTSIZE, EDX, EAX); /* TIB -> ESI */ os.writeMOV(INTSIZE, Register.ESI, objectr, ObjectLayout.TIB_SLOT * slotSize); /* SuperClassesArray -> ESI */ os .writeMOV(INTSIZE, Register.ESI, Register.ESI, (VmArray.DATA_OFFSET + TIBLayout.SUPERCLASSES_INDEX) * slotSize); /* SuperClassesArray.length -> ECX */ os.writeMOV(INTSIZE, ECX, Register.ESI, VmArray.LENGTH_OFFSET * slotSize); /* &superClassesArray[0] -> esi */ os.writeLEA(Register.ESI, Register.ESI, VmArray.DATA_OFFSET * slotSize); os.setObjectRef(loopLabel); /* superClassesArray[index++] -> eax */ os.writeLODSD(); /* Is equal? */ os.writeCMP(EAX, EDX); os.writeJCC(trueLabel, X86Constants.JE); try { os.writeLOOP(loopLabel); } catch (UnresolvedObjectRefException ex) { throw new CompileError(ex); } os.setObjectRef(notInstanceOfLabel); }
16,525
public void startBasicBlock(BasicBlock bb) { if (log) { os.log("Start of basic block " + bb); } if (debug) { BootLog.debug("-- Start of BB"); } startOfBB = true; this.vstack.reset(); eContext.getPool().reset(os); // Push the result from the outer method stack on the vstack vstack.pushAll(outerMethodStack); // Push the items on the vstack the result from a previous basic block. final TypeStack tstack = bb.getStartStack(); vstack.pushAll(tstack); }
public void startBasicBlock(BasicBlock bb) { if (log) { os.log("Start of basic block " + bb); } if (debug) { BootLog.debug("-- Start of BB"); } startOfBB = true; this.vstack.reset(); eContext.getPool().reset(os); // Push the result from the outer method stack on the vstack vstack.pushAll(outerMethodStack); // Push the items on the vstack the result from a previous basic block. final TypeStack tstack = bb.getStartStack(); vstack.pushAll(tstack); }
16,526
public void startInlinedMethodCode(VmMethod inlinedMethod, int newMaxLocals) { if (debug) { BootLog.debug("startInlinedMethodCode(" + inlinedMethod + ")"); } //TODO: check whether this is really needed // For now yes, because a new basic block resets the registerpool // and that fails if not all registers are freed. vstack.push(eContext); outerMethodStack = vstack.asTypeStack(); }
public void startInlinedMethodCode(VmMethod inlinedMethod, int newMaxLocals) { if (debug) { BootLog.debug("startInlinedMethodCode(" + inlinedMethod + ")"); } //TODO: check whether this is really needed // For now yes, because a new basic block resets the registerpool // and that fails if not all registers are freed. vstack.push(eContext); outerMethodStack = vstack.asTypeStack(); }
16,527
public void startInlinedMethodHeader(VmMethod inlinedMethod, int newMaxLocals) { if (debug) { BootLog.debug("startInlinedMethodHeader(" + inlinedMethod + ")"); } maxLocals = newMaxLocals; endOfInlineLabel = new Label(curInstrLabel + "_end_of_inline"); helper.startInlinedMethod(inlinedMethod, curInstrLabel); this.currentMethod = inlinedMethod; }
public void startInlinedMethodHeader(VmMethod inlinedMethod, int newMaxLocals) { if (debug) { BootLog.debug("startInlinedMethodHeader(" + inlinedMethod + ")"); } maxLocals = newMaxLocals; endOfInlineLabel = new Label(curInstrLabel + "_end_of_inline"); helper.startInlinedMethod(inlinedMethod, curInstrLabel); this.currentMethod = inlinedMethod; }
16,528
public final void visit_aastore() { final boolean useBarrier = (context.getWriteBarrier() != null); RefItem val = vstack.popRef(); IntItem idx = vstack.popInt(); RefItem ref = vstack.popRef(); //IMPROVE: optimize case with const value val.load(eContext); // if barrier in use, the index must also be in a register idx.loadIf(eContext, (useBarrier) ? ~Item.Kind.REGISTER : ~(Item.Kind.CONSTANT | Item.Kind.REGISTER)); ref.load(eContext); final Register r = ref.getRegister(); final Register v = val.getRegister(); checkBounds(ref, idx); if (idx.getKind() == Item.Kind.CONSTANT) { final int i = idx.getValue(); os.writeMOV(INTSIZE, r, i + VmArray.DATA_OFFSET * 4, v); } else { final Register i = idx.getRegister(); os.writeMOV(INTSIZE, r, i, 4, VmArray.DATA_OFFSET * 4, v); } if (useBarrier) { // the write barrier could easily be modified to avoid using a // scratch register final X86RegisterPool pool = eContext.getPool(); final Register scratch = pool.request(JvmType.INT); helper .writeArrayStoreWriteBarrier(r, idx.getRegister(), v, scratch); pool.release(scratch); } val.release(eContext); idx.release(eContext); ref.release(eContext); }
public final void visit_aastore() { final boolean useBarrier = (context.getWriteBarrier() != null); RefItem val = vstack.popRef(); IntItem idx = vstack.popInt(); RefItem ref = vstack.popRef(); //IMPROVE: optimize case with const value val.load(eContext); // if barrier in use, the index must also be in a register idx.loadIf(eContext, (useBarrier) ? ~Item.Kind.REGISTER : ~(Item.Kind.CONSTANT | Item.Kind.REGISTER)); ref.load(eContext); final Register r = ref.getRegister(); final Register v = val.getRegister(); checkBounds(ref, idx); if (idx.getKind() == Item.Kind.CONSTANT) { final int i = idx.getValue(); os.writeMOV(INTSIZE, r, i + VmArray.DATA_OFFSET * 4, v); } else { final Register i = idx.getRegister(); os.writeMOV(INTSIZE, r, i, 4, VmArray.DATA_OFFSET * 4, v); } if (useBarrier) { // the write barrier could easily be modified to avoid using a // scratch register final X86RegisterPool pool = eContext.getPool(); final Register scratch = pool.request(JvmType.INT); helper .writeArrayStoreWriteBarrier(r, idx.getRegister(), v, scratch); pool.release(scratch); } val.release(eContext); idx.release(eContext); ref.release(eContext); }
16,529
public final void visit_aastore() { final boolean useBarrier = (context.getWriteBarrier() != null); RefItem val = vstack.popRef(); IntItem idx = vstack.popInt(); RefItem ref = vstack.popRef(); //IMPROVE: optimize case with const value val.load(eContext); // if barrier in use, the index must also be in a register idx.loadIf(eContext, (useBarrier) ? ~Item.Kind.REGISTER : ~(Item.Kind.CONSTANT | Item.Kind.REGISTER)); ref.load(eContext); final Register r = ref.getRegister(); final Register v = val.getRegister(); checkBounds(ref, idx); if (idx.getKind() == Item.Kind.CONSTANT) { final int i = idx.getValue(); os.writeMOV(INTSIZE, r, i + VmArray.DATA_OFFSET * 4, v); } else { final Register i = idx.getRegister(); os.writeMOV(INTSIZE, r, i, 4, VmArray.DATA_OFFSET * 4, v); } if (useBarrier) { // the write barrier could easily be modified to avoid using a // scratch register final X86RegisterPool pool = eContext.getPool(); final Register scratch = pool.request(JvmType.INT); helper .writeArrayStoreWriteBarrier(r, idx.getRegister(), v, scratch); pool.release(scratch); } val.release(eContext); idx.release(eContext); ref.release(eContext); }
public final void visit_aastore() { final boolean useBarrier = (context.getWriteBarrier() != null); RefItem val = vstack.popRef(); IntItem idx = vstack.popInt(); RefItem ref = vstack.popRef(); //IMPROVE: optimize case with const value val.load(eContext); // if barrier in use, the index must also be in a register idx.loadIf(eContext, (useBarrier) ? ~Item.Kind.REGISTER : ~(Item.Kind.CONSTANT | Item.Kind.REGISTER)); ref.load(eContext); final Register r = ref.getRegister(); final Register v = val.getRegister(); checkBounds(ref, idx); if (idx.getKind() == Item.Kind.CONSTANT) { final int i = idx.getValue(); os.writeMOV(INTSIZE, r, i + VmArray.DATA_OFFSET * 4, v); } else { final Register i = idx.getRegister(); os.writeMOV(INTSIZE, r, i, 4, VmArray.DATA_OFFSET * 4, v); } if (useBarrier) { // the write barrier could easily be modified to avoid using a // scratch register final X86RegisterPool pool = eContext.getPool(); final Register scratch = pool.request(JvmType.INT); helper .writeArrayStoreWriteBarrier(r, idx.getRegister(), v, scratch); pool.release(scratch); } val.release(eContext); idx.release(eContext); ref.release(eContext); }
16,530
public final void visit_anewarray(VmConstClass classRef) { final IntItem cnt = vstack.popInt(); // Load the count value cnt.load(eContext); final Register cntr = cnt.getRegister(); // Request tmp register final Register classr = requestRegister(JvmType.INT); writeResolveAndLoadClassToReg(classRef, classr); stackFrame.writePushMethodRef(); os.writePUSH(classr); /* Class */ os.writePUSH(cntr); /* Count */ helper.invokeJavaMethod(context.getAnewarrayMethod()); /* Result is already push on the stack */ // Release cnt.release(eContext); releaseRegister(classr); }
public final void visit_anewarray(VmConstClass classRef) { requestRegister(EAX); // Load the count value cnt.load(eContext); final Register cntr = cnt.getRegister(); // Request tmp register final Register classr = requestRegister(JvmType.INT); writeResolveAndLoadClassToReg(classRef, classr); stackFrame.writePushMethodRef(); os.writePUSH(classr); /* Class */ os.writePUSH(cntr); /* Count */ helper.invokeJavaMethod(context.getAnewarrayMethod()); /* Result is already push on the stack */ // Release cnt.release(eContext); releaseRegister(classr); }
16,531
public final void visit_anewarray(VmConstClass classRef) { final IntItem cnt = vstack.popInt(); // Load the count value cnt.load(eContext); final Register cntr = cnt.getRegister(); // Request tmp register final Register classr = requestRegister(JvmType.INT); writeResolveAndLoadClassToReg(classRef, classr); stackFrame.writePushMethodRef(); os.writePUSH(classr); /* Class */ os.writePUSH(cntr); /* Count */ helper.invokeJavaMethod(context.getAnewarrayMethod()); /* Result is already push on the stack */ // Release cnt.release(eContext); releaseRegister(classr); }
public final void visit_anewarray(VmConstClass classRef) { final IntItem cnt = vstack.popInt(); // Load the count value cnt.load(eContext); final Register cntr = cnt.getRegister(); // Request tmp register final Register classr = requestRegister(JvmType.INT); writeResolveAndLoadClassToReg(classRef, classr); stackFrame.writePushMethodRef(); os.writePUSH(classr); /* Class */ os.writePUSH(cntr); /* Count */ helper.invokeJavaMethod(context.getAnewarrayMethod()); /* Result is already push on the stack */ // Release cnt.release(eContext); releaseRegister(classr); }
16,532
public final void visit_anewarray(VmConstClass classRef) { final IntItem cnt = vstack.popInt(); // Load the count value cnt.load(eContext); final Register cntr = cnt.getRegister(); // Request tmp register final Register classr = requestRegister(JvmType.INT); writeResolveAndLoadClassToReg(classRef, classr); stackFrame.writePushMethodRef(); os.writePUSH(classr); /* Class */ os.writePUSH(cntr); /* Count */ helper.invokeJavaMethod(context.getAnewarrayMethod()); /* Result is already push on the stack */ // Release cnt.release(eContext); releaseRegister(classr); }
public final void visit_anewarray(VmConstClass classRef) { final IntItem cnt = vstack.popInt(); // Load the count value cnt.load(eContext); final Register cntr = cnt.getRegister(); // Request tmp register final Register classr = requestRegister(JvmType.INT); cnt.load(eContext); final Register cntr = cnt.getRegister(); final Register classr = requestRegister(JvmType.INT); stackFrame.writePushMethodRef(); os.writePUSH(classr); /* Class */ os.writePUSH(cntr); /* Count */ helper.invokeJavaMethod(context.getAnewarrayMethod()); /* Result is already push on the stack */ // Release cnt.release(eContext); releaseRegister(classr); }
16,533