diff options
author | Carl Shapiro <cshapiro@google.com> | 2010-06-08 16:37:12 -0700 |
---|---|---|
committer | Carl Shapiro <cshapiro@google.com> | 2010-06-08 17:04:11 -0700 |
commit | de75089fb7216d19e9c22cce4dc62a49513477d3 (patch) | |
tree | 8c4035cc05218ddb7595e9a5c5997b53e58c2572 | |
parent | 52ec072cc4dd215ff541a0b0842e91ea529a6e5d (diff) | |
download | android_dalvik-de75089fb7216d19e9c22cce4dc62a49513477d3.tar.gz android_dalvik-de75089fb7216d19e9c22cce4dc62a49513477d3.tar.bz2 android_dalvik-de75089fb7216d19e9c22cce4dc62a49513477d3.zip |
Remove trailing whitespace.
Change-Id: I95534bb2b88eaf48f2329282041118cd034c812b
476 files changed, 3195 insertions, 3195 deletions
diff --git a/dexdump/DexDump.c b/dexdump/DexDump.c index e5527ca80..318f84078 100644 --- a/dexdump/DexDump.c +++ b/dexdump/DexDump.c @@ -80,20 +80,20 @@ typedef struct FieldMethodInfo { } FieldMethodInfo; /* - * Get 2 little-endian bytes. - */ + * Get 2 little-endian bytes. + */ static inline u2 get2LE(unsigned char const* pSrc) { return pSrc[0] | (pSrc[1] << 8); -} +} /* - * Get 4 little-endian bytes. - */ + * Get 4 little-endian bytes. + */ static inline u4 get4LE(unsigned char const* pSrc) { return pSrc[0] | (pSrc[1] << 8) | (pSrc[2] << 16) | (pSrc[3] << 24); -} +} /* * Converts a single-character primitive type into its human-readable @@ -255,7 +255,7 @@ static char* createAccessFlagStr(u4 flags, AccessFor forWhat) { #define NUM_FLAGS 18 static const char* kAccessStrings[kAccessForMAX][NUM_FLAGS] = { - { + { /* class, inner class */ "PUBLIC", /* 0x0001 */ "PRIVATE", /* 0x0002 */ @@ -573,7 +573,7 @@ void dumpCatches(DexFile* pDexFile, const DexCode* pCode) if (triesSize == 0) { printf(" catches : (none)\n"); return; - } + } printf(" catches : %d\n", triesSize); @@ -585,7 +585,7 @@ void dumpCatches(DexFile* pDexFile, const DexCode* pCode) u4 start = pTry->startAddr; u4 end = start + pTry->insnCount; DexCatchIterator iterator; - + printf(" 0x%04x - 0x%04x\n", start, end); dexCatchIteratorInit(&iterator, pCode, pTry->handlerOff); @@ -593,14 +593,14 @@ void dumpCatches(DexFile* pDexFile, const DexCode* pCode) for (;;) { DexCatchHandler* handler = dexCatchIteratorNext(&iterator); const char* descriptor; - + if (handler == NULL) { break; } - - descriptor = (handler->typeIdx == kDexNoIndex) ? "<any>" : + + descriptor = (handler->typeIdx == kDexNoIndex) ? "<any>" : dexStringByTypeIdx(pDexFile, handler->typeIdx); - + printf(" %s -> 0x%04x\n", descriptor, handler->address); } @@ -616,11 +616,11 @@ static int dumpPositionsCb(void *cnxt, u4 address, u4 lineNum) /* * Dump the positions list. */ -void dumpPositions(DexFile* pDexFile, const DexCode* pCode, +void dumpPositions(DexFile* pDexFile, const DexCode* pCode, const DexMethod *pDexMethod) { printf(" positions : \n"); - const DexMethodId *pMethodId + const DexMethodId *pMethodId = dexGetMethodId(pDexFile, pDexMethod->methodIdx); const char *classDescriptor = dexStringByTypeIdx(pDexFile, pMethodId->classIdx); @@ -634,7 +634,7 @@ static void dumpLocalsCb(void *cnxt, u2 reg, u4 startAddress, const char *signature) { printf(" 0x%04x - 0x%04x reg=%d %s %s %s\n", - startAddress, endAddress, reg, name, descriptor, + startAddress, endAddress, reg, name, descriptor, signature); } @@ -646,9 +646,9 @@ void dumpLocals(DexFile* pDexFile, const DexCode* pCode, { printf(" locals : \n"); - const DexMethodId *pMethodId + const DexMethodId *pMethodId = dexGetMethodId(pDexFile, pDexMethod->methodIdx); - const char *classDescriptor + const char *classDescriptor = dexStringByTypeIdx(pDexFile, pMethodId->classIdx); dexDecodeDebugInfo(pDexFile, pCode, classDescriptor, pMethodId->protoIdx, @@ -669,7 +669,7 @@ bool getMethodInfo(DexFile* pDexFile, u4 methodIdx, FieldMethodInfo* pMethInfo) pMethInfo->name = dexStringById(pDexFile, pMethodId->nameIdx); pMethInfo->signature = dexCopyDescriptorFromMethodId(pDexFile, pMethodId); - pMethInfo->classDescriptor = + pMethInfo->classDescriptor = dexStringByTypeIdx(pDexFile, pMethodId->classIdx); return true; } @@ -1067,9 +1067,9 @@ void dumpBytecodes(DexFile* pDexFile, const DexMethod* pDexMethod) insnWidth = 2 + get2LE((const u1*)(insns+1)) * 4; } else if (instr == kArrayDataSignature) { int width = get2LE((const u1*)(insns+1)); - int size = get2LE((const u1*)(insns+2)) | + int size = get2LE((const u1*)(insns+2)) | (get2LE((const u1*)(insns+3))<<16); - // The plus 1 is to round up for odd size and width + // The plus 1 is to round up for odd size and width insnWidth = 4 + ((size * width) + 1) / 2; } else { opCode = instr & 0xff; @@ -1355,7 +1355,7 @@ void dumpClass(DexFile* pDexFile, int idx, char** pLastPackage) printf("Trouble reading class data (#%d)\n", idx); goto bail; } - + classDescriptor = dexStringByTypeIdx(pDexFile, pClassDef->classIdx); /* diff --git a/dexdump/OpCodeNames.h b/dexdump/OpCodeNames.h index 1aec0d174..3965c6de6 100644 --- a/dexdump/OpCodeNames.h +++ b/dexdump/OpCodeNames.h @@ -15,7 +15,7 @@ */ /* * Dalvik opcode names. - */ + */ #ifndef _DEXDUMP_OPCODENAMES #define _DEXDUMP_OPCODENAMES diff --git a/dexlist/DexList.c b/dexlist/DexList.c index 841c17ffc..f2bec09d2 100644 --- a/dexlist/DexList.c +++ b/dexlist/DexList.c @@ -165,19 +165,19 @@ void dumpClass(DexFile* pDexFile, int idx) fprintf(stderr, "Trouble reading class data\n"); return; } - + if (pClassDef->sourceFileIdx == 0xffffffff) { fileName = NULL; } else { fileName = dexStringById(pDexFile, pClassDef->sourceFileIdx); } - - /* + + /* * TODO: Each class def points at a sourceFile, so maybe that * should be printed out. However, this needs to be coordinated * with the tools that parse this output. */ - + for (i = 0; i < (int) pClassData->header.directMethodsSize; i++) { dumpMethod(pDexFile, fileName, &pClassData->directMethods[i], i); } diff --git a/docs/dalvik-bytecode.html b/docs/dalvik-bytecode.html index 6d6c4f17a..e69a962ee 100644 --- a/docs/dalvik-bytecode.html +++ b/docs/dalvik-bytecode.html @@ -448,7 +448,7 @@ no arrays of <code>long</code> or <code>double</code>, but reference types are acceptable). The constructed instance is stored as a "result" in the same way that the method invocation - instructions store their results, so the constructed instance must + instructions store their results, so the constructed instance must be moved to a register with an immediately subsequent <code>move-result-object</code> instruction (if it is to be used).</td> </tr> @@ -1453,7 +1453,7 @@ round-to-nearest and gradual underflow, except where stated otherwise.</p> float result = a % b; </td> <td>Floating point remainder after division. This function is different - than IEEE 754 remainder and is defined as + than IEEE 754 remainder and is defined as <code>result == a - roundTowardZero(a / b) * b</code>. </td> </tr> @@ -1491,7 +1491,7 @@ round-to-nearest and gradual underflow, except where stated otherwise.</p> double result = a % b; </td> <td>Floating point remainder after division. This function is different - than IEEE 754 remainder and is defined as + than IEEE 754 remainder and is defined as <code>result == a - roundTowardZero(a / b) * b</code>. </td> </tr> diff --git a/docs/dalvik-constraints.html b/docs/dalvik-constraints.html index 105225a7b..69abf3af3 100644 --- a/docs/dalvik-constraints.html +++ b/docs/dalvik-constraints.html @@ -5,11 +5,11 @@ <title>Dalvik bytecode constraints</title> <link rel=stylesheet href="dalvik-constraints.css"> </head> - + <body> - + <h1>Dalvik bytecode constraints</h1> - + <!-- <h1>General integrity constraints</h1> @@ -18,17 +18,17 @@ <th> Identifier </th> - + <th> Description </th> </tr> - + <tr> <td> A1 </td> - + <td> The magic number of the DEX file must be "dex\n035\0". </td> @@ -38,7 +38,7 @@ <td> A1 </td> - + <td> The checksum must be an Adler-32 checksum of the whole file contents except magic and checksum field. @@ -54,14 +54,14 @@ The file_size must match the actual file size in bytes. The header_size must have the value 0x70. The endian_tag must have either the value ENDIAN_CONSTANT or -REVERSE_ENDIAN_CONSTANT. - +REVERSE_ENDIAN_CONSTANT. + For each of the link, string_ids, type_ids, proto_ids, field_ids, method_ids, class_defs and data sections, the offset and size fields must be either both zero or both non-zero. In the latter case, the offset must be four-byte-aligned. All offset fields in the header except map_off must be four-byte-aligned. - + The map_off field must be either zero or point into the data section. In the latter case, the data section must exist. @@ -124,7 +124,7 @@ type_ids list. The referenced entry must be a non-array reference type. ... --> - + <h2> Static constraints </h2> @@ -134,153 +134,153 @@ type_ids list. The referenced entry must be a non-array reference type. They usually can be checked without employing control or data-flow analysis techniques. </p> - + <table> <tr> <th> Identifier </th> - + <th> Description </th> - + <th> Spec equivalent </th> </tr> - + <tr> <td> A1 </td> - + <td> - The <code>insns</code> array must not be empty. + The <code>insns</code> array must not be empty. </td> - + <td> 4.8.1.1 </td> </tr> - + <tr> <td> A2 </td> - + <td> The first opcode in the <code>insns</code> array must have index zero. </td> - + <td> 4.8.1.3 </td> </tr> - + <tr> <td> A3 </td> - + <td> The <code>insns</code> array must only contain valid Dalvik opcodes. </td> - + <td> 4.8.1.4 </td> </tr> - + <tr> <td> A4 </td> - + <td> The index of instruction <code>n+1</code> must equal the index of instruction <code>n</code> plus the length of instruction <code>n</code>, taking into account possible operands. </td> - + <td> 4.8.1.5 </td> </tr> - + <tr> <td> A5 </td> - + <td> The last instruction in the <code>insns</code> array must end at index - <code>insns_size-1</code>. + <code>insns_size-1</code>. </td> - + <td> 4.8.1.6 </td> </tr> - + <tr> <td> A6 </td> - + <td> All <code>goto</code> and <code>if-<kind></code> targets must be opcodes within in the same method. </td> - + <td> 4.8.1.7 </td> </tr> - + <tr> <td> A7 </td> - + <td> All targets of a <code>packed-switch</code> instruction must be opcodes within in the same method. The size and the list of targets - must be consistent. + must be consistent. </td> - + <td> 4.8.1.8 </td> </tr> - + <tr> <td> A8 </td> - + <td> All targets of a <code>sparse-switch</code> instruction must be opcodes within in the same method. The corresponding table must be - consistent and sorted low-to-high. + consistent and sorted low-to-high. </td> - + <td> 4.8.1.9 </td> </tr> - + <tr> <td> A9 </td> - + <td> The <code>B</code> operand of the <code>const-string</code> and <code>const-string/jumbo</code> instructions must be a valid index into the string constant pool. </td> - + <td> 4.8.1.10 </td> @@ -290,31 +290,31 @@ type_ids list. The referenced entry must be a non-array reference type. <td> A10 </td> - + <td> The <code>C</code> operand of the <code>iget<kind></code> and <code>iput<kind></code> instructions must be a valid index into the field constant pool. The referenced entry must represent an instance field. </td> - + <td> 4.8.1.12 </td> </tr> - + <tr> <td> A11 </td> - + <td> The <code>C</code> operand of the <code>sget<kind></code> and <code>sput<kind></code> instructions must be a valid index into the field constant pool. The referenced entry must represent a static field. </td> - + <td> 4.8.1.12 </td> @@ -324,33 +324,33 @@ type_ids list. The referenced entry must be a non-array reference type. <td> A12 </td> - + <td> The <code>C</code> operand of the <code>invoke-virtual</code>, <code>invoke-super</code>, <code<invoke-direct</code> and <code>invoke-static</code> instructions must be a valid index into the method constant pool. In all cases, the referenced - <code>method_id</code> must belong to a class (not an interface). + <code>method_id</code> must belong to a class (not an interface). </td> - + <td> 4.8.1.13 </td> </tr> - + <tr> <td> A13 </td> - + <td> The <code>B</code> operand of the <code>invoke-virtual/range</code>, <code>invoke-super/range</code>, <code>invoke-direct/range</code>, and <code>invoke-static/range</code> instructions must be a valid index into the method constant pool. In all cases, the referenced - <code>method_id</code> must belong to a class (not an interface). + <code>method_id</code> must belong to a class (not an interface). </td> - + <td> 4.8.1.13 </td> @@ -360,81 +360,81 @@ type_ids list. The referenced entry must be a non-array reference type. <td> A14 </td> - + <td> A method the name of which starts with a '<' must only be invoked implicitly by the VM, not by code originating from a Dex file. The only exception is the instance initializer, which may be invoked by <code>invoke-direct</code>. </td> - + <td> 4.8.1.14 </td> </tr> - + <tr> <td> A15 </td> - + <td> The <code>C</code> operand of the <code>invoke-interface</code> instruction must be a valid index into the method constant pool. The referenced <code>method_id</code> must belong to an interface (not a class). </td> - + <td> 4.8.1.15 </td> </tr> - + <tr> <td> A16 </td> - + <td> The <code>B</code> operand of the <code>invoke-interface/range</code> instruction must be a valid index into the method constant pool. The referenced <code>method_id</code> must belong to an interface (not a class). </td> - + <td> 4.8.1.15 </td> </tr> - + <tr> <td> A17 </td> - + <td> The <code>B</code> operand of the <code>const-class</code>, <code>check-cast</code>, <code>new-instance</code>, and <code>filled-new-array/range</code> instructions must be a valid index into the type constant pool. </td> - + <td> 4.8.1.16 </td> </tr> - + <tr> <td> A18 </td> - + <td> The <code>C</code> operand of the <code>instance-of</code>, <code>new-array</code>, and <code>filled-new-array</code> instructions must be a valid index into the type constant pool. </td> - + <td> 4.8.1.16 </td> @@ -444,85 +444,85 @@ type_ids list. The referenced entry must be a non-array reference type. <td> A19 </td> - + <td> The dimensions of an array created by a <code>new-array</code> instruction must be less than <code>256</code>. </td> - + <td> 4.8.1.17 </td> </tr> - + <tr> <td> A20 </td> - + <td> The <code>new</code> instruction must not refer to array classes, interfaces, or abstract classes. </td> - + <td> 4.8.1.18 </td> </tr> - + <tr> <td> A21 </td> - + <td> The type referred to by a <code>new-array</code> instruction must be a valid, non-reference type. </td> - + <td> 4.8.1.20 </td> </tr> - + <tr> <td> A22 </td> - + <td> All registers referred to by an instruction in a single-width (non-pair) fashion must be valid for the current method. That is, their indices must be non-negative and smaller than - <code>registers_size</code>. + <code>registers_size</code>. </td> - + <td> 4.8.1.21 </td> </tr> - + <tr> <td> A23 </td> - + <td> All registers referred to by an instruction in a double-width (pair) fashion must be valid for the current method. That is, their indices - must be non-negative and smaller than <code>registers_size-1</code>. + must be non-negative and smaller than <code>registers_size-1</code>. </td> - + <td> 4.8.1.23 </td> </tr> </table> - + <h2> Structural constraints </h2> - + <p> Structural constraints are constraints on relationships between several elements of the bytecode. They usually can't be checked without employing @@ -534,291 +534,291 @@ type_ids list. The referenced entry must be a non-array reference type. <th> Identifier </th> - + <th> Description </th> - + <th> Spec equivalent </th> </tr> - + <tr> <td> B1 </td> - + <td> The number and types of arguments (registers and immediate values) must always match the instruction. </td> - + <td> 4.8.2.1 </td> </tr> - + <tr> <td> B2 </td> - + <td> - Register pairs must never be broken up. + Register pairs must never be broken up. </td> - + <td> 4.8.2.3 </td> </tr> - + <tr> <td> B3 </td> - + <td> A register (or pair) has to be assigned first before it can be read. </td> - + <td> 4.8.2.4 </td> </tr> - + <tr> <td> B4 </td> - + <td> An <code>invoke-direct</code> instruction must only invoke an instance initializer or a method in the current class or one of its - superclasses. + superclasses. </td> - + <td> 4.8.2.7 </td> </tr> - + <tr> <td> B5 </td> - + <td> An instance initializer must only be invoked on an uninitialized instance. </td> - + <td> 4.8.2.8 </td> </tr> - + <tr> <td> B6 </td> - + <td> Instance methods may only be invoked on and instance fields may only - be accessed on already initialized instances. + be accessed on already initialized instances. </td> - + <td> 4.8.2.9 </td> </tr> - + <tr> <td> B7 </td> - + <td> A register which holds the result of a <code>new-instance</code>code> instruction must not be used if the same <code>new-instance</code>code> instruction is again executed before - the instance is initialized. + the instance is initialized. </td> - + <td> 4.8.2.10 </td> </tr> - + <tr> <td> B8 </td> - + <td> An instance initializer must call another instance initializer (same class or superclass) before any instance members can be accessed. Exceptions are non-inherited instance fields, which can be assigned before calling another initializer, and the <code>Object</code> class - in general. + in general. </td> - + <td> 4.8.2.11 </td> </tr> - + <tr> <td> B9 </td> - + <td> All actual method arguments must be assignment-compatible with their - respective formal arguments. + respective formal arguments. </td> - + <td> 4.8.2.12 </td> </tr> - + <tr> <td> B10 </td> - + <td> For each instance method invocation, the actual instance must be assignment-compatible with the class or interface specified in the instruction. </td> - + <td> 4.8.2.13 </td> </tr> - + <tr> <td> B11 </td> - + <td> A <code>return<kind></code> instruction must match its - method's return type. + method's return type. </td> - + <td> 4.8.2.14 </td> </tr> - + <tr> <td> B12 </td> - + <td> When accessing protected members of a superclass, the actual type of the instance being accessed must be either the current class or one of its subclasses. </td> - + <td> 4.8.2.15 </td> </tr> - + <tr> <td> B13 </td> - + <td> The type of a value stored into a static field must be assignment-compatible with or convertible to the field's type. </td> - + <td> 4.8.2.16 </td> </tr> - + <tr> <td> B14 </td> - + <td> The type of a value stored into a field must be assignment-compatible with or convertible to the field's type. </td> - + <td> 4.8.2.17 </td> </tr> - + <tr> <td> B15 </td> - + <td> The type of every value stored into an array must be assignment-compatible with the array's component type. </td> - + <td> 4.8.2.18 </td> </tr> - + <tr> <td> B16 </td> - + <td> The <code>A</code> operand of a <code>throw</code> instruction must - be assignment-compatible with <code>java.lang.Throwable</code>. + be assignment-compatible with <code>java.lang.Throwable</code>. </td> - + <td> 4.8.2.19 </td> </tr> - + <tr> <td> B17 </td> - + <td> The last reachable instruction of a method must either be a backwards <code>goto</code> or branch, a <code>return</code>, or a <code>throw</code> instruction. It must not be possible to leave the <code>insns</code> array at the bottom. </td> - + <td> 4.8.2.20 </td> </tr> - + <tr> <td> B18 </td> - + <td> The unassigned half of a former register pair may not be read (is considered invalid) until it has been re-assigned by some other instruction. - </td> - + </td> + <td> 4.8.2.3, 4.8.2.4 </td> @@ -828,15 +828,15 @@ type_ids list. The referenced entry must be a non-array reference type. <td> B19 </td> - + <td> A <code>move-result<kind></code> instruction must be immediately preceded (in the <code>insns</code> array) by an <code><invoke-kind></code> instruction. The only exception is the <code>move-result-object</code> instruction, which may also be - preceded by a <code>filled-new-array</code> instruction. + preceded by a <code>filled-new-array</code> instruction. </td> - + <td> - </td> @@ -846,16 +846,16 @@ type_ids list. The referenced entry must be a non-array reference type. <td> B20 </td> - + <td> A <code>move-result<kind></code> instruction must be immediately preceded (in actual control flow) by a matching <code>return-<kind></code> instruction (it must not be jumped to). The only exception is the <code>move-result-object</code> instruction, which may also be preceded by a - <code>filled-new-array</code> instruction. + <code>filled-new-array</code> instruction. </td> - + <td> - </td> @@ -865,28 +865,28 @@ type_ids list. The referenced entry must be a non-array reference type. <td> B21 </td> - + <td> A <code>move-exception</code> instruction must only appear as the first instruction in an exception handler. </td> - + <td> - </td> </tr> - + <tr> <td> B22 </td> - + <td> The <code>packed-switch-data</code>, <code>sparse-switch-data</code>, and <code>fill-array-data</code> pseudo-instructions must not be reachable by control flow. </td> - + <td> - </td> diff --git a/docs/dex-format.css b/docs/dex-format.css index 17e935f75..153dd4e8d 100644 --- a/docs/dex-format.css +++ b/docs/dex-format.css @@ -85,13 +85,13 @@ table td { background: #eeeeff; } -table p { +table p { margin-bottom: 0pt; } /* for the bnf syntax sections */ -table.bnf { +table.bnf { background: #eeeeff; border-color: #aaaaff; border-style: solid; @@ -104,7 +104,7 @@ table.bnf { padding-right: 6pt; } -table.bnf td { +table.bnf td { border: none; padding-left: 6pt; padding-right: 6pt; @@ -112,12 +112,12 @@ table.bnf td { padding-bottom: 1pt; } -table.bnf td:first-child { +table.bnf td:first-child { padding-right: 0pt; width: 8pt; } -table.bnf td:first-child td { +table.bnf td:first-child td { padding-left: 0pt; } diff --git a/docs/dex-format.html b/docs/dex-format.html index bc69dd099..cab9d4c5b 100644 --- a/docs/dex-format.html +++ b/docs/dex-format.html @@ -1305,7 +1305,7 @@ may appear in a <code>.dex</code> file. <tr> <td>data_off</td> <td>uint</td> - <td>offset from the start of the file to the start of the + <td>offset from the start of the file to the start of the <code>data</code> section. </td> </tr> @@ -1559,7 +1559,7 @@ be ordered by initial offset and must not overlap.</p> <td>data</td> <td>ubyte[]</td> <td>a series of MUTF-8 code units (a.k.a. octets, a.k.a. bytes) - followed by a byte of value <code>0</code>. See + followed by a byte of value <code>0</code>. See "MUTF-8 (Modified UTF-8) Encoding" above for details and discussion about the data format. <p><b>Note:</b> It is acceptable to have a string which includes @@ -1892,7 +1892,7 @@ be ordered by initial offset and must not overlap.</p> </tbody> </table> -<p><b>Note:</b> All elements' <code>field_id</code>s and +<p><b>Note:</b> All elements' <code>field_id</code>s and <code>method_id</code>s must refer to the same defining class.</p> <h3><code>encoded_field</code> Format</h3> @@ -2055,10 +2055,10 @@ be ordered by initial offset and must not overlap.</p> <tr> <td>debug_info_off</td> <td>uint</td> - <td>offset from the start of the file to the debug info (line numbers + - local variable info) sequence for this code, or <code>0</code> if - there simply is no information. The offset, if non-zero, should be - to a location in the <code>data</code> section. The format of + <td>offset from the start of the file to the debug info (line numbers + + local variable info) sequence for this code, or <code>0</code> if + there simply is no information. The offset, if non-zero, should be + to a location in the <code>data</code> section. The format of the data is specified by "<code>debug_info_item</code>" below. </td> </tr> @@ -2258,7 +2258,7 @@ The <code>line</code> register represents what source line number should be associated with the next positions table entry emitted by the state machine. It is initialized in the sequence header, and may change in positive or negative directions but must never be less than -<code>1</code>. The <code>source_file</code> register represents the +<code>1</code>. The <code>source_file</code> register represents the source file that the line number entries refer to. It is initialized to the value of <code>source_file_idx</code> in <code>class_def_item</code>. The other two variables, <code>prologue_end</code> and @@ -2282,7 +2282,7 @@ each register for the <code>DBG_RESTART_LOCAL</code> code.</p> <tr> <td>line_start</td> <td>uleb128</td> - <td>the initial value for the state machine's <code>line</code> register. + <td>the initial value for the state machine's <code>line</code> register. Does not represent an actual positions entry. </td> </tr> @@ -2351,7 +2351,7 @@ each register for the <code>DBG_RESTART_LOCAL</code> code.</p> <code>name_idx</code>: string index of the name<br/> <code>type_idx</code>: type index of the type </td> - <td>introduces a local variable at the current address. Either + <td>introduces a local variable at the current address. Either <code>name_idx</code> or <code>type_idx</code> may be <code>NO_INDEX</code> to indicate that that value is unknown. </td> @@ -2363,7 +2363,7 @@ each register for the <code>DBG_RESTART_LOCAL</code> code.</p> uleb128p1 name_idx<br/> uleb128p1 type_idx<br/> uleb128p1 sig_idx - </td> + </td> <td><code>register_num</code>: register that will contain local<br/> <code>name_idx</code>: string index of the name<br/> <code>type_idx</code>: type index of the type<br/> @@ -2385,7 +2385,7 @@ each register for the <code>DBG_RESTART_LOCAL</code> code.</p> <td>0x05</td> <td>uleb128 register_num</td> <td><code>register_num</code>: register that contained local</td> - <td>marks a currently-live local variable as out of scope at the current + <td>marks a currently-live local variable as out of scope at the current address </td> </tr> @@ -2404,9 +2404,9 @@ each register for the <code>DBG_RESTART_LOCAL</code> code.</p> <td>0x07</td> <td></td> <td><i>(none)</i></td> - <td>sets the <code>prologue_end</code> state machine register, - indicating that the next position entry that is added should be - considered the end of a method prologue (an appropriate place for + <td>sets the <code>prologue_end</code> state machine register, + indicating that the next position entry that is added should be + considered the end of a method prologue (an appropriate place for a method breakpoint). The <code>prologue_end</code> register is cleared by any special (<code>>= 0x0a</code>) opcode. </td> @@ -2416,9 +2416,9 @@ each register for the <code>DBG_RESTART_LOCAL</code> code.</p> <td>0x08</td> <td></td> <td><i>(none)</i></td> - <td>sets the <code>epilogue_begin</code> state machine register, - indicating that the next position entry that is added should be - considered the beginning of a method epilogue (an appropriate place + <td>sets the <code>epilogue_begin</code> state machine register, + indicating that the next position entry that is added should be + considered the beginning of a method epilogue (an appropriate place to suspend execution before method exit). The <code>epilogue_begin</code> register is cleared by any special (<code>>= 0x0a</code>) opcode. @@ -2427,7 +2427,7 @@ each register for the <code>DBG_RESTART_LOCAL</code> code.</p> <tr> <td>DBG_SET_FILE</td> <td>0x09</td> - <td>uleb128p1 name_idx</td> + <td>uleb128p1 name_idx</td> <td><code>name_idx</code>: string index of source file name; <code>NO_INDEX</code> if unknown </td> @@ -2438,7 +2438,7 @@ each register for the <code>DBG_RESTART_LOCAL</code> code.</p> </tr> <tr> <td><i>Special Opcodes</i></td> - <!-- When updating the range below, make sure to search for other + <!-- When updating the range below, make sure to search for other instances of 0x0a in this section. --> <td>0x0a…0xff</td> <td></td> @@ -2532,7 +2532,7 @@ address += (adjusted_opcode / DBG_LINE_RANGE) </tbody> </table> -<p><b>Note:</b> All elements' <code>field_id</code>s and +<p><b>Note:</b> All elements' <code>field_id</code>s and <code>method_id</code>s must refer to the same defining class.</p> <h3><code>field_annotation</code> Format</h3> diff --git a/docs/hello-world.html b/docs/hello-world.html index dbbaea6a3..7491a2821 100644 --- a/docs/hello-world.html +++ b/docs/hello-world.html @@ -22,7 +22,7 @@ files into a DEX file, and push that to the device. Here's a simple example: % <font color="green">dx --dex --output=foo.jar Foo.class</font><br> % <font color="green">adb push foo.jar /sdcard</font><br> % <font color="green">adb shell dalvikvm -cp /sdcard/foo.jar Foo</font><br> -Hello, world +Hello, world </code> </p><p> The <code>-cp</code> option sets the classpath. The initial directory diff --git a/docs/instruction-formats.css b/docs/instruction-formats.css index ee23c5c64..a2dc42f9d 100644 --- a/docs/instruction-formats.css +++ b/docs/instruction-formats.css @@ -124,6 +124,6 @@ table.format th:first-child + th + th + th { width: 22%; } -table.format p { +table.format p { margin-bottom: 0pt; }
\ No newline at end of file diff --git a/docs/java-bytecode.css b/docs/java-bytecode.css index 6075c0d69..48984b24b 100644 --- a/docs/java-bytecode.css +++ b/docs/java-bytecode.css @@ -10,7 +10,7 @@ } } -h1 { +h1 { text-align: center; } @@ -26,16 +26,16 @@ td { border-width: 0; } -td.outer { +td.outer { width: 25%; padding: 0; } -td.outer table { +td.outer table { width: 100%; } -td.outer td { +td.outer td { border-width: 0; background: #f8f8f8; padding: 1pt; @@ -43,11 +43,11 @@ td.outer td { padding-right: 2pt; } -tr.d td { +tr.d td { background: #dddddd; } -td.outer td + td + td { +td.outer td + td + td { font-family: monospace; font-weight: bold; padding-right: 5pt; diff --git a/docs/java-constraints.html b/docs/java-constraints.html index 2410a1e7f..9d3c4349d 100644 --- a/docs/java-constraints.html +++ b/docs/java-constraints.html @@ -30,7 +30,7 @@ constraint will fail during the Dx conversion or during verification in the VM itself. </p> - + <h2> Static constraints </h2> @@ -40,311 +40,311 @@ They usually can be checked without employing control or data-flow analysis techniques. </p> - + <table> <tr> <th> Identifier </th> - + <th> Description </th> - + <th> Spec equivalent </th> - + <th> Failure mode </th> </tr> - + <tr> <td> A1 </td> - + <td> - The <code>code</code> array must not be empty. + The <code>code</code> array must not be empty. </td> - + <td> 4.8.1.1 </td> - + <td> DX </td> </tr> - + <tr> <td> A2 </td> - + <td> - The <code>code</code> array must not be larger than 65535 bytes. + The <code>code</code> array must not be larger than 65535 bytes. </td> - + <td> 4.8.1.2 </td> - + <td> DX </td> </tr> - + <tr> <td> A3 </td> - + <td> The first opcode in <code>code</code> array must have index <code>0</code>. </td> - + <td> 4.8.1.3 </td> - + <td> DX </td> </tr> - + <tr> <td> A4 </td> - + <td> The <code>code</code> array must only contain valid opcodes. </td> - + <td> 4.8.1.4 </td> - + <td> DX </td> </tr> - + <tr> <td> A5 </td> - + <td> The index of instruction <code>n+1</code> must equal the index of instruction <code>n</code> plus the length of instruction <code>n</code>, taking into account a possible <code>wide</code> instruction. Opcodes modified by a <code>wide</code> instruction must - not be directly reachable. + not be directly reachable. </td> - + <td> 4.8.1.5 </td> - + <td> DX </td> </tr> - + <tr> <td> A6 </td> - + <td> The last instruction in <code>code</code> array must end at index - <code>code_length-1</code>. + <code>code_length-1</code>. </td> - + <td> 4.8.1.6 </td> - + <td> DX </td> </tr> - + <tr> <td> A7 </td> - + <td> All jump and branch targets must be opcodes within the same method. Opcodes modified by a <code>wide</code> instruction must not be - directly reachable via a jump or branch instruction. + directly reachable via a jump or branch instruction. </td> - + <td> 4.8.1.7 </td> - + <td> DX </td> </tr> - + <tr> <td> A8 </td> - + <td> All targets of a <code>tableswitch</code> instruction must be opcodes within the same method. Upper and lower bounds must be consistent. Opcodes modified by a <code>wide</code> instruction must not be - directly reachable via a <code>tableswitch</code> instruction. + directly reachable via a <code>tableswitch</code> instruction. </td> - + <td> 4.8.1.8 </td> - + <td> DX </td> </tr> - + <tr> <td> A9 </td> - + <td> All targets of a <code>lookupswitch</code> instruction must be opcodes within the same method. Its table must be consistent and sorted low-to-high. Opcodes modified by a <code>wide</code> instruction must - not be directly reachable via a <code>lookupswitch</code> instruction. + not be directly reachable via a <code>lookupswitch</code> instruction. </td> - + <td> 4.8.1.9 </td> - + <td> DX </td> </tr> - + <tr> <td> A10 </td> - + <td> The operands of <code>ldc</code> and <code>ldc_w</code> instructions must be valid indices into the constant pool. The respective entries must be of type <code>CONSTANT_Integer</code>, - <code>CONSTANT_Float</code>, or <code>CONSTANT_String</code>. + <code>CONSTANT_Float</code>, or <code>CONSTANT_String</code>. </td> - + <td> 4.8.1.10 </td> - + <td> DX </td> </tr> - + <tr> <td> A11 </td> - + <td> The operands of <code>ldc2_w</code> instructions must be valid indices into the constant pool. The respective entries must be of type <code>CONSTANT_Long</code> or <code>CONSTANT_Double</code>. The subsequent constant pool entry must be valid and remain unused. </td> - + <td> 4.8.1.11 </td> - + <td> DX </td> </tr> - + <tr> <td> A12 </td> - + <td> The Operands of <code>get<kind></code> and <code>put<kind></code> instructions must be valid indices into constant pool. The respective entries must be of type <code>CONSTANT_Fieldref</code>. </td> - + <td> 4.8.1.12 </td> - + <td> DX </td> </tr> - + <tr> <td> A13 </td> - + <td> The first two operands of <code>invokevirtual</code>, <code>invokespecial</code>, and <code>invokestatic</code> must form a valid 16-bit index into the constant pool. The respective entries must be of type <code>CONSTANT_Methodref</code>. </td> - + <td> 4.8.1.13 </td> - + <td> DX </td> </tr> - + <tr> <td> A14 </td> - + <td> Methods whose names start with '<' must only be invoked implicitly by the VM, not by class file code. The only exception is the instance initializer, which may be invoked by <code>invokespecial</code>. </td> - + <td> 4.8.1.14 </td> - + <td> DX </td> </tr> - + <tr> <td> A15 </td> - + <td> The first two operands of <code>invokeinterface</code> must form a valid 16-bit index into the constant pool. The entry must be of type @@ -352,21 +352,21 @@ specify number of local variables and the fourth operand must always be zero. </td> - + <td> 4.8.1.15 </td> - + <td> DX </td> </tr> - + <tr> <td> A16 </td> - + <td> The operands of <code>instanceof</code>, <code>checkcast</code>, <code>new</code>, and <code>anewarray</code> instructions must @@ -375,218 +375,218 @@ into the constant pool. All respective entries must be of type <code>CONSTANT_Class</code>. </td> - + <td> 4.8.1.16 </td> - + <td> DX </td> </tr> - + <tr> <td> A17 </td> - + <td> The dimensions of an array created by <code>anewarray</code> instructions must be less than <code>256</code>. </td> - + <td> 4.8.1.17 </td> - + <td> DX </td> </tr> - + <tr> <td> A18 </td> - + <td> The <code>new</code> instruction must not reference array classes, interfaces, or abstract classes. </td> - + <td> 4.8.1.18 </td> - + <td> DX </td> </tr> - + <tr> <td> A19 </td> - + <td> The type referenced by a <code>multinewarray</code> instruction must have at least as many dimensions as specified in the instruction. The - dimensions operand must not be <code>0</code> + dimensions operand must not be <code>0</code> </td> - + <td> 4.8.1.19 </td> - + <td> DX </td> </tr> - + <tr> <td> A20 </td> - + <td> The type referenced by a <code>newarray</code> instruction must be a valid, non-reference type. </td> - + <td> 4.8.1.20 </td> - + <td> DX </td> </tr> - + <tr> <td> A21 </td> - + <td> The index operand of instructions explicitly referencing single-width local variables must be non-negative and smaller than <code>max_locals</code>. </td> - + <td> 4.8.1.21 </td> - + <td> DX </td> </tr> - + <tr> <td> A22 </td> - + <td> The index operand of instructions implicitly referencing single-width local variables must be non-negative and smaller than <code>max_locals</code>. </td> - + <td> 4.8.1.22 </td> - + <td> DX </td> </tr> - + <tr> <td> A23 </td> - + <td> The index operand of instructions explicitly referencing double-width local variables must be non-negative and smaller than <code>max_locals-1</code>. </td> - + <td> 4.8.1.23 </td> - + <td> DX </td> </tr> - + <tr> <td> A24 </td> - + <td> The index operand of instructions implicitly referencing double-width local variables must be non-negative and smaller than <code>max_locals-1</code>. </td> - + <td> 4.8.1.24 </td> - + <td> DX </td> </tr> - + <tr> <td> A25 </td> - + <td> The index operand of <code>wide</code> instructions explicitly referencing single-width local variables must be non-negative and smaller than <code>max_locals</code>. </td> - + <td> 4.8.1.25 </td> - + <td> DX </td> </tr> - + <tr> <td> A26 </td> - + <td> The index operand of <code>wide</code> instructions explicitly referencing double-width local variables must be non-negative and smaller than <code>max_locals-1</code>. </td> - + <td> 4.8.1.25 </td> - + <td> DX </td> </tr> </table> - + <h2> Structural constraints </h2> - + <p> Structural constraints are constraints on relationships between several elements of the bytecode. They usually can't be checked without employing @@ -598,466 +598,466 @@ <th> Identifier </th> - + <th> Description </th> - + <th> Spec equivalent </th> - + <th> Failure mode </th> </tr> - + <tr> <td> B1 </td> - + <td> The number and types of arguments (operands and local variables) must always match the instruction. </td> - + <td> 4.8.2.1 </td> - + <td> DX </td> </tr> - + <tr> <td> B2 </td> - + <td> The operand stack must have the same depth for all executions paths - leading to an instruction. + leading to an instruction. </td> - + <td> 4.8.2.2 </td> - + <td> DX </td> </tr> - + <tr> <td> B3 </td> - + <td> - Local variable pairs must never be broken up. + Local variable pairs must never be broken up. </td> - + <td> 4.8.2.3 </td> - + <td> DX </td> </tr> - + <tr> <td> B4 </td> - + <td> A local variable (or pair) has to be assigned first before it can be read. </td> - + <td> 4.8.2.4 </td> - + <td> DX </td> </tr> - + <tr> <td> B5 </td> - + <td> - The operand stack must never grow beyond <code>max_stack</code>. + The operand stack must never grow beyond <code>max_stack</code>. </td> - + <td> 4.8.2.5 </td> - + <td> DX </td> </tr> - + <tr> <td> B6 </td> - + <td> - The operand stack must never underflow. + The operand stack must never underflow. </td> - + <td> 4.8.2.6 </td> - + <td> DX </td> </tr> - + <tr> <td> B7 </td> - + <td> An <code>invokespecial</code> instruction must only invoke an instance initializer or a method in the current class or one of its - superclasses. + superclasses. </td> - + <td> 4.8.2.7 </td> - + <td> VM </td> </tr> - + <tr> <td> B8 </td> - + <td> An instance initializer must only be invoked on an uninitialized - instance residing on the operand stack. + instance residing on the operand stack. </td> - + <td> 4.8.2.8 </td> - + <td> VM </td> </tr> - + <tr> <td> B9 </td> - + <td> Instance methods may only be invoked on and instance fields may only - be accessed on already initialized instances. + be accessed on already initialized instances. </td> - + <td> 4.8.2.9 </td> - + <td> VM </td> </tr> - + <tr> <td> B10 </td> - + <td> The must be no backwards branches with uninitialized instances on the operand stack or in local variables. There must be no code protected by an exception handler that contains local variables with uninitialized instances. </td> - + <td> 4.8.2.10 </td> - + <td> DX </td> </tr> - + <tr> <td> B11 </td> - + <td> An instance initializer must call another instance initializer (same class or superclass) before any instance members can be accessed. Exceptions are non-inherited instance fields, which can be assigned before calling another initializer, and the <code>Object</code> class - in general. + in general. </td> - + <td> 4.8.2.11 </td> - + <td> VM </td> </tr> - + <tr> <td> B12 </td> - + <td> All actual method arguments must be assignment-compatible with formal - arguments. + arguments. </td> - + <td> 4.8.2.12 </td> - + <td> VM </td> </tr> - + <tr> <td> B13 </td> - + <td> For each instance method invocation, the actual instance must be assignment-compatible with the class or interface specified in the instruction. </td> - + <td> 4.8.2.13 </td> - + <td> VM </td> </tr> - + <tr> <td> B14 </td> - + <td> - A returns instruction must match its method's return type. + A returns instruction must match its method's return type. </td> - + <td> 4.8.2.14 </td> - + <td> VM </td> </tr> - + <tr> <td> B15 </td> - + <td> When accessing protected members of a superclass, the actual type of the instance being accessed must be either the current class or one of its subclasses. </td> - + <td> 4.8.2.15 </td> - + <td> VM </td> </tr> - + <tr> <td> B16 </td> - + <td> The type of a value stored into a static field must be assignment-compatible with or convertible to the field's type. </td> - + <td> 4.8.2.16 </td> - + <td> VM </td> </tr> - + <tr> <td> B17 </td> - + <td> The type of a value stored into a field must be assignment-compatible with or convertible to the field's type. </td> - + <td> 4.8.2.17 </td> - + <td> VM </td> </tr> - + <tr> <td> B18 </td> - + <td> The type of every value stored into an array must be assignment-compatible with the array's component type. </td> - + <td> 4.8.2.18 </td> - + <td> VM </td> </tr> - + <tr> <td> B19 </td> - + <td> The operand of an <code>athrow</code> instruction must be - assignment-compatible with <code>java.lang.Throwable</code>. + assignment-compatible with <code>java.lang.Throwable</code>. </td> - + <td> 4.8.2.19 </td> - + <td> VM </td> </tr> - + <tr> <td> B20 </td> - + <td> The last reachable instruction of a method must either be a backwards jump or branch, a return, or an <code>athrow</code> instruction. It must not be possible to leave the <code>code</code> array at the bottom. </td> - + <td> 4.8.2.20 </td> - + <td> VM </td> </tr> - + <tr> <td> B21 </td> - + <td> Local variable values must not be used as return addresses. </td> - + <td> 4.8.2.21 </td> - + <td> VM </td> </tr> - + <tr> <td> B22 </td> - + <td> There must be a single, uniquely determined return instruction per subroutine call. </td> - + <td> 4.8.2.22 </td> - + <td> VM </td> </tr> - + <tr> <td> B23 </td> - + <td> Subroutine calls must not be directly or indirectly self-recursive. </td> - + <td> 4.8.2.23 </td> - + <td> DX </td> </tr> - + <tr> <td> B24 </td> - + <td> <code>ReturnAddress</code> instances must not be reused. If a subroutine returns to a <code>ReturnAddress</code> further up the @@ -1065,16 +1065,16 @@ <code>ReturnAddress</code> instances further down the stack must never be used. </td> - + <td> 4.8.2.24 </td> - + <td> DX </td> </tr> - + </table> </body> </html> diff --git a/docs/jni-tips.html b/docs/jni-tips.html index fc63cca46..76cb03fde 100644 --- a/docs/jni-tips.html +++ b/docs/jni-tips.html @@ -124,7 +124,7 @@ the IDs is to add a piece of code that looks like this to the appropriate class: * class/field/method IDs for this class. Returns false on failure. */ native private static boolean nativeClassInit(); - + /* * Invoke the native initializer when the class is loaded. */ diff --git a/docs/libraries.html b/docs/libraries.html index e1c3035f1..ed2fa7263 100644 --- a/docs/libraries.html +++ b/docs/libraries.html @@ -6,7 +6,7 @@ <head> <title>Dalvik Libraries</title> - + <link rel=stylesheet href="dex-format.css"> <link href="prettify.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="prettify.js"></script> diff --git a/docs/opcodes/opcode-04-move-wide.html b/docs/opcodes/opcode-04-move-wide.html index e043be9d3..8a3bd0078 100644 --- a/docs/opcodes/opcode-04-move-wide.html +++ b/docs/opcodes/opcode-04-move-wide.html @@ -19,7 +19,7 @@ Move the contents of one register-pair to another. <p> Note: It is legal to move from vN to either vN-1 or vN+1, so implementations must arrange for both halves of a register pair to be read before anything is -written. +written. </p> <h2>Details</h2> diff --git a/docs/opcodes/opcode-07-move-object.html b/docs/opcodes/opcode-07-move-object.html index e62750dc7..f29027706 100644 --- a/docs/opcodes/opcode-07-move-object.html +++ b/docs/opcodes/opcode-07-move-object.html @@ -79,7 +79,7 @@ Move the contents of one object-bearing register to another. becomes undefined. </li> </ul> - + <h2>Exceptions</h2> <p> diff --git a/docs/opcodes/opcode-0a-move-result.html b/docs/opcodes/opcode-0a-move-result.html index f043d1373..616087f73 100644 --- a/docs/opcodes/opcode-0a-move-result.html +++ b/docs/opcodes/opcode-0a-move-result.html @@ -17,7 +17,7 @@ Move the single-word non-object result of the most recent invoke-kind into the indicated register. This must be done as the instruction immediately after an invoke-kind whose (single-word, non-object) result is not to be ignored; -anywhere else is invalid. +anywhere else is invalid. </p> <h2>Details</h2> @@ -57,7 +57,7 @@ anywhere else is invalid. <li> The result delivered by the invoke-kind instruction must not be a reference value or require a register pair. - </li> + </li> </ul> <h2>Behavior</h2> @@ -76,7 +76,7 @@ anywhere else is invalid. becomes undefined. </li> </ul> - + <h2>Exceptions</h2> <p> @@ -89,7 +89,7 @@ None. This instruction can also be thought of as reading the contents of a special "result" register that is made valid and defined by executing a non-void return instruction or a filled-new-array instruction. The execution of any other -instruction (including this one) renders this special register invalid. +instruction (including this one) renders this special register invalid. </p> </body> diff --git a/docs/opcodes/opcode-0b-move-result-wide.html b/docs/opcodes/opcode-0b-move-result-wide.html index c3e57793e..c53517aa5 100644 --- a/docs/opcodes/opcode-0b-move-result-wide.html +++ b/docs/opcodes/opcode-0b-move-result-wide.html @@ -17,7 +17,7 @@ Move the double-word result of the most recent invoke-kind into the indicated register pair. This must be done as the instruction immediately after an invoke-kind whose (double-word) result is not to be ignored; anywhere else is -invalid. +invalid. </p> <h2>Details</h2> @@ -60,7 +60,7 @@ invalid. or a double value. </li> </ul> - + <h2>Behavior</h2> <ul> @@ -81,7 +81,7 @@ invalid. becomes undefined. </li> </ul> - + <h2>Exceptions</h2> <p> diff --git a/docs/opcodes/opcode-0c-move-result-object.html b/docs/opcodes/opcode-0c-move-result-object.html index f065fed2e..153873598 100644 --- a/docs/opcodes/opcode-0c-move-result-object.html +++ b/docs/opcodes/opcode-0c-move-result-object.html @@ -77,7 +77,7 @@ is invalid. becomes undefined. </li> </ul> - + <h2>Exceptions</h2> <p> @@ -90,7 +90,7 @@ None. This instruction can also be thought of as reading the contents of a special "result" register that is made valid and defined by executing a non-void return instruction or a filled-new-array instruction. The execution of any other -instruction (including this one) renders this special register invalid. +instruction (including this one) renders this special register invalid. </p> </body> diff --git a/docs/opcodes/opcode-0d-move-exception.html b/docs/opcodes/opcode-0d-move-exception.html index 3c3bc83d1..0f756d02e 100644 --- a/docs/opcodes/opcode-0d-move-exception.html +++ b/docs/opcodes/opcode-0d-move-exception.html @@ -17,7 +17,7 @@ Save a just-caught exception into the given register. This should be the first instruction of any exception handler whose caught exception is not to be ignored, and this instruction may only ever occur as the first instruction of an -exception handler; anywhere else is invalid. +exception handler; anywhere else is invalid. </p> <h2>Details</h2> @@ -51,7 +51,7 @@ exception handler; anywhere else is invalid. the handlers defined for the method in the Dex file. </li> </ul> - + <h2>Behavior</h2> <ul> diff --git a/docs/opcodes/opcode-0e-return-void.html b/docs/opcodes/opcode-0e-return-void.html index 7a9431e3e..0498f81e1 100644 --- a/docs/opcodes/opcode-0e-return-void.html +++ b/docs/opcodes/opcode-0e-return-void.html @@ -14,7 +14,7 @@ <h2>Purpose</h2> <p> -Return from a void method. +Return from a void method. </p> <h2>Details</h2> @@ -72,8 +72,8 @@ Return from a void method. </li> </ul> </li> -</ul> - +</ul> + <h2>Exceptions</h2> <p> diff --git a/docs/opcodes/opcode-0f-return.html b/docs/opcodes/opcode-0f-return.html index 33e0b7c2e..4de55ea9c 100644 --- a/docs/opcodes/opcode-0f-return.html +++ b/docs/opcodes/opcode-0f-return.html @@ -52,8 +52,8 @@ Return from a single-width (32-bit) non-object value-returning method. <li> The type of vA must match the return type of the method. </li> -</ul> - +</ul> + <h2>Behavior</h2> <ul> @@ -89,7 +89,7 @@ Return from a single-width (32-bit) non-object value-returning method. </ul> </li> </ul> - + <h2>Exceptions</h2> <p> diff --git a/docs/opcodes/opcode-10-return-wide.html b/docs/opcodes/opcode-10-return-wide.html index f1a6b83c7..4ccfce43d 100644 --- a/docs/opcodes/opcode-10-return-wide.html +++ b/docs/opcodes/opcode-10-return-wide.html @@ -53,7 +53,7 @@ Return from a double-width (64-bit) value-returning method. The type of vA must match the return type of the method. </li> </ul> - + <h2>Behavior</h2> <ul> diff --git a/docs/opcodes/opcode-11-return-object.html b/docs/opcodes/opcode-11-return-object.html index 369233ca8..b4866ed70 100644 --- a/docs/opcodes/opcode-11-return-object.html +++ b/docs/opcodes/opcode-11-return-object.html @@ -84,7 +84,7 @@ Return from an object-returning method. </li> </ul> </li> -</ul> +</ul> <h2>Exceptions</h2> diff --git a/docs/opcodes/opcode-12-const.html b/docs/opcodes/opcode-12-const.html index b2d894fe3..d2b6ef9eb 100644 --- a/docs/opcodes/opcode-12-const.html +++ b/docs/opcodes/opcode-12-const.html @@ -15,7 +15,7 @@ <p> Move the given literal value (sign-extended to 32 bits, if necessary) into the -specified register. +specified register. </p> <h2>Details</h2> @@ -72,7 +72,7 @@ specified register. <ul> <li> If we are executing the /high16 variant, then B is left-shifted by 16 - bits, that is, B'=B << 0x10 + bits, that is, B'=B << 0x10 <li> Otherwise, if B is a 4 bit or 16 bit constant, it is sign-extended to 32 bits, that is, B'=sign-extended(B). @@ -91,7 +91,7 @@ specified register. If v(A+1) is the upper half of a register pair, v(A+1)' becomes undefined. </li> </ul> - + <h2>Exceptions</h2> <p> diff --git a/docs/opcodes/opcode-16-const-wide.html b/docs/opcodes/opcode-16-const-wide.html index ac92b04cd..6197e3556 100644 --- a/docs/opcodes/opcode-16-const-wide.html +++ b/docs/opcodes/opcode-16-const-wide.html @@ -15,7 +15,7 @@ <p> Move the given literal value (sign-extended to 64 bits) into the specified -register-pair. +register-pair. </p> <h2>Details</h2> @@ -98,7 +98,7 @@ register-pair. <li> If v(A+2) is the upper half of a register pair, v(A+2)' becomes undefined. </li> -</ul> +</ul> <h2>Exceptions</h2> diff --git a/docs/opcodes/opcode-1a-const-string.html b/docs/opcodes/opcode-1a-const-string.html index bd89b70c6..d10c11584 100644 --- a/docs/opcodes/opcode-1a-const-string.html +++ b/docs/opcodes/opcode-1a-const-string.html @@ -15,7 +15,7 @@ <p> Move a reference to the string specified by the given index into the specified -register. +register. </p> <h2>Details</h2> @@ -52,7 +52,7 @@ register. </li> <li> B must be a valid index into the string constant pool. - </li> + </li> </ul> <h2>Behavior</h2> @@ -72,7 +72,7 @@ register. </li> <li> If v(A+1) is the upper half of a register pair, v(A+1)' becomes undefined. - </li> + </li> </ul> <h2>Exceptions</h2> diff --git a/docs/opcodes/opcode-1b-const-class.html b/docs/opcodes/opcode-1b-const-class.html index 7a33e771b..f40b986b4 100644 --- a/docs/opcodes/opcode-1b-const-class.html +++ b/docs/opcodes/opcode-1b-const-class.html @@ -16,7 +16,7 @@ <p> Move a reference to the class specified by the given index into the specified register. In the case where the indicated type is primitive, this will store a -reference to the primitive type's degenerate class. +reference to the primitive type's degenerate class. </p> <h2>Details</h2> diff --git a/docs/opcodes/opcode-1d-monitor-enter.html b/docs/opcodes/opcode-1d-monitor-enter.html index cecc939a1..28c10f414 100644 --- a/docs/opcodes/opcode-1d-monitor-enter.html +++ b/docs/opcodes/opcode-1d-monitor-enter.html @@ -14,7 +14,7 @@ <h2>Purpose</h2> <p> -Acquire the monitor for the indicated object. +Acquire the monitor for the indicated object. </p> <h2>Details</h2> @@ -46,7 +46,7 @@ Acquire the monitor for the indicated object. Register vA must contain a reference to an object. </li> </ul> - + <h2>Behavior</h2> <ul> diff --git a/docs/opcodes/opcode-1e-monitor-exit.html b/docs/opcodes/opcode-1e-monitor-exit.html index bee711d1d..cd7b16506 100644 --- a/docs/opcodes/opcode-1e-monitor-exit.html +++ b/docs/opcodes/opcode-1e-monitor-exit.html @@ -25,7 +25,7 @@ run. This definition makes it possible for a method to use a monitor cleanup catch-all (e.g., finally) block as the monitor cleanup for that block itself, as a way to handle the arbitrary exceptions that might get thrown due to the historical implementation of Thread.stop(), while still managing to have proper -monitor hygiene. +monitor hygiene. </p> <h2>Details</h2> @@ -57,7 +57,7 @@ monitor hygiene. Register vA must contain a reference to an object. </li> </ul> - + <h2>Behavior</h2> <ul> @@ -83,7 +83,7 @@ monitor hygiene. an exception handler it cannot be distinguished from the same type of exception being thrown immediately after the monitor-exit instruction. </li> -</ul> +</ul> <h2>Exceptions</h2> diff --git a/docs/opcodes/opcode-1f-check-cast.html b/docs/opcodes/opcode-1f-check-cast.html index 6325ca47b..8eedd2dd7 100644 --- a/docs/opcodes/opcode-1f-check-cast.html +++ b/docs/opcodes/opcode-1f-check-cast.html @@ -15,7 +15,7 @@ <p> Throw if the reference in the given register cannot be cast to the indicated -type. The type must be a reference type (not a primitive type). +type. The type must be a reference type (not a primitive type). </p> <h2>Details</h2> @@ -53,8 +53,8 @@ type. The type must be a reference type (not a primitive type). <li> Type pool entry B must contain a valid type descriptor for a reference type. </li> -</ul> - +</ul> + <h2>Behavior</h2> <ul> diff --git a/docs/opcodes/opcode-20-instance-of.html b/docs/opcodes/opcode-20-instance-of.html index 5dbfef7c6..88076d84d 100644 --- a/docs/opcodes/opcode-20-instance-of.html +++ b/docs/opcodes/opcode-20-instance-of.html @@ -55,7 +55,7 @@ a primitive type). <li> Type constant pool entry C must contain a valid type descriptor for a reference type. - </li> + </li> </ul> <h2>Behavior</h2> @@ -88,7 +88,7 @@ a primitive type). </li> <li> If v(A+1) is the upper half of a register pair, v(A+1)' becomes undefined. - </li> + </li> <h2>Exceptions</h2> diff --git a/docs/opcodes/opcode-21-array-length.html b/docs/opcodes/opcode-21-array-length.html index 576774215..8072a7cb4 100644 --- a/docs/opcodes/opcode-21-array-length.html +++ b/docs/opcodes/opcode-21-array-length.html @@ -48,7 +48,7 @@ in entries. Register vB must contain a reference to an array. </li> </ul> - + <h2>Behavior</h2> <ul> diff --git a/docs/opcodes/opcode-22-new-instance.html b/docs/opcodes/opcode-22-new-instance.html index ec0a34719..bdcfc3efe 100644 --- a/docs/opcodes/opcode-22-new-instance.html +++ b/docs/opcodes/opcode-22-new-instance.html @@ -15,7 +15,7 @@ <p> Construct a new instance of the indicated type, storing a reference to it in the -destination. The type must refer to a non-array class. +destination. The type must refer to a non-array class. </p> <h2>Details</h2> @@ -77,7 +77,7 @@ destination. The type must refer to a non-array class. </li> <li> If v(A+1) is the upper part of a register pair, v(A+1)' becomes undefined. - </li> + </li> </ul> <h2>Exceptions</h2> @@ -88,7 +88,7 @@ destination. The type must refer to a non-array class. </li> <li> All exceptions that are possible during instantiation can occur. - </li> + </li> </ul> </body> diff --git a/docs/opcodes/opcode-23-new-array.html b/docs/opcodes/opcode-23-new-array.html index be46a49b3..29327e921 100644 --- a/docs/opcodes/opcode-23-new-array.html +++ b/docs/opcodes/opcode-23-new-array.html @@ -15,7 +15,7 @@ <p> Construct a new array of the indicated type and size. The type must be an array -type. +type. </p> <h2>Details</h2> @@ -56,7 +56,7 @@ type. </li> <li> Type constant pool entry C must contain a valid array type descriptor. - </li> + </li> </ul> <h2>Behavior</h2> @@ -87,7 +87,7 @@ type. </li> <li> If v(A+1) is the upper half of a register pair, v(A+1)' becomes undefined. - </li> + </li> </ul> <h2>Exceptions</h2> @@ -101,7 +101,7 @@ type. </li> <li> All exceptions that are possible during instantiation can occur. - </li> + </li> </ul> </body> diff --git a/docs/opcodes/opcode-24-filled-new-array.html b/docs/opcodes/opcode-24-filled-new-array.html index cba0c5d61..1dfa0896f 100644 --- a/docs/opcodes/opcode-24-filled-new-array.html +++ b/docs/opcodes/opcode-24-filled-new-array.html @@ -21,7 +21,7 @@ stored as a "result" in the same way that the method invocation instructions store their results, so the constructed instance must be moved to a register with a subsequent move-result-object instruction (if it is to be used). </p> - + <h2>Details</h2> <table class="instruc"> @@ -80,9 +80,9 @@ with a subsequent move-result-object instruction (if it is to be used). <li> If the element type is a reference type, then all actual arguments (vD .. vA, depending on B) must be references, too. - </li> + </li> </ul> - + <h2>Behavior</h2> <ul> @@ -115,7 +115,7 @@ with a subsequent move-result-object instruction (if it is to be used). If B > 3 then R[3] = vG </li> <li> - If B > 4 then R[4] = vA + If B > 4 then R[4] = vA </li> </ul> </li> @@ -123,7 +123,7 @@ with a subsequent move-result-object instruction (if it is to be used). No reference to R is stored in any register. Instead, R can be accessed by a move-result-object instruction immediately following this filled-new-array instruction. - </li> + </li> </ul> <h2>Exceptions</h2> @@ -137,7 +137,7 @@ with a subsequent move-result-object instruction (if it is to be used). </li> <li> All exceptions that are possible during instantiation can occur. - </li> + </li> </ul> </body> diff --git a/docs/opcodes/opcode-25-filled-new-array-range.html b/docs/opcodes/opcode-25-filled-new-array-range.html index 944a8b164..2ee750562 100644 --- a/docs/opcodes/opcode-25-filled-new-array-range.html +++ b/docs/opcodes/opcode-25-filled-new-array-range.html @@ -16,7 +16,7 @@ <p> Construct an array of the given type and size, filling it with the supplied contents. Clarifications and restrictions are the same as filled-new-array, -described above. +described above. </p> <h2>Details</h2> @@ -70,7 +70,7 @@ described above. </li> <li> The element size of the type denoted by B must be no larger than 32 bits. - </li> + </li> </ul> <h2>Behavior</h2> @@ -102,7 +102,7 @@ described above. ... </li> <li> - J[vA] = vN + J[vA] = vN </li> </ul> </li> @@ -110,7 +110,7 @@ described above. No reference to J is stored in any register. Instead, J can be accessed by a move-result-object instruction immediately following this filled-new-array instruction. - </li> + </li> </ul> <h2>Exceptions</h2> diff --git a/docs/opcodes/opcode-26-fill-array-data.html b/docs/opcodes/opcode-26-fill-array-data.html index c5040a5ba..77b45ae0c 100644 --- a/docs/opcodes/opcode-26-fill-array-data.html +++ b/docs/opcodes/opcode-26-fill-array-data.html @@ -21,7 +21,7 @@ of primitives, and the data table must match it in type and size. Note: The address of the table is guaranteed to be even (that is, 4-byte aligned). If the code size of the method is otherwise odd, then an extra code unit is inserted between the main code and the table whose value is the same as -a nop. +a nop. </p> <h2>Details</h2> @@ -69,8 +69,8 @@ a nop. <li> The table size must be equal or smaller than the array length. </li> -</ul> - +</ul> + <h2>Behavior</h2> <ul> @@ -88,7 +88,7 @@ a nop. <ul> <li> - NullPointerException if vA is null. + NullPointerException if vA is null. </li> </ul> diff --git a/docs/opcodes/opcode-27-throw.html b/docs/opcodes/opcode-27-throw.html index f4416ce3c..1a0eb0937 100644 --- a/docs/opcodes/opcode-27-throw.html +++ b/docs/opcodes/opcode-27-throw.html @@ -50,7 +50,7 @@ Throw the indicated exception. to the usual rules of the Java programming language. </li> </ul> - + <h2>Behavior</h2> <ul> @@ -73,7 +73,7 @@ Throw the indicated exception. </li> <li> Otherwise, the indicated exception. - </li> + </li> </ul> </body> diff --git a/docs/opcodes/opcode-28-goto.html b/docs/opcodes/opcode-28-goto.html index 5ca92b6f5..fec294c1b 100644 --- a/docs/opcodes/opcode-28-goto.html +++ b/docs/opcodes/opcode-28-goto.html @@ -18,7 +18,7 @@ Unconditionally jump to the indicated instruction. </p> <p> Note: The branch offset may not be 0. (A spin loop may be legally constructed -either with goto/32 or by including a nop as a target before the branch.) +either with goto/32 or by including a nop as a target before the branch.) </p> <h2>Details</h2> @@ -48,7 +48,7 @@ either with goto/32 or by including a nop as a target before the branch.) </li> <li> A must not be 0. - </li> + </li> </ul> <h2>Behavior</h2> @@ -60,7 +60,7 @@ either with goto/32 or by including a nop as a target before the branch.) </li> <li> Executions resumes at PC'. - </li> + </li> </ul> <h2>Exceptions</h2> diff --git a/docs/opcodes/opcode-29-goto-16.html b/docs/opcodes/opcode-29-goto-16.html index abe4aece7..791456b60 100644 --- a/docs/opcodes/opcode-29-goto-16.html +++ b/docs/opcodes/opcode-29-goto-16.html @@ -18,7 +18,7 @@ Unconditionally jump to the indicated instruction. </p> <p> Note: The branch offset may not be 0. (A spin loop may be legally constructed -either with goto/32 or by including a nop as a target before the branch.) +either with goto/32 or by including a nop as a target before the branch.) </p> <h2>Details</h2> @@ -48,7 +48,7 @@ either with goto/32 or by including a nop as a target before the branch.) </li> <li> A must not be 0. - </li> + </li> </ul> <h2>Behavior</h2> @@ -60,7 +60,7 @@ either with goto/32 or by including a nop as a target before the branch.) </li> <li> Executions resumes at PC'. - </li> + </li> </ul> <h2>Exceptions</h2> diff --git a/docs/opcodes/opcode-2a-goto-32.html b/docs/opcodes/opcode-2a-goto-32.html index 7d64ac979..b98dd8565 100644 --- a/docs/opcodes/opcode-2a-goto-32.html +++ b/docs/opcodes/opcode-2a-goto-32.html @@ -53,7 +53,7 @@ Unconditionally jump to the indicated instruction. </li> <li> Executions resumes at PC'. - </li> + </li> </ul> <h2>Exceptions</h2> diff --git a/docs/opcodes/opcode-2b-packed-switch.html b/docs/opcodes/opcode-2b-packed-switch.html index 73125bdcc..b2d525138 100644 --- a/docs/opcodes/opcode-2b-packed-switch.html +++ b/docs/opcodes/opcode-2b-packed-switch.html @@ -22,7 +22,7 @@ fall through to the next instruction if there is no match. Note: The address of the table is guaranteed to be even (that is, 4-byte aligned). If the code size of the method is otherwise odd, then an extra code unit is inserted between the main code and the table whose value is the same as -a nop. +a nop. </p> <h2>Details</h2> @@ -92,7 +92,7 @@ a nop. statement. </li> </ul> - + <h2>Exceptions</h2> <p> diff --git a/docs/opcodes/opcode-2c-sparse-switch.html b/docs/opcodes/opcode-2c-sparse-switch.html index cec581e59..9d81eda45 100644 --- a/docs/opcodes/opcode-2c-sparse-switch.html +++ b/docs/opcodes/opcode-2c-sparse-switch.html @@ -22,7 +22,7 @@ there is no match. Note: The address of the table is guaranteed to be even (that is, 4-byte aligned). If the code size of the method is otherwise odd, then an extra code unit is inserted between the main code and the table whose value is the same as -a nop. +a nop. </p> <h2>Details</h2> @@ -87,11 +87,11 @@ a nop. </li> </ul> </li> - <li> + <li> Otherwise execution continues at the instruction following the sparse-switch statement. </li> -</ul> +</ul> <h2>Exceptions</h2> diff --git a/docs/opcodes/opcode-2d-cmp-kind.html b/docs/opcodes/opcode-2d-cmp-kind.html index 431ccd40d..f55a006c9 100644 --- a/docs/opcodes/opcode-2d-cmp-kind.html +++ b/docs/opcodes/opcode-2d-cmp-kind.html @@ -24,7 +24,7 @@ NaN comparisons, and "lt bias" instructions return -1. For example, to check to see if floating point a < b, then it is advisable to use cmpg-float; a result of -1 indicates that the test was true, and the other values indicate it was false either due to a valid comparison or because one -or the other values was NaN. +or the other values was NaN. </p> <h2>Details</h2> @@ -71,7 +71,7 @@ or the other values was NaN. For the -long variant, both both vB and vC must be the lower part of a register pair holding a long value. </li> -</ul> +</ul> <h2>Behavior</h2> @@ -109,8 +109,8 @@ or the other values was NaN. <li> If v(A+1) is the upper half of a register pair, v(A+1)' becomes undefined. </li> -</ul> - +</ul> + <h2>Exceptions</h2> <p> diff --git a/docs/opcodes/opcode-32-if-test.html b/docs/opcodes/opcode-32-if-test.html index af0adb265..ee394f6d1 100644 --- a/docs/opcodes/opcode-32-if-test.html +++ b/docs/opcodes/opcode-32-if-test.html @@ -20,7 +20,7 @@ specified. <p> Note: The branch offset may not be 0. (A spin loop may be legally constructed either by branching around a backward goto or by including a nop as a target -before the branch.) +before the branch.) </p> <h2>Details</h2> @@ -68,7 +68,7 @@ before the branch.) </li> C must of a signed offset that, when added to the PC of the instruction, points to a valid bytecode instruction inside the same method. - </li> + </li> </ul> <h2>Behavior</h2> @@ -89,7 +89,7 @@ before the branch.) </li> </ul> </li> -</ul> +</ul> <h2>Exceptions</h2> diff --git a/docs/opcodes/opcode-38-if-testz.html b/docs/opcodes/opcode-38-if-testz.html index 354e89472..060bbdb60 100644 --- a/docs/opcodes/opcode-38-if-testz.html +++ b/docs/opcodes/opcode-38-if-testz.html @@ -20,7 +20,7 @@ as specified. <p> Note: The branch offset may not be 0. (A spin loop may be legally constructed either by branching around a backward goto or by including a nop as a target - before the branch.) + before the branch.) </p> <h2>Details</h2> @@ -67,7 +67,7 @@ as specified. </li> <li> B must not be 0. - </li> + </li> </ul> <h2>Behavior</h2> diff --git a/docs/opcodes/opcode-44-aget.html b/docs/opcodes/opcode-44-aget.html index b9d6f23c2..6e8836f3b 100644 --- a/docs/opcodes/opcode-44-aget.html +++ b/docs/opcodes/opcode-44-aget.html @@ -15,7 +15,7 @@ <p> Perform the identified array operation at the identified index of the given -array, storing into the value register. +array, storing into the value register. </p> <h2>Details</h2> @@ -63,7 +63,7 @@ array, storing into the value register. </li> <li> Register vC must contain an integer value. - </li> + </li> </ul> <h2>Behavior</h2> @@ -97,7 +97,7 @@ array, storing into the value register. v(A+2)' becomes undefined. </li> </ul> - + <h2>Exceptions</h2> <ul> @@ -107,7 +107,7 @@ array, storing into the value register. <li> ArrayIndexOutOfBoundsException if vC < 0 or vC >= array.length. </li> -</ul> +</ul> </body> </html> diff --git a/docs/opcodes/opcode-7b-unop.html b/docs/opcodes/opcode-7b-unop.html index 1068a2555..8b0609210 100644 --- a/docs/opcodes/opcode-7b-unop.html +++ b/docs/opcodes/opcode-7b-unop.html @@ -84,7 +84,7 @@ result in the destination register. <ul> <li> - The given operation <unop> is performed according to the semantics + The given operation <unop> is performed according to the semantics specified in table XXX. </li> <li> diff --git a/docs/prettify.js b/docs/prettify.js index c9541185f..9e99fc672 100644 --- a/docs/prettify.js +++ b/docs/prettify.js @@ -969,7 +969,7 @@ function _pr_isIE6() { var newlineRe = /\r\n?|\n/g; var trailingSpaceRe = /[ \r\n]$/; var lastWasSpace = true; // the last text chunk emitted ended with a space. - + // A helper function that is responsible for opening sections of decoration // and outputing properly escaped chunks of source function emitTextUpTo(sourceIdx) { diff --git a/dvz/Android.mk b/dvz/Android.mk index 56b7890d4..72b92a005 100644 --- a/dvz/Android.mk +++ b/dvz/Android.mk @@ -9,10 +9,10 @@ LOCAL_SRC_FILES:= \ LOCAL_SHARED_LIBRARIES := \ libcutils -LOCAL_C_INCLUDES := +LOCAL_C_INCLUDES := -LOCAL_CFLAGS := +LOCAL_CFLAGS := -LOCAL_MODULE := dvz +LOCAL_MODULE := dvz include $(BUILD_EXECUTABLE) @@ -45,7 +45,7 @@ static void post_run_func (int pid) { int err; g_pid = pid; - + my_pgid = getpgid(0); if (my_pgid < 0) { perror ("error with getpgid()"); @@ -62,8 +62,8 @@ static void post_run_func (int pid) { // The zygote was unable to move this process into our pgid // We have to forward signals - int forward_signals[] - = {SIGHUP, SIGINT, SIGTERM, SIGWINCH, + int forward_signals[] + = {SIGHUP, SIGINT, SIGTERM, SIGWINCH, SIGTSTP, SIGTTIN, SIGTTOU, SIGCONT}; struct sigaction sa; diff --git a/dx/src/com/android/dx/cf/attrib/AttAnnotationDefault.java b/dx/src/com/android/dx/cf/attrib/AttAnnotationDefault.java index acf5a9ef7..fe0b3abfe 100644 --- a/dx/src/com/android/dx/cf/attrib/AttAnnotationDefault.java +++ b/dx/src/com/android/dx/cf/attrib/AttAnnotationDefault.java @@ -34,7 +34,7 @@ public final class AttAnnotationDefault extends BaseAttribute { /** * Constructs an instance. - * + * * @param value {@code non-null;} the annotation default value * @param byteLength {@code >= 0;} attribute data length in the original * classfile (not including the attribute header) @@ -58,7 +58,7 @@ public final class AttAnnotationDefault extends BaseAttribute { /** * Gets the annotation default value. - * + * * @return {@code non-null;} the value */ public Constant getValue() { diff --git a/dx/src/com/android/dx/cf/attrib/AttCode.java b/dx/src/com/android/dx/cf/attrib/AttCode.java index 89ba895ad..8d34c69e9 100644 --- a/dx/src/com/android/dx/cf/attrib/AttCode.java +++ b/dx/src/com/android/dx/cf/attrib/AttCode.java @@ -45,7 +45,7 @@ public final class AttCode extends BaseAttribute { /** * Constructs an instance. - * + * * @param maxStack {@code >= 0;} the stack size * @param maxLocals {@code >= 0;} the number of locals * @param code {@code non-null;} array containing the bytecode per se @@ -100,7 +100,7 @@ public final class AttCode extends BaseAttribute { /** * Gets the maximum stack size. - * + * * @return {@code >= 0;} the maximum stack size */ public int getMaxStack() { @@ -109,7 +109,7 @@ public final class AttCode extends BaseAttribute { /** * Gets the number of locals. - * + * * @return {@code >= 0;} the number of locals */ public int getMaxLocals() { @@ -118,7 +118,7 @@ public final class AttCode extends BaseAttribute { /** * Gets the bytecode array. - * + * * @return {@code non-null;} the bytecode array */ public BytecodeArray getCode() { @@ -127,7 +127,7 @@ public final class AttCode extends BaseAttribute { /** * Gets the exception table. - * + * * @return {@code non-null;} the exception table */ public ByteCatchList getCatches() { @@ -136,7 +136,7 @@ public final class AttCode extends BaseAttribute { /** * Gets the associated attribute list. - * + * * @return {@code non-null;} the attribute list */ public AttributeList getAttributes() { diff --git a/dx/src/com/android/dx/cf/attrib/AttConstantValue.java b/dx/src/com/android/dx/cf/attrib/AttConstantValue.java index a7436f3c7..aa6d1b315 100644 --- a/dx/src/com/android/dx/cf/attrib/AttConstantValue.java +++ b/dx/src/com/android/dx/cf/attrib/AttConstantValue.java @@ -35,7 +35,7 @@ public final class AttConstantValue extends BaseAttribute { /** * Constructs an instance. - * + * * @param constantValue {@code non-null;} the constant value, which must * be an instance of one of: {@code CstString}, * {@code CstInteger}, {@code CstLong}, @@ -68,7 +68,7 @@ public final class AttConstantValue extends BaseAttribute { * is an instance of one of: {@code CstString}, * {@code CstInteger}, {@code CstLong}, * {@code CstFloat}, or {@code CstDouble}. - * + * * @return {@code non-null;} the constant value */ public TypedConstant getConstantValue() { diff --git a/dx/src/com/android/dx/cf/attrib/AttEnclosingMethod.java b/dx/src/com/android/dx/cf/attrib/AttEnclosingMethod.java index 68a24d94b..6717e15e9 100644 --- a/dx/src/com/android/dx/cf/attrib/AttEnclosingMethod.java +++ b/dx/src/com/android/dx/cf/attrib/AttEnclosingMethod.java @@ -35,7 +35,7 @@ public final class AttEnclosingMethod extends BaseAttribute { /** * Constructs an instance. - * + * * @param type {@code non-null;} the innermost enclosing class * @param method {@code null-ok;} the name-and-type of the innermost enclosing * method, if any @@ -58,7 +58,7 @@ public final class AttEnclosingMethod extends BaseAttribute { /** * Gets the innermost enclosing class. - * + * * @return {@code non-null;} the innermost enclosing class */ public CstType getEnclosingClass() { @@ -68,7 +68,7 @@ public final class AttEnclosingMethod extends BaseAttribute { /** * Gets the name-and-type of the innermost enclosing method, if * any. - * + * * @return {@code null-ok;} the name-and-type of the innermost enclosing * method, if any */ diff --git a/dx/src/com/android/dx/cf/attrib/AttExceptions.java b/dx/src/com/android/dx/cf/attrib/AttExceptions.java index c592047f3..a17e009a8 100644 --- a/dx/src/com/android/dx/cf/attrib/AttExceptions.java +++ b/dx/src/com/android/dx/cf/attrib/AttExceptions.java @@ -31,7 +31,7 @@ public final class AttExceptions extends BaseAttribute { /** * Constructs an instance. - * + * * @param exceptions {@code non-null;} list of classes, presumed but not * verified to be subclasses of {@code Throwable} */ @@ -59,7 +59,7 @@ public final class AttExceptions extends BaseAttribute { * Gets the list of classes associated with this instance. In * general, these classes are not pre-verified to be subclasses of * {@code Throwable}. - * + * * @return {@code non-null;} the list of classes */ public TypeList getExceptions() { diff --git a/dx/src/com/android/dx/cf/attrib/AttInnerClasses.java b/dx/src/com/android/dx/cf/attrib/AttInnerClasses.java index bd6c7cd6a..77a4b087a 100644 --- a/dx/src/com/android/dx/cf/attrib/AttInnerClasses.java +++ b/dx/src/com/android/dx/cf/attrib/AttInnerClasses.java @@ -30,7 +30,7 @@ public final class AttInnerClasses extends BaseAttribute { /** * Constructs an instance. - * + * * @param innerClasses {@code non-null;} list of inner class entries */ public AttInnerClasses(InnerClassList innerClasses) { @@ -55,7 +55,7 @@ public final class AttInnerClasses extends BaseAttribute { /** * Gets the list of "inner class" entries associated with this instance. - * + * * @return {@code non-null;} the list */ public InnerClassList getInnerClasses() { diff --git a/dx/src/com/android/dx/cf/attrib/AttLineNumberTable.java b/dx/src/com/android/dx/cf/attrib/AttLineNumberTable.java index 38980be19..5eac8cbec 100644 --- a/dx/src/com/android/dx/cf/attrib/AttLineNumberTable.java +++ b/dx/src/com/android/dx/cf/attrib/AttLineNumberTable.java @@ -31,7 +31,7 @@ public final class AttLineNumberTable extends BaseAttribute { /** * Constructs an instance. - * + * * @param lineNumbers {@code non-null;} list of line number entries */ public AttLineNumberTable(LineNumberList lineNumbers) { @@ -56,7 +56,7 @@ public final class AttLineNumberTable extends BaseAttribute { /** * Gets the list of "line number" entries associated with this instance. - * + * * @return {@code non-null;} the list */ public LineNumberList getLineNumbers() { diff --git a/dx/src/com/android/dx/cf/attrib/AttLocalVariableTable.java b/dx/src/com/android/dx/cf/attrib/AttLocalVariableTable.java index 53ba64fe1..1d2b4aa01 100644 --- a/dx/src/com/android/dx/cf/attrib/AttLocalVariableTable.java +++ b/dx/src/com/android/dx/cf/attrib/AttLocalVariableTable.java @@ -27,7 +27,7 @@ public final class AttLocalVariableTable extends BaseLocalVariables { /** * Constructs an instance. - * + * * @param localVariables {@code non-null;} list of local variable entries */ public AttLocalVariableTable(LocalVariableList localVariables) { diff --git a/dx/src/com/android/dx/cf/attrib/AttLocalVariableTypeTable.java b/dx/src/com/android/dx/cf/attrib/AttLocalVariableTypeTable.java index 49cdb0c0f..2520bf604 100644 --- a/dx/src/com/android/dx/cf/attrib/AttLocalVariableTypeTable.java +++ b/dx/src/com/android/dx/cf/attrib/AttLocalVariableTypeTable.java @@ -27,7 +27,7 @@ public final class AttLocalVariableTypeTable extends BaseLocalVariables { /** * Constructs an instance. - * + * * @param localVariables {@code non-null;} list of local variable entries */ public AttLocalVariableTypeTable(LocalVariableList localVariables) { diff --git a/dx/src/com/android/dx/cf/attrib/AttRuntimeInvisibleAnnotations.java b/dx/src/com/android/dx/cf/attrib/AttRuntimeInvisibleAnnotations.java index e83b76fb3..d3afe277f 100644 --- a/dx/src/com/android/dx/cf/attrib/AttRuntimeInvisibleAnnotations.java +++ b/dx/src/com/android/dx/cf/attrib/AttRuntimeInvisibleAnnotations.java @@ -28,7 +28,7 @@ public final class AttRuntimeInvisibleAnnotations extends BaseAnnotations { /** * Constructs an instance. - * + * * @param annotations {@code non-null;} the list of annotations * @param byteLength {@code >= 0;} attribute data length in the original * classfile (not including the attribute header) diff --git a/dx/src/com/android/dx/cf/attrib/AttRuntimeInvisibleParameterAnnotations.java b/dx/src/com/android/dx/cf/attrib/AttRuntimeInvisibleParameterAnnotations.java index 7dfe2069a..c9c513694 100644 --- a/dx/src/com/android/dx/cf/attrib/AttRuntimeInvisibleParameterAnnotations.java +++ b/dx/src/com/android/dx/cf/attrib/AttRuntimeInvisibleParameterAnnotations.java @@ -30,7 +30,7 @@ public final class AttRuntimeInvisibleParameterAnnotations /** * Constructs an instance. - * + * * @param parameterAnnotations {@code non-null;} the parameter annotations * @param byteLength {@code >= 0;} attribute data length in the original * classfile (not including the attribute header) diff --git a/dx/src/com/android/dx/cf/attrib/AttRuntimeVisibleAnnotations.java b/dx/src/com/android/dx/cf/attrib/AttRuntimeVisibleAnnotations.java index 9de05881d..a6a640d53 100644 --- a/dx/src/com/android/dx/cf/attrib/AttRuntimeVisibleAnnotations.java +++ b/dx/src/com/android/dx/cf/attrib/AttRuntimeVisibleAnnotations.java @@ -28,7 +28,7 @@ public final class AttRuntimeVisibleAnnotations extends BaseAnnotations { /** * Constructs an instance. - * + * * @param annotations {@code non-null;} the list of annotations * @param byteLength {@code >= 0;} attribute data length in the original * classfile (not including the attribute header) diff --git a/dx/src/com/android/dx/cf/attrib/AttRuntimeVisibleParameterAnnotations.java b/dx/src/com/android/dx/cf/attrib/AttRuntimeVisibleParameterAnnotations.java index 76607c0f4..177eb4c9b 100644 --- a/dx/src/com/android/dx/cf/attrib/AttRuntimeVisibleParameterAnnotations.java +++ b/dx/src/com/android/dx/cf/attrib/AttRuntimeVisibleParameterAnnotations.java @@ -30,7 +30,7 @@ public final class AttRuntimeVisibleParameterAnnotations /** * Constructs an instance. - * + * * @param annotations {@code non-null;} the parameter annotations * @param byteLength {@code >= 0;} attribute data length in the original * classfile (not including the attribute header) diff --git a/dx/src/com/android/dx/cf/attrib/AttSignature.java b/dx/src/com/android/dx/cf/attrib/AttSignature.java index b9cb97d1f..f6023f3eb 100644 --- a/dx/src/com/android/dx/cf/attrib/AttSignature.java +++ b/dx/src/com/android/dx/cf/attrib/AttSignature.java @@ -30,7 +30,7 @@ public final class AttSignature extends BaseAttribute { /** * Constructs an instance. - * + * * @param signature {@code non-null;} the signature string */ public AttSignature(CstUtf8 signature) { @@ -50,7 +50,7 @@ public final class AttSignature extends BaseAttribute { /** * Gets the signature string. - * + * * @return {@code non-null;} the signature string */ public CstUtf8 getSignature() { diff --git a/dx/src/com/android/dx/cf/attrib/AttSourceFile.java b/dx/src/com/android/dx/cf/attrib/AttSourceFile.java index 941a2b0f0..b84ff4da8 100644 --- a/dx/src/com/android/dx/cf/attrib/AttSourceFile.java +++ b/dx/src/com/android/dx/cf/attrib/AttSourceFile.java @@ -30,7 +30,7 @@ public final class AttSourceFile extends BaseAttribute { /** * Constructs an instance. - * + * * @param sourceFile {@code non-null;} the name of the source file */ public AttSourceFile(CstUtf8 sourceFile) { @@ -50,7 +50,7 @@ public final class AttSourceFile extends BaseAttribute { /** * Gets the source file name of this instance. - * + * * @return {@code non-null;} the source file */ public CstUtf8 getSourceFile() { diff --git a/dx/src/com/android/dx/cf/attrib/BaseAnnotations.java b/dx/src/com/android/dx/cf/attrib/BaseAnnotations.java index 4d9201e4b..bc138afe7 100644 --- a/dx/src/com/android/dx/cf/attrib/BaseAnnotations.java +++ b/dx/src/com/android/dx/cf/attrib/BaseAnnotations.java @@ -32,7 +32,7 @@ public abstract class BaseAnnotations extends BaseAttribute { /** * Constructs an instance. - * + * * @param attributeName {@code non-null;} the name of the attribute * @param annotations {@code non-null;} the list of annotations * @param byteLength {@code >= 0;} attribute data length in the original @@ -63,7 +63,7 @@ public abstract class BaseAnnotations extends BaseAttribute { /** * Gets the list of annotations associated with this instance. - * + * * @return {@code non-null;} the list */ public final Annotations getAnnotations() { diff --git a/dx/src/com/android/dx/cf/attrib/BaseAttribute.java b/dx/src/com/android/dx/cf/attrib/BaseAttribute.java index c9c1b33cb..99617250b 100644 --- a/dx/src/com/android/dx/cf/attrib/BaseAttribute.java +++ b/dx/src/com/android/dx/cf/attrib/BaseAttribute.java @@ -28,7 +28,7 @@ public abstract class BaseAttribute implements Attribute { /** * Constructs an instance. - * + * * @param name {@code non-null;} attribute name */ public BaseAttribute(String name) { diff --git a/dx/src/com/android/dx/cf/attrib/BaseLocalVariables.java b/dx/src/com/android/dx/cf/attrib/BaseLocalVariables.java index 5ba5889cb..27cd6fb9e 100644 --- a/dx/src/com/android/dx/cf/attrib/BaseLocalVariables.java +++ b/dx/src/com/android/dx/cf/attrib/BaseLocalVariables.java @@ -29,7 +29,7 @@ public abstract class BaseLocalVariables extends BaseAttribute { /** * Constructs an instance. - * + * * @param name {@code non-null;} attribute name * @param localVariables {@code non-null;} list of local variable entries */ @@ -56,7 +56,7 @@ public abstract class BaseLocalVariables extends BaseAttribute { /** * Gets the list of "local variable" entries associated with this instance. - * + * * @return {@code non-null;} the list */ public final LocalVariableList getLocalVariables() { diff --git a/dx/src/com/android/dx/cf/attrib/BaseParameterAnnotations.java b/dx/src/com/android/dx/cf/attrib/BaseParameterAnnotations.java index 1b204b34e..791f8cdfc 100644 --- a/dx/src/com/android/dx/cf/attrib/BaseParameterAnnotations.java +++ b/dx/src/com/android/dx/cf/attrib/BaseParameterAnnotations.java @@ -32,7 +32,7 @@ public abstract class BaseParameterAnnotations extends BaseAttribute { /** * Constructs an instance. - * + * * @param attributeName {@code non-null;} the name of the attribute * @param parameterAnnotations {@code non-null;} the annotations * @param byteLength {@code >= 0;} attribute data length in the original @@ -64,7 +64,7 @@ public abstract class BaseParameterAnnotations extends BaseAttribute { /** * Gets the list of annotation lists associated with this instance. - * + * * @return {@code non-null;} the list */ public final AnnotationsList getParameterAnnotations() { diff --git a/dx/src/com/android/dx/cf/attrib/RawAttribute.java b/dx/src/com/android/dx/cf/attrib/RawAttribute.java index 585e5c5a2..e905dd1d0 100644 --- a/dx/src/com/android/dx/cf/attrib/RawAttribute.java +++ b/dx/src/com/android/dx/cf/attrib/RawAttribute.java @@ -28,13 +28,13 @@ public final class RawAttribute extends BaseAttribute { /** * {@code null-ok;} constant pool to use for resolution of cpis in {@link - * #data} + * #data} */ private final ConstantPool pool; /** * Constructs an instance. - * + * * @param name {@code non-null;} attribute name * @param data {@code non-null;} attribute data * @param pool {@code null-ok;} constant pool to use for cpi resolution @@ -52,7 +52,7 @@ public final class RawAttribute extends BaseAttribute { /** * Constructs an instance from a sub-array of a {@link ByteArray}. - * + * * @param name {@code non-null;} attribute name * @param data {@code non-null;} array containing the attribute data * @param offset offset in {@code data} to the attribute data @@ -66,7 +66,7 @@ public final class RawAttribute extends BaseAttribute { /** * Get the raw data of the attribute. - * + * * @return {@code non-null;} the data */ public ByteArray getData() { @@ -82,7 +82,7 @@ public final class RawAttribute extends BaseAttribute { * Gets the constant pool to use for cpi resolution, if any. It * presumably came from the class file that this attribute came * from. - * + * * @return {@code null-ok;} the constant pool */ public ConstantPool getPool() { diff --git a/dx/src/com/android/dx/cf/code/BaseMachine.java b/dx/src/com/android/dx/cf/code/BaseMachine.java index b7e700d42..aae605601 100644 --- a/dx/src/com/android/dx/cf/code/BaseMachine.java +++ b/dx/src/com/android/dx/cf/code/BaseMachine.java @@ -27,7 +27,7 @@ import java.util.ArrayList; /** * Base implementation of {@link Machine}. - * + * * <p><b>Note:</b> For the most part, the documentation for this class * ignores the distinction between {@link Type} and {@link * TypeBearer}.</p> @@ -35,7 +35,7 @@ import java.util.ArrayList; public abstract class BaseMachine implements Machine { /* {@code non-null;} the prototype for the associated method */ private final Prototype prototype; - + /** {@code non-null;} primary arguments */ private TypeBearer[] args; @@ -77,7 +77,7 @@ public abstract class BaseMachine implements Machine { /** * Constructs an instance. - * + * * @param prototype {@code non-null;} the prototype for the associated method */ public BaseMachine(Prototype prototype) { @@ -132,7 +132,7 @@ public abstract class BaseMachine implements Machine { public void popArgs(Frame frame, Prototype prototype) { StdTypeList types = prototype.getParameterTypes(); int size = types.size(); - + // Use the above method to do the actual popping... popArgs(frame, size); @@ -253,7 +253,7 @@ public abstract class BaseMachine implements Machine { /** * Gets the number of primary arguments. - * + * * @return {@code >= 0;} the number of primary arguments */ protected final int argCount() { @@ -263,7 +263,7 @@ public abstract class BaseMachine implements Machine { /** * Gets the width of the arguments (where a category-2 value counts as * two). - * + * * @return {@code >= 0;} the argument width */ protected final int argWidth() { @@ -278,7 +278,7 @@ public abstract class BaseMachine implements Machine { /** * Gets the {@code n}th primary argument. - * + * * @param n {@code >= 0, < argCount();} which argument * @return {@code non-null;} the indicated argument */ @@ -297,7 +297,7 @@ public abstract class BaseMachine implements Machine { /** * Gets the type auxiliary argument. - * + * * @return {@code null-ok;} the salient type */ protected final Type getAuxType() { @@ -306,7 +306,7 @@ public abstract class BaseMachine implements Machine { /** * Gets the {@code int} auxiliary argument. - * + * * @return the argument value */ protected final int getAuxInt() { @@ -315,7 +315,7 @@ public abstract class BaseMachine implements Machine { /** * Gets the constant auxiliary argument. - * + * * @return {@code null-ok;} the argument value */ protected final Constant getAuxCst() { @@ -324,7 +324,7 @@ public abstract class BaseMachine implements Machine { /** * Gets the branch target auxiliary argument. - * + * * @return the argument value */ protected final int getAuxTarget() { @@ -333,7 +333,7 @@ public abstract class BaseMachine implements Machine { /** * Gets the switch cases auxiliary argument. - * + * * @return {@code null-ok;} the argument value */ protected final SwitchList getAuxCases() { @@ -350,7 +350,7 @@ public abstract class BaseMachine implements Machine { } /** * Gets the last local index accessed. - * + * * @return {@code >= -1;} the salient local index or {@code -1} if none * was set since the last time {@link #clearArgs} was called */ @@ -364,7 +364,7 @@ public abstract class BaseMachine implements Machine { * by a previous call to {@link #localTarget} with the type of what * should be the sole result set by a call to {@link #setResult} (or * the combination {@link #clearResult} then {@link #addResult}. - * + * * @return {@code null-ok;} the salient register spec or {@code null} if no * local target was set since the last time {@link #clearArgs} was * called @@ -375,7 +375,7 @@ public abstract class BaseMachine implements Machine { } if (resultCount != 1) { - throw new SimException("local target with " + + throw new SimException("local target with " + ((resultCount == 0) ? "no" : "multiple") + " results"); } @@ -413,10 +413,10 @@ public abstract class BaseMachine implements Machine { /** * Sets the results list to be the given single value. - * + * * <p><b>Note:</b> If there is more than one result value, the * others may be added by using {@link #addResult}.</p> - * + * * @param result {@code non-null;} result value */ protected final void setResult(TypeBearer result) { @@ -430,9 +430,9 @@ public abstract class BaseMachine implements Machine { /** * Adds an additional element to the list of results. - * + * * @see #setResult - * + * * @param result {@code non-null;} result value */ protected final void addResult(TypeBearer result) { @@ -447,7 +447,7 @@ public abstract class BaseMachine implements Machine { /** * Gets the count of results. This throws an exception if results were * never set. (Explicitly clearing the results counts as setting them.) - * + * * @return {@code >= 0;} the count */ protected final int resultCount() { @@ -461,7 +461,7 @@ public abstract class BaseMachine implements Machine { /** * Gets the width of the results (where a category-2 value counts as * two). - * + * * @return {@code >= 0;} the result width */ protected final int resultWidth() { @@ -476,7 +476,7 @@ public abstract class BaseMachine implements Machine { /** * Gets the {@code n}th result value. - * + * * @param n {@code >= 0, < resultCount();} which result * @return {@code non-null;} the indicated result value */ @@ -498,7 +498,7 @@ public abstract class BaseMachine implements Machine { * there is a local target (see {@link #localTarget}), then the sole * result is stored to that target; otherwise any results are pushed * onto the stack. - * + * * @param frame {@code non-null;} frame to operate on */ protected final void storeResults(Frame frame) { @@ -528,7 +528,7 @@ public abstract class BaseMachine implements Machine { /** * Throws an exception that indicates a mismatch in local variable * types. - * + * * @param found {@code non-null;} the encountered type * @param local {@code non-null;} the local variable's claimed type */ @@ -536,8 +536,8 @@ public abstract class BaseMachine implements Machine { TypeBearer local) { throw new SimException("local variable type mismatch: " + "attempt to set or access a value of type " + - found.toHuman() + - " using a local variable of type " + + found.toHuman() + + " using a local variable of type " + local.toHuman() + ". This is symptomatic of .class transformation tools " + "that ignore local variable information."); diff --git a/dx/src/com/android/dx/cf/code/BasicBlocker.java b/dx/src/com/android/dx/cf/code/BasicBlocker.java index d67e52549..8fb9560f8 100644 --- a/dx/src/com/android/dx/cf/code/BasicBlocker.java +++ b/dx/src/com/android/dx/cf/code/BasicBlocker.java @@ -54,13 +54,13 @@ public final class BasicBlocker implements BytecodeArray.Visitor { /** * {@code non-null, sparse;} for each instruction offset to a branch of - * some sort, the list of targets for that instruction + * some sort, the list of targets for that instruction */ private final IntList[] targetLists; /** * {@code non-null, sparse;} for each instruction offset to a throwing - * instruction, the list of exception handlers for that instruction + * instruction, the list of exception handlers for that instruction */ private final ByteCatchList[] catchLists; @@ -71,7 +71,7 @@ public final class BasicBlocker implements BytecodeArray.Visitor { * Identifies and enumerates the basic blocks in the given method, * returning a list of them. The returned list notably omits any * definitely-dead code that is identified in the process. - * + * * @param method {@code non-null;} method to convert * @return {@code non-null;} list of basic blocks */ @@ -85,7 +85,7 @@ public final class BasicBlocker implements BytecodeArray.Visitor { /** * Constructs an instance. This class is not publicly instantiable; use * {@link #identifyBlocks}. - * + * * @param method {@code non-null;} method to convert */ private BasicBlocker(ConcreteMethod method) { @@ -174,7 +174,7 @@ public final class BasicBlocker implements BytecodeArray.Visitor { if ((type == Type.INT) || (type == Type.LONG)) { visitThrowing(offset, length, true); } - break; + break; } default: { visitCommon(offset, length, true); @@ -265,7 +265,7 @@ public final class BasicBlocker implements BytecodeArray.Visitor { /** * Extracts the list of basic blocks from the bit sets. - * + * * @return {@code non-null;} the list of basic blocks */ private ByteBlockList getBlockList() { @@ -367,7 +367,7 @@ public final class BasicBlocker implements BytecodeArray.Visitor { /** * Sets a bit in the work set, but only if the instruction in question * isn't yet known to be possibly-live. - * + * * @param offset offset to the instruction in question * @param blockStart {@code true} iff this instruction starts a * basic block @@ -384,7 +384,7 @@ public final class BasicBlocker implements BytecodeArray.Visitor { /** * Helper method used by all the visitor methods. - * + * * @param offset offset to the instruction * @param length length of the instruction, in bytes * @param nextIsLive {@code true} iff the instruction after @@ -417,7 +417,7 @@ public final class BasicBlocker implements BytecodeArray.Visitor { * Helper method used by all the visitor methods that deal with * opcodes that possibly throw. This method should be called after calling * {@link #visitCommon}. - * + * * @param offset offset to the instruction * @param length length of the instruction, in bytes * @param nextIsLive {@code true} iff the instruction after diff --git a/dx/src/com/android/dx/cf/code/ByteBlock.java b/dx/src/com/android/dx/cf/code/ByteBlock.java index 40b91c38d..73bbbab42 100644 --- a/dx/src/com/android/dx/cf/code/ByteBlock.java +++ b/dx/src/com/android/dx/cf/code/ByteBlock.java @@ -40,8 +40,8 @@ public final class ByteBlock implements LabeledItem { private final ByteCatchList catches; /** - * Constructs an instance. - * + * Constructs an instance. + * * @param label {@code >= 0;} target label for this block * @param start {@code >= 0;} bytecode offset (inclusive) of the start * of the block @@ -99,7 +99,7 @@ public final class ByteBlock implements LabeledItem { /** * Gets the label of this block. - * + * * @return {@code >= 0;} the label */ public int getLabel() { @@ -108,7 +108,7 @@ public final class ByteBlock implements LabeledItem { /** * Gets the bytecode offset (inclusive) of the start of this block. - * + * * @return {@code >= 0;} the start offset */ public int getStart() { @@ -117,7 +117,7 @@ public final class ByteBlock implements LabeledItem { /** * Gets the bytecode offset (exclusive) of the end of this block. - * + * * @return {@code > getStart();} the end offset */ public int getEnd() { @@ -125,9 +125,9 @@ public final class ByteBlock implements LabeledItem { } /** - * Gets the list of successors that this block may branch to + * Gets the list of successors that this block may branch to * non-exceptionally. - * + * * @return {@code non-null;} the successor list */ public IntList getSuccessors() { @@ -136,7 +136,7 @@ public final class ByteBlock implements LabeledItem { /** * Gets the list of exceptions caught and their handler targets. - * + * * @return {@code non-null;} the catch list */ public ByteCatchList getCatches() { diff --git a/dx/src/com/android/dx/cf/code/ByteCatchList.java b/dx/src/com/android/dx/cf/code/ByteCatchList.java index aab2087fa..36c37afe5 100644 --- a/dx/src/com/android/dx/cf/code/ByteCatchList.java +++ b/dx/src/com/android/dx/cf/code/ByteCatchList.java @@ -129,7 +129,7 @@ public final class ByteCatchList extends FixedSizeList { * is <i>not</i> found for the exception type of the given item in * the given array. A match is considered to be either an exact type * match or the class {@code Object} which represents a catch-all. - * + * * @param item {@code non-null;} item with the exception type to look for * @param arr {@code non-null;} array to search in * @param count {@code non-null;} maximum number of elements in the array to check @@ -153,7 +153,7 @@ public final class ByteCatchList extends FixedSizeList { * is a list of all the exception handler addresses, with the given * {@code noException} address appended if appropriate. The * result is automatically made immutable. - * + * * @param noException {@code >= -1;} the no-exception address to append, or * {@code -1} not to append anything * @return {@code non-null;} list of exception targets, with diff --git a/dx/src/com/android/dx/cf/code/ByteOps.java b/dx/src/com/android/dx/cf/code/ByteOps.java index ea7b514f6..13760088c 100644 --- a/dx/src/com/android/dx/cf/code/ByteOps.java +++ b/dx/src/com/android/dx/cf/code/ByteOps.java @@ -272,20 +272,20 @@ public class ByteOps { /** * "l": {@code op local}; category-1 local; implies * {@code max_locals} is at least two more than the given - * local number + * local number */ public static final int FMT_LOCAL_1 = 10; /** * "m": {@code op local}; category-2 local; implies * {@code max_locals} is at least two more than the given - * local number + * local number */ public static final int FMT_LOCAL_2 = 11; /** * "y": {@code op #byte} ({@code bipush} and - * {@code newarray}) + * {@code newarray}) */ public static final int FMT_LITERAL_BYTE = 12; @@ -342,7 +342,7 @@ public class ByteOps { /** * {@code non-null;} map from opcodes to format or'ed with allowed constant - * pool types + * pool types */ private static final int[] OPCODE_INFO = new int[256]; @@ -622,7 +622,7 @@ public class ByteOps { /** * Gets the name of the given opcode. - * + * * @param opcode {@code >= 0, <= 255;} the opcode * @return {@code non-null;} its name */ @@ -639,7 +639,7 @@ public class ByteOps { /** * Gets the format and allowed cp types of the given opcode. - * + * * @param opcode {@code >= 0, <= 255;} the opcode * @return its format and allowed cp types */ diff --git a/dx/src/com/android/dx/cf/code/BytecodeArray.java b/dx/src/com/android/dx/cf/code/BytecodeArray.java index 83cff5d7c..80e94bfde 100644 --- a/dx/src/com/android/dx/cf/code/BytecodeArray.java +++ b/dx/src/com/android/dx/cf/code/BytecodeArray.java @@ -46,7 +46,7 @@ public final class BytecodeArray { /** * Constructs an instance. - * + * * @param bytes {@code non-null;} underlying bytes * @param pool {@code non-null;} constant pool to use when resolving constant * pool indices @@ -66,7 +66,7 @@ public final class BytecodeArray { /** * Gets the underlying byte array. - * + * * @return {@code non-null;} the byte array */ public ByteArray getBytes() { @@ -75,7 +75,7 @@ public final class BytecodeArray { /** * Gets the size of the bytecode array, per se. - * + * * @return {@code >= 0;} the length of the bytecode array */ public int size() { @@ -86,7 +86,7 @@ public final class BytecodeArray { * Gets the total length of this structure in bytes, when included in * a {@code Code} attribute. The returned value includes the * array size plus four bytes for {@code code_length}. - * + * * @return {@code >= 4;} the total length, in bytes */ public int byteLength() { @@ -95,7 +95,7 @@ public final class BytecodeArray { /** * Parses each instruction in the array, in order. - * + * * @param visitor {@code null-ok;} visitor to call back to for each instruction */ public void forEach(Visitor visitor) { @@ -114,7 +114,7 @@ public final class BytecodeArray { /** * Finds the offset to each instruction in the bytecode array. The * result is a bit set with the offset of each opcode-per-se flipped on. - * + * * @see Bits * @return {@code non-null;} appropriately constructed bit set */ @@ -138,7 +138,7 @@ public final class BytecodeArray { * the indicated offset (that is, the bit index), repeating until the * work set is empty. It is expected that the visitor will regularly * set new bits in the work set during the process. - * + * * @param workSet {@code non-null;} the work set to process * @param visitor {@code non-null;} visitor to call back to for each instruction */ @@ -162,16 +162,16 @@ public final class BytecodeArray { * Parses the instruction at the indicated offset. Indicate the * result by calling the visitor if supplied and by returning the * number of bytes consumed by the instruction. - * + * * <p>In order to simplify further processing, the opcodes passed * to the visitor are canonicalized, altering the opcode to a more * universal one and making formerly implicit arguments * explicit. In particular:</p> - * + * * <ul> * <li>The opcodes to push literal constants of primitive types all become * {@code ldc}. - * E.g., {@code fconst_0}, {@code sipush}, and + * E.g., {@code fconst_0}, {@code sipush}, and * {@code lconst_0} qualify for this treatment.</li> * <li>{@code aconst_null} becomes {@code ldc} of a * "known null."</li> @@ -202,7 +202,7 @@ public final class BytecodeArray { * their pushed type. E.g., {@code arraylength} gets type * {@code Type.INT}.</li> * </ul> - * + * * @param offset {@code >= 0, < bytes.size();} offset to the start of the * instruction * @param visitor {@code null-ok;} visitor to call back to @@ -313,7 +313,7 @@ public final class BytecodeArray { case ByteOps.LDC: { int idx = bytes.getUnsignedByte(offset + 1); Constant cst = pool.get(idx); - int value = (cst instanceof CstInteger) ? + int value = (cst instanceof CstInteger) ? ((CstInteger) cst).getValue() : 0; visitor.visitConstant(ByteOps.LDC, offset, 2, cst, value); return 2; @@ -321,7 +321,7 @@ public final class BytecodeArray { case ByteOps.LDC_W: { int idx = bytes.getUnsignedShort(offset + 1); Constant cst = pool.get(idx); - int value = (cst instanceof CstInteger) ? + int value = (cst instanceof CstInteger) ? ((CstInteger) cst).getValue() : 0; visitor.visitConstant(ByteOps.LDC, offset, 3, cst, value); return 3; @@ -798,7 +798,7 @@ public final class BytecodeArray { /** * Helper to deal with {@code tableswitch}. - * + * * @param offset the offset to the {@code tableswitch} opcode itself * @param visitor {@code non-null;} visitor to use * @return instruction length, in bytes @@ -841,7 +841,7 @@ public final class BytecodeArray { /** * Helper to deal with {@code lookupswitch}. - * + * * @param offset the offset to the {@code lookupswitch} opcode itself * @param visitor {@code non-null;} visitor to use * @return instruction length, in bytes @@ -1059,10 +1059,10 @@ public final class BytecodeArray { } } - + /** * Helper to deal with {@code wide}. - * + * * @param offset the offset to the {@code wide} opcode itself * @param visitor {@code non-null;} visitor to use * @return instruction length, in bytes @@ -1145,7 +1145,7 @@ public final class BytecodeArray { public interface Visitor { /** * Visits an invalid instruction. - * + * * @param opcode the opcode * @param offset offset to the instruction * @param length length of the instruction, in bytes @@ -1155,7 +1155,7 @@ public final class BytecodeArray { /** * Visits an instruction which has no inline arguments * (implicit or explicit). - * + * * @param opcode the opcode * @param offset offset to the instruction * @param length length of the instruction, in bytes @@ -1166,7 +1166,7 @@ public final class BytecodeArray { /** * Visits an instruction which has a local variable index argument. - * + * * @param opcode the opcode * @param offset offset to the instruction * @param length length of the instruction, in bytes @@ -1188,13 +1188,13 @@ public final class BytecodeArray { * should-be-zero value left-shifted by 8. In the case of entries * of type {@code int}, the {@code value} field always * holds the raw value (for convenience of clients). - * + * * <p><b>Note:</b> In order to avoid giving it a barely-useful * visitor all its own, {@code newarray} also uses this * form, passing {@code value} as the array type code and * {@code cst} as a {@link CstType} instance * corresponding to the array type.</p> - * + * * @param opcode the opcode * @param offset offset to the instruction * @param length length of the instruction, in bytes @@ -1207,7 +1207,7 @@ public final class BytecodeArray { /** * Visits an instruction which has a branch target argument. - * + * * @param opcode the opcode * @param offset offset to the instruction * @param length length of the instruction, in bytes @@ -1218,7 +1218,7 @@ public final class BytecodeArray { /** * Visits a switch instruction. - * + * * @param opcode the opcode * @param offset offset to the instruction * @param length length of the instruction, in bytes @@ -1318,7 +1318,7 @@ public final class BytecodeArray { return previousOffset; } } - + /** * Base implementation of {@link Visitor}, which has empty method * bodies for all methods. diff --git a/dx/src/com/android/dx/cf/code/ConcreteMethod.java b/dx/src/com/android/dx/cf/code/ConcreteMethod.java index 70b6b452f..da6cff750 100644 --- a/dx/src/com/android/dx/cf/code/ConcreteMethod.java +++ b/dx/src/com/android/dx/cf/code/ConcreteMethod.java @@ -43,13 +43,13 @@ public final class ConcreteMethod implements Method { /** * {@code null-ok;} the class's {@code SourceFile} attribute value, - * if any + * if any */ private final CstUtf8 sourceFile; /** * whether the class that this method is part of is defined with - * {@code ACC_SUPER} + * {@code ACC_SUPER} */ private final boolean accSuper; @@ -64,7 +64,7 @@ public final class ConcreteMethod implements Method { /** * Constructs an instance. - * + * * @param method {@code non-null;} the method to be based on * @param cf {@code non-null;} the class file that contains this method * @param keepLines whether to keep the line number information @@ -179,7 +179,7 @@ public final class ConcreteMethod implements Method { /** * Gets whether the class that this method is part of is defined with * {@code ACC_SUPER}. - * + * * @return the {@code ACC_SUPER} value */ public boolean getAccSuper() { @@ -188,7 +188,7 @@ public final class ConcreteMethod implements Method { /** * Gets the maximum stack size. - * + * * @return {@code >= 0;} the maximum stack size */ public int getMaxStack() { @@ -197,7 +197,7 @@ public final class ConcreteMethod implements Method { /** * Gets the number of locals. - * + * * @return {@code >= 0;} the number of locals */ public int getMaxLocals() { @@ -206,7 +206,7 @@ public final class ConcreteMethod implements Method { /** * Gets the bytecode array. - * + * * @return {@code non-null;} the bytecode array */ public BytecodeArray getCode() { @@ -215,7 +215,7 @@ public final class ConcreteMethod implements Method { /** * Gets the exception table. - * + * * @return {@code non-null;} the exception table */ public ByteCatchList getCatches() { @@ -224,7 +224,7 @@ public final class ConcreteMethod implements Method { /** * Gets the line number list. - * + * * @return {@code non-null;} the line number list */ public LineNumberList getLineNumbers() { @@ -233,7 +233,7 @@ public final class ConcreteMethod implements Method { /** * Gets the local variable list. - * + * * @return {@code non-null;} the local variable list */ public LocalVariableList getLocalVariables() { @@ -243,7 +243,7 @@ public final class ConcreteMethod implements Method { /** * Returns a {@link SourcePosition} instance corresponding to the * given bytecode offset. - * + * * @param offset {@code >= 0;} the bytecode offset * @return {@code non-null;} an appropriate instance */ diff --git a/dx/src/com/android/dx/cf/code/ExecutionStack.java b/dx/src/com/android/dx/cf/code/ExecutionStack.java index 15a9e6c12..8f5b528b2 100644 --- a/dx/src/com/android/dx/cf/code/ExecutionStack.java +++ b/dx/src/com/android/dx/cf/code/ExecutionStack.java @@ -24,7 +24,7 @@ import com.android.dx.util.MutabilityControl; /** * Representation of a Java method execution stack. - * + * * <p><b>Note:</b> For the most part, the documentation for this class * ignores the distinction between {@link Type} and {@link * TypeBearer}.</p> @@ -35,13 +35,13 @@ public final class ExecutionStack extends MutabilityControl { /** * {@code >= 0;} stack pointer (points one past the end) / current stack - * size + * size */ private int stackPtr; /** - * Constructs an instance. - * + * Constructs an instance. + * * @param maxStack {@code >= 0;} the maximum size of the stack for this * instance */ @@ -53,7 +53,7 @@ public final class ExecutionStack extends MutabilityControl { /** * Makes and returns a mutable copy of this instance. - * + * * @return {@code non-null;} the copy */ public ExecutionStack copy() { @@ -68,7 +68,7 @@ public final class ExecutionStack extends MutabilityControl { /** * Annotates (adds context to) the given exception with information * about this instance. - * + * * @param ex {@code non-null;} the exception to annotate */ public void annotate(ExceptionWithContext ex) { @@ -85,7 +85,7 @@ public final class ExecutionStack extends MutabilityControl { /** * Replaces all the occurrences of the given uninitialized type in * this stack with its initialized equivalent. - * + * * @param type {@code non-null;} type to replace */ public void makeInitialized(Type type) { @@ -107,7 +107,7 @@ public final class ExecutionStack extends MutabilityControl { /** * Gets the maximum stack size for this instance. - * + * * @return {@code >= 0;} the max stack size */ public int getMaxStack() { @@ -116,7 +116,7 @@ public final class ExecutionStack extends MutabilityControl { /** * Gets the current stack size. - * + * * @return {@code >= 0, < getMaxStack();} the current stack size */ public int size() { @@ -138,7 +138,7 @@ public final class ExecutionStack extends MutabilityControl { /** * Pushes a value of the given type onto the stack. - * + * * @param type {@code non-null;} type of the value * @throws SimException thrown if there is insufficient room on the * stack for the value @@ -175,10 +175,10 @@ public final class ExecutionStack extends MutabilityControl { * {@code n == 0} means to peek at the top of the stack. Note that * this will return {@code null} if the indicated element is the * deeper half of a category-2 value. - * + * * @param n {@code >= 0;} which element to peek at * @return {@code null-ok;} the type of value stored at that element - * @throws SimException thrown if {@code n >= size()} + * @throws SimException thrown if {@code n >= size()} */ public TypeBearer peek(int n) { if (n < 0) { @@ -197,7 +197,7 @@ public final class ExecutionStack extends MutabilityControl { * stack, returning the type per se, as opposed to the * <i>type-bearer</i>. This method is just a convenient shorthand * for {@code peek(n).getType()}. - * + * * @see #peek */ public Type peekType(int n) { @@ -206,7 +206,7 @@ public final class ExecutionStack extends MutabilityControl { /** * Pops the top element off of the stack. - * + * * @return {@code non-null;} the type formerly on the top of the stack * @throws SimException thrown if the stack is empty */ @@ -226,7 +226,7 @@ public final class ExecutionStack extends MutabilityControl { * contexts, particularly when merging two instances. As such, it places * the following restriction on its behavior: You may only replace * values with other values of the same category. - * + * * @param n {@code >= 0;} which element to change, where {@code 0} is * the top element of the stack * @param type {@code non-null;} type of the new value @@ -281,7 +281,7 @@ public final class ExecutionStack extends MutabilityControl { * Gets the string form for a stack element. This is the same as * {@code toString()} except that {@code null} is converted * to {@code "<invalid>"}. - * + * * @param type {@code null-ok;} the stack element * @return {@code non-null;} the string form */ @@ -295,7 +295,7 @@ public final class ExecutionStack extends MutabilityControl { /** * Throws a properly-formatted exception. - * + * * @param msg {@code non-null;} useful message * @return never (keeps compiler happy) */ diff --git a/dx/src/com/android/dx/cf/code/Frame.java b/dx/src/com/android/dx/cf/code/Frame.java index f34533530..002a4fbc1 100644 --- a/dx/src/com/android/dx/cf/code/Frame.java +++ b/dx/src/com/android/dx/cf/code/Frame.java @@ -197,7 +197,7 @@ public final class Frame { } catch (NullPointerException ex) { throw new NullPointerException("can't return from non-subroutine"); } - + return (subLocals == null) ? null : new Frame(subLocals, stack, newSubroutines); } @@ -234,7 +234,7 @@ public final class Frame { * Merges this frame's subroutine lists with another. The result * is the deepest common nesting (effectively, the common prefix of the * two lists). - * + * * @param otherSubroutines label list of subroutine start blocks, from * least-nested to most-nested. * @return {@code non-null;} merged subroutine nest list as described above @@ -359,7 +359,7 @@ public final class Frame { RuntimeException("Incompatible merged subroutines"); } } - + } return new Frame(resultLocals, resultStack, resultSubroutines); diff --git a/dx/src/com/android/dx/cf/code/LineNumberList.java b/dx/src/com/android/dx/cf/code/LineNumberList.java index 7af3f4e6b..f54f8b5e5 100644 --- a/dx/src/com/android/dx/cf/code/LineNumberList.java +++ b/dx/src/com/android/dx/cf/code/LineNumberList.java @@ -29,7 +29,7 @@ public final class LineNumberList extends FixedSizeList { /** * Returns an instance which is the concatenation of the two given * instances. - * + * * @param list1 {@code non-null;} first instance * @param list2 {@code non-null;} second instance * @return {@code non-null;} combined instance @@ -58,7 +58,7 @@ public final class LineNumberList extends FixedSizeList { /** * Constructs an instance. - * + * * @param count the number of elements to be in the list */ public LineNumberList(int count) { @@ -67,7 +67,7 @@ public final class LineNumberList extends FixedSizeList { /** * Gets the indicated item. - * + * * @param n {@code >= 0;} which item * @return {@code null-ok;} the indicated item */ @@ -77,7 +77,7 @@ public final class LineNumberList extends FixedSizeList { /** * Sets the item at the given index. - * + * * @param n {@code >= 0, < size();} which element * @param item {@code non-null;} the item */ @@ -91,7 +91,7 @@ public final class LineNumberList extends FixedSizeList { /** * Sets the item at the given index. - * + * * @param n {@code >= 0, < size();} which element * @param startPc {@code >= 0;} start pc of this item * @param lineNumber {@code >= 0;} corresponding line number @@ -102,7 +102,7 @@ public final class LineNumberList extends FixedSizeList { /** * Gets the line number associated with the given address. - * + * * @param pc {@code >= 0;} the address to look up * @return {@code >= -1;} the associated line number, or {@code -1} if * none is known @@ -146,7 +146,7 @@ public final class LineNumberList extends FixedSizeList { /** * Constructs an instance. - * + * * @param startPc {@code >= 0;} start pc of this item * @param lineNumber {@code >= 0;} corresponding line number */ @@ -165,7 +165,7 @@ public final class LineNumberList extends FixedSizeList { /** * Gets the start pc of this item. - * + * * @return the start pc */ public int getStartPc() { @@ -174,7 +174,7 @@ public final class LineNumberList extends FixedSizeList { /** * Gets the line number of this item. - * + * * @return the line number */ public int getLineNumber() { diff --git a/dx/src/com/android/dx/cf/code/LocalVariableList.java b/dx/src/com/android/dx/cf/code/LocalVariableList.java index 8f49a335f..dbf8ba2ad 100644 --- a/dx/src/com/android/dx/cf/code/LocalVariableList.java +++ b/dx/src/com/android/dx/cf/code/LocalVariableList.java @@ -33,7 +33,7 @@ public final class LocalVariableList extends FixedSizeList { /** * Returns an instance which is the concatenation of the two given * instances. The result is immutable. - * + * * @param list1 {@code non-null;} first instance * @param list2 {@code non-null;} second instance * @return {@code non-null;} combined instance @@ -69,7 +69,7 @@ public final class LocalVariableList extends FixedSizeList { * any element whose {name, index, start, length} matches an * element in the signature list gets augmented with the * corresponding signature. The result is immutable. - * + * * @param descriptorList {@code non-null;} list with descriptors * @param signatureList {@code non-null;} list with signatures * @return {@code non-null;} the merged result @@ -88,7 +88,7 @@ public final class LocalVariableList extends FixedSizeList { item = item.withSignature(signature); } result.set(i, item); - } + } result.setImmutable(); return result; @@ -96,7 +96,7 @@ public final class LocalVariableList extends FixedSizeList { /** * Constructs an instance. - * + * * @param count the number of elements to be in the list */ public LocalVariableList(int count) { @@ -105,7 +105,7 @@ public final class LocalVariableList extends FixedSizeList { /** * Gets the indicated item. - * + * * @param n {@code >= 0;} which item * @return {@code null-ok;} the indicated item */ @@ -115,7 +115,7 @@ public final class LocalVariableList extends FixedSizeList { /** * Sets the item at the given index. - * + * * @param n {@code >= 0, < size();} which element * @param item {@code non-null;} the item */ @@ -129,10 +129,10 @@ public final class LocalVariableList extends FixedSizeList { /** * Sets the item at the given index. - * + * * <p><b>Note:</b> At least one of {@code descriptor} or * {@code signature} must be passed as non-null.</p> - * + * * @param n {@code >= 0, < size();} which element * @param startPc {@code >= 0;} the start pc of this variable's scope * @param length {@code >= 0;} the length (in bytecodes) of this variable's @@ -151,7 +151,7 @@ public final class LocalVariableList extends FixedSizeList { * Gets the local variable information in this instance which matches * the given {@link com.android.dx.cf.code.LocalVariableList.Item} * in all respects but the type descriptor and signature, if any. - * + * * @param item {@code non-null;} local variable information to match * @return {@code null-ok;} the corresponding local variable information stored * in this instance, or {@code null} if there is no matching @@ -176,7 +176,7 @@ public final class LocalVariableList extends FixedSizeList { * and local index, if any. <b>Note:</b> In standard classfiles, a * variable's start point is listed as the address of the instruction * <i>just past</i> the one that sets the variable. - * + * * @param pc {@code >= 0;} the address to look up * @param index {@code >= 0;} the local variable index * @return {@code null-ok;} the associated local variable information, or @@ -220,10 +220,10 @@ public final class LocalVariableList extends FixedSizeList { /** * Constructs an instance. - * + * * <p><b>Note:</b> At least one of {@code descriptor} or * {@code signature} must be passed as non-null.</p> - * + * * @param startPc {@code >= 0;} the start pc of this variable's scope * @param length {@code >= 0;} the length (in bytecodes) of this variable's * scope @@ -265,7 +265,7 @@ public final class LocalVariableList extends FixedSizeList { /** * Gets the start pc of this variable's scope. - * + * * @return {@code >= 0;} the start pc of this variable's scope */ public int getStartPc() { @@ -274,7 +274,7 @@ public final class LocalVariableList extends FixedSizeList { /** * Gets the length (in bytecodes) of this variable's scope. - * + * * @return {@code >= 0;} the length (in bytecodes) of this variable's scope */ public int getLength() { @@ -311,7 +311,7 @@ public final class LocalVariableList extends FixedSizeList { /** * Gets the variable's local index. - * + * * @return {@code >= 0;} the variable's local index */ public int getIndex() { @@ -321,7 +321,7 @@ public final class LocalVariableList extends FixedSizeList { /** * Gets the variable's type descriptor. This is a convenient shorthand * for {@code Type.intern(getDescriptor().getString())}. - * + * * @return {@code non-null;} the variable's type */ public Type getType() { @@ -331,7 +331,7 @@ public final class LocalVariableList extends FixedSizeList { /** * Constructs and returns an instance which is identical to this * one, except that the signature is changed to the given value. - * + * * @param newSignature {@code non-null;} the new signature * @return {@code non-null;} an appropriately-constructed instance */ @@ -343,7 +343,7 @@ public final class LocalVariableList extends FixedSizeList { /** * Gets whether this instance matches (describes) the given * address and index. - * + * * @param pc {@code >= 0;} the address in question * @param index {@code >= 0;} the local variable index in question * @return {@code true} iff this instance matches {@code pc} @@ -359,7 +359,7 @@ public final class LocalVariableList extends FixedSizeList { * Gets whether this instance matches (describes) the given * other instance exactly in all fields except type descriptor and * type signature. - * + * * @param other {@code non-null;} the instance to compare to * @return {@code true} iff this instance matches */ diff --git a/dx/src/com/android/dx/cf/code/LocalsArray.java b/dx/src/com/android/dx/cf/code/LocalsArray.java index b2c268980..75af04752 100644 --- a/dx/src/com/android/dx/cf/code/LocalsArray.java +++ b/dx/src/com/android/dx/cf/code/LocalsArray.java @@ -26,7 +26,7 @@ import com.android.dx.util.ToHuman; /** * Representation of an array of local variables, with Java semantics. - * + * * <p><b>Note:</b> For the most part, the documentation for this class * ignores the distinction between {@link Type} and {@link * TypeBearer}.</p> @@ -37,14 +37,14 @@ public abstract class LocalsArray extends MutabilityControl implements ToHuman { * Constructs an instance, explicitly indicating the mutability. * * @param mutable {@code true} if this instance is mutable - */ + */ protected LocalsArray(boolean mutable) { super(mutable); } /** * Makes and returns a mutable copy of this instance. - * + * * @return {@code non-null;} the copy */ public abstract LocalsArray copy(); @@ -52,7 +52,7 @@ public abstract class LocalsArray extends MutabilityControl implements ToHuman { /** * Annotates (adds context to) the given exception with information * about this instance. - * + * * @param ex {@code non-null;} the exception to annotate */ public abstract void annotate(ExceptionWithContext ex); @@ -60,14 +60,14 @@ public abstract class LocalsArray extends MutabilityControl implements ToHuman { /** * Replaces all the occurrences of the given uninitialized type in * this array with its initialized equivalent. - * + * * @param type {@code non-null;} type to replace */ public abstract void makeInitialized(Type type); /** * Gets the maximum number of locals this instance can refer to. - * + * * @return the max locals */ public abstract int getMaxLocals(); @@ -79,7 +79,7 @@ public abstract class LocalsArray extends MutabilityControl implements ToHuman { * by the operation. In case of either category, if the <i>previous</i> * local contains a category-2 value, then it too is invalidated by * this operation. - * + * * @param idx {@code >= 0, < getMaxLocals();} which local * @param type {@code non-null;} new type for the local at {@code idx} */ @@ -90,14 +90,14 @@ public abstract class LocalsArray extends MutabilityControl implements ToHuman { * to that register spec (which includes type and optional name * information). This is identical to calling * {@code set(spec.getReg(), spec)}. - * + * * @param spec {@code non-null;} register spec to use as the basis for the update */ public abstract void set(RegisterSpec spec); /** * Invalidates the local at the given index. - * + * * @param idx {@code >= 0, < getMaxLocals();} which local */ public abstract void invalidate(int idx); @@ -105,7 +105,7 @@ public abstract class LocalsArray extends MutabilityControl implements ToHuman { /** * Gets the type stored at the given local index, or {@code null} * if the given local is uninitialized / invalid. - * + * * @param idx {@code >= 0, < getMaxLocals();} which local * @return {@code null-ok;} the type of value stored in that local */ @@ -115,7 +115,7 @@ public abstract class LocalsArray extends MutabilityControl implements ToHuman { * Gets the type stored at the given local index, only succeeding if * the given local contains a valid type (though it is allowed to * be an uninitialized instance). - * + * * @param idx {@code >= 0, < getMaxLocals();} which local * @return {@code non-null;} the type of value stored in that local * @throws SimException thrown if {@code idx} is valid, but @@ -126,7 +126,7 @@ public abstract class LocalsArray extends MutabilityControl implements ToHuman { /** * Gets the type stored at the given local index, which is expected * to be an initialized category-1 value. - * + * * @param idx {@code >= 0, < getMaxLocals();} which local * @return {@code non-null;} the type of value stored in that local * @throws SimException thrown if {@code idx} is valid, but @@ -139,7 +139,7 @@ public abstract class LocalsArray extends MutabilityControl implements ToHuman { /** * Gets the type stored at the given local index, which is expected * to be a category-2 value. - * + * * @param idx {@code >= 0, < getMaxLocals();} which local * @return {@code non-null;} the type of value stored in that local * @throws SimException thrown if {@code idx} is valid, but diff --git a/dx/src/com/android/dx/cf/code/LocalsArraySet.java b/dx/src/com/android/dx/cf/code/LocalsArraySet.java index fa2acbe30..5d0305508 100644 --- a/dx/src/com/android/dx/cf/code/LocalsArraySet.java +++ b/dx/src/com/android/dx/cf/code/LocalsArraySet.java @@ -74,7 +74,7 @@ public class LocalsArraySet extends LocalsArray { super(primary.getMaxLocals() > 0); this.primary = primary; - this.secondaries = secondaries; + this.secondaries = secondaries; } /** diff --git a/dx/src/com/android/dx/cf/code/Machine.java b/dx/src/com/android/dx/cf/code/Machine.java index aff50b2f3..72ba3b456 100644 --- a/dx/src/com/android/dx/cf/code/Machine.java +++ b/dx/src/com/android/dx/cf/code/Machine.java @@ -33,11 +33,11 @@ public interface Machine { * Gets the effective prototype of the method that this instance is * being used for. The <i>effective</i> prototype includes an initial * {@code this} argument for instance methods. - * + * * @return {@code non-null;} the method prototype */ public Prototype getPrototype(); - + /** * Clears the regular and auxiliary arguments area. */ diff --git a/dx/src/com/android/dx/cf/code/Merger.java b/dx/src/com/android/dx/cf/code/Merger.java index 8da9a1841..51c31c3a3 100644 --- a/dx/src/com/android/dx/cf/code/Merger.java +++ b/dx/src/com/android/dx/cf/code/Merger.java @@ -34,7 +34,7 @@ public final class Merger { /** * Merges two locals arrays. If the merged result is the same as the first * argument, then return the first argument (not a copy). - * + * * @param locals1 {@code non-null;} a locals array * @param locals2 {@code non-null;} another locals array * @return {@code non-null;} the result of merging the two locals arrays @@ -86,7 +86,7 @@ public final class Merger { /** * Merges two stacks. If the merged result is the same as the first * argument, then return the first argument (not a copy). - * + * * @param stack1 {@code non-null;} a stack * @param stack2 {@code non-null;} another stack * @return {@code non-null;} the result of merging the two stacks @@ -143,7 +143,7 @@ public final class Merger { /** * Merges two frame types. - * + * * @param ft1 {@code non-null;} a frame type * @param ft2 {@code non-null;} another frame type * @return {@code non-null;} the result of merging the two types @@ -212,7 +212,7 @@ public final class Merger { * type {@code Object} is the supertype of all reference * types and all arrays are assignable to * {@code Serializable} and {@code Cloneable}. - * + * * @param supertypeBearer {@code non-null;} the supertype * @param subtypeBearer {@code non-null;} the subtype */ diff --git a/dx/src/com/android/dx/cf/code/ReturnAddress.java b/dx/src/com/android/dx/cf/code/ReturnAddress.java index 47c6071ca..ee36450d1 100644 --- a/dx/src/com/android/dx/cf/code/ReturnAddress.java +++ b/dx/src/com/android/dx/cf/code/ReturnAddress.java @@ -33,7 +33,7 @@ public final class ReturnAddress implements TypeBearer { /** * Constructs an instance. - * + * * @param subroutineAddress {@code >= 0;} the start address of the * subroutine being returned from */ @@ -99,7 +99,7 @@ public final class ReturnAddress implements TypeBearer { /** * Gets the subroutine address. - * + * * @return {@code >= 0;} the subroutine address */ public int getSubroutineAddress() { diff --git a/dx/src/com/android/dx/cf/code/RopperMachine.java b/dx/src/com/android/dx/cf/code/RopperMachine.java index dd7fcd46b..ebff24bb2 100644 --- a/dx/src/com/android/dx/cf/code/RopperMachine.java +++ b/dx/src/com/android/dx/cf/code/RopperMachine.java @@ -53,7 +53,7 @@ import java.util.ArrayList; /** * {@code non-null;} method constant for use in converting - * {@code multianewarray} instructions + * {@code multianewarray} instructions */ private static final CstMethodRef MULTIANEWARRAY_METHOD = new CstMethodRef(ARRAY_REFLECT_TYPE, @@ -106,19 +106,19 @@ import java.util.ArrayList; /** * {@code null-ok;} the appropriate {@code return} op or {@code null} - * if it is not yet known + * if it is not yet known */ private Rop returnOp; /** * {@code null-ok;} the source position for the return block or {@code null} - * if it is not yet known + * if it is not yet known */ private SourcePosition returnPosition; /** * Constructs an instance. - * + * * @param ropper {@code non-null;} ropper controlling this instance * @param method {@code non-null;} method being converted * @param advice {@code non-null;} translation advice to use @@ -126,7 +126,7 @@ import java.util.ArrayList; public RopperMachine(Ropper ropper, ConcreteMethod method, TranslationAdvice advice) { super(method.getEffectiveDescriptor()); - + if (ropper == null) { throw new NullPointerException("ropper == null"); } @@ -153,7 +153,7 @@ import java.util.ArrayList; /** * Gets the instructions array. It is shared and gets modified by * subsequent calls to this instance. - * + * * @return {@code non-null;} the instructions array */ public ArrayList<Insn> getInsns() { @@ -162,7 +162,7 @@ import java.util.ArrayList; /** * Gets the return opcode encountered, if any. - * + * * @return {@code null-ok;} the return opcode */ public Rop getReturnOp() { @@ -171,7 +171,7 @@ import java.util.ArrayList; /** * Gets the return position, if known. - * + * * @return {@code null-ok;} the return position */ public SourcePosition getReturnPosition() { @@ -200,7 +200,7 @@ import java.util.ArrayList; /** * Gets whether {@link #catches} was used. This indicates that the * last instruction in the block is one of the ones that can throw. - * + * * @return whether {@code catches} has been used */ public boolean wereCatchesUsed() { @@ -210,7 +210,7 @@ import java.util.ArrayList; /** * Gets whether the block just processed ended with a * {@code return}. - * + * * @return whether the block returns */ public boolean returns() { @@ -224,7 +224,7 @@ import java.util.ArrayList; * successor. This may return something other than * {@code -1} in the case of an instruction with no * successors at all (primary or otherwise). - * + * * @return {@code >= -1;} the primary successor index */ public int getPrimarySuccessorIndex() { @@ -235,7 +235,7 @@ import java.util.ArrayList; * Gets how many extra blocks will be needed to represent the * block currently being translated. Each extra block should consist * of one instruction from the end of the original block. - * + * * @return {@code >= 0;} the number of extra blocks needed */ public int getExtraBlockCount() { @@ -318,7 +318,7 @@ import java.util.ArrayList; * the "temporary stack" area defined for the method, and * then move stuff back down onto the main "stack" in the * arrangement specified by the stack op pattern. - * + * * Note: This code ends up emitting a lot of what will * turn out to be superfluous moves (e.g., moving back and * forth to the same local when doing a dup); however, @@ -350,7 +350,7 @@ import java.util.ArrayList; stackPointer += type.getType().getCategory(); } return; - } + } TypeBearer destType = (dest != null) ? dest : Type.VOID; Constant cst = getAuxCst(); @@ -369,7 +369,7 @@ import java.util.ArrayList; * Add an array constructor for the int[] containing all the * dimensions. */ - RegisterSpec dimsReg = + RegisterSpec dimsReg = RegisterSpec.make(dest.getNextReg(), Type.INT_ARRAY); rop = Rops.opFilledNewArray(Type.INT_ARRAY, sourceCount); insn = new ThrowingCstInsn(rop, pos, sources, catches, @@ -383,7 +383,7 @@ import java.util.ArrayList; /* * Add a const-class instruction for the specified array - * class. + * class. */ /* @@ -438,7 +438,7 @@ import java.util.ArrayList; RegisterSpec objectReg = RegisterSpec.make(dest.getReg(), Type.OBJECT); - + insn = new ThrowingCstInsn( Rops.opInvokeStatic(MULTIANEWARRAY_METHOD.getPrototype()), pos, RegisterSpecList.make(classReg, dimsReg), @@ -609,7 +609,7 @@ import java.util.ArrayList; * action we take here is to convert these initialization * bytecodes into a single fill-array-data ROP which lays out * all the constant values in a table. - */ + */ if (initValues != null) { extraBlockCount++; insn = new FillArrayDataInsn(Rops.FILL_ARRAY_DATA, pos, @@ -622,7 +622,7 @@ import java.util.ArrayList; /** * Helper for {@link #run}, which gets the list of sources for the. * instruction. - * + * * @param opcode the opcode being translated * @param stackPointer {@code >= 0;} the stack pointer after the * instruction's arguments have been popped @@ -634,7 +634,7 @@ import java.util.ArrayList; if (count == 0) { // We get an easy out if there aren't any sources. return RegisterSpecList.EMPTY; - } + } int localIndex = getLocalIndex(); RegisterSpecList sources; @@ -696,7 +696,7 @@ import java.util.ArrayList; /** * Sets or updates the information about the return block. - * + * * @param op {@code non-null;} the opcode to use * @param pos {@code non-null;} the position to use */ @@ -727,7 +727,7 @@ import java.util.ArrayList; /** * Gets the register opcode for the given Java opcode. - * + * * @param jop {@code >= 0;} the Java opcode * @param cst {@code null-ok;} the constant argument, if any * @return {@code >= 0;} the corresponding register opcode @@ -756,7 +756,7 @@ import java.util.ArrayList; case ByteOps.LDC2_W: { return RegOps.CONST; } - case ByteOps.ILOAD: + case ByteOps.ILOAD: case ByteOps.ISTORE: { return RegOps.MOVE; } diff --git a/dx/src/com/android/dx/cf/code/Simulator.java b/dx/src/com/android/dx/cf/code/Simulator.java index 408e1261d..f96699ed9 100644 --- a/dx/src/com/android/dx/cf/code/Simulator.java +++ b/dx/src/com/android/dx/cf/code/Simulator.java @@ -48,7 +48,7 @@ public class Simulator { private static final String LOCAL_MISMATCH_ERROR = "This is symptomatic of .class transformation tools that ignore " + "local variable information."; - + /** {@code non-null;} machine to use when simulating */ private final Machine machine; @@ -63,7 +63,7 @@ public class Simulator { /** * Constructs an instance. - * + * * @param machine {@code non-null;} machine to use when simulating * @param method {@code non-null;} method data to use */ @@ -85,7 +85,7 @@ public class Simulator { /** * Simulates the effect of executing the given basic block. This modifies * the passed-in frame to represent the end result. - * + * * @param bb {@code non-null;} the basic block * @param frame {@code non-null;} frame to operate on */ @@ -109,7 +109,7 @@ public class Simulator { /** * Simulates the effect of the instruction at the given offset, by * making appropriate calls on the given frame. - * + * * @param offset {@code >= 0;} offset of the instruction to simulate * @param frame {@code non-null;} frame to operate on * @return the length of the instruction, in bytes @@ -139,7 +139,7 @@ public class Simulator { private final Machine machine; /** - * {@code null-ok;} frame to use; set with each call to + * {@code null-ok;} frame to use; set with each call to * {@link Simulator#simulate} */ private Frame frame; @@ -157,7 +157,7 @@ public class Simulator { /** * Sets the frame to act on. - * + * * @param frame {@code non-null;} the frame */ public void setFrame(Frame frame) { @@ -382,7 +382,7 @@ public class Simulator { if (stack.peekType(0).isCategory2()) { throw illegalTos(); } - + if (stack.peekType(1).isCategory2()) { // "form 2" in vmspec-2 machine.popArgs(frame, 2); @@ -474,7 +474,7 @@ public class Simulator { /** * Checks whether the prototype is compatible with returning the * given type, and throws if not. - * + * * @param encountered {@code non-null;} the encountered return type */ private void checkReturnType(Type encountered) { @@ -503,7 +503,7 @@ public class Simulator { * possible, we replace the type with the one indicated in * the local variable table, though we still need to check * to make sure it's valid for the opcode. - * + * * The reason we use (offset + length) for the localOffset * for a store is because it is only after the store that * the local type becomes valid. On the other hand, the @@ -599,7 +599,7 @@ public class Simulator { * Get the instance prototype, and use it to direct * the machine. */ - Prototype prototype = + Prototype prototype = ((CstMethodRef) cst).getPrototype(false); machine.popArgs(frame, prototype); break; @@ -609,7 +609,7 @@ public class Simulator { * Get the static prototype, and use it to direct * the machine. */ - Prototype prototype = + Prototype prototype = ((CstMethodRef) cst).getPrototype(true); machine.popArgs(frame, prototype); break; diff --git a/dx/src/com/android/dx/cf/code/SwitchList.java b/dx/src/com/android/dx/cf/code/SwitchList.java index fdd159614..621d728f6 100644 --- a/dx/src/com/android/dx/cf/code/SwitchList.java +++ b/dx/src/com/android/dx/cf/code/SwitchList.java @@ -31,7 +31,7 @@ public final class SwitchList extends MutabilityControl { /** * {@code non-null;} list of targets corresponding to the test values; there * is always one extra element in the target list, to hold the - * default target + * default target */ private final IntList targets; @@ -40,7 +40,7 @@ public final class SwitchList extends MutabilityControl { /** * Constructs an instance. - * + * * @param size {@code >= 0;} the number of elements to be in the table */ public SwitchList(int size) { @@ -60,7 +60,7 @@ public final class SwitchList extends MutabilityControl { /** * Gets the size of the list. - * + * * @return {@code >= 0;} the list size */ public int size() { @@ -69,9 +69,9 @@ public final class SwitchList extends MutabilityControl { /** * Gets the indicated test value. - * + * * @param n {@code >= 0;}, < size(); which index - * @return the test value + * @return the test value */ public int getValue(int n) { return values.get(n); @@ -80,7 +80,7 @@ public final class SwitchList extends MutabilityControl { /** * Gets the indicated target. Asking for the target at {@code size()} * returns the default target. - * + * * @param n {@code >= 0, <= size();} which index * @return {@code >= 0;} the target */ @@ -91,7 +91,7 @@ public final class SwitchList extends MutabilityControl { /** * Gets the default target. This is just a shorthand for * {@code getTarget(size())}. - * + * * @return {@code >= 0;} the default target */ public int getDefaultTarget() { @@ -101,7 +101,7 @@ public final class SwitchList extends MutabilityControl { /** * Gets the list of all targets. This includes one extra element at the * end of the list, which holds the default target. - * + * * @return {@code non-null;} the target list */ public IntList getTargets() { @@ -110,7 +110,7 @@ public final class SwitchList extends MutabilityControl { /** * Gets the list of all case values. - * + * * @return {@code non-null;} the case value list */ public IntList getValues() { @@ -120,7 +120,7 @@ public final class SwitchList extends MutabilityControl { /** * Sets the default target. It is only valid to call this method * when all the non-default elements have been set. - * + * * @param target {@code >= 0;} the absolute (not relative) default target * address */ @@ -140,7 +140,7 @@ public final class SwitchList extends MutabilityControl { /** * Adds the given item. - * + * * @param value the test value * @param target {@code >= 0;} the absolute (not relative) target address */ diff --git a/dx/src/com/android/dx/cf/code/ValueAwareMachine.java b/dx/src/com/android/dx/cf/code/ValueAwareMachine.java index 43aab8a67..de75db55b 100644 --- a/dx/src/com/android/dx/cf/code/ValueAwareMachine.java +++ b/dx/src/com/android/dx/cf/code/ValueAwareMachine.java @@ -29,7 +29,7 @@ import com.android.dx.util.Hex; public class ValueAwareMachine extends BaseMachine { /** * Constructs an instance. - * + * * @param prototype {@code non-null;} the prototype for the associated * method */ @@ -96,7 +96,7 @@ public class ValueAwareMachine extends BaseMachine { case ByteOps.IUSHR: case ByteOps.IAND: case ByteOps.IOR: - case ByteOps.IXOR: + case ByteOps.IXOR: case ByteOps.IINC: case ByteOps.I2L: case ByteOps.I2F: @@ -161,7 +161,7 @@ public class ValueAwareMachine extends BaseMachine { } Type type = ((TypeBearer) getAuxCst()).getType(); if (type == Type.VOID) { - clearResult(); + clearResult(); } else { setResult(type); } diff --git a/dx/src/com/android/dx/cf/cst/ConstantPoolParser.java b/dx/src/com/android/dx/cf/cst/ConstantPoolParser.java index 7cd9c9be4..5eecfa648 100644 --- a/dx/src/com/android/dx/cf/cst/ConstantPoolParser.java +++ b/dx/src/com/android/dx/cf/cst/ConstantPoolParser.java @@ -53,7 +53,7 @@ public final class ConstantPoolParser { /** * -1 || >= 10; the end offset of this constant pool in the * {@code byte[]} which it came from or {@code -1} if not - * yet parsed + * yet parsed */ private int endOffset; @@ -62,7 +62,7 @@ public final class ConstantPoolParser { /** * Constructs an instance. - * + * * @param bytes {@code non-null;} the bytes of the file */ public ConstantPoolParser(ByteArray bytes) { @@ -76,7 +76,7 @@ public final class ConstantPoolParser { /** * Sets the parse observer for this instance. - * + * * @param observer {@code null-ok;} the observer */ public void setObserver(ParseObserver observer) { @@ -86,7 +86,7 @@ public final class ConstantPoolParser { /** * Gets the end offset of this constant pool in the {@code byte[]} * which it came from. - * + * * @return {@code >= 10;} the end offset */ public int getEndOffset() { @@ -96,7 +96,7 @@ public final class ConstantPoolParser { /** * Gets the actual constant pool. - * + * * @return {@code non-null;} the constant pool */ public StdConstantPool getPool() { @@ -213,7 +213,7 @@ public final class ConstantPoolParser { * parsed, also storing it in the constant pool. This will also * have the side effect of parsing any entries the indicated one * depends on. - * + * * @param idx which constant * @return {@code non-null;} the parsed constant */ @@ -314,7 +314,7 @@ public final class ConstantPoolParser { /** * Parses a utf8 constant. - * + * * @param at offset to the start of the constant (where the tag byte is) * @return {@code non-null;} the parsed value */ diff --git a/dx/src/com/android/dx/cf/direct/AnnotationParser.java b/dx/src/com/android/dx/cf/direct/AnnotationParser.java index 88e4cd289..ca38fc51d 100644 --- a/dx/src/com/android/dx/cf/direct/AnnotationParser.java +++ b/dx/src/com/android/dx/cf/direct/AnnotationParser.java @@ -71,10 +71,10 @@ public final class AnnotationParser { * was parsed */ private int parseCursor; - + /** * Constructs an instance. - * + * * @param cf {@code non-null;} class file to parse from * @param offset {@code >= 0;} offset into the class file data to parse at * @param length {@code >= 0;} number of bytes left in the attribute data @@ -93,15 +93,15 @@ public final class AnnotationParser { this.input = bytes.makeDataInputStream(); this.parseCursor = 0; } - + /** * Parses an annotation value ({@code element_value}) attribute. - * + * * @return {@code non-null;} the parsed constant value */ public Constant parseValueAttribute() { Constant result; - + try { result = parseValue(); @@ -118,14 +118,14 @@ public final class AnnotationParser { /** * Parses a parameter annotation attribute. - * + * * @param visibility {@code non-null;} visibility of the parsed annotations * @return {@code non-null;} the parsed list of lists of annotations */ public AnnotationsList parseParameterAttribute( AnnotationVisibility visibility) { AnnotationsList result; - + try { result = parseAnnotationsList(visibility); @@ -139,10 +139,10 @@ public final class AnnotationParser { return result; } - + /** * Parses an annotation attribute, per se. - * + * * @param visibility {@code non-null;} visibility of the parsed annotations * @return {@code non-null;} the list of annotations read from the attribute * data @@ -150,7 +150,7 @@ public final class AnnotationParser { public Annotations parseAnnotationAttribute( AnnotationVisibility visibility) { Annotations result; - + try { result = parseAnnotations(visibility); @@ -167,7 +167,7 @@ public final class AnnotationParser { /** * Parses a list of annotation lists. - * + * * @param visibility {@code non-null;} visibility of the parsed annotations * @return {@code non-null;} the list of annotation lists read from the attribute * data @@ -202,7 +202,7 @@ public final class AnnotationParser { /** * Parses an annotation list. - * + * * @param visibility {@code non-null;} visibility of the parsed annotations * @return {@code non-null;} the list of annotations read from the attribute * data @@ -237,7 +237,7 @@ public final class AnnotationParser { /** * Parses a single annotation. - * + * * @param visibility {@code non-null;} visibility of the parsed annotation * @return {@code non-null;} the parsed annotation */ @@ -274,18 +274,18 @@ public final class AnnotationParser { annotation.setImmutable(); return annotation; } - + /** * Parses a {@link NameValuePair}. - * + * * @return {@code non-null;} the parsed element */ private NameValuePair parseElement() throws IOException { requireLength(5); - + int elementNameIndex = input.readUnsignedShort(); CstUtf8 elementName = (CstUtf8) pool.get(elementNameIndex); - + if (observer != null) { parsed(2, "element_name: " + elementName.toHuman()); parsed(0, "value: "); @@ -303,7 +303,7 @@ public final class AnnotationParser { /** * Parses an annotation value. - * + * * @return {@code non-null;} the parsed value */ private Constant parseValue() throws IOException { @@ -352,7 +352,7 @@ public final class AnnotationParser { int classInfoIndex = input.readUnsignedShort(); CstUtf8 value = (CstUtf8) pool.get(classInfoIndex); Type type = Type.internReturnType(value.getString()); - + if (observer != null) { parsed(2, "class_info: " + type.toHuman()); } @@ -370,7 +370,7 @@ public final class AnnotationParser { int constNameIndex = input.readUnsignedShort(); CstUtf8 typeName = (CstUtf8) pool.get(typeNameIndex); CstUtf8 constName = (CstUtf8) pool.get(constNameIndex); - + if (observer != null) { parsed(2, "type_name: " + typeName.toHuman()); parsed(2, "const_name: " + constName.toHuman()); @@ -416,11 +416,11 @@ public final class AnnotationParser { } } } - + /** * Helper for {@link #parseValue}, which parses a constant reference * and returns the referred-to constant value. - * + * * @return {@code non-null;} the parsed value */ private Constant parseConstant() throws IOException { @@ -428,8 +428,8 @@ public final class AnnotationParser { Constant value = (Constant) pool.get(constValueIndex); if (observer != null) { - String human = (value instanceof CstUtf8) - ? ((CstUtf8) value).toQuoted() + String human = (value instanceof CstUtf8) + ? ((CstUtf8) value).toQuoted() : value.toHuman(); parsed(2, "constant_value: " + human); } @@ -440,7 +440,7 @@ public final class AnnotationParser { /** * Helper which will throw an exception if the given number of bytes * is not available to be read. - * + * * @param requiredLength the number of required bytes */ private void requireLength(int requiredLength) throws IOException { @@ -448,12 +448,12 @@ public final class AnnotationParser { throw new ParseException("truncated annotation attribute"); } } - + /** * Helper which indicates that some bytes were just parsed. This should * only be used (for efficiency sake) if the parse is known to be * observed. - * + * * @param length {@code >= 0;} number of bytes parsed * @param message {@code non-null;} associated message */ @@ -465,7 +465,7 @@ public final class AnnotationParser { /** * Convenience wrapper that simply calls through to * {@code observer.changeIndent()}. - * + * * @param indent the amount to change the indent by */ private void changeIndent(int indent) { diff --git a/dx/src/com/android/dx/cf/direct/AttributeFactory.java b/dx/src/com/android/dx/cf/direct/AttributeFactory.java index d00a85961..f98372c62 100644 --- a/dx/src/com/android/dx/cf/direct/AttributeFactory.java +++ b/dx/src/com/android/dx/cf/direct/AttributeFactory.java @@ -57,7 +57,7 @@ public class AttributeFactory { * indicated position in the given array. This method figures out * the name, and then does all the setup to call on to {@link #parse0}, * which does the actual construction. - * + * * @param cf {@code non-null;} class file to parse from * @param context context to parse in; one of the {@code CTX_*} * constants @@ -96,7 +96,7 @@ public class AttributeFactory { return parse0(cf, context, name.getString(), offset + 6, length, observer); } catch (ParseException ex) { - ex.addContext("...while parsing " + + ex.addContext("...while parsing " + ((name != null) ? (name.toHuman() + " ") : "") + "attribute at offset " + Hex.u4(offset)); throw ex; @@ -107,7 +107,7 @@ public class AttributeFactory { * Parses attribute content. The base class implements this by constructing * an instance of {@link RawAttribute}. Subclasses are expected to * override this to do something better in most cases. - * + * * @param cf {@code non-null;} class file to parse from * @param context context to parse in; one of the {@code CTX_*} * constants diff --git a/dx/src/com/android/dx/cf/direct/ClassPathOpener.java b/dx/src/com/android/dx/cf/direct/ClassPathOpener.java index 927e9bd68..4e8c435f6 100644 --- a/dx/src/com/android/dx/cf/direct/ClassPathOpener.java +++ b/dx/src/com/android/dx/cf/direct/ClassPathOpener.java @@ -207,7 +207,7 @@ public class ClassPathOpener { byte[] buf = new byte[20000]; boolean any = false; - ArrayList<? extends java.util.zip.ZipEntry> entriesList + ArrayList<? extends java.util.zip.ZipEntry> entriesList = Collections.list(zip.entries()); if (sort) { diff --git a/dx/src/com/android/dx/cf/direct/CodeObserver.java b/dx/src/com/android/dx/cf/direct/CodeObserver.java index 952f1bc5e..efcc80ba9 100644 --- a/dx/src/com/android/dx/cf/direct/CodeObserver.java +++ b/dx/src/com/android/dx/cf/direct/CodeObserver.java @@ -47,7 +47,7 @@ public class CodeObserver implements BytecodeArray.Visitor { /** * Constructs an instance. - * + * * @param bytes {@code non-null;} actual array of bytecode * @param observer {@code non-null;} observer to inform of parsing */ @@ -198,7 +198,7 @@ public class CodeObserver implements BytecodeArray.Visitor { /** * Helper to produce the first bit of output for each instruction. - * + * * @param offset the offset to the start of the instruction */ private String header(int offset) { @@ -220,7 +220,7 @@ public class CodeObserver implements BytecodeArray.Visitor { /** * Helper for {@link #visitConstant} where the constant is an * {@code int}. - * + * * @param opcode the opcode * @param offset offset to the instruction * @param length instruction length @@ -247,7 +247,7 @@ public class CodeObserver implements BytecodeArray.Visitor { /** * Helper for {@link #visitConstant} where the constant is a * {@code long}. - * + * * @param opcode the opcode * @param offset offset to the instruction * @param length instruction length @@ -271,7 +271,7 @@ public class CodeObserver implements BytecodeArray.Visitor { /** * Helper for {@link #visitConstant} where the constant is a * {@code float}. - * + * * @param opcode the opcode * @param offset offset to the instruction * @param length instruction length @@ -289,7 +289,7 @@ public class CodeObserver implements BytecodeArray.Visitor { /** * Helper for {@link #visitConstant} where the constant is a * {@code double}. - * + * * @param opcode the opcode * @param offset offset to the instruction * @param length instruction length diff --git a/dx/src/com/android/dx/cf/direct/DirectClassFile.java b/dx/src/com/android/dx/cf/direct/DirectClassFile.java index ac227fadb..b194572d6 100644 --- a/dx/src/com/android/dx/cf/direct/DirectClassFile.java +++ b/dx/src/com/android/dx/cf/direct/DirectClassFile.java @@ -46,18 +46,18 @@ public class DirectClassFile implements ClassFile { /** * minimum {@code .class} file major version - * + * * The class file definition (vmspec/2nd-edition) says: - * + * * "Implementations of version 1.2 of the * Java 2 platform can support class file * formats of versions in the range 45.0 * through 46.0 inclusive." - * + * * The class files generated by the build are currently * (as of 11/2006) reporting version 49.0 (0x31.0x00), * however, so we use that as our upper bound. - * + * * Valid ranges are typically of the form * "A.0 through B.C inclusive" where A <= B and C >= 0, * which is why we don't have a CLASS_FILE_MIN_MINOR_VERSION. @@ -72,7 +72,7 @@ public class DirectClassFile implements ClassFile { /** * {@code non-null;} the file path for the class, excluding any base directory - * specification + * specification */ private final String filePath; @@ -83,19 +83,19 @@ public class DirectClassFile implements ClassFile { * whether to be strict about parsing; if * {@code false}, this avoids doing checks that only exist * for purposes of verification (such as magic number matching and - * path-package consistency checking) + * path-package consistency checking) */ private final boolean strictParse; /** * {@code null-ok;} the constant pool; only ever {@code null} - * before the constant pool is successfully parsed + * before the constant pool is successfully parsed */ private StdConstantPool pool; /** * the class file field {@code access_flags}; will be {@code -1} - * before the file is successfully parsed + * before the file is successfully parsed */ private int accessFlags; @@ -108,33 +108,33 @@ public class DirectClassFile implements ClassFile { /** * {@code null-ok;} the class file field {@code super_class}, interpreted - * as a type constant if non-zero + * as a type constant if non-zero */ private CstType superClass; /** * {@code null-ok;} the class file field {@code interfaces}; only * ever {@code null} before the file is successfully - * parsed + * parsed */ private TypeList interfaces; /** * {@code null-ok;} the class file field {@code fields}; only ever - * {@code null} before the file is successfully parsed + * {@code null} before the file is successfully parsed */ private FieldList fields; /** * {@code null-ok;} the class file field {@code methods}; only ever - * {@code null} before the file is successfully parsed + * {@code null} before the file is successfully parsed */ private MethodList methods; /** * {@code null-ok;} the class file field {@code attributes}; only * ever {@code null} before the file is successfully - * parsed + * parsed */ private StdAttributeList attributes; @@ -147,7 +147,7 @@ public class DirectClassFile implements ClassFile { /** * Returns the string form of an object or {@code "(none)"} * (rather than {@code "null"}) for {@code null}. - * + * * @param obj {@code null-ok;} the object to stringify * @return {@code non-null;} the appropriate string form */ @@ -161,7 +161,7 @@ public class DirectClassFile implements ClassFile { /** * Constructs an instance. - * + * * @param bytes {@code non-null;} the bytes of the file * @param filePath {@code non-null;} the file path for the class, * excluding any base directory specification @@ -188,7 +188,7 @@ public class DirectClassFile implements ClassFile { /** * Constructs an instance. - * + * * @param bytes {@code non-null;} the bytes of the file * @param filePath {@code non-null;} the file path for the class, * excluding any base directory specification @@ -204,7 +204,7 @@ public class DirectClassFile implements ClassFile { /** * Sets the parse observer for this instance. - * + * * @param observer {@code null-ok;} the observer */ public void setObserver(ParseObserver observer) { @@ -213,7 +213,7 @@ public class DirectClassFile implements ClassFile { /** * Sets the attribute factory to use. - * + * * @param attributeFactory {@code non-null;} the attribute factory */ public void setAttributeFactory(AttributeFactory attributeFactory) { @@ -226,7 +226,7 @@ public class DirectClassFile implements ClassFile { /** * Gets the {@link ByteArray} that this instance's data comes from. - * + * * @return {@code non-null;} the bytes */ public ByteArray getBytes() { @@ -318,7 +318,7 @@ public class DirectClassFile implements ClassFile { * translated to type constants. Instance construction will fail * if any of the (alleged) indices turn out not to refer to * constant pool entries of type {@code Class}. - * + * * @param offset offset into {@link #bytes} for the start of the * data * @param size number of elements in the list (not number of bytes) @@ -332,14 +332,14 @@ public class DirectClassFile implements ClassFile { if (pool == null) { throw new IllegalStateException("pool not yet initialized"); } - + return new DcfTypeList(bytes, offset, size, pool, observer); } /** * Gets the class file field {@code magic}, but without doing any * checks or parsing first. - * + * * @return the magic value */ public int getMagic0() { @@ -349,7 +349,7 @@ public class DirectClassFile implements ClassFile { /** * Gets the class file field {@code minor_version}, but * without doing any checks or parsing first. - * + * * @return the minor version */ public int getMinorVersion0() { @@ -359,7 +359,7 @@ public class DirectClassFile implements ClassFile { /** * Gets the class file field {@code major_version}, but * without doing any checks or parsing first. - * + * * @return the major version */ public int getMajorVersion0() { @@ -404,7 +404,7 @@ public class DirectClassFile implements ClassFile { /** * Sees if the .class file header magic/version are within * range. - * + * * @param magic the value of a classfile "magic" field * @param minorVersion the value of a classfile "minor_version" field * @param majorVersion the value of a classfile "major_version" field @@ -479,7 +479,7 @@ public class DirectClassFile implements ClassFile { if (observer != null) { observer.parsed(bytes, at, 2, - "access_flags: " + + "access_flags: " + AccessFlags.classString(accessFlags)); observer.parsed(bytes, at + 2, 2, "this_class: " + thisClass); observer.parsed(bytes, at + 4, 2, "super_class: " + @@ -559,7 +559,7 @@ public class DirectClassFile implements ClassFile { private static class DcfTypeList implements TypeList { /** {@code non-null;} array containing the data */ private final ByteArray bytes; - + /** number of elements in the list (not number of bytes) */ private final int size; @@ -568,7 +568,7 @@ public class DirectClassFile implements ClassFile { /** * Constructs an instance. - * + * * @param bytes {@code non-null;} original classfile's bytes * @param offset offset into {@link #bytes} for the start of the * data @@ -628,6 +628,6 @@ public class DirectClassFile implements ClassFile { /** {@inheritDoc} */ public TypeList withAddedType(Type type) { throw new UnsupportedOperationException("unsupported"); - } + } } } diff --git a/dx/src/com/android/dx/cf/direct/FieldListParser.java b/dx/src/com/android/dx/cf/direct/FieldListParser.java index 24ba7e0e3..2d8280ddc 100644 --- a/dx/src/com/android/dx/cf/direct/FieldListParser.java +++ b/dx/src/com/android/dx/cf/direct/FieldListParser.java @@ -33,7 +33,7 @@ final /*package*/ class FieldListParser extends MemberListParser { /** * Constructs an instance. - * + * * @param cf {@code non-null;} the class file to parse from * @param definer {@code non-null;} class being defined * @param offset offset in {@code bytes} to the start of the list @@ -47,7 +47,7 @@ final /*package*/ class FieldListParser extends MemberListParser { /** * Gets the parsed list. - * + * * @return {@code non-null;} the parsed list */ public StdFieldList getList() { diff --git a/dx/src/com/android/dx/cf/direct/MemberListParser.java b/dx/src/com/android/dx/cf/direct/MemberListParser.java index a0023c658..91a5e1d3e 100644 --- a/dx/src/com/android/dx/cf/direct/MemberListParser.java +++ b/dx/src/com/android/dx/cf/direct/MemberListParser.java @@ -131,7 +131,7 @@ abstract /*package*/ class MemberListParser { /** * Gets the human-oriented name for what this instance is parsing. * Subclasses must override this method. - * + * * @return {@code non-null;} the human oriented name */ protected abstract String humanName(); @@ -148,7 +148,7 @@ abstract /*package*/ class MemberListParser { /** * Gets the {@code CTX_*} constant to use when parsing attributes. * Subclasses must override this method. - * + * * @return {@code non-null;} the human oriented name */ protected abstract int getAttributeContext(); diff --git a/dx/src/com/android/dx/cf/direct/MethodListParser.java b/dx/src/com/android/dx/cf/direct/MethodListParser.java index 6ab1abaad..9e3494e67 100644 --- a/dx/src/com/android/dx/cf/direct/MethodListParser.java +++ b/dx/src/com/android/dx/cf/direct/MethodListParser.java @@ -33,7 +33,7 @@ final /*package*/ class MethodListParser extends MemberListParser { /** * Constructs an instance. - * + * * @param cf {@code non-null;} the class file to parse from * @param definer {@code non-null;} class being defined * @param offset offset in {@code bytes} to the start of the list @@ -47,7 +47,7 @@ final /*package*/ class MethodListParser extends MemberListParser { /** * Gets the parsed list. - * + * * @return {@code non-null;} the parsed list */ public StdMethodList getList() { diff --git a/dx/src/com/android/dx/cf/direct/StdAttributeFactory.java b/dx/src/com/android/dx/cf/direct/StdAttributeFactory.java index da12a4e5a..a6a97af33 100644 --- a/dx/src/com/android/dx/cf/direct/StdAttributeFactory.java +++ b/dx/src/com/android/dx/cf/direct/StdAttributeFactory.java @@ -366,7 +366,7 @@ public class StdAttributeFactory if (observer != null) { observer.parsed(bytes, offset, 2, "class: " + type); - observer.parsed(bytes, offset + 2, 2, "method: " + + observer.parsed(bytes, offset + 2, 2, "method: " + DirectClassFile.stringOrNone(method)); } @@ -439,13 +439,13 @@ public class StdAttributeFactory list.set(i, innerClass, outerClass, name, accessFlags); if (observer != null) { observer.parsed(bytes, offset, 2, - "inner_class: " + + "inner_class: " + DirectClassFile.stringOrNone(innerClass)); observer.parsed(bytes, offset + 2, 2, - " outer_class: " + + " outer_class: " + DirectClassFile.stringOrNone(outerClass)); observer.parsed(bytes, offset + 4, 2, - " name: " + + " name: " + DirectClassFile.stringOrNone(name)); observer.parsed(bytes, offset + 6, 2, " access_flags: " + @@ -548,7 +548,7 @@ public class StdAttributeFactory /** * Parse the table part of either a {@code LocalVariableTable} * or a {@code LocalVariableTypeTable}. - * + * * @param bytes {@code non-null;} bytes to parse, which should <i>only</i> * contain the table data (no header) * @param pool {@code non-null;} constant pool to use @@ -578,13 +578,13 @@ public class StdAttributeFactory CstUtf8 type = (CstUtf8) pool.get(typeIdx); CstUtf8 descriptor = null; CstUtf8 signature = null; - + if (typeTable) { signature = type; } else { descriptor = type; } - + list.set(i, startPc, length, name, descriptor, signature, index); @@ -614,7 +614,7 @@ public class StdAttributeFactory AnnotationParser ap = new AnnotationParser(cf, offset, length, observer); - Annotations annotations = + Annotations annotations = ap.parseAnnotationAttribute(AnnotationVisibility.BUILD); return new AttRuntimeInvisibleAnnotations(annotations, length); @@ -631,7 +631,7 @@ public class StdAttributeFactory AnnotationParser ap = new AnnotationParser(cf, offset, length, observer); - Annotations annotations = + Annotations annotations = ap.parseAnnotationAttribute(AnnotationVisibility.RUNTIME); return new AttRuntimeVisibleAnnotations(annotations, length); @@ -730,7 +730,7 @@ public class StdAttributeFactory /** * Throws the right exception when a known attribute has a way too short * length. - * + * * @return never * @throws ParseException always thrown */ @@ -741,7 +741,7 @@ public class StdAttributeFactory /** * Throws the right exception when a known attribute has a too short * length. - * + * * @return never * @throws ParseException always thrown */ @@ -752,7 +752,7 @@ public class StdAttributeFactory /** * Throws the right exception when an attribute has an unexpected length * (given its contents). - * + * * @param expected expected length * @return never * @throws ParseException always thrown diff --git a/dx/src/com/android/dx/cf/iface/ClassFile.java b/dx/src/com/android/dx/cf/iface/ClassFile.java index e37fec03a..0f584ba65 100644 --- a/dx/src/com/android/dx/cf/iface/ClassFile.java +++ b/dx/src/com/android/dx/cf/iface/ClassFile.java @@ -81,7 +81,7 @@ public interface ClassFile { public ConstantPool getConstantPool(); /** - * Gets the field {@code interfaces} (along with + * Gets the field {@code interfaces} (along with * {@code interfaces_count}). * * @return {@code non-null;} the list of interfaces diff --git a/dx/src/com/android/dx/cf/iface/StdAttributeList.java b/dx/src/com/android/dx/cf/iface/StdAttributeList.java index dd5dfd7a8..287b8c7f3 100644 --- a/dx/src/com/android/dx/cf/iface/StdAttributeList.java +++ b/dx/src/com/android/dx/cf/iface/StdAttributeList.java @@ -26,7 +26,7 @@ public final class StdAttributeList extends FixedSizeList implements AttributeList { /** * Constructs an instance. All indices initially contain {@code null}. - * + * * @param size the size of the list */ public StdAttributeList(int size) { @@ -94,7 +94,7 @@ public final class StdAttributeList extends FixedSizeList /** * Sets the attribute at the given index. - * + * * @param n {@code >= 0, < size();} which attribute * @param attribute {@code null-ok;} the attribute object */ diff --git a/dx/src/com/android/dx/cf/iface/StdField.java b/dx/src/com/android/dx/cf/iface/StdField.java index c3a4da63a..ef9873d6f 100644 --- a/dx/src/com/android/dx/cf/iface/StdField.java +++ b/dx/src/com/android/dx/cf/iface/StdField.java @@ -28,7 +28,7 @@ import com.android.dx.rop.cst.TypedConstant; public final class StdField extends StdMember implements Field { /** * Constructs an instance. - * + * * @param definingClass {@code non-null;} the defining class * @param accessFlags access flags * @param nat {@code non-null;} member name and type (descriptor) diff --git a/dx/src/com/android/dx/cf/iface/StdFieldList.java b/dx/src/com/android/dx/cf/iface/StdFieldList.java index 044d6b78d..f27bd2261 100644 --- a/dx/src/com/android/dx/cf/iface/StdFieldList.java +++ b/dx/src/com/android/dx/cf/iface/StdFieldList.java @@ -25,7 +25,7 @@ import com.android.dx.util.FixedSizeList; public final class StdFieldList extends FixedSizeList implements FieldList { /** * Constructs an instance. All indices initially contain {@code null}. - * + * * @param size the size of the list */ public StdFieldList(int size) { @@ -39,7 +39,7 @@ public final class StdFieldList extends FixedSizeList implements FieldList { /** * Sets the field at the given index. - * + * * @param n {@code >= 0, < size();} which field * @param field {@code null-ok;} the field object */ diff --git a/dx/src/com/android/dx/cf/iface/StdMember.java b/dx/src/com/android/dx/cf/iface/StdMember.java index dfe45c329..9f15585d9 100644 --- a/dx/src/com/android/dx/cf/iface/StdMember.java +++ b/dx/src/com/android/dx/cf/iface/StdMember.java @@ -39,7 +39,7 @@ public abstract class StdMember implements Member { /** * Constructs an instance. - * + * * @param definingClass {@code non-null;} the defining class * @param accessFlags access flags * @param nat {@code non-null;} member name and type (descriptor) diff --git a/dx/src/com/android/dx/cf/iface/StdMethod.java b/dx/src/com/android/dx/cf/iface/StdMethod.java index 15fd6e1fc..c511d7d0a 100644 --- a/dx/src/com/android/dx/cf/iface/StdMethod.java +++ b/dx/src/com/android/dx/cf/iface/StdMethod.java @@ -31,7 +31,7 @@ public final class StdMethod extends StdMember implements Method { /** * Constructs an instance. - * + * * @param definingClass {@code non-null;} the defining class * @param accessFlags access flags * @param nat {@code non-null;} member name and type (descriptor) diff --git a/dx/src/com/android/dx/cf/iface/StdMethodList.java b/dx/src/com/android/dx/cf/iface/StdMethodList.java index 521021ec0..417cdeee1 100644 --- a/dx/src/com/android/dx/cf/iface/StdMethodList.java +++ b/dx/src/com/android/dx/cf/iface/StdMethodList.java @@ -25,7 +25,7 @@ import com.android.dx.util.FixedSizeList; public final class StdMethodList extends FixedSizeList implements MethodList { /** * Constructs an instance. All indices initially contain {@code null}. - * + * * @param size the size of the list */ public StdMethodList(int size) { @@ -39,7 +39,7 @@ public final class StdMethodList extends FixedSizeList implements MethodList { /** * Sets the method at the given index. - * + * * @param n {@code >= 0, < size();} which method * @param method {@code null-ok;} the method object */ diff --git a/dx/src/com/android/dx/command/Main.java b/dx/src/com/android/dx/command/Main.java index 281a83ee3..626cf7a9e 100644 --- a/dx/src/com/android/dx/command/Main.java +++ b/dx/src/com/android/dx/command/Main.java @@ -50,7 +50,7 @@ public class Main { " Dump classfiles, or transformations thereof, in a " + "human-oriented format.\n" + " dx --junit [-wait] <TestClass>\n" + - " Run the indicated unit test.\n" + + " Run the indicated unit test.\n" + " dx -J<option> ... <arguments, in one of the above " + "forms>\n" + " Pass VM-specific options to the virtual machine that " + @@ -60,7 +60,7 @@ public class Main { ").\n" + " dx --help\n" + " Print this message."; - + /** * This class is uninstantiable. */ @@ -117,7 +117,7 @@ public class Main { } catch (Throwable ex) { System.err.println("\nUNEXPECTED TOP-LEVEL ERROR:"); ex.printStackTrace(); - if ((ex instanceof NoClassDefFoundError) + if ((ex instanceof NoClassDefFoundError) || (ex instanceof NoSuchMethodError)) { System.err.println( "Note: You may be using an incompatible " + @@ -126,7 +126,7 @@ public class Main { "with recent releases of GCJ.)"); } System.exit(3); - } + } if (!gotCmd) { System.err.println("error: no command specified"); diff --git a/dx/src/com/android/dx/command/annotool/AnnotationLister.java b/dx/src/com/android/dx/command/annotool/AnnotationLister.java index d3fb27c42..a29e5ba8f 100644 --- a/dx/src/com/android/dx/command/annotool/AnnotationLister.java +++ b/dx/src/com/android/dx/command/annotool/AnnotationLister.java @@ -202,7 +202,7 @@ class AnnotationLister { case CLASS: case INNERCLASS: case METHOD: - matchPackages.add(packageName); + matchPackages.add(packageName); break; case PACKAGE: System.out.println(packageName.replace('/','.')); diff --git a/dx/src/com/android/dx/command/annotool/Main.java b/dx/src/com/android/dx/command/annotool/Main.java index 9fd1ac57a..7661c3d45 100644 --- a/dx/src/com/android/dx/command/annotool/Main.java +++ b/dx/src/com/android/dx/command/annotool/Main.java @@ -39,7 +39,7 @@ public class Main { InvalidArgumentException() { super(); } - + InvalidArgumentException(String s) { super(s); } @@ -49,7 +49,7 @@ public class Main { CLASS, INNERCLASS, METHOD, - PACKAGE + PACKAGE } diff --git a/dx/src/com/android/dx/command/dexer/Main.java b/dx/src/com/android/dx/command/dexer/Main.java index 5a9f41702..8df1beace 100644 --- a/dx/src/com/android/dx/command/dexer/Main.java +++ b/dx/src/com/android/dx/command/dexer/Main.java @@ -244,7 +244,7 @@ public class Main { } }); - return opener.process(); + return opener.process(); } /** @@ -294,7 +294,7 @@ public class Main { if (! args.coreLibrary) { checkClassName(name); } - + try { ClassDefItem clazz = CfTranslator.translate(name, bytes, args.cfOptions); @@ -317,13 +317,13 @@ public class Main { * Check the class name to make sure it's not a "core library" * class. If there is a problem, this updates the error count and * throws an exception to stop processing. - * + * * @param name {@code non-null;} the fully-qualified internal-form * class name */ private static void checkClassName(String name) { boolean bogus = false; - + if (name.startsWith("java/")) { bogus = true; } else if (name.startsWith("javax/")) { @@ -348,7 +348,7 @@ public class Main { */ DxConsole.err.println("\ntrouble processing \"" + name + "\":"); - DxConsole.err.println("\n" + + DxConsole.err.println("\n" + "Attempt to include a core class (java.* or javax.*) in " + "something other\n" + "than a core library. It is likely that you have " + @@ -690,7 +690,7 @@ public class Main { meth.debugPrint(pw, args.verboseDump); /* - * The (default) source file is an attribute of the class, but + * The (default) source file is an attribute of the class, but * it's useful to see it in method dumps. */ CstUtf8 sourceFile = clazz.getSourceFile(); @@ -732,7 +732,7 @@ public class Main { private static class StopProcessing extends RuntimeException { // This space intentionally left blank. } - + /** * Command-line argument parser and access. */ diff --git a/dx/src/com/android/dx/command/dump/BaseDumper.java b/dx/src/com/android/dx/command/dump/BaseDumper.java index d2c1e133a..ad6540b59 100644 --- a/dx/src/com/android/dx/command/dump/BaseDumper.java +++ b/dx/src/com/android/dx/command/dump/BaseDumper.java @@ -48,7 +48,7 @@ public abstract class BaseDumper /** * {@code non-null;} the file path for the class, excluding any base - * directory specification + * directory specification */ private final String filePath; @@ -72,7 +72,7 @@ public abstract class BaseDumper /** * Constructs an instance. - * + * * @param bytes {@code non-null;} bytes of the (alleged) class file * on the left) * @param out {@code non-null;} where to dump to @@ -157,7 +157,7 @@ public abstract class BaseDumper /** * Gets the current dump cursor (that is, the offset of the expected * next byte to dump). - * + * * @return {@code >= 0;} the dump cursor */ protected final int getAt() { @@ -166,7 +166,7 @@ public abstract class BaseDumper /** * Sets the dump cursor to the indicated offset in the given array. - * + * * @param arr {@code non-null;} array in question * @param offset {@code >= 0;} offset into the array */ @@ -176,7 +176,7 @@ public abstract class BaseDumper /** * Gets the array of {@code byte}s to process. - * + * * @return {@code non-null;} the bytes */ protected final byte[] getBytes() { @@ -185,7 +185,7 @@ public abstract class BaseDumper /** * Gets the filesystem/jar path of the file being dumped. - * + * * @return {@code non-null;} the path */ protected final String getFilePath() { @@ -194,7 +194,7 @@ public abstract class BaseDumper /** * Gets whether to be strict about parsing. - * + * * @return whether to be strict about parsing */ protected final boolean getStrictParse() { @@ -203,7 +203,7 @@ public abstract class BaseDumper /** * Prints the given string to this instance's output stream. - * + * * @param s {@code null-ok;} string to print */ protected final void print(String s) { @@ -213,7 +213,7 @@ public abstract class BaseDumper /** * Prints the given string to this instance's output stream, followed * by a newline. - * + * * @param s {@code null-ok;} string to print */ protected final void println(String s) { @@ -222,7 +222,7 @@ public abstract class BaseDumper /** * Gets whether this dump is to include raw bytes. - * + * * @return the raw bytes flag */ protected final boolean getRawBytes() { @@ -232,7 +232,7 @@ public abstract class BaseDumper /** * Gets the width of the first column of output. This is {@code 0} * unless raw bytes are being included in the output. - * + * * @return {@code >= 0;} the width of the first column */ protected final int getWidth1() { @@ -245,7 +245,7 @@ public abstract class BaseDumper /** * Gets the width of the second column of output. - * + * * @return {@code >= 0;} the width of the second column */ protected final int getWidth2() { @@ -255,7 +255,7 @@ public abstract class BaseDumper /** * Constructs a hex data dump of the given portion of {@link #bytes}. - * + * * @param offset offset to start dumping at * @param len length to dump * @return {@code non-null;} the dump @@ -267,7 +267,7 @@ public abstract class BaseDumper /** * Combines a pair of strings as two columns, or if this is one-column * output, format the otherwise-second column. - * + * * @param s1 {@code non-null;} the first column's string * @param s2 {@code non-null;} the second column's string * @return {@code non-null;} the combined output diff --git a/dx/src/com/android/dx/command/dump/BlockDumper.java b/dx/src/com/android/dx/command/dump/BlockDumper.java index 0858eabba..7a118881d 100644 --- a/dx/src/com/android/dx/command/dump/BlockDumper.java +++ b/dx/src/com/android/dx/command/dump/BlockDumper.java @@ -55,7 +55,7 @@ public class BlockDumper /** * {@code null-ok;} the class file object being constructed; - * becomes non-null during {@link #dump} + * becomes non-null during {@link #dump} */ protected DirectClassFile classFile; @@ -71,7 +71,7 @@ public class BlockDumper /** * Dumps the given array, interpreting it as a class file and dumping * methods with indications of block-level stuff. - * + * * @param bytes {@code non-null;} bytes of the (alleged) class file * @param out {@code non-null;} where to dump to * @param filePath the file path for the class, excluding any base @@ -189,7 +189,7 @@ public class BlockDumper if (!shouldDumpMethod(name)) { return; } - + ConcreteMethod meth = new ConcreteMethod((Method) member, classFile, true, true); @@ -202,7 +202,7 @@ public class BlockDumper /** * Does a regular basic block dump. - * + * * @param meth {@code non-null;} method data to dump */ private void regularDump(ConcreteMethod meth) { @@ -257,7 +257,7 @@ public class BlockDumper CstType exceptionClass = one.getExceptionClass(); parsed(bytes, end, 0, "catch " + - ((exceptionClass == CstType.OBJECT) ? "<any>" : + ((exceptionClass == CstType.OBJECT) ? "<any>" : exceptionClass.toHuman()) + " -> " + Hex.u2(one.getHandlerPc())); } @@ -277,7 +277,7 @@ public class BlockDumper /** * Does a registerizing dump. - * + * * @param meth {@code non-null;} method data to dump */ private void ropDump(ConcreteMethod meth) { diff --git a/dx/src/com/android/dx/command/dump/SsaDumper.java b/dx/src/com/android/dx/command/dump/SsaDumper.java index e5e9d97db..de44c8327 100644 --- a/dx/src/com/android/dx/command/dump/SsaDumper.java +++ b/dx/src/com/android/dx/command/dump/SsaDumper.java @@ -51,7 +51,7 @@ import java.util.EnumSet; public class SsaDumper extends BlockDumper { /** * Does the dump. - * + * * @param bytes {@code non-null;} bytes of the original class file * @param out {@code non-null;} where to dump to * @param filePath the file path for the class, excluding any base @@ -66,7 +66,7 @@ public class SsaDumper extends BlockDumper { /** * Constructs an instance. - * + * * @param bytes {@code non-null;} bytes of the original class file * @param out {@code non-null;} where to dump to * @param filePath the file path for the class, excluding any base @@ -124,10 +124,10 @@ public class SsaDumper extends BlockDumper { sb.append('\n'); ArrayList<SsaBasicBlock> blocks = ssaMeth.getBlocks(); - ArrayList<SsaBasicBlock> sortedBlocks = + ArrayList<SsaBasicBlock> sortedBlocks = (ArrayList<SsaBasicBlock>) blocks.clone(); Collections.sort(sortedBlocks, SsaBasicBlock.LABEL_COMPARATOR); - + for (SsaBasicBlock block : sortedBlocks) { sb.append("block ") .append(Hex.u2(block.getRopLabel())).append('\n'); @@ -164,7 +164,7 @@ public class SsaDumper extends BlockDumper { sb.append(Hex.u2(succLabelList.get(i))); if (szSuccLabels != 1 && primary == succLabelList.get(i)) { - sb.append(" *"); + sb.append(" *"); } sb.append('\n'); } diff --git a/dx/src/com/android/dx/dex/cf/AttributeTranslator.java b/dx/src/com/android/dx/dex/cf/AttributeTranslator.java index cdd29d73d..d021a7c36 100644 --- a/dx/src/com/android/dx/dex/cf/AttributeTranslator.java +++ b/dx/src/com/android/dx/dex/cf/AttributeTranslator.java @@ -84,7 +84,7 @@ import java.util.ArrayList; * combines both visible and invisible annotations into a single * result set and also adds in a system annotation for the * {@code Signature} attribute if present. - * + * * @param attribs {@code non-null;} the attributes list to search in * @return {@code non-null;} the set of annotations, which may be empty */ @@ -107,7 +107,7 @@ import java.util.ArrayList; * class is an annotation class, then this also includes a * representation of all the {@code AnnotationDefault} * values. - * + * * @param cf {@code non-null;} the class in question * @param args {@code non-null;} the high-level options * @return {@code non-null;} the set of annotations, which may be empty @@ -149,7 +149,7 @@ import java.util.ArrayList; * Gets the annotations out of a given method, similar to {@link * #getAnnotations}, also including an annotation for the translation * of the method-specific attribute {@code Exceptions}. - * + * * @param method {@code non-null;} the method in question * @return {@code non-null;} the set of annotations, which may be empty */ @@ -158,18 +158,18 @@ import java.util.ArrayList; TypeList exceptions = getExceptions(method); if (exceptions.size() != 0) { - Annotation throwsAnnotation = + Annotation throwsAnnotation = AnnotationUtils.makeThrows(exceptions); result = Annotations.combine(result, throwsAnnotation); } return result; } - + /** * Helper method for {@link #getAnnotations} which just gets the * existing annotations, per se. - * + * * @param attribs {@code non-null;} the attributes list to search in * @return {@code non-null;} the set of annotations, which may be empty */ @@ -201,7 +201,7 @@ import java.util.ArrayList; /** * Gets the {@code Signature} attribute out of a given * {@link AttributeList}, if any, translating it to an annotation. - * + * * @param attribs {@code non-null;} the attributes list to search in * @return {@code null-ok;} the converted {@code Signature} annotation, * if there was an attribute to translate @@ -223,7 +223,7 @@ import java.util.ArrayList; * If the class really has an enclosing method, this returns an * {@code EnclosingMethod} annotation; if not, this returns * an {@code EnclosingClass} annotation. - * + * * @param attribs {@code non-null;} the attributes list to search in * @return {@code null-ok;} the converted {@code EnclosingMethod} or * {@code EnclosingClass} annotation, if there was an @@ -260,7 +260,7 @@ import java.util.ArrayList; * {@link AttributeList}, if any, translating it to one or more of an * {@code InnerClass}, {@code EnclosingClass}, or * {@code MemberClasses} annotation. - * + * * @param thisClass {@code non-null;} type representing the class being processed * @param attribs {@code non-null;} the attributes list to search in * @param needEnclosingClass whether to include an @@ -298,7 +298,7 @@ import java.util.ArrayList; } int membersSize = membersList.size(); - + if ((foundThisClass == null) && (membersSize == 0)) { return null; } @@ -341,7 +341,7 @@ import java.util.ArrayList; * Gets the parameter annotations out of a given method. This * combines both visible and invisible annotations into a single * result set. - * + * * @param method {@code non-null;} the method in question * @return {@code non-null;} the list of annotation sets, which may be empty */ @@ -377,7 +377,7 @@ import java.util.ArrayList; * Gets the {@code AnnotationDefault} attributes out of a * given class, if any, reforming them as an * {@code AnnotationDefault} annotation. - * + * * @param cf {@code non-null;} the class in question * @return {@code null-ok;} an appropriately-constructed * {@code AnnotationDefault} annotation, if there were any diff --git a/dx/src/com/android/dx/dex/cf/CfOptions.java b/dx/src/com/android/dx/dex/cf/CfOptions.java index 8726223f1..468f0bec1 100644 --- a/dx/src/com/android/dx/dex/cf/CfOptions.java +++ b/dx/src/com/android/dx/dex/cf/CfOptions.java @@ -32,7 +32,7 @@ public class CfOptions { /** whether strict file-name-vs-class-name checking should be done */ public boolean strictNameCheck = true; - + /** whether to do SSA/register optimization */ public boolean optimize = false; diff --git a/dx/src/com/android/dx/dex/cf/CfTranslator.java b/dx/src/com/android/dx/dex/cf/CfTranslator.java index 8210e907b..1a9aa4717 100644 --- a/dx/src/com/android/dx/dex/cf/CfTranslator.java +++ b/dx/src/com/android/dx/dex/cf/CfTranslator.java @@ -126,7 +126,7 @@ public class CfTranslator { if (classAnnotations.size() != 0) { out.setClassAnnotations(classAnnotations); } - + processFields(cf, out); processMethods(cf, args, out); @@ -162,7 +162,7 @@ public class CfTranslator { out.addInstanceField(fi); } - Annotations annotations = + Annotations annotations = AttributeTranslator.getAnnotations(one.getAttributes()); if (annotations.size() != 0) { out.addFieldAnnotations(field, annotations); @@ -178,7 +178,7 @@ public class CfTranslator { /** * Helper for {@link #processFields}, which translates constants into * more specific types if necessary. - * + * * @param constant {@code non-null;} the constant in question * @param type {@code non-null;} the desired type */ @@ -254,8 +254,8 @@ public class CfTranslator { int paramSize; paramSize = meth.getParameterWordCount(isStatic); - - String canonicalName + + String canonicalName = thisClass.getClassType().getDescriptor() + "." + one.getName().getString(); @@ -307,7 +307,7 @@ public class CfTranslator { accessFlags &= ~AccessFlags.ACC_SYNCHRONIZED; } } - + if (isConstructor) { accessFlags |= AccessFlags.ACC_CONSTRUCTOR; } @@ -323,13 +323,13 @@ public class CfTranslator { out.addVirtualMethod(mi); } - Annotations annotations = + Annotations annotations = AttributeTranslator.getMethodAnnotations(one); if (annotations.size() != 0) { out.addMethodAnnotations(meth, annotations); } - AnnotationsList list = + AnnotationsList list = AttributeTranslator.getParameterAnnotations(one); if (list.size() != 0) { out.addParameterAnnotations(meth, list); @@ -366,7 +366,7 @@ public class CfTranslator { * for the current purpose. */ - DalvCode.AssignIndicesCallback callback = + DalvCode.AssignIndicesCallback callback = new DalvCode.AssignIndicesCallback() { public int getIndex(Constant cst) { // Everything is at index 0! diff --git a/dx/src/com/android/dx/dex/cf/CodeStatistics.java b/dx/src/com/android/dx/dex/cf/CodeStatistics.java index b692d77eb..33d03fded 100644 --- a/dx/src/com/android/dx/dex/cf/CodeStatistics.java +++ b/dx/src/com/android/dx/dex/cf/CodeStatistics.java @@ -75,7 +75,7 @@ public final class CodeStatistics { /** * Updates the number of original bytecode bytes processed. - * + * * @param count {@code >= 0;} the number of bytes to add */ public static void updateOriginalByteCount(int count) { @@ -84,7 +84,7 @@ public final class CodeStatistics { /** * Updates the dex statistics. - * + * * @param nonOptCode non-optimized code block * @param code optimized code block */ @@ -145,7 +145,7 @@ public final class CodeStatistics { /** * Prints out the collected statistics. - * + * * @param out {@code non-null;} where to output to */ public static void dumpStatistics(PrintStream out) { diff --git a/dx/src/com/android/dx/dex/cf/OptimizerOptions.java b/dx/src/com/android/dx/dex/cf/OptimizerOptions.java index fa606e34b..a66421e76 100644 --- a/dx/src/com/android/dx/dex/cf/OptimizerOptions.java +++ b/dx/src/com/android/dx/dex/cf/OptimizerOptions.java @@ -56,7 +56,7 @@ public class OptimizerOptions { /** * Loads the optimize/don't optimize lists from files. - * + * * @param optimizeListFile Pathname * @param dontOptimizeListFile Pathname */ @@ -89,7 +89,7 @@ public class OptimizerOptions { /** * Loads a list of newline-separated strings into a new HashSet and returns * the HashSet. - * + * * @param filename filename to process * @return set of all unique lines in the file */ diff --git a/dx/src/com/android/dx/dex/code/ArrayData.java b/dx/src/com/android/dx/dex/code/ArrayData.java index 7698de1ad..145f2c223 100644 --- a/dx/src/com/android/dx/dex/code/ArrayData.java +++ b/dx/src/com/android/dx/dex/code/ArrayData.java @@ -25,12 +25,12 @@ import com.android.dx.rop.type.Type; import java.util.ArrayList; /** - * Pseudo-instruction which holds fill array data. + * Pseudo-instruction which holds fill array data. */ public final class ArrayData extends VariableSizeInsn { /** * {@code non-null;} address representing the instruction that uses this - * instance + * instance */ private final CodeAddress user; @@ -49,7 +49,7 @@ public final class ArrayData extends VariableSizeInsn { /** * Constructs an instance. The output address of this instance is initially * unknown ({@code -1}). - * + * * @param position {@code non-null;} source position * @param user {@code non-null;} address representing the instruction that * uses this instance diff --git a/dx/src/com/android/dx/dex/code/BlockAddresses.java b/dx/src/com/android/dx/dex/code/BlockAddresses.java index e55f89379..1a1d184ff 100644 --- a/dx/src/com/android/dx/dex/code/BlockAddresses.java +++ b/dx/src/com/android/dx/dex/code/BlockAddresses.java @@ -59,7 +59,7 @@ public final class BlockAddresses { /** * Gets the instance for the start of the given block. - * + * * @param block {@code non-null;} the block in question * @return {@code non-null;} the appropriate instance */ @@ -69,7 +69,7 @@ public final class BlockAddresses { /** * Gets the instance for the start of the block with the given label. - * + * * @param label {@code non-null;} the label of the block in question * @return {@code non-null;} the appropriate instance */ @@ -79,7 +79,7 @@ public final class BlockAddresses { /** * Gets the instance for the final instruction of the given block. - * + * * @param block {@code non-null;} the block in question * @return {@code non-null;} the appropriate instance */ @@ -90,7 +90,7 @@ public final class BlockAddresses { /** * Gets the instance for the final instruction of the block with * the given label. - * + * * @param label {@code non-null;} the label of the block in question * @return {@code non-null;} the appropriate instance */ @@ -101,7 +101,7 @@ public final class BlockAddresses { /** * Gets the instance for the end (address after the final instruction) * of the given block. - * + * * @param block {@code non-null;} the block in question * @return {@code non-null;} the appropriate instance */ @@ -112,7 +112,7 @@ public final class BlockAddresses { /** * Gets the instance for the end (address after the final instruction) * of the block with the given label. - * + * * @param label {@code non-null;} the label of the block in question * @return {@code non-null;} the appropriate instance */ diff --git a/dx/src/com/android/dx/dex/code/CatchBuilder.java b/dx/src/com/android/dx/dex/code/CatchBuilder.java index d2ec3d74f..90d2e8d7c 100644 --- a/dx/src/com/android/dx/dex/code/CatchBuilder.java +++ b/dx/src/com/android/dx/dex/code/CatchBuilder.java @@ -26,7 +26,7 @@ import java.util.HashSet; public interface CatchBuilder { /** * Builds and returns the catch table for this instance. - * + * * @return {@code non-null;} the constructed table */ public CatchTable build(); @@ -34,14 +34,14 @@ public interface CatchBuilder { /** * Gets whether this instance has any catches at all (either typed * or catch-all). - * + * * @return whether this instance has any catches at all */ public boolean hasAnyCatches(); - + /** * Gets the set of catch types associated with this instance. - * + * * @return {@code non-null;} the set of catch types */ public HashSet<Type> getCatchTypes(); diff --git a/dx/src/com/android/dx/dex/code/CatchHandlerList.java b/dx/src/com/android/dx/dex/code/CatchHandlerList.java index a8a97be20..84725849d 100644 --- a/dx/src/com/android/dx/dex/code/CatchHandlerList.java +++ b/dx/src/com/android/dx/dex/code/CatchHandlerList.java @@ -57,7 +57,7 @@ public final class CatchHandlerList extends FixedSizeList /** * Get the human form of this instance, prefixed on each line * with the string. - * + * * @param prefix {@code non-null;} the prefix for every line * @param header {@code non-null;} the header for the first line (after the * first prefix) @@ -85,7 +85,7 @@ public final class CatchHandlerList extends FixedSizeList } else { sb.append(entry.getExceptionType().toHuman()); } - + sb.append(" -> "); sb.append(Hex.u2or4(entry.getHandler())); } @@ -96,7 +96,7 @@ public final class CatchHandlerList extends FixedSizeList /** * Returns whether or not this instance ends with a "catch-all" * handler. - * + * * @return {@code true} if this instance ends with a "catch-all" * handler or {@code false} if not */ @@ -205,7 +205,7 @@ public final class CatchHandlerList extends FixedSizeList return false; } - + /** {@inheritDoc} */ public int compareTo(Entry other) { if (handler < other.handler) { @@ -216,10 +216,10 @@ public final class CatchHandlerList extends FixedSizeList return exceptionType.compareTo(other.exceptionType); } - + /** * Gets the exception type handled. - * + * * @return {@code non-null;} the exception type */ public CstType getExceptionType() { @@ -228,7 +228,7 @@ public final class CatchHandlerList extends FixedSizeList /** * Gets the handler address. - * + * * @return {@code >= 0;} the handler address */ public int getHandler() { diff --git a/dx/src/com/android/dx/dex/code/CatchTable.java b/dx/src/com/android/dx/dex/code/CatchTable.java index fd8e3a7fa..0ee890f85 100644 --- a/dx/src/com/android/dx/dex/code/CatchTable.java +++ b/dx/src/com/android/dx/dex/code/CatchTable.java @@ -105,7 +105,7 @@ public final class CatchTable extends FixedSizeList /** * Constructs an instance. * - * @param start {@code >= 0;} start address + * @param start {@code >= 0;} start address * @param end {@code > start;} end address (exclusive) * @param handlers {@code non-null;} list of catch handlers */ @@ -144,7 +144,7 @@ public final class CatchTable extends FixedSizeList return false; } - + /** {@inheritDoc} */ public int compareTo(Entry other) { if (start < other.start) { @@ -152,7 +152,7 @@ public final class CatchTable extends FixedSizeList } else if (start > other.start) { return 1; } - + if (end < other.end) { return -1; } else if (end > other.end) { @@ -161,10 +161,10 @@ public final class CatchTable extends FixedSizeList return handlers.compareTo(other.handlers); } - + /** * Gets the start address. - * + * * @return {@code >= 0;} the start address */ public int getStart() { @@ -173,7 +173,7 @@ public final class CatchTable extends FixedSizeList /** * Gets the end address (exclusive). - * + * * @return {@code > start;} the end address (exclusive) */ public int getEnd() { @@ -182,7 +182,7 @@ public final class CatchTable extends FixedSizeList /** * Gets the handlers. - * + * * @return {@code non-null;} the handlers */ public CatchHandlerList getHandlers() { diff --git a/dx/src/com/android/dx/dex/code/CodeAddress.java b/dx/src/com/android/dx/dex/code/CodeAddress.java index f25718e14..5d26bd1ca 100644 --- a/dx/src/com/android/dx/dex/code/CodeAddress.java +++ b/dx/src/com/android/dx/dex/code/CodeAddress.java @@ -30,7 +30,7 @@ public final class CodeAddress extends ZeroSizeInsn { /** * Constructs an instance. The output address of this instance is initially * unknown ({@code -1}). - * + * * @param position {@code non-null;} source position */ public CodeAddress(SourcePosition position) { diff --git a/dx/src/com/android/dx/dex/code/CstInsn.java b/dx/src/com/android/dx/dex/code/CstInsn.java index a579c5ec8..3f848c0a5 100644 --- a/dx/src/com/android/dx/dex/code/CstInsn.java +++ b/dx/src/com/android/dx/dex/code/CstInsn.java @@ -30,20 +30,20 @@ public final class CstInsn extends FixedSizeInsn { /** * {@code >= -1;} the constant pool index for {@link #constant}, or - * {@code -1} if not yet set + * {@code -1} if not yet set */ private int index; /** * {@code >= -1;} the constant pool index for the class reference in - * {@link #constant} if any, or {@code -1} if not yet set + * {@link #constant} if any, or {@code -1} if not yet set */ private int classIndex; /** * Constructs an instance. The output address of this instance is * initially unknown ({@code -1}) as is the constant pool index. - * + * * @param opcode the opcode; one of the constants from {@link Dops} * @param position {@code non-null;} source position * @param registers {@code non-null;} register list, including a @@ -67,13 +67,13 @@ public final class CstInsn extends FixedSizeInsn { /** {@inheritDoc} */ @Override public DalvInsn withOpcode(Dop opcode) { - CstInsn result = + CstInsn result = new CstInsn(opcode, getPosition(), getRegisters(), constant); if (index >= 0) { result.setIndex(index); } - + if (classIndex >= 0) { result.setClassIndex(classIndex); } @@ -90,7 +90,7 @@ public final class CstInsn extends FixedSizeInsn { if (index >= 0) { result.setIndex(index); } - + if (classIndex >= 0) { result.setClassIndex(classIndex); } @@ -100,7 +100,7 @@ public final class CstInsn extends FixedSizeInsn { /** * Gets the constant argument. - * + * * @return {@code non-null;} the constant argument */ public Constant getConstant() { @@ -110,7 +110,7 @@ public final class CstInsn extends FixedSizeInsn { /** * Gets the constant's index. It is only valid to call this after * {@link #setIndex} has been called. - * + * * @return {@code >= 0;} the constant pool index */ public int getIndex() { @@ -123,9 +123,9 @@ public final class CstInsn extends FixedSizeInsn { /** * Returns whether the constant's index has been set for this instance. - * + * * @see #setIndex - * + * * @return {@code true} iff the index has been set */ public boolean hasIndex() { @@ -135,7 +135,7 @@ public final class CstInsn extends FixedSizeInsn { /** * Sets the constant's index. It is only valid to call this method once * per instance. - * + * * @param index {@code >= 0;} the constant pool index */ public void setIndex(int index) { @@ -153,7 +153,7 @@ public final class CstInsn extends FixedSizeInsn { /** * Gets the constant's class index. It is only valid to call this after * {@link #setClassIndex} has been called. - * + * * @return {@code >= 0;} the constant's class's constant pool index */ public int getClassIndex() { @@ -167,9 +167,9 @@ public final class CstInsn extends FixedSizeInsn { /** * Returns whether the constant's class index has been set for this * instance. - * + * * @see #setClassIndex - * + * * @return {@code true} iff the index has been set */ public boolean hasClassIndex() { @@ -182,7 +182,7 @@ public final class CstInsn extends FixedSizeInsn { * reference constants have a class, so it is only on instances * with reference constants that this method should ever be * called. It is only valid to call this method once per instance. - * + * * @param index {@code >= 0;} the constant's class's constant pool index */ public void setClassIndex(int index) { diff --git a/dx/src/com/android/dx/dex/code/DalvCode.java b/dx/src/com/android/dx/dex/code/DalvCode.java index f91191291..58f191b56 100644 --- a/dx/src/com/android/dx/dex/code/DalvCode.java +++ b/dx/src/com/android/dx/dex/code/DalvCode.java @@ -28,7 +28,7 @@ import java.util.HashSet; public final class DalvCode { /** * how much position info to preserve; one of the static - * constants in {@link PositionList} + * constants in {@link PositionList} */ private final int positionInfo; @@ -46,13 +46,13 @@ public final class DalvCode { /** * {@code null-ok;} catch table; set in - * {@link #finishProcessingIfNecessary} + * {@link #finishProcessingIfNecessary} */ private CatchTable catches; /** * {@code null-ok;} source positions list; set in - * {@link #finishProcessingIfNecessary} + * {@link #finishProcessingIfNecessary} */ private PositionList positions; @@ -119,16 +119,16 @@ public final class DalvCode { * Assign indices in all instructions that need them, using the * given callback to perform lookups. This must be called before * {@link #getInsns}. - * + * * @param callback {@code non-null;} callback object */ public void assignIndices(AssignIndicesCallback callback) { unprocessedInsns.assignIndices(callback); } - + /** * Gets whether this instance has any position data to represent. - * + * * @return {@code true} iff this instance has any position * data to represent */ @@ -136,10 +136,10 @@ public final class DalvCode { return (positionInfo != PositionList.NONE) && unprocessedInsns.hasAnyPositionInfo(); } - + /** * Gets whether this instance has any local variable data to represent. - * + * * @return {@code true} iff this instance has any local variable * data to represent */ @@ -150,16 +150,16 @@ public final class DalvCode { /** * Gets whether this instance has any catches at all (either typed * or catch-all). - * + * * @return whether this instance has any catches at all */ public boolean hasAnyCatches() { return unprocessedCatches.hasAnyCatches(); } - + /** * Gets the set of catch types handled anywhere in the code. - * + * * @return {@code non-null;} the set of catch types */ public HashSet<Type> getCatchTypes() { @@ -169,7 +169,7 @@ public final class DalvCode { /** * Gets the set of all constants referred to by instructions in * the code. - * + * * @return {@code non-null;} the set of constants */ public HashSet<Constant> getInsnConstants() { @@ -178,7 +178,7 @@ public final class DalvCode { /** * Gets the list of instructions. - * + * * @return {@code non-null;} the instruction list */ public DalvInsnList getInsns() { @@ -188,7 +188,7 @@ public final class DalvCode { /** * Gets the catch (exception handler) table. - * + * * @return {@code non-null;} the catch table */ public CatchTable getCatches() { @@ -198,7 +198,7 @@ public final class DalvCode { /** * Gets the source positions list. - * + * * @return {@code non-null;} the source positions list */ public PositionList getPositions() { @@ -208,7 +208,7 @@ public final class DalvCode { /** * Gets the source positions list. - * + * * @return {@code non-null;} the source positions list */ public LocalList getLocals() { @@ -222,7 +222,7 @@ public final class DalvCode { public static interface AssignIndicesCallback { /** * Gets the index for the given constant. - * + * * @param cst {@code non-null;} the constant * @return {@code >= -1;} the index or {@code -1} if the constant * shouldn't actually be reified with an index diff --git a/dx/src/com/android/dx/dex/code/DalvInsn.java b/dx/src/com/android/dx/dex/code/DalvInsn.java index 11ee55d5d..f20381773 100644 --- a/dx/src/com/android/dx/dex/code/DalvInsn.java +++ b/dx/src/com/android/dx/dex/code/DalvInsn.java @@ -29,7 +29,7 @@ import com.android.dx.util.TwoColumnOutput; public abstract class DalvInsn { /** * the actual output address of this instance, if known, or - * {@code -1} if not + * {@code -1} if not */ private int address; @@ -44,7 +44,7 @@ public abstract class DalvInsn { /** * Makes a move instruction, appropriate and ideal for the given arguments. - * + * * @param position {@code non-null;} source position information * @param dest {@code non-null;} destination register * @param src {@code non-null;} source register @@ -76,13 +76,13 @@ public abstract class DalvInsn { /** * Constructs an instance. The output address of this instance is initially * unknown ({@code -1}). - * + * * <p><b>Note:</b> In the unlikely event that an instruction takes * absolutely no registers (e.g., a {@code nop} or a * no-argument no-result static method call), then the given * register list may be passed as {@link * RegisterSpecList#EMPTY}.</p> - * + * * @param opcode the opcode; one of the constants from {@link Dops} * @param position {@code non-null;} source position * @param registers {@code non-null;} register list, including a @@ -141,7 +141,7 @@ public abstract class DalvInsn { /** * Gets whether the address of this instruction is known. - * + * * @see #getAddress * @see #setAddress */ @@ -152,9 +152,9 @@ public abstract class DalvInsn { /** * Gets the output address of this instruction, if it is known. This throws * a {@code RuntimeException} if it has not yet been set. - * + * * @see #setAddress - * + * * @return {@code >= 0;} the output address */ public final int getAddress() { @@ -167,7 +167,7 @@ public abstract class DalvInsn { /** * Gets the opcode. - * + * * @return {@code non-null;} the opcode */ public final Dop getOpcode() { @@ -176,7 +176,7 @@ public abstract class DalvInsn { /** * Gets the source position. - * + * * @return {@code non-null;} the source position */ public final SourcePosition getPosition() { @@ -185,7 +185,7 @@ public abstract class DalvInsn { /** * Gets the register list for this instruction. - * + * * @return {@code non-null;} the registers */ public final RegisterSpecList getRegisters() { @@ -196,7 +196,7 @@ public abstract class DalvInsn { * Returns whether this instance's opcode uses a result register. * This method is a convenient shorthand for * {@code getOpcode().hasResult()}. - * + * * @return {@code true} iff this opcode uses a result register */ public final boolean hasResult() { @@ -209,7 +209,7 @@ public abstract class DalvInsn { * sources (if any), that each source register is unique, and that * (to be explicit here) category-2 values take up two consecutive * registers. - * + * * @return {@code >= 0;} the minimum distinct register requirement */ public final int getMinimumRegisterRequirement() { @@ -228,9 +228,9 @@ public abstract class DalvInsn { /** * Gets the instruction prefix required, if any, to use in a high * register transformed version of this instance. - * + * * @see #hrVersion - * + * * @return {@code null-ok;} the prefix, if any */ public DalvInsn hrPrefix() { @@ -252,9 +252,9 @@ public abstract class DalvInsn { /** * Gets the instruction suffix required, if any, to use in a high * register transformed version of this instance. - * + * * @see #hrVersion - * + * * @return {@code null-ok;} the suffix, if any */ public DalvInsn hrSuffix() { @@ -276,11 +276,11 @@ public abstract class DalvInsn { * instance, and it is guaranteed that the number of low registers * used will be the number returned by {@link * #getMinimumRegisterRequirement}. - * + * * @return {@code non-null;} the replacement */ public DalvInsn hrVersion() { - RegisterSpecList regs = + RegisterSpecList regs = registers.withSequentialRegisters(0, hasResult()); return withRegisters(regs); } @@ -288,7 +288,7 @@ public abstract class DalvInsn { /** * Gets the short identifier for this instruction. This is its * address, if assigned, or its identity hashcode if not. - * + * * @return {@code non-null;} the identifier */ public final String identifierString() { @@ -303,7 +303,7 @@ public abstract class DalvInsn { * Returns the string form of this instance suitable for inclusion in * a human-oriented listing dump. This method will return {@code null} * if this instance should not appear in a listing. - * + * * @param prefix {@code non-null;} prefix before the address; each follow-on * line will be indented to match as well * @param width {@code >= 0;} the width of the output or {@code 0} for @@ -330,7 +330,7 @@ public abstract class DalvInsn { /** * Sets the output address. - * + * * @param address {@code >= 0;} the output address */ public final void setAddress(int address) { @@ -346,7 +346,7 @@ public abstract class DalvInsn { * calculable if this instance's address is known, and it is equal * to the address plus the length of the instruction format of this * instance's opcode. - * + * * @return {@code >= 0;} the next address */ public final int getNextAddress() { @@ -355,7 +355,7 @@ public abstract class DalvInsn { /** * Gets the size of this instruction, in 16-bit code units. - * + * * @return {@code >= 0;} the code size of this instruction */ public abstract int codeSize(); @@ -363,7 +363,7 @@ public abstract class DalvInsn { /** * Writes this instance to the given output. This method should * never annotate the output. - * + * * @param out {@code non-null;} where to write to */ public abstract void writeTo(AnnotatedOutput out); @@ -371,7 +371,7 @@ public abstract class DalvInsn { /** * Returns an instance that is just like this one, except that its * opcode is replaced by the one given, and its address is reset. - * + * * @param opcode {@code non-null;} the new opcode * @return {@code non-null;} an appropriately-constructed instance */ @@ -381,7 +381,7 @@ public abstract class DalvInsn { * Returns an instance that is just like this one, except that all * register references have been offset by the given delta, and its * address is reset. - * + * * @param delta the amount to offset register references by * @return {@code non-null;} an appropriately-constructed instance */ @@ -391,7 +391,7 @@ public abstract class DalvInsn { * Returns an instance that is just like this one, except that the * register list is replaced by the given one, and its address is * reset. - * + * * @param registers {@code non-null;} new register list * @return {@code non-null;} an appropriately-constructed instance */ @@ -400,7 +400,7 @@ public abstract class DalvInsn { /** * Gets the string form for any arguments to this instance. Subclasses * must override this. - * + * * @return {@code null-ok;} the string version of any arguments or * {@code null} if there are none */ @@ -413,7 +413,7 @@ public abstract class DalvInsn { * address and without respect for any output formatting. This * method should return {@code null} if this instance should * not appear in a listing. - * + * * @param noteIndices whether to include an explicit notation of * constant pool indices * @return {@code null-ok;} the listing string diff --git a/dx/src/com/android/dx/dex/code/DalvInsnList.java b/dx/src/com/android/dx/dex/code/DalvInsnList.java index 5cf22f250..0f8c23d99 100644 --- a/dx/src/com/android/dx/dex/code/DalvInsnList.java +++ b/dx/src/com/android/dx/dex/code/DalvInsnList.java @@ -45,7 +45,7 @@ public final class DalvInsnList extends FixedSizeList { /** * Constructs and returns an immutable instance whose elements are * identical to the ones in the given list, in the same order. - * + * * @param list {@code non-null;} the list to use for elements * @param regCount count, in register-units, of the number of registers * this code block requires. @@ -64,10 +64,10 @@ public final class DalvInsnList extends FixedSizeList { result.setImmutable(); return result; } - + /** * Constructs an instance. All indices initially contain {@code null}. - * + * * @param size the size of the list */ public DalvInsnList(int size, int regCount) { @@ -79,7 +79,7 @@ public final class DalvInsnList extends FixedSizeList { * Gets the element at the given index. It is an error to call * this with the index for an element which was never set; if you * do that, this will throw {@code NullPointerException}. - * + * * @param n {@code >= 0, < size();} which index * @return {@code non-null;} element at that index */ @@ -89,7 +89,7 @@ public final class DalvInsnList extends FixedSizeList { /** * Sets the instruction at the given index. - * + * * @param n {@code >= 0, < size();} which index * @param insn {@code non-null;} the instruction to set at {@code n} */ @@ -101,7 +101,7 @@ public final class DalvInsnList extends FixedSizeList { * Gets the size of this instance, in 16-bit code units. This will only * return a meaningful result if the instructions in this instance all * have valid addresses. - * + * * @return {@code >= 0;} the size */ public int codeSize() { @@ -118,7 +118,7 @@ public final class DalvInsnList extends FixedSizeList { /** * Writes all the instructions in this instance to the given output * destination. - * + * * @param out {@code non-null;} where to write to */ public void writeTo(AnnotatedOutput out) { @@ -127,7 +127,7 @@ public final class DalvInsnList extends FixedSizeList { if (out.annotates()) { boolean verbose = out.isVerbose(); - + for (int i = 0; i < sz; i++) { DalvInsn insn = (DalvInsn) get0(i); int codeBytes = insn.codeSize() * 2; @@ -180,7 +180,7 @@ public final class DalvInsnList extends FixedSizeList { * Gets the size of the outgoing arguments area required by this * method. This is equal to the largest argument word count of any * method referred to by this instance. - * + * * @return {@code >= 0;} the required outgoing arguments size */ public int getOutsSize() { @@ -215,7 +215,7 @@ public final class DalvInsnList extends FixedSizeList { /** * Does a human-friendly dump of this instance. - * + * * @param out {@code non-null;} where to dump * @param prefix {@code non-null;} prefix to attach to each line of output * @param verbose whether to be verbose; verbose output includes @@ -249,7 +249,7 @@ public final class DalvInsnList extends FixedSizeList { /** * Does a human-friendly dump of this instance. - * + * * @param out {@code non-null;} where to dump * @param prefix {@code non-null;} prefix to attach to each line of output * @param verbose whether to be verbose; verbose output includes diff --git a/dx/src/com/android/dx/dex/code/Dop.java b/dx/src/com/android/dx/dex/code/Dop.java index d1f92bfb7..2b2a08f90 100644 --- a/dx/src/com/android/dx/dex/code/Dop.java +++ b/dx/src/com/android/dx/dex/code/Dop.java @@ -37,7 +37,7 @@ public final class Dop { /** * Constructs an instance. - * + * * @param opcode {@code DalvOps.MIN_VALUE..DalvOps.MAX_VALUE;} the opcode * value itself * @param family {@code DalvOps.MIN_VALUE..DalvOps.MAX_VALUE;} the opcode family @@ -79,7 +79,7 @@ public final class Dop { /** * Gets the opcode value. - * + * * @return {@code DalvOps.MIN_VALUE..DalvOps.MAX_VALUE;} the opcode value */ public int getOpcode() { @@ -89,7 +89,7 @@ public final class Dop { /** * Gets the opcode family. The opcode family is the unmarked (no * "/...") opcode that has equivalent semantics to this one. - * + * * @return {@code DalvOps.MIN_VALUE..DalvOps.MAX_VALUE;} the opcode family */ public int getFamily() { @@ -98,7 +98,7 @@ public final class Dop { /** * Gets the instruction format. - * + * * @return {@code non-null;} the instruction format */ public InsnFormat getFormat() { @@ -107,7 +107,7 @@ public final class Dop { /** * Returns whether this opcode uses a result register. - * + * * @return {@code true} iff this opcode uses a result register */ public boolean hasResult() { @@ -116,7 +116,7 @@ public final class Dop { /** * Gets the opcode name. - * + * * @return {@code non-null;} the opcode name */ public String getName() { @@ -126,7 +126,7 @@ public final class Dop { /** * Gets the opcode for the opposite test of this instance. This is only * valid for opcodes which are in fact tests. - * + * * @return {@code non-null;} the opposite test */ public Dop getOppositeTest() { diff --git a/dx/src/com/android/dx/dex/code/Dops.java b/dx/src/com/android/dx/dex/code/Dops.java index dfdaa7378..0211a40e7 100644 --- a/dx/src/com/android/dx/dex/code/Dops.java +++ b/dx/src/com/android/dx/dex/code/Dops.java @@ -51,9 +51,9 @@ public final class Dops { private static final Dop[] DOPS; /** - * pseudo-opcode used for nonstandard formatted "instructions" + * pseudo-opcode used for nonstandard formatted "instructions" * (which are mostly not actually instructions, though they do - * appear in instruction lists) + * appear in instruction lists) */ public static final Dop SPECIAL_FORMAT = new Dop(DalvOps.SPECIAL_FORMAT, DalvOps.SPECIAL_FORMAT, @@ -1171,7 +1171,7 @@ public final class Dops { /** * Gets the {@link Dop} for the given opcode value. - * + * * @param opcode {@code DalvOps.MIN_VALUE..DalvOps.MAX_VALUE;} the opcode value * @return {@code non-null;} the associated opcode instance */ @@ -1193,7 +1193,7 @@ public final class Dops { /** * Gets the {@link Dop} with the given family/format combination, if * any. - * + * * @param family {@code DalvOps.MIN_VALUE..DalvOps.MAX_VALUE;} the opcode family * @param format {@code non-null;} the opcode's instruction format * @return {@code null-ok;} the corresponding opcode, or {@code null} if @@ -1221,7 +1221,7 @@ public final class Dops { /** * Puts the given opcode into the table of all ops. - * + * * @param opcode {@code non-null;} the opcode */ private static void set(Dop opcode) { diff --git a/dx/src/com/android/dx/dex/code/FixedSizeInsn.java b/dx/src/com/android/dx/dex/code/FixedSizeInsn.java index 147937f9e..faed530a4 100644 --- a/dx/src/com/android/dx/dex/code/FixedSizeInsn.java +++ b/dx/src/com/android/dx/dex/code/FixedSizeInsn.java @@ -29,13 +29,13 @@ public abstract class FixedSizeInsn extends DalvInsn { /** * Constructs an instance. The output address of this instance is initially * unknown ({@code -1}). - * + * * <p><b>Note:</b> In the unlikely event that an instruction takes * absolutely no registers (e.g., a {@code nop} or a * no-argument no-result * static method call), then the given * register list may be passed as {@link * RegisterSpecList#EMPTY}.</p> - * + * * @param opcode the opcode; one of the constants from {@link Dops} * @param position {@code non-null;} source position * @param registers {@code non-null;} register list, including a diff --git a/dx/src/com/android/dx/dex/code/HighRegisterPrefix.java b/dx/src/com/android/dx/dex/code/HighRegisterPrefix.java index 915536795..6fab094e5 100644 --- a/dx/src/com/android/dx/dex/code/HighRegisterPrefix.java +++ b/dx/src/com/android/dx/dex/code/HighRegisterPrefix.java @@ -32,11 +32,11 @@ import com.android.dx.util.AnnotatedOutput; public final class HighRegisterPrefix extends VariableSizeInsn { /** {@code null-ok;} cached instructions, if constructed */ private SimpleInsn[] insns; - + /** * Constructs an instance. The output address of this instance is initially * unknown ({@code -1}). - * + * * @param position {@code non-null;} source position * @param registers {@code non-null;} source registers */ @@ -83,12 +83,12 @@ public final class HighRegisterPrefix extends VariableSizeInsn { if (insns != null) { return; } - + RegisterSpecList registers = getRegisters(); int sz = registers.size(); insns = new SimpleInsn[sz]; - + for (int i = 0, outAt = 0; i < sz; i++) { RegisterSpec src = registers.get(i); insns[i] = moveInsnFor(src, outAt); @@ -122,7 +122,7 @@ public final class HighRegisterPrefix extends VariableSizeInsn { if (i != 0) { sb.append('\n'); } - + sb.append(insn.listingString0(noteIndices)); outAt += src.getCategory(); diff --git a/dx/src/com/android/dx/dex/code/InsnFormat.java b/dx/src/com/android/dx/dex/code/InsnFormat.java index ca6688bd3..17c127f23 100644 --- a/dx/src/com/android/dx/dex/code/InsnFormat.java +++ b/dx/src/com/android/dx/dex/code/InsnFormat.java @@ -290,7 +290,7 @@ public abstract class InsnFormat { if (! ci.hasIndex()) { return ""; } - + StringBuilder sb = new StringBuilder(20); int index = ci.getIndex(); @@ -302,7 +302,7 @@ public abstract class InsnFormat { } else { sb.append(Hex.u4(index)); } - + return sb.toString(); } @@ -484,7 +484,7 @@ public abstract class InsnFormat { /** * Writes one code unit to the given output destination. - * + * * @param out {@code non-null;} where to write to * @param c0 code unit to write */ @@ -494,7 +494,7 @@ public abstract class InsnFormat { /** * Writes two code units to the given output destination. - * + * * @param out {@code non-null;} where to write to * @param c0 code unit to write * @param c1 code unit to write @@ -506,7 +506,7 @@ public abstract class InsnFormat { /** * Writes three code units to the given output destination. - * + * * @param out {@code non-null;} where to write to * @param c0 code unit to write * @param c1 code unit to write @@ -521,7 +521,7 @@ public abstract class InsnFormat { /** * Writes four code units to the given output destination. - * + * * @param out {@code non-null;} where to write to * @param c0 code unit to write * @param c1 code unit to write @@ -538,7 +538,7 @@ public abstract class InsnFormat { /** * Writes five code units to the given output destination. - * + * * @param out {@code non-null;} where to write to * @param c0 code unit to write * @param c1 code unit to write @@ -557,7 +557,7 @@ public abstract class InsnFormat { /** * Writes six code units to the given output destination. - * + * * @param out {@code non-null;} where to write to * @param c0 code unit to write * @param c1 code unit to write diff --git a/dx/src/com/android/dx/dex/code/LocalEnd.java b/dx/src/com/android/dx/dex/code/LocalEnd.java index 360a55cde..1c2bf899a 100644 --- a/dx/src/com/android/dx/dex/code/LocalEnd.java +++ b/dx/src/com/android/dx/dex/code/LocalEnd.java @@ -39,7 +39,7 @@ public final class LocalEnd extends ZeroSizeInsn { /** * Constructs an instance. The output address of this instance is initially * unknown ({@code -1}). - * + * * @param position {@code non-null;} source position * @param local {@code non-null;} register spec representing the local * variable introduced by this instance @@ -69,7 +69,7 @@ public final class LocalEnd extends ZeroSizeInsn { /** * Gets the register spec representing the local variable ended * by this instance. - * + * * @return {@code non-null;} the register spec */ public RegisterSpec getLocal() { diff --git a/dx/src/com/android/dx/dex/code/LocalSnapshot.java b/dx/src/com/android/dx/dex/code/LocalSnapshot.java index 409ad15bd..baeab4caf 100644 --- a/dx/src/com/android/dx/dex/code/LocalSnapshot.java +++ b/dx/src/com/android/dx/dex/code/LocalSnapshot.java @@ -33,7 +33,7 @@ public final class LocalSnapshot extends ZeroSizeInsn { /** * Constructs an instance. The output address of this instance is initially * unknown ({@code -1}). - * + * * @param position {@code non-null;} source position * @param locals {@code non-null;} associated local variable state */ @@ -61,7 +61,7 @@ public final class LocalSnapshot extends ZeroSizeInsn { /** * Gets the local state associated with this instance. - * + * * @return {@code non-null;} the state */ public RegisterSpecSet getLocals() { diff --git a/dx/src/com/android/dx/dex/code/LocalStart.java b/dx/src/com/android/dx/dex/code/LocalStart.java index ec70e3011..9a17c5bec 100644 --- a/dx/src/com/android/dx/dex/code/LocalStart.java +++ b/dx/src/com/android/dx/dex/code/LocalStart.java @@ -29,13 +29,13 @@ import com.android.dx.rop.code.SourcePosition; public final class LocalStart extends ZeroSizeInsn { /** * {@code non-null;} register spec representing the local variable introduced - * by this instance + * by this instance */ private final RegisterSpec local; /** * Returns the local variable listing string for a single register spec. - * + * * @param spec {@code non-null;} the spec to convert * @return {@code non-null;} the string form */ @@ -47,7 +47,7 @@ public final class LocalStart extends ZeroSizeInsn { /** * Constructs an instance. The output address of this instance is initially * unknown ({@code -1}). - * + * * @param position {@code non-null;} source position * @param local {@code non-null;} register spec representing the local * variable introduced by this instance @@ -77,7 +77,7 @@ public final class LocalStart extends ZeroSizeInsn { /** * Gets the register spec representing the local variable introduced * by this instance. - * + * * @return {@code non-null;} the register spec */ public RegisterSpec getLocal() { diff --git a/dx/src/com/android/dx/dex/code/OddSpacer.java b/dx/src/com/android/dx/dex/code/OddSpacer.java index 727def04b..756a0e2bf 100644 --- a/dx/src/com/android/dx/dex/code/OddSpacer.java +++ b/dx/src/com/android/dx/dex/code/OddSpacer.java @@ -30,7 +30,7 @@ public final class OddSpacer extends VariableSizeInsn { /** * Constructs an instance. The output address of this instance is initially * unknown ({@code -1}). - * + * * @param position {@code non-null;} source position */ public OddSpacer(SourcePosition position) { diff --git a/dx/src/com/android/dx/dex/code/OutputCollector.java b/dx/src/com/android/dx/dex/code/OutputCollector.java index 264337378..d78e5fcab 100644 --- a/dx/src/com/android/dx/dex/code/OutputCollector.java +++ b/dx/src/com/android/dx/dex/code/OutputCollector.java @@ -41,7 +41,7 @@ public final class OutputCollector { /** * Constructs an instance. - * + * * @param initialCapacity {@code >= 0;} initial capacity of the output list * @param suffixInitialCapacity {@code >= 0;} initial capacity of the output * suffix @@ -55,8 +55,8 @@ public final class OutputCollector { /** * Adds an instruction to the output. - * - * @param insn {@code non-null;} the instruction to add + * + * @param insn {@code non-null;} the instruction to add */ public void add(DalvInsn insn) { finisher.add(insn); @@ -66,7 +66,7 @@ public final class OutputCollector { * Reverses a branch which is buried a given number of instructions * backward in the output. It is illegal to call this unless the * indicated instruction really is a reversible branch. - * + * * @param which how many instructions back to find the branch; * {@code 0} is the most recently added instruction, * {@code 1} is the instruction before that, etc. @@ -78,8 +78,8 @@ public final class OutputCollector { /** * Adds an instruction to the output suffix. - * - * @param insn {@code non-null;} the instruction to add + * + * @param insn {@code non-null;} the instruction to add */ public void addSuffix(DalvInsn insn) { suffix.add(insn); @@ -97,7 +97,7 @@ public final class OutputCollector { if (suffix == null) { throw new UnsupportedOperationException("already processed"); } - + appendSuffixToOutput(); return finisher; } diff --git a/dx/src/com/android/dx/dex/code/OutputFinisher.java b/dx/src/com/android/dx/dex/code/OutputFinisher.java index 5b1d53313..4a511982c 100644 --- a/dx/src/com/android/dx/dex/code/OutputFinisher.java +++ b/dx/src/com/android/dx/dex/code/OutputFinisher.java @@ -61,7 +61,7 @@ public final class OutputFinisher { /** * Constructs an instance. It initially contains no instructions. - * + * * @param regCount {@code >= 0;} register count for the method * @param initialCapacity {@code >= 0;} initial capacity of the instructions * list @@ -77,17 +77,17 @@ public final class OutputFinisher { /** * Returns whether any of the instructions added to this instance * come with position info. - * + * * @return whether any of the instructions added to this instance * come with position info */ public boolean hasAnyPositionInfo() { return hasAnyPositionInfo; } - + /** * Returns whether this instance has any local variable information. - * + * * @return whether this instance has any local variable information */ public boolean hasAnyLocalInfo() { @@ -97,7 +97,7 @@ public final class OutputFinisher { /** * Helper for {@link #add} which scrutinizes a single * instruction for local variable information. - * + * * @param insn {@code non-null;} instruction to scrutinize * @return {@code true} iff the instruction refers to any * named locals @@ -124,7 +124,7 @@ public final class OutputFinisher { /** * Helper for {@link #hasAnyLocalInfo} which scrutinizes a single * register spec. - * + * * @param spec {@code non-null;} spec to scrutinize * @return {@code true} iff the spec refers to any * named locals @@ -137,7 +137,7 @@ public final class OutputFinisher { /** * Returns the set of all constants referred to by instructions added * to this instance. - * + * * @return {@code non-null;} the set of constants */ public HashSet<Constant> getAllConstants() { @@ -153,7 +153,7 @@ public final class OutputFinisher { /** * Helper for {@link #getAllConstants} which adds all the info for * a single instruction. - * + * * @param result {@code non-null;} result set to add to * @param insn {@code non-null;} instruction to scrutinize */ @@ -186,7 +186,7 @@ public final class OutputFinisher { if (spec == null) { return; } - + LocalItem local = spec.getLocalItem(); CstUtf8 name = local.getName(); CstUtf8 signature = local.getSignature(); @@ -207,8 +207,8 @@ public final class OutputFinisher { /** * Adds an instruction to the output. - * - * @param insn {@code non-null;} the instruction to add + * + * @param insn {@code non-null;} the instruction to add */ public void add(DalvInsn insn) { insns.add(insn); @@ -217,7 +217,7 @@ public final class OutputFinisher { /** * Inserts an instruction in the output at the given offset. - * + * * @param at {@code >= 0;} what index to insert at * @param insn {@code non-null;} the instruction to insert */ @@ -229,7 +229,7 @@ public final class OutputFinisher { /** * Helper for {@link #add} and {@link #insert}, * which updates the position and local info flags. - * + * * @param insn {@code non-null;} an instruction that was just introduced */ private void updateInfo(DalvInsn insn) { @@ -251,7 +251,7 @@ public final class OutputFinisher { * Reverses a branch which is buried a given number of instructions * backward in the output. It is illegal to call this unless the * indicated instruction really is a reversible branch. - * + * * @param which how many instructions back to find the branch; * {@code 0} is the most recently added instruction, * {@code 1} is the instruction before that, etc. @@ -283,7 +283,7 @@ public final class OutputFinisher { * Assigns indices in all instructions that need them, using the * given callback to perform lookups. This should be called before * calling {@link #finishProcessingAndGetList}. - * + * * @param callback {@code non-null;} callback object */ public void assignIndices(DalvCode.AssignIndicesCallback callback) { @@ -297,7 +297,7 @@ public final class OutputFinisher { /** * Helper for {@link #assignIndices} which does assignment for one * instruction. - * + * * @param insn {@code non-null;} the instruction * @param callback {@code non-null;} the callback */ @@ -323,7 +323,7 @@ public final class OutputFinisher { /** * Does final processing on this instance and gets the output as * a {@link DalvInsnList}. Final processing consists of: - * + * * <ul> * <li>optionally renumbering registers (to make room as needed for * expanded instructions)</li> @@ -332,7 +332,7 @@ public final class OutputFinisher { * constant pool index, or branch target size issues</li> * <li>assigning final addresses</li> * </ul> - * + * * <p><b>Note:</b> This method may only be called once per instance * of this class.</p> * @@ -358,7 +358,7 @@ public final class OutputFinisher { * Helper for {@link #finishProcessingAndGetList}, which extracts * the format out of each instruction into a separate array, to be * further manipulated as things progress. - * + * * @return {@code non-null;} the array of formats */ private InsnFormat[] makeFormatsArray() { @@ -378,12 +378,12 @@ public final class OutputFinisher { * them. It also updates the given {@code formats} array so * as to avoid extra work when constructing the massaged * instruction list. - * + * * @param formats {@code non-null;} array of per-instruction format selections */ private void reserveRegisters(InsnFormat[] formats) { int oldReservedCount = (reservedCount < 0) ? 0 : reservedCount; - + /* * Call calculateReservedCount() and then perform register * reservation, repeatedly until no new reservations happen. @@ -410,7 +410,7 @@ public final class OutputFinisher { /* * No need to call this.set() since the format and * other info are the same. - */ + */ insns.set(i, insn.withRegisterOffset(reservedDifference)); } } @@ -427,7 +427,7 @@ public final class OutputFinisher { * registers that need to be reserved. It also updates the * {@code formats} list to help avoid extra work in future * register reservation passes. - * + * * @param formats {@code non-null;} array of per-instruction format selections * @return {@code >= 0;} the count of reserved registers */ @@ -450,7 +450,7 @@ public final class OutputFinisher { if (originalFormat == newFormat) { continue; } - + if (newFormat == null) { /* * The instruction will need to be expanded, so reserve @@ -499,7 +499,7 @@ public final class OutputFinisher { for (;;) { format = format.nextUp(); if ((format == null) || - (format.isCompatible(insn) && + (format.isCompatible(insn) && (Dops.getOrNull(family, format) != null))) { break; } @@ -507,14 +507,14 @@ public final class OutputFinisher { return format; } - + /** * Helper for {@link #finishProcessingAndGetList}, which goes * through each instruction in the output, making sure its opcode * can accomodate its arguments. In cases where the opcode is * unable to do so, this replaces the instruction with a larger * instruction with identical semantics that <i>will</i> work. - * + * * <p>This method may also reserve a number of low-numbered * registers, renumbering the instructions' original registers, in * order to have register space available in which to move @@ -522,11 +522,11 @@ public final class OutputFinisher { * multi-instruction sequences. This expansion is done when no * simple instruction format can be found for a given instruction that * is able to accomodate that instruction's registers.</p> - * + * * <p>This method ignores issues of branch target size, since * final addresses aren't known at the point that this method is * called.</p> - * + * * @param formats {@code non-null;} array of per-instruction format selections */ private void massageInstructions(InsnFormat[] formats) { @@ -565,7 +565,7 @@ public final class OutputFinisher { * couldn't be represented simply (due to register representation * problems) is expanded into a series of instances that together * perform the proper function. - * + * * @param formats {@code non-null;} array of per-instruction format selections * @return {@code non-null;} the replacement list */ @@ -602,7 +602,7 @@ public final class OutputFinisher { if (prefix != null) { result.add(prefix); } - + if (currentFormat != originalFormat) { dop = Dops.getOrNull(dop.getFamily(), currentFormat); insn = insn.withOpcode(dop); @@ -613,7 +613,7 @@ public final class OutputFinisher { result.add(suffix); } } - + return result; } @@ -655,7 +655,7 @@ public final class OutputFinisher { * case of a conditional branch that doesn't fit, the sense of the * test is reversed in order to branch around a {@code goto} * to the original target. - * + * * @return whether any branches had to be fixed */ private boolean fixBranches() { @@ -696,13 +696,13 @@ public final class OutputFinisher { * It is a conditional: Reverse its sense, and arrange for * it to branch around an absolute goto to the original * branch target. - * + * * Note: An invariant of the list being processed is * that every TargetInsn is followed by a CodeAddress. * Hence, it is always safe to get the next element * after a TargetInsn and cast it to CodeAddress, as * is happening a few lines down. - * + * * Also note: Size gets incremented by one here, as we * have -- in the net -- added one additional element * to the list, so we increment i to match. The added diff --git a/dx/src/com/android/dx/dex/code/PositionList.java b/dx/src/com/android/dx/dex/code/PositionList.java index 41e36678a..1e07e4669 100644 --- a/dx/src/com/android/dx/dex/code/PositionList.java +++ b/dx/src/com/android/dx/dex/code/PositionList.java @@ -29,27 +29,27 @@ public final class PositionList extends FixedSizeList { /** * constant for {@link #make} to indicate that no actual position - * information should be returned + * information should be returned */ public static final int NONE = 1; /** * constant for {@link #make} to indicate that only line number - * transitions should be returned + * transitions should be returned */ public static final int LINES = 2; /** * constant for {@link #make} to indicate that only "important" position * information should be returned. This includes block starts and - * instructions that might throw. + * instructions that might throw. */ public static final int IMPORTANT = 3; /** * Extracts and returns the source position information out of an * instruction list. - * + * * @param insns {@code non-null;} instructions to convert * @param howMuch how much information should be included; one of the * static constants defined by this class @@ -113,7 +113,7 @@ public final class PositionList extends FixedSizeList { /** * Constructs an instance. All indices initially contain {@code null}. - * + * * @param size {@code >= 0;} the size of the list */ public PositionList(int size) { @@ -124,7 +124,7 @@ public final class PositionList extends FixedSizeList { * Gets the element at the given index. It is an error to call * this with the index for an element which was never set; if you * do that, this will throw {@code NullPointerException}. - * + * * @param n {@code >= 0, < size();} which index * @return {@code non-null;} element at that index */ @@ -134,7 +134,7 @@ public final class PositionList extends FixedSizeList { /** * Sets the entry at the given index. - * + * * @param n {@code >= 0, < size();} which index * @param entry {@code non-null;} the entry to set at {@code n} */ @@ -154,7 +154,7 @@ public final class PositionList extends FixedSizeList { /** * Constructs an instance. - * + * * @param address {@code >= 0;} address of this entry * @param position {@code non-null;} corresponding source position information */ @@ -173,7 +173,7 @@ public final class PositionList extends FixedSizeList { /** * Gets the address. - * + * * @return {@code >= 0;} the address */ public int getAddress() { @@ -182,7 +182,7 @@ public final class PositionList extends FixedSizeList { /** * Gets the source position information. - * + * * @return {@code non-null;} the position information */ public SourcePosition getPosition() { diff --git a/dx/src/com/android/dx/dex/code/RopToDop.java b/dx/src/com/android/dx/dex/code/RopToDop.java index 0385467e4..d8fa1cc5f 100644 --- a/dx/src/com/android/dx/dex/code/RopToDop.java +++ b/dx/src/com/android/dx/dex/code/RopToDop.java @@ -277,7 +277,7 @@ public final class RopToDop { /** * Returns the dalvik opcode appropriate for the given register-based * instruction. - * + * * @param insn {@code non-null;} the original instruction * @return the corresponding dalvik opcode; one of the constants in * {@link Dops} @@ -297,16 +297,16 @@ public final class RopToDop { /* * There was no easy case for the rop, so look up the opcode, and * do something special for each: - * + * * The move_exception, new_array, filled_new_array, and * invoke* opcodes won't be found in MAP, since they'll each * have different source and/or result register types / lists. - * + * * The get* and put* opcodes for (non-long) integral types * aren't in the map, since the type signatures aren't * sufficient to distinguish between the types (the salient * source or result will always be just "int"). - * + * * And const instruction need to distinguish between strings and * classes. */ @@ -320,7 +320,7 @@ public final class RopToDop { case RegOps.INVOKE_INTERFACE: return Dops.INVOKE_INTERFACE; case RegOps.NEW_ARRAY: return Dops.NEW_ARRAY; case RegOps.FILLED_NEW_ARRAY: return Dops.FILLED_NEW_ARRAY; - case RegOps.FILL_ARRAY_DATA: return Dops.FILL_ARRAY_DATA; + case RegOps.FILL_ARRAY_DATA: return Dops.FILL_ARRAY_DATA; case RegOps.MOVE_RESULT: { RegisterSpec resultReg = insn.getResult(); diff --git a/dx/src/com/android/dx/dex/code/RopTranslator.java b/dx/src/com/android/dx/dex/code/RopTranslator.java index 9f47b13be..a38ea1168 100644 --- a/dx/src/com/android/dx/dex/code/RopTranslator.java +++ b/dx/src/com/android/dx/dex/code/RopTranslator.java @@ -51,7 +51,7 @@ public final class RopTranslator { /** * how much position info to preserve; one of the static - * constants in {@link PositionList} + * constants in {@link PositionList} */ private final int positionInfo; @@ -85,7 +85,7 @@ public final class RopTranslator { /** * Translates a {@link RopMethod}. This may modify the given * input. - * + * * @param method {@code non-null;} the original method * @param positionInfo how much position info to preserve; one of the * static constants in {@link PositionList} @@ -104,7 +104,7 @@ public final class RopTranslator { /** * Constructs an instance. This method is private. Use {@link #translate}. - * + * * @param method {@code non-null;} the original method * @param positionInfo how much position info to preserve; one of the * static constants in {@link PositionList} @@ -166,7 +166,7 @@ public final class RopTranslator { * stack frame that matches dalvik's calling conventions. This will * alway result in "true" for methods that have run through the * SSA optimizer. - * + * * @param paramSize size, in register units, of all the parameters * to this method */ @@ -198,7 +198,7 @@ public final class RopTranslator { /** * Does the translation and returns the result. - * + * * @return {@code non-null;} the result */ private DalvCode translateAndGetResult() { @@ -231,7 +231,7 @@ public final class RopTranslator { /** * Helper for {@link #outputInstructions}, which does the processing * and output of one block. - * + * * @param block {@code non-null;} the block to process and output * @param nextLabel {@code >= -1;} the next block that will be processed, or * {@code -1} if there is no next block @@ -258,7 +258,7 @@ public final class RopTranslator { // Insert the block end code address. output.add(addresses.getEnd(block)); - // Set up for end-of-block activities. + // Set up for end-of-block activities. int succ = block.getPrimarySuccessor(); Insn lastInsn = block.getLastInsn(); @@ -391,7 +391,7 @@ public final class RopTranslator { if (preferredBlock == null) { break; } - + int preferred = preferredBlock.getLabel(); int primary = one.getPrimarySuccessor(); @@ -424,7 +424,7 @@ public final class RopTranslator { } } } - } + } if (at != sz) { // There was a duplicate block label. @@ -494,13 +494,13 @@ public final class RopTranslator { /** * {@code null-ok;} code address for the salient last instruction of the - * block (used before switches and throwing instructions) + * block (used before switches and throwing instructions) */ private CodeAddress lastAddress; /** * Constructs an instance. - * + * * @param output {@code non-null;} destination for instruction output */ public TranslationVisitor(OutputCollector output) { @@ -509,7 +509,7 @@ public final class RopTranslator { /** * Sets the block currently being worked on. - * + * * @param block {@code non-null;} the block * @param lastAddress {@code non-null;} code address for the salient * last instruction of the block @@ -672,7 +672,7 @@ public final class RopTranslator { return null; } else { return insn.getResult(); - } + } } /** {@inheritDoc} */ @@ -707,7 +707,7 @@ public final class RopTranslator { "Insn with result/move-result-pseudo mismatch " + insn); } - + if ((rop.getOpcode() == RegOps.NEW_ARRAY) && (opcode.getOpcode() != DalvOps.NEW_ARRAY)) { /* @@ -745,7 +745,7 @@ public final class RopTranslator { throw new RuntimeException( "Insn with result/move-result-pseudo mismatch" + insn); } - + addOutput(lastAddress); DalvInsn di = new SimpleInsn(opcode, pos, @@ -767,7 +767,7 @@ public final class RopTranslator { CodeAddress dataAddress = new CodeAddress(pos); ArrayData dataInsn = new ArrayData(pos, lastAddress, values, cst); - + TargetInsn fillArrayDataInsn = new TargetInsn(Dops.FILL_ARRAY_DATA, pos, getRegs(insn), dataAddress); @@ -779,10 +779,10 @@ public final class RopTranslator { addOutputSuffix(dataAddress); addOutputSuffix(dataInsn); } - + /** * Adds to the output. - * + * * @param insn {@code non-null;} instruction to add */ protected void addOutput(DalvInsn insn) { @@ -791,7 +791,7 @@ public final class RopTranslator { /** * Adds to the output suffix. - * + * * @param insn {@code non-null;} instruction to add */ protected void addOutputSuffix(DalvInsn insn) { @@ -810,7 +810,7 @@ public final class RopTranslator { /** * Constructs an instance. - * + * * @param output {@code non-null;} destination for instruction output * @param locals {@code non-null;} the local variable info */ @@ -858,7 +858,7 @@ public final class RopTranslator { /** * Adds a {@link LocalStart} to the output if the given * instruction in fact introduces a local variable. - * + * * @param insn {@code non-null;} instruction in question */ public void addIntroductionIfNecessary(Insn insn) { @@ -868,5 +868,5 @@ public final class RopTranslator { addOutput(new LocalStart(insn.getPosition(), spec)); } } - } + } } diff --git a/dx/src/com/android/dx/dex/code/SimpleInsn.java b/dx/src/com/android/dx/dex/code/SimpleInsn.java index 5e7b2591a..8cdcc5563 100644 --- a/dx/src/com/android/dx/dex/code/SimpleInsn.java +++ b/dx/src/com/android/dx/dex/code/SimpleInsn.java @@ -27,7 +27,7 @@ public final class SimpleInsn extends FixedSizeInsn { /** * Constructs an instance. The output address of this instance is initially * unknown ({@code -1}). - * + * * @param opcode the opcode; one of the constants from {@link Dops} * @param position {@code non-null;} source position * @param registers {@code non-null;} register list, including a diff --git a/dx/src/com/android/dx/dex/code/StdCatchBuilder.java b/dx/src/com/android/dx/dex/code/StdCatchBuilder.java index 6e3a169b4..1e7612e7a 100644 --- a/dx/src/com/android/dx/dex/code/StdCatchBuilder.java +++ b/dx/src/com/android/dx/dex/code/StdCatchBuilder.java @@ -34,7 +34,7 @@ import java.util.HashSet; public final class StdCatchBuilder implements CatchBuilder { /** the maximum range of a single catch handler, in code units */ private static final int MAX_CATCH_RANGE = 65535; - + /** {@code non-null;} method to build the list for */ private final RopMethod method; @@ -43,11 +43,11 @@ public final class StdCatchBuilder implements CatchBuilder { /** {@code non-null;} address objects for each block */ private final BlockAddresses addresses; - + /** * Constructs an instance. It merely holds onto its parameters for * a subsequent call to {@link #build}. - * + * * @param method {@code non-null;} method to build the list for * @param order {@code non-null;} block output order * @param addresses {@code non-null;} address objects for each block @@ -80,7 +80,7 @@ public final class StdCatchBuilder implements CatchBuilder { public boolean hasAnyCatches() { BasicBlockList blocks = method.getBlocks(); int size = blocks.size(); - + for (int i = 0; i < size; i++) { BasicBlock block = blocks.get(i); TypeList catches = block.getLastInsn().getCatches(); @@ -91,13 +91,13 @@ public final class StdCatchBuilder implements CatchBuilder { return false; } - + /** {@inheritDoc} */ public HashSet<Type> getCatchTypes() { HashSet<Type> result = new HashSet<Type>(20); BasicBlockList blocks = method.getBlocks(); int size = blocks.size(); - + for (int i = 0; i < size; i++) { BasicBlock block = blocks.get(i); TypeList catches = block.getLastInsn().getCatches(); @@ -113,7 +113,7 @@ public final class StdCatchBuilder implements CatchBuilder { /** * Builds and returns the catch table for a given method. - * + * * @param method {@code non-null;} method to build the list for * @param order {@code non-null;} block output order * @param addresses {@code non-null;} address objects for each block @@ -128,7 +128,7 @@ public final class StdCatchBuilder implements CatchBuilder { CatchHandlerList currentHandlers = CatchHandlerList.EMPTY; BasicBlock currentStartBlock = null; BasicBlock currentEndBlock = null; - + for (int i = 0; i < len; i++) { BasicBlock block = blocks.labelToBlock(order[i]); @@ -187,11 +187,11 @@ public final class StdCatchBuilder implements CatchBuilder { currentHandlers, addresses); resultList.add(entry); } - + // Construct the final result. int resultSz = resultList.size(); - + if (resultSz == 0) { return CatchTable.EMPTY; } @@ -208,7 +208,7 @@ public final class StdCatchBuilder implements CatchBuilder { /** * Makes the {@link CatchHandlerList} for the given basic block. - * + * * @param block {@code non-null;} block to get entries for * @param addresses {@code non-null;} address objects for each block * @return {@code non-null;} array of entries @@ -249,7 +249,7 @@ public final class StdCatchBuilder implements CatchBuilder { break; } } - + CatchHandlerList result = new CatchHandlerList(catchSize); for (int i = 0; i < catchSize; i++) { @@ -291,7 +291,7 @@ public final class StdCatchBuilder implements CatchBuilder { * Gets whether the address range for the given two blocks is valid * for a catch handler. This is true as long as the covered range is * under 65536 code units. - * + * * @param start {@code non-null;} the start block for the range (inclusive) * @param end {@code non-null;} the start block for the range (also inclusive) * @param addresses {@code non-null;} address objects for each block @@ -306,7 +306,7 @@ public final class StdCatchBuilder implements CatchBuilder { if (end == null) { throw new NullPointerException("end == null"); } - + // See above about selection of instructions. int startAddress = addresses.getLast(start).getAddress(); int endAddress = addresses.getEnd(end).getAddress(); diff --git a/dx/src/com/android/dx/dex/code/SwitchData.java b/dx/src/com/android/dx/dex/code/SwitchData.java index e5a8da4ac..27a6342f7 100644 --- a/dx/src/com/android/dx/dex/code/SwitchData.java +++ b/dx/src/com/android/dx/dex/code/SwitchData.java @@ -30,7 +30,7 @@ import com.android.dx.util.IntList; public final class SwitchData extends VariableSizeInsn { /** * {@code non-null;} address representing the instruction that uses this - * instance + * instance */ private final CodeAddress user; @@ -39,7 +39,7 @@ public final class SwitchData extends VariableSizeInsn { /** * {@code non-null;} corresponding list of code addresses; the branch - * target for each case + * target for each case */ private final CodeAddress[] targets; @@ -49,7 +49,7 @@ public final class SwitchData extends VariableSizeInsn { /** * Constructs an instance. The output address of this instance is initially * unknown ({@code -1}). - * + * * @param position {@code non-null;} source position * @param user {@code non-null;} address representing the instruction that * uses this instance @@ -150,7 +150,7 @@ public final class SwitchData extends VariableSizeInsn { /** * Returns whether or not this instance's data will be output as packed. - * + * * @return {@code true} iff the data is to be packed */ public boolean isPacked() { @@ -201,7 +201,7 @@ public final class SwitchData extends VariableSizeInsn { /** * Gets the size of a packed table for the given cases, in 16-bit code * units. - * + * * @param cases {@code non-null;} sorted list of cases * @return {@code >= -1;} the packed table size or {@code -1} if the * cases couldn't possibly be represented as a packed table @@ -218,7 +218,7 @@ public final class SwitchData extends VariableSizeInsn { /** * Gets the size of a sparse table for the given cases, in 16-bit code * units. - * + * * @param cases {@code non-null;} sorted list of cases * @return {@code > 0;} the sparse table size */ @@ -230,7 +230,7 @@ public final class SwitchData extends VariableSizeInsn { /** * Determines whether the given list of cases warrant being packed. - * + * * @param cases {@code non-null;} sorted list of cases * @return {@code true} iff the table encoding the cases * should be packed diff --git a/dx/src/com/android/dx/dex/code/TargetInsn.java b/dx/src/com/android/dx/dex/code/TargetInsn.java index 0faaadada..cbb5ff9a6 100644 --- a/dx/src/com/android/dx/dex/code/TargetInsn.java +++ b/dx/src/com/android/dx/dex/code/TargetInsn.java @@ -30,7 +30,7 @@ public final class TargetInsn extends FixedSizeInsn { * Constructs an instance. The output address of this instance is initially * unknown ({@code -1}), and the target is initially * {@code null}. - * + * * @param opcode the opcode; one of the constants from {@link Dops} * @param position {@code non-null;} source position * @param registers {@code non-null;} register list, including a @@ -67,7 +67,7 @@ public final class TargetInsn extends FixedSizeInsn { * {@code lt} test becomes a {@code ge}), and its branch * target is replaced by the one given, and all set-once values * associated with the class (such as its address) are reset. - * + * * @param target {@code non-null;} the new branch target * @return {@code non-null;} an appropriately-constructed instance */ @@ -79,7 +79,7 @@ public final class TargetInsn extends FixedSizeInsn { /** * Gets the unique branch target of this instruction. - * + * * @return {@code non-null;} the branch target */ public CodeAddress getTarget() { @@ -91,7 +91,7 @@ public final class TargetInsn extends FixedSizeInsn { * to call if the target instruction has been assigned an address, * and it is merely a convenient shorthand for * {@code getTarget().getAddress()}. - * + * * @return {@code >= 0;} the target address */ public int getTargetAddress() { @@ -103,7 +103,7 @@ public final class TargetInsn extends FixedSizeInsn { * call if both this and the target instruction each has been assigned * an address, and it is merely a convenient shorthand for * {@code getTargetAddress() - getAddress()}. - * + * * @return the branch offset */ public int getTargetOffset() { @@ -112,7 +112,7 @@ public final class TargetInsn extends FixedSizeInsn { /** * Returns whether the target offset is known. - * + * * @return {@code true} if the target offset is known or * {@code false} if not */ diff --git a/dx/src/com/android/dx/dex/code/VariableSizeInsn.java b/dx/src/com/android/dx/dex/code/VariableSizeInsn.java index 889a50ced..06b40f7a8 100644 --- a/dx/src/com/android/dx/dex/code/VariableSizeInsn.java +++ b/dx/src/com/android/dx/dex/code/VariableSizeInsn.java @@ -26,7 +26,7 @@ public abstract class VariableSizeInsn extends DalvInsn { /** * Constructs an instance. The output address of this instance is initially * unknown ({@code -1}). - * + * * @param position {@code non-null;} source position * @param registers {@code non-null;} source registers */ diff --git a/dx/src/com/android/dx/dex/code/ZeroSizeInsn.java b/dx/src/com/android/dx/dex/code/ZeroSizeInsn.java index 198bebf1e..2cc157b7a 100644 --- a/dx/src/com/android/dx/dex/code/ZeroSizeInsn.java +++ b/dx/src/com/android/dx/dex/code/ZeroSizeInsn.java @@ -29,7 +29,7 @@ public abstract class ZeroSizeInsn extends DalvInsn { /** * Constructs an instance. The output address of this instance is initially * unknown ({@code -1}). - * + * * @param position {@code non-null;} source position */ public ZeroSizeInsn(SourcePosition position) { diff --git a/dx/src/com/android/dx/dex/code/form/Form22c.java b/dx/src/com/android/dx/dex/code/form/Form22c.java index e77677fd5..423ccc8d5 100644 --- a/dx/src/com/android/dx/dex/code/form/Form22c.java +++ b/dx/src/com/android/dx/dex/code/form/Form22c.java @@ -83,7 +83,7 @@ public final class Form22c extends InsnFormat { if (! unsignedFitsInShort(cpi)) { return false; } - + Constant cst = ci.getConstant(); return (cst instanceof CstType) || (cst instanceof CstFieldRef); diff --git a/dx/src/com/android/dx/dex/code/form/Form35c.java b/dx/src/com/android/dx/dex/code/form/Form35c.java index 411e3c322..31b127d56 100644 --- a/dx/src/com/android/dx/dex/code/form/Form35c.java +++ b/dx/src/com/android/dx/dex/code/form/Form35c.java @@ -112,7 +112,7 @@ public final class Form35c extends InsnFormat { int r4 = (sz > 4) ? regs.get(4).getReg() : 0; write(out, - opcodeUnit(insn, + opcodeUnit(insn, makeByte(r4, sz)), // encode the fifth operand here (short) cpi, codeUnit(r0, r1, r2, r3)); @@ -123,9 +123,9 @@ public final class Form35c extends InsnFormat { * category-2 values count as two words. Return {@code -1} if the * list requires more than five words or contains registers that need * more than a nibble to identify them. - * + * * @param regs {@code non-null;} the register list in question - * @return {@code >= -1;} the number of words required, or {@code -1} + * @return {@code >= -1;} the number of words required, or {@code -1} * if the list couldn't possibly fit in this format */ private static int wordCount(RegisterSpecList regs) { @@ -160,7 +160,7 @@ public final class Form35c extends InsnFormat { * except that it splits category-2 registers into two explicit * entries. This returns the original list if no modification is * required - * + * * @param orig {@code non-null;} the original list * @return {@code non-null;} the list with the described transformation */ diff --git a/dx/src/com/android/dx/dex/code/form/Form3rc.java b/dx/src/com/android/dx/dex/code/form/Form3rc.java index 2d185cf00..755ad7647 100644 --- a/dx/src/com/android/dx/dex/code/form/Form3rc.java +++ b/dx/src/com/android/dx/dex/code/form/Form3rc.java @@ -69,7 +69,7 @@ public final class Form3rc extends InsnFormat { */ lastReg = lastReg.withOffset(1); } - + sb.append(regs.get(0).regString()); sb.append(".."); sb.append(lastReg.regString()); @@ -78,7 +78,7 @@ public final class Form3rc extends InsnFormat { sb.append("}, "); sb.append(cstString(insn)); - + return sb.toString(); } diff --git a/dx/src/com/android/dx/dex/file/AnnotationItem.java b/dx/src/com/android/dx/dex/file/AnnotationItem.java index 08422bc6a..1febd9e02 100644 --- a/dx/src/com/android/dx/dex/file/AnnotationItem.java +++ b/dx/src/com/android/dx/dex/file/AnnotationItem.java @@ -36,19 +36,19 @@ import java.util.Comparator; public final class AnnotationItem extends OffsettedItem { /** annotation visibility constant: visible at build time only */ private static final int VISIBILITY_BUILD = 0; - + /** annotation visibility constant: visible at runtime */ private static final int VISIBILITY_RUNTIME = 1; /** annotation visibility constant: visible at runtime only to system */ private static final int VISIBILITY_SYSTEM = 2; - + /** the required alignment for instances of this class */ private static final int ALIGNMENT = 1; /** {@code non-null;} unique instance of {@link #TypeIdSorter} */ private static final TypeIdSorter TYPE_ID_SORTER = new TypeIdSorter(); - + /** {@code non-null;} the annotation to represent */ private final Annotation annotation; @@ -87,7 +87,7 @@ public final class AnnotationItem extends OffsettedItem { * Sorts an array of instances, in place, by type id index, * ignoring all other aspects of the elements. This is only valid * to use after type id indices are known. - * + * * @param array {@code non-null;} array to sort */ public static void sortByTypeIdIndex(AnnotationItem[] array) { @@ -96,7 +96,7 @@ public final class AnnotationItem extends OffsettedItem { /** * Constructs an instance. - * + * * @param annotation {@code non-null;} annotation to represent */ public AnnotationItem(Annotation annotation) { @@ -166,7 +166,7 @@ public final class AnnotationItem extends OffsettedItem { * Write a (listing file) annotation for this instance to the given * output, that consumes no bytes of output. This is for annotating * a reference to this instance at the point of the reference. - * + * * @param out {@code non-null;} where to output to * @param prefix {@code non-null;} prefix for each line of output */ @@ -204,7 +204,7 @@ public final class AnnotationItem extends OffsettedItem { throw new RuntimeException("shouldn't happen"); } } - + if (annotates) { /* * The output is to be annotated, so redo the work previously diff --git a/dx/src/com/android/dx/dex/file/AnnotationSetItem.java b/dx/src/com/android/dx/dex/file/AnnotationSetItem.java index 2ff005ac8..218770034 100644 --- a/dx/src/com/android/dx/dex/file/AnnotationSetItem.java +++ b/dx/src/com/android/dx/dex/file/AnnotationSetItem.java @@ -33,7 +33,7 @@ public final class AnnotationSetItem extends OffsettedItem { /** {@code non-null;} the set of annotations */ private final Annotations annotations; - + /** * {@code non-null;} set of annotations as individual items in an array. * <b>Note:</b> The contents have to get sorted by type id before @@ -43,7 +43,7 @@ public final class AnnotationSetItem extends OffsettedItem { /** * Constructs an instance. - * + * * @param annotations {@code non-null;} set of annotations */ public AnnotationSetItem(Annotations annotations) { @@ -61,7 +61,7 @@ public final class AnnotationSetItem extends OffsettedItem { /** * Gets the write size for the given set. - * + * * @param annotations {@code non-null;} the set * @return {@code > 0;} the write size */ @@ -78,13 +78,13 @@ public final class AnnotationSetItem extends OffsettedItem { /** * Gets the underlying annotations of this instance - * + * * @return {@code non-null;} the annotations */ public Annotations getAnnotations() { return annotations; } - + /** {@inheritDoc} */ @Override public int hashCode() { @@ -140,11 +140,11 @@ public final class AnnotationSetItem extends OffsettedItem { } out.writeInt(size); - + for (int i = 0; i < size; i++) { AnnotationItem item = items[i]; int offset = item.getAbsoluteOffset(); - + if (annotates) { out.annotate(4, " entries[" + Integer.toHexString(i) + "]: " + Hex.u4(offset)); diff --git a/dx/src/com/android/dx/dex/file/AnnotationSetRefItem.java b/dx/src/com/android/dx/dex/file/AnnotationSetRefItem.java index 1427e6a05..53072d8c6 100644 --- a/dx/src/com/android/dx/dex/file/AnnotationSetRefItem.java +++ b/dx/src/com/android/dx/dex/file/AnnotationSetRefItem.java @@ -34,7 +34,7 @@ public final class AnnotationSetRefItem extends OffsettedItem { /** * Constructs an instance. - * + * * @param annotations {@code non-null;} the annotation set to refer to */ public AnnotationSetRefItem(AnnotationSetItem annotations) { diff --git a/dx/src/com/android/dx/dex/file/AnnotationUtils.java b/dx/src/com/android/dx/dex/file/AnnotationUtils.java index 8431d3511..d500ec4a9 100644 --- a/dx/src/com/android/dx/dex/file/AnnotationUtils.java +++ b/dx/src/com/android/dx/dex/file/AnnotationUtils.java @@ -39,31 +39,31 @@ import static com.android.dx.rop.annotation.AnnotationVisibility.*; */ public final class AnnotationUtils { /** {@code non-null;} type for {@code AnnotationDefault} annotations */ - private static final CstType ANNOTATION_DEFAULT_TYPE = + private static final CstType ANNOTATION_DEFAULT_TYPE = CstType.intern(Type.intern("Ldalvik/annotation/AnnotationDefault;")); /** {@code non-null;} type for {@code EnclosingClass} annotations */ - private static final CstType ENCLOSING_CLASS_TYPE = + private static final CstType ENCLOSING_CLASS_TYPE = CstType.intern(Type.intern("Ldalvik/annotation/EnclosingClass;")); /** {@code non-null;} type for {@code EnclosingMethod} annotations */ - private static final CstType ENCLOSING_METHOD_TYPE = + private static final CstType ENCLOSING_METHOD_TYPE = CstType.intern(Type.intern("Ldalvik/annotation/EnclosingMethod;")); /** {@code non-null;} type for {@code InnerClass} annotations */ - private static final CstType INNER_CLASS_TYPE = + private static final CstType INNER_CLASS_TYPE = CstType.intern(Type.intern("Ldalvik/annotation/InnerClass;")); /** {@code non-null;} type for {@code MemberClasses} annotations */ - private static final CstType MEMBER_CLASSES_TYPE = + private static final CstType MEMBER_CLASSES_TYPE = CstType.intern(Type.intern("Ldalvik/annotation/MemberClasses;")); /** {@code non-null;} type for {@code Signature} annotations */ - private static final CstType SIGNATURE_TYPE = + private static final CstType SIGNATURE_TYPE = CstType.intern(Type.intern("Ldalvik/annotation/Signature;")); /** {@code non-null;} type for {@code Throws} annotations */ - private static final CstType THROWS_TYPE = + private static final CstType THROWS_TYPE = CstType.intern(Type.intern("Ldalvik/annotation/Throws;")); /** {@code non-null;} the UTF-8 constant {@code "accessFlags"} */ @@ -84,7 +84,7 @@ public final class AnnotationUtils { /** * Constructs a standard {@code AnnotationDefault} annotation. - * + * * @param defaults {@code non-null;} the defaults, itself as an annotation * @return {@code non-null;} the constructed annotation */ @@ -98,7 +98,7 @@ public final class AnnotationUtils { /** * Constructs a standard {@code EnclosingClass} annotation. - * + * * @param clazz {@code non-null;} the enclosing class * @return {@code non-null;} the annotation */ @@ -112,7 +112,7 @@ public final class AnnotationUtils { /** * Constructs a standard {@code EnclosingMethod} annotation. - * + * * @param method {@code non-null;} the enclosing method * @return {@code non-null;} the annotation */ @@ -126,7 +126,7 @@ public final class AnnotationUtils { /** * Constructs a standard {@code InnerClass} annotation. - * + * * @param name {@code null-ok;} the original name of the class, or * {@code null} to represent an anonymous class * @param accessFlags the original access flags @@ -146,7 +146,7 @@ public final class AnnotationUtils { /** * Constructs a standard {@code MemberClasses} annotation. - * + * * @param types {@code non-null;} the list of (the types of) the member classes * @return {@code non-null;} the annotation */ @@ -160,7 +160,7 @@ public final class AnnotationUtils { /** * Constructs a standard {@code Signature} annotation. - * + * * @param signature {@code non-null;} the signature string * @return {@code non-null;} the annotation */ @@ -171,7 +171,7 @@ public final class AnnotationUtils { * Split the string into pieces that are likely to be common * across many signatures and the rest of the file. */ - + String raw = signature.getString(); int rawLength = raw.length(); ArrayList<String> pieces = new ArrayList<String>(20); @@ -214,7 +214,7 @@ public final class AnnotationUtils { } list.setImmutable(); - + result.put(new NameValuePair(VALUE_UTF, new CstArray(list))); result.setImmutable(); return result; @@ -222,7 +222,7 @@ public final class AnnotationUtils { /** * Constructs a standard {@code Throws} annotation. - * + * * @param types {@code non-null;} the list of thrown types * @return {@code non-null;} the annotation */ @@ -236,7 +236,7 @@ public final class AnnotationUtils { /** * Converts a {@link TypeList} to a {@link CstArray}. - * + * * @param types {@code non-null;} the type list * @return {@code non-null;} the corresponding array constant */ diff --git a/dx/src/com/android/dx/dex/file/AnnotationsDirectoryItem.java b/dx/src/com/android/dx/dex/file/AnnotationsDirectoryItem.java index d55195f97..972d4e6c1 100644 --- a/dx/src/com/android/dx/dex/file/AnnotationsDirectoryItem.java +++ b/dx/src/com/android/dx/dex/file/AnnotationsDirectoryItem.java @@ -42,7 +42,7 @@ public final class AnnotationsDirectoryItem extends OffsettedItem { /** {@code null-ok;} the class-level annotations, if any */ private AnnotationSetItem classAnnotations; - + /** {@code null-ok;} the annotated fields, if any */ private ArrayList<FieldAnnotationStruct> fieldAnnotations; @@ -63,7 +63,7 @@ public final class AnnotationsDirectoryItem extends OffsettedItem { methodAnnotations = null; parameterAnnotations = null; } - + /** {@inheritDoc} */ @Override public ItemType itemType() { @@ -72,7 +72,7 @@ public final class AnnotationsDirectoryItem extends OffsettedItem { /** * Returns whether this item is empty (has no contents). - * + * * @return {@code true} if this item is empty, or {@code false} * if not */ @@ -104,16 +104,16 @@ public final class AnnotationsDirectoryItem extends OffsettedItem { if (classAnnotations == null) { return 0; } - + return classAnnotations.hashCode(); } - + /** * {@inheritDoc} - * + * * <p><b>Note:</b>: This throws an exception if this item is not * internable.</p> - * + * * @see #isInternable */ @Override @@ -131,14 +131,14 @@ public final class AnnotationsDirectoryItem extends OffsettedItem { * Sets the direct annotations on this instance. These are annotations * made on the class, per se, as opposed to on one of its members. * It is only valid to call this method at most once per instance. - * + * * @param annotations {@code non-null;} annotations to set for this class */ public void setClassAnnotations(Annotations annotations) { if (annotations == null) { throw new NullPointerException("annotations == null"); } - + if (classAnnotations != null) { throw new UnsupportedOperationException( "class annotations already set"); @@ -149,7 +149,7 @@ public final class AnnotationsDirectoryItem extends OffsettedItem { /** * Adds a field annotations item to this instance. - * + * * @param field {@code non-null;} field in question * @param annotations {@code non-null;} associated annotations to add */ @@ -158,14 +158,14 @@ public final class AnnotationsDirectoryItem extends OffsettedItem { if (fieldAnnotations == null) { fieldAnnotations = new ArrayList<FieldAnnotationStruct>(); } - + fieldAnnotations.add(new FieldAnnotationStruct(field, new AnnotationSetItem(annotations))); } /** * Adds a method annotations item to this instance. - * + * * @param method {@code non-null;} method in question * @param annotations {@code non-null;} associated annotations to add */ @@ -181,7 +181,7 @@ public final class AnnotationsDirectoryItem extends OffsettedItem { /** * Adds a parameter annotations item to this instance. - * + * * @param method {@code non-null;} method in question * @param list {@code non-null;} associated list of annotation sets to add */ @@ -197,7 +197,7 @@ public final class AnnotationsDirectoryItem extends OffsettedItem { /** * Gets the method annotations for a given method, if any. This is * meant for use by debugging / dumping code. - * + * * @param method {@code non-null;} the method * @return {@code null-ok;} the method annotations, if any */ @@ -205,7 +205,7 @@ public final class AnnotationsDirectoryItem extends OffsettedItem { if (methodAnnotations == null) { return null; } - + for (MethodAnnotationStruct item : methodAnnotations) { if (item.getMethod().equals(method)) { return item.getAnnotations(); @@ -218,7 +218,7 @@ public final class AnnotationsDirectoryItem extends OffsettedItem { /** * Gets the parameter annotations for a given method, if any. This is * meant for use by debugging / dumping code. - * + * * @param method {@code non-null;} the method * @return {@code null-ok;} the parameter annotations, if any */ @@ -235,7 +235,7 @@ public final class AnnotationsDirectoryItem extends OffsettedItem { return null; } - + /** {@inheritDoc} */ public void addContents(DexFile file) { MixedItemSection wordData = file.getWordData(); @@ -255,7 +255,7 @@ public final class AnnotationsDirectoryItem extends OffsettedItem { item.addContents(file); } } - + if (parameterAnnotations != null) { for (ParameterAnnotationStruct item : parameterAnnotations) { item.addContents(file); @@ -338,7 +338,7 @@ public final class AnnotationsDirectoryItem extends OffsettedItem { /** * Gets the list size of the given list, or {@code 0} if given * {@code null}. - * + * * @param list {@code null-ok;} the list in question * @return {@code >= 0;} its size */ @@ -353,7 +353,7 @@ public final class AnnotationsDirectoryItem extends OffsettedItem { /** * Prints out the contents of this instance, in a debugging-friendly * way. This is meant to be called from {@link ClassDefItem#debugPrint}. - * + * * @param out {@code non-null;} where to output to */ /*package*/ void debugPrint(PrintWriter out) { @@ -374,12 +374,12 @@ public final class AnnotationsDirectoryItem extends OffsettedItem { out.println(" " + item.toHuman()); } } - + if (parameterAnnotations != null) { out.println(" parameter annotations:"); for (ParameterAnnotationStruct item : parameterAnnotations) { out.println(" " + item.toHuman()); } } - } + } } diff --git a/dx/src/com/android/dx/dex/file/CatchStructs.java b/dx/src/com/android/dx/dex/file/CatchStructs.java index 341201538..e07ec294e 100644 --- a/dx/src/com/android/dx/dex/file/CatchStructs.java +++ b/dx/src/com/android/dx/dex/file/CatchStructs.java @@ -38,13 +38,13 @@ import java.util.TreeMap; public final class CatchStructs { /** * the size of a {@code try_item}: a {@code uint} - * and two {@code ushort}s + * and two {@code ushort}s */ private static final int TRY_ITEM_WRITE_SIZE = 4 + (2 * 2); /** {@code non-null;} code that contains the catches */ private final DalvCode code; - + /** * {@code null-ok;} the underlying table; set in * {@link #finishProcessingIfNecessary} @@ -71,7 +71,7 @@ public final class CatchStructs { /** * Constructs an instance. - * + * * @param code {@code non-null;} code that contains the catches */ public CatchStructs(DalvCode code) { @@ -93,7 +93,7 @@ public final class CatchStructs { /** * Gets the size of the tries list, in entries. - * + * * @return {@code >= 0;} the tries list size */ public int triesSize() { @@ -103,7 +103,7 @@ public final class CatchStructs { /** * Does a human-friendly dump of this instance. - * + * * @param out {@code non-null;} where to dump * @param prefix {@code non-null;} prefix to attach to each line of output */ @@ -113,7 +113,7 @@ public final class CatchStructs { /** * Encodes the handler lists. - * + * * @param file {@code non-null;} file this instance is part of */ public void encode(DexFile file) { @@ -136,13 +136,13 @@ public final class CatchStructs { throw new UnsupportedOperationException( "too many catch handlers"); } - + ByteArrayAnnotatedOutput out = new ByteArrayAnnotatedOutput(); // Write out the handlers "header" consisting of its size in entries. encodedHandlerHeaderSize = out.writeUnsignedLeb128(handlerOffsets.size()); - + // Now write the lists out in order, noting the offset of each. for (Map.Entry<CatchHandlerList, Integer> mapping : handlerOffsets.entrySet()) { @@ -178,17 +178,17 @@ public final class CatchStructs { /** * Gets the write size of this instance, in bytes. - * + * * @return {@code >= 0;} the write size */ public int writeSize() { return (triesSize() * TRY_ITEM_WRITE_SIZE) + + encodedHandlers.length; } - + /** * Writes this instance to the given stream. - * + * * @param file {@code non-null;} file this instance is part of * @param out {@code non-null;} where to write to */ @@ -216,7 +216,7 @@ public final class CatchStructs { out.writeShort(insnCount); out.writeShort(handlerOffsets.get(one.getHandlers())); } - + out.write(encodedHandlers); } @@ -224,7 +224,7 @@ public final class CatchStructs { * Helper method to annotate or simply print the exception handlers. * Only one of {@code printTo} or {@code annotateTo} should * be non-null. - * + * * @param prefix {@code non-null;} prefix for each line * @param printTo {@code null-ok;} where to print to * @param annotateTo {@code null-ok;} where to consume bytes and annotate to @@ -272,7 +272,7 @@ public final class CatchStructs { int lastOffset = 0; CatchHandlerList lastList = null; - + for (Map.Entry<CatchHandlerList, Integer> mapping : handlerOffsets.entrySet()) { CatchHandlerList list = mapping.getKey(); @@ -295,7 +295,7 @@ public final class CatchStructs { /** * Helper for {@link #annotateEntries} to annotate a catch handler list * while consuming it. - * + * * @param handlers {@code non-null;} handlers to annotate * @param offset {@code >= 0;} the offset of this handler * @param size {@code >= 1;} the number of bytes the handlers consume diff --git a/dx/src/com/android/dx/dex/file/ClassDataItem.java b/dx/src/com/android/dx/dex/file/ClassDataItem.java index 4823f9f5f..275ae9980 100644 --- a/dx/src/com/android/dx/dex/file/ClassDataItem.java +++ b/dx/src/com/android/dx/dex/file/ClassDataItem.java @@ -43,7 +43,7 @@ import java.util.HashMap; public final class ClassDataItem extends OffsettedItem { /** {@code non-null;} what class this data is for, just for listing generation */ private final CstType thisClass; - + /** {@code non-null;} list of static fields */ private final ArrayList<EncodedField> staticFields; @@ -71,7 +71,7 @@ public final class ClassDataItem extends OffsettedItem { /** * Constructs an instance. Its sets of members are initially * empty. - * + * * @param thisClass {@code non-null;} what class this data is for, just * for listing generation */ @@ -105,7 +105,7 @@ public final class ClassDataItem extends OffsettedItem { /** * Returns whether this instance is empty. - * + * * @return {@code true} if this instance is empty or * {@code false} if at least one element has been added to it */ @@ -116,7 +116,7 @@ public final class ClassDataItem extends OffsettedItem { /** * Adds a static field. - * + * * @param field {@code non-null;} the field to add * @param value {@code null-ok;} initial value for the field, if any */ @@ -136,7 +136,7 @@ public final class ClassDataItem extends OffsettedItem { /** * Adds an instance field. - * + * * @param field {@code non-null;} the field to add */ public void addInstanceField(EncodedField field) { @@ -149,7 +149,7 @@ public final class ClassDataItem extends OffsettedItem { /** * Adds a direct ({@code static} and/or {@code private}) method. - * + * * @param method {@code non-null;} the method to add */ public void addDirectMethod(EncodedMethod method) { @@ -162,7 +162,7 @@ public final class ClassDataItem extends OffsettedItem { /** * Adds a virtual method. - * + * * @param method {@code non-null;} the method to add */ public void addVirtualMethod(EncodedMethod method) { @@ -177,7 +177,7 @@ public final class ClassDataItem extends OffsettedItem { * Gets all the methods in this class. The returned list is not linked * in any way to the underlying lists contained in this instance, but * the objects contained in the list are shared. - * + * * @return {@code non-null;} list of all methods */ public ArrayList<EncodedMethod> getMethods() { @@ -194,7 +194,7 @@ public final class ClassDataItem extends OffsettedItem { /** * Prints out the contents of this instance, in a debugging-friendly * way. - * + * * @param out {@code non-null;} where to output to * @param verbose whether to be verbose with the output */ @@ -259,7 +259,7 @@ public final class ClassDataItem extends OffsettedItem { /** * Gets a {@link CstArray} corresponding to {@link #staticValues} if * it contains any non-zero non-{@code null} values. - * + * * @return {@code null-ok;} the corresponding constant or {@code null} if * there are no values to encode */ @@ -274,14 +274,14 @@ public final class ClassDataItem extends OffsettedItem { /** * Gets a {@link CstArray} corresponding to {@link #staticValues} if * it contains any non-zero non-{@code null} values. - * + * * @return {@code null-ok;} the corresponding constant or {@code null} if * there are no values to encode */ private CstArray makeStaticValuesConstant() { // First sort the statics into their final order. Collections.sort(staticFields); - + /* * Get the size of staticValues minus any trailing zeros/nulls (both * nulls per se as well as instances of CstKnownNull). @@ -305,9 +305,9 @@ public final class ClassDataItem extends OffsettedItem { if (size == 0) { return null; } - + // There is something worth encoding, so build up a result. - + CstArray.List list = new CstArray.List(size); for (int i = 0; i < size; i++) { EncodedField field = staticFields.get(i); @@ -336,7 +336,7 @@ public final class ClassDataItem extends OffsettedItem { /** * Writes out the encoded form of this instance. - * + * * @param file {@code non-null;} file this instance is part of * @param out {@code non-null;} where to write to */ @@ -362,11 +362,11 @@ public final class ClassDataItem extends OffsettedItem { out.endAnnotation(); } } - + /** * Helper for {@link #encodeOutput}, which writes out the given * size value, annotating it as well (if annotations are enabled). - * + * * @param file {@code non-null;} file this instance is part of * @param out {@code non-null;} where to write to * @param label {@code non-null;} the label for the purposes of annotation @@ -386,7 +386,7 @@ public final class ClassDataItem extends OffsettedItem { * Helper for {@link #encodeOutput}, which writes out the given * list. It also annotates the items (if any and if annotations * are enabled). - * + * * @param file {@code non-null;} file this instance is part of * @param out {@code non-null;} where to write to * @param label {@code non-null;} the label for the purposes of annotation @@ -400,7 +400,7 @@ public final class ClassDataItem extends OffsettedItem { if (size == 0) { return; } - + if (out.annotates()) { out.annotate(0, " " + label + ":"); } diff --git a/dx/src/com/android/dx/dex/file/ClassDefItem.java b/dx/src/com/android/dx/dex/file/ClassDefItem.java index acd8cf515..4d1719b73 100644 --- a/dx/src/com/android/dx/dex/file/ClassDefItem.java +++ b/dx/src/com/android/dx/dex/file/ClassDefItem.java @@ -53,7 +53,7 @@ public final class ClassDefItem extends IndexedItem { /** * {@code null-ok;} superclass or {@code null} if this class is a/the - * root class + * root class */ private final CstType superclass; @@ -78,7 +78,7 @@ public final class ClassDefItem extends IndexedItem { /** * Constructs an instance. Its sets of members and annotations are * initially empty. - * + * * @param thisClass {@code non-null;} type constant for this class * @param accessFlags access flags * @param superclass {@code null-ok;} superclass or {@code null} if @@ -105,7 +105,7 @@ public final class ClassDefItem extends IndexedItem { this.thisClass = thisClass; this.accessFlags = accessFlags; this.superclass = superclass; - this.interfaces = + this.interfaces = (interfaces.size() == 0) ? null : new TypeListItem(interfaces); this.sourceFile = sourceFile; this.classData = new ClassDataItem(thisClass); @@ -188,7 +188,7 @@ public final class ClassDefItem extends IndexedItem { if (annotates) { out.annotate(0, indexString() + ' ' + thisClass.toHuman()); out.annotate(4, " class_idx: " + Hex.u4(classIdx)); - out.annotate(4, " access_flags: " + + out.annotate(4, " access_flags: " + AccessFlags.classString(accessFlags)); out.annotate(4, " superclass_idx: " + Hex.u4(superIdx) + " // " + ((superclass == null) ? "<none>" : @@ -222,7 +222,7 @@ public final class ClassDefItem extends IndexedItem { /** * Gets the constant corresponding to this class. - * + * * @return {@code non-null;} the constant */ public CstType getThisClass() { @@ -231,7 +231,7 @@ public final class ClassDefItem extends IndexedItem { /** * Gets the access flags. - * + * * @return the access flags */ public int getAccessFlags() { @@ -240,7 +240,7 @@ public final class ClassDefItem extends IndexedItem { /** * Gets the superclass. - * + * * @return {@code null-ok;} the superclass or {@code null} if * this class is a/the root class */ @@ -250,7 +250,7 @@ public final class ClassDefItem extends IndexedItem { /** * Gets the list of interfaces implemented. - * + * * @return {@code non-null;} the interfaces list */ public TypeList getInterfaces() { @@ -263,7 +263,7 @@ public final class ClassDefItem extends IndexedItem { /** * Gets the source file name. - * + * * @return {@code null-ok;} the source file name or {@code null} if unknown */ public CstUtf8 getSourceFile() { @@ -272,7 +272,7 @@ public final class ClassDefItem extends IndexedItem { /** * Adds a static field. - * + * * @param field {@code non-null;} the field to add * @param value {@code null-ok;} initial value for the field, if any */ @@ -282,7 +282,7 @@ public final class ClassDefItem extends IndexedItem { /** * Adds an instance field. - * + * * @param field {@code non-null;} the field to add */ public void addInstanceField(EncodedField field) { @@ -291,7 +291,7 @@ public final class ClassDefItem extends IndexedItem { /** * Adds a direct ({@code static} and/or {@code private}) method. - * + * * @param method {@code non-null;} the method to add */ public void addDirectMethod(EncodedMethod method) { @@ -300,7 +300,7 @@ public final class ClassDefItem extends IndexedItem { /** * Adds a virtual method. - * + * * @param method {@code non-null;} the method to add */ public void addVirtualMethod(EncodedMethod method) { @@ -311,7 +311,7 @@ public final class ClassDefItem extends IndexedItem { * Gets all the methods in this class. The returned list is not linked * in any way to the underlying lists contained in this instance, but * the objects contained in the list are shared. - * + * * @return {@code non-null;} list of all methods */ public ArrayList<EncodedMethod> getMethods() { @@ -322,7 +322,7 @@ public final class ClassDefItem extends IndexedItem { * Sets the direct annotations on this class. These are annotations * made on the class, per se, as opposed to on one of its members. * It is only valid to call this method at most once per instance. - * + * * @param annotations {@code non-null;} annotations to set for this class */ public void setClassAnnotations(Annotations annotations) { @@ -331,7 +331,7 @@ public final class ClassDefItem extends IndexedItem { /** * Adds a field annotations item to this class. - * + * * @param field {@code non-null;} field in question * @param annotations {@code non-null;} associated annotations to add */ @@ -342,7 +342,7 @@ public final class ClassDefItem extends IndexedItem { /** * Adds a method annotations item to this class. - * + * * @param method {@code non-null;} method in question * @param annotations {@code non-null;} associated annotations to add */ @@ -353,7 +353,7 @@ public final class ClassDefItem extends IndexedItem { /** * Adds a parameter annotations item to this class. - * + * * @param method {@code non-null;} method in question * @param list {@code non-null;} associated list of annotation sets to add */ @@ -365,7 +365,7 @@ public final class ClassDefItem extends IndexedItem { /** * Gets the method annotations for a given method, if any. This is * meant for use by debugging / dumping code. - * + * * @param method {@code non-null;} the method * @return {@code null-ok;} the method annotations, if any */ @@ -376,18 +376,18 @@ public final class ClassDefItem extends IndexedItem { /** * Gets the parameter annotations for a given method, if any. This is * meant for use by debugging / dumping code. - * + * * @param method {@code non-null;} the method * @return {@code null-ok;} the parameter annotations, if any */ public AnnotationsList getParameterAnnotations(CstMethodRef method) { return annotationsDirectory.getParameterAnnotations(method); } - + /** * Prints out the contents of this instance, in a debugging-friendly * way. - * + * * @param out {@code non-null;} where to output to * @param verbose whether to be verbose with the output */ @@ -404,7 +404,7 @@ public final class ClassDefItem extends IndexedItem { classData.debugPrint(out, verbose); annotationsDirectory.debugPrint(pw); - + pw.println("}"); } } diff --git a/dx/src/com/android/dx/dex/file/ClassDefsSection.java b/dx/src/com/android/dx/dex/file/ClassDefsSection.java index e8efd5745..1ca391f7f 100644 --- a/dx/src/com/android/dx/dex/file/ClassDefsSection.java +++ b/dx/src/com/android/dx/dex/file/ClassDefsSection.java @@ -42,7 +42,7 @@ public final class ClassDefsSection extends UniformItemSection { /** * Constructs an instance. The file offset is initially unknown. - * + * * @param file {@code non-null;} file that this instance is part of */ public ClassDefsSection(DexFile file) { @@ -58,7 +58,7 @@ public final class ClassDefsSection extends UniformItemSection { if (orderedDefs != null) { return orderedDefs; } - + return classDefs.values(); } @@ -83,7 +83,7 @@ public final class ClassDefsSection extends UniformItemSection { /** * Writes the portion of the file header that refers to this instance. - * + * * @param out {@code non-null;} where to write */ public void writeHeaderPart(AnnotatedOutput out) { @@ -104,7 +104,7 @@ public final class ClassDefsSection extends UniformItemSection { /** * Adds an element to this instance. It is illegal to attempt to add more * than one class with the same name. - * + * * @param clazz {@code non-null;} the class def to add */ public void add(ClassDefItem clazz) { @@ -148,7 +148,7 @@ public final class ClassDefsSection extends UniformItemSection { /** * Helper for {@link #orderItems}, which recursively assigns indices * to classes. - * + * * @param type {@code null-ok;} type ref to assign, if any * @param idx {@code >= 0;} the next index to assign * @param maxDepth maximum recursion depth; if negative, this will diff --git a/dx/src/com/android/dx/dex/file/CodeItem.java b/dx/src/com/android/dx/dex/file/CodeItem.java index ab7abbebb..a47f68ae7 100644 --- a/dx/src/com/android/dx/dex/file/CodeItem.java +++ b/dx/src/com/android/dx/dex/file/CodeItem.java @@ -62,7 +62,7 @@ public final class CodeItem extends OffsettedItem { /** * {@code non-null;} list of possibly-thrown exceptions; just used in - * generating debugging output (listings) + * generating debugging output (listings) */ private final TypeList throwsList; @@ -74,7 +74,7 @@ public final class CodeItem extends OffsettedItem { /** * Constructs an instance. - * + * * @param ref {@code non-null;} method that this code implements * @param code {@code non-null;} the underlying code * @param isStatic whether this instance is for a {@code static} @@ -148,7 +148,7 @@ public final class CodeItem extends OffsettedItem { /** * Gets the reference to the method this instance implements. - * + * * @return {@code non-null;} the method reference */ public CstMethodRef getRef() { @@ -157,7 +157,7 @@ public final class CodeItem extends OffsettedItem { /** * Does a human-friendly dump of this instance. - * + * * @param out {@code non-null;} where to dump * @param prefix {@code non-null;} per-line prefix to use * @param verbose whether to be verbose with the output @@ -192,7 +192,7 @@ public final class CodeItem extends OffsettedItem { protected void place0(Section addedTo, int offset) { final DexFile file = addedTo.getFile(); int catchesSize; - + /* * In order to get the catches and insns, all the code's * constants need to be assigned indices. @@ -307,7 +307,7 @@ public final class CodeItem extends OffsettedItem { /** * Get the in registers count. - * + * * @return the count */ private int getInsSize() { @@ -316,7 +316,7 @@ public final class CodeItem extends OffsettedItem { /** * Get the out registers count. - * + * * @return the count */ private int getOutsSize() { @@ -325,7 +325,7 @@ public final class CodeItem extends OffsettedItem { /** * Get the total registers count. - * + * * @return the count */ private int getRegistersSize() { diff --git a/dx/src/com/android/dx/dex/file/DebugInfoDecoder.java b/dx/src/com/android/dx/dex/file/DebugInfoDecoder.java index cd2005526..e82381663 100644 --- a/dx/src/com/android/dx/dex/file/DebugInfoDecoder.java +++ b/dx/src/com/android/dx/dex/file/DebugInfoDecoder.java @@ -73,7 +73,7 @@ public class DebugInfoDecoder { /** current decoding state: line number */ private int line = 1; - + /** current decoding state: bytecode address */ private int address = 0; @@ -102,7 +102,7 @@ public class DebugInfoDecoder { this.desc = ref.getPrototype(); this.file = file; this.regSize = regSize; - + positions = new ArrayList<PositionEntry>(); locals = new ArrayList<LocalEntry>(); this.codesize = codesize; @@ -248,7 +248,7 @@ public class DebugInfoDecoder { throw new RuntimeException( "Mismatch between parameters_size and prototype"); } - + if (!isStatic) { // Start off with implicit 'this' entry LocalEntry thisEntry = @@ -353,7 +353,7 @@ public class DebugInfoDecoder { throw new RuntimeException("nonsensical " + "END_LOCAL on dead register v" + reg); } - + le = new LocalEntry(address, false, reg, prevle.nameIndex, prevle.typeIndex, prevle.signatureIndex); @@ -428,7 +428,7 @@ public class DebugInfoDecoder { DalvInsnList insns = code.getInsns(); int codeSize = insns.codeSize(); int countRegisters = insns.getRegistersSize(); - + try { validateEncode0(info, codeSize, countRegisters, isStatic, ref, file, pl, ll); @@ -441,7 +441,7 @@ public class DebugInfoDecoder { "while processing " + ref.toHuman()); } } - + private static void validateEncode0(byte[] info, int codeSize, int countRegisters, boolean isStatic, CstMethodRef ref, DexFile file, PositionList pl, LocalList ll) { @@ -516,7 +516,7 @@ public class DebugInfoDecoder { } } } - + int origSz = ll.size(); int decodeAt = 0; boolean problem = false; @@ -556,7 +556,7 @@ public class DebugInfoDecoder { problem = true; break; } - + if (decodedEntry.isStart != origEntry.isStart()) { System.err.println("local start/end mismatch at orig " + i + " / decoded " + decodeAt); @@ -569,7 +569,7 @@ public class DebugInfoDecoder { * parameter might not be marked as starting at 0 in the * original list. */ - if ((decodedAddress != origEntry.getAddress()) + if ((decodedAddress != origEntry.getAddress()) && !((decodedAddress == 0) && (decodedEntry.reg >= paramBase))) { System.err.println("local address mismatch at orig " + i + diff --git a/dx/src/com/android/dx/dex/file/DebugInfoItem.java b/dx/src/com/android/dx/dex/file/DebugInfoItem.java index 1c32bd7a0..6a41b18ea 100644 --- a/dx/src/com/android/dx/dex/file/DebugInfoItem.java +++ b/dx/src/com/android/dx/dex/file/DebugInfoItem.java @@ -36,7 +36,7 @@ public class DebugInfoItem extends OffsettedItem { /** {@code non-null;} the code this item represents */ private final DalvCode code; - + private byte[] encoded; private final boolean isStatic; @@ -80,7 +80,7 @@ public class DebugInfoItem extends OffsettedItem { "...while placing debug info for " + ref.toHuman()); } } - + /** {@inheritDoc} */ @Override public String toHuman() { @@ -99,7 +99,7 @@ public class DebugInfoItem extends OffsettedItem { */ public void annotateTo(DexFile file, AnnotatedOutput out, String prefix) { encode(file, prefix, null, out, false); - } + } /** * Does a human-friendly dump of this instance. diff --git a/dx/src/com/android/dx/dex/file/DexFile.java b/dx/src/com/android/dx/dex/file/DexFile.java index a829fed82..1cc9358bd 100644 --- a/dx/src/com/android/dx/dex/file/DexFile.java +++ b/dx/src/com/android/dx/dex/file/DexFile.java @@ -45,7 +45,7 @@ public final class DexFile { /** {@code non-null;} word data section */ private final MixedItemSection wordData; - /** + /** * {@code non-null;} type lists section. This is word data, but separating * it from {@link #wordData} helps break what would otherwise be a * circular dependency between the that and {@link #protoIds}. @@ -120,15 +120,15 @@ public final class DexFile { classDefs = new ClassDefsSection(this); map = new MixedItemSection("map", this, 4, SortType.NONE); - /* + /* * This is the list of sections in the order they appear in * the final output. */ sections = new Section[] { header, stringIds, typeIds, protoIds, fieldIds, methodIds, - classDefs, wordData, typeLists, stringData, byteData, + classDefs, wordData, typeLists, stringData, byteData, classData, map }; - + fileSize = -1; dumpWidth = 79; } @@ -136,7 +136,7 @@ public final class DexFile { /** * Adds a class to this instance. It is illegal to attempt to add more * than one class with the same name. - * + * * @param clazz {@code non-null;} the class to add */ public void add(ClassDefItem clazz) { @@ -145,7 +145,7 @@ public final class DexFile { /** * Gets the class definition with the given name, if any. - * + * * @param name {@code non-null;} the class name to look for * @return {@code null-ok;} the class with the given name, or {@code null} * if there is no such class @@ -163,7 +163,7 @@ public final class DexFile { /** * Writes the contents of this instance as either a binary or a * human-readable form, or both. - * + * * @param out {@code null-ok;} where to write to * @param humanOut {@code null-ok;} where to write human-oriented output to * @param verbose whether to be verbose when writing human-oriented output @@ -185,12 +185,12 @@ public final class DexFile { /** * Returns the contents of this instance as a {@code .dex} file, * in {@code byte[]} form. - * + * * @param humanOut {@code null-ok;} where to write human-oriented output to * @param verbose whether to be verbose when writing human-oriented output * @return {@code non-null;} a {@code .dex} file for this instance */ - public byte[] toDex(Writer humanOut, boolean verbose) + public byte[] toDex(Writer humanOut, boolean verbose) throws IOException { boolean annotate = (humanOut != null); ByteArrayAnnotatedOutput result = toDex0(annotate, verbose); @@ -204,7 +204,7 @@ public final class DexFile { /** * Sets the maximum width of the human-oriented dump of the instance. - * + * * @param dumpWidth {@code >= 40;} the width */ public void setDumpWidth(int dumpWidth) { @@ -217,10 +217,10 @@ public final class DexFile { /** * Gets the total file size, if known. - * + * * <p>This is package-scope in order to allow * the {@link HeaderSection} to set itself up properly.</p> - * + * * @return {@code >= 0;} the total file size * @throws RuntimeException thrown if the file size is not yet known */ @@ -234,11 +234,11 @@ public final class DexFile { /** * Gets the string data section. - * + * * <p>This is package-scope in order to allow * the various {@link Item} instances to add items to the * instance.</p> - * + * * @return {@code non-null;} the string data section */ /*package*/ MixedItemSection getStringData() { @@ -247,11 +247,11 @@ public final class DexFile { /** * Gets the word data section. - * + * * <p>This is package-scope in order to allow * the various {@link Item} instances to add items to the * instance.</p> - * + * * @return {@code non-null;} the word data section */ /*package*/ MixedItemSection getWordData() { @@ -260,11 +260,11 @@ public final class DexFile { /** * Gets the type lists section. - * + * * <p>This is package-scope in order to allow * the various {@link Item} instances to add items to the * instance.</p> - * + * * @return {@code non-null;} the word data section */ /*package*/ MixedItemSection getTypeLists() { @@ -273,10 +273,10 @@ public final class DexFile { /** * Gets the map section. - * + * * <p>This is package-scope in order to allow the header section * to query it.</p> - * + * * @return {@code non-null;} the map section */ /*package*/ MixedItemSection getMap() { @@ -285,11 +285,11 @@ public final class DexFile { /** * Gets the string identifiers section. - * + * * <p>This is package-scope in order to allow * the various {@link Item} instances to add items to the * instance.</p> - * + * * @return {@code non-null;} the string identifiers section */ /*package*/ StringIdsSection getStringIds() { @@ -298,11 +298,11 @@ public final class DexFile { /** * Gets the class definitions section. - * + * * <p>This is package-scope in order to allow * the various {@link Item} instances to add items to the * instance.</p> - * + * * @return {@code non-null;} the class definitions section */ /*package*/ ClassDefsSection getClassDefs() { @@ -311,11 +311,11 @@ public final class DexFile { /** * Gets the class data section. - * + * * <p>This is package-scope in order to allow * the various {@link Item} instances to add items to the * instance.</p> - * + * * @return {@code non-null;} the class data section */ /*package*/ MixedItemSection getClassData() { @@ -324,11 +324,11 @@ public final class DexFile { /** * Gets the type identifiers section. - * + * * <p>This is package-scope in order to allow * the various {@link Item} instances to add items to the * instance.</p> - * + * * @return {@code non-null;} the class identifiers section */ /*package*/ TypeIdsSection getTypeIds() { @@ -337,11 +337,11 @@ public final class DexFile { /** * Gets the prototype identifiers section. - * + * * <p>This is package-scope in order to allow * the various {@link Item} instances to add items to the * instance.</p> - * + * * @return {@code non-null;} the prototype identifiers section */ /*package*/ ProtoIdsSection getProtoIds() { @@ -350,11 +350,11 @@ public final class DexFile { /** * Gets the field identifiers section. - * + * * <p>This is package-scope in order to allow * the various {@link Item} instances to add items to the * instance.</p> - * + * * @return {@code non-null;} the field identifiers section */ /*package*/ FieldIdsSection getFieldIds() { @@ -363,11 +363,11 @@ public final class DexFile { /** * Gets the method identifiers section. - * + * * <p>This is package-scope in order to allow * the various {@link Item} instances to add items to the * instance.</p> - * + * * @return {@code non-null;} the method identifiers section */ /*package*/ MethodIdsSection getMethodIds() { @@ -390,10 +390,10 @@ public final class DexFile { /** * Gets the first section of the file that is to be considered * part of the data section. - * + * * <p>This is package-scope in order to allow the header section * to query it.</p> - * + * * @return {@code non-null;} the section */ /*package*/ Section getFirstDataSection() { @@ -403,21 +403,21 @@ public final class DexFile { /** * Gets the last section of the file that is to be considered * part of the data section. - * + * * <p>This is package-scope in order to allow the header section * to query it.</p> - * + * * @return {@code non-null;} the section */ /*package*/ Section getLastDataSection() { return map; } - + /** * Interns the given constant in the appropriate section of this * instance, or do nothing if the given constant isn't the sort * that should be interned. - * + * * @param cst {@code non-null;} constant to possibly intern */ /*package*/ void internIfAppropriate(Constant cst) { @@ -444,7 +444,7 @@ public final class DexFile { * {@code null} if it isn't such a constant. This will throw * an exception if the given constant <i>should</i> have been found * but wasn't. - * + * * @param cst {@code non-null;} the constant to look up * @return {@code null-ok;} its corresponding item, if it has a corresponding * item, or {@code null} if it's not that sort of constant @@ -468,7 +468,7 @@ public final class DexFile { /** * Returns the contents of this instance as a {@code .dex} file, * in a {@link ByteArrayAnnotatedOutput} instance. - * + * * @param annotate whether or not to keep annotations * @param verbose if annotating, whether to be verbose * @return {@code non-null;} a {@code .dex} file for this instance @@ -524,7 +524,7 @@ public final class DexFile { */ ((MixedItemSection) one).placeItems(); } - + offset = placedAt + one.writeSize(); } catch (RuntimeException ex) { throw ExceptionWithContext.withContext(ex, @@ -569,7 +569,7 @@ public final class DexFile { } // Perform final bookkeeping. - + calcSignature(barr); calcChecksum(barr); @@ -585,7 +585,7 @@ public final class DexFile { /** * Generates and returns statistics for all the items in the file. - * + * * @return {@code non-null;} the statistics */ public Statistics getStatistics() { @@ -601,7 +601,7 @@ public final class DexFile { /** * Calculates the signature for the {@code .dex} file in the * given array, and modify the array to contain it. - * + * * @param bytes {@code non-null;} the bytes of the file */ private static void calcSignature(byte[] bytes) { @@ -629,7 +629,7 @@ public final class DexFile { /** * Calculates the checksum for the {@code .dex} file in the * given array, and modify the array to contain it. - * + * * @param bytes {@code non-null;} the bytes of the file */ private static void calcChecksum(byte[] bytes) { diff --git a/dx/src/com/android/dx/dex/file/EncodedArrayItem.java b/dx/src/com/android/dx/dex/file/EncodedArrayItem.java index c55c6f503..4d904e789 100644 --- a/dx/src/com/android/dx/dex/file/EncodedArrayItem.java +++ b/dx/src/com/android/dx/dex/file/EncodedArrayItem.java @@ -47,7 +47,7 @@ public final class EncodedArrayItem extends OffsettedItem { /** * Constructs an instance. - * + * * @param array {@code non-null;} array to represent */ public EncodedArrayItem(CstArray array) { diff --git a/dx/src/com/android/dx/dex/file/EncodedField.java b/dx/src/com/android/dx/dex/file/EncodedField.java index 146a60452..f2a8184a8 100644 --- a/dx/src/com/android/dx/dex/file/EncodedField.java +++ b/dx/src/com/android/dx/dex/file/EncodedField.java @@ -35,7 +35,7 @@ public final class EncodedField extends EncodedMember /** * Constructs an instance. - * + * * @param field {@code non-null;} constant for the field * @param accessFlags access flags */ @@ -70,7 +70,7 @@ public final class EncodedField extends EncodedMember /** * {@inheritDoc} - * + * * <p><b>Note:</b> This compares the method constants only, * ignoring any associated code, because it should never be the * case that two different items with the same method constant @@ -121,7 +121,7 @@ public final class EncodedField extends EncodedMember /** * Gets the constant for the field. - * + * * @return {@code non-null;} the constant */ public CstFieldRef getRef() { @@ -130,7 +130,7 @@ public final class EncodedField extends EncodedMember /** {@inheritDoc} */ @Override - public int encode(DexFile file, AnnotatedOutput out, + public int encode(DexFile file, AnnotatedOutput out, int lastIndex, int dumpSeq) { int fieldIdx = file.getFieldIds().indexOf(field); int diff = fieldIdx - lastIndex; diff --git a/dx/src/com/android/dx/dex/file/EncodedMember.java b/dx/src/com/android/dx/dex/file/EncodedMember.java index 68119f3d4..509932531 100644 --- a/dx/src/com/android/dx/dex/file/EncodedMember.java +++ b/dx/src/com/android/dx/dex/file/EncodedMember.java @@ -65,14 +65,14 @@ public abstract class EncodedMember implements ToHuman { /** * Populates a {@link DexFile} with items from within this instance. - * + * * @param file {@code non-null;} the file to populate */ public abstract void addContents(DexFile file); /** * Encodes this instance to the given output. - * + * * @param file {@code non-null;} file this instance is part of * @param out {@code non-null;} where to write to * @param lastIndex {@code >= 0;} the previous member index value encoded, or @@ -81,6 +81,6 @@ public abstract class EncodedMember implements ToHuman { * annotation purposes * @return {@code >= 0;} the member index value that was encoded */ - public abstract int encode(DexFile file, AnnotatedOutput out, + public abstract int encode(DexFile file, AnnotatedOutput out, int lastIndex, int dumpSeq); } diff --git a/dx/src/com/android/dx/dex/file/EncodedMethod.java b/dx/src/com/android/dx/dex/file/EncodedMethod.java index dff1a0732..1b0770f49 100644 --- a/dx/src/com/android/dx/dex/file/EncodedMethod.java +++ b/dx/src/com/android/dx/dex/file/EncodedMethod.java @@ -30,20 +30,20 @@ import java.io.PrintWriter; /** * Class that representats a method of a class. */ -public final class EncodedMethod extends EncodedMember +public final class EncodedMethod extends EncodedMember implements Comparable<EncodedMethod> { /** {@code non-null;} constant for the method */ private final CstMethodRef method; /** * {@code null-ok;} code for the method, if the method is neither - * {@code abstract} nor {@code native} + * {@code abstract} nor {@code native} */ private final CodeItem code; /** * Constructs an instance. - * + * * @param method {@code non-null;} constant for the method * @param accessFlags access flags * @param code {@code null-ok;} code for the method, if it is neither @@ -80,7 +80,7 @@ public final class EncodedMethod extends EncodedMember /** * {@inheritDoc} - * + * * <p><b>Note:</b> This compares the method constants only, * ignoring any associated code, because it should never be the * case that two different items with the same method constant @@ -147,7 +147,7 @@ public final class EncodedMethod extends EncodedMember /** * Gets the constant for the method. - * + * * @return {@code non-null;} the constant */ public final CstMethodRef getRef() { @@ -156,14 +156,14 @@ public final class EncodedMethod extends EncodedMember /** {@inheritDoc} */ @Override - public int encode(DexFile file, AnnotatedOutput out, + public int encode(DexFile file, AnnotatedOutput out, int lastIndex, int dumpSeq) { int methodIdx = file.getMethodIds().indexOf(method); int diff = methodIdx - lastIndex; int accessFlags = getAccessFlags(); int codeOff = OffsettedItem.getAbsoluteOffsetOr0(code); boolean hasCode = (codeOff != 0); - boolean shouldHaveCode = (accessFlags & + boolean shouldHaveCode = (accessFlags & (AccessFlags.ACC_ABSTRACT | AccessFlags.ACC_NATIVE)) == 0; /* diff --git a/dx/src/com/android/dx/dex/file/FieldAnnotationStruct.java b/dx/src/com/android/dx/dex/file/FieldAnnotationStruct.java index 6a76ca926..f363d413c 100644 --- a/dx/src/com/android/dx/dex/file/FieldAnnotationStruct.java +++ b/dx/src/com/android/dx/dex/file/FieldAnnotationStruct.java @@ -35,7 +35,7 @@ public final class FieldAnnotationStruct /** * Constructs an instance. - * + * * @param field {@code non-null;} the field in question * @param annotations {@code non-null;} the associated annotations */ @@ -57,13 +57,13 @@ public final class FieldAnnotationStruct public int hashCode() { return field.hashCode(); } - + /** {@inheritDoc} */ public boolean equals(Object other) { if (! (other instanceof FieldAnnotationStruct)) { return false; } - + return field.equals(((FieldAnnotationStruct) other).field); } @@ -104,7 +104,7 @@ public final class FieldAnnotationStruct /** * Gets the field this item is for. - * + * * @return {@code non-null;} the field */ public CstFieldRef getField() { @@ -113,7 +113,7 @@ public final class FieldAnnotationStruct /** * Gets the associated annotations. - * + * * @return {@code non-null;} the annotations */ public Annotations getAnnotations() { diff --git a/dx/src/com/android/dx/dex/file/FieldIdItem.java b/dx/src/com/android/dx/dex/file/FieldIdItem.java index d6d01d518..ecb1d3df8 100644 --- a/dx/src/com/android/dx/dex/file/FieldIdItem.java +++ b/dx/src/com/android/dx/dex/file/FieldIdItem.java @@ -24,7 +24,7 @@ import com.android.dx.rop.cst.CstFieldRef; public final class FieldIdItem extends MemberIdItem { /** * Constructs an instance. - * + * * @param field {@code non-null;} the constant for the field */ public FieldIdItem(CstFieldRef field) { @@ -48,7 +48,7 @@ public final class FieldIdItem extends MemberIdItem { /** * Gets the field constant. - * + * * @return {@code non-null;} the constant */ public CstFieldRef getFieldRef() { @@ -61,10 +61,10 @@ public final class FieldIdItem extends MemberIdItem { TypeIdsSection typeIds = file.getTypeIds(); return typeIds.indexOf(getFieldRef().getType()); } - + /** {@inheritDoc} */ @Override protected String getTypoidName() { return "type_idx"; - } + } } diff --git a/dx/src/com/android/dx/dex/file/FieldIdsSection.java b/dx/src/com/android/dx/dex/file/FieldIdsSection.java index 59ef2294a..c3207311f 100644 --- a/dx/src/com/android/dx/dex/file/FieldIdsSection.java +++ b/dx/src/com/android/dx/dex/file/FieldIdsSection.java @@ -30,13 +30,13 @@ import java.util.TreeMap; public final class FieldIdsSection extends MemberIdsSection { /** * {@code non-null;} map from field constants to {@link - * FieldIdItem} instances + * FieldIdItem} instances */ private final TreeMap<CstFieldRef, FieldIdItem> fieldIds; /** * Constructs an instance. The file offset is initially unknown. - * + * * @param file {@code non-null;} file that this instance is part of */ public FieldIdsSection(DexFile file) { @@ -71,7 +71,7 @@ public final class FieldIdsSection extends MemberIdsSection { /** * Writes the portion of the file header that refers to this instance. - * + * * @param out {@code non-null;} where to write */ public void writeHeaderPart(AnnotatedOutput out) { @@ -91,7 +91,7 @@ public final class FieldIdsSection extends MemberIdsSection { /** * Interns an element into this instance. - * + * * @param field {@code non-null;} the reference to intern * @return {@code non-null;} the interned reference */ @@ -115,7 +115,7 @@ public final class FieldIdsSection extends MemberIdsSection { /** * Gets the index of the given reference, which must have been added * to this instance. - * + * * @param ref {@code non-null;} the reference to look up * @return {@code >= 0;} the reference's index */ diff --git a/dx/src/com/android/dx/dex/file/HeaderItem.java b/dx/src/com/android/dx/dex/file/HeaderItem.java index 65938599d..f95ff44be 100644 --- a/dx/src/com/android/dx/dex/file/HeaderItem.java +++ b/dx/src/com/android/dx/dex/file/HeaderItem.java @@ -48,7 +48,7 @@ public final class HeaderItem extends IndexedItem { public ItemType itemType() { return ItemType.TYPE_HEADER_ITEM; } - + /** {@inheritDoc} */ @Override public int writeSize() { @@ -70,7 +70,7 @@ public final class HeaderItem extends IndexedItem { int dataOff = firstDataSection.getFileOffset(); int dataSize = lastDataSection.getFileOffset() + lastDataSection.writeSize() - dataOff; - + if (out.annotates()) { out.annotate(8, "magic: " + new CstUtf8(MAGIC).toQuoted()); out.annotate(4, "checksum"); @@ -103,7 +103,7 @@ public final class HeaderItem extends IndexedItem { out.writeZeroes(8); out.writeInt(mapOff); - + // Write out each section's respective header part. file.getStringIds().writeHeaderPart(out); file.getTypeIds().writeHeaderPart(out); diff --git a/dx/src/com/android/dx/dex/file/HeaderSection.java b/dx/src/com/android/dx/dex/file/HeaderSection.java index 5bc627819..21da4881a 100644 --- a/dx/src/com/android/dx/dex/file/HeaderSection.java +++ b/dx/src/com/android/dx/dex/file/HeaderSection.java @@ -28,10 +28,10 @@ import java.util.List; public final class HeaderSection extends UniformItemSection { /** {@code non-null;} the list of the one item in the section */ private final List<HeaderItem> list; - + /** * Constructs an instance. The file offset is initially unknown. - * + * * @param file {@code non-null;} file that this instance is part of */ public HeaderSection(DexFile file) { diff --git a/dx/src/com/android/dx/dex/file/IdItem.java b/dx/src/com/android/dx/dex/file/IdItem.java index 5d7c9e320..1bd2b5faa 100644 --- a/dx/src/com/android/dx/dex/file/IdItem.java +++ b/dx/src/com/android/dx/dex/file/IdItem.java @@ -24,13 +24,13 @@ import com.android.dx.rop.cst.CstType; public abstract class IdItem extends IndexedItem { /** * {@code non-null;} the type constant for the defining class of - * the reference + * the reference */ private final CstType type; /** * Constructs an instance. - * + * * @param type {@code non-null;} the type constant for the defining * class of the reference */ @@ -52,7 +52,7 @@ public abstract class IdItem extends IndexedItem { /** * Gets the type constant for the defining class of the * reference. - * + * * @return {@code non-null;} the type constant */ public final CstType getDefiningClass() { diff --git a/dx/src/com/android/dx/dex/file/IndexedItem.java b/dx/src/com/android/dx/dex/file/IndexedItem.java index 32d69eaea..9ba478340 100644 --- a/dx/src/com/android/dx/dex/file/IndexedItem.java +++ b/dx/src/com/android/dx/dex/file/IndexedItem.java @@ -33,7 +33,7 @@ public abstract class IndexedItem extends Item { /** * Gets whether or not this instance has been assigned an index. - * + * * @return {@code true} iff this instance has been assigned an index */ public final boolean hasIndex() { @@ -72,7 +72,7 @@ public abstract class IndexedItem extends Item { /** * Gets the index of this item as a string, suitable for including in * annotations. - * + * * @return {@code non-null;} the index string */ public final String indexString() { diff --git a/dx/src/com/android/dx/dex/file/Item.java b/dx/src/com/android/dx/dex/file/Item.java index 057f218b2..cf2b380c3 100644 --- a/dx/src/com/android/dx/dex/file/Item.java +++ b/dx/src/com/android/dx/dex/file/Item.java @@ -32,15 +32,15 @@ public abstract class Item { /** * Returns the item type for this instance. - * + * * @return {@code non-null;} the item type */ public abstract ItemType itemType(); - + /** * Returns the human name for the particular type of item this * instance is. - * + * * @return {@code non-null;} the name */ public final String typeName() { @@ -49,7 +49,7 @@ public abstract class Item { /** * Gets the size of this instance when written, in bytes. - * + * * @return {@code >= 0;} the write size */ public abstract int writeSize(); @@ -58,10 +58,10 @@ public abstract class Item { * Populates a {@link DexFile} with items from within this instance. * This will <i>not</i> add an item to the file for this instance itself * (which should have been done by whatever refers to this instance). - * + * * <p><b>Note:</b> Subclasses must override this to do something * appropriate.</p> - * + * * @param file {@code non-null;} the file to populate */ public abstract void addContents(DexFile file); @@ -72,7 +72,7 @@ public abstract class Item { * If this instance keeps track of its offset, then this method will * note the written offset and will also throw an exception if this * instance has already been written. - * + * * @param file {@code non-null;} the file to use for reference * @param out {@code non-null;} where to write to */ diff --git a/dx/src/com/android/dx/dex/file/ItemType.java b/dx/src/com/android/dx/dex/file/ItemType.java index 83843b7a4..2fe97ab25 100644 --- a/dx/src/com/android/dx/dex/file/ItemType.java +++ b/dx/src/com/android/dx/dex/file/ItemType.java @@ -44,7 +44,7 @@ public enum ItemType implements ToHuman { TYPE_TYPE_ITEM( -1, "type_item"), TYPE_EXCEPTION_HANDLER_ITEM( -1, "exception_handler_item"), TYPE_ANNOTATION_SET_REF_ITEM( -1, "annotation_set_ref_item"); - + /** value when represented in a {@link MapItem} */ private final int mapValue; @@ -53,10 +53,10 @@ public enum ItemType implements ToHuman { /** {@code non-null;} the short human name */ private final String humanName; - + /** * Constructs an instance. - * + * * @param mapValue value when represented in a {@link MapItem} * @param typeName {@code non-null;} name of the type */ @@ -74,16 +74,16 @@ public enum ItemType implements ToHuman { /** * Gets the map value. - * + * * @return the map value */ public int getMapValue() { return mapValue; } - + /** * Gets the type name. - * + * * @return {@code non-null;} the type name */ public String getTypeName() { diff --git a/dx/src/com/android/dx/dex/file/MapItem.java b/dx/src/com/android/dx/dex/file/MapItem.java index c728dd7cd..d78dc9197 100644 --- a/dx/src/com/android/dx/dex/file/MapItem.java +++ b/dx/src/com/android/dx/dex/file/MapItem.java @@ -74,7 +74,7 @@ public final class MapItem extends OffsettedItem { throw new IllegalArgumentException( "mapSection.items().size() != 0"); } - + ArrayList<MapItem> items = new ArrayList<MapItem>(50); for (Section section : sections) { @@ -111,10 +111,10 @@ public final class MapItem extends OffsettedItem { mapSection.add( new UniformListItem<MapItem>(ItemType.TYPE_MAP_LIST, items)); } - + /** * Constructs an instance. - * + * * @param type {@code non-null;} item type this instance covers * @param section {@code non-null;} section this instance covers * @param firstItem {@code non-null;} first item covered @@ -155,7 +155,7 @@ public final class MapItem extends OffsettedItem { /** * Constructs a self-referential instance. This instance is meant to * represent the section containing the {@code map_list}. - * + * * @param section {@code non-null;} section this instance covers */ private MapItem(Section section) { @@ -231,5 +231,5 @@ public final class MapItem extends OffsettedItem { out.writeShort(0); // unused out.writeInt(itemCount); out.writeInt(offset); - } + } } diff --git a/dx/src/com/android/dx/dex/file/MemberIdItem.java b/dx/src/com/android/dx/dex/file/MemberIdItem.java index 574d41395..d3a61d4a2 100644 --- a/dx/src/com/android/dx/dex/file/MemberIdItem.java +++ b/dx/src/com/android/dx/dex/file/MemberIdItem.java @@ -34,7 +34,7 @@ public abstract class MemberIdItem extends IdItem { /** * Constructs an instance. - * + * * @param cst {@code non-null;} the constant for the member */ public MemberIdItem(CstMemberRef cst) { @@ -74,7 +74,7 @@ public abstract class MemberIdItem extends IdItem { out.annotate(2, String.format(" %-10s %s", getTypoidName() + ':', Hex.u2(typoidIdx))); out.annotate(4, " name_idx: " + Hex.u4(nameIdx)); - } + } out.writeShort(classIdx); out.writeShort(typoidIdx); @@ -85,24 +85,24 @@ public abstract class MemberIdItem extends IdItem { * Returns the index of the type-like thing associated with * this item, in order that it may be written out. Subclasses must * override this to get whatever it is they need to store. - * + * * @param file {@code non-null;} the file being written * @return the index in question */ protected abstract int getTypoidIdx(DexFile file); - + /** * Returns the field name of the type-like thing associated with * this item, for listing-generating purposes. Subclasses must override * this. - * + * * @return {@code non-null;} the name in question */ protected abstract String getTypoidName(); /** * Gets the member constant. - * + * * @return {@code non-null;} the constant */ public final CstMemberRef getRef() { diff --git a/dx/src/com/android/dx/dex/file/MemberIdsSection.java b/dx/src/com/android/dx/dex/file/MemberIdsSection.java index 20b160551..ef0d8cd92 100644 --- a/dx/src/com/android/dx/dex/file/MemberIdsSection.java +++ b/dx/src/com/android/dx/dex/file/MemberIdsSection.java @@ -22,7 +22,7 @@ package com.android.dx.dex.file; public abstract class MemberIdsSection extends UniformItemSection { /** * Constructs an instance. The file offset is initially unknown. - * + * * @param name {@code null-ok;} the name of this instance, for annotation * purposes * @param file {@code non-null;} file that this instance is part of diff --git a/dx/src/com/android/dx/dex/file/MethodAnnotationStruct.java b/dx/src/com/android/dx/dex/file/MethodAnnotationStruct.java index 3c254a199..38f7ce44b 100644 --- a/dx/src/com/android/dx/dex/file/MethodAnnotationStruct.java +++ b/dx/src/com/android/dx/dex/file/MethodAnnotationStruct.java @@ -35,7 +35,7 @@ public final class MethodAnnotationStruct /** * Constructs an instance. - * + * * @param method {@code non-null;} the method in question * @param annotations {@code non-null;} the associated annotations */ @@ -57,13 +57,13 @@ public final class MethodAnnotationStruct public int hashCode() { return method.hashCode(); } - + /** {@inheritDoc} */ public boolean equals(Object other) { if (! (other instanceof MethodAnnotationStruct)) { return false; } - + return method.equals(((MethodAnnotationStruct) other).method); } @@ -104,7 +104,7 @@ public final class MethodAnnotationStruct /** * Gets the method this item is for. - * + * * @return {@code non-null;} the method */ public CstMethodRef getMethod() { @@ -113,7 +113,7 @@ public final class MethodAnnotationStruct /** * Gets the associated annotations. - * + * * @return {@code non-null;} the annotations */ public Annotations getAnnotations() { diff --git a/dx/src/com/android/dx/dex/file/MethodIdItem.java b/dx/src/com/android/dx/dex/file/MethodIdItem.java index bbd6c932b..f2ff4f99d 100644 --- a/dx/src/com/android/dx/dex/file/MethodIdItem.java +++ b/dx/src/com/android/dx/dex/file/MethodIdItem.java @@ -24,7 +24,7 @@ import com.android.dx.rop.cst.CstBaseMethodRef; public final class MethodIdItem extends MemberIdItem { /** * Constructs an instance. - * + * * @param method {@code non-null;} the constant for the method */ public MethodIdItem(CstBaseMethodRef method) { @@ -48,7 +48,7 @@ public final class MethodIdItem extends MemberIdItem { /** * Gets the method constant. - * + * * @return {@code non-null;} the constant */ public CstBaseMethodRef getMethodRef() { @@ -61,10 +61,10 @@ public final class MethodIdItem extends MemberIdItem { ProtoIdsSection protoIds = file.getProtoIds(); return protoIds.indexOf(getMethodRef().getPrototype()); } - + /** {@inheritDoc} */ @Override protected String getTypoidName() { return "proto_idx"; - } + } } diff --git a/dx/src/com/android/dx/dex/file/MethodIdsSection.java b/dx/src/com/android/dx/dex/file/MethodIdsSection.java index f3e7deefd..fa0cd3c25 100644 --- a/dx/src/com/android/dx/dex/file/MethodIdsSection.java +++ b/dx/src/com/android/dx/dex/file/MethodIdsSection.java @@ -30,13 +30,13 @@ import java.util.TreeMap; public final class MethodIdsSection extends MemberIdsSection { /** * {@code non-null;} map from method constants to {@link - * MethodIdItem} instances + * MethodIdItem} instances */ private final TreeMap<CstBaseMethodRef, MethodIdItem> methodIds; /** * Constructs an instance. The file offset is initially unknown. - * + * * @param file {@code non-null;} file that this instance is part of */ public MethodIdsSection(DexFile file) { @@ -71,7 +71,7 @@ public final class MethodIdsSection extends MemberIdsSection { /** * Writes the portion of the file header that refers to this instance. - * + * * @param out {@code non-null;} where to write */ public void writeHeaderPart(AnnotatedOutput out) { @@ -91,7 +91,7 @@ public final class MethodIdsSection extends MemberIdsSection { /** * Interns an element into this instance. - * + * * @param method {@code non-null;} the reference to intern * @return {@code non-null;} the interned reference */ @@ -115,7 +115,7 @@ public final class MethodIdsSection extends MemberIdsSection { /** * Gets the index of the given reference, which must have been added * to this instance. - * + * * @param ref {@code non-null;} the reference to look up * @return {@code >= 0;} the reference's index */ diff --git a/dx/src/com/android/dx/dex/file/MixedItemSection.java b/dx/src/com/android/dx/dex/file/MixedItemSection.java index 0929fe761..b88530671 100644 --- a/dx/src/com/android/dx/dex/file/MixedItemSection.java +++ b/dx/src/com/android/dx/dex/file/MixedItemSection.java @@ -34,7 +34,7 @@ import java.util.TreeMap; * A section of a {@code .dex} file which consists of a sequence of * {@link OffsettedItem} objects, which may each be of a different concrete * class and/or size. - * + * * <b>Note:</b> It is invalid for an item in an instance of this class to * have a larger alignment requirement than the alignment of this instance. */ @@ -59,7 +59,7 @@ public final class MixedItemSection extends Section { return type1.compareTo(type2); } }; - + /** {@code non-null;} the items in this part */ private final ArrayList<OffsettedItem> items; @@ -77,7 +77,7 @@ public final class MixedItemSection extends Section { /** * Constructs an instance. The file offset is initially unknown. - * + * * @param name {@code null-ok;} the name of this instance, for annotation * purposes * @param file {@code non-null;} file that this instance is part of @@ -117,7 +117,7 @@ public final class MixedItemSection extends Section { /** * Gets the size of this instance, in items. - * + * * @return {@code >= 0;} the size */ public int size() { @@ -133,7 +133,7 @@ public final class MixedItemSection extends Section { throwIfNotPrepared(); if (writeSize == -1) { - throw new RuntimeException("write size not yet set"); + throw new RuntimeException("write size not yet set"); } int sz = writeSize; @@ -163,7 +163,7 @@ public final class MixedItemSection extends Section { * that it has been added to this instance. It is invalid to add the * same item to more than one instance, nor to add the same items * multiple times to a single instance. - * + * * @param item {@code non-null;} the item to add */ public void add(OffsettedItem item) { @@ -186,7 +186,7 @@ public final class MixedItemSection extends Section { * Interns an item in this instance, returning the interned instance * (which may not be the one passed in). This will add the item if no * equal item has been added. - * + * * @param item {@code non-null;} the item to intern * @return {@code non-null;} the equivalent interned instance */ @@ -194,7 +194,7 @@ public final class MixedItemSection extends Section { throwIfPrepared(); OffsettedItem result = interns.get(item); - + if (result != null) { return (T) result; } @@ -206,7 +206,7 @@ public final class MixedItemSection extends Section { /** * Gets an item which was previously interned. - * + * * @param item {@code non-null;} the item to look for * @return {@code non-null;} the equivalent already-interned instance */ @@ -214,7 +214,7 @@ public final class MixedItemSection extends Section { throwIfNotPrepared(); OffsettedItem result = interns.get(item); - + if (result != null) { return (T) result; } @@ -226,7 +226,7 @@ public final class MixedItemSection extends Section { * Writes an index of contents of the items in this instance of the * given type. If there are none, this writes nothing. If there are any, * then the index is preceded by the given intro string. - * + * * @param out {@code non-null;} where to write to * @param itemType {@code non-null;} the item type of interest * @param intro {@code non-null;} the introductory string for non-empty indices @@ -250,7 +250,7 @@ public final class MixedItemSection extends Section { } out.annotate(0, intro); - + for (Map.Entry<String, OffsettedItem> entry : index.entrySet()) { String label = entry.getKey(); OffsettedItem item = entry.getValue(); diff --git a/dx/src/com/android/dx/dex/file/OffsettedItem.java b/dx/src/com/android/dx/dex/file/OffsettedItem.java index c8e2d747b..772147066 100644 --- a/dx/src/com/android/dx/dex/file/OffsettedItem.java +++ b/dx/src/com/android/dx/dex/file/OffsettedItem.java @@ -33,20 +33,20 @@ public abstract class OffsettedItem extends Item /** * {@code null-ok;} section the item was added to, or {@code null} if - * not yet added + * not yet added */ private Section addedTo; /** * {@code >= -1;} assigned offset of the item from the start of its section, - * or {@code -1} if not yet assigned + * or {@code -1} if not yet assigned */ private int offset; /** * Gets the absolute offset of the given item, returning {@code 0} * if handed {@code null}. - * + * * @param item {@code null-ok;} the item in question * @return {@code >= 0;} the item's absolute offset, or {@code 0} * if {@code item == null} @@ -61,7 +61,7 @@ public abstract class OffsettedItem extends Item /** * Constructs an instance. The offset is initially unassigned. - * + * * @param alignment {@code > 0;} output alignment requirement; must be a * power of 2 * @param writeSize {@code >= -1;} the size of this instance when written, @@ -82,7 +82,7 @@ public abstract class OffsettedItem extends Item /** * {@inheritDoc} - * + * * Comparisons for this class are defined to be type-major (if the * types don't match then the objects are not equal), with * {@link #compareTo0} deciding same-type comparisons. @@ -106,7 +106,7 @@ public abstract class OffsettedItem extends Item /** * {@inheritDoc} - * + * * Comparisons for this class are defined to be class-major (if the * classes don't match then the objects are not equal), with * {@link #compareTo0} deciding same-class comparisons. @@ -130,7 +130,7 @@ public abstract class OffsettedItem extends Item * Sets the write size of this item. This may only be called once * per instance, and only if the size was unknown upon instance * creation. - * + * * @param writeSize {@code > 0;} the write size, in bytes */ public final void setWriteSize(int writeSize) { @@ -144,9 +144,9 @@ public abstract class OffsettedItem extends Item this.writeSize = writeSize; } - - /** {@inheritDoc} - * + + /** {@inheritDoc} + * * @throws UnsupportedOperationException thrown if the write size * is not yet known */ @@ -155,7 +155,7 @@ public abstract class OffsettedItem extends Item if (writeSize < 0) { throw new UnsupportedOperationException("writeSize is unknown"); } - + return writeSize; } @@ -181,7 +181,7 @@ public abstract class OffsettedItem extends Item /** * Gets the relative item offset. The offset is from the start of * the section which the instance was written to. - * + * * @return {@code >= 0;} the offset * @throws RuntimeException thrown if the offset is not yet known */ @@ -196,7 +196,7 @@ public abstract class OffsettedItem extends Item /** * Gets the absolute item offset. The offset is from the start of * the file which the instance was written to. - * + * * @return {@code >= 0;} the offset * @throws RuntimeException thrown if the offset is not yet known */ @@ -212,7 +212,7 @@ public abstract class OffsettedItem extends Item * Indicates that this item has been added to the given section at * the given offset. It is only valid to call this method once per * instance. - * + * * @param addedTo {@code non-null;} the section this instance has * been added to * @param offset {@code >= 0;} the desired offset from the start of the @@ -247,7 +247,7 @@ public abstract class OffsettedItem extends Item /** * Gets the alignment requirement of this instance. An instance should * only be written when so aligned. - * + * * @return {@code > 0;} the alignment requirement; must be a power of 2 */ public final int getAlignment() { @@ -257,7 +257,7 @@ public abstract class OffsettedItem extends Item /** * Gets the absolute offset of this item as a string, suitable for * including in annotations. - * + * * @return {@code non-null;} the offset string */ public final String offsetString() { @@ -266,7 +266,7 @@ public abstract class OffsettedItem extends Item /** * Gets a short human-readable string representing this instance. - * + * * @return {@code non-null;} the human form */ public abstract String toHuman(); @@ -277,7 +277,7 @@ public abstract class OffsettedItem extends Item * throw an exception (unsupported operation). If a particular * class needs to actually sort, then it should override this * method. - * + * * @param other {@code non-null;} instance to compare to * @return {@code -1}, {@code 0}, or {@code 1}, depending * on the sort order of this instance and the other @@ -293,7 +293,7 @@ public abstract class OffsettedItem extends Item * override this method. In particular, if this instance did not * know its write size up-front, then this method is responsible * for setting it. - * + * * @param addedTo {@code non-null;} the section this instance has been added to * @param offset {@code >= 0;} the offset from the start of the * section where this instance was placed @@ -306,7 +306,7 @@ public abstract class OffsettedItem extends Item * Performs the actual write of the contents of this instance to * the given data section. This is called by {@link #writeTo}, * which will have taken care of ensuring alignment. - * + * * @param file {@code non-null;} the file to use for reference * @param out {@code non-null;} where to write to */ diff --git a/dx/src/com/android/dx/dex/file/ParameterAnnotationStruct.java b/dx/src/com/android/dx/dex/file/ParameterAnnotationStruct.java index 46d045012..078c21986 100644 --- a/dx/src/com/android/dx/dex/file/ParameterAnnotationStruct.java +++ b/dx/src/com/android/dx/dex/file/ParameterAnnotationStruct.java @@ -41,7 +41,7 @@ public final class ParameterAnnotationStruct /** * Constructs an instance. - * + * * @param method {@code non-null;} the method in question * @param annotationsList {@code non-null;} the associated annotations list */ @@ -72,7 +72,7 @@ public final class ParameterAnnotationStruct AnnotationSetItem item = new AnnotationSetItem(annotations); arrayList.add(new AnnotationSetRefItem(item)); } - + this.annotationsItem = new UniformListItem<AnnotationSetRefItem>( ItemType.TYPE_ANNOTATION_SET_REF_LIST, arrayList); } @@ -81,13 +81,13 @@ public final class ParameterAnnotationStruct public int hashCode() { return method.hashCode(); } - + /** {@inheritDoc} */ public boolean equals(Object other) { if (! (other instanceof ParameterAnnotationStruct)) { return false; } - + return method.equals(((ParameterAnnotationStruct) other).method); } @@ -143,7 +143,7 @@ public final class ParameterAnnotationStruct /** * Gets the method this item is for. - * + * * @return {@code non-null;} the method */ public CstMethodRef getMethod() { @@ -152,7 +152,7 @@ public final class ParameterAnnotationStruct /** * Gets the associated annotations list. - * + * * @return {@code non-null;} the annotations list */ public AnnotationsList getAnnotationsList() { diff --git a/dx/src/com/android/dx/dex/file/ProtoIdItem.java b/dx/src/com/android/dx/dex/file/ProtoIdItem.java index afc227c2d..31cf8fbf7 100644 --- a/dx/src/com/android/dx/dex/file/ProtoIdItem.java +++ b/dx/src/com/android/dx/dex/file/ProtoIdItem.java @@ -45,7 +45,7 @@ public final class ProtoIdItem extends IndexedItem { /** * Constructs an instance. - * + * * @param prototype {@code non-null;} the constant for the prototype */ public ProtoIdItem(Prototype prototype) { @@ -57,13 +57,13 @@ public final class ProtoIdItem extends IndexedItem { this.shortForm = makeShortForm(prototype); StdTypeList parameters = prototype.getParameterTypes(); - this.parameterTypes = (parameters.size() == 0) ? null + this.parameterTypes = (parameters.size() == 0) ? null : new TypeListItem(parameters); } /** * Creates the short-form of the given prototype. - * + * * @param prototype {@code non-null;} the prototype * @return {@code non-null;} the short form */ @@ -83,7 +83,7 @@ public final class ProtoIdItem extends IndexedItem { /** * Gets the short-form character for the given type. - * + * * @param type {@code non-null;} the type * @return the corresponding short-form character */ @@ -130,7 +130,7 @@ public final class ProtoIdItem extends IndexedItem { int shortyIdx = file.getStringIds().indexOf(shortForm); int returnIdx = file.getTypeIds().indexOf(prototype.getReturnType()); int paramsOff = OffsettedItem.getAbsoluteOffsetOr0(parameterTypes); - + if (out.annotates()) { StringBuilder sb = new StringBuilder(); sb.append(prototype.getReturnType().toHuman()); @@ -145,7 +145,7 @@ public final class ProtoIdItem extends IndexedItem { } sb.append(params.getType(i).toHuman()); } - + sb.append(")"); out.annotate(0, indexString() + ' ' + sb.toString()); out.annotate(4, " shorty_idx: " + Hex.u4(shortyIdx) + diff --git a/dx/src/com/android/dx/dex/file/ProtoIdsSection.java b/dx/src/com/android/dx/dex/file/ProtoIdsSection.java index 8a95434fd..dc6e8ad98 100644 --- a/dx/src/com/android/dx/dex/file/ProtoIdsSection.java +++ b/dx/src/com/android/dx/dex/file/ProtoIdsSection.java @@ -36,7 +36,7 @@ public final class ProtoIdsSection extends UniformItemSection { /** * Constructs an instance. The file offset is initially unknown. - * + * * @param file {@code non-null;} file that this instance is part of */ public ProtoIdsSection(DexFile file) { @@ -59,7 +59,7 @@ public final class ProtoIdsSection extends UniformItemSection { /** * Writes the portion of the file header that refers to this instance. - * + * * @param out {@code non-null;} where to write */ public void writeHeaderPart(AnnotatedOutput out) { @@ -83,7 +83,7 @@ public final class ProtoIdsSection extends UniformItemSection { /** * Interns an element into this instance. - * + * * @param prototype {@code non-null;} the prototype to intern * @return {@code non-null;} the interned reference */ @@ -107,7 +107,7 @@ public final class ProtoIdsSection extends UniformItemSection { /** * Gets the index of the given prototype, which must have * been added to this instance. - * + * * @param prototype {@code non-null;} the prototype to look up * @return {@code >= 0;} the reference's index */ diff --git a/dx/src/com/android/dx/dex/file/Section.java b/dx/src/com/android/dx/dex/file/Section.java index f5b43af8e..3f04216a9 100644 --- a/dx/src/com/android/dx/dex/file/Section.java +++ b/dx/src/com/android/dx/dex/file/Section.java @@ -45,7 +45,7 @@ public abstract class Section { /** * Validates an alignment. - * + * * @param alignment the alignment * @throws IllegalArgumentException thrown if {@code alignment} * isn't a positive power of 2 @@ -89,9 +89,9 @@ public abstract class Section { return file; } - /** + /** * Gets the alignment for this instance's final output. - * + * * @return {@code > 0;} the alignment */ public final int getAlignment() { @@ -144,7 +144,7 @@ public abstract class Section { * @param out {@code non-null;} where to write to */ public final void writeTo(AnnotatedOutput out) { - throwIfNotPrepared(); + throwIfNotPrepared(); align(out); int cursor = out.getCursor(); @@ -173,7 +173,7 @@ public abstract class Section { * start of this instance's output. This is only valid to call * once this instance has been assigned a file offset (via {@link * #setFileOffset}). - * + * * @param relative {@code >= 0;} the relative offset * @return {@code >= 0;} the corresponding absolute file offset */ @@ -194,10 +194,10 @@ public abstract class Section { * be contained in this section. This is only valid to call * once this instance has been assigned a file offset (via {@link * #setFileOffset}). - * + * * <p><b>Note:</b> Subclasses must implement this as appropriate for * their contents.</p> - * + * * @param item {@code non-null;} the item in question * @return {@code >= 0;} the item's absolute file offset */ @@ -257,7 +257,7 @@ public abstract class Section { /** * Aligns the output of the given data to the alignment of this instance. - * + * * @param out {@code non-null;} the output to align */ protected final void align(AnnotatedOutput out) { @@ -271,14 +271,14 @@ public abstract class Section { * offset matches the actual cursor {@code out} or that the * file offset was not previously assigned, in which case it gets * assigned to {@code out}'s cursor. - * + * * @param out {@code non-null;} where to write to */ protected abstract void writeTo0(AnnotatedOutput out); /** * Returns the name of this section, for annotation purposes. - * + * * @return {@code null-ok;} name of this part, for annotation purposes */ protected final String getName() { diff --git a/dx/src/com/android/dx/dex/file/Statistics.java b/dx/src/com/android/dx/dex/file/Statistics.java index 9a2efb3b0..62e183286 100644 --- a/dx/src/com/android/dx/dex/file/Statistics.java +++ b/dx/src/com/android/dx/dex/file/Statistics.java @@ -38,7 +38,7 @@ public final class Statistics { /** * Adds the given item to the statistics. - * + * * @param item {@code non-null;} the item to add */ public void add(Item item) { @@ -54,7 +54,7 @@ public final class Statistics { /** * Adds the given list of items to the statistics. - * + * * @param list {@code non-null;} the list of items to add */ public void addAll(Section list) { @@ -66,7 +66,7 @@ public final class Statistics { /** * Writes the statistics as an annotation. - * + * * @param out {@code non-null;} where to write to */ public final void writeAnnotation(AnnotatedOutput out) { @@ -126,7 +126,7 @@ public final class Statistics { /** * Constructs an instance for the given item. - * + * * @param item {@code non-null;} item in question * @param name {@code non-null;} type name to use */ @@ -142,7 +142,7 @@ public final class Statistics { /** * Incorporates a new item. This assumes the type name matches. - * + * * @param item {@code non-null;} item to incorporate */ public void add(Item item) { @@ -162,7 +162,7 @@ public final class Statistics { /** * Writes this instance as an annotation. - * + * * @param out {@code non-null;} where to write to */ public void writeAnnotation(AnnotatedOutput out) { diff --git a/dx/src/com/android/dx/dex/file/StringDataItem.java b/dx/src/com/android/dx/dex/file/StringDataItem.java index b9eeb9bfb..80dbced8c 100644 --- a/dx/src/com/android/dx/dex/file/StringDataItem.java +++ b/dx/src/com/android/dx/dex/file/StringDataItem.java @@ -31,7 +31,7 @@ public final class StringDataItem extends OffsettedItem { /** * Constructs an instance. - * + * * @param value {@code non-null;} the string value */ public StringDataItem(CstUtf8 value) { @@ -42,13 +42,13 @@ public final class StringDataItem extends OffsettedItem { /** * Gets the write size for a given value. - * + * * @param value {@code non-null;} the string value * @return {@code >= 2}; the write size, in bytes */ private static int writeSize(CstUtf8 value) { int utf16Size = value.getUtf16Size(); - + // The +1 is for the '\0' termination byte. return Leb128Utils.unsignedLeb128Size(utf16Size) + value.getUtf8Size() + 1; @@ -73,7 +73,7 @@ public final class StringDataItem extends OffsettedItem { int utf16Size = value.getUtf16Size(); if (out.annotates()) { - out.annotate(Leb128Utils.unsignedLeb128Size(utf16Size), + out.annotate(Leb128Utils.unsignedLeb128Size(utf16Size), "utf16_size: " + Hex.u4(utf16Size)); out.annotate(bytes.size() + 1, value.toQuoted()); } diff --git a/dx/src/com/android/dx/dex/file/StringIdItem.java b/dx/src/com/android/dx/dex/file/StringIdItem.java index 401a0bef0..cd0d57b7d 100644 --- a/dx/src/com/android/dx/dex/file/StringIdItem.java +++ b/dx/src/com/android/dx/dex/file/StringIdItem.java @@ -36,7 +36,7 @@ public final class StringIdItem /** * Constructs an instance. - * + * * @param value {@code non-null;} the string value */ public StringIdItem(CstUtf8 value) { @@ -109,7 +109,7 @@ public final class StringIdItem /** * Gets the string value. - * + * * @return {@code non-null;} the value */ public CstUtf8 getValue() { @@ -118,7 +118,7 @@ public final class StringIdItem /** * Gets the associated data object for this instance, if known. - * + * * @return {@code null-ok;} the associated data object or {@code null} * if not yet known */ diff --git a/dx/src/com/android/dx/dex/file/StringIdsSection.java b/dx/src/com/android/dx/dex/file/StringIdsSection.java index b2e8683ed..9039f434a 100644 --- a/dx/src/com/android/dx/dex/file/StringIdsSection.java +++ b/dx/src/com/android/dx/dex/file/StringIdsSection.java @@ -33,13 +33,13 @@ public final class StringIdsSection extends UniformItemSection { /** * {@code non-null;} map from string constants to {@link - * StringIdItem} instances + * StringIdItem} instances */ private final TreeMap<CstUtf8, StringIdItem> strings; /** * Constructs an instance. The file offset is initially unknown. - * + * * @param file {@code non-null;} file that this instance is part of */ public StringIdsSection(DexFile file) { @@ -78,7 +78,7 @@ public final class StringIdsSection /** * Writes the portion of the file header that refers to this instance. - * + * * @param out {@code non-null;} where to write */ public void writeHeaderPart(AnnotatedOutput out) { @@ -98,7 +98,7 @@ public final class StringIdsSection /** * Interns an element into this instance. - * + * * @param string {@code non-null;} the string to intern, as a regular Java * {@code String} * @return {@code non-null;} the interned string @@ -110,7 +110,7 @@ public final class StringIdsSection /** * Interns an element into this instance. - * + * * @param string {@code non-null;} the string to intern, as a {@link CstString} * @return {@code non-null;} the interned string */ @@ -121,7 +121,7 @@ public final class StringIdsSection /** * Interns an element into this instance. - * + * * @param string {@code non-null;} the string to intern, as a constant * @return {@code non-null;} the interned string */ @@ -131,7 +131,7 @@ public final class StringIdsSection /** * Interns an element into this instance. - * + * * @param string {@code non-null;} the string to intern * @return {@code non-null;} the interned string */ @@ -155,7 +155,7 @@ public final class StringIdsSection /** * Interns the components of a name-and-type into this instance. - * + * * @param nat {@code non-null;} the name-and-type */ public void intern(CstNat nat) { @@ -166,7 +166,7 @@ public final class StringIdsSection /** * Gets the index of the given string, which must have been added * to this instance. - * + * * @param string {@code non-null;} the string to look up * @return {@code >= 0;} the string's index */ @@ -189,7 +189,7 @@ public final class StringIdsSection /** * Gets the index of the given string, which must have been added * to this instance. - * + * * @param string {@code non-null;} the string to look up * @return {@code >= 0;} the string's index */ diff --git a/dx/src/com/android/dx/dex/file/TypeIdItem.java b/dx/src/com/android/dx/dex/file/TypeIdItem.java index 01b1417c0..c257e0049 100644 --- a/dx/src/com/android/dx/dex/file/TypeIdItem.java +++ b/dx/src/com/android/dx/dex/file/TypeIdItem.java @@ -30,7 +30,7 @@ public final class TypeIdItem extends IdItem { /** * Constructs an instance. - * + * * @param type {@code non-null;} the constant for the type */ public TypeIdItem(CstType type) { diff --git a/dx/src/com/android/dx/dex/file/TypeIdsSection.java b/dx/src/com/android/dx/dex/file/TypeIdsSection.java index b1b9c58a3..bcc825027 100644 --- a/dx/src/com/android/dx/dex/file/TypeIdsSection.java +++ b/dx/src/com/android/dx/dex/file/TypeIdsSection.java @@ -36,7 +36,7 @@ public final class TypeIdsSection extends UniformItemSection { /** * Constructs an instance. The file offset is initially unknown. - * + * * @param file {@code non-null;} file that this instance is part of */ public TypeIdsSection(DexFile file) { @@ -72,7 +72,7 @@ public final class TypeIdsSection extends UniformItemSection { /** * Writes the portion of the file header that refers to this instance. - * + * * @param out {@code non-null;} where to write */ public void writeHeaderPart(AnnotatedOutput out) { @@ -96,7 +96,7 @@ public final class TypeIdsSection extends UniformItemSection { /** * Interns an element into this instance. - * + * * @param type {@code non-null;} the type to intern * @return {@code non-null;} the interned reference */ @@ -119,7 +119,7 @@ public final class TypeIdsSection extends UniformItemSection { /** * Interns an element into this instance. - * + * * @param type {@code non-null;} the type to intern * @return {@code non-null;} the interned reference */ @@ -144,7 +144,7 @@ public final class TypeIdsSection extends UniformItemSection { /** * Gets the index of the given type, which must have * been added to this instance. - * + * * @param type {@code non-null;} the type to look up * @return {@code >= 0;} the reference's index */ @@ -167,7 +167,7 @@ public final class TypeIdsSection extends UniformItemSection { /** * Gets the index of the given type, which must have * been added to this instance. - * + * * @param type {@code non-null;} the type to look up * @return {@code >= 0;} the reference's index */ diff --git a/dx/src/com/android/dx/dex/file/TypeListItem.java b/dx/src/com/android/dx/dex/file/TypeListItem.java index 3278aefff..b815dd347 100644 --- a/dx/src/com/android/dx/dex/file/TypeListItem.java +++ b/dx/src/com/android/dx/dex/file/TypeListItem.java @@ -41,7 +41,7 @@ public final class TypeListItem extends OffsettedItem { /** * Constructs an instance. - * + * * @param list {@code non-null;} the actual list */ public TypeListItem(TypeList list) { @@ -80,7 +80,7 @@ public final class TypeListItem extends OffsettedItem { /** * Gets the underlying list. - * + * * @return {@code non-null;} the list */ public TypeList getList() { @@ -109,7 +109,7 @@ public final class TypeListItem extends OffsettedItem { for (int i = 0; i < sz; i++) { out.writeShort(typeIds.indexOf(list.getType(i))); } - } + } /** {@inheritDoc} */ @Override diff --git a/dx/src/com/android/dx/dex/file/UniformItemSection.java b/dx/src/com/android/dx/dex/file/UniformItemSection.java index e18243898..d8c09ab26 100644 --- a/dx/src/com/android/dx/dex/file/UniformItemSection.java +++ b/dx/src/com/android/dx/dex/file/UniformItemSection.java @@ -29,7 +29,7 @@ import java.util.Collection; public abstract class UniformItemSection extends Section { /** * Constructs an instance. The file offset is initially unknown. - * + * * @param name {@code null-ok;} the name of this instance, for annotation * purposes * @param file {@code non-null;} file that this instance is part of @@ -59,7 +59,7 @@ public abstract class UniformItemSection extends Section { * will throw an exception if the constant is not found, including * if this instance isn't the sort that maps constants to {@link * IndexedItem} instances. - * + * * @param cst {@code non-null;} constant to look for * @return {@code non-null;} the corresponding item found in this instance */ diff --git a/dx/src/com/android/dx/dex/file/UniformListItem.java b/dx/src/com/android/dx/dex/file/UniformListItem.java index 3c1f4d366..88919c7cb 100644 --- a/dx/src/com/android/dx/dex/file/UniformListItem.java +++ b/dx/src/com/android/dx/dex/file/UniformListItem.java @@ -26,12 +26,12 @@ import java.util.List; * Class that represents a contiguous list of uniform items. Each * item in the list, in particular, must have the same write size and * alignment. - * + * * <p>This class inherits its alignment from its items, bumped up to * {@code 4} if the items have a looser alignment requirement. If * it is more than {@code 4}, then there will be a gap after the * output list size (which is four bytes) and before the first item.</p> - * + * * @param <T> type of element contained in an instance */ public final class UniformListItem<T extends OffsettedItem> @@ -41,14 +41,14 @@ public final class UniformListItem<T extends OffsettedItem> /** {@code non-null;} the item type */ private final ItemType itemType; - + /** {@code non-null;} the contents */ private final List<T> items; /** * Constructs an instance. It is illegal to modify the given list once * it is used to construct an instance of this class. - * + * * @param itemType {@code non-null;} the type of the item * @param items {@code non-null and non-empty;} list of items to represent */ @@ -67,7 +67,7 @@ public final class UniformListItem<T extends OffsettedItem> * Helper for {@link #UniformListItem}, which returns the alignment * requirement implied by the given list. See the header comment for * more details. - * + * * @param items {@code non-null;} list of items being represented * @return {@code >= 4;} the alignment requirement */ @@ -81,12 +81,12 @@ public final class UniformListItem<T extends OffsettedItem> } catch (NullPointerException ex) { // Translate the exception. throw new NullPointerException("items == null"); - } + } } /** * Calculates the write size for the given list. - * + * * @param items {@code non-null;} the list in question * @return {@code >= 0;} the write size */ @@ -147,7 +147,7 @@ public final class UniformListItem<T extends OffsettedItem> /** * Gets the underlying list of items. - * + * * @return {@code non-null;} the list */ public final List<T> getItems() { @@ -179,7 +179,7 @@ public final class UniformListItem<T extends OffsettedItem> "item alignment mismatch"); } } - + offset = i.place(addedTo, offset) + size; } } @@ -203,7 +203,7 @@ public final class UniformListItem<T extends OffsettedItem> /** * Get the size of the header of this list. - * + * * @return {@code >= 0;} the header size */ private int headerSize() { diff --git a/dx/src/com/android/dx/dex/file/ValueEncoder.java b/dx/src/com/android/dx/dex/file/ValueEncoder.java index f7e364aa7..fba64a726 100644 --- a/dx/src/com/android/dx/dex/file/ValueEncoder.java +++ b/dx/src/com/android/dx/dex/file/ValueEncoder.java @@ -100,10 +100,10 @@ public final class ValueEncoder { /** {@code non-null;} output stream to write to */ private final AnnotatedOutput out; - + /** * Construct an instance. - * + * * @param file {@code non-null;} file being written * @param out {@code non-null;} output stream to write to */ @@ -122,7 +122,7 @@ public final class ValueEncoder { /** * Writes out the encoded form of the given constant. - * + * * @param cst {@code non-null;} the constant to write */ public void writeConstant(Constant cst) { @@ -208,7 +208,7 @@ public final class ValueEncoder { /** * Gets the value type for the given constant. - * + * * @param cst {@code non-null;} the constant * @return the value type; one of the {@code VALUE_*} constants * defined by this class @@ -276,7 +276,7 @@ public final class ValueEncoder { if (annotates) { out.annotate(" size: " + Hex.u4(size)); } - + out.writeUnsignedLeb128(size); for (int i = 0; i < size; i++) { @@ -300,7 +300,7 @@ public final class ValueEncoder { * (debugging) annotations and {@code topLevel} is * {@code true}, then this method will write (debugging) * annotations. - * + * * @param annotation {@code non-null;} annotation instance to write * @param topLevel {@code true} iff the given annotation is the * top-level annotation or {@code false} if it is a sub-annotation @@ -318,7 +318,7 @@ public final class ValueEncoder { out.annotate(" type_idx: " + Hex.u4(typeIdx) + " // " + type.toHuman()); } - + out.writeUnsignedLeb128(typeIds.indexOf(annotation.getType())); Collection<NameValuePair> pairs = annotation.getNameValuePairs(); @@ -335,7 +335,7 @@ public final class ValueEncoder { CstUtf8 name = pair.getName(); int nameIdx = stringIds.indexOf(name); Constant value = pair.getValue(); - + if (annotates) { out.annotate(0, " elements[" + at + "]:"); at++; @@ -356,11 +356,11 @@ public final class ValueEncoder { out.endAnnotation(); } } - + /** * Gets the colloquial type name and human form of the type of the * given constant, when used as an encoded value. - * + * * @param cst {@code non-null;} the constant * @return {@code non-null;} its type name and human form */ @@ -383,7 +383,7 @@ public final class ValueEncoder { /** * Helper for {@link #writeConstant}, which writes out the value * for any signed integral type. - * + * * @param type the type constant * @param value {@code long} bits of the value */ @@ -420,7 +420,7 @@ public final class ValueEncoder { /** * Helper for {@link #writeConstant}, which writes out the value * for any unsigned integral type. - * + * * @param type the type constant * @param value {@code long} bits of the value */ @@ -430,7 +430,7 @@ public final class ValueEncoder { if (requiredBits == 0) { requiredBits = 1; } - + // Round up the requiredBits to a number of bytes. int requiredBytes = (requiredBits + 0x07) >> 3; @@ -451,7 +451,7 @@ public final class ValueEncoder { /** * Helper for {@link #writeConstant}, which writes out a * right-zero-extended value. - * + * * @param type the type constant * @param value {@code long} bits of the value */ @@ -461,7 +461,7 @@ public final class ValueEncoder { if (requiredBits == 0) { requiredBits = 1; } - + // Round up the requiredBits to a number of bytes. int requiredBytes = (requiredBits + 0x07) >> 3; @@ -488,7 +488,7 @@ public final class ValueEncoder { * contents for a particular {@link Annotation}, calling itself * recursively should it encounter a nested annotation. * - * @param file {@code non-null;} the file to add to + * @param file {@code non-null;} the file to add to * @param annotation {@code non-null;} the annotation to add contents for */ public static void addContents(DexFile file, Annotation annotation) { @@ -496,7 +496,7 @@ public final class ValueEncoder { StringIdsSection stringIds = file.getStringIds(); typeIds.intern(annotation.getType()); - + for (NameValuePair pair : annotation.getNameValuePairs()) { stringIds.intern(pair.getName()); addContents(file, pair.getValue()); @@ -509,8 +509,8 @@ public final class ValueEncoder { * should it encounter a {@link CstArray} and calling {@link * #addContents(DexFile,Annotation)} recursively should it * encounter a {@link CstAnnotation}. - * - * @param file {@code non-null;} the file to add to + * + * @param file {@code non-null;} the file to add to * @param cst {@code non-null;} the constant to add contents for */ public static void addContents(DexFile file, Constant cst) { diff --git a/dx/src/com/android/dx/rop/annotation/Annotation.java b/dx/src/com/android/dx/rop/annotation/Annotation.java index 6154c618e..ad6d67e77 100644 --- a/dx/src/com/android/dx/rop/annotation/Annotation.java +++ b/dx/src/com/android/dx/rop/annotation/Annotation.java @@ -39,7 +39,7 @@ import java.util.TreeMap; * associated type and additionally consist of a set of (name, value) * pairs, where the names are unique. */ -public final class Annotation extends MutabilityControl +public final class Annotation extends MutabilityControl implements Comparable<Annotation>, ToHuman { /** {@code non-null;} type of the annotation */ private final CstType type; @@ -49,10 +49,10 @@ public final class Annotation extends MutabilityControl /** {@code non-null;} map from names to {@link NameValuePair} instances */ private final TreeMap<CstUtf8, NameValuePair> elements; - + /** * Construct an instance. It initially contains no elements. - * + * * @param type {@code non-null;} type of the annotation * @param visibility {@code non-null;} the visibility of the annotation */ @@ -136,7 +136,7 @@ public final class Annotation extends MutabilityControl public String toString() { return toHuman(); } - + /** {@inheritDoc} */ public String toHuman() { StringBuilder sb = new StringBuilder(); @@ -164,7 +164,7 @@ public final class Annotation extends MutabilityControl /** * Gets the type of this instance. - * + * * @return {@code non-null;} the type */ public CstType getType() { @@ -173,7 +173,7 @@ public final class Annotation extends MutabilityControl /** * Gets the visibility of this instance. - * + * * @return {@code non-null;} the visibility */ public AnnotationVisibility getVisibility() { @@ -184,12 +184,12 @@ public final class Annotation extends MutabilityControl * Put an element into the set of (name, value) pairs for this instance. * If there is a preexisting element with the same name, it will be * replaced by this method. - * + * * @param pair {@code non-null;} the (name, value) pair to place into this instance */ public void put(NameValuePair pair) { throwIfImmutable(); - + if (pair == null) { throw new NullPointerException("pair == null"); } @@ -201,12 +201,12 @@ public final class Annotation extends MutabilityControl * Add an element to the set of (name, value) pairs for this instance. * It is an error to call this method if there is a preexisting element * with the same name. - * + * * @param pair {@code non-null;} the (name, value) pair to add to this instance */ public void add(NameValuePair pair) { throwIfImmutable(); - + if (pair == null) { throw new NullPointerException("pair == null"); } @@ -216,14 +216,14 @@ public final class Annotation extends MutabilityControl if (elements.get(name) != null) { throw new IllegalArgumentException("name already added: " + name); } - + elements.put(name, pair); } /** * Gets the set of name-value pairs contained in this instance. The * result is always unmodifiable. - * + * * @return {@code non-null;} the set of name-value pairs */ public Collection<NameValuePair> getNameValuePairs() { diff --git a/dx/src/com/android/dx/rop/annotation/AnnotationVisibility.java b/dx/src/com/android/dx/rop/annotation/AnnotationVisibility.java index 26246bb10..c717b8cbe 100644 --- a/dx/src/com/android/dx/rop/annotation/AnnotationVisibility.java +++ b/dx/src/com/android/dx/rop/annotation/AnnotationVisibility.java @@ -32,7 +32,7 @@ public enum AnnotationVisibility implements ToHuman { /** * Constructs an instance. - * + * * @param human {@code non-null;} the human-oriented string representation */ private AnnotationVisibility(String human) { diff --git a/dx/src/com/android/dx/rop/annotation/Annotations.java b/dx/src/com/android/dx/rop/annotation/Annotations.java index dcb74a182..807d5d422 100644 --- a/dx/src/com/android/dx/rop/annotation/Annotations.java +++ b/dx/src/com/android/dx/rop/annotation/Annotations.java @@ -27,7 +27,7 @@ import java.util.TreeMap; /** * List of {@link Annotation} instances. */ -public final class Annotations extends MutabilityControl +public final class Annotations extends MutabilityControl implements Comparable<Annotations> { /** {@code non-null;} immutable empty instance */ public static final Annotations EMPTY = new Annotations(); @@ -35,7 +35,7 @@ public final class Annotations extends MutabilityControl static { EMPTY.setImmutable(); } - + /** {@code non-null;} map from types to annotations */ private final TreeMap<CstType, Annotation> annotations; @@ -43,7 +43,7 @@ public final class Annotations extends MutabilityControl * Constructs an immutable instance which is the combination of the * two given instances. The two instances must contain disjoint sets * of types. - * + * * @param a1 {@code non-null;} an instance * @param a2 {@code non-null;} the other instance * @return {@code non-null;} the combination @@ -58,12 +58,12 @@ public final class Annotations extends MutabilityControl return result; } - + /** * Constructs an immutable instance which is the combination of the * given instance with the given additional annotation. The latter's * type must not already appear in the former. - * + * * @param annotations {@code non-null;} the instance to augment * @param annotation {@code non-null;} the additional annotation * @return {@code non-null;} the combination @@ -79,7 +79,7 @@ public final class Annotations extends MutabilityControl return result; } - + /** * Constructs an empty instance. */ @@ -148,10 +148,10 @@ public final class Annotations extends MutabilityControl sb.append("}"); return sb.toString(); } - + /** * Gets the number of elements in this instance. - * + * * @return {@code >= 0;} the size */ public int size() { @@ -161,7 +161,7 @@ public final class Annotations extends MutabilityControl /** * Adds an element to this instance. There must not already be an * element of the same type. - * + * * @param annotation {@code non-null;} the element to add * @throws IllegalArgumentException thrown if there is a duplicate type */ @@ -173,7 +173,7 @@ public final class Annotations extends MutabilityControl } CstType type = annotation.getType(); - + if (annotations.containsKey(type)) { throw new IllegalArgumentException("duplicate type: " + type.toHuman()); @@ -185,7 +185,7 @@ public final class Annotations extends MutabilityControl /** * Adds all of the elements of the given instance to this one. The * instances must not have any duplicate types. - * + * * @param toAdd {@code non-null;} the annotations to add * @throws IllegalArgumentException thrown if there is a duplicate type */ @@ -204,7 +204,7 @@ public final class Annotations extends MutabilityControl /** * Gets the set of annotations contained in this instance. The * result is always unmodifiable. - * + * * @return {@code non-null;} the set of annotations */ public Collection<Annotation> getAnnotations() { diff --git a/dx/src/com/android/dx/rop/annotation/AnnotationsList.java b/dx/src/com/android/dx/rop/annotation/AnnotationsList.java index 0f4207b0b..b97b385a0 100644 --- a/dx/src/com/android/dx/rop/annotation/AnnotationsList.java +++ b/dx/src/com/android/dx/rop/annotation/AnnotationsList.java @@ -25,13 +25,13 @@ public final class AnnotationsList extends FixedSizeList { /** {@code non-null;} immutable empty instance */ public static final AnnotationsList EMPTY = new AnnotationsList(0); - + /** * Constructs an immutable instance which is the combination of * the two given instances. The two instances must each have the * same number of elements, and each pair of elements must contain * disjoint sets of types. - * + * * @param list1 {@code non-null;} an instance * @param list2 {@code non-null;} the other instance * @return {@code non-null;} the combination @@ -58,7 +58,7 @@ public final class AnnotationsList /** * Constructs an instance. All indices initially contain {@code null}. - * + * * @param size the size of the list */ public AnnotationsList(int size) { @@ -69,7 +69,7 @@ public final class AnnotationsList * Gets the element at the given index. It is an error to call * this with the index for an element which was never set; if you * do that, this will throw {@code NullPointerException}. - * + * * @param n {@code >= 0, < size();} which index * @return {@code non-null;} element at that index */ @@ -80,7 +80,7 @@ public final class AnnotationsList /** * Sets the element at the given index. The given element must be * immutable. - * + * * @param n {@code >= 0, < size();} which index * @param a {@code null-ok;} the element to set at {@code n} */ diff --git a/dx/src/com/android/dx/rop/annotation/NameValuePair.java b/dx/src/com/android/dx/rop/annotation/NameValuePair.java index 7137a6025..39a9dfd8f 100644 --- a/dx/src/com/android/dx/rop/annotation/NameValuePair.java +++ b/dx/src/com/android/dx/rop/annotation/NameValuePair.java @@ -29,10 +29,10 @@ public final class NameValuePair implements Comparable<NameValuePair> { /** {@code non-null;} the value */ private final Constant value; - + /** * Construct an instance. - * + * * @param name {@code non-null;} the name * @param value {@code non-null;} the value */ @@ -49,7 +49,7 @@ public final class NameValuePair implements Comparable<NameValuePair> { if (value instanceof CstUtf8) { throw new IllegalArgumentException("bad value: " + value); } - + this.name = name; this.value = value; } @@ -63,7 +63,7 @@ public final class NameValuePair implements Comparable<NameValuePair> { public int hashCode() { return name.hashCode() * 31 + value.hashCode(); } - + /** {@inheritDoc} */ public boolean equals(Object other) { if (! (other instanceof NameValuePair)) { @@ -78,7 +78,7 @@ public final class NameValuePair implements Comparable<NameValuePair> { /** * {@inheritDoc} - * + * * <p>Instances of this class compare in name-major and value-minor * order.</p> */ @@ -90,20 +90,20 @@ public final class NameValuePair implements Comparable<NameValuePair> { } return value.compareTo(other.value); - } + } /** * Gets the name. - * + * * @return {@code non-null;} the name */ public CstUtf8 getName() { return name; } - + /** * Gets the value. - * + * * @return {@code non-null;} the value */ public Constant getValue() { diff --git a/dx/src/com/android/dx/rop/code/AccessFlags.java b/dx/src/com/android/dx/rop/code/AccessFlags.java index b76b610e1..2d84fe8c2 100644 --- a/dx/src/com/android/dx/rop/code/AccessFlags.java +++ b/dx/src/com/android/dx/rop/code/AccessFlags.java @@ -51,7 +51,7 @@ public final class AccessFlags { /** * class with new-style {@code invokespecial} for superclass - * method access + * method access */ public static final int ACC_SUPER = 0x0020; @@ -78,7 +78,7 @@ public final class AccessFlags { /** * method with strict floating point ({@code strictfp}) - * behavior + * behavior */ public static final int ACC_STRICT = 0x0800; @@ -90,7 +90,7 @@ public final class AccessFlags { /** * class is an enumerated type; field is an element of an enumerated - * type + * type */ public static final int ACC_ENUM = 0x4000; @@ -145,7 +145,7 @@ public final class AccessFlags { /** * Returns a human-oriented string representing the given access flags, * as defined on classes (not fields or methods). - * + * * @param flags the flags * @return {@code non-null;} human-oriented string */ @@ -156,7 +156,7 @@ public final class AccessFlags { /** * Returns a human-oriented string representing the given access flags, * as defined on inner classes. - * + * * @param flags the flags * @return {@code non-null;} human-oriented string */ @@ -167,7 +167,7 @@ public final class AccessFlags { /** * Returns a human-oriented string representing the given access flags, * as defined on fields (not classes or methods). - * + * * @param flags the flags * @return {@code non-null;} human-oriented string */ @@ -178,7 +178,7 @@ public final class AccessFlags { /** * Returns a human-oriented string representing the given access flags, * as defined on methods (not classes or fields). - * + * * @param flags the flags * @return {@code non-null;} human-oriented string */ @@ -189,7 +189,7 @@ public final class AccessFlags { /** * Returns whether the flag {@code ACC_PUBLIC} is on in the given * flags. - * + * * @param flags the flags to check * @return the value of the {@code ACC_PUBLIC} flag */ @@ -200,7 +200,7 @@ public final class AccessFlags { /** * Returns whether the flag {@code ACC_PROTECTED} is on in the given * flags. - * + * * @param flags the flags to check * @return the value of the {@code ACC_PROTECTED} flag */ @@ -211,7 +211,7 @@ public final class AccessFlags { /** * Returns whether the flag {@code ACC_PRIVATE} is on in the given * flags. - * + * * @param flags the flags to check * @return the value of the {@code ACC_PRIVATE} flag */ @@ -222,18 +222,18 @@ public final class AccessFlags { /** * Returns whether the flag {@code ACC_STATIC} is on in the given * flags. - * + * * @param flags the flags to check * @return the value of the {@code ACC_STATIC} flag */ public static boolean isStatic(int flags) { return (flags & ACC_STATIC) != 0; } - + /** * Returns whether the flag {@code ACC_SYNCHRONIZED} is on in * the given flags. - * + * * @param flags the flags to check * @return the value of the {@code ACC_SYNCHRONIZED} flag */ @@ -244,7 +244,7 @@ public final class AccessFlags { /** * Returns whether the flag {@code ACC_ABSTRACT} is on in the given * flags. - * + * * @param flags the flags to check * @return the value of the {@code ACC_ABSTRACT} flag */ @@ -255,7 +255,7 @@ public final class AccessFlags { /** * Returns whether the flag {@code ACC_NATIVE} is on in the given * flags. - * + * * @param flags the flags to check * @return the value of the {@code ACC_NATIVE} flag */ @@ -266,7 +266,7 @@ public final class AccessFlags { /** * Returns whether the flag {@code ACC_ANNOTATION} is on in the given * flags. - * + * * @param flags the flags to check * @return the value of the {@code ACC_ANNOTATION} flag */ @@ -277,7 +277,7 @@ public final class AccessFlags { /** * Returns whether the flag {@code ACC_DECLARED_SYNCHRONIZED} is * on in the given flags. - * + * * @param flags the flags to check * @return the value of the {@code ACC_DECLARED_SYNCHRONIZED} flag */ @@ -288,7 +288,7 @@ public final class AccessFlags { /** * Helper to return a human-oriented string representing the given * access flags. - * + * * @param flags the defined flags * @param mask mask for the "defined" bits * @param what what the flags represent (one of {@code CONV_*}) diff --git a/dx/src/com/android/dx/rop/code/BasicBlock.java b/dx/src/com/android/dx/rop/code/BasicBlock.java index 7bb2d9b03..d6ee88694 100644 --- a/dx/src/com/android/dx/rop/code/BasicBlock.java +++ b/dx/src/com/android/dx/rop/code/BasicBlock.java @@ -33,20 +33,20 @@ public final class BasicBlock implements LabeledItem { /** * {@code non-null;} full list of successors that this block may - * branch to + * branch to */ private final IntList successors; /** * {@code >= -1;} the primary / standard-flow / "default" successor, or * {@code -1} if this block has no successors (that is, it - * exits the function/method) + * exits the function/method) */ private final int primarySuccessor; /** * Constructs an instance. The predecessor set is set to {@code null}. - * + * * @param label {@code >= 0;} target label for this block * @param insns {@code non-null;} list of instructions in this block * @param successors {@code non-null;} full list of successors that this @@ -114,7 +114,7 @@ public final class BasicBlock implements LabeledItem { /** * {@inheritDoc} - * + * * Instances of this class compare by identity. That is, * {@code x.equals(y)} is only true if {@code x == y}. */ @@ -125,7 +125,7 @@ public final class BasicBlock implements LabeledItem { /** * {@inheritDoc} - * + * * Return the identity hashcode of this instance. This is proper, * since instances of this class compare by identity (see {@link #equals}). */ @@ -136,7 +136,7 @@ public final class BasicBlock implements LabeledItem { /** * Gets the target label of this block. - * + * * @return {@code >= 0;} the label */ public int getLabel() { @@ -145,7 +145,7 @@ public final class BasicBlock implements LabeledItem { /** * Gets the list of instructions inside this block. - * + * * @return {@code non-null;} the instruction list */ public InsnList getInsns() { @@ -154,7 +154,7 @@ public final class BasicBlock implements LabeledItem { /** * Gets the list of successors that this block may branch to. - * + * * @return {@code non-null;} the successors list */ public IntList getSuccessors() { @@ -163,7 +163,7 @@ public final class BasicBlock implements LabeledItem { /** * Gets the primary successor of this block. - * + * * @return {@code >= -1;} the primary successor, or {@code -1} if this * block has no successors at all */ @@ -174,7 +174,7 @@ public final class BasicBlock implements LabeledItem { /** * Gets the secondary successor of this block. It is only valid to call * this method on blocks that have exactly two successors. - * + * * @return {@code >= 0;} the secondary successor */ public int getSecondarySuccessor() { @@ -194,7 +194,7 @@ public final class BasicBlock implements LabeledItem { /** * Gets the first instruction of this block. This is just a * convenient shorthand for {@code getInsns().get(0)}. - * + * * @return {@code non-null;} the first instruction */ public Insn getFirstInsn() { @@ -204,7 +204,7 @@ public final class BasicBlock implements LabeledItem { /** * Gets the last instruction of this block. This is just a * convenient shorthand for {@code getInsns().getLast()}. - * + * * @return {@code non-null;} the last instruction */ public Insn getLastInsn() { @@ -214,7 +214,7 @@ public final class BasicBlock implements LabeledItem { /** * Returns whether this block might throw an exception. This is * just a convenient shorthand for {@code getLastInsn().canThrow()}. - * + * * @return {@code true} iff this block might throw an * exception */ @@ -227,7 +227,7 @@ public final class BasicBlock implements LabeledItem { * This is just a shorthand for inspecting the last instruction in * the block to see if it could throw, and if so, whether it in fact * has any associated handlers. - * + * * @return {@code true} iff this block has any associated * exception handlers */ @@ -255,7 +255,7 @@ public final class BasicBlock implements LabeledItem { * Returns an instance that is identical to this one, except that * the registers in each instruction are offset by the given * amount. - * + * * @param delta the amount to offset register numbers by * @return {@code non-null;} an appropriately-constructed instance */ diff --git a/dx/src/com/android/dx/rop/code/BasicBlockList.java b/dx/src/com/android/dx/rop/code/BasicBlockList.java index 0627425da..ea7b497cf 100644 --- a/dx/src/com/android/dx/rop/code/BasicBlockList.java +++ b/dx/src/com/android/dx/rop/code/BasicBlockList.java @@ -28,14 +28,14 @@ import com.android.dx.util.LabeledList; public final class BasicBlockList extends LabeledList { /** * {@code >= -1;} the count of registers required by this method or - * {@code -1} if not yet calculated + * {@code -1} if not yet calculated */ private int regCount; /** * Constructs an instance. All indices initially contain {@code null}, * and the first-block label is initially {@code -1}. - * + * * @param size the size of the list */ public BasicBlockList(int size) { @@ -46,7 +46,7 @@ public final class BasicBlockList extends LabeledList { /** * Constructs a mutable copy for {@code getMutableCopy()}. - * + * * @param old block to copy */ private BasicBlockList (BasicBlockList old) { @@ -59,7 +59,7 @@ public final class BasicBlockList extends LabeledList { * Gets the element at the given index. It is an error to call * this with the index for an element which was never set; if you * do that, this will throw {@code NullPointerException}. - * + * * @param n {@code >= 0, < size();} which index * @return {@code non-null;} element at that index */ @@ -69,13 +69,13 @@ public final class BasicBlockList extends LabeledList { /** * Sets the basic block at the given index. - * + * * @param n {@code >= 0, < size();} which index * @param bb {@code null-ok;} the element to set at {@code n} */ public void set(int n, BasicBlock bb) { super.set(n, bb); - + // Reset regCount, since it will need to be recalculated. regCount = -1; } @@ -85,7 +85,7 @@ public final class BasicBlockList extends LabeledList { * the maximum of register-number-plus-category referred to by this * instance's instructions (indirectly through {@link BasicBlock} * instances). - * + * * @return {@code >= 0;} the register count */ public int getRegCount() { @@ -101,7 +101,7 @@ public final class BasicBlockList extends LabeledList { /** * Gets the total instruction count for this instance. This is the * sum of the instruction counts of each block. - * + * * @return {@code >= 0;} the total instruction count */ public int getInstructionCount() { @@ -168,7 +168,7 @@ public final class BasicBlockList extends LabeledList { /** * Visits each instruction of each block in the list, in order. - * + * * @param visitor {@code non-null;} visitor to use */ public void forEachInsn(Insn.Visitor visitor) { @@ -186,7 +186,7 @@ public final class BasicBlockList extends LabeledList { * the registers in each instruction are offset by the given * amount. Mutability of the result is inherited from the * original. - * + * * @param delta the amount to offset register numbers by * @return {@code non-null;} an appropriately-constructed instance */ @@ -223,7 +223,7 @@ public final class BasicBlockList extends LabeledList { * Otherwise, if the block has a primay successor, then that is * the preferred successor. If the block has no successors, then * this returns {@code null}. - * + * * @param block {@code non-null;} the block in question * @return {@code null-ok;} the preferred successor, if any */ @@ -251,7 +251,7 @@ public final class BasicBlockList extends LabeledList { /** * Compares the catches of two blocks for equality. This includes * both the catch types and target labels. - * + * * @param block1 {@code non-null;} one block to compare * @param block2 {@code non-null;} the other block to compare * @return {@code true} if the two blocks' non-primary successors @@ -283,7 +283,7 @@ public final class BasicBlockList extends LabeledList { */ return false; } - + for (int i = 0; i < size; i++) { int label1 = succ1.get(i); int label2 = succ2.get(i); @@ -325,7 +325,7 @@ public final class BasicBlockList extends LabeledList { /** * Gets the register count. - * + * * @return {@code >= 0;} the count */ public int getRegCount() { @@ -364,7 +364,7 @@ public final class BasicBlockList extends LabeledList { /** * Helper for all the {@code visit*} methods. - * + * * @param insn {@code non-null;} instruction being visited */ private void visit(Insn insn) { @@ -384,7 +384,7 @@ public final class BasicBlockList extends LabeledList { /** * Processes the given register spec. - * + * * @param spec {@code non-null;} the register spec */ private void processReg(RegisterSpec spec) { @@ -394,5 +394,5 @@ public final class BasicBlockList extends LabeledList { regCount = reg; } } - } + } } diff --git a/dx/src/com/android/dx/rop/code/ConservativeTranslationAdvice.java b/dx/src/com/android/dx/rop/code/ConservativeTranslationAdvice.java index 1ecf02c15..6c48acf6d 100644 --- a/dx/src/com/android/dx/rop/code/ConservativeTranslationAdvice.java +++ b/dx/src/com/android/dx/rop/code/ConservativeTranslationAdvice.java @@ -32,7 +32,7 @@ public final class ConservativeTranslationAdvice private ConservativeTranslationAdvice() { // This space intentionally left blank. } - + /** {@inheritDoc} */ public boolean hasConstantOperation(Rop opcode, RegisterSpec sourceA, RegisterSpec sourceB) { diff --git a/dx/src/com/android/dx/rop/code/CstInsn.java b/dx/src/com/android/dx/rop/code/CstInsn.java index 26df1a9bc..d7de2f4be 100644 --- a/dx/src/com/android/dx/rop/code/CstInsn.java +++ b/dx/src/com/android/dx/rop/code/CstInsn.java @@ -28,7 +28,7 @@ public abstract class CstInsn /** * Constructs an instance. - * + * * @param opcode {@code non-null;} the opcode * @param position {@code non-null;} source position * @param result {@code null-ok;} spec for the result, if any @@ -54,7 +54,7 @@ public abstract class CstInsn /** * Gets the constant. - * + * * @return {@code non-null;} the constant */ public Constant getConstant() { diff --git a/dx/src/com/android/dx/rop/code/Exceptions.java b/dx/src/com/android/dx/rop/code/Exceptions.java index f99a760d5..1e27a8c17 100644 --- a/dx/src/com/android/dx/rop/code/Exceptions.java +++ b/dx/src/com/android/dx/rop/code/Exceptions.java @@ -29,7 +29,7 @@ public final class Exceptions { /** * {@code non-null;} the type - * {@code java.lang.ArrayIndexOutOfBoundsException} + * {@code java.lang.ArrayIndexOutOfBoundsException} */ public static final Type TYPE_ArrayIndexOutOfBoundsException = Type.intern("Ljava/lang/ArrayIndexOutOfBoundsException;"); @@ -47,7 +47,7 @@ public final class Exceptions { /** * {@code non-null;} the type - * {@code java.lang.IllegalMonitorStateException} + * {@code java.lang.IllegalMonitorStateException} */ public static final Type TYPE_IllegalMonitorStateException = Type.intern("Ljava/lang/IllegalMonitorStateException;"); @@ -79,7 +79,7 @@ public final class Exceptions { /** * {@code non-null;} the list {@code [java.lang.Error, - * java.lang.NegativeArraySizeException]} + * java.lang.NegativeArraySizeException]} */ public static final StdTypeList LIST_Error_NegativeArraySizeException = StdTypeList.make(TYPE_Error, TYPE_NegativeArraySizeException); diff --git a/dx/src/com/android/dx/rop/code/FillArrayDataInsn.java b/dx/src/com/android/dx/rop/code/FillArrayDataInsn.java index 0fc7d2b61..ed9345d4d 100644 --- a/dx/src/com/android/dx/rop/code/FillArrayDataInsn.java +++ b/dx/src/com/android/dx/rop/code/FillArrayDataInsn.java @@ -41,7 +41,7 @@ public final class FillArrayDataInsn /** * Constructs an instance. - * + * * @param opcode {@code non-null;} the opcode * @param position {@code non-null;} source position * @param sources {@code non-null;} specs for all the sources diff --git a/dx/src/com/android/dx/rop/code/Insn.java b/dx/src/com/android/dx/rop/code/Insn.java index 77ab9c043..dad2852b8 100644 --- a/dx/src/com/android/dx/rop/code/Insn.java +++ b/dx/src/com/android/dx/rop/code/Insn.java @@ -44,7 +44,7 @@ public abstract class Insn implements ToHuman { /** * Constructs an instance. - * + * * @param opcode {@code non-null;} the opcode * @param position {@code non-null;} source position * @param result {@code null-ok;} spec for the result, if any @@ -72,7 +72,7 @@ public abstract class Insn implements ToHuman { /** * {@inheritDoc} - * + * * Instances of this class compare by identity. That is, * {@code x.equals(y)} is only true if {@code x == y}. */ @@ -83,7 +83,7 @@ public abstract class Insn implements ToHuman { /** * {@inheritDoc} - * + * * This implementation returns the identity hashcode of this * instance. This is proper, since instances of this class compare * by identity (see {@link #equals}). @@ -101,7 +101,7 @@ public abstract class Insn implements ToHuman { /** * Gets a human-oriented (and slightly lossy) string for this instance. - * + * * @return {@code non-null;} the human string form */ public String toHuman() { @@ -111,7 +111,7 @@ public abstract class Insn implements ToHuman { /** * Gets an "inline" string portion for toHuman(), if available. This * is the portion that appears after the Rop opcode - * + * * @return {@code null-ok;} if non-null, the inline text for toHuman() */ public String getInlineString() { @@ -120,7 +120,7 @@ public abstract class Insn implements ToHuman { /** * Gets the opcode. - * + * * @return {@code non-null;} the opcode */ public final Rop getOpcode() { @@ -129,7 +129,7 @@ public abstract class Insn implements ToHuman { /** * Gets the source position. - * + * * @return {@code non-null;} the source position */ public final SourcePosition getPosition() { @@ -139,7 +139,7 @@ public abstract class Insn implements ToHuman { /** * Gets the result spec, if any. A return value of {@code null} * means this instruction returns nothing. - * + * * @return {@code null-ok;} the result spec, if any */ public final RegisterSpec getResult() { @@ -151,7 +151,7 @@ public abstract class Insn implements ToHuman { * instruction, or null if no local variable assignment occurs. This * may be the result register, or for {@code mark-local} insns * it may be the source. - * + * * @return {@code null-ok;} a named register spec or null */ public final RegisterSpec getLocalAssignment() { @@ -177,7 +177,7 @@ public abstract class Insn implements ToHuman { /** * Gets the source specs. - * + * * @return {@code non-null;} the source specs */ public final RegisterSpecList getSources() { @@ -187,7 +187,7 @@ public abstract class Insn implements ToHuman { /** * Gets whether this instruction can possibly throw an exception. This * is just a convenient wrapper for {@code getOpcode().canThrow()}. - * + * * @return {@code true} iff this instruction can possibly throw */ public final boolean canThrow() { @@ -201,7 +201,7 @@ public abstract class Insn implements ToHuman { * throw or if it merely doesn't handle any of its possible * exceptions. To determine whether this instruction can throw, * use {@link #canThrow}. - * + * * @return {@code non-null;} the catches list */ public abstract TypeList getCatches(); @@ -209,7 +209,7 @@ public abstract class Insn implements ToHuman { /** * Calls the appropriate method on the given visitor, depending on the * class of this instance. Subclasses must override this. - * + * * @param visitor {@code non-null;} the visitor to call on */ public abstract void accept(Visitor visitor); @@ -220,7 +220,7 @@ public abstract class Insn implements ToHuman { * method throws an exception if this instance can't possibly * throw. To determine whether this instruction can throw, use * {@link #canThrow}. - * + * * @param type {@code non-null;} type to append to the catch list * @return {@code non-null;} an appropriately-constructed instance */ @@ -229,7 +229,7 @@ public abstract class Insn implements ToHuman { /** * Returns an instance that is just like this one, except that all * register references have been offset by the given delta. - * + * * @param delta the amount to offset register references by * @return {@code non-null;} an appropriately-constructed instance */ @@ -241,7 +241,7 @@ public abstract class Insn implements ToHuman { * source (if it is a constant) is represented directly rather than * as a register reference. {@code this} is returned in cases where * the translation is not possible. - * + * * @return {@code non-null;} an appropriately-constructed instance */ public Insn withLastSourceLiteral() { @@ -274,7 +274,7 @@ public abstract class Insn implements ToHuman { * to be an identity compare. Insn's are {@code contentEquals()} * if they have the same opcode, registers, source position, and other * metadata. - * + * * @return true in the case described above */ public boolean contentEquals(Insn b) { @@ -300,7 +300,7 @@ public abstract class Insn implements ToHuman { /** * Returns the string form of this instance, with the given bit added in * the standard location for an inline argument. - * + * * @param extra {@code null-ok;} the inline argument string * @return {@code non-null;} the string form */ @@ -333,7 +333,7 @@ public abstract class Insn implements ToHuman { /** * Returns the human string form of this instance, with the given * bit added in the standard location for an inline argument. - * + * * @param extra {@code null-ok;} the inline argument string * @return {@code non-null;} the human string form */ @@ -379,35 +379,35 @@ public abstract class Insn implements ToHuman { public static interface Visitor { /** * Visits a {@link PlainInsn}. - * + * * @param insn {@code non-null;} the instruction to visit */ public void visitPlainInsn(PlainInsn insn); /** * Visits a {@link PlainCstInsn}. - * + * * @param insn {@code non-null;} the instruction to visit */ public void visitPlainCstInsn(PlainCstInsn insn); /** * Visits a {@link SwitchInsn}. - * + * * @param insn {@code non-null;} the instruction to visit */ public void visitSwitchInsn(SwitchInsn insn); /** * Visits a {@link ThrowingCstInsn}. - * + * * @param insn {@code non-null;} the instruction to visit */ public void visitThrowingCstInsn(ThrowingCstInsn insn); /** * Visits a {@link ThrowingInsn}. - * + * * @param insn {@code non-null;} the instruction to visit */ public void visitThrowingInsn(ThrowingInsn insn); diff --git a/dx/src/com/android/dx/rop/code/InsnList.java b/dx/src/com/android/dx/rop/code/InsnList.java index 493f7fceb..88abd7256 100644 --- a/dx/src/com/android/dx/rop/code/InsnList.java +++ b/dx/src/com/android/dx/rop/code/InsnList.java @@ -57,7 +57,7 @@ public final class InsnList /** * Gets the last instruction. This is just a convenient shorthand for * {@code get(size() - 1)}. - * + * * @return {@code non-null;} the last instruction */ public Insn getLast() { @@ -91,7 +91,7 @@ public final class InsnList int sz = size(); if (sz != b.size()) return false; - + for (int i = 0; i < sz; i++) { if (!get(i).contentEquals(b.get(i))) { return false; @@ -106,7 +106,7 @@ public final class InsnList * the registers in each instruction are offset by the given * amount. Mutability of the result is inherited from the * original. - * + * * @param delta the amount to offset register numbers by * @return {@code non-null;} an appropriately-constructed instance */ diff --git a/dx/src/com/android/dx/rop/code/LocalItem.java b/dx/src/com/android/dx/rop/code/LocalItem.java index 7d6bebe09..82b227cd9 100644 --- a/dx/src/com/android/dx/rop/code/LocalItem.java +++ b/dx/src/com/android/dx/rop/code/LocalItem.java @@ -68,7 +68,7 @@ public class LocalItem implements Comparable<LocalItem> { return 0 == compareTo(local); } - /** + /** * Compares two strings like String.compareTo(), excepts treats a null * as the least-possible string value. * diff --git a/dx/src/com/android/dx/rop/code/LocalVariableExtractor.java b/dx/src/com/android/dx/rop/code/LocalVariableExtractor.java index db142c28e..c2c40216d 100644 --- a/dx/src/com/android/dx/rop/code/LocalVariableExtractor.java +++ b/dx/src/com/android/dx/rop/code/LocalVariableExtractor.java @@ -38,7 +38,7 @@ public final class LocalVariableExtractor { /** * Extracts out all the local variable information from the given method. - * + * * @param method {@code non-null;} the method to extract from * @return {@code non-null;} the extracted information */ @@ -49,7 +49,7 @@ public final class LocalVariableExtractor { /** * Constructs an instance. This method is private. Use {@link #extract}. - * + * * @param method {@code non-null;} the method to extract from */ private LocalVariableExtractor(RopMethod method) { @@ -68,7 +68,7 @@ public final class LocalVariableExtractor { /** * Does the extraction. - * + * * @return {@code non-null;} the extracted information */ private LocalVariableInfo doit() { @@ -78,14 +78,14 @@ public final class LocalVariableExtractor { Bits.clear(workSet, label); processBlock(label); } - + resultInfo.setImmutable(); return resultInfo; } /** * Processes a single block. - * + * * @param label {@code >= 0;} label of the block to process */ private void processBlock(int label) { @@ -158,7 +158,7 @@ public final class LocalVariableExtractor { if (previous != null && (previous.getReg() != result.getReg())) { - primaryState.remove(previous); + primaryState.remove(previous); } resultInfo.addAssignment(insn, result); diff --git a/dx/src/com/android/dx/rop/code/LocalVariableInfo.java b/dx/src/com/android/dx/rop/code/LocalVariableInfo.java index fa5e7cc8c..99a10eeef 100644 --- a/dx/src/com/android/dx/rop/code/LocalVariableInfo.java +++ b/dx/src/com/android/dx/rop/code/LocalVariableInfo.java @@ -33,14 +33,14 @@ public final class LocalVariableInfo /** * {@code non-null;} {@link RegisterSpecSet} to use when indicating a block * that has no locals; it is empty and immutable but has an appropriate - * max size for the method + * max size for the method */ private final RegisterSpecSet emptySet; /** * {@code non-null;} array consisting of register sets representing the * sets of variables already assigned upon entry to each block, - * where array indices correspond to block labels + * where array indices correspond to block labels */ private final RegisterSpecSet[] blockStarts; @@ -49,7 +49,7 @@ public final class LocalVariableInfo /** * Constructs an instance. - * + * * @param method {@code non-null;} the method being represented by this instance */ public LocalVariableInfo(RopMethod method) { @@ -72,7 +72,7 @@ public final class LocalVariableInfo /** * Sets the register set associated with the start of the block with * the given label. - * + * * @param label {@code >= 0;} the block label * @param specs {@code non-null;} the register set to associate with the block */ @@ -97,7 +97,7 @@ public final class LocalVariableInfo * is the same as calling {@link #setStarts}. Otherwise, this will * merge the two sets and call {@link #setStarts} on the result of the * merge. - * + * * @param label {@code >= 0;} the block label * @param specs {@code non-null;} the register set to merge into the start set * for the block @@ -131,7 +131,7 @@ public final class LocalVariableInfo * Gets the register set associated with the start of the block * with the given label. This returns an empty set with the appropriate * max size if no set was associated with the block in question. - * + * * @param label {@code >= 0;} the block label * @return {@code non-null;} the associated register set */ @@ -145,7 +145,7 @@ public final class LocalVariableInfo * Gets the register set associated with the start of the given * block. This is just convenient shorthand for * {@code getStarts(block.getLabel())}. - * + * * @param block {@code non-null;} the block in question * @return {@code non-null;} the associated register set */ @@ -158,7 +158,7 @@ public final class LocalVariableInfo * start of the block with the given label. This returns a * newly-allocated empty {@link RegisterSpecSet} of appropriate * max size if there is not yet any set associated with the block. - * + * * @param label {@code >= 0;} the block label * @return {@code non-null;} the associated register set */ @@ -173,13 +173,13 @@ public final class LocalVariableInfo * Adds an assignment association for the given instruction and * register spec. This throws an exception if the instruction * doesn't actually perform a named variable assignment. - * + * * <b>Note:</b> Although the instruction contains its own spec for * the result, it still needs to be passed in explicitly to this * method, since the spec that is stored here should always have a * simple type and the one in the instruction can be an arbitrary * {@link TypeBearer} (such as a constant value). - * + * * @param insn {@code non-null;} the instruction in question * @param spec {@code non-null;} the associated register spec */ @@ -200,7 +200,7 @@ public final class LocalVariableInfo /** * Gets the named register being assigned by the given instruction, if * previously stored in this instance. - * + * * @param insn {@code non-null;} instruction in question * @return {@code null-ok;} the named register being assigned, if any */ @@ -210,7 +210,7 @@ public final class LocalVariableInfo /** * Gets the number of assignments recorded by this instance. - * + * * @return {@code >= 0;} the number of assignments */ public int getAssignmentCount() { @@ -234,7 +234,7 @@ public final class LocalVariableInfo /** * Helper method, to get the starts for a label, throwing the * right exception for range problems. - * + * * @param label {@code >= 0;} the block label * @return {@code null-ok;} associated register set or {@code null} if there * is none diff --git a/dx/src/com/android/dx/rop/code/PlainCstInsn.java b/dx/src/com/android/dx/rop/code/PlainCstInsn.java index 7a3ac38b5..fffa76b8d 100644 --- a/dx/src/com/android/dx/rop/code/PlainCstInsn.java +++ b/dx/src/com/android/dx/rop/code/PlainCstInsn.java @@ -29,7 +29,7 @@ public final class PlainCstInsn extends CstInsn { /** * Constructs an instance. - * + * * @param opcode {@code non-null;} the opcode * @param position {@code non-null;} source position * @param result {@code null-ok;} spec for the result, if any diff --git a/dx/src/com/android/dx/rop/code/PlainInsn.java b/dx/src/com/android/dx/rop/code/PlainInsn.java index d1db646d0..3fd2ba58d 100644 --- a/dx/src/com/android/dx/rop/code/PlainInsn.java +++ b/dx/src/com/android/dx/rop/code/PlainInsn.java @@ -30,7 +30,7 @@ public final class PlainInsn extends Insn { /** * Constructs an instance. - * + * * @param opcode {@code non-null;} the opcode * @param position {@code non-null;} source position * @param result {@code null-ok;} spec for the result, if any @@ -50,13 +50,13 @@ public final class PlainInsn if (result != null && opcode.getBranchingness() != Rop.BRANCH_NONE) { // move-result-pseudo is required here throw new IllegalArgumentException - ("can't mix branchingness with result"); + ("can't mix branchingness with result"); } } /** * Constructs a single-source instance. - * + * * @param opcode {@code non-null;} the opcode * @param position {@code non-null;} source position * @param result {@code null-ok;} spec for the result, if any diff --git a/dx/src/com/android/dx/rop/code/RegOps.java b/dx/src/com/android/dx/rop/code/RegOps.java index 2084a69a0..bdf93423a 100644 --- a/dx/src/com/android/dx/rop/code/RegOps.java +++ b/dx/src/com/android/dx/rop/code/RegOps.java @@ -20,7 +20,7 @@ import com.android.dx.util.Hex; /** * All the register-based opcodes, and related utilities. - * + * * <p><b>Note:</b> Opcode descriptions use a rough pseudocode. {@code r} * is the result register, {@code x} is the first argument, * {@code y} is the second argument, and {@code z} is the @@ -93,7 +93,7 @@ public final class RegOps { /** * {@code T: any numeric type; r,x,y: T :: r = x % y} - * (Java-style remainder) + * (Java-style remainder) */ public static final int REM = 18; @@ -116,13 +116,13 @@ public final class RegOps { /** * {@code T: any integral type; r,x: T; y: int :: r = x >> y} - * (signed right-shift) + * (signed right-shift) */ public static final int SHR = 24; /** * {@code T: any integral type; r,x: T; y: int :: r = x >>> y} - * (unsigned right-shift) + * (unsigned right-shift) */ public static final int USHR = 25; @@ -133,38 +133,38 @@ public final class RegOps { * {@code T: any numeric type; r: int; x,y: T :: r = (x == y) ? 0 * : (x > y) ? 1 : -1} (Java-style "cmpl" where a NaN is * considered "less than" all other values; also used for integral - * comparisons) + * comparisons) */ public static final int CMPL = 27; /** * {@code T: any floating point type; r: int; x,y: T :: r = (x == y) ? 0 * : (x < y) ? -1 : 1} (Java-style "cmpg" where a NaN is - * considered "greater than" all other values) + * considered "greater than" all other values) */ public static final int CMPG = 28; /** * {@code T: any numeric type; U: any numeric type; r: T; x: U :: * r = (T) x} (numeric type conversion between the four - * "real" numeric types) + * "real" numeric types) */ public static final int CONV = 29; /** * {@code r,x: int :: r = (x << 24) >> 24} (Java-style - * convert int to byte) + * convert int to byte) */ public static final int TO_BYTE = 30; /** - * {@code r,x: int :: r = x & 0xffff} (Java-style convert int to char) + * {@code r,x: int :: r = x & 0xffff} (Java-style convert int to char) */ public static final int TO_CHAR = 31; /** * {@code r,x: int :: r = (x << 16) >> 16} (Java-style - * convert int to short) + * convert int to short) */ public static final int TO_SHORT = 32; @@ -191,7 +191,7 @@ public final class RegOps { /** * {@code T: any non-array object type :: r = - * alloc(T)} (allocate heap space for an object) + * alloc(T)} (allocate heap space for an object) */ public static final int NEW_INSTANCE = 40; @@ -206,7 +206,7 @@ public final class RegOps { /** * {@code T: any object type; x: Object :: (T) x} (can - * throw {@code ClassCastException}) + * throw {@code ClassCastException}) */ public static final int CHECK_CAST = 43; @@ -223,13 +223,13 @@ public final class RegOps { /** * {@code T: any type; r: T; f: static field spec of type T :: r = - * f} + * f} */ public static final int GET_STATIC = 46; /** * {@code T: any type; x: T; y: Object; f: instance field spec of type - * T :: y.f = x} + * T :: y.f = x} */ public static final int PUT_FIELD = 47; @@ -241,35 +241,35 @@ public final class RegOps { /** * {@code Tr, T0, T1...: any types; r: Tr; m: static method spec; * y0: T0; y1: T1 ... :: r = m(y0, y1, ...)} (call static - * method) + * method) */ public static final int INVOKE_STATIC = 49; /** * {@code Tr, T0, T1...: any types; r: Tr; x: Object; m: instance method * spec; y0: T0; y1: T1 ... :: r = x.m(y0, y1, ...)} (call normal - * virtual method) + * virtual method) */ public static final int INVOKE_VIRTUAL = 50; /** * {@code Tr, T0, T1...: any types; r: Tr; x: Object; m: instance method * spec; y0: T0; y1: T1 ... :: r = x.m(y0, y1, ...)} (call - * superclass virtual method) + * superclass virtual method) */ public static final int INVOKE_SUPER = 51; /** * {@code Tr, T0, T1...: any types; r: Tr; x: Object; m: instance method * spec; y0: T0; y1: T1 ... :: r = x.m(y0, y1, ...)} (call - * direct/special method) + * direct/special method) */ public static final int INVOKE_DIRECT = 52; /** * {@code Tr, T0, T1...: any types; r: Tr; x: Object; m: interface * (instance) method spec; y0: T0; y1: T1 ... :: r = x.m(y0, y1, - * ...)} (call interface method) + * ...)} (call interface method) */ public static final int INVOKE_INTERFACE = 53; @@ -305,7 +305,7 @@ public final class RegOps { /** * Gets the name of the given opcode. - * + * * @param opcode {@code >= 0, <= 255;} the opcode * @return {@code non-null;} its name */ diff --git a/dx/src/com/android/dx/rop/code/RegisterSpec.java b/dx/src/com/android/dx/rop/code/RegisterSpec.java index 1f1476780..f1ac56362 100644 --- a/dx/src/com/android/dx/rop/code/RegisterSpec.java +++ b/dx/src/com/android/dx/rop/code/RegisterSpec.java @@ -76,7 +76,7 @@ public final class RegisterSpec * Returns an instance for the given register number and type, with * no variable info. This method is allowed to return shared * instances (but doesn't necessarily do so). - * + * * @param reg {@code >= 0;} the register number * @param type {@code non-null;} the type (or possibly actual value) which * is loaded from or stored to the indicated register @@ -126,7 +126,7 @@ public final class RegisterSpec /** * Gets the string form for the given register number. - * + * * @param reg {@code >= 0;} the register number * @return {@code non-null;} the string form */ @@ -137,7 +137,7 @@ public final class RegisterSpec /** * Constructs an instance. This constructor is private. Use * {@link #make}. - * + * * @param reg {@code >= 0;} the register number * @param type {@code non-null;} the type (or possibly actual value) which * is loaded from or stored to the indicated register @@ -177,7 +177,7 @@ public final class RegisterSpec * registers. That is, this compares {@code getType()} on the types * to ignore whatever arbitrary extra stuff might be carried around * by an outer {@link TypeBearer}. - * + * * @param other {@code null-ok;} spec to compare to * @return {@code true} iff {@code this} and {@code other} are equal * in the stated way @@ -194,7 +194,7 @@ public final class RegisterSpec * Like {@link #equalsUsingSimpleType} but ignoring the register number. * This is useful to determine if two instances refer to the "same" * local variable. - * + * * @param other {@code null-ok;} spec to compare to * @return {@code true} iff {@code this} and {@code other} are equal * in the stated way @@ -212,7 +212,7 @@ public final class RegisterSpec /** * Helper for {@link #equals} and {@link #ForComparison.equals}, * which actually does the test. - * + * * @param reg value of the instance variable, for another instance * @param type value of the instance variable, for another instance * @param local value of the instance variable, for another instance @@ -229,7 +229,7 @@ public final class RegisterSpec /** * Compares by (in priority order) register number, unwrapped type * (that is types not {@link TypeBearer}s, and local info. - * + * * @param other {@code non-null;} spec to compare to * @return {@code -1..1;} standard result of comparison */ @@ -253,7 +253,7 @@ public final class RegisterSpec } return this.local.compareTo(other.local); - } + } /** {@inheritDoc} */ @Override @@ -264,7 +264,7 @@ public final class RegisterSpec /** * Helper for {@link #hashCode} and {@link #ForComparison.hashCode}, * which actually does the calculation. - * + * * @param reg value of the instance variable * @param type value of the instance variable * @param local value of the instance variable @@ -315,7 +315,7 @@ public final class RegisterSpec /** * Gets the register number. - * + * * @return {@code >= 0;} the register number */ public int getReg() { @@ -325,7 +325,7 @@ public final class RegisterSpec /** * Gets the type (or actual value) which is loaded from or stored * to the register associated with this instance. - * + * * @return {@code non-null;} the type */ public TypeBearer getTypeBearer() { @@ -348,7 +348,7 @@ public final class RegisterSpec * (category) of the type used. Among other things, this may also * be used to determine the minimum required register count * implied by this instance. - * + * * @return {@code >= 0;} the required registers size */ public int getNextReg() { @@ -358,7 +358,7 @@ public final class RegisterSpec /** * Gets the category of this instance's type. This is just a convenient * shorthand for {@code getType().getCategory()}. - * + * * @see #isCategory1 * @see #isCategory2 * @return {@code 1..2;} the category of this instance's type @@ -370,7 +370,7 @@ public final class RegisterSpec /** * Gets whether this instance's type is category 1. This is just a * convenient shorthand for {@code getType().isCategory1()}. - * + * * @see #getCategory * @see #isCategory2 * @return whether or not this instance's type is of category 1 @@ -382,7 +382,7 @@ public final class RegisterSpec /** * Gets whether this instance's type is category 2. This is just a * convenient shorthand for {@code getType().isCategory2()}. - * + * * @see #getCategory * @see #isCategory1 * @return whether or not this instance's type is of category 2 @@ -393,7 +393,7 @@ public final class RegisterSpec /** * Gets the string form for just the register number of this instance. - * + * * @return {@code non-null;} the register string form */ public String regString() { @@ -403,7 +403,7 @@ public final class RegisterSpec /** * Returns an instance that is the intersection between this instance * and the given one, if any. The intersection is defined as follows: - * + * * <ul> * <li>If {@code other} is {@code null}, then the result * is {@code null}. @@ -420,7 +420,7 @@ public final class RegisterSpec * of the intersection is the local info of this instance. Otherwise, * the local info of the intersection is {@code null}.</li> * </ul> - * + * * @param other {@code null-ok;} instance to intersect with (or {@code null}) * @param localPrimary whether local variables are primary to the * intersection; if {@code true}, then the only non-null @@ -470,7 +470,7 @@ public final class RegisterSpec /** * Returns an instance that is identical to this one, except that the * register number is replaced by the given one. - * + * * @param newReg {@code >= 0;} the new register number * @return {@code non-null;} an appropriately-constructed instance */ @@ -496,7 +496,7 @@ public final class RegisterSpec /** * Returns an instance that is identical to this one, except that the * register number is offset by the given amount. - * + * * @param delta the amount to offset the register number by * @return {@code non-null;} an appropriately-constructed instance */ @@ -507,13 +507,13 @@ public final class RegisterSpec return withReg(reg + delta); } - + /** * Returns an instance that is identical to this one, except that * the type bearer is replaced by the actual underlying type * (thereby stripping off non-type information) with any * initialization information stripped away as well. - * + * * @return {@code non-null;} an appropriately-constructed instance */ public RegisterSpec withSimpleType() { @@ -557,7 +557,7 @@ public final class RegisterSpec /** * Helper for {@link #toString} and {@link #toHuman}. - * + * * @param human whether to be human-oriented * @return {@code non-null;} the string form */ @@ -594,7 +594,7 @@ public final class RegisterSpec private static class ForComparison { /** {@code >= 0;} register number */ private int reg; - + /** {@code non-null;} type loaded or stored */ private TypeBearer type; @@ -606,7 +606,7 @@ public final class RegisterSpec /** * Set all the instance variables. - * + * * @param reg {@code >= 0;} the register number * @param type {@code non-null;} the type (or possibly actual * value) which is loaded from or stored to the indicated @@ -623,7 +623,7 @@ public final class RegisterSpec /** * Construct a {@code RegisterSpec} of this instance's * contents. - * + * * @return {@code non-null;} an appropriately-constructed instance */ public RegisterSpec toRegisterSpec() { diff --git a/dx/src/com/android/dx/rop/code/RegisterSpecList.java b/dx/src/com/android/dx/rop/code/RegisterSpecList.java index 5a02a8d31..e900787ad 100644 --- a/dx/src/com/android/dx/rop/code/RegisterSpecList.java +++ b/dx/src/com/android/dx/rop/code/RegisterSpecList.java @@ -30,7 +30,7 @@ public final class RegisterSpecList /** * Makes a single-element instance. - * + * * @param spec {@code non-null;} the element * @return {@code non-null;} an appropriately-constructed instance */ @@ -42,7 +42,7 @@ public final class RegisterSpecList /** * Makes a two-element instance. - * + * * @param spec0 {@code non-null;} the first element * @param spec1 {@code non-null;} the second element * @return {@code non-null;} an appropriately-constructed instance @@ -57,7 +57,7 @@ public final class RegisterSpecList /** * Makes a three-element instance. - * + * * @param spec0 {@code non-null;} the first element * @param spec1 {@code non-null;} the second element * @param spec2 {@code non-null;} the third element @@ -74,7 +74,7 @@ public final class RegisterSpecList /** * Makes a four-element instance. - * + * * @param spec0 {@code non-null;} the first element * @param spec1 {@code non-null;} the second element * @param spec2 {@code non-null;} the third element @@ -94,7 +94,7 @@ public final class RegisterSpecList /** * Constructs an instance. All indices initially contain {@code null}. - * + * * @param size the size of the list */ public RegisterSpecList(int size) { @@ -122,12 +122,12 @@ public final class RegisterSpecList public TypeList withAddedType(Type type) { throw new UnsupportedOperationException("unsupported"); } - + /** * Gets the indicated element. It is an error to call this with the * index for an element which was never set; if you do that, this * will throw {@code NullPointerException}. - * + * * @param n {@code >= 0, < size();} which element * @return {@code non-null;} the indicated element */ @@ -174,12 +174,12 @@ public final class RegisterSpecList } } - return -1; + return -1; } - + /** * Sets the element at the given index. - * + * * @param n {@code >= 0, < size();} which element * @param spec {@code non-null;} the value to store */ @@ -192,7 +192,7 @@ public final class RegisterSpecList * instance. This is equal to the highest register number referred * to plus the widest width (largest category) of the type used in * that register. - * + * * @return {@code >= 0;} the required registers size */ public int getRegistersSize() { @@ -216,7 +216,7 @@ public final class RegisterSpecList * Returns a new instance, which is the same as this instance, * except that it has an additional element prepended to the original. * Mutability of the result is inherited from the original. - * + * * @param spec {@code non-null;} the new first spec (to prepend) * @return {@code non-null;} an appropriately-constructed instance */ @@ -240,7 +240,7 @@ public final class RegisterSpecList * Returns a new instance, which is the same as this instance, * except that its first element is removed. Mutability of the * result is inherited from the original. - * + * * @return {@code non-null;} an appropriately-constructed instance */ public RegisterSpecList withoutFirst() { @@ -267,7 +267,7 @@ public final class RegisterSpecList * Returns a new instance, which is the same as this instance, * except that its last element is removed. Mutability of the * result is inherited from the original. - * + * * @return {@code non-null;} an appropriately-constructed instance */ public RegisterSpecList withoutLast() { @@ -294,7 +294,7 @@ public final class RegisterSpecList * Returns an instance that is identical to this one, except that * all register numbers are offset by the given amount. Mutability * of the result is inherited from the original. - * + * * @param delta the amount to offset the register numbers by * @return {@code non-null;} an appropriately-constructed instance */ @@ -325,8 +325,8 @@ public final class RegisterSpecList /** * Returns an instance that is identical to this one, except that * all register numbers are renumbered sequentially from the given - * base, with the first number duplicated if indicated. - * + * base, with the first number duplicated if indicated. + * * @param base the base register number * @param duplicateFirst whether to duplicate the first number * @return {@code non-null;} an appropriately-constructed instance diff --git a/dx/src/com/android/dx/rop/code/RegisterSpecSet.java b/dx/src/com/android/dx/rop/code/RegisterSpecSet.java index 68009d997..d16a82a11 100644 --- a/dx/src/com/android/dx/rop/code/RegisterSpecSet.java +++ b/dx/src/com/android/dx/rop/code/RegisterSpecSet.java @@ -31,7 +31,7 @@ public final class RegisterSpecSet /** * {@code non-null;} array of register specs, where each element is * {@code null} or is an instance whose {@code reg} - * matches the array index + * matches the array index */ private final RegisterSpec[] specs; @@ -40,7 +40,7 @@ public final class RegisterSpecSet /** * Constructs an instance. The instance is initially empty. - * + * * @param maxSize {@code >= 0;} the maximum register number (exclusive) that * may be represented in this instance */ @@ -120,13 +120,13 @@ public final class RegisterSpecSet sb.append('}'); return sb.toString(); - } + } /** * Gets the maximum number of registers that may be in this instance, which * is also the maximum-plus-one of register numbers that may be * represented. - * + * * @return {@code >= 0;} the maximum size */ public int getMaxSize() { @@ -135,7 +135,7 @@ public final class RegisterSpecSet /** * Gets the current size of this instance. - * + * * @return {@code >= 0;} the size */ public int size() { @@ -159,7 +159,7 @@ public final class RegisterSpecSet /** * Gets the element with the given register number, if any. - * + * * @param reg {@code >= 0;} the desired register number * @return {@code null-ok;} the element with the given register number or * {@code null} if there is none @@ -177,7 +177,7 @@ public final class RegisterSpecSet * Gets the element with the same register number as the given * spec, if any. This is just a convenient shorthand for * {@code get(spec.getReg())}. - * + * * @param spec {@code non-null;} spec with the desired register number * @return {@code null-ok;} the element with the matching register number or * {@code null} if there is none @@ -191,13 +191,13 @@ public final class RegisterSpecSet * given local (type, name, and signature), or {@code null} if there is * none. This ignores the register number of the given spec but * matches on everything else. - * + * * @param spec {@code non-null;} local to look for * @return {@code null-ok;} first register found that matches, if any */ public RegisterSpec findMatchingLocal(RegisterSpec spec) { int length = specs.length; - + for (int reg = 0; reg < length; reg++) { RegisterSpec s = specs[reg]; @@ -222,10 +222,10 @@ public final class RegisterSpecSet */ public RegisterSpec localItemToSpec(LocalItem local) { int length = specs.length; - + for (int reg = 0; reg < length; reg++) { RegisterSpec spec = specs[reg]; - + if ((spec != null) && local.equals(spec.getLocalItem())) { return spec; } @@ -257,7 +257,7 @@ public final class RegisterSpecSet * previous element is nullified. Finally, if the given spec is for * a category-2 register, then the immediately subsequent element * is nullified. - * + * * @param spec {@code non-null;} the register spec to put in the instance */ public void put(RegisterSpec spec) { @@ -292,7 +292,7 @@ public final class RegisterSpecSet /** * Put the entire contents of the given set into this one. - * + * * @param set {@code non-null;} the set to put into this instance */ public void putAll(RegisterSpecSet set) { @@ -311,7 +311,7 @@ public final class RegisterSpecSet * instance. The intersection consists of the pairwise * {@link RegisterSpec#intersect} of corresponding elements from * this instance and the given one where both are non-null. - * + * * @param other {@code non-null;} set to intersect with * @param localPrimary whether local variables are primary to * the intersection; if {@code true}, then the only non-null @@ -350,7 +350,7 @@ public final class RegisterSpecSet * Returns an instance that is identical to this one, except that * all register numbers are offset by the given amount. Mutability * of the result is inherited from the original. - * + * * @param delta the amount to offset the register numbers by * @return {@code non-null;} an appropriately-constructed instance */ @@ -376,7 +376,7 @@ public final class RegisterSpecSet /** * Makes and return a mutable copy of this instance. - * + * * @return {@code non-null;} the mutable copy */ public RegisterSpecSet mutableCopy() { diff --git a/dx/src/com/android/dx/rop/code/Rop.java b/dx/src/com/android/dx/rop/code/Rop.java index fbd9a16f6..8224584ed 100644 --- a/dx/src/com/android/dx/rop/code/Rop.java +++ b/dx/src/com/android/dx/rop/code/Rop.java @@ -54,7 +54,7 @@ public final class Rop { /** * {@code non-null;} result type of this operation; {@link Type#VOID} for - * no-result operations + * no-result operations */ private final Type result; @@ -66,7 +66,7 @@ public final class Rop { /** * the branchingness of this op; one of the {@code BRANCH_*} - * constants in this class + * constants in this class */ private final int branchingness; @@ -79,7 +79,7 @@ public final class Rop { /** * Constructs an instance. This method is private. Use one of the * public constructors. - * + * * @param opcode the opcode; one of the constants in {@link RegOps} * @param result {@code non-null;} result type of this operation; {@link * Type#VOID} for no-result operations @@ -125,9 +125,9 @@ public final class Rop { } /** - * Constructs an instance. The constructed instance is never a + * Constructs an instance. The constructed instance is never a * call-like op (see {@link #isCallLike}). - * + * * @param opcode the opcode; one of the constants in {@link RegOps} * @param result {@code non-null;} result type of this operation; {@link * Type#VOID} for no-result operations @@ -145,9 +145,9 @@ public final class Rop { } /** - * Constructs a no-exception instance. The constructed instance is never a + * Constructs a no-exception instance. The constructed instance is never a * call-like op (see {@link #isCallLike}). - * + * * @param opcode the opcode; one of the constants in {@link RegOps} * @param result {@code non-null;} result type of this operation; {@link * Type#VOID} for no-result operations @@ -166,7 +166,7 @@ public final class Rop { * Constructs a non-branching no-exception instance. The * {@code branchingness} is always {@code BRANCH_NONE}, * and it is never a call-like op (see {@link #isCallLike}). - * + * * @param opcode the opcode; one of the constants in {@link RegOps} * @param result {@code non-null;} result type of this operation; {@link * Type#VOID} for no-result operations @@ -182,7 +182,7 @@ public final class Rop { * Constructs a non-empty exceptions instance. Its * {@code branchingness} is always {@code BRANCH_THROW}, * but it is never a call-like op (see {@link #isCallLike}). - * + * * @param opcode the opcode; one of the constants in {@link RegOps} * @param result {@code non-null;} result type of this operation; {@link * Type#VOID} for no-result operations @@ -201,7 +201,7 @@ public final class Rop { * Constructs a non-nicknamed instance with non-empty exceptions, which * is always a call-like op (see {@link #isCallLike}). Its * {@code branchingness} is always {@code BRANCH_THROW}. - * + * * @param opcode the opcode; one of the constants in {@link RegOps} * @param sources {@code non-null;} types of all the sources of this operation * @param exceptions {@code non-null;} list of possible types thrown by this @@ -306,7 +306,7 @@ public final class Rop { /** * Gets the opcode. - * + * * @return the opcode */ public int getOpcode() { @@ -316,7 +316,7 @@ public final class Rop { /** * Gets the result type. A return value of {@link Type#VOID} * means this operation returns nothing. - * + * * @return {@code null-ok;} the result spec */ public Type getResult() { @@ -325,7 +325,7 @@ public final class Rop { /** * Gets the source types. - * + * * @return {@code non-null;} the source types */ public TypeList getSources() { @@ -334,7 +334,7 @@ public final class Rop { /** * Gets the list of exception types that might be thrown. - * + * * @return {@code non-null;} the list of exception types */ public TypeList getExceptions() { @@ -343,7 +343,7 @@ public final class Rop { /** * Gets the branchingness of this instance. - * + * * @return the branchingness */ public int getBranchingness() { @@ -352,7 +352,7 @@ public final class Rop { /** * Gets whether this opcode is a function/method call or similar. - * + * * @return {@code true} iff this opcode is call-like */ public boolean isCallLike() { @@ -383,7 +383,7 @@ public final class Rop { /** * Gets the nickname. If this instance has no nickname, this returns * the result of calling {@link #toString}. - * + * * @return {@code non-null;} the nickname */ public String getNickname() { @@ -398,7 +398,7 @@ public final class Rop { * Gets whether this operation can possibly throw an exception. This * is just a convenient wrapper for * {@code getExceptions().size() != 0}. - * + * * @return {@code true} iff this operation can possibly throw */ public final boolean canThrow() { diff --git a/dx/src/com/android/dx/rop/code/RopMethod.java b/dx/src/com/android/dx/rop/code/RopMethod.java index 39575322a..591d325f2 100644 --- a/dx/src/com/android/dx/rop/code/RopMethod.java +++ b/dx/src/com/android/dx/rop/code/RopMethod.java @@ -32,19 +32,19 @@ public final class RopMethod { /** * {@code null-ok;} array of predecessors for each block, indexed by block - * label + * label */ private IntList[] predecessors; /** * {@code null-ok;} the predecessors for the implicit "exit" block, that is - * the labels for the blocks that return, if calculated + * the labels for the blocks that return, if calculated */ private IntList exitPredecessors; /** * Constructs an instance. - * + * * @param blocks {@code non-null;} basic block list of the method * @param firstLabel {@code >= 0;} the label of the first block to execute */ @@ -66,7 +66,7 @@ public final class RopMethod { /** * Gets the basic block list for this method. - * + * * @return {@code non-null;} the list */ public BasicBlockList getBlocks() { @@ -76,7 +76,7 @@ public final class RopMethod { /** * Gets the label for the first block in the method that this list * represents. - * + * * @return {@code >= 0;} the first-block label */ public int getFirstLabel() { @@ -86,7 +86,7 @@ public final class RopMethod { /** * Gets the predecessors associated with the given block. This throws * an exception if there is no block with the given label. - * + * * @param label {@code >= 0;} the label of the block in question * @return {@code non-null;} the predecessors of that block */ @@ -106,7 +106,7 @@ public final class RopMethod { /** * Gets the exit predecessors for this instance. - * + * * @return {@code non-null;} the exit predecessors */ public IntList getExitPredecessors() { @@ -122,7 +122,7 @@ public final class RopMethod { * Returns an instance that is identical to this one, except that * the registers in each instruction are offset by the given * amount. - * + * * @param delta the amount to offset register numbers by * @return {@code non-null;} an appropriately-constructed instance */ diff --git a/dx/src/com/android/dx/rop/code/Rops.java b/dx/src/com/android/dx/rop/code/Rops.java index 15c2e17ed..9085ff42c 100644 --- a/dx/src/com/android/dx/rop/code/Rops.java +++ b/dx/src/com/android/dx/rop/code/Rops.java @@ -201,7 +201,7 @@ public final class Rops { Rop.BRANCH_IF, "if-ne-object"); /** {@code x: int :: goto switchtable[x]} */ - public static final Rop SWITCH = + public static final Rop SWITCH = new Rop(RegOps.SWITCH, Type.VOID, StdTypeList.INT, Rop.BRANCH_SWITCH, "switch"); @@ -575,21 +575,21 @@ public final class Rops { /** * {@code r,x: int :: r = (x << 24) >> 24} (Java-style - * convert int to byte) + * convert int to byte) */ - public static final Rop TO_BYTE = + public static final Rop TO_BYTE = new Rop(RegOps.TO_BYTE, Type.INT, StdTypeList.INT, "to-byte"); /** * {@code r,x: int :: r = x & 0xffff} (Java-style - * convert int to char) + * convert int to char) */ public static final Rop TO_CHAR = new Rop(RegOps.TO_CHAR, Type.INT, StdTypeList.INT, "to-char"); /** * {@code r,x: int :: r = (x << 16) >> 16} (Java-style - * convert int to short) + * convert int to short) */ public static final Rop TO_SHORT = new Rop(RegOps.TO_SHORT, Type.INT, StdTypeList.INT, "to-short"); @@ -646,110 +646,110 @@ public final class Rops { "monitor-exit"); /** {@code r,y: int; x: int[] :: r = x[y]} */ - public static final Rop AGET_INT = + public static final Rop AGET_INT = new Rop(RegOps.AGET, Type.INT, StdTypeList.INTARR_INT, Exceptions.LIST_Error_Null_ArrayIndexOutOfBounds, "aget-int"); /** {@code r: long; x: long[]; y: int :: r = x[y]} */ - public static final Rop AGET_LONG = + public static final Rop AGET_LONG = new Rop(RegOps.AGET, Type.LONG, StdTypeList.LONGARR_INT, Exceptions.LIST_Error_Null_ArrayIndexOutOfBounds, "aget-long"); /** {@code r: float; x: float[]; y: int :: r = x[y]} */ - public static final Rop AGET_FLOAT = + public static final Rop AGET_FLOAT = new Rop(RegOps.AGET, Type.FLOAT, StdTypeList.FLOATARR_INT, Exceptions.LIST_Error_Null_ArrayIndexOutOfBounds, "aget-float"); /** {@code r: double; x: double[]; y: int :: r = x[y]} */ - public static final Rop AGET_DOUBLE = + public static final Rop AGET_DOUBLE = new Rop(RegOps.AGET, Type.DOUBLE, StdTypeList.DOUBLEARR_INT, Exceptions.LIST_Error_Null_ArrayIndexOutOfBounds, "aget-double"); /** {@code r: Object; x: Object[]; y: int :: r = x[y]} */ - public static final Rop AGET_OBJECT = + public static final Rop AGET_OBJECT = new Rop(RegOps.AGET, Type.OBJECT, StdTypeList.OBJECTARR_INT, Exceptions.LIST_Error_Null_ArrayIndexOutOfBounds, "aget-object"); /** {@code r: boolean; x: boolean[]; y: int :: r = x[y]} */ - public static final Rop AGET_BOOLEAN = + public static final Rop AGET_BOOLEAN = new Rop(RegOps.AGET, Type.INT, StdTypeList.BOOLEANARR_INT, Exceptions.LIST_Error_Null_ArrayIndexOutOfBounds, "aget-boolean"); /** {@code r: byte; x: byte[]; y: int :: r = x[y]} */ - public static final Rop AGET_BYTE = + public static final Rop AGET_BYTE = new Rop(RegOps.AGET, Type.INT, StdTypeList.BYTEARR_INT, Exceptions.LIST_Error_Null_ArrayIndexOutOfBounds, "aget-byte"); /** {@code r: char; x: char[]; y: int :: r = x[y]} */ - public static final Rop AGET_CHAR = + public static final Rop AGET_CHAR = new Rop(RegOps.AGET, Type.INT, StdTypeList.CHARARR_INT, Exceptions.LIST_Error_Null_ArrayIndexOutOfBounds, "aget-char"); /** {@code r: short; x: short[]; y: int :: r = x[y]} */ - public static final Rop AGET_SHORT = + public static final Rop AGET_SHORT = new Rop(RegOps.AGET, Type.INT, StdTypeList.SHORTARR_INT, Exceptions.LIST_Error_Null_ArrayIndexOutOfBounds, "aget-short"); /** {@code x,z: int; y: int[] :: y[z] = x} */ - public static final Rop APUT_INT = + public static final Rop APUT_INT = new Rop(RegOps.APUT, Type.VOID, StdTypeList.INT_INTARR_INT, Exceptions.LIST_Error_Null_ArrayIndexOutOfBounds, "aput-int"); /** {@code x: long; y: long[]; z: int :: y[z] = x} */ - public static final Rop APUT_LONG = + public static final Rop APUT_LONG = new Rop(RegOps.APUT, Type.VOID, StdTypeList.LONG_LONGARR_INT, Exceptions.LIST_Error_Null_ArrayIndexOutOfBounds, "aput-long"); /** {@code x: float; y: float[]; z: int :: y[z] = x} */ - public static final Rop APUT_FLOAT = + public static final Rop APUT_FLOAT = new Rop(RegOps.APUT, Type.VOID, StdTypeList.FLOAT_FLOATARR_INT, Exceptions.LIST_Error_Null_ArrayIndexOutOfBounds, "aput-float"); /** {@code x: double; y: double[]; z: int :: y[z] = x} */ - public static final Rop APUT_DOUBLE = + public static final Rop APUT_DOUBLE = new Rop(RegOps.APUT, Type.VOID, StdTypeList.DOUBLE_DOUBLEARR_INT, Exceptions.LIST_Error_Null_ArrayIndexOutOfBounds, "aput-double"); /** {@code x: Object; y: Object[]; z: int :: y[z] = x} */ - public static final Rop APUT_OBJECT = + public static final Rop APUT_OBJECT = new Rop(RegOps.APUT, Type.VOID, StdTypeList.OBJECT_OBJECTARR_INT, Exceptions.LIST_Error_Null_ArrayIndex_ArrayStore, "aput-object"); /** {@code x: boolean; y: boolean[]; z: int :: y[z] = x} */ - public static final Rop APUT_BOOLEAN = + public static final Rop APUT_BOOLEAN = new Rop(RegOps.APUT, Type.VOID, StdTypeList.INT_BOOLEANARR_INT, Exceptions.LIST_Error_Null_ArrayIndex_ArrayStore, "aput-boolean"); /** {@code x: byte; y: byte[]; z: int :: y[z] = x} */ - public static final Rop APUT_BYTE = + public static final Rop APUT_BYTE = new Rop(RegOps.APUT, Type.VOID, StdTypeList.INT_BYTEARR_INT, Exceptions.LIST_Error_Null_ArrayIndex_ArrayStore, "aput-byte"); /** {@code x: char; y: char[]; z: int :: y[z] = x} */ - public static final Rop APUT_CHAR = + public static final Rop APUT_CHAR = new Rop(RegOps.APUT, Type.VOID, StdTypeList.INT_CHARARR_INT, Exceptions.LIST_Error_Null_ArrayIndex_ArrayStore, "aput-char"); /** {@code x: short; y: short[]; z: int :: y[z] = x} */ - public static final Rop APUT_SHORT = + public static final Rop APUT_SHORT = new Rop(RegOps.APUT, Type.VOID, StdTypeList.INT_SHORTARR_INT, Exceptions.LIST_Error_Null_ArrayIndex_ArrayStore, "aput-short"); /** * {@code T: any non-array object type :: r = - * alloc(T)} (allocate heap space for an object) + * alloc(T)} (allocate heap space for an object) */ public static final Rop NEW_INSTANCE = new Rop(RegOps.NEW_INSTANCE, Type.OBJECT, StdTypeList.EMPTY, @@ -805,9 +805,9 @@ public final class Rops { /** * {@code T: any non-array object type; x: Object :: (T) x} (can - * throw {@code ClassCastException}) + * throw {@code ClassCastException}) */ - public static final Rop CHECK_CAST = + public static final Rop CHECK_CAST = new Rop(RegOps.CHECK_CAST, Type.VOID, StdTypeList.OBJECT, Exceptions.LIST_Error_ClassCastException, "check-cast"); @@ -815,7 +815,7 @@ public final class Rops { * {@code T: any non-array object type; x: Object :: x instanceof * T}. Note: This is listed as throwing {@code Error} * explicitly because the op <i>can</i> throw, but there are no - * other predefined exceptions for it. + * other predefined exceptions for it. */ public static final Rop INSTANCE_OF = new Rop(RegOps.INSTANCE_OF, Type.INT, StdTypeList.OBJECT, @@ -823,7 +823,7 @@ public final class Rops { /** * {@code r: int; x: Object; f: instance field spec of - * type int :: r = x.f} + * type int :: r = x.f} */ public static final Rop GET_FIELD_INT = new Rop(RegOps.GET_FIELD, Type.INT, StdTypeList.OBJECT, @@ -831,7 +831,7 @@ public final class Rops { /** * {@code r: long; x: Object; f: instance field spec of - * type long :: r = x.f} + * type long :: r = x.f} */ public static final Rop GET_FIELD_LONG = new Rop(RegOps.GET_FIELD, Type.LONG, StdTypeList.OBJECT, @@ -839,7 +839,7 @@ public final class Rops { /** * {@code r: float; x: Object; f: instance field spec of - * type float :: r = x.f} + * type float :: r = x.f} */ public static final Rop GET_FIELD_FLOAT = new Rop(RegOps.GET_FIELD, Type.FLOAT, StdTypeList.OBJECT, @@ -848,7 +848,7 @@ public final class Rops { /** * {@code r: double; x: Object; f: instance field spec of - * type double :: r = x.f} + * type double :: r = x.f} */ public static final Rop GET_FIELD_DOUBLE = new Rop(RegOps.GET_FIELD, Type.DOUBLE, StdTypeList.OBJECT, @@ -857,7 +857,7 @@ public final class Rops { /** * {@code r: Object; x: Object; f: instance field spec of - * type Object :: r = x.f} + * type Object :: r = x.f} */ public static final Rop GET_FIELD_OBJECT = new Rop(RegOps.GET_FIELD, Type.OBJECT, StdTypeList.OBJECT, @@ -866,7 +866,7 @@ public final class Rops { /** * {@code r: boolean; x: Object; f: instance field spec of - * type boolean :: r = x.f} + * type boolean :: r = x.f} */ public static final Rop GET_FIELD_BOOLEAN = new Rop(RegOps.GET_FIELD, Type.INT, StdTypeList.OBJECT, @@ -875,7 +875,7 @@ public final class Rops { /** * {@code r: byte; x: Object; f: instance field spec of - * type byte :: r = x.f} + * type byte :: r = x.f} */ public static final Rop GET_FIELD_BYTE = new Rop(RegOps.GET_FIELD, Type.INT, StdTypeList.OBJECT, @@ -884,7 +884,7 @@ public final class Rops { /** * {@code r: char; x: Object; f: instance field spec of - * type char :: r = x.f} + * type char :: r = x.f} */ public static final Rop GET_FIELD_CHAR = new Rop(RegOps.GET_FIELD, Type.INT, StdTypeList.OBJECT, @@ -893,7 +893,7 @@ public final class Rops { /** * {@code r: short; x: Object; f: instance field spec of - * type short :: r = x.f} + * type short :: r = x.f} */ public static final Rop GET_FIELD_SHORT = new Rop(RegOps.GET_FIELD, Type.INT, StdTypeList.OBJECT, @@ -947,7 +947,7 @@ public final class Rops { /** * {@code x: int; y: Object; f: instance field spec of type - * int :: y.f = x} + * int :: y.f = x} */ public static final Rop PUT_FIELD_INT = new Rop(RegOps.PUT_FIELD, Type.VOID, StdTypeList.INT_OBJECT, @@ -955,7 +955,7 @@ public final class Rops { /** * {@code x: long; y: Object; f: instance field spec of type - * long :: y.f = x} + * long :: y.f = x} */ public static final Rop PUT_FIELD_LONG = new Rop(RegOps.PUT_FIELD, Type.VOID, StdTypeList.LONG_OBJECT, @@ -963,7 +963,7 @@ public final class Rops { /** * {@code x: float; y: Object; f: instance field spec of type - * float :: y.f = x} + * float :: y.f = x} */ public static final Rop PUT_FIELD_FLOAT = new Rop(RegOps.PUT_FIELD, Type.VOID, StdTypeList.FLOAT_OBJECT, @@ -972,7 +972,7 @@ public final class Rops { /** * {@code x: double; y: Object; f: instance field spec of type - * double :: y.f = x} + * double :: y.f = x} */ public static final Rop PUT_FIELD_DOUBLE = new Rop(RegOps.PUT_FIELD, Type.VOID, StdTypeList.DOUBLE_OBJECT, @@ -981,7 +981,7 @@ public final class Rops { /** * {@code x: Object; y: Object; f: instance field spec of type - * Object :: y.f = x} + * Object :: y.f = x} */ public static final Rop PUT_FIELD_OBJECT = new Rop(RegOps.PUT_FIELD, Type.VOID, StdTypeList.OBJECT_OBJECT, @@ -990,7 +990,7 @@ public final class Rops { /** * {@code x: int; y: Object; f: instance field spec of type - * boolean :: y.f = x} + * boolean :: y.f = x} */ public static final Rop PUT_FIELD_BOOLEAN = new Rop(RegOps.PUT_FIELD, Type.VOID, StdTypeList.INT_OBJECT, @@ -999,7 +999,7 @@ public final class Rops { /** * {@code x: int; y: Object; f: instance field spec of type - * byte :: y.f = x} + * byte :: y.f = x} */ public static final Rop PUT_FIELD_BYTE = new Rop(RegOps.PUT_FIELD, Type.VOID, StdTypeList.INT_OBJECT, @@ -1008,7 +1008,7 @@ public final class Rops { /** * {@code x: int; y: Object; f: instance field spec of type - * char :: y.f = x} + * char :: y.f = x} */ public static final Rop PUT_FIELD_CHAR = new Rop(RegOps.PUT_FIELD, Type.VOID, StdTypeList.INT_OBJECT, @@ -1017,7 +1017,7 @@ public final class Rops { /** * {@code x: int; y: Object; f: instance field spec of type - * short :: y.f = x} + * short :: y.f = x} */ public static final Rop PUT_FIELD_SHORT = new Rop(RegOps.PUT_FIELD, Type.VOID, StdTypeList.INT_OBJECT, @@ -1106,12 +1106,12 @@ public final class Rops { * Returns the appropriate rop for the given opcode, destination, * and sources. The result is typically, but not necessarily, a * shared instance. - * + * * <p><b>Note:</b> This method does not do complete error checking on * its arguments, and so it may return an instance which seemed "right * enough" even though in actuality the passed arguments don't quite * match what is returned. TODO: Revisit this issue.</p> - * + * * @param opcode the opcode * @param dest {@code non-null;} destination (result) type, or * {@link Type#VOID} if none @@ -1239,7 +1239,7 @@ public final class Rops { /** * Returns the appropriate {@code move} rop for the given type. The * result is a shared instance. - * + * * @param type {@code non-null;} type of value being moved * @return {@code non-null;} an appropriate instance */ @@ -1259,7 +1259,7 @@ public final class Rops { /** * Returns the appropriate {@code move-param} rop for the * given type. The result is a shared instance. - * + * * @param type {@code non-null;} type of value being moved * @return {@code non-null;} an appropriate instance */ @@ -1278,7 +1278,7 @@ public final class Rops { /** * Returns the appropriate {@code move-exception} rop for the * given type. The result may be a shared instance. - * + * * @param type {@code non-null;} type of the exception * @return {@code non-null;} an appropriate instance */ @@ -1314,7 +1314,7 @@ public final class Rops { /** * Returns the appropriate {@code const} rop for the given * type. The result is a shared instance. - * + * * @param type {@code non-null;} type of the constant * @return {@code non-null;} an appropriate instance */ @@ -1337,7 +1337,7 @@ public final class Rops { /** * Returns the appropriate {@code if-eq} rop for the given * sources. The result is a shared instance. - * + * * @param types {@code non-null;} source types * @return {@code non-null;} an appropriate instance */ @@ -1349,7 +1349,7 @@ public final class Rops { /** * Returns the appropriate {@code if-ne} rop for the given * sources. The result is a shared instance. - * + * * @param types {@code non-null;} source types * @return {@code non-null;} an appropriate instance */ @@ -1361,7 +1361,7 @@ public final class Rops { /** * Returns the appropriate {@code if-lt} rop for the given * sources. The result is a shared instance. - * + * * @param types {@code non-null;} source types * @return {@code non-null;} an appropriate instance */ @@ -1372,7 +1372,7 @@ public final class Rops { /** * Returns the appropriate {@code if-ge} rop for the given * sources. The result is a shared instance. - * + * * @param types {@code non-null;} source types * @return {@code non-null;} an appropriate instance */ @@ -1383,7 +1383,7 @@ public final class Rops { /** * Returns the appropriate {@code if-gt} rop for the given * sources. The result is a shared instance. - * + * * @param types {@code non-null;} source types * @return {@code non-null;} an appropriate instance */ @@ -1394,7 +1394,7 @@ public final class Rops { /** * Returns the appropriate {@code if-le} rop for the given * sources. The result is a shared instance. - * + * * @param types {@code non-null;} source types * @return {@code non-null;} an appropriate instance */ @@ -1406,7 +1406,7 @@ public final class Rops { * Helper for all the {@code if*}-related methods, which * checks types and picks one of the four variants, throwing if * there's a problem. - * + * * @param types {@code non-null;} the types * @param intZ {@code non-null;} the int-to-0 comparison * @param objZ {@code null-ok;} the object-to-null comparison @@ -1454,7 +1454,7 @@ public final class Rops { /** * Returns the appropriate {@code add} rop for the given * types. The result is a shared instance. - * + * * @param types {@code non-null;} types of the sources * @return {@code non-null;} an appropriate instance */ @@ -1467,7 +1467,7 @@ public final class Rops { /** * Returns the appropriate {@code sub} rop for the given * types. The result is a shared instance. - * + * * @param types {@code non-null;} types of the sources * @return {@code non-null;} an appropriate instance */ @@ -1480,7 +1480,7 @@ public final class Rops { /** * Returns the appropriate {@code mul} rop for the given * types. The result is a shared instance. - * + * * @param types {@code non-null;} types of the sources * @return {@code non-null;} an appropriate instance */ @@ -1493,7 +1493,7 @@ public final class Rops { /** * Returns the appropriate {@code div} rop for the given * types. The result is a shared instance. - * + * * @param types {@code non-null;} types of the sources * @return {@code non-null;} an appropriate instance */ @@ -1506,7 +1506,7 @@ public final class Rops { /** * Returns the appropriate {@code rem} rop for the given * types. The result is a shared instance. - * + * * @param types {@code non-null;} types of the sources * @return {@code non-null;} an appropriate instance */ @@ -1519,7 +1519,7 @@ public final class Rops { /** * Returns the appropriate {@code and} rop for the given * types. The result is a shared instance. - * + * * @param types {@code non-null;} types of the sources * @return {@code non-null;} an appropriate instance */ @@ -1531,7 +1531,7 @@ public final class Rops { /** * Returns the appropriate {@code or} rop for the given * types. The result is a shared instance. - * + * * @param types {@code non-null;} types of the sources * @return {@code non-null;} an appropriate instance */ @@ -1543,7 +1543,7 @@ public final class Rops { /** * Returns the appropriate {@code xor} rop for the given * types. The result is a shared instance. - * + * * @param types {@code non-null;} types of the sources * @return {@code non-null;} an appropriate instance */ @@ -1555,7 +1555,7 @@ public final class Rops { /** * Returns the appropriate {@code shl} rop for the given * types. The result is a shared instance. - * + * * @param types {@code non-null;} types of the sources * @return {@code non-null;} an appropriate instance */ @@ -1567,7 +1567,7 @@ public final class Rops { /** * Returns the appropriate {@code shr} rop for the given * types. The result is a shared instance. - * + * * @param types {@code non-null;} types of the sources * @return {@code non-null;} an appropriate instance */ @@ -1579,7 +1579,7 @@ public final class Rops { /** * Returns the appropriate {@code ushr} rop for the given * types. The result is a shared instance. - * + * * @param types {@code non-null;} types of the sources * @return {@code non-null;} an appropriate instance */ @@ -1591,7 +1591,7 @@ public final class Rops { /** * Returns the appropriate binary arithmetic rop for the given type * and arguments. The result is a shared instance. - * + * * @param types {@code non-null;} sources of the operation * @param int1 {@code non-null;} the int-to-constant rop * @param long1 {@code non-null;} the long-to-constant rop @@ -1640,7 +1640,7 @@ public final class Rops { /** * Returns the appropriate {@code neg} rop for the given type. The * result is a shared instance. - * + * * @param type {@code non-null;} type of value being operated on * @return {@code non-null;} an appropriate instance */ @@ -1658,7 +1658,7 @@ public final class Rops { /** * Returns the appropriate {@code not} rop for the given type. The * result is a shared instance. - * + * * @param type {@code non-null;} type of value being operated on * @return {@code non-null;} an appropriate instance */ @@ -1674,7 +1674,7 @@ public final class Rops { /** * Returns the appropriate {@code cmpl} rop for the given type. The * result is a shared instance. - * + * * @param type {@code non-null;} type of value being compared * @return {@code non-null;} an appropriate instance */ @@ -1691,7 +1691,7 @@ public final class Rops { /** * Returns the appropriate {@code cmpg} rop for the given type. The * result is a shared instance. - * + * * @param type {@code non-null;} type of value being compared * @return {@code non-null;} an appropriate instance */ @@ -1707,7 +1707,7 @@ public final class Rops { /** * Returns the appropriate {@code conv} rop for the given types. The * result is a shared instance. - * + * * @param dest {@code non-null;} target value type * @param source {@code non-null;} source value type * @return {@code non-null;} an appropriate instance @@ -1752,7 +1752,7 @@ public final class Rops { /** * Returns the appropriate {@code return} rop for the given type. The * result is a shared instance. - * + * * @param type {@code non-null;} type of value being returned * @return {@code non-null;} an appropriate instance */ @@ -1772,7 +1772,7 @@ public final class Rops { /** * Returns the appropriate {@code aget} rop for the given type. The * result is a shared instance. - * + * * @param type {@code non-null;} element type of array being accessed * @return {@code non-null;} an appropriate instance */ @@ -1795,7 +1795,7 @@ public final class Rops { /** * Returns the appropriate {@code aput} rop for the given type. The * result is a shared instance. - * + * * @param type {@code non-null;} element type of array being accessed * @return {@code non-null;} an appropriate instance */ @@ -1818,7 +1818,7 @@ public final class Rops { /** * Returns the appropriate {@code new-array} rop for the given * type. The result is a shared instance. - * + * * @param arrayType {@code non-null;} array type of array being created * @return {@code non-null;} an appropriate instance */ @@ -1848,7 +1848,7 @@ public final class Rops { /** * Returns the appropriate {@code filled-new-array} rop for the given * type. The result may be a shared instance. - * + * * @param arrayType {@code non-null;} type of array being created * @param count {@code >= 0;} number of elements that the array should have * @return {@code non-null;} an appropriate instance @@ -1880,7 +1880,7 @@ public final class Rops { /** * Returns the appropriate {@code get-field} rop for the given * type. The result is a shared instance. - * + * * @param type {@code non-null;} type of the field in question * @return {@code non-null;} an appropriate instance */ @@ -1903,7 +1903,7 @@ public final class Rops { /** * Returns the appropriate {@code put-field} rop for the given * type. The result is a shared instance. - * + * * @param type {@code non-null;} type of the field in question * @return {@code non-null;} an appropriate instance */ @@ -1926,7 +1926,7 @@ public final class Rops { /** * Returns the appropriate {@code get-static} rop for the given * type. The result is a shared instance. - * + * * @param type {@code non-null;} type of the field in question * @return {@code non-null;} an appropriate instance */ @@ -1949,7 +1949,7 @@ public final class Rops { /** * Returns the appropriate {@code put-static} rop for the given * type. The result is a shared instance. - * + * * @param type {@code non-null;} type of the field in question * @return {@code non-null;} an appropriate instance */ @@ -1972,7 +1972,7 @@ public final class Rops { /** * Returns the appropriate {@code invoke-static} rop for the * given type. The result is typically a newly-allocated instance. - * + * * @param meth {@code non-null;} descriptor of the method * @return {@code non-null;} an appropriate instance */ @@ -1985,7 +1985,7 @@ public final class Rops { /** * Returns the appropriate {@code invoke-virtual} rop for the * given type. The result is typically a newly-allocated instance. - * + * * @param meth {@code non-null;} descriptor of the method, including the * {@code this} parameter * @return {@code non-null;} an appropriate instance @@ -1999,7 +1999,7 @@ public final class Rops { /** * Returns the appropriate {@code invoke-super} rop for the * given type. The result is typically a newly-allocated instance. - * + * * @param meth {@code non-null;} descriptor of the method, including the * {@code this} parameter * @return {@code non-null;} an appropriate instance @@ -2013,7 +2013,7 @@ public final class Rops { /** * Returns the appropriate {@code invoke-direct} rop for the * given type. The result is typically a newly-allocated instance. - * + * * @param meth {@code non-null;} descriptor of the method, including the * {@code this} parameter * @return {@code non-null;} an appropriate instance @@ -2027,7 +2027,7 @@ public final class Rops { /** * Returns the appropriate {@code invoke-interface} rop for the * given type. The result is typically a newly-allocated instance. - * + * * @param meth {@code non-null;} descriptor of the method, including the * {@code this} parameter * @return {@code non-null;} an appropriate instance @@ -2037,7 +2037,7 @@ public final class Rops { meth.getParameterFrameTypes(), StdTypeList.THROWABLE); } - + /** * Returns the appropriate {@code mark-local} rop for the given type. * The result is a shared instance. @@ -2066,7 +2066,7 @@ public final class Rops { /** * Throws the right exception to complain about a bogus type. - * + * * @param type {@code non-null;} the bad type * @return never */ @@ -2076,7 +2076,7 @@ public final class Rops { /** * Throws the right exception to complain about a bogus list of types. - * + * * @param types {@code non-null;} the bad types * @return never */ diff --git a/dx/src/com/android/dx/rop/code/SourcePosition.java b/dx/src/com/android/dx/rop/code/SourcePosition.java index f32caa15e..f7a7961d7 100644 --- a/dx/src/com/android/dx/rop/code/SourcePosition.java +++ b/dx/src/com/android/dx/rop/code/SourcePosition.java @@ -33,19 +33,19 @@ public final class SourcePosition { /** * {@code >= -1;} the bytecode address, or {@code -1} if that - * information is unknown + * information is unknown */ private final int address; /** * {@code >= -1;} the line number, or {@code -1} if that - * information is unknown + * information is unknown */ private final int line; /** * Constructs an instance. - * + * * @param sourceFile {@code null-ok;} name of the file of origin or * {@code null} if unknown * @param address {@code >= -1;} original bytecode address or {@code -1} @@ -117,7 +117,7 @@ public final class SourcePosition { /** * Returns whether the lines match between this instance and * the one given. - * + * * @param other {@code non-null;} the instance to compare to * @return {@code true} iff the lines match */ @@ -128,7 +128,7 @@ public final class SourcePosition { /** * Returns whether the lines and files match between this instance and * the one given. - * + * * @param other {@code non-null;} the instance to compare to * @return {@code true} iff the lines and files match */ @@ -140,7 +140,7 @@ public final class SourcePosition { /** * Gets the source file, if known. - * + * * @return {@code null-ok;} the source file or {@code null} if unknown */ public CstUtf8 getSourceFile() { @@ -149,7 +149,7 @@ public final class SourcePosition { /** * Gets the original bytecode address. - * + * * @return {@code >= -1;} the address or {@code -1} if unknown */ public int getAddress() { @@ -158,7 +158,7 @@ public final class SourcePosition { /** * Gets the original line number. - * + * * @return {@code >= -1;} the original line number or {@code -1} if * unknown */ diff --git a/dx/src/com/android/dx/rop/code/SwitchInsn.java b/dx/src/com/android/dx/rop/code/SwitchInsn.java index 586205bdf..31bb94dbb 100644 --- a/dx/src/com/android/dx/rop/code/SwitchInsn.java +++ b/dx/src/com/android/dx/rop/code/SwitchInsn.java @@ -31,7 +31,7 @@ public final class SwitchInsn /** * Constructs an instance. - * + * * @param opcode {@code non-null;} the opcode * @param position {@code non-null;} source position * @param result {@code null-ok;} spec for the result, if any @@ -110,7 +110,7 @@ public final class SwitchInsn /** * Gets the list of switch cases. - * + * * @return {@code non-null;} the case list */ public IntList getCases() { diff --git a/dx/src/com/android/dx/rop/code/ThrowingCstInsn.java b/dx/src/com/android/dx/rop/code/ThrowingCstInsn.java index b14e7588d..cdd21d12e 100644 --- a/dx/src/com/android/dx/rop/code/ThrowingCstInsn.java +++ b/dx/src/com/android/dx/rop/code/ThrowingCstInsn.java @@ -31,7 +31,7 @@ public final class ThrowingCstInsn /** * Constructs an instance. - * + * * @param opcode {@code non-null;} the opcode * @param position {@code non-null;} source position * @param sources {@code non-null;} specs for all the sources diff --git a/dx/src/com/android/dx/rop/code/ThrowingInsn.java b/dx/src/com/android/dx/rop/code/ThrowingInsn.java index 78dc87489..6561d4157 100644 --- a/dx/src/com/android/dx/rop/code/ThrowingInsn.java +++ b/dx/src/com/android/dx/rop/code/ThrowingInsn.java @@ -33,7 +33,7 @@ public final class ThrowingInsn /** * Gets the string form of a register spec list to be used as a catches * list. - * + * * @param catches {@code non-null;} the catches list * @return {@code non-null;} the string form */ @@ -53,7 +53,7 @@ public final class ThrowingInsn /** * Constructs an instance. - * + * * @param opcode {@code non-null;} the opcode * @param position {@code non-null;} source position * @param sources {@code non-null;} specs for all the sources diff --git a/dx/src/com/android/dx/rop/cst/Constant.java b/dx/src/com/android/dx/rop/cst/Constant.java index 64231d3b3..3ef035e01 100644 --- a/dx/src/com/android/dx/rop/cst/Constant.java +++ b/dx/src/com/android/dx/rop/cst/Constant.java @@ -42,7 +42,7 @@ public abstract class Constant /** * {@inheritDoc} - * + * * This compares in class-major and value-minor order. */ public final int compareTo(Constant other) { @@ -59,7 +59,7 @@ public abstract class Constant /** * Compare the values of this and another instance, which are guaranteed * to be of the same class. Subclasses must implement this. - * + * * @param other {@code non-null;} the instance to compare to * @return {@code -1}, {@code 0}, or {@code 1}, as usual * for a comparison diff --git a/dx/src/com/android/dx/rop/cst/CstAnnotation.java b/dx/src/com/android/dx/rop/cst/CstAnnotation.java index 1385798c9..8cdf1df44 100644 --- a/dx/src/com/android/dx/rop/cst/CstAnnotation.java +++ b/dx/src/com/android/dx/rop/cst/CstAnnotation.java @@ -24,7 +24,7 @@ import com.android.dx.rop.annotation.Annotation; public final class CstAnnotation extends Constant { /** {@code non-null;} the actual annotation */ private final Annotation annotation; - + /** * Constructs an instance. * @@ -87,7 +87,7 @@ public final class CstAnnotation extends Constant { /** * Get the underlying annotation. - * + * * @return {@code non-null;} the annotation */ public Annotation getAnnotation() { diff --git a/dx/src/com/android/dx/rop/cst/CstArray.java b/dx/src/com/android/dx/rop/cst/CstArray.java index 8b521bdc9..cb7d54de8 100644 --- a/dx/src/com/android/dx/rop/cst/CstArray.java +++ b/dx/src/com/android/dx/rop/cst/CstArray.java @@ -26,7 +26,7 @@ import com.android.dx.util.FixedSizeList; public final class CstArray extends Constant { /** {@code non-null;} the actual list of contents */ private final List list; - + /** * Constructs an instance. * @@ -89,7 +89,7 @@ public final class CstArray extends Constant { /** * Get the underlying list. - * + * * @return {@code non-null;} the list */ public List getList() { @@ -104,7 +104,7 @@ public final class CstArray extends Constant { /** * Constructs an instance. All indices initially contain * {@code null}. - * + * * @param size the size of the list */ public List(int size) { @@ -139,7 +139,7 @@ public final class CstArray extends Constant { * Gets the element at the given index. It is an error to call * this with the index for an element which was never set; if you * do that, this will throw {@code NullPointerException}. - * + * * @param n {@code >= 0, < size();} which index * @return {@code non-null;} element at that index */ @@ -149,7 +149,7 @@ public final class CstArray extends Constant { /** * Sets the element at the given index. - * + * * @param n {@code >= 0, < size();} which index * @param a {@code null-ok;} the element to set at {@code n} */ diff --git a/dx/src/com/android/dx/rop/cst/CstBaseMethodRef.java b/dx/src/com/android/dx/rop/cst/CstBaseMethodRef.java index 039d7edb5..5b0aeb6ab 100644 --- a/dx/src/com/android/dx/rop/cst/CstBaseMethodRef.java +++ b/dx/src/com/android/dx/rop/cst/CstBaseMethodRef.java @@ -99,7 +99,7 @@ public abstract class CstBaseMethodRef /** * {@inheritDoc} - * + * * In this case, this method returns the <i>return type</i> of this method. * * @return {@code non-null;} the method's return type @@ -117,7 +117,7 @@ public abstract class CstBaseMethodRef * {@code getPrototype().getParameterTypes().getWordCount()}, * plus {@code 1} if the method is to be treated as an * instance method. - * + * * @param isStatic whether the method should be considered static * @return {@code >= 0;} the argument word count */ diff --git a/dx/src/com/android/dx/rop/cst/CstBoolean.java b/dx/src/com/android/dx/rop/cst/CstBoolean.java index 8c290ef20..5ff858a5a 100644 --- a/dx/src/com/android/dx/rop/cst/CstBoolean.java +++ b/dx/src/com/android/dx/rop/cst/CstBoolean.java @@ -32,7 +32,7 @@ public final class CstBoolean /** * Makes an instance for the given value. This will return an * already-allocated instance. - * + * * @param value the {@code boolean} value * @return {@code non-null;} the appropriate instance */ @@ -43,7 +43,7 @@ public final class CstBoolean /** * Makes an instance for the given {@code int} value. This * will return an already-allocated instance. - * + * * @param value must be either {@code 0} or {@code 1} * @return {@code non-null;} the appropriate instance */ @@ -59,7 +59,7 @@ public final class CstBoolean /** * Constructs an instance. This constructor is private; use {@link #make}. - * + * * @param value the {@code boolean} value */ private CstBoolean(boolean value) { @@ -90,7 +90,7 @@ public final class CstBoolean /** * Gets the {@code boolean} value. - * + * * @return the value */ public boolean getValue() { diff --git a/dx/src/com/android/dx/rop/cst/CstByte.java b/dx/src/com/android/dx/rop/cst/CstByte.java index a8af9f786..fc8f58f8c 100644 --- a/dx/src/com/android/dx/rop/cst/CstByte.java +++ b/dx/src/com/android/dx/rop/cst/CstByte.java @@ -26,11 +26,11 @@ public final class CstByte extends CstLiteral32 { /** {@code non-null;} the value {@code 0} as an instance of this class */ public static final CstByte VALUE_0 = make((byte) 0); - + /** * Makes an instance for the given value. This may (but does not * necessarily) return an already-allocated instance. - * + * * @param value the {@code byte} value */ public static CstByte make(byte value) { @@ -41,7 +41,7 @@ public final class CstByte * Makes an instance for the given {@code int} value. This * may (but does not necessarily) return an already-allocated * instance. - * + * * @param value the value, which must be in range for a {@code byte} * @return {@code non-null;} the appropriate instance */ @@ -49,7 +49,7 @@ public final class CstByte byte cast = (byte) value; if (cast != value) { - throw new IllegalArgumentException("bogus byte value: " + + throw new IllegalArgumentException("bogus byte value: " + value); } @@ -58,7 +58,7 @@ public final class CstByte /** * Constructs an instance. This constructor is private; use {@link #make}. - * + * * @param value the {@code byte} value */ private CstByte(byte value) { @@ -90,7 +90,7 @@ public final class CstByte /** * Gets the {@code byte} value. - * + * * @return the value */ public byte getValue() { diff --git a/dx/src/com/android/dx/rop/cst/CstChar.java b/dx/src/com/android/dx/rop/cst/CstChar.java index 0a87cbc65..21d8b6784 100644 --- a/dx/src/com/android/dx/rop/cst/CstChar.java +++ b/dx/src/com/android/dx/rop/cst/CstChar.java @@ -30,7 +30,7 @@ public final class CstChar /** * Makes an instance for the given value. This may (but does not * necessarily) return an already-allocated instance. - * + * * @param value the {@code char} value */ public static CstChar make(char value) { @@ -41,7 +41,7 @@ public final class CstChar * Makes an instance for the given {@code int} value. This * may (but does not necessarily) return an already-allocated * instance. - * + * * @param value the value, which must be in range for a {@code char} * @return {@code non-null;} the appropriate instance */ @@ -49,7 +49,7 @@ public final class CstChar char cast = (char) value; if (cast != value) { - throw new IllegalArgumentException("bogus char value: " + + throw new IllegalArgumentException("bogus char value: " + value); } @@ -58,7 +58,7 @@ public final class CstChar /** * Constructs an instance. This constructor is private; use {@link #make}. - * + * * @param value the {@code char} value */ private CstChar(char value) { @@ -90,7 +90,7 @@ public final class CstChar /** * Gets the {@code char} value. - * + * * @return the value */ public char getValue() { diff --git a/dx/src/com/android/dx/rop/cst/CstDouble.java b/dx/src/com/android/dx/rop/cst/CstDouble.java index df4a2cf79..8f1766fca 100644 --- a/dx/src/com/android/dx/rop/cst/CstDouble.java +++ b/dx/src/com/android/dx/rop/cst/CstDouble.java @@ -35,7 +35,7 @@ public final class CstDouble /** * Makes an instance for the given value. This may (but does not * necessarily) return an already-allocated instance. - * + * * @param bits the {@code double} value as {@code long} bits */ public static CstDouble make(long bits) { @@ -48,7 +48,7 @@ public final class CstDouble /** * Constructs an instance. This constructor is private; use {@link #make}. - * + * * @param bits the {@code double} value as {@code long} bits */ private CstDouble(long bits) { @@ -81,7 +81,7 @@ public final class CstDouble /** * Gets the {@code double} value. - * + * * @return the value */ public double getValue() { diff --git a/dx/src/com/android/dx/rop/cst/CstEnumRef.java b/dx/src/com/android/dx/rop/cst/CstEnumRef.java index 78cab9df3..641ab3f4d 100644 --- a/dx/src/com/android/dx/rop/cst/CstEnumRef.java +++ b/dx/src/com/android/dx/rop/cst/CstEnumRef.java @@ -25,7 +25,7 @@ import com.android.dx.rop.type.Type; public final class CstEnumRef extends CstMemberRef { /** {@code null-ok;} the corresponding field ref, lazily initialized */ private CstFieldRef fieldRef; - + /** * Constructs an instance. * @@ -45,8 +45,8 @@ public final class CstEnumRef extends CstMemberRef { } /** - * {@inheritDoc} - * + * {@inheritDoc} + * * <b>Note:</b> This returns the enumerated type. */ public Type getType() { @@ -55,7 +55,7 @@ public final class CstEnumRef extends CstMemberRef { /** * Get a {@link CstFieldRef} that corresponds with this instance. - * + * * @return {@code non-null;} the corresponding field reference */ public CstFieldRef getFieldRef() { diff --git a/dx/src/com/android/dx/rop/cst/CstFieldRef.java b/dx/src/com/android/dx/rop/cst/CstFieldRef.java index 497531fa5..06f0b1501 100644 --- a/dx/src/com/android/dx/rop/cst/CstFieldRef.java +++ b/dx/src/com/android/dx/rop/cst/CstFieldRef.java @@ -28,7 +28,7 @@ public final class CstFieldRef extends CstMemberRef { * primitive type. For example, if given {@link Type#INT}, this * method returns an instance corresponding to the field * {@code java.lang.Integer.TYPE}. - * + * * @param primitiveType {@code non-null;} the primitive type * @return {@code non-null;} the corresponding static field */ @@ -39,7 +39,7 @@ public final class CstFieldRef extends CstMemberRef { /** * Constructs an instance. - * + * * @param definingClass {@code non-null;} the type of the defining class * @param nat {@code non-null;} the name-and-type */ @@ -55,7 +55,7 @@ public final class CstFieldRef extends CstMemberRef { /** * Returns the type of this field. - * + * * @return {@code non-null;} the field's type */ public Type getType() { diff --git a/dx/src/com/android/dx/rop/cst/CstFloat.java b/dx/src/com/android/dx/rop/cst/CstFloat.java index 531a20d96..0a2354a4d 100644 --- a/dx/src/com/android/dx/rop/cst/CstFloat.java +++ b/dx/src/com/android/dx/rop/cst/CstFloat.java @@ -36,7 +36,7 @@ public final class CstFloat /** * Makes an instance for the given value. This may (but does not * necessarily) return an already-allocated instance. - * + * * @param bits the {@code float} value as {@code int} bits */ public static CstFloat make(int bits) { @@ -49,7 +49,7 @@ public final class CstFloat /** * Constructs an instance. This constructor is private; use {@link #make}. - * + * * @param bits the {@code float} value as {@code int} bits */ private CstFloat(int bits) { @@ -82,7 +82,7 @@ public final class CstFloat /** * Gets the {@code float} value. - * + * * @return the value */ public float getValue() { diff --git a/dx/src/com/android/dx/rop/cst/CstInteger.java b/dx/src/com/android/dx/rop/cst/CstInteger.java index 8fae4fa57..3691fc08c 100644 --- a/dx/src/com/android/dx/rop/cst/CstInteger.java +++ b/dx/src/com/android/dx/rop/cst/CstInteger.java @@ -51,7 +51,7 @@ public final class CstInteger /** * Makes an instance for the given value. This may (but does not * necessarily) return an already-allocated instance. - * + * * @param value the {@code int} value * @return {@code non-null;} the appropriate instance */ @@ -75,7 +75,7 @@ public final class CstInteger /** * Constructs an instance. This constructor is private; use {@link #make}. - * + * * @param value the {@code int} value */ private CstInteger(int value) { @@ -107,7 +107,7 @@ public final class CstInteger /** * Gets the {@code int} value. - * + * * @return the value */ public int getValue() { diff --git a/dx/src/com/android/dx/rop/cst/CstInterfaceMethodRef.java b/dx/src/com/android/dx/rop/cst/CstInterfaceMethodRef.java index 55a75995a..8b8cb30a1 100644 --- a/dx/src/com/android/dx/rop/cst/CstInterfaceMethodRef.java +++ b/dx/src/com/android/dx/rop/cst/CstInterfaceMethodRef.java @@ -23,13 +23,13 @@ public final class CstInterfaceMethodRef extends CstBaseMethodRef { /** * {@code null-ok;} normal {@link CstMethodRef} that corresponds to this - * instance, if calculated + * instance, if calculated */ private CstMethodRef methodRef; /** * Constructs an instance. - * + * * @param definingClass {@code non-null;} the type of the defining class * @param nat {@code non-null;} the name-and-type */ @@ -47,7 +47,7 @@ public final class CstInterfaceMethodRef /** * Gets a normal (non-interface) {@link CstMethodRef} that corresponds to * this instance. - * + * * @return {@code non-null;} an appropriate instance */ public CstMethodRef toMethodRef() { diff --git a/dx/src/com/android/dx/rop/cst/CstKnownNull.java b/dx/src/com/android/dx/rop/cst/CstKnownNull.java index 09dde1b31..a80322c5b 100644 --- a/dx/src/com/android/dx/rop/cst/CstKnownNull.java +++ b/dx/src/com/android/dx/rop/cst/CstKnownNull.java @@ -88,7 +88,7 @@ public final class CstKnownNull extends CstLiteralBits { /** * {@inheritDoc} - * + * * As "literal bits," a known-null is always represented as the * number zero. */ @@ -99,7 +99,7 @@ public final class CstKnownNull extends CstLiteralBits { /** * {@inheritDoc} - * + * * As "literal bits," a known-null is always represented as the * number zero. */ diff --git a/dx/src/com/android/dx/rop/cst/CstLiteral32.java b/dx/src/com/android/dx/rop/cst/CstLiteral32.java index c6e3021eb..042cbd979 100644 --- a/dx/src/com/android/dx/rop/cst/CstLiteral32.java +++ b/dx/src/com/android/dx/rop/cst/CstLiteral32.java @@ -26,7 +26,7 @@ public abstract class CstLiteral32 /** * Constructs an instance. - * + * * @param bits the value as {@code int} bits */ /*package*/ CstLiteral32(int bits) { diff --git a/dx/src/com/android/dx/rop/cst/CstLiteral64.java b/dx/src/com/android/dx/rop/cst/CstLiteral64.java index d0b27d2b0..94cfa8cf7 100644 --- a/dx/src/com/android/dx/rop/cst/CstLiteral64.java +++ b/dx/src/com/android/dx/rop/cst/CstLiteral64.java @@ -26,7 +26,7 @@ public abstract class CstLiteral64 /** * Constructs an instance. - * + * * @param bits the value as {@code long} bits */ /*package*/ CstLiteral64(long bits) { diff --git a/dx/src/com/android/dx/rop/cst/CstLiteralBits.java b/dx/src/com/android/dx/rop/cst/CstLiteralBits.java index 64154874b..8bf13a2a3 100644 --- a/dx/src/com/android/dx/rop/cst/CstLiteralBits.java +++ b/dx/src/com/android/dx/rop/cst/CstLiteralBits.java @@ -45,7 +45,7 @@ public abstract class CstLiteralBits * Gets the value as {@code long} bits. If this instance contains * fewer bits than fit in a {@code long}, then the result of this * method is the sign extension of the value. - * + * * @return the bits */ public abstract long getLongBits(); @@ -60,7 +60,7 @@ public abstract class CstLiteralBits if (! fitsInInt()) { return false; } - + int bits = getIntBits(); return (short) bits == bits; } diff --git a/dx/src/com/android/dx/rop/cst/CstLong.java b/dx/src/com/android/dx/rop/cst/CstLong.java index c89a33992..d15952978 100644 --- a/dx/src/com/android/dx/rop/cst/CstLong.java +++ b/dx/src/com/android/dx/rop/cst/CstLong.java @@ -33,7 +33,7 @@ public final class CstLong /** * Makes an instance for the given value. This may (but does not * necessarily) return an already-allocated instance. - * + * * @param value the {@code long} value */ public static CstLong make(long value) { @@ -46,7 +46,7 @@ public final class CstLong /** * Constructs an instance. This constructor is private; use {@link #make}. - * + * * @param value the {@code long} value */ private CstLong(long value) { @@ -78,7 +78,7 @@ public final class CstLong /** * Gets the {@code long} value. - * + * * @return the value */ public long getValue() { diff --git a/dx/src/com/android/dx/rop/cst/CstMemberRef.java b/dx/src/com/android/dx/rop/cst/CstMemberRef.java index bae47c210..0791087cc 100644 --- a/dx/src/com/android/dx/rop/cst/CstMemberRef.java +++ b/dx/src/com/android/dx/rop/cst/CstMemberRef.java @@ -28,7 +28,7 @@ public abstract class CstMemberRef extends TypedConstant { /** * Constructs an instance. - * + * * @param definingClass {@code non-null;} the type of the defining class * @param nat {@code non-null;} the name-and-type */ @@ -53,7 +53,7 @@ public abstract class CstMemberRef extends TypedConstant { } CstMemberRef otherRef = (CstMemberRef) other; - return definingClass.equals(otherRef.definingClass) && + return definingClass.equals(otherRef.definingClass) && nat.equals(otherRef.nat); } @@ -104,7 +104,7 @@ public abstract class CstMemberRef extends TypedConstant { /** * Gets the type of the defining class. - * + * * @return {@code non-null;} the type of defining class */ public final CstType getDefiningClass() { @@ -113,7 +113,7 @@ public abstract class CstMemberRef extends TypedConstant { /** * Gets the defining name-and-type. - * + * * @return {@code non-null;} the name-and-type */ public final CstNat getNat() { diff --git a/dx/src/com/android/dx/rop/cst/CstMethodRef.java b/dx/src/com/android/dx/rop/cst/CstMethodRef.java index 77c97e9d1..075bc7cca 100644 --- a/dx/src/com/android/dx/rop/cst/CstMethodRef.java +++ b/dx/src/com/android/dx/rop/cst/CstMethodRef.java @@ -23,7 +23,7 @@ public final class CstMethodRef extends CstBaseMethodRef { /** * Constructs an instance. - * + * * @param definingClass {@code non-null;} the type of the defining class * @param nat {@code non-null;} the name-and-type */ diff --git a/dx/src/com/android/dx/rop/cst/CstNat.java b/dx/src/com/android/dx/rop/cst/CstNat.java index 5270fd2c7..8a2c59141 100644 --- a/dx/src/com/android/dx/rop/cst/CstNat.java +++ b/dx/src/com/android/dx/rop/cst/CstNat.java @@ -25,7 +25,7 @@ public final class CstNat extends Constant { /** * {@code non-null;} the instance for name {@code TYPE} and descriptor * {@code java.lang.Class}, which is useful when dealing with - * wrapped primitives + * wrapped primitives */ public static final CstNat PRIMITIVE_TYPE_NAT = new CstNat(new CstUtf8("TYPE"), @@ -39,7 +39,7 @@ public final class CstNat extends Constant { /** * Constructs an instance. - * + * * @param name {@code non-null;} the name * @param descriptor {@code non-null;} the descriptor */ @@ -64,7 +64,7 @@ public final class CstNat extends Constant { } CstNat otherNat = (CstNat) other; - return name.equals(otherNat.name) && + return name.equals(otherNat.name) && descriptor.equals(otherNat.descriptor); } @@ -107,7 +107,7 @@ public final class CstNat extends Constant { /** * Gets the name. - * + * * @return {@code non-null;} the name */ public CstUtf8 getName() { @@ -116,7 +116,7 @@ public final class CstNat extends Constant { /** * Gets the descriptor. - * + * * @return {@code non-null;} the descriptor */ public CstUtf8 getDescriptor() { @@ -126,7 +126,7 @@ public final class CstNat extends Constant { /** * Returns an unadorned but human-readable version of the name-and-type * value. - * + * * @return {@code non-null;} the human form */ public String toHuman() { @@ -137,7 +137,7 @@ public final class CstNat extends Constant { * Gets the field type corresponding to this instance's descriptor. * This method is only valid to call if the descriptor in fact describes * a field (and not a method). - * + * * @return {@code non-null;} the field type */ public Type getFieldType() { @@ -148,7 +148,7 @@ public final class CstNat extends Constant { * Gets whether this instance has the name of a standard instance * initialization method. This is just a convenient shorthand for * {@code getName().getString().equals("<init>")}. - * + * * @return {@code true} iff this is a reference to an * instance initialization method */ @@ -160,7 +160,7 @@ public final class CstNat extends Constant { * Gets whether this instance has the name of a standard class * initialization method. This is just a convenient shorthand for * {@code getName().getString().equals("<clinit>")}. - * + * * @return {@code true} iff this is a reference to an * instance initialization method */ diff --git a/dx/src/com/android/dx/rop/cst/CstShort.java b/dx/src/com/android/dx/rop/cst/CstShort.java index 4ac2f68da..5be1022f2 100644 --- a/dx/src/com/android/dx/rop/cst/CstShort.java +++ b/dx/src/com/android/dx/rop/cst/CstShort.java @@ -30,7 +30,7 @@ public final class CstShort /** * Makes an instance for the given value. This may (but does not * necessarily) return an already-allocated instance. - * + * * @param value the {@code short} value * @return {@code non-null;} the appropriate instance */ @@ -42,7 +42,7 @@ public final class CstShort * Makes an instance for the given {@code int} value. This * may (but does not necessarily) return an already-allocated * instance. - * + * * @param value the value, which must be in range for a {@code short} * @return {@code non-null;} the appropriate instance */ @@ -50,7 +50,7 @@ public final class CstShort short cast = (short) value; if (cast != value) { - throw new IllegalArgumentException("bogus short value: " + + throw new IllegalArgumentException("bogus short value: " + value); } @@ -59,7 +59,7 @@ public final class CstShort /** * Constructs an instance. This constructor is private; use {@link #make}. - * + * * @param value the {@code short} value */ private CstShort(short value) { @@ -91,7 +91,7 @@ public final class CstShort /** * Gets the {@code short} value. - * + * * @return the value */ public short getValue() { diff --git a/dx/src/com/android/dx/rop/cst/CstString.java b/dx/src/com/android/dx/rop/cst/CstString.java index ce00f5275..7dbfa0231 100644 --- a/dx/src/com/android/dx/rop/cst/CstString.java +++ b/dx/src/com/android/dx/rop/cst/CstString.java @@ -28,7 +28,7 @@ public final class CstString /** * Constructs an instance. - * + * * @param string {@code non-null;} the string value */ public CstString(CstUtf8 string) { @@ -41,7 +41,7 @@ public final class CstString /** * Constructs an instance. - * + * * @param string {@code non-null;} the string value */ public CstString(String string) { @@ -100,7 +100,7 @@ public final class CstString /** * Gets the string value. - * + * * @return {@code non-null;} the string value */ public CstUtf8 getString() { diff --git a/dx/src/com/android/dx/rop/cst/CstType.java b/dx/src/com/android/dx/rop/cst/CstType.java index 6dc986785..593adf8a3 100644 --- a/dx/src/com/android/dx/rop/cst/CstType.java +++ b/dx/src/com/android/dx/rop/cst/CstType.java @@ -96,7 +96,7 @@ public final class CstType extends TypedConstant { * class corresponding to a given primitive type. For example, if * given {@link Type#INT}, this method returns the class reference * {@code java.lang.Integer}. - * + * * @param primitiveType {@code non-null;} the primitive type * @return {@code non-null;} the corresponding wrapper class */ @@ -118,7 +118,7 @@ public final class CstType extends TypedConstant { /** * Returns an interned instance of this class for the given type. - * + * * @param type {@code non-null;} the underlying type * @return {@code non-null;} an appropriately-constructed instance */ @@ -135,7 +135,7 @@ public final class CstType extends TypedConstant { /** * Constructs an instance. - * + * * @param type {@code non-null;} the underlying type */ public CstType(Type type) { @@ -208,7 +208,7 @@ public final class CstType extends TypedConstant { * Gets the underlying type (as opposed to the type corresponding * to this instance as a constant, which is always * {@code Class}). - * + * * @return {@code non-null;} the type corresponding to the name */ public Type getClassType() { @@ -217,14 +217,14 @@ public final class CstType extends TypedConstant { /** * Gets the type descriptor for this instance. - * + * * @return {@code non-null;} the descriptor */ public CstUtf8 getDescriptor() { if (descriptor == null) { descriptor = new CstUtf8(type.getDescriptor()); } - + return descriptor; } } diff --git a/dx/src/com/android/dx/rop/cst/CstUtf8.java b/dx/src/com/android/dx/rop/cst/CstUtf8.java index 2c7a1df83..5cfc1f3fb 100644 --- a/dx/src/com/android/dx/rop/cst/CstUtf8.java +++ b/dx/src/com/android/dx/rop/cst/CstUtf8.java @@ -23,12 +23,12 @@ import com.android.dx.util.Hex; * Constants of type {@code CONSTANT_Utf8_info}. */ public final class CstUtf8 extends Constant { - /** + /** * {@code non-null;} instance representing {@code ""}, that is, the - * empty string + * empty string */ public static final CstUtf8 EMPTY_STRING = new CstUtf8(""); - + /** {@code non-null;} the UTF-8 value as a string */ private final String string; @@ -39,7 +39,7 @@ public final class CstUtf8 extends Constant { * Converts a string into its Java-style UTF-8 form. Java-style UTF-8 * differs from normal UTF-8 in the handling of character '\0' and * surrogate pairs. - * + * * @param string {@code non-null;} the string to convert * @return {@code non-null;} the UTF-8 bytes for it */ @@ -72,7 +72,7 @@ public final class CstUtf8 extends Constant { /** * Converts an array of UTF-8 bytes into a string. - * + * * @param bytes {@code non-null;} the bytes to convert * @return {@code non-null;} the converted string */ @@ -161,7 +161,7 @@ public final class CstUtf8 extends Constant { /** * Helper for {@link #utf8BytesToString}, which throws the right * exception for a bogus utf-8 byte. - * + * * @param value the byte value * @param offset the file offset * @return never @@ -174,7 +174,7 @@ public final class CstUtf8 extends Constant { /** * Constructs an instance from a {@code String}. - * + * * @param string {@code non-null;} the UTF-8 value as a string */ public CstUtf8(String string) { @@ -188,7 +188,7 @@ public final class CstUtf8 extends Constant { /** * Constructs an instance from some UTF-8 bytes. - * + * * @param bytes {@code non-null;} array of the UTF-8 bytes */ public CstUtf8(ByteArray bytes) { @@ -266,7 +266,7 @@ public final class CstUtf8 extends Constant { */ char nextChar = (i < (len - 1)) ? string.charAt(i + 1) : 0; - boolean displayZero = + boolean displayZero = (nextChar >= '0') && (nextChar <= '7'); sb.append('\\'); for (int shift = 6; shift >= 0; shift -= 3) { @@ -298,7 +298,7 @@ public final class CstUtf8 extends Constant { /** * Gets the value as a human-oriented string, surrounded by double * quotes. - * + * * @return {@code non-null;} the quoted string */ public String toQuoted() { @@ -309,7 +309,7 @@ public final class CstUtf8 extends Constant { * Gets the value as a human-oriented string, surrounded by double * quotes, but ellipsizes the result if it is longer than the given * maximum length - * + * * @param maxLength {@code >= 5;} the maximum length of the string to return * @return {@code non-null;} the quoted string */ @@ -331,7 +331,7 @@ public final class CstUtf8 extends Constant { /** * Gets the UTF-8 value as a string. * The returned string is always already interned. - * + * * @return {@code non-null;} the UTF-8 value as a string */ public String getString() { @@ -340,7 +340,7 @@ public final class CstUtf8 extends Constant { /** * Gets the UTF-8 value as UTF-8 encoded bytes. - * + * * @return {@code non-null;} an array of the UTF-8 bytes */ public ByteArray getBytes() { @@ -350,7 +350,7 @@ public final class CstUtf8 extends Constant { /** * Gets the size of this instance as UTF-8 code points. That is, * get the number of bytes in the UTF-8 encoding of this instance. - * + * * @return {@code >= 0;} the UTF-8 size */ public int getUtf8Size() { @@ -362,10 +362,10 @@ public final class CstUtf8 extends Constant { * get the number of 16-bit chars in the UTF-16 encoding of this * instance. This is the same as the {@code length} of the * Java {@code String} representation of this instance. - * + * * @return {@code >= 0;} the UTF-16 size */ public int getUtf16Size() { return string.length(); - } + } } diff --git a/dx/src/com/android/dx/rop/cst/StdConstantPool.java b/dx/src/com/android/dx/rop/cst/StdConstantPool.java index 82c3ab760..244395d8a 100644 --- a/dx/src/com/android/dx/rop/cst/StdConstantPool.java +++ b/dx/src/com/android/dx/rop/cst/StdConstantPool.java @@ -31,7 +31,7 @@ public final class StdConstantPool /** * Constructs an instance. All indices initially contain {@code null}. - * + * * @param size the size of the pool; this corresponds to the * class file field {@code constant_pool_count}, and is in fact * always at least one more than the actual size of the constant pool, @@ -89,7 +89,7 @@ public final class StdConstantPool /** * Sets the entry at the given index. - * + * * @param n {@code >= 1, < size();} which entry * @param cst {@code null-ok;} the constant to store */ @@ -127,7 +127,7 @@ public final class StdConstantPool /** * Throws the right exception for an invalid cpi. - * + * * @param idx the bad cpi * @return never * @throws ExceptionWithContext always thrown diff --git a/dx/src/com/android/dx/rop/cst/TypedConstant.java b/dx/src/com/android/dx/rop/cst/TypedConstant.java index 823d9c4fa..c250c462f 100644 --- a/dx/src/com/android/dx/rop/cst/TypedConstant.java +++ b/dx/src/com/android/dx/rop/cst/TypedConstant.java @@ -25,7 +25,7 @@ public abstract class TypedConstant extends Constant implements TypeBearer { /** * {@inheritDoc} - * + * * This implentation always returns {@code this}. */ public final TypeBearer getFrameType() { diff --git a/dx/src/com/android/dx/rop/cst/Zeroes.java b/dx/src/com/android/dx/rop/cst/Zeroes.java index 8bed657a2..7250b5ad9 100644 --- a/dx/src/com/android/dx/rop/cst/Zeroes.java +++ b/dx/src/com/android/dx/rop/cst/Zeroes.java @@ -28,10 +28,10 @@ public final class Zeroes { private Zeroes() { // This space intentionally left blank. } - + /** * Gets the "zero" (or {@code null}) value for the given type. - * + * * @param type {@code non-null;} the type in question * @return {@code non-null;} its "zero" value */ diff --git a/dx/src/com/android/dx/rop/type/Prototype.java b/dx/src/com/android/dx/rop/type/Prototype.java index 7e6ab59d5..cbd532883 100644 --- a/dx/src/com/android/dx/rop/type/Prototype.java +++ b/dx/src/com/android/dx/rop/type/Prototype.java @@ -41,10 +41,10 @@ public final class Prototype implements Comparable<Prototype> { private StdTypeList parameterFrameTypes; /** - * Returns the unique instance corresponding to the + * Returns the unique instance corresponding to the * given method descriptor. See vmspec-2 sec4.3.3 for details on the * field descriptor syntax. - * + * * @param descriptor {@code non-null;} the descriptor * @return {@code non-null;} the corresponding instance * @throws IllegalArgumentException thrown if the descriptor has @@ -110,7 +110,7 @@ public final class Prototype implements Comparable<Prototype> { * populate with parsed parameter types, and which also ensures * that there is a '(' at the start of the descriptor and a * single ')' somewhere before the end. - * + * * @param descriptor {@code non-null;} the descriptor string * @return {@code non-null;} array large enough to hold all parsed parameter * types, but which is likely actually larger than needed @@ -155,7 +155,7 @@ public final class Prototype implements Comparable<Prototype> { * on the given definer, name, and flags. For example, an init * method has an uninitialized object of type {@code definer} * as its first argument. - * + * * @param descriptor {@code non-null;} the descriptor string * @param definer {@code non-null;} class the method is defined on * @param isStatic whether this is a static method @@ -180,7 +180,7 @@ public final class Prototype implements Comparable<Prototype> { /** * Interns an instance which consists of the given number of * {@code int}s along with the given return type - * + * * @param returnType {@code non-null;} the return type * @param count {@code > 0;} the number of elements in the prototype * @return {@code non-null;} the interned instance @@ -206,7 +206,7 @@ public final class Prototype implements Comparable<Prototype> { /** * Constructs an instance. This is a private constructor; use one * of the public static methods to get instances. - * + * * @param descriptor {@code non-null;} the descriptor string */ private Prototype(String descriptor, Type returnType, @@ -258,7 +258,7 @@ public final class Prototype implements Comparable<Prototype> { if (this == other) { return 0; } - + /* * The return type is the major order, and then args in order, * and then the shorter list comes first (similar to string @@ -303,7 +303,7 @@ public final class Prototype implements Comparable<Prototype> { /** * Gets the descriptor string. - * + * * @return {@code non-null;} the descriptor */ public String getDescriptor() { @@ -312,7 +312,7 @@ public final class Prototype implements Comparable<Prototype> { /** * Gets the return type. - * + * * @return {@code non-null;} the return type */ public Type getReturnType() { @@ -321,7 +321,7 @@ public final class Prototype implements Comparable<Prototype> { /** * Gets the list of parameter types. - * + * * @return {@code non-null;} the list of parameter types */ public StdTypeList getParameterTypes() { @@ -333,7 +333,7 @@ public final class Prototype implements Comparable<Prototype> { * types. The difference between the two lists (if any) is that all * "intlike" types (see {@link Type#isIntlike}) are replaced by * {@link Type#INT}. - * + * * @return {@code non-null;} the list of parameter frame types */ public StdTypeList getParameterFrameTypes() { @@ -359,7 +359,7 @@ public final class Prototype implements Comparable<Prototype> { * Returns a new interned instance, which is the same as this instance, * except that it has an additional parameter prepended to the original's * argument list. - * + * * @param param {@code non-null;} the new first parameter * @return {@code non-null;} an appropriately-constructed instance */ @@ -379,7 +379,7 @@ public final class Prototype implements Comparable<Prototype> { * Puts the given instance in the intern table if it's not already * there. If a conflicting value is already in the table, then leave it. * Return the interned value. - * + * * @param desc {@code non-null;} instance to make interned * @return {@code non-null;} the actual interned object */ diff --git a/dx/src/com/android/dx/rop/type/StdTypeList.java b/dx/src/com/android/dx/rop/type/StdTypeList.java index a02381237..fe6647c03 100644 --- a/dx/src/com/android/dx/rop/type/StdTypeList.java +++ b/dx/src/com/android/dx/rop/type/StdTypeList.java @@ -163,7 +163,7 @@ public final class StdTypeList /** * Makes a single-element instance. - * + * * @param type {@code non-null;} the element * @return {@code non-null;} an appropriately-constructed instance */ @@ -175,7 +175,7 @@ public final class StdTypeList /** * Makes a two-element instance. - * + * * @param type0 {@code non-null;} the first element * @param type1 {@code non-null;} the second element * @return {@code non-null;} an appropriately-constructed instance @@ -189,7 +189,7 @@ public final class StdTypeList /** * Makes a three-element instance. - * + * * @param type0 {@code non-null;} the first element * @param type1 {@code non-null;} the second element * @param type2 {@code non-null;} the third element @@ -205,7 +205,7 @@ public final class StdTypeList /** * Makes a four-element instance. - * + * * @param type0 {@code non-null;} the first element * @param type1 {@code non-null;} the second element * @param type2 {@code non-null;} the third element @@ -226,7 +226,7 @@ public final class StdTypeList * Returns the given list as a comma-separated list of human forms. This * is a static method so as to work on arbitrary {@link TypeList} * instances. - * + * * @param list {@code non-null;} the list to convert * @return {@code non-null;} the human form */ @@ -236,7 +236,7 @@ public final class StdTypeList if (size == 0) { return "<empty>"; } - + StringBuffer sb = new StringBuffer(100); for (int i = 0; i < size; i++) { @@ -253,7 +253,7 @@ public final class StdTypeList * Returns a hashcode of the contents of the given list. This * is a static method so as to work on arbitrary {@link TypeList} * instances. - * + * * @param list {@code non-null;} the list to inspect * @return {@code non-null;} the hash code */ @@ -267,12 +267,12 @@ public final class StdTypeList return hash; } - + /** * Compares the contents of the given two instances for equality. This * is a static method so as to work on arbitrary {@link TypeList} * instances. - * + * * @param list1 {@code non-null;} one list to compare * @param list2 {@code non-null;} another list to compare * @return whether the two lists contain corresponding equal elements @@ -297,7 +297,7 @@ public final class StdTypeList * Compares the contents of the given two instances for ordering. This * is a static method so as to work on arbitrary {@link TypeList} * instances. - * + * * @param list1 {@code non-null;} one list to compare * @param list2 {@code non-null;} another list to compare * @return the order of the two lists @@ -322,10 +322,10 @@ public final class StdTypeList return 1; } } - + /** * Constructs an instance. All indices initially contain {@code null}. - * + * * @param size the size of the list */ public StdTypeList(int size) { @@ -367,7 +367,7 @@ public final class StdTypeList * Gets the indicated element. It is an error to call this with the * index for an element which was never set; if you do that, this * will throw {@code NullPointerException}. - * + * * @param n {@code >= 0, < size();} which element * @return {@code non-null;} the indicated element */ @@ -377,7 +377,7 @@ public final class StdTypeList /** * Sets the type at the given index. - * + * * @param n {@code >= 0, < size();} which element * @param type {@code non-null;} the type to store */ @@ -389,7 +389,7 @@ public final class StdTypeList * Returns a new instance, which is the same as this instance, * except that it has an additional type prepended to the * original. - * + * * @param type {@code non-null;} the new first element * @return {@code non-null;} an appropriately-constructed instance */ diff --git a/dx/src/com/android/dx/rop/type/Type.java b/dx/src/com/android/dx/rop/type/Type.java index 64c3c3069..16b16f533 100644 --- a/dx/src/com/android/dx/rop/type/Type.java +++ b/dx/src/com/android/dx/rop/type/Type.java @@ -28,7 +28,7 @@ import java.util.HashMap; */ public final class Type implements TypeBearer, Comparable<Type> { /** {@code non-null;} intern table mapping string descriptors to instances */ - private static final HashMap<String, Type> internTable = + private static final HashMap<String, Type> internTable = new HashMap<String, Type>(500); /** basic type constant for {@code void} */ @@ -147,63 +147,63 @@ public final class Type implements TypeBearer, Comparable<Type> { /** * {@code non-null;} instance representing {@code java.lang.Boolean}; the * suffix on the name helps disambiguate this from the instance - * representing a primitive type + * representing a primitive type */ public static final Type BOOLEAN_CLASS = intern("Ljava/lang/Boolean;"); /** * {@code non-null;} instance representing {@code java.lang.Byte}; the * suffix on the name helps disambiguate this from the instance - * representing a primitive type + * representing a primitive type */ public static final Type BYTE_CLASS = intern("Ljava/lang/Byte;"); /** * {@code non-null;} instance representing {@code java.lang.Character}; the * suffix on the name helps disambiguate this from the instance - * representing a primitive type + * representing a primitive type */ public static final Type CHARACTER_CLASS = intern("Ljava/lang/Character;"); /** * {@code non-null;} instance representing {@code java.lang.Double}; the * suffix on the name helps disambiguate this from the instance - * representing a primitive type + * representing a primitive type */ public static final Type DOUBLE_CLASS = intern("Ljava/lang/Double;"); /** * {@code non-null;} instance representing {@code java.lang.Float}; the * suffix on the name helps disambiguate this from the instance - * representing a primitive type + * representing a primitive type */ public static final Type FLOAT_CLASS = intern("Ljava/lang/Float;"); /** * {@code non-null;} instance representing {@code java.lang.Integer}; the * suffix on the name helps disambiguate this from the instance - * representing a primitive type + * representing a primitive type */ public static final Type INTEGER_CLASS = intern("Ljava/lang/Integer;"); /** * {@code non-null;} instance representing {@code java.lang.Long}; the * suffix on the name helps disambiguate this from the instance - * representing a primitive type + * representing a primitive type */ public static final Type LONG_CLASS = intern("Ljava/lang/Long;"); /** * {@code non-null;} instance representing {@code java.lang.Short}; the * suffix on the name helps disambiguate this from the instance - * representing a primitive type + * representing a primitive type */ public static final Type SHORT_CLASS = intern("Ljava/lang/Short;"); /** * {@code non-null;} instance representing {@code java.lang.Void}; the * suffix on the name helps disambiguate this from the instance - * representing a primitive type + * representing a primitive type */ public static final Type VOID_CLASS = intern("Ljava/lang/Void;"); @@ -239,7 +239,7 @@ public final class Type implements TypeBearer, Comparable<Type> { /** * basic type corresponding to this type; one of the - * {@code BT_*} constants + * {@code BT_*} constants */ private final int basicType; @@ -247,32 +247,32 @@ public final class Type implements TypeBearer, Comparable<Type> { * {@code >= -1;} for an uninitialized type, bytecode index that this * instance was allocated at; {@code Integer.MAX_VALUE} if it * was an incoming uninitialized instance; {@code -1} if this - * is an <i>inititialized</i> instance + * is an <i>inititialized</i> instance */ private final int newAt; /** * {@code null-ok;} the internal-form class name corresponding to this type, if * calculated; only valid if {@code this} is a reference type and - * additionally not a return address + * additionally not a return address */ private String className; /** * {@code null-ok;} the type corresponding to an array of this type, if - * calculated + * calculated */ private Type arrayType; /** * {@code null-ok;} the type corresponding to elements of this type, if - * calculated; only valid if {@code this} is an array type + * calculated; only valid if {@code this} is an array type */ private Type componentType; /** * {@code null-ok;} the type corresponding to the initialized version of - * this type, if this instance is in fact an uninitialized type + * this type, if this instance is in fact an uninitialized type */ private Type initializedType; @@ -282,7 +282,7 @@ public final class Type implements TypeBearer, Comparable<Type> { * field descriptor syntax. This method does <i>not</i> allow * {@code "V"} (that is, type {@code void}) as a valid * descriptor. - * + * * @param descriptor {@code non-null;} the descriptor * @return {@code non-null;} the corresponding instance * @throws IllegalArgumentException thrown if the descriptor has @@ -339,8 +339,8 @@ public final class Type implements TypeBearer, Comparable<Type> { char c = descriptor.charAt(i); switch (c) { case '[': - case ';': - case '.': + case ';': + case '.': case '(': case ')': { throw new IllegalArgumentException("bad descriptor"); @@ -365,7 +365,7 @@ public final class Type implements TypeBearer, Comparable<Type> { * given descriptor, allowing {@code "V"} to return the type * for {@code void}. Other than that one caveat, this method * is identical to {@link #intern}. - * + * * @param descriptor {@code non-null;} the descriptor * @return {@code non-null;} the corresponding instance * @throws IllegalArgumentException thrown if the descriptor has @@ -391,7 +391,7 @@ public final class Type implements TypeBearer, Comparable<Type> { * calling {@code intern(name)} if {@code name} begins * with {@code "["} and calling {@code intern("L" + name + ";")} * in all other cases. - * + * * @param name {@code non-null;} the name of the class whose type is desired * @return {@code non-null;} the corresponding type * @throws IllegalArgumentException thrown if the name has @@ -413,7 +413,7 @@ public final class Type implements TypeBearer, Comparable<Type> { * Constructs an instance corresponding to an "uninitialized type." * This is a private constructor; use one of the public static * methods to get instances. - * + * * @param descriptor {@code non-null;} the field descriptor for the type * @param basicType basic type corresponding to this type; one of the * {@code BT_*} constants @@ -444,7 +444,7 @@ public final class Type implements TypeBearer, Comparable<Type> { * Constructs an instance corresponding to an "initialized type." * This is a private constructor; use one of the public static * methods to get instances. - * + * * @param descriptor {@code non-null;} the field descriptor for the type * @param basicType basic type corresponding to this type; one of the * {@code BT_*} constants @@ -559,7 +559,7 @@ public final class Type implements TypeBearer, Comparable<Type> { /** * Gets the descriptor. - * + * * @return {@code non-null;} the descriptor */ public String getDescriptor() { @@ -571,7 +571,7 @@ public final class Type implements TypeBearer, Comparable<Type> { * form. This method is only valid if this instance is for a * normal reference type (that is, a reference type and * additionally not a return address). - * + * * @return {@code non-null;} the internal-form class name */ public String getClassName() { @@ -594,7 +594,7 @@ public final class Type implements TypeBearer, Comparable<Type> { /** * Gets the category. Most instances are category 1. {@code long} * and {@code double} are the only category 2 types. - * + * * @see #isCategory1 * @see #isCategory2 * @return the category @@ -612,7 +612,7 @@ public final class Type implements TypeBearer, Comparable<Type> { /** * Returns whether or not this is a category 1 type. - * + * * @see #getCategory * @see #isCategory2 * @return whether or not this is a category 1 type @@ -630,7 +630,7 @@ public final class Type implements TypeBearer, Comparable<Type> { /** * Returns whether or not this is a category 2 type. - * + * * @see #getCategory * @see #isCategory1 * @return whether or not this is a category 2 type @@ -650,7 +650,7 @@ public final class Type implements TypeBearer, Comparable<Type> { * Gets whether this type is "intlike." An intlike type is one which, when * placed on a stack or in a local, is automatically converted to an * {@code int}. - * + * * @return whether this type is "intlike" */ public boolean isIntlike() { @@ -670,7 +670,7 @@ public final class Type implements TypeBearer, Comparable<Type> { /** * Gets whether this type is a primitive type. All types are either * primitive or reference types. - * + * * @return whether this type is primitive */ public boolean isPrimitive() { @@ -696,7 +696,7 @@ public final class Type implements TypeBearer, Comparable<Type> { * reference type is a reference type that is not a return * address. This method is just convenient shorthand for * {@code getBasicType() == Type.BT_OBJECT}. - * + * * @return whether this type is a normal reference type */ public boolean isReference() { @@ -707,7 +707,7 @@ public final class Type implements TypeBearer, Comparable<Type> { * Gets whether this type is an array type. If this method returns * {@code true}, then it is safe to use {@link #getComponentType} * to determine the component type. - * + * * @return whether this type is an array type */ public boolean isArray() { @@ -717,7 +717,7 @@ public final class Type implements TypeBearer, Comparable<Type> { /** * Gets whether this type is an array type or is a known-null, and * hence is compatible with array types. - * + * * @return whether this type is an array type */ public boolean isArrayOrKnownNull() { @@ -729,7 +729,7 @@ public final class Type implements TypeBearer, Comparable<Type> { * uninitialized instance is what one gets back from the {@code new} * opcode, and remains uninitialized until a valid constructor is * invoked on it. - * + * * @return whether this type is "uninitialized" */ public boolean isUninitialized() { @@ -742,7 +742,7 @@ public final class Type implements TypeBearer, Comparable<Type> { * type is an uninitialized incoming parameter (i.e., the * {@code this} of an {@code <init>} method) or * {@code -1} if this type is in fact <i>initialized</i>. - * + * * @return {@code >= -1;} the allocation bytecode index */ public int getNewAt() { @@ -752,7 +752,7 @@ public final class Type implements TypeBearer, Comparable<Type> { /** * Gets the initialized type corresponding to this instance, but only * if this instance is in fact an uninitialized object type. - * + * * @return {@code non-null;} the initialized type */ public Type getInitializedType() { @@ -766,7 +766,7 @@ public final class Type implements TypeBearer, Comparable<Type> { /** * Gets the type corresponding to an array of this type. - * + * * @return {@code non-null;} the array type */ public Type getArrayType() { @@ -780,7 +780,7 @@ public final class Type implements TypeBearer, Comparable<Type> { /** * Gets the component type of this type. This method is only valid on * array types. - * + * * @return {@code non-null;} the component type */ public Type getComponentType() { @@ -799,7 +799,7 @@ public final class Type implements TypeBearer, Comparable<Type> { * Returns a new interned instance which is identical to this one, except * it is indicated as uninitialized and allocated at the given bytecode * index. This instance must be an initialized object type. - * + * * @param newAt {@code >= 0;} the allocation bytecode index * @return {@code non-null;} an appropriately-constructed instance */ @@ -837,7 +837,7 @@ public final class Type implements TypeBearer, Comparable<Type> { * Puts the given instance in the intern table if it's not already * there. If a conflicting value is already in the table, then leave it. * Return the interned value. - * + * * @param type {@code non-null;} instance to make interned * @return {@code non-null;} the actual interned object */ diff --git a/dx/src/com/android/dx/rop/type/TypeBearer.java b/dx/src/com/android/dx/rop/type/TypeBearer.java index 2f2f2749b..b03dbafa5 100644 --- a/dx/src/com/android/dx/rop/type/TypeBearer.java +++ b/dx/src/com/android/dx/rop/type/TypeBearer.java @@ -55,10 +55,10 @@ public interface TypeBearer * is the same as calling {@code getFrameType()} unless this * instance is an int-like type, in which case this method returns * {@code BT_INT}. - * + * * @see #getBasicType * @see #getFrameType - * + * * @return the basic frame type; one of the {@code BT_*} constants * defined by {@link Type} */ @@ -66,7 +66,7 @@ public interface TypeBearer /** * Returns whether this instance represents a constant value. - * + * * @return {@code true} if this instance represents a constant value * and {@code false} if not */ diff --git a/dx/src/com/android/dx/rop/type/TypeList.java b/dx/src/com/android/dx/rop/type/TypeList.java index e82cca7c2..de2d62e29 100644 --- a/dx/src/com/android/dx/rop/type/TypeList.java +++ b/dx/src/com/android/dx/rop/type/TypeList.java @@ -25,12 +25,12 @@ public interface TypeList { * {@code TypeList} interface itself doesn't provide any * means of mutation, but that doesn't mean that there isn't an * extra-interface way of mutating an instance. - * + * * @return {@code true} if this instance is mutable or * {@code false} if it is immutable */ public boolean isMutable(); - + /** * Gets the size of this list. * @@ -52,7 +52,7 @@ public interface TypeList { * Gets the number of 32-bit words required to hold instances of * all the elements of this list. This is a sum of the widths (categories) * of all the elements. - * + * * @return {@code >= 0;} the required number of words */ public int getWordCount(); @@ -61,7 +61,7 @@ public interface TypeList { * Returns a new instance which is identical to this one, except that * the given item is appended to the end and it is guaranteed to be * immutable. - * + * * @param type {@code non-null;} item to append * @return {@code non-null;} an appropriately-constructed instance */ diff --git a/dx/src/com/android/dx/ssa/BasicRegisterMapper.java b/dx/src/com/android/dx/ssa/BasicRegisterMapper.java index fdabaab1d..83045b234 100644 --- a/dx/src/com/android/dx/ssa/BasicRegisterMapper.java +++ b/dx/src/com/android/dx/ssa/BasicRegisterMapper.java @@ -33,7 +33,7 @@ public class BasicRegisterMapper extends RegisterMapper { /** * Creates a new OneToOneRegisterMapper. - * + * * @param countOldRegisters the number of registers in the old name space */ public BasicRegisterMapper(int countOldRegisters) { diff --git a/dx/src/com/android/dx/ssa/ConstCollector.java b/dx/src/com/android/dx/ssa/ConstCollector.java index 03252d1a4..7aa512d21 100644 --- a/dx/src/com/android/dx/ssa/ConstCollector.java +++ b/dx/src/com/android/dx/ssa/ConstCollector.java @@ -71,7 +71,7 @@ public class ConstCollector { /** * Constructs an instance. - * + * * @param ssaMethod {@code non-null;} method to process */ private ConstCollector(SsaMethod ssaMethod) { @@ -86,7 +86,7 @@ public class ConstCollector { ArrayList<TypedConstant> constantList = getConstsSortedByCountUse(); - + int toCollect = Math.min(constantList.size(), MAX_COLLECTED_CONSTANTS); SsaBasicBlock start = ssaMeth.getEntryBlock(); @@ -126,7 +126,7 @@ public class ConstCollector { SsaBasicBlock resultBlock = constBlock.insertNewSuccessor(successorBlock); - PlainInsn insn + PlainInsn insn = new PlainInsn( Rops.opMoveResultPseudo(result.getTypeBearer()), SourcePosition.NO_INFO, @@ -184,7 +184,7 @@ public class ConstCollector { } /* * We can't move any throwable const whose throw will be - * caught, so don't count them. + * caught, so don't count them. */ if (insn.getBlock().getSuccessors().cardinality() > 1) { continue; @@ -255,7 +255,7 @@ public class ConstCollector { * variable, then insert a mark-local for {@code newReg} just below * it. We expect the definition of {@code origReg} to ultimately * be removed by the dead code eliminator - * + * * @param origReg {@code non-null;} original register * @param newReg {@code non-null;} new register that will replace * {@code origReg} @@ -338,7 +338,7 @@ public class ConstCollector { if (ssaMeth.isRegALocal(origReg)) { if (!COLLECT_ONE_LOCAL) { - continue; + continue; } else { /* * TODO: If the same local gets the same cst diff --git a/dx/src/com/android/dx/ssa/DeadCodeRemover.java b/dx/src/com/android/dx/ssa/DeadCodeRemover.java index ec960b824..2a290500b 100644 --- a/dx/src/com/android/dx/ssa/DeadCodeRemover.java +++ b/dx/src/com/android/dx/ssa/DeadCodeRemover.java @@ -53,7 +53,7 @@ public class DeadCodeRemover { /** * Process a method with the dead-code remver - * + * * @param ssaMethod method to process */ public static void process(SsaMethod ssaMethod) { @@ -63,7 +63,7 @@ public class DeadCodeRemover { /** * Constructs an instance. - * + * * @param ssaMethod method to process */ private DeadCodeRemover(SsaMethod ssaMethod) { @@ -127,7 +127,7 @@ public class DeadCodeRemover { /** * Returns true if the only uses of this register form a circle of * operations with no side effects. - * + * * @param regV register to examine * @param set a set of registers that we've already determined * are only used as sources in operations with no side effect or null @@ -179,7 +179,7 @@ public class DeadCodeRemover { return true; } - return insn.hasSideEffect(); + return insn.hasSideEffect(); } /** diff --git a/dx/src/com/android/dx/ssa/DomFront.java b/dx/src/com/android/dx/ssa/DomFront.java index 3005015b1..87a249d70 100644 --- a/dx/src/com/android/dx/ssa/DomFront.java +++ b/dx/src/com/android/dx/ssa/DomFront.java @@ -37,7 +37,7 @@ public class DomFront { private final SsaMethod meth; private final ArrayList<SsaBasicBlock> nodes; - + private final DomInfo[] domInfos; /** @@ -55,8 +55,8 @@ public class DomFront { } /** - * Constructs instance. Call {@link DomFront#run} to process. - * + * Constructs instance. Call {@link DomFront#run} to process. + * * @param meth {@code non-null;} method to process */ public DomFront(SsaMethod meth) { @@ -98,7 +98,7 @@ public class DomFront { } buildDomTree(); - + if (DEBUG) { debugPrintDomChildren(); } diff --git a/dx/src/com/android/dx/ssa/Dominators.java b/dx/src/com/android/dx/ssa/Dominators.java index f7d7da6f2..503e85752 100644 --- a/dx/src/com/android/dx/ssa/Dominators.java +++ b/dx/src/com/android/dx/ssa/Dominators.java @@ -60,7 +60,7 @@ public final class Dominators { /** * Constructs an instance. - * + * * @param meth {@code non-null;} method to process * @param domInfos {@code non-null;} the raw dominator info * @param postdom true for postdom information, false for normal dom info @@ -78,7 +78,7 @@ public final class Dominators { /** * Constructs a fully-initialized instance. (This method exists so as * to avoid calling a large amount of code in the constructor.) - * + * * @param meth {@code non-null;} method to process * @param domInfos {@code non-null;} the raw dominator info * @param postdom true for postdom information, false for normal dom info @@ -109,7 +109,7 @@ public final class Dominators { /** * Performs path compress on the DFS info. - * + * * @param in Basic block whose DFS info we are path compressing. */ private void compress(SsaBasicBlock in) { @@ -120,7 +120,7 @@ public final class Dominators { ArrayList<SsaBasicBlock> worklist = new ArrayList<SsaBasicBlock>(); HashSet<SsaBasicBlock> visited = new HashSet<SsaBasicBlock>(); worklist.add(in); - + while (!worklist.isEmpty()) { int wsize = worklist.size(); SsaBasicBlock v = worklist.get(wsize - 1); @@ -164,7 +164,7 @@ public final class Dominators { /** * Performs dominator/post-dominator calculation for the control * flow graph. - * + * * @param meth {@code non-null;} method to analyze */ private void run() { @@ -175,7 +175,7 @@ public final class Dominators { vertex.add(root); domInfos[root.getIndex()].idom = root.getIndex(); } - + /* * First we perform a DFS numbering of the blocks, by * numbering the dfs tree roots. diff --git a/dx/src/com/android/dx/ssa/InterferenceRegisterMapper.java b/dx/src/com/android/dx/ssa/InterferenceRegisterMapper.java index 392579d88..851249ba3 100644 --- a/dx/src/com/android/dx/ssa/InterferenceRegisterMapper.java +++ b/dx/src/com/android/dx/ssa/InterferenceRegisterMapper.java @@ -49,7 +49,7 @@ public class InterferenceRegisterMapper extends BasicRegisterMapper { /** * Constructs an instance - * + * * @param countOldRegisters number of registers in old namespace */ public InterferenceRegisterMapper(InterferenceGraph oldRegInterference, @@ -113,7 +113,7 @@ public class InterferenceRegisterMapper extends BasicRegisterMapper { /** * Adds a register's interference set to the interference list, * growing it if necessary. - * + * * @param newReg register in new namespace * @param oldReg register in old namespace */ @@ -158,7 +158,7 @@ public class InterferenceRegisterMapper extends BasicRegisterMapper { return true; } } - + return false; } } diff --git a/dx/src/com/android/dx/ssa/LiteralOpUpgrader.java b/dx/src/com/android/dx/ssa/LiteralOpUpgrader.java index a70b5bb29..01d818d03 100644 --- a/dx/src/com/android/dx/ssa/LiteralOpUpgrader.java +++ b/dx/src/com/android/dx/ssa/LiteralOpUpgrader.java @@ -48,7 +48,7 @@ public class LiteralOpUpgrader { LiteralOpUpgrader dc; dc = new LiteralOpUpgrader(ssaMethod); - + dc.run(); } diff --git a/dx/src/com/android/dx/ssa/MoveParamCombiner.java b/dx/src/com/android/dx/ssa/MoveParamCombiner.java index 352e3e6ab..41660d203 100644 --- a/dx/src/com/android/dx/ssa/MoveParamCombiner.java +++ b/dx/src/com/android/dx/ssa/MoveParamCombiner.java @@ -37,7 +37,7 @@ public class MoveParamCombiner { /** * Processes a method with this optimization step. - * + * * @param ssaMethod method to process */ public static void process(SsaMethod ssaMethod) { @@ -45,7 +45,7 @@ public class MoveParamCombiner { } private MoveParamCombiner(SsaMethod ssaMeth) { - this.ssaMeth = ssaMeth; + this.ssaMeth = ssaMeth; } /** @@ -126,7 +126,7 @@ public class MoveParamCombiner { // Use list is modified by mapSourceRegisters for (int i = uses.size() - 1; i >= 0; i--) { - SsaInsn use = uses.get(i); + SsaInsn use = uses.get(i); use.mapSourceRegisters(mapper); } diff --git a/dx/src/com/android/dx/ssa/NormalSsaInsn.java b/dx/src/com/android/dx/ssa/NormalSsaInsn.java index d3392ca0f..93d36471b 100644 --- a/dx/src/com/android/dx/ssa/NormalSsaInsn.java +++ b/dx/src/com/android/dx/ssa/NormalSsaInsn.java @@ -63,13 +63,13 @@ public final class NormalSsaInsn extends SsaInsn implements Cloneable { for (int i = 0; i < sz; i++) { newSources.set(i, i == index ? newSpec : origSources.get(i)); } - + newSources.setImmutable(); RegisterSpec origSpec = origSources.get(index); if (origSpec.getReg() != newSpec.getReg()) { /* - * If the register remains unchanged, we're only changing + * If the register remains unchanged, we're only changing * the type or local var name so don't update use list */ getBlock().getParent().onSourceChanged(this, origSpec, newSpec); @@ -102,7 +102,7 @@ public final class NormalSsaInsn extends SsaInsn implements Cloneable { /** * Like rop.Insn.getSources(). - * + * * @return {@code null-ok;} sources list */ public RegisterSpecList getSources() { @@ -137,7 +137,7 @@ public final class NormalSsaInsn extends SsaInsn implements Cloneable { /** {@inheritDoc} */ public RegisterSpec getLocalAssignment() { RegisterSpec assignment; - + if (insn.getOpcode().getOpcode() == RegOps.MARK_LOCAL) { assignment = insn.getSources().get(0); } else { diff --git a/dx/src/com/android/dx/ssa/Optimizer.java b/dx/src/com/android/dx/ssa/Optimizer.java index c5f6dc9a2..27a134ab5 100644 --- a/dx/src/com/android/dx/ssa/Optimizer.java +++ b/dx/src/com/android/dx/ssa/Optimizer.java @@ -71,14 +71,14 @@ public class Optimizer { boolean isStatic, boolean inPreserveLocals, TranslationAdvice inAdvice) { - return optimize(rmeth, paramWidth, isStatic, inPreserveLocals, inAdvice, + return optimize(rmeth, paramWidth, isStatic, inPreserveLocals, inAdvice, EnumSet.allOf(OptionalStep.class)); } /** * Runs optimization algorthims over this method, and returns a new * instance of RopMethod with the changes. - * + * * @param rmeth method to process * @param paramWidth the total width, in register-units, of this method's * parameters @@ -241,6 +241,6 @@ public class Optimizer { LivenessAnalyzer.constructInterferenceGraph(ssaMeth); - return ssaMeth; + return ssaMeth; } } diff --git a/dx/src/com/android/dx/ssa/PhiInsn.java b/dx/src/com/android/dx/ssa/PhiInsn.java index 64e85acb9..3ea876ff7 100644 --- a/dx/src/com/android/dx/ssa/PhiInsn.java +++ b/dx/src/com/android/dx/ssa/PhiInsn.java @@ -48,7 +48,7 @@ public final class PhiInsn extends SsaInsn { /** * Constructs a new phi insn with no operands. - * + * * @param resultReg the result reg for this phi insn * @param block block containing this insn. */ @@ -59,7 +59,7 @@ public final class PhiInsn extends SsaInsn { /** * Makes a phi insn with a void result type. - * + * * @param resultReg the result register for this phi insn. * @param block block containing this insn. */ @@ -88,7 +88,7 @@ public final class PhiInsn extends SsaInsn { */ public void updateSourcesToDefinitions(SsaMethod ssaMeth) { for (Operand o : operands) { - RegisterSpec def + RegisterSpec def = ssaMeth.getDefinitionForRegister( o.regSpec.getReg()).getResult(); @@ -111,7 +111,7 @@ public final class PhiInsn extends SsaInsn { /** * Gets the original rop-form result reg. This is useful during renaming. - * + * * @return the original rop-form result reg */ public int getRopResultReg() { @@ -120,7 +120,7 @@ public final class PhiInsn extends SsaInsn { /** * Adds an operand to this phi instruction. - * + * * @param registerSpec register spec, including type and reg of operand * @param predBlock predecessor block to be associated with this operand */ @@ -128,7 +128,7 @@ public final class PhiInsn extends SsaInsn { SsaBasicBlock predBlock) { operands.add(new Operand(registerSpec, predBlock.getIndex(), predBlock.getRopLabel())); - + // Un-cache sources, in case someone has already called getSources(). sources = null; } @@ -136,7 +136,7 @@ public final class PhiInsn extends SsaInsn { /** * Gets the index of the pred block associated with the RegisterSpec * at the particular getSources() index. - * + * * @param sourcesIndex index of source in getSources() * @return block index */ @@ -177,7 +177,7 @@ public final class PhiInsn extends SsaInsn { /** * Gets sources. Constructed lazily from phi operand data structures and * then cached. - * + * * @return {@code non-null;} sources list */ public RegisterSpecList getSources() { @@ -255,7 +255,7 @@ public final class PhiInsn extends SsaInsn { /** * Always throws an exeption, since a phi insn may not be * converted back to rop form. - * + * * @return always throws exception */ @Override @@ -287,7 +287,7 @@ public final class PhiInsn extends SsaInsn { /** {@inheritDoc} */ @Override public boolean isPhiOrMove() { - return true; + return true; } /** {@inheritDoc} */ @@ -310,7 +310,7 @@ public final class PhiInsn extends SsaInsn { /** * Returns human-readable string for listing dumps. This method * allows sub-classes to specify extra text. - * + * * @param extra {@code null-ok;} the argument to print after the opcode * @return human-readable string for listing dumps */ @@ -318,7 +318,7 @@ public final class PhiInsn extends SsaInsn { StringBuffer sb = new StringBuffer(80); sb.append(SourcePosition.NO_INFO); - sb.append(": phi"); + sb.append(": phi"); if (extra != null) { sb.append("("); @@ -327,7 +327,7 @@ public final class PhiInsn extends SsaInsn { } RegisterSpec result = getResult(); - + if (result == null) { sb.append(" ."); } else { diff --git a/dx/src/com/android/dx/ssa/PhiTypeResolver.java b/dx/src/com/android/dx/ssa/PhiTypeResolver.java index f4c26d700..4b8b4e3a6 100644 --- a/dx/src/com/android/dx/ssa/PhiTypeResolver.java +++ b/dx/src/com/android/dx/ssa/PhiTypeResolver.java @@ -121,7 +121,7 @@ public class PhiTypeResolver { * Resolves the result of a phi insn based on its operands. The "void" * type, which is a nonsensical type for a register, is used for * registers defined by as-of-yet-unresolved phi operations. - * + * * @return true if the result type changed, false if no change */ boolean resolveResultType(PhiInsn insn) { @@ -185,7 +185,7 @@ public class PhiTypeResolver { } LocalItem newLocal = sameLocals ? firstLocal : null; - + RegisterSpec result = insn.getResult(); if ((result.getTypeBearer() == newResultType) diff --git a/dx/src/com/android/dx/ssa/RegisterMapper.java b/dx/src/com/android/dx/ssa/RegisterMapper.java index 1f45b429a..bef941f31 100644 --- a/dx/src/com/android/dx/ssa/RegisterMapper.java +++ b/dx/src/com/android/dx/ssa/RegisterMapper.java @@ -21,7 +21,7 @@ import com.android.dx.rop.code.RegisterSpecList; import com.android.dx.util.ToHuman; /** - * Represents a mapping between two register numbering schemes. + * Represents a mapping between two register numbering schemes. * Subclasses of this may be mutable, and as such the mapping provided * is only valid for the lifetime of the method call in which * instances of this class are passed. diff --git a/dx/src/com/android/dx/ssa/SCCP.java b/dx/src/com/android/dx/ssa/SCCP.java index 73e9b4992..42abbb25a 100644 --- a/dx/src/com/android/dx/ssa/SCCP.java +++ b/dx/src/com/android/dx/ssa/SCCP.java @@ -136,7 +136,7 @@ public class SCCP { return false; } } - + /** * Simulates a PHI node and set the lattice for the result * to the approriate value. @@ -438,7 +438,7 @@ public class SCCP { * steps. */ private void replaceConstants() { - for (int reg = 0; reg < regCount; reg++) { + for (int reg = 0; reg < regCount; reg++) { if (latticeValues[reg] != CONSTANT) { continue; } diff --git a/dx/src/com/android/dx/ssa/SsaInsn.java b/dx/src/com/android/dx/ssa/SsaInsn.java index 815f82d38..ca7a1a2f1 100644 --- a/dx/src/com/android/dx/ssa/SsaInsn.java +++ b/dx/src/com/android/dx/ssa/SsaInsn.java @@ -31,7 +31,7 @@ public abstract class SsaInsn implements ToHuman, Cloneable { /** * Constructs an instance. - * + * * @param result {@code null-ok;} initial result register. May be changed. * @param block {@code non-null;} block containing this insn. Can * never change. @@ -68,7 +68,7 @@ public abstract class SsaInsn implements ToHuman, Cloneable { /** * Like {@link com.android.dx.rop.code.Insn getResult()}. - * + * * @return result register */ public RegisterSpec getResult() { @@ -77,7 +77,7 @@ public abstract class SsaInsn implements ToHuman, Cloneable { /** * Set the result register. - * + * * @param result {@code non-null;} the new result register */ protected void setResult(RegisterSpec result) { @@ -90,7 +90,7 @@ public abstract class SsaInsn implements ToHuman, Cloneable { /** * Like {@link com.android.dx.rop.code.Insn getSources()}. - * + * * @return {@code non-null;} sources list */ abstract public RegisterSpecList getSources(); @@ -106,7 +106,7 @@ public abstract class SsaInsn implements ToHuman, Cloneable { /** * Returns whether or not the specified reg is the result reg. - * + * * @param reg register to test * @return true if there is a result and it is stored in the specified * register @@ -119,7 +119,7 @@ public abstract class SsaInsn implements ToHuman, Cloneable { /** * Changes the result register if this insn has a result. This is used * during renaming. - * + * * @param reg new result register */ public void changeResultReg(int reg) { @@ -154,7 +154,7 @@ public abstract class SsaInsn implements ToHuman, Cloneable { result = mapper.map(result); block.getParent().updateOneDefinition(this, oldResult); - mapSourceRegisters(mapper); + mapSourceRegisters(mapper); } /** @@ -176,7 +176,7 @@ public abstract class SsaInsn implements ToHuman, Cloneable { /** * Returns the original Rop insn for this insn, or null if this is * a phi insn. - * + * * TODO: Move this up into NormalSsaInsn. * * @return {@code null-ok;} Rop insn if there is one. @@ -189,8 +189,8 @@ public abstract class SsaInsn implements ToHuman, Cloneable { * may be the result register, or for {@code mark-local} insns * it may be the source. * - * @see com.android.dx.rop.code.Insn#getLocalAssignment() - * + * @see com.android.dx.rop.code.Insn#getLocalAssignment() + * * @return {@code null-ok;} a local-associated register spec or null */ public RegisterSpec getLocalAssignment() { @@ -204,7 +204,7 @@ public abstract class SsaInsn implements ToHuman, Cloneable { /** * Indicates whether the specified register is amongst the registers * used as sources for this instruction. - * + * * @param reg the register in question * @return true if the reg is a source */ @@ -230,7 +230,7 @@ public abstract class SsaInsn implements ToHuman, Cloneable { /** * Returns true if this insn is considered to have a side effect beyond * that of assigning to the result reg. - * + * * @return true if this insn is considered to have a side effect beyond * that of assigning to the result reg. */ @@ -259,7 +259,7 @@ public abstract class SsaInsn implements ToHuman, Cloneable { /** * Accepts a visitor. - * + * * @param v {@code non-null} the visitor */ public abstract void accept(Visitor v); diff --git a/dx/src/com/android/dx/ssa/back/IdenticalBlockCombiner.java b/dx/src/com/android/dx/ssa/back/IdenticalBlockCombiner.java index cfc70153e..515b04f0a 100644 --- a/dx/src/com/android/dx/ssa/back/IdenticalBlockCombiner.java +++ b/dx/src/com/android/dx/ssa/back/IdenticalBlockCombiner.java @@ -41,7 +41,7 @@ public class IdenticalBlockCombiner { /** * Constructs instance. Call {@code process()} to run. - * + * * @param rm {@code non-null;} instance to process */ public IdenticalBlockCombiner(RopMethod rm) { @@ -120,7 +120,7 @@ public class IdenticalBlockCombiner { /** * Helper method to compare the contents of two blocks. - * + * * @param a {@code non-null;} a block to compare * @param b {@code non-null;} another block to compare * @return {@code true} iff the two blocks' instructions are the same diff --git a/dx/src/com/android/dx/ssa/back/LivenessAnalyzer.java b/dx/src/com/android/dx/ssa/back/LivenessAnalyzer.java index cd3f7d2f6..a293e6f4a 100644 --- a/dx/src/com/android/dx/ssa/back/LivenessAnalyzer.java +++ b/dx/src/com/android/dx/ssa/back/LivenessAnalyzer.java @@ -98,7 +98,7 @@ public class LivenessAnalyzer { return interference; } - + /** * Makes liveness analyzer instance for specific register. * diff --git a/dx/src/com/android/dx/ssa/back/NullRegisterAllocator.java b/dx/src/com/android/dx/ssa/back/NullRegisterAllocator.java index f6dc961a3..0205c11f9 100644 --- a/dx/src/com/android/dx/ssa/back/NullRegisterAllocator.java +++ b/dx/src/com/android/dx/ssa/back/NullRegisterAllocator.java @@ -54,5 +54,5 @@ public class NullRegisterAllocator extends RegisterAllocator { } return mapper; - } + } } diff --git a/dx/src/com/android/dx/ssa/back/RegisterAllocator.java b/dx/src/com/android/dx/ssa/back/RegisterAllocator.java index e75eee186..1f9f70f7c 100644 --- a/dx/src/com/android/dx/ssa/back/RegisterAllocator.java +++ b/dx/src/com/android/dx/ssa/back/RegisterAllocator.java @@ -66,7 +66,7 @@ public abstract class RegisterAllocator { /** * Runs the algorithm. - * + * * @return a register mapper to apply to the {@code SsaMethod} */ public abstract RegisterMapper allocateRegisters(); @@ -105,7 +105,7 @@ public abstract class RegisterAllocator { /** * Returns true if the definition site of this register is a * move-param (ie, this is a method parameter). - * + * * @param reg register in question * @return {@code true} if this is a method parameter */ diff --git a/dx/src/com/android/dx/ssa/back/SsaToRop.java b/dx/src/com/android/dx/ssa/back/SsaToRop.java index 0ecbead54..13fc2716d 100644 --- a/dx/src/com/android/dx/ssa/back/SsaToRop.java +++ b/dx/src/com/android/dx/ssa/back/SsaToRop.java @@ -65,7 +65,7 @@ public class SsaToRop { /** * Converts a method in SSA form to ROP form. - * + * * @param ssaMeth {@code non-null;} method to process * @param minimizeRegisters {@code true} if the converter should * attempt to minimize the rop-form register count @@ -78,7 +78,7 @@ public class SsaToRop { /** * Constructs an instance. - * + * * @param ssaMeth {@code non-null;} method to process * @param minimizeRegisters {@code true} if the converter should * attempt to minimize the rop-form register count @@ -92,7 +92,7 @@ public class SsaToRop { /** * Performs the conversion. - * + * * @return {@code non-null;} rop-form output */ private RopMethod convert() { @@ -113,7 +113,7 @@ public class SsaToRop { if (DEBUG) { System.out.println("Printing reg map"); System.out.println(((BasicRegisterMapper)mapper).toHuman()); - } + } ssaMeth.setBackMode(); @@ -135,7 +135,7 @@ public class SsaToRop { } /** - * Removes all blocks containing only GOTOs from the control flow. + * Removes all blocks containing only GOTOs from the control flow. * Although much of this work will be done later when converting * from rop to dex, not all simplification cases can be handled * there. Furthermore, any no-op block between the exit block and @@ -171,7 +171,7 @@ public class SsaToRop { */ private void removePhiFunctions() { ArrayList<SsaBasicBlock> blocks = ssaMeth.getBlocks(); - + for (SsaBasicBlock block : blocks) { // Add moves in all the pred blocks for each phi insn. block.forEachPhiInsn(new PhiVisitor(blocks)); @@ -335,7 +335,7 @@ public class SsaToRop { /** * Converts an insn list to rop form. - * + * * @param ssaInsns {@code non-null;} old instructions * @return {@code non-null;} immutable instruction list */ @@ -354,7 +354,7 @@ public class SsaToRop { /** * <b>Note:</b> This method is not presently used. - * + * * @return a list of registers ordered by most-frequently-used to * least-frequently-used. Each register is listed once and only * once. @@ -381,5 +381,5 @@ public class SsaToRop { } return result; - } + } } diff --git a/dx/src/com/android/dx/util/AnnotatedOutput.java b/dx/src/com/android/dx/util/AnnotatedOutput.java index 9b69a36b4..7a9ea29d4 100644 --- a/dx/src/com/android/dx/util/AnnotatedOutput.java +++ b/dx/src/com/android/dx/util/AnnotatedOutput.java @@ -24,7 +24,7 @@ public interface AnnotatedOutput extends Output { /** * Get whether this instance will actually keep annotations. - * + * * @return {@code true} iff annotations are being kept */ public boolean annotates(); @@ -33,7 +33,7 @@ public interface AnnotatedOutput * Get whether this instance is intended to keep verbose annotations. * Annotators may use the result of calling this method to inform their * annotation activity. - * + * * @return {@code true} iff annotations are to be verbose */ public boolean isVerbose(); @@ -43,7 +43,7 @@ public interface AnnotatedOutput * open annotation will be closed by this call, and the new * annotation marks all subsequent output until another annotation * call. - * + * * @param msg {@code non-null;} the annotation message */ public void annotate(String msg); @@ -54,7 +54,7 @@ public interface AnnotatedOutput * call. If there is already pending annotation from one or more * previous calls to this method, the new call "consumes" output * after all the output covered by the previous calls. - * + * * @param amt {@code >= 0;} the amount of output for this annotation to * cover * @param msg {@code non-null;} the annotation message @@ -72,7 +72,7 @@ public interface AnnotatedOutput * Implementations of this interface are encouraged to deal with too-wide * output, but annotaters are encouraged to attempt to avoid exceeding * the indicated width. - * + * * @return {@code >= 1;} the maximum width */ public int getAnnotationWidth(); diff --git a/dx/src/com/android/dx/util/BitIntSet.java b/dx/src/com/android/dx/util/BitIntSet.java index db85571f4..b364f0c0f 100644 --- a/dx/src/com/android/dx/util/BitIntSet.java +++ b/dx/src/com/android/dx/util/BitIntSet.java @@ -64,7 +64,7 @@ public class BitIntSet implements IntSet { /** @inheritDoc */ public boolean has(int value) { - return (value < Bits.getMax(bits)) && Bits.get(bits, value); + return (value < Bits.getMax(bits)) && Bits.get(bits, value); } /** @inheritDoc */ @@ -93,7 +93,7 @@ public class BitIntSet implements IntSet { /** @inheritDoc */ public int elements() { - return Bits.bitCount(bits); + return Bits.bitCount(bits); } /** @inheritDoc */ diff --git a/dx/src/com/android/dx/util/Bits.java b/dx/src/com/android/dx/util/Bits.java index 1f45bd3fe..cbc0a5b6b 100644 --- a/dx/src/com/android/dx/util/Bits.java +++ b/dx/src/com/android/dx/util/Bits.java @@ -29,7 +29,7 @@ public final class Bits { /** * Constructs a bit set to contain bits up to the given index (exclusive). - * + * * @param max {@code >= 0;} the maximum bit index (exclusive) * @return {@code non-null;} an appropriately-constructed instance */ @@ -40,7 +40,7 @@ public final class Bits { /** * Gets the maximum index (exclusive) for the given bit set. - * + * * @param bits {@code non-null;} bit set in question * @return {@code >= 0;} the maximum index (exclusive) that may be set */ @@ -50,7 +50,7 @@ public final class Bits { /** * Gets the value of the bit at the given index. - * + * * @param bits {@code non-null;} bit set to operate on * @param idx {@code >= 0, < getMax(set);} which bit * @return the value of the indicated bit @@ -63,7 +63,7 @@ public final class Bits { /** * Sets the given bit to the given value. - * + * * @param bits {@code non-null;} bit set to operate on * @param idx {@code >= 0, < getMax(set);} which bit * @param value the new value for the bit @@ -81,7 +81,7 @@ public final class Bits { /** * Sets the given bit to {@code true}. - * + * * @param bits {@code non-null;} bit set to operate on * @param idx {@code >= 0, < getMax(set);} which bit */ @@ -93,7 +93,7 @@ public final class Bits { /** * Sets the given bit to {@code false}. - * + * * @param bits {@code non-null;} bit set to operate on * @param idx {@code >= 0, < getMax(set);} which bit */ @@ -106,7 +106,7 @@ public final class Bits { /** * Returns whether or not the given bit set is empty, that is, whether * no bit is set to {@code true}. - * + * * @param bits {@code non-null;} bit set to operate on * @return {@code true} iff all bits are {@code false} */ @@ -124,7 +124,7 @@ public final class Bits { /** * Gets the number of bits set to {@code true} in the given bit set. - * + * * @param bits {@code non-null;} bit set to operate on * @return {@code >= 0;} the bit count (aka population count) of the set */ @@ -142,7 +142,7 @@ public final class Bits { /** * Returns whether any bits are set to {@code true} in the * specified range. - * + * * @param bits {@code non-null;} bit set to operate on * @param start {@code >= 0;} index of the first bit in the range (inclusive) * @param end {@code >= 0;} index of the last bit in the range (exclusive) @@ -157,7 +157,7 @@ public final class Bits { /** * Finds the lowest-order bit set at or after the given index in the * given bit set. - * + * * @param bits {@code non-null;} bit set to operate on * @param idx {@code >= 0;} minimum index to return * @return {@code >= -1;} lowest-order bit set at or after {@code idx}, @@ -184,7 +184,7 @@ public final class Bits { /** * Finds the lowest-order bit set at or after the given index in the * given {@code int}. - * + * * @param value the value in question * @param idx 0..31 the minimum bit index to return * @return {@code >= -1;} lowest-order bit set at or after {@code idx}, diff --git a/dx/src/com/android/dx/util/ByteArray.java b/dx/src/com/android/dx/util/ByteArray.java index 79fa1956e..21d04573c 100644 --- a/dx/src/com/android/dx/util/ByteArray.java +++ b/dx/src/com/android/dx/util/ByteArray.java @@ -198,7 +198,7 @@ public final class ByteArray { * Copies the contents of this instance into the given raw * {@code byte[]} at the given offset. The given array must be * large enough. - * + * * @param out {@code non-null;} array to hold the output * @param offset {@code non-null;} index into {@code out} for the first * byte of output @@ -252,7 +252,7 @@ public final class ByteArray { * with the cursor starting at the beginning of this instance's data. * <b>Note:</b> The returned instance may be cast to {@link #GetCursor} * if needed. - * + * * @return {@code non-null;} an appropriately-constructed * {@code DataInputStream} instance */ @@ -265,7 +265,7 @@ public final class ByteArray { * with the cursor starting at the beginning of this instance's data. * <b>Note:</b> The returned instance may be cast to {@link #GetCursor} * if needed. - * + * * @return {@code non-null;} an appropriately-constructed * {@code InputStream} instancex */ @@ -279,12 +279,12 @@ public final class ByteArray { public interface GetCursor { /** * Gets the current cursor. - * + * * @return {@code 0..size();} the cursor */ public int getCursor(); } - + /** * Helper class for {@link #makeInputStream}, which implements the * stream functionality. @@ -295,7 +295,7 @@ public final class ByteArray { /** 0..size; the mark */ private int mark; - + public MyInputStream() { cursor = 0; mark = 0; @@ -315,7 +315,7 @@ public final class ByteArray { if ((offset + length) > arr.length) { length = arr.length - offset; } - + int maxLength = size - cursor; if (length > maxLength) { length = maxLength; @@ -351,7 +351,7 @@ public final class ByteArray { public static class MyDataInputStream extends DataInputStream { /** {@code non-null;} the underlying {@link #MyInputStream} */ private final MyInputStream wrapped; - + public MyDataInputStream(MyInputStream wrapped) { super(wrapped); diff --git a/dx/src/com/android/dx/util/ByteArrayAnnotatedOutput.java b/dx/src/com/android/dx/util/ByteArrayAnnotatedOutput.java index 5fcf5d8c3..6d0615e14 100644 --- a/dx/src/com/android/dx/util/ByteArrayAnnotatedOutput.java +++ b/dx/src/com/android/dx/util/ByteArrayAnnotatedOutput.java @@ -23,7 +23,7 @@ import java.util.ArrayList; /** * Implementation of {@link AnnotatedOutput} which stores the written data * into a {@code byte[]}. - * + * * <p><b>Note:</b> As per the {@link Output} interface, multi-byte * writes all use little-endian order.</p> */ @@ -31,7 +31,7 @@ public final class ByteArrayAnnotatedOutput implements AnnotatedOutput { /** default size for stretchy instances */ private static final int DEFAULT_SIZE = 1000; - + /** * whether the instance is stretchy, that is, whether its array * may be resized to increase capacity @@ -49,7 +49,7 @@ public final class ByteArrayAnnotatedOutput /** * {@code null-ok;} list of annotations, or {@code null} if this instance - * isn't keeping them + * isn't keeping them */ private ArrayList<Annotation> annotations; @@ -58,7 +58,7 @@ public final class ByteArrayAnnotatedOutput /** * {@code >= 8 (if used);} the number of bytes of hex output to use - * in annotations + * in annotations */ private int hexCols; @@ -68,7 +68,7 @@ public final class ByteArrayAnnotatedOutput * particular, no reallocation will occur in order to expand the * capacity of the resulting instance. Also, the constructed * instance does not keep annotations by default. - * + * * @param data {@code non-null;} data array to use for output */ public ByteArrayAnnotatedOutput(byte[] data) { @@ -86,7 +86,7 @@ public final class ByteArrayAnnotatedOutput /** * Internal constructor. - * + * * @param data {@code non-null;} data array to use for output * @param stretchy whether the instance is to be stretchy */ @@ -107,9 +107,9 @@ public final class ByteArrayAnnotatedOutput /** * Gets the underlying {@code byte[]} of this instance, which * may be larger than the number of bytes written - * + * * @see #toByteArray - * + * * @return {@code non-null;} the {@code byte[]} */ public byte[] getArray() { @@ -120,9 +120,9 @@ public final class ByteArrayAnnotatedOutput * Constructs and returns a new {@code byte[]} that contains * the written contents exactly (that is, with no extra unwritten * bytes at the end). - * + * * @see #getArray - * + * * @return {@code non-null;} an appropriately-constructed array */ public byte[] toByteArray() { @@ -258,7 +258,7 @@ public final class ByteArrayAnnotatedOutput return count; } - + /** {@inheritDoc} */ public void write(ByteArray bytes) { int blen = bytes.size(); @@ -285,7 +285,7 @@ public final class ByteArrayAnnotatedOutput // twos-complement math trick: ((x < 0) || (y < 0)) <=> ((x|y) < 0) if (((offset | length | end) < 0) || (bytesEnd > bytes.length)) { throw new IndexOutOfBoundsException("bytes.length " + - bytes.length + "; " + + bytes.length + "; " + offset + "..!" + end); } @@ -418,7 +418,7 @@ public final class ByteArrayAnnotatedOutput * Indicates that this instance should keep annotations. This method may * be called only once per instance, and only before any data has been * written to the it. - * + * * @param annotationWidth {@code >= 40;} the desired maximum annotation width * @param verbose whether or not to indicate verbose annotations */ @@ -473,7 +473,7 @@ public final class ByteArrayAnnotatedOutput /** * Writes the annotated content of this instance to the given writer. - * + * * @param out {@code non-null;} where to write to */ public void writeAnnotationsTo(Writer out) throws IOException { @@ -537,7 +537,7 @@ public final class ByteArrayAnnotatedOutput /** * Reallocates the underlying array if necessary. Calls to this method * should be guarded by a test of {@link #stretchy}. - * + * * @param desiredSize {@code >= 0;} the desired minimum total size of the array */ private void ensureCapacity(int desiredSize) { @@ -557,7 +557,7 @@ public final class ByteArrayAnnotatedOutput /** * {@code >= 0;} end of annotated range (exclusive); - * {@code Integer.MAX_VALUE} if unclosed + * {@code Integer.MAX_VALUE} if unclosed */ private int end; @@ -566,7 +566,7 @@ public final class ByteArrayAnnotatedOutput /** * Constructs an instance. - * + * * @param start {@code >= 0;} start of annotated range * @param end {@code >= start;} end of annotated range (exclusive) or * {@code Integer.MAX_VALUE} if unclosed @@ -580,7 +580,7 @@ public final class ByteArrayAnnotatedOutput /** * Constructs an instance. It is initally unclosed. - * + * * @param start {@code >= 0;} start of annotated range * @param text {@code non-null;} annotation text */ @@ -591,7 +591,7 @@ public final class ByteArrayAnnotatedOutput /** * Sets the end as given, but only if the instance is unclosed; * otherwise, do nothing. - * + * * @param end {@code >= start;} the end */ public void setEndIfUnset(int end) { @@ -602,7 +602,7 @@ public final class ByteArrayAnnotatedOutput /** * Sets the end as given. - * + * * @param end {@code >= start;} the end */ public void setEnd(int end) { @@ -611,7 +611,7 @@ public final class ByteArrayAnnotatedOutput /** * Gets the start. - * + * * @return the start */ public int getStart() { @@ -620,7 +620,7 @@ public final class ByteArrayAnnotatedOutput /** * Gets the end. - * + * * @return the end */ public int getEnd() { @@ -629,7 +629,7 @@ public final class ByteArrayAnnotatedOutput /** * Gets the text. - * + * * @return {@code non-null;} the text */ public String getText() { diff --git a/dx/src/com/android/dx/util/FileUtils.java b/dx/src/com/android/dx/util/FileUtils.java index 3f51207e0..098c5ab4b 100644 --- a/dx/src/com/android/dx/util/FileUtils.java +++ b/dx/src/com/android/dx/util/FileUtils.java @@ -34,7 +34,7 @@ public final class FileUtils { /** * Reads the named file, translating {@link IOException} to a * {@link RuntimeException} of some sort. - * + * * @param fileName {@code non-null;} name of the file to read * @return {@code non-null;} contents of the file */ @@ -46,7 +46,7 @@ public final class FileUtils { /** * Reads the given file, translating {@link IOException} to a * {@link RuntimeException} of some sort. - * + * * @param file {@code non-null;} the file to read * @return {@code non-null;} contents of the file */ diff --git a/dx/src/com/android/dx/util/FixedSizeList.java b/dx/src/com/android/dx/util/FixedSizeList.java index 17d773c05..fb3af0450 100644 --- a/dx/src/com/android/dx/util/FixedSizeList.java +++ b/dx/src/com/android/dx/util/FixedSizeList.java @@ -28,7 +28,7 @@ public class FixedSizeList /** * Constructs an instance. All indices initially contain {@code null}. - * + * * @param size the size of the list */ public FixedSizeList(int size) { @@ -78,7 +78,7 @@ public class FixedSizeList /** * {@inheritDoc} - * + * * This method will only work if every element of the list * implements {@link ToHuman}. */ @@ -93,7 +93,7 @@ public class FixedSizeList /** * Gets a customized string form for this instance. - * + * * @param prefix {@code null-ok;} prefix for the start of the result * @param separator {@code null-ok;} separator to insert between each item * @param suffix {@code null-ok;} suffix for the end of the result @@ -107,7 +107,7 @@ public class FixedSizeList * Gets a customized human string for this instance. This method will * only work if every element of the list implements {@link * ToHuman}. - * + * * @param prefix {@code null-ok;} prefix for the start of the result * @param separator {@code null-ok;} separator to insert between each item * @param suffix {@code null-ok;} suffix for the end of the result @@ -168,7 +168,7 @@ public class FixedSizeList * will throw {@code NullPointerException}. This method is * protected so that subclasses may offer a safe type-checked * public interface to their clients. - * + * * @param n {@code >= 0, < size();} which element * @return {@code non-null;} the indicated element */ @@ -192,7 +192,7 @@ public class FixedSizeList * returned. This method is protected so that subclasses may * (optionally) offer a safe type-checked public interface to * their clients. - * + * * @param n {@code >= 0, < size();} which element * @return {@code null-ok;} the indicated element */ @@ -205,7 +205,7 @@ public class FixedSizeList * checks on the element. This method is protected so that * subclasses may offer a safe type-checked public interface to * their clients. - * + * * @param n {@code >= 0, < size();} which element * @param obj {@code null-ok;} the value to store */ @@ -222,7 +222,7 @@ public class FixedSizeList /** * Throws the appropriate exception for the given index value. - * + * * @param n the index value * @return never * @throws IndexOutOfBoundsException always thrown @@ -238,11 +238,11 @@ public class FixedSizeList /** * Helper for {@link #toString} and {@link #toHuman}, which both of * those call to pretty much do everything. - * + * * @param prefix {@code null-ok;} prefix for the start of the result * @param separator {@code null-ok;} separator to insert between each item * @param suffix {@code null-ok;} suffix for the end of the result - * @param human whether the output is to be human + * @param human whether the output is to be human * @return {@code non-null;} the custom string */ private String toString0(String prefix, String separator, String suffix, diff --git a/dx/src/com/android/dx/util/Hex.java b/dx/src/com/android/dx/util/Hex.java index cb71e5e20..e95669c91 100644 --- a/dx/src/com/android/dx/util/Hex.java +++ b/dx/src/com/android/dx/util/Hex.java @@ -29,7 +29,7 @@ public final class Hex { /** * Formats a {@code long} as an 8-byte unsigned hex value. - * + * * @param v value to format * @return {@code non-null;} formatted form */ @@ -45,7 +45,7 @@ public final class Hex { /** * Formats an {@code int} as a 4-byte unsigned hex value. - * + * * @param v value to format * @return {@code non-null;} formatted form */ @@ -61,7 +61,7 @@ public final class Hex { /** * Formats an {@code int} as a 3-byte unsigned hex value. - * + * * @param v value to format * @return {@code non-null;} formatted form */ @@ -77,7 +77,7 @@ public final class Hex { /** * Formats an {@code int} as a 2-byte unsigned hex value. - * + * * @param v value to format * @return {@code non-null;} formatted form */ @@ -95,7 +95,7 @@ public final class Hex { * Formats an {@code int} as either a 2-byte unsigned hex value * (if the value is small enough) or a 4-byte unsigned hex value (if * not). - * + * * @param v value to format * @return {@code non-null;} formatted form */ @@ -109,7 +109,7 @@ public final class Hex { /** * Formats an {@code int} as a 1-byte unsigned hex value. - * + * * @param v value to format * @return {@code non-null;} formatted form */ @@ -125,7 +125,7 @@ public final class Hex { /** * Formats an {@code int} as a 4-bit unsigned hex nibble. - * + * * @param v value to format * @return {@code non-null;} formatted form */ @@ -138,7 +138,7 @@ public final class Hex { /** * Formats a {@code long} as an 8-byte signed hex value. - * + * * @param v value to format * @return {@code non-null;} formatted form */ @@ -162,7 +162,7 @@ public final class Hex { /** * Formats an {@code int} as a 4-byte signed hex value. - * + * * @param v value to format * @return {@code non-null;} formatted form */ @@ -186,7 +186,7 @@ public final class Hex { /** * Formats an {@code int} as a 2-byte signed hex value. - * + * * @param v value to format * @return {@code non-null;} formatted form */ @@ -210,7 +210,7 @@ public final class Hex { /** * Formats an {@code int} as a 1-byte signed hex value. - * + * * @param v value to format * @return {@code non-null;} formatted form */ @@ -236,7 +236,7 @@ public final class Hex { * Formats a hex dump of a portion of a {@code byte[]}. The result * is always newline-terminated, unless the passed-in length was zero, * in which case the result is always the empty string ({@code ""}). - * + * * @param arr {@code non-null;} array to format * @param offset {@code >= 0;} offset to the part to dump * @param length {@code >= 0;} number of bytes to dump @@ -253,7 +253,7 @@ public final class Hex { // twos-complement math trick: ((x < 0) || (y < 0)) <=> ((x|y) < 0) if (((offset | length | end) < 0) || (end > arr.length)) { throw new IndexOutOfBoundsException("arr.length " + - arr.length + "; " + + arr.length + "; " + offset + "..!" + end); } @@ -298,6 +298,6 @@ public final class Hex { sb.append('\n'); } - return sb.toString(); + return sb.toString(); } } diff --git a/dx/src/com/android/dx/util/HexParser.java b/dx/src/com/android/dx/util/HexParser.java index 3d0c99235..1b343453d 100644 --- a/dx/src/com/android/dx/util/HexParser.java +++ b/dx/src/com/android/dx/util/HexParser.java @@ -37,7 +37,7 @@ public final class HexParser { * comment. If a double quote is encountered, then the ASCII value * of the subsequent characters is used, until the next double * quote. Quoted strings may not span multiple lines. - * + * * @param src {@code non-null;} the source string * @return {@code non-null;} the parsed form */ diff --git a/dx/src/com/android/dx/util/IndentingWriter.java b/dx/src/com/android/dx/util/IndentingWriter.java index 92f0b5566..3424e37aa 100644 --- a/dx/src/com/android/dx/util/IndentingWriter.java +++ b/dx/src/com/android/dx/util/IndentingWriter.java @@ -47,7 +47,7 @@ public final class IndentingWriter extends FilterWriter { /** * Constructs an instance. - * + * * @param out {@code non-null;} writer to send final output to * @param width {@code >= 0;} the maximum output width (not including * {@code prefix}), or {@code 0} for no maximum @@ -77,7 +77,7 @@ public final class IndentingWriter extends FilterWriter { /** * Constructs a no-prefix instance. - * + * * @param out {@code non-null;} writer to send final output to * @param width {@code >= 0;} the maximum output width (not including * {@code prefix}), or {@code 0} for no maximum diff --git a/dx/src/com/android/dx/util/IntList.java b/dx/src/com/android/dx/util/IntList.java index c51c0282c..089fead26 100644 --- a/dx/src/com/android/dx/util/IntList.java +++ b/dx/src/com/android/dx/util/IntList.java @@ -40,7 +40,7 @@ public final class IntList extends MutabilityControl { /** * Constructs a new immutable instance with the given element. - * + * * @param value the sole value in the list */ public static IntList makeImmutable(int value) { @@ -54,7 +54,7 @@ public final class IntList extends MutabilityControl { /** * Constructs a new immutable instance with the given elements. - * + * * @param value0 the first value in the list * @param value1 the second value in the list */ @@ -77,7 +77,7 @@ public final class IntList extends MutabilityControl { /** * Constructs an empty instance. - * + * * @param initialCapacity {@code >= 0;} initial capacity of the list */ public IntList(int initialCapacity) { @@ -164,7 +164,7 @@ public final class IntList extends MutabilityControl { /** * Gets the indicated value. - * + * * @param n {@code >= 0, < size();} which element * @return the indicated element's value */ @@ -183,7 +183,7 @@ public final class IntList extends MutabilityControl { /** * Sets the value at the given index. - * + * * @param n {@code >= 0, < size();} which element * @param value value to store */ @@ -208,7 +208,7 @@ public final class IntList extends MutabilityControl { /** * Adds an element to the end of the list. This will increase the * list's capacity if necessary. - * + * * @param value the value to add */ public void add(int value) { @@ -301,7 +301,7 @@ public final class IntList extends MutabilityControl { result = get(size-1); size--; - return result; + return result; } /** @@ -318,7 +318,7 @@ public final class IntList extends MutabilityControl { /** * Shrinks the size of the list. - * + * * @param newSize {@code >= 0;} the new size */ public void shrink(int newSize) { @@ -337,7 +337,7 @@ public final class IntList extends MutabilityControl { /** * Makes and returns a mutable copy of the list. - * + * * @return {@code non-null;} an appropriately-constructed instance */ public IntList mutableCopy() { @@ -440,9 +440,9 @@ public final class IntList extends MutabilityControl { * Returns whether or not the given value appears in the list. * This will do a binary search if the list is sorted or a linear * search if not. - * + * * @see #sort - * + * * @param value value to look for * @return whether the list contains the given value */ diff --git a/dx/src/com/android/dx/util/LabeledList.java b/dx/src/com/android/dx/util/LabeledList.java index 28a148bd1..5b6e1251b 100644 --- a/dx/src/com/android/dx/util/LabeledList.java +++ b/dx/src/com/android/dx/util/LabeledList.java @@ -156,6 +156,6 @@ public class LabeledList extends FixedSizeList { if (item != null) { addLabelIndex(item.getLabel(), n); - } + } } } diff --git a/dx/src/com/android/dx/util/Leb128Utils.java b/dx/src/com/android/dx/util/Leb128Utils.java index 6ed3a6181..5d450ea09 100644 --- a/dx/src/com/android/dx/util/Leb128Utils.java +++ b/dx/src/com/android/dx/util/Leb128Utils.java @@ -30,13 +30,13 @@ public final class Leb128Utils { /** * Gets the number of bytes in the unsigned LEB128 encoding of the * given value. - * + * * @param value the value in question * @return its write size, in bytes */ public static int unsignedLeb128Size(int value) { // TODO: This could be much cleverer. - + int remaining = value >> 7; int count = 0; @@ -51,7 +51,7 @@ public final class Leb128Utils { /** * Gets the number of bytes in the signed LEB128 encoding of the * given value. - * + * * @param value the value in question * @return its write size, in bytes */ diff --git a/dx/src/com/android/dx/util/ListIntSet.java b/dx/src/com/android/dx/util/ListIntSet.java index 6d28a18e4..2b4fc218c 100644 --- a/dx/src/com/android/dx/util/ListIntSet.java +++ b/dx/src/com/android/dx/util/ListIntSet.java @@ -54,7 +54,7 @@ public class ListIntSet implements IntSet { /** @inheritDoc */ public boolean has(int value) { - return ints.indexOf(value) >= 0; + return ints.indexOf(value) >= 0; } /** @inheritDoc */ @@ -70,7 +70,7 @@ public class ListIntSet implements IntSet { while (j < szOther && i < szThis) { while (j < szOther && o.ints.get(j) < ints.get(i)) { add(o.ints.get(j++)); - } + } if (j == szOther) { break; } diff --git a/dx/src/com/android/dx/util/Output.java b/dx/src/com/android/dx/util/Output.java index 5e737ae53..402fa83ba 100644 --- a/dx/src/com/android/dx/util/Output.java +++ b/dx/src/com/android/dx/util/Output.java @@ -17,7 +17,7 @@ package com.android.dx.util; /** - * Interface for a sink for binary output. This is similar to + * Interface for a sink for binary output. This is similar to * {@code java.util.DataOutput}, but no {@code IOExceptions} * are declared, and multibyte output is defined to be little-endian. */ @@ -25,44 +25,44 @@ public interface Output { /** * Gets the current cursor position. This is the same as the number of * bytes written to this instance. - * + * * @return {@code >= 0;} the cursor position */ public int getCursor(); /** * Asserts that the cursor is the given value. - * + * * @param expectedCursor the expected cursor value * @throws RuntimeException thrown if {@code getCursor() != * expectedCursor} */ public void assertCursor(int expectedCursor); - + /** * Writes a {@code byte} to this instance. - * + * * @param value the value to write; all but the low 8 bits are ignored */ public void writeByte(int value); /** * Writes a {@code short} to this instance. - * + * * @param value the value to write; all but the low 16 bits are ignored */ public void writeShort(int value); /** * Writes an {@code int} to this instance. - * + * * @param value the value to write */ public void writeInt(int value); /** * Writes a {@code long} to this instance. - * + * * @param value the value to write */ public void writeLong(long value); @@ -89,14 +89,14 @@ public interface Output { /** * Writes a {@link ByteArray} to this instance. - * + * * @param bytes {@code non-null;} the array to write */ public void write(ByteArray bytes); /** * Writes a portion of a {@code byte[]} to this instance. - * + * * @param bytes {@code non-null;} the array to write * @param offset {@code >= 0;} offset into {@code bytes} for the first * byte to write @@ -107,22 +107,22 @@ public interface Output { /** * Writes a {@code byte[]} to this instance. This is just * a convenient shorthand for {@code write(bytes, 0, bytes.length)}. - * + * * @param bytes {@code non-null;} the array to write */ public void write(byte[] bytes); - /** + /** * Writes the given number of {@code 0} bytes. - * + * * @param count {@code >= 0;} the number of zeroes to write */ public void writeZeroes(int count); - /** + /** * Adds extra bytes if necessary (with value {@code 0}) to * force alignment of the output cursor as given. - * + * * @param alignment {@code > 0;} the alignment; must be a power of two */ public void alignTo(int alignment); diff --git a/dx/src/com/android/dx/util/TwoColumnOutput.java b/dx/src/com/android/dx/util/TwoColumnOutput.java index a155c152f..ed2ab9f47 100644 --- a/dx/src/com/android/dx/util/TwoColumnOutput.java +++ b/dx/src/com/android/dx/util/TwoColumnOutput.java @@ -49,7 +49,7 @@ public final class TwoColumnOutput { /** * Turns the given two strings (with widths) and spacer into a formatted * two-column string. - * + * * @param s1 {@code non-null;} first string * @param width1 {@code > 0;} width of the first column * @param spacer {@code non-null;} spacer string @@ -79,7 +79,7 @@ public final class TwoColumnOutput { /** * Constructs an instance. - * + * * @param out {@code non-null;} writer to send final output to * @param leftWidth {@code > 0;} width of the left column, in characters * @param rightWidth {@code > 0;} width of the right column, in characters @@ -117,7 +117,7 @@ public final class TwoColumnOutput { /** * Constructs an instance. - * + * * @param out {@code non-null;} stream to send final output to * @param leftWidth {@code >= 1;} width of the left column, in characters * @param rightWidth {@code >= 1;} width of the right column, in characters @@ -130,7 +130,7 @@ public final class TwoColumnOutput { /** * Gets the writer to use to write to the left column. - * + * * @return {@code non-null;} the left column writer */ public Writer getLeft() { @@ -139,7 +139,7 @@ public final class TwoColumnOutput { /** * Gets the writer to use to write to the right column. - * + * * @return {@code non-null;} the right column writer */ public Writer getRight() { @@ -225,12 +225,12 @@ public final class TwoColumnOutput { /** * Appends a newline to the given buffer via the given writer, but * only if it isn't empty and doesn't already end with one. - * + * * @param buf {@code non-null;} the buffer in question * @param out {@code non-null;} the writer to use */ private static void appendNewlineIfNecessary(StringBuffer buf, - Writer out) + Writer out) throws IOException { int len = buf.length(); @@ -241,7 +241,7 @@ public final class TwoColumnOutput { /** * Writes the given number of spaces to the given writer. - * + * * @param out {@code non-null;} where to write * @param amt {@code >= 0;} the number of spaces to write */ diff --git a/dx/src/com/android/dx/util/Writers.java b/dx/src/com/android/dx/util/Writers.java index 632b0821e..eba845cc4 100644 --- a/dx/src/com/android/dx/util/Writers.java +++ b/dx/src/com/android/dx/util/Writers.java @@ -34,7 +34,7 @@ public final class Writers { * Makes a {@code PrintWriter} for the given {@code Writer}, * returning the given writer if it already happens to be the right * class. - * + * * @param writer {@code non-null;} writer to (possibly) wrap * @return {@code non-null;} an appropriate instance */ diff --git a/dx/src/com/android/dx/util/_tests/_ListIntSet.java b/dx/src/com/android/dx/util/_tests/_ListIntSet.java index aed79b0c1..ccd599178 100644 --- a/dx/src/com/android/dx/util/_tests/_ListIntSet.java +++ b/dx/src/com/android/dx/util/_tests/_ListIntSet.java @@ -39,7 +39,7 @@ public class _ListIntSet extends TestCase { assertTrue(set.has(31)); assertEquals(3, set.elements()); - + assertFalse(set.has(2)); assertFalse(set.has(7)); assertFalse(set.has(30)); @@ -79,7 +79,7 @@ public class _ListIntSet extends TestCase { IntIterator iter = set.iterator(); - assertFalse(iter.hasNext()); + assertFalse(iter.hasNext()); } public void test_remove() { diff --git a/dx/tests/042-dex-ignore-result/Blort.java b/dx/tests/042-dex-ignore-result/Blort.java index 21370ed9f..2df4e6671 100644 --- a/dx/tests/042-dex-ignore-result/Blort.java +++ b/dx/tests/042-dex-ignore-result/Blort.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Blort +public class Blort { static public int hello() { return 10; diff --git a/dx/tests/043-dex-two-classes/Blort.java b/dx/tests/043-dex-two-classes/Blort.java index 1d9de841c..235907d61 100644 --- a/dx/tests/043-dex-two-classes/Blort.java +++ b/dx/tests/043-dex-two-classes/Blort.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Blort +public class Blort { // This space intentionally left blank. } diff --git a/dx/tests/044-dex-math-ops/Blort.java b/dx/tests/044-dex-math-ops/Blort.java index bf73c336f..75095b58b 100644 --- a/dx/tests/044-dex-math-ops/Blort.java +++ b/dx/tests/044-dex-math-ops/Blort.java @@ -14,13 +14,13 @@ * limitations under the License. */ -public class Blort +public class Blort { private volatile int i; private volatile long l; private volatile float f; private volatile double d; - + public void blort(int i1, int i2) { i = -i1; i = ~i1; @@ -69,5 +69,5 @@ public class Blort d = d1 * d2; d = d1 / d2; d = d1 % d2; - } + } } diff --git a/dx/tests/045-dex-switch-ops/Blort.java b/dx/tests/045-dex-switch-ops/Blort.java index fed741f9f..598bd692e 100644 --- a/dx/tests/045-dex-switch-ops/Blort.java +++ b/dx/tests/045-dex-switch-ops/Blort.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Blort +public class Blort { public int switchTest1(int x) { switch (x) { diff --git a/dx/tests/046-dex-exceptions/Blort.java b/dx/tests/046-dex-exceptions/Blort.java index 8d040c40b..a0b6c0bf6 100644 --- a/dx/tests/046-dex-exceptions/Blort.java +++ b/dx/tests/046-dex-exceptions/Blort.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Blort +public class Blort { public static int maybeThrow(int x) { if (x < 10) { @@ -23,7 +23,7 @@ public class Blort return x; } - + public static int exTest1(int x) { try { maybeThrow(x); diff --git a/dx/tests/047-dex-wide-args/Blort.java b/dx/tests/047-dex-wide-args/Blort.java index e7fc9b57c..fa0f1d88a 100644 --- a/dx/tests/047-dex-wide-args/Blort.java +++ b/dx/tests/047-dex-wide-args/Blort.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Blort +public class Blort { public static long test1(int w, long x, int y, long z) { return w + x + y + z; diff --git a/dx/tests/048-dex-new-array/Blort.java b/dx/tests/048-dex-new-array/Blort.java index 312370c1b..1af0cde99 100644 --- a/dx/tests/048-dex-new-array/Blort.java +++ b/dx/tests/048-dex-new-array/Blort.java @@ -14,12 +14,12 @@ * limitations under the License. */ -public class Blort +public class Blort { public static void sink(Object x) { // Do nothing. } - + public static void test() { sink(new boolean[0]); sink(new byte[1]); diff --git a/dx/tests/049-dex-instanceof/Blort.java b/dx/tests/049-dex-instanceof/Blort.java index 2d46cd173..ad41f30ed 100644 --- a/dx/tests/049-dex-instanceof/Blort.java +++ b/dx/tests/049-dex-instanceof/Blort.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Blort +public class Blort { public static boolean test(Object x) { return x instanceof Blort; diff --git a/dx/tests/050-dex-checkcast/Blort.java b/dx/tests/050-dex-checkcast/Blort.java index 893c3a31d..5441eec72 100644 --- a/dx/tests/050-dex-checkcast/Blort.java +++ b/dx/tests/050-dex-checkcast/Blort.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Blort +public class Blort { public static Blort test(Object x) { return (Blort) x; diff --git a/dx/tests/051-dex-explicit-null/Blort.java b/dx/tests/051-dex-explicit-null/Blort.java index f3bb333ec..9045c50da 100644 --- a/dx/tests/051-dex-explicit-null/Blort.java +++ b/dx/tests/051-dex-explicit-null/Blort.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Blort +public class Blort { public static Object test1() { return null; diff --git a/dx/tests/052-dex-static-var-access/Blort.java b/dx/tests/052-dex-static-var-access/Blort.java index fdbefb4fb..3dd0e7871 100644 --- a/dx/tests/052-dex-static-var-access/Blort.java +++ b/dx/tests/052-dex-static-var-access/Blort.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Blort +public class Blort { public static boolean staticBoolean; public static byte staticByte; diff --git a/dx/tests/053-dex-instance-var-access/Blort.java b/dx/tests/053-dex-instance-var-access/Blort.java index 1f6873743..eb62d6284 100644 --- a/dx/tests/053-dex-instance-var-access/Blort.java +++ b/dx/tests/053-dex-instance-var-access/Blort.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Blort +public class Blort { public boolean insBoolean; public byte insByte; diff --git a/dx/tests/054-dex-high16/Blort.java b/dx/tests/054-dex-high16/Blort.java index e8976fa9d..9fba97232 100644 --- a/dx/tests/054-dex-high16/Blort.java +++ b/dx/tests/054-dex-high16/Blort.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Blort +public class Blort { public static void sink(int i) { // Do nothing. diff --git a/dx/tests/055-dex-explicit-throw/Blort.java b/dx/tests/055-dex-explicit-throw/Blort.java index a47ba902d..e6720d96b 100644 --- a/dx/tests/055-dex-explicit-throw/Blort.java +++ b/dx/tests/055-dex-explicit-throw/Blort.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Blort +public class Blort { private static RuntimeException theException = new RuntimeException(); diff --git a/dx/tests/056-dex-call-interface/Blort.java b/dx/tests/056-dex-call-interface/Blort.java index 75775e618..4175f05d7 100644 --- a/dx/tests/056-dex-call-interface/Blort.java +++ b/dx/tests/056-dex-call-interface/Blort.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Blort +public class Blort { public static int test(Zorch z, double d) { z.zorch1(); diff --git a/dx/tests/057-dex-call-virtual/Blort.java b/dx/tests/057-dex-call-virtual/Blort.java index e32135b25..75ee7d8ca 100644 --- a/dx/tests/057-dex-call-virtual/Blort.java +++ b/dx/tests/057-dex-call-virtual/Blort.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Blort +public class Blort { public static int test(Zorch z) { z.zorch1(); diff --git a/dx/tests/057-dex-call-virtual/Zorch.java b/dx/tests/057-dex-call-virtual/Zorch.java index 718601fc7..867eaedb8 100644 --- a/dx/tests/057-dex-call-virtual/Zorch.java +++ b/dx/tests/057-dex-call-virtual/Zorch.java @@ -16,7 +16,7 @@ public class Zorch { - public void zorch1() { + public void zorch1() { // This space intentionally left blank. } diff --git a/dx/tests/058-dex-call-direct/Blort.java b/dx/tests/058-dex-call-direct/Blort.java index 77e224c85..6d7fa7f20 100644 --- a/dx/tests/058-dex-call-direct/Blort.java +++ b/dx/tests/058-dex-call-direct/Blort.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Blort +public class Blort { public static int test(Blort b) { b.zorch1(); diff --git a/dx/tests/059-dex-call-super/Blort.java b/dx/tests/059-dex-call-super/Blort.java index 599440bc8..efb451e4e 100644 --- a/dx/tests/059-dex-call-super/Blort.java +++ b/dx/tests/059-dex-call-super/Blort.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Blort +public class Blort extends Zorch { public int test1() { diff --git a/dx/tests/059-dex-call-super/Zorch.java b/dx/tests/059-dex-call-super/Zorch.java index 2f8951a04..aa668abd9 100644 --- a/dx/tests/059-dex-call-super/Zorch.java +++ b/dx/tests/059-dex-call-super/Zorch.java @@ -16,7 +16,7 @@ public class Zorch { - public void zorch1() { + public void zorch1() { // This space intentionally left blank. } diff --git a/dx/tests/060-dex-call-static/Blort.java b/dx/tests/060-dex-call-static/Blort.java index 2b9bb48c6..8ad2e275d 100644 --- a/dx/tests/060-dex-call-static/Blort.java +++ b/dx/tests/060-dex-call-static/Blort.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Blort +public class Blort { public static int test() { Zorch.zorch1(); diff --git a/dx/tests/061-dex-try-catch/Blort.java b/dx/tests/061-dex-try-catch/Blort.java index b63a41ea7..903f40ef4 100644 --- a/dx/tests/061-dex-try-catch/Blort.java +++ b/dx/tests/061-dex-try-catch/Blort.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Blort +public class Blort { public static void caught() { // This space intentionally left blank. diff --git a/dx/tests/062-dex-synch-method/Blort.java b/dx/tests/062-dex-synch-method/Blort.java index 823c2cadd..4aca417bb 100644 --- a/dx/tests/062-dex-synch-method/Blort.java +++ b/dx/tests/062-dex-synch-method/Blort.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Blort +public class Blort { public synchronized void testInstance1() { // This space intentionally left blank. diff --git a/dx/tests/063-dex-empty-switch/Blort.java b/dx/tests/063-dex-empty-switch/Blort.java index 2d996f3d4..f53899569 100644 --- a/dx/tests/063-dex-empty-switch/Blort.java +++ b/dx/tests/063-dex-empty-switch/Blort.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Blort +public class Blort { public int test1(int x) { switch (x) { diff --git a/dx/tests/064-dex-array-access/Blort.java b/dx/tests/064-dex-array-access/Blort.java index 3f1d1d876..fa03ec04d 100644 --- a/dx/tests/064-dex-array-access/Blort.java +++ b/dx/tests/064-dex-array-access/Blort.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Blort +public class Blort { public boolean test01(boolean[] x) { x[0] = true; diff --git a/dx/tests/065-dex-new-array/Blort.java b/dx/tests/065-dex-new-array/Blort.java index 93af87f63..7a7eaa402 100644 --- a/dx/tests/065-dex-new-array/Blort.java +++ b/dx/tests/065-dex-new-array/Blort.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Blort +public class Blort { public boolean[] test1() { return new boolean[1]; diff --git a/dx/tests/066-dex-try-catch-rethrow/Blort.java b/dx/tests/066-dex-try-catch-rethrow/Blort.java index cefc0fddc..cdb00ea5e 100644 --- a/dx/tests/066-dex-try-catch-rethrow/Blort.java +++ b/dx/tests/066-dex-try-catch-rethrow/Blort.java @@ -14,12 +14,12 @@ * limitations under the License. */ -public class Blort +public class Blort { public static Object zorch1(String s) { return null; } - + public static void test1() { try { zorch1("x"); @@ -43,7 +43,7 @@ public class Blort public static int zorch3(String s) { return 0; } - + public static void test3() { try { zorch3("x"); @@ -55,7 +55,7 @@ public class Blort public static Object zorch4(int x) { return null; } - + public static void test4() { try { zorch4(1); @@ -67,7 +67,7 @@ public class Blort public static Object zorch5(int x) { return null; } - + public static Object test5() { try { return zorch5(1); diff --git a/dx/tests/067-dex-switch-and-try/Blort.java b/dx/tests/067-dex-switch-and-try/Blort.java index d90bd321e..e6435e1e3 100644 --- a/dx/tests/067-dex-switch-and-try/Blort.java +++ b/dx/tests/067-dex-switch-and-try/Blort.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Blort +public class Blort { static public void blort() { // This space intentionally left blank. diff --git a/dx/tests/068-dex-infinite-loop/Blort.java b/dx/tests/068-dex-infinite-loop/Blort.java index 09c45a4e3..f02640799 100644 --- a/dx/tests/068-dex-infinite-loop/Blort.java +++ b/dx/tests/068-dex-infinite-loop/Blort.java @@ -14,12 +14,12 @@ * limitations under the License. */ -public class Blort +public class Blort { public static boolean zorch() { return true; } - + public static void test1() { for (;;) { // This space intentionally left blank. @@ -43,7 +43,7 @@ public class Blort if (zorch()) { break; } - + while (zorch()) { zorch(); } diff --git a/dx/tests/069-dex-source-position/Blort.java b/dx/tests/069-dex-source-position/Blort.java index 5cede03dc..8c0c5c0af 100644 --- a/dx/tests/069-dex-source-position/Blort.java +++ b/dx/tests/069-dex-source-position/Blort.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Blort +public class Blort { public static int test(int x) { if (x == 0) { // line 6 diff --git a/dx/tests/070-dex-multianewarray/Blort.java b/dx/tests/070-dex-multianewarray/Blort.java index 500b14c3a..ef812cf3a 100644 --- a/dx/tests/070-dex-multianewarray/Blort.java +++ b/dx/tests/070-dex-multianewarray/Blort.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Blort +public class Blort { public static Object test01() { Object[][] x = new Object[2][5]; diff --git a/dx/tests/072-dex-switch-edge-cases/Blort.java b/dx/tests/072-dex-switch-edge-cases/Blort.java index ba2e033eb..2d4d10758 100644 --- a/dx/tests/072-dex-switch-edge-cases/Blort.java +++ b/dx/tests/072-dex-switch-edge-cases/Blort.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Blort +public class Blort { // Empty switch statement. (Note: This is the same as a default-only // switch statement, since under the covers every switch statement @@ -44,7 +44,7 @@ public class Blort return 1; } - + // Single element: Integer.MAX_VALUE. public int test4(int x) { switch (x) { diff --git a/dx/tests/073-dex-null-array-refs/Blort.java b/dx/tests/073-dex-null-array-refs/Blort.java index b6678c0b2..e16e0f47d 100644 --- a/dx/tests/073-dex-null-array-refs/Blort.java +++ b/dx/tests/073-dex-null-array-refs/Blort.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Blort +public class Blort { public static Object test1() { return ((Object[]) null)[0]; @@ -50,7 +50,7 @@ public class Blort return arr[0]; } - + public static void test8(Object[] arr) { if (check()) { arr = null; diff --git a/dx/tests/074-dex-form35c-edge-case/Blort.java b/dx/tests/074-dex-form35c-edge-case/Blort.java index 60efc6361..979263f0e 100644 --- a/dx/tests/074-dex-form35c-edge-case/Blort.java +++ b/dx/tests/074-dex-form35c-edge-case/Blort.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Blort +public class Blort { public void test() { diff --git a/dx/tests/075-dex-cat2-value-merge/Blort.java b/dx/tests/075-dex-cat2-value-merge/Blort.java index d1bf0beca..0aa4c5afb 100644 --- a/dx/tests/075-dex-cat2-value-merge/Blort.java +++ b/dx/tests/075-dex-cat2-value-merge/Blort.java @@ -14,12 +14,12 @@ * limitations under the License. */ -public class Blort +public class Blort { public static void test(long[] arr) { long x = 0; - + for (;;) { x += arr[0]; } diff --git a/dx/tests/076-dex-synch-and-stack/Blort.java b/dx/tests/076-dex-synch-and-stack/Blort.java index 6ba975743..8a83492a4 100644 --- a/dx/tests/076-dex-synch-and-stack/Blort.java +++ b/dx/tests/076-dex-synch-and-stack/Blort.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Blort +public class Blort { public synchronized void test() { new Object(); diff --git a/dx/tests/077-dex-code-alignment/Blort.java b/dx/tests/077-dex-code-alignment/Blort.java index 862cd517c..3ec041afa 100644 --- a/dx/tests/077-dex-code-alignment/Blort.java +++ b/dx/tests/077-dex-code-alignment/Blort.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Blort +public class Blort { public static void justReturn1() { // This space intentionally left blank. diff --git a/dx/tests/078-dex-local-variable-table/Blort.java b/dx/tests/078-dex-local-variable-table/Blort.java index d9f006f23..7291445db 100644 --- a/dx/tests/078-dex-local-variable-table/Blort.java +++ b/dx/tests/078-dex-local-variable-table/Blort.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Blort +public class Blort { public static void test01(Object x) { x.hashCode(); diff --git a/dx/tests/079-dex-local-variable-renumbering/Blort.java b/dx/tests/079-dex-local-variable-renumbering/Blort.java index 629da90d1..c8453a233 100644 --- a/dx/tests/079-dex-local-variable-renumbering/Blort.java +++ b/dx/tests/079-dex-local-variable-renumbering/Blort.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Blort +public class Blort { public static int test1(int x) { float f0 = 0.0f; diff --git a/dx/tests/080-dex-exception-tables/Blort.java b/dx/tests/080-dex-exception-tables/Blort.java index f406bee97..2143f7fb1 100644 --- a/dx/tests/080-dex-exception-tables/Blort.java +++ b/dx/tests/080-dex-exception-tables/Blort.java @@ -30,7 +30,7 @@ public class Blort return 10; } catch (RuntimeException ex) { return 11; - } + } call3(); return 12; @@ -141,13 +141,13 @@ public class Blort call1(); } catch (RuntimeException ex) { return 10; - } + } try { call2(); } catch (RuntimeException ex) { return 11; - } + } return 12; } @@ -158,14 +158,14 @@ public class Blort call2(); } catch (RuntimeException ex) { return 10; - } + } try { call3(); call4(); } catch (RuntimeException ex) { return 11; - } + } return 12; } @@ -195,5 +195,5 @@ public class Blort return 14; } - + } diff --git a/dx/tests/083-ssa-phi-placement/Blort.java b/dx/tests/083-ssa-phi-placement/Blort.java index b31429088..ee14c836d 100644 --- a/dx/tests/083-ssa-phi-placement/Blort.java +++ b/dx/tests/083-ssa-phi-placement/Blort.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Blort +public class Blort { public int phiTest() { @@ -22,7 +22,7 @@ public class Blort int j = 1; int k = 0; - while (k < 100) { + while (k < 100) { if (j < 20) { j = i; k++; diff --git a/dx/tests/084-dex-high-register-moves/Blort.java b/dx/tests/084-dex-high-register-moves/Blort.java index 736cefb66..e68ebd814 100644 --- a/dx/tests/084-dex-high-register-moves/Blort.java +++ b/dx/tests/084-dex-high-register-moves/Blort.java @@ -14,12 +14,12 @@ * limitations under the License. */ -public class Blort +public class Blort { private static int i; private static long l; private static Object o; - + public static void test() { int i0 = 0; int i1 = 0; diff --git a/dx/tests/086-ssa-edge-split/Blort.java b/dx/tests/086-ssa-edge-split/Blort.java index 5e54dfde9..b843381a3 100644 --- a/dx/tests/086-ssa-edge-split/Blort.java +++ b/dx/tests/086-ssa-edge-split/Blort.java @@ -14,13 +14,13 @@ * limitations under the License. */ -public class Blort +public class Blort { /** * This method requires the edge-splitter to add a node * to get to the finally block, since there are * two exception sources. - * + * */ public int edgeSplitPredTest(int x) { int y = 1; @@ -45,7 +45,7 @@ public class Blort * a unique predecessor */ void edgeSplitMoveException() { - try { + try { hashCode(); hashCode(); } catch (Throwable tr) { @@ -60,7 +60,7 @@ public class Blort */ int edgeSplitSuccessor(int x) { int y = 0; - + switch(x) { case 1: y++; break; diff --git a/dx/tests/087-ssa-local-vars/Blort.java b/dx/tests/087-ssa-local-vars/Blort.java index f14979082..b1e07764f 100644 --- a/dx/tests/087-ssa-local-vars/Blort.java +++ b/dx/tests/087-ssa-local-vars/Blort.java @@ -24,7 +24,7 @@ class Blort { System.out.println("object -> string (modified)"); objectArray[4] = new Object(); try { - System.arraycopy(objectArray, 0, stringArray, 0,stringArray.length); + System.arraycopy(objectArray, 0, stringArray, 0,stringArray.length); } catch (ArrayStoreException ase) { // "ase" is an unused local which still must be preserved System.out.println("caught ArrayStoreException (expected)"); @@ -40,7 +40,7 @@ class Blort { System.err.println(foo); } /** - * Stolen from + * Stolen from * java/android/org/apache/http/impl/io/AbstractMessageParser.java * Simplified. * @@ -76,7 +76,7 @@ class Blort { } i++; } - if (maxLineLen > 0 + if (maxLineLen > 0 && previous.length() + 1 + current.length() - i > maxLineLen) { throw new IOException("Maximum line length limit exceeded"); } diff --git a/dx/tests/088-ssa-combine-blocks/Blort.java b/dx/tests/088-ssa-combine-blocks/Blort.java index 64498834d..7fbfea2e0 100644 --- a/dx/tests/088-ssa-combine-blocks/Blort.java +++ b/dx/tests/088-ssa-combine-blocks/Blort.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Blort +public class Blort { /** * just because this should do nothing @@ -27,7 +27,7 @@ public class Blort * a unique predecessor */ void edgeSplitMoveException() { - try { + try { hashCode(); hashCode(); } catch (Throwable tr) { diff --git a/dx/tests/089-dex-define-object/Object.java b/dx/tests/089-dex-define-object/Object.java index e4d9e3cae..575c736d7 100644 --- a/dx/tests/089-dex-define-object/Object.java +++ b/dx/tests/089-dex-define-object/Object.java @@ -17,15 +17,15 @@ package java.lang; public class Object { - public Object() { + public Object() { // This space intentionally left blank. } public boolean equals(Object o) { - return true; + return true; } - protected void finalize() { + protected void finalize() { // This space intentionally left blank. } @@ -35,7 +35,7 @@ public class Object { public final native void notifyAll(); public String toString() { - return "blort"; + return "blort"; } public final void wait() { diff --git a/dx/tests/090-dex-unify-arrays/Blort.java b/dx/tests/090-dex-unify-arrays/Blort.java index 47e1745dd..507153e2e 100644 --- a/dx/tests/090-dex-unify-arrays/Blort.java +++ b/dx/tests/090-dex-unify-arrays/Blort.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Blort +public class Blort { /* * Note: The use of the casts after the "?" in the following are diff --git a/dx/tests/091-ssa-const-collector/Blort.java b/dx/tests/091-ssa-const-collector/Blort.java index 40626e2b8..ec410f967 100644 --- a/dx/tests/091-ssa-const-collector/Blort.java +++ b/dx/tests/091-ssa-const-collector/Blort.java @@ -4,7 +4,7 @@ class Blort { enum Foo { ONE,TWO,THREE,FOUR,FIVE,SIX,SEVEN,EIGHT } - + /** all uses of 10 should be combined except the local assignment */ void testNumeric() { int foo = 10; diff --git a/dx/tests/092-ssa-cfg-edge-cases/Blort.java b/dx/tests/092-ssa-cfg-edge-cases/Blort.java index a1f264ef3..30dfe8bbe 100644 --- a/dx/tests/092-ssa-cfg-edge-cases/Blort.java +++ b/dx/tests/092-ssa-cfg-edge-cases/Blort.java @@ -1,6 +1,6 @@ class Blort { - + void testMultipleIdenticalSuccessors(int foo) { switch(foo) { case 1: diff --git a/dx/tests/093-ssa-invoke-range/Blort.java b/dx/tests/093-ssa-invoke-range/Blort.java index a75e31fee..88c19bb2f 100644 --- a/dx/tests/093-ssa-invoke-range/Blort.java +++ b/dx/tests/093-ssa-invoke-range/Blort.java @@ -1,10 +1,10 @@ class Blort { - + static void methodThatNeedsInvokeRange (int a, int b, int c, int d, int e, int f) { } - + void testNoLocals() { methodThatNeedsInvokeRange(5, 0, 5, 0, 5, 0); } @@ -50,7 +50,7 @@ class Blort { methodThatNeedsInvokeRange(src, 0, dest, 1, 5, 0); methodThatNeedsInvokeRange(dest, 0, src, 1, 5, 0); } - + // ensure that an attempt to combine registers for a local // with a differing category doesn't mess us up. long testMixedCategory(boolean foo) { diff --git a/dx/tests/run-all-tests b/dx/tests/run-all-tests index 1ade7616d..cada8e3cc 100755 --- a/dx/tests/run-all-tests +++ b/dx/tests/run-all-tests @@ -55,4 +55,4 @@ echo "failed: $failed test(s)" for i in $failNames; do echo "failed: $i" done - + diff --git a/hit/src/com/android/hit/ArrayInstance.java b/hit/src/com/android/hit/ArrayInstance.java index cdb56167f..42e880357 100644 --- a/hit/src/com/android/hit/ArrayInstance.java +++ b/hit/src/com/android/hit/ArrayInstance.java @@ -24,8 +24,8 @@ public class ArrayInstance extends Instance { private int mType; private int mNumEntries; private byte[] mData; - - public ArrayInstance(long id, StackTrace stack, int type, int numEntries, + + public ArrayInstance(long id, StackTrace stack, int type, int numEntries, byte[] data) { mId = id; mStack = stack; @@ -38,17 +38,17 @@ public class ArrayInstance extends Instance { if (mType != Types.OBJECT) { return; } - + /* * mData holds a stream of object instance ids * Spin through them all and list ourselves as a reference holder. */ int idSize = Types.getTypeSize(mType); final int N = mNumEntries; - + ByteArrayInputStream bais = new ByteArrayInputStream(mData); DataInputStream dis = new DataInputStream(bais); - + for (int i = 0; i < N; i++) { long id; @@ -60,7 +60,7 @@ public class ArrayInstance extends Instance { } Instance instance = state.findReference(id); - + if (instance != null) { instance.addParent(this); } @@ -81,7 +81,7 @@ public class ArrayInstance extends Instance { if (resultSet.contains(this)) { return; } - + if (null != filter) { if (filter.accept(this)) { resultSet.add(this); @@ -93,30 +93,30 @@ public class ArrayInstance extends Instance { if (mType != Types.OBJECT) { return; } - + /* * mData holds a stream of object instance ids * Spin through them all and visit them */ int idSize = Types.getTypeSize(mType); final int N = mNumEntries; - + ByteArrayInputStream bais = new ByteArrayInputStream(mData); DataInputStream dis = new DataInputStream(bais); State state = mHeap.mState; - + for (int i = 0; i < N; i++) { long id; - + try { if (idSize == 4) { id = dis.readInt(); } else { id = dis.readLong(); } - + Instance instance = state.findReference(id); - + if (instance != null) { instance.visit(resultSet, filter); } @@ -141,48 +141,48 @@ public class ArrayInstance extends Instance { if (mType != Types.OBJECT) { return super.describeReferenceTo(referent); } - + int idSize = Types.getTypeSize(mType); final int N = mNumEntries; int numRefs = 0; StringBuilder result = new StringBuilder("Elements ["); ByteArrayInputStream bais = new ByteArrayInputStream(mData); DataInputStream dis = new DataInputStream(bais); - + /* * Spin through all the objects and build up a string describing * all of the array elements that refer to the target object. */ for (int i = 0; i < N; i++) { long id; - + try { if (idSize == 4) { id = dis.readInt(); } else { id = dis.readLong(); } - + if (id == referent) { numRefs++; - + if (numRefs > 1) { result.append(", "); } - + result.append(i); } } catch (java.io.IOException e) { e.printStackTrace(); } } - + if (numRefs == 0) { return super.describeReferenceTo(referent); } result.append("]"); - + return result.toString(); } } diff --git a/hit/src/com/android/hit/ClassInstance.java b/hit/src/com/android/hit/ClassInstance.java index 36525bef3..086976960 100644 --- a/hit/src/com/android/hit/ClassInstance.java +++ b/hit/src/com/android/hit/ClassInstance.java @@ -29,7 +29,7 @@ public class ClassInstance extends Instance { mStack = stack; mClassId = classId; } - + public final void loadFieldData(DataInputStream in, int numBytes) throws IOException { mFieldValues = new byte[numBytes]; @@ -44,7 +44,7 @@ public class ClassInstance extends Instance { resolve(state, isa, isa.mFieldTypes, mFieldValues); } - private void resolve(State state, ClassObj isa, int[] types, + private void resolve(State state, ClassObj isa, int[] types, byte[] values) { ByteArrayInputStream bais = new ByteArrayInputStream(values); DataInputStream dis = new DataInputStream(bais); @@ -61,15 +61,15 @@ public class ClassInstance extends Instance { if (type == Types.OBJECT) { long id; - + if (size == 4) { id = dis.readInt(); } else { id = dis.readLong(); } - + Instance instance = state.findReference(id); - + if (instance != null) { instance.addParent(this); } @@ -85,7 +85,7 @@ public class ClassInstance extends Instance { @Override public final int getSize() { ClassObj isa = mHeap.mState.findClass(mClassId); - + return isa.getSize(); } @@ -94,7 +94,7 @@ public class ClassInstance extends Instance { if (resultSet.contains(this)) { return; } - + if (filter != null) { if (filter.accept(this)) { resultSet.add(this); @@ -109,7 +109,7 @@ public class ClassInstance extends Instance { ByteArrayInputStream bais = new ByteArrayInputStream(mFieldValues); DataInputStream dis = new DataInputStream(bais); final int N = types.length; - + /* * Spin through the list of fields, find all object references, * and list ourselves as a reference holder. @@ -118,18 +118,18 @@ public class ClassInstance extends Instance { for (int i = 0; i < N; i++) { int type = types[i]; int size = Types.getTypeSize(type); - + if (type == Types.OBJECT) { long id; - + if (size == 4) { id = dis.readInt(); } else { id = dis.readLong(); } - + Instance instance = state.findReference(id); - + if (instance != null) { instance.visit(resultSet, filter); } @@ -145,7 +145,7 @@ public class ClassInstance extends Instance { @Override public final String getTypeName() { ClassObj theClass = mHeap.mState.findClass(mClassId); - + return theClass.mClassName; } @@ -163,7 +163,7 @@ public class ClassInstance extends Instance { final int N = types.length; StringBuilder result = new StringBuilder("Referenced in field(s):"); int numReferences = 0; - + /* * Spin through the list of fields, add info about the field * references to the output text. @@ -172,16 +172,16 @@ public class ClassInstance extends Instance { for (int i = 0; i < N; i++) { int type = types[i]; int size = Types.getTypeSize(type); - + if (type == Types.OBJECT) { long id; - + if (size == 4) { id = dis.readInt(); } else { id = dis.readLong(); } - + if (id == referent) { numReferences++; result.append("\n "); @@ -202,7 +202,7 @@ public class ClassInstance extends Instance { if (numReferences == 0) { return super.describeReferenceTo(referent); } - + return result.toString(); } } diff --git a/hit/src/com/android/hit/ClassObj.java b/hit/src/com/android/hit/ClassObj.java index 388af4acf..1e3ac280d 100644 --- a/hit/src/com/android/hit/ClassObj.java +++ b/hit/src/com/android/hit/ClassObj.java @@ -51,7 +51,7 @@ public class ClassObj extends Instance implements Comparable<ClassObj> { DataInputStream dis = new DataInputStream(bais); int[] types = mStaticFieldTypes; final int N = types.length; - + /* * Spin through the list of static fields, find all object references, * and list ourselves as a reference holder. Also add them to @@ -61,18 +61,18 @@ public class ClassObj extends Instance implements Comparable<ClassObj> { for (int i = 0; i < N; i++) { int type = types[i]; int size = Types.getTypeSize(type); - + if (type == Types.OBJECT) { long id; - + if (size == 4) { id = dis.readInt(); } else { id = dis.readLong(); } - + RootObj root = new RootObj(RootType.JAVA_STATIC, id); - + if (id == 0) { root.mComment = String.format( "Static field %s:%s null", @@ -80,9 +80,9 @@ public class ClassObj extends Instance implements Comparable<ClassObj> { mStaticFieldNames[i]); } else { Instance instance = state.findReference(id); - + instance.addParent(this); - + root.mComment = String.format( "Static field %s:%s %s [%s] 0x%08x", mClassName, @@ -105,7 +105,7 @@ public class ClassObj extends Instance implements Comparable<ClassObj> { // Lastly, add ourself as a subclass of our superclass if (mSuperclassId != 0) { ClassObj superclass = state.findClass(mSuperclassId); - + superclass.addSubclass(this); } } @@ -135,7 +135,7 @@ public class ClassObj extends Instance implements Comparable<ClassObj> { public final void setFieldNames(String[] names) { mFieldNames = names; } - + public final void setFieldTypes(int[] types) { mFieldTypes = types; } @@ -143,11 +143,11 @@ public class ClassObj extends Instance implements Comparable<ClassObj> { public final void setStaticFieldNames(String[] names) { mStaticFieldNames = names; } - + public final void setStaticFieldTypes(int[] types) { mStaticFieldTypes = types; } - + public final void setStaticFieldValues(byte[] values) { mStaticFieldValues = values; } @@ -156,14 +156,14 @@ public class ClassObj extends Instance implements Comparable<ClassObj> { System.out.println("+---------- ClassObj dump for: " + mClassName); System.out.println("+----- Static fields"); - + for (int i = 0; i < mStaticFieldNames.length; i++) { - System.out.println(mStaticFieldNames[i] + ": " + System.out.println(mStaticFieldNames[i] + ": " + mStaticFieldTypes[i]); } System.out.println("+----- Instance fields"); - + for (int i = 0; i < mFieldNames.length; i++) { System.out.println(mFieldNames[i] + ": " + mFieldTypes[i]); } @@ -179,7 +179,7 @@ public class ClassObj extends Instance implements Comparable<ClassObj> { if (resultSet.contains(this)) { return; } - + if (filter != null) { if (filter.accept(this)) { resultSet.add(this); @@ -187,14 +187,14 @@ public class ClassObj extends Instance implements Comparable<ClassObj> { } else { resultSet.add(this); } - + ByteArrayInputStream bais = new ByteArrayInputStream(mStaticFieldValues); DataInputStream dis = new DataInputStream(bais); int[] types = mStaticFieldTypes; final int N = types.length; State state = mHeap.mState; - + /* * Spin through the list of static fields, find all object references, * and visit them. @@ -203,18 +203,18 @@ public class ClassObj extends Instance implements Comparable<ClassObj> { for (int i = 0; i < N; i++) { int type = types[i]; int size = Types.getTypeSize(type); - + if (type == Types.OBJECT) { long id; - + if (size == 4) { id = dis.readInt(); } else { id = dis.readLong(); } - + Instance instance = state.findReference(id); - + if (instance != null) { instance.visit(resultSet, filter); } @@ -235,7 +235,7 @@ public class ClassObj extends Instance implements Comparable<ClassObj> { if (! (o instanceof ClassObj)) { return false; } - + return 0 == compareTo((ClassObj) o); } } diff --git a/hit/src/com/android/hit/Heap.java b/hit/src/com/android/hit/Heap.java index 82dde8eb1..37b15ddc5 100644 --- a/hit/src/com/android/hit/Heap.java +++ b/hit/src/com/android/hit/Heap.java @@ -21,16 +21,16 @@ import java.util.HashMap; public class Heap { String mName; - + // List of individual stack frames HashMap<Long, StackFrame> mFrames = new HashMap<Long, StackFrame>(); - + // List stack traces, which are lists of stack frames HashMap<Integer, StackTrace> mTraces = new HashMap<Integer, StackTrace>(); - + // Root objects such as interned strings, jni locals, etc ArrayList<RootObj> mRoots = new ArrayList<RootObj>(); - + // List of threads HashMap<Integer, ThreadObj> mThreads = new HashMap<Integer, ThreadObj>(); @@ -47,7 +47,7 @@ public class Heap { public Heap(String name) { mName = name; } - + public final void addStackFrame(StackFrame theFrame) { mFrames.put(theFrame.mId, theFrame); } @@ -64,14 +64,14 @@ public class Heap { return mTraces.get(traceSerialNumber); } - public final StackTrace getStackTraceAtDepth(int traceSerialNumber, + public final StackTrace getStackTraceAtDepth(int traceSerialNumber, int depth) { StackTrace trace = mTraces.get(traceSerialNumber); - + if (trace != null) { trace = trace.fromDepth(depth); } - + return trace; } @@ -83,7 +83,7 @@ public class Heap { public final void addThread(ThreadObj thread, int serialNumber) { mThreads.put(serialNumber, thread); } - + public final ThreadObj getThread(int serialNumber) { return mThreads.get(serialNumber); } @@ -91,7 +91,7 @@ public class Heap { public final void addInstance(long id, Instance instance) { mInstances.put(id, instance); } - + public final Instance getInstance(long id) { return mInstances.get(id); } @@ -100,7 +100,7 @@ public class Heap { mClassesById.put(id, theClass); mClassesByName.put(theClass.mClassName, theClass); } - + public final ClassObj getClass(long id) { return mClassesById.get(id); } @@ -112,7 +112,7 @@ public class Heap { public final void dumpInstanceCounts() { for (ClassObj theClass: mClassesById.values()) { int count = theClass.mInstances.size(); - + if (count > 0) { System.out.println(theClass + ": " + count); } @@ -122,18 +122,18 @@ public class Heap { public final void dumpSubclasses() { for (ClassObj theClass: mClassesById.values()) { int count = theClass.mSubclasses.size(); - + if (count > 0) { System.out.println(theClass); theClass.dumpSubclasses(); } } } - + public final void dumpSizes() { for (ClassObj theClass: mClassesById.values()) { int size = 0; - + for (Instance instance: theClass.mInstances) { size += instance.getCompositeSize(); } @@ -144,7 +144,7 @@ public class Heap { } } } - + /* * Spin through all of the class instances and link them to their * parent class definition objects. Then have each instance resolve @@ -161,11 +161,11 @@ public class Heap { String name = theClass.mClassName; String superclassName = "none"; ClassObj superClass = mClassesById.get(theClass.mSuperclassId); - + if (superClass != null) { superclassName = superClass.mClassName; } - + theClass.addInstance(instance); instance.resolveReferences(state); } diff --git a/hit/src/com/android/hit/HprofParser.java b/hit/src/com/android/hit/HprofParser.java index 2226001ff..98fef1e12 100644 --- a/hit/src/com/android/hit/HprofParser.java +++ b/hit/src/com/android/hit/HprofParser.java @@ -53,7 +53,7 @@ public class HprofParser private static final int ROOT_INSTANCE_DUMP = 0x21; private static final int ROOT_OBJECT_ARRAY_DUMP = 0x22; private static final int ROOT_PRIMITIVE_ARRAY_DUMP = 0x23; - + /** * Android format addition * @@ -63,7 +63,7 @@ public class HprofParser * associated with the specified heap. The HEAP_DUMP_INFO data is reset * at the end of the HEAP_DUMP[_SEGMENT]. Multiple HEAP_DUMP_INFO entries * may appear in a single HEAP_DUMP[_SEGMENT]. - * + * * Format: * u1: Tag value (0xFE) * u4: heap ID @@ -103,12 +103,12 @@ public class HprofParser try { String s = readNullTerminatedString(); DataInputStream in = mInput; - + mIdSize = in.readInt(); Types.setIdSize(mIdSize); - + in.readLong(); // Timestamp, ignored for now - + while (true) { int tag = in.readUnsignedByte(); int timestamp = in.readInt(); @@ -118,7 +118,7 @@ public class HprofParser case STRING_IN_UTF8: loadString(length - 4); break; - + case LOAD_CLASS: loadClass(); break; @@ -135,7 +135,7 @@ public class HprofParser loadHeapDump(length); mState.setToDefaultHeap(); break; - + case HEAP_DUMP_SEGMENT: loadHeapDump(length); mState.setToDefaultHeap(); @@ -153,7 +153,7 @@ public class HprofParser } mState.resolveReferences(); - + return state; } @@ -164,7 +164,7 @@ public class HprofParser for (int c = in.read(); c != 0; c = in.read()) { s.append((char) c); } - + return s.toString(); } @@ -175,13 +175,13 @@ public class HprofParser case 4: return ((long) mInput.readInt()) & 0x00000000ffffffffL; case 8: return mInput.readLong(); } - + throw new IllegalArgumentException("ID Length must be 1, 2, 4, or 8"); } private String readUTF8(int length) throws IOException { byte[] b = new byte[length]; - + mInput.read(b); return new String(b, "utf-8"); @@ -190,7 +190,7 @@ public class HprofParser private void loadString(int length) throws IOException { long id = readId(); String string = readUTF8(length); - + mStrings.put(id, string); } @@ -200,7 +200,7 @@ public class HprofParser long id = readId(); int stackTrace = in.readInt(); // unused String name = mStrings.get(readId()); - + mClassNames.put(id, name); } @@ -211,8 +211,8 @@ public class HprofParser String sourceFile = mStrings.get(readId()); int serial = mInput.readInt(); int lineNumber = mInput.readInt(); - - StackFrame frame = new StackFrame(id, methodName, methodSignature, + + StackFrame frame = new StackFrame(id, methodName, methodSignature, sourceFile, serial, lineNumber); mState.addStackFrame(frame); @@ -223,12 +223,12 @@ public class HprofParser int threadSerialNumber = mInput.readInt(); final int numFrames = mInput.readInt(); StackFrame[] frames = new StackFrame[numFrames]; - + for (int i = 0; i < numFrames; i++) { frames[i] = mState.getStackFrame(readId()); } - - StackTrace trace = new StackTrace(serialNumber, threadSerialNumber, + + StackTrace trace = new StackTrace(serialNumber, threadSerialNumber, frames); mState.addStackTrace(trace); @@ -236,62 +236,62 @@ public class HprofParser private void loadHeapDump(int length) throws IOException { DataInputStream in = mInput; - + while (length > 0) { int tag = in.readUnsignedByte(); length--; - + switch (tag) { case ROOT_UNKNOWN: length -= loadBasicObj(RootType.UNKNOWN); break; - + case ROOT_JNI_GLOBAL: length -= loadBasicObj(RootType.NATIVE_STATIC); readId(); // ignored length -= mIdSize; break; - + case ROOT_JNI_LOCAL: length -= loadJniLocal(); break; - + case ROOT_JAVA_FRAME: length -= loadJavaFrame(); break; - + case ROOT_NATIVE_STACK: length -= loadNativeStack(); break; - + case ROOT_STICKY_CLASS: length -= loadBasicObj(RootType.SYSTEM_CLASS); break; - + case ROOT_THREAD_BLOCK: length -= loadThreadBlock(); break; - + case ROOT_MONITOR_USED: length -= loadBasicObj(RootType.BUSY_MONITOR); break; - + case ROOT_THREAD_OBJECT: length -= loadThreadObject(); break; - + case ROOT_CLASS_DUMP: length -= loadClassDump(); break; - + case ROOT_INSTANCE_DUMP: length -= loadInstanceDump(); break; - + case ROOT_OBJECT_ARRAY_DUMP: length -= loadObjectArrayDump(); break; - + case ROOT_PRIMITIVE_ARRAY_DUMP: length -= loadPrimitiveArrayDump(); break; @@ -302,66 +302,66 @@ public class HprofParser throw new IllegalArgumentException( "Don't know how to load a nodata array"); - + case ROOT_HEAP_DUMP_INFO: int heapId = mInput.readInt(); long heapNameId = readId(); String heapName = mStrings.get(heapNameId); - + mState.setHeapTo(heapId, heapName); length -= 4 + mIdSize; break; - + case ROOT_INTERNED_STRING: length -= loadBasicObj(RootType.INTERNED_STRING); break; - + case ROOT_FINALIZING: length -= loadBasicObj(RootType.FINALIZING); break; - + case ROOT_DEBUGGER: length -= loadBasicObj(RootType.DEBUGGER); break; - + case ROOT_REFERENCE_CLEANUP: length -= loadBasicObj(RootType.REFERENCE_CLEANUP); break; - + case ROOT_VM_INTERNAL: length -= loadBasicObj(RootType.VM_INTERNAL); break; - + case ROOT_JNI_MONITOR: length -= loadJniMonitor(); break; - + case ROOT_UNREACHABLE: length -= loadBasicObj(RootType.UNREACHABLE); break; - + default: throw new IllegalArgumentException( - "loadHeapDump loop with unknown tag " + tag - + " with " + mInput.available() + "loadHeapDump loop with unknown tag " + tag + + " with " + mInput.available() + " bytes possibly remaining"); } } } - + private int loadJniLocal() throws IOException { long id = readId(); int threadSerialNumber = mInput.readInt(); int stackFrameNumber = mInput.readInt(); ThreadObj thread = mState.getThread(threadSerialNumber); - StackTrace trace = mState.getStackTraceAtDepth(thread.mStackTrace, + StackTrace trace = mState.getStackTraceAtDepth(thread.mStackTrace, stackFrameNumber); - RootObj root = new RootObj(RootType.NATIVE_LOCAL, id, + RootObj root = new RootObj(RootType.NATIVE_LOCAL, id, threadSerialNumber, trace); - + root.setHeap(mState.mCurrentHeap); mState.addRoot(root); - + return mIdSize + 4 + 4; } @@ -370,38 +370,38 @@ public class HprofParser int threadSerialNumber = mInput.readInt(); int stackFrameNumber = mInput.readInt(); ThreadObj thread = mState.getThread(threadSerialNumber); - StackTrace trace = mState.getStackTraceAtDepth(thread.mStackTrace, + StackTrace trace = mState.getStackTraceAtDepth(thread.mStackTrace, stackFrameNumber); - RootObj root = new RootObj(RootType.JAVA_LOCAL, id, threadSerialNumber, + RootObj root = new RootObj(RootType.JAVA_LOCAL, id, threadSerialNumber, trace); - + root.setHeap(mState.mCurrentHeap); mState.addRoot(root); - + return mIdSize + 4 + 4; } - + private int loadNativeStack() throws IOException { long id = readId(); int threadSerialNumber = mInput.readInt(); ThreadObj thread = mState.getThread(threadSerialNumber); StackTrace trace = mState.getStackTrace(thread.mStackTrace); - RootObj root = new RootObj(RootType.NATIVE_STACK, id, + RootObj root = new RootObj(RootType.NATIVE_STACK, id, threadSerialNumber, trace); - + root.setHeap(mState.mCurrentHeap); mState.addRoot(root); - + return mIdSize + 4; } private int loadBasicObj(RootType type) throws IOException { long id = readId(); RootObj root = new RootObj(type, id); - + root.setHeap(mState.mCurrentHeap); mState.addRoot(root); - + return mIdSize; } @@ -410,12 +410,12 @@ public class HprofParser int threadSerialNumber = mInput.readInt(); ThreadObj thread = mState.getThread(threadSerialNumber); StackTrace stack = mState.getStackTrace(thread.mStackTrace); - RootObj root = new RootObj(RootType.THREAD_BLOCK, id, + RootObj root = new RootObj(RootType.THREAD_BLOCK, id, threadSerialNumber, stack); - + root.setHeap(mState.mCurrentHeap); mState.addRoot(root); - + return mIdSize + 4; } @@ -424,9 +424,9 @@ public class HprofParser int threadSerialNumber = mInput.readInt(); int stackSerialNumber = mInput.readInt(); ThreadObj thread = new ThreadObj(id, stackSerialNumber); - + mState.addThread(thread, threadSerialNumber); - + return mIdSize + 4 + 4; } @@ -449,7 +449,7 @@ public class HprofParser // Skip over the constant pool int numEntries = in.readUnsignedShort(); bytesRead += 2; - + for (int i = 0; i < numEntries; i++) { in.readUnsignedShort(); bytesRead += 2 + skipValue(); @@ -463,7 +463,7 @@ public class HprofParser int[] staticFieldTypes = new int[numEntries]; ByteArrayOutputStream staticFieldValues = new ByteArrayOutputStream(); byte[] buffer = mFieldBuffer; - + for (int i = 0; i < numEntries; i++) { staticFieldNames[i] = mStrings.get(readId()); @@ -476,14 +476,14 @@ public class HprofParser bytesRead += mIdSize + 1 + fieldSize; } - + // Instance fields numEntries = in.readUnsignedShort(); bytesRead += 2; - + String[] names = new String[numEntries]; int[] types = new int[numEntries]; - + for (int i = 0; i < numEntries; i++) { long fieldName = readId(); int type = in.readUnsignedByte(); @@ -493,7 +493,7 @@ public class HprofParser bytesRead += mIdSize + 1; } - + ClassObj theClass = new ClassObj(id, stack, mClassNames.get(id)); theClass.setStaticFieldNames(staticFieldNames); @@ -504,11 +504,11 @@ public class HprofParser theClass.setFieldNames(names); theClass.setFieldTypes(types); theClass.setSize(instanceSize); - + theClass.setHeap(mState.mCurrentHeap); mState.addClass(id, theClass); - + return bytesRead; } @@ -523,7 +523,7 @@ public class HprofParser instance.loadFieldData(mInput, remaining); instance.setHeap(mState.mCurrentHeap); mState.addInstance(id, instance); - + return mIdSize + 4 + mIdSize + 4 + remaining; } @@ -536,19 +536,19 @@ public class HprofParser int totalBytes = numElements * mIdSize; byte[] data = new byte[totalBytes]; String className = mClassNames.get(classId); - + mInput.readFully(data); - ArrayInstance array = new ArrayInstance(id, stack, Types.OBJECT, + ArrayInstance array = new ArrayInstance(id, stack, Types.OBJECT, numElements, data); - + array.mClassId = classId; array.setHeap(mState.mCurrentHeap); mState.addInstance(id, array); return mIdSize + 4 + 4 + mIdSize + totalBytes; } - + private int loadPrimitiveArrayDump() throws IOException { long id = readId(); int stackId = mInput.readInt(); @@ -558,15 +558,15 @@ public class HprofParser int size = Types.getTypeSize(type); int totalBytes = numElements * size; byte[] data = new byte[totalBytes]; - + mInput.readFully(data); - ArrayInstance array = new ArrayInstance(id, stack, type, numElements, + ArrayInstance array = new ArrayInstance(id, stack, type, numElements, data); - + array.setHeap(mState.mCurrentHeap); mState.addInstance(id, array); - + return mIdSize + 4 + 4 + 1 + totalBytes; } @@ -575,21 +575,21 @@ public class HprofParser int threadSerialNumber = mInput.readInt(); int stackDepth = mInput.readInt(); ThreadObj thread = mState.getThread(threadSerialNumber); - StackTrace trace = mState.getStackTraceAtDepth(thread.mStackTrace, + StackTrace trace = mState.getStackTraceAtDepth(thread.mStackTrace, stackDepth); - RootObj root = new RootObj(RootType.NATIVE_MONITOR, id, + RootObj root = new RootObj(RootType.NATIVE_MONITOR, id, threadSerialNumber, trace); - + root.setHeap(mState.mCurrentHeap); mState.addRoot(root); - + return mIdSize + 4 + 4; } private int skipValue() throws IOException { int type = mInput.readUnsignedByte(); int size = Types.getTypeSize(type); - + skipFully(size); return size + 1; @@ -604,7 +604,7 @@ public class HprofParser private void skipFully(long numBytes) throws IOException { while (numBytes > 0) { long skipped = mInput.skip(numBytes); - + numBytes -= skipped; } } diff --git a/hit/src/com/android/hit/Instance.java b/hit/src/com/android/hit/Instance.java index 24db38d1b..6afa2b26a 100644 --- a/hit/src/com/android/hit/Instance.java +++ b/hit/src/com/android/hit/Instance.java @@ -25,10 +25,10 @@ public abstract class Instance { // Id of the ClassObj of which this object is an instance long mClassId; - + // The stack in which this object was allocated StackTrace mStack; - + // The heap in which this object was allocated (app, zygote, etc) Heap mHeap; @@ -41,7 +41,7 @@ public abstract class Instance { // List of all objects that hold a live reference to this object private ArrayList<Instance> mParents; - + /* * After the whole HPROF file is read and parsed this method will be * called on all heap objects so that they can resolve their internal @@ -67,15 +67,15 @@ public abstract class Instance { public final int getCompositeSize() { HashSet<Instance> set = new HashSet<Instance>(); - + visit(set, null); - + int size = 0; - + for (Instance instance: set) { size += instance.getSize(); } - + return size; } @@ -89,21 +89,21 @@ public abstract class Instance { public void setHeap(Heap heap) { mHeap = heap; } - + // Add to the list of objects that have a hard reference to this Instance public void addParent(Instance parent) { if (mParents == null) { mParents = new ArrayList<Instance>(); } - + mParents.add(parent); } - + public ArrayList<Instance> getParents() { if (mParents == null) { mParents = new ArrayList<Instance>(); } - + return mParents; } @@ -112,6 +112,6 @@ public abstract class Instance { * a String describing the reference in detail. */ public String describeReferenceTo(long id) { - return "No reference to 0x" + Long.toHexString(id); + return "No reference to 0x" + Long.toHexString(id); } } diff --git a/hit/src/com/android/hit/Main.java b/hit/src/com/android/hit/Main.java index eebadfe1a..4ed5c11c9 100644 --- a/hit/src/com/android/hit/Main.java +++ b/hit/src/com/android/hit/Main.java @@ -28,16 +28,16 @@ public class Main FileInputStream fis; BufferedInputStream bis; DataInputStream dis; - + try { fis = new FileInputStream(argv[0]); bis = new BufferedInputStream(fis); dis = new DataInputStream(bis); - + State state = (new HprofParser(dis)).parse(); dis.close(); - + testClassesQuery(state); testAllClassesQuery(state); testFindInstancesOf(state); @@ -53,28 +53,28 @@ public class Main "javax.", "org.xml.sax" }; - + Map<String, Set<ClassObj>> someClasses = Queries.classes(state, x); - + for (String thePackage: someClasses.keySet()) { System.out.println("------------------- " + thePackage); - + Set<ClassObj> classes = someClasses.get(thePackage); - + for (ClassObj theClass: classes) { System.out.println(" " + theClass.mClassName); } } } - + private static void testAllClassesQuery(State state) { Map<String, Set<ClassObj>> allClasses = Queries.allClasses(state); - + for (String thePackage: allClasses.keySet()) { System.out.println("------------------- " + thePackage); - + Set<ClassObj> classes = allClasses.get(thePackage); - + for (ClassObj theClass: classes) { System.out.println(" " + theClass.mClassName); } @@ -83,14 +83,14 @@ public class Main private static void testFindInstancesOf(State state) { Instance[] instances = Queries.instancesOf(state, "java.lang.String"); - + System.out.println("There are " + instances.length + " Strings."); } private static void testFindAllInstancesOf(State state) { - Instance[] instances = Queries.allInstancesOf(state, + Instance[] instances = Queries.allInstancesOf(state, "android.graphics.drawable.Drawable"); - + System.out.println("There are " + instances.length + " instances of Drawables and its subclasses."); } diff --git a/hit/src/com/android/hit/Queries.java b/hit/src/com/android/hit/Queries.java index cc692b043..0dac79647 100644 --- a/hit/src/com/android/hit/Queries.java +++ b/hit/src/com/android/hit/Queries.java @@ -27,7 +27,7 @@ import java.util.TreeSet; public class Queries { /* - * NOTES: Here's a list of the queries that can be done in hat and + * NOTES: Here's a list of the queries that can be done in hat and * how you'd perform a similar query here in hit: * * hat hit @@ -67,7 +67,7 @@ public class Queries { return classes(state, null); } - public static Map<String, Set<ClassObj>> classes(State state, + public static Map<String, Set<ClassObj>> classes(State state, String[] excludedPrefixes) { TreeMap<String, Set<ClassObj>> result = new TreeMap<String, Set<ClassObj>>(); @@ -78,16 +78,16 @@ public class Queries { for (Heap heap: state.mHeaps.values()) { classes.addAll(heap.mClassesById.values()); } - + // Filter it if needed if (excludedPrefixes != null) { final int N = excludedPrefixes.length; Iterator<ClassObj> iter = classes.iterator(); - + while (iter.hasNext()) { ClassObj theClass = iter.next(); String classPath = theClass.toString(); - + for (int i = 0; i < N; i++) { if (classPath.startsWith(excludedPrefixes[i])) { iter.remove(); @@ -96,29 +96,29 @@ public class Queries { } } } - + // Now that we have a final list of classes, group them by package for (ClassObj theClass: classes) { String packageName = DEFAULT_PACKAGE; int lastDot = theClass.mClassName.lastIndexOf('.'); - + if (lastDot != -1) { packageName = theClass.mClassName.substring(0, lastDot); } - + Set<ClassObj> classSet = result.get(packageName); - + if (classSet == null) { classSet = new TreeSet<ClassObj>(); result.put(packageName, classSet); } - + classSet.add(theClass); } - + return result; } - + /* * It's sorta sad that this is a pass-through call, but it seems like * having all of the hat-like query methods in one place is a good thing @@ -134,14 +134,14 @@ public class Queries { */ public static Instance[] instancesOf(State state, String baseClassName) { ClassObj theClass = state.findClass(baseClassName); - + if (theClass == null) { throw new IllegalArgumentException("Class not found: " + baseClassName); } - + Instance[] instances = new Instance[theClass.mInstances.size()]; - + return theClass.mInstances.toArray(instances); } @@ -151,38 +151,38 @@ public class Queries { */ public static Instance[] allInstancesOf(State state, String baseClassName) { ClassObj theClass = state.findClass(baseClassName); - + if (theClass == null) { throw new IllegalArgumentException("Class not found: " + baseClassName); } ArrayList<ClassObj> classList = new ArrayList<ClassObj>(); - + classList.add(theClass); classList.addAll(traverseSubclasses(theClass)); - + ArrayList<Instance> instanceList = new ArrayList<Instance>(); - + for (ClassObj someClass: classList) { instanceList.addAll(someClass.mInstances); } - + Instance[] result = new Instance[instanceList.size()]; - + instanceList.toArray(result); - + return result; } - + private static ArrayList<ClassObj> traverseSubclasses(ClassObj base) { ArrayList<ClassObj> result = new ArrayList<ClassObj>(); - + for (ClassObj subclass: base.mSubclasses) { result.add(subclass); result.addAll(traverseSubclasses(subclass)); } - + return result; } @@ -192,33 +192,33 @@ public class Queries { */ public static Instance findObject(State state, String id) { long id2 = Long.parseLong(id, 16); - + return state.findReference(id2); } public static Collection<RootObj> getRoots(State state) { HashSet<RootObj> result = new HashSet<RootObj>(); - + for (Heap heap: state.mHeaps.values()) { result.addAll(heap.mRoots); } - + return result; } public static final Instance[] newInstances(State older, State newer) { ArrayList<Instance> resultList = new ArrayList<Instance>(); - + for (Heap newHeap: newer.mHeaps.values()) { Heap oldHeap = older.getHeap(newHeap.mName); - + if (oldHeap == null) { continue; } - + for (Instance instance: newHeap.mInstances.values()) { Instance oldInstance = oldHeap.getInstance(instance.mId); - + /* * If this instance wasn't in the old heap, or was there, * but that ID was for an obj of a different type, then we have @@ -231,9 +231,9 @@ public class Queries { } } } - + Instance[] resultArray = new Instance[resultList.size()]; - + return resultList.toArray(resultArray); } } diff --git a/hit/src/com/android/hit/RootObj.java b/hit/src/com/android/hit/RootObj.java index 1f9d53912..a9acd3544 100644 --- a/hit/src/com/android/hit/RootObj.java +++ b/hit/src/com/android/hit/RootObj.java @@ -37,7 +37,7 @@ public class RootObj extends Instance { public RootObj(RootType type, long id) { this(type, id, 0, null); } - + public RootObj(RootType type, long id, int thread, StackTrace stack) { mType = type; mId = id; @@ -47,7 +47,7 @@ public class RootObj extends Instance { public final String getClassName(State state) { ClassObj theClass; - + if (mType == RootType.SYSTEM_CLASS) { theClass = state.findClass(mId); } else { @@ -59,24 +59,24 @@ public class RootObj extends Instance { if (theClass == null) { return "no class defined!!"; } - + return theClass.mClassName; } @Override public final int getSize() { Instance instance = null; - + if (mType == RootType.SYSTEM_CLASS) { instance = mHeap.mState.findClass(mId); } else { instance = mHeap.mState.findReference(mId); } - + if (instance == null) { return 0; } - + return instance.getSize(); } @@ -85,7 +85,7 @@ public class RootObj extends Instance { if (resultSet.contains(this)) { return; } - + if (filter != null) { if (filter.accept(this)) { resultSet.add(this); diff --git a/hit/src/com/android/hit/RootType.java b/hit/src/com/android/hit/RootType.java index 01ebefff6..209ed1be0 100644 --- a/hit/src/com/android/hit/RootType.java +++ b/hit/src/com/android/hit/RootType.java @@ -34,19 +34,19 @@ public enum RootType { JAVA_LOCAL (14, "java local"), NATIVE_STACK (15, "native stack"), JAVA_STATIC (16, "java static"); - + private final int mType; private final String mName; - + RootType(int type, String name) { mType = type; mName = name; } - + public final int getType() { return mType; } - + public final String getName() { return mName; } diff --git a/hit/src/com/android/hit/StackFrame.java b/hit/src/com/android/hit/StackFrame.java index a40f607e3..2ae7f326e 100644 --- a/hit/src/com/android/hit/StackFrame.java +++ b/hit/src/com/android/hit/StackFrame.java @@ -21,7 +21,7 @@ public class StackFrame { public static final int UNKNOWN_LOCATION = -1; public static final int COMPILED_METHOD = -2; public static final int NATIVE_METHOD = -3; - + long mId; String mMethodName; String mSignature; @@ -29,7 +29,7 @@ public class StackFrame { int mSerialNumber; int mLineNumber; - public StackFrame(long id, String method, String sig, String file, + public StackFrame(long id, String method, String sig, String file, int serial, int line) { mId = id; mMethodName = method; @@ -45,16 +45,16 @@ public class StackFrame { case UNKNOWN_LOCATION: return "Unknown line number"; case COMPILED_METHOD: return "Compiled method"; case NATIVE_METHOD: return "Native method"; - + default: return String.valueOf(mLineNumber); } } public final String toString() { - return mMethodName - + mSignature.replace('/', '.') - + " - " - + mFilename + ":" + return mMethodName + + mSignature.replace('/', '.') + + " - " + + mFilename + ":" + lineNumberString(); } } diff --git a/hit/src/com/android/hit/StackTrace.java b/hit/src/com/android/hit/StackTrace.java index 239a7b818..53cb86dbe 100644 --- a/hit/src/com/android/hit/StackTrace.java +++ b/hit/src/com/android/hit/StackTrace.java @@ -31,9 +31,9 @@ public class StackTrace { int mOffset = 0; private StackTrace() { - + } - + public StackTrace(int serial, int thread, StackFrame[] frames) { mSerialNumber = serial; mThreadSerialNumber = thread; @@ -42,21 +42,21 @@ public class StackTrace { public final StackTrace fromDepth(int startingDepth) { StackTrace result = new StackTrace(); - + if (mParent != null) { result.mParent = mParent; } else { result.mParent = this; } - + result.mOffset = startingDepth + mOffset; - + return result; } - + public final void dump() { final int N = mFrames.length; - + for (int i = 0; i < N; i++) { System.out.println(mFrames[i].toString()); } diff --git a/hit/src/com/android/hit/State.java b/hit/src/com/android/hit/State.java index 9b2060d41..96c944d91 100644 --- a/hit/src/com/android/hit/State.java +++ b/hit/src/com/android/hit/State.java @@ -41,13 +41,13 @@ public class State { public Heap setHeapTo(int id, String name) { Heap heap = mHeaps.get(id); - + if (heap == null) { heap = new Heap(name); heap.mState = this; mHeaps.put(id, heap); } - + mCurrentHeap = heap; return mCurrentHeap; @@ -56,54 +56,54 @@ public class State { public Heap getHeap(int id) { return mHeaps.get(id); } - + public Heap getHeap(String name) { for (Heap heap: mHeaps.values()) { if (heap.mName.equals(name)) { return heap; } } - + return null; } public final void addStackFrame(StackFrame theFrame) { mCurrentHeap.addStackFrame(theFrame); } - + public final StackFrame getStackFrame(long id) { return mCurrentHeap.getStackFrame(id); } - + public final void addStackTrace(StackTrace theTrace) { mCurrentHeap.addStackTrace(theTrace); } - + public final StackTrace getStackTrace(int traceSerialNumber) { return mCurrentHeap.getStackTrace(traceSerialNumber); } - - public final StackTrace getStackTraceAtDepth(int traceSerialNumber, + + public final StackTrace getStackTraceAtDepth(int traceSerialNumber, int depth) { return mCurrentHeap.getStackTraceAtDepth(traceSerialNumber, depth); } - + public final void addRoot(RootObj root) { mCurrentHeap.addRoot(root); } - + public final void addThread(ThreadObj thread, int serialNumber) { mCurrentHeap.addThread(thread, serialNumber); } - + public final ThreadObj getThread(int serialNumber) { return mCurrentHeap.getThread(serialNumber); } - + public final void addInstance(long id, Instance instance) { mCurrentHeap.addInstance(id, instance); } - + public final void addClass(long id, ClassObj theClass) { mCurrentHeap.addClass(id, theClass); } @@ -111,40 +111,40 @@ public class State { public final Instance findReference(long id) { for (Heap heap: mHeaps.values()) { Instance instance = heap.getInstance(id); - + if (instance != null) { return instance; } } - + // Couldn't find an instance of a class, look for a class object return findClass(id); } - + public final ClassObj findClass(long id) { for (Heap heap: mHeaps.values()) { ClassObj theClass = heap.getClass(id); - + if (theClass != null) { return theClass; } } - + return null; } - + public final ClassObj findClass(String name) { for (Heap heap: mHeaps.values()) { ClassObj theClass = heap.getClass(name); - + if (theClass != null) { return theClass; } } - + return null; } - + public final void dumpInstanceCounts() { for (Heap heap: mHeaps.values()) { System.out.println( @@ -152,7 +152,7 @@ public class State { heap.dumpInstanceCounts(); } } - + public final void dumpSizes() { for (Heap heap: mHeaps.values()) { System.out.println( @@ -168,7 +168,7 @@ public class State { heap.dumpSubclasses(); } } - + public final void resolveReferences() { for (Heap heap: mHeaps.values()) { heap.resolveInstanceRefs(this); diff --git a/hit/src/com/android/hit/Types.java b/hit/src/com/android/hit/Types.java index ef316a94b..62228cea6 100644 --- a/hit/src/com/android/hit/Types.java +++ b/hit/src/com/android/hit/Types.java @@ -45,7 +45,7 @@ public class Types { case 'S': return 2; // short case 'I': return 4; // int case 'J': return 8; // long - + case OBJECT: return mIdSize; case BOOLEAN: return 1; case CHAR: return 2; @@ -56,10 +56,10 @@ public class Types { case INT: return 4; case LONG: return 8; } - + throw new IllegalArgumentException("Illegal type signature: " + type); } - + public static final String getTypeName(int type) { switch (type) { case '[': return "array"; @@ -72,7 +72,7 @@ public class Types { case 'S': return "short"; case 'I': return "int"; case 'J': return "long"; - + case OBJECT: return "object"; case BOOLEAN: return "boolean"; case CHAR: return "char"; @@ -83,7 +83,7 @@ public class Types { case INT: return "int"; case LONG: return "long"; } - + throw new IllegalArgumentException("Illegal type signature: " + type); } } diff --git a/libdex/CmdUtils.c b/libdex/CmdUtils.c index 95e20e7cc..35696f94f 100644 --- a/libdex/CmdUtils.c +++ b/libdex/CmdUtils.c @@ -115,7 +115,7 @@ UnzipToFileResult dexOpenAndMap(const char* fileName, const char* tempFileName, if (len < 5) { if (!quiet) { - fprintf(stderr, + fprintf(stderr, "ERROR: filename must end in .dex, .zip, .jar, or .apk\n"); } result = kUTFRBadArgs; @@ -138,7 +138,7 @@ UnzipToFileResult dexOpenAndMap(const char* fileName, const char* tempFileName, } result = dexUnzipToFile(fileName, tempFileName, quiet); - + if (result == kUTFRSuccess) { //printf("+++ Good unzip to '%s'\n", tempFileName); fileName = tempFileName; diff --git a/libdex/DexCatch.c b/libdex/DexCatch.c index 5eae17a66..ed97e87d9 100644 --- a/libdex/DexCatch.c +++ b/libdex/DexCatch.c @@ -20,14 +20,14 @@ #include "DexCatch.h" -/* Get the first handler offset for the given DexCode. +/* Get the first handler offset for the given DexCode. * It's not 0 because the handlers list is prefixed with its size * (in entries) as a uleb128. */ u4 dexGetFirstHandlerOffset(const DexCode* pCode) { if (pCode->triesSize == 0) { return 0; } - + const u1* baseData = dexGetCatchHandlerData(pCode); const u1* data = baseData; diff --git a/libdex/DexCatch.h b/libdex/DexCatch.h index f928144aa..c0eec7c57 100644 --- a/libdex/DexCatch.h +++ b/libdex/DexCatch.h @@ -32,7 +32,7 @@ typedef struct DexCatchHandler { u4 address; /* handler address */ } DexCatchHandler; -/* Get the first handler offset for the given DexCode. +/* Get the first handler offset for the given DexCode. * It's not 0 because the handlers list is prefixed with its size * (in entries) as a uleb128. */ u4 dexGetFirstHandlerOffset(const DexCode* pCode); @@ -84,7 +84,7 @@ DEX_INLINE void dexCatchIteratorInit(DexCatchIterator* pIterator, { dexCatchIteratorInitToPointer(pIterator, dexGetCatchHandlerData(pCode) + offset); -} +} /* Get the next item from a DexCatchIterator. Returns NULL if at end. */ DEX_INLINE DexCatchHandler* dexCatchIteratorNext(DexCatchIterator* pIterator) { @@ -119,7 +119,7 @@ int dexFindCatchHandlerOffset0(u2 triesSize, const DexTry* pTries, * found. Returns false if there is no applicable handler. */ DEX_INLINE bool dexFindCatchHandler(DexCatchIterator *pIterator, const DexCode* pCode, u4 address) { - u2 triesSize = pCode->triesSize; + u2 triesSize = pCode->triesSize; int offset = -1; // Short-circuit the overwhelmingly common cases. @@ -134,13 +134,13 @@ DEX_INLINE bool dexFindCatchHandler(DexCatchIterator *pIterator, if (address < start) { break; } - + u4 end = start + tries[0].insnCount; if (address >= end) { break; } - + offset = tries[0].handlerOff; break; } @@ -157,6 +157,6 @@ DEX_INLINE bool dexFindCatchHandler(DexCatchIterator *pIterator, dexCatchIteratorInit(pIterator, pCode, offset); return true; } -} +} #endif diff --git a/libdex/DexClass.c b/libdex/DexClass.c index 126813016..8a59e09fd 100644 --- a/libdex/DexClass.c +++ b/libdex/DexClass.c @@ -52,11 +52,11 @@ bool dexReadAndVerifyClassDataHeader(const u1** pData, const u1* pLimit, /* Read and verify an encoded_field. This updates the * given data pointer to point past the end of the read data and * returns an "okay" flag (that is, false == failure). - * + * * The lastIndex value should be set to 0 before the first field in * a list is read. It is updated as fields are read and used in the * decode process. - * + * * The verification done by this function is of the raw data format * only; it does not verify that access flags or indices * are valid. */ @@ -73,7 +73,7 @@ bool dexReadAndVerifyClassDataField(const u1** pData, const u1* pLimit, /* Read and verify an encoded_method. This updates the * given data pointer to point past the end of the read data and * returns an "okay" flag (that is, false == failure). - * + * * The lastIndex value should be set to 0 before the first method in * a list is read. It is updated as fields are read and used in the * decode process. @@ -97,7 +97,7 @@ bool dexReadAndVerifyClassDataMethod(const u1** pData, const u1* pLimit, * must subsequently be free()d. This function returns NULL if there * was trouble parsing the data. If this function is passed NULL, it * returns an initialized empty DexClassData structure. - * + * * The verification done by this function is of the raw data format * only; it does not verify that access flags, indices, or offsets * are valid. */ @@ -110,7 +110,7 @@ DexClassData* dexReadAndVerifyClassData(const u1** pData, const u1* pLimit) { memset(result, 0, sizeof(*result)); return result; } - + if (! dexReadAndVerifyClassDataHeader(pData, pLimit, &header)) { return NULL; } @@ -138,21 +138,21 @@ DexClassData* dexReadAndVerifyClassData(const u1** pData, const u1* pLimit) { } else { result->staticFields = NULL; } - + if (header.instanceFieldsSize != 0) { result->instanceFields = (DexField*) ptr; ptr += header.instanceFieldsSize * sizeof(DexField); } else { result->instanceFields = NULL; } - + if (header.directMethodsSize != 0) { result->directMethods = (DexMethod*) ptr; ptr += header.directMethodsSize * sizeof(DexMethod); } else { result->directMethods = NULL; } - + if (header.virtualMethodsSize != 0) { result->virtualMethods = (DexMethod*) ptr; } else { @@ -176,7 +176,7 @@ DexClassData* dexReadAndVerifyClassData(const u1** pData, const u1* pLimit) { okay = dexReadAndVerifyClassDataMethod(pData, pLimit, &result->directMethods[i], &lastIndex); } - + lastIndex = 0; for (i = 0; okay && (i < header.virtualMethodsSize); i++) { okay = dexReadAndVerifyClassDataMethod(pData, pLimit, diff --git a/libdex/DexClass.h b/libdex/DexClass.h index ce41e8bb3..3d1e11be5 100644 --- a/libdex/DexClass.h +++ b/libdex/DexClass.h @@ -65,11 +65,11 @@ bool dexReadAndVerifyClassDataHeader(const u1** pData, const u1* pLimit, /* Read and verify an encoded_field. This updates the * given data pointer to point past the end of the read data and * returns an "okay" flag (that is, false == failure). - * + * * The lastIndex value should be set to 0 before the first field in * a list is read. It is updated as fields are read and used in the * decode process. - * + * * The verification done by this function is of the raw data format * only; it does not verify that access flags or indices * are valid. */ @@ -79,7 +79,7 @@ bool dexReadAndVerifyClassDataField(const u1** pData, const u1* pLimit, /* Read and verify an encoded_method. This updates the * given data pointer to point past the end of the read data and * returns an "okay" flag (that is, false == failure). - * + * * The lastIndex value should be set to 0 before the first method in * a list is read. It is updated as fields are read and used in the * decode process. @@ -96,7 +96,7 @@ bool dexReadAndVerifyClassDataMethod(const u1** pData, const u1* pLimit, * must subsequently be free()d. This function returns NULL if there * was trouble parsing the data. If this function is passed NULL, it * returns an initialized empty DexClassData structure. - * + * * The verification done by this function is of the raw data format * only; it does not verify that access flags, indices, or offsets * are valid. */ @@ -127,8 +127,8 @@ DEX_INLINE void dexReadClassDataHeader(const u1** pData, } /* Read an encoded_field without verification. This updates the - * given data pointer to point past the end of the read data. - * + * given data pointer to point past the end of the read data. + * * The lastIndex value should be set to 0 before the first field in * a list is read. It is updated as fields are read and used in the * decode process. @@ -143,8 +143,8 @@ DEX_INLINE void dexReadClassDataField(const u1** pData, DexField* pField, } /* Read an encoded_method without verification. This updates the - * given data pointer to point past the end of the read data. - * + * given data pointer to point past the end of the read data. + * * The lastIndex value should be set to 0 before the first method in * a list is read. It is updated as fields are read and used in the * decode process. diff --git a/libdex/DexFile.c b/libdex/DexFile.c index b139746e0..2fc1768ce 100644 --- a/libdex/DexFile.c +++ b/libdex/DexFile.c @@ -90,7 +90,7 @@ bool dexIsValidMemberNameUtf8_0(const char** pUtf8Ptr) { * character (U+00a0, U+2000..U+200f, U+2028..U+202f, * U+fff0..U+ffff). */ - + u2 utf16 = dexGetUtf16FromUtf8(pUtf8Ptr); // Perform follow-up tests based on the high 8 bits. @@ -139,7 +139,7 @@ bool dexIsValidMemberNameUtf8_0(const char** pUtf8Ptr) { /* Return whether the given string is a valid field or method name. */ bool dexIsValidMemberName(const char* s) { bool angleName = false; - + switch (*s) { case '\0': { // The empty string is not a valid name. @@ -184,9 +184,9 @@ bool dexIsValidTypeDescriptor(const char* s) { // Arrays may have no more than 255 dimensions. return false; } - + switch (*(s++)) { - case 'B': + case 'B': case 'C': case 'D': case 'F': @@ -443,7 +443,7 @@ DexClassLookup* dexCreateClassLookup(DexFile* pDexFile) pClassDef = dexGetClassDef(pDexFile, i); pString = dexStringByTypeIdx(pDexFile, pClassDef->classIdx); - classLookupAdd(pDexFile, pLookup, + classLookupAdd(pDexFile, pLookup, (u1*)pString - pDexFile->baseAddr, (u1*)pClassDef - pDexFile->baseAddr, &numProbes); @@ -877,7 +877,7 @@ const DexClassDef* dexFindClass(const DexFile* pDexFile, if (pLookup->table[idx].classDescriptorHash == hash) { const char* str; - + str = (const char*) (pDexFile->baseAddr + offset); if (strcmp(str, descriptor) == 0) { return (const DexClassDef*) @@ -1017,7 +1017,7 @@ static int typeLength (const char *type) { * Reads a string index as encoded for the debug info format, * returning a string pointer or NULL as appropriate. */ -static const char* readStringIdx(const DexFile* pDexFile, +static const char* readStringIdx(const DexFile* pDexFile, const u1** pStream) { u4 stringIdx = readUnsignedLeb128(pStream); @@ -1033,7 +1033,7 @@ static const char* readStringIdx(const DexFile* pDexFile, * Reads a type index as encoded for the debug info format, returning * a string pointer for its descriptor or NULL as appropriate. */ -static const char* readTypeIdx(const DexFile* pDexFile, +static const char* readTypeIdx(const DexFile* pDexFile, const u1** pStream) { u4 typeIdx = readUnsignedLeb128(pStream); @@ -1056,14 +1056,14 @@ typedef struct LocalInfo { bool live; } LocalInfo; -static void emitLocalCbIfLive (void *cnxt, int reg, u4 endAddress, +static void emitLocalCbIfLive (void *cnxt, int reg, u4 endAddress, LocalInfo *localInReg, DexDebugNewLocalCb localCb) { if (localCb != NULL && localInReg[reg].live) { localCb(cnxt, reg, localInReg[reg].startAddress, endAddress, - localInReg[reg].name, - localInReg[reg].descriptor, - localInReg[reg].signature == NULL + localInReg[reg].name, + localInReg[reg].descriptor, + localInReg[reg].signature == NULL ? "" : localInReg[reg].signature ); } } @@ -1113,7 +1113,7 @@ void dexDecodeDebugInfo( } else { assert(pCode->insSize == dexProtoComputeArgsSize(&proto)); } - + DexParameterIterator iterator; dexParameterIteratorInit(&iterator, &proto); @@ -1121,7 +1121,7 @@ void dexDecodeDebugInfo( const char* descriptor = dexParameterIteratorNextDescriptor(&iterator); const char *name; int reg; - + if ((argReg >= pCode->registersSize) || (descriptor == NULL)) { goto invalid_stream; } @@ -1159,7 +1159,7 @@ void dexDecodeDebugInfo( case DBG_ADVANCE_PC: address += readUnsignedLeb128(&stream); break; - + case DBG_ADVANCE_LINE: line += readSignedLeb128(&stream); break; @@ -1170,13 +1170,13 @@ void dexDecodeDebugInfo( if (reg > pCode->registersSize) goto invalid_stream; // Emit what was previously there, if anything - emitLocalCbIfLive (cnxt, reg, address, + emitLocalCbIfLive (cnxt, reg, address, localInReg, localCb); localInReg[reg].name = readStringIdx(pDexFile, &stream); localInReg[reg].descriptor = readTypeIdx(pDexFile, &stream); if (opcode == DBG_START_LOCAL_EXTENDED) { - localInReg[reg].signature + localInReg[reg].signature = readStringIdx(pDexFile, &stream); } else { localInReg[reg].signature = NULL; @@ -1197,7 +1197,7 @@ void dexDecodeDebugInfo( reg = readUnsignedLeb128(&stream); if (reg > pCode->registersSize) goto invalid_stream; - if (localInReg[reg].name == NULL + if (localInReg[reg].name == NULL || localInReg[reg].descriptor == NULL) { goto invalid_stream; } @@ -1224,7 +1224,7 @@ void dexDecodeDebugInfo( line += DBG_LINE_BASE + (adjopcode % DBG_LINE_RANGE); if (posCb != NULL) { - int done; + int done; done = posCb(cnxt, address, line); if (done) { diff --git a/libdex/DexFile.h b/libdex/DexFile.h index 29f34c010..2ce7ebd68 100644 --- a/libdex/DexFile.h +++ b/libdex/DexFile.h @@ -70,7 +70,7 @@ enum { /* * access flags and masks; the "standard" ones are all <= 0x4000 - * + * * Note: There are related declarations in vm/oo/Object.h in the ClassFlags * enum. */ @@ -96,7 +96,7 @@ enum { ACC_CONSTRUCTOR = 0x00010000, // method (Dalvik only) ACC_DECLARED_SYNCHRONIZED = 0x00020000, // method (Dalvik only) - ACC_CLASS_MASK = + ACC_CLASS_MASK = (ACC_PUBLIC | ACC_FINAL | ACC_INTERFACE | ACC_ABSTRACT | ACC_SYNTHETIC | ACC_ANNOTATION | ACC_ENUM), ACC_INNER_CLASS_MASK = @@ -758,7 +758,7 @@ DEX_INLINE const DexTry* dexGetTries(const DexCode* pCode) { if ((((u4) insnsEnd) & 3) != 0) { insnsEnd++; } - + return (const DexTry*) insnsEnd; } @@ -795,7 +795,7 @@ typedef void (*DexDebugNewLocalCb)(void *cnxt, u2 reg, u4 startAddress, /* * Decode debug info for method. - * + * * posCb is called in ascending address order. * localCb is called in order of ascending end address. */ diff --git a/libdex/DexProto.c b/libdex/DexProto.c index c8f1b3edb..28cad6e3a 100644 --- a/libdex/DexProto.c +++ b/libdex/DexProto.c @@ -112,7 +112,7 @@ char* dexStringCacheAbandon(DexStringCache* pCache, const char* value) { * =========================================================================== * Method Prototypes * =========================================================================== - */ + */ /* * Return the DexProtoId from the given DexProto. The DexProto must @@ -150,7 +150,7 @@ const char* dexProtoGetMethodDescriptor(const DexProto* pProto, } length += strlen(dexStringByTypeIdx(dexFile, protoId->returnTypeIdx)); - + dexStringCacheAlloc(pCache, length); char *at = (char*) pCache->value; @@ -201,7 +201,7 @@ const char* dexProtoGetParameterDescriptors(const DexProto* pProto, length += strlen(descriptor); } - + dexParameterIteratorInit(&iterator, pProto); dexStringCacheAlloc(pCache, length); @@ -299,7 +299,7 @@ static int protoCompare(const DexProto* pProto1, const DexProto* pProto2, // Compare return types. if (compareReturnType) { - int result = + int result = strcmp(dexStringByTypeIdx(dexFile1, protoId1->returnTypeIdx), dexStringByTypeIdx(dexFile2, protoId2->returnTypeIdx)); @@ -309,14 +309,14 @@ static int protoCompare(const DexProto* pProto1, const DexProto* pProto2, } // Compare parameters. - + int minParam = (paramCount1 > paramCount2) ? paramCount2 : paramCount1; int i; for (i = 0; i < minParam; i++) { u4 idx1 = dexTypeListGetIdx(typeList1, i); u4 idx2 = dexTypeListGetIdx(typeList2, i); - int result = + int result = strcmp(dexStringByTypeIdx(dexFile1, idx1), dexStringByTypeIdx(dexFile2, idx2)); @@ -368,7 +368,7 @@ static const char* methodDescriptorReturnType(const char* descriptor) { if (result == NULL) { return NULL; } - + // The return type is the character just past the ')'. return result + 1; } @@ -385,7 +385,7 @@ static const char* methodDescriptorNextType(const char* descriptor) { while (*descriptor == '[') { descriptor++; } - + switch (*descriptor) { case 'B': case 'C': case 'D': case 'F': case 'I': case 'J': case 'S': case 'Z': { @@ -412,7 +412,7 @@ int dexProtoCompareToDescriptor(const DexProto* proto, const char* descriptor) { // First compare the return types. - int result = strcmp(dexProtoGetReturnType(proto), + int result = strcmp(dexProtoGetReturnType(proto), methodDescriptorReturnType(descriptor)); if (result != 0) { @@ -427,7 +427,7 @@ int dexProtoCompareToDescriptor(const DexProto* proto, // Skip the '('. assert (*descriptor == '('); descriptor++; - + for (;;) { const char* protoDesc = dexParameterIteratorNextDescriptor(&iterator); @@ -451,7 +451,7 @@ int dexProtoCompareToDescriptor(const DexProto* proto, } // Both prototype and descriptor have arguments. Compare them. - + const char* nextDesc = methodDescriptorNextType(descriptor); for (;;) { @@ -469,7 +469,7 @@ int dexProtoCompareToDescriptor(const DexProto* proto, break; } } - + /* * If we made it here, the two arguments matched, and * descriptor == nextDesc. @@ -482,7 +482,7 @@ int dexProtoCompareToDescriptor(const DexProto* proto, * =========================================================================== * Parameter Iterators * =========================================================================== - */ + */ /* * Initialize the given DexParameterIterator to be at the start of the diff --git a/libdex/InstrUtils.c b/libdex/InstrUtils.c index 8961ce53c..bab77ce3d 100644 --- a/libdex/InstrUtils.c +++ b/libdex/InstrUtils.c @@ -1069,7 +1069,7 @@ void dexDecodeInstruction(const InstructionFormat* fmts, const u2* insns, pDec->vB = INST_B(inst); break; case kFmt11n: // op vA, #+B - pDec->vA = INST_A(inst); + pDec->vA = INST_A(inst); pDec->vB = (s4) (INST_B(inst) << 28) >> 28; // sign extend 4-bit value break; case kFmt11x: // op vAA diff --git a/libdex/InstrUtils.h b/libdex/InstrUtils.h index 60244a8d3..b41df4963 100644 --- a/libdex/InstrUtils.h +++ b/libdex/InstrUtils.h @@ -29,7 +29,7 @@ * (This defines InstructionFormat as an unsigned char to reduce the size * of the table. This isn't necessary with some compilers, which use an * integer width appropriate for the number of enum values.) - * + * * If you add or delete a format, you have to change some or all of: * - this enum * - the switch inside dexDecodeInstruction() in InstrUtils.c diff --git a/libdex/OpCode.h b/libdex/OpCode.h index 4dfd0471c..f0bc423b4 100644 --- a/libdex/OpCode.h +++ b/libdex/OpCode.h @@ -45,16 +45,16 @@ * and running int:fast as above * - repeat for other platforms (x86, ...) * (see notes in mterp/ReadMe.txt for rebuilding instructions) - * + * * Verifier / optimizer: * - update some stuff in analysis/DexOptimize.c, analysis/DexVerify.c, * and/or analysis/CodeVerify.c as needed * - verify by running with verifier enabled (it's on by default) - * + * * Tools: * - update the OpCodeNames table in dexdump/OpCodeNames.c * - update dexdump/DexDump.c if an instruction format has changed - * + * * Note: The Dalvik VM tests (in the tests subdirectory) provide a convenient * way to test most of the above without doing any rebuilds. In particular, * test 003-omnibus-opcodes will exercise most of the opcodes. @@ -108,18 +108,18 @@ typedef enum OpCode { OP_NEW_INSTANCE = 0x22, OP_NEW_ARRAY = 0x23, - + OP_FILLED_NEW_ARRAY = 0x24, OP_FILLED_NEW_ARRAY_RANGE = 0x25, OP_FILL_ARRAY_DATA = 0x26, - + OP_THROW = 0x27, OP_GOTO = 0x28, OP_GOTO_16 = 0x29, OP_GOTO_32 = 0x2a, OP_PACKED_SWITCH = 0x2b, OP_SPARSE_SWITCH = 0x2c, - + OP_CMPL_FLOAT = 0x2d, OP_CMPG_FLOAT = 0x2e, OP_CMPL_DOUBLE = 0x2f, @@ -145,7 +145,7 @@ typedef enum OpCode { OP_UNUSED_41 = 0x41, OP_UNUSED_42 = 0x42, OP_UNUSED_43 = 0x43, - + OP_AGET = 0x44, OP_AGET_WIDE = 0x45, OP_AGET_OBJECT = 0x46, @@ -198,7 +198,7 @@ typedef enum OpCode { OP_INVOKE_INTERFACE = 0x72, OP_UNUSED_73 = 0x73, - + OP_INVOKE_VIRTUAL_RANGE = 0x74, OP_INVOKE_SUPER_RANGE = 0x75, OP_INVOKE_DIRECT_RANGE = 0x76, diff --git a/libdex/ZipArchive.c b/libdex/ZipArchive.c index 65bc6e964..62a8ef1a8 100644 --- a/libdex/ZipArchive.c +++ b/libdex/ZipArchive.c @@ -120,7 +120,7 @@ static void addToHash(ZipArchive* pArchive, const char* str, int strLen, */ static u2 get2LE(unsigned char const* pSrc) { - return pSrc[0] | (pSrc[1] << 8); + return pSrc[0] | (pSrc[1] << 8); } /* diff --git a/libdex/sha1.c b/libdex/sha1.c index 62892488a..dc7e30ae7 100644 --- a/libdex/sha1.c +++ b/libdex/sha1.c @@ -16,7 +16,7 @@ By Steve Reid <steve@edmweb.com> 100% Public Domain ----------------- -Modified 7/98 +Modified 7/98 By James H. Brown <jbrown@burgoyne.com> Still 100% Public Domain diff --git a/libnativehelper/include/nativehelper/JNIHelp.h b/libnativehelper/include/nativehelper/JNIHelp.h index 585d1c74b..1c9f93348 100644 --- a/libnativehelper/include/nativehelper/JNIHelp.h +++ b/libnativehelper/include/nativehelper/JNIHelp.h @@ -81,7 +81,7 @@ const char* jniStrError(int errnum, char* buf, size_t buflen); */ jobject jniCreateFileDescriptor(C_JNIEnv* env, int fd); -/* +/* * Get an int file descriptor from a java.io.FileDescriptor */ int jniGetFDFromFileDescriptor(C_JNIEnv* env, jobject fileDescriptor); diff --git a/libnativehelper/include/nativehelper/jni.h b/libnativehelper/include/nativehelper/jni.h index ad954c8f6..93349e095 100644 --- a/libnativehelper/include/nativehelper/jni.h +++ b/libnativehelper/include/nativehelper/jni.h @@ -124,10 +124,10 @@ typedef enum jobjectRefType { JNIWeakGlobalRefType = 3 } jobjectRefType; -typedef struct { - const char* name; - const char* signature; - void* fnPtr; +typedef struct { + const char* name; + const char* signature; + void* fnPtr; } JNINativeMethod; struct _JNIEnv; @@ -1037,7 +1037,7 @@ struct JNIInvokeInterface { void* reserved0; void* reserved1; void* reserved2; - + jint (*DestroyJavaVM)(JavaVM*); jint (*AttachCurrentThread)(JavaVM*, JNIEnv**, void*); jint (*DetachCurrentThread)(JavaVM*); diff --git a/run-core-tests.sh b/run-core-tests.sh index 7815c7ce1..3b11469ef 100755 --- a/run-core-tests.sh +++ b/run-core-tests.sh @@ -66,7 +66,7 @@ done # (1) The IO tests create lots of files in the current directory, so we change # to /tmp first. # (2) Some of the core tests need a hell of a lot of memory, so we use a -# large value for both heap and stack. +# large value for both heap and stack. rm -rf ${datadir}/xml_source mkdir -p ${datadir}/xml_source diff --git a/tests/002-sleep/src/Main.java b/tests/002-sleep/src/Main.java index 450be2fae..c1a2d83c5 100644 --- a/tests/002-sleep/src/Main.java +++ b/tests/002-sleep/src/Main.java @@ -5,7 +5,7 @@ public class Main { if (args.length != 0) { millis = Integer.parseInt(args[0]); } - + System.out.println("Sleeping " + millis + " msec..."); long start = System.currentTimeMillis(); diff --git a/tests/003-omnibus-opcodes/src/Main.java b/tests/003-omnibus-opcodes/src/Main.java index 271d7956a..fb39d76d7 100644 --- a/tests/003-omnibus-opcodes/src/Main.java +++ b/tests/003-omnibus-opcodes/src/Main.java @@ -68,7 +68,7 @@ public class Main { } catch (VerifyError ve) { System.out.println("Caught (retry): " + ve); } - + try { UnresTest2.run(); } catch (VerifyError ve) { diff --git a/tests/004-annotations/src/android/test/anno/TestAnnotations.java b/tests/004-annotations/src/android/test/anno/TestAnnotations.java index 98fb0ef56..180944649 100644 --- a/tests/004-annotations/src/android/test/anno/TestAnnotations.java +++ b/tests/004-annotations/src/android/test/anno/TestAnnotations.java @@ -14,7 +14,7 @@ public class TestAnnotations { static private void printAnnotationArray(String prefix, Annotation[] arr) { TreeMap<String, Annotation> sorted = new TreeMap<String, Annotation>(); - + for (Annotation a : arr) { sorted.put(a.annotationType().getName(), a); } @@ -24,7 +24,7 @@ public class TestAnnotations { System.out.println(prefix + " " + a.annotationType()); } } - + static void printAnnotations(Class clazz) { Annotation[] annos; Annotation[][] parAnnos; @@ -120,7 +120,7 @@ public class TestAnnotations { Method meth; ExportedProperty property; final IntToString[] mapping; - + try { meth = TestAnnotations.class.getMethod("getFocusType", (Class[])null); diff --git a/tests/021-string2/src/junit/framework/Assert.java b/tests/021-string2/src/junit/framework/Assert.java index c1bc7b2cd..364e646ff 100644 --- a/tests/021-string2/src/junit/framework/Assert.java +++ b/tests/021-string2/src/junit/framework/Assert.java @@ -71,7 +71,7 @@ public class Assert { assertEquals(null, expected, actual); } /** - * Asserts that two Strings are equal. + * Asserts that two Strings are equal. */ static public void assertEquals(String message, String expected, String actual) { if (expected == null && actual == null) @@ -81,7 +81,7 @@ public class Assert { throw new ComparisonFailure(message, expected, actual); } /** - * Asserts that two Strings are equal. + * Asserts that two Strings are equal. */ static public void assertEquals(String expected, String actual) { assertEquals(null, expected, actual); diff --git a/tests/021-string2/src/junit/framework/ComparisonFailure.java b/tests/021-string2/src/junit/framework/ComparisonFailure.java index a0ad17611..0cb2cee91 100644 --- a/tests/021-string2/src/junit/framework/ComparisonFailure.java +++ b/tests/021-string2/src/junit/framework/ComparisonFailure.java @@ -2,7 +2,7 @@ package junit.framework; /** * Thrown when an assert equals for Strings failed. - * + * * Inspired by a patch from Alex Chaffee mailto:alex@purpletech.com */ public class ComparisonFailure extends AssertionFailedError { @@ -20,19 +20,19 @@ public class ComparisonFailure extends AssertionFailedError { fExpected= expected; fActual= actual; } - + /** * Returns "..." in place of common prefix and "..." in * place of common suffix between expected and actual. - * + * * @see java.lang.Throwable#getMessage() */ public String getMessage() { if (fExpected == null || fActual == null) return Assert.format(super.getMessage(), fExpected, fActual); - + int end= Math.min(fExpected.length(), fActual.length()); - + int i= 0; for(; i < end; i++) { if (fExpected.charAt(i) != fActual.charAt(i)) @@ -45,7 +45,7 @@ public class ComparisonFailure extends AssertionFailedError { break; } String actual, expected; - + // equal strings if (j < i && k < i) { expected= fExpected; @@ -57,12 +57,12 @@ public class ComparisonFailure extends AssertionFailedError { expected= "..."+expected; actual= "..."+actual; } - + if (j < fExpected.length()-1) expected= expected+"..."; if (k < fActual.length()-1) actual= actual+"..."; - } + } return Assert.format(super.getMessage(), expected, actual); } } diff --git a/tests/023-many-interfaces/src/ManyInterfaces.java b/tests/023-many-interfaces/src/ManyInterfaces.java index 3c67f1fcd..f860f6729 100644 --- a/tests/023-many-interfaces/src/ManyInterfaces.java +++ b/tests/023-many-interfaces/src/ManyInterfaces.java @@ -152,7 +152,7 @@ public class ManyInterfaces { /** whether to report timing information */ private static boolean timing = false; - + /** * Report on a section. */ @@ -168,7 +168,7 @@ public class ManyInterfaces /** * Run tests. - * + * * @param timing whether to print out timing info */ public static void run(boolean timing) { @@ -233,7 +233,7 @@ public class ManyInterfaces end = System.nanoTime(); report("testInst099", start, end, iter, rept); } - + public int func001() { return 1; } public int func003() { return 3; } public int func005() { return 5; } diff --git a/tests/028-array-write/src/Main.java b/tests/028-array-write/src/Main.java index c9181f1e9..40d9a9ddc 100644 --- a/tests/028-array-write/src/Main.java +++ b/tests/028-array-write/src/Main.java @@ -6,7 +6,7 @@ public class Main { /** whether to report times */ static boolean timing = false; - + static final int STORAGE_SIZE = 128*1024; static int[] mStorage = new int[STORAGE_SIZE]; @@ -60,7 +60,7 @@ public class Main { if ((args.length >= 1) && args[0].equals("--timing")) { timing = true; } - + writeTest(); copyTest(); System.out.println("Done!"); diff --git a/tests/030-bad-finalizer/run b/tests/030-bad-finalizer/run index 6e029466c..8e03cd3f1 100644 --- a/tests/030-bad-finalizer/run +++ b/tests/030-bad-finalizer/run @@ -17,11 +17,11 @@ ${RUN} "$@" > original-output.txt cat original-output.txt | awk ' -/Segmentation fault/ { +/Segmentation fault/ { # ignore the details of the line print "(segfault)" next; } -{ +{ print; }' diff --git a/tests/030-bad-finalizer/src/Main.java b/tests/030-bad-finalizer/src/Main.java index 542020ec5..ef9fc8b9c 100644 --- a/tests/030-bad-finalizer/src/Main.java +++ b/tests/030-bad-finalizer/src/Main.java @@ -18,7 +18,7 @@ public class Main { System.out.println("Requesting another GC."); System.gc(); } - + System.out.println("Done waiting."); System.exit(0); } diff --git a/tests/031-class-attributes/src/ClassAttrs.java b/tests/031-class-attributes/src/ClassAttrs.java index 35bd5506d..c1407bdcf 100644 --- a/tests/031-class-attributes/src/ClassAttrs.java +++ b/tests/031-class-attributes/src/ClassAttrs.java @@ -53,7 +53,7 @@ public class ClassAttrs { meth = MemberClass.class.getMethod("foo", (Class[]) null); System.out.println("method signature: " + getSignatureAttribute(meth)); - + Field field; field = MemberClass.class.getField("mWha"); System.out.println("field signature: " diff --git a/tests/032-concrete-sub/src/ConcreteSub.java b/tests/032-concrete-sub/src/ConcreteSub.java index fbaeb1b10..8f78cc9f4 100644 --- a/tests/032-concrete-sub/src/ConcreteSub.java +++ b/tests/032-concrete-sub/src/ConcreteSub.java @@ -24,7 +24,7 @@ public class ConcreteSub extends AbstractBase { System.out.println("calling abs.doStuff()"); abs.doStuff(); } - + public static void main() { ConcreteSub sub = new ConcreteSub(); diff --git a/tests/033-class-init-deadlock/src/Main.java b/tests/033-class-init-deadlock/src/Main.java index df13c2659..8ff922ecf 100644 --- a/tests/033-class-init-deadlock/src/Main.java +++ b/tests/033-class-init-deadlock/src/Main.java @@ -11,15 +11,15 @@ public class Main { static public void main(String[] args) { Thread thread1, thread2; - + System.out.println("Deadlock test starting."); thread1 = new Thread() { public void run() { new A(); } }; thread2 = new Thread() { public void run() { new B(); } }; thread1.start(); thread2.start(); - + try { Thread.sleep(6000); } catch (InterruptedException ie) { } - + System.out.println("Deadlock test interupting threads."); thread1.interrupt(); thread2.interrupt(); diff --git a/tests/036-finalizer/src/Main.java b/tests/036-finalizer/src/Main.java index a8623f859..0a42b898b 100644 --- a/tests/036-finalizer/src/Main.java +++ b/tests/036-finalizer/src/Main.java @@ -40,7 +40,7 @@ public class Main { } catch (InterruptedException ie) { throw new RuntimeException(ie); } - + return wimp[0]; } @@ -80,7 +80,7 @@ public class Main { /* this will try to collect and finalize ft */ System.out.println("gc"); System.gc(); - + System.out.println("wimp: " + wimpString(wimp)); System.out.println("finalize"); System.runFinalization(); diff --git a/tests/039-join-main/src/Main.java b/tests/039-join-main/src/Main.java index 8d66b5859..e3e2d3e76 100644 --- a/tests/039-join-main/src/Main.java +++ b/tests/039-join-main/src/Main.java @@ -6,7 +6,7 @@ public class Main { public static void main(String[] args) { Thread t; - + t = new Thread(new JoinMainSub(Thread.currentThread()), "Joiner"); System.out.print("Starting thread '" + t.getName() + "'\n"); t.start(); diff --git a/tests/050-sync-test/src/Main.java b/tests/050-sync-test/src/Main.java index 620e899ea..63477065f 100644 --- a/tests/050-sync-test/src/Main.java +++ b/tests/050-sync-test/src/Main.java @@ -42,7 +42,7 @@ public class Main { try { Thread.sleep(100); - } + } catch (InterruptedException ie) { System.out.println("INTERRUPT!"); ie.printStackTrace(); @@ -153,7 +153,7 @@ class SleepyThread extends Thread { } catch (InterruptedException ie) { // Expecting this; interrupted should be false. - System.out.println(Thread.currentThread().getName() + + System.out.println(Thread.currentThread().getName() + " interrupted, flag=" + Thread.interrupted()); intr = true; } diff --git a/tests/051-thread/src/Main.java b/tests/051-thread/src/Main.java index ff1b1813c..7873596ed 100644 --- a/tests/051-thread/src/Main.java +++ b/tests/051-thread/src/Main.java @@ -32,7 +32,7 @@ public class Main { } catch (InterruptedException ex) { ex.printStackTrace(); } - + System.out.print("Thread starter returning\n"); } diff --git a/tests/053-wait-some/src/Main.java b/tests/053-wait-some/src/Main.java index 468f9f0f1..7f703c77a 100644 --- a/tests/053-wait-some/src/Main.java +++ b/tests/053-wait-some/src/Main.java @@ -13,7 +13,7 @@ public class Main { boolean timing = (args.length >= 1) && args[0].equals("--timing"); doit(timing); } - + public static void doit(boolean timing) { Object sleepy = new Object(); long start, end; @@ -47,10 +47,10 @@ public class Main { if (epsilon > 50) { epsilon = 50; } - + long min = delay - epsilon; long max = delay + epsilon; - + if (elapsed < min) { System.out.println(" Elapsed time was too short"); showTime = true; @@ -60,7 +60,7 @@ public class Main { showTime = true; } } - + if (showTime) { System.out.println(" Wall clock elapsed " + elapsed + "ms"); diff --git a/tests/054-uncaught/src/Main.java b/tests/054-uncaught/src/Main.java index 68e9b42bf..4ee6b050a 100644 --- a/tests/054-uncaught/src/Main.java +++ b/tests/054-uncaught/src/Main.java @@ -8,7 +8,7 @@ public class Main { testThread(1); testThread(2); testThread(3); - + catchTheUncaught(1); } @@ -22,7 +22,7 @@ public class Main { ex.printStackTrace(); } } - + static void catchTheUncaught(int which) { ThreadDeathHandler defHandler = new ThreadDeathHandler("DEFAULT"); ThreadDeathHandler threadHandler = new ThreadDeathHandler("THREAD"); @@ -55,7 +55,7 @@ public class Main { public Helper(int which) { this.which = which; } - + public void run() { catchTheUncaught(which); } diff --git a/tests/055-enum-performance/src/Main.java b/tests/055-enum-performance/src/Main.java index a576d3a34..64d03ebad 100644 --- a/tests/055-enum-performance/src/Main.java +++ b/tests/055-enum-performance/src/Main.java @@ -3,7 +3,7 @@ import otherpackage.OtherPackagePublicEnum; public class Main { /** used by {@link #basisCall} */ static private int basisTestValue = 12; - + static public void main(String[] args) throws Exception { boolean timing = (args.length >= 1) && args[0].equals("--timing"); run(timing); @@ -11,7 +11,7 @@ public class Main { static public void run(boolean timing) { preTest(); - + long time0 = System.nanoTime(); int count1 = test1(500); long time1 = System.nanoTime(); @@ -105,7 +105,7 @@ public class Main { static public int basisCall(int i, String name) { int compare = name.compareTo("fuzzbot"); - + if (i < (basisTestValue * compare)) { return basisTestValue; } else { diff --git a/tests/057-iteration-performance/src/Main.java b/tests/057-iteration-performance/src/Main.java index defbd7576..d56280269 100644 --- a/tests/057-iteration-performance/src/Main.java +++ b/tests/057-iteration-performance/src/Main.java @@ -19,7 +19,7 @@ import java.util.ArrayList; /** * The matrix of tests includes the A-E axis for loop body contents and * the 0-5 axis for iterator style. - * + * * <ul> * <li>A: empty body</li> * <li>B: array element access and update</li> @@ -30,7 +30,7 @@ import java.util.ArrayList; * <li>G: one small object allocation (empty constructor)</li> * <li>H: copy 8k of bytes from one array to another</li> * </ul> - * + * * <ul> * <li>0: for() loop backward to 0</li> * <li>1: for() loop forward to local variable</li> @@ -44,7 +44,7 @@ import java.util.ArrayList; public class Main { static public final int BODIES = 8; static public final int LOOPS = 7; - + static public void main(String[] args) throws Exception { boolean timing = (args.length >= 1) && args[0].equals("--timing"); @@ -70,14 +70,14 @@ public class Main { if (timing) { System.out.println("iters = " + iters); } - + run(timing, iters); } static private enum Normalization { NONE, PER_COLUMN, TOP_LEFT; } - + static public void printTimings(double[][] timings, Normalization norm) { System.out.println(); System.out.printf("%-7s A B C D E" + @@ -124,7 +124,7 @@ public class Main { } else { combineTimings(timings, newTimings, i); } - + if (checkTimes(timings, timing)) { break; } @@ -137,7 +137,7 @@ public class Main { if (! goodTimes) { timing = true; } - + if (timing) { printTimings(timings, Normalization.NONE); printTimings(timings, Normalization.TOP_LEFT); @@ -151,13 +151,13 @@ public class Main { int oldWeight) { for (int i = 0; i < target.length; i++) { for (int j = 0; j < target[i].length; j++) { - target[i][j] = + target[i][j] = ((target[i][j] * oldWeight) + newTimes[i][j]) / (oldWeight + 1); } } } - + static public boolean checkTimes(double[][] timings, boolean print) { // expected increase over A1 double[][] expected = { @@ -167,11 +167,11 @@ public class Main { { 1.6, 2.8, 2.9, 3.6, 6.8, 12.6, 63.5, 97.0 }, { 1.7, 3.0, 2.9, 3.7, 6.9, 12.8, 64.0, 98.0 }, { 6.0, 6.0, 6.0, 7.0, 10.0, 15.0, 64.5, 105.0 }, - { 31.0, 31.2, 31.5, 34.0, 41.0, 43.0, 91.0, 135.0 }, + { 31.0, 31.2, 31.5, 34.0, 41.0, 43.0, 91.0, 135.0 }, }; boolean good = true; - + for (int x = 0; x < BODIES; x++) { for (int y = 0; y < LOOPS; y++) { double ratio = timings[x][y] / timings[0][0]; @@ -187,7 +187,7 @@ public class Main { return good; } - + static public double[][] runAllTests(int iters, boolean print) { // diters is used to get usec, not nanosec; hence the extra 1000. double diters = (double) iters * INNER_COUNT * 1000; @@ -200,7 +200,7 @@ public class Main { if (print) { System.out.println("Running A..."); } - + t0 = System.nanoTime(); testA0(iters); t1 = System.nanoTime(); @@ -226,11 +226,11 @@ public class Main { timings[0][6] = (t7 - t6) / diters; // Column B - + if (print) { System.out.println("Running B..."); } - + t0 = System.nanoTime(); testB0(iters); t1 = System.nanoTime(); @@ -256,11 +256,11 @@ public class Main { timings[1][6] = (t7 - t6) / diters; // Column C - + if (print) { System.out.println("Running C..."); } - + t0 = System.nanoTime(); testC0(iters); t1 = System.nanoTime(); @@ -284,9 +284,9 @@ public class Main { timings[2][4] = (t5 - t4) / diters; timings[2][5] = (t6 - t5) / diters; timings[2][6] = (t7 - t6) / diters; - + // Column D - + if (print) { System.out.println("Running D..."); } @@ -314,9 +314,9 @@ public class Main { timings[3][4] = (t5 - t4) / diters; timings[3][5] = (t6 - t5) / diters; timings[3][6] = (t7 - t6) / diters; - + // Column E - + if (print) { System.out.println("Running E..."); } @@ -344,9 +344,9 @@ public class Main { timings[4][4] = (t5 - t4) / diters; timings[4][5] = (t6 - t5) / diters; timings[4][6] = (t7 - t6) / diters; - + // Column F - + if (print) { System.out.println("Running F..."); } @@ -379,9 +379,9 @@ public class Main { iters /= 5; diters /= 5; - + // Column G - + if (print) { System.out.println("Running G..."); } @@ -409,9 +409,9 @@ public class Main { timings[6][4] = (t5 - t4) / diters; timings[6][5] = (t6 - t5) / diters; timings[6][6] = (t7 - t6) / diters; - + // Column H - + if (print) { System.out.println("Running H..."); } @@ -472,9 +472,9 @@ public class Main { return size; } } - + // The tests themselves - + static public void testA0(int iters) { for (int outer = iters; outer > 0; outer--) { for (int i = INNER_COUNT; i > 0; i--) { @@ -495,7 +495,7 @@ public class Main { static public void testA2(int iters) { int[] array = INNER_ARRAY; - + for (int outer = iters; outer > 0; outer--) { for (int i = 0; i < array.length; i++) { // empty @@ -505,7 +505,7 @@ public class Main { static public void testA3(int iters) { int[] array = INNER_ARRAY; - + for (int outer = iters; outer > 0; outer--) { for (int i : array) { // empty @@ -515,7 +515,7 @@ public class Main { static public void testA4(int iters) { Target target = TARGET; - + for (int outer = iters; outer > 0; outer--) { for (int i = 0; i < target.size; i++) { // empty @@ -525,7 +525,7 @@ public class Main { static public void testA5(int iters) { Target target = TARGET; - + for (int outer = iters; outer > 0; outer--) { for (int i = 0; i < target.size(); i++) { // empty @@ -535,7 +535,7 @@ public class Main { static public void testA6(int iters) { ArrayList<Object> list = INNER_LIST; - + for (int outer = iters; outer > 0; outer--) { for (Object o : list) { // empty @@ -545,7 +545,7 @@ public class Main { static public void testB0(int iters) { Target target = TARGET; - + for (int outer = iters; outer > 0; outer--) { for (int i = INNER_COUNT; i > 0; i--) { target.value++; @@ -567,7 +567,7 @@ public class Main { static public void testB2(int iters) { Target target = TARGET; int[] array = INNER_ARRAY; - + for (int outer = iters; outer > 0; outer--) { for (int i = 0; i < array.length; i++) { target.value++; @@ -578,7 +578,7 @@ public class Main { static public void testB3(int iters) { Target target = TARGET; int[] array = INNER_ARRAY; - + for (int outer = iters; outer > 0; outer--) { for (int i : array) { target.value++; @@ -588,7 +588,7 @@ public class Main { static public void testB4(int iters) { Target target = TARGET; - + for (int outer = iters; outer > 0; outer--) { for (int i = 0; i < target.size; i++) { target.value++; @@ -598,7 +598,7 @@ public class Main { static public void testB5(int iters) { Target target = TARGET; - + for (int outer = iters; outer > 0; outer--) { for (int i = 0; i < target.size(); i++) { target.value++; @@ -609,7 +609,7 @@ public class Main { static public void testB6(int iters) { Target target = TARGET; ArrayList<Object> list = INNER_LIST; - + for (int outer = iters; outer > 0; outer--) { for (Object o : list) { target.value++; @@ -640,7 +640,7 @@ public class Main { static public void testC2(int iters) { int[] array = INNER_ARRAY; - + for (int outer = iters; outer > 0; outer--) { for (int i = 0; i < array.length; i++) { array[i]++; @@ -650,7 +650,7 @@ public class Main { static public void testC3(int iters) { int[] array = INNER_ARRAY; - + for (int outer = iters; outer > 0; outer--) { for (int i : array) { array[0] = i + 1; @@ -661,7 +661,7 @@ public class Main { static public void testC4(int iters) { Target target = TARGET; int[] array = INNER_ARRAY; - + for (int outer = iters; outer > 0; outer--) { for (int i = 0; i < target.size; i++) { array[i]++; @@ -672,7 +672,7 @@ public class Main { static public void testC5(int iters) { int[] array = INNER_ARRAY; Target target = TARGET; - + for (int outer = iters; outer > 0; outer--) { for (int i = 0; i < target.size(); i++) { array[i]++; @@ -683,7 +683,7 @@ public class Main { static public void testC6(int iters) { int[] array = INNER_ARRAY; ArrayList<Object> list = INNER_LIST; - + for (int outer = iters; outer > 0; outer--) { for (Object o : list) { array[0]++; @@ -715,7 +715,7 @@ public class Main { static public void testD2(int iters) { Target target = TARGET; int[] array = INNER_ARRAY; - + for (int outer = iters; outer > 0; outer--) { for (int i = 0; i < array.length; i++) { target.simple(); @@ -726,7 +726,7 @@ public class Main { static public void testD3(int iters) { Target target = TARGET; int[] array = INNER_ARRAY; - + for (int outer = iters; outer > 0; outer--) { for (int i : array) { target.simple(); @@ -736,7 +736,7 @@ public class Main { static public void testD4(int iters) { Target target = TARGET; - + for (int outer = iters; outer > 0; outer--) { for (int i = 0; i < target.size; i++) { target.simple(); @@ -746,7 +746,7 @@ public class Main { static public void testD5(int iters) { Target target = TARGET; - + for (int outer = iters; outer > 0; outer--) { for (int i = 0; i < target.size(); i++) { target.simple(); @@ -757,13 +757,13 @@ public class Main { static public void testD6(int iters) { Target target = TARGET; ArrayList<Object> list = INNER_LIST; - + for (int outer = iters; outer > 0; outer--) { for (Object o : list) { target.simple(); } } - } + } static public void testE0(int iters) { Target target = TARGET; @@ -793,7 +793,7 @@ public class Main { static public void testE2(int iters) { Target target = TARGET; int[] array = INNER_ARRAY; - + for (int outer = iters; outer > 0; outer--) { for (int i = 0; i < array.length; i++) { synchronized (target) { @@ -806,7 +806,7 @@ public class Main { static public void testE3(int iters) { Target target = TARGET; int[] array = INNER_ARRAY; - + for (int outer = iters; outer > 0; outer--) { for (int i : array) { synchronized (target) { @@ -818,7 +818,7 @@ public class Main { static public void testE4(int iters) { Target target = TARGET; - + for (int outer = iters; outer > 0; outer--) { for (int i = 0; i < target.size; i++) { synchronized (target) { @@ -830,7 +830,7 @@ public class Main { static public void testE5(int iters) { Target target = TARGET; - + for (int outer = iters; outer > 0; outer--) { for (int i = 0; i < target.size(); i++) { synchronized (target) { @@ -843,7 +843,7 @@ public class Main { static public void testE6(int iters) { Target target = TARGET; ArrayList<Object> list = INNER_LIST; - + for (int outer = iters; outer > 0; outer--) { for (Object o : list) { synchronized (target) { @@ -851,7 +851,7 @@ public class Main { } } } - } + } static public void testF0(int iters) { Target target = TARGET; @@ -885,7 +885,7 @@ public class Main { static public void testF2(int iters) { Target target = TARGET; int[] array = INNER_ARRAY; - + for (int outer = iters; outer > 0; outer--) { for (int i = 0; i < array.length; i++) { target.simple(); @@ -900,7 +900,7 @@ public class Main { static public void testF3(int iters) { Target target = TARGET; int[] array = INNER_ARRAY; - + for (int outer = iters; outer > 0; outer--) { for (int i : array) { target.simple(); @@ -914,7 +914,7 @@ public class Main { static public void testF4(int iters) { Target target = TARGET; - + for (int outer = iters; outer > 0; outer--) { for (int i = 0; i < target.size; i++) { target.simple(); @@ -928,7 +928,7 @@ public class Main { static public void testF5(int iters) { Target target = TARGET; - + for (int outer = iters; outer > 0; outer--) { for (int i = 0; i < target.size(); i++) { target.simple(); @@ -943,7 +943,7 @@ public class Main { static public void testF6(int iters) { Target target = TARGET; ArrayList<Object> list = INNER_LIST; - + for (int outer = iters; outer > 0; outer--) { for (Object o : list) { target.simple(); @@ -975,7 +975,7 @@ public class Main { static public void testG2(int iters) { int[] array = INNER_ARRAY; - + for (int outer = iters; outer > 0; outer--) { for (int i = 0; i < array.length; i++) { new Target(); @@ -985,7 +985,7 @@ public class Main { static public void testG3(int iters) { int[] array = INNER_ARRAY; - + for (int outer = iters; outer > 0; outer--) { for (int i : array) { new Target(); @@ -995,7 +995,7 @@ public class Main { static public void testG4(int iters) { Target target = TARGET; - + for (int outer = iters; outer > 0; outer--) { for (int i = 0; i < target.size; i++) { new Target(); @@ -1005,7 +1005,7 @@ public class Main { static public void testG5(int iters) { Target target = TARGET; - + for (int outer = iters; outer > 0; outer--) { for (int i = 0; i < target.size(); i++) { new Target(); @@ -1015,7 +1015,7 @@ public class Main { static public void testG6(int iters) { ArrayList<Object> list = INNER_LIST; - + for (int outer = iters; outer > 0; outer--) { for (Object o : list) { new Target(); @@ -1026,7 +1026,7 @@ public class Main { static public void testH0(int iters) { byte[] b1 = BYTES_1; byte[] b2 = BYTES_2; - + for (int outer = iters; outer > 0; outer--) { for (int i = INNER_COUNT; i > 0; i--) { System.arraycopy(b1, 0, b2, 0, ARRAY_BYTES); @@ -1050,7 +1050,7 @@ public class Main { byte[] b1 = BYTES_1; byte[] b2 = BYTES_2; int[] array = INNER_ARRAY; - + for (int outer = iters; outer > 0; outer--) { for (int i = 0; i < array.length; i++) { System.arraycopy(b1, 0, b2, 0, ARRAY_BYTES); @@ -1062,7 +1062,7 @@ public class Main { byte[] b1 = BYTES_1; byte[] b2 = BYTES_2; int[] array = INNER_ARRAY; - + for (int outer = iters; outer > 0; outer--) { for (int i : array) { System.arraycopy(b1, 0, b2, 0, ARRAY_BYTES); @@ -1074,7 +1074,7 @@ public class Main { Target target = TARGET; byte[] b1 = BYTES_1; byte[] b2 = BYTES_2; - + for (int outer = iters; outer > 0; outer--) { for (int i = 0; i < target.size; i++) { System.arraycopy(b1, 0, b2, 0, ARRAY_BYTES); @@ -1086,7 +1086,7 @@ public class Main { Target target = TARGET; byte[] b1 = BYTES_1; byte[] b2 = BYTES_2; - + for (int outer = iters; outer > 0; outer--) { for (int i = 0; i < target.size(); i++) { System.arraycopy(b1, 0, b2, 0, ARRAY_BYTES); @@ -1098,7 +1098,7 @@ public class Main { byte[] b1 = BYTES_1; byte[] b2 = BYTES_2; ArrayList<Object> list = INNER_LIST; - + for (int outer = iters; outer > 0; outer--) { for (Object o : list) { System.arraycopy(b1, 0, b2, 0, ARRAY_BYTES); diff --git a/tests/058-enum-order/src/Main.java b/tests/058-enum-order/src/Main.java index 74048c65f..2cd60525c 100644 --- a/tests/058-enum-order/src/Main.java +++ b/tests/058-enum-order/src/Main.java @@ -21,7 +21,7 @@ public class Main { public static enum Muffin { CORN, BLUEBERRY, CRANBERRY, BRAN, BLACKBERRY; } - + public static void main(String args[]) { Muffin[] array = Muffin.class.getEnumConstants(); for (Muffin m : array) { diff --git a/tests/060-reflection-security/src/Enforcer.java b/tests/060-reflection-security/src/Enforcer.java index ad688172c..c6def8d0c 100644 --- a/tests/060-reflection-security/src/Enforcer.java +++ b/tests/060-reflection-security/src/Enforcer.java @@ -45,7 +45,7 @@ public class Enforcer extends SecurityManager { case Member.PUBLIC: member = "PUBLIC"; break; default: member = "<" + which + ">?"; break; } - + System.out.println("checkMemberAccess: " + c.getName() + ", " + member); denyIfAppropriate(); diff --git a/tests/060-reflection-security/src/Main.java b/tests/060-reflection-security/src/Main.java index 9db0251ec..6db3bcd04 100644 --- a/tests/060-reflection-security/src/Main.java +++ b/tests/060-reflection-security/src/Main.java @@ -2,14 +2,14 @@ import other.Blort; public class Main { static public boolean VERBOSE = false; - + static public void main(String[] args) { if (args.length > 0) { if (args[0].equals("--verbose")) { VERBOSE = true; } } - + System.out.println("Setting SecurityManager."); System.setSecurityManager(Enforcer.THE_ONE); System.out.println("Running tests."); diff --git a/tests/060-reflection-security/src/other/Blort.java b/tests/060-reflection-security/src/other/Blort.java index 033ae6909..94d22e80f 100644 --- a/tests/060-reflection-security/src/other/Blort.java +++ b/tests/060-reflection-security/src/other/Blort.java @@ -5,7 +5,7 @@ public class Blort { /*package*/ int packageField; protected int protectedField; public int publicField; - + private void privateMethod() { // This space intentionally left blank. } diff --git a/tests/067-preemptive-unpark/src/Main.java b/tests/067-preemptive-unpark/src/Main.java index 1ecac14f1..a16219e60 100644 --- a/tests/067-preemptive-unpark/src/Main.java +++ b/tests/067-preemptive-unpark/src/Main.java @@ -7,11 +7,11 @@ public class Main { public static void main(String[] args) throws Exception { setUp(); - + ParkTester test = new ParkTester(); System.out.println("Test starting"); - + test.start(); UNSAFE.unpark(test); clearStack(10); @@ -81,7 +81,7 @@ public class Main { private static class ParkTester extends Thread { public volatile boolean parkNow = false; public volatile boolean success = false; - + public void run() { while (!parkNow) { try { diff --git a/tests/068-classloader/src/FancyLoader.java b/tests/068-classloader/src/FancyLoader.java index 1daf155e2..926c92e12 100644 --- a/tests/068-classloader/src/FancyLoader.java +++ b/tests/068-classloader/src/FancyLoader.java @@ -185,7 +185,7 @@ public class FancyLoader extends ClassLoader { throws ClassNotFoundException { Class res; - + /* * 1. Invoke findLoadedClass(String) to check if the class has * already been loaded. diff --git a/tests/070-nio-buffer/src/Main.java b/tests/070-nio-buffer/src/Main.java index 8cdaa516a..ffc9e27e0 100644 --- a/tests/070-nio-buffer/src/Main.java +++ b/tests/070-nio-buffer/src/Main.java @@ -89,7 +89,7 @@ public class Main { int1.clear (); int1.put (data); int1.position (0); - + int1.clear (); int1.put (data); int1.position (0); diff --git a/tests/run-all-tests b/tests/run-all-tests index ac86e1ef3..3069e344d 100755 --- a/tests/run-all-tests +++ b/tests/run-all-tests @@ -122,4 +122,4 @@ echo "failed: $failed test(s)" for i in $failNames; do echo "failed: $i" done - + diff --git a/tools/deadcode.py b/tools/deadcode.py index eb71b7c24..2ef8c70dc 100755 --- a/tools/deadcode.py +++ b/tools/deadcode.py @@ -9,7 +9,7 @@ def SplitSections(buffer): When found, the name of the section is extracted. The entire contents of that section is added to a result hashmap with the section name as the key""" - + # Match lines like # |section_name: # capturing section_name @@ -19,11 +19,11 @@ def SplitSections(buffer): start = 0 anchor = -1 sectionName = '' - + while True: # Look for a section header result = headerPattern.search(buffer, start) - + # If there are no more, add a section from the last header to EOF if result is None: if anchor is not -1: @@ -34,17 +34,17 @@ def SplitSections(buffer): # map indexed by the section name if anchor is not -1: sections[sectionName] = buffer[anchor:result.start()] - + sectionName = result.group(1) start = result.end() anchor = start - + return sections def FindMethods(section): """Spin through the 'method code index' section and extract all method signatures. When found, they are added to a result list.""" - + # Match lines like: # |[abcd] com/example/app/Class.method:(args)return # capturing the method signature @@ -56,7 +56,7 @@ def FindMethods(section): while True: # Look for a method name result = methodPattern.search(section, start) - + if result is None: return methods @@ -68,16 +68,16 @@ def CallsMethod(codes, method): """Spin through all the input method signatures. For each one, return whether or not there is method invokation line in the codes section that lists the method as the target.""" - + start = 0 - + while True: # Find the next reference to the method signature match = codes.find(method, start) - + if match is -1: break; - + # Find the beginning of the line the method reference is on startOfLine = codes.rfind("\n", 0, match) + 1 @@ -86,9 +86,9 @@ def CallsMethod(codes, method): # than the beginning of the code section for that method. if codes.find("invoke", startOfLine, match) is not -1: return True - + start = match + len(method) - + return False @@ -120,7 +120,7 @@ def main(): if not CallsMethod(codes, method): print "\t", method count += 1 - + if count is 0: print "\tNone" diff --git a/tools/dmtracedump/Android.mk b/tools/dmtracedump/Android.mk index ef9a9c25b..2ba0a68d1 100644 --- a/tools/dmtracedump/Android.mk +++ b/tools/dmtracedump/Android.mk @@ -1,4 +1,4 @@ -# +# # Copyright 2006 The Android Open Source Project # # Java method trace dump tool diff --git a/tools/dmtracedump/CreateTestTrace.c b/tools/dmtracedump/CreateTestTrace.c index 9d72b1f4c..0b85d516a 100644 --- a/tools/dmtracedump/CreateTestTrace.c +++ b/tools/dmtracedump/CreateTestTrace.c @@ -2,16 +2,16 @@ ** ** Copyright 2006, The Android Open Source Project ** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at ** -** http://www.apache.org/licenses/LICENSE-2.0 +** http://www.apache.org/licenses/LICENSE-2.0 ** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and ** limitations under the License. */ @@ -214,7 +214,7 @@ void parseInputFile(const char *inputFileName) save_cp = cp; while (*cp != '\n') cp += 1; - + /* Remove trailing spaces */ cp -= 1; while (isspace(*cp)) diff --git a/tools/dmtracedump/TraceDump.c b/tools/dmtracedump/TraceDump.c index 3dc18938e..02cdf9856 100644 --- a/tools/dmtracedump/TraceDump.c +++ b/tools/dmtracedump/TraceDump.c @@ -2,16 +2,16 @@ ** ** Copyright 2006, The Android Open Source Project ** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at ** -** http://www.apache.org/licenses/LICENSE-2.0 +** http://www.apache.org/licenses/LICENSE-2.0 ** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and ** limitations under the License. */ @@ -59,7 +59,7 @@ int versionNumber; #define DEFAULT_ACTIVE_THREADS 8 -char *htmlHeader = +char *htmlHeader = "<html>\n<head>\n<script type=\"text/javascript\" src=\"%ssortable.js\"></script>\n" "<script langugage=\"javascript\">\n" "function toggle(item) {\n" @@ -100,10 +100,10 @@ char *htmlHeader = "</head><body>\n\n"; char *htmlFooter = "\n</body>\n</html>\n"; -char *profileSeparator = +char *profileSeparator = "======================================================================"; - -const char* tableHeader = + +const char* tableHeader = "<table class='sortable' id='%s'><tr>\n" "<th>Method</th>\n" "<th>Run 1 (us)</th>\n" @@ -112,18 +112,18 @@ const char* tableHeader = "<th>Diff (%%)</th>\n" "<th>1: # calls</th>\n" "<th>2: # calls</th>\n" - "</tr>\n"; - -const char* tableHeaderMissing = + "</tr>\n"; + +const char* tableHeaderMissing = "<table class='sortable' id='%s'>\n" "<th>Method</th>\n" "<th>Exclusive</th>\n" "<th>Inclusive</th>\n" "<th># calls</th>\n"; - -#define GRAPH_LABEL_VISITED 0x0001 + +#define GRAPH_LABEL_VISITED 0x0001 #define GRAPH_NODE_VISITED 0x0002 - + /* * Values from the header of the data file. */ @@ -1227,7 +1227,7 @@ int readDataRecord(FILE *dataFp, int *threadId, unsigned int *methodVal, if (id == EOF) return 1; *threadId = id; - + *methodVal = read4LE(dataFp); *elapsedTime = read4LE(dataFp); if (feof(dataFp)) { @@ -1465,7 +1465,7 @@ TimedMethod *sortTimedMethodList(TimedMethod *list, int *num) for (ii = 0; ii < num_entries - 1; ++ii) sorted[ii].next = &sorted[ii + 1]; sorted[num_entries - 1].next = NULL; - + return sorted; } @@ -1488,7 +1488,7 @@ void printInclusiveMethod(MethodEntry *method, TimedMethod *list, int numCalls, char *className, *methodName, *signature; char classBuf[HTML_BUFSIZE], methodBuf[HTML_BUFSIZE]; char signatureBuf[HTML_BUFSIZE]; - + anchor_close = ""; if (gOptions.outputHtml) anchor_close = "</a>"; @@ -1690,7 +1690,7 @@ void printExclusiveProfile(MethodEntry **pMethods, int numMethods, } /* check to make sure that the child method meets the threshold of the parent */ -int checkThreshold(MethodEntry* parent, MethodEntry* child) +int checkThreshold(MethodEntry* parent, MethodEntry* child) { double parentTime = parent->elapsedInclusive; double childTime = child->elapsedInclusive; @@ -1700,18 +1700,18 @@ int checkThreshold(MethodEntry* parent, MethodEntry* child) void createLabels(FILE* file, MethodEntry* method) { - fprintf(file, "node%d[label = \"[%d] %s.%s (%llu, %llu, %d)\"]\n", - method->index, method->index, method->className, method->methodName, + fprintf(file, "node%d[label = \"[%d] %s.%s (%llu, %llu, %d)\"]\n", + method->index, method->index, method->className, method->methodName, method->elapsedInclusive / 1000, method->elapsedExclusive / 1000, method->numCalls[0]); - method->graphState = GRAPH_LABEL_VISITED; + method->graphState = GRAPH_LABEL_VISITED; TimedMethod* child; for (child = method->children[0] ; child ; child = child->next) { MethodEntry* childMethod = child->method; - + if ((childMethod->graphState & GRAPH_LABEL_VISITED) == 0 && checkThreshold(method, childMethod)) { createLabels(file, child->method); } @@ -1721,7 +1721,7 @@ void createLabels(FILE* file, MethodEntry* method) void createLinks(FILE* file, MethodEntry* method) { method->graphState |= GRAPH_NODE_VISITED; - + TimedMethod* child; for (child = method->children[0] ; child ; child = child->next) { MethodEntry* childMethod = child->method; @@ -1746,19 +1746,19 @@ void createInclusiveProfileGraphNew(DataKeys* dataKeys) } FILE* file = fopen(path, "w+"); - + fprintf(file, "digraph g {\nnode [shape = record,height=.1];\n"); - + createLabels(file, dataKeys->methods); createLinks(file, dataKeys->methods); - + fprintf(file, "}"); fclose(file); - + // now that we have the dot file generate the image char command[1024]; snprintf(command, 1024, "dot -Tpng -o '%s' '%s'", gOptions.graphFileName, path); - + system(command); if (! gOptions.keepDotFile) { @@ -2931,7 +2931,7 @@ bail: */ DataKeys* parseDataKeys(TraceData* traceData, const char* traceFileName, uint64_t* threadTime, Filter** filters) -{ +{ DataKeys* dataKeys = NULL; MethodEntry **pMethods = NULL; MethodEntry* method; @@ -2940,7 +2940,7 @@ DataKeys* parseDataKeys(TraceData* traceData, const char* traceFileName, int ii, jj, numThreads; uint64_t currentTime; MethodEntry* caller; - + dataFp = fopen(traceFileName, "r"); if (dataFp == NULL) goto bail; @@ -3178,7 +3178,7 @@ DataKeys* parseDataKeys(TraceData* traceData, const char* traceFileName, } caller = &dataKeys->methods[TOPLEVEL_INDEX]; caller->elapsedInclusive = sumThreadTime; - + #if 0 fclose(dumpStream); #endif @@ -3190,7 +3190,7 @@ DataKeys* parseDataKeys(TraceData* traceData, const char* traceFileName, bail: if (dataFp != NULL) fclose(dataFp); - + return dataKeys; } @@ -3207,7 +3207,7 @@ MethodEntry** parseMethodEntries(DataKeys* dataKeys) MethodEntry* entry = &dataKeys->methods[ii]; pMethods[ii] = entry; } - + return pMethods; } @@ -3253,7 +3253,7 @@ int compareMethodNamesForDiff(const void *a, const void *b) if (result == 0) { result = strcmp(methodA->signature, methodB->signature); if (result == 0) { - return strcmp(methodA->className, methodB->className); + return strcmp(methodA->className, methodB->className); } } return result; @@ -3262,21 +3262,21 @@ int compareMethodNamesForDiff(const void *a, const void *b) int findMatch(MethodEntry** methods, int size, MethodEntry* matchThis) { int i; - + for (i = 0 ; i < size ; i++) { MethodEntry* method = methods[i]; - + if (method != NULL && !compareMethodNamesForDiff(&method, &matchThis)) { -// printf("%s.%s == %s.%s<br>\n", matchThis->className, matchThis->methodName, +// printf("%s.%s == %s.%s<br>\n", matchThis->className, matchThis->methodName, // method->className, method->methodName); - + return i; /* if (!compareMethodNames(&method, &matchThis)) { return i; } */ } } - + return -1; } @@ -3286,13 +3286,13 @@ int compareDiffEntriesExculsive(const void *a, const void *b) const DiffEntry* entryA = (const DiffEntry*)a; const DiffEntry* entryB = (const DiffEntry*)b; - + if (entryA->differenceExclusive < entryB->differenceExclusive) { return 1; } else if (entryA->differenceExclusive > entryB->differenceExclusive) { return -1; } - + return 0; } @@ -3302,37 +3302,37 @@ int compareDiffEntriesInculsive(const void *a, const void *b) const DiffEntry* entryA = (const DiffEntry*)a; const DiffEntry* entryB = (const DiffEntry*)b; - + if (entryA->differenceInclusive < entryB->differenceInclusive) { return 1; } else if (entryA->differenceInclusive > entryB->differenceInclusive) { return -1; } - + return 0; } -void printMissingMethod(MethodEntry* method) +void printMissingMethod(MethodEntry* method) { char classBuf[HTML_BUFSIZE]; char methodBuf[HTML_BUFSIZE]; char* className; char* methodName; - + className = htmlEscape(method->className, classBuf, HTML_BUFSIZE); methodName = htmlEscape(method->methodName, methodBuf, HTML_BUFSIZE); - - if (gOptions.outputHtml) printf("<tr><td>\n"); - + + if (gOptions.outputHtml) printf("<tr><td>\n"); + printf("%s.%s ", className, methodName); if (gOptions.outputHtml) printf("</td><td>"); - + printf("%lld ", method->elapsedExclusive); if (gOptions.outputHtml) printf("</td><td>"); - + printf("%lld ", method->elapsedInclusive); if (gOptions.outputHtml) printf("</td><td>"); - + printf("%d\n", method->numCalls[0]); if (gOptions.outputHtml) printf("</td><td>\n"); } @@ -3342,8 +3342,8 @@ void createDiff(DataKeys* d1, uint64_t sum1, DataKeys* d2, uint64_t sum2) { MethodEntry** methods1 = parseMethodEntries(d1); MethodEntry** methods2 = parseMethodEntries(d2); - - // sort and assign the indicies + + // sort and assign the indicies int i; qsort(methods1, d1->numMethods, sizeof(MethodEntry*), compareElapsedInclusive); for (i = 0; i < d1->numMethods; ++i) { @@ -3354,17 +3354,17 @@ void createDiff(DataKeys* d1, uint64_t sum1, DataKeys* d2, uint64_t sum2) for (i = 0; i < d2->numMethods; ++i) { methods2[i]->index = i; } - + int max = (d1->numMethods < d2->numMethods) ? d2->numMethods : d1->numMethods; max++; DiffEntry* diffs = (DiffEntry*)malloc(max * sizeof(DiffEntry)); memset(diffs, 0, max * sizeof(DiffEntry)); DiffEntry* ptr = diffs; - + // printf("<br>d1->numMethods: %d d1->numMethods: %d<br>\n", d1->numMethods, d2->numMethods); - + int matches = 0; - + for (i = 0 ; i < d1->numMethods ; i++) { int match = findMatch(methods2, d2->numMethods, methods1[i]); if (match >= 0) { @@ -3384,13 +3384,13 @@ void createDiff(DataKeys* d1, uint64_t sum1, DataKeys* d2, uint64_t sum2) ptr->differenceInclusive = i2 - i1; ptr->differenceInclusivePercentage = ((double)i2 / (double)i1) * 100.0; } - + // clear these out so we don't find them again and we know which ones // we have left over methods1[i] = NULL; methods2[match] = NULL; ptr++; - + matches++; } } @@ -3399,7 +3399,7 @@ void createDiff(DataKeys* d1, uint64_t sum1, DataKeys* d2, uint64_t sum2) qsort(diffs, matches, sizeof(DiffEntry), compareDiffEntriesExculsive); ptr = diffs; - + if (gOptions.outputHtml) { printf(htmlHeader, gOptions.sortableUrl); printf("<h3>Table of Contents</h3>\n"); @@ -3412,12 +3412,12 @@ void createDiff(DataKeys* d1, uint64_t sum1, DataKeys* d2, uint64_t sum2) printf("<a name=\"exclusive\"></a><h3 id=\"exclusive\">Exclusive</h3>\n"); printf(tableHeader, "exclusive_table"); } - + char classBuf[HTML_BUFSIZE]; char methodBuf[HTML_BUFSIZE]; char* className; char* methodName; - + while (ptr->method1 != NULL && ptr->method2 != NULL) { if (gOptions.outputHtml) printf("<tr><td>\n"); @@ -3426,16 +3426,16 @@ void createDiff(DataKeys* d1, uint64_t sum1, DataKeys* d2, uint64_t sum2) printf("%s.%s ", className, methodName); if (gOptions.outputHtml) printf("</td><td>"); - + printf("%lld ", ptr->method1->elapsedExclusive); if (gOptions.outputHtml) printf("</td><td>"); - + printf("%llu ", ptr->method2->elapsedExclusive); if (gOptions.outputHtml) printf("</td><td>"); - + printf("%lld ", ptr->differenceExclusive); if (gOptions.outputHtml) printf("</td><td>"); - + printf("%.2f\n", ptr->differenceExclusivePercentage); if (gOptions.outputHtml) printf("</td><td>\n"); @@ -3444,12 +3444,12 @@ void createDiff(DataKeys* d1, uint64_t sum1, DataKeys* d2, uint64_t sum2) printf("%d\n", ptr->method2->numCalls[0]); if (gOptions.outputHtml) printf("</td></tr>\n"); - + ptr++; } - + if (gOptions.outputHtml) printf("</table>\n"); - + if (gOptions.outputHtml) { printf(htmlHeader, gOptions.sortableUrl); printf("Run 1: %s<br>\n", gOptions.diffFileName); @@ -3457,10 +3457,10 @@ void createDiff(DataKeys* d1, uint64_t sum1, DataKeys* d2, uint64_t sum2) printf("<a name=\"inclusive\"></a><h3 id=\"inculisve\">Inclusive</h3>\n"); printf(tableHeader, "inclusive_table"); } - + qsort(diffs, matches, sizeof(DiffEntry), compareDiffEntriesInculsive); ptr = diffs; - + while (ptr->method1 != NULL && ptr->method2 != NULL) { if (gOptions.outputHtml) printf("<tr><td>\n"); @@ -3496,25 +3496,25 @@ void createDiff(DataKeys* d1, uint64_t sum1, DataKeys* d2, uint64_t sum2) printf("<h3>Run 1 methods not found in Run 2</h3>"); printf(tableHeaderMissing); } - + for (i = 0; i < d1->numMethods; ++i) { if (methods1[i] != NULL) { printMissingMethod(methods1[i]); } } - + if (gOptions.outputHtml) { printf("</table>\n"); printf("<h3>Run 2 methods not found in Run 1</h3>"); printf(tableHeaderMissing); } - + for (i = 0; i < d2->numMethods; ++i) { if (methods2[i] != NULL) { printMissingMethod(methods2[i]); } } - + if (gOptions.outputHtml) printf("</body></html\n"); } @@ -3613,9 +3613,9 @@ int main(int argc, char** argv) uint64_t sum2; TraceData data2; DataKeys* d2 = parseDataKeys(&data2, gOptions.diffFileName, &sum2, filters); - + createDiff(d2, sum2, dataKeys, sumThreadTime); - + freeDataKeys(d2); } else { MethodEntry** methods = parseMethodEntries(dataKeys); @@ -3626,7 +3626,7 @@ int main(int argc, char** argv) } free(methods); } - + freeDataKeys(dataKeys); return 0; diff --git a/tools/dmtracedump/dmtracedump.pl b/tools/dmtracedump/dmtracedump.pl index fbd00acf8..9c3f40e05 100755 --- a/tools/dmtracedump/dmtracedump.pl +++ b/tools/dmtracedump/dmtracedump.pl @@ -12,7 +12,7 @@ foreach (@traces) print("dmtracedump -h -p $input > $output\n"); system("dmtracedump -h -p '$input' > '$output'"); - + } closedir DIR; diff --git a/tools/gdbjithelper/README.txt b/tools/gdbjithelper/README.txt index 032b24471..f34cb7c94 100644 --- a/tools/gdbjithelper/README.txt +++ b/tools/gdbjithelper/README.txt @@ -26,7 +26,7 @@ code around lr: Step 2 - + Push $OUT/EXECUTABLES/gdbjithelper_intermediates/LINKED/gdbjithelper to /system/bin on the device or emulator diff --git a/tools/gdbjithelper/gdbjithelper.c b/tools/gdbjithelper/gdbjithelper.c index 862fcae2f..817d5a41e 100644 --- a/tools/gdbjithelper/gdbjithelper.c +++ b/tools/gdbjithelper/gdbjithelper.c @@ -40,7 +40,7 @@ volatile int done; * 463ba204 4191debc 01010000 4284aa74 68b00054 * 463ba214 045cf205 cc016468 0718f2a5 d0102800 * 463ba224 4c13c701 a20aa108 efb0f775 e008e010 - * + * * code around lr: * 463ba1a8 42e19e58 f2050050 cc01045c 0718f2a5 * 463ba1b8 d00f2800 4c13c701 a20aa108 efe4f775 diff --git a/vm/AllocTracker.c b/vm/AllocTracker.c index 9fb1c4d64..28462231a 100644 --- a/vm/AllocTracker.c +++ b/vm/AllocTracker.c @@ -609,7 +609,7 @@ void dvmDumpTrackedAllocations(bool enable) */ int idx = headIndex(); int count = gDvm.allocRecordCount; - + LOGI("Tracked allocations, (head=%d count=%d)\n", gDvm.allocRecordHead, count); while (count--) { @@ -458,8 +458,8 @@ static bool getThreadStats(pid_t pid, pid_t tid, unsigned long* pUtime, * (4b) threadId * (1b) thread status * (4b) tid - * (4b) utime - * (4b) stime + * (4b) utime + * (4b) stime * (1b) is daemon? * * The length fields exist in anticipation of adding additional fields diff --git a/vm/Debugger.c b/vm/Debugger.c index aa37d5d4c..bcc92151e 100644 --- a/vm/Debugger.c +++ b/vm/Debugger.c @@ -821,7 +821,7 @@ int dvmDbgGetSignatureTag(const char* type) if (strcmp(type, "Ljava/lang/String;") == 0) return JT_STRING; else if (strcmp(type, "Ljava/lang/Class;") == 0) - return JT_CLASS_OBJECT; + return JT_CLASS_OBJECT; else if (strcmp(type, "Ljava/lang/Thread;") == 0) return JT_THREAD; else if (strcmp(type, "Ljava/lang/ThreadGroup;") == 0) @@ -1255,7 +1255,7 @@ void dvmDbgOutputAllMethods(RefTypeId refTypeId, bool withGeneric, int i; dexStringCacheInit(&stringCache); - + clazz = refTypeIdToClassObject(refTypeId); assert(clazz != NULL); @@ -1325,7 +1325,7 @@ typedef struct DebugCallbackContext { bool withGeneric; } DebugCallbackContext; -static int lineTablePositionsCb(void *cnxt, u4 address, u4 lineNum) +static int lineTablePositionsCb(void *cnxt, u4 address, u4 lineNum) { DebugCallbackContext *pContext = (DebugCallbackContext *)cnxt; @@ -1454,7 +1454,7 @@ void dvmDbgOutputVariableTable(RefTypeId refTypeId, MethodId methodId, DebugCallbackContext context; memset (&context, 0, sizeof(DebugCallbackContext)); - + method = methodIdToMethod(refTypeId, methodId); expandBufAdd4BE(pReply, method->insSize); @@ -1664,7 +1664,7 @@ void dvmDbgSetStaticFieldValue(RefTypeId refTypeId, FieldId fieldId, StaticField* sfield = (StaticField*) fieldIdToField(refTypeId, fieldId); Object* objVal; JValue value; - + value.j = rawValue; switch (sfield->field.signature[0]) { @@ -1761,7 +1761,7 @@ bool dvmDbgGetThreadStatus(ObjectId threadId, u4* pThreadStatus, Object* threadObj; Thread* thread; bool result = false; - + threadObj = objectIdToObject(threadId); assert(threadObj != NULL); @@ -1808,7 +1808,7 @@ u4 dvmDbgGetThreadSuspendCount(ObjectId threadId) Object* threadObj; Thread* thread; u4 result = 0; - + threadObj = objectIdToObject(threadId); assert(threadObj != NULL); @@ -1836,7 +1836,7 @@ bool dvmDbgThreadExists(ObjectId threadId) Object* threadObj; Thread* thread; bool result; - + threadObj = objectIdToObject(threadId); assert(threadObj != NULL); @@ -1863,7 +1863,7 @@ bool dvmDbgIsSuspended(ObjectId threadId) Object* threadObj; Thread* thread; bool result = false; - + threadObj = objectIdToObject(threadId); assert(threadObj != NULL); @@ -1893,7 +1893,7 @@ void dvmDbgWaitForSuspend(ObjectId threadId) { Object* threadObj; Thread* thread; - + threadObj = objectIdToObject(threadId); assert(threadObj != NULL); diff --git a/vm/Exception.c b/vm/Exception.c index 5e01dfc1b..d286f2a50 100644 --- a/vm/Exception.c +++ b/vm/Exception.c @@ -528,7 +528,7 @@ static bool initException(Object* exception, const char* msg, Object* cause, excepClass->descriptor, msg, initKind); assert(strcmp(excepClass->descriptor, "Ljava/lang/RuntimeException;") != 0); - dvmThrowChainedException("Ljava/lang/RuntimeException;", + dvmThrowChainedException("Ljava/lang/RuntimeException;", "re-throw on exception class missing constructor", NULL); goto bail; } @@ -781,7 +781,7 @@ static int findCatchInMethod(Thread* self, const Method* method, int relPc, if (handler == NULL) { break; } - + if (handler->typeIdx == kDexNoIndex) { /* catch-all */ LOGV("Match on catch-all block at 0x%02x in %s.%s for %s\n", @@ -1075,7 +1075,7 @@ void* dvmFillInStackTraceInternal(Thread* thread, bool wantObject, int* pCount) *intPtr++ = 0; /* no saved PC for native methods */ } else { assert(saveArea->xtra.currentPc >= method->insns && - saveArea->xtra.currentPc < + saveArea->xtra.currentPc < method->insns + dvmGetMethodInsnsSize(method)); *intPtr++ = (int) (saveArea->xtra.currentPc - method->insns); } @@ -282,8 +282,8 @@ bool dvmHashTableRemove(HashTable* pHashTable, u4 itemHash, void* item) /* * Scan every entry in the hash table and evaluate it with the specified - * indirect function call. If the function returns 1, remove the entry from - * the table. + * indirect function call. If the function returns 1, remove the entry from + * the table. * * Does NOT invoke the "free" function on the item. * @@ -400,7 +400,7 @@ void dvmHashTableProbeCount(HashTable* pHashTable, HashCalcFunc calcFunc, { const void* data = (const void*)dvmHashIterData(&iter); int count; - + count = countProbes(pHashTable, (*calcFunc)(data), data, cmpFunc); numEntries++; @@ -224,7 +224,7 @@ static void showVersion(void) { dvmFprintf(stdout, "DalvikVM version %d.%d.%d\n", DALVIK_MAJOR_VERSION, DALVIK_MINOR_VERSION, DALVIK_BUG_VERSION); - dvmFprintf(stdout, + dvmFprintf(stdout, "Copyright (C) 2007 The Android Open Source Project\n\n" "This software is built from source code licensed under the " "Apache License,\n" @@ -634,7 +634,7 @@ static void processXjitmethod(const char *opt) gDvmJit.methodTable = dvmHashTableCreate(8, NULL); start = buf; - /* + /* * Break comma-separated method signatures and enter them into the hash * table individually. */ @@ -1371,7 +1371,7 @@ bool dvmInitAfterZygote(void) { u8 startHeap, startQuit, startJdwp; u8 endHeap, endQuit, endJdwp; - + startHeap = dvmGetRelativeTimeUsec(); /* diff --git a/vm/InlineNative.c b/vm/InlineNative.c index 232395808..aa9c5cf24 100644 --- a/vm/InlineNative.c +++ b/vm/InlineNative.c @@ -754,7 +754,7 @@ bool dvmPerformInlineOp4Dbg(u4 arg0, u4 arg1, u4 arg2, u4 arg3, Method* method = gDvm.inlinedMethods[opIndex]; if (method == NULL) { ClassObject* clazz; - + clazz = dvmFindClassNoInit( gDvmInlineOpsTable[opIndex].classDescriptor, NULL); if (clazz == NULL) { diff --git a/vm/Properties.c b/vm/Properties.c index 91288c27f..1cc3e7138 100644 --- a/vm/Properties.c +++ b/vm/Properties.c @@ -199,7 +199,7 @@ void dvmCreateDefaultProperties(Object* propObj) setProperty(propObj, put, "file.separator", "/"); setProperty(propObj, put, "line.separator", "\n"); setProperty(propObj, put, "path.separator", ":"); - + /* * These show up elsewhere, so do them here too. */ diff --git a/vm/alloc/DdmHeap.c b/vm/alloc/DdmHeap.c index 24054df65..4cb5cae02 100644 --- a/vm/alloc/DdmHeap.c +++ b/vm/alloc/DdmHeap.c @@ -36,12 +36,12 @@ enum HpifWhen { /* * Chunk HPIF (client --> server) - * + * * Heap Info. General information about the heap, * suitable for a summary display. - * + * * [u4]: number of heaps - * + * * For each heap: * [u4]: heap ID * [u8]: timestamp in ms since Unix epoch @@ -274,7 +274,7 @@ heap_chunk_callback(const void *chunkptr, size_t chunklen, state = HPSG_STATE(SOLIDITY_FREE, 0); } else { const Object *obj = userptr; - /* If we're looking at the native heap, we'll just return + /* If we're looking at the native heap, we'll just return * (SOLIDITY_HARD, KIND_NATIVE) for all allocated chunks */ bool native = ctx->type == CHUNK_TYPE("NHSG"); @@ -363,7 +363,7 @@ static void walkHeap(bool merge, bool native) { HeapChunkContext ctx; - + memset(&ctx, 0, sizeof(ctx)); ctx.bufLen = HPSx_CHUNK_SIZE; ctx.buf = (u1 *)malloc(ctx.bufLen); diff --git a/vm/alloc/HeapDebug.c b/vm/alloc/HeapDebug.c index 86d583306..cb8fb4849 100644 --- a/vm/alloc/HeapDebug.c +++ b/vm/alloc/HeapDebug.c @@ -122,17 +122,17 @@ void dvmLogGcStats(size_t numFreed, size_t sizeFreed, size_t gcTimeMs) /* Enough to quiet down gcc for unitialized variable check */ perHeapActualSize[0] = perHeapAllowedSize[0] = perHeapNumAllocated[0] = perHeapSizeAllocated[0] = 0; - actualSize = dvmHeapSourceGetValue(HS_FOOTPRINT, perHeapActualSize, + actualSize = dvmHeapSourceGetValue(HS_FOOTPRINT, perHeapActualSize, HEAP_SOURCE_MAX_HEAP_COUNT); - allowedSize = dvmHeapSourceGetValue(HS_ALLOWED_FOOTPRINT, + allowedSize = dvmHeapSourceGetValue(HS_ALLOWED_FOOTPRINT, perHeapAllowedSize, HEAP_SOURCE_MAX_HEAP_COUNT); numAllocated = dvmHeapSourceGetValue(HS_OBJECTS_ALLOCATED, perHeapNumAllocated, HEAP_SOURCE_MAX_HEAP_COUNT); sizeAllocated = dvmHeapSourceGetValue(HS_BYTES_ALLOCATED, perHeapSizeAllocated, HEAP_SOURCE_MAX_HEAP_COUNT); - /* - * Construct the the first 64-bit value to write to the log. + /* + * Construct the the first 64-bit value to write to the log. * Global information: * * [63 ] Must be zero diff --git a/vm/alloc/HeapSource.c b/vm/alloc/HeapSource.c index 31df82327..7c4de5d45 100644 --- a/vm/alloc/HeapSource.c +++ b/vm/alloc/HeapSource.c @@ -1166,7 +1166,7 @@ void dvmSetTargetHeapUtilization(float newTarget) hs->targetUtilization = (size_t)(newTarget * (float)HEAP_UTILIZATION_MAX); - LOGV("Set heap target utilization to %zd/%d (%f)\n", + LOGV("Set heap target utilization to %zd/%d (%f)\n", hs->targetUtilization, HEAP_UTILIZATION_MAX, newTarget); } @@ -1373,7 +1373,7 @@ dvmHeapSourceTrim(size_t bytesTrimmed[], size_t arrayLen) /* Return any whole free pages to the system. */ bytesTrimmed[i] = 0; - mspace_walk_free_pages(heap->msp, releasePagesInRange, + mspace_walk_free_pages(heap->msp, releasePagesInRange, &bytesTrimmed[i]); heapBytes += bytesTrimmed[i]; } @@ -1474,7 +1474,7 @@ externalAllocPossible(const HeapSource *hs, size_t n) * Tries to update the internal count of externally-allocated memory. * If there's enough room for that memory, returns true. If not, returns * false and does not update the count. - * + * * The caller must ensure externalAllocPossible(hs, n) == true. */ static bool diff --git a/vm/alloc/HeapSource.h b/vm/alloc/HeapSource.h index 1857f2ca5..6df3df06f 100644 --- a/vm/alloc/HeapSource.h +++ b/vm/alloc/HeapSource.h @@ -71,7 +71,7 @@ enum HeapSourceValueSpec { HS_EXTERNAL_BYTES_ALLOCATED, HS_EXTERNAL_LIMIT }; -size_t dvmHeapSourceGetValue(enum HeapSourceValueSpec spec, +size_t dvmHeapSourceGetValue(enum HeapSourceValueSpec spec, size_t perHeapStats[], size_t arrayLen); /* diff --git a/vm/alloc/HeapWorker.c b/vm/alloc/HeapWorker.c index bf924cd81..edd4b983b 100644 --- a/vm/alloc/HeapWorker.c +++ b/vm/alloc/HeapWorker.c @@ -343,7 +343,7 @@ static void* heapWorkerThreadStart(void* arg) #endif if (trimtime.tv_sec < now.tv_sec || - (trimtime.tv_sec == now.tv_sec && + (trimtime.tv_sec == now.tv_sec && trimtime.tv_nsec <= now.tv_nsec)) { size_t madvisedSizes[HEAP_SOURCE_MAX_HEAP_COUNT]; diff --git a/vm/analysis/CodeVerify.c b/vm/analysis/CodeVerify.c index becce81da..fee065702 100644 --- a/vm/analysis/CodeVerify.c +++ b/vm/analysis/CodeVerify.c @@ -3179,7 +3179,7 @@ bool dvmVerifyCodeFlow(Method* meth, InsnFlags* insnFlags, vd.insnRegCount = meth->registersSize; vd.insnFlags = insnFlags; vd.addrRegs = regTable.addrRegs; - + pMap = dvmGenerateRegisterMapV(&vd); if (pMap != NULL) { /* diff --git a/vm/analysis/CodeVerify.h b/vm/analysis/CodeVerify.h index 1b93655e1..d8959ceae 100644 --- a/vm/analysis/CodeVerify.h +++ b/vm/analysis/CodeVerify.h @@ -239,7 +239,7 @@ void dvmFreeUninitInstanceMap(UninitInstanceMap* uninitMap); * different class is already associated with the address (shouldn't * happen either). */ -//int dvmSetUninitInstance(UninitInstanceMap* uninitMap, int addr, +//int dvmSetUninitInstance(UninitInstanceMap* uninitMap, int addr, // ClassObject* clazz); /* diff --git a/vm/analysis/DexVerify.c b/vm/analysis/DexVerify.c index 3793a4ef2..8eced237a 100644 --- a/vm/analysis/DexVerify.c +++ b/vm/analysis/DexVerify.c @@ -254,7 +254,7 @@ static bool checkArrayData(const Method* meth, int curOffset) LOG_VFY_METH(meth, "VFY: invalid array data end: at %d, data offset %d, end %d, " "count %d\n", - curOffset, offsetToArrayData, + curOffset, offsetToArrayData, curOffset + offsetToArrayData + tableSize, insnCount); return false; diff --git a/vm/analysis/ReduceConstants.c b/vm/analysis/ReduceConstants.c index 308db8739..bdfdb80ad 100644 --- a/vm/analysis/ReduceConstants.c +++ b/vm/analysis/ReduceConstants.c @@ -189,7 +189,7 @@ Further implementation thoughts: */ /* Output Formats - + There are two possible output formats, from which we choose based on how we plan to take advantage of the remapped constants. At most one of these will appear in the DEX. diff --git a/vm/arch/arm/CallEABI.S b/vm/arch/arm/CallEABI.S index 9717e3b3d..e0d4f5c91 100644 --- a/vm/arch/arm/CallEABI.S +++ b/vm/arch/arm/CallEABI.S @@ -36,7 +36,7 @@ Function prototype: void dvmPlatformInvoke(void* pEnv, ClassObject* clazz, int argInfo, int argc, - const u4* argv, const char* signature, void* func, JValue* pReturn) + const u4* argv, const char* signature, void* func, JValue* pReturn) The method we are calling has the form: diff --git a/vm/arch/arm/CallOldABI.S b/vm/arch/arm/CallOldABI.S index c09821806..2463d3cb4 100644 --- a/vm/arch/arm/CallOldABI.S +++ b/vm/arch/arm/CallOldABI.S @@ -30,7 +30,7 @@ Function prototype: void dvmPlatformInvoke(void* pEnv, ClassObject* clazz, int argInfo, int argc, - const u4* argv, const char* signature, void* func, JValue* pReturn) + const u4* argv, const char* signature, void* func, JValue* pReturn) The method we are calling has the form: diff --git a/vm/hprof/HprofClass.c b/vm/hprof/HprofClass.c index 5043bebf4..f76f159c8 100644 --- a/vm/hprof/HprofClass.c +++ b/vm/hprof/HprofClass.c @@ -74,7 +74,7 @@ getPrettyClassNameId(const char *descriptor) { hprof_string_id classNameId; char *dotName = dvmDescriptorToDot(descriptor); - + /* Hprof suggests that array class names be converted from, e.g., * "[[[I" to "int[][][]" and "[Lorg.blort.Spaz;" to * "org.blort.Spaz[]". @@ -205,7 +205,7 @@ hprofDumpClasses(hprof_context_t *ctx) * ID: class object ID * u4: stack trace serial number * ID: class name string ID - * + * * We use the address of the class object structure as its ID. */ hprofAddU4ToRecord(rec, clazz->serialNumber); diff --git a/vm/hprof/HprofHeap.c b/vm/hprof/HprofHeap.c index bc6cf64d2..75a1d2b4e 100644 --- a/vm/hprof/HprofHeap.c +++ b/vm/hprof/HprofHeap.c @@ -231,10 +231,10 @@ hprofDumpHeapObject(hprof_context_t *ctx, const Object *obj) hprof_record_t *rec = &ctx->curRec; HprofHeapId desiredHeap; - desiredHeap = + desiredHeap = dvmHeapSourceGetPtrFlag(obj, HS_ALLOCATED_IN_ZYGOTE) ? HPROF_HEAP_ZYGOTE : HPROF_HEAP_APP; - + if (ctx->objectsInSegment >= OBJECTS_PER_SEGMENT || rec->length >= BYTES_PER_SEGMENT) { diff --git a/vm/hprof/HprofStack.c b/vm/hprof/HprofStack.c index 241e01e69..04641ef7c 100644 --- a/vm/hprof/HprofStack.c +++ b/vm/hprof/HprofStack.c @@ -171,7 +171,7 @@ hprofDumpStacks(hprof_context_t *ctx) int i; hprofStartNewRecord(ctx, HPROF_TAG_STACK_TRACE, HPROF_TIME); - + stackTraceEntry = (const StackTraceEntry *) dvmHashIterData(&iter); assert(stackTraceEntry != NULL); @@ -184,7 +184,7 @@ hprofDumpStacks(hprof_context_t *ctx) */ hprofAddU4ToRecord(rec, stackTraceEntry->trace.serialNumber); hprofAddU4ToRecord(rec, stackTraceEntry->trace.threadSerialNumber); - + count = 0; while ((count < STACK_DEPTH) && (stackTraceEntry->trace.frameIds[count] != 0)) { @@ -210,7 +210,7 @@ hprofFillInStackTrace(void *objectPtr) Thread* self; void* fp; int i; - + if (objectPtr == NULL) { return; } diff --git a/vm/hprof/HprofStackFrame.c b/vm/hprof/HprofStackFrame.c index b1ade4300..f9c789e88 100644 --- a/vm/hprof/HprofStackFrame.c +++ b/vm/hprof/HprofStackFrame.c @@ -66,7 +66,7 @@ hprofStartup_StackFrame() descriptor = dexProtoGetMethodDescriptor(&method->prototype, &cache); hprofLookupStringId(descriptor); dexStringCacheRelease(&cache); - + const char* sourceFile = dvmGetMethodSourceFile(method); if (sourceFile) { hprofLookupStringId(sourceFile); @@ -76,7 +76,7 @@ hprofStartup_StackFrame() hprofLookupClassId(method->clazz); } } - + return 0; } @@ -114,7 +114,7 @@ computeStackFrameHash(const StackFrameEntry *stackFrameEntry) u4 hash = 0; const char *cp = (char *) &stackFrameEntry->frame; int i; - + for (i = 0; i < (int) sizeof(StackFrame); i++) { hash = 31 * hash + cp[i]; } @@ -192,12 +192,12 @@ hprofDumpStackFrames(hprof_context_t *ctx) const char *sourceFile; ClassObject *clazz; int lineNum; - + hprofStartNewRecord(ctx, HPROF_TAG_STACK_FRAME, HPROF_TIME); - + stackFrameEntry = (const StackFrameEntry *) dvmHashIterData(&iter); assert(stackFrameEntry != NULL); - + method = stackFrameEntry->frame.method; pc = stackFrameEntry->frame.pc; sourceFile = dvmGetMethodSourceFile(method); diff --git a/vm/hprof/HprofString.c b/vm/hprof/HprofString.c index 4e14efb9f..3f697f58c 100644 --- a/vm/hprof/HprofString.c +++ b/vm/hprof/HprofString.c @@ -102,7 +102,7 @@ hprofDumpStrings(hprof_context_t *ctx) * ID: ID for this string * [u1]*: UTF8 characters for string (NOT NULL terminated) * (the record format encodes the length) - * + * * We use the address of the string data as its ID. */ err = hprofAddU4ToRecord(rec, (u4)str); diff --git a/vm/interp/Stack.c b/vm/interp/Stack.c index 11a9a3213..f6a0620ac 100644 --- a/vm/interp/Stack.c +++ b/vm/interp/Stack.c @@ -790,7 +790,7 @@ static int lineNumForPcCb(void *cnxt, u4 address, u4 lineNum) { LineNumFromPcContext *pContext = (LineNumFromPcContext *)cnxt; - // We know that this callback will be called in + // We know that this callback will be called in // ascending address order, so keep going until we find // a match or we've just gone past it. @@ -834,7 +834,7 @@ int dvmLineNumFromPC(const Method* method, u4 relPc) method->prototype.protoIdx, method->accessFlags, lineNumForPcCb, NULL, &context); - + return context.lineNum; } @@ -966,7 +966,7 @@ ClassObject* dvmGetCaller3Class(const void* curFrame) if (caller == NULL) return NULL; } - + return SAVEAREA_FROM_FP(caller)->method->clazz; } diff --git a/vm/jdwp/JdwpAdb.c b/vm/jdwp/JdwpAdb.c index dfc7bd781..ab1360253 100644 --- a/vm/jdwp/JdwpAdb.c +++ b/vm/jdwp/JdwpAdb.c @@ -101,13 +101,13 @@ adbStateAlloc(void) netState->controlAddrLen = sizeof(netState->controlAddr.controlAddrUn.sun_family) + kJdwpControlNameLen; - - memcpy(netState->controlAddr.controlAddrUn.sun_path, + + memcpy(netState->controlAddr.controlAddrUn.sun_path, kJdwpControlName, kJdwpControlNameLen); - + netState->wakeFds[0] = -1; netState->wakeFds[1] = -1; - + return netState; } @@ -122,7 +122,7 @@ static bool startup(struct JdwpState* state, const JdwpStartupParams* pParams) JdwpNetState* netState; LOGV("ADB transport startup\n"); - + state->netState = netState = adbStateAlloc(); if (netState == NULL) return false; @@ -158,13 +158,13 @@ static int receiveClientFd(JdwpNetState* netState) msg.msg_flags = 0; msg.msg_control = cm_un.buffer; msg.msg_controllen = sizeof(cm_un.buffer); - + cmsg = CMSG_FIRSTHDR(&msg); cmsg->cmsg_len = msg.msg_controllen; cmsg->cmsg_level = SOL_SOCKET; cmsg->cmsg_type = SCM_RIGHTS; ((int*)CMSG_DATA(cmsg))[0] = -1; - + do { ret = recvmsg(netState->controlSock, &msg, 0); } while (ret < 0 && errno == EINTR); @@ -197,7 +197,7 @@ static bool acceptConnection(struct JdwpState* state) int retryCount = 0; /* first, ensure that we get a connection to the ADB daemon */ - + retry: if (netState->shuttingDown) return false; @@ -340,7 +340,7 @@ static void adbStateShutdown(struct JdwpNetState* netState) shutdown(controlSock, SHUT_RDWR); netState->controlSock = -1; } - + if (netState->wakeFds[1] >= 0) { LOGV("+++ writing to wakePipe\n"); (void) write(netState->wakeFds[1], "", 1); diff --git a/vm/jdwp/JdwpEvent.c b/vm/jdwp/JdwpEvent.c index 903759907..b1e2a4063 100644 --- a/vm/jdwp/JdwpEvent.c +++ b/vm/jdwp/JdwpEvent.c @@ -745,7 +745,7 @@ bool dvmJdwpPostVMStart(JdwpState* state, bool suspend) { enum JdwpSuspendPolicy suspendPolicy; ObjectId threadId = dvmDbgGetThreadSelfId(); - + if (suspend) suspendPolicy = SP_ALL; else diff --git a/vm/jdwp/JdwpMain.c b/vm/jdwp/JdwpMain.c index 015f1c678..965a4b03b 100644 --- a/vm/jdwp/JdwpMain.c +++ b/vm/jdwp/JdwpMain.c @@ -209,7 +209,7 @@ void dvmJdwpShutdown(JdwpState* state) /* * Are we talking to a debugger? - */ + */ bool dvmJdwpIsActive(JdwpState* state) { return dvmJdwpIsConnected(state); diff --git a/vm/mterp/armv5te/OP_INVOKE_INTERFACE.S b/vm/mterp/armv5te/OP_INVOKE_INTERFACE.S index 5463d5c16..91b6a7ef6 100644 --- a/vm/mterp/armv5te/OP_INVOKE_INTERFACE.S +++ b/vm/mterp/armv5te/OP_INVOKE_INTERFACE.S @@ -24,5 +24,5 @@ bl dvmFindInterfaceMethodInCache @ r0<- call(class, ref, method, dex) cmp r0, #0 @ failed? beq common_exceptionThrown @ yes, handle exception - b common_invokeMethod${routine} @ jump to common handler + b common_invokeMethod${routine} @ jump to common handler diff --git a/vm/mterp/c/OP_FILL_ARRAY_DATA.c b/vm/mterp/c/OP_FILL_ARRAY_DATA.c index 157d3fc5e..095b465d2 100644 --- a/vm/mterp/c/OP_FILL_ARRAY_DATA.c +++ b/vm/mterp/c/OP_FILL_ARRAY_DATA.c @@ -14,7 +14,7 @@ HANDLE_OPCODE(OP_FILL_ARRAY_DATA) /*vAA, +BBBBBBBB*/ arrayData >= curMethod->insns + dvmGetMethodInsnsSize(curMethod)) { /* should have been caught in verifier */ - dvmThrowException("Ljava/lang/InternalError;", + dvmThrowException("Ljava/lang/InternalError;", "bad fill array data"); GOTO_exceptionThrown(); } diff --git a/vm/mterp/out/InterpAsm-armv4t.S b/vm/mterp/out/InterpAsm-armv4t.S index 7f8ff9a14..45c09414c 100644 --- a/vm/mterp/out/InterpAsm-armv4t.S +++ b/vm/mterp/out/InterpAsm-armv4t.S @@ -3362,7 +3362,7 @@ dalvik_inst: bl dvmFindInterfaceMethodInCache @ r0<- call(class, ref, method, dex) cmp r0, #0 @ failed? beq common_exceptionThrown @ yes, handle exception - b common_invokeMethodNoRange @ jump to common handler + b common_invokeMethodNoRange @ jump to common handler /* ------------------------------ */ @@ -3528,7 +3528,7 @@ dalvik_inst: bl dvmFindInterfaceMethodInCache @ r0<- call(class, ref, method, dex) cmp r0, #0 @ failed? beq common_exceptionThrown @ yes, handle exception - b common_invokeMethodRange @ jump to common handler + b common_invokeMethodRange @ jump to common handler diff --git a/vm/mterp/out/InterpAsm-armv5te-vfp.S b/vm/mterp/out/InterpAsm-armv5te-vfp.S index dc1948d85..67c87e069 100644 --- a/vm/mterp/out/InterpAsm-armv5te-vfp.S +++ b/vm/mterp/out/InterpAsm-armv5te-vfp.S @@ -3342,7 +3342,7 @@ dalvik_inst: bl dvmFindInterfaceMethodInCache @ r0<- call(class, ref, method, dex) cmp r0, #0 @ failed? beq common_exceptionThrown @ yes, handle exception - b common_invokeMethodNoRange @ jump to common handler + b common_invokeMethodNoRange @ jump to common handler /* ------------------------------ */ @@ -3508,7 +3508,7 @@ dalvik_inst: bl dvmFindInterfaceMethodInCache @ r0<- call(class, ref, method, dex) cmp r0, #0 @ failed? beq common_exceptionThrown @ yes, handle exception - b common_invokeMethodRange @ jump to common handler + b common_invokeMethodRange @ jump to common handler diff --git a/vm/mterp/out/InterpAsm-armv5te.S b/vm/mterp/out/InterpAsm-armv5te.S index ad9801572..19d3bfbba 100644 --- a/vm/mterp/out/InterpAsm-armv5te.S +++ b/vm/mterp/out/InterpAsm-armv5te.S @@ -3364,7 +3364,7 @@ dalvik_inst: bl dvmFindInterfaceMethodInCache @ r0<- call(class, ref, method, dex) cmp r0, #0 @ failed? beq common_exceptionThrown @ yes, handle exception - b common_invokeMethodNoRange @ jump to common handler + b common_invokeMethodNoRange @ jump to common handler /* ------------------------------ */ @@ -3530,7 +3530,7 @@ dalvik_inst: bl dvmFindInterfaceMethodInCache @ r0<- call(class, ref, method, dex) cmp r0, #0 @ failed? beq common_exceptionThrown @ yes, handle exception - b common_invokeMethodRange @ jump to common handler + b common_invokeMethodRange @ jump to common handler diff --git a/vm/mterp/out/InterpAsm-armv7-a-neon.S b/vm/mterp/out/InterpAsm-armv7-a-neon.S index 9cd811c74..741d83106 100644 --- a/vm/mterp/out/InterpAsm-armv7-a-neon.S +++ b/vm/mterp/out/InterpAsm-armv7-a-neon.S @@ -3332,7 +3332,7 @@ dalvik_inst: bl dvmFindInterfaceMethodInCache @ r0<- call(class, ref, method, dex) cmp r0, #0 @ failed? beq common_exceptionThrown @ yes, handle exception - b common_invokeMethodNoRange @ jump to common handler + b common_invokeMethodNoRange @ jump to common handler /* ------------------------------ */ @@ -3498,7 +3498,7 @@ dalvik_inst: bl dvmFindInterfaceMethodInCache @ r0<- call(class, ref, method, dex) cmp r0, #0 @ failed? beq common_exceptionThrown @ yes, handle exception - b common_invokeMethodRange @ jump to common handler + b common_invokeMethodRange @ jump to common handler diff --git a/vm/mterp/out/InterpAsm-armv7-a.S b/vm/mterp/out/InterpAsm-armv7-a.S index 577fc345b..1423b225a 100644 --- a/vm/mterp/out/InterpAsm-armv7-a.S +++ b/vm/mterp/out/InterpAsm-armv7-a.S @@ -3332,7 +3332,7 @@ dalvik_inst: bl dvmFindInterfaceMethodInCache @ r0<- call(class, ref, method, dex) cmp r0, #0 @ failed? beq common_exceptionThrown @ yes, handle exception - b common_invokeMethodNoRange @ jump to common handler + b common_invokeMethodNoRange @ jump to common handler /* ------------------------------ */ @@ -3498,7 +3498,7 @@ dalvik_inst: bl dvmFindInterfaceMethodInCache @ r0<- call(class, ref, method, dex) cmp r0, #0 @ failed? beq common_exceptionThrown @ yes, handle exception - b common_invokeMethodRange @ jump to common handler + b common_invokeMethodRange @ jump to common handler diff --git a/vm/mterp/out/InterpAsm-x86-atom.S b/vm/mterp/out/InterpAsm-x86-atom.S index d32ff2fff..6eb1a4595 100644 --- a/vm/mterp/out/InterpAsm-x86-atom.S +++ b/vm/mterp/out/InterpAsm-x86-atom.S @@ -14798,7 +14798,7 @@ OP_IF_LEZ_2f: /* * File: OP_THROW_VERIFICATION_ERROR.S * - * Code: + * Code: * * For: throw-verification-error * diff --git a/vm/mterp/out/InterpAsm-x86.S b/vm/mterp/out/InterpAsm-x86.S index c6542024a..66317daf7 100644 --- a/vm/mterp/out/InterpAsm-x86.S +++ b/vm/mterp/out/InterpAsm-x86.S @@ -3114,8 +3114,8 @@ dvmAsmInstructionStart = .L_OP_NOP andb $0xf,%cl # ecx<- A FETCH_INST_WORD(1) ADVANCE_PC(1) - - + + negl %eax SET_VREG(%eax,%ecx) GOTO_NEXT @@ -3137,8 +3137,8 @@ dvmAsmInstructionStart = .L_OP_NOP andb $0xf,%cl # ecx<- A FETCH_INST_WORD(1) ADVANCE_PC(1) - - + + notl %eax SET_VREG(%eax,%ecx) GOTO_NEXT @@ -3256,7 +3256,7 @@ dvmAsmInstructionStart = .L_OP_NOP andb $0xf,%cl # ecx<- A FETCH_INST_WORD(1) ADVANCE_PC(1) - + fstps (rFP,%ecx,4) # vA<- %st0 GOTO_NEXT @@ -3276,7 +3276,7 @@ dvmAsmInstructionStart = .L_OP_NOP andb $0xf,%cl # ecx<- A FETCH_INST_WORD(1) ADVANCE_PC(1) - + fstpl (rFP,%ecx,4) # vA<- %st0 GOTO_NEXT @@ -3314,7 +3314,7 @@ dvmAsmInstructionStart = .L_OP_NOP andb $0xf,%cl # ecx<- A FETCH_INST_WORD(1) ADVANCE_PC(1) - + fstps (rFP,%ecx,4) # vA<- %st0 GOTO_NEXT @@ -3334,7 +3334,7 @@ dvmAsmInstructionStart = .L_OP_NOP andb $0xf,%cl # ecx<- A FETCH_INST_WORD(1) ADVANCE_PC(1) - + fstpl (rFP,%ecx,4) # vA<- %st0 GOTO_NEXT @@ -3428,7 +3428,7 @@ dvmAsmInstructionStart = .L_OP_NOP andb $0xf,%cl # ecx<- A FETCH_INST_WORD(1) ADVANCE_PC(1) - + fstpl (rFP,%ecx,4) # vA<- %st0 GOTO_NEXT @@ -3522,7 +3522,7 @@ dvmAsmInstructionStart = .L_OP_NOP andb $0xf,%cl # ecx<- A FETCH_INST_WORD(1) ADVANCE_PC(1) - + fstps (rFP,%ecx,4) # vA<- %st0 GOTO_NEXT @@ -3543,8 +3543,8 @@ dvmAsmInstructionStart = .L_OP_NOP andb $0xf,%cl # ecx<- A FETCH_INST_WORD(1) ADVANCE_PC(1) - - + + movsbl %al,%eax SET_VREG(%eax,%ecx) GOTO_NEXT @@ -3566,8 +3566,8 @@ dvmAsmInstructionStart = .L_OP_NOP andb $0xf,%cl # ecx<- A FETCH_INST_WORD(1) ADVANCE_PC(1) - - + + movzwl %ax,%eax SET_VREG(%eax,%ecx) GOTO_NEXT @@ -3589,8 +3589,8 @@ dvmAsmInstructionStart = .L_OP_NOP andb $0xf,%cl # ecx<- A FETCH_INST_WORD(1) ADVANCE_PC(1) - - + + movswl %ax,%eax SET_VREG(%eax,%ecx) GOTO_NEXT diff --git a/vm/mterp/out/InterpC-allstubs.c b/vm/mterp/out/InterpC-allstubs.c index 4f6ca9703..7df772984 100644 --- a/vm/mterp/out/InterpC-allstubs.c +++ b/vm/mterp/out/InterpC-allstubs.c @@ -1791,7 +1791,7 @@ HANDLE_OPCODE(OP_FILL_ARRAY_DATA) /*vAA, +BBBBBBBB*/ arrayData >= curMethod->insns + dvmGetMethodInsnsSize(curMethod)) { /* should have been caught in verifier */ - dvmThrowException("Ljava/lang/InternalError;", + dvmThrowException("Ljava/lang/InternalError;", "bad fill array data"); GOTO_exceptionThrown(); } diff --git a/vm/mterp/out/InterpC-portdbg.c b/vm/mterp/out/InterpC-portdbg.c index 08172a89d..4edcbf093 100644 --- a/vm/mterp/out/InterpC-portdbg.c +++ b/vm/mterp/out/InterpC-portdbg.c @@ -1294,7 +1294,7 @@ static void updateDebugger(const Method* method, const u2* pc, const u4* fp, if (pCtrl->size == SS_MIN) { doStop = true; msg = "new instruction"; - } else if (!dvmAddressSetGet(pCtrl->pAddressSet, + } else if (!dvmAddressSetGet(pCtrl->pAddressSet, pc - method->insns)) { doStop = true; msg = "new line"; @@ -2158,7 +2158,7 @@ HANDLE_OPCODE(OP_FILL_ARRAY_DATA) /*vAA, +BBBBBBBB*/ arrayData >= curMethod->insns + dvmGetMethodInsnsSize(curMethod)) { /* should have been caught in verifier */ - dvmThrowException("Ljava/lang/InternalError;", + dvmThrowException("Ljava/lang/InternalError;", "bad fill array data"); GOTO_exceptionThrown(); } diff --git a/vm/mterp/out/InterpC-portstd.c b/vm/mterp/out/InterpC-portstd.c index 7e20714aa..36fdc17de 100644 --- a/vm/mterp/out/InterpC-portstd.c +++ b/vm/mterp/out/InterpC-portstd.c @@ -1896,7 +1896,7 @@ HANDLE_OPCODE(OP_FILL_ARRAY_DATA) /*vAA, +BBBBBBBB*/ arrayData >= curMethod->insns + dvmGetMethodInsnsSize(curMethod)) { /* should have been caught in verifier */ - dvmThrowException("Ljava/lang/InternalError;", + dvmThrowException("Ljava/lang/InternalError;", "bad fill array data"); GOTO_exceptionThrown(); } diff --git a/vm/mterp/portable/debug.c b/vm/mterp/portable/debug.c index 7ac4a025f..552785eb7 100644 --- a/vm/mterp/portable/debug.c +++ b/vm/mterp/portable/debug.c @@ -101,7 +101,7 @@ static void updateDebugger(const Method* method, const u2* pc, const u4* fp, if (pCtrl->size == SS_MIN) { doStop = true; msg = "new instruction"; - } else if (!dvmAddressSetGet(pCtrl->pAddressSet, + } else if (!dvmAddressSetGet(pCtrl->pAddressSet, pc - method->insns)) { doStop = true; msg = "new line"; diff --git a/vm/mterp/x86-atom/OP_THROW_VERIFICATION_ERROR.S b/vm/mterp/x86-atom/OP_THROW_VERIFICATION_ERROR.S index 52e52bf75..fcd42c708 100644 --- a/vm/mterp/x86-atom/OP_THROW_VERIFICATION_ERROR.S +++ b/vm/mterp/x86-atom/OP_THROW_VERIFICATION_ERROR.S @@ -16,7 +16,7 @@ /* * File: OP_THROW_VERIFICATION_ERROR.S * - * Code: + * Code: * * For: throw-verification-error * diff --git a/vm/native/InternalNative.c b/vm/native/InternalNative.c index 9b6b801ec..e2df6b29c 100644 --- a/vm/native/InternalNative.c +++ b/vm/native/InternalNative.c @@ -56,7 +56,7 @@ static DalvikNativeClass gDvmNativeMethodSet[] = { { "Ldalvik/system/VMStack;", dvm_dalvik_system_VMStack, 0 }, { "Lorg/apache/harmony/dalvik/ddmc/DdmServer;", dvm_org_apache_harmony_dalvik_ddmc_DdmServer, 0 }, - { "Lorg/apache/harmony/dalvik/ddmc/DdmVmInternal;", + { "Lorg/apache/harmony/dalvik/ddmc/DdmVmInternal;", dvm_org_apache_harmony_dalvik_ddmc_DdmVmInternal, 0 }, { "Lorg/apache/harmony/dalvik/NativeTestTarget;", dvm_org_apache_harmony_dalvik_NativeTestTarget, 0 }, @@ -264,7 +264,7 @@ bail: * check the access flags at the time of the method call. This results in * "native abstract" methods, which can't exist. If we see the "abstract" * flag set, clear the "native" flag. - * + * * We also move the DECLARED_SYNCHRONIZED flag into the SYNCHRONIZED * position, because the callers of this function are trying to convey * the "traditional" meaning of the flags to their callers. @@ -276,11 +276,11 @@ u4 dvmFixMethodFlags(u4 flags) } flags &= ~ACC_SYNCHRONIZED; - + if ((flags & ACC_DECLARED_SYNCHRONIZED) != 0) { flags |= ACC_SYNCHRONIZED; } - + return flags & JAVA_FLAGS_MASK; } diff --git a/vm/native/InternalNativePriv.h b/vm/native/InternalNativePriv.h index bcd911994..6f8d6c9ba 100644 --- a/vm/native/InternalNativePriv.h +++ b/vm/native/InternalNativePriv.h @@ -55,7 +55,7 @@ ClassObject* dvmFindClassByName(StringObject* nameObj, Object* loader, * check the access flags at the time of the method call. This results in * "native abstract" methods, which can't exist. If we see the "abstract" * flag set, clear the "native" flag. - * + * * We also move the DECLARED_SYNCHRONIZED flag into the SYNCHRONIZED * position, because the callers of this function are trying to convey * the "traditional" meaning of the flags to their callers. diff --git a/vm/native/dalvik_system_VMDebug.c b/vm/native/dalvik_system_VMDebug.c index 34398d0d4..1d7b8cbb0 100644 --- a/vm/native/dalvik_system_VMDebug.c +++ b/vm/native/dalvik_system_VMDebug.c @@ -359,7 +359,7 @@ static void Dalvik_dalvik_system_VMDebug_startMethodTracingNative(const u4* args RETURN_VOID(); } } - + dvmMethodTraceStart(traceFileName != NULL ? traceFileName : "[DDMS]", fd, bufferSize, flags, (traceFileName == NULL && fd == -1)); free(traceFileName); diff --git a/vm/native/dalvik_system_Zygote.c b/vm/native/dalvik_system_Zygote.c index 0aa811de7..4337f4dda 100644 --- a/vm/native/dalvik_system_Zygote.c +++ b/vm/native/dalvik_system_Zygote.c @@ -88,14 +88,14 @@ static void sigchldHandler(int s) #endif /* ifdef WCOREDUMP */ } - /* + /* * If the just-crashed process is the system_server, bring down zygote * so that it is restarted by init and system server will be restarted * from there. */ if (pid == gDvm.systemServerPid) { LOG(LOG_INFO, ZYGOTE_LOG_TAG, - "Exit zygote because system server (%d) has terminated\n", + "Exit zygote because system server (%d) has terminated\n", (int) pid); kill(getpid(), SIGKILL); } @@ -116,7 +116,7 @@ static void sigchldHandler(int s) * This ends up being called repeatedly before each fork(), but there's * no real harm in that. */ -static void setSignalHandler() +static void setSignalHandler() { int err; struct sigaction sa; @@ -126,7 +126,7 @@ static void setSignalHandler() sa.sa_handler = sigchldHandler; err = sigaction (SIGCHLD, &sa, NULL); - + if (err < 0) { LOGW("Error setting SIGCHLD handler errno: %d", errno); } @@ -145,13 +145,13 @@ static void unsetSignalHandler() sa.sa_handler = SIG_DFL; err = sigaction (SIGCHLD, &sa, NULL); - + if (err < 0) { LOGW("Error unsetting SIGCHLD handler errno: %d", errno); } } -/* +/* * Calls POSIX setgroups() using the int[] object as an argument. * A NULL argument is tolerated. */ @@ -217,7 +217,7 @@ static int setrlimitsFromArray(ArrayObject* rlimits) return -1; } } - + return 0; } @@ -238,7 +238,7 @@ static void Dalvik_dalvik_system_Zygote_fork(const u4* args, JValue* pResult) dvmAbort(); } - setSignalHandler(); + setSignalHandler(); dvmDumpLoaderStats("zygote"); pid = fork(); @@ -323,7 +323,7 @@ static void enableDebugFeatures(u4 debugFlags) #endif } -/* +/* * Utility routine to fork zygote and specialize the child process. */ static pid_t forkAndSpecializeCommon(const u4* args) @@ -348,7 +348,7 @@ static pid_t forkAndSpecializeCommon(const u4* args) dvmAbort(); } - setSignalHandler(); + setSignalHandler(); dvmDumpLoaderStats("zygote"); pid = fork(); @@ -403,7 +403,7 @@ static pid_t forkAndSpecializeCommon(const u4* args) /* configure additional debug options */ enableDebugFeatures(debugFlags); - unsetSignalHandler(); + unsetSignalHandler(); gDvm.zygote = false; if (!dvmInitAfterZygote()) { LOGE("error in post-zygote initialization\n"); @@ -416,8 +416,8 @@ static pid_t forkAndSpecializeCommon(const u4* args) return pid; } -/* native public static int forkAndSpecialize(int uid, int gid, - * int[] gids, int debugFlags); +/* native public static int forkAndSpecialize(int uid, int gid, + * int[] gids, int debugFlags); */ static void Dalvik_dalvik_system_Zygote_forkAndSpecialize(const u4* args, JValue* pResult) @@ -429,8 +429,8 @@ static void Dalvik_dalvik_system_Zygote_forkAndSpecialize(const u4* args, RETURN_INT(pid); } -/* native public static int forkSystemServer(int uid, int gid, - * int[] gids, int debugFlags); +/* native public static int forkSystemServer(int uid, int gid, + * int[] gids, int debugFlags); */ static void Dalvik_dalvik_system_Zygote_forkSystemServer( const u4* args, JValue* pResult) diff --git a/vm/native/java_lang_Class.c b/vm/native/java_lang_Class.c index 09b440ff1..91381ab93 100644 --- a/vm/native/java_lang_Class.c +++ b/vm/native/java_lang_Class.c @@ -385,7 +385,7 @@ static void Dalvik_java_lang_Class_getName(const u4* args, JValue* pResult) const DexFile* pDexFile = clazz->pDexFile; const DexClassDef* pClassDef; const DexClassId* pClassId; - + pDexFile = clazz->pDexFile; pClassDef = dvmDexFindClass(pDexFile, clazz->descriptor); pClassId = dvmDexGetClassId(pDexFile, pClassDef->classIdx); @@ -717,7 +717,7 @@ static void Dalvik_java_lang_Class_getDeclaredAnnotations(const u4* args, /* * public String getInnerClassName() * - * Returns the simple name of a member class or local class, or null otherwise. + * Returns the simple name of a member class or local class, or null otherwise. */ static void Dalvik_java_lang_Class_getInnerClassName(const u4* args, JValue* pResult) @@ -725,7 +725,7 @@ static void Dalvik_java_lang_Class_getInnerClassName(const u4* args, ClassObject* clazz = (ClassObject*) args[0]; StringObject* nameObj; int flags; - + if (dvmGetInnerClass(clazz, &nameObj, &flags)) { dvmReleaseTrackedAlloc((Object*) nameObj, NULL); RETURN_PTR(nameObj); diff --git a/vm/native/java_lang_VMThread.c b/vm/native/java_lang_VMThread.c index 85a54af85..e9d6cada2 100644 --- a/vm/native/java_lang_VMThread.c +++ b/vm/native/java_lang_VMThread.c @@ -68,7 +68,7 @@ static void Dalvik_java_lang_VMThread_getStatus(const u4* args, JValue* pResult) else result = THREAD_ZOMBIE; // assume it used to exist and is now gone dvmUnlockThreadList(); - + RETURN_INT(result); } @@ -198,7 +198,7 @@ static void Dalvik_java_lang_VMThread_setPriority(const u4* args, Object* thisPtr = (Object*) args[0]; int newPriority = args[1]; Thread* thread; - + dvmLockThreadList(NULL); thread = dvmGetThreadFromThreadObject(thisPtr); if (thread != NULL) diff --git a/vm/native/sun_misc_Unsafe.c b/vm/native/sun_misc_Unsafe.c index 9adebc847..82a162b0a 100644 --- a/vm/native/sun_misc_Unsafe.c +++ b/vm/native/sun_misc_Unsafe.c @@ -128,7 +128,7 @@ static void Dalvik_sun_misc_Unsafe_compareAndSwapObject(const u4* args, // Note: android_atomic_cmpxchg() returns 0 on success, not failure. int result = android_atomic_cmpxchg((int32_t) expectedValue, (int32_t) newValue, address); - + RETURN_BOOLEAN(result == 0); } @@ -222,7 +222,7 @@ static void Dalvik_sun_misc_Unsafe_putObjectVolatile(const u4* args, *address = value; RETURN_VOID(); } - + /* * public native int getInt(Object obj, long offset); */ diff --git a/vm/oo/Array.c b/vm/oo/Array.c index 84e74aa60..94911b59f 100644 --- a/vm/oo/Array.c +++ b/vm/oo/Array.c @@ -222,7 +222,7 @@ ArrayObject* dvmAllocPrimitiveArray(char type, size_t length, int allocFlags) * The dimension we're creating is in dimensions[0], so when we recurse * we advance the pointer. */ -ArrayObject* dvmAllocMultiArray(ClassObject* arrayClass, int curDim, +ArrayObject* dvmAllocMultiArray(ClassObject* arrayClass, int curDim, const int* dimensions) { ArrayObject* newArray; diff --git a/vm/oo/Class.h b/vm/oo/Class.h index d81aaeaf3..7457a60eb 100644 --- a/vm/oo/Class.h +++ b/vm/oo/Class.h @@ -71,7 +71,7 @@ void dvmSetClassSerialNumber(ClassObject* clazz); /* * Find the class with the given descriptor. Load it if it hasn't already * been. - * + * * "loader" is the initiating class loader. */ ClassObject* dvmFindClass(const char* descriptor, Object* loader); @@ -213,7 +213,7 @@ INLINE int dvmCompareMethodProtos(const Method* method1, const Method* method2) { return dexProtoCompare(&method1->prototype, &method2->prototype); -} +} /* * Compare the two method prototypes, considering only the parameters @@ -224,7 +224,7 @@ INLINE int dvmCompareMethodParameterProtos(const Method* method1, const Method* method2) { return dexProtoCompareParameters(&method1->prototype, &method2->prototype); -} +} /* * Compare the two method names and prototypes, a la strcmp(). The diff --git a/vm/oo/Object.c b/vm/oo/Object.c index 0d2da1f6f..3fa86e327 100644 --- a/vm/oo/Object.c +++ b/vm/oo/Object.c @@ -216,7 +216,7 @@ static inline int compareMethodHelper(Method* method, const char* methodName, } proto = &method->prototype; - + if (strcmp(returnType, dexProtoGetReturnType(proto)) != 0) { return 1; } @@ -256,7 +256,7 @@ static inline int compareMethodHelper(Method* method, const char* methodName, * and also find a pointer to the return type. */ static inline size_t countArgsAndFindReturnType(const char* descriptor, - const char** pReturnType) + const char** pReturnType) { size_t count = 0; bool bogus = false; @@ -264,7 +264,7 @@ static inline size_t countArgsAndFindReturnType(const char* descriptor, assert(*descriptor == '('); descriptor++; - + while (!done) { switch (*descriptor) { case 'B': case 'C': case 'D': case 'F': @@ -297,7 +297,7 @@ static inline size_t countArgsAndFindReturnType(const char* descriptor, break; } case ')': { - /* + /* * Note: The loop will exit after incrementing descriptor * one more time, so it then points at the return type. */ @@ -336,7 +336,7 @@ static inline void copyTypes(char* buffer, const char** argTypes, /* Skip the '('. */ descriptor++; - + for (i = 0; i < argCount; i++) { argTypes[i] = buffer; @@ -353,9 +353,9 @@ static inline void copyTypes(char* buffer, const char** argTypes, *(buffer++) = c; } while (c != ';'); } - + *(buffer++) = '\0'; - } + } } /* @@ -395,7 +395,7 @@ static Method* findMethodInListByDescriptor(const ClassObject* clazz, methods = clazz->directMethods; methodCount = clazz->directMethodCount; } - + for (i = 0; i < methodCount; i++) { Method* method = &methods[i]; if (compareMethodHelper(method, name, returnType, argCount, @@ -424,7 +424,7 @@ static Method* findMethodInListByDescriptor(const ClassObject* clazz, */ static Method* findMethodInListByProto(const ClassObject* clazz, MethodType wantedType, bool isHier, const char* name, const DexProto* proto) -{ +{ while (clazz != NULL) { int i; diff --git a/vm/oo/Object.h b/vm/oo/Object.h index 07daa89d2..4afc82cf5 100644 --- a/vm/oo/Object.h +++ b/vm/oo/Object.h @@ -892,8 +892,8 @@ INLINE bool dvmIsFinalClass(const ClassObject* clazz) { INLINE bool dvmIsAbstractClass(const ClassObject* clazz) { return (clazz->accessFlags & ACC_ABSTRACT) != 0; } -INLINE bool dvmIsAnnotationClass(const ClassObject* clazz) { - return (clazz->accessFlags & ACC_ANNOTATION) != 0; +INLINE bool dvmIsAnnotationClass(const ClassObject* clazz) { + return (clazz->accessFlags & ACC_ANNOTATION) != 0; } INLINE bool dvmIsPrimitiveClass(const ClassObject* clazz) { return clazz->primitiveType != PRIM_NOT; diff --git a/vm/reflect/Annotation.c b/vm/reflect/Annotation.c index c2f5131b6..cfaa0abe8 100644 --- a/vm/reflect/Annotation.c +++ b/vm/reflect/Annotation.c @@ -120,8 +120,8 @@ bool dvmReflectAnnotationStartup(void) */ static u4 readUleb128(const u1** pBuf) { - u4 result = 0; - int shift = 0; + u4 result = 0; + int shift = 0; const u1* buf = *pBuf; u1 val; @@ -174,7 +174,7 @@ static ArrayObject* emptyAnnoArray(void) } /* - * Return an array of empty arrays of Annotation objects. + * Return an array of empty arrays of Annotation objects. * * Caller must call dvmReleaseTrackedAlloc(). */ @@ -183,7 +183,7 @@ static ArrayObject* emptyAnnoArrayArray(int numElements) Thread* self = dvmThreadSelf(); ArrayObject* arr; int i; - + arr = dvmAllocArrayByClass(gDvm.classJavaLangAnnotationAnnotationArrayArray, numElements, ALLOC_DEFAULT); if (arr != NULL) { @@ -2127,7 +2127,7 @@ ArrayObject* dvmGetParameterAnnotations(const Method* method) /** * Initializes an encoded array iterator. - * + * * @param iterator iterator to initialize * @param encodedArray encoded array to iterate over * @param clazz class to use when resolving strings and types @@ -2153,9 +2153,9 @@ bool dvmEncodedArrayIteratorHasNext(const EncodedArrayIterator* iterator) { * cursor. This returns primitive values in their corresponding union * slots, and returns everything else (including nulls) as object * references in the "l" union slot. - * + * * The caller must call dvmReleaseTrackedAlloc() on any returned reference. - * + * * @param value pointer to store decoded value into * @returns true if a value was decoded and the cursor advanced; false if * the last value had already been decoded or if there was a problem decoding diff --git a/vm/reflect/Proxy.c b/vm/reflect/Proxy.c index 5d201a65d..4984b12c5 100644 --- a/vm/reflect/Proxy.c +++ b/vm/reflect/Proxy.c @@ -136,7 +136,7 @@ ClassObject* dvmGenerateProxyClass(StringObject* str, ArrayObject* interfaces, ArrayObject* throws = NULL; ClassObject* newClass = NULL; int i; - + nameStr = dvmCreateCstrFromString(str); if (nameStr == NULL) { dvmThrowException("Ljava/lang/IllegalArgumentException;", @@ -797,7 +797,7 @@ static void createConstructor(ClassObject* clazz, Method* meth) meth->name = "<init>"; meth->prototype = gDvm.methJavaLangReflectProxy_constructorPrototype->prototype; - meth->shorty = + meth->shorty = gDvm.methJavaLangReflectProxy_constructorPrototype->shorty; // no pDexCode or pDexMethod @@ -862,7 +862,7 @@ static ArrayObject* boxMethodArgs(const Method* method, const u4* args) */ int srcIndex = 0; - + argCount = 0; while (*desc != '\0') { char descChar = *(desc++); diff --git a/vm/reflect/Reflect.c b/vm/reflect/Reflect.c index 7fc07b55c..17be3aac5 100644 --- a/vm/reflect/Reflect.c +++ b/vm/reflect/Reflect.c @@ -71,9 +71,9 @@ bool dvmReflectStartup(void) return false; } - gDvm.classJavaLangClassArray = + gDvm.classJavaLangClassArray = dvmFindArrayClass("[Ljava/lang/Class;", NULL); - gDvm.classJavaLangObjectArray = + gDvm.classJavaLangObjectArray = dvmFindArrayClass("[Ljava/lang/Object;", NULL); if (gDvm.classJavaLangClassArray == NULL || gDvm.classJavaLangObjectArray == NULL) @@ -1029,7 +1029,7 @@ int dvmConvertArgument(DataObject* arg, ClassObject* type, s4* destPtr) DataObject* dvmWrapPrimitive(JValue value, ClassObject* returnType) { static const char* boxTypes[] = { // order from enum PrimitiveType - "Ljava/lang/Boolean;", + "Ljava/lang/Boolean;", "Ljava/lang/Character;", "Ljava/lang/Float;", "Ljava/lang/Double;", diff --git a/vm/reflect/Reflect.h b/vm/reflect/Reflect.h index cd8e76c4e..16e714844 100644 --- a/vm/reflect/Reflect.h +++ b/vm/reflect/Reflect.h @@ -208,7 +208,7 @@ typedef struct { /** * Initializes an encoded array iterator. - * + * * @param iterator iterator to initialize * @param encodedArray encoded array to iterate over * @param clazz class to use when resolving strings and types @@ -226,9 +226,9 @@ bool dvmEncodedArrayIteratorHasNext(const EncodedArrayIterator* iterator); * cursor. This returns primitive values in their corresponding union * slots, and returns everything else (including nulls) as object * references in the "l" union slot. - * + * * The caller must call dvmReleaseTrackedAlloc() on any returned reference. - * + * * @param value pointer to store decoded value into * @returns true if a value was decoded and the cursor advanced; false if * the last value had already been decoded or if there was a problem decoding diff --git a/vm/test/AtomicSpeed.c b/vm/test/AtomicSpeed.c index b569668fb..859c65d5d 100644 --- a/vm/test/AtomicSpeed.c +++ b/vm/test/AtomicSpeed.c @@ -30,7 +30,7 @@ u8 dvmTestAtomicSpeedSub(int repeatCount) int* valuePtr = &value; u8 start, end; int i; - + #ifdef TRIVIAL_COMPARE /* init to arg value so compiler can't pre-determine result */ int j = repeatCount; |