rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
theirfirstport = 0; ourlastport = 65535;
theirlastport = 65535; theirhost = p.hostport;
public boolean implies(Permission perm) { SocketPermission p; // First make sure we are the right object type if (perm instanceof SocketPermission) p = (SocketPermission) perm; else return false; // Next check the actions String ourlist = getActions(); String theirlist = p.getActions(); if (! ourlist.startsWith(theirlist)) return false; // Now check ports int ourfirstport = 0; // Now check ports int ourlastport = 0; // Now check ports int theirfirstport = 0; // Now check ports int theirlastport = 0; // Get ours if (hostport.indexOf(":") == -1) { ourfirstport = 0; ourlastport = 65535; } else { // FIXME: Needs bulletproofing. // This will dump if hostport if all sorts of bad data was passed to // the constructor String range = hostport.substring(hostport.indexOf(":") + 1); if (range.startsWith("-")) ourfirstport = 0; else if (range.indexOf("-") == -1) ourfirstport = Integer.parseInt(range); else ourfirstport = Integer.parseInt(range.substring(0, range.indexOf("-"))); if (range.endsWith("-")) ourlastport = 65535; else if (range.indexOf("-") == -1) ourlastport = Integer.parseInt(range); else ourlastport = Integer.parseInt(range.substring(range.indexOf("-") + 1, range.length())); } // Get theirs if (p.hostport.indexOf(":") == -1) { theirfirstport = 0; ourlastport = 65535; } else { // This will dump if hostport if all sorts of bad data was passed to // the constructor// @classpath-bugfix 18/10/2005 Martin Husted Hartvig ([email protected]) :// Wrong usage of hostport and not p.hostport in call to indexOf String range = p.hostport.substring(p.hostport.indexOf(":") + 1);// @classpath-bugfix-end if (range.startsWith("-")) theirfirstport = 0; else if (range.indexOf("-") == -1) theirfirstport = Integer.parseInt(range); else theirfirstport = Integer.parseInt(range.substring(0, range.indexOf("-"))); if (range.endsWith("-")) theirlastport = 65535; else if (range.indexOf("-") == -1) theirlastport = Integer.parseInt(range); else theirlastport = Integer.parseInt(range.substring(range.indexOf("-") + 1, range.length())); } // Now check them if ((theirfirstport < ourfirstport) || (theirlastport > ourlastport)) return false; // Finally we can check the hosts String ourhost; // Finally we can check the hosts String theirhost; // Get ours if (hostport.indexOf(":") == -1) ourhost = hostport; else ourhost = hostport.substring(0, hostport.indexOf(":")); // Get theirs if (p.hostport.indexOf(":") == -1) theirhost = p.hostport; else theirhost = p.hostport.substring(0, p.hostport.indexOf(":")); // Are they equal? if (ourhost.equals(theirhost)) return true; // Try the canonical names String ourcanonical = null; // Try the canonical names String theircanonical = null; try { ourcanonical = InetAddress.getByName(ourhost).getHostName(); theircanonical = InetAddress.getByName(theirhost).getHostName(); } catch (UnknownHostException e) { // Who didn't resolve? Just assume current address is canonical enough // Is this ok to do? if (ourcanonical == null) ourcanonical = ourhost; if (theircanonical == null) theircanonical = theirhost; } if (ourcanonical.equals(theircanonical)) return true; // Well, last chance. Try for a wildcard if (ourhost.indexOf("*.") != -1) { String wild_domain = ourhost.substring(ourhost.indexOf("*" + 1)); if (theircanonical.endsWith(wild_domain)) return true; }// @classpath-bugfix 18/10/2005 Martin Husted Hartvig ([email protected]) :// Missed wildcard as host address if (ourhost.equals("*")) return true;// @classpath-bugfix-end // Didn't make it return false; }
String range = p.hostport.substring(p.hostport.indexOf(":") + 1);
range = p.hostport.substring(portsIndex + 1); portDelimitorIndex = range.indexOf(portDelimitor); if (portDelimitorIndex == 0) theirfirstport = 0; else if (portDelimitorIndex == -1) { theirfirstport = Integer.parseInt(range); theirlastport = theirfirstport; } else theirfirstport = Integer.parseInt(range.substring(0, portDelimitorIndex)); if (range.endsWith(portDelimitor)) theirlastport = 65535; else theirlastport = Integer.parseInt(range.substring(portDelimitorIndex + 1, range.length())); theirhost = p.hostport.substring(0, portsIndex); } if ((theirfirstport < ourfirstport) || (theirlastport > ourlastport)) { return false; } if (ourhost.equals(theirhost)) return true; String ourcanonical = null; String theircanonical = null; try { ourcanonical = InetAddress.getByName(ourhost).getHostName(); theircanonical = InetAddress.getByName(theirhost).getHostName(); } catch (UnknownHostException e) { if (ourcanonical == null) ourcanonical = ourhost; if (theircanonical == null) theircanonical = theirhost; } if (ourcanonical.equals(theircanonical)) return true; int wildcardIndex = ourcanonical.indexOf(wildcard); if (wildcardIndex != -1 && ourcanonical.length() > 1) { String wild_domain = ourcanonical.substring(wildcardIndex + 1); if (theircanonical.endsWith(wild_domain)) { return true; } } if (ourcanonical.equals(wildcard)) return true; return false;
public boolean implies(Permission perm) { SocketPermission p; // First make sure we are the right object type if (perm instanceof SocketPermission) p = (SocketPermission) perm; else return false; // Next check the actions String ourlist = getActions(); String theirlist = p.getActions(); if (! ourlist.startsWith(theirlist)) return false; // Now check ports int ourfirstport = 0; // Now check ports int ourlastport = 0; // Now check ports int theirfirstport = 0; // Now check ports int theirlastport = 0; // Get ours if (hostport.indexOf(":") == -1) { ourfirstport = 0; ourlastport = 65535; } else { // FIXME: Needs bulletproofing. // This will dump if hostport if all sorts of bad data was passed to // the constructor String range = hostport.substring(hostport.indexOf(":") + 1); if (range.startsWith("-")) ourfirstport = 0; else if (range.indexOf("-") == -1) ourfirstport = Integer.parseInt(range); else ourfirstport = Integer.parseInt(range.substring(0, range.indexOf("-"))); if (range.endsWith("-")) ourlastport = 65535; else if (range.indexOf("-") == -1) ourlastport = Integer.parseInt(range); else ourlastport = Integer.parseInt(range.substring(range.indexOf("-") + 1, range.length())); } // Get theirs if (p.hostport.indexOf(":") == -1) { theirfirstport = 0; ourlastport = 65535; } else { // This will dump if hostport if all sorts of bad data was passed to // the constructor// @classpath-bugfix 18/10/2005 Martin Husted Hartvig ([email protected]) :// Wrong usage of hostport and not p.hostport in call to indexOf String range = p.hostport.substring(p.hostport.indexOf(":") + 1);// @classpath-bugfix-end if (range.startsWith("-")) theirfirstport = 0; else if (range.indexOf("-") == -1) theirfirstport = Integer.parseInt(range); else theirfirstport = Integer.parseInt(range.substring(0, range.indexOf("-"))); if (range.endsWith("-")) theirlastport = 65535; else if (range.indexOf("-") == -1) theirlastport = Integer.parseInt(range); else theirlastport = Integer.parseInt(range.substring(range.indexOf("-") + 1, range.length())); } // Now check them if ((theirfirstport < ourfirstport) || (theirlastport > ourlastport)) return false; // Finally we can check the hosts String ourhost; // Finally we can check the hosts String theirhost; // Get ours if (hostport.indexOf(":") == -1) ourhost = hostport; else ourhost = hostport.substring(0, hostport.indexOf(":")); // Get theirs if (p.hostport.indexOf(":") == -1) theirhost = p.hostport; else theirhost = p.hostport.substring(0, p.hostport.indexOf(":")); // Are they equal? if (ourhost.equals(theirhost)) return true; // Try the canonical names String ourcanonical = null; // Try the canonical names String theircanonical = null; try { ourcanonical = InetAddress.getByName(ourhost).getHostName(); theircanonical = InetAddress.getByName(theirhost).getHostName(); } catch (UnknownHostException e) { // Who didn't resolve? Just assume current address is canonical enough // Is this ok to do? if (ourcanonical == null) ourcanonical = ourhost; if (theircanonical == null) theircanonical = theirhost; } if (ourcanonical.equals(theircanonical)) return true; // Well, last chance. Try for a wildcard if (ourhost.indexOf("*.") != -1) { String wild_domain = ourhost.substring(ourhost.indexOf("*" + 1)); if (theircanonical.endsWith(wild_domain)) return true; }// @classpath-bugfix 18/10/2005 Martin Husted Hartvig ([email protected]) :// Missed wildcard as host address if (ourhost.equals("*")) return true;// @classpath-bugfix-end // Didn't make it return false; }
if (range.startsWith("-")) theirfirstport = 0; else if (range.indexOf("-") == -1) theirfirstport = Integer.parseInt(range); else theirfirstport = Integer.parseInt(range.substring(0, range.indexOf("-"))); if (range.endsWith("-")) theirlastport = 65535; else if (range.indexOf("-") == -1) theirlastport = Integer.parseInt(range); else theirlastport = Integer.parseInt(range.substring(range.indexOf("-") + 1, range.length())); } if ((theirfirstport < ourfirstport) || (theirlastport > ourlastport)) return false; String ourhost; String theirhost; if (hostport.indexOf(":") == -1) ourhost = hostport; else ourhost = hostport.substring(0, hostport.indexOf(":")); if (p.hostport.indexOf(":") == -1) theirhost = p.hostport; else theirhost = p.hostport.substring(0, p.hostport.indexOf(":")); if (ourhost.equals(theirhost)) return true; String ourcanonical = null; String theircanonical = null; try { ourcanonical = InetAddress.getByName(ourhost).getHostName(); theircanonical = InetAddress.getByName(theirhost).getHostName(); } catch (UnknownHostException e) { if (ourcanonical == null) ourcanonical = ourhost; if (theircanonical == null) theircanonical = theirhost; } if (ourcanonical.equals(theircanonical)) return true; if (ourhost.indexOf("*.") != -1) { String wild_domain = ourhost.substring(ourhost.indexOf("*" + 1)); if (theircanonical.endsWith(wild_domain)) return true; } if (ourhost.equals("*")) return true; return false;
public boolean implies(Permission perm) { SocketPermission p; // First make sure we are the right object type if (perm instanceof SocketPermission) p = (SocketPermission) perm; else return false; // Next check the actions String ourlist = getActions(); String theirlist = p.getActions(); if (! ourlist.startsWith(theirlist)) return false; // Now check ports int ourfirstport = 0; // Now check ports int ourlastport = 0; // Now check ports int theirfirstport = 0; // Now check ports int theirlastport = 0; // Get ours if (hostport.indexOf(":") == -1) { ourfirstport = 0; ourlastport = 65535; } else { // FIXME: Needs bulletproofing. // This will dump if hostport if all sorts of bad data was passed to // the constructor String range = hostport.substring(hostport.indexOf(":") + 1); if (range.startsWith("-")) ourfirstport = 0; else if (range.indexOf("-") == -1) ourfirstport = Integer.parseInt(range); else ourfirstport = Integer.parseInt(range.substring(0, range.indexOf("-"))); if (range.endsWith("-")) ourlastport = 65535; else if (range.indexOf("-") == -1) ourlastport = Integer.parseInt(range); else ourlastport = Integer.parseInt(range.substring(range.indexOf("-") + 1, range.length())); } // Get theirs if (p.hostport.indexOf(":") == -1) { theirfirstport = 0; ourlastport = 65535; } else { // This will dump if hostport if all sorts of bad data was passed to // the constructor// @classpath-bugfix 18/10/2005 Martin Husted Hartvig ([email protected]) :// Wrong usage of hostport and not p.hostport in call to indexOf String range = p.hostport.substring(p.hostport.indexOf(":") + 1);// @classpath-bugfix-end if (range.startsWith("-")) theirfirstport = 0; else if (range.indexOf("-") == -1) theirfirstport = Integer.parseInt(range); else theirfirstport = Integer.parseInt(range.substring(0, range.indexOf("-"))); if (range.endsWith("-")) theirlastport = 65535; else if (range.indexOf("-") == -1) theirlastport = Integer.parseInt(range); else theirlastport = Integer.parseInt(range.substring(range.indexOf("-") + 1, range.length())); } // Now check them if ((theirfirstport < ourfirstport) || (theirlastport > ourlastport)) return false; // Finally we can check the hosts String ourhost; // Finally we can check the hosts String theirhost; // Get ours if (hostport.indexOf(":") == -1) ourhost = hostport; else ourhost = hostport.substring(0, hostport.indexOf(":")); // Get theirs if (p.hostport.indexOf(":") == -1) theirhost = p.hostport; else theirhost = p.hostport.substring(0, p.hostport.indexOf(":")); // Are they equal? if (ourhost.equals(theirhost)) return true; // Try the canonical names String ourcanonical = null; // Try the canonical names String theircanonical = null; try { ourcanonical = InetAddress.getByName(ourhost).getHostName(); theircanonical = InetAddress.getByName(theirhost).getHostName(); } catch (UnknownHostException e) { // Who didn't resolve? Just assume current address is canonical enough // Is this ok to do? if (ourcanonical == null) ourcanonical = ourhost; if (theircanonical == null) theircanonical = theirhost; } if (ourcanonical.equals(theircanonical)) return true; // Well, last chance. Try for a wildcard if (ourhost.indexOf("*.") != -1) { String wild_domain = ourhost.substring(ourhost.indexOf("*" + 1)); if (theircanonical.endsWith(wild_domain)) return true; }// @classpath-bugfix 18/10/2005 Martin Husted Hartvig ([email protected]) :// Missed wildcard as host address if (ourhost.equals("*")) return true;// @classpath-bugfix-end // Didn't make it return false; }
}
public boolean lookingAt () { match = pattern.getRE().getMatch(input, 0); if (match != null) { if (match.getStartIndex() == 0) return true; match = null; } return false; }
return find(0);
if (lookingAt()) { if (position == input.length()) return true; match = null; } return false;
public boolean matches () { return find(0); }
public REMatch getMatch(Object input, int index) { return getMatch(input,index,0);
public REMatch getMatch(Object input) { return getMatch(input,0,0);
public REMatch getMatch(Object input, int index) { return getMatch(input,index,0); }
public String substituteAll(Object input,String replace,int index) { return substituteAll(input,replace,index,0);
public String substituteAll(Object input,String replace) { return substituteAll(input,replace,0,0);
public String substituteAll(Object input,String replace,int index) { return substituteAll(input,replace,index,0); }
public String substitute(Object input,String replace,int index) { return substitute(input,replace,index,0);
public String substitute(Object input,String replace) { return substitute(input,replace,0,0);
public String substitute(Object input,String replace,int index) { return substitute(input,replace,index,0); }
public MatteBorder(int top, int left, int bottom, int right, Color color) { super(top, left, bottom, right); this.c = color; }
public MatteBorder(int top, int left, int bottom, int right, Color matteColor) { super(top, left, bottom, right); if (matteColor == null) throw new IllegalArgumentException(); this.color = matteColor; }
public MatteBorder(int top, int left, int bottom, int right, Color color) { super(top, left, bottom, right); this.c = color; }
{ return false; }
{ return (color != null) && (color.getAlpha() == 255); }
public boolean isBorderOpaque() { return false; }
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { }
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Insets i = getBorderInsets(); paintEdge(c, g, x, y, width, i.top, 0, 0); paintEdge(c, g, x, y + height - i.bottom, width, i.bottom, 0, height - i.bottom); paintEdge(c, g, x, y + i.top, i.left, height - i.top, 0, i.top); paintEdge(c, g, x + width - i.right, y + i.top, i.right, height - i.bottom, width - i.right, i.top); }
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { }
public EmptyBorder(int left, int right, int top, int bottom) { this.l = left; this.r = right; this.t = top; this.b = bottom; }
public EmptyBorder(int top, int left, int bottom, int right) { this.top = top; this.left = left; this.bottom = bottom; this.right = right; }
public EmptyBorder(int left, int right, int top, int bottom) { this.l = left; this.r = right; this.t = top; this.b = bottom; }
public Insets getBorderInsets(Component c) { return getBorderInsets(c, new Insets(0,0,0,0)); }
public Insets getBorderInsets (Component c) { return new Insets (0, 0, 0, 0); }
public Insets getBorderInsets(Component c) { return getBorderInsets(c, new Insets(0,0,0,0)); }
public Insets getBorderInsets(Component c, Insets s) { if (s == null) s = new Insets(0,0,0,0); s.left = l; s.right = r; s.top = t; s.bottom = b; return s; }
public Insets getBorderInsets(Component c) { return getBorderInsets(c, null); }
public Insets getBorderInsets(Component c, Insets s) { if (s == null) s = new Insets(0,0,0,0); s.left = l; s.right = r; s.top = t; s.bottom = b; return s; }
public static DocumentBuilderFactory newInstance() { try { return (DocumentBuilderFactory) ClassStuff.createFactory ( defaultPropName, "gnu.xml.dom.JAXPFactory"); } catch (ClassCastException e) { throw new FactoryConfigurationError (e, "Factory class is the wrong type"); } }
public static DocumentBuilderFactory newInstance() { ClassLoader loader = Thread.currentThread().getContextClassLoader(); if (loader == null) { loader = DocumentBuilderFactory.class.getClassLoader(); } String className = null; int count = 0; do { className = getFactoryClassName(loader, count++); if (className != null) { try { Class t = (loader != null) ? loader.loadClass(className) : Class.forName(className); return (DocumentBuilderFactory) t.newInstance(); } catch (ClassNotFoundException e) { className = null; } catch (Exception e) { throw new FactoryConfigurationError(e, "error instantiating class " + className); } } } while (className == null && count < 3); return new gnu.xml.dom.DomDocumentBuilderFactory(); }
public static DocumentBuilderFactory newInstance() { try { return (DocumentBuilderFactory) ClassStuff.createFactory ( defaultPropName, "gnu.xml.dom.JAXPFactory"); } catch (ClassCastException e) { throw new FactoryConfigurationError (e, "Factory class is the wrong type"); } }
public void setExpandEntityReferences(boolean value) { expandEntityRef = value; }
public void setExpandEntityReferences(boolean expandEntityRef) { expandEntityReferences = expandEntityRef; }
public void setExpandEntityReferences(boolean value) { expandEntityRef = value; } // setExpandEntityReferences()
public abstract void setEntityResolver(EntityResolver resolver);
public abstract void setEntityResolver(EntityResolver er);
public abstract void setEntityResolver(EntityResolver resolver);
public abstract void setErrorHandler(ErrorHandler handler);
public abstract void setErrorHandler(ErrorHandler eh);
public abstract void setErrorHandler(ErrorHandler handler);
public DOMSource(Node node, String systemID) { this.node = node; this.baseID = systemID; }
public DOMSource() { this(null, null); }
public DOMSource(Node node, String systemID) { this.node = node; this.baseID = systemID; } // DOMSource()
public abstract Document parse(InputSource source) throws SAXException, IOException;
public Document parse(InputStream is) throws SAXException, IOException { if (is == null) { throw new IllegalArgumentException("input stream is null"); } return parse(new InputSource(is)); }
public abstract Document parse(InputSource source) throws SAXException, IOException;
Border b = c.getBorder(); if (b == null || b instanceof UIResource) c.setBorder(UIManager.getBorder(defaultBorderName));
public static void installBorder(JComponent c, String defaultBorderName) { }
Color bg = c.getBackground(); if (bg == null || bg instanceof UIResource) c.setBackground(UIManager.getColor(defaultBgName)); Color fg = c.getForeground(); if (fg == null || fg instanceof UIResource) c.setForeground(UIManager.getColor(defaultFgName));
public static void installColors(JComponent c, String defaultBgName, String defaultFgName) { }
installColors(component, defaultBgName, defaultFgName); Font f = component.getFont(); if (f == null || f instanceof UIResource) component.setFont(UIManager.getFont(defaultFontName));
public static void installColorsAndFont(JComponent component, String defaultBgName, String defaultFgName, String defaultFontName) { }
return null;
final URL file = baseClass.getResource(gifFile); return new UIDefaults.LazyValue() { public Object createValue(UIDefaults table) { return new IconUIResource(new ImageIcon(file)); } };
public static Object makeIcon(Class baseClass, String gifFile) { return null; }
case Node.PROCESSING_INSTRUCTION_NODE:
case Node.DOCUMENT_NODE:
public boolean matches(Node node, int pos, int len) { short nodeType = node.getNodeType(); switch (nodeType) { case Node.ELEMENT_NODE: case Node.ATTRIBUTE_NODE: case Node.TEXT_NODE: case Node.CDATA_SECTION_NODE: case Node.COMMENT_NODE: case Node.PROCESSING_INSTRUCTION_NODE: if (type > 0) { if (nodeType != type) { return false; } if (data != null && !data.equals(node.getNodeValue())) { return false; } } return true; default: // Not part of XPath data model return false; } }
{
public boolean matches(Node node, int pos, int len) { short nodeType = node.getNodeType(); switch (nodeType) { case Node.ELEMENT_NODE: case Node.ATTRIBUTE_NODE: case Node.TEXT_NODE: case Node.CDATA_SECTION_NODE: case Node.COMMENT_NODE: case Node.PROCESSING_INSTRUCTION_NODE: if (type > 0) { if (nodeType != type) { return false; } if (data != null && !data.equals(node.getNodeValue())) { return false; } } return true; default: // Not part of XPath data model return false; } }
if (data != null && !data.equals(node.getNodeValue()))
return true; case Node.PROCESSING_INSTRUCTION_NODE: if (type > 0)
public boolean matches(Node node, int pos, int len) { short nodeType = node.getNodeType(); switch (nodeType) { case Node.ELEMENT_NODE: case Node.ATTRIBUTE_NODE: case Node.TEXT_NODE: case Node.CDATA_SECTION_NODE: case Node.COMMENT_NODE: case Node.PROCESSING_INSTRUCTION_NODE: if (type > 0) { if (nodeType != type) { return false; } if (data != null && !data.equals(node.getNodeValue())) { return false; } } return true; default: // Not part of XPath data model return false; } }
}
public boolean matches(Node node, int pos, int len) { short nodeType = node.getNodeType(); switch (nodeType) { case Node.ELEMENT_NODE: case Node.ATTRIBUTE_NODE: case Node.TEXT_NODE: case Node.CDATA_SECTION_NODE: case Node.COMMENT_NODE: case Node.PROCESSING_INSTRUCTION_NODE: if (type > 0) { if (nodeType != type) { return false; } if (data != null && !data.equals(node.getNodeValue())) { return false; } } return true; default: // Not part of XPath data model return false; } }
this.bounds = shape.getBounds2D();
public ShapeGraphicAttribute (Shape shape, int alignment, boolean stroke) { super (alignment); this.shape = shape; this.stroke = stroke; }
public void draw (Graphics2D graphics, float x, float y) throws NotImplementedException
public void draw(Graphics2D graphics, float x, float y)
public void draw (Graphics2D graphics, float x, float y) throws NotImplementedException { throw new Error ("not implemented"); }
throw new Error ("not implemented");
graphics.translate(x, y); if (stroke == STROKE) graphics.draw(shape); else graphics.fill(shape); graphics.translate(- x, - y);
public void draw (Graphics2D graphics, float x, float y) throws NotImplementedException { throw new Error ("not implemented"); }
public float getAdvance () throws NotImplementedException
public float getAdvance()
public float getAdvance () throws NotImplementedException { throw new Error ("not implemented"); }
throw new Error ("not implemented");
return Math.max(0, (float) bounds.getMaxX());
public float getAdvance () throws NotImplementedException { throw new Error ("not implemented"); }
public float getAscent () throws NotImplementedException
public float getAscent()
public float getAscent () throws NotImplementedException { throw new Error ("not implemented"); }
throw new Error ("not implemented");
return Math.max(0, -(float) bounds.getMinY());
public float getAscent () throws NotImplementedException { throw new Error ("not implemented"); }
return shape.getBounds2D ();
Rectangle2D.Float bounds = new Rectangle2D.Float(); bounds.setRect(this.bounds); if (stroke == STROKE) { bounds.width++; bounds.height++; } return bounds;
public Rectangle2D getBounds () { return shape.getBounds2D (); }
public float getDescent () throws NotImplementedException
public float getDescent()
public float getDescent () throws NotImplementedException { throw new Error ("not implemented"); }
throw new Error ("not implemented");
return Math.max(0, (float) bounds.getMaxY());
public float getDescent () throws NotImplementedException { throw new Error ("not implemented"); }
public abstract void translate(double tx, double ty);
public abstract void translate(int x, int y);
public abstract void translate(double tx, double ty);
public void setRect(Rectangle2D r)
public void setRect(float x, float y, float w, float h)
public void setRect(Rectangle2D r) { x = (float) r.getX(); y = (float) r.getY(); width = (float) r.getWidth(); height = (float) r.getHeight(); }
x = (float) r.getX(); y = (float) r.getY(); width = (float) r.getWidth(); height = (float) r.getHeight();
this.x = x; this.y = y; width = w; height = h;
public void setRect(Rectangle2D r) { x = (float) r.getX(); y = (float) r.getY(); width = (float) r.getWidth(); height = (float) r.getHeight(); }
public final Class getCategory()
public Class getCategory()
public final Class getCategory() { return PrinterMessageFromOperator.class; }
public final String getName()
public String getName()
public final String getName() { return "printer-message-from-operator"; }
if (value == null) throw new NullPointerException("value may not be null");
if (value == null || locale == null) throw new NullPointerException("value and/or locale may not be null");
protected TextSyntax(String value, Locale locale) { if (value == null) throw new NullPointerException("value may not be null"); this.value = value; this.locale = locale; }
visibleRowCount = 8;
visibleRowCount = 7;
void init() { dragEnabled = false; fixedCellHeight = -1; fixedCellWidth = -1; layoutOrientation = VERTICAL; opaque = true; valueIsAdjusting = false; visibleRowCount = 8; cellRenderer = new DefaultListCellRenderer(); listListener = new ListListener(); setModel(new DefaultListModel()); setSelectionModel(createSelectionModel()); setSelectionMode(ListSelectionModel.SINGLE_SELECTION); setLayout(null); updateUI(); }
setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
void init() { dragEnabled = false; fixedCellHeight = -1; fixedCellWidth = -1; layoutOrientation = VERTICAL; opaque = true; valueIsAdjusting = false; visibleRowCount = 8; cellRenderer = new DefaultListCellRenderer(); listListener = new ListListener(); setModel(new DefaultListModel()); setSelectionModel(createSelectionModel()); setSelectionMode(ListSelectionModel.SINGLE_SELECTION); setLayout(null); updateUI(); }
if (a < 0) selectionModel.clearSelection(); else
public void setSelectedIndex(int a) { selectionModel.setSelectionInterval(a, a); }
public abstract int locationToIndex(JList index, Point location);
public abstract int locationToIndex(JList list, Point location);
public abstract int locationToIndex(JList index, Point location);
public InvalidMidiDataException(String s)
public InvalidMidiDataException()
public InvalidMidiDataException(String s) { super(s); }
super(s);
super();
public InvalidMidiDataException(String s) { super(s); }
+ parent == null ? "" : "not "
+ (parent == null ? "" : "not ")
protected AbstractPreferences(AbstractPreferences parent, String name) { if ( (name == null) // name should be given || (name.length() > MAX_NAME_LENGTH) // 80 characters max || (parent == null && name.length() != 0) // root has no name || (parent != null && name.length() == 0) // all other nodes do || (name.indexOf('/') != -1)) // must not contain '/' throw new IllegalArgumentException("Illegal name argument '" + name + "' (parent is " + parent == null ? "" : "not " + "null)"); this.parent = parent; this.name = name; }
public InflaterInputStream(InputStream in, Inflater inf)
public InflaterInputStream(InputStream in)
public InflaterInputStream(InputStream in, Inflater inf) { this(in, inf, 4096); }
this(in, inf, 4096);
this(in, new Inflater(), 4096);
public InflaterInputStream(InputStream in, Inflater inf) { this(in, inf, 4096); }
public int read(byte[] b, int off, int len) throws IOException { if (inf == null) throw new IOException("stream closed"); if (len == 0) return 0; int count = 0; for (;;) { try { count = inf.inflate(b, off, len); } catch (DataFormatException dfe) { throw new ZipException(dfe.getMessage()); } if (count > 0) return count; if (inf.needsDictionary() | inf.finished()) return -1; else if (inf.needsInput()) fill(); else throw new InternalError("Don't know what to do"); }
public int read() throws IOException { int nread = read(onebytebuffer, 0, 1); if (nread > 0) return onebytebuffer[0] & 0xff; return -1;
public int read(byte[] b, int off, int len) throws IOException { if (inf == null) throw new IOException("stream closed"); if (len == 0) return 0; int count = 0; for (;;) { try { count = inf.inflate(b, off, len); } catch (DataFormatException dfe) { throw new ZipException(dfe.getMessage()); } if (count > 0) return count; if (inf.needsDictionary() | inf.finished()) return -1; else if (inf.needsInput()) fill(); else throw new InternalError("Don't know what to do"); } }
public ZipException (String msg)
public ZipException()
public ZipException (String msg) { super(msg); }
super(msg);
public ZipException (String msg) { super(msg); }
public void setInput (byte[] buf, int off, int len)
public void setInput (byte[] buf)
public void setInput (byte[] buf, int off, int len) { input.setInput (buf, off, len); totalIn += len; }
input.setInput (buf, off, len); totalIn += len;
setInput (buf, 0, buf.length);
public void setInput (byte[] buf, int off, int len) { input.setInput (buf, off, len); totalIn += len; }
public int inflate (byte[] buf, int off, int len) throws DataFormatException
public int inflate (byte[] buf) throws DataFormatException
public int inflate (byte[] buf, int off, int len) throws DataFormatException { /* Special case: len may be zero */ if (len == 0) return 0; /* Check for correct buff, off, len triple */ if (0 > off || off > off + len || off + len > buf.length) throw new ArrayIndexOutOfBoundsException(); int count = 0; int more; do { if (mode != DECODE_CHKSUM) { /* Don't give away any output, if we are waiting for the * checksum in the input stream. * * With this trick we have always: * needsInput() and not finished() * implies more output can be produced. */ more = outputWindow.copyOutput(buf, off, len); adler.update(buf, off, more); off += more; count += more; totalOut += more; len -= more; if (len == 0) return count; } } while (decode() || (outputWindow.getAvailable() > 0 && mode != DECODE_CHKSUM)); return count; }
if (len == 0) return 0; if (0 > off || off > off + len || off + len > buf.length) throw new ArrayIndexOutOfBoundsException(); int count = 0; int more; do { if (mode != DECODE_CHKSUM) { more = outputWindow.copyOutput(buf, off, len); adler.update(buf, off, more); off += more; count += more; totalOut += more; len -= more; if (len == 0) return count; } } while (decode() || (outputWindow.getAvailable() > 0 && mode != DECODE_CHKSUM)); return count;
return inflate (buf, 0, buf.length);
public int inflate (byte[] buf, int off, int len) throws DataFormatException { /* Special case: len may be zero */ if (len == 0) return 0; /* Check for correct buff, off, len triple */ if (0 > off || off > off + len || off + len > buf.length) throw new ArrayIndexOutOfBoundsException(); int count = 0; int more; do { if (mode != DECODE_CHKSUM) { /* Don't give away any output, if we are waiting for the * checksum in the input stream. * * With this trick we have always: * needsInput() and not finished() * implies more output can be produced. */ more = outputWindow.copyOutput(buf, off, len); adler.update(buf, off, more); off += more; count += more; totalOut += more; len -= more; if (len == 0) return count; } } while (decode() || (outputWindow.getAvailable() > 0 && mode != DECODE_CHKSUM)); return count; }
{
Template(Stylesheet stylesheet, QName name, Pattern match, TemplateNode node, int precedence, double priority, QName mode) { this.stylesheet = stylesheet; this.name = name; this.match = match; this.node = node; // adjust priority if necessary // see XSLT section 5.5 Test test = getNodeTest(match); if (test != null) { if (test instanceof NameTest) { NameTest nameTest = (NameTest) test; if (nameTest.matchesAny() || nameTest.matchesAnyLocalName()) { priority = -0.25d; } else { priority = 0.0d; } } else { NodeTypeTest nodeTypeTest = (NodeTypeTest) test; if (nodeTypeTest.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE && nodeTypeTest.getData() != null) { priority = 0.0d; } else { priority = -0.5d; } } } this.precedence = precedence; this.priority = priority; this.mode = mode; }
}
Template(Stylesheet stylesheet, QName name, Pattern match, TemplateNode node, int precedence, double priority, QName mode) { this.stylesheet = stylesheet; this.name = name; this.match = match; this.node = node; // adjust priority if necessary // see XSLT section 5.5 Test test = getNodeTest(match); if (test != null) { if (test instanceof NameTest) { NameTest nameTest = (NameTest) test; if (nameTest.matchesAny() || nameTest.matchesAnyLocalName()) { priority = -0.25d; } else { priority = 0.0d; } } else { NodeTypeTest nodeTypeTest = (NodeTypeTest) test; if (nodeTypeTest.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE && nodeTypeTest.getData() != null) { priority = 0.0d; } else { priority = -0.5d; } } } this.precedence = precedence; this.priority = priority; this.mode = mode; }
}
isAnyNode = false;
Template(Stylesheet stylesheet, QName name, Pattern match, TemplateNode node, int precedence, double priority, QName mode) { this.stylesheet = stylesheet; this.name = name; this.match = match; this.node = node; // adjust priority if necessary // see XSLT section 5.5 Test test = getNodeTest(match); if (test != null) { if (test instanceof NameTest) { NameTest nameTest = (NameTest) test; if (nameTest.matchesAny() || nameTest.matchesAnyLocalName()) { priority = -0.25d; } else { priority = 0.0d; } } else { NodeTypeTest nodeTypeTest = (NodeTypeTest) test; if (nodeTypeTest.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE && nodeTypeTest.getData() != null) { priority = 0.0d; } else { priority = -0.5d; } } } this.precedence = precedence; this.priority = priority; this.mode = mode; }
}
else isAnyNode = false;
Template(Stylesheet stylesheet, QName name, Pattern match, TemplateNode node, int precedence, double priority, QName mode) { this.stylesheet = stylesheet; this.name = name; this.match = match; this.node = node; // adjust priority if necessary // see XSLT section 5.5 Test test = getNodeTest(match); if (test != null) { if (test instanceof NameTest) { NameTest nameTest = (NameTest) test; if (nameTest.matchesAny() || nameTest.matchesAnyLocalName()) { priority = -0.25d; } else { priority = 0.0d; } } else { NodeTypeTest nodeTypeTest = (NodeTypeTest) test; if (nodeTypeTest.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE && nodeTypeTest.getData() != null) { priority = 0.0d; } else { priority = -0.5d; } } } this.precedence = precedence; this.priority = priority; this.mode = mode; }
{
void apply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { System.err.println("...applying " + toString() + " to " + context); if (node != null) { node.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } }
}
void apply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { System.err.println("...applying " + toString() + " to " + context); if (node != null) { node.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } }
{
public int compareTo(Object other) { if (other instanceof Template) { Template t = (Template) other; int d = t.precedence - precedence; if (d != 0) { return d; } double d2 = t.priority - priority; if (d2 != 0.0d) { return (int) Math.round(d2 * 1000.0d); } } return 0; }
}
public int compareTo(Object other) { if (other instanceof Template) { Template t = (Template) other; int d = t.precedence - precedence; if (d != 0) { return d; } double d2 = t.priority - priority; if (d2 != 0.0d) { return (int) Math.round(d2 * 1000.0d); } } return 0; }
{
Test getNodeTest(Expr expr) { if (expr instanceof Selector) { Selector selector = (Selector) expr; Test[] tests = selector.getTests(); if (tests.length > 0) { return tests[0]; } } return null; }
}
Test getNodeTest(Expr expr) { if (expr instanceof Selector) { Selector selector = (Selector) expr; Test[] tests = selector.getTests(); if (tests.length > 0) { return tests[0]; } } return null; }
{
boolean imports(Template other) { for (Stylesheet ctx = other.stylesheet.parent; ctx != null; ctx = ctx.parent) { if (ctx == stylesheet) { return true; } } return false; }
}
boolean imports(Template other) { for (Stylesheet ctx = other.stylesheet.parent; ctx != null; ctx = ctx.parent) { if (ctx == stylesheet) { return true; } } return false; }
{
void list(PrintStream out) { out.println(toString()); if (node != null) { node.list(1, out, true); } }
}
void list(PrintStream out) { out.println(toString()); if (node != null) { node.list(1, out, true); } }
{
boolean matches(QName mode, Node node) { if ((mode == null && this.mode != null) || (mode != null && !mode.equals(this.mode))) { return false; } if (match == null) { return false; } return match.matches(node); }
}
boolean matches(QName mode, Node node) { if ((mode == null && this.mode != null) || (mode != null && !mode.equals(this.mode))) { return false; } if (match == null) { return false; } return match.matches(node); }
}
if (isAnyNode && node.getNodeType() == Node.DOCUMENT_NODE) return false;
boolean matches(QName mode, Node node) { if ((mode == null && this.mode != null) || (mode != null && !mode.equals(this.mode))) { return false; } if (match == null) { return false; } return match.matches(node); }
{
void list(int depth, PrintStream out, boolean listNext) { for (int i = 0; i < depth; i++) { out.print(" "); } out.println(toString()); if (children != null) { children.list(depth + 1, out, true); } if (listNext && next != null) { next.list(depth, out, listNext); } }
}
void list(int depth, PrintStream out, boolean listNext) { for (int i = 0; i < depth; i++) { out.print(" "); } out.println(toString()); if (children != null) { children.list(depth + 1, out, true); } if (listNext && next != null) { next.list(depth, out, listNext); } }
Object getNegotiatedProperty(String propName) throws SaslException;
Object getNegotiatedProperty(String propName);
Object getNegotiatedProperty(String propName) throws SaslException;
public DecimalFormat (String pattern, DecimalFormatSymbols symbols)
public DecimalFormat ()
public DecimalFormat (String pattern, DecimalFormatSymbols symbols) { if (symbols == null) { throw new NullPointerException("Supplied set of symbols is null."); } this.symbols = symbols; applyPattern(pattern); }
if (symbols == null) { throw new NullPointerException("Supplied set of symbols is null."); } this.symbols = symbols; applyPattern(pattern);
this ("#,##0.###");
public DecimalFormat (String pattern, DecimalFormatSymbols symbols) { if (symbols == null) { throw new NullPointerException("Supplied set of symbols is null."); } this.symbols = symbols; applyPattern(pattern); }
public NO_IMPLEMENT()
public NO_IMPLEMENT(String message)
public NO_IMPLEMENT() { super("", 0, CompletionStatus.COMPLETED_NO); }
super("", 0, CompletionStatus.COMPLETED_NO);
super(message, 0, CompletionStatus.COMPLETED_NO);
public NO_IMPLEMENT() { super("", 0, CompletionStatus.COMPLETED_NO); }
public PendingBuffer(int bufsize)
public PendingBuffer()
public PendingBuffer(int bufsize) { buf = new byte[bufsize]; }
buf = new byte[bufsize];
this( 4096 );
public PendingBuffer(int bufsize) { buf = new byte[bufsize]; }
public RandomAccessFile (String fileName, String mode)
public RandomAccessFile (File file, String mode)
public RandomAccessFile (String fileName, String mode) throws FileNotFoundException { this (new File(fileName), mode); }
this (new File(fileName), mode);
int fdmode; if (mode.equals("r")) fdmode = FileChannelImpl.READ; else if (mode.equals("rw")) fdmode = FileChannelImpl.READ | FileChannelImpl.WRITE; else if (mode.equals("rws")) { fdmode = (FileChannelImpl.READ | FileChannelImpl.WRITE | FileChannelImpl.SYNC); } else if (mode.equals("rwd")) { fdmode = (FileChannelImpl.READ | FileChannelImpl.WRITE | FileChannelImpl.DSYNC); } else throw new IllegalArgumentException ("invalid mode: " + mode); final String fileName = file.getPath(); SecurityManager s = System.getSecurityManager(); if (s != null) { s.checkRead(fileName); if ((fdmode & FileChannelImpl.WRITE) != 0) s.checkWrite(fileName); } ch = FileChannelImpl.create(file, fdmode); fd = new FileDescriptor(ch); if ((fdmode & FileChannelImpl.WRITE) != 0) out = new DataOutputStream (new FileOutputStream (fd)); else out = null; in = new DataInputStream (new FileInputStream (fd));
public RandomAccessFile (String fileName, String mode) throws FileNotFoundException { this (new File(fileName), mode); }
public void setCrc(long crc) { if ((crc & 0xffffffff00000000L) != 0) { throw new IllegalArgumentException("invalid crc"); }
public void setCrc(long crc) { if ((crc & 0xffffffff00000000L) != 0) throw new IllegalArgumentException();
public void setCrc(long crc) { if ((crc & 0xffffffff00000000L) != 0) { throw new IllegalArgumentException("invalid crc"); } this.crc = (int) crc; this.known |= KNOWN_CRC; }
public void setComment(String comment) { if (comment.length() > 0xffff)
public void setComment(String comment) { if (comment != null && comment.length() > 0xffff)
public void setComment(String comment) { if (comment.length() > 0xffff) throw new IllegalArgumentException(); this.comment = comment; }
emmit(out);
emit(out);
public void performTwoPasses(Reader reader, OutputStream out) throws Exception{ StringWriter sw = new StringWriter(); char[] buf = new char[1024]; for(int count; (count = reader.read(buf)) > -1; sw.write(buf, 0, count)); sw.flush(); sw.close(); String data = sw.toString(); //1st pass ReInit(new StringReader(data)); setPass(1); jnasmInput(); assemble(0); //2nd pass setPass(2); instructions.clear(); ReInit(new StringReader(data)); jnasmInput(); emmit(out); }
AbstractFormatter formatter = createFormatter(newValue); try { setText(formatter.valueToString(newValue)); } catch (ParseException ex) { }
public void setValue (Object newValue) { if (value == newValue) return; Object oldValue = value; value = newValue; firePropertyChange("value", oldValue, newValue); }
{ return "JEditorPane"; }
{ return "EditorPaneUI"; }
public String getUIClassID() { return "JEditorPane"; }
return handler.toExternalForm(this);
return ph.toExternalForm(this);
public String toExternalForm() { // Identical to toString(). return handler.toExternalForm(this); }
String replacementText);
EntityDeclaration declaration);
public abstract EntityReference createEntityReference(String name, String replacementText);
Attribute(String name, String value)
Attribute(String name, String value, boolean specified)
Attribute(String name, String value) { this.name = name; this.value = value; this.nameSpace = ""; }
this.specified = specified;
Attribute(String name, String value) { this.name = name; this.value = value; this.nameSpace = ""; }
if (attributeCount == attributeSpecified.length) { boolean temp [] = new boolean [attributeSpecified.length + 5]; System.arraycopy (attributeSpecified, 0, temp, 0, attributeCount); attributeSpecified = temp; } attributeSpecified [attributeCount] = isSpecified;
void attribute (String qname, String value, boolean isSpecified) throws SAXException { if (!attributes) { attributes = true; if (namespaces) prefixStack.pushContext (); } // process namespace decls immediately; // then maybe forget this as an attribute if (namespaces) { int index; // default NS declaration? if (getFeature (FEATURE + "string-interning")) { if ("xmlns" == qname) { declarePrefix ("", value); if (!xmlNames) return; } // NS prefix declaration? else if ((index = qname.indexOf (':')) == 5 && qname.startsWith ("xmlns")) { String prefix = qname.substring (6); if (prefix.equals("")) fatal ("missing prefix in namespace declaration attribute"); if (value.length () == 0) { verror ("missing URI in namespace declaration attribute: " + qname); } else declarePrefix (prefix, value); if (!xmlNames) return; } } else { if ("xmlns".equals(qname)) { declarePrefix ("", value); if (!xmlNames) return; } // NS prefix declaration? else if ((index = qname.indexOf (':')) == 5 && qname.startsWith ("xmlns")) { String prefix = qname.substring (6); if (value.length () == 0) { verror ("missing URI in namespace decl attribute: " + qname); } else declarePrefix (prefix, value); if (!xmlNames) return; } } } // remember this attribute ... if (attributeCount == attributeSpecified.length) { // grow array? boolean temp [] = new boolean [attributeSpecified.length + 5]; System.arraycopy (attributeSpecified, 0, temp, 0, attributeCount); attributeSpecified = temp; } attributeSpecified [attributeCount] = isSpecified; attributeCount++; // attribute type comes from querying parser's DTD records attributesList.add(new Attribute(qname, value)); }
attributesList.add(new Attribute(qname, value));
attributesList.add(new Attribute(qname, value, isSpecified));
void attribute (String qname, String value, boolean isSpecified) throws SAXException { if (!attributes) { attributes = true; if (namespaces) prefixStack.pushContext (); } // process namespace decls immediately; // then maybe forget this as an attribute if (namespaces) { int index; // default NS declaration? if (getFeature (FEATURE + "string-interning")) { if ("xmlns" == qname) { declarePrefix ("", value); if (!xmlNames) return; } // NS prefix declaration? else if ((index = qname.indexOf (':')) == 5 && qname.startsWith ("xmlns")) { String prefix = qname.substring (6); if (prefix.equals("")) fatal ("missing prefix in namespace declaration attribute"); if (value.length () == 0) { verror ("missing URI in namespace declaration attribute: " + qname); } else declarePrefix (prefix, value); if (!xmlNames) return; } } else { if ("xmlns".equals(qname)) { declarePrefix ("", value); if (!xmlNames) return; } // NS prefix declaration? else if ((index = qname.indexOf (':')) == 5 && qname.startsWith ("xmlns")) { String prefix = qname.substring (6); if (value.length () == 0) { verror ("missing URI in namespace decl attribute: " + qname); } else declarePrefix (prefix, value); if (!xmlNames) return; } } } // remember this attribute ... if (attributeCount == attributeSpecified.length) { // grow array? boolean temp [] = new boolean [attributeSpecified.length + 5]; System.arraycopy (attributeSpecified, 0, temp, 0, attributeCount); attributeSpecified = temp; } attributeSpecified [attributeCount] = isSpecified; attributeCount++; // attribute type comes from querying parser's DTD records attributesList.add(new Attribute(qname, value)); }
return attributeDeclared [index];
String type = parser.getAttributeType(elementName, getQName(index)); return (type != null);
public boolean isDeclared (int index) { if (index < 0 || index >= attributeCount) throw new ArrayIndexOutOfBoundsException (); return attributeDeclared [index]; }