bugged
stringlengths
6
599k
fixed
stringlengths
10
599k
__index_level_0__
int64
0
1.13M
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 (hagar@jnode.org) :// 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 (hagar@jnode.org) :// Missed wildcard as host address if (ourhost.equals("*")) return true;// @classpath-bugfix-end // Didn't make it 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 ourfirstport = 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 (hagar@jnode.org) :// 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 (hagar@jnode.org) :// Missed wildcard as host address if (ourhost.equals("*")) return true;// @classpath-bugfix-end // Didn't make it return false; }
9,592
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 (hagar@jnode.org) :// 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 (hagar@jnode.org) :// Missed wildcard as host address if (ourhost.equals("*")) return true;// @classpath-bugfix-end // Didn't make it 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 ourlastport = 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 (hagar@jnode.org) :// 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 (hagar@jnode.org) :// Missed wildcard as host address if (ourhost.equals("*")) return true;// @classpath-bugfix-end // Didn't make it return false; }
9,593
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 (hagar@jnode.org) :// 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 (hagar@jnode.org) :// Missed wildcard as host address if (ourhost.equals("*")) return true;// @classpath-bugfix-end // Didn't make it 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 theirfirstport = 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 (hagar@jnode.org) :// 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 (hagar@jnode.org) :// Missed wildcard as host address if (ourhost.equals("*")) return true;// @classpath-bugfix-end // Didn't make it return false; }
9,594
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 (hagar@jnode.org) :// 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 (hagar@jnode.org) :// Missed wildcard as host address if (ourhost.equals("*")) return true;// @classpath-bugfix-end // Didn't make it 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 int theirlastport = 0; String ourhost; String theirhost; String range; int portsIndex; int portDelimitorIndex; portsIndex = hostport.indexOf(ports); if (portsIndex == -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 (hagar@jnode.org) :// 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 int theirlastport = 0; String ourhost; String theirhost; String range; int portsIndex; int portDelimitorIndex; portsIndex = hostport.indexOf(ports); if (portsIndex == -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 (hagar@jnode.org) :// Missed wildcard as host address if (ourhost.equals("*")) return true;// @classpath-bugfix-end // Didn't make it return false; }
9,595
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 (hagar@jnode.org) :// 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 (hagar@jnode.org) :// Missed wildcard as host address if (ourhost.equals("*")) return true;// @classpath-bugfix-end // Didn't make it 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 (hagar@jnode.org) :// 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 (hagar@jnode.org) :// Missed wildcard as host address if (ourhost.equals("*")) return true;// @classpath-bugfix-end // Didn't make it return false; }
9,596
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 (hagar@jnode.org) :// 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 (hagar@jnode.org) :// Missed wildcard as host address if (ourhost.equals("*")) return true;// @classpath-bugfix-end // Didn't make it 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 (hagar@jnode.org) :// 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 (hagar@jnode.org) :// Missed wildcard as host address if (ourhost.equals("*")) return true;// @classpath-bugfix-end // Didn't make it return false; }
9,597
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 (hagar@jnode.org) :// 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 (hagar@jnode.org) :// Missed wildcard as host address if (ourhost.equals("*")) return true;// @classpath-bugfix-end // Didn't make it 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 (hagar@jnode.org) :// 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 (hagar@jnode.org) :// Missed wildcard as host address if (ourhost.equals("*")) return true;// @classpath-bugfix-end // Didn't make it return false; }
9,598
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 (hagar@jnode.org) :// 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 (hagar@jnode.org) :// Missed wildcard as host address if (ourhost.equals("*")) return true;// @classpath-bugfix-end // Didn't make it 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 portsIndex = p.hostport.indexOf(ports); if (portsIndex == -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 (hagar@jnode.org) :// 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 portsIndex = p.hostport.indexOf(ports); if (portsIndex == -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 (hagar@jnode.org) :// Missed wildcard as host address if (ourhost.equals("*")) return true;// @classpath-bugfix-end // Didn't make it return false; }
9,599
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 (hagar@jnode.org) :// 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 (hagar@jnode.org) :// Missed wildcard as host address if (ourhost.equals("*")) return true;// @classpath-bugfix-end // Didn't make it 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 (hagar@jnode.org) :// 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 (hagar@jnode.org) :// Missed wildcard as host address if (ourhost.equals("*")) return true;// @classpath-bugfix-end // Didn't make it return false; }
9,600
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 (hagar@jnode.org) :// 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 (hagar@jnode.org) :// Missed wildcard as host address if (ourhost.equals("*")) return true;// @classpath-bugfix-end // Didn't make it 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 (hagar@jnode.org) :// Wrong usage of hostport and not p.hostport in call to indexOf 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;// @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 (hagar@jnode.org) :// Missed wildcard as host address if (ourhost.equals("*")) return true;// @classpath-bugfix-end // Didn't make it return false; }
9,601
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 (hagar@jnode.org) :// 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 (hagar@jnode.org) :// Missed wildcard as host address if (ourhost.equals("*")) return true;// @classpath-bugfix-end // Didn't make it 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 (hagar@jnode.org) :// 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 (hagar@jnode.org) :// Missed wildcard as host address if (ourhost.equals("*")) return true;// @classpath-bugfix-end // Didn't make it return false; }
9,602
public boolean matches () { return find(0); }
public boolean matches () { if (lookingAt()) { if (position == input.length()) return true; match = null; } return false; }
9,604
public REMatch getMatch(Object input, int index) { return getMatch(input,index,0); }
public REMatch getMatch(Object input, int index) { return getMatch(input,index,0); }
9,605
public String substituteAll(Object input,String replace,int index) { return substituteAll(input,replace,index,0); }
public String substituteAll(Object input,String replace,int index) { return substituteAll(input,replace,index,0); }
9,606
public String substitute(Object input,String replace,int index) { return substitute(input,replace,index,0); }
public String substitute(Object input,String replace,int index) { return substitute(input,replace,index,0); }
9,607
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 color) { super(top, left, bottom, right); this.c = color; }
9,608
public boolean isBorderOpaque() { return false; }
public boolean isBorderOpaque() { return false; }
9,609
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) { }
9,610
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 left, int right, int top, int bottom) { this.l = left; this.r = right; this.t = top; this.b = bottom; }
9,611
public Insets getBorderInsets(Component c) { return getBorderInsets(c, new Insets(0,0,0,0)); }
public Insets getBorderInsets(Component c) { return getBorderInsets(c, new Insets(0,0,0,0)); }
9,612
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, 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; }
9,613
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() { try { return (DocumentBuilderFactory) ClassStuff.createFactory ( defaultPropName, "gnu.xml.dom.JAXPFactory"); } catch (ClassCastException e) { throw new FactoryConfigurationError (e, "Factory class is the wrong type"); } }
9,614
public void setExpandEntityReferences(boolean value) { expandEntityRef = value; } // setExpandEntityReferences()
public void setExpandEntityReferences(boolean value) { expandEntityRef = value; } // setExpandEntityReferences()
9,615
public abstract void setEntityResolver(EntityResolver resolver);
public abstract void setEntityResolver(EntityResolver er);
9,616
public abstract void setErrorHandler(ErrorHandler handler);
public abstract void setErrorHandler(ErrorHandler eh);
9,617
public DOMSource(Node node, String systemID) { this.node = node; this.baseID = systemID; } // DOMSource()
public DOMSource(Node node, String systemID) { this.node = node; this.baseID = systemID; } // DOMSource()
9,618
public abstract Document parse(InputSource source) throws SAXException, IOException;
public abstract Document parse(InputSource source) throws SAXException, IOException;
9,619
public static Object makeIcon(Class baseClass, String gifFile) { return null; }
public static Object makeIcon(Class baseClass, String gifFile) { final URL file = baseClass.getResource(gifFile); return new UIDefaults.LazyValue() { public Object createValue(UIDefaults table) { return new IconUIResource(new ImageIcon(file)); } }; }
9,623
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.DOCUMENT_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; } }
9,624
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; } }
9,625
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; } return true; case Node.PROCESSING_INSTRUCTION_NODE: if (type > 0) { return false; } } return true; default: // Not part of XPath data model return false; } }
9,626
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;
9,627
public void draw (Graphics2D graphics, float x, float y) throws NotImplementedException { throw new Error ("not implemented"); }
public void draw (Graphics2D graphics, float x, float y) throws NotImplementedException { throw new Error ("not implemented"); }
9,629
public void draw (Graphics2D graphics, float x, float y) throws NotImplementedException { throw new Error ("not implemented"); }
public void draw (Graphics2D graphics, float x, float y) throws NotImplementedException { graphics.translate(x, y); if (stroke == STROKE) graphics.draw(shape); else graphics.fill(shape); graphics.translate(- x, - y); }
9,630
public float getAdvance () throws NotImplementedException { throw new Error ("not implemented"); }
public float getAdvance () throws NotImplementedException { throw new Error ("not implemented"); }
9,631
public float getAdvance () throws NotImplementedException { throw new Error ("not implemented"); }
public float getAdvance () throws NotImplementedException { return Math.max(0, (float) bounds.getMaxX()); }
9,632
public float getAscent () throws NotImplementedException { throw new Error ("not implemented"); }
public float getAscent () throws NotImplementedException { throw new Error ("not implemented"); }
9,633
public float getAscent () throws NotImplementedException { throw new Error ("not implemented"); }
public float getAscent () throws NotImplementedException { return Math.max(0, -(float) bounds.getMinY()); }
9,634
public Rectangle2D getBounds () { return shape.getBounds2D (); }
public Rectangle2D getBounds () { Rectangle2D.Float bounds = new Rectangle2D.Float(); bounds.setRect(this.bounds); if (stroke == STROKE) { bounds.width++; bounds.height++; } return bounds; }
9,635
public float getDescent () throws NotImplementedException { throw new Error ("not implemented"); }
public float getDescent () throws NotImplementedException { throw new Error ("not implemented"); }
9,636
public float getDescent () throws NotImplementedException { throw new Error ("not implemented"); }
public float getDescent () throws NotImplementedException { return Math.max(0, (float) bounds.getMaxY()); }
9,637
public abstract void translate(double tx, double ty);
public abstract void translate(int x, int y);
9,638
public void setRect(Rectangle2D r) { x = (float) r.getX(); y = (float) r.getY(); width = (float) r.getWidth(); height = (float) r.getHeight(); }
public void setRect(float x, float y, float w, float h) { x = (float) r.getX(); y = (float) r.getY(); width = (float) r.getWidth(); height = (float) r.getHeight(); }
9,639
public void setRect(Rectangle2D r) { x = (float) r.getX(); y = (float) r.getY(); width = (float) r.getWidth(); height = (float) r.getHeight(); }
public void setRect(Rectangle2D r) { x = (float) r.getX(); y = (float) r.getY(); width = (float) r.getWidth(); height = (float) r.getHeight(); }
9,640
public final Class getCategory() { return PrinterMessageFromOperator.class; }
public Class getCategory() { return PrinterMessageFromOperator.class; }
9,641
public final String getName() { return "printer-message-from-operator"; }
public String getName() { return "printer-message-from-operator"; }
9,642
protected TextSyntax(String value, Locale locale) { if (value == null) throw new NullPointerException("value may not be null"); this.value = value; this.locale = locale; }
protected TextSyntax(String value, Locale locale) { if (value == null) throw new NullPointerException("value may not be null"); this.value = value; this.locale = locale; }
9,643
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(); }
void init() { dragEnabled = false; fixedCellHeight = -1; fixedCellWidth = -1; layoutOrientation = VERTICAL; opaque = true; valueIsAdjusting = false; visibleRowCount = 7; cellRenderer = new DefaultListCellRenderer(); listListener = new ListListener(); setModel(new DefaultListModel()); setSelectionModel(createSelectionModel()); setSelectionMode(ListSelectionModel.SINGLE_SELECTION); setLayout(null); updateUI(); }
9,644
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(); }
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.MULTIPLE_INTERVAL_SELECTION); setLayout(null); updateUI(); }
9,645
public abstract int locationToIndex(JList index, Point location);
public abstract int locationToIndex(JList list, Point location);
9,647
public InvalidMidiDataException(String s) { super(s); }
public InvalidMidiDataException() { super(s); }
9,648
public InvalidMidiDataException(String s) { super(s); }
public InvalidMidiDataException(String s) { super(); }
9,649
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; }
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; }
9,650
public InflaterInputStream(InputStream in, Inflater inf) { this(in, inf, 4096); }
public InflaterInputStream(InputStream in) { this(in, inf, 4096); }
9,651
public InflaterInputStream(InputStream in, Inflater inf) { this(in, inf, 4096); }
public InflaterInputStream(InputStream in, Inflater inf) { this(in, new Inflater(), 4096); }
9,652
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(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"); } }
9,653
public ZipException (String msg) { super(msg); }
public ZipException() { super(msg); }
9,654
public ZipException (String msg) { super(msg); }
public ZipException (String msg) { }
9,655
public void setInput (byte[] buf, int off, int len) { input.setInput (buf, off, len); totalIn += len; }
public void setInput (byte[] buf) { input.setInput (buf, off, len); totalIn += len; }
9,656
public void setInput (byte[] buf, int off, int len) { input.setInput (buf, off, len); totalIn += len; }
public void setInput (byte[] buf, int off, int len) { input.setInput (buf, off, len); totalIn += len; }
9,657
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; }
public int inflate (byte[] buf) 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; }
9,658
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; }
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; }
9,659
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; }
9,660
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;
9,661
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; isAnyNode = false; else { priority = 0.0d; isAnyNode = false; isAnyNode = false; else { NodeTypeTest nodeTypeTest = (NodeTypeTest) test; if (nodeTypeTest.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE && nodeTypeTest.getData() != null) { priority = 0.0d; isAnyNode = false; else { priority = -0.5d; isAnyNode = false; isAnyNode = false; isAnyNode = false; this.precedence = precedence; this.priority = priority; this.mode = mode; isAnyNode = false;
9,662
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 isAnyNode = false; else { priority = 0.0d; else isAnyNode = false; else isAnyNode = false; else { NodeTypeTest nodeTypeTest = (NodeTypeTest) test; if (nodeTypeTest.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE && nodeTypeTest.getData() != null) { priority = 0.0d; else isAnyNode = false; else { priority = -0.5d; else isAnyNode = false; else isAnyNode = false; else isAnyNode = false; this.precedence = precedence; this.priority = priority; this.mode = mode; else isAnyNode = false;
9,663
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); } }
9,664
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);
9,665
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; }
9,666
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;
9,667
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; }
9,668
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;
9,669
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; }
9,670
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;
9,671
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); } }
9,672
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);
9,673
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); }
9,674
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);
9,675
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 (isAnyNode && node.getNodeType() == Node.DOCUMENT_NODE) return false; if (match == null) { return false; if (isAnyNode && node.getNodeType() == Node.DOCUMENT_NODE) return false; return match.matches(node); if (isAnyNode && node.getNodeType() == Node.DOCUMENT_NODE) return false;
9,676
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); } }
9,677
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);
9,678
Object getNegotiatedProperty(String propName) throws SaslException;
Object getNegotiatedProperty(String propName);
9,679
public DecimalFormat (String pattern, DecimalFormatSymbols symbols) { if (symbols == null) { throw new NullPointerException("Supplied set of symbols is null."); } this.symbols = symbols; applyPattern(pattern); }
public DecimalFormat () { if (symbols == null) { throw new NullPointerException("Supplied set of symbols is null."); } this.symbols = symbols; applyPattern(pattern); }
9,680
public DecimalFormat (String pattern, DecimalFormatSymbols symbols) { if (symbols == null) { throw new NullPointerException("Supplied set of symbols is null."); } this.symbols = symbols; applyPattern(pattern); }
public DecimalFormat (String pattern, DecimalFormatSymbols symbols) { if (symbols == null) { throw new NullPointerException("Supplied set of symbols is null."); } this.symbols = symbols; applyPattern(pattern); }
9,681
public NO_IMPLEMENT() { super("", 0, CompletionStatus.COMPLETED_NO); }
public NO_IMPLEMENT(String message) { super("", 0, CompletionStatus.COMPLETED_NO); }
9,682
public NO_IMPLEMENT() { super("", 0, CompletionStatus.COMPLETED_NO); }
public NO_IMPLEMENT() { super(message, 0, CompletionStatus.COMPLETED_NO); }
9,683
public PendingBuffer(int bufsize) { buf = new byte[bufsize]; }
public PendingBuffer() { buf = new byte[bufsize]; }
9,684
public PendingBuffer(int bufsize) { buf = new byte[bufsize]; }
public PendingBuffer(int bufsize) { this( 4096 ); }
9,685
public RandomAccessFile (String fileName, String mode) throws FileNotFoundException { this (new File(fileName), mode); }
public RandomAccessFile (File file, String mode) throws FileNotFoundException { this (new File(fileName), mode); }
9,686
public RandomAccessFile (String fileName, String mode) throws FileNotFoundException { this (new File(fileName), mode); }
public RandomAccessFile (String fileName, String mode) throws FileNotFoundException { 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)); }
9,687
public void setCrc(long crc) { if ((crc & 0xffffffff00000000L) != 0) { throw new IllegalArgumentException("invalid crc"); } this.crc = (int) crc; this.known |= KNOWN_CRC; }
public void setCrc(long crc) { if ((crc & 0xffffffff00000000L) != 0) { throw new IllegalArgumentException("invalid crc"); } this.crc = (int) crc; this.known |= KNOWN_CRC; }
9,688
public void setComment(String comment) { if (comment.length() > 0xffff) throw new IllegalArgumentException(); this.comment = comment; }
public void setComment(String comment) { if (comment.length() > 0xffff) throw new IllegalArgumentException(); this.comment = comment; }
9,689
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); }
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(); emit(out); }
9,690
public String getUIClassID() { return "JEditorPane"; }
public String getUIClassID() { return "EditorPaneUI"; }
9,692
public String toExternalForm() { // Identical to toString(). return handler.toExternalForm(this); }
public String toExternalForm() { // Identical to toString(). return ph.toExternalForm(this); }
9,693
public abstract EntityReference createEntityReference(String name, String replacementText);
public abstract EntityReference createEntityReference(String name, EntityDeclaration declaration);
9,694
Attribute(String name, String value) { this.name = name; this.value = value; this.nameSpace = ""; }
Attribute(String name, String value, boolean specified) { this.name = name; this.value = value; this.nameSpace = ""; }
9,695
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)); }
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)); }
9,697
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)); }
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, isSpecified)); }
9,698
public boolean isDeclared (int index) { if (index < 0 || index >= attributeCount) throw new ArrayIndexOutOfBoundsException (); return attributeDeclared [index]; }
public boolean isDeclared (int index) { if (index < 0 || index >= attributeCount) throw new ArrayIndexOutOfBoundsException (); String type = parser.getAttributeType(elementName, getQName(index)); return (type != null); }
9,699