bugged
stringlengths
6
599k
fixed
stringlengths
10
599k
__index_level_0__
int64
0
1.13M
protected final int next(int numBits) { if (numBits == 0) return 0; byte tmp[] = new byte[numBits / 8 + (1 * (numBits % 8))]; secureRandomSpi.engineNextBytes(tmp); randomBytesUsed += tmp.length; counter++; int ret = 0; for (int i = 0; i < tmp.length; i++) ret |= tmp[i] << (8 * i); return ret; }
protected final int next(int numBits) { if (numBits == 0) return 0; byte tmp[] = new byte[numBits / 8 + (1 * (numBits % 8))]; secureRandomSpi.engineNextBytes(tmp); randomBytesUsed += tmp.length; counter++; int ret = 0; for (int i = 0; i < tmp.length; i++) ret |= tmp[i] << (8 * i); long mask = (1L << numBits) - 1; return (int) (ret & mask); }
14,172
public TaggedProfileHolder(TaggedProfile initialValue) { value = initialValue; }
public TaggedProfileHolder() { value = initialValue; }
14,173
public TaggedProfileHolder(TaggedProfile initialValue) { value = initialValue; }
public TaggedProfileHolder(TaggedProfile initialValue) { }
14,174
NodeNumberNode(TemplateNode children, TemplateNode next, int level, Pattern count, Pattern from, TemplateNode format, String lang, int letterValue, String groupingSeparator, int groupingSize) { super(children, next, format, lang, letterValue, groupingSeparator, groupingSize); this.level = level; this.count = count; this.from = from; }
NodeNumberNode(TemplateNode children, TemplateNode next, int level, Pattern count, Pattern from, TemplateNode format, String lang, int letterValue, String groupingSeparator, int groupingSize) { super(children, next, format, lang, letterValue, groupingSeparator, groupingSize); this.level = level; this.count = count; this.from = from; }
14,175
NodeNumberNode(TemplateNode children, TemplateNode next, int level, Pattern count, Pattern from, TemplateNode format, String lang, int letterValue, String groupingSeparator, int groupingSize) { super(children, next, format, lang, letterValue, groupingSeparator, groupingSize); this.level = level; this.count = count; this.from = from; }
NodeNumberNode(TemplateNode children, TemplateNode next, int level, Pattern count, Pattern from, TemplateNode format, String lang, int letterValue, String groupingSeparator, int groupingSize) { super(children, next, format, lang, letterValue, groupingSeparator, groupingSize); this.level = level; this.count = count; this.from = from; }
14,176
TemplateNode clone(Stylesheet stylesheet) { return new NodeNumberNode((children == null) ? null : children.clone(stylesheet), (next == null) ? null : next.clone(stylesheet), level, (count == null) ? null : (Pattern) count.clone(stylesheet), (from == null) ? from : (Pattern) from.clone(stylesheet), format, lang, letterValue, groupingSeparator, groupingSize); }
TemplateNode clone(Stylesheet stylesheet) { return new NodeNumberNode((children == null) ? null : children.clone(stylesheet), (next == null) ? null : next.clone(stylesheet), level, (count == null) ? null : (Pattern) count.clone(stylesheet), (from == null) ? from : (Pattern) from.clone(stylesheet), format, lang, letterValue, groupingSeparator, groupingSize); }
14,177
boolean countMatches(Node current, Node node) { if (count == null) { int cnt = current.getNodeType(); int nnt = node.getNodeType(); if (cnt != nnt) { return false; } if (nnt == Node.ELEMENT_NODE || nnt == Node.ATTRIBUTE_NODE) { String curi = current.getNamespaceURI(); String nuri = node.getNamespaceURI(); if ((curi == null && nuri != null) || (curi != null && !curi.equals(nuri))) { return false; } String cn = current.getLocalName(); String nn = current.getLocalName(); if (!cn.equals(nn)) { return false; } } return true; } else { return count.matches(node); } }
boolean countMatches(Node current, Node node) { if (count == null) { int cnt = current.getNodeType(); int nnt = node.getNodeType(); if (cnt != nnt) { return false; } if (nnt == Node.ELEMENT_NODE || nnt == Node.ATTRIBUTE_NODE) { String curi = current.getNamespaceURI(); String nuri = node.getNamespaceURI(); if ((curi == null && nuri != null) || (curi != null && !curi.equals(nuri))) { return false; } String cn = current.getLocalName(); if (cn == null) { cn = current.getNodeName(); } String nn = node.getLocalName(); if (nn == null) { nn = node.getNodeName(); } if (!cn.equals(nn)) { return false; } } return true; } else { return count.matches(node); } }
14,179
public byte[] getData(int tagSignature) { if (tagSignature == icSigHead) return header.getData(getSize()); TagEntry t = (TagEntry) tagTable.get(TagEntry.tagHashKey(tagSignature)); if (t == null) return null; return t.getData(); }
public byte[] getData() { if (tagSignature == icSigHead) return header.getData(getSize()); TagEntry t = (TagEntry) tagTable.get(TagEntry.tagHashKey(tagSignature)); if (t == null) return null; return t.getData(); }
14,180
public byte[] getData(int tagSignature) { if (tagSignature == icSigHead) return header.getData(getSize()); TagEntry t = (TagEntry) tagTable.get(TagEntry.tagHashKey(tagSignature)); if (t == null) return null; return t.getData(); }
public byte[] getData(int tagSignature) { if (tagSignature == icSigHead) return header.getData(getSize()); TagEntry t = (TagEntry) tagTable.get(TagEntry.tagHashKey(tagSignature)); if (t == null) return null; return t.getData(); }
14,181
public byte[] getData(int tagSignature) { if (tagSignature == icSigHead) return header.getData(getSize()); TagEntry t = (TagEntry) tagTable.get(TagEntry.tagHashKey(tagSignature)); if (t == null) return null; return t.getData(); }
public byte[] getData(int tagSignature) { if (tagSignature == icSigHead) return header.getData(getSize()); TagEntry t = (TagEntry) tagTable.get(TagEntry.tagHashKey(tagSignature)); if (t == null) return null; return t.getData(); }
14,182
private void _handleEndTag_remaining(TagElement tag) { HTML.Tag h = tag.getHTMLTag(); handleEndTag(tag); endTag(tag.fictional()); if (h.isPreformatted()) preformatted--; if (preformatted < 0) preformatted = 0; if (h == HTML.Tag.TITLE) { titleOpen = false; titleHandled = true; char[] a = new char[ title.length() ]; title.getChars(0, a.length, a, 0); handleTitle(a); } }
void _handleEndTag_remaining(TagElement tag) { HTML.Tag h = tag.getHTMLTag(); handleEndTag(tag); endTag(tag.fictional()); if (h.isPreformatted()) preformatted--; if (preformatted < 0) preformatted = 0; if (h == HTML.Tag.TITLE) { titleOpen = false; titleHandled = true; char[] a = new char[ title.length() ]; title.getChars(0, a.length, a, 0); handleTitle(a); } }
14,183
private void _handleStartTag(TagElement tag) { validator.openTag(tag, attributes); startingTag(tag); handleStartTag(tag); HTML.Tag h = tag.getHTMLTag(); if (h.isPreformatted()) preformatted++; if (h == HTML.Tag.TITLE) { if (titleHandled) error("Repetetive <TITLE> tag"); titleOpen = true; titleHandled = false; } }
void _handleStartTag(TagElement tag) { validator.openTag(tag, attributes); startingTag(tag); handleStartTag(tag); HTML.Tag h = tag.getHTMLTag(); if (h.isPreformatted()) preformatted++; if (h == HTML.Tag.TITLE) { if (titleHandled) error("Repetetive <TITLE> tag"); titleOpen = true; titleHandled = false; } }
14,184
TemplateNode clone(Stylesheet stylesheet) { TemplateNode ret = new OtherwiseNode(); if (children != null) { ret.children = children.clone(stylesheet); } if (next != null) { ret.next = next.clone(stylesheet); } return ret; }
TemplateNode clone(Stylesheet stylesheet) TemplateNode ret = new OtherwiseNode(); if (children != null) ret.children = children.clone(stylesheet); } if (next != null) ret.next = next.clone(stylesheet); } return ret; }
14,185
TemplateNode clone(Stylesheet stylesheet) { TemplateNode ret = new OtherwiseNode(); if (children != null) { ret.children = children.clone(stylesheet); } if (next != null) { ret.next = next.clone(stylesheet); } return ret; }
TemplateNode clone(Stylesheet stylesheet) { TemplateNode ret = new OtherwiseNode(); if (children != null) { ret.children = children.clone(stylesheet); if (next != null) { ret.next = next.clone(stylesheet); return ret;
14,186
void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { if (children != null) { children.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } if (next != null) { next.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } }
void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException if (children != null) children.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } if (next != null) next.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } }
14,187
void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { if (children != null) { children.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } if (next != null) { next.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } }
void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { if (children != null) { children.apply(stylesheet, mode, context, pos, len, parent, nextSibling); if (next != null) { next.apply(stylesheet, mode, context, pos, len, parent, nextSibling);
14,188
public String toString() { StringBuffer buf = new StringBuffer(getClass().getName()); buf.append('['); buf.append(']'); return buf.toString(); }
public String toString() { StringBuffer buf = new StringBuffer(getClass().getName()); buf.append('['); buf.append(']'); return buf.toString(); }
14,189
public Expr clone(Object context) { NamespaceContext n = nsctx; if (context instanceof NamespaceContext) { n = (NamespaceContext) context; } FunctionAvailableFunction f = new FunctionAvailableFunction(n); int len = args.size(); List args2 = new ArrayList(len); for (int i = 0; i < len; i++) { args2.add(((Expr) args.get(i)).clone(context)); } f.setArguments(args2); return f; }
public Expr clone(Object context) NamespaceContext n = nsctx; if (context instanceof NamespaceContext) n = (NamespaceContext) context; } FunctionAvailableFunction f = new FunctionAvailableFunction(n); int len = args.size(); List args2 = new ArrayList(len); for (int i = 0; i < len; i++) args2.add(((Expr) args.get(i)).clone(context)); } f.setArguments(args2); return f; }
14,190
public Expr clone(Object context) { NamespaceContext n = nsctx; if (context instanceof NamespaceContext) { n = (NamespaceContext) context; } FunctionAvailableFunction f = new FunctionAvailableFunction(n); int len = args.size(); List args2 = new ArrayList(len); for (int i = 0; i < len; i++) { args2.add(((Expr) args.get(i)).clone(context)); } f.setArguments(args2); return f; }
public Expr clone(Object context) { NamespaceContext n = nsctx; if (context instanceof NamespaceContext) { n = (NamespaceContext) context; FunctionAvailableFunction f = new FunctionAvailableFunction(n); int len = args.size(); List args2 = new ArrayList(len); for (int i = 0; i < len; i++) { args2.add(((Expr) args.get(i)).clone(context)); f.setArguments(args2); return f;
14,191
public CharacterBreakIterator () { iter = null; // FIXME? }
public CharacterBreakIterator () { // FIXME? }
14,192
protected CoderResult decodeLoop (ByteBuffer in, CharBuffer out) { // TODO: Optimize this in the case in.hasArray() / out.hasArray() int inPos = 0; try { while (in.hasRemaining ()) { char c; byte b1 = in.get (); int highNibble = (b1 >> 4) & 0xF; switch (highNibble) { case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: if (out.remaining () < 1) return CoderResult.OVERFLOW; out.put ((char) b1); inPos++; break; case 0xC: case 0xD: byte b2; if (in.remaining () < 1) return CoderResult.UNDERFLOW; if (out.remaining () < 1) return CoderResult.OVERFLOW; if (!isContinuation (b2 = in.get ())) return CoderResult.malformedForLength (1); c = (char) (((b1 & 0x1F) << 6) | (b2 & 0x3F)); // check that we had the shortest encoding if (c <= 0x7F) return CoderResult.malformedForLength (2); out.put (c); inPos += 2; break; case 0xE: byte b3; if (in.remaining () < 2) return CoderResult.UNDERFLOW; if (out.remaining () < 1) return CoderResult.OVERFLOW; if (!isContinuation (b2 = in.get ())) return CoderResult.malformedForLength (1); if (!isContinuation (b3 = in.get ())) return CoderResult.malformedForLength (1); c = (char) (((b1 & 0x0F) << 12) | ((b2 & 0x3F) << 6) | (b3 & 0x3F)); // check that we had the shortest encoding if (c <= 0x7FF) return CoderResult.malformedForLength (3); out.put (c); inPos += 3; break; default: return CoderResult.malformedForLength (1); } } return CoderResult.UNDERFLOW; } finally { // In case we did a get(), then encountered an error, reset the // position to before the error. If there was no error, this // will benignly reset the position to the value it already has. in.position (inPos); } }
protected CoderResult decodeLoop (ByteBuffer in, CharBuffer out) { // TODO: Optimize this in the case in.hasArray() / out.hasArray() int inPos = in.position(); try { while (in.hasRemaining ()) { char c; byte b1 = in.get (); int highNibble = (b1 >> 4) & 0xF; switch (highNibble) { case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: if (out.remaining () < 1) return CoderResult.OVERFLOW; out.put ((char) b1); inPos++; break; case 0xC: case 0xD: byte b2; if (in.remaining () < 1) return CoderResult.UNDERFLOW; if (out.remaining () < 1) return CoderResult.OVERFLOW; if (!isContinuation (b2 = in.get ())) return CoderResult.malformedForLength (1); c = (char) (((b1 & 0x1F) << 6) | (b2 & 0x3F)); // check that we had the shortest encoding if (c <= 0x7F) return CoderResult.malformedForLength (2); out.put (c); inPos += 2; break; case 0xE: byte b3; if (in.remaining () < 2) return CoderResult.UNDERFLOW; if (out.remaining () < 1) return CoderResult.OVERFLOW; if (!isContinuation (b2 = in.get ())) return CoderResult.malformedForLength (1); if (!isContinuation (b3 = in.get ())) return CoderResult.malformedForLength (1); c = (char) (((b1 & 0x0F) << 12) | ((b2 & 0x3F) << 6) | (b3 & 0x3F)); // check that we had the shortest encoding if (c <= 0x7FF) return CoderResult.malformedForLength (3); out.put (c); inPos += 3; break; default: return CoderResult.malformedForLength (1); } } return CoderResult.UNDERFLOW; } finally { // In case we did a get(), then encountered an error, reset the // position to before the error. If there was no error, this // will benignly reset the position to the value it already has. in.position (inPos); } }
14,193
protected CoderResult encodeLoop (CharBuffer in, ByteBuffer out) { int inPos = 0; try { // TODO: Optimize this in the case in.hasArray() / out.hasArray() while (in.hasRemaining ()) { int remaining = out.remaining (); char c = in.get (); // UCS-4 range (hex.) UTF-8 octet sequence (binary) // 0000 0000-0000 007F 0xxxxxxx // 0000 0080-0000 07FF 110xxxxx 10xxxxxx // 0000 0800-0000 FFFF 1110xxxx 10xxxxxx 10xxxxxx // Scalar Value UTF-16 byte 1 byte 2 byte 3 byte 4 // 0000 0000 0xxx xxxx 0000 0000 0xxx xxxx 0xxx xxxx // 0000 0yyy yyxx xxxx 0000 0yyy yyxx xxxx 110y yyyy 10xx xxxx // zzzz yyyy yyxx xxxx zzzz yyyy yyxx xxxx 1110 zzzz 10yy yyyy 10xx xxxx // u uuuu zzzz yyyy yyxx xxxx 1101 10ww wwzz zzyy 1111 0uuu 10uu zzzz 10yy yyyy 10xx xxxx // + 1101 11yy yyxx xxxx // Note: uuuuu = wwww + 1 if (c <= 0x7F) { if (remaining < 1) return CoderResult.OVERFLOW; out.put ((byte) c); inPos++; } else if (c <= 0x7FF) { if (remaining < 2) return CoderResult.OVERFLOW; out.put ((byte) (0xC0 | (c >> 6))); out.put ((byte) (0x80 | (c & 0x3F))); inPos++; } else if (0xD800 <= c && c <= 0xDFFF) { if (remaining < 4) return CoderResult.OVERFLOW; // we got a low surrogate without a preciding high one if (c > 0xDBFF) return CoderResult.malformedForLength (1); // high surrogates if (!in.hasRemaining ()) return CoderResult.UNDERFLOW; char d = in.get (); // make sure d is a low surrogate if (d < 0xDC00 || d > 0xDFFF) return CoderResult.malformedForLength (1); // make the 32 bit value // int value2 = (c - 0xD800) * 0x400 + (d - 0xDC00) + 0x10000; int value = (((c & 0x3FF) << 10) | (d & 0x3FF)) + 0x10000; // assert value == value2; out.put ((byte) (0xF0 | (value >> 18))); out.put ((byte) (0x80 | ((value >> 12) & 0x3F))); out.put ((byte) (0x80 | ((value >> 6) & 0x3F))); out.put ((byte) (0x80 | ((value ) & 0x3F))); inPos += 2; } else { if (remaining < 3) return CoderResult.OVERFLOW; out.put ((byte) (0xE0 | (c >> 12))); out.put ((byte) (0x80 | ((c >> 6) & 0x3F))); out.put ((byte) (0x80 | (c & 0x3F))); inPos++; } } return CoderResult.UNDERFLOW; } finally { // In case we did a get(), then encountered an error, reset the // position to before the error. If there was no error, this // will benignly reset the position to the value it already has. in.position (inPos); } }
protected CoderResult encodeLoop (CharBuffer in, ByteBuffer out) { int inPos = in.position(); try { // TODO: Optimize this in the case in.hasArray() / out.hasArray() while (in.hasRemaining ()) { int remaining = out.remaining (); char c = in.get (); // UCS-4 range (hex.) UTF-8 octet sequence (binary) // 0000 0000-0000 007F 0xxxxxxx // 0000 0080-0000 07FF 110xxxxx 10xxxxxx // 0000 0800-0000 FFFF 1110xxxx 10xxxxxx 10xxxxxx // Scalar Value UTF-16 byte 1 byte 2 byte 3 byte 4 // 0000 0000 0xxx xxxx 0000 0000 0xxx xxxx 0xxx xxxx // 0000 0yyy yyxx xxxx 0000 0yyy yyxx xxxx 110y yyyy 10xx xxxx // zzzz yyyy yyxx xxxx zzzz yyyy yyxx xxxx 1110 zzzz 10yy yyyy 10xx xxxx // u uuuu zzzz yyyy yyxx xxxx 1101 10ww wwzz zzyy 1111 0uuu 10uu zzzz 10yy yyyy 10xx xxxx // + 1101 11yy yyxx xxxx // Note: uuuuu = wwww + 1 if (c <= 0x7F) { if (remaining < 1) return CoderResult.OVERFLOW; out.put ((byte) c); inPos++; } else if (c <= 0x7FF) { if (remaining < 2) return CoderResult.OVERFLOW; out.put ((byte) (0xC0 | (c >> 6))); out.put ((byte) (0x80 | (c & 0x3F))); inPos++; } else if (0xD800 <= c && c <= 0xDFFF) { if (remaining < 4) return CoderResult.OVERFLOW; // we got a low surrogate without a preciding high one if (c > 0xDBFF) return CoderResult.malformedForLength (1); // high surrogates if (!in.hasRemaining ()) return CoderResult.UNDERFLOW; char d = in.get (); // make sure d is a low surrogate if (d < 0xDC00 || d > 0xDFFF) return CoderResult.malformedForLength (1); // make the 32 bit value // int value2 = (c - 0xD800) * 0x400 + (d - 0xDC00) + 0x10000; int value = (((c & 0x3FF) << 10) | (d & 0x3FF)) + 0x10000; // assert value == value2; out.put ((byte) (0xF0 | (value >> 18))); out.put ((byte) (0x80 | ((value >> 12) & 0x3F))); out.put ((byte) (0x80 | ((value >> 6) & 0x3F))); out.put ((byte) (0x80 | ((value ) & 0x3F))); inPos += 2; } else { if (remaining < 3) return CoderResult.OVERFLOW; out.put ((byte) (0xE0 | (c >> 12))); out.put ((byte) (0x80 | ((c >> 6) & 0x3F))); out.put ((byte) (0x80 | (c & 0x3F))); inPos++; } } return CoderResult.UNDERFLOW; } finally { // In case we did a get(), then encountered an error, reset the // position to before the error. If there was no error, this // will benignly reset the position to the value it already has. in.position (inPos); } }
14,194
public final void requestFocus() { jComponent.requestFocus(); // save old focus component SwingComponentPeer oldFocusPeer; Component fc = toolkit.getFocusHandler().getFocusedComponent(); if (fc != null) { oldFocusPeer = (SwingComponentPeer) fc.getPeer(); } else { oldFocusPeer = null; } // set new focus toolkit.getFocusHandler().setFocusedComponent((Component) component); // redraw new and (if necessary) old focus component // Note that Window derived classes can also request // focus, but are not traversable to focus. if (oldFocusPeer != null && oldFocusPeer.isFocusTraversable()) { oldFocusPeer.paintAWTComponent(); } if (isFocusTraversable()) { paintAWTComponent(); } }
public final void requestFocus() { jComponent.requestFocus(); // save old focus component SwingComponentPeer oldFocusPeer; Component fc = toolkit.getFocusHandler().getFocusedComponent(); if (fc != null) { oldFocusPeer = (SwingComponentPeer) fc.getPeer(); } else { oldFocusPeer = null; } // set new focus toolkit.getFocusHandler().setFocusedComponent((Component) component); // redraw new and (if necessary) old focus component // Note that Window derived classes can also request // focus, but are not traversable to focus. if (oldFocusPeer != null && oldFocusPeer.isFocusTraversable()) { } if (isFocusTraversable()) { paintAWTComponent(); } }
14,196
public final void requestFocus() { jComponent.requestFocus(); // save old focus component SwingComponentPeer oldFocusPeer; Component fc = toolkit.getFocusHandler().getFocusedComponent(); if (fc != null) { oldFocusPeer = (SwingComponentPeer) fc.getPeer(); } else { oldFocusPeer = null; } // set new focus toolkit.getFocusHandler().setFocusedComponent((Component) component); // redraw new and (if necessary) old focus component // Note that Window derived classes can also request // focus, but are not traversable to focus. if (oldFocusPeer != null && oldFocusPeer.isFocusTraversable()) { oldFocusPeer.paintAWTComponent(); } if (isFocusTraversable()) { paintAWTComponent(); } }
public final void requestFocus() { jComponent.requestFocus(); // save old focus component SwingComponentPeer oldFocusPeer; Component fc = toolkit.getFocusHandler().getFocusedComponent(); if (fc != null) { oldFocusPeer = (SwingComponentPeer) fc.getPeer(); } else { oldFocusPeer = null; } // set new focus toolkit.getFocusHandler().setFocusedComponent((Component) component); // redraw new and (if necessary) old focus component // Note that Window derived classes can also request // focus, but are not traversable to focus. if (oldFocusPeer != null && oldFocusPeer.isFocusTraversable()) { oldFocusPeer. } if (isFocusTraversable()) { } }
14,197
public synchronized void unloadPlugin(String pluginId) throws PluginException { final SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(PluginSecurityConstants.UNLOAD_PERM); } final PluginDescriptorModel descr = (PluginDescriptorModel)getPluginDescriptor(pluginId); if (descr != null) { if (descr.isSystemPlugin()) { throw new PluginException( "Cannot unload a system plugin"); } // Unload all plugins that depend on this plugin final ArrayList descriptors = new ArrayList(descriptorMap.values()); for (Iterator i = descriptors.iterator(); i.hasNext();) { final PluginDescriptor dep = (PluginDescriptor) i.next(); if (dep.depends(pluginId)) { unloadPlugin(dep.getId()); } } // Now remove it descr.unresolve(this); } }
public synchronized void unloadPlugin(String pluginId) throws PluginException { final SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(PluginSecurityConstants.UNLOAD_PERM); } final PluginDescriptorModel descr = (PluginDescriptorModel)getPluginDescriptor(pluginId); if (descr != null) { if (descr.isSystemPlugin()) { throw new PluginException( "Cannot unload a system plugin: "+pluginId); } // Unload all plugins that depend on this plugin final ArrayList descriptors = new ArrayList(descriptorMap.values()); for (Iterator i = descriptors.iterator(); i.hasNext();) { final PluginDescriptor dep = (PluginDescriptor) i.next(); if (dep.depends(pluginId)) { unloadPlugin(dep.getId()); } } // Now remove it descr.unresolve(this); } }
14,198
public final void cancel () { if (ok) selector ().selectedKeys ().add (this); ok = false; }
public final void cancel () { if (ok) selector ().selectedKeys ().add (this); ok = false; }
14,199
public final boolean isValid () { return ok; }
public final boolean isValid () { return ! cancelled; }
14,200
public static ComponentUI createUI(JComponent component) { if (instances == null) instances = new HashMap(); Object o = instances.get(component); MetalTabbedPaneUI instance; if (o == null) { instance = new MetalTabbedPaneUI(); instances.put(component, instance); } else instance = (MetalTabbedPaneUI) o; return instance; }
public static ComponentUI createUI(JComponent component) { if (instances == null) instances = new HashMap(); Object o = instances.get(component); MetalTabbedPaneUI instance; if (o == null) { instance = new MetalTabbedPaneUI(); instances.put(component, instance); } else instance = (MetalTabbedPaneUI) o; return instance; }
14,201
public final InputMap getInputMap(int condition) { enableEvents(AWTEvent.KEY_EVENT_MASK); switch (condition) { case WHEN_FOCUSED: if (inputMap_whenFocused == null) inputMap_whenFocused = new InputMap(); return inputMap_whenFocused; case WHEN_ANCESTOR_OF_FOCUSED_COMPONENT: if (inputMap_whenAncestorOfFocused == null) inputMap_whenAncestorOfFocused = new InputMap(); return inputMap_whenAncestorOfFocused; case WHEN_IN_FOCUSED_WINDOW: if (inputMap_whenInFocusedWindow == null) inputMap_whenInFocusedWindow = new ComponentInputMap(this); return inputMap_whenInFocusedWindow; case UNDEFINED_CONDITION: default: return null; } }
public final InputMap getInputMap(int condition) { enableEvents(AWTEvent.KEY_EVENT_MASK); switch (condition) { case WHEN_FOCUSED: if (inputMap_whenFocused == null) inputMap_whenFocused = new InputMap(); return inputMap_whenFocused; case WHEN_ANCESTOR_OF_FOCUSED_COMPONENT: if (inputMap_whenAncestorOfFocused == null) inputMap_whenAncestorOfFocused = new InputMap(); return inputMap_whenAncestorOfFocused; case WHEN_IN_FOCUSED_WINDOW: if (inputMap_whenInFocusedWindow == null) inputMap_whenInFocusedWindow = new ComponentInputMap(this); return inputMap_whenInFocusedWindow; case UNDEFINED_CONDITION: default: throw new IllegalArgumentException("Invalid 'condition' argument: " + condition); } }
14,202
private void paintChildrenOptimized(Graphics g) { Shape originalClip = g.getClip(); Rectangle inner = SwingUtilities.calculateInnerArea(this, rectCache); g.clipRect(inner.x, inner.y, inner.width, inner.height); Component[] children = getComponents(); // paintingTile becomes true just before we start painting the component's // children. paintingTile = true; for (int i = children.length - 1; i >= 0; i--) //children.length; i++) { // paintingTile must be set to false before we begin to start painting // the last tile. if (i == children.length - 1) paintingTile = false; if (!children[i].isVisible()) continue; Rectangle bounds = children[i].getBounds(rectCache); Rectangle oldClip = g.getClipBounds(); if (oldClip == null) oldClip = bounds; if (!g.hitClip(bounds.x, bounds.y, bounds.width, bounds.height)) continue; boolean translated = false; try { g.clipRect(bounds.x, bounds.y, bounds.width, bounds.height); g.translate(bounds.x, bounds.y); translated = true; children[i].paint(g); } finally { if (translated) g.translate(-bounds.x, -bounds.y); g.setClip(oldClip); } } g.setClip(originalClip); }
private void paintChildrenOptimized(Graphics g) { Shape originalClip = g.getClip(); Rectangle inner = SwingUtilities.calculateInnerArea(this, rectCache); g.clipRect(inner.x, inner.y, inner.width, inner.height); Component[] children = getComponents(); // paintingTile becomes true just before we start painting the component's // children. paintingTile = true; for (int i = children.length - 1; i >= 0; i--) //children.length; i++) { // paintingTile must be set to false before we begin to start painting // the last tile. if (i == children.length - 1) paintingTile = false; if (!children[i].isVisible()) continue; Rectangle bounds = children[i].getBounds(rectCache); Rectangle oldClip = g.getClipBounds(); if (oldClip == null) oldClip = bounds; if (!g.hitClip(bounds.x, bounds.y, bounds.width, bounds.height)) continue; boolean translated = false; try { g.clipRect(bounds.x, bounds.y, bounds.width, bounds.height); g.translate(bounds.x, bounds.y); translated = true; children[i].paint(g); } finally { if (translated) g.translate(-bounds.x, -bounds.y); g.setClip(oldClip); } } g.setClip(originalClip); }
14,203
private void paintDoubleBuffered(Rectangle r) { RepaintManager rm = RepaintManager.currentManager(this); // Paint on the offscreen buffer. Component root = getRoot(this); Image buffer = rm.getOffscreenBuffer(this, root.getWidth(), root.getHeight()); //Rectangle targetClip = SwingUtilities.convertRectangle(this, r, root); Point translation = SwingUtilities.convertPoint(this, 0, 0, root); Graphics g2 = buffer.getGraphics(); g2.translate(translation.x, translation.y); g2.setClip(r.x, r.y, r.width, r.height); g2 = getComponentGraphics(g2); isPaintingDoubleBuffered = true; try { paint(g2); } finally { isPaintingDoubleBuffered = false; g2.dispose(); } // Paint the buffer contents on screen. rm.commitBuffer(root, new Rectangle(translation.x + r.x, translation.y + r.y, r.width, r.height)); }
private void paintDoubleBuffered(Rectangle r) { RepaintManager rm = RepaintManager.currentManager(this); // Paint on the offscreen buffer. Component root = getRoot(this); Image buffer = rm.getVolatileOffscreenBuffer(this, root.getWidth(), root.getHeight()); //Rectangle targetClip = SwingUtilities.convertRectangle(this, r, root); Point translation = SwingUtilities.convertPoint(this, 0, 0, root); Graphics g2 = buffer.getGraphics(); g2.translate(translation.x, translation.y); g2.setClip(r.x, r.y, r.width, r.height); g2 = getComponentGraphics(g2); isPaintingDoubleBuffered = true; try { paint(g2); } finally { isPaintingDoubleBuffered = false; g2.dispose(); } // Paint the buffer contents on screen. rm.commitBuffer(root, new Rectangle(translation.x + r.x, translation.y + r.y, r.width, r.height)); }
14,204
public DebugGraphics(Graphics graphics) { // TODO } // DebugGraphics()
public DebugGraphics() { // TODO } // DebugGraphics()
14,206
public DOMResult() { } // DOMResult()
public DOMResult() { } // DOMResult()
14,208
public void setSystemId(String systemID) { this.systemId = systemID; } // systemID()
public void setSystemId(String systemID) { this.systemId = systemID; } // systemID()
14,209
static void fillMetalPattern(Graphics g, int x, int y, int w, int h, Color light, Color dark) { int xOff = 0; for (int mY = y; mY < (y + h); mY++) { // set color alternating with every line if (((mY - y) % 2) == 0) g.setColor(light); else g.setColor(dark); for (int mX = x + (xOff); mX < (x + w); mX += 4) { g.drawLine(mX, mY, mX, mY); } // increase x offset xOff++; if (xOff > 3) xOff = 0; } }
static void fillMetalPattern(Component c, Graphics g, int x, int y, int w, int h, Color light, Color dark) { int xOff = 0; for (int mY = y; mY < (y + h); mY++) { // set color alternating with every line if (((mY - y) % 2) == 0) g.setColor(light); else g.setColor(dark); for (int mX = x + (xOff); mX < (x + w); mX += 4) { g.drawLine(mX, mY, mX, mY); } // increase x offset xOff++; if (xOff > 3) xOff = 0; } }
14,211
static void fillMetalPattern(Graphics g, int x, int y, int w, int h, Color light, Color dark) { int xOff = 0; for (int mY = y; mY < (y + h); mY++) { // set color alternating with every line if (((mY - y) % 2) == 0) g.setColor(light); else g.setColor(dark); for (int mX = x + (xOff); mX < (x + w); mX += 4) { g.drawLine(mX, mY, mX, mY); } // increase x offset xOff++; if (xOff > 3) xOff = 0; } }
static void fillMetalPattern(Graphics g, int x, int y, int w, int h, Color light, Color dark) { int xOff = 0; for (int mY = y; mY < (y + h); mY++) { // set color alternating with every line if (((mY - y) % 2) == 0) g.setColor(light); else g.setColor(dark); for (int mX = x + (xOff); mX < (x + w); mX += 4) { g.drawLine(mX, mY, mX, mY); } // increase x offset xOff++; if (xOff > 3) xOff = 0; } }
14,212
static void fillMetalPattern(Graphics g, int x, int y, int w, int h, Color light, Color dark) { int xOff = 0; for (int mY = y; mY < (y + h); mY++) { // set color alternating with every line if (((mY - y) % 2) == 0) g.setColor(light); else g.setColor(dark); for (int mX = x + (xOff); mX < (x + w); mX += 4) { g.drawLine(mX, mY, mX, mY); } // increase x offset xOff++; if (xOff > 3) xOff = 0; } }
static void fillMetalPattern(Graphics g, int x, int y, int w, int h, Color light, Color dark) { int xOff = 0; for (int mY = y; mY < (y + h); mY++) { // set color alternating with every line if (((mY - y) % 2) == 0) g.setColor(light); else g.setColor(dark); for (int mX = x + (xOff); mX < (x + w); mX += 4) { g.drawLine(mX, mY, mX, mY); } // increase x offset xOff++; if (xOff > 3) xOff = 0; } }
14,213
static void fillMetalPattern(Graphics g, int x, int y, int w, int h, Color light, Color dark) { int xOff = 0; for (int mY = y; mY < (y + h); mY++) { // set color alternating with every line if (((mY - y) % 2) == 0) g.setColor(light); else g.setColor(dark); for (int mX = x + (xOff); mX < (x + w); mX += 4) { g.drawLine(mX, mY, mX, mY); } // increase x offset xOff++; if (xOff > 3) xOff = 0; } }
static void fillMetalPattern(Graphics g, int x, int y, int w, int h, Color light, Color dark) { int xOff = 0; for (int mY = y; mY < (y + h); mY++) { // set color alternating with every line if (((mY - y) % 2) == 0) g.setColor(light); else g.setColor(dark); for (int mX = x + (xOff); mX < (x + w); mX += 4) { g.drawLine(mX, mY, mX, mY); } // increase x offset xOff++; if (xOff > 3) xOff = 0; } }
14,214
static void fillMetalPattern(Graphics g, int x, int y, int w, int h, Color light, Color dark) { int xOff = 0; for (int mY = y; mY < (y + h); mY++) { // set color alternating with every line if (((mY - y) % 2) == 0) g.setColor(light); else g.setColor(dark); for (int mX = x + (xOff); mX < (x + w); mX += 4) { g.drawLine(mX, mY, mX, mY); } // increase x offset xOff++; if (xOff > 3) xOff = 0; } }
static void fillMetalPattern(Graphics g, int x, int y, int w, int h, Color light, Color dark) { int xOff = 0; for (int mY = y; mY < (y + h); mY++) { // set color alternating with every line if (((mY - y) % 2) == 0) g.setColor(light); else g.setColor(dark); for (int mX = x + (xOff); mX < (x + w); mX += 4) { g.drawLine(mX, mY, mX, mY); } // increase x offset xOff++; if (xOff > 3) xOff = 0; } }
14,215
public void installUI(JComponent c) { prepareForUIInstall(); super.installUI(c); tree = (JTree) c; installDefaults(); installComponents(); setCellEditor(createDefaultCellEditor()); createdCellEditor = true; isEditing = false; TreeModel mod = tree.getModel(); setModel(mod); tree.setRootVisible(true); if (mod != null) tree.expandPath(new TreePath(mod.getRoot())); treeSelectionModel = tree.getSelectionModel(); installKeyboardActions(); installListeners(); completeUIInstall(); }
public void installUI(JComponent c) { prepareForUIInstall(); super.installUI(c); tree = (JTree) c; installDefaults(); installComponents(); setCellEditor(createDefaultCellEditor()); createdCellEditor = true; isEditing = false; TreeModel mod = tree.getModel(); setModel(mod); if (mod != null) tree.expandPath(new TreePath(mod.getRoot())); treeSelectionModel = tree.getSelectionModel(); installKeyboardActions(); installListeners(); completeUIInstall(); }
14,216
int paintControlIcons(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object node) { int h = descent; int rowHeight = getRowHeight(); TreePath path = new TreePath(getPathToRoot(node, 0)); Icon icon = getCurrentControlIcon(path); Rectangle clip = g.getClipBounds(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; if (mod.isLeaf(node)) descent += rowHeight; else { if (depth > 0 || tree.isRootVisible()) descent += rowHeight; int max = 0; if (!mod.isLeaf(node)) max = mod.getChildCount(node); if (!node.equals(mod.getRoot())) icon.paintIcon(tree, g, indentation - rightChildIndent - 3, h); if (tree.isExpanded(path)) { for (int i = 0; i < max; i++) { int indent = indentation + rightChildIndent; if (depth == 0 && !tree.isRootVisible()) indent = -1; descent = paintControlIcons(g, indent, descent, i, depth + 1, tree, mod, mod.getChild(node, i)); } } } return descent; }
int paintControlIcons(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object node) { int h = descent; int rowHeight = getRowHeight(); TreePath path = new TreePath(getPathToRoot(node, 0)); Icon icon = getCurrentControlIcon(path); Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; if (mod.isLeaf(node)) descent += rowHeight; else { if (depth > 0 || tree.isRootVisible()) descent += rowHeight; int max = 0; if (!mod.isLeaf(node)) max = mod.getChildCount(node); if (!node.equals(mod.getRoot())) icon.paintIcon(tree, g, indentation - rightChildIndent - 3, h); if (tree.isExpanded(path)) { for (int i = 0; i < max; i++) { int indent = indentation + rightChildIndent; if (depth == 0 && !tree.isRootVisible()) indent = -1; descent = paintControlIcons(g, indent, descent, i, depth + 1, tree, mod, mod.getChild(node, i)); } } } return descent; }
14,217
private String getDefaultDisplayName(boolean dst) { int offset = getRawOffset(); if (dst && this instanceof SimpleTimeZone) { // ugly, but this is a design failure of the API: // getDisplayName takes a dst parameter even though // TimeZone knows nothing about daylight saving offsets. offset += ((SimpleTimeZone) this).getDSTSavings(); } StringBuffer sb = new StringBuffer(9); sb.append("GMT"); sb.append(offset >= 0 ? '+' : '-'); offset = Math.abs(offset) / (1000 * 60); int hours = offset / 60; int minutes = offset % 60; sb.append((char) ('0' + hours / 10)).append((char) ('0' + hours % 10)); sb.append(':'); sb.append((char) ('0' + minutes / 10)).append((char) ('0' + minutes % 10)); return sb.toString(); }
private String getDefaultDisplayName(boolean dst) { int offset = getRawOffset(); if (dst && this instanceof SimpleTimeZone) { // ugly, but this is a design failure of the API: // getDisplayName takes a dst parameter even though // TimeZone knows nothing about daylight saving offsets. offset += ((SimpleTimeZone) this).getDSTSavings(); } StringBuffer sb = new StringBuffer(9); sb.append("GMT"); offset = Math.abs(offset) / (1000 * 60); int hours = offset / 60; int minutes = offset % 60; sb.append((char) ('0' + hours / 10)).append((char) ('0' + hours % 10)); sb.append(':'); sb.append((char) ('0' + minutes / 10)).append((char) ('0' + minutes % 10)); return sb.toString(); }
14,218
private String getDefaultDisplayName(boolean dst) { int offset = getRawOffset(); if (dst && this instanceof SimpleTimeZone) { // ugly, but this is a design failure of the API: // getDisplayName takes a dst parameter even though // TimeZone knows nothing about daylight saving offsets. offset += ((SimpleTimeZone) this).getDSTSavings(); } StringBuffer sb = new StringBuffer(9); sb.append("GMT"); sb.append(offset >= 0 ? '+' : '-'); offset = Math.abs(offset) / (1000 * 60); int hours = offset / 60; int minutes = offset % 60; sb.append((char) ('0' + hours / 10)).append((char) ('0' + hours % 10)); sb.append(':'); sb.append((char) ('0' + minutes / 10)).append((char) ('0' + minutes % 10)); return sb.toString(); }
private String getDefaultDisplayName(boolean dst) { int offset = getRawOffset(); if (dst && this instanceof SimpleTimeZone) { // ugly, but this is a design failure of the API: // getDisplayName takes a dst parameter even though // TimeZone knows nothing about daylight saving offsets. offset += ((SimpleTimeZone) this).getDSTSavings(); } StringBuffer sb = new StringBuffer(9); sb.append("GMT"); sb.append(offset >= 0 ? '+' : '-'); offset = Math.abs(offset) / (1000 * 60); int hours = offset / 60; int minutes = offset % 60; sb.append((char) ('0' + hours / 10)).append((char) ('0' + hours % 10)); sb.append(':'); sb.append((char) ('0' + minutes / 10)).append((char) ('0' + minutes % 10)); return sb.toString(); }
14,219
private String getDefaultDisplayName(boolean dst) { int offset = getRawOffset(); if (dst && this instanceof SimpleTimeZone) { // ugly, but this is a design failure of the API: // getDisplayName takes a dst parameter even though // TimeZone knows nothing about daylight saving offsets. offset += ((SimpleTimeZone) this).getDSTSavings(); } StringBuffer sb = new StringBuffer(9); sb.append("GMT"); sb.append(offset >= 0 ? '+' : '-'); offset = Math.abs(offset) / (1000 * 60); int hours = offset / 60; int minutes = offset % 60; sb.append((char) ('0' + hours / 10)).append((char) ('0' + hours % 10)); sb.append(':'); sb.append((char) ('0' + minutes / 10)).append((char) ('0' + minutes % 10)); return sb.toString(); }
private String getDefaultDisplayName(boolean dst) { int offset = getRawOffset(); if (dst && this instanceof SimpleTimeZone) { // ugly, but this is a design failure of the API: // getDisplayName takes a dst parameter even though // TimeZone knows nothing about daylight saving offsets. offset += ((SimpleTimeZone) this).getDSTSavings(); } StringBuffer sb = new StringBuffer(9); sb.append("GMT"); sb.append(offset >= 0 ? '+' : '-'); offset = Math.abs(offset) / (1000 * 60); int hours = offset / 60; int minutes = offset % 60; if (minutes != 0 || hours != 0) { sb.append(offset >= 0 ? '+' : '-'); sb.append((char) ('0' + hours / 10)); sb.append((char) ('0' + hours % 10)); sb.append(':'); sb.append((char) ('0' + minutes / 10)).append((char) ('0' + minutes % 10)); return sb.toString(); }
14,220
private String getDefaultDisplayName(boolean dst) { int offset = getRawOffset(); if (dst && this instanceof SimpleTimeZone) { // ugly, but this is a design failure of the API: // getDisplayName takes a dst parameter even though // TimeZone knows nothing about daylight saving offsets. offset += ((SimpleTimeZone) this).getDSTSavings(); } StringBuffer sb = new StringBuffer(9); sb.append("GMT"); sb.append(offset >= 0 ? '+' : '-'); offset = Math.abs(offset) / (1000 * 60); int hours = offset / 60; int minutes = offset % 60; sb.append((char) ('0' + hours / 10)).append((char) ('0' + hours % 10)); sb.append(':'); sb.append((char) ('0' + minutes / 10)).append((char) ('0' + minutes % 10)); return sb.toString(); }
private String getDefaultDisplayName(boolean dst) { int offset = getRawOffset(); if (dst && this instanceof SimpleTimeZone) { // ugly, but this is a design failure of the API: // getDisplayName takes a dst parameter even though // TimeZone knows nothing about daylight saving offsets. offset += ((SimpleTimeZone) this).getDSTSavings(); } StringBuffer sb = new StringBuffer(9); sb.append("GMT"); sb.append(offset >= 0 ? '+' : '-'); offset = Math.abs(offset) / (1000 * 60); int hours = offset / 60; int minutes = offset % 60; sb.append((char) ('0' + hours / 10)).append((char) ('0' + hours % 10)); sb.append(':'); sb.append((char) ('0' + minutes / 10)); sb.append((char) ('0' + minutes % 10)); } return sb.toString(); }
14,221
private void addColorToQueue(Color c) { if (--start == -1) start = numRows * numCols - 1; colors[start] = c; }
void addColorToQueue(Color c) { if (--start == -1) start = numRows * numCols - 1; colors[start] = c; }
14,222
public Thread[] threads() { Thread[] result = new Thread[threadsCount()]; Enumeration e = threads.elements(); for (int n = 0; e.hasMoreElements(); n++) result[n] = (Thread) e.nextElement(); return result; }
public Thread[] threads() { Thread[] result = new Thread[threadsCount()]; Enumeration e = threads.elements(); for (int n = 0; e.hasMoreElements(); n++) result[n] = (Thread) e.nextElement(); return result; }
14,223
public SinkChannelImpl (SelectorProvider selectorProvider, int native_fd) { super (selectorProvider); this.native_fd = native_fd; }
public SinkChannelImpl (SelectorProvider selectorProvider, VMChannel channel) { super (selectorProvider); this.native_fd = native_fd; }
14,224
public SinkChannelImpl (SelectorProvider selectorProvider, int native_fd) { super (selectorProvider); this.native_fd = native_fd; }
public SinkChannelImpl (SelectorProvider selectorProvider, int native_fd) { super (selectorProvider); vmch = channel; }
14,225
protected final void implCloseSelectableChannel() throws IOException { throw new Error ("Not implemented"); }
protected final void implCloseSelectableChannel() throws IOException { vmch.close(); }
14,226
protected final void implConfigureBlocking (boolean blocking) throws IOException { throw new Error ("Not implemented"); }
protected final void implConfigureBlocking (boolean blocking) throws IOException { vmch.setBlocking(blocking); }
14,227
public final int write (ByteBuffer dst) throws IOException { throw new Error ("Not implemented"); }
public final int write (ByteBuffer dst) throws IOException { return vmch.write(dst); }
14,228
public SourceChannelImpl (SelectorProvider selectorProvider, int native_fd) { super (selectorProvider); this.native_fd = native_fd; }
public SourceChannelImpl (SelectorProvider selectorProvider, VMChannel channel) { super (selectorProvider); this.native_fd = native_fd; }
14,229
public SourceChannelImpl (SelectorProvider selectorProvider, int native_fd) { super (selectorProvider); this.native_fd = native_fd; }
public SourceChannelImpl (SelectorProvider selectorProvider, int native_fd) { super (selectorProvider); vmch = channel; }
14,230
protected void implConfigureBlocking (boolean blocking) throws IOException { throw new Error ("Not implemented"); }
protected void implConfigureBlocking (boolean blocking) throws IOException { vmch.setBlocking(blocking); }
14,231
public final int read (ByteBuffer src) throws IOException { throw new Error ("Not implemented"); }
public final int read (ByteBuffer src) throws IOException { return vmch.read(src); }
14,232
public PipeImpl (SelectorProvider provider) throws IOException { super(); VMPipe.init (this, provider); }
public PipeImpl (SelectorProvider provider) throws IOException { super(); VMChannel[] pipe = VMPipe.pipe(); sink = new SinkChannelImpl(provider, pipe[0]); source = new SourceChannelImpl(provider, pipe[1]); }
14,233
public boolean implies(Permission perm) { PermissionCollection pc = getPermissions(); if (pc == null) return (false); return (pc.implies(perm)); }
public boolean implies(Permission perm) { PermissionCollection pc = getPermissions(); if (pc == null) return (false); return (pc.implies(perm)); }
14,234
public String toString() { String linesep = System.getProperty("line.separator"); StringBuffer sb = new StringBuffer(""); sb.append("ProtectionDomain (" + linesep); if (code_source == null) sb.append("CodeSource:null" + linesep); else sb.append(code_source + linesep); sb.append(perms); sb.append(linesep + ")" + linesep); return sb.toString(); }
public String toString() { String linesep = System.getProperty("line.separator"); StringBuffer sb = new StringBuffer(""); sb.append("ProtectionDomain (" + linesep); if (code_source == null) sb.append("CodeSource:null" + linesep); else sb.append(code_source + linesep); sb.append(perms); sb.append(linesep + ")" + linesep); return sb.toString(); }
14,235
public String toString() { String linesep = System.getProperty("line.separator"); StringBuffer sb = new StringBuffer(""); sb.append("ProtectionDomain (" + linesep); if (code_source == null) sb.append("CodeSource:null" + linesep); else sb.append(code_source + linesep); sb.append(perms); sb.append(linesep + ")" + linesep); return sb.toString(); }
public String toString() { String linesep = System.getProperty("line.separator"); StringBuffer sb = new StringBuffer(""); sb.append("ProtectionDomain (" + linesep); if (code_source == null) sb.append("CodeSource:null"); else sb.append(code_source); sb.append(linesep); if (classloader == null) sb.append("ClassLoader:null"); else sb.append(classloader); sb.append(linesep); sb.append("Principals:"); if (principals != null && principals.length > 0) { sb.append("["); Principal pal; for (int i = 0; i < principals.length; i++) { pal = principals[i]; sb.append("'").append(pal.getName()) .append("' of type ").append(pal.getClass().getName()); if (i < principals.length-1) sb.append(", "); } sb.append("]"); } else sb.append("none"); sb.append(linesep); if (!staticBinding) if (Policy.isLoaded()) sb.append(Policy.getCurrentPolicy().getPermissions(this)); else sb.append(perms); else sb.append(code_source + linesep); sb.append(perms); sb.append(linesep + ")" + linesep); return sb.toString(); }
14,236
public String toString() { String linesep = System.getProperty("line.separator"); StringBuffer sb = new StringBuffer(""); sb.append("ProtectionDomain (" + linesep); if (code_source == null) sb.append("CodeSource:null" + linesep); else sb.append(code_source + linesep); sb.append(perms); sb.append(linesep + ")" + linesep); return sb.toString(); }
public String toString() { String linesep = System.getProperty("line.separator"); StringBuffer sb = new StringBuffer(""); sb.append("ProtectionDomain (" + linesep); if (code_source == null) sb.append("CodeSource:null" + linesep); else sb.append(perms); sb.append(linesep + ")" + linesep); return sb.toString(); }
14,237
public String toString() { String linesep = System.getProperty("line.separator"); StringBuffer sb = new StringBuffer(""); sb.append("ProtectionDomain (" + linesep); if (code_source == null) sb.append("CodeSource:null" + linesep); else sb.append(code_source + linesep); sb.append(perms); sb.append(linesep + ")" + linesep); return sb.toString(); }
public String toString() { String linesep = System.getProperty("line.separator"); StringBuffer sb = new StringBuffer(""); sb.append("ProtectionDomain (" + linesep); if (code_source == null) sb.append("CodeSource:null" + linesep); else sb.append(code_source + linesep); sb.append(perms); return sb.toString(); }
14,238
public String toString() { String linesep = System.getProperty("line.separator"); StringBuffer sb = new StringBuffer(""); sb.append("ProtectionDomain (" + linesep); if (code_source == null) sb.append("CodeSource:null" + linesep); else sb.append(code_source + linesep); sb.append(perms); sb.append(linesep + ")" + linesep); return sb.toString(); }
public String toString() { String linesep = System.getProperty("line.separator"); StringBuffer sb = new StringBuffer(""); sb.append("ProtectionDomain (" + linesep); if (code_source == null) sb.append("CodeSource:null" + linesep); else sb.append(code_source + linesep); sb.append(perms); sb.append(linesep + ")" + linesep); return sb.append(linesep).append(")").append(linesep).toString(); }
14,239
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); tabPane.setFont(defaults.getFont("TabbedPane.font")); tabPane.setForeground(defaults.getColor("TabbedPane.foreground")); tabPane.setBackground(defaults.getColor("TabbedPane.background")); tabPane.setOpaque(true); highlight = defaults.getColor("TabbedPane.highlight"); lightHighlight = defaults.getColor("TabbedPane.lightHighlight"); shadow = defaults.getColor("TabbedPane.shadow"); darkShadow = defaults.getColor("TabbedPane.darkShadow"); focus = defaults.getColor("TabbedPane.focus"); textIconGap = defaults.getInt("TabbedPane.textIconGap"); tabRunOverlay = defaults.getInt("TabbedPane.tabRunOverlay"); tabInsets = defaults.getInsets("TabbedPane.tabbedPaneTabInsets"); selectedTabPadInsets = defaults.getInsets("TabbedPane.tabbedPaneTabPadInsets"); tabAreaInsets = defaults.getInsets("TabbedPane.tabbedPaneTabAreaInsets"); contentBorderInsets = defaults.getInsets("TabbedPane.tabbedPaneContentBorderInsets"); calcRect = new Rectangle(); tabRuns = new int[10]; tabAreaRect = new Rectangle(); contentRect = new Rectangle(); }
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); tabPane.setFont(defaults.getFont("TabbedPane.font")); tabPane.setForeground(defaults.getColor("TabbedPane.foreground")); tabPane.setBackground(defaults.getColor("TabbedPane.background")); tabPane.setOpaque(false); highlight = defaults.getColor("TabbedPane.highlight"); lightHighlight = defaults.getColor("TabbedPane.lightHighlight"); shadow = defaults.getColor("TabbedPane.shadow"); darkShadow = defaults.getColor("TabbedPane.darkShadow"); focus = defaults.getColor("TabbedPane.focus"); textIconGap = defaults.getInt("TabbedPane.textIconGap"); tabRunOverlay = defaults.getInt("TabbedPane.tabRunOverlay"); tabInsets = defaults.getInsets("TabbedPane.tabbedPaneTabInsets"); selectedTabPadInsets = defaults.getInsets("TabbedPane.tabbedPaneTabPadInsets"); tabAreaInsets = defaults.getInsets("TabbedPane.tabbedPaneTabAreaInsets"); contentBorderInsets = defaults.getInsets("TabbedPane.tabbedPaneContentBorderInsets"); calcRect = new Rectangle(); tabRuns = new int[10]; tabAreaRect = new Rectangle(); contentRect = new Rectangle(); }
14,241
public final Set aliases() { if (aliases == null) { return Collections.EMPTY_SET; } // should we cache the aliasSet instead? int n = aliases.length; if (n == 0) { return Collections.EMPTY_SET; } HashSet aliasSet = new HashSet(n); for (int i = 0; i < n; ++i) aliasSet.add(aliases[i]); return Collections.unmodifiableSet(aliasSet); }
public final Set aliases() { if (aliases == null) { return Collections.EMPTY_SET; } // should we cache the aliasSet instead? int n = aliases.length; if (n == 0) { return Collections.EMPTY_SET; } HashSet aliasSet = new HashSet(n); for (int i = 0; i < n; ++i) aliasSet.add(aliases[i]); return Collections.unmodifiableSet(aliasSet); }
14,242
public final Set aliases() { if (aliases == null) { return Collections.EMPTY_SET; } // should we cache the aliasSet instead? int n = aliases.length; if (n == 0) { return Collections.EMPTY_SET; } HashSet aliasSet = new HashSet(n); for (int i = 0; i < n; ++i) aliasSet.add(aliases[i]); return Collections.unmodifiableSet(aliasSet); }
public final Set aliases() { if (aliases == null) { return Collections.EMPTY_SET; // should we cache the aliasSet instead? int n = aliases.length; if (n == 0) { return Collections.EMPTY_SET; HashSet aliasSet = new HashSet(n); for (int i = 0; i < n; ++i) aliasSet.add(aliases[i]); return Collections.unmodifiableSet(aliasSet);
14,243
public final Set aliases() { if (aliases == null) { return Collections.EMPTY_SET; } // should we cache the aliasSet instead? int n = aliases.length; if (n == 0) { return Collections.EMPTY_SET; } HashSet aliasSet = new HashSet(n); for (int i = 0; i < n; ++i) aliasSet.add(aliases[i]); return Collections.unmodifiableSet(aliasSet); }
public final Set aliases() { if (aliases == null) { return Collections.EMPTY_SET; } // should we cache the aliasSet instead? int n = aliases.length; if (n == 0) { return Collections.EMPTY_SET; } HashSet aliasSet = new HashSet(n); for (int i = 0; i < n; ++i) aliasSet.add(aliases[i]); return Collections.unmodifiableSet(aliasSet); }
14,244
public CharBuffer decode(ByteBuffer bb) { try { CharsetDecoder decoder = (CharsetDecoder) cachedDecoder.get(); if (decoder == null) { decoder = newDecoder().onMalformedInput(CodingErrorAction.REPLACE).onUnmappableCharacter(CodingErrorAction.REPLACE); cachedDecoder.set(decoder); } decoder.reset(); return decoder.decode(bb); } catch (CharacterCodingException e) { throw new AssertionError(e); } }
public CharBuffer decode(ByteBuffer bb) { try { CharsetDecoder decoder = (CharsetDecoder) cachedDecoder.get(); if (decoder == null) { decoder = newDecoder().onMalformedInput(CodingErrorAction.REPLACE).onUnmappableCharacter(CodingErrorAction.REPLACE); cachedDecoder.set(decoder); } decoder.reset(); return decoder.decode(bb); } catch (CharacterCodingException e) { throw new AssertionError(e); } }
14,245
public CharBuffer decode(ByteBuffer bb) { try { CharsetDecoder decoder = (CharsetDecoder) cachedDecoder.get(); if (decoder == null) { decoder = newDecoder().onMalformedInput(CodingErrorAction.REPLACE).onUnmappableCharacter(CodingErrorAction.REPLACE); cachedDecoder.set(decoder); } decoder.reset(); return decoder.decode(bb); } catch (CharacterCodingException e) { throw new AssertionError(e); } }
public CharBuffer decode(ByteBuffer bb) { try { CharsetDecoder decoder = (CharsetDecoder) cachedDecoder.get(); if (decoder == null) { decoder = newDecoder().onMalformedInput(CodingErrorAction.REPLACE).onUnmappableCharacter(CodingErrorAction.REPLACE); cachedDecoder.set(decoder); } decoder.reset(); return decoder.decode(bb); } catch (CharacterCodingException e) { throw new AssertionError(e); } }
14,246
public final ByteBuffer encode(CharBuffer cb) { try { CharsetEncoder encoder = (CharsetEncoder) cachedEncoder.get(); if (encoder == null) { encoder = newEncoder().onMalformedInput(CodingErrorAction.REPLACE).onUnmappableCharacter(CodingErrorAction.REPLACE); cachedEncoder.set(encoder); } return encoder.encode(cb); } catch (CharacterCodingException e) { throw new AssertionError(e); } }
public final ByteBuffer encode(CharBuffer cb) { try { CharsetEncoder encoder = (CharsetEncoder) cachedEncoder.get(); if (encoder == null) { encoder = newEncoder().onMalformedInput(CodingErrorAction.REPLACE).onUnmappableCharacter(CodingErrorAction.REPLACE); cachedEncoder.set(encoder); } return encoder.encode(cb); } catch (CharacterCodingException e) { throw new AssertionError(e); } }
14,247
public final ByteBuffer encode(CharBuffer cb) { try { CharsetEncoder encoder = (CharsetEncoder) cachedEncoder.get(); if (encoder == null) { encoder = newEncoder().onMalformedInput(CodingErrorAction.REPLACE).onUnmappableCharacter(CodingErrorAction.REPLACE); cachedEncoder.set(encoder); } return encoder.encode(cb); } catch (CharacterCodingException e) { throw new AssertionError(e); } }
public final ByteBuffer encode(CharBuffer cb) { try { CharsetEncoder encoder = (CharsetEncoder) cachedEncoder.get(); if (encoder == null) { encoder = newEncoder().onMalformedInput(CodingErrorAction.REPLACE).onUnmappableCharacter(CodingErrorAction.REPLACE); cachedEncoder.set(encoder); } return encoder.encode(cb); } catch (CharacterCodingException e) { throw new AssertionError(e); } }
14,248
public final boolean isRegistered(String name) { return !name.startsWith("x-") && !name.startsWith("X-"); }
public final boolean isRegistered(String name) { return !name.startsWith("x-") && !name.startsWith("X-"); }
14,249
private static final CharsetProvider provider() { return (CharsetProvider)AccessController.doPrivileged(new PrivilegedAction() { public Object run() { return Provider.provider(); }}); }
private static final CharsetProvider provider() { return (CharsetProvider)AccessController.doPrivileged(new PrivilegedAction() { public Object run() { return Provider.provider(); }}); }
14,250
public IllegalCharsetNameException (String charsetName) { super (charsetName); }
public IllegalCharsetNameException (String charsetName) { super (); this.charsetName = charsetName; }
14,251
public UnsupportedCharsetException (String charsetName) { super (charsetName); }
public UnsupportedCharsetException (String charsetName) { super (); this.charsetName = charsetName; }
14,252
boolean match(CharIndexed input, REMatch mymatch) { // number of times we've matched so far int numRepeats = 0; // Possible positions for the next repeat to match at REMatch newMatch = mymatch; REMatch last = null; REMatch current; // Add the '0-repeats' index // positions.elementAt(z) == position [] in input after <<z>> matches Vector positions = new Vector(); positions.addElement(newMatch); // Declare variables used in loop REMatch doables; REMatch doablesLast; REMatch recurrent; do { // Check for stingy match for each possibility. if (stingy && (numRepeats >= min)) { REMatch result = matchRest(input, newMatch); if (result != null) { mymatch.assignFrom(result); return true; } } doables = null; doablesLast = null; // try next repeat at all possible positions for (current = newMatch; current != null; current = current.next) { recurrent = (REMatch) current.clone(); if (token.match(input, recurrent)) { // add all items in current to doables array if (doables == null) { doables = recurrent; doablesLast = recurrent; } else { // Order these from longest to shortest // Start by assuming longest (more repeats) doablesLast.next = recurrent; } // Find new doablesLast while (doablesLast.next != null) { doablesLast = doablesLast.next; } } } // if none of the possibilities worked out, break out of do/while if (doables == null) break; // reassign where the next repeat can match newMatch = doables; // increment how many repeats we've successfully found ++numRepeats; positions.addElement(newMatch); } while (numRepeats < max); // If there aren't enough repeats, then fail if (numRepeats < min) return false; // We're greedy, but ease off until a true match is found int posIndex = positions.size(); // At this point we've either got too many or just the right amount. // See if this numRepeats works with the rest of the regexp. REMatch allResults = null; REMatch allResultsLast = null; REMatch results = null; while (--posIndex >= min) { newMatch = (REMatch) positions.elementAt(posIndex); results = matchRest(input, newMatch); if (results != null) { if (allResults == null) { allResults = results; allResultsLast = results; } else { // Order these from longest to shortest // Start by assuming longest (more repeats) allResultsLast.next = results; } // Find new doablesLast while (allResultsLast.next != null) { allResultsLast = allResultsLast.next; } } // else did not match rest of the tokens, try again on smaller sample // or break out when performing possessive matching if (possessive) break; } if (allResults != null) { mymatch.assignFrom(allResults); // does this get all? return true; } // If we fall out, no matches. return false; }
boolean match(CharIndexed input, REMatch mymatch) { // number of times we've matched so far int numRepeats = 0; // Possible positions for the next repeat to match at REMatch newMatch = mymatch; REMatch last = null; REMatch current; // Add the '0-repeats' index // positions.elementAt(z) == position [] in input after <<z>> matches Vector positions = new Vector(); positions.addElement(newMatch); // Declare variables used in loop REMatch doables; REMatch doablesLast; REMatch recurrent; do { // Check for stingy match for each possibility. if ((stingy && (numRepeats >= min)) || alwaysEmpty) { REMatch result = matchRest(input, newMatch); if (result != null) { mymatch.assignFrom(result); return true; } } doables = null; doablesLast = null; // try next repeat at all possible positions for (current = newMatch; current != null; current = current.next) { recurrent = (REMatch) current.clone(); if (token.match(input, recurrent)) { // add all items in current to doables array if (doables == null) { doables = recurrent; doablesLast = recurrent; } else { // Order these from longest to shortest // Start by assuming longest (more repeats) doablesLast.next = recurrent; } // Find new doablesLast while (doablesLast.next != null) { doablesLast = doablesLast.next; } } } // if none of the possibilities worked out, break out of do/while if (doables == null) break; // reassign where the next repeat can match newMatch = doables; // increment how many repeats we've successfully found ++numRepeats; positions.addElement(newMatch); } while (numRepeats < max); // If there aren't enough repeats, then fail if (numRepeats < min) return false; // We're greedy, but ease off until a true match is found int posIndex = positions.size(); // At this point we've either got too many or just the right amount. // See if this numRepeats works with the rest of the regexp. REMatch allResults = null; REMatch allResultsLast = null; REMatch results = null; while (--posIndex >= min) { newMatch = (REMatch) positions.elementAt(posIndex); results = matchRest(input, newMatch); if (results != null) { if (allResults == null) { allResults = results; allResultsLast = results; } else { // Order these from longest to shortest // Start by assuming longest (more repeats) allResultsLast.next = results; } // Find new doablesLast while (allResultsLast.next != null) { allResultsLast = allResultsLast.next; } } // else did not match rest of the tokens, try again on smaller sample // or break out when performing possessive matching if (possessive) break; } if (allResults != null) { mymatch.assignFrom(allResults); // does this get all? return true; } // If we fall out, no matches. return false; }
14,253
boolean match(CharIndexed input, REMatch mymatch) { // number of times we've matched so far int numRepeats = 0; // Possible positions for the next repeat to match at REMatch newMatch = mymatch; REMatch last = null; REMatch current; // Add the '0-repeats' index // positions.elementAt(z) == position [] in input after <<z>> matches Vector positions = new Vector(); positions.addElement(newMatch); // Declare variables used in loop REMatch doables; REMatch doablesLast; REMatch recurrent; do { // Check for stingy match for each possibility. if (stingy && (numRepeats >= min)) { REMatch result = matchRest(input, newMatch); if (result != null) { mymatch.assignFrom(result); return true; } } doables = null; doablesLast = null; // try next repeat at all possible positions for (current = newMatch; current != null; current = current.next) { recurrent = (REMatch) current.clone(); if (token.match(input, recurrent)) { // add all items in current to doables array if (doables == null) { doables = recurrent; doablesLast = recurrent; } else { // Order these from longest to shortest // Start by assuming longest (more repeats) doablesLast.next = recurrent; } // Find new doablesLast while (doablesLast.next != null) { doablesLast = doablesLast.next; } } } // if none of the possibilities worked out, break out of do/while if (doables == null) break; // reassign where the next repeat can match newMatch = doables; // increment how many repeats we've successfully found ++numRepeats; positions.addElement(newMatch); } while (numRepeats < max); // If there aren't enough repeats, then fail if (numRepeats < min) return false; // We're greedy, but ease off until a true match is found int posIndex = positions.size(); // At this point we've either got too many or just the right amount. // See if this numRepeats works with the rest of the regexp. REMatch allResults = null; REMatch allResultsLast = null; REMatch results = null; while (--posIndex >= min) { newMatch = (REMatch) positions.elementAt(posIndex); results = matchRest(input, newMatch); if (results != null) { if (allResults == null) { allResults = results; allResultsLast = results; } else { // Order these from longest to shortest // Start by assuming longest (more repeats) allResultsLast.next = results; } // Find new doablesLast while (allResultsLast.next != null) { allResultsLast = allResultsLast.next; } } // else did not match rest of the tokens, try again on smaller sample // or break out when performing possessive matching if (possessive) break; } if (allResults != null) { mymatch.assignFrom(allResults); // does this get all? return true; } // If we fall out, no matches. return false; }
boolean match(CharIndexed input, REMatch mymatch) { // number of times we've matched so far int numRepeats = 0; // Possible positions for the next repeat to match at REMatch newMatch = mymatch; REMatch last = null; REMatch current; // Add the '0-repeats' index // positions.elementAt(z) == position [] in input after <<z>> matches Vector positions = new Vector(); positions.addElement(newMatch); // Declare variables used in loop REMatch doables; REMatch doablesLast; REMatch recurrent; do { // Check for stingy match for each possibility. if (stingy && (numRepeats >= min)) { REMatch result = matchRest(input, newMatch); if (result != null) { mymatch.assignFrom(result); return true; } } doables = null; doablesLast = null; // try next repeat at all possible positions for (current = newMatch; current != null; current = current.next) { recurrent = (REMatch) current.clone(); if (token.match(input, recurrent)) { // add all items in current to doables array if (doables == null) { doables = recurrent; doablesLast = recurrent; } else { // Order these from longest to shortest // Start by assuming longest (more repeats) doablesLast.next = recurrent; } // Find new doablesLast while (doablesLast.next != null) { doablesLast = doablesLast.next; } } } // if none of the possibilities worked out, break out of do/while if (doables == null) break; // reassign where the next repeat can match newMatch = doables; // increment how many repeats we've successfully found ++numRepeats; positions.addElement(newMatch); } while (numRepeats < max); // If there aren't enough repeats, then fail if (numRepeats < min) return false; // We're greedy, but ease off until a true match is found int posIndex = positions.size(); // At this point we've either got too many or just the right amount. // See if this numRepeats works with the rest of the regexp. REMatch allResults = null; REMatch allResultsLast = null; REMatch results = null; int indexCount = posIndex - min; if (indexCount <= 0) { indexCount = 1; } while (indexCount-- > 0) { --posIndex; newMatch = (REMatch) positions.elementAt(posIndex); results = matchRest(input, newMatch); if (results != null) { if (allResults == null) { allResults = results; allResultsLast = results; } else { // Order these from longest to shortest // Start by assuming longest (more repeats) allResultsLast.next = results; } // Find new doablesLast while (allResultsLast.next != null) { allResultsLast = allResultsLast.next; } } // else did not match rest of the tokens, try again on smaller sample // or break out when performing possessive matching if (possessive) break; } if (allResults != null) { mymatch.assignFrom(allResults); // does this get all? return true; } // If we fall out, no matches. return false; }
14,254
public static void insertSystemProperties(Properties res) { final Vm vm = Vm.getVm(); final VmArchitecture arch = vm.getArch(); // Java properties res.put("java.version", "1.1.0"); res.put("java.vendor", "JNode.org"); res.put("java.vendor.url", "http://jnode.org"); res.put("java.home", "/"); res.put("java.vm.specification.version", "1.4"); res.put("java.vm.specification.vendor", "JNode.org"); res.put("java.vm.specification.name", "jnode"); res.put("java.vm.version", vm.getVersion()); res.put("java.vm.vendor", "JNode.org"); res.put("java.vm.name", "JNode"); res.put("java.class.version", "1.1"); res.put("java.class.path", ""); res.put("java.library.path", ""); res.put("java.io.tmpdir", "/tmp"); res.put("java.compiler", "Internal"); res.put("java.ext.dirs", ""); res.put("os.name", "JNode"); res.put("os.arch", arch.getName()); res.put("os.version", vm.getVersion()); res.put("file.separator", "/"); res.put("path.separator", ":"); res.put("line.separator", "\n"); res.put("user.name", "System"); res.put("user.home", "/"); res.put("user.dir", "/"); // Log4j properties res.put("log4j.defaultInitOverride", "true"); // GNU properties res.put("gnu.cpu.endian", (arch.getByteOrder() == ByteOrder.BIG_ENDIAN) ? "big" : "little"); res.put("gnu.java.io.encoding_scheme_alias.US-ASCII", "ISO8859-1"); res.put("gnu.java.io.encoding_scheme_alias.UTF-16LE", "UTF16LE"); res.put("gnu.java.io.encoding_scheme_alias.UTF-16BE", "UTF16BE"); }
public static void insertSystemProperties(Properties res) { final Vm vm = Vm.getVm(); final VmArchitecture arch = vm.getArch(); // Java properties res.put("java.version", "1.1.0"); res.put("java.vendor", "JNode.org"); res.put("java.vendor.url", "http://jnode.org"); res.put("java.home", "/"); res.put("java.vm.specification.version", "1.4"); res.put("java.vm.specification.vendor", "JNode.org"); res.put("java.vm.specification.name", "jnode"); res.put("java.vm.version", vm.getVersion()); res.put("java.vm.vendor", "JNode.org"); res.put("java.vm.name", "JNode"); res.put("java.class.version", "1.1"); res.put("java.class.path", ""); res.put("java.library.path", ""); res.put("java.io.tmpdir", "/tmp"); res.put("java.compiler", "Internal"); res.put("java.ext.dirs", ""); res.put("os.name", "JNode"); res.put("os.arch", arch.getName()); res.put("os.version", vm.getVersion()); res.put("file.separator", "/"); res.put("path.separator", ":"); res.put("line.separator", "\n"); res.put("user.name", "System"); res.put("user.home", "/"); res.put("user.dir", "/"); // Log4j properties res.put("log4j.defaultInitOverride", "true"); // GNU properties res.put("gnu.cpu.endian", (arch.getByteOrder() == ByteOrder.BIG_ENDIAN) ? "big" : "little"); res.put("gnu.java.io.encoding_scheme_alias.US-ASCII", "ISO8859-1"); res.put("gnu.java.io.encoding_scheme_alias.UTF-16LE", "UTF16LE"); res.put("gnu.java.io.encoding_scheme_alias.UTF-16BE", "UTF16BE"); }
14,257
public Document createDocument(String namespaceURI, String rootName, DocumentType doctype) { Document doc = new DomDocument(this); Element root = null; if (rootName != null) { root = doc.createElementNS(namespaceURI, rootName); if (rootName.startsWith("xmlns:")) { throw new DomEx(DomEx.NAMESPACE_ERR, "xmlns is reserved", null, 0); } } // Bleech -- L2 seemingly _requires_ omission of xmlns attributes. if (doctype != null) { doc.appendChild(doctype); // handles WRONG_DOCUMENT error } if (root != null) { doc.appendChild(root); } return doc; }
public Document createDocument(String namespaceURI, String rootName, DocumentType doctype) { Document doc = new DomDocument(this); Element root = null; if (rootName != null) { root = doc.createElementNS(namespaceURI, rootName); if (rootName.startsWith("xmlns:")) { throw new DomDOMException(DOMException.NAMESPACE_ERR, "xmlns is reserved", null, 0); } } // Bleech -- L2 seemingly _requires_ omission of xmlns attributes. if (doctype != null) { doc.appendChild(doctype); // handles WRONG_DOCUMENT error } if (root != null) { doc.appendChild(root); } return doc; }
14,258
public Servant reference_to_servant(org.omg.CORBA.Object the_Object) throws ObjectNotActive, WrongPolicy, WrongAdapter { if (applies(ServantRetentionPolicyValue.RETAIN)) { AOM.Obj ref = aom.findObject(the_Object); if (ref == null) throw new WrongAdapter(); else if (ref.isDeactiveted() || ref.servant == null) { if (default_servant != null) return default_servant; else throw new ObjectNotActive(); } else return ref.servant; } else if (default_servant != null) { return default_servant; } else throw new WrongPolicy("Either RETAIN or USE_DEFAULT_SERVANT required."); }
public Servant reference_to_servant(org.omg.CORBA.Object the_Object) throws ObjectNotActive, WrongPolicy, WrongAdapter { if (applies(ServantRetentionPolicyValue.RETAIN)) { AOM.Obj ref = aom.findObject(the_Object); if (ref == null) { String object; if (the_Object == null) object = "null passed"; else if (the_Object instanceof gnuServantObject) { gnuServantObject gs = (gnuServantObject) the_Object; object = "Wrong owner POA " + gs.poa.the_name(); } else object = "Unknown " + the_Object.getClass().getName(); throw new WrongAdapter(object + " for '" + the_name() + "'"); } else if (ref.isDeactiveted() || ref.servant == null) { if (default_servant != null) return default_servant; else throw new ObjectNotActive(); } else return ref.servant; } else if (default_servant != null) { return default_servant; } else throw new WrongPolicy("Either RETAIN or USE_DEFAULT_SERVANT required."); }
14,259
public static final String getDefaultType() { String tmp; //Security reads every property in java.security so it //will return this property if it exists. tmp = Security.getProperty("keystore.type"); if (tmp == null) tmp = "jks"; return tmp; }
public static final String getDefaultType() { String tmp; //Security reads every property in java.security so it //will return this property if it exists. tmp = Security.getProperty("keystore.type"); if (tmp == null) tmp = "jks"; return tmp; }
14,260
public static KeyStore getInstance(String type) throws KeyStoreException { Provider[] p = Security.getProviders(); for (int i = 0; i < p.length; i++) { String classname = p[i].getProperty("KeyStore." + type); if (classname != null) return getInstance(classname, type, p[i]); } throw new KeyStoreException(type); }
public static KeyStore getInstance(String type) throws KeyStoreException { Provider[] p = Security.getProviders(); for (int i = 0; i < p.length; i++) { String classname = p[i].getProperty("KeyStore." + type); if (classname != null) return getInstance(classname, type, p[i]); } throw new KeyStoreException(type); }
14,261
public Dimension getViewSize() { if (isViewSizeSet) return viewSize; else return getView().getSize(); }
public Dimension getViewSize() { if (isViewSizeSet) return viewSize; else { Component view = getView(); if (view != null) return view.getPreferredSize(); else return new Dimension(); } }
14,262
private synchronized static ConnectionRunner getConnectionRunner() { if(freelist.size() == 0){ if(size < max_size){ ++size; ConnectionRunner a = new ConnectionRunner(group, new Integer(size).toString()); a.start(); freelist.add(a); }else while(freelist.size() == 0) try{ ConnectionRunnerPool.class.wait(); }catch(InterruptedException e){} } // always let the first in pool most busy or other scheduling plan?? ConnectionRunner a = (ConnectionRunner)freelist.get(0); freelist.remove(a); return a; }
private static synchronized ConnectionRunner getConnectionRunner() { if(freelist.size() == 0){ if(size < max_size){ ++size; ConnectionRunner a = new ConnectionRunner(group, new Integer(size).toString()); a.start(); freelist.add(a); }else while(freelist.size() == 0) try{ ConnectionRunnerPool.class.wait(); }catch(InterruptedException e){} } // always let the first in pool most busy or other scheduling plan?? ConnectionRunner a = (ConnectionRunner)freelist.get(0); freelist.remove(a); return a; }
14,263
addNotify(){ if (menuBar != null) menuBar.addNotify(); if (peer == null) peer = getToolkit ().createFrame (this); // We now know there's a Frame (us) with a live peer, so we can start the // fundamental queue and dispatch thread, by inserting a dummy event. if (parent != null && parent.isDisplayable()) fireDummyEvent(); super.addNotify();}
addNotify(){ if (menuBar != null) menuBar.addNotify(); if (peer == null) peer = getToolkit ().createFrame (this); // We now know there's a Frame (us) with a live peer, so we can start the // fundamental queue and dispatch thread, by inserting a dummy event. if (parent != null && parent.isDisplayable()) fireDummyEvent(); super.addNotify();}
14,264
public void removeNotify(){ if (menuBar != null) menuBar.removeNotify(); super.removeNotify(); // By now we've been disconnected from the peer, and the peer set to // null. This is formally the same as saying "we just became // un-displayable", so we wake up the event queue with a dummy event to // see if it's time to shut down. fireDummyEvent();}
public void removeNotify(){ if (menuBar != null) menuBar.removeNotify(); super.removeNotify(); // By now we've been disconnected from the peer, and the peer set to // null. This is formally the same as saying "we just became // un-displayable", so we wake up the event queue with a dummy event to // see if it's time to shut down. }
14,265
protected void installDefaults() { LookAndFeel.installColorsAndFont(tabPane, "TabbedPane.background", "TabbedPane.foreground", "TabbedPane.font"); tabPane.setOpaque(false); highlight = UIManager.getColor("TabbedPane.highlight"); lightHighlight = UIManager.getColor("TabbedPane.lightHighlight"); shadow = UIManager.getColor("TabbedPane.shadow"); darkShadow = UIManager.getColor("TabbedPane.darkShadow"); focus = UIManager.getColor("TabbedPane.focus"); textIconGap = UIManager.getInt("TabbedPane.textIconGap"); tabRunOverlay = UIManager.getInt("TabbedPane.tabRunOverlay"); tabInsets = UIManager.getInsets("TabbedPane.tabbedPaneTabInsets"); selectedTabPadInsets = UIManager.getInsets("TabbedPane.tabbedPaneTabPadInsets"); tabAreaInsets = UIManager.getInsets("TabbedPane.tabbedPaneTabAreaInsets"); contentBorderInsets = UIManager.getInsets("TabbedPane.tabbedPaneContentBorderInsets"); calcRect = new Rectangle(); tabRuns = new int[10]; tabAreaRect = new Rectangle(); contentRect = new Rectangle(); }
protected void installDefaults() { LookAndFeel.installColorsAndFont(tabPane, "TabbedPane.background", "TabbedPane.foreground", "TabbedPane.font"); tabPane.setOpaque(false); highlight = UIManager.getColor("TabbedPane.highlight"); lightHighlight = UIManager.getColor("TabbedPane.lightHighlight"); shadow = UIManager.getColor("TabbedPane.shadow"); darkShadow = UIManager.getColor("TabbedPane.darkShadow"); focus = UIManager.getColor("TabbedPane.focus"); textIconGap = UIManager.getInt("TabbedPane.textIconGap"); tabRunOverlay = UIManager.getInt("TabbedPane.tabRunOverlay"); tabInsets = UIManager.getInsets("TabbedPane.tabInsets"); selectedTabPadInsets = UIManager.getInsets("TabbedPane.tabbedPaneTabPadInsets"); tabAreaInsets = UIManager.getInsets("TabbedPane.tabbedPaneTabAreaInsets"); contentBorderInsets = UIManager.getInsets("TabbedPane.tabbedPaneContentBorderInsets"); calcRect = new Rectangle(); tabRuns = new int[10]; tabAreaRect = new Rectangle(); contentRect = new Rectangle(); }
14,266
protected void installDefaults() { LookAndFeel.installColorsAndFont(tabPane, "TabbedPane.background", "TabbedPane.foreground", "TabbedPane.font"); tabPane.setOpaque(false); highlight = UIManager.getColor("TabbedPane.highlight"); lightHighlight = UIManager.getColor("TabbedPane.lightHighlight"); shadow = UIManager.getColor("TabbedPane.shadow"); darkShadow = UIManager.getColor("TabbedPane.darkShadow"); focus = UIManager.getColor("TabbedPane.focus"); textIconGap = UIManager.getInt("TabbedPane.textIconGap"); tabRunOverlay = UIManager.getInt("TabbedPane.tabRunOverlay"); tabInsets = UIManager.getInsets("TabbedPane.tabbedPaneTabInsets"); selectedTabPadInsets = UIManager.getInsets("TabbedPane.tabbedPaneTabPadInsets"); tabAreaInsets = UIManager.getInsets("TabbedPane.tabbedPaneTabAreaInsets"); contentBorderInsets = UIManager.getInsets("TabbedPane.tabbedPaneContentBorderInsets"); calcRect = new Rectangle(); tabRuns = new int[10]; tabAreaRect = new Rectangle(); contentRect = new Rectangle(); }
protected void installDefaults() { LookAndFeel.installColorsAndFont(tabPane, "TabbedPane.background", "TabbedPane.foreground", "TabbedPane.font"); tabPane.setOpaque(false); highlight = UIManager.getColor("TabbedPane.highlight"); lightHighlight = UIManager.getColor("TabbedPane.lightHighlight"); shadow = UIManager.getColor("TabbedPane.shadow"); darkShadow = UIManager.getColor("TabbedPane.darkShadow"); focus = UIManager.getColor("TabbedPane.focus"); textIconGap = UIManager.getInt("TabbedPane.textIconGap"); tabRunOverlay = UIManager.getInt("TabbedPane.tabRunOverlay"); tabInsets = UIManager.getInsets("TabbedPane.tabbedPaneTabInsets"); selectedTabPadInsets = UIManager.getInsets("TabbedPane.tabbedPaneTabPadInsets"); tabAreaInsets = UIManager.getInsets("TabbedPane.tabAreaInsets"); contentBorderInsets = UIManager.getInsets("TabbedPane.tabbedPaneContentBorderInsets"); calcRect = new Rectangle(); tabRuns = new int[10]; tabAreaRect = new Rectangle(); contentRect = new Rectangle(); }
14,267
public int getScrollableBlockIncrement(Rectangle visible, int orientation, int direction) { return 0; }
public int getScrollableBlockIncrement(Rectangle visible, int orientation, int direction) { if (orientation == SwingConstants.HORIZONTAL) return visible.width; else if (orientation == SwingConstants.VERTICAL) return visible.height; else throw new IllegalArgumentException("orientation must be either " + "javax.swing.SwingConstants.VERTICAL " + "or " + "javax.swing.SwingConstants.HORIZONTAL" ); }
14,269
public int getScrollableUnitIncrement(Rectangle visible, int orientation, int direction) { return 0; }
public int getScrollableUnitIncrement(Rectangle visible, int orientation, int direction) { if (orientation == SwingConstants.HORIZONTAL) return visible.width / 10; else if (orientation == SwingConstants.VERTICAL) return visible.height / 10; else throw new IllegalArgumentException("orientation must be either " + "javax.swing.SwingConstants.VERTICAL " + "or " + "javax.swing.SwingConstants.HORIZONTAL" ); }
14,270
public boolean implies(Permission p) { if (! (p instanceof FilePermission)) return false; String f1 = getName(); if (f1.equals(ALL_FILES)) return true; FilePermission fp = (FilePermission) p; String f2 = fp.getName(); if (f1.charAt(0) != File.separatorChar) f1 = CURRENT_DIRECTORY + f1; if (f2.charAt(0) != File.separatorChar) f2 = CURRENT_DIRECTORY + f2; String sub1; switch (f1.charAt(f1.length() - 1)) { case '*': sub1 = f1.substring(0, f1.length() - 1); // chop off "*" if (f2.length() <= sub1.length()) { // If it's smaller, there is no way it could be part of // this directory. If it's the same (or length - 1), it // could be the same directory but specifies access to // the directory rather than the files in it. return false; } else if (f2.charAt(sub1.length() - 1) == File.separatorChar) { // Make sure the part before the "/" is the same. if (! f2.substring(0, sub1.length()).equals(sub1)) return false; // Make sure there are no subdirectories specified // underneath this one. if (f2.substring(sub1.length() + 1).indexOf(File.separatorChar) != -1) return false; } else { // Obviously not equal: f2 is either not a directory or // is not the same directory (its name continues further // than we want). return false; } break; case '-': // Chop off "/-". sub1 = f1.substring(0, f1.length() - 2); if (f2.length() < sub1.length()) { // If it's smaller, there is no way it could be part of // this directory. return false; } else if (f2.length() > sub1.length() && f2.charAt(sub1.length()) != File.separatorChar) return false; else if (! f2.substring(0, sub1.length()).equals(sub1)) return false; break; default: if (f2.charAt(f2.length() - 1) == File.separatorChar) { if (! f1.equals(f2.substring(0, f2.length() - 1))) return false; } else if (!f1.equals(f2)) return false; break; } if (readPerm && ! fp.readPerm) return false; if (writePerm && ! fp.writePerm) return false; if (executePerm && ! fp.executePerm) return false; if (deletePerm && ! fp.deletePerm) return false; return true; }
public boolean implies(Permission p) { if (! (p instanceof FilePermission)) return false; String f1 = getName(); if (f1.equals(ALL_FILES)) return true; FilePermission fp = (FilePermission) p; String f2 = fp.getName(); if (f1.charAt(0) != File.separatorChar) f1 = CURRENT_DIRECTORY + f1; if (f2.charAt(0) != File.separatorChar) f2 = CURRENT_DIRECTORY + f2; String sub1; switch (f1.charAt(f1.length() - 1)) { case '*': sub1 = f1.substring(0, f1.length() - 1); // chop off "*" if (f2.length() <= sub1.length()) { // If it's smaller, there is no way it could be part of // this directory. If it's the same (or length - 1), it // could be the same directory but specifies access to // the directory rather than the files in it. return false; } else if (f2.charAt(sub1.length() - 1) == File.separatorChar) { // Make sure the part before the "/" is the same. if (! f2.substring(0, sub1.length()).equals(sub1)) return false; // Make sure there are no subdirectories specified // underneath this one. if (f2.substring(sub1.length() + 1).indexOf(File.separatorChar) != -1) return false; } else { // Obviously not equal: f2 is either not a directory or // is not the same directory (its name continues further // than we want). return false; } break; case '-': // Chop off "/-". sub1 = f1.substring(0, f1.length() - 2); if (f2.length() < sub1.length()) { // If it's smaller, there is no way it could be part of // this directory. return false; } else if (f2.length() > sub1.length() && f2.charAt(sub1.length()) != File.separatorChar) return false; else if (! f2.substring(0, sub1.length()).equals(sub1)) return false; break; default: if (f2.charAt(f2.length() - 1) == File.separatorChar) { if (! f1.equals(f2.substring(0, f2.length() - 1))) return false; } else if (!f1.equals(f2)) return false; break; } if (readPerm && ! fp.readPerm) return false; if (writePerm && ! fp.writePerm) return false; if (executePerm && ! fp.executePerm) return false; if (deletePerm && ! fp.deletePerm) return false; return true; }
14,273
public boolean implies(Permission p) { if (! (p instanceof FilePermission)) return false; String f1 = getName(); if (f1.equals(ALL_FILES)) return true; FilePermission fp = (FilePermission) p; String f2 = fp.getName(); if (f1.charAt(0) != File.separatorChar) f1 = CURRENT_DIRECTORY + f1; if (f2.charAt(0) != File.separatorChar) f2 = CURRENT_DIRECTORY + f2; String sub1; switch (f1.charAt(f1.length() - 1)) { case '*': sub1 = f1.substring(0, f1.length() - 1); // chop off "*" if (f2.length() <= sub1.length()) { // If it's smaller, there is no way it could be part of // this directory. If it's the same (or length - 1), it // could be the same directory but specifies access to // the directory rather than the files in it. return false; } else if (f2.charAt(sub1.length() - 1) == File.separatorChar) { // Make sure the part before the "/" is the same. if (! f2.substring(0, sub1.length()).equals(sub1)) return false; // Make sure there are no subdirectories specified // underneath this one. if (f2.substring(sub1.length() + 1).indexOf(File.separatorChar) != -1) return false; } else { // Obviously not equal: f2 is either not a directory or // is not the same directory (its name continues further // than we want). return false; } break; case '-': // Chop off "/-". sub1 = f1.substring(0, f1.length() - 2); if (f2.length() < sub1.length()) { // If it's smaller, there is no way it could be part of // this directory. return false; } else if (f2.length() > sub1.length() && f2.charAt(sub1.length()) != File.separatorChar) return false; else if (! f2.substring(0, sub1.length()).equals(sub1)) return false; break; default: if (f2.charAt(f2.length() - 1) == File.separatorChar) { if (! f1.equals(f2.substring(0, f2.length() - 1))) return false; } else if (!f1.equals(f2)) return false; break; } if (readPerm && ! fp.readPerm) return false; if (writePerm && ! fp.writePerm) return false; if (executePerm && ! fp.executePerm) return false; if (deletePerm && ! fp.deletePerm) return false; return true; }
public boolean implies(Permission p) { if (! (p instanceof FilePermission)) return false; String f1 = getName(); if (f1.equals(ALL_FILES)) return true; FilePermission fp = (FilePermission) p; String f2 = fp.getName(); if (f1.charAt(0) != File.separatorChar) f1 = CURRENT_DIRECTORY + f1; if (f2.charAt(0) != File.separatorChar) f2 = CURRENT_DIRECTORY + f2; String sub1; switch (f1.charAt(f1.length() - 1)) { case '*': sub1 = f1.substring(0, f1.length() - 1); // chop off "*" if (f2.length() <= sub1.length()) { // If it's smaller, there is no way it could be part of // this directory. If it's the same (or length - 1), it // could be the same directory but specifies access to // the directory rather than the files in it. return false; } else if (f2.charAt(sub1.length() - 1) == File.separatorChar) { // Make sure the part before the "/" is the same. if (! f2.substring(0, sub1.length()).equals(sub1)) return false; // Make sure there are no subdirectories specified // underneath this one. if (f2.substring(sub1.length() + 1).indexOf(File.separatorChar) != -1) return false; } else { // Obviously not equal: f2 is either not a directory or // is not the same directory (its name continues further // than we want). return false; } break; case '-': // Chop off "/-". sub1 = f1.substring(0, f1.length() - 2); if (f2.length() < sub1.length()) { // If it's smaller, there is no way it could be part of // this directory. return false; } else if (f2.length() > sub1.length() && f2.charAt(sub1.length()) != File.separatorChar) return false; else if (! f2.substring(0, sub1.length()).equals(sub1)) return false; break; default: if (f2.charAt(f2.length() - 1) == File.separatorChar) { if (! f1.equals(f2.substring(0, f2.length() - 1))) return false; } else if (!f1.equals(f2)) return false; break; } if (readPerm && ! fp.readPerm) return false; if (writePerm && ! fp.writePerm) return false; if (executePerm && ! fp.executePerm) return false; if (deletePerm && ! fp.deletePerm) return false; return true; }
14,274
public boolean implies(Permission p) { if (! (p instanceof FilePermission)) return false; String f1 = getName(); if (f1.equals(ALL_FILES)) return true; FilePermission fp = (FilePermission) p; String f2 = fp.getName(); if (f1.charAt(0) != File.separatorChar) f1 = CURRENT_DIRECTORY + f1; if (f2.charAt(0) != File.separatorChar) f2 = CURRENT_DIRECTORY + f2; String sub1; switch (f1.charAt(f1.length() - 1)) { case '*': sub1 = f1.substring(0, f1.length() - 1); // chop off "*" if (f2.length() <= sub1.length()) { // If it's smaller, there is no way it could be part of // this directory. If it's the same (or length - 1), it // could be the same directory but specifies access to // the directory rather than the files in it. return false; } else if (f2.charAt(sub1.length() - 1) == File.separatorChar) { // Make sure the part before the "/" is the same. if (! f2.substring(0, sub1.length()).equals(sub1)) return false; // Make sure there are no subdirectories specified // underneath this one. if (f2.substring(sub1.length() + 1).indexOf(File.separatorChar) != -1) return false; } else { // Obviously not equal: f2 is either not a directory or // is not the same directory (its name continues further // than we want). return false; } break; case '-': // Chop off "/-". sub1 = f1.substring(0, f1.length() - 2); if (f2.length() < sub1.length()) { // If it's smaller, there is no way it could be part of // this directory. return false; } else if (f2.length() > sub1.length() && f2.charAt(sub1.length()) != File.separatorChar) return false; else if (! f2.substring(0, sub1.length()).equals(sub1)) return false; break; default: if (f2.charAt(f2.length() - 1) == File.separatorChar) { if (! f1.equals(f2.substring(0, f2.length() - 1))) return false; } else if (!f1.equals(f2)) return false; break; } if (readPerm && ! fp.readPerm) return false; if (writePerm && ! fp.writePerm) return false; if (executePerm && ! fp.executePerm) return false; if (deletePerm && ! fp.deletePerm) return false; return true; }
public boolean implies(Permission p) { if (! (p instanceof FilePermission)) return false; String f1 = getName(); if (f1.equals(ALL_FILES)) return true; FilePermission fp = (FilePermission) p; String f2 = fp.getName(); if (f1.charAt(0) != File.separatorChar) f1 = CURRENT_DIRECTORY + f1; if (f2.charAt(0) != File.separatorChar) f2 = CURRENT_DIRECTORY + f2; String sub1; switch (f1.charAt(f1.length() - 1)) { case '*': sub1 = f1.substring(0, f1.length() - 1); // chop off "*" if (f2.length() <= sub1.length()) { // If it's smaller, there is no way it could be part of // this directory. If it's the same (or length - 1), it // could be the same directory but specifies access to // the directory rather than the files in it. return false; } else if (f2.charAt(sub1.length() - 1) == File.separatorChar) { // Make sure the part before the "/" is the same. if (! f2.substring(0, sub1.length()).equals(sub1)) return false; // Make sure there are no subdirectories specified // underneath this one. if (f2.substring(sub1.length() + 1).indexOf(File.separatorChar) != -1) return false; } else { // Obviously not equal: f2 is either not a directory or // is not the same directory (its name continues further // than we want). return false; } break; case '-': // Chop off "/-". sub1 = f1.substring(0, f1.length() - 2); if (f2.length() < sub1.length()) { // If it's smaller, there is no way it could be part of // this directory. return false; } else if (f2.length() > sub1.length() && f2.charAt(sub1.length()) != File.separatorChar) return false; else if (! f2.substring(0, sub1.length()).equals(sub1)) return false; break; default: if (f2.charAt(f2.length() - 1) == File.separatorChar) { if (! f1.equals(f2.substring(0, f2.length() - 1))) return false; } else if (!f1.equals(f2)) return false; break; } if (fp.readPerm && ! readPerm) return false; if (writePerm && ! fp.writePerm) return false; if (executePerm && ! fp.executePerm) return false; if (deletePerm && ! fp.deletePerm) return false; return true; }
14,275
public boolean implies(Permission p) { if (! (p instanceof FilePermission)) return false; String f1 = getName(); if (f1.equals(ALL_FILES)) return true; FilePermission fp = (FilePermission) p; String f2 = fp.getName(); if (f1.charAt(0) != File.separatorChar) f1 = CURRENT_DIRECTORY + f1; if (f2.charAt(0) != File.separatorChar) f2 = CURRENT_DIRECTORY + f2; String sub1; switch (f1.charAt(f1.length() - 1)) { case '*': sub1 = f1.substring(0, f1.length() - 1); // chop off "*" if (f2.length() <= sub1.length()) { // If it's smaller, there is no way it could be part of // this directory. If it's the same (or length - 1), it // could be the same directory but specifies access to // the directory rather than the files in it. return false; } else if (f2.charAt(sub1.length() - 1) == File.separatorChar) { // Make sure the part before the "/" is the same. if (! f2.substring(0, sub1.length()).equals(sub1)) return false; // Make sure there are no subdirectories specified // underneath this one. if (f2.substring(sub1.length() + 1).indexOf(File.separatorChar) != -1) return false; } else { // Obviously not equal: f2 is either not a directory or // is not the same directory (its name continues further // than we want). return false; } break; case '-': // Chop off "/-". sub1 = f1.substring(0, f1.length() - 2); if (f2.length() < sub1.length()) { // If it's smaller, there is no way it could be part of // this directory. return false; } else if (f2.length() > sub1.length() && f2.charAt(sub1.length()) != File.separatorChar) return false; else if (! f2.substring(0, sub1.length()).equals(sub1)) return false; break; default: if (f2.charAt(f2.length() - 1) == File.separatorChar) { if (! f1.equals(f2.substring(0, f2.length() - 1))) return false; } else if (!f1.equals(f2)) return false; break; } if (readPerm && ! fp.readPerm) return false; if (writePerm && ! fp.writePerm) return false; if (executePerm && ! fp.executePerm) return false; if (deletePerm && ! fp.deletePerm) return false; return true; }
public boolean implies(Permission p) { if (! (p instanceof FilePermission)) return false; String f1 = getName(); if (f1.equals(ALL_FILES)) return true; FilePermission fp = (FilePermission) p; String f2 = fp.getName(); if (f1.charAt(0) != File.separatorChar) f1 = CURRENT_DIRECTORY + f1; if (f2.charAt(0) != File.separatorChar) f2 = CURRENT_DIRECTORY + f2; String sub1; switch (f1.charAt(f1.length() - 1)) { case '*': sub1 = f1.substring(0, f1.length() - 1); // chop off "*" if (f2.length() <= sub1.length()) { // If it's smaller, there is no way it could be part of // this directory. If it's the same (or length - 1), it // could be the same directory but specifies access to // the directory rather than the files in it. return false; } else if (f2.charAt(sub1.length() - 1) == File.separatorChar) { // Make sure the part before the "/" is the same. if (! f2.substring(0, sub1.length()).equals(sub1)) return false; // Make sure there are no subdirectories specified // underneath this one. if (f2.substring(sub1.length() + 1).indexOf(File.separatorChar) != -1) return false; } else { // Obviously not equal: f2 is either not a directory or // is not the same directory (its name continues further // than we want). return false; } break; case '-': // Chop off "/-". sub1 = f1.substring(0, f1.length() - 2); if (f2.length() < sub1.length()) { // If it's smaller, there is no way it could be part of // this directory. return false; } else if (f2.length() > sub1.length() && f2.charAt(sub1.length()) != File.separatorChar) return false; else if (! f2.substring(0, sub1.length()).equals(sub1)) return false; break; default: if (f2.charAt(f2.length() - 1) == File.separatorChar) { if (! f1.equals(f2.substring(0, f2.length() - 1))) return false; } else if (!f1.equals(f2)) return false; break; } if (readPerm && ! fp.readPerm) return false; if (fp.writePerm && ! writePerm) return false; if (executePerm && ! fp.executePerm) return false; if (deletePerm && ! fp.deletePerm) return false; return true; }
14,276
public boolean implies(Permission p) { if (! (p instanceof FilePermission)) return false; String f1 = getName(); if (f1.equals(ALL_FILES)) return true; FilePermission fp = (FilePermission) p; String f2 = fp.getName(); if (f1.charAt(0) != File.separatorChar) f1 = CURRENT_DIRECTORY + f1; if (f2.charAt(0) != File.separatorChar) f2 = CURRENT_DIRECTORY + f2; String sub1; switch (f1.charAt(f1.length() - 1)) { case '*': sub1 = f1.substring(0, f1.length() - 1); // chop off "*" if (f2.length() <= sub1.length()) { // If it's smaller, there is no way it could be part of // this directory. If it's the same (or length - 1), it // could be the same directory but specifies access to // the directory rather than the files in it. return false; } else if (f2.charAt(sub1.length() - 1) == File.separatorChar) { // Make sure the part before the "/" is the same. if (! f2.substring(0, sub1.length()).equals(sub1)) return false; // Make sure there are no subdirectories specified // underneath this one. if (f2.substring(sub1.length() + 1).indexOf(File.separatorChar) != -1) return false; } else { // Obviously not equal: f2 is either not a directory or // is not the same directory (its name continues further // than we want). return false; } break; case '-': // Chop off "/-". sub1 = f1.substring(0, f1.length() - 2); if (f2.length() < sub1.length()) { // If it's smaller, there is no way it could be part of // this directory. return false; } else if (f2.length() > sub1.length() && f2.charAt(sub1.length()) != File.separatorChar) return false; else if (! f2.substring(0, sub1.length()).equals(sub1)) return false; break; default: if (f2.charAt(f2.length() - 1) == File.separatorChar) { if (! f1.equals(f2.substring(0, f2.length() - 1))) return false; } else if (!f1.equals(f2)) return false; break; } if (readPerm && ! fp.readPerm) return false; if (writePerm && ! fp.writePerm) return false; if (executePerm && ! fp.executePerm) return false; if (deletePerm && ! fp.deletePerm) return false; return true; }
public boolean implies(Permission p) { if (! (p instanceof FilePermission)) return false; String f1 = getName(); if (f1.equals(ALL_FILES)) return true; FilePermission fp = (FilePermission) p; String f2 = fp.getName(); if (f1.charAt(0) != File.separatorChar) f1 = CURRENT_DIRECTORY + f1; if (f2.charAt(0) != File.separatorChar) f2 = CURRENT_DIRECTORY + f2; String sub1; switch (f1.charAt(f1.length() - 1)) { case '*': sub1 = f1.substring(0, f1.length() - 1); // chop off "*" if (f2.length() <= sub1.length()) { // If it's smaller, there is no way it could be part of // this directory. If it's the same (or length - 1), it // could be the same directory but specifies access to // the directory rather than the files in it. return false; } else if (f2.charAt(sub1.length() - 1) == File.separatorChar) { // Make sure the part before the "/" is the same. if (! f2.substring(0, sub1.length()).equals(sub1)) return false; // Make sure there are no subdirectories specified // underneath this one. if (f2.substring(sub1.length() + 1).indexOf(File.separatorChar) != -1) return false; } else { // Obviously not equal: f2 is either not a directory or // is not the same directory (its name continues further // than we want). return false; } break; case '-': // Chop off "/-". sub1 = f1.substring(0, f1.length() - 2); if (f2.length() < sub1.length()) { // If it's smaller, there is no way it could be part of // this directory. return false; } else if (f2.length() > sub1.length() && f2.charAt(sub1.length()) != File.separatorChar) return false; else if (! f2.substring(0, sub1.length()).equals(sub1)) return false; break; default: if (f2.charAt(f2.length() - 1) == File.separatorChar) { if (! f1.equals(f2.substring(0, f2.length() - 1))) return false; } else if (!f1.equals(f2)) return false; break; } if (readPerm && ! fp.readPerm) return false; if (writePerm && ! fp.writePerm) return false; if (fp.executePerm && ! executePerm) return false; if (deletePerm && ! fp.deletePerm) return false; return true; }
14,277
public boolean implies(Permission p) { if (! (p instanceof FilePermission)) return false; String f1 = getName(); if (f1.equals(ALL_FILES)) return true; FilePermission fp = (FilePermission) p; String f2 = fp.getName(); if (f1.charAt(0) != File.separatorChar) f1 = CURRENT_DIRECTORY + f1; if (f2.charAt(0) != File.separatorChar) f2 = CURRENT_DIRECTORY + f2; String sub1; switch (f1.charAt(f1.length() - 1)) { case '*': sub1 = f1.substring(0, f1.length() - 1); // chop off "*" if (f2.length() <= sub1.length()) { // If it's smaller, there is no way it could be part of // this directory. If it's the same (or length - 1), it // could be the same directory but specifies access to // the directory rather than the files in it. return false; } else if (f2.charAt(sub1.length() - 1) == File.separatorChar) { // Make sure the part before the "/" is the same. if (! f2.substring(0, sub1.length()).equals(sub1)) return false; // Make sure there are no subdirectories specified // underneath this one. if (f2.substring(sub1.length() + 1).indexOf(File.separatorChar) != -1) return false; } else { // Obviously not equal: f2 is either not a directory or // is not the same directory (its name continues further // than we want). return false; } break; case '-': // Chop off "/-". sub1 = f1.substring(0, f1.length() - 2); if (f2.length() < sub1.length()) { // If it's smaller, there is no way it could be part of // this directory. return false; } else if (f2.length() > sub1.length() && f2.charAt(sub1.length()) != File.separatorChar) return false; else if (! f2.substring(0, sub1.length()).equals(sub1)) return false; break; default: if (f2.charAt(f2.length() - 1) == File.separatorChar) { if (! f1.equals(f2.substring(0, f2.length() - 1))) return false; } else if (!f1.equals(f2)) return false; break; } if (readPerm && ! fp.readPerm) return false; if (writePerm && ! fp.writePerm) return false; if (executePerm && ! fp.executePerm) return false; if (deletePerm && ! fp.deletePerm) return false; return true; }
public boolean implies(Permission p) { if (! (p instanceof FilePermission)) return false; String f1 = getName(); if (f1.equals(ALL_FILES)) return true; FilePermission fp = (FilePermission) p; String f2 = fp.getName(); if (f1.charAt(0) != File.separatorChar) f1 = CURRENT_DIRECTORY + f1; if (f2.charAt(0) != File.separatorChar) f2 = CURRENT_DIRECTORY + f2; String sub1; switch (f1.charAt(f1.length() - 1)) { case '*': sub1 = f1.substring(0, f1.length() - 1); // chop off "*" if (f2.length() <= sub1.length()) { // If it's smaller, there is no way it could be part of // this directory. If it's the same (or length - 1), it // could be the same directory but specifies access to // the directory rather than the files in it. return false; } else if (f2.charAt(sub1.length() - 1) == File.separatorChar) { // Make sure the part before the "/" is the same. if (! f2.substring(0, sub1.length()).equals(sub1)) return false; // Make sure there are no subdirectories specified // underneath this one. if (f2.substring(sub1.length() + 1).indexOf(File.separatorChar) != -1) return false; } else { // Obviously not equal: f2 is either not a directory or // is not the same directory (its name continues further // than we want). return false; } break; case '-': // Chop off "/-". sub1 = f1.substring(0, f1.length() - 2); if (f2.length() < sub1.length()) { // If it's smaller, there is no way it could be part of // this directory. return false; } else if (f2.length() > sub1.length() && f2.charAt(sub1.length()) != File.separatorChar) return false; else if (! f2.substring(0, sub1.length()).equals(sub1)) return false; break; default: if (f2.charAt(f2.length() - 1) == File.separatorChar) { if (! f1.equals(f2.substring(0, f2.length() - 1))) return false; } else if (!f1.equals(f2)) return false; break; } if (readPerm && ! fp.readPerm) return false; if (writePerm && ! fp.writePerm) return false; if (executePerm && ! fp.executePerm) return false; if (fp.deletePerm && ! deletePerm) return false; return true; }
14,278
public void installUI(JComponent c) { c.setOpaque(true); c.setBackground(UIManager.getColor("control")); super.installUI(c); }
public void installUI(JComponent c) { c.setBackground(UIManager.getColor("control")); super.installUI(c); }
14,279
public void editingCanceled(ChangeEvent e) { editingPath = null; editingRow = -1; stopEditingInCompleteEditing = false; if (editingComponent != null) tree.remove(editingComponent.getParent()); editingComponent = null; if (cellEditor != null) { if (cellEditor instanceof DefaultTreeCellEditor) tree.removeTreeSelectionListener((DefaultTreeCellEditor) cellEditor); cellEditor.removeCellEditorListener(cellEditorListener); setCellEditor(null); createdCellEditor = false; } tree.requestFocusInWindow(false); editorTimer.stop(); isEditing = false; validCachedPreferredSize = false; tree.repaint(); }
public void editingCanceled(ChangeEvent e) { editingPath = null; editingRow = -1; stopEditingInCompleteEditing = false; if (editingComponent != null) tree.remove(editingComponent.getParent()); editingComponent = null; if (cellEditor != null) { if (cellEditor instanceof DefaultTreeCellEditor) tree.removeTreeSelectionListener((DefaultTreeCellEditor) cellEditor); cellEditor.removeCellEditorListener(cellEditorListener); setCellEditor(null); createdCellEditor = false; } tree.requestFocusInWindow(false); editorTimer.stop(); isEditing = false; validCachedPreferredSize = false; tree.repaint(); }
14,280
public void editingStopped(ChangeEvent e) { editingPath = null; editingRow = -1; stopEditingInCompleteEditing = false; if (editingComponent != null) { tree.remove(editingComponent.getParent()); editingComponent = null; } if (cellEditor != null) { newVal = ((JTextField) getCellEditor().getCellEditorValue()).getText(); completeEditing(false, false, true); if (cellEditor instanceof DefaultTreeCellEditor) tree.removeTreeSelectionListener((DefaultTreeCellEditor) cellEditor); cellEditor.removeCellEditorListener(cellEditorListener); setCellEditor(null); createdCellEditor = false; } isEditing = false; tree.requestFocusInWindow(false); editorTimer.stop(); validCachedPreferredSize = false; tree.repaint(); }
public void editingStopped(ChangeEvent e) { editingPath = null; editingRow = -1; stopEditingInCompleteEditing = false; if (editingComponent != null) { tree.remove(editingComponent.getParent()); editingComponent = null; } if (cellEditor != null) { newVal = ((JTextField) getCellEditor().getCellEditorValue()).getText(); completeEditing(false, false, true); if (cellEditor instanceof DefaultTreeCellEditor) tree.removeTreeSelectionListener((DefaultTreeCellEditor) cellEditor); cellEditor.removeCellEditorListener(cellEditorListener); setCellEditor(null); createdCellEditor = false; } isEditing = false; tree.requestFocusInWindow(false); editorTimer.stop(); validCachedPreferredSize = false; tree.repaint(); }
14,281
public void actionPerformed(ActionEvent e) { TreePath lead = tree.getLeadSelectionPath(); if (e.getActionCommand().equals("selectPreviousChangeLead") || e.getActionCommand().equals("selectPreviousExtendSelection") || e.getActionCommand().equals("selectPrevious") || e.getActionCommand().equals("selectNext") || e.getActionCommand().equals("selectNextExtendSelection") || e.getActionCommand().equals("selectNextChangeLead")) (new TreeIncrementAction(0, "")).actionPerformed(e); else if (e.getActionCommand().equals("selectParent") || e.getActionCommand().equals("selectChild")) (new TreeTraverseAction(0, "")).actionPerformed(e); else if (e.getActionCommand().equals("selectAll")) { TreePath[] paths = new TreePath[tree.getVisibleRowCount()]; Object curr = getNextVisibleNode(treeModel.getRoot()); int i = 0; while (curr != null && i < paths.length) { paths[i] = new TreePath(getPathToRoot(curr, 0)); i++; } tree.addSelectionPaths(paths); } else if (e.getActionCommand().equals("startEditing")) tree.startEditingAtPath(lead); else if (e.getActionCommand().equals("toggle")) { if (tree.isEditing()) tree.stopEditing(); else { Object last = lead.getLastPathComponent(); TreePath path = new TreePath(getPathToRoot(last, 0)); if (!treeModel.isLeaf(last)) toggleExpandState(path); } } else if (e.getActionCommand().equals("clearSelection")) tree.clearSelection(); if (tree.isEditing() && !e.getActionCommand().equals("startEditing")) tree.cancelEditing(); tree.scrollPathToVisible(lead); }
public void actionPerformed(ActionEvent e) { TreePath lead = tree.getLeadSelectionPath(); if (e.getActionCommand().equals("selectPreviousChangeLead") || e.getActionCommand().equals("selectPreviousExtendSelection") || e.getActionCommand().equals("selectPrevious") || e.getActionCommand().equals("selectNext") || e.getActionCommand().equals("selectNextExtendSelection") || e.getActionCommand().equals("selectNextChangeLead")) (new TreeIncrementAction(0, "")).actionPerformed(e); else if (e.getActionCommand().equals("selectParent") || e.getActionCommand().equals("selectChild")) (new TreeTraverseAction(0, "")).actionPerformed(e); else if (e.getActionCommand().equals("selectAll")) { TreePath[] paths = new TreePath[tree.getVisibleRowCount()]; Object curr = getNextVisibleNode(treeModel.getRoot()); int i = 0; while (curr != null && i < paths.length) { paths[i] = new TreePath(getPathToRoot(curr, 0)); i++; } tree.addSelectionPaths(paths); } else if (e.getActionCommand().equals("startEditing")) tree.startEditingAtPath(lead); else if (e.getActionCommand().equals("toggle")) { if (tree.isEditing()) tree.stopEditing(); else { Object last = lead.getLastPathComponent(); TreePath path = new TreePath(getPathToRoot(last, 0)); if (!treeModel.isLeaf(last)) toggleExpandState(path); } } else if (e.getActionCommand().equals("clearSelection")) tree.clearSelection(); if (tree.isEditing() && !e.getActionCommand().equals("startEditing")) tree.stopEditing(); tree.scrollPathToVisible(lead); }
14,283