bugged
stringlengths 6
599k
| fixed
stringlengths 6
40.8M
| __index_level_0__
int64 0
3.24M
|
|---|---|---|
public GregorianCalendar(Locale locale) { this(TimeZone.getDefault(), locale); }
|
public GregorianCalendar() { this(TimeZone.getDefault(), locale); }
| 3,725
|
public GregorianCalendar(Locale locale) { this(TimeZone.getDefault(), locale); }
|
public GregorianCalendar(Locale locale) { this(TimeZone.getDefault(), locale); }
| 3,726
|
public int get(int field) { // If the requested field is invalid, force all fields to be recomputed. if (!isSet[field]) areFieldsSet = false; complete(); return fields[field]; }
|
public int get(int field) { // If the requested field is invalid, force all fields to be recomputed. if (!isSet[field]) areFieldsSet = false; complete(); return fields[field]; }
| 3,727
|
public void set(int field, int value) { isTimeSet = false; fields[field] = value; isSet[field] = true; switch (field) { case YEAR: case MONTH: case DATE: isSet[WEEK_OF_YEAR] = false; isSet[DAY_OF_YEAR] = false; isSet[WEEK_OF_MONTH] = false; isSet[DAY_OF_WEEK] = false; isSet[DAY_OF_WEEK_IN_MONTH] = false; break; case AM_PM: isSet[HOUR_OF_DAY] = false; break; case HOUR_OF_DAY: isSet[AM_PM] = false; isSet[HOUR] = false; break; case HOUR: isSet[HOUR_OF_DAY] = false; break; case DST_OFFSET: explicitDSTOffset = true; } // May have crossed over a DST boundary. if (!explicitDSTOffset && (field != DST_OFFSET && field != ZONE_OFFSET)) isSet[DST_OFFSET] = false; }
|
public void set(int field, int value) { isTimeSet = false; fields[field] = value; isSet[field] = true; switch (field) { case YEAR: case MONTH: case DATE: isSet[WEEK_OF_YEAR] = false; isSet[DAY_OF_YEAR] = false; isSet[WEEK_OF_MONTH] = false; isSet[DAY_OF_WEEK] = false; isSet[DAY_OF_WEEK_IN_MONTH] = false; break; case AM_PM: isSet[HOUR_OF_DAY] = false; break; case HOUR_OF_DAY: isSet[AM_PM] = false; isSet[HOUR] = false; break; case HOUR: isSet[HOUR_OF_DAY] = false; break; case DST_OFFSET: explicitDSTOffset = true; } // May have crossed over a DST boundary. if (! explicitDSTOffset && (field != DST_OFFSET && field != ZONE_OFFSET)) isSet[DST_OFFSET] = false; }
| 3,728
|
public final Date getTime() { if (!isTimeSet) computeTime(); return new Date(time); }
|
public final Date getTime() { if (!isTimeSet) computeTime(); return new Date(time); }
| 3,729
|
public boolean equals (Object obj) { if (!(obj instanceof DateFormat)) return false; DateFormat d = (DateFormat) obj; return numberFormat.equals(d.numberFormat); }
|
public boolean equals (Object obj) { if (!(obj instanceof DateFormat)) return false; DateFormat d = (DateFormat) obj; return false; }
| 3,730
|
protected void processWindowFocusEvent(WindowEvent event) { if (windowFocusListener != null) { switch (event.getID ()) { case WindowEvent.WINDOW_GAINED_FOCUS: windowFocusListener.windowGainedFocus (event); break; case WindowEvent.WINDOW_LOST_FOCUS: windowFocusListener.windowLostFocus (event); break; default: break; } } }
|
protected void processWindowFocusEvent(WindowEvent event) { if (windowFocusListener != null) { switch (event.getID ()) { case WindowEvent.WINDOW_GAINED_FOCUS: windowFocusListener.windowGainedFocus (event); break; case WindowEvent.WINDOW_LOST_FOCUS: windowFocusListener.windowLostFocus (event); break; default: break; } } }
| 3,731
|
protected void processWindowFocusEvent(WindowEvent event) { if (windowFocusListener != null) { switch (event.getID ()) { case WindowEvent.WINDOW_GAINED_FOCUS: windowFocusListener.windowGainedFocus (event); break; case WindowEvent.WINDOW_LOST_FOCUS: windowFocusListener.windowLostFocus (event); break; default: break; } } }
|
protected void processWindowFocusEvent(WindowEvent event) { if (windowFocusListener != null) { switch (event.getID ()) { case WindowEvent.WINDOW_GAINED_FOCUS: windowFocusListener.windowGainedFocus (event); break; case WindowEvent.WINDOW_LOST_FOCUS: windowFocusListener.windowLostFocus (event); break; default: break; } } }
| 3,732
|
public ISO9660Entry(EntryRecord entry) { this.CDFSentry = entry; }
|
public ISO9660Entry(EntryRecord entry) { this.CDFSentry = entry; }
| 3,733
|
public FSAccessRights getAccessRights() throws IOException { throw new UnsupportedOperationException("not yet implemented"); }
|
public FSAccessRights getAccessRights() throws IOException { throw new UnsupportedOperationException("not yet implemented"); }
| 3,734
|
public EntryRecord getCDFSentry() { return CDFSentry; }
|
public EntryRecord getCDFSentry() { return CDFSentry; }
| 3,735
|
public FSDirectory getDirectory() throws IOException { return new ISO9660Directory(this); }
|
public FSDirectory getDirectory() throws IOException { return new ISO9660Directory(this); }
| 3,736
|
public FSFile getFile() throws IOException { return new ISO9660File(this); }
|
public FSFile getFile() throws IOException { return new ISO9660File(this); }
| 3,737
|
public FileSystem getFileSystem() { return null; }
|
public FileSystem getFileSystem() { return null; }
| 3,738
|
public long getLastModified() throws IOException { throw new UnsupportedOperationException("not yet implemented"); }
|
public long getLastModified() throws IOException { throw new UnsupportedOperationException("not yet implemented"); }
| 3,739
|
public String getName() { return CDFSentry.getFileIdentifier(); }
|
public String getName() { return CDFSentry.getFileIdentifier(); }
| 3,740
|
public FSDirectory getParent() { throw new UnsupportedOperationException("not yet implemented"); }
|
public FSDirectory getParent() { throw new UnsupportedOperationException("not yet implemented"); }
| 3,741
|
public boolean isDirectory() { return CDFSentry.isDirectory(); }
|
public boolean isDirectory() { return CDFSentry.isDirectory(); }
| 3,742
|
public boolean isFile() { return !CDFSentry.isDirectory(); }
|
public boolean isFile() { return !CDFSentry.isDirectory(); }
| 3,743
|
public boolean isValid() { return true; }
|
public boolean isValid() { return true; }
| 3,744
|
public void setCDFSentry(EntryRecord sentry) { CDFSentry = sentry; }
|
public void setCDFSentry(EntryRecord sentry) { CDFSentry = sentry; }
| 3,745
|
public void setLastModified(long lastModified) throws IOException { throw new UnsupportedOperationException("not yet implemented"); }
|
public void setLastModified(long lastModified) throws IOException { throw new UnsupportedOperationException("not yet implemented"); }
| 3,746
|
public void setName(String newName) throws IOException { throw new UnsupportedOperationException("not yet implemented"); }
|
public void setName(String newName) throws IOException { throw new UnsupportedOperationException("not yet implemented"); }
| 3,747
|
public void setExceptionListener(ExceptionListener listener) { exceptionListener = (listener != null) ? listener : new ExceptionListener() { public void exceptionThrown(Exception e) { System.err.println("exception thrown: " + e); } }; }
|
public void setExceptionListener(ExceptionListener listener) { exceptionListener = (listener != null) ? listener : new ExceptionListener() { public void exceptionThrown(Exception e) { System.err.println("exception thrown: " + e); } }; }
| 3,748
|
public Expression(Object target, String methodName, Object[] arguments) { super(target, methodName, arguments); this.value = UNSET; }
|
public Expression(Object value, Object target, String methodName, Object[] arguments) { super(target, methodName, arguments); this.value = UNSET; }
| 3,749
|
public Expression(Object target, String methodName, Object[] arguments) { super(target, methodName, arguments); this.value = UNSET; }
|
public Expression(Object target, String methodName, Object[] arguments) { super(target, methodName, arguments); this.value = value; }
| 3,750
|
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; }
| 3,751
|
protected short getBottomInset() { return (short) insets.bottom; }
|
protected short getBottomInset() { return bottom; }
| 3,752
|
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; }
| 3,753
|
protected short getLeftInset() { return (short) insets.left; }
|
protected short getLeftInset() { return left; }
| 3,754
|
protected short getRightInset() { return (short) insets.right; }
|
protected short getRightInset() { return right; }
| 3,755
|
protected short getTopInset() { return (short) insets.top; }
|
protected short getTopInset() { return top; }
| 3,756
|
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; }
| 3,757
|
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); }
| 3,759
|
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; }
| 3,760
|
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; }
| 3,761
|
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); }
| 3,762
|
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; }
| 3,763
|
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; }
|
if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { publicif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { Shapeif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { modelToView(intif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { pos,if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { Shapeif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { a,if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { Position.Biasif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { bias)if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { throwsif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { BadLocationExceptionif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { {if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { intif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { childIndexif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { =if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { getViewIndex(pos,if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { bias);if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { ifif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { (childIndexif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { ==if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { -1)if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { throwif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { newif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { BadLocationException("Positionif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { "if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { +if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { posif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { +if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { "if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { isif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { notif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { representedif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { byif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { view.",if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { pos);if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { Shapeif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { retif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { =if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { null;if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { Viewif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { childif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { =if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { getView(childIndex);if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { Shapeif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { childAllocif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { =if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { getChildAllocation(childIndex,if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { a);if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { ifif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { (childAllocif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { ==if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { null)if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { retif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { =if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { createDefaultLocation(a,if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { bias);if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { Shapeif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { resultif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { =if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { child.modelToView(pos,if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { childAlloc,if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { bias);if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { ifif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { (resultif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { !=if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { null)if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { retif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { =if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { result;if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { elseif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { retif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { =if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { createDefaultLocation(a,if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { bias);if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { returnif (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { ret;if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { if (! backward || testpos >= getStartOffset()) { int childIndex = getViewIndexAtPosition(testpos); if (childIndex != -1 && childIndex < getViewCount()) { }
| 3,764
|
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; }
| 3,765
|
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; }
| 3,766
|
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; }
| 3,768
|
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; }
| 3,769
|
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); }
| 3,770
|
public int getViewIndex(int pos, Position.Bias b) { return -1; }
|
public int getViewIndex(float x, float y, Shape allocation) { return -1; }
| 3,771
|
public void replace(int offset, int length, View[] views) { // Default implementation does nothing. }
|
public void replace(int offset, int length, View[] views) { // Default implementation does nothing. }
| 3,772
|
protected MouseEvent convertMouseEvent(MouseEvent e) { Point point = SwingUtilities.convertPoint((Component) e.getSource(), e.getPoint(), list); MouseEvent newEvent= new MouseEvent((Component) e.getSource(), e.getID(), e.getWhen(), e.getModifiers(), point.x, point.y, e.getModifiers(), e.isPopupTrigger()); return newEvent; }
|
protected MouseEvent convertMouseEvent(MouseEvent e) { Point point = SwingUtilities.convertPoint((Component) e.getSource(), e.getPoint(), list); MouseEvent newEvent = new MouseEvent((Component) e.getSource(), e.getID(), e.getWhen(), e.getModifiers(), point.x, point.y, e.getModifiers(), e.isPopupTrigger()); return newEvent; }
| 3,782
|
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); } }
| 3,783
|
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(); } } }
| 3,784
|
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; } }
| 3,787
|
public void setAxisValueList (ValueListInterface valueListObj) { resetAxisValues(); addAxisValueList(valueListObj); }
|
public void setAxisValueList (ValueList valueListObj) { resetAxisValues(); addAxisValueList(valueListObj); }
| 3,788
|
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; }
| 3,789
|
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 ); } } }
| 3,790
|
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 ); } } }
| 3,791
|
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 ); } } }
| 3,792
|
public ActivationGroupID(ActivationSystem system) { this.system = system;}
|
public ActivationGroupID(ActivationSystem system) { this.system = system;}
| 3,793
|
public ActivationGroupID(ActivationSystem system) { this.system = system;}
|
public ActivationGroupID(ActivationSystem system) { this.system = system;}
| 3,794
|
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);}
| 3,795
|
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);}
| 3,796
|
public ActivationSystem getSystem() { return (system);}
|
public ActivationSystem getSystem() { return (system);}
| 3,797
|
public int hashCode() { return (system.hashCode());}
|
public int hashCode() { return (system.hashCode());}
| 3,798
|
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(); }
| 3,799
|
public AccessibleContext getAccessibleContext() { return null; }
|
public AccessibleContext getAccessibleContext() { if (accessibleContext == null) accessibleContext = new AccessibleJPanel(); return accessibleContext; }
| 3,802
|
public PanelUI getUI() { return (PanelUI)ui; }
|
public PanelUI getUI() { return (PanelUI)ui; }
| 3,803
|
public String getUIClassID() { return "PanelUI"; }
|
public String getUIClassID() { return "PanelUI"; }
| 3,804
|
public String getClientHost() throws ServerNotActiveException { throw new Error("Not implemented");}
|
public String getClientHost() throws ServerNotActiveException { throw new Error("Not implemented");}
| 3,805
|
public UnicastRef(ObjID objid) { this.objid = objid;}
|
public UnicastRef(ObjID objid) { this.objid = objid;}
| 3,806
|
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);}
| 3,807
|
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);}
| 3,808
|
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);}
| 3,809
|
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);}
| 3,810
|
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);}
| 3,811
|
public GeneralSecurityException(String msg) { super(msg); }
|
public GeneralSecurityException() { super(msg); }
| 3,812
|
public GeneralSecurityException(String msg) { super(msg); }
|
public GeneralSecurityException(String msg) { }
| 3,813
|
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); }
| 3,815
|
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); }
| 3,816
|
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); }
| 3,817
|
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); }
| 3,818
|
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); } }
| 3,819
|
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()); } }
| 3,820
|
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; }
| 3,822
|
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; }
| 3,823
|
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()); }
| 3,824
|
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()); }
| 3,825
|
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()); }
| 3,826
|
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 + " ]"; }
| 3,828
|
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); }
| 3,829
|
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); }
| 3,830
|
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); }
| 3,831
|
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); }
| 3,832
|
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); }
| 3,833
|
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); }
| 3,834
|
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); }
| 3,835
|
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); }
| 3,836
|
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); }
| 3,837
|
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); }
| 3,838
|
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); }
| 3,839
|
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); }
| 3,840
|
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); }
| 3,841
|
DisabledFocusManager() { // TODO } // DisabledFocusManager()
|
DisabledFocusManager() { // TODO } // DisabledFocusManager()
| 3,842
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.