rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
|
---|---|---|
public ValidationConsumer (EventConsumer next)
|
public ValidationConsumer ()
|
public ValidationConsumer (EventConsumer next) { super (next); setContentHandler (this); setDTDHandler (this); try { setProperty (DECL_HANDLER, this); } catch (Exception e) { /* "can't happen" */ } try { setProperty (LEXICAL_HANDLER, this); } catch (Exception e) { /* "can't happen" */ } }
|
super (next); setContentHandler (this); setDTDHandler (this); try { setProperty (DECL_HANDLER, this); } catch (Exception e) { } try { setProperty (LEXICAL_HANDLER, this); } catch (Exception e) { }
|
this (null);
|
public ValidationConsumer (EventConsumer next) { super (next); setContentHandler (this); setDTDHandler (this); try { setProperty (DECL_HANDLER, this); } catch (Exception e) { /* "can't happen" */ } try { setProperty (LEXICAL_HANDLER, this); } catch (Exception e) { /* "can't happen" */ } }
|
return symbols;
|
return (DecimalFormatSymbols) symbols.clone();
|
public DecimalFormatSymbols getDecimalFormatSymbols () { return symbols; }
|
symbols = newSymbols;
|
symbols = (DecimalFormatSymbols) newSymbols.clone();
|
public void setDecimalFormatSymbols (DecimalFormatSymbols newSymbols) { symbols = newSymbols; }
|
final ParsedArguments cmdLine = HELP_INFO.parse(args); final File entry = ARG_DIR.getFile(cmdLine); boolean deleteOk=false; if (!entry.exists()) { System.err.println(entry + " does not exist"); } if(entry.isDirectory()){ final File[] subFile=entry.listFiles(); for(int i=0;i<subFile.length;i++){ final String name=subFile[i].getName(); if(!name.equals(".") && !name.equals("..")){ System.err.println("Directory is not empty"); return; } } } deleteOk=entry.delete(); if(!deleteOk){ System.err.println(entry + " does not deleted"); }
|
new DeleteCommand().execute(new CommandLine(args), System.in, System.out, System.err);
|
public static void main(String[] args) throws Exception { final ParsedArguments cmdLine = HELP_INFO.parse(args); final File entry = ARG_DIR.getFile(cmdLine); boolean deleteOk=false; if (!entry.exists()) { System.err.println(entry + " does not exist"); } // for this time, delete only empty directory (wait implementation of -r option) if(entry.isDirectory()){ final File[] subFile=entry.listFiles(); for(int i=0;i<subFile.length;i++){ final String name=subFile[i].getName(); if(!name.equals(".") && !name.equals("..")){ System.err.println("Directory is not empty"); return; } } } deleteOk=entry.delete(); if(!deleteOk){ System.err.println(entry + " does not deleted"); } }
|
if(object == null || list.contains(object))
|
public void setSelectedItem(Object object) { selectedItem = object; if(object == null || list.contains(object)) fireContentsChanged(this, -1, -1); }
|
|
protected void fireIntervalAdded(Object source, int startIndex, int endIndex) {
|
protected void fireIntervalAdded (Object source, int startIndex, int endIndex) { ListDataEvent event; ListDataListener[] listeners; ListDataListener listener; int index;
|
protected void fireIntervalAdded(Object source, int startIndex, int endIndex) { // Variables ListDataEvent event; EventListener[] listeners; ListDataListener listener; int index; // Create Event event = new ListDataEvent(source, ListDataEvent.INTERVAL_ADDED, startIndex, endIndex); // Get Listeners listeners = listenerList.getListeners(ListDataListener.class); // Process Listeners for (index = 0; index < listeners.length; index++) { listener = (ListDataListener) listeners[index]; listener.intervalAdded(event); } // for } // fireIntervalAdded()
|
ListDataEvent event; EventListener[] listeners; ListDataListener listener; int index;
|
event = new ListDataEvent (source, ListDataEvent.INTERVAL_ADDED, startIndex, endIndex);
|
protected void fireIntervalAdded(Object source, int startIndex, int endIndex) { // Variables ListDataEvent event; EventListener[] listeners; ListDataListener listener; int index; // Create Event event = new ListDataEvent(source, ListDataEvent.INTERVAL_ADDED, startIndex, endIndex); // Get Listeners listeners = listenerList.getListeners(ListDataListener.class); // Process Listeners for (index = 0; index < listeners.length; index++) { listener = (ListDataListener) listeners[index]; listener.intervalAdded(event); } // for } // fireIntervalAdded()
|
event = new ListDataEvent(source, ListDataEvent.INTERVAL_ADDED, startIndex, endIndex);
|
listeners = getListDataListeners ();
|
protected void fireIntervalAdded(Object source, int startIndex, int endIndex) { // Variables ListDataEvent event; EventListener[] listeners; ListDataListener listener; int index; // Create Event event = new ListDataEvent(source, ListDataEvent.INTERVAL_ADDED, startIndex, endIndex); // Get Listeners listeners = listenerList.getListeners(ListDataListener.class); // Process Listeners for (index = 0; index < listeners.length; index++) { listener = (ListDataListener) listeners[index]; listener.intervalAdded(event); } // for } // fireIntervalAdded()
|
listeners = listenerList.getListeners(ListDataListener.class); for (index = 0; index < listeners.length; index++) { listener = (ListDataListener) listeners[index]; listener.intervalAdded(event); } }
|
for (index = 0; index < listeners.length; index++) { listener = listeners [index]; listener.intervalAdded (event); } }
|
protected void fireIntervalAdded(Object source, int startIndex, int endIndex) { // Variables ListDataEvent event; EventListener[] listeners; ListDataListener listener; int index; // Create Event event = new ListDataEvent(source, ListDataEvent.INTERVAL_ADDED, startIndex, endIndex); // Get Listeners listeners = listenerList.getListeners(ListDataListener.class); // Process Listeners for (index = 0; index < listeners.length; index++) { listener = (ListDataListener) listeners[index]; listener.intervalAdded(event); } // for } // fireIntervalAdded()
|
protected void fireIntervalRemoved(Object source, int startIndex, int endIndex) {
|
protected void fireIntervalRemoved (Object source, int startIndex, int endIndex) { ListDataEvent event; ListDataListener[] listeners; ListDataListener listener; int index;
|
protected void fireIntervalRemoved(Object source, int startIndex, int endIndex) { // Variables ListDataEvent event; EventListener[] listeners; ListDataListener listener; int index; // Create Event event = new ListDataEvent(source, ListDataEvent.INTERVAL_REMOVED, startIndex, endIndex); // Get Listeners listeners = listenerList.getListeners(ListDataListener.class); // Process Listeners for (index = 0; index < listeners.length; index++) { listener = (ListDataListener) listeners[index]; listener.intervalRemoved(event); } // for } // fireIntervalRemoved()
|
ListDataEvent event; EventListener[] listeners; ListDataListener listener; int index;
|
event = new ListDataEvent (source, ListDataEvent.INTERVAL_REMOVED, startIndex, endIndex);
|
protected void fireIntervalRemoved(Object source, int startIndex, int endIndex) { // Variables ListDataEvent event; EventListener[] listeners; ListDataListener listener; int index; // Create Event event = new ListDataEvent(source, ListDataEvent.INTERVAL_REMOVED, startIndex, endIndex); // Get Listeners listeners = listenerList.getListeners(ListDataListener.class); // Process Listeners for (index = 0; index < listeners.length; index++) { listener = (ListDataListener) listeners[index]; listener.intervalRemoved(event); } // for } // fireIntervalRemoved()
|
event = new ListDataEvent(source, ListDataEvent.INTERVAL_REMOVED, startIndex, endIndex);
|
listeners = getListDataListeners ();
|
protected void fireIntervalRemoved(Object source, int startIndex, int endIndex) { // Variables ListDataEvent event; EventListener[] listeners; ListDataListener listener; int index; // Create Event event = new ListDataEvent(source, ListDataEvent.INTERVAL_REMOVED, startIndex, endIndex); // Get Listeners listeners = listenerList.getListeners(ListDataListener.class); // Process Listeners for (index = 0; index < listeners.length; index++) { listener = (ListDataListener) listeners[index]; listener.intervalRemoved(event); } // for } // fireIntervalRemoved()
|
listeners = listenerList.getListeners(ListDataListener.class); for (index = 0; index < listeners.length; index++) { listener = (ListDataListener) listeners[index]; listener.intervalRemoved(event); } }
|
for (index = 0; index < listeners.length; index++) { listener = listeners [index]; listener.intervalRemoved (event); } }
|
protected void fireIntervalRemoved(Object source, int startIndex, int endIndex) { // Variables ListDataEvent event; EventListener[] listeners; ListDataListener listener; int index; // Create Event event = new ListDataEvent(source, ListDataEvent.INTERVAL_REMOVED, startIndex, endIndex); // Get Listeners listeners = listenerList.getListeners(ListDataListener.class); // Process Listeners for (index = 0; index < listeners.length; index++) { listener = (ListDataListener) listeners[index]; listener.intervalRemoved(event); } // for } // fireIntervalRemoved()
|
throw new DomEx(DomEx.NOT_SUPPORTED_ERR);
|
throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR);
|
public Node adoptNode(Node source) { switch (source.getNodeType()) { case DOCUMENT_NODE: case DOCUMENT_TYPE_NODE: throw new DomEx(DomEx.NOT_SUPPORTED_ERR); case ENTITY_NODE: case NOTATION_NODE: throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR); } if (source instanceof DomNode) { DomNode src = (DomNode) source; DomNode dst = src; if (dst.parent != null) { dst = (DomNode) dst.cloneNode(true); } dst.setOwner(this); src.notifyUserDataHandlers(UserDataHandler.NODE_ADOPTED, src, dst); return dst; } return null; }
|
throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR);
|
throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
|
public Node adoptNode(Node source) { switch (source.getNodeType()) { case DOCUMENT_NODE: case DOCUMENT_TYPE_NODE: throw new DomEx(DomEx.NOT_SUPPORTED_ERR); case ENTITY_NODE: case NOTATION_NODE: throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR); } if (source instanceof DomNode) { DomNode src = (DomNode) source; DomNode dst = src; if (dst.parent != null) { dst = (DomNode) dst.cloneNode(true); } dst.setOwner(this); src.notifyUserDataHandlers(UserDataHandler.NODE_ADOPTED, src, dst); return dst; } return null; }
|
throw new DomEx(DomEx.NAMESPACE_ERR, name, null, 0);
|
throw new DomDOMException(DOMException.NAMESPACE_ERR, name, null, 0);
|
static void checkNCName(String name, boolean xml11) { checkName(name, xml11); int len = name.length(); int index = name.indexOf(':'); if (index != -1) { if (index == 0 || index == (len - 1) || name.lastIndexOf(':') != index) { throw new DomEx(DomEx.NAMESPACE_ERR, name, null, 0); } } }
|
throw new DomEx (DomEx.NAMESPACE_ERR, name, null, 0);
|
throw new DomDOMException(DOMException.NAMESPACE_ERR, name, null, 0);
|
static void checkName(String name, boolean xml11) { if (name == null) { throw new DomEx (DomEx.NAMESPACE_ERR, name, null, 0); } int len = name.length(); if (len == 0) { throw new DomEx (DomEx.NAMESPACE_ERR, name, null, 0); } // dog: rewritten to use the rules for XML 1.0 and 1.1 // Name start character char c = name.charAt(0); if (xml11) { // XML 1.1 if ((c < 0x0041 || c > 0x005a) && (c < 0x0061 || c > 0x007a) && c != ':' && c != '_' && (c < 0x00c0 || c > 0x00d6) && (c < 0x00d8 || c > 0x00f6) && (c < 0x00f8 || c > 0x02ff) && (c < 0x0370 || c > 0x037d) && (c < 0x037f || c > 0x1fff) && (c < 0x200c || c > 0x200d) && (c < 0x2070 || c > 0x218f) && (c < 0x2c00 || c > 0x2fef) && (c < 0x3001 || c > 0xd7ff) && (c < 0xf900 || c > 0xfdcf) && (c < 0xfdf0 || c > 0xfffd) && (c < 0x10000 || c > 0xeffff)) { throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); } } else { // XML 1.0 int type = Character.getType(c); switch (type) { case Character.LOWERCASE_LETTER: // Ll case Character.UPPERCASE_LETTER: // Lu case Character.OTHER_LETTER: // Lo case Character.TITLECASE_LETTER: // Lt case Character.LETTER_NUMBER: // Nl if ((c > 0xf900 && c < 0xfffe) || (c >= 0x20dd && c <= 0x20e0)) { // Compatibility area and Unicode 2.0 exclusions throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); } break; default: if (c != ':' && c != '_' && (c < 0x02bb || c > 0x02c1) && c != 0x0559 && c != 0x06e5 && c != 0x06e6) { throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); } } } // Subsequent characters for (int i = 1; i < len; i++) { c = name.charAt(i); if (xml11) { // XML 1.1 if ((c < 0x0041 || c > 0x005a) && (c < 0x0061 || c > 0x007a) && (c < 0x0030 || c > 0x0039) && c != ':' && c != '_' && c != '-' && c != '.' && (c < 0x00c0 || c > 0x00d6) && (c < 0x00d8 || c > 0x00f6) && (c < 0x00f8 || c > 0x02ff) && (c < 0x0370 || c > 0x037d) && (c < 0x037f || c > 0x1fff) && (c < 0x200c || c > 0x200d) && (c < 0x2070 || c > 0x218f) && (c < 0x2c00 || c > 0x2fef) && (c < 0x3001 || c > 0xd7ff) && (c < 0xf900 || c > 0xfdcf) && (c < 0xfdf0 || c > 0xfffd) && (c < 0x10000 || c > 0xeffff) && c != 0x00b7 && (c < 0x0300 || c > 0x036f) && (c < 0x203f || c > 0x2040)) { throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); } } else { // XML 1.0 int type = Character.getType(c); switch (type) { case Character.LOWERCASE_LETTER: // Ll case Character.UPPERCASE_LETTER: // Lu case Character.DECIMAL_DIGIT_NUMBER: // Nd case Character.OTHER_LETTER: // Lo case Character.TITLECASE_LETTER: // Lt case Character.LETTER_NUMBER: // Nl case Character.COMBINING_SPACING_MARK: // Mc case Character.ENCLOSING_MARK: // Me case Character.NON_SPACING_MARK: // Mn case Character.MODIFIER_LETTER: // Lm if ((c > 0xf900 && c < 0xfffe) || (c >= 0x20dd && c <= 0x20e0)) { // Compatibility area and Unicode 2.0 exclusions throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); } break; default: if (c != '-' && c != '.' && c != ':' && c != '_' && c != 0x0387 && (c < 0x02bb || c > 0x02c1) && c != 0x0559 && c != 0x06e5 && c != 0x06e6 && c != 0x00b7) { throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); } } } } // FIXME characters with a font or compatibility decomposition (i.e. // those with a "compatibility formatting tag" in field 5 of the // database -- marked by field 5 beginning with a "<") are not allowed. }
|
throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c);
|
throw new DomDOMException(DOMException.INVALID_CHARACTER_ERR, name, null, c);
|
static void checkName(String name, boolean xml11) { if (name == null) { throw new DomEx (DomEx.NAMESPACE_ERR, name, null, 0); } int len = name.length(); if (len == 0) { throw new DomEx (DomEx.NAMESPACE_ERR, name, null, 0); } // dog: rewritten to use the rules for XML 1.0 and 1.1 // Name start character char c = name.charAt(0); if (xml11) { // XML 1.1 if ((c < 0x0041 || c > 0x005a) && (c < 0x0061 || c > 0x007a) && c != ':' && c != '_' && (c < 0x00c0 || c > 0x00d6) && (c < 0x00d8 || c > 0x00f6) && (c < 0x00f8 || c > 0x02ff) && (c < 0x0370 || c > 0x037d) && (c < 0x037f || c > 0x1fff) && (c < 0x200c || c > 0x200d) && (c < 0x2070 || c > 0x218f) && (c < 0x2c00 || c > 0x2fef) && (c < 0x3001 || c > 0xd7ff) && (c < 0xf900 || c > 0xfdcf) && (c < 0xfdf0 || c > 0xfffd) && (c < 0x10000 || c > 0xeffff)) { throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); } } else { // XML 1.0 int type = Character.getType(c); switch (type) { case Character.LOWERCASE_LETTER: // Ll case Character.UPPERCASE_LETTER: // Lu case Character.OTHER_LETTER: // Lo case Character.TITLECASE_LETTER: // Lt case Character.LETTER_NUMBER: // Nl if ((c > 0xf900 && c < 0xfffe) || (c >= 0x20dd && c <= 0x20e0)) { // Compatibility area and Unicode 2.0 exclusions throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); } break; default: if (c != ':' && c != '_' && (c < 0x02bb || c > 0x02c1) && c != 0x0559 && c != 0x06e5 && c != 0x06e6) { throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); } } } // Subsequent characters for (int i = 1; i < len; i++) { c = name.charAt(i); if (xml11) { // XML 1.1 if ((c < 0x0041 || c > 0x005a) && (c < 0x0061 || c > 0x007a) && (c < 0x0030 || c > 0x0039) && c != ':' && c != '_' && c != '-' && c != '.' && (c < 0x00c0 || c > 0x00d6) && (c < 0x00d8 || c > 0x00f6) && (c < 0x00f8 || c > 0x02ff) && (c < 0x0370 || c > 0x037d) && (c < 0x037f || c > 0x1fff) && (c < 0x200c || c > 0x200d) && (c < 0x2070 || c > 0x218f) && (c < 0x2c00 || c > 0x2fef) && (c < 0x3001 || c > 0xd7ff) && (c < 0xf900 || c > 0xfdcf) && (c < 0xfdf0 || c > 0xfffd) && (c < 0x10000 || c > 0xeffff) && c != 0x00b7 && (c < 0x0300 || c > 0x036f) && (c < 0x203f || c > 0x2040)) { throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); } } else { // XML 1.0 int type = Character.getType(c); switch (type) { case Character.LOWERCASE_LETTER: // Ll case Character.UPPERCASE_LETTER: // Lu case Character.DECIMAL_DIGIT_NUMBER: // Nd case Character.OTHER_LETTER: // Lo case Character.TITLECASE_LETTER: // Lt case Character.LETTER_NUMBER: // Nl case Character.COMBINING_SPACING_MARK: // Mc case Character.ENCLOSING_MARK: // Me case Character.NON_SPACING_MARK: // Mn case Character.MODIFIER_LETTER: // Lm if ((c > 0xf900 && c < 0xfffe) || (c >= 0x20dd && c <= 0x20e0)) { // Compatibility area and Unicode 2.0 exclusions throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); } break; default: if (c != '-' && c != '.' && c != ':' && c != '_' && c != 0x0387 && (c < 0x02bb || c > 0x02c1) && c != 0x0559 && c != 0x06e5 && c != 0x06e6 && c != 0x00b7) { throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); } } } } // FIXME characters with a font or compatibility decomposition (i.e. // those with a "compatibility formatting tag" in field 5 of the // database -- marked by field 5 beginning with a "<") are not allowed. }
|
throw new DomEx (DomEx.HIERARCHY_REQUEST_ERR,
|
throw new DomDOMException(DOMException.HIERARCHY_REQUEST_ERR,
|
private void checkNewChild(Node newChild) { if (newChild.getNodeType() == ELEMENT_NODE && getDocumentElement() != null) { throw new DomEx (DomEx.HIERARCHY_REQUEST_ERR, "document element already present: " + getDocumentElement(), newChild, 0); } if (newChild.getNodeType() == DOCUMENT_TYPE_NODE && getDoctype() != null) { throw new DomEx (DomEx.HIERARCHY_REQUEST_ERR, "document type already present: " + getDoctype(), newChild, 0); } }
|
throw new DomEx(DomEx.NAMESPACE_ERR,
|
throw new DomDOMException(DOMException.NAMESPACE_ERR,
|
public Attr createAttributeNS(String namespaceURI, String name) { if (checkingCharacters) { checkNCName(name, "1.1".equals(version)); } if ("".equals(namespaceURI)) { namespaceURI = null; } if (name.startsWith ("xml:")) { if (namespaceURI == null) { namespaceURI = XMLConstants.XML_NS_URI; } else if (!XMLConstants.XML_NS_URI.equals(namespaceURI)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xml namespace is always " + XMLConstants.XML_NS_URI, this, 0); } } else if (XMLConstants.XMLNS_ATTRIBUTE.equals(name) || name.startsWith("xmlns:")) { if (namespaceURI == null) { namespaceURI = XMLConstants.XMLNS_ATTRIBUTE_NS_URI; } else if (!XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xmlns namespace must be " + XMLConstants.XMLNS_ATTRIBUTE_NS_URI, this, 0); } } else if (namespaceURI == null && name.indexOf(':') != -1) { throw new DomEx(DomEx.NAMESPACE_ERR, "prefixed name needs a URI: " + name, this, 0); } return new DomAttr(this, namespaceURI, name); }
|
return new DomCDATA(this, value);
|
return new DomCDATASection(this, value);
|
public CDATASection createCDATASection(String value) { if (checkingCharacters) { checkChar(value, "1.1".equals(version)); } return new DomCDATA(this, value); }
|
return new DomFragment(this);
|
return new DomDocumentFragment(this);
|
public DocumentFragment createDocumentFragment() { return new DomFragment(this); }
|
throw new DomEx(DomEx.NAMESPACE_ERR,
|
throw new DomDOMException(DOMException.NAMESPACE_ERR,
|
public Element createElementNS(String namespaceURI, String name) { if (checkingCharacters) { checkNCName(name, "1.1".equals(version)); } if ("".equals(namespaceURI)) { namespaceURI = null; } if (name.startsWith("xml:")) { if (namespaceURI != null && !XMLConstants.XML_NS_URI.equals(namespaceURI)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xml namespace is always " + XMLConstants.XML_NS_URI, this, 0); } namespaceURI = XMLConstants.XML_NS_URI; } else if (XMLConstants.XMLNS_ATTRIBUTE.equals(name) || name.startsWith("xmlns:")) { throw new DomEx(DomEx.NAMESPACE_ERR, "xmlns is reserved", this, 0); } else if (namespaceURI == null && name.indexOf(':') != -1) { throw new DomEx(DomEx.NAMESPACE_ERR, "prefixed name '" + name + "' needs a URI", this, 0); } Element element = new DomElement(this, namespaceURI, name); defaultAttributes(element, name); return element; }
|
throw new DomEx(DomEx.NAMESPACE_ERR, "prefixed name '" + name + "' needs a URI", this, 0);
|
throw new DomDOMException(DOMException.NAMESPACE_ERR, "prefixed name '" + name + "' needs a URI", this, 0);
|
public Element createElementNS(String namespaceURI, String name) { if (checkingCharacters) { checkNCName(name, "1.1".equals(version)); } if ("".equals(namespaceURI)) { namespaceURI = null; } if (name.startsWith("xml:")) { if (namespaceURI != null && !XMLConstants.XML_NS_URI.equals(namespaceURI)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xml namespace is always " + XMLConstants.XML_NS_URI, this, 0); } namespaceURI = XMLConstants.XML_NS_URI; } else if (XMLConstants.XMLNS_ATTRIBUTE.equals(name) || name.startsWith("xmlns:")) { throw new DomEx(DomEx.NAMESPACE_ERR, "xmlns is reserved", this, 0); } else if (namespaceURI == null && name.indexOf(':') != -1) { throw new DomEx(DomEx.NAMESPACE_ERR, "prefixed name '" + name + "' needs a URI", this, 0); } Element element = new DomElement(this, namespaceURI, name); defaultAttributes(element, name); return element; }
|
throw new DomEx(DomEx.SYNTAX_ERR, "illegal PI target name", this, 0);
|
throw new DomDOMException(DOMException.SYNTAX_ERR, "illegal PI target name", this, 0);
|
public ProcessingInstruction createProcessingInstruction(String target, String data) { if (checkingCharacters) { boolean xml11 = "1.1".equals(version); checkName(target, xml11); if ("xml".equalsIgnoreCase(target)) { throw new DomEx(DomEx.SYNTAX_ERR, "illegal PI target name", this, 0); } checkChar(data, xml11); } return new DomPI(this, target, data); }
|
return new DomPI(this, target, data);
|
return new DomProcessingInstruction(this, target, data);
|
public ProcessingInstruction createProcessingInstruction(String target, String data) { if (checkingCharacters) { boolean xml11 = "1.1".equals(version); checkName(target, xml11); if ("xml".equalsIgnoreCase(target)) { throw new DomEx(DomEx.SYNTAX_ERR, "illegal PI target name", this, 0); } checkChar(data, xml11); } return new DomPI(this, target, data); }
|
dst = new DomFragment(this);
|
dst = new DomDocumentFragment(this);
|
public Node importNode(Node src, boolean deep) { Node dst = null; switch (src.getNodeType()) { case TEXT_NODE: dst = createTextNode(src.getNodeValue()); break; case CDATA_SECTION_NODE: dst = createCDATASection(src.getNodeValue()); break; case COMMENT_NODE: dst = createComment(src.getNodeValue()); break; case PROCESSING_INSTRUCTION_NODE: dst = createProcessingInstruction(src.getNodeName(), src.getNodeValue()); break; case NOTATION_NODE: // NOTE: There's no standard way to create // these, or add them to a doctype. Useless. Notation notation = (Notation) src; dst = new DomNotation(this, notation.getNodeName(), notation.getPublicId(), notation.getSystemId()); break; case ENTITY_NODE: // NOTE: There's no standard way to create // these, or add them to a doctype. Useless. Entity entity = (Entity) src; dst = new DomEntity(this, entity.getNodeName(), entity.getPublicId(), entity.getSystemId(), entity.getNotationName()); if (deep) { for (Node ctx = src.getFirstChild(); ctx != null; ctx = ctx.getNextSibling()) { dst.appendChild(importNode(ctx, deep)); } } break; case ENTITY_REFERENCE_NODE: dst = createEntityReference(src.getNodeName()); break; case DOCUMENT_FRAGMENT_NODE: dst = new DomFragment(this); if (deep) { for (Node ctx = src.getFirstChild(); ctx != null; ctx = ctx.getNextSibling()) { dst.appendChild(importNode(ctx, deep)); } } break; case ATTRIBUTE_NODE: String attr_nsuri = src.getNamespaceURI(); if (attr_nsuri != null) { dst = createAttributeNS(attr_nsuri, src.getNodeName()); } else { dst = createAttribute(src.getNodeName()); } // this is _always_ done regardless of "deep" setting for (Node ctx = src.getFirstChild(); ctx != null; ctx = ctx.getNextSibling()) { dst.appendChild(importNode(ctx, false)); } break; case ELEMENT_NODE: String elem_nsuri = src.getNamespaceURI(); if (elem_nsuri != null) { dst = createElementNS(elem_nsuri, src.getNodeName()); } else { dst = createElement(src.getNodeName()); } NamedNodeMap srcAttrs = src.getAttributes(); NamedNodeMap dstAttrs = dst.getAttributes(); int len = srcAttrs.getLength(); for (int i = 0; i < len; i++) { Attr a = (Attr) srcAttrs.item(i); Attr dflt; // maybe update defaulted attributes dflt = (Attr) dstAttrs.getNamedItem(a.getNodeName()); if (dflt != null) { String newval = a.getNodeValue(); if (!dflt.getNodeValue().equals(newval) || a.getSpecified () == true) { dflt.setNodeValue (newval); } continue; } dstAttrs.setNamedItem((Attr) importNode(a, false)); } if (deep) { for (Node ctx = src.getFirstChild(); ctx != null; ctx = ctx.getNextSibling()) { dst.appendChild(importNode(ctx, true)); } } break; // can't import document or doctype nodes case DOCUMENT_NODE: case DOCUMENT_TYPE_NODE: // FALLTHROUGH // can't import unrecognized or nonstandard nodes default: throw new DomEx(DomEx.NOT_SUPPORTED_ERR, null, src, 0); } // FIXME cleanup a bit -- for deep copies, copy those // children in one place, here (code sharing is healthy) if (src instanceof DomNode) { ((DomNode) src).notifyUserDataHandlers(UserDataHandler.NODE_IMPORTED, src, dst); } return dst; }
|
throw new DomEx(DomEx.NOT_SUPPORTED_ERR, null, src, 0);
|
throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR, null, src, 0);
|
public Node importNode(Node src, boolean deep) { Node dst = null; switch (src.getNodeType()) { case TEXT_NODE: dst = createTextNode(src.getNodeValue()); break; case CDATA_SECTION_NODE: dst = createCDATASection(src.getNodeValue()); break; case COMMENT_NODE: dst = createComment(src.getNodeValue()); break; case PROCESSING_INSTRUCTION_NODE: dst = createProcessingInstruction(src.getNodeName(), src.getNodeValue()); break; case NOTATION_NODE: // NOTE: There's no standard way to create // these, or add them to a doctype. Useless. Notation notation = (Notation) src; dst = new DomNotation(this, notation.getNodeName(), notation.getPublicId(), notation.getSystemId()); break; case ENTITY_NODE: // NOTE: There's no standard way to create // these, or add them to a doctype. Useless. Entity entity = (Entity) src; dst = new DomEntity(this, entity.getNodeName(), entity.getPublicId(), entity.getSystemId(), entity.getNotationName()); if (deep) { for (Node ctx = src.getFirstChild(); ctx != null; ctx = ctx.getNextSibling()) { dst.appendChild(importNode(ctx, deep)); } } break; case ENTITY_REFERENCE_NODE: dst = createEntityReference(src.getNodeName()); break; case DOCUMENT_FRAGMENT_NODE: dst = new DomFragment(this); if (deep) { for (Node ctx = src.getFirstChild(); ctx != null; ctx = ctx.getNextSibling()) { dst.appendChild(importNode(ctx, deep)); } } break; case ATTRIBUTE_NODE: String attr_nsuri = src.getNamespaceURI(); if (attr_nsuri != null) { dst = createAttributeNS(attr_nsuri, src.getNodeName()); } else { dst = createAttribute(src.getNodeName()); } // this is _always_ done regardless of "deep" setting for (Node ctx = src.getFirstChild(); ctx != null; ctx = ctx.getNextSibling()) { dst.appendChild(importNode(ctx, false)); } break; case ELEMENT_NODE: String elem_nsuri = src.getNamespaceURI(); if (elem_nsuri != null) { dst = createElementNS(elem_nsuri, src.getNodeName()); } else { dst = createElement(src.getNodeName()); } NamedNodeMap srcAttrs = src.getAttributes(); NamedNodeMap dstAttrs = dst.getAttributes(); int len = srcAttrs.getLength(); for (int i = 0; i < len; i++) { Attr a = (Attr) srcAttrs.item(i); Attr dflt; // maybe update defaulted attributes dflt = (Attr) dstAttrs.getNamedItem(a.getNodeName()); if (dflt != null) { String newval = a.getNodeValue(); if (!dflt.getNodeValue().equals(newval) || a.getSpecified () == true) { dflt.setNodeValue (newval); } continue; } dstAttrs.setNamedItem((Attr) importNode(a, false)); } if (deep) { for (Node ctx = src.getFirstChild(); ctx != null; ctx = ctx.getNextSibling()) { dst.appendChild(importNode(ctx, true)); } } break; // can't import document or doctype nodes case DOCUMENT_NODE: case DOCUMENT_TYPE_NODE: // FALLTHROUGH // can't import unrecognized or nonstandard nodes default: throw new DomEx(DomEx.NOT_SUPPORTED_ERR, null, src, 0); } // FIXME cleanup a bit -- for deep copies, copy those // children in one place, here (code sharing is healthy) if (src instanceof DomNode) { ((DomNode) src).notifyUserDataHandlers(UserDataHandler.NODE_IMPORTED, src, dst); } return dst; }
|
throw new DomEx(DomEx.NOT_FOUND_ERR);
|
throw new DomDOMException(DOMException.NOT_FOUND_ERR);
|
public Node renameNode(Node n, String namespaceURI, String qualifiedName) throws DOMException { if (n instanceof DomNsNode) { DomNsNode src = (DomNsNode) n; if (src == null) { throw new DomEx(DomEx.NOT_FOUND_ERR); } if (src.owner != this) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, src, 0); } boolean xml11 = "1.1".equals(version); checkName(qualifiedName, xml11); int ci = qualifiedName.indexOf(':'); if ("".equals(namespaceURI)) { namespaceURI = null; } if (namespaceURI != null) { checkNCName(qualifiedName, xml11); String prefix = (ci == -1) ? "" : qualifiedName.substring(0, ci); if (XMLConstants.XML_NS_PREFIX.equals(prefix) && !XMLConstants.XML_NS_URI.equals(namespaceURI)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xml namespace must be " + XMLConstants.XML_NS_URI, src, 0); } else if (src.nodeType == ATTRIBUTE_NODE && (XMLConstants.XMLNS_ATTRIBUTE.equals(prefix) || XMLConstants.XMLNS_ATTRIBUTE.equals(qualifiedName)) && !XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xmlns namespace must be " + XMLConstants.XMLNS_ATTRIBUTE_NS_URI, src, 0); } if (XMLConstants.XML_NS_URI.equals(namespaceURI) && !XMLConstants.XML_NS_PREFIX.equals(prefix)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xml namespace must be " + XMLConstants.XML_NS_URI, src, 0); } else if (src.nodeType == ATTRIBUTE_NODE && XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI) && !(XMLConstants.XMLNS_ATTRIBUTE.equals(prefix) || XMLConstants.XMLNS_ATTRIBUTE.equals(qualifiedName))) { throw new DomEx(DomEx.NAMESPACE_ERR, "xmlns namespace must be " + XMLConstants.XMLNS_ATTRIBUTE_NS_URI, src, 0); } } src.setNodeName(qualifiedName); src.setNamespaceURI(namespaceURI); src.notifyUserDataHandlers(UserDataHandler.NODE_RENAMED, src, src); // TODO MutationNameEvents // DOMElementNameChanged or DOMAttributeNameChanged return src; } throw new DomEx(DomEx.NOT_SUPPORTED_ERR, null, n, 0); }
|
throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, src, 0);
|
throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR, null, src, 0);
|
public Node renameNode(Node n, String namespaceURI, String qualifiedName) throws DOMException { if (n instanceof DomNsNode) { DomNsNode src = (DomNsNode) n; if (src == null) { throw new DomEx(DomEx.NOT_FOUND_ERR); } if (src.owner != this) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, src, 0); } boolean xml11 = "1.1".equals(version); checkName(qualifiedName, xml11); int ci = qualifiedName.indexOf(':'); if ("".equals(namespaceURI)) { namespaceURI = null; } if (namespaceURI != null) { checkNCName(qualifiedName, xml11); String prefix = (ci == -1) ? "" : qualifiedName.substring(0, ci); if (XMLConstants.XML_NS_PREFIX.equals(prefix) && !XMLConstants.XML_NS_URI.equals(namespaceURI)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xml namespace must be " + XMLConstants.XML_NS_URI, src, 0); } else if (src.nodeType == ATTRIBUTE_NODE && (XMLConstants.XMLNS_ATTRIBUTE.equals(prefix) || XMLConstants.XMLNS_ATTRIBUTE.equals(qualifiedName)) && !XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xmlns namespace must be " + XMLConstants.XMLNS_ATTRIBUTE_NS_URI, src, 0); } if (XMLConstants.XML_NS_URI.equals(namespaceURI) && !XMLConstants.XML_NS_PREFIX.equals(prefix)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xml namespace must be " + XMLConstants.XML_NS_URI, src, 0); } else if (src.nodeType == ATTRIBUTE_NODE && XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI) && !(XMLConstants.XMLNS_ATTRIBUTE.equals(prefix) || XMLConstants.XMLNS_ATTRIBUTE.equals(qualifiedName))) { throw new DomEx(DomEx.NAMESPACE_ERR, "xmlns namespace must be " + XMLConstants.XMLNS_ATTRIBUTE_NS_URI, src, 0); } } src.setNodeName(qualifiedName); src.setNamespaceURI(namespaceURI); src.notifyUserDataHandlers(UserDataHandler.NODE_RENAMED, src, src); // TODO MutationNameEvents // DOMElementNameChanged or DOMAttributeNameChanged return src; } throw new DomEx(DomEx.NOT_SUPPORTED_ERR, null, n, 0); }
|
throw new DomEx(DomEx.NAMESPACE_ERR,
|
throw new DomDOMException(DOMException.NAMESPACE_ERR,
|
public Node renameNode(Node n, String namespaceURI, String qualifiedName) throws DOMException { if (n instanceof DomNsNode) { DomNsNode src = (DomNsNode) n; if (src == null) { throw new DomEx(DomEx.NOT_FOUND_ERR); } if (src.owner != this) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, src, 0); } boolean xml11 = "1.1".equals(version); checkName(qualifiedName, xml11); int ci = qualifiedName.indexOf(':'); if ("".equals(namespaceURI)) { namespaceURI = null; } if (namespaceURI != null) { checkNCName(qualifiedName, xml11); String prefix = (ci == -1) ? "" : qualifiedName.substring(0, ci); if (XMLConstants.XML_NS_PREFIX.equals(prefix) && !XMLConstants.XML_NS_URI.equals(namespaceURI)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xml namespace must be " + XMLConstants.XML_NS_URI, src, 0); } else if (src.nodeType == ATTRIBUTE_NODE && (XMLConstants.XMLNS_ATTRIBUTE.equals(prefix) || XMLConstants.XMLNS_ATTRIBUTE.equals(qualifiedName)) && !XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xmlns namespace must be " + XMLConstants.XMLNS_ATTRIBUTE_NS_URI, src, 0); } if (XMLConstants.XML_NS_URI.equals(namespaceURI) && !XMLConstants.XML_NS_PREFIX.equals(prefix)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xml namespace must be " + XMLConstants.XML_NS_URI, src, 0); } else if (src.nodeType == ATTRIBUTE_NODE && XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI) && !(XMLConstants.XMLNS_ATTRIBUTE.equals(prefix) || XMLConstants.XMLNS_ATTRIBUTE.equals(qualifiedName))) { throw new DomEx(DomEx.NAMESPACE_ERR, "xmlns namespace must be " + XMLConstants.XMLNS_ATTRIBUTE_NS_URI, src, 0); } } src.setNodeName(qualifiedName); src.setNamespaceURI(namespaceURI); src.notifyUserDataHandlers(UserDataHandler.NODE_RENAMED, src, src); // TODO MutationNameEvents // DOMElementNameChanged or DOMAttributeNameChanged return src; } throw new DomEx(DomEx.NOT_SUPPORTED_ERR, null, n, 0); }
|
throw new DomEx(DomEx.NOT_SUPPORTED_ERR, null, n, 0);
|
throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR, null, n, 0);
|
public Node renameNode(Node n, String namespaceURI, String qualifiedName) throws DOMException { if (n instanceof DomNsNode) { DomNsNode src = (DomNsNode) n; if (src == null) { throw new DomEx(DomEx.NOT_FOUND_ERR); } if (src.owner != this) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, src, 0); } boolean xml11 = "1.1".equals(version); checkName(qualifiedName, xml11); int ci = qualifiedName.indexOf(':'); if ("".equals(namespaceURI)) { namespaceURI = null; } if (namespaceURI != null) { checkNCName(qualifiedName, xml11); String prefix = (ci == -1) ? "" : qualifiedName.substring(0, ci); if (XMLConstants.XML_NS_PREFIX.equals(prefix) && !XMLConstants.XML_NS_URI.equals(namespaceURI)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xml namespace must be " + XMLConstants.XML_NS_URI, src, 0); } else if (src.nodeType == ATTRIBUTE_NODE && (XMLConstants.XMLNS_ATTRIBUTE.equals(prefix) || XMLConstants.XMLNS_ATTRIBUTE.equals(qualifiedName)) && !XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xmlns namespace must be " + XMLConstants.XMLNS_ATTRIBUTE_NS_URI, src, 0); } if (XMLConstants.XML_NS_URI.equals(namespaceURI) && !XMLConstants.XML_NS_PREFIX.equals(prefix)) { throw new DomEx(DomEx.NAMESPACE_ERR, "xml namespace must be " + XMLConstants.XML_NS_URI, src, 0); } else if (src.nodeType == ATTRIBUTE_NODE && XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI) && !(XMLConstants.XMLNS_ATTRIBUTE.equals(prefix) || XMLConstants.XMLNS_ATTRIBUTE.equals(qualifiedName))) { throw new DomEx(DomEx.NAMESPACE_ERR, "xmlns namespace must be " + XMLConstants.XMLNS_ATTRIBUTE_NS_URI, src, 0); } } src.setNodeName(qualifiedName); src.setNamespaceURI(namespaceURI); src.notifyUserDataHandlers(UserDataHandler.NODE_RENAMED, src, src); // TODO MutationNameEvents // DOMElementNameChanged or DOMAttributeNameChanged return src; } throw new DomEx(DomEx.NOT_SUPPORTED_ERR, null, n, 0); }
|
throw new DomEx(DomEx.NOT_SUPPORTED_ERR);
|
throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR);
|
public void setXmlVersion(String xmlVersion) { if (xmlVersion == null) { xmlVersion = "1.0"; } if ("1.0".equals(xmlVersion) || "1.1".equals(xmlVersion)) { version = xmlVersion; } else { throw new DomEx(DomEx.NOT_SUPPORTED_ERR); } }
|
NamedValue returns, ExceptionList exceptions, ContextList ctx_list
|
NamedValue returns
|
Request _create_request(Context context, String operation, NVList parameters, NamedValue returns, ExceptionList exceptions, ContextList ctx_list );
|
NVList parameters, NamedValue returns, ExceptionList exceptions, ContextList ctx_list
|
NVList parameters, NamedValue returns
|
public abstract Request create_request(org.omg.CORBA.Object target, Context context, String operation, NVList parameters, NamedValue returns, ExceptionList exceptions, ContextList ctx_list );
|
ParameterNode(TemplateNode children, TemplateNode next, String name, Expr select, boolean global)
|
ParameterNode(String name, Expr select, boolean global)
|
ParameterNode(TemplateNode children, TemplateNode next, String name, Expr select, boolean global) { super(children, next); this.name = name; this.select = select; this.global = global; }
|
super(children, next);
|
ParameterNode(TemplateNode children, TemplateNode next, String name, Expr select, boolean global) { super(children, next); this.name = name; this.select = select; this.global = global; }
|
|
return new ParameterNode((children == null) ? null : children.clone(stylesheet), (next == null) ? null : next.clone(stylesheet), name,
|
TemplateNode ret = new ParameterNode(name,
|
TemplateNode clone(Stylesheet stylesheet) { return new ParameterNode((children == null) ? null : children.clone(stylesheet), (next == null) ? null : next.clone(stylesheet), name, select.clone(stylesheet), global); }
|
if (children != null) { ret.children = children.clone(stylesheet); } if (next != null) { ret.next = next.clone(stylesheet); } return ret;
|
TemplateNode clone(Stylesheet stylesheet) { return new ParameterNode((children == null) ? null : children.clone(stylesheet), (next == null) ? null : next.clone(stylesheet), name, select.clone(stylesheet), global); }
|
|
log.setLevel(Level.DEBUG);
|
public Ext2File(INode iNode) { this.iNode=iNode; valid = true; }
|
|
throw new IOException("EXT2 implementation is currently readonly");
|
long blockSize = iNode.getExt2FileSystem().getBlockSize(); if(length<getLength()) { long blockNr = length / blockSize; long blockOffset = length % blockSize; long nextBlock; if(blockOffset==0) nextBlock=blockNr; else nextBlock=blockNr+1; for(long i=iNode.getAllocatedBlockCount()-1; i>=nextBlock; i--) { log.debug("setLength(): freeing up block "+i+" of inode"); try{ iNode.freeDataBlock(i); }catch(FileSystemException fse) { throw new IOException(fse); } } iNode.setSize(length); try{ iNode.update(); }catch(FileSystemException fse) { throw new IOException(fse); } iNode.getExt2FileSystem().updateFS(); return; } if(length>getLength()) { long len = length - getLength(); long blocksAllocated = getLengthInBlocks(); long bytesAllocated = getLength(); long bytesCovered=0; while( bytesCovered < len ) { long blockIndex = (bytesAllocated+bytesCovered) / blockSize; long blockOffset = (bytesAllocated+bytesCovered) % blockSize; long newSection = Math.min(len-bytesCovered, blockSize - blockOffset); if(blockIndex >= blocksAllocated) { try{ iNode.allocateDataBlock(blockIndex); }catch(FileSystemException fe) { throw new IOException("Internal filesystem exception",fe); } blocksAllocated++; } bytesCovered += newSection; } iNode.setSize(length); return; }
|
public void setLength(long length) throws IOException { throw new IOException("EXT2 implementation is currently readonly"); }
|
throw new IOException("EXT2 implementation is currently readonly");
|
if(fileOffset > getLength()) throw new IOException("Can't write beyond the end of the file! (fileOffset: "+ fileOffset+", getLength()"+getLength()); if(off+len>src.length) throw new IOException("src is shorter than what you want to write"); log.debug("write(fileOffset="+fileOffset+", src, off, len="+len+")"); final long blockSize = iNode.getExt2FileSystem().getBlockSize(); long blocksAllocated = iNode.getAllocatedBlockCount(); long bytesWritten=0; while( bytesWritten < len ) { long blockIndex = (fileOffset+bytesWritten) / blockSize; long blockOffset = (fileOffset+bytesWritten) % blockSize; long copyLength = Math.min(len-bytesWritten, blockSize - blockOffset); byte[] dest; if( !( (blockOffset==0)&&(copyLength==blockSize) ) && (blockIndex < blocksAllocated)) dest = iNode.getDataBlock(blockIndex); else dest = new byte[(int)blockSize]; System.arraycopy( src, (int)(off+bytesWritten), dest, (int)blockOffset, (int)copyLength); if(blockIndex >= blocksAllocated) { try{ iNode.allocateDataBlock(blockIndex); }catch(FileSystemException fe) { throw new IOException("Internal filesystem exception",fe); } blocksAllocated++; } iNode.writeDataBlock(blockIndex, dest); bytesWritten += copyLength; } iNode.setSize( fileOffset+len ); try{ iNode.update(); }catch(FileSystemException fse) { throw new IOException(fse); } iNode.getExt2FileSystem().updateFS();
|
public void write(long fileOffset, byte[] src, int off, int len) throws IOException { throw new IOException("EXT2 implementation is currently readonly"); }
|
serialVersionOnStream = 1;
|
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); if (serialVersionOnStream < 1) { monetarySeparator = decimalSeparator; exponential = 'E'; serialVersionOnStream = 1; } }
|
|
if (serialVersionOnStream < 2) locale = Locale.getDefault(); serialVersionOnStream = 2;
|
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); if (serialVersionOnStream < 1) { monetarySeparator = decimalSeparator; exponential = 'E'; serialVersionOnStream = 1; } }
|
|
public static Currency getInstance (String currencyCode)
|
public static Currency getInstance (Locale locale)
|
public static Currency getInstance (String currencyCode) { Locale[] all_locales = Locale.getAvailableLocales (); for (int i=0;i<all_locales.length;i++) { Currency test_currency = getInstance (all_locales[i]); if (test_currency.getCurrencyCode() != null && test_currency.getCurrencyCode().equals(currencyCode)) return test_currency; } return null; }
|
Locale[] all_locales = Locale.getAvailableLocales (); for (int i=0;i<all_locales.length;i++)
|
Currency newCurrency; newCurrency = (Currency) cache.get(locale); if (newCurrency == null)
|
public static Currency getInstance (String currencyCode) { Locale[] all_locales = Locale.getAvailableLocales (); for (int i=0;i<all_locales.length;i++) { Currency test_currency = getInstance (all_locales[i]); if (test_currency.getCurrencyCode() != null && test_currency.getCurrencyCode().equals(currencyCode)) return test_currency; } return null; }
|
Currency test_currency = getInstance (all_locales[i]); if (test_currency.getCurrencyCode() != null && test_currency.getCurrencyCode().equals(currencyCode)) return test_currency;
|
newCurrency = new Currency (locale); cache.put(locale, newCurrency);
|
public static Currency getInstance (String currencyCode) { Locale[] all_locales = Locale.getAvailableLocales (); for (int i=0;i<all_locales.length;i++) { Currency test_currency = getInstance (all_locales[i]); if (test_currency.getCurrencyCode() != null && test_currency.getCurrencyCode().equals(currencyCode)) return test_currency; } return null; }
|
return null;
|
return newCurrency;
|
public static Currency getInstance (String currencyCode) { Locale[] all_locales = Locale.getAvailableLocales (); for (int i=0;i<all_locales.length;i++) { Currency test_currency = getInstance (all_locales[i]); if (test_currency.getCurrencyCode() != null && test_currency.getCurrencyCode().equals(currencyCode)) return test_currency; } return null; }
|
if (! remEx && !force) throw new CompilationError(m[i].getName() + ", defined in " + c.getName() + ", does not throw " + RemoteException.class.getName()); }
|
} if (! remEx && !force) throw new CompilationError(m[i].getName() + ", defined in " + c.getName() + ", does not throw " + RemoteException.class.getName());
|
public synchronized void compile(Class remote) { reset(); String s; // Get the package. s = remote.getName(); int p = s.lastIndexOf('.'); if (p < 0) { // Root package. packag = ""; implName = name = s; } else { packag = s.substring(0, p); implName = name = s.substring(p + 1); } name = convertStubName(name); stubName = name; vars.put("#name", name); vars.put("#package", packag); vars.put("#implName", implName); if (verbose) System.out.println("Package " + packag + ", name " + name + " impl " + implName); // Get the implemented remotes. Class[] interfaces = remote.getInterfaces(); for (int i = 0; i < interfaces.length; i++) { if (Remote.class.isAssignableFrom(interfaces[i])) { if (! interfaces[i].equals(Remote.class)) { implementedRemotes.add(interfaces[i]); } } } vars.put("#idList", getIdList(implementedRemotes)); // Collect and process methods. Iterator iter = implementedRemotes.iterator(); while (iter.hasNext()) { Class c = (Class) iter.next(); Method[] m = c.getMethods(); // Check if throws RemoteException. for (int i = 0; i < m.length; i++) { Class[] exc = m[i].getExceptionTypes(); boolean remEx = false; for (int j = 0; j < exc.length; j++) { if (RemoteException.class.isAssignableFrom(exc[j])) { remEx = true; break; } if (! remEx && !force) throw new CompilationError(m[i].getName() + ", defined in " + c.getName() + ", does not throw " + RemoteException.class.getName()); } AbstractMethodGenerator mm = createMethodGenerator(m[i]); methods.add(mm); } } }
|
public void addChangeListener(ChangeListener listener);
|
void addChangeListener(ChangeListener listener);
|
public void addChangeListener(ChangeListener listener);
|
public int getSelectedIndex();
|
int getSelectedIndex();
|
public int getSelectedIndex();
|
public void removeChangeListener(ChangeListener listener);
|
void removeChangeListener(ChangeListener listener);
|
public void removeChangeListener(ChangeListener listener);
|
protected ImageReaderWriterSpi()
|
public ImageReaderWriterSpi()
|
protected ImageReaderWriterSpi() { }
|
String classname = p[i].getProperty("AlgorithmParameterGenerator." + algorithm); if (classname != null) return getInstance(classname, algorithm, p[i]);
|
return getInstance(algorithm, p[i]);
|
public static AlgorithmParameterGenerator getInstance(String algorithm) throws NoSuchAlgorithmException { Provider[] p = Security.getProviders(); for (int i = 0; i < p.length; i++) { String classname = p[i].getProperty("AlgorithmParameterGenerator." + algorithm); if (classname != null) return getInstance(classname, algorithm, p[i]); } throw new NoSuchAlgorithmException(algorithm); }
|
catch (NoSuchAlgorithmException ignored) {}
|
public static AlgorithmParameterGenerator getInstance(String algorithm) throws NoSuchAlgorithmException { Provider[] p = Security.getProviders(); for (int i = 0; i < p.length; i++) { String classname = p[i].getProperty("AlgorithmParameterGenerator." + algorithm); if (classname != null) return getInstance(classname, algorithm, p[i]); } throw new NoSuchAlgorithmException(algorithm); }
|
|
this.id = id;
|
name = id; flags = 0;
|
protected Tag(String id) { this.id = id; }
|
public UnknownTag(String id)
|
public UnknownTag(String name)
|
public UnknownTag(String id) { super(id); }
|
super(id);
|
super(name);
|
public UnknownTag(String id) { super(id); }
|
UIDefaults defaults = UIManager.getLookAndFeelDefaults(); activeBorder = defaults.getBorder("ToolTip.border"); inactiveBorder = defaults.getBorder("ToolTip.borderInactive"); isAcceleratorHidden = defaults.getBoolean("ToolTip.hideAccelerator"); acceleratorFont = defaults.getFont("MenuItem.acceleratorFont"); acceleratorForeground = defaults.getColor("MenuItem.acceleratorForeground"); acceleratorDelimiter = defaults.getString("MenuItem.acceleratorDelimiter");
|
public MetalToolTipUI() { super(); }
|
|
private int findClosestTick(int value)
|
int findClosestTick(int value)
|
private int findClosestTick(int value) { int min = slider.getMinimum(); int max = slider.getMaximum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); // The default value to return is value + minor or // value + major. // Initializing at min - value leaves us with a default // return value of min, which always has tick marks // (if ticks are painted). int minor = min - value; int major = min - value; // If there are no major tick marks or minor tick marks // e.g. snap is set to true but no ticks are set, then // we can just return the value. if (majorSpace <= 0 && minorSpace <= 0) return value; // First check the major ticks. if (majorSpace > 0) { int lowerBound = (value - min) / majorSpace; int majLower = majorSpace * lowerBound + min; int majHigher = majorSpace * (lowerBound + 1) + min; if (majHigher <= max && majHigher - value <= value - majLower) major = majHigher - value; else major = majLower - value; } if (minorSpace > 0) { int lowerBound = value / minorSpace; int minLower = minorSpace * lowerBound; int minHigher = minorSpace * (lowerBound + 1); if (minHigher <= max && minHigher - value <= value - minLower) minor = minHigher - value; else minor = minLower - value; } // Give preference to minor ticks if (Math.abs(minor) > Math.abs(major)) return value + major; else return value + minor; }
|
if (SwingButtonPeer.this.awtComponent != null) retVal = SwingButtonPeer.this.awtComponent.isShowing();
|
if (button != null) retVal = button.isShowing();
|
public boolean isShowing() { boolean retVal = false; if (SwingButtonPeer.this.awtComponent != null) retVal = SwingButtonPeer.this.awtComponent.isShowing(); return retVal; }
|
SwingButton button = new SwingButton();
|
SwingButton button = new SwingButton(theButton);
|
public SwingButtonPeer(Button theButton) { SwingButton button = new SwingButton(); button.setText(theButton.getLabel()); button.addActionListener(new SwingButtonListener()); init(theButton, button); }
|
if (isSet[HOUR_OF_DAY]) hour = fields[HOUR_OF_DAY]; else if (isSet[HOUR])
|
if (isSet[HOUR])
|
protected synchronized void computeTime() { int millisInDay = 0; int era = fields[ERA]; int year = fields[YEAR]; int month = fields[MONTH]; int day = fields[DAY_OF_MONTH]; int minute = fields[MINUTE]; int second = fields[SECOND]; int millis = fields[MILLISECOND]; int[] month_days = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; int[] dayCount = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; int hour = 0; if (! isLenient()) nonLeniencyCheck(); if (! isSet[MONTH]) { // 5: YEAR + DAY_OF_WEEK + WEEK_OF_YEAR if (isSet[DAY_OF_WEEK] || isSet[WEEK_OF_YEAR]) { int first = getFirstDayOfMonth(year, 0); int offs; if ((8 - first) >= getMinimalDaysInFirstWeek()) // start counting on first week offs = 1; else offs = 1 + (8 - first); month = 0; day = offs + 7 * (fields[WEEK_OF_YEAR] - 1); day += fields[DAY_OF_WEEK] - first; } else { // 4: YEAR + DAY_OF_YEAR month = 0; day = fields[DAY_OF_YEAR]; } } else { if (isSet[DAY_OF_WEEK]) { int first = getFirstDayOfMonth(year, month); // 3: YEAR + MONTH + DAY_OF_WEEK_IN_MONTH + DAY_OF_WEEK if (isSet[DAY_OF_WEEK_IN_MONTH]) { int offs = fields[DAY_OF_WEEK] - first; if (offs < 0) offs += 7; day = 1 + 7 * (fields[DAY_OF_WEEK_IN_MONTH] - 1); day += offs; } else { // 2: YEAR + MONTH + WEEK_OF_MONTH + DAY_OF_WEEK day = 1 + 7 * (fields[WEEK_OF_MONTH] - 1); day += fields[DAY_OF_WEEK] - first; } } // 1: YEAR + MONTH + DAY_OF_MONTH } if (era == BC && year > 0) year = 1 - year; // rest of code assumes day/month/year set // should negative BC years be AD? // get the hour (but no check for validity) if (isSet[HOUR_OF_DAY]) hour = fields[HOUR_OF_DAY]; else if (isSet[HOUR]) { hour = fields[HOUR]; if (isSet[AM_PM] && fields[AM_PM] == PM) if (hour != 12) /* not Noon */ hour += 12; /* Fix the problem of the status of 12:00 AM (midnight). */ if (isSet[AM_PM] && fields[AM_PM] == AM && hour == 12) hour = 0; } // Read the era,year,month,day fields and convert as appropriate. // Calculate number of milliseconds into the day // This takes care of both h, m, s, ms over/underflows. long allMillis = (((hour * 60L) + minute) * 60L + second) * 1000L + millis; day += allMillis / (24 * 60 * 60 * 1000L); millisInDay = (int) (allMillis % (24 * 60 * 60 * 1000L)); if (month < 0) { year += (int) month / 12; month = month % 12; if (month < 0) { month += 12; year--; } } if (month > 11) { year += (month / 12); month = month % 12; } month_days[1] = isLeapYear(year) ? 29 : 28; while (day <= 0) { if (month == 0) { year--; month_days[1] = isLeapYear(year) ? 29 : 28; } month = (month + 11) % 12; day += month_days[month]; } while (day > month_days[month]) { day -= (month_days[month]); month = (month + 1) % 12; if (month == 0) { year++; month_days[1] = isLeapYear(year) ? 29 : 28; } } // ok, by here we have valid day,month,year,era and millisinday int dayOfYear = dayCount[month] + day - 1; // (day starts on 1) if (isLeapYear(year) && month > 1) dayOfYear++; int relativeDay = (year - 1) * 365 + ((year - 1) >> 2) + dayOfYear - EPOCH_DAYS; // gregorian days from 1 to epoch. int gregFactor = (int) Math.floor((double) (year - 1) / 400.) - (int) Math.floor((double) (year - 1) / 100.); if ((relativeDay + gregFactor) * 60L * 60L * 24L * 1000L >= gregorianCutover) relativeDay += gregFactor; else relativeDay -= 2; time = relativeDay * (24 * 60 * 60 * 1000L) + millisInDay; // the epoch was a Thursday. int weekday = (int) (relativeDay + THURSDAY) % 7; if (weekday <= 0) weekday += 7; fields[DAY_OF_WEEK] = weekday; TimeZone zone = getTimeZone(); int rawOffset = zone.getRawOffset(); int dstOffset = zone.getOffset((year < 1) ? BC : AD, (year < 1) ? 1 - year : year, month, day, weekday, millisInDay) - zone.getRawOffset(); time -= (rawOffset + dstOffset); isTimeSet = true; }
|
if (isSet[AM_PM] && fields[AM_PM] == PM)
|
if (fields[AM_PM] == PM)
|
protected synchronized void computeTime() { int millisInDay = 0; int era = fields[ERA]; int year = fields[YEAR]; int month = fields[MONTH]; int day = fields[DAY_OF_MONTH]; int minute = fields[MINUTE]; int second = fields[SECOND]; int millis = fields[MILLISECOND]; int[] month_days = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; int[] dayCount = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; int hour = 0; if (! isLenient()) nonLeniencyCheck(); if (! isSet[MONTH]) { // 5: YEAR + DAY_OF_WEEK + WEEK_OF_YEAR if (isSet[DAY_OF_WEEK] || isSet[WEEK_OF_YEAR]) { int first = getFirstDayOfMonth(year, 0); int offs; if ((8 - first) >= getMinimalDaysInFirstWeek()) // start counting on first week offs = 1; else offs = 1 + (8 - first); month = 0; day = offs + 7 * (fields[WEEK_OF_YEAR] - 1); day += fields[DAY_OF_WEEK] - first; } else { // 4: YEAR + DAY_OF_YEAR month = 0; day = fields[DAY_OF_YEAR]; } } else { if (isSet[DAY_OF_WEEK]) { int first = getFirstDayOfMonth(year, month); // 3: YEAR + MONTH + DAY_OF_WEEK_IN_MONTH + DAY_OF_WEEK if (isSet[DAY_OF_WEEK_IN_MONTH]) { int offs = fields[DAY_OF_WEEK] - first; if (offs < 0) offs += 7; day = 1 + 7 * (fields[DAY_OF_WEEK_IN_MONTH] - 1); day += offs; } else { // 2: YEAR + MONTH + WEEK_OF_MONTH + DAY_OF_WEEK day = 1 + 7 * (fields[WEEK_OF_MONTH] - 1); day += fields[DAY_OF_WEEK] - first; } } // 1: YEAR + MONTH + DAY_OF_MONTH } if (era == BC && year > 0) year = 1 - year; // rest of code assumes day/month/year set // should negative BC years be AD? // get the hour (but no check for validity) if (isSet[HOUR_OF_DAY]) hour = fields[HOUR_OF_DAY]; else if (isSet[HOUR]) { hour = fields[HOUR]; if (isSet[AM_PM] && fields[AM_PM] == PM) if (hour != 12) /* not Noon */ hour += 12; /* Fix the problem of the status of 12:00 AM (midnight). */ if (isSet[AM_PM] && fields[AM_PM] == AM && hour == 12) hour = 0; } // Read the era,year,month,day fields and convert as appropriate. // Calculate number of milliseconds into the day // This takes care of both h, m, s, ms over/underflows. long allMillis = (((hour * 60L) + minute) * 60L + second) * 1000L + millis; day += allMillis / (24 * 60 * 60 * 1000L); millisInDay = (int) (allMillis % (24 * 60 * 60 * 1000L)); if (month < 0) { year += (int) month / 12; month = month % 12; if (month < 0) { month += 12; year--; } } if (month > 11) { year += (month / 12); month = month % 12; } month_days[1] = isLeapYear(year) ? 29 : 28; while (day <= 0) { if (month == 0) { year--; month_days[1] = isLeapYear(year) ? 29 : 28; } month = (month + 11) % 12; day += month_days[month]; } while (day > month_days[month]) { day -= (month_days[month]); month = (month + 1) % 12; if (month == 0) { year++; month_days[1] = isLeapYear(year) ? 29 : 28; } } // ok, by here we have valid day,month,year,era and millisinday int dayOfYear = dayCount[month] + day - 1; // (day starts on 1) if (isLeapYear(year) && month > 1) dayOfYear++; int relativeDay = (year - 1) * 365 + ((year - 1) >> 2) + dayOfYear - EPOCH_DAYS; // gregorian days from 1 to epoch. int gregFactor = (int) Math.floor((double) (year - 1) / 400.) - (int) Math.floor((double) (year - 1) / 100.); if ((relativeDay + gregFactor) * 60L * 60L * 24L * 1000L >= gregorianCutover) relativeDay += gregFactor; else relativeDay -= 2; time = relativeDay * (24 * 60 * 60 * 1000L) + millisInDay; // the epoch was a Thursday. int weekday = (int) (relativeDay + THURSDAY) % 7; if (weekday <= 0) weekday += 7; fields[DAY_OF_WEEK] = weekday; TimeZone zone = getTimeZone(); int rawOffset = zone.getRawOffset(); int dstOffset = zone.getOffset((year < 1) ? BC : AD, (year < 1) ? 1 - year : year, month, day, weekday, millisInDay) - zone.getRawOffset(); time -= (rawOffset + dstOffset); isTimeSet = true; }
|
if (isSet[AM_PM] && fields[AM_PM] == AM && hour == 12)
|
if (fields[AM_PM] == AM && hour == 12)
|
protected synchronized void computeTime() { int millisInDay = 0; int era = fields[ERA]; int year = fields[YEAR]; int month = fields[MONTH]; int day = fields[DAY_OF_MONTH]; int minute = fields[MINUTE]; int second = fields[SECOND]; int millis = fields[MILLISECOND]; int[] month_days = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; int[] dayCount = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; int hour = 0; if (! isLenient()) nonLeniencyCheck(); if (! isSet[MONTH]) { // 5: YEAR + DAY_OF_WEEK + WEEK_OF_YEAR if (isSet[DAY_OF_WEEK] || isSet[WEEK_OF_YEAR]) { int first = getFirstDayOfMonth(year, 0); int offs; if ((8 - first) >= getMinimalDaysInFirstWeek()) // start counting on first week offs = 1; else offs = 1 + (8 - first); month = 0; day = offs + 7 * (fields[WEEK_OF_YEAR] - 1); day += fields[DAY_OF_WEEK] - first; } else { // 4: YEAR + DAY_OF_YEAR month = 0; day = fields[DAY_OF_YEAR]; } } else { if (isSet[DAY_OF_WEEK]) { int first = getFirstDayOfMonth(year, month); // 3: YEAR + MONTH + DAY_OF_WEEK_IN_MONTH + DAY_OF_WEEK if (isSet[DAY_OF_WEEK_IN_MONTH]) { int offs = fields[DAY_OF_WEEK] - first; if (offs < 0) offs += 7; day = 1 + 7 * (fields[DAY_OF_WEEK_IN_MONTH] - 1); day += offs; } else { // 2: YEAR + MONTH + WEEK_OF_MONTH + DAY_OF_WEEK day = 1 + 7 * (fields[WEEK_OF_MONTH] - 1); day += fields[DAY_OF_WEEK] - first; } } // 1: YEAR + MONTH + DAY_OF_MONTH } if (era == BC && year > 0) year = 1 - year; // rest of code assumes day/month/year set // should negative BC years be AD? // get the hour (but no check for validity) if (isSet[HOUR_OF_DAY]) hour = fields[HOUR_OF_DAY]; else if (isSet[HOUR]) { hour = fields[HOUR]; if (isSet[AM_PM] && fields[AM_PM] == PM) if (hour != 12) /* not Noon */ hour += 12; /* Fix the problem of the status of 12:00 AM (midnight). */ if (isSet[AM_PM] && fields[AM_PM] == AM && hour == 12) hour = 0; } // Read the era,year,month,day fields and convert as appropriate. // Calculate number of milliseconds into the day // This takes care of both h, m, s, ms over/underflows. long allMillis = (((hour * 60L) + minute) * 60L + second) * 1000L + millis; day += allMillis / (24 * 60 * 60 * 1000L); millisInDay = (int) (allMillis % (24 * 60 * 60 * 1000L)); if (month < 0) { year += (int) month / 12; month = month % 12; if (month < 0) { month += 12; year--; } } if (month > 11) { year += (month / 12); month = month % 12; } month_days[1] = isLeapYear(year) ? 29 : 28; while (day <= 0) { if (month == 0) { year--; month_days[1] = isLeapYear(year) ? 29 : 28; } month = (month + 11) % 12; day += month_days[month]; } while (day > month_days[month]) { day -= (month_days[month]); month = (month + 1) % 12; if (month == 0) { year++; month_days[1] = isLeapYear(year) ? 29 : 28; } } // ok, by here we have valid day,month,year,era and millisinday int dayOfYear = dayCount[month] + day - 1; // (day starts on 1) if (isLeapYear(year) && month > 1) dayOfYear++; int relativeDay = (year - 1) * 365 + ((year - 1) >> 2) + dayOfYear - EPOCH_DAYS; // gregorian days from 1 to epoch. int gregFactor = (int) Math.floor((double) (year - 1) / 400.) - (int) Math.floor((double) (year - 1) / 100.); if ((relativeDay + gregFactor) * 60L * 60L * 24L * 1000L >= gregorianCutover) relativeDay += gregFactor; else relativeDay -= 2; time = relativeDay * (24 * 60 * 60 * 1000L) + millisInDay; // the epoch was a Thursday. int weekday = (int) (relativeDay + THURSDAY) % 7; if (weekday <= 0) weekday += 7; fields[DAY_OF_WEEK] = weekday; TimeZone zone = getTimeZone(); int rawOffset = zone.getRawOffset(); int dstOffset = zone.getOffset((year < 1) ? BC : AD, (year < 1) ? 1 - year : year, month, day, weekday, millisInDay) - zone.getRawOffset(); time -= (rawOffset + dstOffset); isTimeSet = true; }
|
int rawOffset = zone.getRawOffset(); int dstOffset = zone.getOffset((year < 1) ? BC : AD, (year < 1) ? 1 - year : year, month, day, weekday, millisInDay) - zone.getRawOffset(); time -= (rawOffset + dstOffset);
|
int rawOffset = isSet[ZONE_OFFSET] ? fields[ZONE_OFFSET] : zone.getRawOffset(); int dstOffset = isSet[DST_OFFSET] ? fields[DST_OFFSET] : (zone.getOffset((year < 0) ? BC : AD, (year < 0) ? 1 - year : year, month, day, weekday, millisInDay) - zone.getRawOffset()); time -= rawOffset + dstOffset;
|
protected synchronized void computeTime() { int millisInDay = 0; int era = fields[ERA]; int year = fields[YEAR]; int month = fields[MONTH]; int day = fields[DAY_OF_MONTH]; int minute = fields[MINUTE]; int second = fields[SECOND]; int millis = fields[MILLISECOND]; int[] month_days = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; int[] dayCount = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; int hour = 0; if (! isLenient()) nonLeniencyCheck(); if (! isSet[MONTH]) { // 5: YEAR + DAY_OF_WEEK + WEEK_OF_YEAR if (isSet[DAY_OF_WEEK] || isSet[WEEK_OF_YEAR]) { int first = getFirstDayOfMonth(year, 0); int offs; if ((8 - first) >= getMinimalDaysInFirstWeek()) // start counting on first week offs = 1; else offs = 1 + (8 - first); month = 0; day = offs + 7 * (fields[WEEK_OF_YEAR] - 1); day += fields[DAY_OF_WEEK] - first; } else { // 4: YEAR + DAY_OF_YEAR month = 0; day = fields[DAY_OF_YEAR]; } } else { if (isSet[DAY_OF_WEEK]) { int first = getFirstDayOfMonth(year, month); // 3: YEAR + MONTH + DAY_OF_WEEK_IN_MONTH + DAY_OF_WEEK if (isSet[DAY_OF_WEEK_IN_MONTH]) { int offs = fields[DAY_OF_WEEK] - first; if (offs < 0) offs += 7; day = 1 + 7 * (fields[DAY_OF_WEEK_IN_MONTH] - 1); day += offs; } else { // 2: YEAR + MONTH + WEEK_OF_MONTH + DAY_OF_WEEK day = 1 + 7 * (fields[WEEK_OF_MONTH] - 1); day += fields[DAY_OF_WEEK] - first; } } // 1: YEAR + MONTH + DAY_OF_MONTH } if (era == BC && year > 0) year = 1 - year; // rest of code assumes day/month/year set // should negative BC years be AD? // get the hour (but no check for validity) if (isSet[HOUR_OF_DAY]) hour = fields[HOUR_OF_DAY]; else if (isSet[HOUR]) { hour = fields[HOUR]; if (isSet[AM_PM] && fields[AM_PM] == PM) if (hour != 12) /* not Noon */ hour += 12; /* Fix the problem of the status of 12:00 AM (midnight). */ if (isSet[AM_PM] && fields[AM_PM] == AM && hour == 12) hour = 0; } // Read the era,year,month,day fields and convert as appropriate. // Calculate number of milliseconds into the day // This takes care of both h, m, s, ms over/underflows. long allMillis = (((hour * 60L) + minute) * 60L + second) * 1000L + millis; day += allMillis / (24 * 60 * 60 * 1000L); millisInDay = (int) (allMillis % (24 * 60 * 60 * 1000L)); if (month < 0) { year += (int) month / 12; month = month % 12; if (month < 0) { month += 12; year--; } } if (month > 11) { year += (month / 12); month = month % 12; } month_days[1] = isLeapYear(year) ? 29 : 28; while (day <= 0) { if (month == 0) { year--; month_days[1] = isLeapYear(year) ? 29 : 28; } month = (month + 11) % 12; day += month_days[month]; } while (day > month_days[month]) { day -= (month_days[month]); month = (month + 1) % 12; if (month == 0) { year++; month_days[1] = isLeapYear(year) ? 29 : 28; } } // ok, by here we have valid day,month,year,era and millisinday int dayOfYear = dayCount[month] + day - 1; // (day starts on 1) if (isLeapYear(year) && month > 1) dayOfYear++; int relativeDay = (year - 1) * 365 + ((year - 1) >> 2) + dayOfYear - EPOCH_DAYS; // gregorian days from 1 to epoch. int gregFactor = (int) Math.floor((double) (year - 1) / 400.) - (int) Math.floor((double) (year - 1) / 100.); if ((relativeDay + gregFactor) * 60L * 60L * 24L * 1000L >= gregorianCutover) relativeDay += gregFactor; else relativeDay -= 2; time = relativeDay * (24 * 60 * 60 * 1000L) + millisInDay; // the epoch was a Thursday. int weekday = (int) (relativeDay + THURSDAY) % 7; if (weekday <= 0) weekday += 7; fields[DAY_OF_WEEK] = weekday; TimeZone zone = getTimeZone(); int rawOffset = zone.getRawOffset(); int dstOffset = zone.getOffset((year < 1) ? BC : AD, (year < 1) ? 1 - year : year, month, day, weekday, millisInDay) - zone.getRawOffset(); time -= (rawOffset + dstOffset); isTimeSet = true; }
|
protected Calendar(TimeZone zone, Locale locale)
|
protected Calendar()
|
protected Calendar(TimeZone zone, Locale locale) { this.zone = zone; lenient = true; String[] days = { "", "sun", "mon", "tue", "wed", "thu", "fri", "sat" }; ResourceBundle rb = getBundle(locale); String min = (String) rb.getObject("minNumberOfDaysInFirstWeek"); String first = (String) rb.getObject("firstDayOfWeek"); try { if (min != null) minimalDaysInFirstWeek = Integer.parseInt(min); } catch (NumberFormatException ex) { minimalDaysInFirstWeek = 1; } firstDayOfWeek = 1; if (first != null) for (int i = 0; i < 8; i++) if (days[i].equals(first)) firstDayOfWeek = i; clear(); }
|
this.zone = zone; lenient = true; String[] days = { "", "sun", "mon", "tue", "wed", "thu", "fri", "sat" }; ResourceBundle rb = getBundle(locale); String min = (String) rb.getObject("minNumberOfDaysInFirstWeek"); String first = (String) rb.getObject("firstDayOfWeek"); try { if (min != null) minimalDaysInFirstWeek = Integer.parseInt(min); } catch (NumberFormatException ex) { minimalDaysInFirstWeek = 1; } firstDayOfWeek = 1; if (first != null) for (int i = 0; i < 8; i++) if (days[i].equals(first)) firstDayOfWeek = i; clear();
|
this(TimeZone.getDefault(), Locale.getDefault());
|
protected Calendar(TimeZone zone, Locale locale) { this.zone = zone; lenient = true; String[] days = { "", "sun", "mon", "tue", "wed", "thu", "fri", "sat" }; ResourceBundle rb = getBundle(locale); String min = (String) rb.getObject("minNumberOfDaysInFirstWeek"); String first = (String) rb.getObject("firstDayOfWeek"); try { if (min != null) minimalDaysInFirstWeek = Integer.parseInt(min); } catch (NumberFormatException ex) { minimalDaysInFirstWeek = 1; } firstDayOfWeek = 1; if (first != null) for (int i = 0; i < 8; i++) if (days[i].equals(first)) firstDayOfWeek = i; clear(); }
|
addStringln("Prerequisites:");
|
*/ addStringln("\tunknown"); addStringln("Prerequisites:");
|
public void refresh(){ super.refresh(); try{ final PluginManager mgr = InitialNaming.lookup(PluginManager.NAME); final PluginDescriptor descr = mgr.getRegistry().getPluginDescriptor(name); if (descr != null) { addStringln("Name:"); addStringln("\t"+descr.getId()); addStringln("Provider:"); addStringln("\t"+descr.getProviderName()); addStringln("State :"); try { if (descr.getPlugin().isActive()) { addStringln("\tactive"); } else { addStringln("\tinactive"); } } catch (PluginException PE){ System.err.println(PE); } addStringln("Prerequisites:"); PluginPrerequisite[] allPreqs = descr.getPrerequisites(); PluginPrerequisite current; for (int i =0 ; i<allPreqs.length; i++){ current = allPreqs[i]; addStringln("\t"+current.getPluginId()+"\t\t"+current.getPluginVersion()); } } else { isvalid = false; } } catch (NameNotFoundException N){ System.err.println(N); } }
|
public FloatSeqHolder(float[] initial_value)
|
public FloatSeqHolder()
|
public FloatSeqHolder(float[] initial_value) { value = initial_value; typecode.setLength(value.length); }
|
value = initial_value; typecode.setLength(value.length);
|
public FloatSeqHolder(float[] initial_value) { value = initial_value; typecode.setLength(value.length); }
|
|
return (cal.get(Calendar.ZONE_OFFSET)
|
return - (cal.get(Calendar.ZONE_OFFSET)
|
public int getTimezoneOffset() { Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(time); return (cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET)) / (60 * 1000); }
|
private void readObject(java.io.ObjectInputStream input) throws java.io.IOException, ClassNotFoundException
|
private void readObject(ObjectInputStream input) throws IOException, ClassNotFoundException
|
private void readObject(java.io.ObjectInputStream input) throws java.io.IOException, ClassNotFoundException { input.defaultReadObject(); time = input.readLong(); }
|
private void writeObject(java.io.ObjectOutputStream output) throws java.io.IOException
|
private void writeObject(ObjectOutputStream output) throws IOException
|
private void writeObject(java.io.ObjectOutputStream output) throws java.io.IOException { output.defaultWriteObject(); output.writeLong(time); }
|
public final String getDisplayName(boolean dst, int style)
|
public final String getDisplayName()
|
public final String getDisplayName(boolean dst, int style) { return (getDisplayName(dst, style, Locale.getDefault())); }
|
return (getDisplayName(dst, style, Locale.getDefault()));
|
return (getDisplayName(false, LONG, Locale.getDefault()));
|
public final String getDisplayName(boolean dst, int style) { return (getDisplayName(dst, style, Locale.getDefault())); }
|
public ReaderDelegate(XMLStreamReader reader)
|
public ReaderDelegate()
|
public ReaderDelegate(XMLStreamReader reader) { parent = reader; }
|
parent = reader;
|
public ReaderDelegate(XMLStreamReader reader) { parent = reader; }
|
|
public String getAttributeName(int index)
|
public QName getAttributeName(int index)
|
public String getAttributeName(int index) { if (parent != null) return parent.getAttributeName(index); return null; }
|
public String getAttributeValue(int index)
|
public String getAttributeValue(String namespaceUri, String localName)
|
public String getAttributeValue(int index) { if (parent != null) return parent.getAttributeValue(index); return null; }
|
return parent.getAttributeValue(index);
|
return parent.getAttributeValue(namespaceUri, localName);
|
public String getAttributeValue(int index) { if (parent != null) return parent.getAttributeValue(index); return null; }
|
public String getNamespaceURI()
|
public String getNamespaceURI(String prefix)
|
public String getNamespaceURI() { if (parent != null) return parent.getNamespaceURI(); return null; }
|
return parent.getNamespaceURI();
|
return parent.getNamespaceURI(prefix);
|
public String getNamespaceURI() { if (parent != null) return parent.getNamespaceURI(); return null; }
|
public char[] getTextCharacters()
|
public int getTextCharacters(int sourceStart, char[] target, int targetStart, int length) throws XMLStreamException
|
public char[] getTextCharacters() { if (parent != null) return parent.getTextCharacters(); return null; }
|
return parent.getTextCharacters(); return null;
|
return parent.getTextCharacters(sourceStart, target, targetStart, length); return 0;
|
public char[] getTextCharacters() { if (parent != null) return parent.getTextCharacters(); return null; }
|
super(in);
|
super(in.markSupported() ? in : new BufferedInputStream(in));
|
public CRLFInputStream(InputStream in) { super(in); }
|
int c; if (buf != -1) { c = buf; buf = -1; return c; } else { c = super.read();
|
int c = in.read();
|
public int read() throws IOException { int c; if (buf != -1) { c = buf; buf = -1; return c; } else { c = super.read(); if (c == CR) { buf = super.read(); if (buf == LF) { c = buf; buf = -1; } } } return c; }
|
buf = super.read(); if (buf == LF)
|
in.mark(1); int d = in.read(); if (d == LF)
|
public int read() throws IOException { int c; if (buf != -1) { c = buf; buf = -1; return c; } else { c = super.read(); if (c == CR) { buf = super.read(); if (buf == LF) { c = buf; buf = -1; } } } return c; }
|
c = buf; buf = -1;
|
c = d;
|
public int read() throws IOException { int c; if (buf != -1) { c = buf; buf = -1; return c; } else { c = super.read(); if (c == CR) { buf = super.read(); if (buf == LF) { c = buf; buf = -1; } } } return c; }
|
else { in.reset();
|
public int read() throws IOException { int c; if (buf != -1) { c = buf; buf = -1; return c; } else { c = super.read(); if (c == CR) { buf = super.read(); if (buf == LF) { c = buf; buf = -1; } } } return c; }
|
|
else if (selectedIndex == -1) select(0);
|
add(String item){ if (item == null) throw new NullPointerException ("item must be non-null"); pItems.addElement(item); int i = pItems.size () - 1; if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.add (item, i); }}
|
|
else if (selectedIndex == -1 || selectedIndex >= index) select(0);
|
insert(String item, int index){ if (index < 0) throw new IllegalArgumentException ("index may not be less then 0"); if (index > getItemCount ()) index = getItemCount (); pItems.insertElementAt(item, index); if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.add (item, index); }}
|
|
protected Inet6Address(byte[] addr, String host) { super(addr, host);
|
Inet6Address(byte[] addr, String host) { super(addr, host, null);
|
protected Inet6Address(byte[] addr, String host) { super(addr, host); this.ipaddress = addr; }
|
public boolean equals(Object obj) { if (obj == null || !(obj instanceof Inet6Address))
|
public boolean equals(Object obj) { if (! (obj instanceof Inet6Address))
|
public boolean equals(Object obj) { if (obj == null || !(obj instanceof Inet6Address)) return false; Inet6Address tmp = (Inet6Address) obj; return super.equals(tmp) && this.ipaddress == tmp.ipaddress; }
|
return ipaddress == anylocal;
|
return Arrays.equals(ipaddress, anylocal);
|
public boolean isAnyLocalAddress() { byte[] anylocal = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; return ipaddress == anylocal; }
|
return ipaddress == loopback;
|
return Arrays.equals(ipaddress, loopback);
|
public boolean isLoopbackAddress() { byte[] loopback = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }; return ipaddress == loopback; }
|
c.setBorder(defaults.getBorder("Label.border"));
|
protected void installDefaults(JLabel c) { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); c.setForeground(defaults.getColor("Label.foreground")); c.setBackground(defaults.getColor("Label.background")); c.setFont(defaults.getFont("Label.font")); c.setBorder(defaults.getBorder("Label.border")); //XXX: There are properties we don't use called disabledForeground //and disabledShadow. }
|
|
c.setBorder(null);
|
protected void uninstallDefaults(JLabel c) { c.setForeground(null); c.setBackground(null); c.setFont(null); c.setBorder(null); }
|
|
if (month < 0 || month > 11) throw new IllegalArgumentException("month out of range");
|
private int checkRule(int month, int day, int dayOfWeek) { int daysInMonth = getDaysInMonth(month, 1); if (dayOfWeek == 0) { if (day <= 0 || day > daysInMonth) throw new IllegalArgumentException("day out of range"); return DOM_MODE; } else if (dayOfWeek > 0) { if (Math.abs(day) > (daysInMonth + 6) / 7) throw new IllegalArgumentException("dayOfWeekInMonth out of range"); if (dayOfWeek > Calendar.SATURDAY) throw new IllegalArgumentException("dayOfWeek out of range"); return DOW_IN_MONTH_MODE; } else { if (day == 0 || Math.abs(day) > daysInMonth) throw new IllegalArgumentException("day out of range"); if (dayOfWeek < -Calendar.SATURDAY) throw new IllegalArgumentException("dayOfWeek out of range"); if (day < 0) return DOW_LE_DOM_MODE; else return DOW_GE_DOM_MODE; } }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.