bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
|---|---|---|
public void handleEvent(AWTEvent event) { switch (event.getID()) { case PaintEvent.PAINT: { Graphics g = jComponent.getGraphics(); //Point p = component.getLocationOnScreen(); //g.translate(p.x, p.y); ((Component)component).paint(g); //g.translate(-p.x, -p.y); } break; case PaintEvent.UPDATE: { Graphics g = jComponent.getGraphics(); //Point p = component.getLocationOnScreen(); //g.translate(p.x, p.y); ((Component)component).update(getGraphics()); //g.translate(-p.x, -p.y); } break; } }
|
public void handleEvent(AWTEvent event) { switch (event.getID()) { case PaintEvent.PAINT: { Graphics g = jComponent.getGraphics(); //Point p = component.getLocationOnScreen(); //g.translate(p.x, p.y); ((Component)component).paint(g); //g.translate(-p.x, -p.y); } break; case PaintEvent.UPDATE: { Graphics g = jComponent.getGraphics(); //Point p = component.getLocationOnScreen(); //g.translate(p.x, p.y); ((Component)component).update(getGraphics()); //g.translate(-p.x, -p.y); } break; } }
| 12,363
|
public synchronized void setLength(long length) throws IOException { if (closed) { throw new IOException("File closed"); } if (readOnly) { throw new IOException("Cannot write"); } file.setLength(length); if (length > fileOffset) { fileOffset = length; } }
|
public synchronized void setLength(long length) throws IOException { if (closed) { throw new IOException("File closed"); } if (readOnly) { throw new IOException("Cannot write"); } file.setLength(length); fileOffset = length; } }
| 12,365
|
public synchronized void setLength(long length) throws IOException { if (closed) { throw new IOException("File closed"); } if (readOnly) { throw new IOException("Cannot write"); } file.setLength(length); if (length > fileOffset) { fileOffset = length; } }
|
public synchronized void setLength(long length) throws IOException { if (closed) { throw new IOException("File closed"); if (readOnly) { throw new IOException("Cannot write"); file.setLength(length); if (length > fileOffset) { fileOffset = length;
| 12,366
|
final public static ByteBuffer wrap (byte[] array) { return wrap (array, 0, array.length); }
|
public static final ByteBuffer wrap (byte[] array, int offset, int length) { return wrap (array, 0, array.length); }
| 12,367
|
final public static ByteBuffer wrap (byte[] array) { return wrap (array, 0, array.length); }
|
final public static ByteBuffer wrap (byte[] array) { return new ByteBufferImpl (array, 0, array.length, offset + length, offset, -1, false); }
| 12,368
|
public static String decode(String s, String encoding) throws UnsupportedEncodingException { // First convert all '+' characters to spaces. String str = s.replace('+', ' '); // Then go through the whole string looking for byte encoded characters int i; int start = 0; byte[] bytes = null; int length = str.length(); StringBuffer result = new StringBuffer(length); while ((i = str.indexOf('%', start)) >= 0) { // Add all non-encoded characters to the result buffer result.append(str.substring(start, i)); start = i; // Get all consecutive encoded bytes while ((i + 2 < length) && (str.charAt(i) == '%')) i += 3; // Decode all these bytes if ((bytes == null) || (bytes.length < ((i - start) / 3))) bytes = new byte[((i - start) / 3)]; int index = 0; try { while (start < i) { String sub = str.substring(start + 1, start + 3); bytes[index] = (byte) Integer.parseInt(sub, 16); index++; start += 3; } } catch (NumberFormatException nfe) { // One of the hex encoded strings was bad } // Add the bytes as characters according to the given encoding result.append(new String(bytes, 0, index, encoding)); // Make sure we skip to just after a % sign // There might not have been enough encoded characters after the % // or the hex chars were not actually hex chars (NumberFormatException) if (start < length && s.charAt(start) == '%') { result.append('%'); start++; } } // Add any characters left if (start < str.length()) result.append(str.substring(start)); return result.toString(); }
|
public static String decode(String s, String encoding) throws UnsupportedEncodingException { // First convert all '+' characters to spaces. String str = s.replace('+', ' '); // Then go through the whole string looking for byte encoded characters int i; int start = 0; byte[] bytes = null; int length = str.length(); StringBuffer result = new StringBuffer(length); while ((i = str.indexOf('%', start)) >= 0) { // Add all non-encoded characters to the result buffer result.append(str.substring(start, i)); start = i; // Get all consecutive encoded bytes while ((i + 2 < length) && (str.charAt(i) == '%')) i += 3; // Decode all these bytes if ((bytes == null) || (bytes.length < ((i - start) / 3))) bytes = new byte[((i - start) / 3)]; int index = 0; try { while (start < i) { String sub = str.substring(start + 1, start + 3); bytes[index] = (byte) Integer.parseInt(sub, 16); index++; start += 3; } } catch (NumberFormatException nfe) { // One of the hex encoded strings was bad } // Add the bytes as characters according to the given encoding result.append(new String(bytes, 0, index, encoding)); // Make sure we skip to just after a % sign // There might not have been enough encoded characters after the % // or the hex chars were not actually hex chars (NumberFormatException) if (start < length && s.charAt(start) == '%') { result.append('%'); start++; } } // Add any characters left if (start < str.length()) result.append(str.substring(start)); return result.toString(); }
| 12,369
|
public static String decode(String s, String encoding) throws UnsupportedEncodingException { // First convert all '+' characters to spaces. String str = s.replace('+', ' '); // Then go through the whole string looking for byte encoded characters int i; int start = 0; byte[] bytes = null; int length = str.length(); StringBuffer result = new StringBuffer(length); while ((i = str.indexOf('%', start)) >= 0) { // Add all non-encoded characters to the result buffer result.append(str.substring(start, i)); start = i; // Get all consecutive encoded bytes while ((i + 2 < length) && (str.charAt(i) == '%')) i += 3; // Decode all these bytes if ((bytes == null) || (bytes.length < ((i - start) / 3))) bytes = new byte[((i - start) / 3)]; int index = 0; try { while (start < i) { String sub = str.substring(start + 1, start + 3); bytes[index] = (byte) Integer.parseInt(sub, 16); index++; start += 3; } } catch (NumberFormatException nfe) { // One of the hex encoded strings was bad } // Add the bytes as characters according to the given encoding result.append(new String(bytes, 0, index, encoding)); // Make sure we skip to just after a % sign // There might not have been enough encoded characters after the % // or the hex chars were not actually hex chars (NumberFormatException) if (start < length && s.charAt(start) == '%') { result.append('%'); start++; } } // Add any characters left if (start < str.length()) result.append(str.substring(start)); return result.toString(); }
|
public static String decode(String s, String encoding) throws UnsupportedEncodingException { // First convert all '+' characters to spaces. String str = s.replace('+', ' '); // Then go through the whole string looking for byte encoded characters int i; int start = 0; byte[] bytes = null; int length = str.length(); StringBuffer result = new StringBuffer(length); while ((i = str.indexOf('%', start)) >= 0) { // Add all non-encoded characters to the result buffer result.append(str.substring(start, i)); start = i; // Get all consecutive encoded bytes while ((i + 2 < length) && (str.charAt(i) == '%')) i += 3; // Decode all these bytes if ((bytes == null) || (bytes.length < ((i - start) / 3))) bytes = new byte[((i - start) / 3)]; int index = 0; try { while (start < i) { String sub = str.substring(start + 1, start + 3); bytes[index] = (byte) Integer.parseInt(sub, 16); index++; start += 3; } } catch (NumberFormatException nfe) { // One of the hex encoded strings was bad } // Add the bytes as characters according to the given encoding result.append(new String(bytes, 0, index, encoding)); // Make sure we skip to just after a % sign // There might not have been enough encoded characters after the % // or the hex chars were not actually hex chars (NumberFormatException) if (start < length && s.charAt(start) == '%') { result.append('%'); start++; } } // Add any characters left if (start < str.length()) result.append(str.substring(start)); return result.toString(); }
| 12,370
|
public static String decode(String s, String encoding) throws UnsupportedEncodingException { // First convert all '+' characters to spaces. String str = s.replace('+', ' '); // Then go through the whole string looking for byte encoded characters int i; int start = 0; byte[] bytes = null; int length = str.length(); StringBuffer result = new StringBuffer(length); while ((i = str.indexOf('%', start)) >= 0) { // Add all non-encoded characters to the result buffer result.append(str.substring(start, i)); start = i; // Get all consecutive encoded bytes while ((i + 2 < length) && (str.charAt(i) == '%')) i += 3; // Decode all these bytes if ((bytes == null) || (bytes.length < ((i - start) / 3))) bytes = new byte[((i - start) / 3)]; int index = 0; try { while (start < i) { String sub = str.substring(start + 1, start + 3); bytes[index] = (byte) Integer.parseInt(sub, 16); index++; start += 3; } } catch (NumberFormatException nfe) { // One of the hex encoded strings was bad } // Add the bytes as characters according to the given encoding result.append(new String(bytes, 0, index, encoding)); // Make sure we skip to just after a % sign // There might not have been enough encoded characters after the % // or the hex chars were not actually hex chars (NumberFormatException) if (start < length && s.charAt(start) == '%') { result.append('%'); start++; } } // Add any characters left if (start < str.length()) result.append(str.substring(start)); return result.toString(); }
|
public static String decode(String s, String encoding) throws UnsupportedEncodingException { // First convert all '+' characters to spaces. String str = s.replace('+', ' '); // Then go through the whole string looking for byte encoded characters int i; int start = 0; byte[] bytes = null; int length = str.length(); StringBuffer result = new StringBuffer(length); while ((i = str.indexOf('%', start)) >= 0) { // Add all non-encoded characters to the result buffer result.append(str.substring(start, i)); start = i; // Get all consecutive encoded bytes while ((i + 2 < length) && (str.charAt(i) == '%')) i += 3; // Decode all these bytes if ((bytes == null) || (bytes.length < ((i - start) / 3))) bytes = new byte[((i - start) / 3)]; int index = 0; try { while (start < i) { String sub = str.substring(start + 1, start + 3); bytes[index] = (byte) Integer.parseInt(sub, 16); index++; start += 3; } } catch (NumberFormatException nfe) { // One of the hex encoded strings was bad } // Add the bytes as characters according to the given encoding result.append(new String(bytes, 0, index, encoding)); // Make sure we skip to just after a % sign // There might not have been enough encoded characters after the % // or the hex chars were not actually hex chars (NumberFormatException) if (start < length && s.charAt(start) == '%') { result.append('%'); start++; } } // Add any characters left if (start < str.length()) result.append(str.substring(start)); return result.toString(); }
| 12,371
|
public static String decode(String s, String encoding) throws UnsupportedEncodingException { // First convert all '+' characters to spaces. String str = s.replace('+', ' '); // Then go through the whole string looking for byte encoded characters int i; int start = 0; byte[] bytes = null; int length = str.length(); StringBuffer result = new StringBuffer(length); while ((i = str.indexOf('%', start)) >= 0) { // Add all non-encoded characters to the result buffer result.append(str.substring(start, i)); start = i; // Get all consecutive encoded bytes while ((i + 2 < length) && (str.charAt(i) == '%')) i += 3; // Decode all these bytes if ((bytes == null) || (bytes.length < ((i - start) / 3))) bytes = new byte[((i - start) / 3)]; int index = 0; try { while (start < i) { String sub = str.substring(start + 1, start + 3); bytes[index] = (byte) Integer.parseInt(sub, 16); index++; start += 3; } } catch (NumberFormatException nfe) { // One of the hex encoded strings was bad } // Add the bytes as characters according to the given encoding result.append(new String(bytes, 0, index, encoding)); // Make sure we skip to just after a % sign // There might not have been enough encoded characters after the % // or the hex chars were not actually hex chars (NumberFormatException) if (start < length && s.charAt(start) == '%') { result.append('%'); start++; } } // Add any characters left if (start < str.length()) result.append(str.substring(start)); return result.toString(); }
|
public static String decode(String s, String encoding) throws UnsupportedEncodingException { // First convert all '+' characters to spaces. String str = s.replace('+', ' '); // Then go through the whole string looking for byte encoded characters int i; int start = 0; byte[] bytes = null; int length = str.length(); StringBuffer result = new StringBuffer(length); while ((i = str.indexOf('%', start)) >= 0) { // Add all non-encoded characters to the result buffer result.append(str.substring(start, i)); start = i; // Get all consecutive encoded bytes while ((i + 2 < length) && (str.charAt(i) == '%')) i += 3; // Decode all these bytes if ((bytes == null) || (bytes.length < ((i - start) / 3))) bytes = new byte[((i - start) / 3)]; int index = 0; try { while (start < i) { String sub = str.substring(start + 1, start + 3); bytes[index] = (byte) Integer.parseInt(sub, 16); index++; start += 3; } } catch (NumberFormatException nfe) { // One of the hex encoded strings was bad } // Add the bytes as characters according to the given encoding result.append(new String(bytes, 0, index, encoding)); // Make sure we skip to just after a % sign // There might not have been enough encoded characters after the % // or the hex chars were not actually hex chars (NumberFormatException) if (start < length && s.charAt(start) == '%') { result.append('%'); start++; } } // Add any characters left if (start < str.length()) result.append(str.substring(start)); return result.toString(); }
| 12,372
|
public static Constant getInstance(Object value) { return new ReferenceConstant(value); }
|
public static Constant getInstance(Object value) { return new ReferenceConstant(value); }
| 12,373
|
Container getContentPane() { return getRootPane().getContentPane(); }
|
public Container getContentPane() { return getRootPane().getContentPane(); }
| 12,374
|
void setContentPane(Container contentPane) { getRootPane().setContentPane(contentPane); }
|
public void setContentPane(Container contentPane) { getRootPane().setContentPane(contentPane); }
| 12,375
|
void setDefaultCloseOperation(int operation) { close_action = operation; }
|
public void setDefaultCloseOperation(int operation) { close_action = operation; }
| 12,376
|
void setGlassPane(Component glassPane) { getRootPane().setGlassPane(glassPane); }
|
public void setGlassPane(Component glassPane) { getRootPane().setGlassPane(glassPane); }
| 12,377
|
public static KeyFactory getInstance(String algorithm) throws NoSuchAlgorithmException { Provider[] p = Security.getProviders(); for (int i = 0; i < p.length; i++) { String classname = p[i].getProperty("KeyFactory." + algorithm); if (classname != null) return getInstance(classname, algorithm, p[i]); } throw new NoSuchAlgorithmException(algorithm); }
|
public static KeyFactory getInstance(String algorithm) throws NoSuchAlgorithmException { Provider[] p = Security.getProviders(); for (int i = 0; i < p.length; i++) { String classname = p[i].getProperty("KeyFactory." + algorithm); if (classname != null) return getInstance(classname, algorithm, p[i]); } throw new NoSuchAlgorithmException(algorithm); }
| 12,378
|
public int hashCode () { // FIXME: check what SUN does here. return affineTransform == null ? 0 : affineTransform.hashCode (); }
|
public int hashCode () { // FIXME: check what SUN does here. int code = ( isAntiAliased ? 1 : 0 ) + ( usesFractionalMetrics ? 2 : 0 ); if( affineTransform != null && !affineTransform.isIdentity() ) code ^= affineTransform.hashCode(); return code; }
| 12,380
|
public static String[] getISOCountries() { return new String[] { "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AN", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BM", "BN", "BO", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "FX", "GA", "GB", "GD", "GE", "GF", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IN", "IO", "IQ", "IR", "IS", "IT", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PT", "PW", "PY", "QA", "RE", "RO", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "ST", "SV", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TM", "TN", "TO", "TP", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "YE", "YT", "YU", "ZA", "ZM", "ZR", "ZW" }; }
|
public static String[] getISOCountries() { if (countryCache == null) { "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AN", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BM", "BN", "BO", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "FX", "GA", "GB", "GD", "GE", "GF", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IN", "IO", "IQ", "IR", "IS", "IT", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PT", "PW", "PY", "QA", "RE", "RO", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "ST", "SV", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TM", "TN", "TO", "TP", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "YE", "YT", "YU", "ZA", "ZM", "ZR", "ZW" }; }
| 12,383
|
public static String[] getISOCountries() { return new String[] { "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AN", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BM", "BN", "BO", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "FX", "GA", "GB", "GD", "GE", "GF", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IN", "IO", "IQ", "IR", "IS", "IT", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PT", "PW", "PY", "QA", "RE", "RO", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "ST", "SV", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TM", "TN", "TO", "TP", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "YE", "YT", "YU", "ZA", "ZM", "ZR", "ZW" }; }
|
public static String[] getISOCountries() { return new String[] { "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AN", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BM", "BN", "BO", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "FX", "GA", "GB", "GD", "GE", "GF", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IN", "IO", "IQ", "IR", "IS", "IT", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PT", "PW", "PY", "QA", "RE", "RO", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "ST", "SV", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TM", "TN", "TO", "TP", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "YE", "YT", "YU", "ZA", "ZM", "ZR", "ZW" }; }
| 12,384
|
public static String[] getISOLanguages() { return new String[] { "aa", "ab", "af", "am", "ar", "as", "ay", "az", "ba", "be", "bg", "bh", "bi", "bn", "bo", "br", "ca", "co", "cs", "cy", "da", "de", "dz", "el", "en", "eo", "es", "et", "eu", "fa", "fi", "fj", "fo", "fr", "fy", "ga", "gd", "gl", "gn", "gu", "ha", "he", "hi", "hr", "hu", "hy", "ia", "id", "ie", "ik", "in", "is", "it", "iu", "iw", "ja", "ji", "jw", "ka", "kk", "kl", "km", "kn", "ko", "ks", "ku", "ky", "la", "ln", "lo", "lt", "lv", "mg", "mi", "mk", "ml", "mn", "mo", "mr", "ms", "mt", "my", "na", "ne", "nl", "no", "oc", "om", "or", "pa", "pl", "ps", "pt", "qu", "rm", "rn", "ro", "ru", "rw", "sa", "sd", "sg", "sh", "si", "sk", "sl", "sm", "sn", "so", "sq", "sr", "ss", "st", "su", "sv", "sw", "ta", "te", "tg", "th", "ti", "tk", "tl", "tn", "to", "tr", "ts", "tt", "tw", "ug", "uk", "ur", "uz", "vi", "vo", "wo", "xh", "yi", "yo", "za", "zh", "zu" }; }
|
public static String[] getISOLanguages() { if (languageCache == null) { "aa", "ab", "af", "am", "ar", "as", "ay", "az", "ba", "be", "bg", "bh", "bi", "bn", "bo", "br", "ca", "co", "cs", "cy", "da", "de", "dz", "el", "en", "eo", "es", "et", "eu", "fa", "fi", "fj", "fo", "fr", "fy", "ga", "gd", "gl", "gn", "gu", "ha", "he", "hi", "hr", "hu", "hy", "ia", "id", "ie", "ik", "in", "is", "it", "iu", "iw", "ja", "ji", "jw", "ka", "kk", "kl", "km", "kn", "ko", "ks", "ku", "ky", "la", "ln", "lo", "lt", "lv", "mg", "mi", "mk", "ml", "mn", "mo", "mr", "ms", "mt", "my", "na", "ne", "nl", "no", "oc", "om", "or", "pa", "pl", "ps", "pt", "qu", "rm", "rn", "ro", "ru", "rw", "sa", "sd", "sg", "sh", "si", "sk", "sl", "sm", "sn", "so", "sq", "sr", "ss", "st", "su", "sv", "sw", "ta", "te", "tg", "th", "ti", "tk", "tl", "tn", "to", "tr", "ts", "tt", "tw", "ug", "uk", "ur", "uz", "vi", "vo", "wo", "xh", "yi", "yo", "za", "zh", "zu" }; }
| 12,385
|
public static String[] getISOLanguages() { return new String[] { "aa", "ab", "af", "am", "ar", "as", "ay", "az", "ba", "be", "bg", "bh", "bi", "bn", "bo", "br", "ca", "co", "cs", "cy", "da", "de", "dz", "el", "en", "eo", "es", "et", "eu", "fa", "fi", "fj", "fo", "fr", "fy", "ga", "gd", "gl", "gn", "gu", "ha", "he", "hi", "hr", "hu", "hy", "ia", "id", "ie", "ik", "in", "is", "it", "iu", "iw", "ja", "ji", "jw", "ka", "kk", "kl", "km", "kn", "ko", "ks", "ku", "ky", "la", "ln", "lo", "lt", "lv", "mg", "mi", "mk", "ml", "mn", "mo", "mr", "ms", "mt", "my", "na", "ne", "nl", "no", "oc", "om", "or", "pa", "pl", "ps", "pt", "qu", "rm", "rn", "ro", "ru", "rw", "sa", "sd", "sg", "sh", "si", "sk", "sl", "sm", "sn", "so", "sq", "sr", "ss", "st", "su", "sv", "sw", "ta", "te", "tg", "th", "ti", "tk", "tl", "tn", "to", "tr", "ts", "tt", "tw", "ug", "uk", "ur", "uz", "vi", "vo", "wo", "xh", "yi", "yo", "za", "zh", "zu" }; }
|
public static String[] getISOLanguages() { return new String[] { "aa", "ab", "af", "am", "ar", "as", "ay", "az", "ba", "be", "bg", "bh", "bi", "bn", "bo", "br", "ca", "co", "cs", "cy", "da", "de", "dz", "el", "en", "eo", "es", "et", "eu", "fa", "fi", "fj", "fo", "fr", "fy", "ga", "gd", "gl", "gn", "gu", "ha", "he", "hi", "hr", "hu", "hy", "ia", "id", "ie", "ik", "in", "is", "it", "iu", "iw", "ja", "ji", "jw", "ka", "kk", "kl", "km", "kn", "ko", "ks", "ku", "ky", "la", "ln", "lo", "lt", "lv", "mg", "mi", "mk", "ml", "mn", "mo", "mr", "ms", "mt", "my", "na", "ne", "nl", "no", "oc", "om", "or", "pa", "pl", "ps", "pt", "qu", "rm", "rn", "ro", "ru", "rw", "sa", "sd", "sg", "sh", "si", "sk", "sl", "sm", "sn", "so", "sq", "sr", "ss", "st", "su", "sv", "sw", "ta", "te", "tg", "th", "ti", "tk", "tl", "tn", "to", "tr", "ts", "tt", "tw", "ug", "uk", "ur", "uz", "vi", "vo", "wo", "xh", "yi", "yo", "za", "zh", "zu" }; }
| 12,386
|
public JRadioButtonMenuItem() { // TODO } // JRadioButtonMenuItem()
|
public JRadioButtonMenuItem() { // TODO } // JRadioButtonMenuItem()
| 12,387
|
public AccessibleContext getAccessibleContext() { if (accessibleContext == null) { accessibleContext = new AccessibleJRadioButtonMenuItem(this); } // if return accessibleContext; } // getAccessibleContext()
|
public AccessibleContext getAccessibleContext() { if (accessibleContext == null) { accessibleContext = new AccessibleJRadioButtonMenuItem(this); } // if return accessibleContext; } // getAccessibleContext()
| 12,388
|
protected String paramString() { return null; // TODO } // paramString()
|
protected String paramString() { return null; // TODO } // paramString()
| 12,389
|
protected final void doTransmit(SocketBuffer skbuf, HardwareAddress destination) throws NetworkException { skbuf.insert(ETH_HLEN); if (destination != null) { destination.writeTo(skbuf, 0); } else { EthernetAddress.BROADCAST.writeTo(skbuf, 0); } getAddress().writeTo(skbuf, 6); skbuf.set16(12, skbuf.getProtocolID()); onReceive(skbuf); }
|
protected final void doTransmit(SocketBuffer skbuf, HardwareAddress destination) throws NetworkException { skbuf.insert(ETH_HLEN); if (destination != null) { destination.writeTo(skbuf, 0); } else { EthernetAddress.BROADCAST.writeTo(skbuf, 0); } getAddress().writeTo(skbuf, 6); skbuf.set16(12, skbuf.getProtocolID()); onReceive(skbuf); }
| 12,391
|
protected final void doTransmit(SocketBuffer skbuf, HardwareAddress destination) throws NetworkException { skbuf.insert(ETH_HLEN); if (destination != null) { destination.writeTo(skbuf, 0); } else { EthernetAddress.BROADCAST.writeTo(skbuf, 0); } getAddress().writeTo(skbuf, 6); skbuf.set16(12, skbuf.getProtocolID()); onReceive(skbuf); }
|
protected final void doTransmit(SocketBuffer skbuf, HardwareAddress destination) throws NetworkException { skbuf.insert(ETH_HLEN); if (destination != null) { destination.writeTo(skbuf, 0); } else { EthernetAddress.BROADCAST.writeTo(skbuf, 0); } getAddress().writeTo(skbuf, 6); skbuf.set16(12, skbuf.getProtocolID()); onReceive(skbuf); }
| 12,392
|
public int following (int pos) { int save = iter.getIndex(); iter.setIndex(pos); int r = next (); return r; }
|
public int following (int pos) { iter.setIndex(pos); int r = next (); return r; }
| 12,393
|
protected Node getChildElement(String name) { for (Node child = getFirstChild(); child != null; child = child.getNextSibling()) { if (name.equalsIgnoreCase(child.getLocalName())) { return child; } } return null; }
|
protected Node getChildElement(String name) { for (Node child = getFirstChild(); child != null; child = child.getNextSibling()) { String childName = child.getLocalName(); if (childName == null) { childName = child.getLocalName(); } if (name.equalsIgnoreCase(childName)) { return child; } } return null; }
| 12,394
|
protected Node getParentElement(String name) { for (Node parent = getParentNode(); parent != null; parent = parent.getParentNode()) { if (name.equalsIgnoreCase(parent.getLocalName())) { return parent; } } return null; }
|
protected Node getParentElement(String name) { for (Node parent = getParentNode(); parent != null; parent = parent.getParentNode()) { String parentName = parent.getLocalName(); if (parentName == null) { parentName = parent.getNodeName(); } if (name.equalsIgnoreCase(parentName)) { return parent; } } return null; }
| 12,396
|
public static char[] read(InputStream input) { CharSeqHolder h = new CharSeqHolder(); h._read(input); return h.value; }
|
public static char[] read(InputStream input) { CharSeqHolder h = new CharSeqHolder(); h._read(input); return h.value; }
| 12,398
|
public static void write(OutputStream output, char[] value) { CharSeqHolder h = new CharSeqHolder(value); h._write(output); }
|
public static void write(OutputStream output, char[] value) { CharSeqHolder h = new CharSeqHolder(value); h._write(output); }
| 12,399
|
public static Date getDateForNTFSTimes(long _100ns) { long timeoffset = Math.abs((369 * 365 + 89) * 24 * 3600 * 10000000); long time = (Math.abs(_100ns) - timeoffset); System.out.println("hours" + ((Math.abs(time) / 1000) / 60) / 60); Date date = new Date(time); System.out.println(date.toLocaleString()); return date; }
|
public static Date getDateForNTFSTimes(long _100ns) { long timeoffset = Math.abs((369 * 365 + 89) * 24 * 3600 * 10000000); long time = (Math.abs(_100ns) - timeoffset); System.out.println("hours" + ((Math.abs(time) / 1000) / 60) / 60); Date date = new Date(time); System.out.println(DateFormat.getInstance().format(date)); return date; }
| 12,400
|
public RepaintManager() { dirtyComponents = new Hashtable(); invalidComponents = new Vector(); repaintWorker = new RepaintWorker(); doubleBufferMaximumSize = new Dimension(2000,2000); doubleBufferingEnabled = true; }
|
public RepaintManager() { dirtyComponents = new Hashtable(); invalidComponents = new Vector(); repaintWorker = new RepaintWorker(); doubleBufferMaximumSize = new Dimension(2000,2000); doubleBufferingEnabled = true; }
| 12,401
|
public synchronized void addDirtyRegion(JComponent component, int x, int y, int w, int h) { if (w == 0 || h == 0) return; Rectangle r = new Rectangle(x, y, w, h); if (dirtyComponents.containsKey(component)) r = r.union((Rectangle)dirtyComponents.get(component)); dirtyComponents.put(component, r); if (! repaintWorker.isLive()) { repaintWorker.setLive(true); SwingUtilities.invokeLater(repaintWorker); } }
|
public synchronized void addDirtyRegion(JComponent component, int x, int y, int w, int h) { if (w == 0 || h == 0 || !component.isShowing()) return; Rectangle r = new Rectangle(x, y, w, h); if (dirtyComponents.containsKey(component)) r = r.union((Rectangle)dirtyComponents.get(component)); dirtyComponents.put(component, r); if (! repaintWorker.isLive()) { repaintWorker.setLive(true); SwingUtilities.invokeLater(repaintWorker); } }
| 12,402
|
public Rectangle getDirtyRegion(JComponent component) { return (Rectangle) dirtyComponents.get(component); }
|
public Rectangle getDirtyRegion(JComponent component) { Rectangle dirty = (Rectangle) dirtyComponents.get(component); if (dirty == null) dirty = new Rectangle(); return dirty; }
| 12,404
|
public boolean isCompletelyDirty(JComponent component) { Rectangle dirty = (Rectangle) dirtyComponents.get(component); if (dirty == null) return false; Rectangle r = component.getBounds(); if (r == null) return true; return dirty.contains(r); }
|
public boolean isCompletelyDirty(JComponent component) { Rectangle dirty = (Rectangle) dirtyComponents.get(component); if (dirty == null) return false; Rectangle r = component.getBounds(); if (r == null) return true; return dirty.contains(r); }
| 12,405
|
public boolean isCompletelyDirty(JComponent component) { Rectangle dirty = (Rectangle) dirtyComponents.get(component); if (dirty == null) return false; Rectangle r = component.getBounds(); if (r == null) return true; return dirty.contains(r); }
|
public boolean isCompletelyDirty(JComponent component) { Rectangle dirty = (Rectangle) dirtyComponents.get(component); if (dirty == null) return false; Rectangle r = component.getBounds(); if (r == null) return true; return dirty.contains(r); }
| 12,406
|
public void paintDirtyRegions() { // step 1: pull out roots and calculate spanning damage HashMap roots = new HashMap(); for (Enumeration e = dirtyComponents.keys(); e.hasMoreElements(); ) { JComponent comp = (JComponent) e.nextElement(); if (! (comp.isVisible() && comp.isShowing())) continue; Rectangle damaged = getDirtyRegion(comp); if (damaged.width == 0 || damaged.height == 0) continue; JRootPane root = comp.getRootPane(); // If the component has no root, no repainting will occur. if (root == null) continue; Rectangle rootDamage = SwingUtilities.convertRectangle(comp, damaged, root); if (! roots.containsKey(root)) { roots.put(root, rootDamage); } else { roots.put(root, ((Rectangle)roots.get(root)).union(rootDamage)); } } dirtyComponents.clear(); // step 2: paint those roots Iterator i = roots.entrySet().iterator(); while(i.hasNext()) { Map.Entry ent = (Map.Entry) i.next(); JRootPane root = (JRootPane) ent.getKey(); Rectangle rect = (Rectangle) ent.getValue(); root.paintImmediately(rect); } }
|
public void paintDirtyRegions() { // step 1: pull out roots and calculate spanning damage HashMap roots = new HashMap(); for (Enumeration e = dirtyComponents.keys(); e.hasMoreElements(); ) { JComponent comp = (JComponent) e.nextElement(); if (! (comp.isVisible() && comp.isShowing())) continue; Rectangle damaged = getDirtyRegion(comp); if (damaged.width == 0 || damaged.height == 0) continue; JRootPane root = comp.getRootPane(); // If the component has no root, no repainting will occur. if (root == null) continue; Rectangle rootDamage = SwingUtilities.convertRectangle(comp, damaged, root); if (! roots.containsKey(root)) { roots.put(root, rootDamage); } else { roots.put(root, ((Rectangle)roots.get(root)).union(rootDamage)); } } dirtyComponents.clear(); // step 2: paint those roots Iterator i = roots.entrySet().iterator(); while(i.hasNext()) { Map.Entry ent = (Map.Entry) i.next(); JRootPane root = (JRootPane) ent.getKey(); Rectangle rect = (Rectangle) ent.getValue(); root.paintImmediately(rect); } }
| 12,409
|
public void paintDirtyRegions() { // step 1: pull out roots and calculate spanning damage HashMap roots = new HashMap(); for (Enumeration e = dirtyComponents.keys(); e.hasMoreElements(); ) { JComponent comp = (JComponent) e.nextElement(); if (! (comp.isVisible() && comp.isShowing())) continue; Rectangle damaged = getDirtyRegion(comp); if (damaged.width == 0 || damaged.height == 0) continue; JRootPane root = comp.getRootPane(); // If the component has no root, no repainting will occur. if (root == null) continue; Rectangle rootDamage = SwingUtilities.convertRectangle(comp, damaged, root); if (! roots.containsKey(root)) { roots.put(root, rootDamage); } else { roots.put(root, ((Rectangle)roots.get(root)).union(rootDamage)); } } dirtyComponents.clear(); // step 2: paint those roots Iterator i = roots.entrySet().iterator(); while(i.hasNext()) { Map.Entry ent = (Map.Entry) i.next(); JRootPane root = (JRootPane) ent.getKey(); Rectangle rect = (Rectangle) ent.getValue(); root.paintImmediately(rect); } }
|
public void paintDirtyRegions() { // step 1: pull out roots and calculate spanning damage HashMap roots = new HashMap(); for (Enumeration e = dirtyComponents.keys(); e.hasMoreElements(); ) { JComponent comp = (JComponent) e.nextElement(); if (! (comp.isVisible() && comp.isShowing())) continue; Rectangle damaged = getDirtyRegion(comp); if (damaged.width == 0 || damaged.height == 0) continue; JRootPane root = comp.getRootPane(); // If the component has no root, no repainting will occur. if (root == null) continue; Rectangle rootDamage = SwingUtilities.convertRectangle(comp, damaged, root); if (! roots.containsKey(root)) { roots.put(root, rootDamage); } else { roots.put(root, ((Rectangle)roots.get(root)).union(rootDamage)); } } dirtyComponents.clear(); // step 2: paint those roots Iterator i = roots.entrySet().iterator(); while(i.hasNext()) { Map.Entry ent = (Map.Entry) i.next(); JRootPane root = (JRootPane) ent.getKey(); Rectangle rect = (Rectangle) ent.getValue(); root.paintImmediately(rect); } }
| 12,410
|
public void paintDirtyRegions() { // step 1: pull out roots and calculate spanning damage HashMap roots = new HashMap(); for (Enumeration e = dirtyComponents.keys(); e.hasMoreElements(); ) { JComponent comp = (JComponent) e.nextElement(); if (! (comp.isVisible() && comp.isShowing())) continue; Rectangle damaged = getDirtyRegion(comp); if (damaged.width == 0 || damaged.height == 0) continue; JRootPane root = comp.getRootPane(); // If the component has no root, no repainting will occur. if (root == null) continue; Rectangle rootDamage = SwingUtilities.convertRectangle(comp, damaged, root); if (! roots.containsKey(root)) { roots.put(root, rootDamage); } else { roots.put(root, ((Rectangle)roots.get(root)).union(rootDamage)); } } dirtyComponents.clear(); // step 2: paint those roots Iterator i = roots.entrySet().iterator(); while(i.hasNext()) { Map.Entry ent = (Map.Entry) i.next(); JRootPane root = (JRootPane) ent.getKey(); Rectangle rect = (Rectangle) ent.getValue(); root.paintImmediately(rect); } }
|
public void paintDirtyRegions() { // step 1: pull out roots and calculate spanning damage HashMap roots = new HashMap(); for (Enumeration e = dirtyComponents.keys(); e.hasMoreElements(); ) { JComponent comp = (JComponent) e.nextElement(); if (! (comp.isVisible() && comp.isShowing())) continue; Rectangle damaged = getDirtyRegion(comp); if (damaged.width == 0 || damaged.height == 0) continue; JRootPane root = comp.getRootPane(); // If the component has no root, no repainting will occur. if (root == null) continue; Rectangle rootDamage = SwingUtilities.convertRectangle(comp, damaged, root); if (! roots.containsKey(root)) { roots.put(root, rootDamage); } else { roots.put(root, ((Rectangle)roots.get(root)).union(rootDamage)); } } dirtyComponents.clear(); // step 2: paint those roots Iterator i = roots.entrySet().iterator(); while(i.hasNext()) { Map.Entry ent = (Map.Entry) i.next(); JRootPane root = (JRootPane) ent.getKey(); Rectangle rect = (Rectangle) ent.getValue(); root.paintImmediately(rect); } }
| 12,411
|
public void paintDirtyRegions() { // step 1: pull out roots and calculate spanning damage HashMap roots = new HashMap(); for (Enumeration e = dirtyComponents.keys(); e.hasMoreElements(); ) { JComponent comp = (JComponent) e.nextElement(); if (! (comp.isVisible() && comp.isShowing())) continue; Rectangle damaged = getDirtyRegion(comp); if (damaged.width == 0 || damaged.height == 0) continue; JRootPane root = comp.getRootPane(); // If the component has no root, no repainting will occur. if (root == null) continue; Rectangle rootDamage = SwingUtilities.convertRectangle(comp, damaged, root); if (! roots.containsKey(root)) { roots.put(root, rootDamage); } else { roots.put(root, ((Rectangle)roots.get(root)).union(rootDamage)); } } dirtyComponents.clear(); // step 2: paint those roots Iterator i = roots.entrySet().iterator(); while(i.hasNext()) { Map.Entry ent = (Map.Entry) i.next(); JRootPane root = (JRootPane) ent.getKey(); Rectangle rect = (Rectangle) ent.getValue(); root.paintImmediately(rect); } }
|
public void paintDirtyRegions() { // step 1: pull out roots and calculate spanning damage HashMap roots = new HashMap(); for (Enumeration e = dirtyComponents.keys(); e.hasMoreElements(); ) { JComponent comp = (JComponent) e.nextElement(); if (! (comp.isVisible() && comp.isShowing())) continue; Rectangle damaged = getDirtyRegion(comp); if (damaged.width == 0 || damaged.height == 0) continue; JRootPane root = comp.getRootPane(); // If the component has no root, no repainting will occur. if (root == null) continue; Rectangle rootDamage = SwingUtilities.convertRectangle(comp, damaged, root); if (! roots.containsKey(root)) { roots.put(root, rootDamage); } else { roots.put(root, ((Rectangle)roots.get(root)).union(rootDamage)); } } dirtyComponents.clear(); // step 2: paint those roots Iterator i = roots.entrySet().iterator(); while(i.hasNext()) { Map.Entry ent = (Map.Entry) i.next(); JRootPane root = (JRootPane) ent.getKey(); Rectangle rect = (Rectangle) ent.getValue(); root.paintImmediately(rect); } }
| 12,412
|
public synchronized void removeInvalidComponent(JComponent component) { invalidComponents.removeElement(component); }
|
public synchronized void removeInvalidComponent(JComponent component) { invalidComponents.remove(component); }
| 12,413
|
public void validateInvalidComponents() { for (Enumeration e = invalidComponents.elements(); e.hasMoreElements(); ) { JComponent comp = (JComponent) e.nextElement(); if (! (comp.isVisible() && comp.isShowing())) continue; comp.validate(); } invalidComponents.clear(); }
|
public void validateInvalidComponents() { synchronized(this) { ArrayList swap = invalidComponents; invalidComponents = workInvalidComponents; workInvalidComponents = swap; } for (Iterator i = workInvalidComponents.iterator(); i.hasNext(); ) { JComponent comp = (JComponent) e.nextElement(); if (! (comp.isVisible() && comp.isShowing())) continue; comp.validate(); } invalidComponents.clear(); }
| 12,414
|
public void validateInvalidComponents() { for (Enumeration e = invalidComponents.elements(); e.hasMoreElements(); ) { JComponent comp = (JComponent) e.nextElement(); if (! (comp.isVisible() && comp.isShowing())) continue; comp.validate(); } invalidComponents.clear(); }
|
public void validateInvalidComponents() { for (Enumeration e = invalidComponents.elements(); e.hasMoreElements(); ) { JComponent comp = (JComponent) i.next(); if (! (comp.isVisible() && comp.isShowing())) continue; comp.validate(); } invalidComponents.clear(); }
| 12,415
|
public void validateInvalidComponents() { for (Enumeration e = invalidComponents.elements(); e.hasMoreElements(); ) { JComponent comp = (JComponent) e.nextElement(); if (! (comp.isVisible() && comp.isShowing())) continue; comp.validate(); } invalidComponents.clear(); }
|
public void validateInvalidComponents() { for (Enumeration e = invalidComponents.elements(); e.hasMoreElements(); ) { JComponent comp = (JComponent) e.nextElement(); if (! (comp.isVisible() && comp.isShowing())) continue; comp.validate(); } workInvalidComponents.clear(); }
| 12,416
|
public void startElement (String qName, AttributeList qAtts) throws SAXException { // These are exceptions from the // first pass; they should be // ignored if there's a second pass, // but reported otherwise. Vector exceptions = null; // If we're not doing Namespace // processing, dispatch this quickly. if (!namespaces) { if (contentHandler != null) { attAdapter.setAttributeList(qAtts); contentHandler.startElement("", "", qName.intern(), attAdapter); } return; } // OK, we're doing Namespace processing. nsSupport.pushContext(); int length = qAtts.getLength(); // First pass: handle NS decls for (int i = 0; i < length; i++) { String attQName = qAtts.getName(i); if (!attQName.startsWith("xmlns")) continue; // Could be a declaration... String prefix; int n = attQName.indexOf(':'); // xmlns=... if (n == -1 && attQName.length () == 5) { prefix = ""; } else if (n != 5) { // XML namespaces spec doesn't discuss "xmlnsf:oo" // (and similarly named) attributes ... at most, warn continue; } else // xmlns:foo=... prefix = attQName.substring(n+1); String value = qAtts.getValue(i); if (!nsSupport.declarePrefix(prefix, value)) { reportError("Illegal Namespace prefix: " + prefix); continue; } if (contentHandler != null) contentHandler.startPrefixMapping(prefix, value); } // Second pass: copy all relevant // attributes into the SAX2 AttributeList // using updated prefix bindings atts.clear(); for (int i = 0; i < length; i++) { String attQName = qAtts.getName(i); String type = qAtts.getType(i); String value = qAtts.getValue(i); // Declaration? if (attQName.startsWith("xmlns")) { String prefix; int n = attQName.indexOf(':'); if (n == -1 && attQName.length () == 5) { prefix = ""; } else if (n != 5) { // XML namespaces spec doesn't discuss "xmlnsf:oo" // (and similarly named) attributes ... ignore prefix = null; } else { prefix = attQName.substring(n+1); } // Yes, decl: report or prune if (prefix != null) { if (prefixes) atts.addAttribute("", "", attQName.intern(), type, value); continue; } } // Not a declaration -- report try { String attName[] = processName(attQName, true, true); atts.addAttribute(attName[0], attName[1], attName[2], type, value); } catch (SAXException e) { if (exceptions == null) exceptions = new Vector(); exceptions.addElement(e); atts.addAttribute("", attQName, attQName, type, value); } } // now handle the deferred exception reports if (exceptions != null && errorHandler != null) { for (int i = 0; i < exceptions.size(); i++) errorHandler.error((SAXParseException) (exceptions.elementAt(i))); } // OK, finally report the event. if (contentHandler != null) { String name[] = processName(qName, false, false); contentHandler.startElement(name[0], name[1], name[2], atts); } }
|
public void startElement (String qName, AttributeList qAtts) throws SAXException { // These are exceptions from the // first pass; they should be // ignored if there's a second pass, // but reported otherwise. Vector exceptions = null; // If we're not doing Namespace // processing, dispatch this quickly. if (!namespaces) { if (contentHandler != null) { attAdapter.setAttributeList(qAtts); contentHandler.startElement("", "", qName.intern(), attAdapter); } return; } // OK, we're doing Namespace processing. nsSupport.pushContext(); int length = qAtts.getLength(); // First pass: handle NS decls for (int i = 0; i < length; i++) { String attQName = qAtts.getName(i); if (!attQName.startsWith("xmlns")) continue; // Could be a declaration... String prefix; int n = attQName.indexOf(':'); // xmlns=... if (n == -1 && attQName.length () == 5) { prefix = ""; } else if (n != 5) { // XML namespaces spec doesn't discuss "xmlnsf:oo" // (and similarly named) attributes ... at most, warn continue; } else // xmlns:foo=... prefix = attQName.substring(6); String value = qAtts.getValue(i); if (!nsSupport.declarePrefix(prefix, value)) { reportError("Illegal Namespace prefix: " + prefix); continue; } if (contentHandler != null) contentHandler.startPrefixMapping(prefix, value); } // Second pass: copy all relevant // attributes into the SAX2 AttributeList // using updated prefix bindings atts.clear(); for (int i = 0; i < length; i++) { String attQName = qAtts.getName(i); String type = qAtts.getType(i); String value = qAtts.getValue(i); // Declaration? if (attQName.startsWith("xmlns")) { String prefix; int n = attQName.indexOf(':'); if (n == -1 && attQName.length () == 5) { prefix = ""; } else if (n != 5) { // XML namespaces spec doesn't discuss "xmlnsf:oo" // (and similarly named) attributes ... ignore prefix = null; } else { prefix = attQName.substring(6); } // Yes, decl: report or prune if (prefix != null) { if (prefixes) atts.addAttribute("", "", attQName.intern(), type, value); continue; } } // Not a declaration -- report try { String attName[] = processName(attQName, true, true); atts.addAttribute(attName[0], attName[1], attName[2], type, value); } catch (SAXException e) { if (exceptions == null) exceptions = new Vector(); exceptions.addElement(e); atts.addAttribute("", attQName, attQName, type, value); } } // now handle the deferred exception reports if (exceptions != null && errorHandler != null) { for (int i = 0; i < exceptions.size(); i++) errorHandler.error((SAXParseException) (exceptions.elementAt(i))); } // OK, finally report the event. if (contentHandler != null) { String name[] = processName(qName, false, false); contentHandler.startElement(name[0], name[1], name[2], atts); } }
| 12,420
|
public void startElement (String qName, AttributeList qAtts) throws SAXException { // These are exceptions from the // first pass; they should be // ignored if there's a second pass, // but reported otherwise. Vector exceptions = null; // If we're not doing Namespace // processing, dispatch this quickly. if (!namespaces) { if (contentHandler != null) { attAdapter.setAttributeList(qAtts); contentHandler.startElement("", "", qName.intern(), attAdapter); } return; } // OK, we're doing Namespace processing. nsSupport.pushContext(); int length = qAtts.getLength(); // First pass: handle NS decls for (int i = 0; i < length; i++) { String attQName = qAtts.getName(i); if (!attQName.startsWith("xmlns")) continue; // Could be a declaration... String prefix; int n = attQName.indexOf(':'); // xmlns=... if (n == -1 && attQName.length () == 5) { prefix = ""; } else if (n != 5) { // XML namespaces spec doesn't discuss "xmlnsf:oo" // (and similarly named) attributes ... at most, warn continue; } else // xmlns:foo=... prefix = attQName.substring(n+1); String value = qAtts.getValue(i); if (!nsSupport.declarePrefix(prefix, value)) { reportError("Illegal Namespace prefix: " + prefix); continue; } if (contentHandler != null) contentHandler.startPrefixMapping(prefix, value); } // Second pass: copy all relevant // attributes into the SAX2 AttributeList // using updated prefix bindings atts.clear(); for (int i = 0; i < length; i++) { String attQName = qAtts.getName(i); String type = qAtts.getType(i); String value = qAtts.getValue(i); // Declaration? if (attQName.startsWith("xmlns")) { String prefix; int n = attQName.indexOf(':'); if (n == -1 && attQName.length () == 5) { prefix = ""; } else if (n != 5) { // XML namespaces spec doesn't discuss "xmlnsf:oo" // (and similarly named) attributes ... ignore prefix = null; } else { prefix = attQName.substring(n+1); } // Yes, decl: report or prune if (prefix != null) { if (prefixes) atts.addAttribute("", "", attQName.intern(), type, value); continue; } } // Not a declaration -- report try { String attName[] = processName(attQName, true, true); atts.addAttribute(attName[0], attName[1], attName[2], type, value); } catch (SAXException e) { if (exceptions == null) exceptions = new Vector(); exceptions.addElement(e); atts.addAttribute("", attQName, attQName, type, value); } } // now handle the deferred exception reports if (exceptions != null && errorHandler != null) { for (int i = 0; i < exceptions.size(); i++) errorHandler.error((SAXParseException) (exceptions.elementAt(i))); } // OK, finally report the event. if (contentHandler != null) { String name[] = processName(qName, false, false); contentHandler.startElement(name[0], name[1], name[2], atts); } }
|
public void startElement (String qName, AttributeList qAtts) throws SAXException { // These are exceptions from the // first pass; they should be // ignored if there's a second pass, // but reported otherwise. Vector exceptions = null; // If we're not doing Namespace // processing, dispatch this quickly. if (!namespaces) { if (contentHandler != null) { attAdapter.setAttributeList(qAtts); contentHandler.startElement("", "", qName.intern(), attAdapter); } return; } // OK, we're doing Namespace processing. nsSupport.pushContext(); int length = qAtts.getLength(); // First pass: handle NS decls for (int i = 0; i < length; i++) { String attQName = qAtts.getName(i); if (!attQName.startsWith("xmlns")) continue; // Could be a declaration... String prefix; int n = attQName.indexOf(':'); // xmlns=... if (n == -1 && attQName.length () == 5) { prefix = ""; } else if (n != 5) { // XML namespaces spec doesn't discuss "xmlnsf:oo" // (and similarly named) attributes ... at most, warn continue; } else // xmlns:foo=... prefix = attQName.substring(n+1); String value = qAtts.getValue(i); if (!nsSupport.declarePrefix(prefix, value)) { reportError("Illegal Namespace prefix: " + prefix); continue; } if (contentHandler != null) contentHandler.startPrefixMapping(prefix, value); } // Second pass: copy all relevant // attributes into the SAX2 AttributeList // using updated prefix bindings atts.clear(); for (int i = 0; i < length; i++) { String attQName = qAtts.getName(i); String type = qAtts.getType(i); String value = qAtts.getValue(i); // Declaration? if (attQName.startsWith("xmlns")) { String prefix; int n = attQName.indexOf(':'); if (n == -1 && attQName.length () == 5) { prefix = ""; } else if (n != 5) { // XML namespaces spec doesn't discuss "xmlnsf:oo" // (and similarly named) attributes ... ignore prefix = null; } else { prefix = attQName.substring(n+1); } // Yes, decl: report or prune if (prefix != null) { if (prefixes) atts.addAttribute("", "", attQName.intern(), type, value); continue; } } // Not a declaration -- report try { String attName[] = processName(attQName, true, true); atts.addAttribute(attName[0], attName[1], attName[2], type, value); } catch (SAXException e) { if (exceptions == null) exceptions = new Vector(); exceptions.addElement(e); atts.addAttribute("", attQName, attQName, type, value); } } // now handle the deferred exception reports if (exceptions != null && errorHandler != null) { for (int i = 0; i < exceptions.size(); i++) errorHandler.error((SAXParseException) (exceptions.elementAt(i))); } // OK, finally report the event. if (contentHandler != null) { String name[] = processName(qName, false, false); contentHandler.startElement(name[0], name[1], name[2], atts); } }
| 12,421
|
final void startApp(final String name, final String className) { try { final Runnable runner = new Runnable() { public void run() { try { final ClassLoader cl = Thread.currentThread().getContextClassLoader(); final Class cls = cl.loadClass(className); final Method main = cls.getMethod("main", mainTypes); final Object[] args = { new String[0] }; main.invoke(null, args); } catch (SecurityException ex) { log.error("Security exception in starting class " + className, ex); } catch (ClassNotFoundException ex) { log.error("Cannot find class " + className); } catch (NoSuchMethodException ex) { log.error("Cannot find main method in " + className); } catch (IllegalAccessException ex) { log.error("Cannot access main method in " + className); } catch (InvocationTargetException ex) { log.error("Error in " + className, ex.getTargetException()); } } }; final Thread t = new Thread(runner); t.start(); } catch (SecurityException ex) { log.error("Security exception in starting class " + className, ex); } }
|
final void startApp(final String name, final String className) { try { final Runnable runner = new Runnable() { public void run() { try { final ClassLoader cl = Thread.currentThread().getContextClassLoader(); final Class<?> cls = cl.loadClass(className); final Method main = cls.getMethod("main", mainTypes); final Object[] args = { new String[0] }; main.invoke(null, args); } catch (SecurityException ex) { log.error("Security exception in starting class " + className, ex); } catch (ClassNotFoundException ex) { log.error("Cannot find class " + className); } catch (NoSuchMethodException ex) { log.error("Cannot find main method in " + className); } catch (IllegalAccessException ex) { log.error("Cannot access main method in " + className); } catch (InvocationTargetException ex) { log.error("Error in " + className, ex.getTargetException()); } } }; final Thread t = new Thread(runner); t.start(); } catch (SecurityException ex) { log.error("Security exception in starting class " + className, ex); } }
| 12,422
|
public void run() { try { final ClassLoader cl = Thread.currentThread().getContextClassLoader(); final Class cls = cl.loadClass(className); final Method main = cls.getMethod("main", mainTypes); final Object[] args = { new String[0] }; main.invoke(null, args); } catch (SecurityException ex) { log.error("Security exception in starting class " + className, ex); } catch (ClassNotFoundException ex) { log.error("Cannot find class " + className); } catch (NoSuchMethodException ex) { log.error("Cannot find main method in " + className); } catch (IllegalAccessException ex) { log.error("Cannot access main method in " + className); } catch (InvocationTargetException ex) { log.error("Error in " + className, ex.getTargetException()); } }
|
public void run() { try { final ClassLoader cl = Thread.currentThread().getContextClassLoader(); final Class<?> cls = cl.loadClass(className); final Method main = cls.getMethod("main", mainTypes); final Object[] args = { new String[0] }; main.invoke(null, args); } catch (SecurityException ex) { log.error("Security exception in starting class " + className, ex); } catch (ClassNotFoundException ex) { log.error("Cannot find class " + className); } catch (NoSuchMethodException ex) { log.error("Cannot find main method in " + className); } catch (IllegalAccessException ex) { log.error("Cannot access main method in " + className); } catch (InvocationTargetException ex) { log.error("Error in " + className, ex.getTargetException()); } }
| 12,423
|
public static Font decode (String fontspec){ String name = null; int style = PLAIN; int size = 12; StringTokenizer st = new StringTokenizer(fontspec, "-"); while (st.hasMoreTokens()) { String token = st.nextToken(); if (name == null) { name = token; continue; } if (token.toUpperCase().equals("BOLD")) { style = BOLD; continue; } if (token.toUpperCase().equals("ITALIC")) { style = ITALIC; continue; } if (token.toUpperCase().equals("BOLDITALIC")) { style = BOLD | ITALIC; continue; } int tokenval = 0; try { tokenval = Integer.parseInt(token); } catch(NumberFormatException e) { ; } if (tokenval != 0) size = tokenval; } HashMap attrs = new HashMap(); ClasspathFontPeer.copyStyleToAttrs (style, attrs); ClasspathFontPeer.copySizeToAttrs (size, attrs); return getFontFromToolkit (name, attrs);}
|
public static Font decode (String fontspec){ String name = null; int style = PLAIN; int size = 12; StringTokenizer st = new StringTokenizer(fontspec, "-"); while (st.hasMoreTokens()) { String token = st.nextToken(); if (name == null) { name = token; continue; } if (token.toUpperCase().equals("BOLD")) { style = BOLD; continue; } if (token.toUpperCase().equals("ITALIC")) { style = ITALIC; continue; } if (token.toUpperCase().equals("BOLDITALIC")) { style = BOLD | ITALIC; continue; } int tokenval = 0; try { tokenval = Integer.parseInt(token); } catch(NumberFormatException e) { } if (tokenval != 0) size = tokenval; } HashMap attrs = new HashMap(); ClasspathFontPeer.copyStyleToAttrs (style, attrs); ClasspathFontPeer.copySizeToAttrs (size, attrs); return getFontFromToolkit (name, attrs);}
| 12,424
|
public UnmarshalException(String s, Exception e) { super(s, e); }
|
public UnmarshalException(String s) { super(s, e); }
| 12,425
|
public UnmarshalException(String s, Exception e) { super(s, e); }
|
public UnmarshalException(String s, Exception e) { super(s); }
| 12,426
|
public static synchronized JarFile get (URL url, boolean useCaches) throws IOException { JarFile jf; if (useCaches) { jf = (JarFile) cache.get (url); if (jf != null) return jf; } if ("file".equals (url.getProtocol())) { File f = new File (url.getFile()); jf = new JarFile (f, true, ZipFile.OPEN_READ); } else { URLConnection urlconn = url.openConnection(); InputStream is = urlconn.getInputStream(); byte[] buf = new byte [READBUFSIZE]; File f = File.createTempFile ("cache", "jar"); FileOutputStream fos = new FileOutputStream (f); int len = 0; while ((len = is.read (buf)) != -1) { fos.write (buf, 0, len); } fos.close(); // Always verify the Manifest, open read only and delete when done. jf = new JarFile (f, true, ZipFile.OPEN_READ | ZipFile.OPEN_DELETE); } if (useCaches) cache.put (url, jf); return jf; }
|
public static synchronized JarFile get (URL url, boolean useCaches) throws IOException { JarFile jf; if (useCaches) { jf = (JarFile) cache.get (url); if (jf != null) return jf; } if ("file".equals (url.getProtocol())) { String fn = url.getFile(); fn = gnu.java.net.protocol.file.Connection.unquote(fn); File f = new File (fn); jf = new JarFile (f, true, ZipFile.OPEN_READ); } else { URLConnection urlconn = url.openConnection(); InputStream is = urlconn.getInputStream(); byte[] buf = new byte [READBUFSIZE]; File f = File.createTempFile ("cache", "jar"); FileOutputStream fos = new FileOutputStream (f); int len = 0; while ((len = is.read (buf)) != -1) { fos.write (buf, 0, len); } fos.close(); // Always verify the Manifest, open read only and delete when done. jf = new JarFile (f, true, ZipFile.OPEN_READ | ZipFile.OPEN_DELETE); } if (useCaches) cache.put (url, jf); return jf; }
| 12,427
|
public INodeTable(Ext2FileSystem fs, int firstBlock) { this.fs = fs; this.firstBlock = firstBlock; blockSize=fs.getSuperblock().getBlockSize(); blockCount = (int)Math.ceil( (double)(fs.getSuperblock().getINodesCount()*INode.INODE_LENGTH) / (double) blockSize); }
|
public INodeTable(Ext2FileSystem fs, int firstBlock) throws IOException { this.fs = fs; this.firstBlock = firstBlock; blockSize=fs.getSuperblock().getBlockSize(); blockCount = (int)Math.ceil( (double)(fs.getSuperblock().getINodesCount()*INode.INODE_LENGTH) / (double) blockSize); }
| 12,428
|
public INodeTable(Ext2FileSystem fs, int firstBlock) { this.fs = fs; this.firstBlock = firstBlock; blockSize=fs.getSuperblock().getBlockSize(); blockCount = (int)Math.ceil( (double)(fs.getSuperblock().getINodesCount()*INode.INODE_LENGTH) / (double) blockSize); }
|
public INodeTable(Ext2FileSystem fs, int firstBlock) { this.fs = fs; this.firstBlock = firstBlock; blockSize=(int)fs.getBlockSize(); blockCount = (int)Math.ceil( (double)(fs.getSuperblock().getINodesCount()*INode.INODE_LENGTH) / (double) blockSize); }
| 12,429
|
public INodeTable(Ext2FileSystem fs, int firstBlock) { this.fs = fs; this.firstBlock = firstBlock; blockSize=fs.getSuperblock().getBlockSize(); blockCount = (int)Math.ceil( (double)(fs.getSuperblock().getINodesCount()*INode.INODE_LENGTH) / (double) blockSize); }
|
public INodeTable(Ext2FileSystem fs, int firstBlock) { this.fs = fs; this.firstBlock = firstBlock; blockSize=fs.getSuperblock().getBlockSize(); blockCount = (int)Math.ceil( (double)(fs.getSuperblock().getINodesPerGroup()*INode.INODE_LENGTH) / (double) blockSize); }
| 12,430
|
public void propertyChange(PropertyChangeEvent e) { JFileChooser filechooser = getFileChooser(); String n = e.getPropertyName(); if (n.equals(JFileChooser.MULTI_SELECTION_ENABLED_CHANGED_PROPERTY)) { int mode = -1; if (filechooser.isMultiSelectionEnabled()) mode = ListSelectionModel.MULTIPLE_INTERVAL_SELECTION; else mode = ListSelectionModel.SINGLE_SELECTION; if (listView) fileList.setSelectionMode(mode); else fileTable.setSelectionMode(mode); } else if (n.equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { File file = filechooser.getSelectedFile(); if (file != null && filechooser.getDialogType() == JFileChooser.SAVE_DIALOG) { if (file.isDirectory() && filechooser.isTraversable(file)) { directoryLabel = look; dirLabel.setText(directoryLabel); filechooser.setApproveButtonText(openButtonText); filechooser.setApproveButtonToolTipText(openButtonToolTipText); } else if (file.isFile()) { directoryLabel = save; dirLabel.setText(directoryLabel); filechooser.setApproveButtonText(saveButtonText); filechooser.setApproveButtonToolTipText(saveButtonToolTipText); } } if (file == null) setFileName(null); else setFileName(file.getName()); int index = -1; index = getModel().indexOf(file); if (index >= 0) { if (listView) { fileList.setSelectedIndex(index); fileList.ensureIndexIsVisible(index); fileList.revalidate(); fileList.repaint(); } else { fileTable.getSelectionModel().addSelectionInterval(index, index); fileTable.scrollRectToVisible(fileTable.getCellRect(index, 0, true)); fileTable.revalidate(); fileTable.repaint(); } } } else if (n.equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { if (listView) { fileList.clearSelection(); fileList.revalidate(); fileList.repaint(); } else { fileTable.clearSelection(); fileTable.revalidate(); fileTable.repaint(); } setDirectorySelected(false); File currentDirectory = filechooser.getCurrentDirectory(); setDirectory(currentDirectory); boolean hasParent = (currentDirectory.getParentFile() != null); getChangeToParentDirectoryAction().setEnabled(hasParent); } else if (n.equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY)) { filterModel.propertyChange(e); } else if (n.equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) { filterModel.propertyChange(e); } else if (n.equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || n.equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); approveButton.setText(getApproveButtonText(filechooser)); approveButton.setToolTipText( getApproveButtonToolTipText(filechooser)); approveButton.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (n.equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) approveButton.setText(getApproveButtonText(filechooser)); else if (n.equals( JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) approveButton.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (n.equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) approveButton.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (n.equals( JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { topPanel.add(controls, BorderLayout.EAST); } else topPanel.remove(controls); topPanel.revalidate(); topPanel.repaint(); topPanel.doLayout(); } else if (n.equals( JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter( getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter( getAcceptAllFileFilter(filechooser)); } else if (n.equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (n.equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || n.equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || n.equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) { // Remove editing component if (fileTable != null) fileTable.removeAll(); if (fileList != null) fileList.removeAll(); startEditing = false; // Set text on button back to original. if (filechooser.getDialogType() == JFileChooser.SAVE_DIALOG) { directoryLabel = save; dirLabel.setText(directoryLabel); filechooser.setApproveButtonText(saveButtonText); filechooser.setApproveButtonToolTipText(saveButtonToolTipText); } rescanCurrentDirectory(filechooser); } filechooser.revalidate(); filechooser.repaint(); }
|
public void propertyChange(PropertyChangeEvent e) { JFileChooser filechooser = getFileChooser(); String n = e.getPropertyName(); if (n.equals(JFileChooser.MULTI_SELECTION_ENABLED_CHANGED_PROPERTY)) { int mode = -1; if (filechooser.isMultiSelectionEnabled()) mode = ListSelectionModel.MULTIPLE_INTERVAL_SELECTION; else mode = ListSelectionModel.SINGLE_SELECTION; if (listView) fileList.setSelectionMode(mode); else fileTable.setSelectionMode(mode); } else if (n.equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { File file = filechooser.getSelectedFile(); if (file != null && filechooser.getDialogType() == JFileChooser.SAVE_DIALOG) { if (file.isDirectory() && filechooser.isTraversable(file)) { directoryLabel = look; dirLabel.setText(directoryLabel); filechooser.setApproveButtonText(openButtonText); filechooser.setApproveButtonToolTipText(openButtonToolTipText); } else if (file.isFile()) { directoryLabel = save; dirLabel.setText(directoryLabel); filechooser.setApproveButtonText(saveButtonText); filechooser.setApproveButtonToolTipText(saveButtonToolTipText); } } if (file == null) setFileName(null); else setFileName(file.getName()); int index = -1; index = getModel().indexOf(file); if (index >= 0) { if (listView) { fileList.setSelectedIndex(index); fileList.ensureIndexIsVisible(index); fileList.revalidate(); fileList.repaint(); } else { fileTable.getSelectionModel().addSelectionInterval(index, index); fileTable.scrollRectToVisible(fileTable.getCellRect(index, 0, true)); fileTable.revalidate(); fileTable.repaint(); } } } else if (n.equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { if (listView) { fileList.clearSelection(); fileList.revalidate(); fileList.repaint(); } else { fileTable.clearSelection(); fileTable.revalidate(); fileTable.repaint(); } setDirectorySelected(false); File currentDirectory = filechooser.getCurrentDirectory(); setDirectory(currentDirectory); boolean hasParent = currentDirectory.getParentFile() != null; getChangeToParentDirectoryAction().setEnabled(hasParent); } else if (n.equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY)) { filterModel.propertyChange(e); } else if (n.equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) { filterModel.propertyChange(e); } else if (n.equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || n.equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); approveButton.setText(getApproveButtonText(filechooser)); approveButton.setToolTipText( getApproveButtonToolTipText(filechooser)); approveButton.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (n.equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) approveButton.setText(getApproveButtonText(filechooser)); else if (n.equals( JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) approveButton.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (n.equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) approveButton.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (n.equals( JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { topPanel.add(controls, BorderLayout.EAST); } else topPanel.remove(controls); topPanel.revalidate(); topPanel.repaint(); topPanel.doLayout(); } else if (n.equals( JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter( getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter( getAcceptAllFileFilter(filechooser)); } else if (n.equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (n.equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || n.equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || n.equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) { // Remove editing component if (fileTable != null) fileTable.removeAll(); if (fileList != null) fileList.removeAll(); startEditing = false; // Set text on button back to original. if (filechooser.getDialogType() == JFileChooser.SAVE_DIALOG) { directoryLabel = save; dirLabel.setText(directoryLabel); filechooser.setApproveButtonText(saveButtonText); filechooser.setApproveButtonToolTipText(saveButtonToolTipText); } rescanCurrentDirectory(filechooser); } filechooser.revalidate(); filechooser.repaint(); }
| 12,432
|
protected int checkHorizontalKey(int key, String exception) { // Verify that key is a legal value for the horizontalAlignment properties. return 0; }
|
protected int checkHorizontalKey(int key, String exception) { // Verify that key is a legal value for the horizontalAlignment properties. return 0; }
| 12,433
|
protected int checkVerticalKey(int key, String exception) { // Ensures that the key is a valid. return 0; }
|
protected int checkVerticalKey(int key, String exception) { // Ensures that the key is a valid. return 0; }
| 12,434
|
protected ActionListener createActionListener() { return new ActionListener() { public void actionPerformed(ActionEvent e) { } }; }
|
protected ActionListener createActionListener() { return new ActionListener() { public void actionPerformed(ActionEvent e) { } }; }
| 12,435
|
public void actionPerformed(ActionEvent e) { }
|
public void actionPerformed(ActionEvent e) { }
| 12,436
|
protected ChangeListener createChangeListener() { // Subclasses that want to handle ChangeEvents differently can override this to return another ChangeListener implementation. return new ChangeListener() { public void stateChanged(ChangeEvent e) { } }; }
|
protected ChangeListener createChangeListener() { // Subclasses that want to handle ChangeEvents differently can override this to return another ChangeListener implementation. return new ChangeListener() { public void stateChanged(ChangeEvent e) { } }; }
| 12,437
|
protected ItemListener createItemListener() { return new ItemListener() { public void itemStateChanged(ItemEvent e) { } }; }
|
protected ItemListener createItemListener() { return new ItemListener() { public void itemStateChanged(ItemEvent e) { } }; }
| 12,438
|
protected void fireActionPerformed(ActionEvent event) { getModel().fireActionPerformed(event); }
|
protected void fireActionPerformed(ActionEvent event) { getModel().fireActionPerformed(event); }
| 12,439
|
protected void fireItemStateChanged(ItemEvent event) { getModel().fireItemStateChanged(event); }
|
protected void fireItemStateChanged(ItemEvent event) { getModel().fireItemStateChanged(event); }
| 12,440
|
protected void fireStateChanged(ChangeEvent event) { getModel().fireStateChanged(event); }
|
protected void fireStateChanged(ChangeEvent event) { getModel().fireStateChanged(event); }
| 12,441
|
public Action getAction() { return action_taken; }
|
public Action getAction() { return action_taken; }
| 12,442
|
public void removeActionListener(ActionListener l) { getModel().removeActionListener(l); }
|
public void removeActionListener(ActionListener l) { getModel().removeActionListener(l); }
| 12,443
|
public void removeItemListener(ItemListener l) { getModel().removeItemListener(l); }
|
public void removeItemListener(ItemListener l) { getModel().removeItemListener(l); }
| 12,444
|
public void setFocusPainted(boolean b) { boolean old = paint_focus; paint_focus = b; firePropertyChange(FOCUS_PAINTED_CHANGED_PROPERTY, old, b); if (hasFocus()) { revalidate(); repaint(); } }
|
public void setFocusPainted(boolean b) { boolean old = paint_focus; paint_focus = b; firePropertyChange(FOCUS_PAINTED_CHANGED_PROPERTY, old, b); if (hasFocus()) { revalidate(); repaint(); } }
| 12,445
|
public void setPressedIcon(Icon pressedIcon) { pressed_button = pressedIcon; revalidate(); repaint(); }
|
public void setPressedIcon(Icon pressedIcon) { pressed_button = pressedIcon; revalidate(); repaint(); }
| 12,446
|
public void setRolloverIcon(Icon rolloverIcon) { // Sets the rollover icon for the button. }
|
public void setRolloverIcon(Icon rolloverIcon) { // Sets the rollover icon for the button. }
| 12,447
|
public void setRolloverSelectedIcon(Icon rolloverSelectedIcon) { // Sets the rollover selected icon for the button. }
|
public void setRolloverSelectedIcon(Icon rolloverSelectedIcon) { // Sets the rollover selected icon for the button. }
| 12,448
|
public void setVerticalAlignment(int alignment) { vert_align = alignment; }
|
public void setVerticalAlignment(int alignment) { vert_align = alignment; }
| 12,449
|
public void setVerticalTextPosition(int textPosition) { vert_text_pos = textPosition; }
|
public void setVerticalTextPosition(int textPosition) { vert_text_pos = textPosition; }
| 12,450
|
protected JComponent createContentPane() { JPanel p = new JPanel(); p.setName(this.getName() + ".contentPane"); p.setLayout(new BorderLayout()); return p; }
|
protected Container createContentPane() { JPanel p = new JPanel(); p.setName(this.getName() + ".contentPane"); p.setLayout(new BorderLayout()); return p; }
| 12,453
|
public boolean isSelected() { return super.isArmed(); }
|
public boolean isSelected() { return super.isSelected(); }
| 12,454
|
public void insert(Component component, int index) { // TODO } // insert()
|
public void insert(Action action, int index) { // TODO } // insert()
| 12,455
|
protected void installDefaults(JComponent c) { c.setOpaque(true); c.setBackground(UIManager.getColor("Viewport.background")); }
|
protected void installDefaults(JComponent c) { c.setOpaque(true); LookAndFeel.installColorsAndFont(c, "Viewport.background", "Viewport.foreground", "Viewport.font"); }
| 12,456
|
public abstract void parse(Reader reader, ParserCallback callback, boolean ignoreCharSet ) throws java.io.IOException;
|
public abstract void parse(Reader reader, ParserCallback callback, boolean ignoreCharSet ) throws IOException;
| 12,457
|
public void addAttribute(Object key, Object value) { super.addAttribute(key.toString().toLowerCase(), value); }
|
public void addAttribute(Object key, Object value) { if (key instanceof String) super.addAttribute(((String) key).toLowerCase(), value); else super.addAttribute(key, value); }
| 12,458
|
public Object getAttribute(Object _key) { Object key = _key.toString().toLowerCase(); Object v = super.getAttribute(key); if (v != null) return v; else if (parent != null) return parent.getAttribute(key); else return null; }
|
public Object getAttribute(Object _key) { Object key = _key.toString().toLowerCase(); v = super.getAttribute(key); if (v != null) return v; else if (parent != null) return parent.getAttribute(key); else return null; }
| 12,459
|
public Object getAttribute(Object _key) { Object key = _key.toString().toLowerCase(); Object v = super.getAttribute(key); if (v != null) return v; else if (parent != null) return parent.getAttribute(key); else return null; }
|
public Object getAttribute(Object _key) { Object key = _key.toString().toLowerCase(); Object v = super.getAttribute(key); if (v != null) return v; key = HTML.getAttributeKey((String) key); v = super.getAttribute(key); if (v != null) return v; if (parent != null) return parent.getAttribute(key); else return null; }
| 12,460
|
public Enumeration getAttributeNames() { // Replace the string keys by HTML.attribute, where applicable final Enumeration enumeration = super.getAttributeNames(); return new Enumeration() { public boolean hasMoreElements() { return enumeration.hasMoreElements(); } public Object nextElement() { Object key = enumeration.nextElement(); HTML.Attribute hKey = HTML.getAttributeKey((String) key); if (hKey != null) return hKey; else return key; } }; }
|
public Enumeration getAttributeNames() { // Replace the string keys by HTML.attribute, where applicable final Enumeration enumeration = super.getAttributeNames(); return new Enumeration() { public boolean hasMoreElements() { return enumeration.hasMoreElements(); } public Object nextElement() { Object key = enumeration.nextElement(); HTML.Attribute hKey = HTML.getAttributeKey((String) key); if (hKey != null) return hKey; } return key; } }; }
| 12,461
|
public Object nextElement() { Object key = enumeration.nextElement(); HTML.Attribute hKey = HTML.getAttributeKey((String) key); if (hKey != null) return hKey; else return key; }
|
public Object nextElement() { Object key = enumeration.nextElement(); HTML.Attribute hKey = HTML.getAttributeKey((String) key); if (hKey != null) return hKey; } return key; }
| 12,462
|
Obj(org.omg.CORBA.Object _object, byte[] _key, Servant _servant, POA _poa) { object = _object; key = _key; servant = _servant; poa = _poa; }
|
Obj(org.omg.CORBA.Object _object, byte[] _key, Servant _servant, gnuPOA _poa) { object = _object; key = _key; servant = _servant; poa = _poa; }
| 12,463
|
public Obj add(org.omg.CORBA.Object object, Servant servant, POA poa) { return add(generateObjectKey(object), object, servant, poa); }
|
public Obj add(org.omg.CORBA.Object object, Servant servant, gnuPOA poa) { return add(generateObjectKey(object), object, servant, poa); }
| 12,464
|
public void keyPressed( KeyEvent evt ) { if (evt.getKeyCode() == KeyEvent.VK_DOWN) { int lead = BasicListUI.this.list.getLeadSelectionIndex(); if (!evt.isShiftDown()) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(lead+1); } else { BasicListUI.this.list.getSelectionModel().setLeadSelectionIndex(lead+1); } } else if (evt.getKeyCode() == KeyEvent.VK_UP) { int lead = BasicListUI.this.list.getLeadSelectionIndex(); if (!evt.isShiftDown()) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(Math.max(lead-1,0)); } else { BasicListUI.this.list.getSelectionModel().setLeadSelectionIndex(Math.max(lead-1,0)); } } }
|
public void keyPressed( KeyEvent evt ) { if (evt.getKeyCode() == KeyEvent.VK_DOWN) { int lead = BasicListUI.this.list.getLeadSelectionIndex(); if (!evt.isShiftDown()) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(Math.min(lead+1,max)); } else { BasicListUI.this.list.getSelectionModel().setLeadSelectionIndex(lead+1); } } else if (evt.getKeyCode() == KeyEvent.VK_UP) { int lead = BasicListUI.this.list.getLeadSelectionIndex(); if (!evt.isShiftDown()) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(Math.max(lead-1,0)); } else { BasicListUI.this.list.getSelectionModel().setLeadSelectionIndex(Math.max(lead-1,0)); } } }
| 12,465
|
public void keyPressed( KeyEvent evt ) { if (evt.getKeyCode() == KeyEvent.VK_DOWN) { int lead = BasicListUI.this.list.getLeadSelectionIndex(); if (!evt.isShiftDown()) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(lead+1); } else { BasicListUI.this.list.getSelectionModel().setLeadSelectionIndex(lead+1); } } else if (evt.getKeyCode() == KeyEvent.VK_UP) { int lead = BasicListUI.this.list.getLeadSelectionIndex(); if (!evt.isShiftDown()) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(Math.max(lead-1,0)); } else { BasicListUI.this.list.getSelectionModel().setLeadSelectionIndex(Math.max(lead-1,0)); } } }
|
public void keyPressed( KeyEvent evt ) { if (evt.getKeyCode() == KeyEvent.VK_DOWN) { int lead = BasicListUI.this.list.getLeadSelectionIndex(); if (!evt.isShiftDown()) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(lead+1); } else { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.min(lead+1,max)); } } else if (evt.getKeyCode() == KeyEvent.VK_UP) { int lead = BasicListUI.this.list.getLeadSelectionIndex(); if (!evt.isShiftDown()) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(Math.max(lead-1,0)); } else { BasicListUI.this.list.getSelectionModel().setLeadSelectionIndex(Math.max(lead-1,0)); } } }
| 12,466
|
public void mouseClicked(MouseEvent event) { Point click = event.getPoint(); int index = BasicListUI.this.locationToIndex(list, click); if (index == -1) return; boolean controlPressed = event.isControlDown(); if (controlPressed) { if (BasicListUI.this.list.getSelectionMode() == ListSelectionModel.SINGLE_SELECTION) BasicListUI.this.list.setSelectedIndex(index); else if (BasicListUI.this.list.isSelectedIndex(index)) BasicListUI.this.list.removeSelectionInterval(index,index); else BasicListUI.this.list.addSelectionInterval(index,index); } else BasicListUI.this.list.setSelectedIndex(index); }
|
public void mouseClicked(MouseEvent event) { Point click = event.getPoint(); int index = BasicListUI.this.locationToIndex(list, click); if (index == -1) return; boolean controlPressed = event.isControlDown(); if (controlPressed) { if (BasicListUI.this.list.getSelectionMode() == ListSelectionModel.SINGLE_SELECTION) BasicListUI.this.list.setSelectedIndex(index); else if (BasicListUI.this.list.isSelectedIndex(index)) BasicListUI.this.list.removeSelectionInterval(index,index); else BasicListUI.this.list.addSelectionInterval(index,index); } else BasicListUI.this.list.setSelectedIndex(index); }
| 12,467
|
void damageLayout() { updateLayoutStateNeeded = 1; if (list != null) list.revalidate(); }
|
void damageLayout() { updateLayoutStateNeeded = 1; if (list != null) list.revalidate(); }
| 12,469
|
public void setElem(int i, int val) { data[i+offset] = (float) val; }
|
public void setElem(int i, int val) { data[i+offset] = val; }
| 12,470
|
private Object[] getProperty(Object o, String prop) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { // Use the event object when the property name to extract is null. if (prop == null) return new Object[] {o, o.getClass()}; // Isolate the first property name from a.b.c. int pos; String rest = null; if ((pos = prop.indexOf('.')) != -1) { rest = prop.substring(pos + 1); prop = prop.substring(0, pos); } // Find a method named getProp. It could be isProp instead. Method getter; try { // Look for boolean property getter isProperty getter = o.getClass().getMethod("is" + capitalize(prop), null); } catch (NoSuchMethodException e) { // Look for regular property getter getProperty getter = o.getClass().getMethod("get" + capitalize(prop), null); } Object val = getter.invoke(o, null); if (rest != null) return getProperty(val, rest); return new Object[] {val, getter.getReturnType()}; }
|
private Object[] getProperty(Object o, String prop) { // Use the event object when the property name to extract is null. if (prop == null) return new Object[] {o, o.getClass()}; // Isolate the first property name from a.b.c. int pos; String rest = null; if ((pos = prop.indexOf('.')) != -1) { rest = prop.substring(pos + 1); prop = prop.substring(0, pos); } // Find a method named getProp. It could be isProp instead. Method getter; try { // Look for boolean property getter isProperty getter = o.getClass().getMethod("is" + capitalize(prop), null); } catch (NoSuchMethodException e) { // Look for regular property getter getProperty getter = o.getClass().getMethod("get" + capitalize(prop), null); } Object val = getter.invoke(o, null); if (rest != null) return getProperty(val, rest); return new Object[] {val, getter.getReturnType()}; }
| 12,472
|
private Object[] getProperty(Object o, String prop) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { // Use the event object when the property name to extract is null. if (prop == null) return new Object[] {o, o.getClass()}; // Isolate the first property name from a.b.c. int pos; String rest = null; if ((pos = prop.indexOf('.')) != -1) { rest = prop.substring(pos + 1); prop = prop.substring(0, pos); } // Find a method named getProp. It could be isProp instead. Method getter; try { // Look for boolean property getter isProperty getter = o.getClass().getMethod("is" + capitalize(prop), null); } catch (NoSuchMethodException e) { // Look for regular property getter getProperty getter = o.getClass().getMethod("get" + capitalize(prop), null); } Object val = getter.invoke(o, null); if (rest != null) return getProperty(val, rest); return new Object[] {val, getter.getReturnType()}; }
|
private Object[] getProperty(Object o, String prop) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { // Use the event object when the property name to extract is null. if (prop == null) return new Object[] {o, o.getClass()}; // Isolate the first property name from a.b.c. int pos; String rest = null; if ((pos = prop.indexOf('.')) != -1) { rest = prop.substring(pos + 1); prop = prop.substring(0, pos); } // Find a method named getProp. It could be isProp instead. Method getter; try { // Look for boolean property getter isProperty getter = o.getClass().getMethod("is" + capitalize(prop), null); } catch (NoSuchMethodException e) { // Look for regular property getter getProperty getter = o.getClass().getMethod("get" + capitalize(prop), null); } Object val = getter.invoke(o, null); if (rest != null) return getProperty(val, rest); return new Object[] {val, getter.getReturnType()}; }
| 12,473
|
private Object[] getProperty(Object o, String prop) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { // Use the event object when the property name to extract is null. if (prop == null) return new Object[] {o, o.getClass()}; // Isolate the first property name from a.b.c. int pos; String rest = null; if ((pos = prop.indexOf('.')) != -1) { rest = prop.substring(pos + 1); prop = prop.substring(0, pos); } // Find a method named getProp. It could be isProp instead. Method getter; try { // Look for boolean property getter isProperty getter = o.getClass().getMethod("is" + capitalize(prop), null); } catch (NoSuchMethodException e) { // Look for regular property getter getProperty getter = o.getClass().getMethod("get" + capitalize(prop), null); } Object val = getter.invoke(o, null); if (rest != null) return getProperty(val, rest); return new Object[] {val, getter.getReturnType()}; }
|
private Object[] getProperty(Object o, String prop) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { // Use the event object when the property name to extract is null. if (prop == null) return new Object[] {o, o.getClass()}; // Isolate the first property name from a.b.c. int pos; String rest = null; if ((pos = prop.indexOf('.')) != -1) { rest = prop.substring(pos + 1); prop = prop.substring(0, pos); } // Find a method named getProp. It could be isProp instead. Method getter; try { // Look for boolean property getter isProperty getter = o.getClass().getMethod("is" + capitalize(prop), null); } catch (NoSuchMethodException nsme1) { // Look for regular property getter getProperty getter = o.getClass().getMethod("get" + capitalize(prop), null); } Object val = getter.invoke(o, null); if (rest != null) return getProperty(val, rest); return new Object[] {val, getter.getReturnType()}; }
| 12,474
|
public Object invoke(Object proxy, Method method, Object[] arguments) throws Exception { // Do we actually need the proxy? if (method == null) throw new RuntimeException("Invoking null method"); // Listener methods that weren't specified are ignored. If listenerMethod // is null, then all listener methods are processed. if (listenerMethod != null && !method.getName().equals(listenerMethod)) return null; // Extract the first arg from arguments and do getProperty on arg if (arguments == null || arguments.length == 0) return null; Object event = arguments[0]; // We hope :-) // Obtain the property XXX propertyType keeps showing up null - why? // because the object inside getProperty changes, but the ref variable // can't change this way, dolt! need a better way to get both values out // - need method and object to do the invoke and get return type Object v[] = getProperty(event, property); Object val = v[0]; Class propertyType = (Class) v[1]; // Find the actual method of target to invoke. We can't do this in the // constructor since we don't know the type of the property we extracted // from the event then. // // action can be either a property or a method. Sun's docs seem to imply // that action should be treated as a property first, and then a method, // but don't specifically say it. // // XXX check what happens with native type wrappers. The better thing to // do is look at the return type of the method Method actionMethod; try { // Look for a property setter for action. actionMethod = target.getClass().getMethod("set" + capitalize(action), new Class[] {propertyType}); } catch (NoSuchMethodException e) { // If action as property didn't work, try as method. try { actionMethod = target.getClass().getMethod(action, new Class[] {propertyType}); } catch (NoSuchMethodException e1) { // When event property is null, we may call action with no args if (property == null) { actionMethod = target.getClass().getMethod(action, null); return actionMethod.invoke(target, null); } else throw e1; } } // Invoke target.action(property) return actionMethod.invoke(target, new Object[] {val}); }
|
public Object invoke(Object proxy, Method method, Object[] arguments) { // Do we actually need the proxy? if (method == null) throw new RuntimeException("Invoking null method"); // Listener methods that weren't specified are ignored. If listenerMethod // is null, then all listener methods are processed. if (listenerMethod != null && !method.getName().equals(listenerMethod)) return null; // Extract the first arg from arguments and do getProperty on arg if (arguments == null || arguments.length == 0) return null; Object event = arguments[0]; // We hope :-) // Obtain the property XXX propertyType keeps showing up null - why? // because the object inside getProperty changes, but the ref variable // can't change this way, dolt! need a better way to get both values out // - need method and object to do the invoke and get return type Object v[] = getProperty(event, property); Object val = v[0]; Class propertyType = (Class) v[1]; // Find the actual method of target to invoke. We can't do this in the // constructor since we don't know the type of the property we extracted // from the event then. // // action can be either a property or a method. Sun's docs seem to imply // that action should be treated as a property first, and then a method, // but don't specifically say it. // // XXX check what happens with native type wrappers. The better thing to // do is look at the return type of the method Method actionMethod; try { // Look for a property setter for action. actionMethod = target.getClass().getMethod("set" + capitalize(action), new Class[] {propertyType}); } catch (NoSuchMethodException e) { // If action as property didn't work, try as method. try { actionMethod = target.getClass().getMethod(action, new Class[] {propertyType}); } catch (NoSuchMethodException e1) { // When event property is null, we may call action with no args if (property == null) { actionMethod = target.getClass().getMethod(action, null); return actionMethod.invoke(target, null); } else throw e1; } } // Invoke target.action(property) return actionMethod.invoke(target, new Object[] {val}); }
| 12,476
|
public Object invoke(Object proxy, Method method, Object[] arguments) throws Exception { // Do we actually need the proxy? if (method == null) throw new RuntimeException("Invoking null method"); // Listener methods that weren't specified are ignored. If listenerMethod // is null, then all listener methods are processed. if (listenerMethod != null && !method.getName().equals(listenerMethod)) return null; // Extract the first arg from arguments and do getProperty on arg if (arguments == null || arguments.length == 0) return null; Object event = arguments[0]; // We hope :-) // Obtain the property XXX propertyType keeps showing up null - why? // because the object inside getProperty changes, but the ref variable // can't change this way, dolt! need a better way to get both values out // - need method and object to do the invoke and get return type Object v[] = getProperty(event, property); Object val = v[0]; Class propertyType = (Class) v[1]; // Find the actual method of target to invoke. We can't do this in the // constructor since we don't know the type of the property we extracted // from the event then. // // action can be either a property or a method. Sun's docs seem to imply // that action should be treated as a property first, and then a method, // but don't specifically say it. // // XXX check what happens with native type wrappers. The better thing to // do is look at the return type of the method Method actionMethod; try { // Look for a property setter for action. actionMethod = target.getClass().getMethod("set" + capitalize(action), new Class[] {propertyType}); } catch (NoSuchMethodException e) { // If action as property didn't work, try as method. try { actionMethod = target.getClass().getMethod(action, new Class[] {propertyType}); } catch (NoSuchMethodException e1) { // When event property is null, we may call action with no args if (property == null) { actionMethod = target.getClass().getMethod(action, null); return actionMethod.invoke(target, null); } else throw e1; } } // Invoke target.action(property) return actionMethod.invoke(target, new Object[] {val}); }
|
public Object invoke(Object proxy, Method method, Object[] arguments) throws Exception { // Do we actually need the proxy? if (method == null) throw new RuntimeException("Invoking null method"); // Listener methods that weren't specified are ignored. If listenerMethod // is null, then all listener methods are processed. if (listenerMethod != null && !method.getName().equals(listenerMethod)) return null; // Extract the first arg from arguments and do getProperty on arg if (arguments == null || arguments.length == 0) return null; Object event = arguments[0]; // We hope :-) // Obtain the property XXX propertyType keeps showing up null - why? // because the object inside getProperty changes, but the ref variable // can't change this way, dolt! need a better way to get both values out // - need method and object to do the invoke and get return type Object v[] = getProperty(event, property); Object val = v[0]; Class propertyType = (Class) v[1]; // Find the actual method of target to invoke. We can't do this in the // constructor since we don't know the type of the property we extracted // from the event then. // // action can be either a property or a method. Sun's docs seem to imply // that action should be treated as a property first, and then a method, // but don't specifically say it. // // XXX check what happens with native type wrappers. The better thing to // do is look at the return type of the method Method actionMethod; try { // Look for a property setter for action. actionMethod = target.getClass().getMethod("set" + capitalize(action), new Class[] {propertyType}); } catch (NoSuchMethodException e) { // If action as property didn't work, try as method. try { actionMethod = target.getClass().getMethod(action, new Class[] {propertyType}); } catch (NoSuchMethodException e1) { // When event property is null, we may call action with no args if (property == null) { actionMethod = target.getClass().getMethod(action, null); return actionMethod.invoke(target, null); } else throw e1; } } // Invoke target.action(property) return actionMethod.invoke(target, new Object[] {val}); }
| 12,477
|
public Object invoke(Object proxy, Method method, Object[] arguments) throws Exception { // Do we actually need the proxy? if (method == null) throw new RuntimeException("Invoking null method"); // Listener methods that weren't specified are ignored. If listenerMethod // is null, then all listener methods are processed. if (listenerMethod != null && !method.getName().equals(listenerMethod)) return null; // Extract the first arg from arguments and do getProperty on arg if (arguments == null || arguments.length == 0) return null; Object event = arguments[0]; // We hope :-) // Obtain the property XXX propertyType keeps showing up null - why? // because the object inside getProperty changes, but the ref variable // can't change this way, dolt! need a better way to get both values out // - need method and object to do the invoke and get return type Object v[] = getProperty(event, property); Object val = v[0]; Class propertyType = (Class) v[1]; // Find the actual method of target to invoke. We can't do this in the // constructor since we don't know the type of the property we extracted // from the event then. // // action can be either a property or a method. Sun's docs seem to imply // that action should be treated as a property first, and then a method, // but don't specifically say it. // // XXX check what happens with native type wrappers. The better thing to // do is look at the return type of the method Method actionMethod; try { // Look for a property setter for action. actionMethod = target.getClass().getMethod("set" + capitalize(action), new Class[] {propertyType}); } catch (NoSuchMethodException e) { // If action as property didn't work, try as method. try { actionMethod = target.getClass().getMethod(action, new Class[] {propertyType}); } catch (NoSuchMethodException e1) { // When event property is null, we may call action with no args if (property == null) { actionMethod = target.getClass().getMethod(action, null); return actionMethod.invoke(target, null); } else throw e1; } } // Invoke target.action(property) return actionMethod.invoke(target, new Object[] {val}); }
|
public Object invoke(Object proxy, Method method, Object[] arguments) throws Exception { // Do we actually need the proxy? if (method == null) throw new RuntimeException("Invoking null method"); // Listener methods that weren't specified are ignored. If listenerMethod // is null, then all listener methods are processed. if (listenerMethod != null && !method.getName().equals(listenerMethod)) return null; // Extract the first arg from arguments and do getProperty on arg if (arguments == null || arguments.length == 0) return null; Object event = arguments[0]; // We hope :-) // Obtain the property XXX propertyType keeps showing up null - why? // because the object inside getProperty changes, but the ref variable // can't change this way, dolt! need a better way to get both values out // - need method and object to do the invoke and get return type Object v[] = getProperty(event, property); Object val = v[0]; Class propertyType = (Class) v[1]; // Find the actual method of target to invoke. We can't do this in the // constructor since we don't know the type of the property we extracted // from the event then. // // action can be either a property or a method. Sun's docs seem to imply // that action should be treated as a property first, and then a method, // but don't specifically say it. // // XXX check what happens with native type wrappers. The better thing to // do is look at the return type of the method Method actionMethod; try { // Look for a property setter for action. actionMethod = target.getClass().getMethod("set" + capitalize(action), new Class[] {propertyType}); } catch (NoSuchMethodException e) { // If action as property didn't work, try as method. try { actionMethod = target.getClass().getMethod(action, new Class[] {propertyType}); } catch (NoSuchMethodException e1) { // When event property is null, we may call action with no args if (property == null) { actionMethod = target.getClass().getMethod(action, null); return actionMethod.invoke(target, null); } else throw e1; } } // Invoke target.action(property) return actionMethod.invoke(target, new Object[] {val}); }
| 12,478
|
public Object invoke(Object proxy, Method method, Object[] arguments) throws Exception { // Do we actually need the proxy? if (method == null) throw new RuntimeException("Invoking null method"); // Listener methods that weren't specified are ignored. If listenerMethod // is null, then all listener methods are processed. if (listenerMethod != null && !method.getName().equals(listenerMethod)) return null; // Extract the first arg from arguments and do getProperty on arg if (arguments == null || arguments.length == 0) return null; Object event = arguments[0]; // We hope :-) // Obtain the property XXX propertyType keeps showing up null - why? // because the object inside getProperty changes, but the ref variable // can't change this way, dolt! need a better way to get both values out // - need method and object to do the invoke and get return type Object v[] = getProperty(event, property); Object val = v[0]; Class propertyType = (Class) v[1]; // Find the actual method of target to invoke. We can't do this in the // constructor since we don't know the type of the property we extracted // from the event then. // // action can be either a property or a method. Sun's docs seem to imply // that action should be treated as a property first, and then a method, // but don't specifically say it. // // XXX check what happens with native type wrappers. The better thing to // do is look at the return type of the method Method actionMethod; try { // Look for a property setter for action. actionMethod = target.getClass().getMethod("set" + capitalize(action), new Class[] {propertyType}); } catch (NoSuchMethodException e) { // If action as property didn't work, try as method. try { actionMethod = target.getClass().getMethod(action, new Class[] {propertyType}); } catch (NoSuchMethodException e1) { // When event property is null, we may call action with no args if (property == null) { actionMethod = target.getClass().getMethod(action, null); return actionMethod.invoke(target, null); } else throw e1; } } // Invoke target.action(property) return actionMethod.invoke(target, new Object[] {val}); }
|
public Object invoke(Object proxy, Method method, Object[] arguments) throws Exception { // Do we actually need the proxy? if (method == null) throw new RuntimeException("Invoking null method"); // Listener methods that weren't specified are ignored. If listenerMethod // is null, then all listener methods are processed. if (listenerMethod != null && !method.getName().equals(listenerMethod)) return null; // Extract the first arg from arguments and do getProperty on arg if (arguments == null || arguments.length == 0) return null; Object event = arguments[0]; // We hope :-) // Obtain the property XXX propertyType keeps showing up null - why? // because the object inside getProperty changes, but the ref variable // can't change this way, dolt! need a better way to get both values out // - need method and object to do the invoke and get return type Object v[] = getProperty(event, property); Object val = v[0]; Class propertyType = (Class) v[1]; // Find the actual method of target to invoke. We can't do this in the // constructor since we don't know the type of the property we extracted // from the event then. // // action can be either a property or a method. Sun's docs seem to imply // that action should be treated as a property first, and then a method, // but don't specifically say it. // // XXX check what happens with native type wrappers. The better thing to // do is look at the return type of the method Method actionMethod; try { // Look for a property setter for action. actionMethod = target.getClass().getMethod("set" + capitalize(action), new Class[] {propertyType}); } catch (NoSuchMethodException e) { // If action as property didn't work, try as method. try { actionMethod = target.getClass().getMethod(action, new Class[] {propertyType}); } catch (NoSuchMethodException e1) { // When event property is null, we may call action with no args if (property == null) { actionMethod = target.getClass().getMethod(action, null); return actionMethod.invoke(target, null); } else throw e1; } } // Invoke target.action(property) return actionMethod.invoke(target, new Object[] {val}); }
| 12,479
|
public Object invoke(Object proxy, Method method, Object[] arguments) throws Exception { // Do we actually need the proxy? if (method == null) throw new RuntimeException("Invoking null method"); // Listener methods that weren't specified are ignored. If listenerMethod // is null, then all listener methods are processed. if (listenerMethod != null && !method.getName().equals(listenerMethod)) return null; // Extract the first arg from arguments and do getProperty on arg if (arguments == null || arguments.length == 0) return null; Object event = arguments[0]; // We hope :-) // Obtain the property XXX propertyType keeps showing up null - why? // because the object inside getProperty changes, but the ref variable // can't change this way, dolt! need a better way to get both values out // - need method and object to do the invoke and get return type Object v[] = getProperty(event, property); Object val = v[0]; Class propertyType = (Class) v[1]; // Find the actual method of target to invoke. We can't do this in the // constructor since we don't know the type of the property we extracted // from the event then. // // action can be either a property or a method. Sun's docs seem to imply // that action should be treated as a property first, and then a method, // but don't specifically say it. // // XXX check what happens with native type wrappers. The better thing to // do is look at the return type of the method Method actionMethod; try { // Look for a property setter for action. actionMethod = target.getClass().getMethod("set" + capitalize(action), new Class[] {propertyType}); } catch (NoSuchMethodException e) { // If action as property didn't work, try as method. try { actionMethod = target.getClass().getMethod(action, new Class[] {propertyType}); } catch (NoSuchMethodException e1) { // When event property is null, we may call action with no args if (property == null) { actionMethod = target.getClass().getMethod(action, null); return actionMethod.invoke(target, null); } else throw e1; } } // Invoke target.action(property) return actionMethod.invoke(target, new Object[] {val}); }
|
public Object invoke(Object proxy, Method method, Object[] arguments) throws Exception { // Do we actually need the proxy? if (method == null) throw new RuntimeException("Invoking null method"); // Listener methods that weren't specified are ignored. If listenerMethod // is null, then all listener methods are processed. if (listenerMethod != null && !method.getName().equals(listenerMethod)) return null; // Extract the first arg from arguments and do getProperty on arg if (arguments == null || arguments.length == 0) return null; Object event = arguments[0]; // We hope :-) // Obtain the property XXX propertyType keeps showing up null - why? // because the object inside getProperty changes, but the ref variable // can't change this way, dolt! need a better way to get both values out // - need method and object to do the invoke and get return type Object v[] = getProperty(event, property); Object val = v[0]; Class propertyType = (Class) v[1]; // Find the actual method of target to invoke. We can't do this in the // constructor since we don't know the type of the property we extracted // from the event then. // // action can be either a property or a method. Sun's docs seem to imply // that action should be treated as a property first, and then a method, // but don't specifically say it. // // XXX check what happens with native type wrappers. The better thing to // do is look at the return type of the method Class[] argTypes = new Class[] { initClass((Class) v[1]) }; while(argTypes[0] != null) { try { // Look for a property setter for action. actionMethod = target.getClass().getMethod("set" + capitalize(action), new Class[] {propertyType}); } catch (NoSuchMethodException e) { // If action as property didn't work, try as method. try { actionMethod = target.getClass().getMethod(action, new Class[] {propertyType}); } catch (NoSuchMethodException e1) { // When event property is null, we may call action with no args if (property == null) { actionMethod = target.getClass().getMethod(action, null); return actionMethod.invoke(target, null); } else throw e1; } } // Invoke target.action(property) return actionMethod.invoke(target, new Object[] {val}); }
| 12,480
|
public Object invoke(Object proxy, Method method, Object[] arguments) throws Exception { // Do we actually need the proxy? if (method == null) throw new RuntimeException("Invoking null method"); // Listener methods that weren't specified are ignored. If listenerMethod // is null, then all listener methods are processed. if (listenerMethod != null && !method.getName().equals(listenerMethod)) return null; // Extract the first arg from arguments and do getProperty on arg if (arguments == null || arguments.length == 0) return null; Object event = arguments[0]; // We hope :-) // Obtain the property XXX propertyType keeps showing up null - why? // because the object inside getProperty changes, but the ref variable // can't change this way, dolt! need a better way to get both values out // - need method and object to do the invoke and get return type Object v[] = getProperty(event, property); Object val = v[0]; Class propertyType = (Class) v[1]; // Find the actual method of target to invoke. We can't do this in the // constructor since we don't know the type of the property we extracted // from the event then. // // action can be either a property or a method. Sun's docs seem to imply // that action should be treated as a property first, and then a method, // but don't specifically say it. // // XXX check what happens with native type wrappers. The better thing to // do is look at the return type of the method Method actionMethod; try { // Look for a property setter for action. actionMethod = target.getClass().getMethod("set" + capitalize(action), new Class[] {propertyType}); } catch (NoSuchMethodException e) { // If action as property didn't work, try as method. try { actionMethod = target.getClass().getMethod(action, new Class[] {propertyType}); } catch (NoSuchMethodException e1) { // When event property is null, we may call action with no args if (property == null) { actionMethod = target.getClass().getMethod(action, null); return actionMethod.invoke(target, null); } else throw e1; } } // Invoke target.action(property) return actionMethod.invoke(target, new Object[] {val}); }
|
public Object invoke(Object proxy, Method method, Object[] arguments) throws Exception { // Do we actually need the proxy? if (method == null) throw new RuntimeException("Invoking null method"); // Listener methods that weren't specified are ignored. If listenerMethod // is null, then all listener methods are processed. if (listenerMethod != null && !method.getName().equals(listenerMethod)) return null; // Extract the first arg from arguments and do getProperty on arg if (arguments == null || arguments.length == 0) return null; Object event = arguments[0]; // We hope :-) // Obtain the property XXX propertyType keeps showing up null - why? // because the object inside getProperty changes, but the ref variable // can't change this way, dolt! need a better way to get both values out // - need method and object to do the invoke and get return type Object v[] = getProperty(event, property); Object val = v[0]; Class propertyType = (Class) v[1]; // Find the actual method of target to invoke. We can't do this in the // constructor since we don't know the type of the property we extracted // from the event then. // // action can be either a property or a method. Sun's docs seem to imply // that action should be treated as a property first, and then a method, // but don't specifically say it. // // XXX check what happens with native type wrappers. The better thing to // do is look at the return type of the method Method actionMethod; try { // Look for a property setter for action. actionMethod = target.getClass().getMethod("set" + capitalize(action), new Class[] {propertyType}); } catch (NoSuchMethodException e) { // If action as property didn't work, try as method. try { actionMethod = target.getClass().getMethod(action, new Class[] {propertyType}); } catch (NoSuchMethodException e1) { // When event property is null, we may call action with no args if (property == null) { actionMethod = target.getClass().getMethod(action, null); return actionMethod.invoke(target, null); } else throw e1; } } // Invoke target.action(property) return actionMethod.invoke(target, new Object[] {val}); }
| 12,481
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.