bugged
stringlengths
6
599k
fixed
stringlengths
10
599k
__index_level_0__
int64
0
1.13M
public static UserException readUserException(String idl, InputStream input) { try { String holder = toHelperName(idl); Class holderClass = Class.forName(holder); Method read = holderClass.getMethod("read", new Class[] { org.omg.CORBA.portable.InputStream.class } ); return (UserException) read.invoke(null, new Object[] { input }); } catch (MARSHAL mex) { // This one is ok to throw throw mex; } catch (Exception ex) { ex.printStackTrace(); return null; } }
public static UserException readUserException(String idl, InputStream input) { try { String holder = toHelperName(idl); Class holderClass = Class.forName(holder); Method read = helperClass.getMethod("read", new Class[] { org.omg.CORBA.portable.InputStream.class } ); return (UserException) read.invoke(null, new Object[] { input }); } catch (MARSHAL mex) { // This one is ok to throw throw mex; } catch (Exception ex) { ex.printStackTrace(); return null; } }
13,610
public Date parse (String dateStr, ParsePosition pos) { int fmt_index = 0; int fmt_max = pattern.length(); calendar.clear(); boolean saw_timezone = false; int quote_start = -1; boolean is2DigitYear = false; try { for (; fmt_index < fmt_max; ++fmt_index) { char ch = pattern.charAt(fmt_index); if (ch == '\'') { int index = pos.getIndex(); if (fmt_index < fmt_max - 1 && pattern.charAt(fmt_index + 1) == '\'') { if (! expect (dateStr, pos, ch)) return null; ++fmt_index; } else quote_start = quote_start < 0 ? fmt_index : -1; continue; } if (quote_start != -1 || ((ch < 'a' || ch > 'z') && (ch < 'A' || ch > 'Z'))) { if (! expect (dateStr, pos, ch)) return null; continue; } // We've arrived at a potential pattern character in the // pattern. int fmt_count = 1; while (++fmt_index < fmt_max && pattern.charAt(fmt_index) == ch) { ++fmt_count; } // We might need to limit the number of digits to parse in // some cases. We look to the next pattern character to // decide. boolean limit_digits = false; if (fmt_index < fmt_max && standardChars.indexOf(pattern.charAt(fmt_index)) >= 0) limit_digits = true; --fmt_index; // We can handle most fields automatically: most either are // numeric or are looked up in a string vector. In some cases // we need an offset. When numeric, `offset' is added to the // resulting value. When doing a string lookup, offset is the // initial index into the string array. int calendar_field; boolean is_numeric = true; int offset = 0; boolean maybe2DigitYear = false; Integer simpleOffset; String[] set1 = null; String[] set2 = null; switch (ch) { case 'd': calendar_field = Calendar.DATE; break; case 'D': calendar_field = Calendar.DAY_OF_YEAR; break; case 'F': calendar_field = Calendar.DAY_OF_WEEK_IN_MONTH; break; case 'E': is_numeric = false; offset = 1; calendar_field = Calendar.DAY_OF_WEEK; set1 = formatData.getWeekdays(); set2 = formatData.getShortWeekdays(); break; case 'w': calendar_field = Calendar.WEEK_OF_YEAR; break; case 'W': calendar_field = Calendar.WEEK_OF_MONTH; break; case 'M': calendar_field = Calendar.MONTH; if (fmt_count <= 2) offset = -1; else { is_numeric = false; set1 = formatData.getMonths(); set2 = formatData.getShortMonths(); } break; case 'y': calendar_field = Calendar.YEAR; if (fmt_count <= 2) maybe2DigitYear = true; break; case 'K': calendar_field = Calendar.HOUR; break; case 'h': calendar_field = Calendar.HOUR; break; case 'H': calendar_field = Calendar.HOUR_OF_DAY; break; case 'k': calendar_field = Calendar.HOUR_OF_DAY; break; case 'm': calendar_field = Calendar.MINUTE; break; case 's': calendar_field = Calendar.SECOND; break; case 'S': calendar_field = Calendar.MILLISECOND; break; case 'a': is_numeric = false; calendar_field = Calendar.AM_PM; set1 = formatData.getAmPmStrings(); break; case 'z': case 'Z': // We need a special case for the timezone, because it // uses a different data structure than the other cases. is_numeric = false; calendar_field = Calendar.ZONE_OFFSET; String[][] zoneStrings = formatData.getZoneStrings(); int zoneCount = zoneStrings.length; int index = pos.getIndex(); boolean found_zone = false; simpleOffset = computeOffset(dateStr.substring(index)); if (simpleOffset != null) { found_zone = true; saw_timezone = true; calendar.set(Calendar.DST_OFFSET, 0); offset = simpleOffset.intValue(); } else { for (int j = 0; j < zoneCount; j++) { String[] strings = zoneStrings[j]; int k; for (k = 0; k < strings.length; ++k) { if (dateStr.startsWith(strings[k], index)) break; } if (k != strings.length) { found_zone = true; saw_timezone = true; TimeZone tz = TimeZone.getTimeZone (strings[0]); calendar.set (Calendar.DST_OFFSET, tz.getDSTSavings()); offset = tz.getRawOffset (); pos.setIndex(index + strings[k].length()); break; } } } if (! found_zone) { pos.setErrorIndex(pos.getIndex()); return null; } break; default: pos.setErrorIndex(pos.getIndex()); return null; } // Compute the value we should assign to the field. int value; int index = -1; if (is_numeric) { numberFormat.setMinimumIntegerDigits(fmt_count); if (limit_digits) numberFormat.setMaximumIntegerDigits(fmt_count); if (maybe2DigitYear) index = pos.getIndex(); Number n = numberFormat.parse(dateStr, pos); if (pos == null || ! (n instanceof Long)) return null; value = n.intValue() + offset; } else if (set1 != null) { index = pos.getIndex(); int i; boolean found = false; for (i = offset; i < set1.length; ++i) { if (set1[i] != null) if (dateStr.toUpperCase().startsWith(set1[i].toUpperCase(), index)) { found = true; pos.setIndex(index + set1[i].length()); break; } } if (!found && set2 != null) { for (i = offset; i < set2.length; ++i) { if (set2[i] != null) if (dateStr.toUpperCase().startsWith(set2[i].toUpperCase(), index)) { found = true; pos.setIndex(index + set2[i].length()); break; } } } if (!found) { pos.setErrorIndex(index); return null; } value = i; } else value = offset; if (maybe2DigitYear) { // Parse into default century if the numeric year string has // exactly 2 digits. int digit_count = pos.getIndex() - index; if (digit_count == 2) is2DigitYear = true; } // Assign the value and move on. calendar.set(calendar_field, value); } if (is2DigitYear) { // Apply the 80-20 heuristic to dermine the full year based on // defaultCenturyStart. int year = defaultCentury + calendar.get(Calendar.YEAR); calendar.set(Calendar.YEAR, year); if (calendar.getTime().compareTo(defaultCenturyStart) < 0) calendar.set(Calendar.YEAR, year + 100); } if (! saw_timezone) { // Use the real rules to determine whether or not this // particular time is in daylight savings. calendar.clear (Calendar.DST_OFFSET); calendar.clear (Calendar.ZONE_OFFSET); } return calendar.getTime(); } catch (IllegalArgumentException x) { pos.setErrorIndex(pos.getIndex()); return null; } }
public Date parse (String dateStr, ParsePosition pos) { int fmt_index = 0; int fmt_max = pattern.length(); calendar.clear(); boolean saw_timezone = false; int quote_start = -1; boolean is2DigitYear = false; try { for (; fmt_index < fmt_max; ++fmt_index) { char ch = pattern.charAt(fmt_index); if (ch == '\'') { int index = pos.getIndex(); if (fmt_index < fmt_max - 1 && pattern.charAt(fmt_index + 1) == '\'') { if (! expect (dateStr, pos, ch)) return null; ++fmt_index; } else quote_start = quote_start < 0 ? fmt_index : -1; continue; } if (quote_start != -1 || ((ch < 'a' || ch > 'z') && (ch < 'A' || ch > 'Z'))) { if (! expect (dateStr, pos, ch)) return null; continue; } // We've arrived at a potential pattern character in the // pattern. int fmt_count = 1; while (++fmt_index < fmt_max && pattern.charAt(fmt_index) == ch) { ++fmt_count; } // We might need to limit the number of digits to parse in // some cases. We look to the next pattern character to // decide. boolean limit_digits = false; if (fmt_index < fmt_max && standardChars.indexOf(pattern.charAt(fmt_index)) >= 0) limit_digits = true; --fmt_index; // We can handle most fields automatically: most either are // numeric or are looked up in a string vector. In some cases // we need an offset. When numeric, `offset' is added to the // resulting value. When doing a string lookup, offset is the // initial index into the string array. int calendar_field; boolean is_numeric = true; int offset = 0; boolean maybe2DigitYear = false; Integer simpleOffset; String[] set1 = null; String[] set2 = null; switch (ch) { case 'd': calendar_field = Calendar.DATE; break; case 'D': calendar_field = Calendar.DAY_OF_YEAR; break; case 'F': calendar_field = Calendar.DAY_OF_WEEK_IN_MONTH; break; case 'E': is_numeric = false; offset = 1; calendar_field = Calendar.DAY_OF_WEEK; set1 = formatData.getWeekdays(); set2 = formatData.getShortWeekdays(); break; case 'w': calendar_field = Calendar.WEEK_OF_YEAR; break; case 'W': calendar_field = Calendar.WEEK_OF_MONTH; break; case 'M': calendar_field = Calendar.MONTH; if (fmt_count <= 2) offset = -1; else { is_numeric = false; set1 = formatData.getMonths(); set2 = formatData.getShortMonths(); } break; case 'y': calendar_field = Calendar.YEAR; if (fmt_count <= 2) maybe2DigitYear = true; break; case 'K': calendar_field = Calendar.HOUR; break; case 'h': calendar_field = Calendar.HOUR; break; case 'H': calendar_field = Calendar.HOUR_OF_DAY; break; case 'k': calendar_field = Calendar.HOUR_OF_DAY; break; case 'm': calendar_field = Calendar.MINUTE; break; case 's': calendar_field = Calendar.SECOND; break; case 'S': calendar_field = Calendar.MILLISECOND; break; case 'a': is_numeric = false; calendar_field = Calendar.AM_PM; set1 = formatData.getAmPmStrings(); break; case 'z': case 'Z': // We need a special case for the timezone, because it // uses a different data structure than the other cases. is_numeric = false; calendar_field = Calendar.ZONE_OFFSET; String[][] zoneStrings = formatData.getZoneStrings(); int zoneCount = zoneStrings.length; int index = pos.getIndex(); boolean found_zone = false; simpleOffset = computeOffset(dateStr.substring(index)); if (simpleOffset != null) { found_zone = true; saw_timezone = true; calendar.set(Calendar.DST_OFFSET, 0); offset = simpleOffset.intValue(); } else { for (int j = 0; j < zoneCount; j++) { String[] strings = zoneStrings[j]; int k; for (k = 0; k < strings.length; ++k) { if (dateStr.startsWith(strings[k], index)) break; } if (k != strings.length) { found_zone = true; saw_timezone = true; TimeZone tz = TimeZone.getTimeZone (strings[0]); calendar.set (Calendar.DST_OFFSET, tz.getDSTSavings()); offset = tz.getRawOffset (); pos.setIndex(index + strings[k].length()); break; } } } if (! found_zone) { pos.setErrorIndex(pos.getIndex()); return null; } break; default: pos.setErrorIndex(pos.getIndex()); return null; } // Compute the value we should assign to the field. int value; int index = -1; if (is_numeric) { numberFormat.setMinimumIntegerDigits(fmt_count); if (limit_digits) numberFormat.setMaximumIntegerDigits(fmt_count); if (maybe2DigitYear) index = pos.getIndex(); Number n = numberFormat.parse(dateStr, pos); if (pos == null || ! (n instanceof Long)) return null; value = n.intValue() + offset; } else if (set1 != null) { index = pos.getIndex(); int i; boolean found = false; for (i = offset; i < set1.length; ++i) { if (set1[i] != null) if (dateStr.toUpperCase().startsWith(set1[i].toUpperCase(), index)) { found = true; pos.setIndex(index + set1[i].length()); break; } } if (!found && set2 != null) { for (i = offset; i < set2.length; ++i) { if (set2[i] != null) if (dateStr.toUpperCase().startsWith(set2[i].toUpperCase(), index)) { found = true; pos.setIndex(index + set2[i].length()); break; } } } if (!found) { pos.setErrorIndex(index); return null; } value = i; } else value = offset; if (maybe2DigitYear) { // Parse into default century if the numeric year string has // exactly 2 digits. int digit_count = pos.getIndex() - index; if (digit_count == 2) is2DigitYear = true; } // Assign the value and move on. calendar.set(calendar_field, value); } if (is2DigitYear) { // Apply the 80-20 heuristic to dermine the full year based on // defaultCenturyStart. int year = defaultCentury + calendar.get(Calendar.YEAR); calendar.set(Calendar.YEAR, year); if (calendar.getTime().compareTo(defaultCenturyStart) < 0) calendar.set(Calendar.YEAR, year + 100); } if (! saw_timezone) { // Use the real rules to determine whether or not this // particular time is in daylight savings. calendar.clear (Calendar.DST_OFFSET); calendar.clear (Calendar.ZONE_OFFSET); } return calendar.getTime(); } catch (IllegalArgumentException x) { pos.setErrorIndex(pos.getIndex()); return null; } }
13,611
public Expr clone(Object context) { Stylesheet s = stylesheet; if (context instanceof Stylesheet) { s = (Stylesheet) context; } DocumentFunction f = new DocumentFunction(s, base); int len = args.size(); List args2 = new ArrayList(len); for (int i = 0; i < len; i++) { args2.add(((Expr) args.get(i)).clone(context)); } f.setArguments(args2); return f; }
public Expr clone(Object context) Stylesheet s = stylesheet; if (context instanceof Stylesheet) s = (Stylesheet) context; } DocumentFunction f = new DocumentFunction(s, base); int len = args.size(); List args2 = new ArrayList(len); for (int i = 0; i < len; i++) args2.add(((Expr) args.get(i)).clone(context)); } f.setArguments(args2); return f; }
13,612
public Expr clone(Object context) { Stylesheet s = stylesheet; if (context instanceof Stylesheet) { s = (Stylesheet) context; } DocumentFunction f = new DocumentFunction(s, base); int len = args.size(); List args2 = new ArrayList(len); for (int i = 0; i < len; i++) { args2.add(((Expr) args.get(i)).clone(context)); } f.setArguments(args2); return f; }
public Expr clone(Object context) { Stylesheet s = stylesheet; if (context instanceof Stylesheet) { s = (Stylesheet) context; DocumentFunction f = new DocumentFunction(s, base); int len = args.size(); List args2 = new ArrayList(len); for (int i = 0; i < len; i++) { args2.add(((Expr) args.get(i)).clone(context)); f.setArguments(args2); return f;
13,613
Collection document(String uri, String base) { if ("".equals(uri) || uri == null) { uri = this.base.getBaseURI(); } // Get fragment Expr fragment = null; int hi = uri.indexOf('#'); if (hi != -1) { String f = uri.substring(hi + 1); uri = uri.substring(0, hi); // TODO handle xpointer() here // this only handles IDs fragment = new IdFunction(new Constant(f)); } // Get document source try { DOMSource source; XSLURIResolver resolver = stylesheet.factory.resolver; synchronized (resolver) { if (stylesheet.transformer != null) { resolver.setUserResolver(stylesheet.transformer.uriResolver); resolver.setUserListener(stylesheet.transformer.errorListener); } source = resolver.resolveDOM(null, base, uri); } Node node = source.getNode(); if (fragment == null) { return Collections.singleton(node); } else { Object ret = fragment.evaluate(node, 1, 1); if (!(ret instanceof Collection)) { // XXX Report error? return Collections.EMPTY_SET; } return (Collection) ret; } } catch (TransformerException e) { String msg = "can't open " + uri; if (base != null) { msg += " with base " + base; } throw new RuntimeException(msg); } }
Collection document(String uri, String base) if ("".equals(uri) || uri == null) uri = this.base.getBaseURI(); } // Get fragment Expr fragment = null; int hi = uri.indexOf('#'); if (hi != -1) String f = uri.substring(hi + 1); uri = uri.substring(0, hi); // TODO handle xpointer() here // this only handles IDs fragment = new IdFunction(new Constant(f)); } // Get document source try DOMSource source; XSLURIResolver resolver = stylesheet.factory.resolver; synchronized (resolver) if (stylesheet.transformer != null) resolver.setUserResolver(stylesheet.transformer.uriResolver); resolver.setUserListener(stylesheet.transformer.errorListener); } source = resolver.resolveDOM(null, base, uri); } Node node = source.getNode(); if (fragment == null) return Collections.singleton(node); } else Object ret = fragment.evaluate(node, 1, 1); if (!(ret instanceof Collection)) // XXX Report error? return Collections.EMPTY_SET; } return (Collection) ret; } } catch (TransformerException e) String msg = "can't open " + uri; if (base != null) msg += " with base " + base; } throw new RuntimeException(msg); } }
13,614
Collection document(String uri, String base) { if ("".equals(uri) || uri == null) { uri = this.base.getBaseURI(); } // Get fragment Expr fragment = null; int hi = uri.indexOf('#'); if (hi != -1) { String f = uri.substring(hi + 1); uri = uri.substring(0, hi); // TODO handle xpointer() here // this only handles IDs fragment = new IdFunction(new Constant(f)); } // Get document source try { DOMSource source; XSLURIResolver resolver = stylesheet.factory.resolver; synchronized (resolver) { if (stylesheet.transformer != null) { resolver.setUserResolver(stylesheet.transformer.uriResolver); resolver.setUserListener(stylesheet.transformer.errorListener); } source = resolver.resolveDOM(null, base, uri); } Node node = source.getNode(); if (fragment == null) { return Collections.singleton(node); } else { Object ret = fragment.evaluate(node, 1, 1); if (!(ret instanceof Collection)) { // XXX Report error? return Collections.EMPTY_SET; } return (Collection) ret; } } catch (TransformerException e) { String msg = "can't open " + uri; if (base != null) { msg += " with base " + base; } throw new RuntimeException(msg); } }
Collection document(String uri, String base) { if ("".equals(uri) || uri == null) { uri = this.base.getBaseURI(); // Get fragment Expr fragment = null; int hi = uri.indexOf('#'); if (hi != -1) { String f = uri.substring(hi + 1); uri = uri.substring(0, hi); // TODO handle xpointer() here // this only handles IDs fragment = new IdFunction(new Constant(f)); // Get document source try { DOMSource source; XSLURIResolver resolver = stylesheet.factory.resolver; synchronized (resolver) { if (stylesheet.transformer != null) { resolver.setUserResolver(stylesheet.transformer.uriResolver); resolver.setUserListener(stylesheet.transformer.errorListener); source = resolver.resolveDOM(null, base, uri); Node node = source.getNode(); if (fragment == null) { return Collections.singleton(node); else { Object ret = fragment.evaluate(node, 1, 1); if (!(ret instanceof Collection)) { // XXX Report error? return Collections.EMPTY_SET; return (Collection) ret; catch (TransformerException e) { String msg = "can't open " + uri; if (base != null) { msg += " with base " + base; throw new RuntimeException(msg);
13,615
JarURLConnection(URL url) throws MalformedURLException{ super(url); // Now, strip off the "jar:" and everything from the "!/" to the end // to get the "real" URL inside String url_string = url.toExternalForm(); if (!url_string.startsWith("jar:")) throw new MalformedURLException(url_string); if (url_string.indexOf("!/") == -1) throw new MalformedURLException(url_string); String real_url_string = url_string.substring(4, url_string.indexOf("!/")); real_url = new URL(real_url_string); if (url_string.length() == (url_string.indexOf("!/") + 1)) entry_name = ""; else entry_name = url_string.substring(url_string.indexOf("!/") + 2);}
JarURLConnection(URL url) throws MalformedURLException{ super(url); // Now, strip off the "jar:" and everything from the "!/" to the end // to get the "real" URL inside String url_string = url.toExternalForm(); if (!url_string.startsWith("jar:")) throw new MalformedURLException(url_string); if (url_string.indexOf("!/") == -1) throw new MalformedURLException(url_string); String real_url_string = url_string.substring(4, url_string.indexOf("!/")); real_url = new URL(real_url_string); if (url_string.length() == (url_string.indexOf("!/") + 1)) entry_name = ""; else entry_name = url_string.substring(url_string.indexOf("!/") + 2);}
13,618
JarURLConnection(URL url) throws MalformedURLException{ super(url); // Now, strip off the "jar:" and everything from the "!/" to the end // to get the "real" URL inside String url_string = url.toExternalForm(); if (!url_string.startsWith("jar:")) throw new MalformedURLException(url_string); if (url_string.indexOf("!/") == -1) throw new MalformedURLException(url_string); String real_url_string = url_string.substring(4, url_string.indexOf("!/")); real_url = new URL(real_url_string); if (url_string.length() == (url_string.indexOf("!/") + 1)) entry_name = ""; else entry_name = url_string.substring(url_string.indexOf("!/") + 2);}
JarURLConnection(URL url) throws MalformedURLException{ super(url); // Now, strip off the "jar:" and everything from the "!/" to the end // to get the "real" URL inside if (! url.getProtocol().equals("jar")) throw new MalformedURLException(url + ": Not jar protocol."); if (!url_string.startsWith("jar:")) throw new MalformedURLException(url_string); if (url_string.indexOf("!/") == -1) throw new MalformedURLException(url_string); String real_url_string = url_string.substring(4, url_string.indexOf("!/")); real_url = new URL(real_url_string); if (url_string.length() == (url_string.indexOf("!/") + 1)) entry_name = ""; else entry_name = url_string.substring(url_string.indexOf("!/") + 2);}
13,619
JarURLConnection(URL url) throws MalformedURLException{ super(url); // Now, strip off the "jar:" and everything from the "!/" to the end // to get the "real" URL inside String url_string = url.toExternalForm(); if (!url_string.startsWith("jar:")) throw new MalformedURLException(url_string); if (url_string.indexOf("!/") == -1) throw new MalformedURLException(url_string); String real_url_string = url_string.substring(4, url_string.indexOf("!/")); real_url = new URL(real_url_string); if (url_string.length() == (url_string.indexOf("!/") + 1)) entry_name = ""; else entry_name = url_string.substring(url_string.indexOf("!/") + 2);}
JarURLConnection(URL url) throws MalformedURLException{ super(url); // Now, strip off the "jar:" and everything from the "!/" to the end // to get the "real" URL inside String url_string = url.toExternalForm(); if (!url_string.startsWith("jar:")) throw new MalformedURLException(url_string); if (url_string.indexOf("!/") == -1) throw new MalformedURLException(url_string); String real_url_string = url_string.substring(4, url_string.indexOf("!/")); real_url = new URL(real_url_string); if (url_string.length() == (url_string.indexOf("!/") + 1)) entry_name = ""; else entry_name = url_string.substring(url_string.indexOf("!/") + 2);}
13,620
JarURLConnection(URL url) throws MalformedURLException{ super(url); // Now, strip off the "jar:" and everything from the "!/" to the end // to get the "real" URL inside String url_string = url.toExternalForm(); if (!url_string.startsWith("jar:")) throw new MalformedURLException(url_string); if (url_string.indexOf("!/") == -1) throw new MalformedURLException(url_string); String real_url_string = url_string.substring(4, url_string.indexOf("!/")); real_url = new URL(real_url_string); if (url_string.length() == (url_string.indexOf("!/") + 1)) entry_name = ""; else entry_name = url_string.substring(url_string.indexOf("!/") + 2);}
JarURLConnection(URL url) throws MalformedURLException{ super(url); // Now, strip off the "jar:" and everything from the "!/" to the end // to get the "real" URL inside String url_string = url.toExternalForm(); if (!url_string.startsWith("jar:")) throw new MalformedURLException(url_string); if (url_string.indexOf("!/") == -1) throw new MalformedURLException(url_string); String real_url_string = url_string.substring(4, url_string.indexOf("!/")); real_url = new URL(real_url_string); if (url_string.length() == (url_string.indexOf("!/") + 1)) entry_name = ""; else entry_name = url_string.substring(url_string.indexOf("!/") + 2);}
13,621
JarURLConnection(URL url) throws MalformedURLException{ super(url); // Now, strip off the "jar:" and everything from the "!/" to the end // to get the "real" URL inside String url_string = url.toExternalForm(); if (!url_string.startsWith("jar:")) throw new MalformedURLException(url_string); if (url_string.indexOf("!/") == -1) throw new MalformedURLException(url_string); String real_url_string = url_string.substring(4, url_string.indexOf("!/")); real_url = new URL(real_url_string); if (url_string.length() == (url_string.indexOf("!/") + 1)) entry_name = ""; else entry_name = url_string.substring(url_string.indexOf("!/") + 2);}
JarURLConnection(URL url) throws MalformedURLException{ super(url); // Now, strip off the "jar:" and everything from the "!/" to the end // to get the "real" URL inside String url_string = url.toExternalForm(); if (!url_string.startsWith("jar:")) throw new MalformedURLException(url_string); if (url_string.indexOf("!/") == -1) throw new MalformedURLException(url_string); String real_url_string = url_string.substring(4, url_string.indexOf("!/")); real_url = new URL(real_url_string); if (url_string.length() == (url_string.indexOf("!/") + 1)) entry_name = ""; else entry_name = url_string.substring(url_string.indexOf("!/") + 2);}
13,622
getAttributes() throws IOException{ return(getJarEntry().getAttributes());}
getAttributes() throws IOException{ return(getJarEntry().getAttributes());}
13,623
getCertificates() throws IOException{ return(getJarEntry().getCertificates());}
getCertificates() throws IOException{ return(getJarEntry().getCertificates());}
13,624
getEntryName(){ return(entry_name);}
getEntryName(){ return(entry_name);}
13,625
getJarEntry() throws IOException{ if (jar_file == null) jar_file = getJarFile(); return(jar_file.getJarEntry(entry_name));}
getJarEntry() throws IOException{ if (jar_file == null) jar_file = getJarFile(); return(jar_file.getJarEntry(entry_name));}
13,626
getJarEntry() throws IOException{ if (jar_file == null) jar_file = getJarFile(); return(jar_file.getJarEntry(entry_name));}
getJarEntry() throws IOException{ if (jar_file == null) jar_file = getJarFile(); return(jar_file.getJarEntry(entry_name));}
13,627
getJarFile() throws IOException;
public abstract JarFile getJarFile() throws IOException;
13,628
getJarFileURL(){ return(real_url);}
getJarFileURL(){ return(real_url);}
13,629
getMainAttributes() throws IOException{ return(getManifest().getMainAttributes());}
getMainAttributes() throws IOException{ return(getManifest().getMainAttributes());}
13,630
getManifest() throws IOException{ if (jar_file == null) jar_file = getJarFile(); return(jar_file.getManifest());}
getManifest() throws IOException{ if (jar_file == null) jar_file = getJarFile(); return(jar_file.getManifest());}
13,631
getManifest() throws IOException{ if (jar_file == null) jar_file = getJarFile(); return(jar_file.getManifest());}
getManifest() throws IOException{ if (jar_file == null) jar_file = getJarFile(); return(jar_file.getManifest());}
13,632
public AccessibleJApplet() { super(); // Nothing to do here. }
protected AccessibleJApplet() { super(); // Nothing to do here. }
13,633
public Frame() { this(""); }
public Frame() { this(""); }
13,635
public void addNotify() { if (peer == null) peer = getToolkit().createFrame(this); super.addNotify(); }
public void addNotify() { if (peer == null) peer = getToolkit().createFrame(this); super.addNotify(); }
13,636
public int getCursorType() { return (getCursor().getType()); }
public int getCursorType() { return (getCursor().getType()); }
13,637
public static Frame[] getFrames() { //Frame[] array = new Frames[frames.size()]; //return frames.toArray(array); // see finalize() comment String msg = "FIXME: can't be implemented without weak references"; throw new UnsupportedOperationException(msg); }
public static Frame[] getFrames() { //Frame[] array = new Frames[frames.size()]; //return frames.toArray(array); // see finalize() comment String msg = "FIXME: can't be implemented without weak references"; throw new UnsupportedOperationException(msg); }
13,638
public Image getIconImage() { return (icon); }
public Image getIconImage() { return (icon); }
13,639
public MenuBar getMenuBar() { return (menuBar); }
public MenuBar getMenuBar() { return (menuBar); }
13,640
public int getState() { /* FIXME: State might have changed in the peer... Must check. */ return state; }
public int getState() { /* FIXME: State might have changed in the peer... Must check. */ return state; }
13,641
public String getTitle() { return (title); }
public String getTitle() { return (title); }
13,642
public boolean isResizable() { return (resizable); }
public boolean isResizable() { return (resizable); }
13,643
protected String paramString() { return (getClass().getName()); }
protected String paramString() { return (getClass().getName()); }
13,644
public void remove(MenuComponent menu) { menuBar.remove(menu); }
public void remove(MenuComponent menu) { menuBar.remove(menu); }
13,645
public void setCursor(int type) { setCursor(new Cursor(type)); }
public void setCursor(int type) { setCursor(new Cursor(type)); }
13,646
public synchronized void setIconImage(Image icon) { this.icon = icon; if (peer != null) ((FramePeer) peer).setIconImage(icon); }
public synchronized void setIconImage(Image icon) { this.icon = icon; if (peer != null) ((FramePeer) peer).setIconImage(icon); }
13,647
public synchronized void setMenuBar(MenuBar menuBar) { this.menuBar = menuBar; if (peer != null) ((FramePeer) peer).setMenuBar(menuBar); }
public synchronized void setMenuBar(MenuBar menuBar) { this.menuBar = menuBar; if (peer != null) ((FramePeer) peer).setMenuBar(menuBar); }
13,648
public synchronized void setResizable(boolean resizable) { this.resizable = resizable; if (peer != null) ((FramePeer) peer).setResizable(resizable); }
public synchronized void setResizable(boolean resizable) { this.resizable = resizable; if (peer != null) ((FramePeer) peer).setResizable(resizable); }
13,649
public synchronized void setTitle(String title) { this.title = title; if (peer != null) ((FramePeer) peer).setTitle(title); }
public synchronized void setTitle(String title) { this.title = title; if (peer != null) ((FramePeer) peer).setTitle(title); }
13,650
public abstract Object get(String name, Object defvalue) throws IOException, IllegalArgumentException;
public abstract boolean get(String name, boolean defvalue) throws IOException, IllegalArgumentException;
13,652
public Serializable read_value() { return read_value((Class) null); }
public Serializable read_value() { return Vio.read(this); }
13,653
private void printList(File[] list, PrintStream out) { if (list != null) { Arrays.sort(list, new Comparator<File>() { public int compare(File f1, File f2) { boolean b1 = f1.isDirectory(); boolean b2 = f2.isDirectory(); return b1 == b2 ? f1.getName().compareTo(f2.getName()) : b1 & !b2 ? -1 : 1; } }); StringBuilder sb = new StringBuilder(); Date lastModified = new Date(); for (int i = 0; i < list.length; i++) { File f = list[i]; if (f.exists()) { sb.setLength(0); lastModified.setTime(f.lastModified()); if (f.isFile()) { String ln = String.valueOf(f.length()); int cnt = LEFT_MARGIN - ln.length(); for (int j = 0; j < cnt; j++, sb.append(' ')) ; sb.append(ln); sb.append("B "); sb.append(df.format(lastModified)); sb.append(" "); sb.append(f.getName()); } else { for (int j = 0; j < LEFT_MARGIN + 4; j++, sb.append(' ')) ; sb.append(df.format(lastModified)); sb.append(" ["); sb.append(f.getName()); sb.append(']'); } out.println(sb.toString()); } } out.println(); } }
private void printList(File[] list, PrintStream out) { if (list != null) { Arrays.sort(list, new Comparator<File>() { public int compare(File f1, File f2) { boolean b1 = f1.isDirectory(); boolean b2 = f2.isDirectory(); return b1 == b2 ? f1.getName().compareTo(f2.getName()) : b1 & !b2 ? -1 : 1; } }); StringBuilder sb = new StringBuilder(); Date lastModified = new Date(); for (int i = 0; i < list.length; i++) { File f = list[i]; if (f.exists()) { sb.setLength(0); lastModified.setTime(f.lastModified()); if (f.isFile()) { String ln = NumberUtils.size(f.length()); int cnt = LEFT_MARGIN - ln.length(); for (int j = 0; j < cnt; j++, sb.append(' ')) ; sb.append(ln); sb.append("B "); sb.append(df.format(lastModified)); sb.append(" "); sb.append(f.getName()); } else { for (int j = 0; j < LEFT_MARGIN + 4; j++, sb.append(' ')) ; sb.append(df.format(lastModified)); sb.append(" ["); sb.append(f.getName()); sb.append(']'); } out.println(sb.toString()); } } out.println(); } }
13,654
private void printList(File[] list, PrintStream out) { if (list != null) { Arrays.sort(list, new Comparator<File>() { public int compare(File f1, File f2) { boolean b1 = f1.isDirectory(); boolean b2 = f2.isDirectory(); return b1 == b2 ? f1.getName().compareTo(f2.getName()) : b1 & !b2 ? -1 : 1; } }); StringBuilder sb = new StringBuilder(); Date lastModified = new Date(); for (int i = 0; i < list.length; i++) { File f = list[i]; if (f.exists()) { sb.setLength(0); lastModified.setTime(f.lastModified()); if (f.isFile()) { String ln = String.valueOf(f.length()); int cnt = LEFT_MARGIN - ln.length(); for (int j = 0; j < cnt; j++, sb.append(' ')) ; sb.append(ln); sb.append("B "); sb.append(df.format(lastModified)); sb.append(" "); sb.append(f.getName()); } else { for (int j = 0; j < LEFT_MARGIN + 4; j++, sb.append(' ')) ; sb.append(df.format(lastModified)); sb.append(" ["); sb.append(f.getName()); sb.append(']'); } out.println(sb.toString()); } } out.println(); } }
private void printList(File[] list, PrintStream out) { if (list != null) { Arrays.sort(list, new Comparator<File>() { public int compare(File f1, File f2) { boolean b1 = f1.isDirectory(); boolean b2 = f2.isDirectory(); return b1 == b2 ? f1.getName().compareTo(f2.getName()) : b1 & !b2 ? -1 : 1; } }); StringBuilder sb = new StringBuilder(); Date lastModified = new Date(); for (int i = 0; i < list.length; i++) { File f = list[i]; if (f.exists()) { sb.setLength(0); lastModified.setTime(f.lastModified()); if (f.isFile()) { String ln = String.valueOf(f.length()); int cnt = LEFT_MARGIN - ln.length(); for (int j = 0; j < cnt; j++, sb.append(' ')) ; sb.append(ln); sb.append(" "); sb.append(df.format(lastModified)); sb.append(" "); sb.append(f.getName()); } else { for (int j = 0; j < LEFT_MARGIN + 4; j++, sb.append(' ')) ; sb.append(df.format(lastModified)); sb.append(" ["); sb.append(f.getName()); sb.append(']'); } out.println(sb.toString()); } } out.println(); } }
13,655
private void printList(File[] list, PrintStream out) { if (list != null) { Arrays.sort(list, new Comparator<File>() { public int compare(File f1, File f2) { boolean b1 = f1.isDirectory(); boolean b2 = f2.isDirectory(); return b1 == b2 ? f1.getName().compareTo(f2.getName()) : b1 & !b2 ? -1 : 1; } }); StringBuilder sb = new StringBuilder(); Date lastModified = new Date(); for (int i = 0; i < list.length; i++) { File f = list[i]; if (f.exists()) { sb.setLength(0); lastModified.setTime(f.lastModified()); if (f.isFile()) { String ln = String.valueOf(f.length()); int cnt = LEFT_MARGIN - ln.length(); for (int j = 0; j < cnt; j++, sb.append(' ')) ; sb.append(ln); sb.append("B "); sb.append(df.format(lastModified)); sb.append(" "); sb.append(f.getName()); } else { for (int j = 0; j < LEFT_MARGIN + 4; j++, sb.append(' ')) ; sb.append(df.format(lastModified)); sb.append(" ["); sb.append(f.getName()); sb.append(']'); } out.println(sb.toString()); } } out.println(); } }
private void printList(File[] list, PrintStream out) { if (list != null) { Arrays.sort(list, new Comparator<File>() { public int compare(File f1, File f2) { boolean b1 = f1.isDirectory(); boolean b2 = f2.isDirectory(); return b1 == b2 ? f1.getName().compareTo(f2.getName()) : b1 & !b2 ? -1 : 1; } }); StringBuilder sb = new StringBuilder(); Date lastModified = new Date(); for (int i = 0; i < list.length; i++) { File f = list[i]; if (f.exists()) { sb.setLength(0); lastModified.setTime(f.lastModified()); if (f.isFile()) { String ln = String.valueOf(f.length()); int cnt = LEFT_MARGIN - ln.length(); for (int j = 0; j < cnt; j++, sb.append(' ')) ; sb.append(ln); sb.append("B "); sb.append(df.format(lastModified)); sb.append(" "); sb.append(f.getName()); } else { for (int j = 0; j < LEFT_MARGIN + 3; j++, sb.append(' ')) ; sb.append(df.format(lastModified)); sb.append(" ["); sb.append(f.getName()); sb.append(']'); } out.println(sb.toString()); } } out.println(); } }
13,656
protected URLConnection openConnection(URL url) throws IOException { // If a hostname is set, then we need to switch protocols to ftp // in order to transfer this from the remote host. String host = url.getHost(); if ((host != null) && (! host.equals(""))) { throw new IOException("ftp protocol handler not yet implemented."); /* // Reset the protocol (and implicitly the handler) for this URL. // Then have the URL attempt the connection again, as it will // get the changed handler the next time around. setURL (url, "ftp", url.getHost(), url.getPort(), url.getFile(), url.getRef()); // Until the ftp protocol handler is written, this will cause // a NullPointerException. return url.openConnection(); */ } return new Connection(url); }
protected URLConnection openConnection(URL url) throws IOException { // If a hostname is set, then we need to switch protocols to ftp // in order to transfer this from the remote host. String host = url.getHost(); if ((host != null) && (! host.equals(""))) { throw new IOException("ftp protocol handler not yet implemented."); /* // Reset the protocol (and implicitly the handler) for this URL. // Then have the URL attempt the connection again, as it will // get the changed handler the next time around. setURL (url, "ftp", url.getHost(), url.getPort(), url.getFile(), url.getRef()); // Until the ftp protocol handler is written, this will cause // a NullPointerException. return url.openConnection(); */ } return new Connection(url); }
13,657
protected URLConnection openConnection(URL url) throws IOException { // If a hostname is set, then we need to switch protocols to ftp // in order to transfer this from the remote host. String host = url.getHost(); if ((host != null) && (! host.equals(""))) { throw new IOException("ftp protocol handler not yet implemented."); /* // Reset the protocol (and implicitly the handler) for this URL. // Then have the URL attempt the connection again, as it will // get the changed handler the next time around. setURL (url, "ftp", url.getHost(), url.getPort(), url.getFile(), url.getRef()); // Until the ftp protocol handler is written, this will cause // a NullPointerException. return url.openConnection(); */ } return new Connection(url); }
protected URLConnection openConnection(URL url) throws IOException { // If a hostname is set, then we need to switch protocols to ftp // in order to transfer this from the remote host. String host = url.getHost(); if ((host != null) && (! host.equals(""))) { throw new IOException("ftp protocol handler not yet implemented."); /* // Reset the protocol (and implicitly the handler) for this URL. // Then have the URL attempt the connection again, as it will // get the changed handler the next time around. setURL (url, "ftp", url.getHost(), url.getPort(), url.getFile(), url.getRef()); // Until the ftp protocol handler is written, this will cause // a NullPointerException. return url.openConnection(); } return new Connection(url); }
13,658
protected void acceptDrag (int dragOperation) { // FIXME: implement this }
protected void acceptDrag(int dragOperation) throws NotImplementedException { // FIXME: implement this }
13,659
protected void acceptDrop (int dropOperation) { // FIXME: implement this }
protected void acceptDrop(int dropOperation) throws NotImplementedException { // FIXME: implement this }
13,660
protected DataFlavor[] getCurrentDataFlavors () { // FIXME: implement this return null; }
protected DataFlavor[] getCurrentDataFlavors() throws NotImplementedException { // FIXME: implement this return null; }
13,661
protected Transferable getTransferable() throws InvalidDnDOperationException { // FIXME: implement this return null; }
protected Transferable getTransferable() throws InvalidDnDOperationException, NotImplementedException { // FIXME: implement this return null; }
13,662
protected void rejectDrag () { // FIXME: implement this }
protected void rejectDrag() throws NotImplementedException { // FIXME: implement this }
13,663
protected void rejectDrop () { // FIXME: implement this }
protected void rejectDrop() throws NotImplementedException { // FIXME: implement this }
13,664
public AbstractButton() { this("",null); }
public AbstractButton() { init("", null); updateUI(); }
13,665
protected void fireActionPerformed(ActionEvent e) { e.setSource(this); ActionListener[] listeners = getActionListeners(); for (int i = 0; i < listeners.length; i++) listeners[i].actionPerformed(e); }
protected void fireActionPerformed(ActionEvent e) { ActionEvent ae = new ActionEvent( this, e.getID(), getActionCommand(), e.getWhen(), e.getModifiers()); ActionListener[] listeners = getActionListeners(); for (int i = 0; i < listeners.length; i++) listeners[i].actionPerformed(e); }
13,666
protected void fireActionPerformed(ActionEvent e) { e.setSource(this); ActionListener[] listeners = getActionListeners(); for (int i = 0; i < listeners.length; i++) listeners[i].actionPerformed(e); }
protected void fireActionPerformed(ActionEvent e) { e.setSource(this); ActionListener[] listeners = getActionListeners(); for (int i = 0; i < listeners.length; i++) listeners[i].actionPerformed(ae); }
13,667
public String getActionCommand() { return getModel().getActionCommand(); }
public String getActionCommand() { String ac = model.getActionCommand(); if (ac != null) return ac; else return text; }
13,668
public void setActionCommand(String aCommand) { getModel().setActionCommand(aCommand); }
public void setActionCommand(String actionCommand) { getModel().setActionCommand(aCommand); }
13,669
public void setActionCommand(String aCommand) { getModel().setActionCommand(aCommand); }
public void setActionCommand(String aCommand) { model.setActionCommand(actionCommand); }
13,670
compareTo(Object obj){ return(compareTo((CollationKey)obj));}
compareTo(Object obj){ return(compareTo((CollationKey)obj));}
13,671
equals(Object obj){ if (obj == null) return(false); if (!(obj instanceof CollationKey)) return(false); CollationKey ck = (CollationKey)obj; if (!ck.collator.equals(collator)) return(false); if (!ck.getSourceString().equals(getSourceString())) return(false); if (!ck.toByteArray().equals(toByteArray())) return(false); return(true);}
equals(Object obj){ if (obj == null) return(false); if (!(obj instanceof CollationKey)) return(false); CollationKey ck = (CollationKey)obj; if (!ck.collator.equals(collator)) return(false); if (!ck.getSourceString().equals(getSourceString())) return(false); if (!ck.toByteArray().equals(toByteArray())) return(false); return(true);}
13,672
equals(Object obj){ if (obj == null) return(false); if (!(obj instanceof CollationKey)) return(false); CollationKey ck = (CollationKey)obj; if (!ck.collator.equals(collator)) return(false); if (!ck.getSourceString().equals(getSourceString())) return(false); if (!ck.toByteArray().equals(toByteArray())) return(false); return(true);}
equals(Object obj){ if (obj == null) return(false); if (!(obj instanceof CollationKey)) return(false); CollationKey ck = (CollationKey)obj; if (!ck.collator.equals(collator)) return(false); if (!ck.getSourceString().equals(getSourceString())) return(false); if (!ck.toByteArray().equals(toByteArray())) return(false); return(true);}
13,673
equals(Object obj){ if (obj == null) return(false); if (!(obj instanceof CollationKey)) return(false); CollationKey ck = (CollationKey)obj; if (!ck.collator.equals(collator)) return(false); if (!ck.getSourceString().equals(getSourceString())) return(false); if (!ck.toByteArray().equals(toByteArray())) return(false); return(true);}
equals(Object obj){ if (obj == null) return(false); if (!(obj instanceof CollationKey)) return(false); if (ck.collator != collator) return false; if (!ck.collator.equals(collator)) return(false); if (!ck.getSourceString().equals(getSourceString())) return(false); if (!ck.toByteArray().equals(toByteArray())) return(false); return(true);}
13,674
equals(Object obj){ if (obj == null) return(false); if (!(obj instanceof CollationKey)) return(false); CollationKey ck = (CollationKey)obj; if (!ck.collator.equals(collator)) return(false); if (!ck.getSourceString().equals(getSourceString())) return(false); if (!ck.toByteArray().equals(toByteArray())) return(false); return(true);}
equals(Object obj){ if (obj == null) return(false); if (!(obj instanceof CollationKey)) return(false); CollationKey ck = (CollationKey)obj; if (!ck.collator.equals(collator)) return(false); if (!ck.getSourceString().equals(getSourceString())) return(false); if (!ck.toByteArray().equals(toByteArray())) return(false); return(true);}
13,675
equals(Object obj){ if (obj == null) return(false); if (!(obj instanceof CollationKey)) return(false); CollationKey ck = (CollationKey)obj; if (!ck.collator.equals(collator)) return(false); if (!ck.getSourceString().equals(getSourceString())) return(false); if (!ck.toByteArray().equals(toByteArray())) return(false); return(true);}
equals(Object obj){ if (obj == null) return(false); if (!(obj instanceof CollationKey)) return(false); CollationKey ck = (CollationKey)obj; if (!ck.collator.equals(collator)) return(false); if (!ck.getSourceString().equals(getSourceString())) return(false); if (!ck.toByteArray().equals(toByteArray())) return(false); return(true);}
13,676
equals(Object obj){ if (obj == null) return(false); if (!(obj instanceof CollationKey)) return(false); CollationKey ck = (CollationKey)obj; if (!ck.collator.equals(collator)) return(false); if (!ck.getSourceString().equals(getSourceString())) return(false); if (!ck.toByteArray().equals(toByteArray())) return(false); return(true);}
equals(Object obj){ if (obj == null) return(false); if (!(obj instanceof CollationKey)) return(false); CollationKey ck = (CollationKey)obj; if (!ck.collator.equals(collator)) return(false); if (!ck.getSourceString().equals(getSourceString())) return(false); if (!ck.toByteArray().equals(toByteArray())) return(false); return(true);}
13,677
getSourceString(){ return(str);}
getSourceString(){ return(str);}
13,678
hashCode(){ return(key.hashCode());}
hashCode(){ return(key.hashCode());}
13,679
toByteArray(){ return(key);}
toByteArray(){ return(key);}
13,680
TemplateNode clone(Stylesheet stylesheet) { int len = withParams.size(); List withParams2 = new ArrayList(len); for (int i = 0; i < len; i++) { withParams2.add(((WithParam) withParams.get(i)).clone(stylesheet)); } TemplateNode ret = new CallTemplateNode(name, withParams2); if (children != null) { ret.children = children.clone(stylesheet); } if (next != null) { ret.next = next.clone(stylesheet); } return ret; }
TemplateNode clone(Stylesheet stylesheet) int len = withParams.size(); List withParams2 = new ArrayList(len); for (int i = 0; i < len; i++) withParams2.add(((WithParam) withParams.get(i)).clone(stylesheet)); } TemplateNode ret = new CallTemplateNode(name, withParams2); if (children != null) ret.children = children.clone(stylesheet); } if (next != null) ret.next = next.clone(stylesheet); } return ret; }
13,681
TemplateNode clone(Stylesheet stylesheet) { int len = withParams.size(); List withParams2 = new ArrayList(len); for (int i = 0; i < len; i++) { withParams2.add(((WithParam) withParams.get(i)).clone(stylesheet)); } TemplateNode ret = new CallTemplateNode(name, withParams2); if (children != null) { ret.children = children.clone(stylesheet); } if (next != null) { ret.next = next.clone(stylesheet); } return ret; }
TemplateNode clone(Stylesheet stylesheet) { int len = withParams.size(); List withParams2 = new ArrayList(len); for (int i = 0; i < len; i++) { withParams2.add(((WithParam) withParams.get(i)).clone(stylesheet)); TemplateNode ret = new CallTemplateNode(name, withParams2); if (children != null) { ret.children = children.clone(stylesheet); if (next != null) { ret.next = next.clone(stylesheet); return ret;
13,682
void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { if (withParams != null) { // compute the parameter values LinkedList values = new LinkedList(); for (Iterator i = withParams.iterator(); i.hasNext(); ) { WithParam p = (WithParam) i.next(); Object value = p.getValue(stylesheet, mode, context, pos, len); Object[] pair = new Object[2]; pair[0] = p.name; pair[1] = value; values.add(pair); } // push the parameter context stylesheet.bindings.push(Bindings.WITH_PARAM); // set the parameters for (Iterator i = values.iterator(); i.hasNext(); ) { Object[] pair = (Object[]) i.next(); QName name = (QName) pair[0]; Object value = pair[1]; stylesheet.bindings.set(name, value, Bindings.WITH_PARAM); if (stylesheet.debug) { System.err.println("with-param: " + name + " = " + value); } } } TemplateNode t = stylesheet.getTemplate(mode, name); if (t != null) { t.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } if (withParams != null) { // pop the variable context stylesheet.bindings.pop(Bindings.WITH_PARAM); } // call-template doesn't have processable children if (next != null) { next.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } }
void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { if (withParams != null) { // compute the parameter values LinkedList values = new LinkedList(); for (Iterator i = withParams.iterator(); i.hasNext(); ) { WithParam p = (WithParam) i.next(); if (t.hasParam(p.name)) { Object value = p.getValue(stylesheet, mode, context, pos, len); Object[] pair = new Object[2]; pair[0] = p.name; pair[1] = value; values.add(pair); } // push the parameter context stylesheet.bindings.push(Bindings.WITH_PARAM); // set the parameters for (Iterator i = values.iterator(); i.hasNext(); ) { Object[] pair = (Object[]) i.next(); QName name = (QName) pair[0]; Object value = pair[1]; stylesheet.bindings.set(name, value, Bindings.WITH_PARAM); if (stylesheet.debug) { System.err.println("with-param: " + name + " = " + value); } } } TemplateNode t = stylesheet.getTemplate(mode, name); if (t != null) { t.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } if (withParams != null) { // pop the variable context stylesheet.bindings.pop(Bindings.WITH_PARAM); } // call-template doesn't have processable children if (next != null) { next.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } }
13,683
void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { if (withParams != null) { // compute the parameter values LinkedList values = new LinkedList(); for (Iterator i = withParams.iterator(); i.hasNext(); ) { WithParam p = (WithParam) i.next(); Object value = p.getValue(stylesheet, mode, context, pos, len); Object[] pair = new Object[2]; pair[0] = p.name; pair[1] = value; values.add(pair); } // push the parameter context stylesheet.bindings.push(Bindings.WITH_PARAM); // set the parameters for (Iterator i = values.iterator(); i.hasNext(); ) { Object[] pair = (Object[]) i.next(); QName name = (QName) pair[0]; Object value = pair[1]; stylesheet.bindings.set(name, value, Bindings.WITH_PARAM); if (stylesheet.debug) { System.err.println("with-param: " + name + " = " + value); } } } TemplateNode t = stylesheet.getTemplate(mode, name); if (t != null) { t.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } if (withParams != null) { // pop the variable context stylesheet.bindings.pop(Bindings.WITH_PARAM); } // call-template doesn't have processable children if (next != null) { next.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } }
void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException if (withParams != null) // compute the parameter values LinkedList values = new LinkedList(); for (Iterator i = withParams.iterator(); i.hasNext(); ) WithParam p = (WithParam) i.next(); Object value = p.getValue(stylesheet, mode, context, pos, len); Object[] pair = new Object[2]; pair[0] = p.name; pair[1] = value; values.add(pair); } // push the parameter context stylesheet.bindings.push(Bindings.WITH_PARAM); // set the parameters for (Iterator i = values.iterator(); i.hasNext(); ) Object[] pair = (Object[]) i.next(); QName name = (QName) pair[0]; Object value = pair[1]; stylesheet.bindings.set(name, value, Bindings.WITH_PARAM); if (stylesheet.debug) System.err.println("with-param: " + name + " = " + value); } } } TemplateNode t = stylesheet.getTemplate(mode, name); if (t != null) t.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } if (withParams != null) // pop the variable context stylesheet.bindings.pop(Bindings.WITH_PARAM); } // call-template doesn't have processable children if (next != null) next.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } }
13,684
void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { if (withParams != null) { // compute the parameter values LinkedList values = new LinkedList(); for (Iterator i = withParams.iterator(); i.hasNext(); ) { WithParam p = (WithParam) i.next(); Object value = p.getValue(stylesheet, mode, context, pos, len); Object[] pair = new Object[2]; pair[0] = p.name; pair[1] = value; values.add(pair); } // push the parameter context stylesheet.bindings.push(Bindings.WITH_PARAM); // set the parameters for (Iterator i = values.iterator(); i.hasNext(); ) { Object[] pair = (Object[]) i.next(); QName name = (QName) pair[0]; Object value = pair[1]; stylesheet.bindings.set(name, value, Bindings.WITH_PARAM); if (stylesheet.debug) { System.err.println("with-param: " + name + " = " + value); } } } TemplateNode t = stylesheet.getTemplate(mode, name); if (t != null) { t.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } if (withParams != null) { // pop the variable context stylesheet.bindings.pop(Bindings.WITH_PARAM); } // call-template doesn't have processable children if (next != null) { next.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } }
void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { if (withParams != null) { // compute the parameter values LinkedList values = new LinkedList(); for (Iterator i = withParams.iterator(); i.hasNext(); ) { WithParam p = (WithParam) i.next(); Object value = p.getValue(stylesheet, mode, context, pos, len); Object[] pair = new Object[2]; pair[0] = p.name; pair[1] = value; values.add(pair); } // push the parameter context stylesheet.bindings.push(Bindings.WITH_PARAM); // set the parameters for (Iterator i = values.iterator(); i.hasNext(); ) { Object[] pair = (Object[]) i.next(); QName name = (QName) pair[0]; Object value = pair[1]; stylesheet.bindings.set(name, value, Bindings.WITH_PARAM); if (stylesheet.debug) { System.err.println("with-param: " + name + " = " + value); } } } TemplateNode t = stylesheet.getTemplate(mode, name); if (t != null) { t.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } if (withParams != null) { // pop the variable context stylesheet.bindings.pop(Bindings.WITH_PARAM); } // call-template doesn't have processable children if (next != null) { next.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } }
13,685
void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { if (withParams != null) { // compute the parameter values LinkedList values = new LinkedList(); for (Iterator i = withParams.iterator(); i.hasNext(); ) { WithParam p = (WithParam) i.next(); Object value = p.getValue(stylesheet, mode, context, pos, len); Object[] pair = new Object[2]; pair[0] = p.name; pair[1] = value; values.add(pair); } // push the parameter context stylesheet.bindings.push(Bindings.WITH_PARAM); // set the parameters for (Iterator i = values.iterator(); i.hasNext(); ) { Object[] pair = (Object[]) i.next(); QName name = (QName) pair[0]; Object value = pair[1]; stylesheet.bindings.set(name, value, Bindings.WITH_PARAM); if (stylesheet.debug) { System.err.println("with-param: " + name + " = " + value); } } } TemplateNode t = stylesheet.getTemplate(mode, name); if (t != null) { t.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } if (withParams != null) { // pop the variable context stylesheet.bindings.pop(Bindings.WITH_PARAM); } // call-template doesn't have processable children if (next != null) { next.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } }
void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { if (withParams != null) { // compute the parameter values LinkedList values = new LinkedList(); for (Iterator i = withParams.iterator(); i.hasNext(); ) { WithParam p = (WithParam) i.next(); Object value = p.getValue(stylesheet, mode, context, pos, len); Object[] pair = new Object[2]; pair[0] = p.name; pair[1] = value; values.add(pair); // push the parameter context stylesheet.bindings.push(Bindings.WITH_PARAM); // set the parameters for (Iterator i = values.iterator(); i.hasNext(); ) { Object[] pair = (Object[]) i.next(); QName name = (QName) pair[0]; Object value = pair[1]; stylesheet.bindings.set(name, value, Bindings.WITH_PARAM); if (stylesheet.debug) { System.err.println("with-param: " + name + " = " + value); TemplateNode t = stylesheet.getTemplate(mode, name); if (t != null) { t.apply(stylesheet, mode, context, pos, len, parent, nextSibling); if (withParams != null) { // pop the variable context stylesheet.bindings.pop(Bindings.WITH_PARAM); // call-template doesn't have processable children if (next != null) { next.apply(stylesheet, mode, context, pos, len, parent, nextSibling);
13,686
public boolean references(QName var) { if (withParams != null) { for (Iterator i = withParams.iterator(); i.hasNext(); ) { if (((WithParam) i.next()).references(var)) { return true; } } } return super.references(var); }
public boolean references(QName var) if (withParams != null) for (Iterator i = withParams.iterator(); i.hasNext(); ) if (((WithParam) i.next()).references(var)) return true; } } } return super.references(var); }
13,687
public boolean references(QName var) { if (withParams != null) { for (Iterator i = withParams.iterator(); i.hasNext(); ) { if (((WithParam) i.next()).references(var)) { return true; } } } return super.references(var); }
public boolean references(QName var) { if (withParams != null) { for (Iterator i = withParams.iterator(); i.hasNext(); ) { if (((WithParam) i.next()).references(var)) { return true; return super.references(var);
13,688
public String toString() { StringBuffer buf = new StringBuffer(getClass().getName()); buf.append('['); buf.append("name="); buf.append(name); buf.append(']'); return buf.toString(); }
public String toString() { StringBuffer buf = new StringBuffer("call-template"); buf.append('['); buf.append("name="); buf.append(name); buf.append(']'); return buf.toString(); }
13,689
protected InetAddress getHostAddress(URL url) { String hostname = url.getHost(); if (hostname == "") return null; try { return InetAddress.getByName(hostname); } catch (UnknownHostException e) { return null; } }
protected InetAddress getHostAddress(URL url) { String hostname = url.getHost(); if (hostname.equals("")) return null; try { return InetAddress.getByName(hostname); } catch (UnknownHostException e) { return null; } }
13,697
protected boolean hostsEqual(URL url1, URL url2) throws UnknownHostException { InetAddress addr1 = InetAddress.getByName(url1.getHost()); InetAddress addr2 = InetAddress.getByName(url2.getHost()); return addr1.equals(addr2); }
protected boolean hostsEqual(URL url1, URL url2) throws UnknownHostException { InetAddress addr1 = InetAddress.getByName(url1.getHost()); InetAddress addr2 = InetAddress.getByName(url2.getHost()); return addr1.equals(addr2); }
13,698
protected abstract URLConnection openConnection(URL u) throws IOException;
protected abstract URLConnection openConnection(URL url) throws IOException;
13,700
protected void parseURL(URL url, String spec, int start, int end) { String host = url.getHost(); int port = url.getPort(); String file = url.getFile(); String ref = url.getRef(); if (spec.regionMatches(start, "//", 0, 2)) { int hostEnd; int colon; start += 2; int slash = spec.indexOf('/', start); if (slash >= 0) hostEnd = slash; else hostEnd = end; host = spec.substring(start, hostEnd); // Look for optional port number. It is valid for the non-port // part of the host name to be null (e.g. a URL "http://:80"). // TBD: JDK 1.2 in this case sets host to null rather than ""; // this is undocumented and likely an unintended side effect in 1.2 // so we'll be simple here and stick with "". Note that // "http://" or "http:///" produce a "" host in JDK 1.2. if ((colon = host.indexOf(':')) >= 0) { try { port = Integer.parseInt(host.substring(colon + 1)); } catch (NumberFormatException e) { // Ignore invalid port values; port is already set to u's // port. } host = host.substring(0, colon); } file = null; start = hostEnd; } else if (host == null) host = ""; if (file == null || file.length() == 0 || (start < end && spec.charAt(start) == '/')) { // No file context available; just spec for file. // Or this is an absolute path name; ignore any file context. file = spec.substring(start, end); ref = null; } else if (start < end) { // Context is available, but only override it if there is a new file. file = file.substring(0, file.lastIndexOf('/')) + '/' + spec.substring(start, end); ref = null; } if (ref == null) { // Normally there should be no '#' in the file part, // but we are nice. int hash = file.indexOf('#'); if (hash != -1) { ref = file.substring(hash + 1, file.length()); file = file.substring(0, hash); } } // XXX - Classpath used to call PlatformHelper.toCanonicalForm() on // the file part. It seems like overhead, but supposedly there is some // benefit in windows based systems (it also lowercased the string). setURL(url, url.getProtocol(), host, port, file, ref); }
protected void parseURL(URL url, String spec, int start, int end) { String host = url.getHost(); int port = url.getPort(); String file = url.getFile(); String ref = url.getRef(); if (spec.regionMatches(start, " { String genuineHost;//", 0, 2)) { int hostEnd; int colon; start += 2; int slash = spec.indexOf('/', start); if (slash >= 0) hostEnd = slash; else hostEnd = end; host = spec.substring(start, hostEnd); // Look for optional port number. It is valid for the non-port // part of the host name to be null (e.g. a URL "http://:80"). // TBD: JDK 1.2 in this case sets host to null rather than ""; // this is undocumented and likely an unintended side effect in 1.2 // so we'll be simple here and stick with "". Note that // "http://" or "http:///" produce a "" host in JDK 1.2. if ((colon = host.indexOf(':')) >= 0) { try { port = Integer.parseInt(host.substring(colon + 1)); } catch (NumberFormatException e) { // Ignore invalid port values; port is already set to u's // port. } host = host.substring(0, colon); } file = null; start = hostEnd; } else if (host == null) host = ""; if (file == null || file.length() == 0 || (start < end && spec.charAt(start) == '/')) { // No file context available; just spec for file. // Or this is an absolute path name; ignore any file context. file = spec.substring(start, end); ref = null; } else if (start < end) { // Context is available, but only override it if there is a new file. file = file.substring(0, file.lastIndexOf('/')) + '/' + spec.substring(start, end); ref = null; } if (ref == null) { // Normally there should be no '#' in the file part, // but we are nice. int hash = file.indexOf('#'); if (hash != -1) { ref = file.substring(hash + 1, file.length()); file = file.substring(0, hash); } } // XXX - Classpath used to call PlatformHelper.toCanonicalForm() on // the file part. It seems like overhead, but supposedly there is some // benefit in windows based systems (it also lowercased the string). setURL(url, url.getProtocol(), host, port, file, ref); }
13,701
protected void parseURL(URL url, String spec, int start, int end) { String host = url.getHost(); int port = url.getPort(); String file = url.getFile(); String ref = url.getRef(); if (spec.regionMatches(start, "//", 0, 2)) { int hostEnd; int colon; start += 2; int slash = spec.indexOf('/', start); if (slash >= 0) hostEnd = slash; else hostEnd = end; host = spec.substring(start, hostEnd); // Look for optional port number. It is valid for the non-port // part of the host name to be null (e.g. a URL "http://:80"). // TBD: JDK 1.2 in this case sets host to null rather than ""; // this is undocumented and likely an unintended side effect in 1.2 // so we'll be simple here and stick with "". Note that // "http://" or "http:///" produce a "" host in JDK 1.2. if ((colon = host.indexOf(':')) >= 0) { try { port = Integer.parseInt(host.substring(colon + 1)); } catch (NumberFormatException e) { // Ignore invalid port values; port is already set to u's // port. } host = host.substring(0, colon); } file = null; start = hostEnd; } else if (host == null) host = ""; if (file == null || file.length() == 0 || (start < end && spec.charAt(start) == '/')) { // No file context available; just spec for file. // Or this is an absolute path name; ignore any file context. file = spec.substring(start, end); ref = null; } else if (start < end) { // Context is available, but only override it if there is a new file. file = file.substring(0, file.lastIndexOf('/')) + '/' + spec.substring(start, end); ref = null; } if (ref == null) { // Normally there should be no '#' in the file part, // but we are nice. int hash = file.indexOf('#'); if (hash != -1) { ref = file.substring(hash + 1, file.length()); file = file.substring(0, hash); } } // XXX - Classpath used to call PlatformHelper.toCanonicalForm() on // the file part. It seems like overhead, but supposedly there is some // benefit in windows based systems (it also lowercased the string). setURL(url, url.getProtocol(), host, port, file, ref); }
protected void parseURL(URL url, String spec, int start, int end) { String host = url.getHost(); int port = url.getPort(); String file = url.getFile(); String ref = url.getRef(); if (spec.regionMatches(start, "//", 0, 2)) { int hostEnd; int colon; start += 2; int slash = spec.indexOf('/', start); if (slash >= 0) hostEnd = slash; else hostEnd = end; authority = host = spec.substring(start, hostEnd); if ((at_host = host.indexOf('@')) >= 0) { genuineHost = host.substring(at_host); userInfo = host.substring(0, at_host); } else genuineHost = host; // Look for optional port number. It is valid for the non-port // part of the host name to be null (e.g. a URL "http://:80"). // TBD: JDK 1.2 in this case sets host to null rather than ""; // this is undocumented and likely an unintended side effect in 1.2 // so we'll be simple here and stick with "". Note that // "http://" or "http:///" produce a "" host in JDK 1.2. if ((colon = host.indexOf(':')) >= 0) { try { port = Integer.parseInt(host.substring(colon + 1)); } catch (NumberFormatException e) { // Ignore invalid port values; port is already set to u's // port. } host = host.substring(0, colon); } file = null; start = hostEnd; } else if (host == null) host = ""; if (file == null || file.length() == 0 || (start < end && spec.charAt(start) == '/')) { // No file context available; just spec for file. // Or this is an absolute path name; ignore any file context. file = spec.substring(start, end); ref = null; } else if (start < end) { // Context is available, but only override it if there is a new file. file = file.substring(0, file.lastIndexOf('/')) + '/' + spec.substring(start, end); ref = null; } if (ref == null) { // Normally there should be no '#' in the file part, // but we are nice. int hash = file.indexOf('#'); if (hash != -1) { ref = file.substring(hash + 1, file.length()); file = file.substring(0, hash); } } // XXX - Classpath used to call PlatformHelper.toCanonicalForm() on // the file part. It seems like overhead, but supposedly there is some // benefit in windows based systems (it also lowercased the string). setURL(url, url.getProtocol(), host, port, file, ref); }
13,702
protected void parseURL(URL url, String spec, int start, int end) { String host = url.getHost(); int port = url.getPort(); String file = url.getFile(); String ref = url.getRef(); if (spec.regionMatches(start, "//", 0, 2)) { int hostEnd; int colon; start += 2; int slash = spec.indexOf('/', start); if (slash >= 0) hostEnd = slash; else hostEnd = end; host = spec.substring(start, hostEnd); // Look for optional port number. It is valid for the non-port // part of the host name to be null (e.g. a URL "http://:80"). // TBD: JDK 1.2 in this case sets host to null rather than ""; // this is undocumented and likely an unintended side effect in 1.2 // so we'll be simple here and stick with "". Note that // "http://" or "http:///" produce a "" host in JDK 1.2. if ((colon = host.indexOf(':')) >= 0) { try { port = Integer.parseInt(host.substring(colon + 1)); } catch (NumberFormatException e) { // Ignore invalid port values; port is already set to u's // port. } host = host.substring(0, colon); } file = null; start = hostEnd; } else if (host == null) host = ""; if (file == null || file.length() == 0 || (start < end && spec.charAt(start) == '/')) { // No file context available; just spec for file. // Or this is an absolute path name; ignore any file context. file = spec.substring(start, end); ref = null; } else if (start < end) { // Context is available, but only override it if there is a new file. file = file.substring(0, file.lastIndexOf('/')) + '/' + spec.substring(start, end); ref = null; } if (ref == null) { // Normally there should be no '#' in the file part, // but we are nice. int hash = file.indexOf('#'); if (hash != -1) { ref = file.substring(hash + 1, file.length()); file = file.substring(0, hash); } } // XXX - Classpath used to call PlatformHelper.toCanonicalForm() on // the file part. It seems like overhead, but supposedly there is some // benefit in windows based systems (it also lowercased the string). setURL(url, url.getProtocol(), host, port, file, ref); }
protected void parseURL(URL url, String spec, int start, int end) { String host = url.getHost(); int port = url.getPort(); String file = url.getFile(); String ref = url.getRef(); if (spec.regionMatches(start, "//", 0, 2)) { int hostEnd; int colon; start += 2; int slash = spec.indexOf('/', start); if (slash >= 0) hostEnd = slash; else hostEnd = end; host = spec.substring(start, hostEnd); // Look for optional port number. It is valid for the non-port // part of the host name to be null (e.g. a URL "http://:80"). // TBD: JDK 1.2 in this case sets host to null rather than ""; // this is undocumented and likely an unintended side effect in 1.2 // so we'll be simple here and stick with "". Note that // "http://" or "http:///" produce a "" host in JDK 1.2. if ((colon = host.indexOf(':')) >= 0) { try { port = Integer.parseInt(host.substring(colon + 1)); } catch (NumberFormatException e) { // Ignore invalid port values; port is already set to u's // port. } host = host.substring(0, colon); } file = null; start = hostEnd; } else if (host == null) host = ""; if (file == null || file.length() == 0 || (start < end && spec.charAt(start) == '/')) { // No file context available; just spec for file. // Or this is an absolute path name; ignore any file context. file = spec.substring(start, end); ref = null; } else if (start < end) { // Context is available, but only override it if there is a new file. file = file.substring(0, file.lastIndexOf('/')) + '/' + spec.substring(start, end); ref = null; } if (ref == null) { // Normally there should be no '#' in the file part, // but we are nice. int hash = file.indexOf('#'); if (hash != -1) { ref = file.substring(hash + 1, file.length()); file = file.substring(0, hash); } } // XXX - Classpath used to call PlatformHelper.toCanonicalForm() on // the file part. It seems like overhead, but supposedly there is some // benefit in windows based systems (it also lowercased the string). setURL(url, url.getProtocol(), host, port, file, ref); }
13,703
protected void parseURL(URL url, String spec, int start, int end) { String host = url.getHost(); int port = url.getPort(); String file = url.getFile(); String ref = url.getRef(); if (spec.regionMatches(start, "//", 0, 2)) { int hostEnd; int colon; start += 2; int slash = spec.indexOf('/', start); if (slash >= 0) hostEnd = slash; else hostEnd = end; host = spec.substring(start, hostEnd); // Look for optional port number. It is valid for the non-port // part of the host name to be null (e.g. a URL "http://:80"). // TBD: JDK 1.2 in this case sets host to null rather than ""; // this is undocumented and likely an unintended side effect in 1.2 // so we'll be simple here and stick with "". Note that // "http://" or "http:///" produce a "" host in JDK 1.2. if ((colon = host.indexOf(':')) >= 0) { try { port = Integer.parseInt(host.substring(colon + 1)); } catch (NumberFormatException e) { // Ignore invalid port values; port is already set to u's // port. } host = host.substring(0, colon); } file = null; start = hostEnd; } else if (host == null) host = ""; if (file == null || file.length() == 0 || (start < end && spec.charAt(start) == '/')) { // No file context available; just spec for file. // Or this is an absolute path name; ignore any file context. file = spec.substring(start, end); ref = null; } else if (start < end) { // Context is available, but only override it if there is a new file. file = file.substring(0, file.lastIndexOf('/')) + '/' + spec.substring(start, end); ref = null; } if (ref == null) { // Normally there should be no '#' in the file part, // but we are nice. int hash = file.indexOf('#'); if (hash != -1) { ref = file.substring(hash + 1, file.length()); file = file.substring(0, hash); } } // XXX - Classpath used to call PlatformHelper.toCanonicalForm() on // the file part. It seems like overhead, but supposedly there is some // benefit in windows based systems (it also lowercased the string). setURL(url, url.getProtocol(), host, port, file, ref); }
protected void parseURL(URL url, String spec, int start, int end) { String host = url.getHost(); int port = url.getPort(); String file = url.getFile(); String ref = url.getRef(); if (spec.regionMatches(start, "//", 0, 2)) { int hostEnd; int colon; start += 2; int slash = spec.indexOf('/', start); if (slash >= 0) hostEnd = slash; else hostEnd = end; host = spec.substring(start, hostEnd); // Look for optional port number. It is valid for the non-port // part of the host name to be null (e.g. a URL "http://:80"). // TBD: JDK 1.2 in this case sets host to null rather than ""; // this is undocumented and likely an unintended side effect in 1.2 // so we'll be simple here and stick with "". Note that // "http://" or "http:///" produce a "" host in JDK 1.2. if ((colon = host.indexOf(':')) >= 0) { try { port = Integer.parseInt(host.substring(colon + 1)); } catch (NumberFormatException e) { // Ignore invalid port values; port is already set to u's // port. } host = host.substring(0, colon); } file = null; start = hostEnd; } else if (host == null) host = ""; if (file == null || file.length() == 0 || (start < end && spec.charAt(start) == '/')) { // No file context available; just spec for file. // Or this is an absolute path name; ignore any file context. file = spec.substring(start, end); ref = null; } else if (start < end) { // Context is available, but only override it if there is a new file. file = file.substring(0, file.lastIndexOf('/')) + '/' + spec.substring(start, end); ref = null; } if (ref == null) { // Normally there should be no '#' in the file part, // but we are nice. int hash = file.indexOf('#'); if (hash != -1) { ref = file.substring(hash + 1, file.length()); file = file.substring(0, hash); } } // XXX - Classpath used to call PlatformHelper.toCanonicalForm() on // the file part. It seems like overhead, but supposedly there is some // benefit in windows based systems (it also lowercased the string). setURL(url, url.getProtocol(), host, port, file, ref); }
13,704
protected void parseURL(URL url, String spec, int start, int end) { String host = url.getHost(); int port = url.getPort(); String file = url.getFile(); String ref = url.getRef(); if (spec.regionMatches(start, "//", 0, 2)) { int hostEnd; int colon; start += 2; int slash = spec.indexOf('/', start); if (slash >= 0) hostEnd = slash; else hostEnd = end; host = spec.substring(start, hostEnd); // Look for optional port number. It is valid for the non-port // part of the host name to be null (e.g. a URL "http://:80"). // TBD: JDK 1.2 in this case sets host to null rather than ""; // this is undocumented and likely an unintended side effect in 1.2 // so we'll be simple here and stick with "". Note that // "http://" or "http:///" produce a "" host in JDK 1.2. if ((colon = host.indexOf(':')) >= 0) { try { port = Integer.parseInt(host.substring(colon + 1)); } catch (NumberFormatException e) { // Ignore invalid port values; port is already set to u's // port. } host = host.substring(0, colon); } file = null; start = hostEnd; } else if (host == null) host = ""; if (file == null || file.length() == 0 || (start < end && spec.charAt(start) == '/')) { // No file context available; just spec for file. // Or this is an absolute path name; ignore any file context. file = spec.substring(start, end); ref = null; } else if (start < end) { // Context is available, but only override it if there is a new file. file = file.substring(0, file.lastIndexOf('/')) + '/' + spec.substring(start, end); ref = null; } if (ref == null) { // Normally there should be no '#' in the file part, // but we are nice. int hash = file.indexOf('#'); if (hash != -1) { ref = file.substring(hash + 1, file.length()); file = file.substring(0, hash); } } // XXX - Classpath used to call PlatformHelper.toCanonicalForm() on // the file part. It seems like overhead, but supposedly there is some // benefit in windows based systems (it also lowercased the string). setURL(url, url.getProtocol(), host, port, file, ref); }
protected void parseURL(URL url, String spec, int start, int end) { String host = url.getHost(); int port = url.getPort(); String file = url.getFile(); String ref = url.getRef(); if (spec.regionMatches(start, "//", 0, 2)) { int hostEnd; int colon; start += 2; int slash = spec.indexOf('/', start); if (slash >= 0) hostEnd = slash; else hostEnd = end; host = spec.substring(start, hostEnd); // Look for optional port number. It is valid for the non-port // part of the host name to be null (e.g. a URL "http://:80"). // TBD: JDK 1.2 in this case sets host to null rather than ""; // this is undocumented and likely an unintended side effect in 1.2 // so we'll be simple here and stick with "". Note that // "http://" or "http:///" produce a "" host in JDK 1.2. if ((colon = host.indexOf(':')) >= 0) { try { port = Integer.parseInt(host.substring(colon + 1)); } catch (NumberFormatException e) { // Ignore invalid port values; port is already set to u's // port. } host = host.substring(0, colon); } file = null; start = hostEnd; } else if (host == null) host = ""; if (file == null || file.length() == 0 || (start < end && spec.charAt(start) == '/')) { // No file context available; just spec for file. // Or this is an absolute path name; ignore any file context. file = spec.substring(start, end); ref = null; } else if (start < end) { // Context is available, but only override it if there is a new file. file = file.substring(0, file.lastIndexOf('/')) + '/' + spec.substring(start, end); ref = null; } if (ref == null) { // Normally there should be no '#' in the file part, // but we are nice. int hash = file.indexOf('#'); if (hash != -1) { ref = file.substring(hash + 1, file.length()); file = file.substring(0, hash); } } // XXX - Classpath used to call PlatformHelper.toCanonicalForm() on // the file part. It seems like overhead, but supposedly there is some // benefit in windows based systems (it also lowercased the string). setURL(url, url.getProtocol(), host, port, authority, userInfo, file, query, ref); }
13,705
protected boolean sameFile(URL url1, URL url2) { if (url1 == url2) return true; // This comparison is very conservative. It assumes that any // field can be null. if (url1 == null || url2 == null || url1.getPort() != url2.getPort()) return false; String s1, s2; s1 = url1.getProtocol(); s2 = url2.getProtocol(); if (s1 != s2 && (s1 == null || !s1.equals(s2))) return false; s1 = url1.getHost(); s2 = url2.getHost(); if (s1 != s2 && (s1 == null || !s1.equals(s2))) return false; s1 = canonicalizeFilename(url1.getFile()); s2 = canonicalizeFilename(url2.getFile()); if (s1 != s2 && (s1 == null || !s1.equals(s2))) return false; return true; }
protected boolean sameFile(URL url1, URL url2) { if (url1 == url2) return true; // This comparison is very conservative. It assumes that any // field can be null. if (url1 == null || url2 == null) return false; int p1 = url1.getPort(); if (p1 == -1) p1 = url1.ph.getDefaultPort(); int p2 = url2.getPort(); if (p2 == -1) p2 = url2.ph.getDefaultPort(); if (p1 != p2) return false; String s1, s2; s1 = url1.getProtocol(); s2 = url2.getProtocol(); if (s1 != s2 && (s1 == null || !s1.equals(s2))) return false; s1 = url1.getHost(); s2 = url2.getHost(); if (s1 != s2 && (s1 == null || !s1.equals(s2))) return false; s1 = canonicalizeFilename(url1.getFile()); s2 = canonicalizeFilename(url2.getFile()); if (s1 != s2 && (s1 == null || !s1.equals(s2))) return false; return true; }
13,706
protected boolean sameFile(URL url1, URL url2) { if (url1 == url2) return true; // This comparison is very conservative. It assumes that any // field can be null. if (url1 == null || url2 == null || url1.getPort() != url2.getPort()) return false; String s1, s2; s1 = url1.getProtocol(); s2 = url2.getProtocol(); if (s1 != s2 && (s1 == null || !s1.equals(s2))) return false; s1 = url1.getHost(); s2 = url2.getHost(); if (s1 != s2 && (s1 == null || !s1.equals(s2))) return false; s1 = canonicalizeFilename(url1.getFile()); s2 = canonicalizeFilename(url2.getFile()); if (s1 != s2 && (s1 == null || !s1.equals(s2))) return false; return true; }
protected boolean sameFile(URL url1, URL url2) { if (url1 == url2) return true; // This comparison is very conservative. It assumes that any // field can be null. if (url1 == null || url2 == null || url1.getPort() != url2.getPort()) return false; String s1; String s2; s1 = url1.getProtocol(); s2 = url2.getProtocol(); if (s1 != s2 && (s1 == null || !s1.equals(s2))) return false; s1 = url1.getHost(); s2 = url2.getHost(); if (s1 != s2 && (s1 == null || !s1.equals(s2))) return false; s1 = canonicalizeFilename(url1.getFile()); s2 = canonicalizeFilename(url2.getFile()); if (s1 != s2 && (s1 == null || !s1.equals(s2))) return false; return true; }
13,707
protected String toExternalForm(URL u) { String protocol, host, file, ref; int port; protocol = u.getProtocol(); // JDK 1.2 online doc infers that host could be null because it // explicitly states that file cannot be null, but is silent on host. host = u.getHost(); if (host == null) host = ""; port = u.getPort(); file = u.getFile(); ref = u.getRef(); // Guess a reasonable size for the string buffer so we have to resize // at most once. int size = protocol.length() + host.length() + file.length() + 24; StringBuffer sb = new StringBuffer(size); if (protocol != null && protocol.length() > 0) { sb.append(protocol); sb.append(":"); } if (host.length() != 0) sb.append("//").append(host); // Note that this produces different results from JDK 1.2 as JDK 1.2 // ignores a non-default port if host is null or "". That is inconsistent // with the spec since the result of this method is spec'ed so it can be // used to construct a new URL that is equivalent to the original. boolean port_needed = port > 0 && port != getDefaultPort(); if (port_needed) sb.append(':').append(port); sb.append(file); if (ref != null) sb.append('#').append(ref); return sb.toString(); }
protected String toExternalForm(URL u) { String protocol, host, file, ref; int port; protocol = u.getProtocol(); // JDK 1.2 online doc infers that host could be null because it // explicitly states that file cannot be null, but is silent on host. host = u.getHost(); if (host == null) host = ""; port = u.getPort(); file = u.getFile(); ref = u.getRef(); // Guess a reasonable size for the string buffer so we have to resize // at most once. int size = protocol.length() + host.length() + file.length() + 24; StringBuffer sb = new StringBuffer(size); if (protocol != null && protocol.length() > 0) { sb.append(protocol); sb.append(":"); } if (host.length() != 0) sb.append("//").append(host); // Note that this produces different results from JDK 1.2 as JDK 1.2 // ignores a non-default port if host is null or "". That is inconsistent // with the spec since the result of this method is spec'ed so it can be // used to construct a new URL that is equivalent to the original. boolean port_needed = port > 0 && port != getDefaultPort(); if (port_needed) sb.append(':').append(port); sb.append(file); if (ref != null) sb.append('#').append(ref); return sb.toString(); }
13,708
protected String toExternalForm(URL u) { String protocol, host, file, ref; int port; protocol = u.getProtocol(); // JDK 1.2 online doc infers that host could be null because it // explicitly states that file cannot be null, but is silent on host. host = u.getHost(); if (host == null) host = ""; port = u.getPort(); file = u.getFile(); ref = u.getRef(); // Guess a reasonable size for the string buffer so we have to resize // at most once. int size = protocol.length() + host.length() + file.length() + 24; StringBuffer sb = new StringBuffer(size); if (protocol != null && protocol.length() > 0) { sb.append(protocol); sb.append(":"); } if (host.length() != 0) sb.append("//").append(host); // Note that this produces different results from JDK 1.2 as JDK 1.2 // ignores a non-default port if host is null or "". That is inconsistent // with the spec since the result of this method is spec'ed so it can be // used to construct a new URL that is equivalent to the original. boolean port_needed = port > 0 && port != getDefaultPort(); if (port_needed) sb.append(':').append(port); sb.append(file); if (ref != null) sb.append('#').append(ref); return sb.toString(); }
protected String toExternalForm(URL u) { String protocol, host, file, ref; int port; protocol = url.getProtocol(); authority = url.getAuthority(); if (authority == null) authority = ""; // JDK 1.2 online doc infers that host could be null because it // explicitly states that file cannot be null, but is silent on host. host = u.getHost(); if (host == null) host = ""; port = u.getPort(); file = u.getFile(); ref = u.getRef(); // Guess a reasonable size for the string buffer so we have to resize // at most once. int size = protocol.length() + host.length() + file.length() + 24; StringBuffer sb = new StringBuffer(size); if (protocol != null && protocol.length() > 0) { sb.append(protocol); sb.append(":"); } if (host.length() != 0) sb.append("//").append(host); // Note that this produces different results from JDK 1.2 as JDK 1.2 // ignores a non-default port if host is null or "". That is inconsistent // with the spec since the result of this method is spec'ed so it can be // used to construct a new URL that is equivalent to the original. boolean port_needed = port > 0 && port != getDefaultPort(); if (port_needed) sb.append(':').append(port); sb.append(file); if (ref != null) sb.append('#').append(ref); return sb.toString(); }
13,709
protected String toExternalForm(URL u) { String protocol, host, file, ref; int port; protocol = u.getProtocol(); // JDK 1.2 online doc infers that host could be null because it // explicitly states that file cannot be null, but is silent on host. host = u.getHost(); if (host == null) host = ""; port = u.getPort(); file = u.getFile(); ref = u.getRef(); // Guess a reasonable size for the string buffer so we have to resize // at most once. int size = protocol.length() + host.length() + file.length() + 24; StringBuffer sb = new StringBuffer(size); if (protocol != null && protocol.length() > 0) { sb.append(protocol); sb.append(":"); } if (host.length() != 0) sb.append("//").append(host); // Note that this produces different results from JDK 1.2 as JDK 1.2 // ignores a non-default port if host is null or "". That is inconsistent // with the spec since the result of this method is spec'ed so it can be // used to construct a new URL that is equivalent to the original. boolean port_needed = port > 0 && port != getDefaultPort(); if (port_needed) sb.append(':').append(port); sb.append(file); if (ref != null) sb.append('#').append(ref); return sb.toString(); }
protected String toExternalForm(URL u) { String protocol, host, file, ref; int port; protocol = u.getProtocol(); // JDK 1.2 online doc infers that host could be null because it // explicitly states that file cannot be null, but is silent on host. host = u.getHost(); if (host == null) host = ""; port = u.getPort(); file = u.getFile(); ref = u.getRef(); // Guess a reasonable size for the string buffer so we have to resize // at most once. int size = protocol.length() + host.length() + file.length() + 24; StringBuffer sb = new StringBuffer(size); if (protocol != null && protocol.length() > 0) { sb.append(protocol); sb.append(":"); } if (host.length() != 0) sb.append("//").append(host); // Note that this produces different results from JDK 1.2 as JDK 1.2 // ignores a non-default port if host is null or "". That is inconsistent // with the spec since the result of this method is spec'ed so it can be // used to construct a new URL that is equivalent to the original. boolean port_needed = port > 0 && port != getDefaultPort(); if (port_needed) sb.append(':').append(port); sb.append(file); if (ref != null) sb.append('#').append(ref); return sb.toString(); }
13,710
protected String toExternalForm(URL u) { String protocol, host, file, ref; int port; protocol = u.getProtocol(); // JDK 1.2 online doc infers that host could be null because it // explicitly states that file cannot be null, but is silent on host. host = u.getHost(); if (host == null) host = ""; port = u.getPort(); file = u.getFile(); ref = u.getRef(); // Guess a reasonable size for the string buffer so we have to resize // at most once. int size = protocol.length() + host.length() + file.length() + 24; StringBuffer sb = new StringBuffer(size); if (protocol != null && protocol.length() > 0) { sb.append(protocol); sb.append(":"); } if (host.length() != 0) sb.append("//").append(host); // Note that this produces different results from JDK 1.2 as JDK 1.2 // ignores a non-default port if host is null or "". That is inconsistent // with the spec since the result of this method is spec'ed so it can be // used to construct a new URL that is equivalent to the original. boolean port_needed = port > 0 && port != getDefaultPort(); if (port_needed) sb.append(':').append(port); sb.append(file); if (ref != null) sb.append('#').append(ref); return sb.toString(); }
protected String toExternalForm(URL u) { String protocol, host, file, ref; int port; protocol = u.getProtocol(); // JDK 1.2 online doc infers that host could be null because it // explicitly states that file cannot be null, but is silent on host. host = u.getHost(); if (host == null) host = ""; port = u.getPort(); file = u.getFile(); ref = u.getRef(); // Guess a reasonable size for the string buffer so we have to resize // at most once. int size = protocol.length() + authority.length() + file.length() + 24; StringBuffer sb = new StringBuffer(size); if (protocol != null && protocol.length() > 0) { sb.append(protocol); sb.append(":"); } if (host.length() != 0) sb.append("//").append(host); // Note that this produces different results from JDK 1.2 as JDK 1.2 // ignores a non-default port if host is null or "". That is inconsistent // with the spec since the result of this method is spec'ed so it can be // used to construct a new URL that is equivalent to the original. boolean port_needed = port > 0 && port != getDefaultPort(); if (port_needed) sb.append(':').append(port); sb.append(file); if (ref != null) sb.append('#').append(ref); return sb.toString(); }
13,711
protected String toExternalForm(URL u) { String protocol, host, file, ref; int port; protocol = u.getProtocol(); // JDK 1.2 online doc infers that host could be null because it // explicitly states that file cannot be null, but is silent on host. host = u.getHost(); if (host == null) host = ""; port = u.getPort(); file = u.getFile(); ref = u.getRef(); // Guess a reasonable size for the string buffer so we have to resize // at most once. int size = protocol.length() + host.length() + file.length() + 24; StringBuffer sb = new StringBuffer(size); if (protocol != null && protocol.length() > 0) { sb.append(protocol); sb.append(":"); } if (host.length() != 0) sb.append("//").append(host); // Note that this produces different results from JDK 1.2 as JDK 1.2 // ignores a non-default port if host is null or "". That is inconsistent // with the spec since the result of this method is spec'ed so it can be // used to construct a new URL that is equivalent to the original. boolean port_needed = port > 0 && port != getDefaultPort(); if (port_needed) sb.append(':').append(port); sb.append(file); if (ref != null) sb.append('#').append(ref); return sb.toString(); }
protected String toExternalForm(URL u) { String protocol, host, file, ref; int port; protocol = u.getProtocol(); // JDK 1.2 online doc infers that host could be null because it // explicitly states that file cannot be null, but is silent on host. host = u.getHost(); if (host == null) host = ""; port = u.getPort(); file = u.getFile(); ref = u.getRef(); // Guess a reasonable size for the string buffer so we have to resize // at most once. int size = protocol.length() + host.length() + file.length() + 24; StringBuffer sb = new StringBuffer(size); if (protocol != null && protocol.length() > 0) { sb.append(protocol); sb.append(":"); } if (host.length() != 0) sb.append("//").append(host); // Note that this produces different results from JDK 1.2 as JDK 1.2 // ignores a non-default port if host is null or "". That is inconsistent // with the spec since the result of this method is spec'ed so it can be // used to construct a new URL that is equivalent to the original. boolean port_needed = port > 0 && port != getDefaultPort(); if (port_needed) sb.append(':').append(port); sb.append(file); if (ref != null) sb.append('#').append(ref); return sb.toString(); }
13,712
TemplateNode clone(Stylesheet stylesheet) { TemplateNode ret = new IfNode(test.clone(stylesheet)); if (children != null) { ret.children = children.clone(stylesheet); } if (next != null) { ret.next = next.clone(stylesheet); } return ret; }
TemplateNode clone(Stylesheet stylesheet) TemplateNode ret = new IfNode(test.clone(stylesheet)); if (children != null) ret.children = children.clone(stylesheet); } if (next != null) ret.next = next.clone(stylesheet); } return ret; }
13,713
TemplateNode clone(Stylesheet stylesheet) { TemplateNode ret = new IfNode(test.clone(stylesheet)); if (children != null) { ret.children = children.clone(stylesheet); } if (next != null) { ret.next = next.clone(stylesheet); } return ret; }
TemplateNode clone(Stylesheet stylesheet) { TemplateNode ret = new IfNode(test.clone(stylesheet)); if (children != null) { ret.children = children.clone(stylesheet); if (next != null) { ret.next = next.clone(stylesheet); return ret;
13,714
void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { Object ret = test.evaluate(context, pos, len); boolean success = (ret instanceof Boolean) ? ((Boolean) ret).booleanValue() : Expr._boolean(context, ret); if (success) { if (children != null) { children.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } } if (next != null) { next.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } }
void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException Object ret = test.evaluate(context, pos, len); boolean success = (ret instanceof Boolean) ? ((Boolean) ret).booleanValue() : Expr._boolean(context, ret); if (success) if (children != null) children.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } } if (next != null) next.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } }
13,715
void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { Object ret = test.evaluate(context, pos, len); boolean success = (ret instanceof Boolean) ? ((Boolean) ret).booleanValue() : Expr._boolean(context, ret); if (success) { if (children != null) { children.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } } if (next != null) { next.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } }
void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { Object ret = test.evaluate(context, pos, len); boolean success = (ret instanceof Boolean) ? ((Boolean) ret).booleanValue() : Expr._boolean(context, ret); if (success) { if (children != null) { children.apply(stylesheet, mode, context, pos, len, parent, nextSibling); if (next != null) { next.apply(stylesheet, mode, context, pos, len, parent, nextSibling);
13,716
public String toString() { StringBuffer buf = new StringBuffer(getClass().getName()); buf.append('['); buf.append("test="); buf.append(test); buf.append(']'); return buf.toString(); }
public String toString() { StringBuffer buf = new StringBuffer("if"); buf.append('['); buf.append("test="); buf.append(test); buf.append(']'); return buf.toString(); }
13,717
public SwingFrame(Frame awtFrame) { this.awtComponent = awtFrame;// setFocusCycleRoot(true);// final KeyboardFocusManager manager = KeyboardFocusManager// .getCurrentKeyboardFocusManager();// setFocusTraversalPolicy(manager.getDefaultFocusTraversalPolicy()); addInternalFrameListener(this); }
public SwingFrame(Frame awtFrame) { this.awtComponent = awtFrame;// setFocusCycleRoot(true);// final KeyboardFocusManager manager = KeyboardFocusManager// .getCurrentKeyboardFocusManager();// setFocusTraversalPolicy(manager.getDefaultFocusTraversalPolicy()); }
13,718
Node getRow(final int index) { int i = 0; for (Node ctx = getFirstChild(); ctx != null; ctx = ctx.getNextSibling()) { if (!"tr".equalsIgnoreCase(ctx.getLocalName())) { continue; } if (index == i) { return ctx; } i++; } return null; }
Node getRow(final int index) { int i = 0; for (Node ctx = getFirstChild(); ctx != null; ctx = ctx.getNextSibling()) { String name = ctx.getLocalName(); if (name == null) { name = ctx.getNodeName(); } if (!"tr".equalsIgnoreCase(name)) { continue; } if (index == i) { return ctx; } i++; } return null; }
13,719
public static void main(String[] args) throws Exception { final ParsedArguments cmdLine = HELP_INFO.parse(args); final File dir = ARG_DIR.getFile(cmdLine); boolean mkOk = false; mkOk=dir.mkdir(); if(!mkOk){ System.err.println("Directory can't make"); } }
public static void main(String[] args) throws Exception { final ParsedArguments cmdLine = HELP_INFO.parse(args); final File dir = ARG_DIR.getFile(cmdLine); boolean mkOk = false; mkOk=dir.mkdir(); if(!mkOk){ System.err.println("Directory can't make"); } }
13,723
public MenuElement[] getSubElements() { MenuElement[] subElements = new MenuElement[getComponentCount()]; for (int i = 0; i < getComponentCount(); i++) subElements[i] = (MenuElement) getMenu(i); return subElements; }
public MenuElement[] getSubElements() { MenuElement[] subElements = new MenuElement[getComponentCount()]; for (int i = 0; i < getComponentCount(); i++) { menu = getMenu(i); if (menu != null) { subElements[j++] = (MenuElement) menu; } else doResize = true; } return subElements; }
13,724