bugged
stringlengths 6
599k
| fixed
stringlengths 6
40.8M
| __index_level_0__
int64 0
3.24M
|
|---|---|---|
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; }
| 15,620
|
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 if (hostport.equals(empty) && p.hostport.equals(empty)) return true; // 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; }
| 15,621
|
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; }
| 15,622
|
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; }
| 15,623
|
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; }
| 15,624
|
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; }
| 15,625
|
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; }
| 15,626
|
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; }
| 15,627
|
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; }
| 15,628
|
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; }
| 15,629
|
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; }
| 15,630
|
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; }
| 15,631
|
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; }
| 15,632
|
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; }
| 15,633
|
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; }
| 15,634
|
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; }
| 15,635
|
public boolean matches () { return find(0); }
|
public boolean matches () { if (lookingAt()) { if (position == input.length()) return true; match = null; } return false; }
| 15,637
|
public REMatch getMatch(Object input, int index) { return getMatch(input,index,0); }
|
public REMatch getMatch(Object input, int index) { return getMatch(input,index,0); }
| 15,638
|
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); }
| 15,639
|
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); }
| 15,640
|
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; }
| 15,641
|
public boolean isBorderOpaque() { return false; }
|
public boolean isBorderOpaque() { return false; }
| 15,642
|
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) { }
| 15,643
|
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; }
| 15,644
|
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)); }
| 15,645
|
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; }
| 15,646
|
public boolean isBorderOpaque() { return false; }
|
public boolean isBorderOpaque() { return false; }
| 15,647
|
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) { }
| 15,648
|
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"); } }
| 15,649
|
public void setNamespaceAware(boolean value) { namespaceAware = value; } // setNamespaceAware()
|
public void setNamespaceAware(boolean value) { namespaceAware = value; } // setNamespaceAware()
| 15,650
|
public void setExpandEntityReferences(boolean value) { expandEntityRef = value; } // setExpandEntityReferences()
|
public void setExpandEntityReferences(boolean value) { expandEntityRef = value; } // setExpandEntityReferences()
| 15,651
|
public abstract void setEntityResolver(EntityResolver resolver);
|
public abstract void setEntityResolver(EntityResolver resolver);
| 15,652
|
public abstract void setErrorHandler(ErrorHandler handler);
|
public abstract void setErrorHandler(ErrorHandler handler);
| 15,653
|
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()
| 15,654
|
public abstract Document parse(InputSource source) throws SAXException, IOException;
|
public abstract Document parse(InputSource source) throws SAXException, IOException;
| 15,655
|
public SimpleAttributeSet(AttributeSet a) { tab = new Hashtable(); if (a != null) addAttributes(a); }
|
public SimpleAttributeSet() { tab = new Hashtable(); if (a != null) addAttributes(a); }
| 15,656
|
public SimpleAttributeSet(AttributeSet a) { tab = new Hashtable(); if (a != null) addAttributes(a); }
|
public SimpleAttributeSet(AttributeSet a) { tab = new Hashtable(); if (a != null) addAttributes(a); }
| 15,657
|
public static void installColors(JComponent c, String defaultBgName, String defaultFgName) { }
|
public static void installColors(JComponent c, String defaultBgName, String defaultFgName) { }
| 15,659
|
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)); } }; }
| 15,662
|
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; } }
| 15,663
|
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; } }
| 15,664
|
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; } }
| 15,665
|
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; }
| 15,666
|
public ShapeGraphicAttribute (Shape shape, int alignment, boolean stroke) { super (alignment); this.shape = shape; this.stroke = stroke; }
|
public ShapeGraphicAttribute(Shape shape, int alignment, boolean stroke) { super (alignment); this.shape = shape; this.stroke = stroke; }
| 15,667
|
public ShapeGraphicAttribute (Shape shape, int alignment, boolean stroke) { super (alignment); this.shape = shape; this.stroke = stroke; }
|
public ShapeGraphicAttribute (Shape shape, int alignment, boolean stroke) { super(alignment); this.shape = shape; this.stroke = stroke; }
| 15,668
|
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"); }
| 15,670
|
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); }
| 15,671
|
public boolean equals (Object obj) { if (! (obj instanceof ShapeGraphicAttribute)) return false; return equals ((ShapeGraphicAttribute) obj); }
|
public boolean equals(Object obj) { if (! (obj instanceof ShapeGraphicAttribute)) return false; return equals ((ShapeGraphicAttribute) obj); }
| 15,672
|
public boolean equals (Object obj) { if (! (obj instanceof ShapeGraphicAttribute)) return false; return equals ((ShapeGraphicAttribute) obj); }
|
public boolean equals (Object obj) { if (! (obj instanceof ShapeGraphicAttribute)) return false; return equals((ShapeGraphicAttribute) obj); }
| 15,673
|
public float getAdvance () throws NotImplementedException { throw new Error ("not implemented"); }
|
public float getAdvance () throws NotImplementedException { throw new Error ("not implemented"); }
| 15,674
|
public float getAdvance () throws NotImplementedException { throw new Error ("not implemented"); }
|
public float getAdvance () throws NotImplementedException { return Math.max(0, (float) bounds.getMaxX()); }
| 15,675
|
public float getAscent () throws NotImplementedException { throw new Error ("not implemented"); }
|
public float getAscent () throws NotImplementedException { throw new Error ("not implemented"); }
| 15,676
|
public float getAscent () throws NotImplementedException { throw new Error ("not implemented"); }
|
public float getAscent () throws NotImplementedException { return Math.max(0, -(float) bounds.getMinY()); }
| 15,677
|
public Rectangle2D getBounds () { return shape.getBounds2D (); }
|
public Rectangle2D getBounds() { return shape.getBounds2D (); }
| 15,678
|
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; }
| 15,679
|
public float getDescent () throws NotImplementedException { throw new Error ("not implemented"); }
|
public float getDescent () throws NotImplementedException { throw new Error ("not implemented"); }
| 15,680
|
public float getDescent () throws NotImplementedException { throw new Error ("not implemented"); }
|
public float getDescent () throws NotImplementedException { return Math.max(0, (float) bounds.getMaxY()); }
| 15,681
|
public int hashCode () { // FIXME: Check what SUN does here return shape.hashCode (); }
|
public int hashCode() { // FIXME: Check what SUN does here return shape.hashCode (); }
| 15,682
|
public int hashCode () { // FIXME: Check what SUN does here return shape.hashCode (); }
|
public int hashCode () { // FIXME: Check what SUN does here return shape.hashCode(); }
| 15,683
|
public abstract void translate(double tx, double ty);
|
public abstract void translate(double tx, double ty);
| 15,684
|
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(); }
| 15,685
|
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(); }
| 15,686
|
public final Class getCategory() { return PrinterMessageFromOperator.class; }
|
public Class getCategory() { return PrinterMessageFromOperator.class; }
| 15,687
|
public final String getName() { return "printer-message-from-operator"; }
|
public String getName() { return "printer-message-from-operator"; }
| 15,688
|
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; }
| 15,689
|
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(); }
| 15,690
|
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(); }
| 15,691
|
public abstract int locationToIndex(JList index, Point location);
|
public abstract int locationToIndex(JList index, Point location);
| 15,693
|
public InvalidMidiDataException(String s) { super(s); }
|
public InvalidMidiDataException() { super(s); }
| 15,694
|
public InvalidMidiDataException(String s) { super(s); }
|
public InvalidMidiDataException(String s) { super(); }
| 15,695
|
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; }
| 15,696
|
public InflaterInputStream(InputStream in, Inflater inf) { this(in, inf, 4096); }
|
public InflaterInputStream(InputStream in) { this(in, inf, 4096); }
| 15,697
|
public InflaterInputStream(InputStream in, Inflater inf) { this(in, inf, 4096); }
|
public InflaterInputStream(InputStream in, Inflater inf) { this(in, new Inflater(), 4096); }
| 15,698
|
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"); } }
| 15,699
|
public ZipException (String msg) { super(msg); }
|
public ZipException() { super(msg); }
| 15,700
|
public ZipException (String msg) { super(msg); }
|
public ZipException (String msg) { }
| 15,701
|
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; }
| 15,702
|
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; }
| 15,703
|
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; }
| 15,704
|
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; }
| 15,705
|
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; }
| 15,706
|
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; }
| 15,707
|
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; }
| 15,708
|
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; }
| 15,709
|
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; }
| 15,710
|
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; }
| 15,711
|
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; }
| 15,712
|
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; }
| 15,713
|
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); } }
| 15,714
|
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); }
| 15,715
|
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; }
| 15,716
|
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; }
| 15,717
|
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; }
| 15,718
|
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; }
| 15,719
|
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; }
| 15,720
|
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; }
| 15,721
|
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; }
| 15,722
|
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; }
| 15,723
|
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); } }
| 15,724
|
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); }
| 15,725
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.