bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
|---|---|---|
public CompositeView(Element element) { super(element); children = new View[0]; insets = new Insets(0, 0, 0, 0); }
|
public CompositeView(Element element) { super(element); children = new View[0]; top = 0; bottom = 0; left = 0; right = 0; }
| 2,270
|
protected short getBottomInset() { return (short) insets.bottom; }
|
protected short getBottomInset() { return bottom; }
| 2,271
|
protected Rectangle getInsideAllocation(Shape a) { if (a == null) return null; Rectangle alloc = a.getBounds(); // Initialize the inside allocation rectangle. This is done inside // a synchronized block in order to avoid multiple threads creating // this instance simultanously. Rectangle inside; synchronized(this) { inside = insideAllocation; if (inside == null) { inside = new Rectangle(); insideAllocation = inside; } } inside.x = alloc.x + insets.left; inside.y = alloc.y + insets.top; inside.width = alloc.width - insets.left - insets.right; inside.height = alloc.height - insets.top - insets.bottom; return inside; }
|
protected Rectangle getInsideAllocation(Shape a) { if (a == null) return null; Rectangle alloc = a.getBounds(); // Initialize the inside allocation rectangle. This is done inside // a synchronized block in order to avoid multiple threads creating // this instance simultanously. Rectangle inside; synchronized(this) { inside = insideAllocation; if (inside == null) { inside = new Rectangle(); insideAllocation = inside; } } inside.x = alloc.x + insets.left; inside.y = alloc.y + insets.top; inside.width = alloc.width - insets.left - insets.right; inside.height = alloc.height - insets.top - insets.bottom; return inside; }
| 2,272
|
protected short getLeftInset() { return (short) insets.left; }
|
protected short getLeftInset() { return left; }
| 2,273
|
protected short getRightInset() { return (short) insets.right; }
|
protected short getRightInset() { return right; }
| 2,274
|
protected short getTopInset() { return (short) insets.top; }
|
protected short getTopInset() { return top; }
| 2,275
|
protected View getViewAtPosition(int pos, Rectangle a) { int i = getViewIndexAtPosition(pos); View view = children[i]; childAllocation(i, a); return view; }
|
protected View getViewAtPosition(int pos, Rectangle a) { int i = getViewIndexAtPosition(pos); if (i >= 0 && i < getViewCount() && a != null) { view = getView(i); childAllocation(i, a); return view; }
| 2,276
|
public int getViewIndex(int pos, Position.Bias b) { if (b == Position.Bias.Backward && pos != 0) pos -= 1; return getViewIndexAtPosition(pos); }
|
public int getViewIndex(int pos, Position.Bias b) { if (b == Position.Bias.Backward) pos -= 1; return getViewIndexAtPosition(pos); }
| 2,278
|
public int getViewIndex(int pos, Position.Bias b) { if (b == Position.Bias.Backward && pos != 0) pos -= 1; return getViewIndexAtPosition(pos); }
|
public int getViewIndex(int pos, Position.Bias b) { if (b == Position.Bias.Backward && pos != 0) pos -= 1; int i = -1; if (pos >= getStartOffset() && pos < getEndOffset()) i = getViewIndexAtPosition(pos); return i; }
| 2,279
|
protected int getViewIndexAtPosition(int pos) { int index = -1; for (int i = 0; i < children.length; i++) { if (children[i].getStartOffset() <= pos && children[i].getEndOffset() > pos) { index = i; break; } } return index; }
|
protected int getViewIndexAtPosition(int pos) { int index = -1; for (int i = 0; i < children.length; i++) { if (children[i].getStartOffset() <= pos && children[i].getEndOffset() > pos) { index = i; break; } } return index; }
| 2,280
|
protected void loadChildren(ViewFactory f) { Element el = getElement(); int count = el.getElementCount(); View[] newChildren = new View[count]; for (int i = 0; i < count; ++i) { Element child = el.getElement(i); View view = f.create(child); newChildren[i] = view; } replace(0, getViewCount(), newChildren); }
|
protected void loadChildren(ViewFactory f) { Element el = getElement(); int count = el.getElementCount(); View[] newChildren = new View[count]; for (int i = 0; i < count; ++i) { Element child = el.getElement(i); View view = f.create(child); newChildren[i] = view; } replace(0, 0, newChildren); }
| 2,281
|
public Shape modelToView(int pos, Shape a, Position.Bias bias) throws BadLocationException { int childIndex = getViewIndex(pos, bias); if (childIndex == -1) throw new BadLocationException("Position " + pos + " is not represented by view.", pos); Shape ret = null; View child = getView(childIndex); Shape childAlloc = getChildAllocation(childIndex, a); if (childAlloc == null) ret = createDefaultLocation(a, bias); Shape result = child.modelToView(pos, childAlloc, bias); if (result != null) ret = result; else ret = createDefaultLocation(a, bias); return ret; }
|
public Shape modelToView(int pos, Shape a, Position.Bias bias) throws BadLocationException { int childIndex = getViewIndex(pos, bias); if (childIndex == -1) throw new BadLocationException("Position " + pos + " is not represented by view.", pos); Shape ret = null; View child = getView(childIndex); Shape childAlloc = getChildAllocation(childIndex, a); if (childAlloc == null) ret = createDefaultLocation(a, bias); Shape result = child.modelToView(pos, childAlloc, bias); if (result != null) ret = result; else ret = createDefaultLocation(a, bias); return ret; }
| 2,282
|
public Shape modelToView(int pos, Shape a, Position.Bias bias) throws BadLocationException { int childIndex = getViewIndex(pos, bias); if (childIndex == -1) throw new BadLocationException("Position " + pos + " is not represented by view.", pos); Shape ret = null; View child = getView(childIndex); Shape childAlloc = getChildAllocation(childIndex, a); if (childAlloc == null) ret = createDefaultLocation(a, bias); Shape result = child.modelToView(pos, childAlloc, bias); if (result != null) ret = result; else ret = createDefaultLocation(a, bias); return ret; }
|
public Shape modelToView(int pos, Shape a, Position.Bias bias) throws BadLocationException { int childIndex = getViewIndex(pos, bias); if (childIndex == -1) throw new BadLocationException("Position " + pos + " is not represented by view.", pos); Shape ret = null; View child = getView(childIndex); Shape childAlloc = getChildAllocation(childIndex, a); if (childAlloc == null) ret = createDefaultLocation(a, bias); Shape result = child.modelToView(pos, childAlloc, bias); if (result != null) ret = result; else ret = createDefaultLocation(a, bias); return ret; }
| 2,284
|
public Shape modelToView(int pos, Shape a, Position.Bias bias) throws BadLocationException { int childIndex = getViewIndex(pos, bias); if (childIndex == -1) throw new BadLocationException("Position " + pos + " is not represented by view.", pos); Shape ret = null; View child = getView(childIndex); Shape childAlloc = getChildAllocation(childIndex, a); if (childAlloc == null) ret = createDefaultLocation(a, bias); Shape result = child.modelToView(pos, childAlloc, bias); if (result != null) ret = result; else ret = createDefaultLocation(a, bias); return ret; }
|
public Shape modelToView(int pos, Shape a, Position.Bias bias) throws BadLocationException { int childIndex = getViewIndex(pos, bias); if (childIndex == -1) throw new BadLocationException("Position " + pos + " is not represented by view.", pos); Shape ret = null; View child = getView(childIndex); Shape childAlloc = getChildAllocation(childIndex, a); if (childAlloc == null) ret = createDefaultLocation(a, bias); Shape result = child.modelToView(pos, childAlloc, bias); if (result != null) ret = result; else { throw new BadLocationException("Position " + pos + " is not represented by view.", pos); } } return ret; }
| 2,285
|
protected void setInsets(short top, short left, short bottom, short right) { insets.top = top; insets.left = left; insets.bottom = bottom; insets.right = right; }
|
protected void setInsets(short t, short l, short b, short r) { insets.top = top; insets.left = left; insets.bottom = bottom; insets.right = right; }
| 2,287
|
protected void setInsets(short top, short left, short bottom, short right) { insets.top = top; insets.left = left; insets.bottom = bottom; insets.right = right; }
|
protected void setInsets(short top, short left, short bottom, short right) { insets.top = top; insets.left = left; insets.bottom = bottom; insets.right = right; }
| 2,288
|
protected void setParagraphInsets(AttributeSet attributes) { Float l = (Float) attributes.getAttribute(StyleConstants.LeftIndent); short left = 0; if (l != null) left = l.shortValue(); Float r = (Float) attributes.getAttribute(StyleConstants.RightIndent); short right = 0; if (r != null) right = r.shortValue(); Float t = (Float) attributes.getAttribute(StyleConstants.SpaceAbove); short top = 0; if (t != null) top = t.shortValue(); Float b = (Float) attributes.getAttribute(StyleConstants.SpaceBelow); short bottom = 0; if (b != null) bottom = b.shortValue(); setInsets(top, left, bottom, right); }
|
protected void setParagraphInsets(AttributeSet attributes) { Float l = (Float) attributes.getAttribute(StyleConstants.LeftIndent); short left = 0; if (l != null) left = l.shortValue(); Float r = (Float) attributes.getAttribute(StyleConstants.RightIndent); short right = 0; if (r != null) right = r.shortValue(); Float t = (Float) attributes.getAttribute(StyleConstants.SpaceAbove); short top = 0; if (t != null) top = t.shortValue(); Float b = (Float) attributes.getAttribute(StyleConstants.SpaceBelow); short bottom = 0; if (b != null) bottom = b.shortValue(); setInsets(top, left, bottom, right); }
| 2,289
|
public int getViewIndex(int pos, Position.Bias b) { return -1; }
|
public int getViewIndex(float x, float y, Shape allocation) { return -1; }
| 2,290
|
public void setMinimumSize(Dimension min) { Dimension oldMinimumSize = minimumSize; minimumSize = min; firePropertyChange("minimumSize", oldMinimumSize, minimumSize); revalidate(); repaint(); // adjust preferred and maximum size accordingly if (preferredSize != null) { Dimension prefSize = getPreferredSize(); prefSize.width = Math.max(prefSize.width, minimumSize.width); prefSize.height = Math.max(prefSize.height, minimumSize.height); setPreferredSize(prefSize); } if (maximumSize != null) { Dimension maxSize = getMaximumSize(); maxSize.width = Math.max(maxSize.width, minimumSize.width); maxSize.height = Math.max(maxSize.height, minimumSize.height); setMaximumSize(maxSize); } }
|
public void setMinimumSize(Dimension min) { Dimension oldMinimumSize = minimumSize; minimumSize = min; firePropertyChange("minimumSize", oldMinimumSize, minimumSize); revalidate(); repaint(); // adjust preferred and maximum size accordingly if (preferredSize != null) { Dimension prefSize = getPreferredSize(); prefSize.width = Math.max(prefSize.width, minimumSize.width); prefSize.height = Math.max(prefSize.height, minimumSize.height); setPreferredSize(prefSize); } if (maximumSize != null) { Dimension maxSize = getMaximumSize(); maxSize.width = Math.max(maxSize.width, minimumSize.width); maxSize.height = Math.max(maxSize.height, minimumSize.height); setMaximumSize(maxSize); } }
| 2,292
|
public void setVisible(boolean visible) { if (visible == isVisible()) return; boolean old = isVisible(); this.visible = visible; if (old != isVisible()) { firePropertyChange("visible", old, isVisible()); if (visible) { firePopupMenuWillBecomeVisible(); Container rootContainer = (Container) SwingUtilities.getRoot(invoker); Dimension screenSize = getToolkit().getScreenSize(); boolean fit = true; Dimension size = this.getSize(); if ((size.width > (rootContainer.getWidth() - popupLocation.x)) || (size.height > (rootContainer.getHeight() - popupLocation.y))) fit = false; if (lightWeightPopupEnabled && fit) popup = new LightWeightPopup(this); else { if (fit) popup = new MediumWeightPopup(this); else { popup = new HeavyWeightPopup(this); setLightWeightPopupEnabled(false); } } if (popup instanceof LightWeightPopup || popup instanceof MediumWeightPopup) { JLayeredPane layeredPane; layeredPane = SwingUtilities.getRootPane(invoker).getLayeredPane(); Point p = new Point(popupLocation.x, popupLocation.y); if (layeredPane.isShowing()) SwingUtilities.convertPointFromScreen(p, layeredPane); if (size.width + popupLocation.x > screenSize.width) popupLocation.x -= size.width; if (size.height + popupLocation.y > screenSize.height) popupLocation.y -= size.height; popup.show(p.x, p.y, size.width, size.height); } else { // Subtract insets of the top-level container if popup menu's // top-left corner is inside it. Insets insets = rootContainer.getInsets(); if (size.width + popupLocation.x > screenSize.width) popupLocation.x -= size.width; if (size.height + popupLocation.y > screenSize.height) popupLocation.y -= size.height; popup.show(popupLocation.x - insets.left, popupLocation.y - insets.top, size.width, size.height); } } else { firePopupMenuWillBecomeInvisible(); popup.hide(); } } }
|
public void setVisible(boolean visible) { if (visible == isVisible()) return; boolean old = isVisible(); this.visible = visible; if (old != isVisible()) { firePropertyChange("visible", old, isVisible()); if (visible) { firePopupMenuWillBecomeVisible(); Container rootContainer = (Container) SwingUtilities.getRoot(invoker); Dimension screenSize = getToolkit().getScreenSize(); boolean fit = true; Dimension size = getSize(); if (size.width == 0 && size.height == 0) { size = getPreferredSize(); setSize(size); } if ((size.width > (rootContainer.getWidth() - popupLocation.x)) || (size.height > (rootContainer.getHeight() - popupLocation.y))) fit = false; if (lightWeightPopupEnabled && fit) popup = new LightWeightPopup(this); else { if (fit) popup = new MediumWeightPopup(this); else { popup = new HeavyWeightPopup(this); setLightWeightPopupEnabled(false); } } if (popup instanceof LightWeightPopup || popup instanceof MediumWeightPopup) { JLayeredPane layeredPane; layeredPane = SwingUtilities.getRootPane(invoker).getLayeredPane(); Point p = new Point(popupLocation.x, popupLocation.y); if (layeredPane.isShowing()) SwingUtilities.convertPointFromScreen(p, layeredPane); if (size.width + popupLocation.x > screenSize.width) popupLocation.x -= size.width; if (size.height + popupLocation.y > screenSize.height) popupLocation.y -= size.height; popup.show(p.x, p.y, size.width, size.height); } else { // Subtract insets of the top-level container if popup menu's // top-left corner is inside it. Insets insets = rootContainer.getInsets(); if (size.width + popupLocation.x > screenSize.width) popupLocation.x -= size.width; if (size.height + popupLocation.y > screenSize.height) popupLocation.y -= size.height; popup.show(popupLocation.x - insets.left, popupLocation.y - insets.top, size.width, size.height); } } else { firePopupMenuWillBecomeInvisible(); popup.hide(); } } }
| 2,293
|
public boolean addAxisValueList (ValueListInterface valueListObj) { List values = valueListObj.getValues(); // do we have any new values? if (values.size() > 0) { addValueListObj(valueListObj); // append in new values to Parameter obj Iterator iter = values.iterator(); while (iter.hasNext()) { Value thisValue = ((Value) iter.next()); internalAddAxisValue(thisValue); } return true; } else { // safety, needed? hasValueListCompactDescription = false; Log.warnln("Warning: no Values appended, ValueList empty. Parameter unchanged."); return false; } }
|
public boolean addAxisValueList (ValueList valueListObj) { List values = valueListObj.getValues(); // do we have any new values? if (values.size() > 0) { addValueListObj(valueListObj); // append in new values to Parameter obj Iterator iter = values.iterator(); while (iter.hasNext()) { Value thisValue = ((Value) iter.next()); internalAddAxisValue(thisValue); } return true; } else { // safety, needed? hasValueListCompactDescription = false; Log.warnln("Warning: no Values appended, ValueList empty. Parameter unchanged."); return false; } }
| 2,296
|
public void setAxisValueList (ValueListInterface valueListObj) { resetAxisValues(); addAxisValueList(valueListObj); }
|
public void setAxisValueList (ValueList valueListObj) { resetAxisValues(); addAxisValueList(valueListObj); }
| 2,297
|
protected boolean addValueListObj (ValueListInterface valueListObj) { if (valueListObj == null) return false; valueListObjects.add(valueListObj); hasValueListCompactDescription = true; return true; }
|
protected boolean addValueListObj (ValueList valueListObj) { if (valueListObj == null) return false; valueListObjects.add(valueListObj); hasValueListCompactDescription = true; return true; }
| 2,298
|
public InvokeHandler getHandler(String operation, CookieHolder cookie, boolean forwarding_allowed ) throws gnuForwardRequest { if (servant != null) { return servantToHandler(servant); } else { // Use servant locator to locate the servant. if (poa.servant_locator != null) { try { servant = poa.servant_locator.preinvoke(Id, poa, operation, cookie); return servantToHandler(servant); } catch (org.omg.PortableServer.ForwardRequest forw_ex) { if (forwarding_allowed) { throw new gnuForwardRequest(forw_ex.forward_reference); } else { servant = ForwardedServant.create(forw_ex.forward_reference); return servantToHandler(servant); } } } else // Use servant activator to locate the servant. if (poa.applies(ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION) && poa.applies(ServantRetentionPolicyValue.RETAIN) ) { try { poa.activate_object_with_id(Id, servant, forwarding_allowed); servant = poa.id_to_servant(Id); return servantToHandler(servant); } catch (gnuForwardRequest forwarded) { throw forwarded; } catch (Exception ex) { ex.printStackTrace(); BAD_OPERATION bad = new BAD_OPERATION("Unable to activate", 0x5004, CompletionStatus.COMPLETED_NO ); bad.initCause(ex); throw bad; } } else if (poa.default_servant != null) { servant = poa.default_servant; return servantToHandler(servant); } // No servant and no servant manager - throw exception. else { throw new BAD_OPERATION("Unable to activate", 0x5002, CompletionStatus.COMPLETED_NO ); } } }
|
public InvokeHandler getHandler(String operation, CookieHolder cookie, boolean forwarding_allowed ) throws gnuForwardRequest { if (servant != null) { return servantToHandler(servant); } else { // Use servant locator to locate the servant. if (poa.servant_locator != null) { try { servant = poa.servant_locator.preinvoke(Id, poa, operation, cookie); return servantToHandler(servant); } catch (org.omg.PortableServer.ForwardRequest forw_ex) { if (forwarding_allowed) { throw new gnuForwardRequest(forw_ex.forward_reference); } else { servant = ForwardedServant.create(forw_ex.forward_reference); return servantToHandler(servant); } } } else // Use servant activator to locate the servant. if (poa.applies(ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION) && poa.applies(ServantRetentionPolicyValue.RETAIN) ) { try { poa.activate_object_with_id(Id, servant, forwarding_allowed); servant = poa.id_to_servant(Id); return servantToHandler(servant); } catch (gnuForwardRequest forwarded) { throw forwarded; } catch (Exception ex) { BAD_OPERATION bad = new BAD_OPERATION("Unable to activate", 0x5004, CompletionStatus.COMPLETED_NO ); bad.initCause(ex); throw bad; } } else if (poa.default_servant != null) { servant = poa.default_servant; return servantToHandler(servant); } // No servant and no servant manager - throw exception. else { throw new BAD_OPERATION("Unable to activate", 0x5002, CompletionStatus.COMPLETED_NO ); } } }
| 2,299
|
public InvokeHandler getHandler(String operation, CookieHolder cookie, boolean forwarding_allowed ) throws gnuForwardRequest { if (servant != null) { return servantToHandler(servant); } else { // Use servant locator to locate the servant. if (poa.servant_locator != null) { try { servant = poa.servant_locator.preinvoke(Id, poa, operation, cookie); return servantToHandler(servant); } catch (org.omg.PortableServer.ForwardRequest forw_ex) { if (forwarding_allowed) { throw new gnuForwardRequest(forw_ex.forward_reference); } else { servant = ForwardedServant.create(forw_ex.forward_reference); return servantToHandler(servant); } } } else // Use servant activator to locate the servant. if (poa.applies(ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION) && poa.applies(ServantRetentionPolicyValue.RETAIN) ) { try { poa.activate_object_with_id(Id, servant, forwarding_allowed); servant = poa.id_to_servant(Id); return servantToHandler(servant); } catch (gnuForwardRequest forwarded) { throw forwarded; } catch (Exception ex) { ex.printStackTrace(); BAD_OPERATION bad = new BAD_OPERATION("Unable to activate", 0x5004, CompletionStatus.COMPLETED_NO ); bad.initCause(ex); throw bad; } } else if (poa.default_servant != null) { servant = poa.default_servant; return servantToHandler(servant); } // No servant and no servant manager - throw exception. else { throw new BAD_OPERATION("Unable to activate", 0x5002, CompletionStatus.COMPLETED_NO ); } } }
|
public InvokeHandler getHandler(String operation, CookieHolder cookie, boolean forwarding_allowed ) throws gnuForwardRequest { if (servant != null) { return servantToHandler(servant); } else { // Use servant locator to locate the servant. if (poa.servant_locator != null) { try { servant = poa.servant_locator.preinvoke(Id, poa, operation, cookie); return servantToHandler(servant); } catch (org.omg.PortableServer.ForwardRequest forw_ex) { if (forwarding_allowed) { throw new gnuForwardRequest(forw_ex.forward_reference); } else { servant = ForwardedServant.create(forw_ex.forward_reference); return servantToHandler(servant); } } } else // Use servant activator to locate the servant. if (poa.applies(ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION) && poa.applies(ServantRetentionPolicyValue.RETAIN) ) { try { poa.activate_object_with_id(Id, servant, forwarding_allowed); servant = poa.id_to_servant(Id); return servantToHandler(servant); } catch (gnuForwardRequest forwarded) { throw forwarded; } catch (Exception ex) { ex.printStackTrace(); BAD_OPERATION bad = new BAD_OPERATION("Unable to activate", Minor.Activation, CompletionStatus.COMPLETED_NO ); bad.initCause(ex); throw bad; } } else if (poa.default_servant != null) { servant = poa.default_servant; return servantToHandler(servant); } // No servant and no servant manager - throw exception. else { throw new BAD_OPERATION("Unable to activate", 0x5002, CompletionStatus.COMPLETED_NO ); } } }
| 2,300
|
public InvokeHandler getHandler(String operation, CookieHolder cookie, boolean forwarding_allowed ) throws gnuForwardRequest { if (servant != null) { return servantToHandler(servant); } else { // Use servant locator to locate the servant. if (poa.servant_locator != null) { try { servant = poa.servant_locator.preinvoke(Id, poa, operation, cookie); return servantToHandler(servant); } catch (org.omg.PortableServer.ForwardRequest forw_ex) { if (forwarding_allowed) { throw new gnuForwardRequest(forw_ex.forward_reference); } else { servant = ForwardedServant.create(forw_ex.forward_reference); return servantToHandler(servant); } } } else // Use servant activator to locate the servant. if (poa.applies(ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION) && poa.applies(ServantRetentionPolicyValue.RETAIN) ) { try { poa.activate_object_with_id(Id, servant, forwarding_allowed); servant = poa.id_to_servant(Id); return servantToHandler(servant); } catch (gnuForwardRequest forwarded) { throw forwarded; } catch (Exception ex) { ex.printStackTrace(); BAD_OPERATION bad = new BAD_OPERATION("Unable to activate", 0x5004, CompletionStatus.COMPLETED_NO ); bad.initCause(ex); throw bad; } } else if (poa.default_servant != null) { servant = poa.default_servant; return servantToHandler(servant); } // No servant and no servant manager - throw exception. else { throw new BAD_OPERATION("Unable to activate", 0x5002, CompletionStatus.COMPLETED_NO ); } } }
|
public InvokeHandler getHandler(String operation, CookieHolder cookie, boolean forwarding_allowed ) throws gnuForwardRequest { if (servant != null) { return servantToHandler(servant); } else { // Use servant locator to locate the servant. if (poa.servant_locator != null) { try { servant = poa.servant_locator.preinvoke(Id, poa, operation, cookie); return servantToHandler(servant); } catch (org.omg.PortableServer.ForwardRequest forw_ex) { if (forwarding_allowed) { throw new gnuForwardRequest(forw_ex.forward_reference); } else { servant = ForwardedServant.create(forw_ex.forward_reference); return servantToHandler(servant); } } } else // Use servant activator to locate the servant. if (poa.applies(ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION) && poa.applies(ServantRetentionPolicyValue.RETAIN) ) { try { poa.activate_object_with_id(Id, servant, forwarding_allowed); servant = poa.id_to_servant(Id); return servantToHandler(servant); } catch (gnuForwardRequest forwarded) { throw forwarded; } catch (Exception ex) { ex.printStackTrace(); BAD_OPERATION bad = new BAD_OPERATION("Unable to activate", 0x5004, CompletionStatus.COMPLETED_NO ); bad.initCause(ex); throw bad; } } else if (poa.default_servant != null) { servant = poa.default_servant; return servantToHandler(servant); } // No servant and no servant manager - throw exception. else { throw new BAD_OPERATION("Unable to activate", Minor.Activation, CompletionStatus.COMPLETED_NO ); } } }
| 2,301
|
public boolean equals(Object obj) { if (obj instanceof ActivationGroupID) { ActivationGroupID that = (ActivationGroupID)obj; if (this.system.equals(that.system)) { return (true); } } return (false);}
|
public boolean equals(Object obj) { if (obj instanceof ActivationGroupID) { ActivationGroupID that = (ActivationGroupID)obj; if (this.system.equals(that.system)) { return (true); } } return (false);}
| 2,302
|
public boolean equals(Object obj) { if (obj instanceof ActivationGroupID) { ActivationGroupID that = (ActivationGroupID)obj; if (this.system.equals(that.system)) { return (true); } } return (false);}
|
public boolean equals(Object obj) { if (obj instanceof ActivationGroupID) { ActivationGroupID that = (ActivationGroupID)obj; if (this.system.equals(that.system)) { return (true); } } return (false);}
| 2,303
|
public ActivationSystem getSystem() { return (system);}
|
public ActivationSystem getSystem() { return (system);}
| 2,304
|
public int hashCode() { return (system.hashCode());}
|
public int hashCode() { return (system.hashCode());}
| 2,305
|
private static String toArgString() { StringBuffer sb = new StringBuffer(); sb.append(systemId.getText()); // port if (port.getText() != null) if (port.getText().trim().length() > 0) sb.append(" -p " + port.getText().trim()); if (fpn.getText() != null) if (fpn.getText().length() > 0) sb.append(" -f " + fpn.getText()); if (!LangTool.getString("conf.labelDefault").equals( (String)cpb.getSelectedItem())) sb.append(" -cp " + (String)cpb.getSelectedItem()); if (!SSL_TYPE_NONE.equals((String)sslType.getSelectedItem())) sb.append(" -sslType " + (String)sslType.getSelectedItem()); if (ec.isSelected()) sb.append(" -e" ); if (tc.isSelected()) sb.append(" -t" ); if (!sdNormal.isSelected()) sb.append(" -132" ); if (deviceName.getText() != null) if (deviceName.getText().trim().length() > 0) if (deviceName.getText().trim().length() > 10) sb.append(" -dn " + deviceName.getText().trim().substring(0,10).toUpperCase()); else sb.append(" -dn " + deviceName.getText().trim().toUpperCase()); if (useProxy.isSelected()) sb.append(" -usp" ); if (proxyHost.getText() != null) if (proxyHost.getText().length() > 0) sb.append(" -sph " + proxyHost.getText()); if (proxyPort.getText() != null) if (proxyPort.getText().length() > 0) sb.append(" -spp " + proxyPort.getText()); if (noEmbed.isSelected()) sb.append(" -noembed "); if (deamon.isSelected()) sb.append(" -d "); if (newJVM.isSelected()) sb.append(" -nc "); return sb.toString(); }
|
private static String toArgString() { StringBuffer sb = new StringBuffer(); sb.append(systemId.getText()); // port if (port.getText() != null) if (port.getText().trim().length() > 0) sb.append(" -p " + port.getText().trim()); if (fpn.getText() != null) if (fpn.getText().length() > 0) sb.append(" -f " + fpn.getText()); if (!LangTool.getString("conf.labelDefault").equals( (String)cpb.getSelectedItem())) sb.append(" -cp " + (String)cpb.getSelectedItem()); if (!SSL_TYPE_NONE.equals((String)sslType.getSelectedItem())) sb.append(" -sslType " + (String)sslType.getSelectedItem()); if (ec.isSelected()) sb.append(" -e" ); if (tc.isSelected()) sb.append(" -t" ); if (!sdNormal.isSelected()) sb.append(" -132" ); if (deviceName.getText() != null && !sdn.isSelected()) if (deviceName.getText().trim().length() > 0) if (deviceName.getText().trim().length() > 10) sb.append(" -dn " + deviceName.getText().trim().substring(0,10).toUpperCase()); else sb.append(" -dn " + deviceName.getText().trim().toUpperCase()); if (useProxy.isSelected()) sb.append(" -usp" ); if (proxyHost.getText() != null) if (proxyHost.getText().length() > 0) sb.append(" -sph " + proxyHost.getText()); if (proxyPort.getText() != null) if (proxyPort.getText().length() > 0) sb.append(" -spp " + proxyPort.getText()); if (noEmbed.isSelected()) sb.append(" -noembed "); if (deamon.isSelected()) sb.append(" -d "); if (newJVM.isSelected()) sb.append(" -nc "); return sb.toString(); }
| 2,306
|
public AccessibleContext getAccessibleContext() { return null; }
|
public AccessibleContext getAccessibleContext() { if (accessibleContext == null) accessibleContext = new AccessibleJPanel(); return accessibleContext; }
| 2,309
|
public String getClientHost() throws ServerNotActiveException { throw new Error("Not implemented");}
|
public String getClientHost() throws ServerNotActiveException { return RemoteServer.getClientHost();}
| 2,310
|
public UnicastRef(ObjID objid) { this.objid = objid;}
|
public UnicastRef(ObjID objid) { this.objid = objid;}
| 2,311
|
public static synchronized UnicastConnectionManager getInstance(int port, RMIServerSocketFactory ssf) {//System.out.println("getInstance: " + port + "," + ssf); if (ssf == null) { ssf = defaultSocketFactory; } TripleKey key = new TripleKey(localhost, port, ssf); UnicastConnectionManager man = (UnicastConnectionManager)servers.get(key); if (man == null) { man = new UnicastConnectionManager(port, ssf); if (debug) { nsmanager++; System.out.println("\n\n ****** " + nsmanager + " server managers.\n\n"); } // The provided port might not be the set port. key.port = man.serverPort; servers.put(key, man); } return (man);}
|
public static synchronized UnicastConnectionManager getInstance(int port, RMIServerSocketFactory ssf) {//System.out.println("getInstance: " + port + "," + ssf); if (ssf == null) { ssf = defaultSocketFactory; } TripleKey key = new TripleKey(localhost, port, ssf); UnicastConnectionManager man = (UnicastConnectionManager)servers.get(key); if (man == null) { man = new UnicastConnectionManager(port, ssf); if (debug) { nsmanager++; System.out.println("\n\n ****** " + nsmanager + " server managers.\n\n"); } // The provided port might not be the set port. key.port = man.serverPort; servers.put(key, man); } return (man);}
| 2,312
|
public static synchronized UnicastConnectionManager getInstance(int port, RMIServerSocketFactory ssf) {//System.out.println("getInstance: " + port + "," + ssf); if (ssf == null) { ssf = defaultSocketFactory; } TripleKey key = new TripleKey(localhost, port, ssf); UnicastConnectionManager man = (UnicastConnectionManager)servers.get(key); if (man == null) { man = new UnicastConnectionManager(port, ssf); if (debug) { nsmanager++; System.out.println("\n\n ****** " + nsmanager + " server managers.\n\n"); } // The provided port might not be the set port. key.port = man.serverPort; servers.put(key, man); } return (man);}
|
public static synchronized UnicastConnectionManager getInstance(int port, RMIServerSocketFactory ssf) {//System.out.println("getInstance: " + port + "," + ssf); if (ssf == null) { ssf = defaultSocketFactory; } TripleKey key = new TripleKey(localhost, port, ssf); UnicastConnectionManager man = (UnicastConnectionManager)servers.get(key); if (man == null) { man = new UnicastConnectionManager(port, ssf); if (debug) { nsmanager++; System.out.println("\n\n ****** " + nsmanager + " server managers.\n\n"); } // The provided port might not be the set port. key.port = man.serverPort; servers.put(key, man); } return (man);}
| 2,313
|
public static synchronized UnicastConnectionManager getInstance(int port, RMIServerSocketFactory ssf) {//System.out.println("getInstance: " + port + "," + ssf); if (ssf == null) { ssf = defaultSocketFactory; } TripleKey key = new TripleKey(localhost, port, ssf); UnicastConnectionManager man = (UnicastConnectionManager)servers.get(key); if (man == null) { man = new UnicastConnectionManager(port, ssf); if (debug) { nsmanager++; System.out.println("\n\n ****** " + nsmanager + " server managers.\n\n"); } // The provided port might not be the set port. key.port = man.serverPort; servers.put(key, man); } return (man);}
|
public static synchronized UnicastConnectionManager getInstance(int port, RMIServerSocketFactory ssf) {//System.out.println("getInstance: " + port + "," + ssf); if (ssf == null) { ssf = defaultSocketFactory; } TripleKey key = new TripleKey(localhost, port, ssf); UnicastConnectionManager man = (UnicastConnectionManager)servers.get(key); if (man == null) { man = new UnicastConnectionManager(host, port, csf); if (debug) { nsmanager++; System.out.println("\n\n ****** " + nsmanager + " server managers.\n\n"); } // The provided port might not be the set port. key.port = man.serverPort; servers.put(key, man); } return (man);}
| 2,314
|
public static synchronized UnicastConnectionManager getInstance(int port, RMIServerSocketFactory ssf) {//System.out.println("getInstance: " + port + "," + ssf); if (ssf == null) { ssf = defaultSocketFactory; } TripleKey key = new TripleKey(localhost, port, ssf); UnicastConnectionManager man = (UnicastConnectionManager)servers.get(key); if (man == null) { man = new UnicastConnectionManager(port, ssf); if (debug) { nsmanager++; System.out.println("\n\n ****** " + nsmanager + " server managers.\n\n"); } // The provided port might not be the set port. key.port = man.serverPort; servers.put(key, man); } return (man);}
|
public static synchronized UnicastConnectionManager getInstance(int port, RMIServerSocketFactory ssf) {//System.out.println("getInstance: " + port + "," + ssf); if (ssf == null) { ssf = defaultSocketFactory; } TripleKey key = new TripleKey(localhost, port, ssf); UnicastConnectionManager man = (UnicastConnectionManager)servers.get(key); if (man == null) { man = new UnicastConnectionManager(port, ssf); if (debug) { nsmanager++; System.out.println("\n\n ****** " + nsmanager + " server managers.\n\n"); } // The provided port might not be the set port. key.port = man.serverPort; servers.put(key, man); } return (man);}
| 2,315
|
public static synchronized UnicastConnectionManager getInstance(int port, RMIServerSocketFactory ssf) {//System.out.println("getInstance: " + port + "," + ssf); if (ssf == null) { ssf = defaultSocketFactory; } TripleKey key = new TripleKey(localhost, port, ssf); UnicastConnectionManager man = (UnicastConnectionManager)servers.get(key); if (man == null) { man = new UnicastConnectionManager(port, ssf); if (debug) { nsmanager++; System.out.println("\n\n ****** " + nsmanager + " server managers.\n\n"); } // The provided port might not be the set port. key.port = man.serverPort; servers.put(key, man); } return (man);}
|
public static synchronized UnicastConnectionManager getInstance(int port, RMIServerSocketFactory ssf) {//System.out.println("getInstance: " + port + "," + ssf); if (ssf == null) { ssf = defaultSocketFactory; } TripleKey key = new TripleKey(localhost, port, ssf); UnicastConnectionManager man = (UnicastConnectionManager)servers.get(key); if (man == null) { man = new UnicastConnectionManager(port, ssf); if (debug) { nsmanager++; System.out.println("\n\n ****** " + nsmanager + " server managers.\n\n"); } // The provided port might not be the set port. key.port = man.serverPort; servers.put(key, man); } return (man);}
| 2,316
|
public GeneralSecurityException(String msg) { super(msg); }
|
public GeneralSecurityException() { super(msg); }
| 2,317
|
public GeneralSecurityException(String msg) { super(msg); }
|
public GeneralSecurityException(String msg) { }
| 2,318
|
public final synchronized void writeUTF(String value) throws IOException { int len = value.length(); int sum = 0; for (int i = 0; i < len && sum <= 65535; ++i) { char c = value.charAt(i); if (c >= '\u0001' && c <= '\u007f') sum += 1; else if (c == '\u0000' || (c >= '\u0080' && c <= '\u07ff')) sum += 2; else sum += 3; } if (sum > 65535) throw new UTFDataFormatException (); int pos = 0; byte[] buf = new byte[sum]; for (int i = 0; i < len; ++i) { char c = value.charAt(i); if (c >= '\u0001' && c <= '\u007f') buf[pos++] = (byte) c; else if (c == '\u0000' || (c >= '\u0080' && c <= '\u07ff')) { buf[pos++] = (byte) (0xc0 | (0x1f & (c >> 6))); buf[pos++] = (byte) (0x80 | (0x3f & c)); } else { // JSL says the first byte should be or'd with 0xc0, but // that is a typo. Unicode says 0xe0, and that is what is // consistent with DataInputStream. buf[pos++] = (byte) (0xe0 | (0x0f & (c >> 12))); buf[pos++] = (byte) (0x80 | (0x3f & (c >> 6))); buf[pos++] = (byte) (0x80 | (0x3f & c)); } } writeShort (sum); write(buf, 0, sum); }
|
public final synchronized void writeUTF(String value) throws IOException { int len = value.length(); int i = 0; int pos = 0; boolean lengthWritten = false; for (int i = 0; i < len && sum <= 65535; ++i) { char c = value.charAt(i); if (c >= '\u0001' && c <= '\u007f') sum += 1; else if (c == '\u0000' || (c >= '\u0080' && c <= '\u07ff')) sum += 2; else sum += 3; } if (sum > 65535) throw new UTFDataFormatException (); int pos = 0; byte[] buf = new byte[sum]; for (int i = 0; i < len; ++i) { char c = value.charAt(i); if (c >= '\u0001' && c <= '\u007f') buf[pos++] = (byte) c; else if (c == '\u0000' || (c >= '\u0080' && c <= '\u07ff')) { buf[pos++] = (byte) (0xc0 | (0x1f & (c >> 6))); buf[pos++] = (byte) (0x80 | (0x3f & c)); } else { // JSL says the first byte should be or'd with 0xc0, but // that is a typo. Unicode says 0xe0, and that is what is // consistent with DataInputStream. buf[pos++] = (byte) (0xe0 | (0x0f & (c >> 12))); buf[pos++] = (byte) (0x80 | (0x3f & (c >> 6))); buf[pos++] = (byte) (0x80 | (0x3f & c)); } } writeShort (sum); write(buf, 0, sum); }
| 2,319
|
public final synchronized void writeUTF(String value) throws IOException { int len = value.length(); int sum = 0; for (int i = 0; i < len && sum <= 65535; ++i) { char c = value.charAt(i); if (c >= '\u0001' && c <= '\u007f') sum += 1; else if (c == '\u0000' || (c >= '\u0080' && c <= '\u07ff')) sum += 2; else sum += 3; } if (sum > 65535) throw new UTFDataFormatException (); int pos = 0; byte[] buf = new byte[sum]; for (int i = 0; i < len; ++i) { char c = value.charAt(i); if (c >= '\u0001' && c <= '\u007f') buf[pos++] = (byte) c; else if (c == '\u0000' || (c >= '\u0080' && c <= '\u07ff')) { buf[pos++] = (byte) (0xc0 | (0x1f & (c >> 6))); buf[pos++] = (byte) (0x80 | (0x3f & c)); } else { // JSL says the first byte should be or'd with 0xc0, but // that is a typo. Unicode says 0xe0, and that is what is // consistent with DataInputStream. buf[pos++] = (byte) (0xe0 | (0x0f & (c >> 12))); buf[pos++] = (byte) (0x80 | (0x3f & (c >> 6))); buf[pos++] = (byte) (0x80 | (0x3f & c)); } } writeShort (sum); write(buf, 0, sum); }
|
public final synchronized void writeUTF(String value) throws IOException { int len = value.length(); int sum = 0; if (buf == null) buf = new byte[512]; do { char c = value.charAt(i); if (c >= '\u0001' && c <= '\u007f') sum += 1; else if (c == '\u0000' || (c >= '\u0080' && c <= '\u07ff')) sum += 2; else sum += 3; } if (sum > 65535) throw new UTFDataFormatException (); int pos = 0; byte[] buf = new byte[sum]; for (int i = 0; i < len; ++i) { char c = value.charAt(i); if (c >= '\u0001' && c <= '\u007f') buf[pos++] = (byte) c; else if (c == '\u0000' || (c >= '\u0080' && c <= '\u07ff')) { buf[pos++] = (byte) (0xc0 | (0x1f & (c >> 6))); buf[pos++] = (byte) (0x80 | (0x3f & c)); } else { // JSL says the first byte should be or'd with 0xc0, but // that is a typo. Unicode says 0xe0, and that is what is // consistent with DataInputStream. buf[pos++] = (byte) (0xe0 | (0x0f & (c >> 12))); buf[pos++] = (byte) (0x80 | (0x3f & (c >> 6))); buf[pos++] = (byte) (0x80 | (0x3f & c)); } } writeShort (sum); write(buf, 0, sum); }
| 2,320
|
public final synchronized void writeUTF(String value) throws IOException { int len = value.length(); int sum = 0; for (int i = 0; i < len && sum <= 65535; ++i) { char c = value.charAt(i); if (c >= '\u0001' && c <= '\u007f') sum += 1; else if (c == '\u0000' || (c >= '\u0080' && c <= '\u07ff')) sum += 2; else sum += 3; } if (sum > 65535) throw new UTFDataFormatException (); int pos = 0; byte[] buf = new byte[sum]; for (int i = 0; i < len; ++i) { char c = value.charAt(i); if (c >= '\u0001' && c <= '\u007f') buf[pos++] = (byte) c; else if (c == '\u0000' || (c >= '\u0080' && c <= '\u07ff')) { buf[pos++] = (byte) (0xc0 | (0x1f & (c >> 6))); buf[pos++] = (byte) (0x80 | (0x3f & c)); } else { // JSL says the first byte should be or'd with 0xc0, but // that is a typo. Unicode says 0xe0, and that is what is // consistent with DataInputStream. buf[pos++] = (byte) (0xe0 | (0x0f & (c >> 12))); buf[pos++] = (byte) (0x80 | (0x3f & (c >> 6))); buf[pos++] = (byte) (0x80 | (0x3f & c)); } } writeShort (sum); write(buf, 0, sum); }
|
public final synchronized void writeUTF(String value) throws IOException { int len = value.length(); int sum = 0; for (int i = 0; i < len && sum <= 65535; ++i) { char c = value.charAt(i); if (c >= '\u0001' && c <= '\u007f') sum += 1; else if (c == '\u0000' || (c >= '\u0080' && c <= '\u07ff')) sum += 2; else sum += 3; } if (sum > 65535) throw new UTFDataFormatException (); int pos = 0; byte[] buf = new byte[sum]; for (int i = 0; i < len; ++i) { char c = value.charAt(i); if (c >= '\u0001' && c <= '\u007f') buf[pos++] = (byte) c; else if (c == '\u0000' || (c >= '\u0080' && c <= '\u07ff')) { buf[pos++] = (byte) (0xc0 | (0x1f & (c >> 6))); buf[pos++] = (byte) (0x80 | (0x3f & c)); } else { // JSL says the first byte should be or'd with 0xc0, but // that is a typo. Unicode says 0xe0, and that is what is // consistent with DataInputStream. buf[pos++] = (byte) (0xe0 | (0x0f & (c >> 12))); buf[pos++] = (byte) (0x80 | (0x3f & (c >> 6))); buf[pos++] = (byte) (0x80 | (0x3f & c)); } } writeShort (sum); write(buf, 0, sum); }
| 2,321
|
public final synchronized void writeUTF(String value) throws IOException { int len = value.length(); int sum = 0; for (int i = 0; i < len && sum <= 65535; ++i) { char c = value.charAt(i); if (c >= '\u0001' && c <= '\u007f') sum += 1; else if (c == '\u0000' || (c >= '\u0080' && c <= '\u07ff')) sum += 2; else sum += 3; } if (sum > 65535) throw new UTFDataFormatException (); int pos = 0; byte[] buf = new byte[sum]; for (int i = 0; i < len; ++i) { char c = value.charAt(i); if (c >= '\u0001' && c <= '\u007f') buf[pos++] = (byte) c; else if (c == '\u0000' || (c >= '\u0080' && c <= '\u07ff')) { buf[pos++] = (byte) (0xc0 | (0x1f & (c >> 6))); buf[pos++] = (byte) (0x80 | (0x3f & c)); } else { // JSL says the first byte should be or'd with 0xc0, but // that is a typo. Unicode says 0xe0, and that is what is // consistent with DataInputStream. buf[pos++] = (byte) (0xe0 | (0x0f & (c >> 12))); buf[pos++] = (byte) (0x80 | (0x3f & (c >> 6))); buf[pos++] = (byte) (0x80 | (0x3f & c)); } } writeShort (sum); write(buf, 0, sum); }
|
public final synchronized void writeUTF(String value) throws IOException { int len = value.length(); int sum = 0; for (int i = 0; i < len && sum <= 65535; ++i) { char c = value.charAt(i); if (c >= '\u0001' && c <= '\u007f') sum += 1; else if (c == '\u0000' || (c >= '\u0080' && c <= '\u07ff')) sum += 2; else sum += 3; } if (sum > 65535) throw new UTFDataFormatException (); int pos = 0; byte[] buf = new byte[sum]; for (int i = 0; i < len; ++i) { char c = value.charAt(i); if (c >= '\u0001' && c <= '\u007f') buf[pos++] = (byte) c; else if (c == '\u0000' || (c >= '\u0080' && c <= '\u07ff')) { buf[pos++] = (byte) (0xc0 | (0x1f & (c >> 6))); buf[pos++] = (byte) (0x80 | (0x3f & c)); } else { // JSL says the first byte should be or'd with 0xc0, but // that is a typo. Unicode says 0xe0, and that is what is // consistent with DataInputStream. buf[pos++] = (byte) (0xe0 | (0x0f & (c >> 12))); buf[pos++] = (byte) (0x80 | (0x3f & (c >> 6))); buf[pos++] = (byte) (0x80 | (0x3f & c)); } } writeShort (sum); write(buf, 0, sum); }
| 2,322
|
protected void paintMenuItem(Graphics g, JComponent c, Icon checkIcon, Icon arrowIcon, Color background, Color foreground, int defaultTextIconGap) { JMenuItem m = (JMenuItem) c; Rectangle tr = new Rectangle(); // text rectangle Rectangle ir = new Rectangle(); // icon rectangle Rectangle vr = new Rectangle(); // view rectangle Rectangle br = new Rectangle(); // border rectangle Rectangle ar = new Rectangle(); // accelerator rectangle Rectangle cr = new Rectangle(); // checkIcon rectangle int vertAlign = m.getVerticalAlignment(); int horAlign = m.getHorizontalAlignment(); int vertTextPos = m.getVerticalTextPosition(); int horTextPos = m.getHorizontalTextPosition(); Font f = m.getFont(); g.setFont(f); FontMetrics fm = g.getFontMetrics(f); SwingUtilities.calculateInnerArea(m, br); SwingUtilities.calculateInsetArea(br, m.getInsets(), vr); paintBackground(g, m, m.getBackground()); /* MenuItems insets are equal to menuItems margin, space between text and menuItems border. We need to paint insets region as well. */ Insets insets = m.getInsets(); br.x -= insets.left; br.y -= insets.top; br.width += insets.right + insets.left; br.height += insets.top + insets.bottom; /* Menu item is considered to be highlighted when it is selected. It is considered to be selected if menu item is inside some menu and is armed or if it is both armed and pressed */ if (m.getModel().isArmed() && (m.getParent() instanceof MenuElement || m.getModel().isPressed())) { if (m.isContentAreaFilled()) { g.setColor(selectionBackground); g.fillRect(br.x, br.y, br.width, br.height); } } else { if (m.isContentAreaFilled()) { g.setColor(m.getBackground()); g.fillRect(br.x, br.y, br.width, br.height); } } // If this menu item is a JCheckBoxMenuItem then paint check icon if (checkIcon != null) { SwingUtilities.layoutCompoundLabel(m, fm, null, checkIcon, vertAlign, horAlign, vertTextPos, horTextPos, vr, cr, tr, defaultTextIconGap); checkIcon.paintIcon(m, g, cr.x, cr.y); // We need to calculate position of the menu text and position of // user menu icon if there exists one relative to the check icon. // So we need to adjust view rectangle s.t. its starting point is at // checkIcon.width + defaultTextIconGap. vr.x = cr.x + cr.width + defaultTextIconGap; } // if this is a submenu, then paint arrow icon to indicate it. if (arrowIcon != null && (c instanceof JMenu)) { if (! ((JMenu) c).isTopLevelMenu()) { int width = arrowIcon.getIconWidth(); int height = arrowIcon.getIconHeight(); arrowIcon.paintIcon(m, g, vr.width - width + defaultTextIconGap, vr.y + 2); } } // paint text and user menu icon if it exists Icon i = m.getIcon(); SwingUtilities.layoutCompoundLabel(c, fm, m.getText(), i, vertAlign, horAlign, vertTextPos, horTextPos, vr, ir, tr, defaultTextIconGap); if (i != null) i.paintIcon(c, g, ir.x, ir.y); paintText(g, m, tr, m.getText()); // paint accelerator String acceleratorText = ""; if (m.getAccelerator() != null) { acceleratorText = getAcceleratorText(m.getAccelerator()); fm = g.getFontMetrics(acceleratorFont); ar.width = fm.stringWidth(acceleratorText); ar.x = br.width - ar.width; vr.x = br.width - ar.width; SwingUtilities.layoutCompoundLabel(m, fm, acceleratorText, null, vertAlign, horAlign, vertTextPos, horTextPos, vr, ir, ar, defaultTextIconGap); paintAccelerator(g, m, ar, acceleratorText); } }
|
protected void paintMenuItem(Graphics g, JComponent c, Icon checkIcon, Icon arrowIcon, Color background, Color foreground, int defaultTextIconGap) { JMenuItem m = (JMenuItem) c; Rectangle tr = new Rectangle(); // text rectangle Rectangle ir = new Rectangle(); // icon rectangle Rectangle vr = new Rectangle(); // view rectangle Rectangle br = new Rectangle(); // border rectangle Rectangle ar = new Rectangle(); // accelerator rectangle Rectangle cr = new Rectangle(); // checkIcon rectangle int vertAlign = m.getVerticalAlignment(); int horAlign = m.getHorizontalAlignment(); int vertTextPos = m.getVerticalTextPosition(); int horTextPos = m.getHorizontalTextPosition(); Font f = m.getFont(); g.setFont(f); FontMetrics fm = g.getFontMetrics(f); SwingUtilities.calculateInnerArea(m, br); SwingUtilities.calculateInsetArea(br, m.getInsets(), vr); paintBackground(g, m, m.getBackground()); /* MenuItems insets are equal to menuItems margin, space between text and menuItems border. We need to paint insets region as well. */ Insets insets = m.getInsets(); br.x -= insets.left; br.y -= insets.top; br.width += insets.right + insets.left; br.height += insets.top + insets.bottom; /* Menu item is considered to be highlighted when it is selected. It is considered to be selected if menu item is inside some menu and is armed or if it is both armed and pressed */ if (m.getModel().isArmed() && (m.getParent() instanceof MenuElement || m.getModel().isPressed())) { if (m.isContentAreaFilled()) { g.setColor(selectionBackground); g.fillRect(br.x, br.y, br.width, br.height); } } else { if (m.isContentAreaFilled()) { g.setColor(m.getBackground()); g.fillRect(br.x, br.y, br.width, br.height); } } // If this menu item is a JCheckBoxMenuItem then paint check icon if (checkIcon != null) { SwingUtilities.layoutCompoundLabel(m, fm, null, checkIcon, vertAlign, horAlign, vertTextPos, horTextPos, vr, cr, tr, defaultTextIconGap); checkIcon.paintIcon(m, g, cr.x, cr.y); // We need to calculate position of the menu text and position of // user menu icon if there exists one relative to the check icon. // So we need to adjust view rectangle s.t. its starting point is at // checkIcon.width + defaultTextIconGap. vr.x = cr.x + cr.width + defaultTextIconGap; } // if this is a submenu, then paint arrow icon to indicate it. if (arrowIcon != null && (c instanceof JMenu)) { if (! ((JMenu) c).isTopLevelMenu()) { int width = arrowIcon.getIconWidth(); int height = arrowIcon.getIconHeight(); arrowIcon.paintIcon(m, g, vr.width - width + defaultTextIconGap, vr.y + 2); } } // paint text and user menu icon if it exists Icon i = m.getIcon(); SwingUtilities.layoutCompoundLabel(c, fm, m.getText(), i, vertAlign, horAlign, vertTextPos, horTextPos, vr, ir, tr, defaultTextIconGap); if (i != null) i.paintIcon(c, g, ir.x, ir.y); paintText(g, m, tr, m.getText()); // paint accelerator String acceleratorText = ""; if (m.getAccelerator() != null) { acceleratorText = getAcceleratorText(m.getAccelerator()); fm = g.getFontMetrics(acceleratorFont); ar.width = fm.stringWidth(acceleratorText); ar.x = br.width - ar.width; vr.x = br.width - ar.width; SwingUtilities.layoutCompoundLabel(m, fm, acceleratorText, null, vertAlign, horAlign, vertTextPos, horTextPos, vr, ir, ar, defaultTextIconGap); paintAccelerator(g, m, ar, acceleratorText); } }
| 2,323
|
protected void paintText(Graphics g, JMenuItem menuItem, Rectangle textRect, String text) { Font f = menuItem.getFont(); g.setFont(f); FontMetrics fm = g.getFontMetrics(f); if (text != null && ! text.equals("")) { if (menuItem.isEnabled()) { /* Menu item is considered to be highlighted when it is selected. It is considered to be selected if menu item is inside some menu and is armed or if it is both armed and pressed */ if (menuItem.getModel().isArmed() && (menuItem.getParent() instanceof MenuElement || menuItem.getModel().isPressed())) g.setColor(selectionForeground); else g.setColor(menuItem.getForeground()); } else // FIXME: should fix this to use 'disabledForeground', but its // default value in BasicLookAndFeel is null. g.setColor(Color.gray); int mnemonicIndex = menuItem.getDisplayedMnemonicIndex(); if (mnemonicIndex != -1) BasicGraphicsUtils.drawStringUnderlineCharAt(g, text, mnemonicIndex, textRect.x, textRect.y + fm.getAscent()); else BasicGraphicsUtils.drawString(g, text, 0, textRect.x, textRect.y + fm.getAscent()); } }
|
protected void paintText(Graphics g, JMenuItem menuItem, Rectangle textRect, String text) { Font f = menuItem.getFont(); g.setFont(f); FontMetrics fm = g.getFontMetrics(f); if (text != null && ! text.equals("")) { if (menuItem.isEnabled()) { /* Menu item is considered to be highlighted when it is selected. It is considered to be selected if menu item is inside some menu and is armed or if it is both armed and pressed */ if (menuItem.getModel().isArmed() && (menuItem.getParent() instanceof MenuElement || menuItem.getModel().isPressed())) g.setColor(selectionForeground); else g.setColor(menuItem.getForeground()); } else // FIXME: should fix this to use 'disabledForeground', but its // default value in BasicLookAndFeel is null. g.setColor(Color.gray); int mnemonicIndex = menuItem.getDisplayedMnemonicIndex(); if (mnemonicIndex != -1) BasicGraphicsUtils.drawStringUnderlineCharAt(g, text, mnemonicIndex, textRect.x, textRect.y + fm.getAscent()); else BasicGraphicsUtils.drawString(g, text, 0, textRect.x, textRect.y + fm.getAscent()); } }
| 2,324
|
public KeyStroke[] allKeys() { KeyStroke[] superKeys = super.allKeys(); KeyStroke[] mapKeys = map.getBoundKeyStrokes(); KeyStroke[] bothKeys = new KeyStroke[superKeys.length + mapKeys.length]; for (int i = 0; i < superKeys.length; ++i) bothKeys[i] = superKeys[i]; for (int i = 0; i < mapKeys.length; ++i) bothKeys[i + superKeys.length] = mapKeys[i]; return bothKeys; }
|
public KeyStroke[] allKeys() { KeyStroke[] superKeys = super.allKeys(); KeyStroke[] mapKeys = map.getBoundKeyStrokes(); KeyStroke[] bothKeys = new KeyStroke[superKeys.length + mapKeys.length]; for (int i = 0; i < superKeys.length; ++i) bothKeys[i] = superKeys[i]; for (int i = 0; i < mapKeys.length; ++i) bothKeys[i + superKeys.length] = mapKeys[i]; return bothKeys; }
| 2,325
|
public KeyStroke[] allKeys() { KeyStroke[] superKeys = super.allKeys(); KeyStroke[] mapKeys = map.getBoundKeyStrokes(); KeyStroke[] bothKeys = new KeyStroke[superKeys.length + mapKeys.length]; for (int i = 0; i < superKeys.length; ++i) bothKeys[i] = superKeys[i]; for (int i = 0; i < mapKeys.length; ++i) bothKeys[i + superKeys.length] = mapKeys[i]; return bothKeys; }
|
public KeyStroke[] allKeys() { KeyStroke[] superKeys = super.allKeys(); KeyStroke[] mapKeys = map.getBoundKeyStrokes(); KeyStroke[] bothKeys = new KeyStroke[superKeys.length + mapKeys.length]; for (int i = 0; i < superKeys.length; ++i) bothKeys[i] = superKeys[i]; for (int i = 0; i < mapKeys.length; ++i) bothKeys[i + superKeys.length] = mapKeys[i]; return bothKeys; }
| 2,326
|
public JTextComponent() { Keymap defkeymap = getKeymap(DEFAULT_KEYMAP); boolean creatingKeymap = false; if (defkeymap == null) { defkeymap = addKeymap(DEFAULT_KEYMAP, null); defkeymap.setDefaultAction(new DefaultEditorKit.DefaultKeyTypedAction()); creatingKeymap = true; } setFocusable(true); setEditable(true); enableEvents(AWTEvent.KEY_EVENT_MASK); updateUI(); // need to do this after updateUI() if (creatingKeymap) loadKeymap( defkeymap, new KeyBinding[] { new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0), DefaultEditorKit.backwardAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0), DefaultEditorKit.forwardAction), new KeyBinding(KeyStroke.getKeyStroke("typed \b"), DefaultEditorKit.deletePrevCharAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_X, KeyEvent.CTRL_DOWN_MASK), DefaultEditorKit.cutAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_C, KeyEvent.CTRL_DOWN_MASK), DefaultEditorKit.copyAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_V, KeyEvent.CTRL_DOWN_MASK), DefaultEditorKit.pasteAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, KeyEvent.SHIFT_DOWN_MASK), DefaultEditorKit.selectionBackwardAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, KeyEvent.SHIFT_DOWN_MASK), DefaultEditorKit.selectionForwardAction), new KeyBinding(KeyStroke.getKeyStroke("typed \u007f"), DefaultEditorKit.deleteNextCharAction) }, getActions()); }
|
public JTextComponent() { Keymap defkeymap = getKeymap(DEFAULT_KEYMAP); if (defkeymap == null) { defkeymap = addKeymap(DEFAULT_KEYMAP, null); defkeymap.setDefaultAction(new DefaultEditorKit.DefaultKeyTypedAction()); creatingKeymap = true; } setFocusable(true); setEditable(true); enableEvents(AWTEvent.KEY_EVENT_MASK); updateUI(); // need to do this after updateUI() if (creatingKeymap) loadKeymap( defkeymap, new KeyBinding[] { new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0), DefaultEditorKit.backwardAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0), DefaultEditorKit.forwardAction), new KeyBinding(KeyStroke.getKeyStroke("typed \b"), DefaultEditorKit.deletePrevCharAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_X, KeyEvent.CTRL_DOWN_MASK), DefaultEditorKit.cutAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_C, KeyEvent.CTRL_DOWN_MASK), DefaultEditorKit.copyAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_V, KeyEvent.CTRL_DOWN_MASK), DefaultEditorKit.pasteAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, KeyEvent.SHIFT_DOWN_MASK), DefaultEditorKit.selectionBackwardAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, KeyEvent.SHIFT_DOWN_MASK), DefaultEditorKit.selectionForwardAction), new KeyBinding(KeyStroke.getKeyStroke("typed \u007f"), DefaultEditorKit.deleteNextCharAction) }, getActions()); }
| 2,327
|
public JTextComponent() { Keymap defkeymap = getKeymap(DEFAULT_KEYMAP); boolean creatingKeymap = false; if (defkeymap == null) { defkeymap = addKeymap(DEFAULT_KEYMAP, null); defkeymap.setDefaultAction(new DefaultEditorKit.DefaultKeyTypedAction()); creatingKeymap = true; } setFocusable(true); setEditable(true); enableEvents(AWTEvent.KEY_EVENT_MASK); updateUI(); // need to do this after updateUI() if (creatingKeymap) loadKeymap( defkeymap, new KeyBinding[] { new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0), DefaultEditorKit.backwardAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0), DefaultEditorKit.forwardAction), new KeyBinding(KeyStroke.getKeyStroke("typed \b"), DefaultEditorKit.deletePrevCharAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_X, KeyEvent.CTRL_DOWN_MASK), DefaultEditorKit.cutAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_C, KeyEvent.CTRL_DOWN_MASK), DefaultEditorKit.copyAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_V, KeyEvent.CTRL_DOWN_MASK), DefaultEditorKit.pasteAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, KeyEvent.SHIFT_DOWN_MASK), DefaultEditorKit.selectionBackwardAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, KeyEvent.SHIFT_DOWN_MASK), DefaultEditorKit.selectionForwardAction), new KeyBinding(KeyStroke.getKeyStroke("typed \u007f"), DefaultEditorKit.deleteNextCharAction) }, getActions()); }
|
public JTextComponent() { Keymap defkeymap = getKeymap(DEFAULT_KEYMAP); boolean creatingKeymap = false; if (defkeymap == null) { defkeymap = addKeymap(DEFAULT_KEYMAP, null); defkeymap.setDefaultAction(new DefaultEditorKit.DefaultKeyTypedAction()); } setFocusable(true); setEditable(true); enableEvents(AWTEvent.KEY_EVENT_MASK); updateUI(); // need to do this after updateUI() if (creatingKeymap) loadKeymap( defkeymap, new KeyBinding[] { new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0), DefaultEditorKit.backwardAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0), DefaultEditorKit.forwardAction), new KeyBinding(KeyStroke.getKeyStroke("typed \b"), DefaultEditorKit.deletePrevCharAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_X, KeyEvent.CTRL_DOWN_MASK), DefaultEditorKit.cutAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_C, KeyEvent.CTRL_DOWN_MASK), DefaultEditorKit.copyAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_V, KeyEvent.CTRL_DOWN_MASK), DefaultEditorKit.pasteAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, KeyEvent.SHIFT_DOWN_MASK), DefaultEditorKit.selectionBackwardAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, KeyEvent.SHIFT_DOWN_MASK), DefaultEditorKit.selectionForwardAction), new KeyBinding(KeyStroke.getKeyStroke("typed \u007f"), DefaultEditorKit.deleteNextCharAction) }, getActions()); }
| 2,328
|
public JTextComponent() { Keymap defkeymap = getKeymap(DEFAULT_KEYMAP); boolean creatingKeymap = false; if (defkeymap == null) { defkeymap = addKeymap(DEFAULT_KEYMAP, null); defkeymap.setDefaultAction(new DefaultEditorKit.DefaultKeyTypedAction()); creatingKeymap = true; } setFocusable(true); setEditable(true); enableEvents(AWTEvent.KEY_EVENT_MASK); updateUI(); // need to do this after updateUI() if (creatingKeymap) loadKeymap( defkeymap, new KeyBinding[] { new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0), DefaultEditorKit.backwardAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0), DefaultEditorKit.forwardAction), new KeyBinding(KeyStroke.getKeyStroke("typed \b"), DefaultEditorKit.deletePrevCharAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_X, KeyEvent.CTRL_DOWN_MASK), DefaultEditorKit.cutAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_C, KeyEvent.CTRL_DOWN_MASK), DefaultEditorKit.copyAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_V, KeyEvent.CTRL_DOWN_MASK), DefaultEditorKit.pasteAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, KeyEvent.SHIFT_DOWN_MASK), DefaultEditorKit.selectionBackwardAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, KeyEvent.SHIFT_DOWN_MASK), DefaultEditorKit.selectionForwardAction), new KeyBinding(KeyStroke.getKeyStroke("typed \u007f"), DefaultEditorKit.deleteNextCharAction) }, getActions()); }
|
public JTextComponent() { Keymap defkeymap = getKeymap(DEFAULT_KEYMAP); boolean creatingKeymap = false; if (defkeymap == null) { defkeymap = addKeymap(DEFAULT_KEYMAP, null); defkeymap.setDefaultAction(new DefaultEditorKit.DefaultKeyTypedAction()); creatingKeymap = true; } setFocusable(true); setEditable(true); enableEvents(AWTEvent.KEY_EVENT_MASK); updateUI(); // need to do this after updateUI() if (creatingKeymap) loadKeymap( defkeymap, new KeyBinding[] { new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0), DefaultEditorKit.backwardAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0), DefaultEditorKit.forwardAction), new KeyBinding(KeyStroke.getKeyStroke("typed \b"), DefaultEditorKit.deletePrevCharAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_X, KeyEvent.CTRL_DOWN_MASK), DefaultEditorKit.cutAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_C, KeyEvent.CTRL_DOWN_MASK), DefaultEditorKit.copyAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_V, KeyEvent.CTRL_DOWN_MASK), DefaultEditorKit.pasteAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, KeyEvent.SHIFT_DOWN_MASK), DefaultEditorKit.selectionBackwardAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, KeyEvent.SHIFT_DOWN_MASK), DefaultEditorKit.selectionForwardAction), new KeyBinding(KeyStroke.getKeyStroke("typed \u007f"), DefaultEditorKit.deleteNextCharAction) }, getActions()); }
| 2,329
|
public String toString() { return "DERValue [ tag=" + tag + ", class=" + tagClass + ", constructed=" + constructed + ", value=" + value + " ]"; }
|
public String toString() { return "DERValue [ tag=" + tag + ", class=" + tagClass + ", constructed=" + constructed + ", value=" + value + " ]"; }
| 2,330
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, n, e, d, p, q, dP, dQ, qInv; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); checkIsBigInteger(derVersion, "Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); byte[] pkBytes = (byte[]) val.getValue(); der = new DERReader(pkBytes); DERValue derRSAPrivateKey = der.read(); checkIsConstructed(derRSAPrivateKey, "Wrong RSAPrivateKey field"); val = der.read(); checkIsBigInteger(val, "Wrong RSAPrivateKey Version field"); version = (BigInteger) val.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected RSAPrivateKey Version: " + version); val = der.read(); checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong privateExponent field"); d = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime1 field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime2 field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent1 field"); dP = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent2 field"); dQ = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong coefficient field"); qInv = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPrivateKey(Registry.PKCS8_ENCODING_ID, n, e, d, p, q, dP, dQ, qInv); }
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, n, e, d, p, q, dP, dQ, qInv; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); DerUtil.checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); checkIsBigInteger(derVersion, "Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); byte[] pkBytes = (byte[]) val.getValue(); der = new DERReader(pkBytes); DERValue derRSAPrivateKey = der.read(); checkIsConstructed(derRSAPrivateKey, "Wrong RSAPrivateKey field"); val = der.read(); checkIsBigInteger(val, "Wrong RSAPrivateKey Version field"); version = (BigInteger) val.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected RSAPrivateKey Version: " + version); val = der.read(); checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong privateExponent field"); d = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime1 field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime2 field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent1 field"); dP = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent2 field"); dQ = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong coefficient field"); qInv = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPrivateKey(Registry.PKCS8_ENCODING_ID, n, e, d, p, q, dP, dQ, qInv); }
| 2,331
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, n, e, d, p, q, dP, dQ, qInv; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); checkIsBigInteger(derVersion, "Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); byte[] pkBytes = (byte[]) val.getValue(); der = new DERReader(pkBytes); DERValue derRSAPrivateKey = der.read(); checkIsConstructed(derRSAPrivateKey, "Wrong RSAPrivateKey field"); val = der.read(); checkIsBigInteger(val, "Wrong RSAPrivateKey Version field"); version = (BigInteger) val.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected RSAPrivateKey Version: " + version); val = der.read(); checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong privateExponent field"); d = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime1 field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime2 field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent1 field"); dP = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent2 field"); dQ = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong coefficient field"); qInv = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPrivateKey(Registry.PKCS8_ENCODING_ID, n, e, d, p, q, dP, dQ, qInv); }
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, n, e, d, p, q, dP, dQ, qInv; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); DerUtil.checkIsBigInteger(derVersion, "Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); byte[] pkBytes = (byte[]) val.getValue(); der = new DERReader(pkBytes); DERValue derRSAPrivateKey = der.read(); checkIsConstructed(derRSAPrivateKey, "Wrong RSAPrivateKey field"); val = der.read(); checkIsBigInteger(val, "Wrong RSAPrivateKey Version field"); version = (BigInteger) val.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected RSAPrivateKey Version: " + version); val = der.read(); checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong privateExponent field"); d = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime1 field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime2 field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent1 field"); dP = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent2 field"); dQ = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong coefficient field"); qInv = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPrivateKey(Registry.PKCS8_ENCODING_ID, n, e, d, p, q, dP, dQ, qInv); }
| 2,332
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, n, e, d, p, q, dP, dQ, qInv; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); checkIsBigInteger(derVersion, "Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); byte[] pkBytes = (byte[]) val.getValue(); der = new DERReader(pkBytes); DERValue derRSAPrivateKey = der.read(); checkIsConstructed(derRSAPrivateKey, "Wrong RSAPrivateKey field"); val = der.read(); checkIsBigInteger(val, "Wrong RSAPrivateKey Version field"); version = (BigInteger) val.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected RSAPrivateKey Version: " + version); val = der.read(); checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong privateExponent field"); d = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime1 field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime2 field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent1 field"); dP = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent2 field"); dQ = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong coefficient field"); qInv = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPrivateKey(Registry.PKCS8_ENCODING_ID, n, e, d, p, q, dP, dQ, qInv); }
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, n, e, d, p, q, dP, dQ, qInv; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); checkIsBigInteger(derVersion, "Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); DerUtil.checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); byte[] pkBytes = (byte[]) val.getValue(); der = new DERReader(pkBytes); DERValue derRSAPrivateKey = der.read(); checkIsConstructed(derRSAPrivateKey, "Wrong RSAPrivateKey field"); val = der.read(); checkIsBigInteger(val, "Wrong RSAPrivateKey Version field"); version = (BigInteger) val.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected RSAPrivateKey Version: " + version); val = der.read(); checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong privateExponent field"); d = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime1 field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime2 field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent1 field"); dP = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent2 field"); dQ = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong coefficient field"); qInv = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPrivateKey(Registry.PKCS8_ENCODING_ID, n, e, d, p, q, dP, dQ, qInv); }
| 2,333
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, n, e, d, p, q, dP, dQ, qInv; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); checkIsBigInteger(derVersion, "Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); byte[] pkBytes = (byte[]) val.getValue(); der = new DERReader(pkBytes); DERValue derRSAPrivateKey = der.read(); checkIsConstructed(derRSAPrivateKey, "Wrong RSAPrivateKey field"); val = der.read(); checkIsBigInteger(val, "Wrong RSAPrivateKey Version field"); version = (BigInteger) val.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected RSAPrivateKey Version: " + version); val = der.read(); checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong privateExponent field"); d = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime1 field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime2 field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent1 field"); dP = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent2 field"); dQ = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong coefficient field"); qInv = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPrivateKey(Registry.PKCS8_ENCODING_ID, n, e, d, p, q, dP, dQ, qInv); }
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, n, e, d, p, q, dP, dQ, qInv; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); checkIsBigInteger(derVersion, "Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); byte[] pkBytes = (byte[]) val.getValue(); der = new DERReader(pkBytes); DERValue derRSAPrivateKey = der.read(); DerUtil.checkIsConstructed(derRSAPrivateKey, "Wrong RSAPrivateKey field"); val = der.read(); checkIsBigInteger(val, "Wrong RSAPrivateKey Version field"); version = (BigInteger) val.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected RSAPrivateKey Version: " + version); val = der.read(); checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong privateExponent field"); d = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime1 field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime2 field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent1 field"); dP = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent2 field"); dQ = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong coefficient field"); qInv = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPrivateKey(Registry.PKCS8_ENCODING_ID, n, e, d, p, q, dP, dQ, qInv); }
| 2,334
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, n, e, d, p, q, dP, dQ, qInv; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); checkIsBigInteger(derVersion, "Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); byte[] pkBytes = (byte[]) val.getValue(); der = new DERReader(pkBytes); DERValue derRSAPrivateKey = der.read(); checkIsConstructed(derRSAPrivateKey, "Wrong RSAPrivateKey field"); val = der.read(); checkIsBigInteger(val, "Wrong RSAPrivateKey Version field"); version = (BigInteger) val.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected RSAPrivateKey Version: " + version); val = der.read(); checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong privateExponent field"); d = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime1 field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime2 field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent1 field"); dP = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent2 field"); dQ = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong coefficient field"); qInv = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPrivateKey(Registry.PKCS8_ENCODING_ID, n, e, d, p, q, dP, dQ, qInv); }
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, n, e, d, p, q, dP, dQ, qInv; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); checkIsBigInteger(derVersion, "Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); byte[] pkBytes = (byte[]) val.getValue(); der = new DERReader(pkBytes); DERValue derRSAPrivateKey = der.read(); checkIsConstructed(derRSAPrivateKey, "Wrong RSAPrivateKey field"); val = der.read(); DerUtil.checkIsBigInteger(val, "Wrong RSAPrivateKey Version field"); version = (BigInteger) val.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected RSAPrivateKey Version: " + version); val = der.read(); checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong privateExponent field"); d = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime1 field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime2 field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent1 field"); dP = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent2 field"); dQ = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong coefficient field"); qInv = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPrivateKey(Registry.PKCS8_ENCODING_ID, n, e, d, p, q, dP, dQ, qInv); }
| 2,335
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, n, e, d, p, q, dP, dQ, qInv; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); checkIsBigInteger(derVersion, "Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); byte[] pkBytes = (byte[]) val.getValue(); der = new DERReader(pkBytes); DERValue derRSAPrivateKey = der.read(); checkIsConstructed(derRSAPrivateKey, "Wrong RSAPrivateKey field"); val = der.read(); checkIsBigInteger(val, "Wrong RSAPrivateKey Version field"); version = (BigInteger) val.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected RSAPrivateKey Version: " + version); val = der.read(); checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong privateExponent field"); d = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime1 field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime2 field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent1 field"); dP = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent2 field"); dQ = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong coefficient field"); qInv = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPrivateKey(Registry.PKCS8_ENCODING_ID, n, e, d, p, q, dP, dQ, qInv); }
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, n, e, d, p, q, dP, dQ, qInv; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); checkIsBigInteger(derVersion, "Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); byte[] pkBytes = (byte[]) val.getValue(); der = new DERReader(pkBytes); DERValue derRSAPrivateKey = der.read(); checkIsConstructed(derRSAPrivateKey, "Wrong RSAPrivateKey field"); val = der.read(); checkIsBigInteger(val, "Wrong RSAPrivateKey Version field"); version = (BigInteger) val.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected RSAPrivateKey Version: " + version); val = der.read(); DerUtil.checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong privateExponent field"); d = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime1 field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime2 field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent1 field"); dP = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent2 field"); dQ = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong coefficient field"); qInv = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPrivateKey(Registry.PKCS8_ENCODING_ID, n, e, d, p, q, dP, dQ, qInv); }
| 2,336
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, n, e, d, p, q, dP, dQ, qInv; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); checkIsBigInteger(derVersion, "Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); byte[] pkBytes = (byte[]) val.getValue(); der = new DERReader(pkBytes); DERValue derRSAPrivateKey = der.read(); checkIsConstructed(derRSAPrivateKey, "Wrong RSAPrivateKey field"); val = der.read(); checkIsBigInteger(val, "Wrong RSAPrivateKey Version field"); version = (BigInteger) val.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected RSAPrivateKey Version: " + version); val = der.read(); checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong privateExponent field"); d = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime1 field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime2 field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent1 field"); dP = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent2 field"); dQ = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong coefficient field"); qInv = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPrivateKey(Registry.PKCS8_ENCODING_ID, n, e, d, p, q, dP, dQ, qInv); }
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, n, e, d, p, q, dP, dQ, qInv; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); checkIsBigInteger(derVersion, "Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); byte[] pkBytes = (byte[]) val.getValue(); der = new DERReader(pkBytes); DERValue derRSAPrivateKey = der.read(); checkIsConstructed(derRSAPrivateKey, "Wrong RSAPrivateKey field"); val = der.read(); checkIsBigInteger(val, "Wrong RSAPrivateKey Version field"); version = (BigInteger) val.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected RSAPrivateKey Version: " + version); val = der.read(); checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); DerUtil.checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong privateExponent field"); d = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime1 field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime2 field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent1 field"); dP = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent2 field"); dQ = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong coefficient field"); qInv = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPrivateKey(Registry.PKCS8_ENCODING_ID, n, e, d, p, q, dP, dQ, qInv); }
| 2,337
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, n, e, d, p, q, dP, dQ, qInv; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); checkIsBigInteger(derVersion, "Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); byte[] pkBytes = (byte[]) val.getValue(); der = new DERReader(pkBytes); DERValue derRSAPrivateKey = der.read(); checkIsConstructed(derRSAPrivateKey, "Wrong RSAPrivateKey field"); val = der.read(); checkIsBigInteger(val, "Wrong RSAPrivateKey Version field"); version = (BigInteger) val.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected RSAPrivateKey Version: " + version); val = der.read(); checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong privateExponent field"); d = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime1 field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime2 field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent1 field"); dP = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent2 field"); dQ = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong coefficient field"); qInv = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPrivateKey(Registry.PKCS8_ENCODING_ID, n, e, d, p, q, dP, dQ, qInv); }
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, n, e, d, p, q, dP, dQ, qInv; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); checkIsBigInteger(derVersion, "Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); byte[] pkBytes = (byte[]) val.getValue(); der = new DERReader(pkBytes); DERValue derRSAPrivateKey = der.read(); checkIsConstructed(derRSAPrivateKey, "Wrong RSAPrivateKey field"); val = der.read(); checkIsBigInteger(val, "Wrong RSAPrivateKey Version field"); version = (BigInteger) val.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected RSAPrivateKey Version: " + version); val = der.read(); checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); val = der.read(); DerUtil.checkIsBigInteger(val, "Wrong privateExponent field"); d = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime1 field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime2 field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent1 field"); dP = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent2 field"); dQ = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong coefficient field"); qInv = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPrivateKey(Registry.PKCS8_ENCODING_ID, n, e, d, p, q, dP, dQ, qInv); }
| 2,338
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, n, e, d, p, q, dP, dQ, qInv; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); checkIsBigInteger(derVersion, "Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); byte[] pkBytes = (byte[]) val.getValue(); der = new DERReader(pkBytes); DERValue derRSAPrivateKey = der.read(); checkIsConstructed(derRSAPrivateKey, "Wrong RSAPrivateKey field"); val = der.read(); checkIsBigInteger(val, "Wrong RSAPrivateKey Version field"); version = (BigInteger) val.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected RSAPrivateKey Version: " + version); val = der.read(); checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong privateExponent field"); d = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime1 field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime2 field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent1 field"); dP = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent2 field"); dQ = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong coefficient field"); qInv = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPrivateKey(Registry.PKCS8_ENCODING_ID, n, e, d, p, q, dP, dQ, qInv); }
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, n, e, d, p, q, dP, dQ, qInv; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); checkIsBigInteger(derVersion, "Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); byte[] pkBytes = (byte[]) val.getValue(); der = new DERReader(pkBytes); DERValue derRSAPrivateKey = der.read(); checkIsConstructed(derRSAPrivateKey, "Wrong RSAPrivateKey field"); val = der.read(); checkIsBigInteger(val, "Wrong RSAPrivateKey Version field"); version = (BigInteger) val.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected RSAPrivateKey Version: " + version); val = der.read(); checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong privateExponent field"); d = (BigInteger) val.getValue(); val = der.read(); DerUtil.checkIsBigInteger(val, "Wrong prime1 field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime2 field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent1 field"); dP = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent2 field"); dQ = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong coefficient field"); qInv = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPrivateKey(Registry.PKCS8_ENCODING_ID, n, e, d, p, q, dP, dQ, qInv); }
| 2,339
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, n, e, d, p, q, dP, dQ, qInv; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); checkIsBigInteger(derVersion, "Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); byte[] pkBytes = (byte[]) val.getValue(); der = new DERReader(pkBytes); DERValue derRSAPrivateKey = der.read(); checkIsConstructed(derRSAPrivateKey, "Wrong RSAPrivateKey field"); val = der.read(); checkIsBigInteger(val, "Wrong RSAPrivateKey Version field"); version = (BigInteger) val.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected RSAPrivateKey Version: " + version); val = der.read(); checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong privateExponent field"); d = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime1 field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime2 field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent1 field"); dP = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent2 field"); dQ = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong coefficient field"); qInv = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPrivateKey(Registry.PKCS8_ENCODING_ID, n, e, d, p, q, dP, dQ, qInv); }
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, n, e, d, p, q, dP, dQ, qInv; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); checkIsBigInteger(derVersion, "Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); byte[] pkBytes = (byte[]) val.getValue(); der = new DERReader(pkBytes); DERValue derRSAPrivateKey = der.read(); checkIsConstructed(derRSAPrivateKey, "Wrong RSAPrivateKey field"); val = der.read(); checkIsBigInteger(val, "Wrong RSAPrivateKey Version field"); version = (BigInteger) val.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected RSAPrivateKey Version: " + version); val = der.read(); checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong privateExponent field"); d = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime1 field"); p = (BigInteger) val.getValue(); val = der.read(); DerUtil.checkIsBigInteger(val, "Wrong prime2 field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent1 field"); dP = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent2 field"); dQ = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong coefficient field"); qInv = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPrivateKey(Registry.PKCS8_ENCODING_ID, n, e, d, p, q, dP, dQ, qInv); }
| 2,340
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, n, e, d, p, q, dP, dQ, qInv; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); checkIsBigInteger(derVersion, "Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); byte[] pkBytes = (byte[]) val.getValue(); der = new DERReader(pkBytes); DERValue derRSAPrivateKey = der.read(); checkIsConstructed(derRSAPrivateKey, "Wrong RSAPrivateKey field"); val = der.read(); checkIsBigInteger(val, "Wrong RSAPrivateKey Version field"); version = (BigInteger) val.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected RSAPrivateKey Version: " + version); val = der.read(); checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong privateExponent field"); d = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime1 field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime2 field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent1 field"); dP = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent2 field"); dQ = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong coefficient field"); qInv = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPrivateKey(Registry.PKCS8_ENCODING_ID, n, e, d, p, q, dP, dQ, qInv); }
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, n, e, d, p, q, dP, dQ, qInv; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); checkIsBigInteger(derVersion, "Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); byte[] pkBytes = (byte[]) val.getValue(); der = new DERReader(pkBytes); DERValue derRSAPrivateKey = der.read(); checkIsConstructed(derRSAPrivateKey, "Wrong RSAPrivateKey field"); val = der.read(); checkIsBigInteger(val, "Wrong RSAPrivateKey Version field"); version = (BigInteger) val.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected RSAPrivateKey Version: " + version); val = der.read(); checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong privateExponent field"); d = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime1 field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime2 field"); q = (BigInteger) val.getValue(); val = der.read(); DerUtil.checkIsBigInteger(val, "Wrong exponent1 field"); dP = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent2 field"); dQ = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong coefficient field"); qInv = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPrivateKey(Registry.PKCS8_ENCODING_ID, n, e, d, p, q, dP, dQ, qInv); }
| 2,341
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, n, e, d, p, q, dP, dQ, qInv; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); checkIsBigInteger(derVersion, "Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); byte[] pkBytes = (byte[]) val.getValue(); der = new DERReader(pkBytes); DERValue derRSAPrivateKey = der.read(); checkIsConstructed(derRSAPrivateKey, "Wrong RSAPrivateKey field"); val = der.read(); checkIsBigInteger(val, "Wrong RSAPrivateKey Version field"); version = (BigInteger) val.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected RSAPrivateKey Version: " + version); val = der.read(); checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong privateExponent field"); d = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime1 field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime2 field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent1 field"); dP = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent2 field"); dQ = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong coefficient field"); qInv = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPrivateKey(Registry.PKCS8_ENCODING_ID, n, e, d, p, q, dP, dQ, qInv); }
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, n, e, d, p, q, dP, dQ, qInv; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); checkIsBigInteger(derVersion, "Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); byte[] pkBytes = (byte[]) val.getValue(); der = new DERReader(pkBytes); DERValue derRSAPrivateKey = der.read(); checkIsConstructed(derRSAPrivateKey, "Wrong RSAPrivateKey field"); val = der.read(); checkIsBigInteger(val, "Wrong RSAPrivateKey Version field"); version = (BigInteger) val.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected RSAPrivateKey Version: " + version); val = der.read(); checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong privateExponent field"); d = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime1 field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime2 field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent1 field"); dP = (BigInteger) val.getValue(); val = der.read(); DerUtil.checkIsBigInteger(val, "Wrong exponent2 field"); dQ = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong coefficient field"); qInv = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPrivateKey(Registry.PKCS8_ENCODING_ID, n, e, d, p, q, dP, dQ, qInv); }
| 2,342
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, n, e, d, p, q, dP, dQ, qInv; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); checkIsBigInteger(derVersion, "Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); byte[] pkBytes = (byte[]) val.getValue(); der = new DERReader(pkBytes); DERValue derRSAPrivateKey = der.read(); checkIsConstructed(derRSAPrivateKey, "Wrong RSAPrivateKey field"); val = der.read(); checkIsBigInteger(val, "Wrong RSAPrivateKey Version field"); version = (BigInteger) val.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected RSAPrivateKey Version: " + version); val = der.read(); checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong privateExponent field"); d = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime1 field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime2 field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent1 field"); dP = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent2 field"); dQ = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong coefficient field"); qInv = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPrivateKey(Registry.PKCS8_ENCODING_ID, n, e, d, p, q, dP, dQ, qInv); }
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, n, e, d, p, q, dP, dQ, qInv; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); checkIsBigInteger(derVersion, "Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); byte[] pkBytes = (byte[]) val.getValue(); der = new DERReader(pkBytes); DERValue derRSAPrivateKey = der.read(); checkIsConstructed(derRSAPrivateKey, "Wrong RSAPrivateKey field"); val = der.read(); checkIsBigInteger(val, "Wrong RSAPrivateKey Version field"); version = (BigInteger) val.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected RSAPrivateKey Version: " + version); val = der.read(); checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong privateExponent field"); d = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime1 field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong prime2 field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent1 field"); dP = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong exponent2 field"); dQ = (BigInteger) val.getValue(); val = der.read(); DerUtil.checkIsBigInteger(val, "Wrong coefficient field"); qInv = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPrivateKey(Registry.PKCS8_ENCODING_ID, n, e, d, p, q, dP, dQ, qInv); }
| 2,343
|
public final Object clone(Cloneable object) { testInited(); final VmClassType< ? > objectClass = VmMagic.getObjectType(object); final Address objectPtr = ObjectReference.fromObject(object) .toAddress(); final int size; if (objectClass.isArray()) { final int slotSize = Unsafe.getCurrentProcessor().getArchitecture() .getReferenceSize(); final VmArrayClass< ? > arrayClass = (VmArrayClass< ? >) objectClass; final int length = objectPtr.loadInt(Offset .fromIntSignExtend(VmArray.LENGTH_OFFSET * slotSize)); final int elemSize = arrayClass.getComponentType().getTypeSize(); size = (VmArray.DATA_OFFSET * slotSize) * (length * elemSize); } else { final VmNormalClass< ? > normalClass = (VmNormalClass) objectClass; size = normalClass.getObjectSize(); } final Object newObj = allocObject(objectClass, size); helper.copy(objectPtr, ObjectReference.fromObject(newObj).toAddress(), Extent.fromIntZeroExtend(size)); return newObj; }
|
public final Object clone(Cloneable object) { testInited(); final VmClassType< ? > objectClass = VmMagic.getObjectType(object); final Address objectPtr = ObjectReference.fromObject(object) .toAddress(); final int size; if (objectClass.isArray()) { final int slotSize = Unsafe.getCurrentProcessor().getArchitecture() .getReferenceSize(); final VmArrayClass< ? > arrayClass = (VmArrayClass< ? >) objectClass; final int length = objectPtr.loadInt(Offset .fromIntSignExtend(VmArray.LENGTH_OFFSET * slotSize)); final int elemSize = arrayClass.getComponentType().getTypeSize(); size = (VmArray.DATA_OFFSET * slotSize) * (length * elemSize); } else { final VmNormalClass< ? > normalClass = (VmNormalClass<?>) objectClass; size = normalClass.getObjectSize(); } final Object newObj = allocObject(objectClass, size); helper.copy(objectPtr, ObjectReference.fromObject(newObj).toAddress(), Extent.fromIntZeroExtend(size)); return newObj; }
| 2,344
|
public final Object newInstance(VmType< ? > cls) { // cls.link(); cls.initialize(); return newInstance(cls, ((VmNormalClass< ? >) cls).getObjectSize()); }
|
public final Object newInstance(VmType< ? > cls) { // cls.link(); return newInstance(cls, ((VmNormalClass< ? >) cls).getObjectSize()); }
| 2,345
|
public NegativeArraySizeException(String s) { super(s); }
|
public NegativeArraySizeException(String s) { super(s); }
| 2,346
|
public OutOfMemoryError() { super(); }
|
public OutOfMemoryError() { super(); }
| 2,347
|
public HostArgument(String name, String description) { super(name, description); }
|
public HostArgument(String name, String description) { super(name, description); }
| 2,348
|
public BasicComboBoxEditor() { editor = new JTextField(); editor.setBorder(new EmptyBorder(1, 1, 1, 1)); }
|
public BasicComboBoxEditor() { editor = new JTextField(); editor.setBorder(null); editor.setColumns(9); }
| 2,349
|
public Component getTopComponentAt(int x, int y) { if(desktopFrame == null){ //no AWT yet, drop the event return null; } Component comp = desktopFrame.getDesktop().getComponentAt(x,y); if(comp instanceof SwingBaseWindow){ SwingBaseWindow base = (SwingBaseWindow) comp; Window w = base.getAWTComponent(); if(w instanceof Frame){ MenuBar mb = ((Frame)w).getMenuBar(); if(mb != null){ JMenuBar jmb = ((SwingMenuBarPeer)mb.getPeer()).jComponent; Point p = new Point(x,y); SwingUtilities.convertPointFromScreen(p, jmb); comp = SwingUtilities.getDeepestComponentAt(jmb, p.x, p.y); if(comp != null && (comp != jmb || comp == jmb && jmb.contains(p.x,p.y))){ return comp; } } } Point p = new Point(x,y); SwingUtilities.convertPointFromScreen(p, w); comp = SwingUtilities.getDeepestComponentAt(w, p.x, p.y); if(comp == w){ p = new Point(x,y); SwingUtilities.convertPointFromScreen(p, base); comp = SwingUtilities.getDeepestComponentAt(base, p.x, p.y); } } else { comp = super.getTopComponentAt(x, y); SwingFrame sfp = (SwingFrame) SwingUtilities.getAncestorOfClass( SwingFrame.class, comp); if (sfp != null) { Rectangle r = sfp.getBounds(); Insets ins = sfp.getSwingPeer().getInsets(); r.x = r.x + ins.left; r.y = r.y + ins.top; r.width = r.width - ins.left - ins.right; r.height = r.height - ins.top - ins.bottom; if (r.contains(x, y)) { Component c = sfp.getAWTComponent().findComponentAt(x, y); if (c != null) { comp = c; } } } } return comp; }
|
public Component getTopComponentAt(int x, int y) { if(desktopFrame == null){ //no AWT yet, drop the event return null; } Component comp = desktopFrame.getDesktop().getComponentAt(x,y); if(comp instanceof SwingBaseWindow){ SwingBaseWindow base = (SwingBaseWindow) comp; Window w = base.getAWTComponent(); if(w instanceof Frame){ MenuBar mb = ((Frame)w).getMenuBar(); if(mb != null){ JMenuBar jmb = ((SwingMenuBarPeer)mb.getPeer()).jComponent; Point p = new Point(x,y); SwingUtilities.convertPointFromScreen(p, jmb); comp = SwingUtilities.getDeepestComponentAt(jmb, p.x, p.y); if(comp != null && (comp != jmb || comp == jmb && jmb.contains(p.x,p.y))){ return comp; } } } Point p = new Point(x,y); SwingUtilities.convertPointFromScreen(p, w); comp = SwingUtilities.getDeepestComponentAt(w, p.x, p.y); if(comp == w){ p = new Point(x,y); SwingUtilities.convertPointFromScreen(p, base); comp = SwingUtilities.getDeepestComponentAt(base, p.x, p.y); } } else { comp = super.getTopComponentAt(x, y); SwingFrame sfp = (SwingFrame) SwingUtilities.getAncestorOfClass( SwingFrame.class, comp); if (sfp != null) { Rectangle r = sfp.getBounds(); Insets ins = sfp.getSwingPeer().getInsets(); r.x = r.x + ins.left; r.y = r.y + ins.top; r.width = r.width - ins.left - ins.right; r.height = r.height - ins.top - ins.bottom; if (r.contains(x, y)) { Component c = sfp.getAWTComponent().findComponentAt(x, y); if (c != null) { comp = c; } } } } return comp; }
| 2,350
|
public Component getTopComponentAt(int x, int y) { if(desktopFrame == null){ //no AWT yet, drop the event return null; } Component comp = desktopFrame.getDesktop().getComponentAt(x,y); if(comp instanceof SwingBaseWindow){ SwingBaseWindow base = (SwingBaseWindow) comp; Window w = base.getAWTComponent(); if(w instanceof Frame){ MenuBar mb = ((Frame)w).getMenuBar(); if(mb != null){ JMenuBar jmb = ((SwingMenuBarPeer)mb.getPeer()).jComponent; Point p = new Point(x,y); SwingUtilities.convertPointFromScreen(p, jmb); comp = SwingUtilities.getDeepestComponentAt(jmb, p.x, p.y); if(comp != null && (comp != jmb || comp == jmb && jmb.contains(p.x,p.y))){ return comp; } } } Point p = new Point(x,y); SwingUtilities.convertPointFromScreen(p, w); comp = SwingUtilities.getDeepestComponentAt(w, p.x, p.y); if(comp == w){ p = new Point(x,y); SwingUtilities.convertPointFromScreen(p, base); comp = SwingUtilities.getDeepestComponentAt(base, p.x, p.y); } } else { comp = super.getTopComponentAt(x, y); SwingFrame sfp = (SwingFrame) SwingUtilities.getAncestorOfClass( SwingFrame.class, comp); if (sfp != null) { Rectangle r = sfp.getBounds(); Insets ins = sfp.getSwingPeer().getInsets(); r.x = r.x + ins.left; r.y = r.y + ins.top; r.width = r.width - ins.left - ins.right; r.height = r.height - ins.top - ins.bottom; if (r.contains(x, y)) { Component c = sfp.getAWTComponent().findComponentAt(x, y); if (c != null) { comp = c; } } } } return comp; }
|
public Component getTopComponentAt(int x, int y) { if(desktopFrame == null){ //no AWT yet, drop the event return null; } Component comp = desktopFrame.getDesktop().getComponentAt(x,y); if(comp instanceof SwingBaseWindow){ SwingBaseWindow base = (SwingBaseWindow) comp; Window w = base.getAWTComponent(); if(w instanceof Frame){ MenuBar mb = ((Frame)w).getMenuBar(); if(mb != null){ JMenuBar jmb = ((SwingMenuBarPeer)mb.getPeer()).jComponent; Point p = new Point(x,y); SwingUtilities.convertPointFromScreen(p, jmb); comp = SwingUtilities.getDeepestComponentAt(jmb, p.x, p.y); if(comp != null && (comp != jmb || comp == jmb && jmb.contains(p.x,p.y))){ return comp; } } } Point p = new Point(x,y); SwingUtilities.convertPointFromScreen(p, w); comp = SwingUtilities.getDeepestComponentAt(w, p.x, p.y); if(comp == w){ p = new Point(x,y); SwingUtilities.convertPointFromScreen(p, base); comp = SwingUtilities.getDeepestComponentAt(base, p.x, p.y); } } else { comp = super.getTopComponentAt(x, y); SwingFrame sfp = (SwingFrame) SwingUtilities.getAncestorOfClass( SwingFrame.class, comp); if (sfp != null) { Rectangle r = sfp.getBounds(); Insets ins = sfp.getSwingPeer().getInsets(); r.x = r.x + ins.left; r.y = r.y + ins.top; r.width = r.width - ins.left - ins.right; r.height = r.height - ins.top - ins.bottom; if (r.contains(x, y)) { Component c = sfp.getAWTComponent().findComponentAt(x, y); if (c != null) { comp = c; } } } } return comp; }
| 2,351
|
public boolean contains(double x, double y) { double rx = getWidth() / 2; double ry = getHeight() / 2; double tx = (x - getCenterX()) / rx; double ty = (y - getCenterY()) / ry; return tx * tx + ty * ty <= 1.0; }
|
public boolean contains(double x, double y) { double rx = getWidth() / 2; double ry = getHeight() / 2; double tx = (x - getCenterX()) / rx; double ty = (y - getCenterY()) / ry; return tx * tx + ty * ty <= 1.0; }
| 2,352
|
public boolean shouldScroll(int direction) { int value; if (slider.getOrientation() == JSlider.HORIZONTAL) value = valueForXPosition(currentMouseX); else value = valueForYPosition(currentMouseY); if (direction == POSITIVE_SCROLL) return (value > slider.getValue()); else return (value < slider.getValue()); }
|
public boolean shouldScroll(int direction) { int value; if (slider.getOrientation() == JSlider.HORIZONTAL) value = valueForXPosition(currentMouseX); else value = valueForYPosition(currentMouseY); if (direction == POSITIVE_SCROLL) return value > slider.getValue(); else return (value < slider.getValue()); }
| 2,356
|
public boolean shouldScroll(int direction) { int value; if (slider.getOrientation() == JSlider.HORIZONTAL) value = valueForXPosition(currentMouseX); else value = valueForYPosition(currentMouseY); if (direction == POSITIVE_SCROLL) return (value > slider.getValue()); else return (value < slider.getValue()); }
|
public boolean shouldScroll(int direction) { int value; if (slider.getOrientation() == JSlider.HORIZONTAL) value = valueForXPosition(currentMouseX); else value = valueForYPosition(currentMouseY); if (direction == POSITIVE_SCROLL) return (value > slider.getValue()); else return value < slider.getValue(); }
| 2,357
|
protected void calculateLabelRect() { if (slider.getOrientation() == JSlider.HORIZONTAL) { labelRect.x = contentRect.x; labelRect.y = tickRect.y + tickRect.height; labelRect.width = contentRect.width; labelRect.height = getHeightOfTallestLabel(); } else { labelRect.x = tickRect.x + tickRect.width; labelRect.y = contentRect.y; labelRect.width = getWidthOfWidestLabel(); labelRect.height = contentRect.height; } }
|
protected void calculateLabelRect() { if (slider.getOrientation() == JSlider.HORIZONTAL) { labelRect.x = contentRect.x; labelRect.y = tickRect.y + tickRect.height - 1; labelRect.width = contentRect.width; labelRect.height = getHeightOfTallestLabel(); } else { labelRect.x = tickRect.x + tickRect.width; labelRect.y = contentRect.y; labelRect.width = getWidthOfWidestLabel(); labelRect.height = contentRect.height; } }
| 2,358
|
protected void calculateLabelRect() { if (slider.getOrientation() == JSlider.HORIZONTAL) { labelRect.x = contentRect.x; labelRect.y = tickRect.y + tickRect.height; labelRect.width = contentRect.width; labelRect.height = getHeightOfTallestLabel(); } else { labelRect.x = tickRect.x + tickRect.width; labelRect.y = contentRect.y; labelRect.width = getWidthOfWidestLabel(); labelRect.height = contentRect.height; } }
|
protected void calculateLabelRect() { if (slider.getOrientation() == JSlider.HORIZONTAL) { labelRect.x = contentRect.x; labelRect.y = tickRect.y + tickRect.height; labelRect.width = contentRect.width; labelRect.height = getHeightOfTallestLabel(); } else { if (slider.getPaintLabels()) { labelRect.x = tickRect.x + tickRect.width - 1; labelRect.y = contentRect.y; labelRect.width = getWidthOfWidestLabel(); labelRect.height = contentRect.height; } }
| 2,359
|
protected void calculateLabelRect() { if (slider.getOrientation() == JSlider.HORIZONTAL) { labelRect.x = contentRect.x; labelRect.y = tickRect.y + tickRect.height; labelRect.width = contentRect.width; labelRect.height = getHeightOfTallestLabel(); } else { labelRect.x = tickRect.x + tickRect.width; labelRect.y = contentRect.y; labelRect.width = getWidthOfWidestLabel(); labelRect.height = contentRect.height; } }
|
protected void calculateLabelRect() { if (slider.getOrientation() == JSlider.HORIZONTAL) { labelRect.x = contentRect.x; labelRect.y = tickRect.y + tickRect.height; labelRect.width = contentRect.width; labelRect.height = getHeightOfTallestLabel(); } else { labelRect.x = tickRect.x + tickRect.width; labelRect.y = contentRect.y; labelRect.height = contentRect.height; } }
| 2,360
|
protected void calculateThumbLocation() { int value = slider.getValue(); if (slider.getOrientation() == JSlider.HORIZONTAL) { thumbRect.x = xPositionForValue(value) - thumbRect.width / 2; thumbRect.y = trackRect.y; } else { thumbRect.x = trackRect.x; thumbRect.y = yPositionForValue(value) - thumbRect.height / 2; } }
|
protected void calculateThumbLocation() { int value = slider.getValue(); if (slider.getOrientation() == JSlider.HORIZONTAL) { thumbRect.x = xPositionForValue(value) - thumbRect.width / 2; thumbRect.y = trackRect.y + 1; } else { thumbRect.x = trackRect.x; thumbRect.y = yPositionForValue(value) - thumbRect.height / 2; } }
| 2,362
|
protected void calculateThumbLocation() { int value = slider.getValue(); if (slider.getOrientation() == JSlider.HORIZONTAL) { thumbRect.x = xPositionForValue(value) - thumbRect.width / 2; thumbRect.y = trackRect.y; } else { thumbRect.x = trackRect.x; thumbRect.y = yPositionForValue(value) - thumbRect.height / 2; } }
|
protected void calculateThumbLocation() { int value = slider.getValue(); if (slider.getOrientation() == JSlider.HORIZONTAL) { thumbRect.x = xPositionForValue(value) - thumbRect.width / 2; thumbRect.y = trackRect.y; } else { thumbRect.x = trackRect.x + 1; thumbRect.y = yPositionForValue(value) - thumbRect.height / 2; } }
| 2,363
|
protected void calculateThumbSize() { Dimension d = getThumbSize(); thumbRect.width = d.width; thumbRect.height = d.height; if (slider.getOrientation() == JSlider.HORIZONTAL) thumbRect.y = trackRect.y; else thumbRect.x = trackRect.x; }
|
protected void calculateThumbSize() { Dimension d = getThumbSize(); thumbRect.width = d.width; thumbRect.height = d.height; if (slider.getOrientation() == JSlider.HORIZONTAL) thumbRect.y = trackRect.y; else thumbRect.x = trackRect.x; }
| 2,364
|
protected void calculateTickRect() { if (slider.getOrientation() == JSlider.HORIZONTAL) { tickRect.x = trackRect.x; tickRect.y = trackRect.y + trackRect.height; tickRect.width = trackRect.width; tickRect.height = (slider.getPaintTicks() ? getTickLength() : 0); if (tickRect.y + tickRect.height > contentRect.y + contentRect.height) tickRect.height = contentRect.y + contentRect.height - tickRect.y; } else { tickRect.x = trackRect.x + trackRect.width; tickRect.y = trackRect.y; tickRect.width = (slider.getPaintTicks() ? getTickLength() : 0); tickRect.height = trackRect.height; if (tickRect.x + tickRect.width > contentRect.x + contentRect.width) tickRect.width = contentRect.x + contentRect.width - tickRect.x; } }
|
protected void calculateTickRect() { if (slider.getOrientation() == JSlider.HORIZONTAL) { tickRect.x = trackRect.x; tickRect.y = trackRect.y + trackRect.height; tickRect.width = trackRect.width; tickRect.height = slider.getPaintTicks() ? getTickLength() : 0; if (!slider.getPaintTicks()) tickRect.y--; if (tickRect.y + tickRect.height > contentRect.y + contentRect.height) tickRect.height = contentRect.y + contentRect.height - tickRect.y; } else { tickRect.x = trackRect.x + trackRect.width; tickRect.y = trackRect.y; tickRect.width = (slider.getPaintTicks() ? getTickLength() : 0); tickRect.height = trackRect.height; if (tickRect.x + tickRect.width > contentRect.x + contentRect.width) tickRect.width = contentRect.x + contentRect.width - tickRect.x; } }
| 2,365
|
protected void calculateTickRect() { if (slider.getOrientation() == JSlider.HORIZONTAL) { tickRect.x = trackRect.x; tickRect.y = trackRect.y + trackRect.height; tickRect.width = trackRect.width; tickRect.height = (slider.getPaintTicks() ? getTickLength() : 0); if (tickRect.y + tickRect.height > contentRect.y + contentRect.height) tickRect.height = contentRect.y + contentRect.height - tickRect.y; } else { tickRect.x = trackRect.x + trackRect.width; tickRect.y = trackRect.y; tickRect.width = (slider.getPaintTicks() ? getTickLength() : 0); tickRect.height = trackRect.height; if (tickRect.x + tickRect.width > contentRect.x + contentRect.width) tickRect.width = contentRect.x + contentRect.width - tickRect.x; } }
|
protected void calculateTickRect() { if (slider.getOrientation() == JSlider.HORIZONTAL) { tickRect.x = trackRect.x; tickRect.y = trackRect.y + trackRect.height; tickRect.width = trackRect.width; tickRect.height = (slider.getPaintTicks() ? getTickLength() : 0); if (tickRect.y + tickRect.height > contentRect.y + contentRect.height) tickRect.height = contentRect.y + contentRect.height - tickRect.y; } else { tickRect.x = trackRect.x + trackRect.width; tickRect.y = trackRect.y; tickRect.width = slider.getPaintTicks() ? getTickLength() : 0; tickRect.height = trackRect.height; if (tickRect.x + tickRect.width > contentRect.x + contentRect.width) tickRect.width = contentRect.x + contentRect.width - tickRect.x; } }
| 2,366
|
public void paintTrack(Graphics g) { Color saved_color = g.getColor(); int width; int height; Point a = new Point(trackRect.x, trackRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); if (slider.getOrientation() == JSlider.HORIZONTAL) { width = trackRect.width; height = (thumbRect.height / 4 == 0) ? 1 : thumbRect.height / 4; a.translate(0, (trackRect.height / 2) - (height / 2)); b.translate(0, (trackRect.height / 2) + (height / 2)); c.translate(trackRect.width, (trackRect.height / 2) + (height / 2)); d.translate(trackRect.width, (trackRect.height / 2) - (height / 2)); } else { width = (thumbRect.width / 4 == 0) ? 1 : thumbRect.width / 4; height = trackRect.height; a.translate((trackRect.width / 2) - (width / 2), 0); b.translate((trackRect.width / 2) - (width / 2), trackRect.height); c.translate((trackRect.width / 2) + (width / 2), trackRect.height); d.translate((trackRect.width / 2) + (width / 2), 0); } g.setColor(Color.GRAY); g.fillRect(a.x, a.y, width, height); g.setColor(getHighlightColor()); g.drawLine(b.x, b.y, c.x, c.y); g.drawLine(c.x, c.y, d.x, d.y); g.setColor(getShadowColor()); g.drawLine(b.x, b.y, a.x, a.y); g.drawLine(a.x, a.y, d.x, d.y); g.setColor(saved_color); }
|
public void paintTrack(Graphics g) { Color saved_color = g.getColor(); int width; int height; Point a = new Point(trackRect.x, trackRect.y + 1); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); if (slider.getOrientation() == JSlider.HORIZONTAL) { width = trackRect.width; height = (thumbRect.height / 4 == 0) ? 1 : thumbRect.height / 4; a.translate(0, (trackRect.height / 2) - (height / 2)); b.translate(0, (trackRect.height / 2) + (height / 2)); c.translate(trackRect.width, (trackRect.height / 2) + (height / 2)); d.translate(trackRect.width, (trackRect.height / 2) - (height / 2)); } else { width = (thumbRect.width / 4 == 0) ? 1 : thumbRect.width / 4; height = trackRect.height; a.translate((trackRect.width / 2) - (width / 2), 0); b.translate((trackRect.width / 2) - (width / 2), trackRect.height); c.translate((trackRect.width / 2) + (width / 2), trackRect.height); d.translate((trackRect.width / 2) + (width / 2), 0); } g.setColor(Color.GRAY); g.fillRect(a.x, a.y, width, height); g.setColor(getHighlightColor()); g.drawLine(b.x, b.y, c.x, c.y); g.drawLine(c.x, c.y, d.x, d.y); g.setColor(getShadowColor()); g.drawLine(b.x, b.y, a.x, a.y); g.drawLine(a.x, a.y, d.x, d.y); g.setColor(saved_color); }
| 2,368
|
public int valueForXPosition(int xPos) { int min = slider.getMinimum(); int max = slider.getMaximum(); int len = trackRect.width; int value; // If the length is 0, you shouldn't be able to even see where the slider // is. This really shouldn't ever happen, but just in case, we'll return // the middle. if (len == 0) return ((max - min) / 2); if (! drawInverted()) value = ((xPos - trackRect.x) * (max - min) / len + min); else value = ((len - (xPos - trackRect.x)) * (max - min) / len + min); // If this isn't a legal value, then we'll have to move to one now. if (value > max) value = max; else if (value < min) value = min; return value; }
|
public int valueForXPosition(int xPos) { int min = slider.getMinimum(); int max = slider.getMaximum(); int len = trackRect.width; int value; // If the length is 0, you shouldn't be able to even see where the slider // is. This really shouldn't ever happen, but just in case, we'll return // the middle. if (len == 0) return (max - min) / 2; if (! drawInverted()) value = ((xPos - trackRect.x) * (max - min) / len + min); else value = ((len - (xPos - trackRect.x)) * (max - min) / len + min); // If this isn't a legal value, then we'll have to move to one now. if (value > max) value = max; else if (value < min) value = min; return value; }
| 2,369
|
public int valueForXPosition(int xPos) { int min = slider.getMinimum(); int max = slider.getMaximum(); int len = trackRect.width; int value; // If the length is 0, you shouldn't be able to even see where the slider // is. This really shouldn't ever happen, but just in case, we'll return // the middle. if (len == 0) return ((max - min) / 2); if (! drawInverted()) value = ((xPos - trackRect.x) * (max - min) / len + min); else value = ((len - (xPos - trackRect.x)) * (max - min) / len + min); // If this isn't a legal value, then we'll have to move to one now. if (value > max) value = max; else if (value < min) value = min; return value; }
|
public int valueForXPosition(int xPos) { int min = slider.getMinimum(); int max = slider.getMaximum(); int len = trackRect.width; int value; // If the length is 0, you shouldn't be able to even see where the slider // is. This really shouldn't ever happen, but just in case, we'll return // the middle. if (len == 0) return ((max - min) / 2); if (! drawInverted()) value = (xPos - trackRect.x) * (max - min) / len + min; else value = ((len - (xPos - trackRect.x)) * (max - min) / len + min); // If this isn't a legal value, then we'll have to move to one now. if (value > max) value = max; else if (value < min) value = min; return value; }
| 2,370
|
public int valueForXPosition(int xPos) { int min = slider.getMinimum(); int max = slider.getMaximum(); int len = trackRect.width; int value; // If the length is 0, you shouldn't be able to even see where the slider // is. This really shouldn't ever happen, but just in case, we'll return // the middle. if (len == 0) return ((max - min) / 2); if (! drawInverted()) value = ((xPos - trackRect.x) * (max - min) / len + min); else value = ((len - (xPos - trackRect.x)) * (max - min) / len + min); // If this isn't a legal value, then we'll have to move to one now. if (value > max) value = max; else if (value < min) value = min; return value; }
|
public int valueForXPosition(int xPos) { int min = slider.getMinimum(); int max = slider.getMaximum(); int len = trackRect.width; int value; // If the length is 0, you shouldn't be able to even see where the slider // is. This really shouldn't ever happen, but just in case, we'll return // the middle. if (len == 0) return ((max - min) / 2); if (! drawInverted()) value = ((xPos - trackRect.x) * (max - min) / len + min); else value = (len - (xPos - trackRect.x)) * (max - min) / len + min; // If this isn't a legal value, then we'll have to move to one now. if (value > max) value = max; else if (value < min) value = min; return value; }
| 2,371
|
public int valueForYPosition(int yPos) { int min = slider.getMinimum(); int max = slider.getMaximum(); int len = trackRect.height; int value; // If the length is 0, you shouldn't be able to even see where the slider // is. This really shouldn't ever happen, but just in case, we'll return // the middle. if (len == 0) return ((max - min) / 2); if (! drawInverted()) value = ((len - (yPos - trackRect.y)) * (max - min) / len + min); else value = ((yPos - trackRect.y) * (max - min) / len + min); // If this isn't a legal value, then we'll have to move to one now. if (value > max) value = max; else if (value < min) value = min; return value; }
|
public int valueForYPosition(int yPos) { int min = slider.getMinimum(); int max = slider.getMaximum(); int len = trackRect.height; int value; // If the length is 0, you shouldn't be able to even see where the slider // is. This really shouldn't ever happen, but just in case, we'll return // the middle. if (len == 0) return (max - min) / 2; if (! drawInverted()) value = ((len - (yPos - trackRect.y)) * (max - min) / len + min); else value = ((yPos - trackRect.y) * (max - min) / len + min); // If this isn't a legal value, then we'll have to move to one now. if (value > max) value = max; else if (value < min) value = min; return value; }
| 2,372
|
public int valueForYPosition(int yPos) { int min = slider.getMinimum(); int max = slider.getMaximum(); int len = trackRect.height; int value; // If the length is 0, you shouldn't be able to even see where the slider // is. This really shouldn't ever happen, but just in case, we'll return // the middle. if (len == 0) return ((max - min) / 2); if (! drawInverted()) value = ((len - (yPos - trackRect.y)) * (max - min) / len + min); else value = ((yPos - trackRect.y) * (max - min) / len + min); // If this isn't a legal value, then we'll have to move to one now. if (value > max) value = max; else if (value < min) value = min; return value; }
|
public int valueForYPosition(int yPos) { int min = slider.getMinimum(); int max = slider.getMaximum(); int len = trackRect.height; int value; // If the length is 0, you shouldn't be able to even see where the slider // is. This really shouldn't ever happen, but just in case, we'll return // the middle. if (len == 0) return ((max - min) / 2); if (! drawInverted()) value = (len - (yPos - trackRect.y)) * (max - min) / len + min; else value = ((yPos - trackRect.y) * (max - min) / len + min); // If this isn't a legal value, then we'll have to move to one now. if (value > max) value = max; else if (value < min) value = min; return value; }
| 2,373
|
public int valueForYPosition(int yPos) { int min = slider.getMinimum(); int max = slider.getMaximum(); int len = trackRect.height; int value; // If the length is 0, you shouldn't be able to even see where the slider // is. This really shouldn't ever happen, but just in case, we'll return // the middle. if (len == 0) return ((max - min) / 2); if (! drawInverted()) value = ((len - (yPos - trackRect.y)) * (max - min) / len + min); else value = ((yPos - trackRect.y) * (max - min) / len + min); // If this isn't a legal value, then we'll have to move to one now. if (value > max) value = max; else if (value < min) value = min; return value; }
|
public int valueForYPosition(int yPos) { int min = slider.getMinimum(); int max = slider.getMaximum(); int len = trackRect.height; int value; // If the length is 0, you shouldn't be able to even see where the slider // is. This really shouldn't ever happen, but just in case, we'll return // the middle. if (len == 0) return ((max - min) / 2); if (! drawInverted()) value = ((len - (yPos - trackRect.y)) * (max - min) / len + min); else value = (yPos - trackRect.y) * (max - min) / len + min; // If this isn't a legal value, then we'll have to move to one now. if (value > max) value = max; else if (value < min) value = min; return value; }
| 2,374
|
public synchronized void write (byte[] buf, int offset, int len) throws IOException { out.write(buf, offset, len); written += len; }
|
public synchronized void write (byte[] buf, int offset, int len) throws IOException { out.write(buf, offset, len); written += len; }
| 2,375
|
public synchronized void write (byte[] buf, int offset, int len) throws IOException { out.write(buf, offset, len); written += len; }
|
public synchronized void write (byte[] buf, int offset, int len) throws IOException { out.write(buf, offset, len); written += len; }
| 2,376
|
public UnaryQuad(int address, IRBasicBlock block, int lhsIndex, int operation, int varIndex) { super(address, block, lhsIndex); this.operation = operation; this.operand = getOperand(varIndex); refs = new Operand[] { operand }; }
|
public UnaryQuad(int address, IRBasicBlock block, int lhsIndex, int operation, int varIndex) { super(address, block, lhsIndex); this.operation = operation; this.operand = getOperand(varIndex); refs = new Operand[] { operand }; }
| 2,377
|
public void doPass2(BootableHashMap liveVariables) { operand = operand.simplify(); if (operand instanceof Variable) { Variable v = (Variable) operand; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } }
|
public void doPass2(BootableHashMap liveVariables) { operand = operand.simplify(); if (operand instanceof Variable) { Variable v = (Variable) operand; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } }
| 2,378
|
private Quad foldConstants() { if(operand instanceof Constant){ Constant c = (Constant) operand; switch (operation) { case I2L: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.i2l()); case I2F: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.i2f()); case I2D: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.i2d()); case L2I: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.l2i()); case L2F: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.l2f()); case L2D: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.l2d()); case F2I: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.f2i()); case F2L: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.f2l()); case F2D: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.f2d()); case D2I: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.d2i()); case D2L: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.d2l()); case D2F: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.d2f()); case I2B: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.i2b()); case I2C: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.i2c()); case I2S: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.i2s()); case INEG: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.iNeg()); case LNEG: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.lNeg()); case FNEG: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.fNeg()); case DNEG: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.dNeg()); default: throw new IllegalArgumentException("Don't know how to fold those yet..."); } } return this; }
|
private Quad foldConstants() { if(operand instanceof Constant){ Constant c = (Constant) operand; switch (operation) { case I2L: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.i2l()); case I2F: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.i2f()); case I2D: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.i2d()); case L2I: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.l2i()); case L2F: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.l2f()); case L2D: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.l2d()); case F2I: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.f2i()); case F2L: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.f2l()); case F2D: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.f2d()); case D2I: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.d2i()); case D2L: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.d2l()); case D2F: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.d2f()); case I2B: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.i2b()); case I2C: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.i2c()); case I2S: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.i2s()); case INEG: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.iNeg()); case LNEG: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.lNeg()); case FNEG: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.fNeg()); case DNEG: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c.dNeg()); default: throw new IllegalArgumentException("Don't know how to fold those yet..."); } } return this; }
| 2,379
|
public void generateCode(CodeGenerator cg) { Variable lhs = getLHS(); Location lhsLoc = lhs.getLocation(); if (lhsLoc instanceof RegisterLocation) { RegisterLocation regLoc = (RegisterLocation) lhsLoc; Object lhsReg = regLoc.getRegister(); if (operand instanceof Variable) { Variable var = (Variable) operand; Location varLoc = var.getLocation(); if (varLoc instanceof RegisterLocation) { RegisterLocation vregLoc = (RegisterLocation) varLoc; cg.generateCodeFor(this, lhsReg, operation, vregLoc.getRegister()); } else if (varLoc instanceof StackLocation) { StackLocation stackLoc = (StackLocation) varLoc; cg.generateCodeFor(this, lhsReg, operation, stackLoc.getDisplacement()); } else { throw new IllegalArgumentException("Unknown location: " + varLoc); } } else if (operand instanceof Constant) { // this probably won't happen, is should be folded earlier Constant con = (Constant) operand; cg.generateCodeFor(this, lhsReg, operation, con); } else { throw new IllegalArgumentException("Unknown operand: " + operand); } } else if (lhsLoc instanceof StackLocation) { StackLocation lhsStackLoc = (StackLocation) lhsLoc; int lhsDisp = lhsStackLoc.getDisplacement(); if (operand instanceof Variable) { Variable var = (Variable) operand; Location varLoc = var.getLocation(); if (varLoc instanceof RegisterLocation) { RegisterLocation vregLoc = (RegisterLocation) varLoc; cg.generateCodeFor(this, lhsDisp, operation, vregLoc.getRegister()); } else if (varLoc instanceof StackLocation) { StackLocation stackLoc = (StackLocation) varLoc; cg.generateCodeFor(this, lhsDisp, operation, stackLoc.getDisplacement()); } else { throw new IllegalArgumentException("Unknown location: " + varLoc); } } else if (operand instanceof Constant) { Constant con = (Constant) operand; cg.generateCodeFor(this, lhsDisp, operation, con); } else { throw new IllegalArgumentException("Unknown operand: " + operand); } } else { throw new IllegalArgumentException("Unknown location: " + lhsLoc); } }
|
public void generateCode(CodeGenerator cg) { Variable lhs = getLHS(); Location lhsLoc = lhs.getLocation(); if (lhsLoc instanceof RegisterLocation) { RegisterLocation regLoc = (RegisterLocation) lhsLoc; Object lhsReg = regLoc.getRegister(); if (operand instanceof Variable) { Variable var = (Variable) operand; Location varLoc = var.getLocation(); if (varLoc instanceof RegisterLocation) { RegisterLocation vregLoc = (RegisterLocation) varLoc; cg.generateCodeFor(this, lhsReg, operation, vregLoc.getRegister()); } else if (varLoc instanceof StackLocation) { StackLocation stackLoc = (StackLocation) varLoc; cg.generateCodeFor(this, lhsReg, operation, stackLoc.getDisplacement()); } else { throw new IllegalArgumentException("Unknown location: " + varLoc); } } else if (operand instanceof Constant) { // this probably won't happen, is should be folded earlier Constant con = (Constant) operand; cg.generateCodeFor(this, lhsReg, operation, con); } else { throw new IllegalArgumentException("Unknown operand: " + operand); } } else if (lhsLoc instanceof StackLocation) { StackLocation lhsStackLoc = (StackLocation) lhsLoc; int lhsDisp = lhsStackLoc.getDisplacement(); if (operand instanceof Variable) { Variable var = (Variable) operand; Location varLoc = var.getLocation(); if (varLoc instanceof RegisterLocation) { RegisterLocation vregLoc = (RegisterLocation) varLoc; cg.generateCodeFor(this, lhsDisp, operation, vregLoc.getRegister()); } else if (varLoc instanceof StackLocation) { StackLocation stackLoc = (StackLocation) varLoc; cg.generateCodeFor(this, lhsDisp, operation, stackLoc.getDisplacement()); } else { throw new IllegalArgumentException("Unknown location: " + varLoc); } } else if (operand instanceof Constant) { Constant con = (Constant) operand; cg.generateCodeFor(this, lhsDisp, operation, con); } else { throw new IllegalArgumentException("Unknown operand: " + operand); } } else { throw new IllegalArgumentException("Unknown location: " + lhsLoc); } }
| 2,380
|
public void generateCode(CodeGenerator cg) { Variable lhs = getLHS(); Location lhsLoc = lhs.getLocation(); if (lhsLoc instanceof RegisterLocation) { RegisterLocation regLoc = (RegisterLocation) lhsLoc; Object lhsReg = regLoc.getRegister(); if (operand instanceof Variable) { Variable var = (Variable) operand; Location varLoc = var.getLocation(); if (varLoc instanceof RegisterLocation) { RegisterLocation vregLoc = (RegisterLocation) varLoc; cg.generateCodeFor(this, lhsReg, operation, vregLoc.getRegister()); } else if (varLoc instanceof StackLocation) { StackLocation stackLoc = (StackLocation) varLoc; cg.generateCodeFor(this, lhsReg, operation, stackLoc.getDisplacement()); } else { throw new IllegalArgumentException("Unknown location: " + varLoc); } } else if (operand instanceof Constant) { // this probably won't happen, is should be folded earlier Constant con = (Constant) operand; cg.generateCodeFor(this, lhsReg, operation, con); } else { throw new IllegalArgumentException("Unknown operand: " + operand); } } else if (lhsLoc instanceof StackLocation) { StackLocation lhsStackLoc = (StackLocation) lhsLoc; int lhsDisp = lhsStackLoc.getDisplacement(); if (operand instanceof Variable) { Variable var = (Variable) operand; Location varLoc = var.getLocation(); if (varLoc instanceof RegisterLocation) { RegisterLocation vregLoc = (RegisterLocation) varLoc; cg.generateCodeFor(this, lhsDisp, operation, vregLoc.getRegister()); } else if (varLoc instanceof StackLocation) { StackLocation stackLoc = (StackLocation) varLoc; cg.generateCodeFor(this, lhsDisp, operation, stackLoc.getDisplacement()); } else { throw new IllegalArgumentException("Unknown location: " + varLoc); } } else if (operand instanceof Constant) { Constant con = (Constant) operand; cg.generateCodeFor(this, lhsDisp, operation, con); } else { throw new IllegalArgumentException("Unknown operand: " + operand); } } else { throw new IllegalArgumentException("Unknown location: " + lhsLoc); } }
|
public void generateCode(CodeGenerator cg) { Variable lhs = getLHS(); Location lhsLoc = lhs.getLocation(); if (lhsLoc instanceof RegisterLocation) { RegisterLocation regLoc = (RegisterLocation) lhsLoc; Object lhsReg = regLoc.getRegister(); if (operand instanceof Variable) { Variable var = (Variable) operand; Location varLoc = var.getLocation(); if (varLoc instanceof RegisterLocation) { RegisterLocation vregLoc = (RegisterLocation) varLoc; cg.generateCodeFor(this, lhsReg, operation, vregLoc.getRegister()); } else if (varLoc instanceof StackLocation) { StackLocation stackLoc = (StackLocation) varLoc; cg.generateCodeFor(this, lhsReg, operation, stackLoc.getDisplacement()); } else { throw new IllegalArgumentException("Unknown location: " + varLoc); } } else if (refs[0] instanceof Constant) { // this probably won't happen, is should be folded earlier Constant con = (Constant) operand; cg.generateCodeFor(this, lhsReg, operation, con); } else { throw new IllegalArgumentException("Unknown operand: " + operand); } } else if (lhsLoc instanceof StackLocation) { StackLocation lhsStackLoc = (StackLocation) lhsLoc; int lhsDisp = lhsStackLoc.getDisplacement(); if (operand instanceof Variable) { Variable var = (Variable) operand; Location varLoc = var.getLocation(); if (varLoc instanceof RegisterLocation) { RegisterLocation vregLoc = (RegisterLocation) varLoc; cg.generateCodeFor(this, lhsDisp, operation, vregLoc.getRegister()); } else if (varLoc instanceof StackLocation) { StackLocation stackLoc = (StackLocation) varLoc; cg.generateCodeFor(this, lhsDisp, operation, stackLoc.getDisplacement()); } else { throw new IllegalArgumentException("Unknown location: " + varLoc); } } else if (refs[0] instanceof Constant) { Constant con = (Constant) operand; cg.generateCodeFor(this, lhsDisp, operation, con); } else { throw new IllegalArgumentException("Unknown operand: " + operand); } } else { throw new IllegalArgumentException("Unknown location: " + lhsLoc); } }
| 2,381
|
public void generateCode(CodeGenerator cg) { Variable lhs = getLHS(); Location lhsLoc = lhs.getLocation(); if (lhsLoc instanceof RegisterLocation) { RegisterLocation regLoc = (RegisterLocation) lhsLoc; Object lhsReg = regLoc.getRegister(); if (operand instanceof Variable) { Variable var = (Variable) operand; Location varLoc = var.getLocation(); if (varLoc instanceof RegisterLocation) { RegisterLocation vregLoc = (RegisterLocation) varLoc; cg.generateCodeFor(this, lhsReg, operation, vregLoc.getRegister()); } else if (varLoc instanceof StackLocation) { StackLocation stackLoc = (StackLocation) varLoc; cg.generateCodeFor(this, lhsReg, operation, stackLoc.getDisplacement()); } else { throw new IllegalArgumentException("Unknown location: " + varLoc); } } else if (operand instanceof Constant) { // this probably won't happen, is should be folded earlier Constant con = (Constant) operand; cg.generateCodeFor(this, lhsReg, operation, con); } else { throw new IllegalArgumentException("Unknown operand: " + operand); } } else if (lhsLoc instanceof StackLocation) { StackLocation lhsStackLoc = (StackLocation) lhsLoc; int lhsDisp = lhsStackLoc.getDisplacement(); if (operand instanceof Variable) { Variable var = (Variable) operand; Location varLoc = var.getLocation(); if (varLoc instanceof RegisterLocation) { RegisterLocation vregLoc = (RegisterLocation) varLoc; cg.generateCodeFor(this, lhsDisp, operation, vregLoc.getRegister()); } else if (varLoc instanceof StackLocation) { StackLocation stackLoc = (StackLocation) varLoc; cg.generateCodeFor(this, lhsDisp, operation, stackLoc.getDisplacement()); } else { throw new IllegalArgumentException("Unknown location: " + varLoc); } } else if (operand instanceof Constant) { Constant con = (Constant) operand; cg.generateCodeFor(this, lhsDisp, operation, con); } else { throw new IllegalArgumentException("Unknown operand: " + operand); } } else { throw new IllegalArgumentException("Unknown location: " + lhsLoc); } }
|
public void generateCode(CodeGenerator cg) { Variable lhs = getLHS(); Location lhsLoc = lhs.getLocation(); if (lhsLoc instanceof RegisterLocation) { RegisterLocation regLoc = (RegisterLocation) lhsLoc; Object lhsReg = regLoc.getRegister(); if (operand instanceof Variable) { Variable var = (Variable) operand; Location varLoc = var.getLocation(); if (varLoc instanceof RegisterLocation) { RegisterLocation vregLoc = (RegisterLocation) varLoc; cg.generateCodeFor(this, lhsReg, operation, vregLoc.getRegister()); } else if (varLoc instanceof StackLocation) { StackLocation stackLoc = (StackLocation) varLoc; cg.generateCodeFor(this, lhsReg, operation, stackLoc.getDisplacement()); } else { throw new IllegalArgumentException("Unknown location: " + varLoc); } } else if (operand instanceof Constant) { // this probably won't happen, is should be folded earlier Constant con = (Constant) refs[0]; cg.generateCodeFor(this, lhsReg, operation, con); } else { throw new IllegalArgumentException("Unknown operand: " + operand); } } else if (lhsLoc instanceof StackLocation) { StackLocation lhsStackLoc = (StackLocation) lhsLoc; int lhsDisp = lhsStackLoc.getDisplacement(); if (operand instanceof Variable) { Variable var = (Variable) operand; Location varLoc = var.getLocation(); if (varLoc instanceof RegisterLocation) { RegisterLocation vregLoc = (RegisterLocation) varLoc; cg.generateCodeFor(this, lhsDisp, operation, vregLoc.getRegister()); } else if (varLoc instanceof StackLocation) { StackLocation stackLoc = (StackLocation) varLoc; cg.generateCodeFor(this, lhsDisp, operation, stackLoc.getDisplacement()); } else { throw new IllegalArgumentException("Unknown location: " + varLoc); } } else if (operand instanceof Constant) { Constant con = (Constant) refs[0]; cg.generateCodeFor(this, lhsDisp, operation, con); } else { throw new IllegalArgumentException("Unknown operand: " + operand); } } else { throw new IllegalArgumentException("Unknown location: " + lhsLoc); } }
| 2,382
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.