diff options
Diffstat (limited to 'libjava/classpath/java/lang')
75 files changed, 1788 insertions, 1795 deletions
diff --git a/libjava/classpath/java/lang/AbstractStringBuffer.java b/libjava/classpath/java/lang/AbstractStringBuffer.java index dc3a8c9..242afdc 100644 --- a/libjava/classpath/java/lang/AbstractStringBuffer.java +++ b/libjava/classpath/java/lang/AbstractStringBuffer.java @@ -169,13 +169,13 @@ abstract class AbstractStringBuffer /* If the StringBuffer's value just grew, then we know that value is newly allocated and the region between count and newLength is filled with '\0'. */ - count = newLength; + count = newLength; } else { - /* The StringBuffer's value doesn't need to grow. However, - we should clear out any cruft that may exist. */ - while (count < newLength) + /* The StringBuffer's value doesn't need to grow. However, + we should clear out any cruft that may exist. */ + while (count < newLength) value[count++] = '\0'; } } @@ -244,7 +244,7 @@ abstract class AbstractStringBuffer * @see System#arraycopy(Object, int, Object, int, int) */ public void getChars(int srcOffset, int srcEnd, - char[] dst, int dstOffset) + char[] dst, int dstOffset) { if (srcOffset < 0 || srcEnd > count || srcEnd < srcOffset) throw new StringIndexOutOfBoundsException(); @@ -316,10 +316,10 @@ abstract class AbstractStringBuffer return append("null"); synchronized (stringBuffer) { - int len = stringBuffer.count; - ensureCapacity(count + len); - VMSystem.arraycopy(stringBuffer.value, 0, value, count, len); - count += len; + int len = stringBuffer.count; + ensureCapacity(count + len); + VMSystem.arraycopy(stringBuffer.value, 0, value, count, len); + count += len; } return this; } @@ -420,9 +420,9 @@ abstract class AbstractStringBuffer seq = "null"; if (end - start > 0) { - ensureCapacity_unsynchronized(count + end - start); - for (; start < end; ++start) - value[count++] = seq.charAt(start); + ensureCapacity_unsynchronized(count + end - start); + for (; start < end; ++start) + value[count++] = seq.charAt(start); } return this; } @@ -907,9 +907,9 @@ abstract class AbstractStringBuffer // If we save more than 1/4 of the buffer, shrink. if (wouldSave > 200 || wouldSave * 4 > value.length) { - char[] newValue = new char[count]; - VMSystem.arraycopy(value, 0, newValue, 0, count); - value = newValue; + char[] newValue = new char[count]; + VMSystem.arraycopy(value, 0, newValue, 0, count); + value = newValue; } } @@ -933,23 +933,23 @@ abstract class AbstractStringBuffer int count = 0; while (start < end) { - char base = value[start]; - if (base < Character.MIN_HIGH_SURROGATE - || base > Character.MAX_HIGH_SURROGATE - || start == end - || start == count - || value[start + 1] < Character.MIN_LOW_SURROGATE - || value[start + 1] > Character.MAX_LOW_SURROGATE) - { - // Nothing. - } - else - { - // Surrogate pair. - ++start; - } - ++start; - ++count; + char base = value[start]; + if (base < Character.MIN_HIGH_SURROGATE + || base > Character.MAX_HIGH_SURROGATE + || start == end + || start == count + || value[start + 1] < Character.MIN_LOW_SURROGATE + || value[start + 1] > Character.MAX_LOW_SURROGATE) + { + // Nothing. + } + else + { + // Surrogate pair. + ++start; + } + ++start; + ++count; } return count; } @@ -969,22 +969,22 @@ abstract class AbstractStringBuffer { while (codePoints > 0) { - char base = value[start]; - if (base < Character.MIN_HIGH_SURROGATE - || base > Character.MAX_HIGH_SURROGATE - || start == count - || value[start + 1] < Character.MIN_LOW_SURROGATE - || value[start + 1] > Character.MAX_LOW_SURROGATE) - { - // Nothing. - } - else - { - // Surrogate pair. - ++start; - } - ++start; - --codePoints; + char base = value[start]; + if (base < Character.MIN_HIGH_SURROGATE + || base > Character.MAX_HIGH_SURROGATE + || start == count + || value[start + 1] < Character.MIN_LOW_SURROGATE + || value[start + 1] > Character.MAX_LOW_SURROGATE) + { + // Nothing. + } + else + { + // Surrogate pair. + ++start; + } + ++start; + --codePoints; } return start; } diff --git a/libjava/classpath/java/lang/Boolean.java b/libjava/classpath/java/lang/Boolean.java index 2b0236d..f2eaf41 100644 --- a/libjava/classpath/java/lang/Boolean.java +++ b/libjava/classpath/java/lang/Boolean.java @@ -226,7 +226,7 @@ public final class Boolean implements Serializable, Comparable<Boolean> * Compares this Boolean to another. * * @param other the Boolean to compare this Boolean to - * @return 0 if both Booleans represent the same value, a positive number + * @return 0 if both Booleans represent the same value, a positive number * if this Boolean represents true and the other false, and a negative * number otherwise. * @since 1.5 @@ -247,5 +247,5 @@ public final class Boolean implements Serializable, Comparable<Boolean> { return "true".equalsIgnoreCase(b) ? true : false; } - + } diff --git a/libjava/classpath/java/lang/Character.java b/libjava/classpath/java/lang/Character.java index eaa9557..05e641c 100644 --- a/libjava/classpath/java/lang/Character.java +++ b/libjava/classpath/java/lang/Character.java @@ -168,7 +168,7 @@ public final class Character implements Serializable, Comparable<Character> * standard. */ private UnicodeBlock(int start, int end, String name, - String canonicalName) + String canonicalName) { super(name); this.start = start; @@ -202,8 +202,8 @@ public final class Character implements Serializable, Comparable<Character> public static UnicodeBlock of(int codePoint) { if (codePoint > MAX_CODE_POINT) - throw new IllegalArgumentException("The supplied integer value is " + - "too large to be a codepoint."); + throw new IllegalArgumentException("The supplied integer value is " + + "too large to be a codepoint."); // Simple binary search for the correct block. int low = 0; int hi = sets.length - 1; @@ -278,7 +278,7 @@ public final class Character implements Serializable, Comparable<Character> return SURROGATES_AREA; break; case CONSTANT: - if (usCollator.compare(blockName, "SURROGATES_AREA") == 0) + if (usCollator.compare(blockName, "SURROGATES_AREA") == 0) return SURROGATES_AREA; break; } @@ -292,12 +292,12 @@ public final class Character implements Serializable, Comparable<Character> break; case NO_SPACES: for (UnicodeBlock block : sets) - { - String nsName = block.canonicalName.replaceAll(" ",""); - if (usCollator.compare(blockName, nsName) == 0) - return block; - } - break; + { + String nsName = block.canonicalName.replaceAll(" ",""); + if (usCollator.compare(blockName, nsName) == 0) + return block; + } + break; case CONSTANT: for (UnicodeBlock block : sets) if (usCollator.compare(blockName, block.toString()) == 0) @@ -314,7 +314,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock BASIC_LATIN = new UnicodeBlock(0x0000, 0x007F, - "BASIC_LATIN", + "BASIC_LATIN", "Basic Latin"); /** @@ -323,7 +323,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock LATIN_1_SUPPLEMENT = new UnicodeBlock(0x0080, 0x00FF, - "LATIN_1_SUPPLEMENT", + "LATIN_1_SUPPLEMENT", "Latin-1 Supplement"); /** @@ -332,7 +332,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock LATIN_EXTENDED_A = new UnicodeBlock(0x0100, 0x017F, - "LATIN_EXTENDED_A", + "LATIN_EXTENDED_A", "Latin Extended-A"); /** @@ -341,7 +341,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock LATIN_EXTENDED_B = new UnicodeBlock(0x0180, 0x024F, - "LATIN_EXTENDED_B", + "LATIN_EXTENDED_B", "Latin Extended-B"); /** @@ -350,7 +350,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock IPA_EXTENSIONS = new UnicodeBlock(0x0250, 0x02AF, - "IPA_EXTENSIONS", + "IPA_EXTENSIONS", "IPA Extensions"); /** @@ -359,7 +359,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock SPACING_MODIFIER_LETTERS = new UnicodeBlock(0x02B0, 0x02FF, - "SPACING_MODIFIER_LETTERS", + "SPACING_MODIFIER_LETTERS", "Spacing Modifier Letters"); /** @@ -368,7 +368,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock COMBINING_DIACRITICAL_MARKS = new UnicodeBlock(0x0300, 0x036F, - "COMBINING_DIACRITICAL_MARKS", + "COMBINING_DIACRITICAL_MARKS", "Combining Diacritical Marks"); /** @@ -377,7 +377,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock GREEK = new UnicodeBlock(0x0370, 0x03FF, - "GREEK", + "GREEK", "Greek"); /** @@ -386,7 +386,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock CYRILLIC = new UnicodeBlock(0x0400, 0x04FF, - "CYRILLIC", + "CYRILLIC", "Cyrillic"); /** @@ -396,7 +396,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock CYRILLIC_SUPPLEMENTARY = new UnicodeBlock(0x0500, 0x052F, - "CYRILLIC_SUPPLEMENTARY", + "CYRILLIC_SUPPLEMENTARY", "Cyrillic Supplementary"); /** @@ -405,7 +405,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock ARMENIAN = new UnicodeBlock(0x0530, 0x058F, - "ARMENIAN", + "ARMENIAN", "Armenian"); /** @@ -414,7 +414,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock HEBREW = new UnicodeBlock(0x0590, 0x05FF, - "HEBREW", + "HEBREW", "Hebrew"); /** @@ -423,7 +423,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock ARABIC = new UnicodeBlock(0x0600, 0x06FF, - "ARABIC", + "ARABIC", "Arabic"); /** @@ -433,7 +433,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock SYRIAC = new UnicodeBlock(0x0700, 0x074F, - "SYRIAC", + "SYRIAC", "Syriac"); /** @@ -443,7 +443,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock THAANA = new UnicodeBlock(0x0780, 0x07BF, - "THAANA", + "THAANA", "Thaana"); /** @@ -452,7 +452,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock DEVANAGARI = new UnicodeBlock(0x0900, 0x097F, - "DEVANAGARI", + "DEVANAGARI", "Devanagari"); /** @@ -461,7 +461,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock BENGALI = new UnicodeBlock(0x0980, 0x09FF, - "BENGALI", + "BENGALI", "Bengali"); /** @@ -470,7 +470,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock GURMUKHI = new UnicodeBlock(0x0A00, 0x0A7F, - "GURMUKHI", + "GURMUKHI", "Gurmukhi"); /** @@ -479,7 +479,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock GUJARATI = new UnicodeBlock(0x0A80, 0x0AFF, - "GUJARATI", + "GUJARATI", "Gujarati"); /** @@ -488,7 +488,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock ORIYA = new UnicodeBlock(0x0B00, 0x0B7F, - "ORIYA", + "ORIYA", "Oriya"); /** @@ -497,7 +497,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock TAMIL = new UnicodeBlock(0x0B80, 0x0BFF, - "TAMIL", + "TAMIL", "Tamil"); /** @@ -506,7 +506,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock TELUGU = new UnicodeBlock(0x0C00, 0x0C7F, - "TELUGU", + "TELUGU", "Telugu"); /** @@ -515,7 +515,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock KANNADA = new UnicodeBlock(0x0C80, 0x0CFF, - "KANNADA", + "KANNADA", "Kannada"); /** @@ -524,7 +524,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock MALAYALAM = new UnicodeBlock(0x0D00, 0x0D7F, - "MALAYALAM", + "MALAYALAM", "Malayalam"); /** @@ -534,7 +534,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock SINHALA = new UnicodeBlock(0x0D80, 0x0DFF, - "SINHALA", + "SINHALA", "Sinhala"); /** @@ -543,7 +543,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock THAI = new UnicodeBlock(0x0E00, 0x0E7F, - "THAI", + "THAI", "Thai"); /** @@ -552,7 +552,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock LAO = new UnicodeBlock(0x0E80, 0x0EFF, - "LAO", + "LAO", "Lao"); /** @@ -561,7 +561,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock TIBETAN = new UnicodeBlock(0x0F00, 0x0FFF, - "TIBETAN", + "TIBETAN", "Tibetan"); /** @@ -571,7 +571,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock MYANMAR = new UnicodeBlock(0x1000, 0x109F, - "MYANMAR", + "MYANMAR", "Myanmar"); /** @@ -580,7 +580,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock GEORGIAN = new UnicodeBlock(0x10A0, 0x10FF, - "GEORGIAN", + "GEORGIAN", "Georgian"); /** @@ -589,7 +589,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock HANGUL_JAMO = new UnicodeBlock(0x1100, 0x11FF, - "HANGUL_JAMO", + "HANGUL_JAMO", "Hangul Jamo"); /** @@ -599,7 +599,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock ETHIOPIC = new UnicodeBlock(0x1200, 0x137F, - "ETHIOPIC", + "ETHIOPIC", "Ethiopic"); /** @@ -609,7 +609,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock CHEROKEE = new UnicodeBlock(0x13A0, 0x13FF, - "CHEROKEE", + "CHEROKEE", "Cherokee"); /** @@ -619,7 +619,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS = new UnicodeBlock(0x1400, 0x167F, - "UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS", + "UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS", "Unified Canadian Aboriginal Syllabics"); /** @@ -629,7 +629,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock OGHAM = new UnicodeBlock(0x1680, 0x169F, - "OGHAM", + "OGHAM", "Ogham"); /** @@ -639,7 +639,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock RUNIC = new UnicodeBlock(0x16A0, 0x16FF, - "RUNIC", + "RUNIC", "Runic"); /** @@ -649,7 +649,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock TAGALOG = new UnicodeBlock(0x1700, 0x171F, - "TAGALOG", + "TAGALOG", "Tagalog"); /** @@ -659,7 +659,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock HANUNOO = new UnicodeBlock(0x1720, 0x173F, - "HANUNOO", + "HANUNOO", "Hanunoo"); /** @@ -669,7 +669,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock BUHID = new UnicodeBlock(0x1740, 0x175F, - "BUHID", + "BUHID", "Buhid"); /** @@ -679,7 +679,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock TAGBANWA = new UnicodeBlock(0x1760, 0x177F, - "TAGBANWA", + "TAGBANWA", "Tagbanwa"); /** @@ -689,7 +689,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock KHMER = new UnicodeBlock(0x1780, 0x17FF, - "KHMER", + "KHMER", "Khmer"); /** @@ -699,7 +699,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock MONGOLIAN = new UnicodeBlock(0x1800, 0x18AF, - "MONGOLIAN", + "MONGOLIAN", "Mongolian"); /** @@ -709,7 +709,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock LIMBU = new UnicodeBlock(0x1900, 0x194F, - "LIMBU", + "LIMBU", "Limbu"); /** @@ -719,7 +719,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock TAI_LE = new UnicodeBlock(0x1950, 0x197F, - "TAI_LE", + "TAI_LE", "Tai Le"); /** @@ -729,7 +729,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock KHMER_SYMBOLS = new UnicodeBlock(0x19E0, 0x19FF, - "KHMER_SYMBOLS", + "KHMER_SYMBOLS", "Khmer Symbols"); /** @@ -739,7 +739,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock PHONETIC_EXTENSIONS = new UnicodeBlock(0x1D00, 0x1D7F, - "PHONETIC_EXTENSIONS", + "PHONETIC_EXTENSIONS", "Phonetic Extensions"); /** @@ -748,7 +748,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock LATIN_EXTENDED_ADDITIONAL = new UnicodeBlock(0x1E00, 0x1EFF, - "LATIN_EXTENDED_ADDITIONAL", + "LATIN_EXTENDED_ADDITIONAL", "Latin Extended Additional"); /** @@ -757,7 +757,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock GREEK_EXTENDED = new UnicodeBlock(0x1F00, 0x1FFF, - "GREEK_EXTENDED", + "GREEK_EXTENDED", "Greek Extended"); /** @@ -766,7 +766,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock GENERAL_PUNCTUATION = new UnicodeBlock(0x2000, 0x206F, - "GENERAL_PUNCTUATION", + "GENERAL_PUNCTUATION", "General Punctuation"); /** @@ -775,7 +775,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock SUPERSCRIPTS_AND_SUBSCRIPTS = new UnicodeBlock(0x2070, 0x209F, - "SUPERSCRIPTS_AND_SUBSCRIPTS", + "SUPERSCRIPTS_AND_SUBSCRIPTS", "Superscripts and Subscripts"); /** @@ -784,7 +784,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock CURRENCY_SYMBOLS = new UnicodeBlock(0x20A0, 0x20CF, - "CURRENCY_SYMBOLS", + "CURRENCY_SYMBOLS", "Currency Symbols"); /** @@ -793,7 +793,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock COMBINING_MARKS_FOR_SYMBOLS = new UnicodeBlock(0x20D0, 0x20FF, - "COMBINING_MARKS_FOR_SYMBOLS", + "COMBINING_MARKS_FOR_SYMBOLS", "Combining Marks for Symbols"); /** @@ -802,7 +802,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock LETTERLIKE_SYMBOLS = new UnicodeBlock(0x2100, 0x214F, - "LETTERLIKE_SYMBOLS", + "LETTERLIKE_SYMBOLS", "Letterlike Symbols"); /** @@ -811,7 +811,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock NUMBER_FORMS = new UnicodeBlock(0x2150, 0x218F, - "NUMBER_FORMS", + "NUMBER_FORMS", "Number Forms"); /** @@ -820,7 +820,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock ARROWS = new UnicodeBlock(0x2190, 0x21FF, - "ARROWS", + "ARROWS", "Arrows"); /** @@ -829,7 +829,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock MATHEMATICAL_OPERATORS = new UnicodeBlock(0x2200, 0x22FF, - "MATHEMATICAL_OPERATORS", + "MATHEMATICAL_OPERATORS", "Mathematical Operators"); /** @@ -838,7 +838,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock MISCELLANEOUS_TECHNICAL = new UnicodeBlock(0x2300, 0x23FF, - "MISCELLANEOUS_TECHNICAL", + "MISCELLANEOUS_TECHNICAL", "Miscellaneous Technical"); /** @@ -847,7 +847,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock CONTROL_PICTURES = new UnicodeBlock(0x2400, 0x243F, - "CONTROL_PICTURES", + "CONTROL_PICTURES", "Control Pictures"); /** @@ -856,7 +856,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock OPTICAL_CHARACTER_RECOGNITION = new UnicodeBlock(0x2440, 0x245F, - "OPTICAL_CHARACTER_RECOGNITION", + "OPTICAL_CHARACTER_RECOGNITION", "Optical Character Recognition"); /** @@ -865,7 +865,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock ENCLOSED_ALPHANUMERICS = new UnicodeBlock(0x2460, 0x24FF, - "ENCLOSED_ALPHANUMERICS", + "ENCLOSED_ALPHANUMERICS", "Enclosed Alphanumerics"); /** @@ -874,7 +874,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock BOX_DRAWING = new UnicodeBlock(0x2500, 0x257F, - "BOX_DRAWING", + "BOX_DRAWING", "Box Drawing"); /** @@ -883,7 +883,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock BLOCK_ELEMENTS = new UnicodeBlock(0x2580, 0x259F, - "BLOCK_ELEMENTS", + "BLOCK_ELEMENTS", "Block Elements"); /** @@ -892,7 +892,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock GEOMETRIC_SHAPES = new UnicodeBlock(0x25A0, 0x25FF, - "GEOMETRIC_SHAPES", + "GEOMETRIC_SHAPES", "Geometric Shapes"); /** @@ -901,7 +901,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock MISCELLANEOUS_SYMBOLS = new UnicodeBlock(0x2600, 0x26FF, - "MISCELLANEOUS_SYMBOLS", + "MISCELLANEOUS_SYMBOLS", "Miscellaneous Symbols"); /** @@ -910,7 +910,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock DINGBATS = new UnicodeBlock(0x2700, 0x27BF, - "DINGBATS", + "DINGBATS", "Dingbats"); /** @@ -920,7 +920,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A = new UnicodeBlock(0x27C0, 0x27EF, - "MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A", + "MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A", "Miscellaneous Mathematical Symbols-A"); /** @@ -930,7 +930,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock SUPPLEMENTAL_ARROWS_A = new UnicodeBlock(0x27F0, 0x27FF, - "SUPPLEMENTAL_ARROWS_A", + "SUPPLEMENTAL_ARROWS_A", "Supplemental Arrows-A"); /** @@ -940,7 +940,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock BRAILLE_PATTERNS = new UnicodeBlock(0x2800, 0x28FF, - "BRAILLE_PATTERNS", + "BRAILLE_PATTERNS", "Braille Patterns"); /** @@ -950,7 +950,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock SUPPLEMENTAL_ARROWS_B = new UnicodeBlock(0x2900, 0x297F, - "SUPPLEMENTAL_ARROWS_B", + "SUPPLEMENTAL_ARROWS_B", "Supplemental Arrows-B"); /** @@ -960,7 +960,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B = new UnicodeBlock(0x2980, 0x29FF, - "MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B", + "MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B", "Miscellaneous Mathematical Symbols-B"); /** @@ -970,7 +970,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock SUPPLEMENTAL_MATHEMATICAL_OPERATORS = new UnicodeBlock(0x2A00, 0x2AFF, - "SUPPLEMENTAL_MATHEMATICAL_OPERATORS", + "SUPPLEMENTAL_MATHEMATICAL_OPERATORS", "Supplemental Mathematical Operators"); /** @@ -980,7 +980,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock MISCELLANEOUS_SYMBOLS_AND_ARROWS = new UnicodeBlock(0x2B00, 0x2BFF, - "MISCELLANEOUS_SYMBOLS_AND_ARROWS", + "MISCELLANEOUS_SYMBOLS_AND_ARROWS", "Miscellaneous Symbols and Arrows"); /** @@ -990,7 +990,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock CJK_RADICALS_SUPPLEMENT = new UnicodeBlock(0x2E80, 0x2EFF, - "CJK_RADICALS_SUPPLEMENT", + "CJK_RADICALS_SUPPLEMENT", "CJK Radicals Supplement"); /** @@ -1000,7 +1000,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock KANGXI_RADICALS = new UnicodeBlock(0x2F00, 0x2FDF, - "KANGXI_RADICALS", + "KANGXI_RADICALS", "Kangxi Radicals"); /** @@ -1010,7 +1010,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock IDEOGRAPHIC_DESCRIPTION_CHARACTERS = new UnicodeBlock(0x2FF0, 0x2FFF, - "IDEOGRAPHIC_DESCRIPTION_CHARACTERS", + "IDEOGRAPHIC_DESCRIPTION_CHARACTERS", "Ideographic Description Characters"); /** @@ -1019,7 +1019,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock CJK_SYMBOLS_AND_PUNCTUATION = new UnicodeBlock(0x3000, 0x303F, - "CJK_SYMBOLS_AND_PUNCTUATION", + "CJK_SYMBOLS_AND_PUNCTUATION", "CJK Symbols and Punctuation"); /** @@ -1028,7 +1028,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock HIRAGANA = new UnicodeBlock(0x3040, 0x309F, - "HIRAGANA", + "HIRAGANA", "Hiragana"); /** @@ -1037,7 +1037,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock KATAKANA = new UnicodeBlock(0x30A0, 0x30FF, - "KATAKANA", + "KATAKANA", "Katakana"); /** @@ -1046,7 +1046,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock BOPOMOFO = new UnicodeBlock(0x3100, 0x312F, - "BOPOMOFO", + "BOPOMOFO", "Bopomofo"); /** @@ -1055,7 +1055,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock HANGUL_COMPATIBILITY_JAMO = new UnicodeBlock(0x3130, 0x318F, - "HANGUL_COMPATIBILITY_JAMO", + "HANGUL_COMPATIBILITY_JAMO", "Hangul Compatibility Jamo"); /** @@ -1064,7 +1064,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock KANBUN = new UnicodeBlock(0x3190, 0x319F, - "KANBUN", + "KANBUN", "Kanbun"); /** @@ -1074,7 +1074,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock BOPOMOFO_EXTENDED = new UnicodeBlock(0x31A0, 0x31BF, - "BOPOMOFO_EXTENDED", + "BOPOMOFO_EXTENDED", "Bopomofo Extended"); /** @@ -1084,7 +1084,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock KATAKANA_PHONETIC_EXTENSIONS = new UnicodeBlock(0x31F0, 0x31FF, - "KATAKANA_PHONETIC_EXTENSIONS", + "KATAKANA_PHONETIC_EXTENSIONS", "Katakana Phonetic Extensions"); /** @@ -1093,7 +1093,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock ENCLOSED_CJK_LETTERS_AND_MONTHS = new UnicodeBlock(0x3200, 0x32FF, - "ENCLOSED_CJK_LETTERS_AND_MONTHS", + "ENCLOSED_CJK_LETTERS_AND_MONTHS", "Enclosed CJK Letters and Months"); /** @@ -1102,7 +1102,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock CJK_COMPATIBILITY = new UnicodeBlock(0x3300, 0x33FF, - "CJK_COMPATIBILITY", + "CJK_COMPATIBILITY", "CJK Compatibility"); /** @@ -1112,7 +1112,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A = new UnicodeBlock(0x3400, 0x4DBF, - "CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A", + "CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A", "CJK Unified Ideographs Extension A"); /** @@ -1122,7 +1122,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock YIJING_HEXAGRAM_SYMBOLS = new UnicodeBlock(0x4DC0, 0x4DFF, - "YIJING_HEXAGRAM_SYMBOLS", + "YIJING_HEXAGRAM_SYMBOLS", "Yijing Hexagram Symbols"); /** @@ -1131,7 +1131,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock CJK_UNIFIED_IDEOGRAPHS = new UnicodeBlock(0x4E00, 0x9FFF, - "CJK_UNIFIED_IDEOGRAPHS", + "CJK_UNIFIED_IDEOGRAPHS", "CJK Unified Ideographs"); /** @@ -1141,7 +1141,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock YI_SYLLABLES = new UnicodeBlock(0xA000, 0xA48F, - "YI_SYLLABLES", + "YI_SYLLABLES", "Yi Syllables"); /** @@ -1151,7 +1151,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock YI_RADICALS = new UnicodeBlock(0xA490, 0xA4CF, - "YI_RADICALS", + "YI_RADICALS", "Yi Radicals"); /** @@ -1160,7 +1160,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock HANGUL_SYLLABLES = new UnicodeBlock(0xAC00, 0xD7AF, - "HANGUL_SYLLABLES", + "HANGUL_SYLLABLES", "Hangul Syllables"); /** @@ -1170,7 +1170,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock HIGH_SURROGATES = new UnicodeBlock(0xD800, 0xDB7F, - "HIGH_SURROGATES", + "HIGH_SURROGATES", "High Surrogates"); /** @@ -1180,7 +1180,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock HIGH_PRIVATE_USE_SURROGATES = new UnicodeBlock(0xDB80, 0xDBFF, - "HIGH_PRIVATE_USE_SURROGATES", + "HIGH_PRIVATE_USE_SURROGATES", "High Private Use Surrogates"); /** @@ -1190,7 +1190,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock LOW_SURROGATES = new UnicodeBlock(0xDC00, 0xDFFF, - "LOW_SURROGATES", + "LOW_SURROGATES", "Low Surrogates"); /** @@ -1199,7 +1199,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock PRIVATE_USE_AREA = new UnicodeBlock(0xE000, 0xF8FF, - "PRIVATE_USE_AREA", + "PRIVATE_USE_AREA", "Private Use Area"); /** @@ -1208,7 +1208,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock CJK_COMPATIBILITY_IDEOGRAPHS = new UnicodeBlock(0xF900, 0xFAFF, - "CJK_COMPATIBILITY_IDEOGRAPHS", + "CJK_COMPATIBILITY_IDEOGRAPHS", "CJK Compatibility Ideographs"); /** @@ -1217,7 +1217,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock ALPHABETIC_PRESENTATION_FORMS = new UnicodeBlock(0xFB00, 0xFB4F, - "ALPHABETIC_PRESENTATION_FORMS", + "ALPHABETIC_PRESENTATION_FORMS", "Alphabetic Presentation Forms"); /** @@ -1226,7 +1226,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock ARABIC_PRESENTATION_FORMS_A = new UnicodeBlock(0xFB50, 0xFDFF, - "ARABIC_PRESENTATION_FORMS_A", + "ARABIC_PRESENTATION_FORMS_A", "Arabic Presentation Forms-A"); /** @@ -1236,7 +1236,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock VARIATION_SELECTORS = new UnicodeBlock(0xFE00, 0xFE0F, - "VARIATION_SELECTORS", + "VARIATION_SELECTORS", "Variation Selectors"); /** @@ -1245,7 +1245,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock COMBINING_HALF_MARKS = new UnicodeBlock(0xFE20, 0xFE2F, - "COMBINING_HALF_MARKS", + "COMBINING_HALF_MARKS", "Combining Half Marks"); /** @@ -1254,7 +1254,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock CJK_COMPATIBILITY_FORMS = new UnicodeBlock(0xFE30, 0xFE4F, - "CJK_COMPATIBILITY_FORMS", + "CJK_COMPATIBILITY_FORMS", "CJK Compatibility Forms"); /** @@ -1263,7 +1263,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock SMALL_FORM_VARIANTS = new UnicodeBlock(0xFE50, 0xFE6F, - "SMALL_FORM_VARIANTS", + "SMALL_FORM_VARIANTS", "Small Form Variants"); /** @@ -1272,7 +1272,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock ARABIC_PRESENTATION_FORMS_B = new UnicodeBlock(0xFE70, 0xFEFF, - "ARABIC_PRESENTATION_FORMS_B", + "ARABIC_PRESENTATION_FORMS_B", "Arabic Presentation Forms-B"); /** @@ -1281,7 +1281,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock HALFWIDTH_AND_FULLWIDTH_FORMS = new UnicodeBlock(0xFF00, 0xFFEF, - "HALFWIDTH_AND_FULLWIDTH_FORMS", + "HALFWIDTH_AND_FULLWIDTH_FORMS", "Halfwidth and Fullwidth Forms"); /** @@ -1290,7 +1290,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock SPECIALS = new UnicodeBlock(0xFFF0, 0xFFFF, - "SPECIALS", + "SPECIALS", "Specials"); /** @@ -1300,7 +1300,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock LINEAR_B_SYLLABARY = new UnicodeBlock(0x10000, 0x1007F, - "LINEAR_B_SYLLABARY", + "LINEAR_B_SYLLABARY", "Linear B Syllabary"); /** @@ -1310,7 +1310,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock LINEAR_B_IDEOGRAMS = new UnicodeBlock(0x10080, 0x100FF, - "LINEAR_B_IDEOGRAMS", + "LINEAR_B_IDEOGRAMS", "Linear B Ideograms"); /** @@ -1320,7 +1320,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock AEGEAN_NUMBERS = new UnicodeBlock(0x10100, 0x1013F, - "AEGEAN_NUMBERS", + "AEGEAN_NUMBERS", "Aegean Numbers"); /** @@ -1330,7 +1330,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock OLD_ITALIC = new UnicodeBlock(0x10300, 0x1032F, - "OLD_ITALIC", + "OLD_ITALIC", "Old Italic"); /** @@ -1340,7 +1340,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock GOTHIC = new UnicodeBlock(0x10330, 0x1034F, - "GOTHIC", + "GOTHIC", "Gothic"); /** @@ -1350,7 +1350,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock UGARITIC = new UnicodeBlock(0x10380, 0x1039F, - "UGARITIC", + "UGARITIC", "Ugaritic"); /** @@ -1360,7 +1360,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock DESERET = new UnicodeBlock(0x10400, 0x1044F, - "DESERET", + "DESERET", "Deseret"); /** @@ -1370,7 +1370,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock SHAVIAN = new UnicodeBlock(0x10450, 0x1047F, - "SHAVIAN", + "SHAVIAN", "Shavian"); /** @@ -1380,7 +1380,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock OSMANYA = new UnicodeBlock(0x10480, 0x104AF, - "OSMANYA", + "OSMANYA", "Osmanya"); /** @@ -1390,7 +1390,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock CYPRIOT_SYLLABARY = new UnicodeBlock(0x10800, 0x1083F, - "CYPRIOT_SYLLABARY", + "CYPRIOT_SYLLABARY", "Cypriot Syllabary"); /** @@ -1400,7 +1400,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock BYZANTINE_MUSICAL_SYMBOLS = new UnicodeBlock(0x1D000, 0x1D0FF, - "BYZANTINE_MUSICAL_SYMBOLS", + "BYZANTINE_MUSICAL_SYMBOLS", "Byzantine Musical Symbols"); /** @@ -1410,7 +1410,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock MUSICAL_SYMBOLS = new UnicodeBlock(0x1D100, 0x1D1FF, - "MUSICAL_SYMBOLS", + "MUSICAL_SYMBOLS", "Musical Symbols"); /** @@ -1420,7 +1420,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock TAI_XUAN_JING_SYMBOLS = new UnicodeBlock(0x1D300, 0x1D35F, - "TAI_XUAN_JING_SYMBOLS", + "TAI_XUAN_JING_SYMBOLS", "Tai Xuan Jing Symbols"); /** @@ -1430,7 +1430,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock MATHEMATICAL_ALPHANUMERIC_SYMBOLS = new UnicodeBlock(0x1D400, 0x1D7FF, - "MATHEMATICAL_ALPHANUMERIC_SYMBOLS", + "MATHEMATICAL_ALPHANUMERIC_SYMBOLS", "Mathematical Alphanumeric Symbols"); /** @@ -1440,7 +1440,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B = new UnicodeBlock(0x20000, 0x2A6DF, - "CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B", + "CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B", "CJK Unified Ideographs Extension B"); /** @@ -1450,7 +1450,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT = new UnicodeBlock(0x2F800, 0x2FA1F, - "CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT", + "CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT", "CJK Compatibility Ideographs Supplement"); /** @@ -1460,7 +1460,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock TAGS = new UnicodeBlock(0xE0000, 0xE007F, - "TAGS", + "TAGS", "Tags"); /** @@ -1470,7 +1470,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock VARIATION_SELECTORS_SUPPLEMENT = new UnicodeBlock(0xE0100, 0xE01EF, - "VARIATION_SELECTORS_SUPPLEMENT", + "VARIATION_SELECTORS_SUPPLEMENT", "Variation Selectors Supplement"); /** @@ -1480,7 +1480,7 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock SUPPLEMENTARY_PRIVATE_USE_AREA_A = new UnicodeBlock(0xF0000, 0xFFFFF, - "SUPPLEMENTARY_PRIVATE_USE_AREA_A", + "SUPPLEMENTARY_PRIVATE_USE_AREA_A", "Supplementary Private Use Area-A"); /** @@ -1490,13 +1490,13 @@ public final class Character implements Serializable, Comparable<Character> */ public static final UnicodeBlock SUPPLEMENTARY_PRIVATE_USE_AREA_B = new UnicodeBlock(0x100000, 0x10FFFF, - "SUPPLEMENTARY_PRIVATE_USE_AREA_B", + "SUPPLEMENTARY_PRIVATE_USE_AREA_B", "Supplementary Private Use Area-B"); /** * Surrogates Area. * 'D800' - 'DFFF'. - * @deprecated As of 1.5, the three areas, + * @deprecated As of 1.5, the three areas, * <a href="#HIGH_SURROGATES">HIGH_SURROGATES</a>, * <a href="#HIGH_PRIVATE_USE_SURROGATES">HIGH_PRIVATE_USE_SURROGATES</a> * and <a href="#LOW_SURROGATES">LOW_SURROGATES</a>, as defined @@ -1508,7 +1508,7 @@ public final class Character implements Serializable, Comparable<Character> public static final UnicodeBlock SURROGATES_AREA = new UnicodeBlock(0xD800, 0xDFFF, "SURROGATES_AREA", - "Surrogates Area"); + "Surrogates Area"); /** * The defined subsets. @@ -1643,9 +1643,9 @@ public final class Character implements Serializable, Comparable<Character> } // class UnicodeBlock /** - * A class to encompass all the properties of characters in the + * A class to encompass all the properties of characters in the * private use blocks in the Unicode standard. This class extends - * UnassignedCharacters because the return type from getType() is + * UnassignedCharacters because the return type from getType() is * different. * @author Anthony Balkissoon abalkiss at redhat dot com * @@ -1657,25 +1657,25 @@ public final class Character implements Serializable, Comparable<Character> */ static int getType(int cp) { - // The upper 2 code points in any plane are considered unassigned, + // The upper 2 code points in any plane are considered unassigned, // even in the private-use planes. if ((cp & 0xffff) >= 0xfffe) return UnassignedCharacters.getType(cp); return PRIVATE_USE; } - + /** * Returns true if the character cp is defined. */ static boolean isDefined(int cp) { - // The upper 2 code points in any plane are considered unassigned, + // The upper 2 code points in any plane are considered unassigned, // even in the private-use planes. if ((cp & 0xffff) >= 0xfffe) return UnassignedCharacters.isDefined(cp); return true; } - + /** * Gets the directionality for the character cp. */ @@ -1686,9 +1686,9 @@ public final class Character implements Serializable, Comparable<Character> return DIRECTIONALITY_LEFT_TO_RIGHT; } } - + /** - * A class to encompass all the properties of code points that are + * A class to encompass all the properties of code points that are * currently undefined in the Unicode standard. * @author Anthony Balkissoon abalkiss at redhat dot com * @@ -1707,7 +1707,7 @@ public final class Character implements Serializable, Comparable<Character> } /** - * Returns the Unicode directionality property for unassigned + * Returns the Unicode directionality property for unassigned * characters. * @param cp the character * @return DIRECTIONALITY_UNDEFINED @@ -1736,9 +1736,9 @@ public final class Character implements Serializable, Comparable<Character> { return UNASSIGNED; } - + /** - * Returns false to indiciate that the character is not defined in the + * Returns false to indiciate that the character is not defined in the * Unicode standard. * @param cp the character * @return false @@ -1759,7 +1759,7 @@ public final class Character implements Serializable, Comparable<Character> } /** - * Returns false to indicate that the character cannot be ignored + * Returns false to indicate that the character cannot be ignored * within an identifier * @param cp the character * @return false @@ -1770,7 +1770,7 @@ public final class Character implements Serializable, Comparable<Character> } /** - * Returns false to indicate that the character cannot be part of a + * Returns false to indicate that the character cannot be part of a * Java identifier. * @param cp the character * @return false @@ -1781,7 +1781,7 @@ public final class Character implements Serializable, Comparable<Character> } /** - * Returns false to indicate that the character cannot be start a + * Returns false to indicate that the character cannot be start a * Java identifier. * @param cp the character * @return false @@ -1821,7 +1821,7 @@ public final class Character implements Serializable, Comparable<Character> { return false; } - + /** * Returns false to indicate that the character cannot is not mirrored. * @param cp the character @@ -1841,7 +1841,7 @@ public final class Character implements Serializable, Comparable<Character> { return false; } - + /** * Returns false to indicate that the character it not a titlecase letter. * @param cp the character @@ -1851,9 +1851,9 @@ public final class Character implements Serializable, Comparable<Character> { return false; } - + /** - * Returns false to indicate that the character cannot be part of a + * Returns false to indicate that the character cannot be part of a * Unicode identifier. * @param cp the character * @return false @@ -1864,7 +1864,7 @@ public final class Character implements Serializable, Comparable<Character> } /** - * Returns false to indicate that the character cannot start a + * Returns false to indicate that the character cannot start a * Unicode identifier. * @param cp the character * @return false @@ -1904,7 +1904,7 @@ public final class Character implements Serializable, Comparable<Character> { return cp; } - + /** * Returns cp to indicate this character has no titlecase conversion. * @param cp the character @@ -1923,7 +1923,7 @@ public final class Character implements Serializable, Comparable<Character> static int toUpperCase(int cp) { return cp; - } + } } /** @@ -2014,7 +2014,7 @@ public final class Character implements Serializable, Comparable<Character> * This value is <code>'\uDFFF'</code>. * @since 1.5 */ - public static final char MAX_LOW_SURROGATE = '\uDFFF'; + public static final char MAX_LOW_SURROGATE = '\uDFFF'; /** * The minimum Unicode surrogate code unit in the UTF-16 character encoding. @@ -2034,7 +2034,7 @@ public final class Character implements Serializable, Comparable<Character> * The lowest possible supplementary Unicode code point (the first code * point outside the basic multilingual plane (BMP)). * This value is <code>0x10000</code>. - */ + */ public static final int MIN_SUPPLEMENTARY_CODE_POINT = 0x10000; /** @@ -2418,7 +2418,7 @@ public final class Character implements Serializable, Comparable<Character> * @see #readCodePoint(int) * @see CharData#BLOCKS */ - private static final char[][] blocks = + private static final char[][] blocks = new char[][]{ String.zeroBasedStringValue(CharData.BLOCKS[0]), String.zeroBasedStringValue(CharData.BLOCKS[1]), @@ -2443,7 +2443,7 @@ public final class Character implements Serializable, Comparable<Character> * of String.value to avoid copying the array. * @see CharData#DATA */ - private static final char[][] data = + private static final char[][] data = new char[][]{ String.zeroBasedStringValue(CharData.DATA[0]), String.zeroBasedStringValue(CharData.DATA[1]), @@ -2468,7 +2468,7 @@ public final class Character implements Serializable, Comparable<Character> * of String.value to avoid copying the array. * @see CharData#NUM_VALUE */ - private static final char[][] numValue = + private static final char[][] numValue = new char[][]{ String.zeroBasedStringValue(CharData.NUM_VALUE[0]), String.zeroBasedStringValue(CharData.NUM_VALUE[1]), @@ -2492,8 +2492,8 @@ public final class Character implements Serializable, Comparable<Character> * Stores unicode uppercase attribute table. Exploit package visibility * of String.value to avoid copying the array. * @see CharData#UPPER - */ - private static final char[][] upper = + */ + private static final char[][] upper = new char[][]{ String.zeroBasedStringValue(CharData.UPPER[0]), String.zeroBasedStringValue(CharData.UPPER[1]), @@ -2518,7 +2518,7 @@ public final class Character implements Serializable, Comparable<Character> * of String.value to avoid copying the array. * @see CharData#LOWER */ - private static final char[][] lower = + private static final char[][] lower = new char[][]{ String.zeroBasedStringValue(CharData.LOWER[0]), String.zeroBasedStringValue(CharData.LOWER[1]), @@ -2544,7 +2544,7 @@ public final class Character implements Serializable, Comparable<Character> * @see CharData#DIRECTION */ // Package visible for use by String. - static final char[][] direction = + static final char[][] direction = new char[][]{ String.zeroBasedStringValue(CharData.DIRECTION[0]), String.zeroBasedStringValue(CharData.DIRECTION[1]), @@ -2569,7 +2569,7 @@ public final class Character implements Serializable, Comparable<Character> * String.value to avoid copying the array. * @see CharData#TITLE */ - private static final char[] title = String.zeroBasedStringValue(CharData.TITLE); + private static final char[] title = String.zeroBasedStringValue(CharData.TITLE); /** * Mask for grabbing the type out of the contents of data. @@ -2698,7 +2698,7 @@ public final class Character implements Serializable, Comparable<Character> { return isLowerCase((int)ch); } - + /** * Determines if a character is a Unicode lowercase letter. For example, * <code>'a'</code> is lowercase. Returns true if getType() returns @@ -2712,7 +2712,7 @@ public final class Character implements Serializable, Comparable<Character> * @see #isTitleCase(char) * @see #toLowerCase(char) * @see #getType(char) - * + * * @since 1.5 */ public static boolean isLowerCase(int codePoint) @@ -2738,7 +2738,7 @@ public final class Character implements Serializable, Comparable<Character> { return isUpperCase((int)ch); } - + /** * Determines if a character is a Unicode uppercase letter. For example, * <code>'A'</code> is uppercase. Returns true if getType() returns @@ -2752,7 +2752,7 @@ public final class Character implements Serializable, Comparable<Character> * @see #isTitleCase(char) * @see #toUpperCase(char) * @see #getType(char) - * + * * @since 1.5 */ public static boolean isUpperCase(int codePoint) @@ -2792,14 +2792,14 @@ public final class Character implements Serializable, Comparable<Character> * @see #isUpperCase(char) * @see #toTitleCase(char) * @see #getType(char) - * + * * @since 1.5 */ public static boolean isTitleCase(int codePoint) { return getType(codePoint) == TITLECASE_LETTER; } - + /** * Determines if a character is a Unicode decimal digit. For example, @@ -2818,7 +2818,7 @@ public final class Character implements Serializable, Comparable<Character> { return isDigit((int)ch); } - + /** * Determines if a character is a Unicode decimal digit. For example, * <code>'0'</code> is a digit. A character is a Unicode digit if @@ -2831,7 +2831,7 @@ public final class Character implements Serializable, Comparable<Character> * @see #digit(char, int) * @see #forDigit(int, int) * @see #getType(char) - * + * * @since 1.5 */ @@ -2859,7 +2859,7 @@ public final class Character implements Serializable, Comparable<Character> { return isDefined((int)ch); } - + /** * Determines if a character is part of the Unicode Standard. This is an * evolving standard, but covers every character in the data file. @@ -2874,7 +2874,7 @@ public final class Character implements Serializable, Comparable<Character> * @see #isLowerCase(char) * @see #isTitleCase(char) * @see #isUpperCase(char) - * + * * @since 1.5 */ public static boolean isDefined(int codePoint) @@ -2885,7 +2885,7 @@ public final class Character implements Serializable, Comparable<Character> /** * Determines if a character is a Unicode letter. Not all letters have case, * so this may return true when isLowerCase and isUpperCase return false. - * A character is a Unicode letter if getType() returns one of + * A character is a Unicode letter if getType() returns one of * UPPERCASE_LETTER, LOWERCASE_LETTER, TITLECASE_LETTER, MODIFIER_LETTER, * or OTHER_LETTER. * <br> @@ -2907,11 +2907,11 @@ public final class Character implements Serializable, Comparable<Character> { return isLetter((int)ch); } - + /** * Determines if a character is a Unicode letter. Not all letters have case, * so this may return true when isLowerCase and isUpperCase return false. - * A character is a Unicode letter if getType() returns one of + * A character is a Unicode letter if getType() returns one of * UPPERCASE_LETTER, LOWERCASE_LETTER, TITLECASE_LETTER, MODIFIER_LETTER, * or OTHER_LETTER. * <br> @@ -2928,7 +2928,7 @@ public final class Character implements Serializable, Comparable<Character> * @see #isTitleCase(char) * @see #isUnicodeIdentifierStart(char) * @see #isUpperCase(char) - * + * * @since 1.5 */ public static boolean isLetter(int codePoint) @@ -2947,17 +2947,17 @@ public final class Character implements Serializable, Comparable<Character> * @param index the start position in the CharSequence * @param codePointOffset the number of code points offset from the start * position - * @return the index into the CharSequence that is codePointOffset code + * @return the index into the CharSequence that is codePointOffset code * points offset from index - * + * * @throws NullPointerException if seq is null * @throws IndexOutOfBoundsException if index is negative or greater than the * length of the sequence. - * @throws IndexOutOfBoundsException if codePointOffset is positive and the + * @throws IndexOutOfBoundsException if codePointOffset is positive and the * subsequence from index to the end of seq has fewer than codePointOffset * code points * @throws IndexOutOfBoundsException if codePointOffset is negative and the - * subsequence from the start of seq to index has fewer than + * subsequence from the start of seq to index has fewer than * (-codePointOffset) code points * @since 1.5 */ @@ -2968,7 +2968,7 @@ public final class Character implements Serializable, Comparable<Character> int len = seq.length(); if (index < 0 || index > len) throw new IndexOutOfBoundsException(); - + int numToGo = codePointOffset; int offset = index; int adjust = 1; @@ -2999,7 +2999,7 @@ public final class Character implements Serializable, Comparable<Character> return offset; } } - + /** * Returns the index into the given char subarray that is offset * <code>codePointOffset</code> code points from <code>index</code>. @@ -3010,11 +3010,11 @@ public final class Character implements Serializable, Comparable<Character> * @param codePointOffset the number of code points offset from <code>index * </code> * @return the index into the char array - * + * * @throws NullPointerException if a is null * @throws IndexOutOfBoundsException if start or count is negative or if * start + count is greater than the length of the array - * @throws IndexOutOfBoundsException if index is less than start or larger + * @throws IndexOutOfBoundsException if index is less than start or larger * than start + count * @throws IndexOutOfBoundsException if codePointOffset is positive and the * subarray from index to start + count - 1 has fewer than codePointOffset @@ -3022,7 +3022,7 @@ public final class Character implements Serializable, Comparable<Character> * @throws IndexOutOfBoundsException if codePointOffset is negative and the * subarray from start to index - 1 has fewer than (-codePointOffset) code * points - * + * * @since 1.5 */ public static int offsetByCodePoints(char[] a, @@ -3035,7 +3035,7 @@ public final class Character implements Serializable, Comparable<Character> int end = start + count; if (start < 0 || count < 0 || end > len || index < start || index > end) throw new IndexOutOfBoundsException(); - + int numToGo = codePointOffset; int offset = index; int adjust = 1; @@ -3069,18 +3069,18 @@ public final class Character implements Serializable, Comparable<Character> } } - + /** * Returns the number of Unicode code points in the specified range of the * given CharSequence. The first char in the range is at position - * beginIndex and the last one is at position endIndex - 1. Paired - * surrogates (supplementary characters are represented by a pair of chars - - * one from the high surrogates and one from the low surrogates) + * beginIndex and the last one is at position endIndex - 1. Paired + * surrogates (supplementary characters are represented by a pair of chars - + * one from the high surrogates and one from the low surrogates) * count as just one code point. * @param seq the CharSequence to inspect * @param beginIndex the beginning of the range * @param endIndex the end of the range - * @return the number of Unicode code points in the given range of the + * @return the number of Unicode code points in the given range of the * sequence * @throws NullPointerException if seq is null * @throws IndexOutOfBoundsException if beginIndex is negative, endIndex is @@ -3093,7 +3093,7 @@ public final class Character implements Serializable, Comparable<Character> int len = seq.length(); if (beginIndex < 0 || endIndex > len || beginIndex > endIndex) throw new IndexOutOfBoundsException(); - + int count = 0; for (int i = beginIndex; i < endIndex; i++) { @@ -3102,24 +3102,24 @@ public final class Character implements Serializable, Comparable<Character> if (isHighSurrogate(seq.charAt(i)) && (i + 1) < endIndex && isLowSurrogate(seq.charAt(i + 1))) i ++; - } + } return count; } - + /** * Returns the number of Unicode code points in the specified range of the * given char array. The first char in the range is at position * offset and the length of the range is count. Paired surrogates - * (supplementary characters are represented by a pair of chars - - * one from the high surrogates and one from the low surrogates) + * (supplementary characters are represented by a pair of chars - + * one from the high surrogates and one from the low surrogates) * count as just one code point. * @param a the char array to inspect * @param offset the beginning of the range * @param count the length of the range - * @return the number of Unicode code points in the given range of the + * @return the number of Unicode code points in the given range of the * array * @throws NullPointerException if a is null - * @throws IndexOutOfBoundsException if offset or count is negative or if + * @throws IndexOutOfBoundsException if offset or count is negative or if * offset + countendIndex is larger than the length of a. * @since 1.5 */ @@ -3130,7 +3130,7 @@ public final class Character implements Serializable, Comparable<Character> int end = offset + count; if (offset < 0 || count < 0 || end > len) throw new IndexOutOfBoundsException(); - + int counter = 0; for (int i = offset; i < end; i++) { @@ -3139,7 +3139,7 @@ public final class Character implements Serializable, Comparable<Character> if (isHighSurrogate(a[i]) && (i + 1) < end && isLowSurrogate(a[i + 1])) i ++; - } + } return counter; } @@ -3177,7 +3177,7 @@ public final class Character implements Serializable, Comparable<Character> * @see #isJavaLetterOrDigit(char) * @see #isLetter(char) * @see #isUnicodeIdentifierPart(char) - * + * * @since 1.5 */ public static boolean isLetterOrDigit(int codePoint) @@ -3190,7 +3190,7 @@ public final class Character implements Serializable, Comparable<Character> | (1 << OTHER_LETTER) | (1 << DECIMAL_DIGIT_NUMBER))) != 0; } - + /** * Determines if a character can start a Java identifier. This is the * combination of isLetter, any character where getType returns @@ -3306,7 +3306,7 @@ public final class Character implements Serializable, Comparable<Character> { return isJavaIdentifierPart((int)ch); } - + /** * Determines if a character can follow the first letter in * a Java identifier. This is the combination of isJavaLetter (isLetter, @@ -3411,7 +3411,7 @@ public final class Character implements Serializable, Comparable<Character> { return isUnicodeIdentifierPart((int)ch); } - + /** * Determines if a character can follow the first letter in * a Unicode identifier. This includes letters, connecting punctuation, @@ -3512,7 +3512,7 @@ public final class Character implements Serializable, Comparable<Character> { return (char) (lower[0][readCodePoint((int)ch) >>> 7] + ch); } - + /** * Converts a Unicode character into its lowercase equivalent mapping. * If a mapping does not exist, then the character passed is returned. @@ -3525,7 +3525,7 @@ public final class Character implements Serializable, Comparable<Character> * @see #isUpperCase(char) * @see #toTitleCase(char) * @see #toUpperCase(char) - * + * * @since 1.5 */ public static int toLowerCase(int codePoint) @@ -3537,7 +3537,7 @@ public final class Character implements Serializable, Comparable<Character> return UnassignedCharacters.toLowerCase(codePoint); if (plane > 14) return PrivateUseCharacters.toLowerCase(codePoint); - + // The short value stored in lower[plane] is the signed difference between // codePoint and its lowercase conversion. return ((short)lower[plane][readCodePoint(codePoint) >>> 7]) + codePoint; @@ -3560,7 +3560,7 @@ public final class Character implements Serializable, Comparable<Character> { return (char) (upper[0][readCodePoint((int)ch) >>> 7] + ch); } - + /** * Converts a Unicode character into its uppercase equivalent mapping. * If a mapping does not exist, then the character passed is returned. @@ -3573,7 +3573,7 @@ public final class Character implements Serializable, Comparable<Character> * @see #isUpperCase(char) * @see #toLowerCase(char) * @see #toTitleCase(char) - * + * * @since 1.5 */ public static int toUpperCase(int codePoint) @@ -3585,7 +3585,7 @@ public final class Character implements Serializable, Comparable<Character> return UnassignedCharacters.toUpperCase(codePoint); if (plane > 14) return PrivateUseCharacters.toUpperCase(codePoint); - + // The short value stored in upper[plane] is the signed difference between // codePoint and its uppercase conversion. return ((short)upper[plane][readCodePoint(codePoint) >>> 7]) + codePoint; @@ -3623,7 +3623,7 @@ public final class Character implements Serializable, Comparable<Character> * @see #isTitleCase(char) * @see #toLowerCase(char) * @see #toUpperCase(char) - * + * * @since 1.5 */ public static int toTitleCase(int codePoint) @@ -3693,7 +3693,7 @@ public final class Character implements Serializable, Comparable<Character> { if (radix < MIN_RADIX || radix > MAX_RADIX) return -1; - + // If the code point is unassigned or in one of the private use areas // then we delegate the call to the appropriate private static inner class. int plane = codePoint >>> 16; @@ -3709,8 +3709,8 @@ public final class Character implements Serializable, Comparable<Character> { // Signedness doesn't matter; 0xffff vs. -1 are both rejected. int digit = numValue[plane][attr >> 7]; - - // If digit is less than or equal to -3 then the numerical value was + + // If digit is less than or equal to -3 then the numerical value was // too large to fit into numValue and is stored in CharData.LARGENUMS. if (digit <= -3) digit = CharData.LARGENUMS[-digit - 3]; @@ -3718,7 +3718,7 @@ public final class Character implements Serializable, Comparable<Character> } return -1; } - + /** * Returns the Unicode numeric value property of a character. For example, * <code>'\\u216C'</code> (the Roman numeral fifty) returns 50. @@ -3751,7 +3751,7 @@ public final class Character implements Serializable, Comparable<Character> // Treat numValue as signed. return (short) numValue[0][readCodePoint((int)ch) >> 7]; } - + /** * Returns the Unicode numeric value property of a character. For example, * <code>'\\u216C'</code> (the Roman numeral fifty) returns 50. @@ -3788,9 +3788,9 @@ public final class Character implements Serializable, Comparable<Character> return UnassignedCharacters.getNumericValue(codePoint); if (plane > 14) return PrivateUseCharacters.getNumericValue(codePoint); - + // If the value N found in numValue[plane] is less than or equal to -3 - // then the numeric value was too big to fit into 16 bits and is + // then the numeric value was too big to fit into 16 bits and is // stored in CharData.LARGENUMS at offset (-N - 3). short num = (short)numValue[plane][readCodePoint(codePoint) >> 7]; if (num <= -3) @@ -3837,7 +3837,7 @@ public final class Character implements Serializable, Comparable<Character> { return isSpaceChar((int)ch); } - + /** * Determines if a character is a Unicode space character. This includes * SPACE_SEPARATOR, LINE_SEPARATOR, and PARAGRAPH_SEPARATOR. @@ -3878,7 +3878,7 @@ public final class Character implements Serializable, Comparable<Character> { return isWhitespace((int) ch); } - + /** * Determines if a character is Java whitespace. This includes Unicode * space characters (SPACE_SEPARATOR, LINE_SEPARATOR, and @@ -3903,7 +3903,7 @@ public final class Character implements Serializable, Comparable<Character> return UnassignedCharacters.isWhiteSpace(codePoint); if (plane > 14) return PrivateUseCharacters.isWhiteSpace(codePoint); - + int attr = readCodePoint(codePoint); return ((((1 << (attr & TYPE_MASK)) & ((1 << SPACE_SEPARATOR) @@ -3937,14 +3937,14 @@ public final class Character implements Serializable, Comparable<Character> { return isISOControl((int)ch); } - + /** * Determines if the character is an ISO Control character. This is true * if the code point is in the range [0, 0x001F] or if it is in the range * [0x007F, 0x009F]. * @param codePoint the character to check * @return true if the character is in one of the above ranges - * + * * @since 1.5 */ public static boolean isISOControl(int codePoint) @@ -3952,7 +3952,7 @@ public final class Character implements Serializable, Comparable<Character> if ((codePoint >= 0 && codePoint <= 0x001F) || (codePoint >= 0x007F && codePoint <= 0x009F)) return true; - return false; + return false; } /** @@ -3996,7 +3996,7 @@ public final class Character implements Serializable, Comparable<Character> { return getType((int)ch); } - + /** * Returns the Unicode general category property of a character. * @@ -4032,7 +4032,7 @@ public final class Character implements Serializable, Comparable<Character> * @see #MODIFIER_SYMBOL * @see #INITIAL_QUOTE_PUNCTUATION * @see #FINAL_QUOTE_PUNCTUATION - * + * * @since 1.5 */ public static int getType(int codePoint) @@ -4044,7 +4044,7 @@ public final class Character implements Serializable, Comparable<Character> return UnassignedCharacters.getType(codePoint); if (plane > 14) return PrivateUseCharacters.getType(codePoint); - + return readCodePoint(codePoint) & TYPE_MASK; } @@ -4105,7 +4105,7 @@ public final class Character implements Serializable, Comparable<Character> return getDirectionality((int)ch); } - + /** * Returns the Unicode directionality property of the character. This * is used in the visual ordering of text. @@ -4143,11 +4143,11 @@ public final class Character implements Serializable, Comparable<Character> return UnassignedCharacters.getDirectionality(codePoint); if (plane > 14) return PrivateUseCharacters.getDirectionality(codePoint); - + // The result will correctly be signed. return (byte) (direction[plane][readCodePoint(codePoint) >> 7] >> 2); } - + /** * Determines whether the character is mirrored according to Unicode. For * example, <code>\u0028</code> (LEFT PARENTHESIS) appears as '(' in @@ -4161,7 +4161,7 @@ public final class Character implements Serializable, Comparable<Character> { return (readCodePoint((int)ch) & MIRROR_MASK) != 0; } - + /** * Determines whether the character is mirrored according to Unicode. For * example, <code>\u0028</code> (LEFT PARENTHESIS) appears as '(' in @@ -4180,7 +4180,7 @@ public final class Character implements Serializable, Comparable<Character> return UnassignedCharacters.isMirrored(codePoint); if (plane > 14) return PrivateUseCharacters.isMirrored(codePoint); - + return (readCodePoint(codePoint) & MIRROR_MASK) != 0; } @@ -4229,7 +4229,7 @@ public final class Character implements Serializable, Comparable<Character> /** * Converts a unicode code point to a UTF-16 representation of that * code point. - * + * * @param codePoint the unicode code point * * @return the UTF-16 representation of that code point @@ -4288,7 +4288,7 @@ public final class Character implements Serializable, Comparable<Character> else { dst[dstIndex] = (char) codePoint; - result = 1; + result = 1; } return result; } @@ -4305,9 +4305,9 @@ public final class Character implements Serializable, Comparable<Character> */ public static int charCount(int codePoint) { - return - (codePoint >= MIN_SUPPLEMENTARY_CODE_POINT) - ? 2 + return + (codePoint >= MIN_SUPPLEMENTARY_CODE_POINT) + ? 2 : 1; } @@ -4510,7 +4510,7 @@ public final class Character implements Serializable, Comparable<Character> public static int codePointBefore(char[] chars, int index, int start) { if (index < start || index > chars.length - || start < 0 || start >= chars.length) + || start < 0 || start >= chars.length) throw new IndexOutOfBoundsException(); --index; char low = chars[index]; diff --git a/libjava/classpath/java/lang/Class.java b/libjava/classpath/java/lang/Class.java index 0aafe80..1caee01 100644 --- a/libjava/classpath/java/lang/Class.java +++ b/libjava/classpath/java/lang/Class.java @@ -99,7 +99,7 @@ import java.util.LinkedHashSet; * @since 1.0 * @see ClassLoader */ -public final class Class<T> +public final class Class<T> implements Serializable, Type, AnnotatedElement, GenericDeclaration { /** @@ -215,7 +215,7 @@ public final class Class<T> * @since 1.2 */ public static Class<?> forName(String name, boolean initialize, - ClassLoader classloader) + ClassLoader classloader) throws ClassNotFoundException { if (classloader == null) @@ -232,7 +232,7 @@ public final class Class<T> } return (Class<?>) VMClass.forName(name, initialize, classloader); } - + /** * Get all the public member classes and interfaces declared in this * class or inherited from superclasses. This returns an array of length @@ -263,7 +263,7 @@ public final class Class<T> list.addAll(Arrays.asList(superClass.internalGetClasses())); return list.toArray(new Class<?>[list.size()]); } - + /** * Get the ClassLoader that loaded this class. If the class was loaded * by the bootstrap classloader, this method will return null. @@ -288,7 +288,7 @@ public final class Class<T> if (loader != null && sm != null) { // Get the calling classloader - ClassLoader cl = VMStackWalker.getCallingClassLoader(); + ClassLoader cl = VMStackWalker.getCallingClassLoader(); if (cl != null && !cl.isAncestorOf(loader)) sm.checkPermission(new RuntimePermission("getClassLoader")); } @@ -331,9 +331,9 @@ public final class Class<T> Constructor[] constructors = getDeclaredConstructors(true); for (int i = 0; i < constructors.length; i++) { - Constructor constructor = constructors[i]; - if (matchParameters(types, constructor.getParameterTypes())) - return constructor; + Constructor constructor = constructors[i]; + if (matchParameters(types, constructor.getParameterTypes())) + return constructor; } throw new NoSuchMethodException(); } @@ -377,9 +377,9 @@ public final class Class<T> Constructor[] constructors = getDeclaredConstructors(false); for (int i = 0; i < constructors.length; i++) { - Constructor constructor = constructors[i]; - if (matchParameters(types, constructor.getParameterTypes())) - return constructor; + Constructor constructor = constructors[i]; + if (matchParameters(types, constructor.getParameterTypes())) + return constructor; } throw new NoSuchMethodException(); } @@ -429,7 +429,7 @@ public final class Class<T> { return VMClass.getDeclaredConstructors (this, publicOnly); } - + /** * Get a field declared in this class, where name is its simple name. The * implicit length field of arrays is not available. A security check may @@ -449,8 +449,8 @@ public final class Class<T> Field[] fields = getDeclaredFields(false); for (int i = 0; i < fields.length; i++) { - if (fields[i].getName().equals(name)) - return fields[i]; + if (fields[i].getName().equals(name)) + return fields[i]; } throw new NoSuchFieldException(); } @@ -535,7 +535,7 @@ public final class Class<T> { return VMClass.getDeclaredMethods (this, publicOnly); } - + /** * If this is a nested or inner class, return the class that declared it. * If not, return null. @@ -643,7 +643,7 @@ public final class Class<T> private Class[] params; private Class returnType; private int hash; - + MethodKey(Method m) { name = m.getName(); @@ -651,36 +651,36 @@ public final class Class<T> returnType = m.getReturnType(); hash = name.hashCode() ^ returnType.hashCode(); for(int i = 0; i < params.length; i++) - { - hash ^= params[i].hashCode(); - } + { + hash ^= params[i].hashCode(); + } } - + public boolean equals(Object o) { if (o instanceof MethodKey) - { - MethodKey m = (MethodKey) o; - if (m.name.equals(name) && m.params.length == params.length - && m.returnType == returnType) - { - for (int i = 0; i < params.length; i++) - { - if (m.params[i] != params[i]) - return false; - } - return true; - } - } + { + MethodKey m = (MethodKey) o; + if (m.name.equals(name) && m.params.length == params.length + && m.returnType == returnType) + { + for (int i = 0; i < params.length; i++) + { + if (m.params[i] != params[i]) + return false; + } + return true; + } + } return false; } - + public int hashCode() { return hash; } } - + /** * Get a public method declared or inherited in this class, where name is * its simple name. The implicit methods of Object are not available from @@ -725,21 +725,21 @@ public final class Class<T> Class superClass = getSuperclass(); if (superClass != null) { - match = superClass.internalGetMethod(methodName, args); - if(match != null) - return match; + match = superClass.internalGetMethod(methodName, args); + if(match != null) + return match; } Class[] interfaces = getInterfaces(); for (int i = 0; i < interfaces.length; i++) { - match = interfaces[i].internalGetMethod(methodName, args); - if (match != null) - return match; + match = interfaces[i].internalGetMethod(methodName, args); + if (match != null) + return match; } return null; } - /** + /** * Find the best matching method in <code>list</code> according to * the definition of ``best matching'' used by <code>getMethod()</code> * @@ -756,14 +756,14 @@ public final class Class<T> Method match = null; for (int i = 0; i < list.length; i++) { - Method method = list[i]; - if (!method.getName().equals(name)) - continue; - if (!matchParameters(args, method.getParameterTypes())) - continue; - if (match == null - || match.getReturnType().isAssignableFrom(method.getReturnType())) - match = method; + Method method = list[i]; + if (!method.getName().equals(name)) + continue; + if (!matchParameters(args, method.getParameterTypes())) + continue; + if (match == null + || match.getReturnType().isAssignableFrom(method.getReturnType())) + match = method; } return match; } @@ -783,12 +783,12 @@ public final class Class<T> return false; for (int i = 0; i < types1.length; i++) { - if (types1[i] != types2[i]) - return false; + if (types1[i] != types2[i]) + return false; } return true; } - + /** * Get all the public methods declared in this class or inherited from * superclasses. This returns an array of length 0 if there are no methods, @@ -825,25 +825,25 @@ public final class Class<T> Class[] interfaces = getInterfaces(); for(int i = 0; i < interfaces.length; i++) { - methods = interfaces[i].internalGetMethods(); - for(int j = 0; j < methods.length; j++) - { - map.put(new MethodKey(methods[j]), methods[j]); - } + methods = interfaces[i].internalGetMethods(); + for(int j = 0; j < methods.length; j++) + { + map.put(new MethodKey(methods[j]), methods[j]); + } } Class superClass = getSuperclass(); if(superClass != null) { - methods = superClass.internalGetMethods(); - for(int i = 0; i < methods.length; i++) - { - map.put(new MethodKey(methods[i]), methods[i]); - } + methods = superClass.internalGetMethods(); + for(int i = 0; i < methods.length; i++) + { + map.put(new MethodKey(methods[i]), methods[i]); + } } methods = getDeclaredMethods(true); for(int i = 0; i < methods.length; i++) { - map.put(new MethodKey(methods[i]), methods[i]); + map.put(new MethodKey(methods[i]), methods[i]); } return map.values().toArray(new Method[map.size()]); } @@ -867,7 +867,7 @@ public final class Class<T> Modifier.FINAL | Modifier.STATIC | Modifier.ABSTRACT | Modifier.INTERFACE)); } - + /** * Get the name of this class, separated by dots for package separators. * If the class represents a primitive type, or void, then the @@ -896,7 +896,7 @@ public final class Class<T> * @return the name of this class */ public String getName() - { + { return VMClass.getName (this); } @@ -959,16 +959,16 @@ public final class Class<T> { if (resourceName.length() > 0) { - if (resourceName.charAt(0) != '/') - { - String pkg = getPackagePortion(getName()); - if (pkg.length() > 0) - resourceName = pkg.replace('.','/') + '/' + resourceName; - } - else - { - resourceName = resourceName.substring(1); - } + if (resourceName.charAt(0) != '/') + { + String pkg = getPackagePortion(getName()); + if (pkg.length() > 0) + resourceName = pkg.replace('.','/') + '/' + resourceName; + } + else + { + resourceName = resourceName.substring(1); + } } return resourceName; } @@ -984,7 +984,7 @@ public final class Class<T> { return signers == null ? null : (Object[]) signers.clone (); } - + /** * Set the signers of this class. * @@ -1006,7 +1006,7 @@ public final class Class<T> { return VMClass.getSuperclass (this); } - + /** * Return whether this class is an array type. * @@ -1017,7 +1017,7 @@ public final class Class<T> { return VMClass.isArray (this); } - + /** * Discover whether an instance of the Class parameter would be an * instance of this Class as well. Think of doing @@ -1036,7 +1036,7 @@ public final class Class<T> { return VMClass.isAssignableFrom (this, c); } - + /** * Discover whether an Object is an instance of this Class. Think of it * as almost like <code>o instanceof (this class)</code>. @@ -1049,7 +1049,7 @@ public final class Class<T> { return VMClass.isInstance (this, o); } - + /** * Check whether this class is an interface or not. Array types are not * interfaces. @@ -1060,7 +1060,7 @@ public final class Class<T> { return VMClass.isInterface (this); } - + /** * Return whether this class is a primitive type. A primitive type class * is a class representing a kind of "placeholder" for the various @@ -1084,7 +1084,7 @@ public final class Class<T> { return VMClass.isPrimitive (this); } - + /** * Get a new instance of this class by calling the no-argument constructor. * The class is initialized if it has not been already. A security check @@ -1109,45 +1109,45 @@ public final class Class<T> Constructor<T> constructor; synchronized(this) { - constructor = this.constructor; + constructor = this.constructor; } if (constructor == null) { - Constructor[] constructors = getDeclaredConstructors(false); - for (int i = 0; i < constructors.length; i++) - { - if (constructors[i].getParameterTypes().length == 0) - { - constructor = constructors[i]; - break; - } - } - if (constructor == null) - throw new InstantiationException(getName()); - if (!Modifier.isPublic(constructor.getModifiers()) + Constructor[] constructors = getDeclaredConstructors(false); + for (int i = 0; i < constructors.length; i++) + { + if (constructors[i].getParameterTypes().length == 0) + { + constructor = constructors[i]; + break; + } + } + if (constructor == null) + throw new InstantiationException(getName()); + if (!Modifier.isPublic(constructor.getModifiers()) || !Modifier.isPublic(VMClass.getModifiers(this, true))) - { - setAccessible(constructor); - } - synchronized(this) - { - if (this.constructor == null) - this.constructor = constructor; - } + { + setAccessible(constructor); + } + synchronized(this) + { + if (this.constructor == null) + this.constructor = constructor; + } } int modifiers = constructor.getModifiers(); if (!Modifier.isPublic(modifiers) || !Modifier.isPublic(VMClass.getModifiers(this, true))) { - Class caller = VMStackWalker.getCallingClass(); - if (caller != null && - caller != this && - (Modifier.isPrivate(modifiers) - || getClassLoader() != caller.getClassLoader() - || !getPackagePortion(getName()) - .equals(getPackagePortion(caller.getName())))) - throw new IllegalAccessException(getName() - + " has an inaccessible constructor"); + Class caller = VMStackWalker.getCallingClass(); + if (caller != null && + caller != this && + (Modifier.isPrivate(modifiers) + || getClassLoader() != caller.getClassLoader() + || !getPackagePortion(getName()) + .equals(getPackagePortion(caller.getName())))) + throw new IllegalAccessException(getName() + + " has an inaccessible constructor"); } try { @@ -1155,9 +1155,9 @@ public final class Class<T> } catch (InvocationTargetException e) { - VMClass.throwException(e.getTargetException()); - throw (InternalError) new InternalError - ("VMClass.throwException returned").initCause(e); + VMClass.throwException(e.getTargetException()); + throw (InternalError) new InternalError + ("VMClass.throwException returned").initCause(e); } } @@ -1288,14 +1288,14 @@ public final class Class<T> * returns an appropriately cast reference to this object. Otherwise, * a <code>ClassCastException</code> is thrown. * </p> - * + * * @param klass the class object, the parameterized type (<code>U</code>) of * which should be a superclass of the parameterized type of * this instance. * @return a reference to this object, appropriately cast. * @throws ClassCastException if this class can not be converted to one * which represents a subclass of the specified - * type, <code>U</code>. + * type, <code>U</code>. * @since 1.5 */ public <U> Class<? extends U> asSubclass(Class<U> klass) @@ -1328,16 +1328,16 @@ public final class Class<T> Field[] fields = getDeclaredFields(true); for (int i = 0; i < fields.length; i++) { - Field field = fields[i]; - if (field.getName().equals(name)) - return field; + Field field = fields[i]; + if (field.getName().equals(name)) + return field; } Class[] interfaces = getInterfaces(); for (int i = 0; i < interfaces.length; i++) { - Field field = interfaces[i].internalGetField(name); - if(field != null) - return field; + Field field = interfaces[i].internalGetField(name); + if(field != null) + return field; } Class superClass = getSuperclass(); if (superClass != null) @@ -1368,10 +1368,10 @@ public final class Class<T> SecurityManager sm = SecurityManager.current; if (sm != null) { - sm.checkMemberAccess(this, which); - Package pkg = getPackage(); - if (pkg != null) - sm.checkPackageAccess(pkg.getName()); + sm.checkMemberAccess(this, which); + Package pkg = getPackage(); + if (pkg != null) + sm.checkPackageAccess(pkg.getName()); } } @@ -1388,30 +1388,30 @@ public final class Class<T> { if (isEnum()) { - try - { + try + { Method m = getMethod("values"); setAccessible(m); - return (T[]) m.invoke(null); - } - catch (NoSuchMethodException exception) - { - throw new Error("Enum lacks values() method"); - } - catch (IllegalAccessException exception) - { - throw new Error("Unable to access Enum class"); - } - catch (InvocationTargetException exception) - { - throw new - RuntimeException("The values method threw an exception", - exception); - } + return (T[]) m.invoke(null); + } + catch (NoSuchMethodException exception) + { + throw new Error("Enum lacks values() method"); + } + catch (IllegalAccessException exception) + { + throw new Error("Unable to access Enum class"); + } + catch (InvocationTargetException exception) + { + throw new + RuntimeException("The values method threw an exception", + exception); + } } else { - return null; + return null; } } @@ -1458,7 +1458,7 @@ public final class Class<T> * <code>getName()</code> which follows the last ".". Anonymous * classes have no name, and so the result of calling this method is * "". The simple name of an array consists of the simple name of - * its component type, followed by "[]". Thus, an array with the + * its component type, followed by "[]". Thus, an array with the * component type of an anonymous class has a simple name of simply * "[]". * @@ -1485,7 +1485,7 @@ public final class Class<T> Annotation[] annotations = getAnnotations(); for (Annotation annotation : annotations) if (annotation.annotationType() == annotationClass) - foundAnnotation = (A) annotation; + foundAnnotation = (A) annotation; return foundAnnotation; } @@ -1506,15 +1506,15 @@ public final class Class<T> for (Annotation a : getDeclaredAnnotations()) map.put((Class) a.annotationType(), a); for (Class<? super T> s = getSuperclass(); - s != null; - s = s.getSuperclass()) + s != null; + s = s.getSuperclass()) { - for (Annotation a : s.getDeclaredAnnotations()) - { - Class k = (Class) a.annotationType(); - if (! map.containsKey(k) && k.isAnnotationPresent(Inherited.class)) - map.put(k, a); - } + for (Annotation a : s.getDeclaredAnnotations()) + { + Class k = (Class) a.annotationType(); + if (! map.containsKey(k) && k.isAnnotationPresent(Inherited.class)) + map.put(k, a); + } } Collection<Annotation> v = map.values(); return v.toArray(new Annotation[v.size()]); @@ -1533,7 +1533,7 @@ public final class Class<T> * The canonical name for top-level classes, top-level interfaces and * primitive types is always the same as the fully-qualified name. * For array types, the canonical name is the canonical name of its - * component type with `[]' appended. + * component type with `[]' appended. * </p> * <p> * The canonical name of a member class always refers to the place where @@ -1590,7 +1590,7 @@ public final class Class<T> /** * Returns the constructor which immediately encloses this class. If - * this class is a top-level class, or a local or anonymous class + * this class is a top-level class, or a local or anonymous class * immediately enclosed by a type definition, instance initializer * or static initializer, then <code>null</code> is returned. * @@ -1606,7 +1606,7 @@ public final class Class<T> /** * Returns the method which immediately encloses this class. If - * this class is a top-level class, or a local or anonymous class + * this class is a top-level class, or a local or anonymous class * immediately enclosed by a type definition, instance initializer * or static initializer, then <code>null</code> is returned. * @@ -1718,7 +1718,7 @@ public final class Class<T> * An array of size zero is returned if this class has no type * variables. * - * @return the type variables associated with this class. + * @return the type variables associated with this class. * @throws GenericSignatureFormatError if the generic signature does * not conform to the format specified in the Virtual Machine * specification, version 3. @@ -1743,8 +1743,8 @@ public final class Class<T> * @return true if an annotation exists for the specified type. * @since 1.5 */ - public boolean isAnnotationPresent(Class<? extends Annotation> - annotationClass) + public boolean isAnnotationPresent(Class<? extends Annotation> + annotationClass) { return getAnnotation(annotationClass) != null; } diff --git a/libjava/classpath/java/lang/ClassLoader.java b/libjava/classpath/java/lang/ClassLoader.java index 591406a..b7cbb2a 100644 --- a/libjava/classpath/java/lang/ClassLoader.java +++ b/libjava/classpath/java/lang/ClassLoader.java @@ -165,23 +165,23 @@ public abstract class ClassLoader if (secman != null && SecurityManager.current == null) { if (secman.equals("") || secman.equals("default")) - { - SecurityManager.current = new SecurityManager(); - } - else - { - try - { - Class cl = Class.forName(secman, false, StaticData.systemClassLoader); - SecurityManager.current = (SecurityManager)cl.newInstance(); - } - catch (Exception x) - { - throw (InternalError) - new InternalError("Unable to create SecurityManager") - .initCause(x); - } - } + { + SecurityManager.current = new SecurityManager(); + } + else + { + try + { + Class cl = Class.forName(secman, false, StaticData.systemClassLoader); + SecurityManager.current = (SecurityManager)cl.newInstance(); + } + catch (Exception x) + { + throw (InternalError) + new InternalError("Unable to create SecurityManager") + .initCause(x); + } + } } } @@ -320,23 +320,23 @@ public abstract class ClassLoader Class<?> c = findLoadedClass(name); if (c == null) { - // Can the class be loaded by a parent? - try - { - if (parent == null) - { - c = VMClassLoader.loadClass(name, resolve); - if (c != null) - return c; - } - else - { - return parent.loadClass(name, resolve); - } - } + // Can the class be loaded by a parent? + try + { + if (parent == null) + { + c = VMClassLoader.loadClass(name, resolve); + if (c != null) + return c; + } + else + { + return parent.loadClass(name, resolve); + } + } catch (ClassNotFoundException e) - { - } + { + } // Still not found, we have to do it ourself. c = findClass(name); } @@ -431,7 +431,7 @@ public abstract class ClassLoader * @since 1.1 */ protected final Class<?> defineClass(String name, byte[] data, int offset, - int len) throws ClassFormatError + int len) throws ClassFormatError { return defineClass(name, data, offset, len, null); } @@ -460,16 +460,16 @@ public abstract class ClassLoader * @since 1.2 */ protected final synchronized Class<?> defineClass(String name, byte[] data, - int offset, int len, - ProtectionDomain domain) + int offset, int len, + ProtectionDomain domain) throws ClassFormatError { checkInitialized(); if (domain == null) domain = StaticData.defaultProtectionDomain; - + return VMClassLoader.defineClassWithTransformers(this, name, data, offset, - len, domain); + len, domain); } /** @@ -493,7 +493,7 @@ public abstract class ClassLoader * @since 1.5 */ protected final Class<?> defineClass(String name, ByteBuffer buf, - ProtectionDomain domain) + ProtectionDomain domain) throws ClassFormatError { byte[] data = new byte[buf.remaining()]; @@ -547,8 +547,8 @@ public abstract class ClassLoader SecurityManager sm = SecurityManager.current; if (sm != null) { - ClassLoader cl = VMStackWalker.getCallingClassLoader(); - if (cl != null && ! cl.isAncestorOf(this)) + ClassLoader cl = VMStackWalker.getCallingClassLoader(); + if (cl != null && ! cl.isAncestorOf(this)) sm.checkPermission(new RuntimePermission("getClassLoader")); } return parent; @@ -791,9 +791,9 @@ public abstract class ClassLoader SecurityManager sm = SecurityManager.current; if (sm != null) { - ClassLoader cl = VMStackWalker.getCallingClassLoader(); - if (cl != null && cl != StaticData.systemClassLoader) - sm.checkPermission(new RuntimePermission("getClassLoader")); + ClassLoader cl = VMStackWalker.getCallingClassLoader(); + if (cl != null && cl != StaticData.systemClassLoader) + sm.checkPermission(new RuntimePermission("getClassLoader")); } return StaticData.systemClassLoader; @@ -863,10 +863,10 @@ public abstract class ClassLoader if (p == null) { - synchronized (definedPackages) - { - p = definedPackages.get(name); - } + synchronized (definedPackages) + { + p = definedPackages.get(name); + } } return p; } @@ -895,7 +895,7 @@ public abstract class ClassLoader parentPackages = parent.getPackages(); Package[] allPackages = new Package[parentPackages.length - + packages.length]; + + packages.length]; System.arraycopy(parentPackages, 0, allPackages, 0, parentPackages.length); System.arraycopy(packages, 0, allPackages, parentPackages.length, @@ -937,7 +937,7 @@ public abstract class ClassLoader { defaultAssertionStatus = enabled; } - + /** * Set the default assertion status for packages, used unless overridden * by a class request. This default also covers subpackages, unless they @@ -958,7 +958,7 @@ public abstract class ClassLoader = new HashMap<String, Boolean>(StaticData.systemPackageAssertionStatus); packageAssertionStatus.put(name, Boolean.valueOf(enabled)); } - + /** * Set the default assertion status for a class. This only affects the * status of top-level classes, any other string is harmless. @@ -976,11 +976,11 @@ public abstract class ClassLoader { if (classAssertionStatus == null) classAssertionStatus - = new HashMap<String, Boolean>(StaticData.systemClassAssertionStatus); + = new HashMap<String, Boolean>(StaticData.systemClassAssertionStatus); // The toString() hack catches null, as required. classAssertionStatus.put(name.toString(), Boolean.valueOf(enabled)); } - + /** * Resets the default assertion status of this classloader, its packages * and classes, all to false. This allows overriding defaults inherited @@ -1007,9 +1007,9 @@ public abstract class ClassLoader { while (loader != null) { - if (this == loader) - return true; - loader = loader.parent; + if (this == loader) + return true; + loader = loader.parent; } return false; } @@ -1021,17 +1021,17 @@ public abstract class ClassLoader ArrayList list = new ArrayList(); while (tok.hasMoreTokens()) { - try - { - File f = new File(tok.nextToken()); - File[] files = f.listFiles(); - if (files != null) - for (int i = 0; i < files.length; i++) - list.add(files[i].toURL()); - } - catch(Exception x) - { - } + try + { + File f = new File(tok.nextToken()); + File[] files = f.listFiles(); + if (files != null) + for (int i = 0; i < files.length; i++) + list.add(files[i].toURL()); + } + catch(Exception x) + { + } } URL[] urls = new URL[list.size()]; list.toArray(urls); @@ -1042,7 +1042,7 @@ public abstract class ClassLoader { try { - list.add(new File(file).toURL()); + list.add(new File(file).toURL()); } catch(java.net.MalformedURLException x) { @@ -1056,22 +1056,22 @@ public abstract class ClassLoader ArrayList list = new ArrayList(); while (tok.hasMoreTokens()) { - String s = tok.nextToken(); - if (s.equals(File.pathSeparator)) - addFileURL(list, "."); - else - { - addFileURL(list, s); - if (tok.hasMoreTokens()) - { - // Skip the separator. - tok.nextToken(); - // If the classpath ended with a separator, - // append the current directory. - if (!tok.hasMoreTokens()) - addFileURL(list, "."); - } - } + String s = tok.nextToken(); + if (s.equals(File.pathSeparator)) + addFileURL(list, "."); + else + { + addFileURL(list, s); + if (tok.hasMoreTokens()) + { + // Skip the separator. + tok.nextToken(); + // If the classpath ended with a separator, + // append the current directory. + if (!tok.hasMoreTokens()) + addFileURL(list, "."); + } + } } URL[] urls = new URL[list.size()]; list.toArray(urls); @@ -1096,22 +1096,22 @@ public abstract class ClassLoader static ClassLoader createSystemClassLoader(URL[] urls, ClassLoader parent) { return - new URLClassLoader(urls, parent) - { - protected synchronized Class loadClass(String name, - boolean resolve) - throws ClassNotFoundException - { - SecurityManager sm = SecurityManager.current; - if (sm != null) - { - int lastDot = name.lastIndexOf('.'); - if (lastDot != -1) - sm.checkPackageAccess(name.substring(0, lastDot)); - } - return super.loadClass(name, resolve); - } - }; + new URLClassLoader(urls, parent) + { + protected synchronized Class loadClass(String name, + boolean resolve) + throws ClassNotFoundException + { + SecurityManager sm = SecurityManager.current; + if (sm != null) + { + int lastDot = name.lastIndexOf('.'); + if (lastDot != -1) + sm.checkPackageAccess(name.substring(0, lastDot)); + } + return super.loadClass(name, resolve); + } + }; } static ClassLoader createAuxiliarySystemClassLoader(ClassLoader parent) @@ -1119,20 +1119,20 @@ public abstract class ClassLoader String loader = SystemProperties.getProperty("java.system.class.loader", null); if (loader == null) { - return parent; + return parent; } try { - Constructor c = Class.forName(loader, false, parent) - .getConstructor(new Class[] { ClassLoader.class }); - return (ClassLoader)c.newInstance(new Object[] { parent }); + Constructor c = Class.forName(loader, false, parent) + .getConstructor(new Class[] { ClassLoader.class }); + return (ClassLoader)c.newInstance(new Object[] { parent }); } catch (Exception e) { - System.err.println("Requested system classloader " + loader + " failed."); - throw (Error) - new Error("Requested system classloader " + loader + " failed.") - .initCause(e); + System.err.println("Requested system classloader " + loader + " failed."); + throw (Error) + new Error("Requested system classloader " + loader + " failed.") + .initCause(e); } } diff --git a/libjava/classpath/java/lang/Comparable.java b/libjava/classpath/java/lang/Comparable.java index 4ad39af..d4ca63a 100644 --- a/libjava/classpath/java/lang/Comparable.java +++ b/libjava/classpath/java/lang/Comparable.java @@ -52,8 +52,8 @@ package java.lang; * * <p>Lists, arrays, and sets of objects that implement this interface can * be sorted automatically, without the need for an explicit - * {@link java.util.Comparator}. Note that <code>e1.compareTo(null)</code> - * should throw an Exception; as should comparison between incompatible + * {@link java.util.Comparator}. Note that <code>e1.compareTo(null)</code> + * should throw an Exception; as should comparison between incompatible * classes. * * @author Geoff Berry diff --git a/libjava/classpath/java/lang/Double.java b/libjava/classpath/java/lang/Double.java index f3f7cb1..3ae1b01 100644 --- a/libjava/classpath/java/lang/Double.java +++ b/libjava/classpath/java/lang/Double.java @@ -213,7 +213,7 @@ public final class Double extends Number implements Comparable<Double> long bits = doubleToLongBits(d); CPStringBuilder result = new CPStringBuilder(); - + if (bits < 0) result.append('-'); result.append("0x"); @@ -603,21 +603,21 @@ public final class Double extends Number implements Comparable<Double> { // handle the easy cases: if (x < y) - return -1; + return -1; if (x > y) - return 1; + return 1; // handle equality respecting that 0.0 != -0.0 (hence not using x == y): long lx = doubleToRawLongBits(x); long ly = doubleToRawLongBits(y); if (lx == ly) - return 0; + return 0; // handle NaNs: if (x != x) - return (y != y) ? 0 : 1; + return (y != y) ? 0 : 1; else if (y != y) - return -1; + return -1; // handle +/- 0.0 return (lx < ly) ? -1 : 1; diff --git a/libjava/classpath/java/lang/Enum.java b/libjava/classpath/java/lang/Enum.java index da2e40b..46d2824 100644 --- a/libjava/classpath/java/lang/Enum.java +++ b/libjava/classpath/java/lang/Enum.java @@ -102,17 +102,17 @@ public abstract class Enum<T extends Enum<T>> if (! f.isEnumConstant()) throw new IllegalArgumentException(s); Class.setAccessible(f); - @SuppressWarnings("unchecked") - S val = (S) f.get(null); + @SuppressWarnings("unchecked") + S val = (S) f.get(null); return val; } catch (NoSuchFieldException exception) { - throw new IllegalArgumentException(s); + throw new IllegalArgumentException(s); } catch (IllegalAccessException exception) { - throw new Error("Unable to access Enum class"); + throw new Error("Unable to access Enum class"); } } @@ -167,7 +167,7 @@ public abstract class Enum<T extends Enum<T>> * integer if <code>e.ordinal > this.ordinal</code>. * @throws ClassCastException if <code>e</code> is not an enumeration * constant of the same class. - */ + */ public final int compareTo(T e) { if (getDeclaringClass() != e.getDeclaringClass()) @@ -201,7 +201,7 @@ public abstract class Enum<T extends Enum<T>> /** * Returns the number of this enumeration constant, which represents * the order in which it was originally declared, starting from zero. - * + * * @return the number of this constant. */ public final int ordinal() diff --git a/libjava/classpath/java/lang/EnumConstantNotPresentException.java b/libjava/classpath/java/lang/EnumConstantNotPresentException.java index 4586c37..f597318 100644 --- a/libjava/classpath/java/lang/EnumConstantNotPresentException.java +++ b/libjava/classpath/java/lang/EnumConstantNotPresentException.java @@ -69,7 +69,7 @@ public class EnumConstantNotPresentException extends RuntimeException * @param name the name of the missing enum constant */ public EnumConstantNotPresentException(Class<? extends Enum> theEnum, - String name) + String name) { super("enum " + theEnum + " is missing the constant " + name); enumType = theEnum; diff --git a/libjava/classpath/java/lang/Float.java b/libjava/classpath/java/lang/Float.java index 63e43c2..a4a766e 100644 --- a/libjava/classpath/java/lang/Float.java +++ b/libjava/classpath/java/lang/Float.java @@ -224,7 +224,7 @@ public final class Float extends Number implements Comparable<Float> int bits = floatToIntBits(f); CPStringBuilder result = new CPStringBuilder(); - + if (bits < 0) result.append('-'); result.append("0x"); @@ -611,21 +611,21 @@ public final class Float extends Number implements Comparable<Float> { // handle the easy cases: if (x < y) - return -1; + return -1; if (x > y) - return 1; + return 1; // handle equality respecting that 0.0 != -0.0 (hence not using x == y): int ix = floatToRawIntBits(x); int iy = floatToRawIntBits(y); if (ix == iy) - return 0; + return 0; // handle NaNs: if (x != x) - return (y != y) ? 0 : 1; + return (y != y) ? 0 : 1; else if (y != y) - return -1; + return -1; // handle +/- 0.0 return (ix < iy) ? -1 : 1; diff --git a/libjava/classpath/java/lang/IllegalArgumentException.java b/libjava/classpath/java/lang/IllegalArgumentException.java index 75a0b8b..26354a5 100644 --- a/libjava/classpath/java/lang/IllegalArgumentException.java +++ b/libjava/classpath/java/lang/IllegalArgumentException.java @@ -88,7 +88,7 @@ public class IllegalArgumentException extends RuntimeException * automatically incorporated into the resulting detail message of * this exception. * </p> - * + * * @param message the detail message, which should give the reason for * this exception being thrown. * @param cause the cause of this exception, or null if the cause @@ -116,7 +116,7 @@ public class IllegalArgumentException extends RuntimeException * This makes this constructor very useful for simply wrapping another * exception. * </p> - * + * * @param cause the cause of this exception, or null if the cause * is unknown. * @since 1.5 diff --git a/libjava/classpath/java/lang/IllegalStateException.java b/libjava/classpath/java/lang/IllegalStateException.java index 6b4e5f8..b182f09 100644 --- a/libjava/classpath/java/lang/IllegalStateException.java +++ b/libjava/classpath/java/lang/IllegalStateException.java @@ -93,7 +93,7 @@ public class IllegalStateException extends RuntimeException * automatically incorporated into the resulting detail message of * this exception. * </p> - * + * * @param message the detail message, which should give the reason for * this exception being thrown. * @param cause the cause of this exception, or null if the cause @@ -121,7 +121,7 @@ public class IllegalStateException extends RuntimeException * This makes this constructor very useful for simply wrapping another * exception. * </p> - * + * * @param cause the cause of this exception, or null if the cause * is unknown. * @since 1.5 @@ -132,4 +132,3 @@ public class IllegalStateException extends RuntimeException } } - diff --git a/libjava/classpath/java/lang/IndexOutOfBoundsException.java b/libjava/classpath/java/lang/IndexOutOfBoundsException.java index c53c67e..0a00253 100644 --- a/libjava/classpath/java/lang/IndexOutOfBoundsException.java +++ b/libjava/classpath/java/lang/IndexOutOfBoundsException.java @@ -41,7 +41,7 @@ package java.lang; /** * This exception can be thrown to indicate an attempt to access an * index which is out of bounds on objects like String, Array, or Vector. - * Usually any negative integer less than or equal to -1 and positive + * Usually any negative integer less than or equal to -1 and positive * integer greater than or equal to the size of the object is an index * which would be out of bounds. * diff --git a/libjava/classpath/java/lang/Integer.java b/libjava/classpath/java/lang/Integer.java index e5ca4b3..f379795 100644 --- a/libjava/classpath/java/lang/Integer.java +++ b/libjava/classpath/java/lang/Integer.java @@ -205,12 +205,12 @@ public final class Integer extends Number implements Comparable<Integer> // When the value is MIN_VALUE, it overflows when made positive if (num < 0) - { + { i = size = stringSize(MAX_VALUE, radix) + 2; buffer = new char[size]; - buffer[--i] = digits[(int) (-(num + radix) % radix)]; - num = -(num / radix); - } + buffer[--i] = digits[(int) (-(num + radix) % radix)]; + num = -(num / radix); + } else { i = size = stringSize(num, radix) + 1; @@ -704,9 +704,9 @@ public final class Integer extends Number implements Comparable<Integer> public static int reverseBytes(int val) { return ( ((val >> 24) & 0xff) - | ((val >> 8) & 0xff00) - | ((val << 8) & 0xff0000) - | ((val << 24) & 0xff000000)); + | ((val >> 8) & 0xff00) + | ((val << 8) & 0xff0000) + | ((val << 24) & 0xff000000)); } /** @@ -786,15 +786,15 @@ public final class Integer extends Number implements Comparable<Integer> if (ch == '-') { if (len == 1) - throw new NumberFormatException("pure '-'"); + throw new NumberFormatException("pure '-'"); isNeg = true; ch = str.charAt(++index); } else if (ch == '+') { - if (len == 1) - throw new NumberFormatException("pure '+'"); - ch = str.charAt(++index); + if (len == 1) + throw new NumberFormatException("pure '+'"); + ch = str.charAt(++index); } if (decode) { @@ -828,8 +828,8 @@ public final class Integer extends Number implements Comparable<Integer> int val = 0; while (index < len) { - if (val < 0 || val > max) - throw new NumberFormatException("number overflow (pos=" + index + ") : " + str); + if (val < 0 || val > max) + throw new NumberFormatException("number overflow (pos=" + index + ") : " + str); ch = Character.digit(str.charAt(index++), radix); val = val * radix + ch; diff --git a/libjava/classpath/java/lang/Long.java b/libjava/classpath/java/lang/Long.java index a5ee6c7..e7579d8 100644 --- a/libjava/classpath/java/lang/Long.java +++ b/libjava/classpath/java/lang/Long.java @@ -817,8 +817,8 @@ public final class Long extends Number implements Comparable<Long> long val = 0; while (index < len) { - if (val < 0 || val > max) - throw new NumberFormatException(); + if (val < 0 || val > max) + throw new NumberFormatException(); ch = Character.digit(str.charAt(index++), radix); val = val * radix + ch; diff --git a/libjava/classpath/java/lang/Math.java b/libjava/classpath/java/lang/Math.java index 90574d5..6cf29b4a 100644 --- a/libjava/classpath/java/lang/Math.java +++ b/libjava/classpath/java/lang/Math.java @@ -709,7 +709,7 @@ public final class Math * zero, then the original value is returned. The returned result is * within 1 ulp of the exact result. For a finite value, <code>x</code>, * the cube root of <code>-x</code> is equal to the negation of the cube root - * of <code>x</code>. + * of <code>x</code>. * </p> * <p> * For a square root, use <code>sqrt</code>. For other roots, use @@ -730,7 +730,7 @@ public final class Math /** * <p> * Returns the hyperbolic cosine of the given value. For a value, - * <code>x</code>, the hyperbolic cosine is <code>(e<sup>x</sup> + + * <code>x</code>, the hyperbolic cosine is <code>(e<sup>x</sup> + * e<sup>-x</sup>)/2</code> * with <code>e</code> being <a href="#E">Euler's number</a>. The returned * result is within 2.5 ulps of the exact result. @@ -740,7 +740,7 @@ public final class Math * returned. For either infinity, positive infinity is returned. * The hyperbolic cosine of zero is 1.0. * </p> - * + * * @param a the numeric argument * @return the hyperbolic cosine of <code>a</code>. * @since 1.5 @@ -758,12 +758,12 @@ public final class Math * 1 ulp of the exact result, and results are semi-monotonic. For finite * inputs, the returned value is greater than or equal to -1.0. Once * a result enters within half a ulp of this limit, the limit is returned. - * </p> + * </p> * <p> * For <code>NaN</code>, positive infinity and zero, the original value * is returned. Negative infinity returns a result of -1.0 (the limit). * </p> - * + * * @param a the numeric argument * @return <code>e<sup>a</sup> - 1</code> * @since 1.5 @@ -785,7 +785,7 @@ public final class Math * is positive infinity. Otherwise, if either argument is <code>NaN</code>, * then <code>NaN</code> is returned. * </p> - * + * * @param a the first parameter. * @param b the second parameter. * @return the hypotenuse matching the supplied parameters. @@ -855,7 +855,7 @@ public final class Math * <li>If <code>a</code> is positive or negative zero, the result is the * same.</li> * </ul> - * + * * @param a the numeric argument. * @return the sign of the argument. * @since 1.5. @@ -882,7 +882,7 @@ public final class Math * <li>If <code>a</code> is positive or negative zero, the result is the * same.</li> * </ul> - * + * * @param a the numeric argument. * @return the sign of the argument. * @since 1.5. @@ -901,7 +901,7 @@ public final class Math /** * <p> * Returns the hyperbolic sine of the given value. For a value, - * <code>x</code>, the hyperbolic sine is <code>(e<sup>x</sup> - + * <code>x</code>, the hyperbolic sine is <code>(e<sup>x</sup> - * e<sup>-x</sup>)/2</code> * with <code>e</code> being <a href="#E">Euler's number</a>. The returned * result is within 2.5 ulps of the exact result. @@ -910,7 +910,7 @@ public final class Math * If the supplied value is <code>NaN</code>, an infinity or a zero, then the * original value is returned. * </p> - * + * * @param a the numeric argument * @return the hyperbolic sine of <code>a</code>. * @since 1.5 @@ -923,7 +923,7 @@ public final class Math /** * <p> * Returns the hyperbolic tangent of the given value. For a value, - * <code>x</code>, the hyperbolic tangent is <code>(e<sup>x</sup> - + * <code>x</code>, the hyperbolic tangent is <code>(e<sup>x</sup> - * e<sup>-x</sup>)/(e<sup>x</sup> + e<sup>-x</sup>)</code> * (i.e. <code>sinh(a)/cosh(a)</code>) * with <code>e</code> being <a href="#E">Euler's number</a>. The returned @@ -938,7 +938,7 @@ public final class Math * value is returned. Positive infinity returns +1.0 and negative infinity * returns -1.0. * </p> - * + * * @param a the numeric argument * @return the hyperbolic tangent of <code>a</code>. * @since 1.5 diff --git a/libjava/classpath/java/lang/NoClassDefFoundError.java b/libjava/classpath/java/lang/NoClassDefFoundError.java index 7e8e6ca..55d5f26 100644 --- a/libjava/classpath/java/lang/NoClassDefFoundError.java +++ b/libjava/classpath/java/lang/NoClassDefFoundError.java @@ -43,7 +43,7 @@ package java.lang; * Java Virtual Machine tries to load a class and no definition of the class * can be found. This could happen when using the <code>new</code> expression * or during a normal method call. The reason this would occur at runtime is - * because the missing class definition existed when the currently executing + * because the missing class definition existed when the currently executing * class was compiled, but now that definition cannot be found. * * @author Brian Jones diff --git a/libjava/classpath/java/lang/Object.java b/libjava/classpath/java/lang/Object.java index fbd1dc7..a6e7004 100644 --- a/libjava/classpath/java/lang/Object.java +++ b/libjava/classpath/java/lang/Object.java @@ -8,7 +8,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU diff --git a/libjava/classpath/java/lang/Package.java b/libjava/classpath/java/lang/Package.java index 1141a07..9220dfd 100644 --- a/libjava/classpath/java/lang/Package.java +++ b/libjava/classpath/java/lang/Package.java @@ -109,8 +109,8 @@ public class Package * that defines the Package. */ Package(String name, - String specTitle, String specVendor, String specVersion, - String implTitle, String implVendor, String implVersion, URL sealed) + String specTitle, String specVendor, String specVersion, + String implTitle, String implVendor, String implVersion, URL sealed) { this(name, specTitle, specVendor, specVersion, implTitle, implVendor, implVersion, sealed, null); @@ -121,7 +121,7 @@ public class Package * the <code>name</code> of the package may be <code>null</code>. * There are no public constructors defined for Package; this is a package * local constructor that is used by java.lang.Classloader.definePackage(). - * + * * @param name The name of the Package * @param specTitle The name of the specification * @param specVendor The name of the specification designer @@ -132,8 +132,8 @@ public class Package * @param sealed If sealed the origin of the package classes */ Package(String name, - String specTitle, String specVendor, String specVersion, - String implTitle, String implVendor, String implVersion, URL sealed, + String specTitle, String specVendor, String specVersion, + String implTitle, String implVendor, String implVersion, URL sealed, ClassLoader loader) { if (name == null) @@ -333,7 +333,7 @@ public class Package public String toString() { return ("package " + name + (specTitle == null ? "" : ", " + specTitle) - + (specVersion == null ? "" : ", version " + specVersion)); + + (specVersion == null ? "" : ", version " + specVersion)); } /** @@ -351,7 +351,7 @@ public class Package Annotation[] annotations = getAnnotations(); for (Annotation annotation : annotations) if (annotation.annotationType() == annotationClass) - foundAnnotation = (A) annotation; + foundAnnotation = (A) annotation; return foundAnnotation; } @@ -405,8 +405,8 @@ public class Package * @return true if an annotation exists for the specified type. * @since 1.5 */ - public boolean isAnnotationPresent(Class<? extends Annotation> - annotationClass) + public boolean isAnnotationPresent(Class<? extends Annotation> + annotationClass) { return getAnnotation(annotationClass) != null; } diff --git a/libjava/classpath/java/lang/ProcessBuilder.java b/libjava/classpath/java/lang/ProcessBuilder.java index 9ffe24c..0b32ede 100644 --- a/libjava/classpath/java/lang/ProcessBuilder.java +++ b/libjava/classpath/java/lang/ProcessBuilder.java @@ -204,7 +204,7 @@ public final class ProcessBuilder * indicates that the default behaviour of using the * working directory of the current process should * be adopted. - * + * * @return the working directory. */ public File directory() @@ -218,7 +218,7 @@ public final class ProcessBuilder * which indicates the default value should be used. * The default is the working directory of the current * process. - * + * * @param directory the new working directory. * @return a reference to this process builder. */ @@ -252,7 +252,7 @@ public final class ProcessBuilder * some may not allow any changes to the environment variables or * may prevent certain values being used. Attempts to do so will * throw an <code>UnsupportedOperationException</code> or - * <code>IllegalArgumentException</code>, respectively. + * <code>IllegalArgumentException</code>, respectively. * </p> * <p> * Use of this method may require a security check for the diff --git a/libjava/classpath/java/lang/Runtime.java b/libjava/classpath/java/lang/Runtime.java index 64ca5d9..3134c2a 100644 --- a/libjava/classpath/java/lang/Runtime.java +++ b/libjava/classpath/java/lang/Runtime.java @@ -93,11 +93,11 @@ public class Runtime { if (current != null) throw new InternalError("Attempt to recreate Runtime"); - + // If used by underlying VM this contains the directories where Classpath's own // native libraries are located. String bootPath = SystemProperties.getProperty("gnu.classpath.boot.library.path", ""); - + // If properly set by the user this contains the directories where the application's // native libraries are located. On operating systems where a LD_LIBRARY_PATH environment // variable is available a VM should preset java.library.path with value of this @@ -109,22 +109,22 @@ public class Runtime StringTokenizer t1 = new StringTokenizer(bootPath, pathSep); StringTokenizer t2 = new StringTokenizer(path, pathSep); libpath = new String[t1.countTokens() + t2.countTokens()]; - + int i = 0; while(t1.hasMoreTokens()) { String prefix = t1.nextToken(); if (! prefix.endsWith(fileSep)) prefix += fileSep; - + libpath[i] = prefix; i++; } - + while(t2.hasMoreTokens()) { String prefix = t2.nextToken(); if (! prefix.endsWith(fileSep)) prefix += fileSep; - + libpath[i] = prefix; i++; } @@ -185,8 +185,8 @@ public class Runtime // inside a join on our thread. exitSequence.interrupt(); // Shutdown hooks are still running, so we clear status to - // make sure we don't halt. - status = 0; + // make sure we don't halt. + status = 0; } } @@ -214,7 +214,7 @@ public class Runtime * Any subsequent invocations will simply return false. * Note that it is package accessible so that VMRuntime can call it * when VM exit is not triggered by a call to Runtime.exit(). - * + * * @return was the current thread the first one to call this method? */ boolean runShutdownHooks() @@ -286,8 +286,8 @@ public class Runtime shutdownHooks = null; } } - // Run finalization on all finalizable objects (even if they are - // still reachable). + // Run finalization on all finalizable objects (even if they are + // still reachable). VMRuntime.runFinalizationForExit(); } return first; @@ -750,15 +750,15 @@ public class Runtime String filename; if (loader != null && (filename = loader.findLibrary(libname)) != null) { - if (loadLib(filename, loader) != 0) - return; + if (loadLib(filename, loader) != 0) + return; } else { - filename = VMRuntime.mapLibraryName(libname); - for (int i = 0; i < libpath.length; i++) - if (loadLib(libpath[i] + filename, loader) != 0) - return; + filename = VMRuntime.mapLibraryName(libname); + for (int i = 0; i < libpath.length; i++) + if (loadLib(libpath[i] + filename, loader) != 0) + return; } throw new UnsatisfiedLinkError("Native library `" + libname + "' not found (as file `" + filename + "') in gnu.classpath.boot.library.path and java.library.path"); diff --git a/libjava/classpath/java/lang/SecurityException.java b/libjava/classpath/java/lang/SecurityException.java index 84be33c..f20fbe0 100644 --- a/libjava/classpath/java/lang/SecurityException.java +++ b/libjava/classpath/java/lang/SecurityException.java @@ -87,7 +87,7 @@ public class SecurityException extends RuntimeException * automatically incorporated into the resulting detail message of * this exception. * </p> - * + * * @param message the detail message, which should give the reason for * this exception being thrown. * @param cause the cause of this exception, or null if the cause @@ -115,7 +115,7 @@ public class SecurityException extends RuntimeException * This makes this constructor very useful for simply wrapping another * exception. * </p> - * + * * @param cause the cause of this exception, or null if the cause * is unknown. * @since 1.5 diff --git a/libjava/classpath/java/lang/SecurityManager.java b/libjava/classpath/java/lang/SecurityManager.java index ff84d95..d7adc11 100644 --- a/libjava/classpath/java/lang/SecurityManager.java +++ b/libjava/classpath/java/lang/SecurityManager.java @@ -225,7 +225,7 @@ public class SecurityManager * are from system classes</li> * <li>A check of <code>java.security.AllPermission</code> succeeds.</li> * </ul> - * + * * @return the most recent non-system ClassLoader on the execution stack * @deprecated use {@link #checkPermission(Permission)} instead */ @@ -248,7 +248,7 @@ public class SecurityManager * are from system classes</li> * <li>A check of <code>java.security.AllPermission</code> succeeds.</li> * </ul> - * + * * @return the most recent non-system Class on the execution stack * @deprecated use {@link #checkPermission(Permission)} instead */ @@ -287,7 +287,7 @@ public class SecurityManager * are from system classes</li> * <li>A check of <code>java.security.AllPermission</code> succeeds.</li> * </ul> - * + * * @return the index of the most recent non-system Class on the stack * @deprecated use {@link #checkPermission(Permission)} instead */ @@ -432,8 +432,8 @@ public class SecurityManager */ public void checkAccess(Thread thread) { - if (thread.getThreadGroup() != null - && thread.getThreadGroup().parent == null) + if (thread.getThreadGroup() != null + && thread.getThreadGroup().parent == null) checkPermission(new RuntimePermission("modifyThread")); } @@ -1062,10 +1062,10 @@ public class SecurityManager String list = (String)AccessController.doPrivileged(new PrivilegedAction() { - public Object run() + public Object run() { - return Security.getProperty(restriction); - } + return Security.getProperty(restriction); + } }); if (list == null || list.equals("")) @@ -1076,12 +1076,12 @@ public class SecurityManager StringTokenizer st = new StringTokenizer(list, ","); while (st.hasMoreTokens()) { - if (packageNamePlusDot.startsWith(st.nextToken())) - { - Permission p = new RuntimePermission(permission + packageName); - checkPermission(p); - return; - } + if (packageNamePlusDot.startsWith(st.nextToken())) + { + Permission p = new RuntimePermission(permission + packageName); + checkPermission(p); + return; + } } } } diff --git a/libjava/classpath/java/lang/StackTraceElement.java b/libjava/classpath/java/lang/StackTraceElement.java index 73e1a46..167272d 100644 --- a/libjava/classpath/java/lang/StackTraceElement.java +++ b/libjava/classpath/java/lang/StackTraceElement.java @@ -119,7 +119,7 @@ public final class StackTraceElement implements Serializable * @param fileName the name of the file, null if unknown * @param lineNumber the line in the file, negative if unknown, or -2 * if this method is native - * + * * @since 1.5 */ public StackTraceElement(String className, String methodName, String fileName, diff --git a/libjava/classpath/java/lang/StrictMath.java b/libjava/classpath/java/lang/StrictMath.java index 6eb1cb2..88f5e57 100644 --- a/libjava/classpath/java/lang/StrictMath.java +++ b/libjava/classpath/java/lang/StrictMath.java @@ -658,12 +658,12 @@ public final strictfp class StrictMath // 1. Replace x by |x| (sinh(-x) = -sinh(x)). // 2. // E + E/(E+1) - // 0 <= x <= 22 : sinh(x) := --------------, E=expm1(x) - // 2 + // 0 <= x <= 22 : sinh(x) := --------------, E=expm1(x) + // 2 // // 22 <= x <= lnovft : sinh(x) := exp(x)/2 // lnovft <= x <= ln2ovft: sinh(x) := exp(x/2)/2 * exp(x/2) - // ln2ovft < x : sinh(x) := +inf (overflow) + // ln2ovft < x : sinh(x) := +inf (overflow) double t, w, h; @@ -691,15 +691,15 @@ public final strictfp class StrictMath // |x| in [0, 22], return sign(x) * 0.5 * (E+E/(E+1)) if (h_bits < 0x40360000L) // |x| < 22 { - if (h_bits < 0x3e300000L) // |x| < 2^-28 - return x; // for tiny arguments return x + if (h_bits < 0x3e300000L) // |x| < 2^-28 + return x; // for tiny arguments return x - t = expm1(abs(x)); + t = expm1(abs(x)); - if (h_bits < 0x3ff00000L) - return h * (2.0 * t - t * t / (t + 1.0)); + if (h_bits < 0x3ff00000L) + return h * (2.0 * t - t * t / (t + 1.0)); - return h * (t + t / (t + 1.0)); + return h * (t + t / (t + 1.0)); } // |x| in [22, log(Double.MAX_VALUE)], return 0.5 * exp(|x|) @@ -708,12 +708,12 @@ public final strictfp class StrictMath // |x| in [log(Double.MAX_VALUE), overflowthreshold] if ((h_bits < 0x408633ceL) - || ((h_bits == 0x408633ceL) && (l_bits <= 0x8fb9f87dL))) + || ((h_bits == 0x408633ceL) && (l_bits <= 0x8fb9f87dL))) { - w = exp(0.5 * abs(x)); - t = h * w; + w = exp(0.5 * abs(x)); + t = h * w; - return t * w; + return t * w; } // |x| > overflowthershold @@ -749,12 +749,12 @@ public final strictfp class StrictMath // 0 <= x <= ln2/2 : cosh(x) := 1 + ------------------- // 2*exp(x) // - // exp(x) + 1/exp(x) + // exp(x) + 1/exp(x) // ln2/2 <= x <= 22 : cosh(x) := ------------------ - // 2 + // 2 // 22 <= x <= lnovft : cosh(x) := exp(x)/2 // lnovft <= x <= ln2ovft: cosh(x) := exp(x/2)/2 * exp(x/2) - // ln2ovft < x : cosh(x) := +inf (overflow) + // ln2ovft < x : cosh(x) := +inf (overflow) double t, w; long bits; @@ -776,22 +776,22 @@ public final strictfp class StrictMath // |x| in [0, 0.5 * ln(2)], return 1 + expm1(|x|)^2 / (2 * exp(|x|)) if (hx < 0x3fd62e43L) { - t = expm1(abs(x)); - w = 1.0 + t; + t = expm1(abs(x)); + w = 1.0 + t; - // for tiny arguments return 1. - if (hx < 0x3c800000L) - return w; + // for tiny arguments return 1. + if (hx < 0x3c800000L) + return w; - return 1.0 + (t * t) / (w + w); + return 1.0 + (t * t) / (w + w); } // |x| in [0.5 * ln(2), 22], return exp(|x|)/2 + 1 / (2 * exp(|x|)) if (hx < 0x40360000L) { - t = exp(abs(x)); + t = exp(abs(x)); - return 0.5 * t + 0.5 / t; + return 0.5 * t + 0.5 / t; } // |x| in [22, log(Double.MAX_VALUE)], return 0.5 * exp(|x|) @@ -801,12 +801,12 @@ public final strictfp class StrictMath // |x| in [log(Double.MAX_VALUE), overflowthreshold], // return exp(x/2)/2 * exp(x/2) if ((hx < 0x408633ceL) - || ((hx == 0x408633ceL) && (lx <= 0x8fb9f87dL))) + || ((hx == 0x408633ceL) && (lx <= 0x8fb9f87dL))) { - w = exp(0.5 * abs(x)); - t = 0.5 * w; + w = exp(0.5 * abs(x)); + t = 0.5 * w; - return t * w; + return t * w; } // |x| > overflowthreshold @@ -862,22 +862,22 @@ public final strictfp class StrictMath if (h_bits < 0x40360000L) // |x| < 22 { - if (h_bits < 0x3c800000L) // |x| < 2^-55 - return x * (1.0 + x); - - if (h_bits >= 0x3ff00000L) // |x| >= 1 - { - t = expm1(2.0 * abs(x)); - z = 1.0 - 2.0 / (t + 2.0); - } - else // |x| < 1 - { - t = expm1(-2.0 * abs(x)); - z = -t / (t + 2.0); - } + if (h_bits < 0x3c800000L) // |x| < 2^-55 + return x * (1.0 + x); + + if (h_bits >= 0x3ff00000L) // |x| >= 1 + { + t = expm1(2.0 * abs(x)); + z = 1.0 - 2.0 / (t + 2.0); + } + else // |x| < 1 + { + t = expm1(-2.0 * abs(x)); + z = -t / (t + 2.0); + } } else // |x| >= 22 - z = 1.0; + z = 1.0; return (x >= 0) ? z : -z; } @@ -909,7 +909,7 @@ public final strictfp class StrictMath private static double buildDouble(long lowDWord, long highDWord) { return Double.longBitsToDouble(((highDWord & 0xffffffffL) << 32) - | (lowDWord & 0xffffffffL)); + | (lowDWord & 0xffffffffL)); } /** @@ -960,26 +960,26 @@ public final strictfp class StrictMath if (bits < 0x0010000000000000L) // subnormal number { - t = TWO_54; - t *= x; + t = TWO_54; + t *= x; - // __HI(t)=__HI(t)/3+B2; - bits = Double.doubleToLongBits(t); - h = getHighDWord(bits); - l = getLowDWord(bits); + // __HI(t)=__HI(t)/3+B2; + bits = Double.doubleToLongBits(t); + h = getHighDWord(bits); + l = getLowDWord(bits); - h = h / 3 + CBRT_B2; + h = h / 3 + CBRT_B2; - t = buildDouble(l, h); + t = buildDouble(l, h); } else { - // __HI(t)=__HI(x)/3+B1; - h = getHighDWord(bits); - l = 0; + // __HI(t)=__HI(x)/3+B1; + h = getHighDWord(bits); + l = 0; - h = h / 3 + CBRT_B1; - t = buildDouble(l, h); + h = h / 3 + CBRT_B1; + t = buildDouble(l, h); } // new cbrt to 23 bits @@ -998,7 +998,7 @@ public final strictfp class StrictMath t = buildDouble(l, h); // one step newton iteration to 53 bits with error less than 0.667 ulps - s = t * t; // t * t is exact + s = t * t; // t * t is exact r = x / s; w = t + t; r = (r - t) / (w + r); // r - t is exact @@ -1087,75 +1087,75 @@ public final strictfp class StrictMath { // Method // 1. Argument reduction: - // Given x, find r and integer k such that + // Given x, find r and integer k such that // // x = k * ln(2) + r, |r| <= 0.5 * ln(2) // // Here a correction term c will be computed to compensate - // the error in r when rounded to a floating-point number. + // the error in r when rounded to a floating-point number. // // 2. Approximating expm1(r) by a special rational function on - // the interval [0, 0.5 * ln(2)]: - // Since - // r*(exp(r)+1)/(exp(r)-1) = 2 + r^2/6 - r^4/360 + ... - // we define R1(r*r) by - // r*(exp(r)+1)/(exp(r)-1) = 2 + r^2/6 * R1(r*r) - // That is, - // R1(r**2) = 6/r *((exp(r)+1)/(exp(r)-1) - 2/r) - // = 6/r * ( 1 + 2.0*(1/(exp(r)-1) - 1/r)) - // = 1 - r^2/60 + r^4/2520 - r^6/100800 + ... + // the interval [0, 0.5 * ln(2)]: + // Since + // r*(exp(r)+1)/(exp(r)-1) = 2 + r^2/6 - r^4/360 + ... + // we define R1(r*r) by + // r*(exp(r)+1)/(exp(r)-1) = 2 + r^2/6 * R1(r*r) + // That is, + // R1(r**2) = 6/r *((exp(r)+1)/(exp(r)-1) - 2/r) + // = 6/r * ( 1 + 2.0*(1/(exp(r)-1) - 1/r)) + // = 1 - r^2/60 + r^4/2520 - r^6/100800 + ... // We use a special Remes algorithm on [0, 0.347] to generate - // a polynomial of degree 5 in r*r to approximate R1. The - // maximum error of this polynomial approximation is bounded - // by 2**-61. In other words, - // R1(z) ~ 1.0 + Q1*z + Q2*z**2 + Q3*z**3 + Q4*z**4 + Q5*z**5 - // where Q1 = -1.6666666666666567384E-2, - // Q2 = 3.9682539681370365873E-4, - // Q3 = -9.9206344733435987357E-6, - // Q4 = 2.5051361420808517002E-7, - // Q5 = -6.2843505682382617102E-9; - // (where z=r*r, and Q1 to Q5 are called EXPM1_Qx in the source) - // with error bounded by - // | 5 | -61 - // | 1.0+Q1*z+...+Q5*z - R1(z) | <= 2 - // | | + // a polynomial of degree 5 in r*r to approximate R1. The + // maximum error of this polynomial approximation is bounded + // by 2**-61. In other words, + // R1(z) ~ 1.0 + Q1*z + Q2*z**2 + Q3*z**3 + Q4*z**4 + Q5*z**5 + // where Q1 = -1.6666666666666567384E-2, + // Q2 = 3.9682539681370365873E-4, + // Q3 = -9.9206344733435987357E-6, + // Q4 = 2.5051361420808517002E-7, + // Q5 = -6.2843505682382617102E-9; + // (where z=r*r, and Q1 to Q5 are called EXPM1_Qx in the source) + // with error bounded by + // | 5 | -61 + // | 1.0+Q1*z+...+Q5*z - R1(z) | <= 2 + // | | // - // expm1(r) = exp(r)-1 is then computed by the following - // specific way which minimize the accumulation rounding error: - // 2 3 - // r r [ 3 - (R1 + R1*r/2) ] - // expm1(r) = r + --- + --- * [--------------------] - // 2 2 [ 6 - r*(3 - R1*r/2) ] + // expm1(r) = exp(r)-1 is then computed by the following + // specific way which minimize the accumulation rounding error: + // 2 3 + // r r [ 3 - (R1 + R1*r/2) ] + // expm1(r) = r + --- + --- * [--------------------] + // 2 2 [ 6 - r*(3 - R1*r/2) ] // - // To compensate the error in the argument reduction, we use - // expm1(r+c) = expm1(r) + c + expm1(r)*c - // ~ expm1(r) + c + r*c - // Thus c+r*c will be added in as the correction terms for - // expm1(r+c). Now rearrange the term to avoid optimization - // screw up: - // ( 2 2 ) - // ({ ( r [ R1 - (3 - R1*r/2) ] ) } r ) - // expm1(r+c)~r - ({r*(--- * [--------------------]-c)-c} - --- ) - // ({ ( 2 [ 6 - r*(3 - R1*r/2) ] ) } 2 ) + // To compensate the error in the argument reduction, we use + // expm1(r+c) = expm1(r) + c + expm1(r)*c + // ~ expm1(r) + c + r*c + // Thus c+r*c will be added in as the correction terms for + // expm1(r+c). Now rearrange the term to avoid optimization + // screw up: + // ( 2 2 ) + // ({ ( r [ R1 - (3 - R1*r/2) ] ) } r ) + // expm1(r+c)~r - ({r*(--- * [--------------------]-c)-c} - --- ) + // ({ ( 2 [ 6 - r*(3 - R1*r/2) ] ) } 2 ) // ( ) // - // = r - E + // = r - E // 3. Scale back to obtain expm1(x): - // From step 1, we have - // expm1(x) = either 2^k*[expm1(r)+1] - 1 - // = or 2^k*[expm1(r) + (1-2^-k)] + // From step 1, we have + // expm1(x) = either 2^k*[expm1(r)+1] - 1 + // = or 2^k*[expm1(r) + (1-2^-k)] // 4. Implementation notes: - // (A). To save one multiplication, we scale the coefficient Qi - // to Qi*2^i, and replace z by (x^2)/2. - // (B). To achieve maximum accuracy, we compute expm1(x) by - // (i) if x < -56*ln2, return -1.0, (raise inexact if x!=inf) - // (ii) if k=0, return r-E - // (iii) if k=-1, return 0.5*(r-E)-0.5 - // (iv) if k=1 if r < -0.25, return 2*((r+0.5)- E) - // else return 1.0+2.0*(r-E); - // (v) if (k<-2||k>56) return 2^k(1-(E-r)) - 1 (or exp(x)-1) - // (vi) if k <= 20, return 2^k((1-2^-k)-(E-r)), else - // (vii) return 2^k(1-((E+2^-k)-r)) + // (A). To save one multiplication, we scale the coefficient Qi + // to Qi*2^i, and replace z by (x^2)/2. + // (B). To achieve maximum accuracy, we compute expm1(x) by + // (i) if x < -56*ln2, return -1.0, (raise inexact if x!=inf) + // (ii) if k=0, return r-E + // (iii) if k=-1, return 0.5*(r-E)-0.5 + // (iv) if k=1 if r < -0.25, return 2*((r+0.5)- E) + // else return 1.0+2.0*(r-E); + // (v) if (k<-2||k>56) return 2^k(1-(E-r)) - 1 (or exp(x)-1) + // (vi) if k <= 20, return 2^k((1-2^-k)-(E-r)), else + // (vii) return 2^k(1-((E+2^-k)-r)) boolean negative = (x < 0); double y, hi, lo, c, t, e, hxs, hfx, r1; @@ -1175,52 +1175,52 @@ public final strictfp class StrictMath // handle special cases and large arguments if (h_bits >= 0x4043687aL) // if |x| >= 56 * ln(2) { - if (h_bits >= 0x40862e42L) // if |x| >= EXP_LIMIT_H - { - if (h_bits >= 0x7ff00000L) - { - if (((h_bits & 0x000fffffL) | (l_bits & 0xffffffffL)) != 0) - return x; // exp(NaN) = NaN - else - return negative ? -1.0 : x; // exp({+-inf}) = {+inf, -1} - } - - if (x > EXP_LIMIT_H) - return Double.POSITIVE_INFINITY; // overflow - } - - if (negative) // x <= -56 * ln(2) - return -1.0; + if (h_bits >= 0x40862e42L) // if |x| >= EXP_LIMIT_H + { + if (h_bits >= 0x7ff00000L) + { + if (((h_bits & 0x000fffffL) | (l_bits & 0xffffffffL)) != 0) + return x; // exp(NaN) = NaN + else + return negative ? -1.0 : x; // exp({+-inf}) = {+inf, -1} + } + + if (x > EXP_LIMIT_H) + return Double.POSITIVE_INFINITY; // overflow + } + + if (negative) // x <= -56 * ln(2) + return -1.0; } // argument reduction if (h_bits > 0x3fd62e42L) // |x| > 0.5 * ln(2) { - if (h_bits < 0x3ff0a2b2L) // |x| < 1.5 * ln(2) - { - if (negative) - { - hi = x + LN2_H; - lo = -LN2_L; - k = -1; - } - else - { - hi = x - LN2_H; - lo = LN2_L; - k = 1; - } - } - else - { - k = (int) (INV_LN2 * x + (negative ? - 0.5 : 0.5)); - t = k; - hi = x - t * LN2_H; - lo = t * LN2_L; - } - - x = hi - lo; - c = (hi - x) - lo; + if (h_bits < 0x3ff0a2b2L) // |x| < 1.5 * ln(2) + { + if (negative) + { + hi = x + LN2_H; + lo = -LN2_L; + k = -1; + } + else + { + hi = x - LN2_H; + lo = LN2_L; + k = 1; + } + } + else + { + k = (int) (INV_LN2 * x + (negative ? - 0.5 : 0.5)); + t = k; + hi = x - t * LN2_H; + lo = t * LN2_L; + } + + x = hi - lo; + c = (hi - x) - lo; } else if (h_bits < 0x3c900000L) // |x| < 2^-54 return x @@ -1232,85 +1232,85 @@ public final strictfp class StrictMath hfx = 0.5 * x; hxs = x * hfx; r1 = 1.0 + hxs * (EXPM1_Q1 - + hxs * (EXPM1_Q2 + + hxs * (EXPM1_Q2 + hxs * (EXPM1_Q3 - + hxs * (EXPM1_Q4 - + hxs * EXPM1_Q5)))); + + hxs * (EXPM1_Q4 + + hxs * EXPM1_Q5)))); t = 3.0 - r1 * hfx; e = hxs * ((r1 - t) / (6.0 - x * t)); if (k == 0) { - return x - (x * e - hxs); // c == 0 + return x - (x * e - hxs); // c == 0 } else { - e = x * (e - c) - c; - e -= hxs; + e = x * (e - c) - c; + e -= hxs; - if (k == -1) - return 0.5 * (x - e) - 0.5; + if (k == -1) + return 0.5 * (x - e) - 0.5; - if (k == 1) - { - if (x < - 0.25) - return -2.0 * (e - (x + 0.5)); - else - return 1.0 + 2.0 * (x - e); - } + if (k == 1) + { + if (x < - 0.25) + return -2.0 * (e - (x + 0.5)); + else + return 1.0 + 2.0 * (x - e); + } - if (k <= -2 || k > 56) // sufficient to return exp(x) - 1 - { - y = 1.0 - (e - x); + if (k <= -2 || k > 56) // sufficient to return exp(x) - 1 + { + y = 1.0 - (e - x); - bits = Double.doubleToLongBits(y); - h_bits = getHighDWord(bits); - l_bits = getLowDWord(bits); + bits = Double.doubleToLongBits(y); + h_bits = getHighDWord(bits); + l_bits = getLowDWord(bits); - h_bits += (k << 20); // add k to y's exponent + h_bits += (k << 20); // add k to y's exponent - y = buildDouble(l_bits, h_bits); + y = buildDouble(l_bits, h_bits); - return y - 1.0; - } + return y - 1.0; + } - t = 1.0; - if (k < 20) - { - bits = Double.doubleToLongBits(t); - h_bits = 0x3ff00000L - (0x00200000L >> k); - l_bits = getLowDWord(bits); + t = 1.0; + if (k < 20) + { + bits = Double.doubleToLongBits(t); + h_bits = 0x3ff00000L - (0x00200000L >> k); + l_bits = getLowDWord(bits); - t = buildDouble(l_bits, h_bits); // t = 1 - 2^(-k) - y = t - (e - x); + t = buildDouble(l_bits, h_bits); // t = 1 - 2^(-k) + y = t - (e - x); - bits = Double.doubleToLongBits(y); - h_bits = getHighDWord(bits); - l_bits = getLowDWord(bits); + bits = Double.doubleToLongBits(y); + h_bits = getHighDWord(bits); + l_bits = getLowDWord(bits); - h_bits += (k << 20); // add k to y's exponent + h_bits += (k << 20); // add k to y's exponent - y = buildDouble(l_bits, h_bits); - } - else - { - bits = Double.doubleToLongBits(t); - h_bits = (0x000003ffL - k) << 20; - l_bits = getLowDWord(bits); + y = buildDouble(l_bits, h_bits); + } + else + { + bits = Double.doubleToLongBits(t); + h_bits = (0x000003ffL - k) << 20; + l_bits = getLowDWord(bits); - t = buildDouble(l_bits, h_bits); // t = 2^(-k) + t = buildDouble(l_bits, h_bits); // t = 2^(-k) - y = x - (e + t); - y += 1.0; + y = x - (e + t); + y += 1.0; - bits = Double.doubleToLongBits(y); - h_bits = getHighDWord(bits); - l_bits = getLowDWord(bits); + bits = Double.doubleToLongBits(y); + h_bits = getHighDWord(bits); + l_bits = getLowDWord(bits); - h_bits += (k << 20); // add k to y's exponent + h_bits += (k << 20); // add k to y's exponent - y = buildDouble(l_bits, h_bits); - } + y = buildDouble(l_bits, h_bits); + } } return y; @@ -2504,7 +2504,7 @@ public final strictfp class StrictMath * <li>If <code>a</code> is positive or negative zero, the result is the * same.</li> * </ul> - * + * * @param a the numeric argument. * @return the sign of the argument. * @since 1.5. @@ -2526,7 +2526,7 @@ public final strictfp class StrictMath * <li>If <code>a</code> is positive or negative zero, the result is the * same.</li> * </ul> - * + * * @param a the numeric argument. * @return the sign of the argument. * @since 1.5. diff --git a/libjava/classpath/java/lang/String.java b/libjava/classpath/java/lang/String.java index c8c6cb9..45c0daf 100644 --- a/libjava/classpath/java/lang/String.java +++ b/libjava/classpath/java/lang/String.java @@ -107,7 +107,7 @@ public final class String * @see CharData#UPPER_EXPAND */ private static final char[] upperExpand - = zeroBasedStringValue(CharData.UPPER_EXPAND); + = zeroBasedStringValue(CharData.UPPER_EXPAND); /** * Stores unicode multi-character uppercase special casing table. @@ -115,8 +115,8 @@ public final class String * @see CharData#UPPER_SPECIAL */ private static final char[] upperSpecial - = zeroBasedStringValue(CharData.UPPER_SPECIAL); - + = zeroBasedStringValue(CharData.UPPER_SPECIAL); + /** * Characters which make up the String. * Package access is granted for use by StringBuffer. @@ -281,7 +281,7 @@ public final class String // equivalent to: offset + count < 0 || offset + count > ascii.length if (ascii.length - offset < count) throw new StringIndexOutOfBoundsException("offset + count: " - + (offset + count)); + + (offset + count)); value = new char[count]; this.offset = 0; this.count = count; @@ -355,18 +355,18 @@ public final class String { try { - return Charset.forName(encoding); + return Charset.forName(encoding); } catch(IllegalCharsetNameException e) { - throw new UnsupportedEncodingException("Encoding: "+encoding+ - " not found."); + throw new UnsupportedEncodingException("Encoding: "+encoding+ + " not found."); } catch(UnsupportedCharsetException e) { - throw new UnsupportedEncodingException("Encoding: "+encoding+ - " not found."); - } + throw new UnsupportedEncodingException("Encoding: "+encoding+ + " not found."); + } } /** @@ -397,31 +397,31 @@ public final class String // equivalent to: offset + count < 0 || offset + count > data.length if (data.length - offset < count) throw new StringIndexOutOfBoundsException("offset + count: " - + (offset + count)); - try + + (offset + count)); + try { CharsetDecoder csd = encoding.newDecoder(); - csd.onMalformedInput(CodingErrorAction.REPLACE); - csd.onUnmappableCharacter(CodingErrorAction.REPLACE); - CharBuffer cbuf = csd.decode(ByteBuffer.wrap(data, offset, count)); - if(cbuf.hasArray()) - { - value = cbuf.array(); - this.offset = cbuf.position(); - this.count = cbuf.remaining(); - } else { - // Doubt this will happen. But just in case. - value = new char[cbuf.remaining()]; - cbuf.get(value); - this.offset = 0; - this.count = value.length; - } - } + csd.onMalformedInput(CodingErrorAction.REPLACE); + csd.onUnmappableCharacter(CodingErrorAction.REPLACE); + CharBuffer cbuf = csd.decode(ByteBuffer.wrap(data, offset, count)); + if(cbuf.hasArray()) + { + value = cbuf.array(); + this.offset = cbuf.position(); + this.count = cbuf.remaining(); + } else { + // Doubt this will happen. But just in case. + value = new char[cbuf.remaining()]; + cbuf.get(value); + this.offset = 0; + this.count = value.length; + } + } catch(CharacterCodingException e) { - // This shouldn't ever happen. - throw (InternalError) new InternalError().initCause(e); - } + // This shouldn't ever happen. + throw (InternalError) new InternalError().initCause(e); + } } /** @@ -494,39 +494,39 @@ public final class String // equivalent to: offset + count < 0 || offset + count > data.length if (data.length - offset < count) throw new StringIndexOutOfBoundsException("offset + count: " - + (offset + count)); + + (offset + count)); int o, c; char[] v; String encoding; - try - { - encoding = System.getProperty("file.encoding"); - CharsetDecoder csd = Charset.forName(encoding).newDecoder(); - csd.onMalformedInput(CodingErrorAction.REPLACE); - csd.onUnmappableCharacter(CodingErrorAction.REPLACE); - CharBuffer cbuf = csd.decode(ByteBuffer.wrap(data, offset, count)); - if(cbuf.hasArray()) - { + try + { + encoding = System.getProperty("file.encoding"); + CharsetDecoder csd = Charset.forName(encoding).newDecoder(); + csd.onMalformedInput(CodingErrorAction.REPLACE); + csd.onUnmappableCharacter(CodingErrorAction.REPLACE); + CharBuffer cbuf = csd.decode(ByteBuffer.wrap(data, offset, count)); + if(cbuf.hasArray()) + { v = cbuf.array(); - o = cbuf.position(); - c = cbuf.remaining(); - } else { - // Doubt this will happen. But just in case. - v = new char[cbuf.remaining()]; - cbuf.get(v); - o = 0; - c = v.length; - } - } catch(Exception ex){ - // If anything goes wrong (System property not set, - // NIO provider not available, etc) - // Default to the 'safe' encoding ISO8859_1 - v = new char[count]; - o = 0; - c = count; - for (int i=0;i<count;i++) - v[i] = (char)data[offset+i]; - } + o = cbuf.position(); + c = cbuf.remaining(); + } else { + // Doubt this will happen. But just in case. + v = new char[cbuf.remaining()]; + cbuf.get(v); + o = 0; + c = v.length; + } + } catch(Exception ex){ + // If anything goes wrong (System property not set, + // NIO provider not available, etc) + // Default to the 'safe' encoding ISO8859_1 + v = new char[count]; + o = 0; + c = count; + for (int i=0;i<count;i++) + v[i] = (char)data[offset+i]; + } this.value = v; this.offset = o; this.count = c; @@ -610,7 +610,7 @@ public final class String // equivalent to: offset + count < 0 || offset + count > data.length if (data.length - offset < count) throw new StringIndexOutOfBoundsException("offset + count: " - + (offset + count)); + + (offset + count)); if (dont_copy) { value = data; @@ -631,7 +631,7 @@ public final class String * @param codePoints the entire array of code points * @param offset the start of the subarray * @param count the length of the subarray - * + * * @throws IllegalArgumentException if an invalid code point is found * in the codePoints array * @throws IndexOutOfBoundsException if offset is negative or offset + count @@ -640,34 +640,34 @@ public final class String public String(int[] codePoints, int offset, int count) { // FIXME: This implementation appears to give correct internal - // representation of the String because: + // representation of the String because: // - length() is correct - // - getting a char[] from toCharArray() and testing + // - getting a char[] from toCharArray() and testing // Character.codePointAt() on all the characters in that array gives // the appropriate results - // however printing the String gives incorrect results. This may be + // however printing the String gives incorrect results. This may be // due to printing method errors (such as incorrectly looping through // the String one char at a time rather than one "character" at a time. - + if (offset < 0) throw new IndexOutOfBoundsException(); int end = offset + count; int pos = 0; // This creates a char array that is long enough for all of the code // points to represent supplementary characters. This is more than likely - // a waste of storage, so we use it only temporarily and then copy the + // a waste of storage, so we use it only temporarily and then copy the // used portion into the value array. char[] temp = new char[2 * codePoints.length]; for (int i = offset; i < end; i++) { - pos += Character.toChars(codePoints[i], temp, pos); + pos += Character.toChars(codePoints[i], temp, pos); } this.count = pos; this.value = new char[pos]; System.arraycopy(temp, 0, value, 0, pos); this.offset = 0; } - + /** * Returns the number of characters contained in this String. * @@ -813,25 +813,25 @@ public final class String */ public byte[] getBytes(Charset enc) { - try + try { - CharsetEncoder cse = enc.newEncoder(); - cse.onMalformedInput(CodingErrorAction.REPLACE); - cse.onUnmappableCharacter(CodingErrorAction.REPLACE); - ByteBuffer bbuf = cse.encode(CharBuffer.wrap(value, offset, count)); - if(bbuf.hasArray()) - return bbuf.array(); - - // Doubt this will happen. But just in case. - byte[] bytes = new byte[bbuf.remaining()]; - bbuf.get(bytes); - return bytes; - } + CharsetEncoder cse = enc.newEncoder(); + cse.onMalformedInput(CodingErrorAction.REPLACE); + cse.onUnmappableCharacter(CodingErrorAction.REPLACE); + ByteBuffer bbuf = cse.encode(CharBuffer.wrap(value, offset, count)); + if(bbuf.hasArray()) + return bbuf.array(); + + // Doubt this will happen. But just in case. + byte[] bytes = new byte[bbuf.remaining()]; + bbuf.get(bytes); + return bytes; + } catch(CharacterCodingException e) { - // This shouldn't ever happen. - throw (InternalError) new InternalError().initCause(e); - } + // This shouldn't ever happen. + throw (InternalError) new InternalError().initCause(e); + } } /** @@ -845,18 +845,18 @@ public final class String * @since 1.1 */ public byte[] getBytes() - { - try - { - return getBytes(System.getProperty("file.encoding")); - } catch(Exception e) { - // XXX - Throw an error here? - // For now, default to the 'safe' encoding. - byte[] bytes = new byte[count]; - for(int i=0;i<count;i++) - bytes[i] = (byte)((value[offset+i] <= 0xFF)? - value[offset+i]:'?'); - return bytes; + { + try + { + return getBytes(System.getProperty("file.encoding")); + } catch(Exception e) { + // XXX - Throw an error here? + // For now, default to the 'safe' encoding. + byte[] bytes = new byte[count]; + for(int i=0;i<count;i++) + bytes[i] = (byte)((value[offset+i] <= 0xFF)? + value[offset+i]:'?'); + return bytes; } } @@ -929,7 +929,7 @@ public final class String return false; for (int i = 0; i < count; ++i) if (value[offset + i] != seq.charAt(i)) - return false; + return false; return true; } @@ -1025,7 +1025,7 @@ public final class String return result; } return count - str.count; - } + } /** * Predicate which determines if this String matches another String @@ -1789,7 +1789,7 @@ public final class String if (begin == limit) return ""; while (value[begin++] <= '\u0020'); - + int end = limit; while (value[--end] <= '\u0020') ; @@ -1991,10 +1991,10 @@ public final class String } /** - * If two Strings are considered equal, by the equals() method, - * then intern() will return the same String instance. ie. - * if (s1.equals(s2)) then (s1.intern() == s2.intern()). - * All string literals and string-valued constant expressions + * If two Strings are considered equal, by the equals() method, + * then intern() will return the same String instance. ie. + * if (s1.equals(s2)) then (s1.intern() == s2.intern()). + * All string literals and string-valued constant expressions * are already interned. * * @return the interned String @@ -2026,23 +2026,23 @@ public final class String int count = 0; while (start < end) { - char base = value[start]; - if (base < Character.MIN_HIGH_SURROGATE - || base > Character.MAX_HIGH_SURROGATE - || start == end - || start == count - || value[start + 1] < Character.MIN_LOW_SURROGATE - || value[start + 1] > Character.MAX_LOW_SURROGATE) - { - // Nothing. - } - else - { - // Surrogate pair. - ++start; - } - ++start; - ++count; + char base = value[start]; + if (base < Character.MIN_HIGH_SURROGATE + || base > Character.MAX_HIGH_SURROGATE + || start == end + || start == count + || value[start + 1] < Character.MIN_LOW_SURROGATE + || value[start + 1] > Character.MAX_LOW_SURROGATE) + { + // Nothing. + } + else + { + // Surrogate pair. + ++start; + } + ++start; + ++count; } return count; } @@ -2111,30 +2111,30 @@ public final class String value = s.value; else { - int count = s.count; - value = new char[count]; - VMSystem.arraycopy(s.value, s.offset, value, 0, count); + int count = s.count; + value = new char[count]; + VMSystem.arraycopy(s.value, s.offset, value, 0, count); } return value; } - + /** * Returns true iff this String contains the sequence of Characters * described in s. * @param s the CharSequence * @return true iff this String contains s - * + * * @since 1.5 */ public boolean contains (CharSequence s) { return this.indexOf(s.toString()) != -1; } - + /** * Returns a string that is this string with all instances of the sequence - * represented by <code>target</code> replaced by the sequence in + * represented by <code>target</code> replaced by the sequence in * <code>replacement</code>. * @param target the sequence to be replaced * @param replacement the sequence used as the replacement @@ -2146,9 +2146,9 @@ public final class String String replaceString = replacement.toString(); int targetLength = target.length(); int replaceLength = replacement.length(); - + int startPos = this.indexOf(targetString); - CPStringBuilder result = new CPStringBuilder(this); + CPStringBuilder result = new CPStringBuilder(this); while (startPos != -1) { // Replace the target with the replacement @@ -2159,15 +2159,15 @@ public final class String } return result.toString(); } - + /** - * Return the index into this String that is offset from the given index by + * Return the index into this String that is offset from the given index by * <code>codePointOffset</code> code points. * @param index the index at which to start * @param codePointOffset the number of code points to offset * @return the index into this String that is <code>codePointOffset</code> * code points offset from <code>index</code>. - * + * * @throws IndexOutOfBoundsException if index is negative or larger than the * length of this string. * @throws IndexOutOfBoundsException if codePointOffset is positive and the @@ -2180,7 +2180,7 @@ public final class String { if (index < 0 || index > count) throw new IndexOutOfBoundsException(); - + return Character.offsetByCodePoints(value, offset, count, offset + index, codePointOffset); } diff --git a/libjava/classpath/java/lang/StringBuffer.java b/libjava/classpath/java/lang/StringBuffer.java index b105f55..81a52f6 100644 --- a/libjava/classpath/java/lang/StringBuffer.java +++ b/libjava/classpath/java/lang/StringBuffer.java @@ -691,7 +691,7 @@ public final class StringBuffer * @since 1.5 */ public synchronized StringBuffer insert(int offset, CharSequence sequence, - int start, int end) + int start, int end) { super.insert(offset, sequence, start, end); return this; diff --git a/libjava/classpath/java/lang/StringBuilder.java b/libjava/classpath/java/lang/StringBuilder.java index aefe927..83a064a 100644 --- a/libjava/classpath/java/lang/StringBuilder.java +++ b/libjava/classpath/java/lang/StringBuilder.java @@ -291,7 +291,7 @@ public final class StringBuilder * @return this <code>StringBuilder</code> */ public StringBuilder append(CharSequence seq, int start, - int end) + int end) { super.append(seq, start, end); return this; @@ -487,7 +487,7 @@ public final class StringBuilder * @throws StringIndexOutOfBoundsException if any index is out of bounds */ public StringBuilder insert(int offset, - char[] str, int str_offset, int len) + char[] str, int str_offset, int len) { super.insert(offset, str, str_offset, len); return this; @@ -556,7 +556,7 @@ public final class StringBuilder * or end are out of bounds */ public StringBuilder insert(int offset, CharSequence sequence, - int start, int end) + int start, int end) { super.insert(offset, sequence, start, end); return this; diff --git a/libjava/classpath/java/lang/System.java b/libjava/classpath/java/lang/System.java index 58b1bba..39d6da2 100644 --- a/libjava/classpath/java/lang/System.java +++ b/libjava/classpath/java/lang/System.java @@ -134,7 +134,7 @@ public final class System SecurityManager sm = SecurityManager.current; // Be thread-safe. if (sm != null) sm.checkPermission(new RuntimePermission("setIO")); - + VMSystem.setIn(in); } @@ -151,7 +151,7 @@ public final class System { SecurityManager sm = SecurityManager.current; // Be thread-safe. if (sm != null) - sm.checkPermission(new RuntimePermission("setIO")); + sm.checkPermission(new RuntimePermission("setIO")); VMSystem.setOut(out); } @@ -202,15 +202,15 @@ public final class System // preload it here. if (SecurityManager.current == null) { - try - { - Class.forName("java.security.Security"); - } - catch (ClassNotFoundException e) - { - } + try + { + Class.forName("java.security.Security"); + } + catch (ClassNotFoundException e) + { + } } - + SecurityManager.current = sm; } @@ -237,8 +237,8 @@ public final class System { return VMSystem.currentTimeMillis(); } - - /** + + /** * <p> * Returns the current value of a nanosecond-precise system timer. * The value of the timer is an offset relative to some arbitrary fixed @@ -261,7 +261,7 @@ public final class System * </p> * * @return the time of a system timer in nanoseconds. - * @since 1.5 + * @since 1.5 */ public static long nanoTime() { @@ -365,7 +365,7 @@ public final class System * <dt>gnu.java.io.encoding_scheme_alias.iso-latin-_?</dt> <dd>8859_?</dd> * <dt>gnu.java.io.encoding_scheme_alias.latin?</dt> <dd>8859_?</dd> * <dt>gnu.java.io.encoding_scheme_alias.utf-8</dt> <dd>UTF8</dd> - * <dt>gnu.java.util.zoneinfo.dir</dt> <dd>Root of zoneinfo tree</dd> + * <dt>gnu.java.util.zoneinfo.dir</dt> <dd>Root of zoneinfo tree</dd> * <dt>gnu.javax.print.server</dt> <dd>Hostname of external CUPS server.</dd> * </dl> * @@ -549,7 +549,7 @@ public final class System if (environmentMap == null) { - Map<String,String> variables = new EnvironmentMap(); + Map<String,String> variables = new EnvironmentMap(); List<String> environ = (List<String>)VMSystem.environ(); for (String envEntry : environ) { @@ -558,16 +558,16 @@ public final class System { // it's perfectly legal that some entries may be in the form // key=value=value=value - int equalSignIndex = envEntry.indexOf('='); + int equalSignIndex = envEntry.indexOf('='); String key = envEntry.substring(0, equalSignIndex); String value = envEntry.substring(equalSignIndex + 1); variables.put(key, value); } } - + environmentMap = Collections.unmodifiableMap(variables); } - + return environmentMap; } @@ -731,7 +731,7 @@ public final class System { c = coll; } - + /** * Blocks queries containing a null object or an object which * isn't of type <code>String</code>. All other queries @@ -745,15 +745,15 @@ public final class System public boolean contains(Object obj) { if (obj == null) - throw new - NullPointerException("This collection does not support " + - "null values."); + throw new + NullPointerException("This collection does not support " + + "null values."); if (!(obj instanceof String)) - throw new - ClassCastException("This collection only supports Strings."); + throw new + ClassCastException("This collection only supports Strings."); return c.contains(obj); } - + /** * Blocks queries where the collection contains a null object or * an object which isn't of type <code>String</code>. All other @@ -768,15 +768,15 @@ public final class System public boolean containsAll(Collection<?> coll) { for (Object o: coll) - { - if (o == null) - throw new - NullPointerException("This collection does not support " + - "null values."); - if (!(o instanceof String)) - throw new - ClassCastException("This collection only supports Strings."); - } + { + if (o == null) + throw new + NullPointerException("This collection does not support " + + "null values."); + if (!(o instanceof String)) + throw new + ClassCastException("This collection only supports Strings."); + } return c.containsAll(coll); } @@ -790,7 +790,7 @@ public final class System { return c.iterator(); } - + /** * Blocks the removal of elements from the collection. * @@ -802,15 +802,15 @@ public final class System public boolean remove(Object key) { if (key == null) - throw new - NullPointerException("This collection does not support " + - "null values."); + throw new + NullPointerException("This collection does not support " + + "null values."); if (!(key instanceof String)) - throw new - ClassCastException("This collection only supports Strings."); + throw new + ClassCastException("This collection only supports Strings."); return c.contains(key); - } - + } + /** * Blocks the removal of all elements in the specified * collection from the collection. @@ -824,18 +824,18 @@ public final class System public boolean removeAll(Collection<?> coll) { for (Object o: coll) - { - if (o == null) - throw new - NullPointerException("This collection does not support " + - "null values."); - if (!(o instanceof String)) - throw new - ClassCastException("This collection only supports Strings."); - } + { + if (o == null) + throw new + NullPointerException("This collection does not support " + + "null values."); + if (!(o instanceof String)) + throw new + ClassCastException("This collection only supports Strings."); + } return c.removeAll(coll); } - + /** * Blocks the retention of all elements in the specified * collection from the collection. @@ -849,15 +849,15 @@ public final class System public boolean retainAll(Collection<?> coll) { for (Object o: coll) - { - if (o == null) - throw new - NullPointerException("This collection does not support " + - "null values."); - if (!(o instanceof String)) - throw new - ClassCastException("This collection only supports Strings."); - } + { + if (o == null) + throw new + NullPointerException("This collection does not support " + + "null values."); + if (!(o instanceof String)) + throw new + ClassCastException("This collection only supports Strings."); + } return c.containsAll(coll); } @@ -877,14 +877,14 @@ public final class System /** * This is a specialised <code>HashMap</code>, which * prevents the addition or querying of anything other than - * <code>String</code> objects. + * <code>String</code> objects. * * @author Andrew John Hughes (gnu_andrew@member.fsf.org) */ static class EnvironmentMap extends HashMap<String,String> { - + /** * Cache the entry set. */ @@ -915,7 +915,7 @@ public final class System * @param m the map to be added to this. * @throws NullPointerException if a key or value is null. * @throws ClassCastException if a key or value is not a String. - */ + */ EnvironmentMap(Map<String,String> m) { super(m); @@ -933,14 +933,14 @@ public final class System public boolean containsKey(Object key) { if (key == null) - throw new - NullPointerException("This map does not support null keys."); + throw new + NullPointerException("This map does not support null keys."); if (!(key instanceof String)) - throw new - ClassCastException("This map only allows queries using Strings."); + throw new + ClassCastException("This map only allows queries using Strings."); return super.containsKey(key); } - + /** * Blocks queries using a null or non-<code>String</code> value. * All other queries are forwarded to the superclass. @@ -952,11 +952,11 @@ public final class System public boolean containsValue(Object value) { if (value == null) - throw new - NullPointerException("This map does not support null values."); + throw new + NullPointerException("This map does not support null values."); if (!(value instanceof String)) - throw new - ClassCastException("This map only allows queries using Strings."); + throw new + ClassCastException("This map only allows queries using Strings."); return super.containsValue(value); } @@ -985,14 +985,14 @@ public final class System public String get(Object key) { if (key == null) - throw new - NullPointerException("This map does not support null keys."); + throw new + NullPointerException("This map does not support null keys."); if (!(key instanceof String)) - throw new - ClassCastException("This map only allows queries using Strings."); + throw new + ClassCastException("This map only allows queries using Strings."); return super.get(key); } - + /** * Returns a set view of the keys, with the same * provisions as for the underlying map. @@ -1021,13 +1021,13 @@ public final class System public String put(String key, String value) { if (key == null) - throw new NullPointerException("A new key is null."); + throw new NullPointerException("A new key is null."); if (value == null) - throw new NullPointerException("A new value is null."); + throw new NullPointerException("A new value is null."); if (!(key instanceof String)) - throw new ClassCastException("A new key is not a String."); + throw new ClassCastException("A new key is not a String."); if (!(value instanceof String)) - throw new ClassCastException("A new value is not a String."); + throw new ClassCastException("A new value is not a String."); return super.put(key, value); } @@ -1043,14 +1043,14 @@ public final class System public String remove(Object key) { if (key == null) - throw new - NullPointerException("This map does not support null keys."); + throw new + NullPointerException("This map does not support null keys."); if (!(key instanceof String)) - throw new - ClassCastException("This map only allows queries using Strings."); + throw new + ClassCastException("This map only allows queries using Strings."); return super.remove(key); } - + /** * Returns a collection view of the values, with the same * provisions as for the underlying map. @@ -1063,7 +1063,7 @@ public final class System values = new EnvironmentCollection(super.values()); return values; } - + } /** diff --git a/libjava/classpath/java/lang/Thread.java b/libjava/classpath/java/lang/Thread.java index 82e7261..bc2dbb5 100644 --- a/libjava/classpath/java/lang/Thread.java +++ b/libjava/classpath/java/lang/Thread.java @@ -143,13 +143,13 @@ public class Thread implements Runnable /** This thread's ID. */ private final long threadId; - + /** The park blocker. See LockSupport. */ Object parkBlocker; /** The next thread number to use. */ private static int numAnonymousThreadsCreated; - + /** Used to generate the next thread ID to use. */ private static long totalThreadsCreated; @@ -354,10 +354,10 @@ public class Thread implements Runnable Thread current = currentThread(); if (group == null) { - if (sm != null) - group = sm.getThreadGroup(); - if (group == null) - group = current.group; + if (sm != null) + group = sm.getThreadGroup(); + if (group == null) + group = current.group; } if (sm != null) sm.checkAccess(group); @@ -368,7 +368,7 @@ public class Thread implements Runnable this.runnable = target; this.stacksize = size; this.locals = new ThreadLocalMap(); - + synchronized (Thread.class) { this.threadId = ++totalThreadsCreated; @@ -422,7 +422,7 @@ public class Thread implements Runnable this.threadId = ++totalThreadsCreated; } } - + /** * Generate a name for an anonymous thread. */ @@ -510,7 +510,7 @@ public class Thread implements Runnable { throw new NoSuchMethodError(); } - + /** * Print a stack trace of the current thread to stderr using the same * format as Throwable's printStackTrace() method. @@ -540,7 +540,7 @@ public class Thread implements Runnable { return currentThread().group.enumerate(array); } - + /** * Get this Thread's name. * @@ -731,7 +731,7 @@ public class Thread implements Runnable if (t != null) t.resume(); } - + /** * The method of Thread that will be run if there is no Runnable object * associated with the Thread. Thread's implementation does nothing at all. @@ -788,7 +788,7 @@ public class Thread implements Runnable if (loader != null && sm != null) { // Get the calling classloader - ClassLoader cl = VMStackWalker.getCallingClassLoader(); + ClassLoader cl = VMStackWalker.getCallingClassLoader(); if (cl != null && !cl.isAncestorOf(loader)) sm.checkPermission(new RuntimePermission("getClassLoader")); } @@ -921,7 +921,7 @@ public class Thread implements Runnable VMThread.create(this, stacksize); } - + /** * Cause this Thread to stop abnormally because of the throw of a ThreadDeath * error. If you stop a Thread that has not yet started, it will stop @@ -992,9 +992,9 @@ public class Thread implements Runnable } VMThread vt = vmThread; if (vt != null) - vt.stop(t); + vt.stop(t); else - stillborn = t; + stillborn = t; } /** @@ -1055,7 +1055,7 @@ public class Thread implements Runnable public String toString() { return ("Thread[" + name + "," + priority + "," - + (group == null ? "" : group.getName()) + "]"); + + (group == null ? "" : group.getName()) + "]"); } /** @@ -1076,7 +1076,7 @@ public class Thread implements Runnable return currentThread().locals; } - /** + /** * Assigns the given <code>UncaughtExceptionHandler</code> to this * thread. This will then be called if the thread terminates due * to an uncaught exception, pre-empting that of the @@ -1084,17 +1084,17 @@ public class Thread implements Runnable * * @param h the handler to use for this thread. * @throws SecurityException if the current thread can't modify this thread. - * @since 1.5 + * @since 1.5 */ public void setUncaughtExceptionHandler(UncaughtExceptionHandler h) { SecurityManager sm = SecurityManager.current; // Be thread-safe. if (sm != null) - sm.checkAccess(this); + sm.checkAccess(this); exceptionHandler = h; } - /** + /** * <p> * Returns the handler used when this thread terminates due to an * uncaught exception. The handler used is determined by the following: @@ -1107,17 +1107,17 @@ public class Thread implements Runnable * (which can only happen when the thread was terminated since * then it won't have an associated thread group anymore).</li> * </ul> - * + * * @return the appropriate <code>UncaughtExceptionHandler</code> or * <code>null</code> if one can't be obtained. - * @since 1.5 + * @since 1.5 */ public UncaughtExceptionHandler getUncaughtExceptionHandler() { return exceptionHandler != null ? exceptionHandler : group; } - /** + /** * <p> * Sets the default uncaught exception handler used when one isn't * provided by the thread or its associated <code>ThreadGroup</code>. @@ -1137,36 +1137,36 @@ public class Thread implements Runnable * @throws SecurityException if a security manager is present and * disallows the runtime permission * "setDefaultUncaughtExceptionHandler". - * @since 1.5 + * @since 1.5 */ - public static void + public static void setDefaultUncaughtExceptionHandler(UncaughtExceptionHandler h) { SecurityManager sm = SecurityManager.current; // Be thread-safe. if (sm != null) - sm.checkPermission(new RuntimePermission("setDefaultUncaughtExceptionHandler")); + sm.checkPermission(new RuntimePermission("setDefaultUncaughtExceptionHandler")); defaultHandler = h; } - /** + /** * Returns the handler used by default when a thread terminates * unexpectedly due to an exception, or <code>null</code> if one doesn't * exist. * * @return the default uncaught exception handler. - * @since 1.5 + * @since 1.5 */ public static UncaughtExceptionHandler getDefaultUncaughtExceptionHandler() { return defaultHandler; } - - /** + + /** * Returns the unique identifier for this thread. This ID is generated * on thread creation, and may be re-used on its death. * * @return a positive long number representing the thread's ID. - * @since 1.5 + * @since 1.5 */ public long getId() { @@ -1231,7 +1231,7 @@ public class Thread implements Runnable void uncaughtException(Thread thr, Throwable exc); } - /** + /** * <p> * Represents the current state of a thread, according to the VM rather * than the operating system. It can be one of the following: @@ -1249,7 +1249,7 @@ public class Thread implements Runnable * <li>TERMINATED -- The thread has exited.</li> * </ul> * - * @since 1.5 + * @since 1.5 */ public enum State { @@ -1296,7 +1296,7 @@ public class Thread implements Runnable * by the thread, with the most recent method forming the * first element in the array. The array will be empty * if the virtual machine can not obtain information on the - * thread. + * thread. * </p> * <p> * To execute this method, the current security manager @@ -1304,7 +1304,7 @@ public class Thread implements Runnable * <code>"getStackTrace"</code> and * <code>"modifyThreadGroup"</code> {@link RuntimePermission}s. * </p> - * + * * @return a map of threads to arrays of {@link StackTraceElement}s. * @throws SecurityException if a security manager exists, and * prevents either or both the runtime @@ -1322,14 +1322,14 @@ public class Thread implements Runnable int filled = group.enumerate(threadList); while (filled == arraySize) { - arraySize *= 2; - threadList = new Thread[arraySize]; - filled = group.enumerate(threadList); + arraySize *= 2; + threadList = new Thread[arraySize]; + filled = group.enumerate(threadList); } Map traces = new HashMap(); for (int a = 0; a < filled; ++a) traces.put(threadList[a], - threadList[a].getStackTrace()); + threadList[a].getStackTrace()); return traces; } diff --git a/libjava/classpath/java/lang/ThreadLocal.java b/libjava/classpath/java/lang/ThreadLocal.java index 1f60a55..71b722e 100644 --- a/libjava/classpath/java/lang/ThreadLocal.java +++ b/libjava/classpath/java/lang/ThreadLocal.java @@ -100,7 +100,7 @@ public class ThreadLocal<T> /** * Allocate a new hash. */ - private synchronized int computeNextHash() + private synchronized int computeNextHash() { return nextHashBase++ * 6709; } diff --git a/libjava/classpath/java/lang/Throwable.java b/libjava/classpath/java/lang/Throwable.java index f74851f..13bc5b9 100644 --- a/libjava/classpath/java/lang/Throwable.java +++ b/libjava/classpath/java/lang/Throwable.java @@ -423,32 +423,32 @@ public class Throwable implements Serializable Throwable cause = getCause(); while (cause != null) { - // Cause start first line + // Cause start first line sb.append("Caused by: "); // Cause stacktrace StackTraceElement[] parentStack = stack; stack = cause.getStackTrace(); - if (parentStack == null || parentStack.length == 0) - stackTraceStringBuffer(sb, cause.toString(), stack, 0); - else - { - int equal = 0; // Count how many of the last stack frames are equal - int frame = stack.length-1; - int parentFrame = parentStack.length-1; - while (frame > 0 && parentFrame > 0) - { - if (stack[frame].equals(parentStack[parentFrame])) - { - equal++; - frame--; - parentFrame--; - } - else - break; - } - stackTraceStringBuffer(sb, cause.toString(), stack, equal); - } + if (parentStack == null || parentStack.length == 0) + stackTraceStringBuffer(sb, cause.toString(), stack, 0); + else + { + int equal = 0; // Count how many of the last stack frames are equal + int frame = stack.length-1; + int parentFrame = parentStack.length-1; + while (frame > 0 && parentFrame > 0) + { + if (stack[frame].equals(parentStack[parentFrame])) + { + equal++; + frame--; + parentFrame--; + } + else + break; + } + stackTraceStringBuffer(sb, cause.toString(), stack, equal); + } cause = cause.getCause(); } @@ -458,7 +458,7 @@ public class Throwable implements Serializable // Adds to the given StringBuffer a line containing the name and // all stacktrace elements minus the last equal ones. private static void stackTraceStringBuffer(CPStringBuilder sb, String name, - StackTraceElement[] stack, int equal) + StackTraceElement[] stack, int equal) { String nl = StaticData.nl; // (finish) first line @@ -468,24 +468,24 @@ public class Throwable implements Serializable // The stacktrace if (stack == null || stack.length == 0) { - sb.append(" <<No stacktrace available>>"); - sb.append(nl); + sb.append(" <<No stacktrace available>>"); + sb.append(nl); } else { - for (int i = 0; i < stack.length-equal; i++) - { - sb.append(" at "); - sb.append(stack[i] == null ? "<<Unknown>>" : stack[i].toString()); - sb.append(nl); - } - if (equal > 0) - { - sb.append(" ..."); - sb.append(equal); - sb.append(" more"); - sb.append(nl); - } + for (int i = 0; i < stack.length-equal; i++) + { + sb.append(" at "); + sb.append(stack[i] == null ? "<<Unknown>>" : stack[i].toString()); + sb.append(nl); + } + if (equal > 0) + { + sb.append(" ..."); + sb.append(equal); + sb.append(" more"); + sb.append(nl); + } } } @@ -518,12 +518,12 @@ public class Throwable implements Serializable { if (stackTrace == null) if (vmState == null) - stackTrace = new StackTraceElement[0]; - else - { - stackTrace = vmState.getStackTrace(this); - vmState = null; // No longer needed - } + stackTrace = new StackTraceElement[0]; + else + { + stackTrace = vmState.getStackTrace(this); + vmState = null; // No longer needed + } return stackTrace; } @@ -548,9 +548,9 @@ public class Throwable implements Serializable while (--i >= 0) { - st[i] = stackTrace[i]; - if (st[i] == null) - throw new NullPointerException("Element " + i + " null"); + st[i] = stackTrace[i]; + if (st[i] == null) + throw new NullPointerException("Element " + i + " null"); } this.stackTrace = st; diff --git a/libjava/classpath/java/lang/TypeNotPresentException.java b/libjava/classpath/java/lang/TypeNotPresentException.java index 65d98457..4d6bf23 100644 --- a/libjava/classpath/java/lang/TypeNotPresentException.java +++ b/libjava/classpath/java/lang/TypeNotPresentException.java @@ -43,7 +43,7 @@ package java.lang; * Thrown when a type is accessed using a <code>String</code>-based * representation, but no definition of the supplied type is found. * This is effectively an unchecked equivalent of the existing - * <code>ClassNotFound</code> exception. + * <code>ClassNotFound</code> exception. * </p> * <p> * It may occur due to an attempt to load a missing class, interface or @@ -66,7 +66,7 @@ public class TypeNotPresentException * may be used to provide additional history, with regards to the * root of the problem. It is perfectly valid for this to be null, * if the cause of the problem is unknown. - * + * * @param typeName the name of the missing type. * @param cause the cause of this exception, or null if the cause * is unknown. diff --git a/libjava/classpath/java/lang/UnsupportedOperationException.java b/libjava/classpath/java/lang/UnsupportedOperationException.java index e691cc7..4994f67 100644 --- a/libjava/classpath/java/lang/UnsupportedOperationException.java +++ b/libjava/classpath/java/lang/UnsupportedOperationException.java @@ -86,7 +86,7 @@ public class UnsupportedOperationException extends RuntimeException * automatically incorporated into the resulting detail message of * this exception. * </p> - * + * * @param message the detail message, which should give the reason for * this exception being thrown. * @param cause the cause of this exception, or null if the cause @@ -114,7 +114,7 @@ public class UnsupportedOperationException extends RuntimeException * This makes this constructor very useful for simply wrapping another * exception. * </p> - * + * * @param cause the cause of this exception, or null if the cause * is unknown. * @since 1.5 diff --git a/libjava/classpath/java/lang/annotation/Annotation.java b/libjava/classpath/java/lang/annotation/Annotation.java index cc334ec..aac8bb9 100644 --- a/libjava/classpath/java/lang/annotation/Annotation.java +++ b/libjava/classpath/java/lang/annotation/Annotation.java @@ -67,13 +67,13 @@ public interface Annotation * annotation, according to the following: * <ul> * <li>If the members are <code>float</code>s, then, for floats - * <code>x</code> and <code>y</code>, + * <code>x</code> and <code>y</code>, * <code>Float.valueOf(x).equals(Float.valueOf(y)</code> must return * true. This differs from the usual (<code>==</code>) comparison * in that <code>NaN</code> is considered equal to itself and positive * and negative zero are seen as different.</li> * <li>Likewise, if the members are <code>double</code>s, then, for doubles - * <code>x</code> and <code>y</code>, + * <code>x</code> and <code>y</code>, * <code>Double.valueOf(x).equals(Double.valueOf(y)</code> must return * true. This differs from the usual (<code>==</code>) comparison * in that <code>NaN</code> is considered equal to itself and positive diff --git a/libjava/classpath/java/lang/annotation/AnnotationTypeMismatchException.java b/libjava/classpath/java/lang/annotation/AnnotationTypeMismatchException.java index 653305d..bab32e0 100644 --- a/libjava/classpath/java/lang/annotation/AnnotationTypeMismatchException.java +++ b/libjava/classpath/java/lang/annotation/AnnotationTypeMismatchException.java @@ -44,7 +44,7 @@ import java.lang.reflect.Method; * which the type has changed, since compilation or serialization * took place. The mismatch between the compiled or serialized * type and the current type causes this exception to be thrown. - * + * * @author Tom Tromey (tromey@redhat.com) * @author Andrew John Hughes (gnu_andrew@member.fsf.org) * @since 1.5 diff --git a/libjava/classpath/java/lang/annotation/IncompleteAnnotationException.java b/libjava/classpath/java/lang/annotation/IncompleteAnnotationException.java index 5b20650..b511b36 100644 --- a/libjava/classpath/java/lang/annotation/IncompleteAnnotationException.java +++ b/libjava/classpath/java/lang/annotation/IncompleteAnnotationException.java @@ -40,8 +40,8 @@ package java.lang.annotation; /** * Thrown when accessing an element within an annotation which * was added since compilation or serialization took place, and - * does not have a default value. - * + * does not have a default value. + * * @author Tom Tromey (tromey@redhat.com) * @author Andrew John Hughes (gnu_andrew@member.fsf.org) * @since 1.5 @@ -59,7 +59,7 @@ public class IncompleteAnnotationException extends RuntimeException * @param name the name of the missing element. */ public IncompleteAnnotationException(Class<? extends Annotation> type, - String name) + String name) { this.annotationType = type; this.elementName = name; @@ -100,7 +100,7 @@ public class IncompleteAnnotationException extends RuntimeException /** * The name of the missing element. * - * @serial the name of the missing element. + * @serial the name of the missing element. */ private String elementName; diff --git a/libjava/classpath/java/lang/instrument/ClassFileTransformer.java b/libjava/classpath/java/lang/instrument/ClassFileTransformer.java index 01b2f8a..189a46a 100644 --- a/libjava/classpath/java/lang/instrument/ClassFileTransformer.java +++ b/libjava/classpath/java/lang/instrument/ClassFileTransformer.java @@ -67,9 +67,9 @@ public interface ClassFileTransformer * @param protectionDomain the protection domain of the class being defined or * redefined * @param classfileBuffer the input byte buffer in class file format - * + * * @return a class file buffer or null when no transformation has been performed - * + * * @throws IllegalClassFormatException if the byte buffer does not represent * a well-formed class file * @see Instrumentation#redefineClasses(java.lang.instrument.ClassDefinition[]) @@ -82,4 +82,3 @@ public interface ClassFileTransformer byte[] classfileBuffer) throws IllegalClassFormatException; } - diff --git a/libjava/classpath/java/lang/instrument/Instrumentation.java b/libjava/classpath/java/lang/instrument/Instrumentation.java index 81aefa6..42e3ab5 100644 --- a/libjava/classpath/java/lang/instrument/Instrumentation.java +++ b/libjava/classpath/java/lang/instrument/Instrumentation.java @@ -50,22 +50,22 @@ package java.lang.instrument; */ public interface Instrumentation { - + /** * Adds a <code>ClassFileTransformer</class> object * to the instrumentation. Each time a class is defined * or redefined, the <code>transform</code> method of the * <code>transformer</code> object is called. - * + * * @param transformer the transformer to add * @throws NullPointerException if transformer is null */ void addTransformer(ClassFileTransformer transformer); - + /** * Removes the given transformer from the set of transformers * this Instrumentation object has. - * + * * @param transformer the transformer to remove * @return true if the transformer was found and removed, false if * the transformer was not found @@ -75,7 +75,7 @@ public interface Instrumentation /** * Returns if the current JVM supports class redefinition - * + * * @return true if the current JVM supports class redefinition */ boolean isRedefineClassesSupported(); @@ -85,9 +85,9 @@ public interface Instrumentation * the corresponding class files. * * @param definitions an array of classes to redefine - * - * @throws ClassNotFoundException if a class cannot be found - * @throws UnmodifiableClassException if a class cannot be modified + * + * @throws ClassNotFoundException if a class cannot be found + * @throws UnmodifiableClassException if a class cannot be modified * @throws UnsupportedOperationException if the JVM does not support * redefinition or the redefinition made unsupported changes * @throws ClassFormatError if a class file is not valid @@ -97,7 +97,7 @@ public interface Instrumentation * are unsupported * @throws ClassCircularityError if circularity occured with the new * classes - * @throws LinkageError if a linkage error occurs + * @throws LinkageError if a linkage error occurs * @throws NullPointerException if the definitions array is null, or any * of its element * @@ -112,7 +112,7 @@ public interface Instrumentation /** * Get all the classes loaded by the JVM. - * + * * @return an array containing all the classes loaded by the JVM. The array * is empty if no class is loaded. */ @@ -120,9 +120,9 @@ public interface Instrumentation /** * Get all the classes loaded by a given class loader - * + * * @param loader the loader - * + * * @return an array containing all the classes loaded by the given loader. * The array is empty if no class was loaded by the loader. */ @@ -130,7 +130,7 @@ public interface Instrumentation /** * Get the size of an object. It contains the size of all fields. - * + * * @param objectToSize the object * @return the size of the object * @throws NullPointerException if objectToSize is null. diff --git a/libjava/classpath/java/lang/management/ClassLoadingMXBean.java b/libjava/classpath/java/lang/management/ClassLoadingMXBean.java index 2a8651b..491af24 100644 --- a/libjava/classpath/java/lang/management/ClassLoadingMXBean.java +++ b/libjava/classpath/java/lang/management/ClassLoadingMXBean.java @@ -38,7 +38,7 @@ exception statement from your version. */ package java.lang.management; /** - * Provides access to information about the class loading + * Provides access to information about the class loading * behaviour of the current invocation of the virtual * machine. An instance of this bean is obtained by calling * {@link ManagementFactory#getClassLoadingMXBean()}. @@ -100,4 +100,3 @@ public interface ClassLoadingMXBean void setVerbose(boolean verbose); } - diff --git a/libjava/classpath/java/lang/management/CompilationMXBean.java b/libjava/classpath/java/lang/management/CompilationMXBean.java index 7f666f2..36f69c4 100644 --- a/libjava/classpath/java/lang/management/CompilationMXBean.java +++ b/libjava/classpath/java/lang/management/CompilationMXBean.java @@ -50,7 +50,7 @@ package java.lang.management; */ public interface CompilationMXBean { - + /** * Returns the name of the Just-In-Time (JIT) compiler. * diff --git a/libjava/classpath/java/lang/management/GarbageCollectorMXBean.java b/libjava/classpath/java/lang/management/GarbageCollectorMXBean.java index 5bb0a18..f3da004 100644 --- a/libjava/classpath/java/lang/management/GarbageCollectorMXBean.java +++ b/libjava/classpath/java/lang/management/GarbageCollectorMXBean.java @@ -70,7 +70,7 @@ public interface GarbageCollectorMXBean * Note that the accumulated time may not change, even when the * collection count increases, if the time taken is sufficiently * short; this depends on the resolution of the timer used. - * + * * @return the accumulated number of milliseconds spent collecting, * or -1 if this is undefined. */ diff --git a/libjava/classpath/java/lang/management/ManagementFactory.java b/libjava/classpath/java/lang/management/ManagementFactory.java index 977b399..c054f5d 100644 --- a/libjava/classpath/java/lang/management/ManagementFactory.java +++ b/libjava/classpath/java/lang/management/ManagementFactory.java @@ -82,7 +82,7 @@ import javax.management.openmbean.TabularData; /** * <p> * Provides access to the system's management beans via a series - * of static methods. + * of static methods. * </p> * <p> * An instance of a system management bean can be obtained by @@ -251,16 +251,16 @@ public class ManagementFactory public static OperatingSystemMXBean getOperatingSystemMXBean() { if (osBean == null) - try - { - osBean = new OperatingSystemMXBeanImpl(); - } + try + { + osBean = new OperatingSystemMXBeanImpl(); + } catch (NotCompliantMBeanException e) - { - throw new InternalError("The GNU implementation of the " + - "operating system bean is not a " + - "compliant management bean."); - } + { + throw new InternalError("The GNU implementation of the " + + "operating system bean is not a " + + "compliant management bean."); + } return osBean; } @@ -275,15 +275,15 @@ public class ManagementFactory { if (runtimeBean == null) try - { - runtimeBean = new RuntimeMXBeanImpl(); - } + { + runtimeBean = new RuntimeMXBeanImpl(); + } catch (NotCompliantMBeanException e) - { - throw new InternalError("The GNU implementation of the " + - "runtime bean is not a compliant " + - "management bean."); - } + { + throw new InternalError("The GNU implementation of the " + + "runtime bean is not a compliant " + + "management bean."); + } return runtimeBean; } @@ -298,15 +298,15 @@ public class ManagementFactory { if (classLoadingBean == null) try - { - classLoadingBean = new ClassLoadingMXBeanImpl(); - } + { + classLoadingBean = new ClassLoadingMXBeanImpl(); + } catch (NotCompliantMBeanException e) - { - throw new InternalError("The GNU implementation of the " + - "class loading bean is not a " + - "compliant management bean."); - } + { + throw new InternalError("The GNU implementation of the " + + "class loading bean is not a " + + "compliant management bean."); + } return classLoadingBean; } @@ -321,15 +321,15 @@ public class ManagementFactory { if (threadBean == null) try - { - threadBean = new ThreadMXBeanImpl(); - } + { + threadBean = new ThreadMXBeanImpl(); + } catch (NotCompliantMBeanException e) - { - throw new InternalError("The GNU implementation of the " + - "thread bean is not a compliant " + - "management bean."); - } + { + throw new InternalError("The GNU implementation of the " + + "thread bean is not a compliant " + + "management bean."); + } return threadBean; } @@ -344,15 +344,15 @@ public class ManagementFactory { if (memoryBean == null) try - { - memoryBean = new MemoryMXBeanImpl(); - } + { + memoryBean = new MemoryMXBeanImpl(); + } catch (NotCompliantMBeanException e) - { - throw new InternalError("The GNU implementation of the " + - "memory bean is not a compliant " + - "management bean."); - } + { + throw new InternalError("The GNU implementation of the " + + "memory bean is not a compliant " + + "management bean."); + } return memoryBean; } @@ -369,17 +369,17 @@ public class ManagementFactory public static CompilationMXBean getCompilationMXBean() { if (compilationBean == null && - SystemProperties.getProperty("gnu.java.compiler.name") != null) + SystemProperties.getProperty("gnu.java.compiler.name") != null) try - { - compilationBean = new CompilationMXBeanImpl(); - } + { + compilationBean = new CompilationMXBeanImpl(); + } catch (NotCompliantMBeanException e) - { - throw new InternalError("The GNU implementation of the " + - "compilation bean is not a compliant " + - "management bean."); - } + { + throw new InternalError("The GNU implementation of the " + + "compilation bean is not a compliant " + + "management bean."); + } return compilationBean; } @@ -397,15 +397,15 @@ public class ManagementFactory String[] names = VMManagementFactory.getMemoryPoolNames(); for (int a = 0; a < names.length; ++a) try - { - poolBeans.add(new MemoryPoolMXBeanImpl(names[a])); - } + { + poolBeans.add(new MemoryPoolMXBeanImpl(names[a])); + } catch (NotCompliantMBeanException e) - { - throw new InternalError("The GNU implementation of the " + - "memory pool bean, " + a + ", is " + - "not a compliant management bean."); - } + { + throw new InternalError("The GNU implementation of the " + + "memory pool bean, " + a + ", is " + + "not a compliant management bean."); + } return poolBeans; } @@ -423,15 +423,15 @@ public class ManagementFactory String[] names = VMManagementFactory.getMemoryManagerNames(); for (int a = 0; a < names.length; ++a) try - { - managerBeans.add(new MemoryManagerMXBeanImpl(names[a])); - } + { + managerBeans.add(new MemoryManagerMXBeanImpl(names[a])); + } catch (NotCompliantMBeanException e) - { - throw new InternalError("The GNU implementation of the " + - "memory manager bean, " + a + ", is " + - "not a compliant management bean."); - } + { + throw new InternalError("The GNU implementation of the " + + "memory manager bean, " + a + ", is " + + "not a compliant management bean."); + } managerBeans.addAll(getGarbageCollectorMXBeans()); return managerBeans; } @@ -450,16 +450,16 @@ public class ManagementFactory String[] names = VMManagementFactory.getGarbageCollectorNames(); for (int a = 0; a < names.length; ++a) try - { - gcBeans.add(new GarbageCollectorMXBeanImpl(names[a])); - } + { + gcBeans.add(new GarbageCollectorMXBeanImpl(names[a])); + } catch (NotCompliantMBeanException e) - { - throw new InternalError("The GNU implementation of the " + - "garbage collector bean, " + a + - ", is not a compliant management " + - "bean."); - } + { + throw new InternalError("The GNU implementation of the " + + "garbage collector bean, " + a + + ", is not a compliant management " + + "bean."); + } return gcBeans; } @@ -490,77 +490,77 @@ public class ManagementFactory { if (platformServer == null) { - platformServer = MBeanServerFactory.createMBeanServer(); - try - { - platformServer.registerMBean(getOperatingSystemMXBean(), - new ObjectName(OPERATING_SYSTEM_MXBEAN_NAME)); - platformServer.registerMBean(getRuntimeMXBean(), - new ObjectName(RUNTIME_MXBEAN_NAME)); - platformServer.registerMBean(getClassLoadingMXBean(), - new ObjectName(CLASS_LOADING_MXBEAN_NAME)); - platformServer.registerMBean(getThreadMXBean(), - new ObjectName(THREAD_MXBEAN_NAME)); - platformServer.registerMBean(getMemoryMXBean(), - new ObjectName(MEMORY_MXBEAN_NAME)); - CompilationMXBean compBean = getCompilationMXBean(); - if (compBean != null) - platformServer.registerMBean(compBean, - new ObjectName(COMPILATION_MXBEAN_NAME)); - Iterator beans = getMemoryPoolMXBeans().iterator(); - while (beans.hasNext()) - { - MemoryPoolMXBean bean = (MemoryPoolMXBean) beans.next(); - platformServer.registerMBean(bean, - new ObjectName(MEMORY_POOL_MXBEAN_DOMAIN_TYPE + - ",name=" + - bean.getName())); - } - beans = getMemoryManagerMXBeans().iterator(); - while (beans.hasNext()) - { - MemoryManagerMXBean bean = (MemoryManagerMXBean) beans.next(); - platformServer.registerMBean(bean, - new ObjectName(MEMORY_MANAGER_MXBEAN_DOMAIN_TYPE + - ",name=" + - bean.getName())); - } - beans = getGarbageCollectorMXBeans().iterator(); - while (beans.hasNext()) - { - GarbageCollectorMXBean bean = (GarbageCollectorMXBean) beans.next(); - platformServer.registerMBean(bean, - new ObjectName(GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE + - ",name=" + - bean.getName())); - } - platformServer.registerMBean(LogManager.getLoggingMXBean(), - new ObjectName(LogManager.LOGGING_MXBEAN_NAME)); - } - catch (InstanceAlreadyExistsException e) - { - throw (Error) - (new InternalError("One of the management beans is " + - "already registered.").initCause(e)); - } - catch (MBeanRegistrationException e) - { - throw (Error) - (new InternalError("One of the management beans' preRegister " + - "methods threw an exception.").initCause(e)); - } - catch (NotCompliantMBeanException e) - { - throw (Error) - (new InternalError("One of the management beans is " + - "not compliant.").initCause(e)); - } - catch (MalformedObjectNameException e) - { - throw (Error) - (new InternalError("The object name of a management bean is " + - "not compliant.").initCause(e)); - } + platformServer = MBeanServerFactory.createMBeanServer(); + try + { + platformServer.registerMBean(getOperatingSystemMXBean(), + new ObjectName(OPERATING_SYSTEM_MXBEAN_NAME)); + platformServer.registerMBean(getRuntimeMXBean(), + new ObjectName(RUNTIME_MXBEAN_NAME)); + platformServer.registerMBean(getClassLoadingMXBean(), + new ObjectName(CLASS_LOADING_MXBEAN_NAME)); + platformServer.registerMBean(getThreadMXBean(), + new ObjectName(THREAD_MXBEAN_NAME)); + platformServer.registerMBean(getMemoryMXBean(), + new ObjectName(MEMORY_MXBEAN_NAME)); + CompilationMXBean compBean = getCompilationMXBean(); + if (compBean != null) + platformServer.registerMBean(compBean, + new ObjectName(COMPILATION_MXBEAN_NAME)); + Iterator beans = getMemoryPoolMXBeans().iterator(); + while (beans.hasNext()) + { + MemoryPoolMXBean bean = (MemoryPoolMXBean) beans.next(); + platformServer.registerMBean(bean, + new ObjectName(MEMORY_POOL_MXBEAN_DOMAIN_TYPE + + ",name=" + + bean.getName())); + } + beans = getMemoryManagerMXBeans().iterator(); + while (beans.hasNext()) + { + MemoryManagerMXBean bean = (MemoryManagerMXBean) beans.next(); + platformServer.registerMBean(bean, + new ObjectName(MEMORY_MANAGER_MXBEAN_DOMAIN_TYPE + + ",name=" + + bean.getName())); + } + beans = getGarbageCollectorMXBeans().iterator(); + while (beans.hasNext()) + { + GarbageCollectorMXBean bean = (GarbageCollectorMXBean) beans.next(); + platformServer.registerMBean(bean, + new ObjectName(GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE + + ",name=" + + bean.getName())); + } + platformServer.registerMBean(LogManager.getLoggingMXBean(), + new ObjectName(LogManager.LOGGING_MXBEAN_NAME)); + } + catch (InstanceAlreadyExistsException e) + { + throw (Error) + (new InternalError("One of the management beans is " + + "already registered.").initCause(e)); + } + catch (MBeanRegistrationException e) + { + throw (Error) + (new InternalError("One of the management beans' preRegister " + + "methods threw an exception.").initCause(e)); + } + catch (NotCompliantMBeanException e) + { + throw (Error) + (new InternalError("One of the management beans is " + + "not compliant.").initCause(e)); + } + catch (MalformedObjectNameException e) + { + throw (Error) + (new InternalError("The object name of a management bean is " + + "not compliant.").initCause(e)); + } } return platformServer; } @@ -600,51 +600,51 @@ public class ManagementFactory * @throws IOException if the connection throws one. */ public static <T> T newPlatformMXBeanProxy(MBeanServerConnection connection, - String mxbeanName, - Class<T> mxbeanInterface) + String mxbeanName, + Class<T> mxbeanInterface) throws IOException { if (!(mxbeanName.equals(CLASS_LOADING_MXBEAN_NAME) || - mxbeanName.equals(COMPILATION_MXBEAN_NAME) || - mxbeanName.startsWith(GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE) || - mxbeanName.startsWith(MEMORY_MANAGER_MXBEAN_DOMAIN_TYPE) || - mxbeanName.equals(MEMORY_MXBEAN_NAME) || - mxbeanName.startsWith(MEMORY_POOL_MXBEAN_DOMAIN_TYPE) || - mxbeanName.equals(OPERATING_SYSTEM_MXBEAN_NAME) || - mxbeanName.equals(RUNTIME_MXBEAN_NAME) || - mxbeanName.equals(THREAD_MXBEAN_NAME))) + mxbeanName.equals(COMPILATION_MXBEAN_NAME) || + mxbeanName.startsWith(GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE) || + mxbeanName.startsWith(MEMORY_MANAGER_MXBEAN_DOMAIN_TYPE) || + mxbeanName.equals(MEMORY_MXBEAN_NAME) || + mxbeanName.startsWith(MEMORY_POOL_MXBEAN_DOMAIN_TYPE) || + mxbeanName.equals(OPERATING_SYSTEM_MXBEAN_NAME) || + mxbeanName.equals(RUNTIME_MXBEAN_NAME) || + mxbeanName.equals(THREAD_MXBEAN_NAME))) { - throw new IllegalArgumentException("The named bean, " + mxbeanName + - ", is not a platform name."); + throw new IllegalArgumentException("The named bean, " + mxbeanName + + ", is not a platform name."); } if ((mxbeanName.equals(CLASS_LOADING_MXBEAN_NAME) && - mxbeanInterface != ClassLoadingMXBean.class) || - (mxbeanName.equals(COMPILATION_MXBEAN_NAME) && - mxbeanInterface != CompilationMXBean.class) || - (mxbeanName.startsWith(GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE) && - mxbeanInterface != GarbageCollectorMXBean.class) || - (mxbeanName.startsWith(MEMORY_MANAGER_MXBEAN_DOMAIN_TYPE) && - mxbeanInterface != MemoryManagerMXBean.class) || - (mxbeanName.equals(MEMORY_MXBEAN_NAME) && - mxbeanInterface != MemoryMXBean.class) || - (mxbeanName.startsWith(MEMORY_POOL_MXBEAN_DOMAIN_TYPE) && - mxbeanInterface != MemoryPoolMXBean.class) || - (mxbeanName.equals(OPERATING_SYSTEM_MXBEAN_NAME) && - mxbeanInterface != OperatingSystemMXBean.class) || - (mxbeanName.equals(RUNTIME_MXBEAN_NAME) && - mxbeanInterface != RuntimeMXBean.class) || - (mxbeanName.equals(THREAD_MXBEAN_NAME) && - mxbeanInterface != ThreadMXBean.class)) + mxbeanInterface != ClassLoadingMXBean.class) || + (mxbeanName.equals(COMPILATION_MXBEAN_NAME) && + mxbeanInterface != CompilationMXBean.class) || + (mxbeanName.startsWith(GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE) && + mxbeanInterface != GarbageCollectorMXBean.class) || + (mxbeanName.startsWith(MEMORY_MANAGER_MXBEAN_DOMAIN_TYPE) && + mxbeanInterface != MemoryManagerMXBean.class) || + (mxbeanName.equals(MEMORY_MXBEAN_NAME) && + mxbeanInterface != MemoryMXBean.class) || + (mxbeanName.startsWith(MEMORY_POOL_MXBEAN_DOMAIN_TYPE) && + mxbeanInterface != MemoryPoolMXBean.class) || + (mxbeanName.equals(OPERATING_SYSTEM_MXBEAN_NAME) && + mxbeanInterface != OperatingSystemMXBean.class) || + (mxbeanName.equals(RUNTIME_MXBEAN_NAME) && + mxbeanInterface != RuntimeMXBean.class) || + (mxbeanName.equals(THREAD_MXBEAN_NAME) && + mxbeanInterface != ThreadMXBean.class)) throw new IllegalArgumentException("The interface, " + mxbeanInterface + - ", does not match the bean, " + mxbeanName); + ", does not match the bean, " + mxbeanName); ObjectName bean; try { - bean = new ObjectName(mxbeanName); + bean = new ObjectName(mxbeanName); } catch (MalformedObjectNameException e) { - throw new IllegalArgumentException("The named bean is invalid."); + throw new IllegalArgumentException("The named bean is invalid."); } if (!(connection.isRegistered(bean))) throw new IllegalArgumentException("The bean is not registered on this connection."); @@ -654,8 +654,8 @@ public class ManagementFactory else interfaces = new Class[] { mxbeanInterface }; return (T) Proxy.newProxyInstance(mxbeanInterface.getClassLoader(), - interfaces, - new ManagementInvocationHandler(connection, bean)); + interfaces, + new ManagementInvocationHandler(connection, bean)); } /** @@ -688,7 +688,7 @@ public class ManagementFactory * @param bean the bean to proxy. */ public ManagementInvocationHandler(MBeanServerConnection conn, - ObjectName bean) + ObjectName bean) throws IOException { this.conn = conn; @@ -715,46 +715,46 @@ public class ManagementFactory { String name = method.getName(); if (name.equals("toString")) - return "Proxy for " + bean + " using " + conn; + return "Proxy for " + bean + " using " + conn; if (name.equals("addNotificationListener")) - { - conn.addNotificationListener(bean, - (NotificationListener) args[0], - (NotificationFilter) args[1], - args[2]); - return null; - } + { + conn.addNotificationListener(bean, + (NotificationListener) args[0], + (NotificationFilter) args[1], + args[2]); + return null; + } if (name.equals("getNotificationInfo")) - return conn.getMBeanInfo(bean).getNotifications(); + return conn.getMBeanInfo(bean).getNotifications(); if (name.equals("removeNotificationListener")) - { - if (args.length == 1) - conn.removeNotificationListener(bean, - (NotificationListener) - args[0]); - else - conn.removeNotificationListener(bean, - (NotificationListener) - args[0], - (NotificationFilter) - args[1], args[2]); - return null; - } + { + if (args.length == 1) + conn.removeNotificationListener(bean, + (NotificationListener) + args[0]); + else + conn.removeNotificationListener(bean, + (NotificationListener) + args[0], + (NotificationFilter) + args[1], args[2]); + return null; + } String attrib = null; if (name.startsWith("get")) - attrib = name.substring(3); + attrib = name.substring(3); else if (name.startsWith("is")) - attrib = name.substring(2); + attrib = name.substring(2); if (attrib != null) - return translate(conn.getAttribute(bean, attrib), method); + return translate(conn.getAttribute(bean, attrib), method); else if (name.startsWith("set")) - { - conn.setAttribute(bean, new Attribute(name.substring(3), - args[0])); - return null; - } + { + conn.setAttribute(bean, new Attribute(name.substring(3), + args[0])); + return null; + } else - return translate(conn.invoke(bean, name, args, null), method); + return translate(conn.invoke(bean, name, args, null), method); } /** @@ -772,44 +772,44 @@ public class ManagementFactory { Class<?> returnType = method.getReturnType(); if (returnType.isEnum()) - { - String ename = (String) otype; - Enum[] constants = (Enum[]) returnType.getEnumConstants(); - for (Enum c : constants) - if (c.name().equals(ename)) - return c; - } + { + String ename = (String) otype; + Enum[] constants = (Enum[]) returnType.getEnumConstants(); + for (Enum c : constants) + if (c.name().equals(ename)) + return c; + } if (List.class.isAssignableFrom(returnType)) - { - Object[] elems = (Object[]) otype; - List l = new ArrayList(elems.length); - for (Object elem : elems) - l.add(elem); - return l; - } + { + Object[] elems = (Object[]) otype; + List l = new ArrayList(elems.length); + for (Object elem : elems) + l.add(elem); + return l; + } if (Map.class.isAssignableFrom(returnType)) - { - TabularData data = (TabularData) otype; - Map m = new HashMap(data.size()); - for (Object val : data.values()) - { - CompositeData vals = (CompositeData) val; - m.put(vals.get("key"), vals.get("value")); - } - return m; - } + { + TabularData data = (TabularData) otype; + Map m = new HashMap(data.size()); + for (Object val : data.values()) + { + CompositeData vals = (CompositeData) val; + m.put(vals.get("key"), vals.get("value")); + } + return m; + } try - { - Method m = returnType.getMethod("from", - new Class[] - { CompositeData.class }); - return m.invoke(null, (CompositeData) otype); - } + { + Method m = returnType.getMethod("from", + new Class[] + { CompositeData.class }); + return m.invoke(null, (CompositeData) otype); + } catch (NoSuchMethodException e) - { - /* Ignored; we expect this if this - isn't a from(CompositeData) class */ - } + { + /* Ignored; we expect this if this + isn't a from(CompositeData) class */ + } return otype; } diff --git a/libjava/classpath/java/lang/management/ManagementPermission.java b/libjava/classpath/java/lang/management/ManagementPermission.java index 0e6bd06..7379457 100644 --- a/libjava/classpath/java/lang/management/ManagementPermission.java +++ b/libjava/classpath/java/lang/management/ManagementPermission.java @@ -71,7 +71,7 @@ import java.security.BasicPermission; * usage limits changed. Malicious code could use * this to alter the behaviour of the system.</li> * </ul> - * + * * @author Andrew John Hughes (gnu_andrew@member.fsf.org) * @since 1.5 */ @@ -127,6 +127,5 @@ public final class ManagementPermission if (!(actions == null || actions.equals(""))) throw new IllegalArgumentException("Invalid actions."); } - -} +} diff --git a/libjava/classpath/java/lang/management/MemoryMXBean.java b/libjava/classpath/java/lang/management/MemoryMXBean.java index 4d9e5ff..acf0e67 100644 --- a/libjava/classpath/java/lang/management/MemoryMXBean.java +++ b/libjava/classpath/java/lang/management/MemoryMXBean.java @@ -39,7 +39,7 @@ package java.lang.management; /** * <p> - * Provides access to information about the memory used + * Provides access to information about the memory used * by the virtual machine. An instance of this bean is * obtained by calling * {@link ManagementFactory#getMemoryMXBean()}. @@ -104,7 +104,7 @@ package java.lang.management; */ public interface MemoryMXBean { - + /** * Instigates a garbage collection cycle. The virtual * machine's garbage collector should make the best @@ -135,7 +135,7 @@ public interface MemoryMXBean * memory. */ MemoryUsage getNonHeapMemoryUsage(); - + /** * Returns the number of objects which are waiting to * be garbage collected (finalized). An object is diff --git a/libjava/classpath/java/lang/management/MemoryManagerMXBean.java b/libjava/classpath/java/lang/management/MemoryManagerMXBean.java index 9210705..1b10e99 100644 --- a/libjava/classpath/java/lang/management/MemoryManagerMXBean.java +++ b/libjava/classpath/java/lang/management/MemoryManagerMXBean.java @@ -49,10 +49,10 @@ package java.lang.management; public interface MemoryManagerMXBean { - /** + /** * Returns an array containing the names of the memory pools * this memory manager manages. - * + * * @return an array containing the name of each memory pool * this manager is responsible for. */ diff --git a/libjava/classpath/java/lang/management/MemoryNotificationInfo.java b/libjava/classpath/java/lang/management/MemoryNotificationInfo.java index adb38b0..85856e0 100644 --- a/libjava/classpath/java/lang/management/MemoryNotificationInfo.java +++ b/libjava/classpath/java/lang/management/MemoryNotificationInfo.java @@ -74,7 +74,7 @@ import javax.management.openmbean.SimpleType; * {@link #from(javax.management.openmbean.CompositeData)} method may be * used to unwrap the value and obtain an instance of this class. * </p> - * + * * @author Andrew John Hughes (gnu_andrew@member.fsf.org) * @since 1.5 */ @@ -87,7 +87,7 @@ public class MemoryNotificationInfo * threshold again before another notification is emitted. The value is * <code>java.management.memory.threshold.exceeded</code>. */ - public static final String MEMORY_THRESHOLD_EXCEEDED = + public static final String MEMORY_THRESHOLD_EXCEEDED = "java.management.memory.threshold.exceeded"; /** @@ -153,9 +153,9 @@ public class MemoryNotificationInfo * <tr><td>committed</td><td>java.lang.Long</td></tr> * <tr><td>max</td><td>java.lang.Long</td></tr> * </table> - * + * * @param data the composite data structure to take values from. - * @return a new instance containing the values from the + * @return a new instance containing the values from the * composite data structure, or <code>null</code> * if the data structure was also <code>null</code>. * @throws IllegalArgumentException if the composite data structure @@ -172,8 +172,8 @@ public class MemoryNotificationInfo ThreadInfo.checkAttribute(type, "count", SimpleType.LONG); MemoryUsage usage = MemoryUsage.from((CompositeData) data.get("usage")); return new MemoryNotificationInfo(((String) data.get("poolName")), - usage, - ((Long) data.get("count")).longValue()); + usage, + ((Long) data.get("count")).longValue()); } /** @@ -212,4 +212,3 @@ public class MemoryNotificationInfo } } - diff --git a/libjava/classpath/java/lang/management/MemoryPoolMXBean.java b/libjava/classpath/java/lang/management/MemoryPoolMXBean.java index 36a8236..9729093 100644 --- a/libjava/classpath/java/lang/management/MemoryPoolMXBean.java +++ b/libjava/classpath/java/lang/management/MemoryPoolMXBean.java @@ -209,7 +209,7 @@ public interface MemoryPoolMXBean long getUsageThresholdCount(); /** - * Returns true if the collection usage level is equal to + * Returns true if the collection usage level is equal to * or greater than the collection usage threshold. * * @return true if the collection usage threshold has been @@ -236,7 +236,7 @@ public interface MemoryPoolMXBean boolean isCollectionUsageThresholdSupported(); /** - * Returns true if the usage level is equal to + * Returns true if the usage level is equal to * or greater than the usage threshold. * * @return true if the usage threshold has been @@ -260,7 +260,7 @@ public interface MemoryPoolMXBean * @see #setUsageThreshold(long) */ boolean isUsageThresholdSupported(); - + /** * Returns true if this memory pool is still valid. A memory pool * becomes invalid when it is removed by the virtual machine and diff --git a/libjava/classpath/java/lang/management/MemoryType.java b/libjava/classpath/java/lang/management/MemoryType.java index 4422b32..c864d54 100644 --- a/libjava/classpath/java/lang/management/MemoryType.java +++ b/libjava/classpath/java/lang/management/MemoryType.java @@ -48,4 +48,3 @@ public enum MemoryType { HEAP, NON_HEAP; } - diff --git a/libjava/classpath/java/lang/management/MemoryUsage.java b/libjava/classpath/java/lang/management/MemoryUsage.java index d851da9..42aef3c 100644 --- a/libjava/classpath/java/lang/management/MemoryUsage.java +++ b/libjava/classpath/java/lang/management/MemoryUsage.java @@ -119,29 +119,29 @@ public class MemoryUsage * above. */ public MemoryUsage(long init, long used, long committed, - long maximum) + long maximum) { if (init < -1) throw new IllegalArgumentException("Initial value of " - + init + " is too small."); + + init + " is too small."); if (used < 0) throw new IllegalArgumentException("Used value of " - + used + " is too small."); + + used + " is too small."); if (committed < 0) throw new IllegalArgumentException("Committed value of " - + committed + " is too small."); + + committed + " is too small."); if (committed < used) throw new IllegalArgumentException("Committed value of " - + committed + " is below " - + used + ", the amount used."); + + committed + " is below " + + used + ", the amount used."); if (maximum < -1) throw new IllegalArgumentException("Maximum value of " - + maximum + " is too small."); + + maximum + " is too small."); if (maximum != -1 && maximum < committed) - throw new IllegalArgumentException("Maximum value of " - + maximum + " is below " - + committed + ", the amount " - + "committed."); + throw new IllegalArgumentException("Maximum value of " + + maximum + " is below " + + committed + ", the amount " + + "committed."); this.init = init; this.used = used; this.committed = committed; @@ -165,9 +165,9 @@ public class MemoryUsage * <p> * All should have the type, <code>java.lang.Long</code>. * </p> - * + * * @param data the composite data structure to take values from. - * @return a new instance containing the values from the + * @return a new instance containing the values from the * composite data structure, or <code>null</code> * if the data structure was also <code>null</code>. * @throws IllegalArgumentException if the composite data structure @@ -185,9 +185,9 @@ public class MemoryUsage ThreadInfo.checkAttribute(type, "Committed", SimpleType.LONG); ThreadInfo.checkAttribute(type, "Max", SimpleType.LONG); return new MemoryUsage(((Long) data.get("Init")).longValue(), - ((Long) data.get("Used")).longValue(), - ((Long) data.get("Committed")).longValue(), - ((Long) data.get("Max")).longValue()); + ((Long) data.get("Used")).longValue(), + ((Long) data.get("Committed")).longValue(), + ((Long) data.get("Max")).longValue()); } /** @@ -217,7 +217,7 @@ public class MemoryUsage /** * Returns the maximum amount of memory available for this - * pool (in bytes). This amount is not guaranteed to + * pool (in bytes). This amount is not guaranteed to * actually be usable. This method may return -1, if the * value is undefined. * @@ -262,4 +262,3 @@ public class MemoryUsage } } - diff --git a/libjava/classpath/java/lang/management/MonitorInfo.java b/libjava/classpath/java/lang/management/MonitorInfo.java index cba73a8..fd72337 100644 --- a/libjava/classpath/java/lang/management/MonitorInfo.java +++ b/libjava/classpath/java/lang/management/MonitorInfo.java @@ -82,16 +82,16 @@ public class MonitorInfo * < 0. */ public MonitorInfo(String className, int identityHashCode, int stackDepth, - StackTraceElement stackFrame) + StackTraceElement stackFrame) { super(className, identityHashCode); if (stackFrame == null && stackDepth >= 0) throw new IllegalArgumentException("The stack frame is null, but the " + - "stack depth is greater than or equal " + - "to zero."); + "stack depth is greater than or equal " + + "to zero."); if (stackFrame != null && stackDepth < 0) throw new IllegalArgumentException("The stack frame is not null, but the " + - "stack depth is less than zero."); + "stack depth is less than zero."); this.stackDepth = stackDepth; this.stackFrame = stackFrame; } @@ -123,9 +123,9 @@ public class MonitorInfo * <tr><td>lineNumber</td><td>java.lang.Integer</td></tr> * <tr><td>nativeMethod</td><td>java.lang.Boolean</td></tr> * </table> - * + * * @param data the composite data structure to take values from. - * @return a new instance containing the values from the + * @return a new instance containing the values from the * composite data structure, or <code>null</code> * if the data structure was also <code>null</code>. * @throws IllegalArgumentException if the composite data structure @@ -141,15 +141,15 @@ public class MonitorInfo ThreadInfo.checkAttribute(type, "IdentityHashCode", SimpleType.INTEGER); ThreadInfo.checkAttribute(type, "LockedStackDepth", SimpleType.INTEGER); ThreadInfo.checkAttribute(type, "LockedStackFrame", - ThreadInfo.getStackTraceType()); + ThreadInfo.getStackTraceType()); CompositeData frame = (CompositeData) data.get("LockedStackFrame"); return new MonitorInfo((String) data.get("ClassName"), - (Integer) data.get("IdentityHashCode"), - (Integer) data.get("LockedStackDepth"), - new StackTraceElement((String) frame.get("ClassName"), - (String) frame.get("MethodName"), - (String) frame.get("FileName"), - (Integer) frame.get("LineNumber"))); + (Integer) data.get("IdentityHashCode"), + (Integer) data.get("LockedStackDepth"), + new StackTraceElement((String) frame.get("ClassName"), + (String) frame.get("MethodName"), + (String) frame.get("FileName"), + (Integer) frame.get("LineNumber"))); } /** diff --git a/libjava/classpath/java/lang/management/OperatingSystemMXBean.java b/libjava/classpath/java/lang/management/OperatingSystemMXBean.java index ed38285..dcc963e 100644 --- a/libjava/classpath/java/lang/management/OperatingSystemMXBean.java +++ b/libjava/classpath/java/lang/management/OperatingSystemMXBean.java @@ -89,7 +89,7 @@ public interface OperatingSystemMXBean /** * Returns the system load average for the last minute, or -1 * if this is unavailable. The availability and calculation - * of the load average is system-dependent, but is usually + * of the load average is system-dependent, but is usually * a damped time-dependent average obtained by monitoring the * number of queued and running processes. It is expected * that this method will be called frequently to monitor the diff --git a/libjava/classpath/java/lang/management/RuntimeMXBean.java b/libjava/classpath/java/lang/management/RuntimeMXBean.java index a2931d1..1e2aa01 100644 --- a/libjava/classpath/java/lang/management/RuntimeMXBean.java +++ b/libjava/classpath/java/lang/management/RuntimeMXBean.java @@ -56,7 +56,7 @@ public interface RuntimeMXBean * Returns the boot classpath used by the virtual machine. This * value follows the standard path syntax used by the underlying * operating system (e.g. directories separated by ':' on UNIX - * or ';' on Windows). + * or ';' on Windows). * </p> * <p> * Supplying this value is optional. Users should check the @@ -81,7 +81,7 @@ public interface RuntimeMXBean * property via {@link System#getProperty(String)}. This value * follows the standard path syntax used by the underlying operating * system (e.g. directories separated by ':' on UNIX or ';' on - * Windows). + * Windows). * * @return the classpath used by the system class loader. * @throws SecurityException if a security manager exists which @@ -114,7 +114,7 @@ public interface RuntimeMXBean * {@link System#getProperty(String)}. This value follows the * standard path syntax used by the underlying operating * system (e.g. directories separated by ':' on UNIX or ';' on - * Windows). + * Windows). * * @return the library path. * @throws SecurityException if a security manager exists which @@ -142,7 +142,7 @@ public interface RuntimeMXBean * same virtual machine (for example, it might include * the process identifier or the host name of the machine * on which it is running). The intention is that this - * name refers to the precise entity that the other data + * name refers to the precise entity that the other data * supplied by this bean refers to, rather than the VM * in general. * @@ -154,7 +154,7 @@ public interface RuntimeMXBean * Returns the specification name of the virtual machine. * This is equivalent to obtaining the * <code>java.vm.specification.name</code> property via - * {@link System#getProperty(String)}. + * {@link System#getProperty(String)}. * * @return the specification name of the VM. * @throws SecurityException if a security manager exists which @@ -169,7 +169,7 @@ public interface RuntimeMXBean * Returns the specification vendor of the virtual machine. * This is equivalent to obtaining the * <code>java.vm.specification.vendor</code> property via - * {@link System#getProperty(String)}. + * {@link System#getProperty(String)}. * * @return the specification vendor of the VM. * @throws SecurityException if a security manager exists which @@ -184,7 +184,7 @@ public interface RuntimeMXBean * Returns the specification version of the virtual machine. * This is equivalent to obtaining the * <code>java.vm.specification.version</code> property via - * {@link System#getProperty(String)}. + * {@link System#getProperty(String)}. * * @return the specification version of the VM. * @throws SecurityException if a security manager exists which @@ -198,7 +198,7 @@ public interface RuntimeMXBean /** * Returns the approximate start time of the virtual machine * in milliseconds. - * + * * @return the start time of the virtual machine. */ long getStartTime(); @@ -216,7 +216,7 @@ public interface RuntimeMXBean /** * Returns the uptime of the virtual machine in milliseconds. - * + * * @return the uptime of the virtual machine. */ long getUptime(); @@ -225,7 +225,7 @@ public interface RuntimeMXBean * Returns the implementation name of the virtual machine. * This is equivalent to obtaining the * <code>java.vm.name</code> property via - * {@link System#getProperty(String)}. + * {@link System#getProperty(String)}. * * @return the implementation name of the VM. * @throws SecurityException if a security manager exists which @@ -240,7 +240,7 @@ public interface RuntimeMXBean * Returns the implementation vendor of the virtual machine. * This is equivalent to obtaining the * <code>java.vm.vendor</code> property via - * {@link System#getProperty(String)}. + * {@link System#getProperty(String)}. * * @return the implementation vendor of the VM. * @throws SecurityException if a security manager exists which @@ -255,7 +255,7 @@ public interface RuntimeMXBean * Returns the implementation version of the virtual machine. * This is equivalent to obtaining the * <code>java.vm.version</code> property via - * {@link System#getProperty(String)}. + * {@link System#getProperty(String)}. * * @return the implementation version of the VM. * @throws SecurityException if a security manager exists which diff --git a/libjava/classpath/java/lang/management/ThreadInfo.java b/libjava/classpath/java/lang/management/ThreadInfo.java index 5b8856d..a4ecc76 100644 --- a/libjava/classpath/java/lang/management/ThreadInfo.java +++ b/libjava/classpath/java/lang/management/ThreadInfo.java @@ -211,7 +211,7 @@ public class ThreadInfo * lock, or <code>-1</code> if it doesn't have an owner * (only used if blocked) * @param lockOwnerName the name of the thread which owns the monitor - * lock, or <code>null</code> if it doesn't have an + * lock, or <code>null</code> if it doesn't have an * owner (only used if blocked) * @param waitedCount the number of times the thread has been in a * waiting state. @@ -227,16 +227,16 @@ public class ThreadInfo * by the thread. * @param lockedSynchronizers an array of {@link LockInfo} objects * representing locks held on ownable - * synchronizers by the thread. + * synchronizers by the thread. * * @since 1.6 */ private ThreadInfo(long threadId, String threadName, Thread.State threadState, - long blockedCount, long blockedTime, String lockName, - long lockOwnerId, String lockOwnerName, long waitedCount, - long waitedTime, boolean isInNative, boolean isSuspended, - StackTraceElement[] trace, MonitorInfo[] lockedMonitors, - LockInfo[] lockedSynchronizers) + long blockedCount, long blockedTime, String lockName, + long lockOwnerId, String lockOwnerName, long waitedCount, + long waitedTime, boolean isInNative, boolean isSuspended, + StackTraceElement[] trace, MonitorInfo[] lockedMonitors, + LockInfo[] lockedSynchronizers) { this.threadId = threadId; this.threadName = threadName; @@ -266,16 +266,16 @@ public class ThreadInfo * or of the wrong type. */ static void checkAttribute(CompositeType ctype, String name, - OpenType type) + OpenType type) throws IllegalArgumentException { OpenType foundType = ctype.getType(name); if (foundType == null) throw new IllegalArgumentException("Could not find a field named " + - name); + name); if (!(foundType.equals(type))) throw new IllegalArgumentException("Field " + name + " is not of " + - "type " + type.getClassName()); + "type " + type.getClassName()); } /** @@ -288,31 +288,31 @@ public class ThreadInfo { if (seType == null) try - { - seType = new CompositeType(StackTraceElement.class.getName(), - "An element of a stack trace", - new String[] { "className", "methodName", - "fileName", "lineNumber", - "nativeMethod" - }, - new String[] { "Name of the class", - "Name of the method", - "Name of the source code file", - "Line number", - "True if this is a native method" - }, - new OpenType[] { - SimpleType.STRING, SimpleType.STRING, - SimpleType.STRING, SimpleType.INTEGER, - SimpleType.BOOLEAN - }); - } + { + seType = new CompositeType(StackTraceElement.class.getName(), + "An element of a stack trace", + new String[] { "className", "methodName", + "fileName", "lineNumber", + "nativeMethod" + }, + new String[] { "Name of the class", + "Name of the method", + "Name of the source code file", + "Line number", + "True if this is a native method" + }, + new OpenType[] { + SimpleType.STRING, SimpleType.STRING, + SimpleType.STRING, SimpleType.INTEGER, + SimpleType.BOOLEAN + }); + } catch (OpenDataException e) - { - throw new IllegalStateException("Something went wrong in creating " + - "the composite data type for the " + - "stack trace element.", e); - } + { + throw new IllegalStateException("Something went wrong in creating " + + "the composite data type for the " + + "stack trace element.", e); + } return seType; } @@ -352,9 +352,9 @@ public class ThreadInfo * <tr><td>lineNumber</td><td>java.lang.Integer</td></tr> * <tr><td>nativeMethod</td><td>java.lang.Boolean</td></tr> * </table> - * + * * @param data the composite data structure to take values from. - * @return a new instance containing the values from the + * @return a new instance containing the values from the * composite data structure, or <code>null</code> * if the data structure was also <code>null</code>. * @throws IllegalArgumentException if the composite data structure @@ -380,119 +380,119 @@ public class ThreadInfo checkAttribute(type, "LockOwnerName", SimpleType.STRING); try { - checkAttribute(type, "StackTrace", - new ArrayType(1, getStackTraceType())); + checkAttribute(type, "StackTrace", + new ArrayType(1, getStackTraceType())); } catch (OpenDataException e) { - throw new IllegalStateException("Something went wrong in creating " + - "the array for the stack trace element.", - e); + throw new IllegalStateException("Something went wrong in creating " + + "the array for the stack trace element.", + e); } OpenType foundType = type.getType("LockedMonitors"); if (foundType != null) try - { - CompositeType mType = new CompositeType(MonitorInfo.class.getName(), - "Information on a object monitor lock", - new String[] { "ClassName", - "IdentityHashCode", - "LockedStackDepth", - "LockedStackFrame" - }, - new String[] { "Name of the class", - "Identity hash code " + - "of the class", - "Stack depth at time " + - "of lock", - "Stack frame at time " + - "of lock", - }, - new OpenType[] { - SimpleType.STRING, SimpleType.INTEGER, - SimpleType.INTEGER, getStackTraceType() - }); - if (!(foundType.equals(new ArrayType(1, mType)))) - throw new IllegalArgumentException("Field LockedMonitors is not of " + - "type " + mType.getClassName()); - } + { + CompositeType mType = new CompositeType(MonitorInfo.class.getName(), + "Information on a object monitor lock", + new String[] { "ClassName", + "IdentityHashCode", + "LockedStackDepth", + "LockedStackFrame" + }, + new String[] { "Name of the class", + "Identity hash code " + + "of the class", + "Stack depth at time " + + "of lock", + "Stack frame at time " + + "of lock", + }, + new OpenType[] { + SimpleType.STRING, SimpleType.INTEGER, + SimpleType.INTEGER, getStackTraceType() + }); + if (!(foundType.equals(new ArrayType(1, mType)))) + throw new IllegalArgumentException("Field LockedMonitors is not of " + + "type " + mType.getClassName()); + } catch (OpenDataException e) { - throw new IllegalStateException("Something went wrong in creating " + - "the composite data type for the " + - "object monitor information array.", e); + throw new IllegalStateException("Something went wrong in creating " + + "the composite data type for the " + + "object monitor information array.", e); } foundType = type.getType("LockedSynchronizers"); if (foundType != null) try - { - CompositeType lType = new CompositeType(LockInfo.class.getName(), - "Information on a lock", - new String[] { "ClassName", - "IdentityHashCode" - }, - new String[] { "Name of the class", - "Identity hash code " + - "of the class" - }, - new OpenType[] { - SimpleType.STRING, SimpleType.INTEGER - }); - if (!(foundType.equals(new ArrayType(1, lType)))) - throw new IllegalArgumentException("Field LockedSynchronizers is not of " + - "type " + lType.getClassName()); - } + { + CompositeType lType = new CompositeType(LockInfo.class.getName(), + "Information on a lock", + new String[] { "ClassName", + "IdentityHashCode" + }, + new String[] { "Name of the class", + "Identity hash code " + + "of the class" + }, + new OpenType[] { + SimpleType.STRING, SimpleType.INTEGER + }); + if (!(foundType.equals(new ArrayType(1, lType)))) + throw new IllegalArgumentException("Field LockedSynchronizers is not of " + + "type " + lType.getClassName()); + } catch (OpenDataException e) { - throw new IllegalStateException("Something went wrong in creating " + - "the composite data type for the " + - "ownable synchronizerinformation array.", e); + throw new IllegalStateException("Something went wrong in creating " + + "the composite data type for the " + + "ownable synchronizerinformation array.", e); } CompositeData[] dTraces = (CompositeData[]) data.get("StackTrace"); StackTraceElement[] traces = new StackTraceElement[dTraces.length]; for (int a = 0; a < dTraces.length; ++a) - /* FIXME: We can't use the boolean as there is no available - constructor. */ - traces[a] = - new StackTraceElement((String) dTraces[a].get("ClassName"), - (String) dTraces[a].get("MethodName"), - (String) dTraces[a].get("FileName"), - ((Integer) - dTraces[a].get("LineNumber")).intValue()); + /* FIXME: We can't use the boolean as there is no available + constructor. */ + traces[a] = + new StackTraceElement((String) dTraces[a].get("ClassName"), + (String) dTraces[a].get("MethodName"), + (String) dTraces[a].get("FileName"), + ((Integer) + dTraces[a].get("LineNumber")).intValue()); MonitorInfo[] mInfo; if (data.containsKey("LockedMonitors")) { - CompositeData[] dmInfos = (CompositeData[]) data.get("LockedMonitors"); - mInfo = new MonitorInfo[dmInfos.length]; - for (int a = 0; a < dmInfos.length; ++a) - mInfo[a] = MonitorInfo.from(dmInfos[a]); + CompositeData[] dmInfos = (CompositeData[]) data.get("LockedMonitors"); + mInfo = new MonitorInfo[dmInfos.length]; + for (int a = 0; a < dmInfos.length; ++a) + mInfo[a] = MonitorInfo.from(dmInfos[a]); } else mInfo = new MonitorInfo[]{}; LockInfo[] lInfo; if (data.containsKey("LockedSynchronizers")) { - CompositeData[] dlInfos = (CompositeData[]) data.get("LockedSynchronizers"); - lInfo = new LockInfo[dlInfos.length]; - for (int a = 0; a < dlInfos.length; ++a) - lInfo[a] = new LockInfo((String) dlInfos[a].get("ClassName"), - (Integer) dlInfos[a].get("IdentityHashCode")); + CompositeData[] dlInfos = (CompositeData[]) data.get("LockedSynchronizers"); + lInfo = new LockInfo[dlInfos.length]; + for (int a = 0; a < dlInfos.length; ++a) + lInfo[a] = new LockInfo((String) dlInfos[a].get("ClassName"), + (Integer) dlInfos[a].get("IdentityHashCode")); } else lInfo = new LockInfo[]{}; return new ThreadInfo(((Long) data.get("ThreadId")).longValue(), - (String) data.get("ThreadName"), - Thread.State.valueOf((String) data.get("ThreadState")), - ((Long) data.get("BlockedCount")).longValue(), - ((Long) data.get("BlockedTime")).longValue(), - (String) data.get("LockName"), - ((Long) data.get("LockOwnerId")).longValue(), - (String) data.get("LockOwnerName"), - ((Long) data.get("WaitedCount")).longValue(), - ((Long) data.get("WaitedTime")).longValue(), - ((Boolean) data.get("InNative")).booleanValue(), - ((Boolean) data.get("Suspended")).booleanValue(), - traces, mInfo, lInfo); + (String) data.get("ThreadName"), + Thread.State.valueOf((String) data.get("ThreadState")), + ((Long) data.get("BlockedCount")).longValue(), + ((Long) data.get("BlockedTime")).longValue(), + (String) data.get("LockName"), + ((Long) data.get("LockOwnerId")).longValue(), + (String) data.get("LockOwnerName"), + ((Long) data.get("WaitedCount")).longValue(), + ((Long) data.get("WaitedTime")).longValue(), + ((Boolean) data.get("InNative")).booleanValue(), + ((Boolean) data.get("Suspended")).booleanValue(), + traces, mInfo, lInfo); } /** @@ -528,7 +528,7 @@ public class ThreadInfo * for thread contention monitoring and for this support * to be enabled. * </p> - * + * * @return the accumulated time (in milliseconds) that this * thread has spent in the blocked state, since * thread contention monitoring was enabled, or -1 @@ -601,7 +601,7 @@ public class ThreadInfo * The lock is the return value of * {@link java.util.concurrent.locks.LockSupport#getBlocker()}.</li> * </ol> - * + * * @return a {@link LockInfo} object representing the lock on * which the thread is blocked, or <code>null</code> if * the thread isn't blocked. @@ -613,7 +613,7 @@ public class ThreadInfo String lockName = getLockName(); int at = lockName.indexOf('@'); return new LockInfo(lockName.substring(0, at), - Integer.decode(lockName.substring(at + 1))); + Integer.decode(lockName.substring(at + 1))); } /** @@ -655,7 +655,7 @@ public class ThreadInfo * monitor lock this thread is waiting for. -1 is returned * if either this thread is not blocked, or the lock is * not held by any other thread. - * + * * @return the thread identifier of thread holding the lock * this thread is waiting for, or -1 if the thread * is not blocked or the lock is not held by another @@ -673,7 +673,7 @@ public class ThreadInfo * monitor lock this thread is waiting for. <code>null</code> * is returned if either this thread is not blocked, * or the lock is not held by any other thread. - * + * * @return the thread identifier of thread holding the lock * this thread is waiting for, or <code>null</code> * if the thread is not blocked or the lock is not @@ -701,7 +701,7 @@ public class ThreadInfo * stack trace information for a thread. In these * cases, an empty array will also be returned. * </p> - * + * * @return an array of {@link java.lang.StackTraceElement}s * representing the trace of this thread. */ @@ -742,16 +742,16 @@ public class ThreadInfo { return threadState; } - + /** * Returns the number of times this thread has been - * in the {@link java.lang.Thread.State#WAITING} + * in the {@link java.lang.Thread.State#WAITING} * or {@link java.lang.Thread.State#TIMED_WAITING} state. * A thread enters one of these states when it is waiting * due to a call to {@link java.lang.Object.wait()}, * {@link java.lang.Object.join()} or * {@link java.lang.concurrent.locks.LockSupport.park()}, - * either with an infinite or timed delay, respectively. + * either with an infinite or timed delay, respectively. * * @return the number of times this thread has been waiting. */ @@ -771,14 +771,14 @@ public class ThreadInfo * due to a call to {@link java.lang.Object.wait()}, * {@link java.lang.Object.join()} or * {@link java.lang.concurrent.locks.LockSupport.park()}, - * either with an infinite or timed delay, respectively. + * either with an infinite or timed delay, respectively. * </p> * <p> * Use of this method requires virtual machine support * for thread contention monitoring and for this support * to be enabled. * </p> - * + * * @return the accumulated time (in milliseconds) that this * thread has spent in one of the waiting states, since * thread contention monitoring was enabled, or -1 @@ -849,14 +849,14 @@ public class ThreadInfo public String toString() { return getClass().getName() + - "[id=" + threadId + + "[id=" + threadId + ", name=" + threadName + ", state=" + threadState + ", blockedCount=" + blockedCount + ", waitedCount=" + waitedCount + - ", isInNative=" + isInNative + + ", isInNative=" + isInNative + ", isSuspended=" + isSuspended + - (isThreadBlocked() ? + (isThreadBlocked() ? ", lockOwnerId=" + lockOwnerId + ", lockOwnerName=" + lockOwnerName : "") + ", lockedMonitors=" + Arrays.toString(lockedMonitors) + @@ -888,8 +888,8 @@ public class ThreadInfo private boolean isThreadBlocked() { return (threadState == Thread.State.BLOCKED || - threadState == Thread.State.WAITING || - threadState == Thread.State.TIMED_WAITING); + threadState == Thread.State.WAITING || + threadState == Thread.State.TIMED_WAITING); } - + } diff --git a/libjava/classpath/java/lang/management/ThreadMXBean.java b/libjava/classpath/java/lang/management/ThreadMXBean.java index f73075d..551c532 100644 --- a/libjava/classpath/java/lang/management/ThreadMXBean.java +++ b/libjava/classpath/java/lang/management/ThreadMXBean.java @@ -39,7 +39,7 @@ package java.lang.management; /** * <p> - * Provides access to information about the threads + * Provides access to information about the threads * of the virtual machine. An instance of this bean is * obtained by calling * {@link ManagementFactory#getThreadMXBean()}. @@ -122,8 +122,8 @@ public interface ThreadMXBean * @see #isSynchronizerUsageSupported() */ ThreadInfo[] dumpAllThreads(boolean lockedMonitors, - boolean lockedSynchronizers); - + boolean lockedSynchronizers); + /** * <p> * This method obtains a list of threads which are deadlocked @@ -140,7 +140,7 @@ public interface ThreadMXBean * then {@link #findMonitorDeadlockedThreads()} should be used in * preference to this method. * </p> - * + * * @return an array of thread identifiers, corresponding to threads * which are currently in a deadlocked situation, or * <code>null</code> if there are no deadlocks. @@ -161,7 +161,7 @@ public interface ThreadMXBean * waiting to obtain monitor ownership. On entering a synchronized * method of an object, or re-entering it after returning from an * {@link java.lang.Object#wait()} call, a thread obtains ownership - * of the object's monitor. + * of the object's monitor. * </p> * <p> * Deadlocks can occur in this situation if one or more threads end up @@ -174,7 +174,7 @@ public interface ThreadMXBean * of a different object. While in that method, it then wants to * call the original synchronized method, R, called by A. Doing so * requires ownership of P, which is still held by A. Hence, it - * becomes blocked. + * becomes blocked. * </p> * <p> * A then finishes its sleep, becomes runnable, and is then allowed @@ -193,7 +193,7 @@ public interface ThreadMXBean * to include deadlocks involving ownable synchronizers, * {@link #findDeadlockedThreads()} should be used instead. * </p> - * + * * @return an array of thread identifiers, corresponding to threads * which are currently in a deadlocked situation, or * <code>null</code> if there are no deadlocks. @@ -221,7 +221,7 @@ public interface ThreadMXBean * Returns the total number of nanoseconds of CPU time * the current thread has used. This is equivalent to calling * <code>{@link #getThreadCpuTime()}(Thread.currentThread.getId())</code>. - * </p> + * </p> * <p> * Note that the value is only nanosecond-precise, and not accurate; there * is no guarantee that the difference between two values is really a @@ -248,7 +248,7 @@ public interface ThreadMXBean * the current thread has executed in user mode. This is * equivalent to calling * <code>{@link #getThreadUserTime()}(Thread.currentThread.getId())</code>. - * </p> + * </p> * <p> * Note that the value is only nanosecond-precise, and not accurate; there * is no guarantee that the difference between two values is really a @@ -298,8 +298,8 @@ public interface ThreadMXBean /** * <p> * Returns the total number of nanoseconds of CPU time - * the specified thread has used. - * </p> + * the specified thread has used. + * </p> * <p> * Note that the value is only nanosecond-precise, and not accurate; there * is no guarantee that the difference between two values is really a @@ -329,7 +329,7 @@ public interface ThreadMXBean * <code>{@link #getThreadInfo}(id, 0)</code>. If the * identifier specifies a thread which is either non-existant * or not alive, then the method returns <code>null</code>. - * + * * @param id the identifier of the thread to return information * on. * @return a {@link ThreadInfo} object pertaining to the specified @@ -348,11 +348,11 @@ public interface ThreadMXBean * identifier specifies a thread which is either non-existant * or not alive, then the corresponding element in the returned * array is <code>null</code>. - * + * * @param ids an array of thread identifiers to return information * on. * @return an array of {@link ThreadInfo} objects matching the - * specified threads. The corresponding element is + * specified threads. The corresponding element is * <code>null</code> if the identifier specifies * a thread that doesn't exist or is not alive. * @throws IllegalArgumentException if an identifier in the array is @@ -379,15 +379,15 @@ public interface ThreadMXBean * If an identifier specifies a thread which is either non-existant * or not alive, then the corresponding element in the returned * array is <code>null</code>. - * + * * @param ids an array of thread identifiers to return information * on. * @param lockedMonitors true if information on locked monitors * should be included. * @param lockedSynchronizers true if information on locked - * ownable synchronizers should be included. + * ownable synchronizers should be included. * @return an array of {@link ThreadInfo} objects matching the - * specified threads. The corresponding element is + * specified threads. The corresponding element is * <code>null</code> if the identifier specifies * a thread that doesn't exist or is not alive. * @throws IllegalArgumentException if an identifier in the array is @@ -407,7 +407,7 @@ public interface ThreadMXBean * @see #isSynchronizerUsageSupported() */ ThreadInfo[] getThreadInfo(long[] ids, boolean lockedMonitors, - boolean lockedSynchronizers); + boolean lockedSynchronizers); /** * Returns information on the specified thread with @@ -444,7 +444,7 @@ public interface ThreadMXBean * to an empty stack trace (an empty array is returned by the * appropriate {@link ThreadInfo} method). A maximum depth of * <code>Integer.MAX_VALUE</code> returns the full stack trace. - * + * * @param ids an array of thread identifiers to return information * on. * @param maxDepth the maximum depth of the stack trace. @@ -452,7 +452,7 @@ public interface ThreadMXBean * correspond to an empty and full stack trace * respectively. * @return an array of {@link ThreadInfo} objects matching the - * specified threads. The corresponding element is + * specified threads. The corresponding element is * <code>null</code> if the identifier specifies * a thread that doesn't exist or is not alive. * @throws IllegalArgumentException if an identifier in the array is @@ -466,8 +466,8 @@ public interface ThreadMXBean /** * <p> * Returns the total number of nanoseconds of CPU time - * the specified thread has executed in user mode. - * </p> + * the specified thread has executed in user mode. + * </p> * <p> * Note that the value is only nanosecond-precise, and not accurate; there * is no guarantee that the difference between two values is really a diff --git a/libjava/classpath/java/lang/ref/PhantomReference.java b/libjava/classpath/java/lang/ref/PhantomReference.java index 67e97d3..29215ea 100644 --- a/libjava/classpath/java/lang/ref/PhantomReference.java +++ b/libjava/classpath/java/lang/ref/PhantomReference.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU @@ -44,7 +44,7 @@ package java.lang.ref; * finalized. This is the reason, why <code>get()</code> always * returns null. * - * @author Jochen Hoenicke + * @author Jochen Hoenicke */ public class PhantomReference<T> extends Reference<T> @@ -60,11 +60,11 @@ public class PhantomReference<T> { super(referent, q); } - + /** * Returns the object, this reference refers to. * @return <code>null</code>, since the refered object may be - * finalized and thus not accessible. + * finalized and thus not accessible. */ public T get() { diff --git a/libjava/classpath/java/lang/ref/Reference.java b/libjava/classpath/java/lang/ref/Reference.java index ce224b8..37cda6f 100644 --- a/libjava/classpath/java/lang/ref/Reference.java +++ b/libjava/classpath/java/lang/ref/Reference.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU @@ -89,7 +89,7 @@ public abstract class Reference<T> * reference is not enqueued. Otherwise it points to the next * reference. The last reference on a queue will point to itself * (not to null, that value is used to mark a not enqueued - * reference). + * reference). */ volatile Reference nextOnQueue; @@ -103,7 +103,7 @@ public abstract class Reference<T> /** * Creates a new reference that is not registered to any queue. * Since it is package private, it is not possible to overload this - * class in a different package. + * class in a different package. * @param ref the object we refer to. */ Reference(T ref) @@ -114,7 +114,7 @@ public abstract class Reference<T> /** * Creates a reference that is registered to a queue. Since this is * package private, it is not possible to overload this class in a - * different package. + * different package. * @param ref the object we refer to. * @param q the reference queue to register on. * @exception NullPointerException if q is null. @@ -129,21 +129,21 @@ public abstract class Reference<T> /** * Returns the object, this reference refers to. - * @return the object, this reference refers to, or null if the + * @return the object, this reference refers to, or null if the * reference was cleared. */ public T get() { synchronized (lock) { - return referent; + return referent; } } /** * Clears the reference, so that it doesn't refer to its object * anymore. For soft and weak references this is called by the - * garbage collector. For phantom references you should call + * garbage collector. For phantom references you should call * this when enqueuing the reference. */ public void clear() @@ -164,12 +164,12 @@ public abstract class Reference<T> * Enqueue an object on a reference queue. This is normally executed * by the garbage collector. */ - public boolean enqueue() + public boolean enqueue() { ReferenceQueue q = queue; if (q != null) { - return q.enqueue(this); + return q.enqueue(this); } return false; } diff --git a/libjava/classpath/java/lang/ref/ReferenceQueue.java b/libjava/classpath/java/lang/ref/ReferenceQueue.java index 2816287..73f62d6 100644 --- a/libjava/classpath/java/lang/ref/ReferenceQueue.java +++ b/libjava/classpath/java/lang/ref/ReferenceQueue.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU @@ -55,9 +55,9 @@ public class ReferenceQueue<T> /** * This is a linked list of references. If this is null, the list is * empty. Otherwise this points to the first reference on the queue. - * The first reference will point to the next reference via the + * The first reference will point to the next reference via the * <code>nextOnQueue</code> field. The last reference will point to - * itself (not to null, since <code>nextOnQueue</code> is used to + * itself (not to null, since <code>nextOnQueue</code> is used to * determine if a reference is enqueued). */ private Reference<? extends T> first; @@ -80,15 +80,15 @@ public class ReferenceQueue<T> * immediately. The reference will be dequeued. * * @return a reference on the queue, if there is one, - * <code>null</code> otherwise. + * <code>null</code> otherwise. */ public Reference<? extends T> poll() - { + { return dequeue(); } /** - * This is called by reference to enqueue itself on this queue. + * This is called by reference to enqueue itself on this queue. * @param ref the reference that should be enqueued. * @return true if successful, false if not. */ @@ -119,7 +119,7 @@ public class ReferenceQueue<T> { if (first == null) return null; - + Reference<? extends T> result = first; first = (first == first.nextOnQueue) ? null : first.nextOnQueue; result.nextOnQueue = null; @@ -132,8 +132,8 @@ public class ReferenceQueue<T> * until a reference is enqueued. * @param timeout the timeout period in milliseconds, <code>0</code> means * wait forever. - * @return the reference removed from the queue, or - * <code>null</code> if timeout period expired. + * @return the reference removed from the queue, or + * <code>null</code> if timeout period expired. * @exception InterruptedException if the wait was interrupted. */ public Reference<? extends T> remove(long timeout) @@ -147,13 +147,13 @@ public class ReferenceQueue<T> return dequeue(); } - + /** * Removes a reference from the queue, blocking until a reference is * enqueued. * - * @return the reference removed from the queue. + * @return the reference removed from the queue. * @exception InterruptedException if the wait was interrupted. */ public Reference<? extends T> remove() diff --git a/libjava/classpath/java/lang/ref/SoftReference.java b/libjava/classpath/java/lang/ref/SoftReference.java index 077dc17..269ffd0 100644 --- a/libjava/classpath/java/lang/ref/SoftReference.java +++ b/libjava/classpath/java/lang/ref/SoftReference.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU @@ -45,7 +45,7 @@ package java.lang.ref; * references it should clear. This makes a soft reference ideal for * caches.<br> * - * @author Jochen Hoenicke + * @author Jochen Hoenicke */ public class SoftReference<T> extends Reference<T> @@ -69,15 +69,15 @@ public class SoftReference<T> { super(referent, q); } - + /** * Returns the object, this reference refers to. - * @return the object, this reference refers to, or null if the + * @return the object, this reference refers to, or null if the * reference was cleared. */ public T get() { - /* Why is this overloaded??? + /* Why is this overloaded??? * Maybe for a kind of LRU strategy. */ return super.get(); } diff --git a/libjava/classpath/java/lang/ref/WeakReference.java b/libjava/classpath/java/lang/ref/WeakReference.java index 563563b..9735643 100644 --- a/libjava/classpath/java/lang/ref/WeakReference.java +++ b/libjava/classpath/java/lang/ref/WeakReference.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU @@ -51,8 +51,8 @@ package java.lang.ref; * an object is not referenced anymore, the reference will * automatically cleared, and you may remove it from the set. <br> * - * @author Jochen Hoenicke - * @see java.util.WeakHashMap + * @author Jochen Hoenicke + * @see java.util.WeakHashMap */ public class WeakReference<T> extends Reference<T> diff --git a/libjava/classpath/java/lang/reflect/AccessibleObject.java b/libjava/classpath/java/lang/reflect/AccessibleObject.java index 328f81d..7567691 100644 --- a/libjava/classpath/java/lang/reflect/AccessibleObject.java +++ b/libjava/classpath/java/lang/reflect/AccessibleObject.java @@ -91,9 +91,9 @@ public class AccessibleObject * <code>ReflectPermission("suppressAccessChecks")</code>.<p> * * It is forbidden to set the accessibility flag to true on any constructor - * for java.lang.Class. This will result in a SecurityException. If the + * for java.lang.Class. This will result in a SecurityException. If the * SecurityException is thrown for any of the passed AccessibleObjects, - * the accessibility flag will be set on AccessibleObjects in the array prior + * the accessibility flag will be set on AccessibleObjects in the array prior * to the one which resulted in the exception. * * @param array the array of accessible objects @@ -115,7 +115,7 @@ public class AccessibleObject * manager exists, it is checked for * <code>ReflectPermission("suppressAccessChecks")</code>.<p> * - * It is forbidden to set the accessibility flag to true on any constructor for + * It is forbidden to set the accessibility flag to true on any constructor for * java.lang.Class. This will result in a SecurityException. * * @param flag the desired state of accessibility, true to bypass security diff --git a/libjava/classpath/java/lang/reflect/AnnotatedElement.java b/libjava/classpath/java/lang/reflect/AnnotatedElement.java index 8f2a8b6..0179a0f 100644 --- a/libjava/classpath/java/lang/reflect/AnnotatedElement.java +++ b/libjava/classpath/java/lang/reflect/AnnotatedElement.java @@ -57,7 +57,7 @@ import java.lang.annotation.Annotation; * <code>AnnotationTypeMismatchException</code> or * <code>IncompleteAnnotationException</code>. * </p> - * + * * @author Tom Tromey (tromey@redhat.com) * @author Andrew John Hughes (gnu_andrew@member.fsf.org) * @since 1.5 diff --git a/libjava/classpath/java/lang/reflect/Array.java b/libjava/classpath/java/lang/reflect/Array.java index d64e36c..a31e48e 100644 --- a/libjava/classpath/java/lang/reflect/Array.java +++ b/libjava/classpath/java/lang/reflect/Array.java @@ -248,7 +248,7 @@ public final class Array throw new NullPointerException(); throw new IllegalArgumentException(); } - + /** * Gets an element of a byte array. * @@ -422,11 +422,11 @@ public final class Array { if (array instanceof Object[]) { - // Too bad the API won't let us throw the easier ArrayStoreException! - if (value != null - && ! array.getClass().getComponentType().isInstance(value)) - throw new IllegalArgumentException(); - ((Object[]) array)[index] = value; + // Too bad the API won't let us throw the easier ArrayStoreException! + if (value != null + && ! array.getClass().getComponentType().isInstance(value)) + throw new IllegalArgumentException(); + ((Object[]) array)[index] = value; } else if (value instanceof Byte) setByte(array, index, ((Byte) value).byteValue()); diff --git a/libjava/classpath/java/lang/reflect/Constructor.java b/libjava/classpath/java/lang/reflect/Constructor.java index d9b7e83..d6c8d79 100644 --- a/libjava/classpath/java/lang/reflect/Constructor.java +++ b/libjava/classpath/java/lang/reflect/Constructor.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU @@ -81,7 +81,7 @@ import java.lang.annotation.Annotation; public final class Constructor<T> extends AccessibleObject implements GenericDeclaration, Member -{ +{ private static final int CONSTRUCTOR_MODIFIERS = Modifier.PRIVATE | Modifier.PROTECTED | Modifier.PUBLIC; @@ -108,7 +108,7 @@ public final class Constructor<T> */ public Class<T> getDeclaringClass() { - // Inescapable as the VM layer is 1.4 based. + // Inescapable as the VM layer is 1.4 based. @SuppressWarnings("unchecked") Class<T> declClass = (Class<T>) cons.getDeclaringClass(); return declClass; @@ -314,7 +314,7 @@ public final class Constructor<T> throws InstantiationException, IllegalAccessException, InvocationTargetException { - // Inescapable as the VM layer is 1.4 based. + // Inescapable as the VM layer is 1.4 based. @SuppressWarnings("unchecked") T ins = (T) cons.construct(args); return ins; @@ -336,10 +336,10 @@ public final class Constructor<T> { if (p == null) { - String sig = cons.getSignature(); - if (sig == null) - return new TypeVariable[0]; - p = new MethodSignatureParser(this, sig); + String sig = cons.getSignature(); + if (sig == null) + return new TypeVariable[0]; + p = new MethodSignatureParser(this, sig); } return p.getTypeParameters(); } @@ -350,7 +350,7 @@ public final class Constructor<T> * An array of size zero is returned if this constructor declares no * exceptions. * - * @return the exception types declared by this constructor. + * @return the exception types declared by this constructor. * @throws GenericSignatureFormatError if the generic signature does * not conform to the format specified in the Virtual Machine * specification, version 3. @@ -360,10 +360,10 @@ public final class Constructor<T> { if (p == null) { - String sig = cons.getSignature(); - if (sig == null) - return getExceptionTypes(); - p = new MethodSignatureParser(this, sig); + String sig = cons.getSignature(); + if (sig == null) + return getExceptionTypes(); + p = new MethodSignatureParser(this, sig); } return p.getGenericExceptionTypes(); } @@ -384,10 +384,10 @@ public final class Constructor<T> { if (p == null) { - String sig = cons.getSignature(); - if (sig == null) - return getParameterTypes(); - p = new MethodSignatureParser(this, sig); + String sig = cons.getSignature(); + if (sig == null) + return getParameterTypes(); + p = new MethodSignatureParser(this, sig); } return p.getGenericParameterTypes(); } @@ -406,7 +406,7 @@ public final class Constructor<T> * The returned annotations are serialized. Changing the annotations has * no affect on the return value of future calls to this method. * </p> - * + * * @return an array of arrays which represents the annotations used on the * parameters of this constructor. The order of the array elements * matches the declaration order of the parameters. @@ -428,7 +428,7 @@ public final class Constructor<T> */ public <T extends Annotation> T getAnnotation(Class<T> annotationClass) { - // Inescapable as the VM layer is 1.4 based. + // Inescapable as the VM layer is 1.4 based. @SuppressWarnings("unchecked") T ann = (T) cons.getAnnotation(annotationClass); return ann; diff --git a/libjava/classpath/java/lang/reflect/Field.java b/libjava/classpath/java/lang/reflect/Field.java index b9d9288..29ca795 100644 --- a/libjava/classpath/java/lang/reflect/Field.java +++ b/libjava/classpath/java/lang/reflect/Field.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU @@ -691,11 +691,11 @@ extends AccessibleObject implements Member { if (p == null) { - String signature = f.getSignature(); - if (signature == null) - return getType(); - p = new FieldSignatureParser(getDeclaringClass(), - signature); + String signature = f.getSignature(); + if (signature == null) + return getType(); + p = new FieldSignatureParser(getDeclaringClass(), + signature); } return p.getFieldType(); } @@ -711,7 +711,7 @@ extends AccessibleObject implements Member */ public <T extends Annotation> T getAnnotation(Class<T> annotationClass) { - // Inescapable as the VM layer is 1.4 based. T will erase to Annotation anyway. + // Inescapable as the VM layer is 1.4 based. T will erase to Annotation anyway. @SuppressWarnings("unchecked") T ann = (T) f.getAnnotation(annotationClass); return ann; } diff --git a/libjava/classpath/java/lang/reflect/GenericArrayType.java b/libjava/classpath/java/lang/reflect/GenericArrayType.java index 8dc33a7..2e08024 100644 --- a/libjava/classpath/java/lang/reflect/GenericArrayType.java +++ b/libjava/classpath/java/lang/reflect/GenericArrayType.java @@ -46,7 +46,7 @@ package java.lang.reflect; * @author Andrew John Hughes (gnu_andrew@member.fsf.org) * @since 1.5 */ -public interface GenericArrayType +public interface GenericArrayType extends Type { diff --git a/libjava/classpath/java/lang/reflect/GenericDeclaration.java b/libjava/classpath/java/lang/reflect/GenericDeclaration.java index 244befd..d78aba9 100644 --- a/libjava/classpath/java/lang/reflect/GenericDeclaration.java +++ b/libjava/classpath/java/lang/reflect/GenericDeclaration.java @@ -52,7 +52,7 @@ public interface GenericDeclaration * Returns a <code>TypeVariable</code> object for each type variable * declared by this entity, in order of declaration. An empty array * is returned if no type variables are declared. - * + * * @return an array of <code>TypeVariable</code> objects. * @throws GenericSignatureFormatError if the signature format within the * class file does not conform to that specified in the 3rd edition diff --git a/libjava/classpath/java/lang/reflect/InvocationHandler.java b/libjava/classpath/java/lang/reflect/InvocationHandler.java index 208e621..3d30afd 100644 --- a/libjava/classpath/java/lang/reflect/InvocationHandler.java +++ b/libjava/classpath/java/lang/reflect/InvocationHandler.java @@ -55,7 +55,7 @@ package java.lang.reflect; * work on any object in general.</p> * * <p>Hints for implementing this class:</p> - * + * * <ul> * <li>Don't forget that Object.equals, Object.hashCode, and * Object.toString will call this handler. In particular, diff --git a/libjava/classpath/java/lang/reflect/MalformedParameterizedTypeException.java b/libjava/classpath/java/lang/reflect/MalformedParameterizedTypeException.java index 50ae230..bfbe3bc 100644 --- a/libjava/classpath/java/lang/reflect/MalformedParameterizedTypeException.java +++ b/libjava/classpath/java/lang/reflect/MalformedParameterizedTypeException.java @@ -38,7 +38,7 @@ exception statement from your version. */ package java.lang.reflect; -/** +/** * This exception class is thrown when one of the reflection * methods encountered an invalid parameterized type within * the metadata of a class. One possible reason for this @@ -47,9 +47,9 @@ package java.lang.reflect; * * @author Tom Tromey (tromey@redhat.com) * @author Andrew John Hughes (gnu_andrew@member.fsf.org) - * @since 1.5 + * @since 1.5 */ -public class MalformedParameterizedTypeException +public class MalformedParameterizedTypeException extends RuntimeException { private static final long serialVersionUID = -5696557788586220964L; diff --git a/libjava/classpath/java/lang/reflect/Method.java b/libjava/classpath/java/lang/reflect/Method.java index 0a532dd..fe4b2eb 100644 --- a/libjava/classpath/java/lang/reflect/Method.java +++ b/libjava/classpath/java/lang/reflect/Method.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU @@ -333,7 +333,7 @@ extends AccessibleObject implements Member, GenericDeclaration * An array of size zero is returned if this class has no type * variables. * - * @return the type variables associated with this class. + * @return the type variables associated with this class. * @throws GenericSignatureFormatError if the generic signature does * not conform to the format specified in the Virtual Machine * specification, version 3. @@ -343,10 +343,10 @@ extends AccessibleObject implements Member, GenericDeclaration { if (p == null) { - String sig = m.getSignature(); - if (sig == null) - return (TypeVariable<Method>[]) new TypeVariable[0]; - p = new MethodSignatureParser(this, sig); + String sig = m.getSignature(); + if (sig == null) + return (TypeVariable<Method>[]) new TypeVariable[0]; + p = new MethodSignatureParser(this, sig); } return p.getTypeParameters(); } @@ -357,7 +357,7 @@ extends AccessibleObject implements Member, GenericDeclaration * An array of size zero is returned if this method declares no * exceptions. * - * @return the exception types declared by this method. + * @return the exception types declared by this method. * @throws GenericSignatureFormatError if the generic signature does * not conform to the format specified in the Virtual Machine * specification, version 3. @@ -367,10 +367,10 @@ extends AccessibleObject implements Member, GenericDeclaration { if (p == null) { - String sig = m.getSignature(); - if (sig == null) - return getExceptionTypes(); - p = new MethodSignatureParser(this, sig); + String sig = m.getSignature(); + if (sig == null) + return getExceptionTypes(); + p = new MethodSignatureParser(this, sig); } return p.getGenericExceptionTypes(); } @@ -391,10 +391,10 @@ extends AccessibleObject implements Member, GenericDeclaration { if (p == null) { - String sig = m.getSignature(); - if (sig == null) - return getParameterTypes(); - p = new MethodSignatureParser(this, sig); + String sig = m.getSignature(); + if (sig == null) + return getParameterTypes(); + p = new MethodSignatureParser(this, sig); } return p.getGenericParameterTypes(); } @@ -412,10 +412,10 @@ extends AccessibleObject implements Member, GenericDeclaration { if (p == null) { - String sig = m.getSignature(); - if (sig == null) - return getReturnType(); - p = new MethodSignatureParser(this, sig); + String sig = m.getSignature(); + if (sig == null) + return getReturnType(); + p = new MethodSignatureParser(this, sig); } return p.getGenericReturnType(); } @@ -450,7 +450,7 @@ extends AccessibleObject implements Member, GenericDeclaration * The returned annotations are serialized. Changing the annotations has * no affect on the return value of future calls to this method. * </p> - * + * * @return an array of arrays which represents the annotations used on the * parameters of this method. The order of the array elements * matches the declaration order of the parameters. @@ -472,7 +472,7 @@ extends AccessibleObject implements Member, GenericDeclaration */ public <T extends Annotation> T getAnnotation(Class<T> annotationClass) { - // Inescapable as the VM layer is 1.4 based. T will erase to Annotation anyway. + // Inescapable as the VM layer is 1.4 based. T will erase to Annotation anyway. @SuppressWarnings("unchecked") T ann = (T) m.getAnnotation(annotationClass); return ann; diff --git a/libjava/classpath/java/lang/reflect/Modifier.java b/libjava/classpath/java/lang/reflect/Modifier.java index 45d9b51..15bad05 100644 --- a/libjava/classpath/java/lang/reflect/Modifier.java +++ b/libjava/classpath/java/lang/reflect/Modifier.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU @@ -345,7 +345,7 @@ public class Modifier r.append("strictfp "); if (isInterface(mod)) r.append("interface "); - + // Trim trailing space. if ((mod & ALL_FLAGS) != 0) r.setLength(r.length() - 1); diff --git a/libjava/classpath/java/lang/reflect/Proxy.java b/libjava/classpath/java/lang/reflect/Proxy.java index fb2004e..0e76124 100644 --- a/libjava/classpath/java/lang/reflect/Proxy.java +++ b/libjava/classpath/java/lang/reflect/Proxy.java @@ -217,7 +217,7 @@ public class Proxy implements Serializable * <p>There are several restrictions on this method, the violation of * which will result in an IllegalArgumentException or * NullPointerException:</p> - * + * * <ul> * <li>All objects in `interfaces' must represent distinct interfaces. * Classes, primitive types, null, and duplicates are forbidden.</li> @@ -258,7 +258,7 @@ public class Proxy implements Serializable // synchronized so that we aren't trying to build the same class // simultaneously in two threads public static synchronized Class<?> getProxyClass(ClassLoader loader, - Class<?>... interfaces) + Class<?>... interfaces) { interfaces = (Class[]) interfaces.clone(); ProxyType pt = new ProxyType(loader, interfaces); @@ -274,7 +274,7 @@ public class Proxy implements Serializable : ProxyData.getProxyData(pt)); clazz = (VMProxy.HAVE_NATIVE_GENERATE_PROXY_CLASS - ? VMProxy.generateProxyClass(loader, data) + ? VMProxy.generateProxyClass(loader, data) : new ClassFactory(data).generate(loader)); } @@ -716,7 +716,7 @@ public class Proxy implements Serializable if (! Modifier.isPublic(inter.getModifiers())) if (in_package) { - String p = getPackage(inter); + String p = getPackage(inter); if (! data.pack.equals(p)) throw new IllegalArgumentException("non-public interfaces " + "from different " @@ -769,7 +769,7 @@ public class Proxy implements Serializable * Method.equals as it would also check the declaring class, what we do not * want. We only want to check that the given method have the same signature * as a core method (same name and parameter types) - * + * * @param method the method to check * @return whether the method has the same name and parameter types as * Object.equals, Object.hashCode or Object.toString @@ -795,7 +795,7 @@ public class Proxy implements Serializable } return false; } - + } // class ProxyData /** @@ -1260,7 +1260,7 @@ public class Proxy implements Serializable ProtectionDomain.class }; Method m = vmClassLoader.getDeclaredMethod("defineClass", types); // We can bypass the security check of setAccessible(true), since - // we're in the same package. + // we're in the same package. m.flag = true; Object[] args = {loader, qualName, bytecode, Integer.valueOf(0), diff --git a/libjava/classpath/java/lang/reflect/Type.java b/libjava/classpath/java/lang/reflect/Type.java index c9ea5bf..41b0a9c 100644 --- a/libjava/classpath/java/lang/reflect/Type.java +++ b/libjava/classpath/java/lang/reflect/Type.java @@ -49,7 +49,7 @@ package java.lang.reflect; * @author Tom Tromey (tromey@redhat.com) * @author Andrew John Hughes (gnu_andrew@member.fsf.org) * @since 1.5 - */ + */ public interface Type { } diff --git a/libjava/classpath/java/lang/reflect/TypeVariable.java b/libjava/classpath/java/lang/reflect/TypeVariable.java index ec6af69..671c290 100644 --- a/libjava/classpath/java/lang/reflect/TypeVariable.java +++ b/libjava/classpath/java/lang/reflect/TypeVariable.java @@ -39,13 +39,13 @@ exception statement from your version. */ package java.lang.reflect; /** - * <p> + * <p> * This is a common interface for all type variables provided by * the Java language. Instances are created the first time a type * variable is needed by one of the reflective methods declared in * this package. * </p> - * <p> + * <p> * Creating a type variable requires resolving the appropriate type. * This may involve resolving other classes as a side effect (e.g. * if the type is nested inside other classes). Creation should not @@ -57,7 +57,7 @@ package java.lang.reflect; * @author Tom Tromey (tromey@redhat.com) * @author Andrew John Hughes (gnu_andrew@member.fsf.org) * @since 1.5 - */ + */ public interface TypeVariable<T extends GenericDeclaration> extends Type { diff --git a/libjava/classpath/java/lang/reflect/WildcardType.java b/libjava/classpath/java/lang/reflect/WildcardType.java index 4f78906..43b5d0a4 100644 --- a/libjava/classpath/java/lang/reflect/WildcardType.java +++ b/libjava/classpath/java/lang/reflect/WildcardType.java @@ -84,7 +84,7 @@ public interface WildcardType extends Type * the lower bounds of this type do not actually exist. * @throws MalformedParameterizedTypeException if any of the types * refer to a type which can not be instantiated. - */ + */ Type[] getLowerBounds(); /** @@ -109,7 +109,7 @@ public interface WildcardType extends Type * the upper bounds of this type do not actually exist. * @throws MalformedParameterizedTypeException if any of the types * refer to a type which can not be instantiated. - */ + */ Type[] getUpperBounds(); } |