OSDN Git Service

auto import //branches/master/...@140412
authorThe Android Open Source Project <initial-contribution@android.com>
Thu, 19 Mar 2009 05:20:24 +0000 (22:20 -0700)
committerThe Android Open Source Project <initial-contribution@android.com>
Thu, 19 Mar 2009 05:20:24 +0000 (22:20 -0700)
375 files changed:
dalvikvm/Main.c
dexdump/DexDump.c
dx/src/com/android/dx/Version.java
dx/src/com/android/dx/cf/attrib/AttAnnotationDefault.java
dx/src/com/android/dx/cf/attrib/AttCode.java
dx/src/com/android/dx/cf/attrib/AttConstantValue.java
dx/src/com/android/dx/cf/attrib/AttDeprecated.java
dx/src/com/android/dx/cf/attrib/AttEnclosingMethod.java
dx/src/com/android/dx/cf/attrib/AttExceptions.java
dx/src/com/android/dx/cf/attrib/AttInnerClasses.java
dx/src/com/android/dx/cf/attrib/AttLineNumberTable.java
dx/src/com/android/dx/cf/attrib/AttLocalVariableTable.java
dx/src/com/android/dx/cf/attrib/AttLocalVariableTypeTable.java
dx/src/com/android/dx/cf/attrib/AttRuntimeInvisibleAnnotations.java
dx/src/com/android/dx/cf/attrib/AttRuntimeInvisibleParameterAnnotations.java
dx/src/com/android/dx/cf/attrib/AttRuntimeVisibleAnnotations.java
dx/src/com/android/dx/cf/attrib/AttRuntimeVisibleParameterAnnotations.java
dx/src/com/android/dx/cf/attrib/AttSignature.java
dx/src/com/android/dx/cf/attrib/AttSourceFile.java
dx/src/com/android/dx/cf/attrib/AttSynthetic.java
dx/src/com/android/dx/cf/attrib/BaseAnnotations.java
dx/src/com/android/dx/cf/attrib/BaseAttribute.java
dx/src/com/android/dx/cf/attrib/BaseLocalVariables.java
dx/src/com/android/dx/cf/attrib/BaseParameterAnnotations.java
dx/src/com/android/dx/cf/attrib/InnerClassList.java
dx/src/com/android/dx/cf/attrib/RawAttribute.java
dx/src/com/android/dx/cf/code/BaseMachine.java
dx/src/com/android/dx/cf/code/BasicBlocker.java
dx/src/com/android/dx/cf/code/ByteBlock.java
dx/src/com/android/dx/cf/code/ByteBlockList.java
dx/src/com/android/dx/cf/code/ByteCatchList.java
dx/src/com/android/dx/cf/code/ByteOps.java
dx/src/com/android/dx/cf/code/BytecodeArray.java
dx/src/com/android/dx/cf/code/ConcreteMethod.java
dx/src/com/android/dx/cf/code/ExecutionStack.java
dx/src/com/android/dx/cf/code/Frame.java
dx/src/com/android/dx/cf/code/LineNumberList.java
dx/src/com/android/dx/cf/code/LocalVariableList.java
dx/src/com/android/dx/cf/code/LocalsArray.java
dx/src/com/android/dx/cf/code/LocalsArraySet.java
dx/src/com/android/dx/cf/code/Machine.java
dx/src/com/android/dx/cf/code/Merger.java
dx/src/com/android/dx/cf/code/OneLocalsArray.java
dx/src/com/android/dx/cf/code/ReturnAddress.java
dx/src/com/android/dx/cf/code/Ropper.java
dx/src/com/android/dx/cf/code/RopperMachine.java
dx/src/com/android/dx/cf/code/Simulator.java
dx/src/com/android/dx/cf/code/SwitchList.java
dx/src/com/android/dx/cf/code/ValueAwareMachine.java
dx/src/com/android/dx/cf/cst/ConstantPoolParser.java
dx/src/com/android/dx/cf/cst/ConstantTags.java
dx/src/com/android/dx/cf/direct/AnnotationParser.java
dx/src/com/android/dx/cf/direct/AttributeFactory.java
dx/src/com/android/dx/cf/direct/AttributeListParser.java
dx/src/com/android/dx/cf/direct/ClassPathOpener.java
dx/src/com/android/dx/cf/direct/CodeObserver.java
dx/src/com/android/dx/cf/direct/DirectClassFile.java
dx/src/com/android/dx/cf/direct/FieldListParser.java
dx/src/com/android/dx/cf/direct/MemberListParser.java
dx/src/com/android/dx/cf/direct/MethodListParser.java
dx/src/com/android/dx/cf/direct/StdAttributeFactory.java
dx/src/com/android/dx/cf/iface/Attribute.java
dx/src/com/android/dx/cf/iface/AttributeList.java
dx/src/com/android/dx/cf/iface/ClassFile.java
dx/src/com/android/dx/cf/iface/Field.java
dx/src/com/android/dx/cf/iface/FieldList.java
dx/src/com/android/dx/cf/iface/Member.java
dx/src/com/android/dx/cf/iface/Method.java
dx/src/com/android/dx/cf/iface/MethodList.java
dx/src/com/android/dx/cf/iface/ParseObserver.java
dx/src/com/android/dx/cf/iface/StdAttributeList.java
dx/src/com/android/dx/cf/iface/StdField.java
dx/src/com/android/dx/cf/iface/StdFieldList.java
dx/src/com/android/dx/cf/iface/StdMember.java
dx/src/com/android/dx/cf/iface/StdMethod.java
dx/src/com/android/dx/cf/iface/StdMethodList.java
dx/src/com/android/dx/command/DxConsole.java
dx/src/com/android/dx/command/Main.java
dx/src/com/android/dx/command/annotool/AnnotationLister.java
dx/src/com/android/dx/command/dexer/Main.java
dx/src/com/android/dx/command/dump/BaseDumper.java
dx/src/com/android/dx/command/dump/BlockDumper.java
dx/src/com/android/dx/command/dump/ClassDumper.java
dx/src/com/android/dx/command/dump/DotDumper.java
dx/src/com/android/dx/command/dump/Main.java
dx/src/com/android/dx/command/dump/SsaDumper.java
dx/src/com/android/dx/dex/cf/AttributeTranslator.java
dx/src/com/android/dx/dex/cf/CfTranslator.java
dx/src/com/android/dx/dex/cf/CodeStatistics.java
dx/src/com/android/dx/dex/cf/OptimizerOptions.java
dx/src/com/android/dx/dex/code/ArrayData.java
dx/src/com/android/dx/dex/code/BlockAddresses.java
dx/src/com/android/dx/dex/code/CatchBuilder.java
dx/src/com/android/dx/dex/code/CatchHandlerList.java
dx/src/com/android/dx/dex/code/CatchTable.java
dx/src/com/android/dx/dex/code/CodeAddress.java
dx/src/com/android/dx/dex/code/CstInsn.java
dx/src/com/android/dx/dex/code/DalvCode.java
dx/src/com/android/dx/dex/code/DalvInsn.java
dx/src/com/android/dx/dex/code/DalvInsnList.java
dx/src/com/android/dx/dex/code/Dop.java
dx/src/com/android/dx/dex/code/Dops.java
dx/src/com/android/dx/dex/code/FixedSizeInsn.java
dx/src/com/android/dx/dex/code/HighRegisterPrefix.java
dx/src/com/android/dx/dex/code/InsnFormat.java
dx/src/com/android/dx/dex/code/LocalEnd.java
dx/src/com/android/dx/dex/code/LocalList.java
dx/src/com/android/dx/dex/code/LocalSnapshot.java
dx/src/com/android/dx/dex/code/LocalStart.java
dx/src/com/android/dx/dex/code/OddSpacer.java
dx/src/com/android/dx/dex/code/OutputCollector.java
dx/src/com/android/dx/dex/code/OutputFinisher.java
dx/src/com/android/dx/dex/code/PositionList.java
dx/src/com/android/dx/dex/code/RopToDop.java
dx/src/com/android/dx/dex/code/RopTranslator.java
dx/src/com/android/dx/dex/code/SimpleInsn.java
dx/src/com/android/dx/dex/code/StdCatchBuilder.java
dx/src/com/android/dx/dex/code/SwitchData.java
dx/src/com/android/dx/dex/code/TargetInsn.java
dx/src/com/android/dx/dex/code/VariableSizeInsn.java
dx/src/com/android/dx/dex/code/ZeroSizeInsn.java
dx/src/com/android/dx/dex/code/form/Form10t.java
dx/src/com/android/dx/dex/code/form/Form10x.java
dx/src/com/android/dx/dex/code/form/Form11n.java
dx/src/com/android/dx/dex/code/form/Form11x.java
dx/src/com/android/dx/dex/code/form/Form12x.java
dx/src/com/android/dx/dex/code/form/Form20t.java
dx/src/com/android/dx/dex/code/form/Form21c.java
dx/src/com/android/dx/dex/code/form/Form21h.java
dx/src/com/android/dx/dex/code/form/Form21s.java
dx/src/com/android/dx/dex/code/form/Form21t.java
dx/src/com/android/dx/dex/code/form/Form22b.java
dx/src/com/android/dx/dex/code/form/Form22c.java
dx/src/com/android/dx/dex/code/form/Form22s.java
dx/src/com/android/dx/dex/code/form/Form22t.java
dx/src/com/android/dx/dex/code/form/Form22x.java
dx/src/com/android/dx/dex/code/form/Form23x.java
dx/src/com/android/dx/dex/code/form/Form30t.java
dx/src/com/android/dx/dex/code/form/Form31c.java
dx/src/com/android/dx/dex/code/form/Form31i.java
dx/src/com/android/dx/dex/code/form/Form31t.java
dx/src/com/android/dx/dex/code/form/Form32x.java
dx/src/com/android/dx/dex/code/form/Form35c.java
dx/src/com/android/dx/dex/code/form/Form3rc.java
dx/src/com/android/dx/dex/code/form/Form51l.java
dx/src/com/android/dx/dex/code/form/SpecialFormat.java
dx/src/com/android/dx/dex/file/AnnotationItem.java
dx/src/com/android/dx/dex/file/AnnotationSetItem.java
dx/src/com/android/dx/dex/file/AnnotationSetRefItem.java
dx/src/com/android/dx/dex/file/AnnotationUtils.java
dx/src/com/android/dx/dex/file/AnnotationsDirectoryItem.java
dx/src/com/android/dx/dex/file/CatchStructs.java
dx/src/com/android/dx/dex/file/ClassDataItem.java
dx/src/com/android/dx/dex/file/ClassDefItem.java
dx/src/com/android/dx/dex/file/ClassDefsSection.java
dx/src/com/android/dx/dex/file/CodeItem.java
dx/src/com/android/dx/dex/file/DebugInfoConstants.java
dx/src/com/android/dx/dex/file/DebugInfoDecoder.java
dx/src/com/android/dx/dex/file/DebugInfoEncoder.java
dx/src/com/android/dx/dex/file/DebugInfoItem.java
dx/src/com/android/dx/dex/file/DexFile.java
dx/src/com/android/dx/dex/file/EncodedArrayItem.java
dx/src/com/android/dx/dex/file/EncodedField.java
dx/src/com/android/dx/dex/file/EncodedMember.java
dx/src/com/android/dx/dex/file/EncodedMethod.java
dx/src/com/android/dx/dex/file/FieldAnnotationStruct.java
dx/src/com/android/dx/dex/file/FieldIdItem.java
dx/src/com/android/dx/dex/file/FieldIdsSection.java
dx/src/com/android/dx/dex/file/HeaderItem.java
dx/src/com/android/dx/dex/file/HeaderSection.java
dx/src/com/android/dx/dex/file/IdItem.java
dx/src/com/android/dx/dex/file/IndexedItem.java
dx/src/com/android/dx/dex/file/Item.java
dx/src/com/android/dx/dex/file/ItemType.java
dx/src/com/android/dx/dex/file/MapItem.java
dx/src/com/android/dx/dex/file/MemberIdItem.java
dx/src/com/android/dx/dex/file/MemberIdsSection.java
dx/src/com/android/dx/dex/file/MethodAnnotationStruct.java
dx/src/com/android/dx/dex/file/MethodIdItem.java
dx/src/com/android/dx/dex/file/MethodIdsSection.java
dx/src/com/android/dx/dex/file/MixedItemSection.java
dx/src/com/android/dx/dex/file/OffsettedItem.java
dx/src/com/android/dx/dex/file/ParameterAnnotationStruct.java
dx/src/com/android/dx/dex/file/ProtoIdItem.java
dx/src/com/android/dx/dex/file/ProtoIdsSection.java
dx/src/com/android/dx/dex/file/Section.java
dx/src/com/android/dx/dex/file/Statistics.java
dx/src/com/android/dx/dex/file/StringDataItem.java
dx/src/com/android/dx/dex/file/StringIdItem.java
dx/src/com/android/dx/dex/file/StringIdsSection.java
dx/src/com/android/dx/dex/file/TypeIdItem.java
dx/src/com/android/dx/dex/file/TypeIdsSection.java
dx/src/com/android/dx/dex/file/TypeListItem.java
dx/src/com/android/dx/dex/file/UniformItemSection.java
dx/src/com/android/dx/dex/file/UniformListItem.java
dx/src/com/android/dx/dex/file/ValueEncoder.java
dx/src/com/android/dx/rop/annotation/Annotation.java
dx/src/com/android/dx/rop/annotation/AnnotationVisibility.java
dx/src/com/android/dx/rop/annotation/Annotations.java
dx/src/com/android/dx/rop/annotation/AnnotationsList.java
dx/src/com/android/dx/rop/annotation/NameValuePair.java
dx/src/com/android/dx/rop/code/AccessFlags.java
dx/src/com/android/dx/rop/code/BasicBlock.java
dx/src/com/android/dx/rop/code/BasicBlockList.java
dx/src/com/android/dx/rop/code/ConservativeTranslationAdvice.java
dx/src/com/android/dx/rop/code/CstInsn.java
dx/src/com/android/dx/rop/code/DexTranslationAdvice.java
dx/src/com/android/dx/rop/code/Exceptions.java
dx/src/com/android/dx/rop/code/FillArrayDataInsn.java
dx/src/com/android/dx/rop/code/Insn.java
dx/src/com/android/dx/rop/code/InsnList.java
dx/src/com/android/dx/rop/code/LocalItem.java
dx/src/com/android/dx/rop/code/LocalVariableExtractor.java
dx/src/com/android/dx/rop/code/LocalVariableInfo.java
dx/src/com/android/dx/rop/code/PlainCstInsn.java
dx/src/com/android/dx/rop/code/PlainInsn.java
dx/src/com/android/dx/rop/code/RegOps.java
dx/src/com/android/dx/rop/code/RegisterSpec.java
dx/src/com/android/dx/rop/code/RegisterSpecList.java
dx/src/com/android/dx/rop/code/RegisterSpecSet.java
dx/src/com/android/dx/rop/code/Rop.java
dx/src/com/android/dx/rop/code/RopMethod.java
dx/src/com/android/dx/rop/code/Rops.java
dx/src/com/android/dx/rop/code/SourcePosition.java
dx/src/com/android/dx/rop/code/SwitchInsn.java
dx/src/com/android/dx/rop/code/ThrowingCstInsn.java
dx/src/com/android/dx/rop/code/ThrowingInsn.java
dx/src/com/android/dx/rop/code/TranslationAdvice.java
dx/src/com/android/dx/rop/cst/Constant.java
dx/src/com/android/dx/rop/cst/ConstantPool.java
dx/src/com/android/dx/rop/cst/CstAnnotation.java
dx/src/com/android/dx/rop/cst/CstArray.java
dx/src/com/android/dx/rop/cst/CstBaseMethodRef.java
dx/src/com/android/dx/rop/cst/CstBoolean.java
dx/src/com/android/dx/rop/cst/CstByte.java
dx/src/com/android/dx/rop/cst/CstChar.java
dx/src/com/android/dx/rop/cst/CstDouble.java
dx/src/com/android/dx/rop/cst/CstEnumRef.java
dx/src/com/android/dx/rop/cst/CstFieldRef.java
dx/src/com/android/dx/rop/cst/CstFloat.java
dx/src/com/android/dx/rop/cst/CstInteger.java
dx/src/com/android/dx/rop/cst/CstInterfaceMethodRef.java
dx/src/com/android/dx/rop/cst/CstKnownNull.java
dx/src/com/android/dx/rop/cst/CstLiteral32.java
dx/src/com/android/dx/rop/cst/CstLiteral64.java
dx/src/com/android/dx/rop/cst/CstLiteralBits.java
dx/src/com/android/dx/rop/cst/CstLong.java
dx/src/com/android/dx/rop/cst/CstMemberRef.java
dx/src/com/android/dx/rop/cst/CstMethodRef.java
dx/src/com/android/dx/rop/cst/CstNat.java
dx/src/com/android/dx/rop/cst/CstShort.java
dx/src/com/android/dx/rop/cst/CstString.java
dx/src/com/android/dx/rop/cst/CstType.java
dx/src/com/android/dx/rop/cst/CstUtf8.java
dx/src/com/android/dx/rop/cst/StdConstantPool.java
dx/src/com/android/dx/rop/cst/TypedConstant.java
dx/src/com/android/dx/rop/cst/Zeroes.java
dx/src/com/android/dx/rop/package-info.java
dx/src/com/android/dx/rop/type/Prototype.java
dx/src/com/android/dx/rop/type/StdTypeList.java
dx/src/com/android/dx/rop/type/Type.java
dx/src/com/android/dx/rop/type/TypeBearer.java
dx/src/com/android/dx/rop/type/TypeList.java
dx/src/com/android/dx/ssa/BasicRegisterMapper.java
dx/src/com/android/dx/ssa/ConstCollector.java
dx/src/com/android/dx/ssa/DeadCodeRemover.java
dx/src/com/android/dx/ssa/DomFront.java
dx/src/com/android/dx/ssa/Dominators.java
dx/src/com/android/dx/ssa/InterferenceRegisterMapper.java
dx/src/com/android/dx/ssa/LiteralOpUpgrader.java
dx/src/com/android/dx/ssa/LocalVariableExtractor.java
dx/src/com/android/dx/ssa/LocalVariableInfo.java
dx/src/com/android/dx/ssa/MoveParamCombiner.java
dx/src/com/android/dx/ssa/NormalSsaInsn.java
dx/src/com/android/dx/ssa/Optimizer.java
dx/src/com/android/dx/ssa/PhiInsn.java
dx/src/com/android/dx/ssa/RegisterMapper.java
dx/src/com/android/dx/ssa/SetFactory.java
dx/src/com/android/dx/ssa/SsaBasicBlock.java
dx/src/com/android/dx/ssa/SsaConverter.java
dx/src/com/android/dx/ssa/SsaInsn.java
dx/src/com/android/dx/ssa/SsaMethod.java
dx/src/com/android/dx/ssa/SsaRenamer.java
dx/src/com/android/dx/ssa/_tests/_DomFront.java
dx/src/com/android/dx/ssa/back/FirstFitAllocator.java
dx/src/com/android/dx/ssa/back/FirstFitLocalCombiningAllocator.java
dx/src/com/android/dx/ssa/back/IdenticalBlockCombiner.java
dx/src/com/android/dx/ssa/back/InterferenceGraph.java
dx/src/com/android/dx/ssa/back/LivenessAnalyzer.java
dx/src/com/android/dx/ssa/back/NullRegisterAllocator.java
dx/src/com/android/dx/ssa/back/RegisterAllocator.java
dx/src/com/android/dx/ssa/back/SsaToRop.java
dx/src/com/android/dx/ssa/package-info.java
dx/src/com/android/dx/util/AnnotatedOutput.java
dx/src/com/android/dx/util/BitIntSet.java
dx/src/com/android/dx/util/Bits.java
dx/src/com/android/dx/util/ByteArray.java
dx/src/com/android/dx/util/ByteArrayAnnotatedOutput.java
dx/src/com/android/dx/util/ExceptionWithContext.java
dx/src/com/android/dx/util/FileUtils.java
dx/src/com/android/dx/util/FixedSizeList.java
dx/src/com/android/dx/util/Hex.java
dx/src/com/android/dx/util/HexParser.java
dx/src/com/android/dx/util/IndentingWriter.java
dx/src/com/android/dx/util/IntList.java
dx/src/com/android/dx/util/IntSet.java
dx/src/com/android/dx/util/LabeledItem.java
dx/src/com/android/dx/util/LabeledList.java
dx/src/com/android/dx/util/MutabilityControl.java
dx/src/com/android/dx/util/Output.java
dx/src/com/android/dx/util/ToHuman.java
dx/src/com/android/dx/util/TwoColumnOutput.java
dx/src/com/android/dx/util/Writers.java
dx/src/com/android/dx/util/_tests/_Bits.java
dx/src/com/android/dx/util/_tests/_IntList.java
libcore/dalvik/src/main/java/dalvik/system/PathClassLoader.java
libcore/dalvik/src/main/java/dalvik/system/VMDebug.java
libcore/luni/src/main/native/org_apache_harmony_luni_platform_OSNetworkSystem.cpp
libcore/nio/src/test/java/org/apache/harmony/nio/tests/java/nio/channels/SocketChannelTest.java
libcore/prefs/src/main/java/java/util/prefs/Preferences.java
libcore/text/src/main/java/java/text/RuleBasedCollator.java
libdex/DexFile.c
libdex/DexFile.h
libdex/SysUtil.c
libdex/SysUtil.h
vm/Android.mk
vm/Dalvik.h
vm/Debugger.c
vm/Globals.h
vm/Init.c
vm/Init.h
vm/Jni.c
vm/Misc.h
vm/Native.c
vm/Profile.c
vm/Profile.h
vm/Thread.c
vm/Thread.h
vm/alloc/Alloc.h
vm/alloc/Heap.c
vm/alloc/HeapInternal.h
vm/alloc/HeapWorker.c
vm/alloc/MarkSweep.c
vm/analysis/CodeVerify.c
vm/analysis/CodeVerify.h
vm/analysis/DexOptimize.c
vm/analysis/DexOptimize.h
vm/analysis/DexVerify.c
vm/analysis/RegisterMap.c
vm/analysis/RegisterMap.h
vm/analysis/VerifySubs.h
vm/hprof/Hprof.c
vm/hprof/Hprof.h
vm/interp/Stack.c
vm/mterp/armv5te/OP_MONITOR_ENTER.S
vm/mterp/armv5te/footer.S
vm/mterp/c/OP_MONITOR_ENTER.c
vm/mterp/c/header.c
vm/mterp/cstubs/stubdefs.c
vm/mterp/out/InterpAsm-armv4.S
vm/mterp/out/InterpAsm-armv5te.S
vm/mterp/out/InterpAsm-x86.S
vm/mterp/out/InterpC-allstubs.c
vm/mterp/out/InterpC-armv4.c
vm/mterp/out/InterpC-armv5te.c
vm/mterp/out/InterpC-portdbg.c
vm/mterp/out/InterpC-portstd.c
vm/mterp/out/InterpC-x86.c
vm/mterp/portable/stubdefs.c
vm/mterp/x86/OP_MONITOR_ENTER.S
vm/mterp/x86/footer.S
vm/native/dalvik_system_VMDebug.c
vm/oo/Class.c
vm/test/AtomicSpeed.c [new file with mode: 0644]
vm/test/Test.h

index 70cc61f..a6439fb 100644 (file)
@@ -115,7 +115,7 @@ static int methodIsPublic(JNIEnv* env, jclass clazz, jmethodID methodId)
     }
     getModifiersId = (*env)->GetMethodID(env, methodClass,
                         "getModifiers", "()I");
-    if (methodClass == NULL) {
+    if (getModifiersId == NULL) {
         fprintf(stderr, "Dalvik VM unable to find reflect.Method.getModifiers\n");
         goto bail;
     }
index a4d97eb..879288b 100644 (file)
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 /*
  * The "dexdump" tool is intended to mimic "objdump".  When possible, use
  * similar command-line arguments.
@@ -48,6 +49,7 @@ struct {
     bool disassemble;
     bool showFileHeaders;
     bool showSectionHeaders;
+    bool dumpRegisterMaps;
     const char* tempFileName;
 } gOptions;
 
@@ -67,6 +69,14 @@ static inline u2 get2LE(unsigned char const* pSrc)
 }   
 
 /*
+ * 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);
+}   
+
+/*
  * Return a newly-allocated string for the "dot version" of the class
  * name for the given type descriptor. That is, The initial "L" and
  * final ";" (if any) have been removed and all occurrences of '/'
@@ -958,6 +968,8 @@ void dumpIField(const DexFile* pDexFile, const DexField* pIField, int i)
 
 /*
  * Dump the class.
+ *
+ * Note "idx" is a DexClassDef index, not a DexTypeId index.
  */
 void dumpClass(DexFile* pDexFile, int idx)
 {
@@ -1039,6 +1051,164 @@ void dumpClass(DexFile* pDexFile, int idx)
     free(accessStr);
 }
 
+
+/*
+ * Advance "ptr" to ensure 32-bit alignment.
+ */
+static inline const u1* align32(const u1* ptr)
+{
+    return (u1*) (((int) ptr + 3) & ~0x03);
+}
+
+/*
+ * Dump register map contents of the current method.
+ *
+ * "*pData" should point to the start of the register map data.  Advances
+ * "*pData" to the start of the next map.
+ */
+void dumpMethodMap(DexFile* pDexFile, const DexMethod* pDexMethod, int idx,
+    const u1** pData)
+{
+    const u1* data = *pData;
+    const DexMethodId* pMethodId;
+    const char* name;
+    int offset = data - (u1*) pDexFile->pOptHeader;
+
+    pMethodId = dexGetMethodId(pDexFile, pDexMethod->methodIdx);
+    name = dexStringById(pDexFile, pMethodId->nameIdx);
+    printf("      #%d: 0x%08x %s\n", idx, offset, name);
+
+    u1 format;
+    int addrWidth;
+
+    format = *data++;
+    if (format == 1) {              /* kRegMapFormatNone */
+        /* no map */
+        printf("        (no map)\n");
+        addrWidth = 0;
+    } else if (format == 2) {       /* kRegMapFormatCompact8 */
+        addrWidth = 1;
+    } else if (format == 3) {       /* kRegMapFormatCompact16 */
+        addrWidth = 2;
+    } else {
+        printf("        (unknown format %d!)\n", format);
+        addrWidth = -1;
+    }
+
+    if (addrWidth > 0) {
+        u1 regWidth;
+        u2 numEntries;
+        int idx, addr, byte;
+
+        regWidth = *data++;
+        numEntries = *data++;
+        numEntries |= (*data++) << 8;
+
+        for (idx = 0; idx < numEntries; idx++) {
+            addr = *data++;
+            if (addrWidth > 1)
+                addr |= (*data++) << 8;
+
+            printf("        %4x:", addr);
+            for (byte = 0; byte < regWidth; byte++) {
+                printf(" %02x", *data++);
+            }
+            printf("\n");
+        }
+    }
+
+    //if (addrWidth >= 0)
+    //    *pData = align32(data);
+    *pData = data;
+}
+
+/*
+ * Dump the contents of the register map area.
+ *
+ * These are only present in optimized DEX files, and the structure is
+ * not really exposed to other parts of the VM itself.  We're going to
+ * dig through them here, but this is pretty fragile.  DO NOT rely on
+ * this or derive other code from it.
+ */
+void dumpRegisterMaps(DexFile* pDexFile)
+{
+    const u1* pClassPool = pDexFile->pRegisterMapPool;
+    const u4* classOffsets;
+    const u1* ptr;
+    u4 numClasses;
+    int baseFileOffset = (u1*) pClassPool - (u1*) pDexFile->pOptHeader;
+    int idx;
+
+    if (pClassPool == NULL) {
+        printf("No register maps found\n");
+        return;
+    }
+
+    ptr = pClassPool;
+    numClasses = get4LE(ptr);
+    ptr += sizeof(u4);
+    classOffsets = (const u4*) ptr;
+
+    printf("RMAP begins at offset 0x%07x\n", baseFileOffset);
+    printf("Maps for %d classes\n", numClasses);
+    for (idx = 0; idx < (int) numClasses; idx++) {
+        const DexClassDef* pClassDef;
+        const char* classDescriptor;
+
+        pClassDef = dexGetClassDef(pDexFile, idx);
+        classDescriptor = dexStringByTypeIdx(pDexFile, pClassDef->classIdx);
+
+        printf("%4d: +%d (0x%08x) %s\n", idx, classOffsets[idx],
+            baseFileOffset + classOffsets[idx], classDescriptor);
+
+        if (classOffsets[idx] == 0)
+            continue;
+
+        /*
+         * What follows is a series of RegisterMap entries, one for every
+         * direct method, then one for every virtual method.
+         */
+        DexClassData* pClassData;
+        const u1* pEncodedData;
+        const u1* data = (u1*) pClassPool + classOffsets[idx];
+        u2 methodCount;
+        int i;
+
+        pEncodedData = dexGetClassData(pDexFile, pClassDef);
+        pClassData = dexReadAndVerifyClassData(&pEncodedData, NULL);
+        if (pClassData == NULL) {
+            fprintf(stderr, "Trouble reading class data\n");
+            continue;
+        }
+
+        methodCount = *data++;
+        methodCount |= (*data++) << 8;
+        data += 2;      /* two pad bytes follow methodCount */
+        if (methodCount != pClassData->header.directMethodsSize
+                            + pClassData->header.virtualMethodsSize)
+        {
+            printf("NOTE: method count discrepancy (%d != %d + %d)\n",
+                methodCount, pClassData->header.directMethodsSize,
+                pClassData->header.virtualMethodsSize);
+            /* this is bad, but keep going anyway */
+        }
+
+        printf("    direct methods: %d\n",
+            pClassData->header.directMethodsSize);
+        for (i = 0; i < (int) pClassData->header.directMethodsSize; i++) {
+            dumpMethodMap(pDexFile, &pClassData->directMethods[i], i, &data);
+        }
+
+        printf("    virtual methods: %d\n",
+            pClassData->header.virtualMethodsSize);
+        for (i = 0; i < (int) pClassData->header.virtualMethodsSize; i++) {
+            dumpMethodMap(pDexFile, &pClassData->virtualMethods[i], i, &data);
+        }
+
+        free(pClassData);
+    }
+}
+
 /*
  * Dump the requested sections of the file.
  */
@@ -1049,6 +1219,11 @@ void processDexFile(const char* fileName, DexFile* pDexFile)
     printf("Opened '%s', DEX version '%.3s'\n", fileName,
         pDexFile->pHeader->magic +4);
 
+    if (gOptions.dumpRegisterMaps) {
+        dumpRegisterMaps(pDexFile);
+        return;
+    }
+
     if (gOptions.showFileHeaders)
         dumpFileHeader(pDexFile);
 
@@ -1103,11 +1278,13 @@ bail:
 void usage(void)
 {
     fprintf(stderr, "Copyright (C) 2007 The Android Open Source Project\n\n");
-    fprintf(stderr, "%s: [-d] [-f] [-h] [-t tempfile] dexfile...\n", gProgName);
+    fprintf(stderr, "%s: [-d] [-f] [-h] [-m] [-t tempfile] dexfile...\n",
+        gProgName);
     fprintf(stderr, "\n");
     fprintf(stderr, " -d : disassemble code sections\n");
     fprintf(stderr, " -f : display summary information from file header\n");
     fprintf(stderr, " -h : display file header details\n");
+    fprintf(stderr, " -m : dump register maps (and nothing else)\n");
     fprintf(stderr, " -t : temp file name (defaults to /sdcard/dex-temp-*)\n");
 }
 
@@ -1124,7 +1301,7 @@ int main(int argc, char* const argv[])
     memset(&gOptions, 0, sizeof(gOptions));
 
     while (1) {
-        ic = getopt(argc, argv, "dfht:");
+        ic = getopt(argc, argv, "dfhmt:");
         if (ic < 0)
             break;
 
@@ -1138,6 +1315,9 @@ int main(int argc, char* const argv[])
         case 'h':       // dump section headers, i.e. all meta-data
             gOptions.showSectionHeaders = true;
             break;
+        case 'm':       // dump register maps only
+            gOptions.dumpRegisterMaps = true;
+            break;
         case 't':       // temp file, used when opening compressed Jar
             gOptions.tempFileName = argv[optind];
             break;
index 02dc7b2..9e68d92 100644 (file)
@@ -20,6 +20,6 @@ package com.android.dx;
  * Version number for dx.
  */
 public class Version {
-    /** non-null; version string */
+    /** {@code non-null;} version string */
     public static final String VERSION = "1.2";
 }
index 12e1f74..acf5a9e 100644 (file)
@@ -19,24 +19,24 @@ package com.android.dx.cf.attrib;
 import com.android.dx.rop.cst.Constant;
 
 /**
- * Attribute class for <code>AnnotationDefault</code> attributes.
+ * Attribute class for {@code AnnotationDefault} attributes.
  */
 public final class AttAnnotationDefault extends BaseAttribute {
-    /** non-null; attribute name for attributes of this type */
+    /** {@code non-null;} attribute name for attributes of this type */
     public static final String ATTRIBUTE_NAME = "AnnotationDefault";
 
-    /** non-null; the annotation default value */
+    /** {@code non-null;} the annotation default value */
     private final Constant value;
 
-    /** &gt;= 0; attribute data length in the original classfile (not
+    /** {@code >= 0;} attribute data length in the original classfile (not
      * including the attribute header) */
     private final int byteLength;
 
     /**
      * Constructs an instance.
      * 
-     * @param value non-null; the annotation default value
-     * @param byteLength &gt;= 0; attribute data length in the original
+     * @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)
      */
     public AttAnnotationDefault(Constant value, int byteLength) {
@@ -59,7 +59,7 @@ public final class AttAnnotationDefault extends BaseAttribute {
     /**
      * Gets the annotation default value.
      * 
-     * @return non-null; the value
+     * @return {@code non-null;} the value
      */
     public Constant getValue() {
         return value;
index f00da2f..89ba895 100644 (file)
@@ -22,35 +22,35 @@ import com.android.dx.cf.iface.AttributeList;
 import com.android.dx.util.MutabilityException;
 
 /**
- * Attribute class for standard <code>Code</code> attributes.
+ * Attribute class for standard {@code Code} attributes.
  */
 public final class AttCode extends BaseAttribute {
-    /** non-null; attribute name for attributes of this type */
+    /** {@code non-null;} attribute name for attributes of this type */
     public static final String ATTRIBUTE_NAME = "Code";
 
-    /** &gt;= 0; the stack size */
+    /** {@code >= 0;} the stack size */
     private final int maxStack;
 
-    /** &gt;= 0; the number of locals */
+    /** {@code >= 0;} the number of locals */
     private final int maxLocals;
 
-    /** non-null; array containing the bytecode per se */
+    /** {@code non-null;} array containing the bytecode per se */
     private final BytecodeArray code;
 
-    /** non-null; the exception table */
+    /** {@code non-null;} the exception table */
     private final ByteCatchList catches;
 
-    /** non-null; the associated list of attributes */
+    /** {@code non-null;} the associated list of attributes */
     private final AttributeList attributes;
 
     /**
      * Constructs an instance.
      * 
-     * @param maxStack &gt;= 0; the stack size
-     * @param maxLocals &gt;= 0; the number of locals
-     * @param code non-null; array containing the bytecode per se
-     * @param catches non-null; the exception table
-     * @param attributes non-null; the associated list of attributes
+     * @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
+     * @param catches {@code non-null;} the exception table
+     * @param attributes {@code non-null;} the associated list of attributes
      */
     public AttCode(int maxStack, int maxLocals, BytecodeArray code,
                    ByteCatchList catches, AttributeList attributes) {
@@ -101,7 +101,7 @@ public final class AttCode extends BaseAttribute {
     /**
      * Gets the maximum stack size.
      * 
-     * @return &gt;= 0; the maximum stack size
+     * @return {@code >= 0;} the maximum stack size
      */
     public int getMaxStack() {
         return maxStack;
@@ -110,7 +110,7 @@ public final class AttCode extends BaseAttribute {
     /**
      * Gets the number of locals.
      * 
-     * @return &gt;= 0; the number of locals
+     * @return {@code >= 0;} the number of locals
      */
     public int getMaxLocals() {
         return maxLocals;
@@ -119,7 +119,7 @@ public final class AttCode extends BaseAttribute {
     /**
      * Gets the bytecode array.
      * 
-     * @return non-null; the bytecode array
+     * @return {@code non-null;} the bytecode array
      */
     public BytecodeArray getCode() {
         return code;
@@ -128,7 +128,7 @@ public final class AttCode extends BaseAttribute {
     /**
      * Gets the exception table.
      * 
-     * @return non-null; the exception table
+     * @return {@code non-null;} the exception table
      */
     public ByteCatchList getCatches() {
         return catches;
@@ -137,7 +137,7 @@ public final class AttCode extends BaseAttribute {
     /**
      * Gets the associated attribute list.
      * 
-     * @return non-null; the attribute list
+     * @return {@code non-null;} the attribute list
      */
     public AttributeList getAttributes() {
         return attributes;
index a84da43..a7436f3 100644 (file)
@@ -24,22 +24,22 @@ import com.android.dx.rop.cst.CstString;
 import com.android.dx.rop.cst.TypedConstant;
 
 /**
- * Attribute class for standard <code>ConstantValue</code> attributes.
+ * Attribute class for standard {@code ConstantValue} attributes.
  */
 public final class AttConstantValue extends BaseAttribute {
-    /** non-null; attribute name for attributes of this type */
+    /** {@code non-null;} attribute name for attributes of this type */
     public static final String ATTRIBUTE_NAME = "ConstantValue";
 
-    /** non-null; the constant value */
+    /** {@code non-null;} the constant value */
     private final TypedConstant constantValue;
 
     /**
      * Constructs an instance.
      * 
-     * @param constantValue non-null; the constant value, which must
-     * be an instance of one of: <code>CstString</code>,
-     * <code>CstInteger</code>, <code>CstLong</code>,
-     * <code>CstFloat</code>, or <code>CstDouble</code>
+     * @param constantValue {@code non-null;} the constant value, which must
+     * be an instance of one of: {@code CstString},
+     * {@code CstInteger}, {@code CstLong},
+     * {@code CstFloat}, or {@code CstDouble}
      */
     public AttConstantValue(TypedConstant constantValue) {
         super(ATTRIBUTE_NAME);
@@ -65,11 +65,11 @@ public final class AttConstantValue extends BaseAttribute {
 
     /**
      * Gets the constant value of this instance. The returned value
-     * is an instance of one of: <code>CstString</code>,
-     * <code>CstInteger</code>, <code>CstLong</code>,
-     * <code>CstFloat</code>, or <code>CstDouble</code>.
+     * is an instance of one of: {@code CstString},
+     * {@code CstInteger}, {@code CstLong},
+     * {@code CstFloat}, or {@code CstDouble}.
      * 
-     * @return non-null; the constant value
+     * @return {@code non-null;} the constant value
      */
     public TypedConstant getConstantValue() {
         return constantValue;
index cd1dd24..d440aae 100644 (file)
 package com.android.dx.cf.attrib;
 
 /**
- * Attribute class for standard <code>Deprecated</code> attributes.
+ * Attribute class for standard {@code Deprecated} attributes.
  */
 public final class AttDeprecated extends BaseAttribute {
-    /** non-null; attribute name for attributes of this type */
+    /** {@code non-null;} attribute name for attributes of this type */
     public static final String ATTRIBUTE_NAME = "Deprecated";
 
     /**
index 7cccad7..68a24d9 100644 (file)
@@ -20,24 +20,24 @@ import com.android.dx.rop.cst.CstNat;
 import com.android.dx.rop.cst.CstType;
 
 /**
- * Attribute class for standards-track <code>EnclosingMethod</code>
+ * Attribute class for standards-track {@code EnclosingMethod}
  * attributes.
  */
 public final class AttEnclosingMethod extends BaseAttribute {
-    /** non-null; attribute name for attributes of this type */
+    /** {@code non-null;} attribute name for attributes of this type */
     public static final String ATTRIBUTE_NAME = "EnclosingMethod";
 
-    /** non-null; the innermost enclosing class */
+    /** {@code non-null;} the innermost enclosing class */
     private final CstType type;
 
-    /** null-ok; the name-and-type of the innermost enclosing method, if any */
+    /** {@code null-ok;} the name-and-type of the innermost enclosing method, if any */
     private final CstNat method;
 
     /**
      * Constructs an instance.
      * 
-     * @param type non-null; the innermost enclosing class
-     * @param method null-ok; the name-and-type of the innermost enclosing
+     * @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
      */
     public AttEnclosingMethod(CstType type, CstNat method) {
@@ -59,7 +59,7 @@ public final class AttEnclosingMethod extends BaseAttribute {
     /**
      * Gets the innermost enclosing class.
      * 
-     * @return non-null; the innermost enclosing class
+     * @return {@code non-null;} the innermost enclosing class
      */
     public CstType getEnclosingClass() {
         return type;
@@ -69,7 +69,7 @@ public final class AttEnclosingMethod extends BaseAttribute {
      * Gets the name-and-type of the innermost enclosing method, if
      * any.
      * 
-     * @return null-ok; the name-and-type of the innermost enclosing
+     * @return {@code null-ok;} the name-and-type of the innermost enclosing
      * method, if any
      */
     public CstNat getMethod() {
index 59e624e..c592047 100644 (file)
@@ -20,20 +20,20 @@ import com.android.dx.rop.type.TypeList;
 import com.android.dx.util.MutabilityException;
 
 /**
- * Attribute class for standard <code>Exceptions</code> attributes.
+ * Attribute class for standard {@code Exceptions} attributes.
  */
 public final class AttExceptions extends BaseAttribute {
-    /** non-null; attribute name for attributes of this type */
+    /** {@code non-null;} attribute name for attributes of this type */
     public static final String ATTRIBUTE_NAME = "Exceptions";
 
-    /** non-null; list of exception classes */
+    /** {@code non-null;} list of exception classes */
     private final TypeList exceptions;
 
     /**
      * Constructs an instance.
      * 
-     * @param exceptions non-null; list of classes, presumed but not
-     * verified to be subclasses of <code>Throwable</code>
+     * @param exceptions {@code non-null;} list of classes, presumed but not
+     * verified to be subclasses of {@code Throwable}
      */
     public AttExceptions(TypeList exceptions) {
         super(ATTRIBUTE_NAME);
@@ -58,9 +58,9 @@ 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</code>.
+     * {@code Throwable}.
      * 
-     * @return non-null; the list of classes
+     * @return {@code non-null;} the list of classes
      */
     public TypeList getExceptions() {
         return exceptions;
index df30539..bd6c7cd 100644 (file)
@@ -19,19 +19,19 @@ package com.android.dx.cf.attrib;
 import com.android.dx.util.MutabilityException;
 
 /**
- * Attribute class for standard <code>InnerClasses</code> attributes.
+ * Attribute class for standard {@code InnerClasses} attributes.
  */
 public final class AttInnerClasses extends BaseAttribute {
-    /** non-null; attribute name for attributes of this type */
+    /** {@code non-null;} attribute name for attributes of this type */
     public static final String ATTRIBUTE_NAME = "InnerClasses";
 
-    /** non-null; list of inner class entries */
+    /** {@code non-null;} list of inner class entries */
     private final InnerClassList innerClasses;
 
     /**
      * Constructs an instance.
      * 
-     * @param innerClasses non-null; list of inner class entries
+     * @param innerClasses {@code non-null;} list of inner class entries
      */
     public AttInnerClasses(InnerClassList innerClasses) {
         super(ATTRIBUTE_NAME);
@@ -56,7 +56,7 @@ public final class AttInnerClasses extends BaseAttribute {
     /**
      * Gets the list of "inner class" entries associated with this instance.
      * 
-     * @return non-null; the list
+     * @return {@code non-null;} the list
      */
     public InnerClassList getInnerClasses() {
         return innerClasses;
index c5e65e8..38980be 100644 (file)
@@ -20,19 +20,19 @@ import com.android.dx.cf.code.LineNumberList;
 import com.android.dx.util.MutabilityException;
 
 /**
- * Attribute class for standard <code>LineNumberTable</code> attributes.
+ * Attribute class for standard {@code LineNumberTable} attributes.
  */
 public final class AttLineNumberTable extends BaseAttribute {
-    /** non-null; attribute name for attributes of this type */
+    /** {@code non-null;} attribute name for attributes of this type */
     public static final String ATTRIBUTE_NAME = "LineNumberTable";
 
-    /** non-null; list of line number entries */
+    /** {@code non-null;} list of line number entries */
     private final LineNumberList lineNumbers;
 
     /**
      * Constructs an instance.
      * 
-     * @param lineNumbers non-null; list of line number entries
+     * @param lineNumbers {@code non-null;} list of line number entries
      */
     public AttLineNumberTable(LineNumberList lineNumbers) {
         super(ATTRIBUTE_NAME);
@@ -57,7 +57,7 @@ public final class AttLineNumberTable extends BaseAttribute {
     /**
      * Gets the list of "line number" entries associated with this instance.
      * 
-     * @return non-null; the list
+     * @return {@code non-null;} the list
      */
     public LineNumberList getLineNumbers() {
         return lineNumbers;
index 893f254..53ba64f 100644 (file)
@@ -19,16 +19,16 @@ package com.android.dx.cf.attrib;
 import com.android.dx.cf.code.LocalVariableList;
 
 /**
- * Attribute class for standard <code>LocalVariableTable</code> attributes.
+ * Attribute class for standard {@code LocalVariableTable} attributes.
  */
 public final class AttLocalVariableTable extends BaseLocalVariables {
-    /** non-null; attribute name for attributes of this type */
+    /** {@code non-null;} attribute name for attributes of this type */
     public static final String ATTRIBUTE_NAME = "LocalVariableTable";
 
     /**
      * Constructs an instance.
      * 
-     * @param localVariables non-null; list of local variable entries
+     * @param localVariables {@code non-null;} list of local variable entries
      */
     public AttLocalVariableTable(LocalVariableList localVariables) {
         super(ATTRIBUTE_NAME, localVariables);
index 7037b74..49cdb0c 100644 (file)
@@ -19,16 +19,16 @@ package com.android.dx.cf.attrib;
 import com.android.dx.cf.code.LocalVariableList;
 
 /**
- * Attribute class for standard <code>LocalVariableTypeTable</code> attributes.
+ * Attribute class for standard {@code LocalVariableTypeTable} attributes.
  */
 public final class AttLocalVariableTypeTable extends BaseLocalVariables {
-    /** non-null; attribute name for attributes of this type */
+    /** {@code non-null;} attribute name for attributes of this type */
     public static final String ATTRIBUTE_NAME = "LocalVariableTypeTable";
 
     /**
      * Constructs an instance.
      * 
-     * @param localVariables non-null; list of local variable entries
+     * @param localVariables {@code non-null;} list of local variable entries
      */
     public AttLocalVariableTypeTable(LocalVariableList localVariables) {
         super(ATTRIBUTE_NAME, localVariables);
index 583ab17..e83b76f 100644 (file)
@@ -19,18 +19,18 @@ package com.android.dx.cf.attrib;
 import com.android.dx.rop.annotation.Annotations;
 
 /**
- * Attribute class for standard <code>RuntimeInvisibleAnnotations</code>
+ * Attribute class for standard {@code RuntimeInvisibleAnnotations}
  * attributes.
  */
 public final class AttRuntimeInvisibleAnnotations extends BaseAnnotations {
-    /** non-null; attribute name for attributes of this type */
+    /** {@code non-null;} attribute name for attributes of this type */
     public static final String ATTRIBUTE_NAME = "RuntimeInvisibleAnnotations";
 
     /**
      * Constructs an instance.
      * 
-     * @param annotations non-null; the list of annotations
-     * @param byteLength &gt;= 0; attribute data length in the original
+     * @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)
      */
     public AttRuntimeInvisibleAnnotations(Annotations annotations,
index 08865e1..7dfe206 100644 (file)
@@ -20,19 +20,19 @@ import com.android.dx.rop.annotation.AnnotationsList;
 
 /**
  * Attribute class for standard
- * <code>RuntimeInvisibleParameterAnnotations</code> attributes.
+ * {@code RuntimeInvisibleParameterAnnotations} attributes.
  */
 public final class AttRuntimeInvisibleParameterAnnotations
         extends BaseParameterAnnotations {
-    /** non-null; attribute name for attributes of this type */
+    /** {@code non-null;} attribute name for attributes of this type */
     public static final String ATTRIBUTE_NAME =
         "RuntimeInvisibleParameterAnnotations";
 
     /**
      * Constructs an instance.
      * 
-     * @param parameterAnnotations non-null; the parameter annotations
-     * @param byteLength &gt;= 0; attribute data length in the original
+     * @param parameterAnnotations {@code non-null;} the parameter annotations
+     * @param byteLength {@code >= 0;} attribute data length in the original
      * classfile (not including the attribute header)
      */
     public AttRuntimeInvisibleParameterAnnotations(
index c61acb5..9de0588 100644 (file)
@@ -19,18 +19,18 @@ package com.android.dx.cf.attrib;
 import com.android.dx.rop.annotation.Annotations;
 
 /**
- * Attribute class for standard <code>RuntimeVisibleAnnotations</code>
+ * Attribute class for standard {@code RuntimeVisibleAnnotations}
  * attributes.
  */
 public final class AttRuntimeVisibleAnnotations extends BaseAnnotations {
-    /** non-null; attribute name for attributes of this type */
+    /** {@code non-null;} attribute name for attributes of this type */
     public static final String ATTRIBUTE_NAME = "RuntimeVisibleAnnotations";
 
     /**
      * Constructs an instance.
      * 
-     * @param annotations non-null; the list of annotations
-     * @param byteLength &gt;= 0; attribute data length in the original
+     * @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)
      */
     public AttRuntimeVisibleAnnotations(Annotations annotations,
index dfe57b2..76607c0 100644 (file)
@@ -19,20 +19,20 @@ package com.android.dx.cf.attrib;
 import com.android.dx.rop.annotation.AnnotationsList;
 
 /**
- * Attribute class for standard <code>RuntimeVisibleParameterAnnotations</code>
+ * Attribute class for standard {@code RuntimeVisibleParameterAnnotations}
  * attributes.
  */
 public final class AttRuntimeVisibleParameterAnnotations
         extends BaseParameterAnnotations {
-    /** non-null; attribute name for attributes of this type */
+    /** {@code non-null;} attribute name for attributes of this type */
     public static final String ATTRIBUTE_NAME =
         "RuntimeVisibleParameterAnnotations";
 
     /**
      * Constructs an instance.
      * 
-     * @param annotations non-null; the parameter annotations
-     * @param byteLength &gt;= 0; attribute data length in the original
+     * @param annotations {@code non-null;} the parameter annotations
+     * @param byteLength {@code >= 0;} attribute data length in the original
      * classfile (not including the attribute header)
      */
     public AttRuntimeVisibleParameterAnnotations(
index 97edbbd..b9cb97d 100644 (file)
@@ -19,19 +19,19 @@ package com.android.dx.cf.attrib;
 import com.android.dx.rop.cst.CstUtf8;
 
 /**
- * Attribute class for standards-track <code>Signature</code> attributes.
+ * Attribute class for standards-track {@code Signature} attributes.
  */
 public final class AttSignature extends BaseAttribute {
-    /** non-null; attribute name for attributes of this type */
+    /** {@code non-null;} attribute name for attributes of this type */
     public static final String ATTRIBUTE_NAME = "Signature";
 
-    /** non-null; the signature string */
+    /** {@code non-null;} the signature string */
     private final CstUtf8 signature;
 
     /**
      * Constructs an instance.
      * 
-     * @param signature non-null; the signature string
+     * @param signature {@code non-null;} the signature string
      */
     public AttSignature(CstUtf8 signature) {
         super(ATTRIBUTE_NAME);
@@ -51,7 +51,7 @@ public final class AttSignature extends BaseAttribute {
     /**
      * Gets the signature string.
      * 
-     * @return non-null; the signature string
+     * @return {@code non-null;} the signature string
      */
     public CstUtf8 getSignature() {
         return signature;
index f087217..941a2b0 100644 (file)
@@ -19,19 +19,19 @@ package com.android.dx.cf.attrib;
 import com.android.dx.rop.cst.CstUtf8;
 
 /**
- * Attribute class for standard <code>SourceFile</code> attributes.
+ * Attribute class for standard {@code SourceFile} attributes.
  */
 public final class AttSourceFile extends BaseAttribute {
-    /** non-null; attribute name for attributes of this type */
+    /** {@code non-null;} attribute name for attributes of this type */
     public static final String ATTRIBUTE_NAME = "SourceFile";
 
-    /** non-null; name of the source file */
+    /** {@code non-null;} name of the source file */
     private final CstUtf8 sourceFile;
 
     /**
      * Constructs an instance.
      * 
-     * @param sourceFile non-null; the name of the source file
+     * @param sourceFile {@code non-null;} the name of the source file
      */
     public AttSourceFile(CstUtf8 sourceFile) {
         super(ATTRIBUTE_NAME);
@@ -51,7 +51,7 @@ public final class AttSourceFile extends BaseAttribute {
     /**
      * Gets the source file name of this instance.
      * 
-     * @return non-null; the source file
+     * @return {@code non-null;} the source file
      */
     public CstUtf8 getSourceFile() {
         return sourceFile;
index daa9b0c..e3841eb 100644 (file)
 package com.android.dx.cf.attrib;
 
 /**
- * Attribute class for standard <code>Synthetic</code> attributes.
+ * Attribute class for standard {@code Synthetic} attributes.
  */
 public final class AttSynthetic extends BaseAttribute {
-    /** non-null; attribute name for attributes of this type */
+    /** {@code non-null;} attribute name for attributes of this type */
     public static final String ATTRIBUTE_NAME = "Synthetic";
 
     /**
index 0163e2c..4d9201e 100644 (file)
@@ -23,19 +23,19 @@ import com.android.dx.util.MutabilityException;
  * Base class for annotations attributes.
  */
 public abstract class BaseAnnotations extends BaseAttribute {
-    /** non-null; list of annotations */
+    /** {@code non-null;} list of annotations */
     private final Annotations annotations;
 
-    /** &gt;= 0; attribute data length in the original classfile (not
+    /** {@code >= 0;} attribute data length in the original classfile (not
      * including the attribute header) */
     private final int byteLength;
 
     /**
      * Constructs an instance.
      * 
-     * @param attributeName non-null; the name of the attribute
-     * @param annotations non-null; the list of annotations
-     * @param byteLength &gt;= 0; attribute data length in the original
+     * @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
      * classfile (not including the attribute header)
      */
     public BaseAnnotations(String attributeName, Annotations annotations,
@@ -64,7 +64,7 @@ public abstract class BaseAnnotations extends BaseAttribute {
     /**
      * Gets the list of annotations associated with this instance.
      * 
-     * @return non-null; the list
+     * @return {@code non-null;} the list
      */
     public final Annotations getAnnotations() {
         return annotations;
index ef1c6ac..c9c1b33 100644 (file)
@@ -23,13 +23,13 @@ import com.android.dx.cf.iface.Attribute;
  * the attribute name but leaves the rest up to subclasses.
  */
 public abstract class BaseAttribute implements Attribute {
-    /** non-null; attribute name */
+    /** {@code non-null;} attribute name */
     private final String name;
 
     /**
      * Constructs an instance.
      * 
-     * @param name non-null; attribute name
+     * @param name {@code non-null;} attribute name
      */
     public BaseAttribute(String name) {
         if (name == null) {
index a39e724..5ba5889 100644 (file)
@@ -20,18 +20,18 @@ import com.android.dx.cf.code.LocalVariableList;
 import com.android.dx.util.MutabilityException;
 
 /**
- * Base attribute class for standard <code>LocalVariableTable</code>
- * and <code>LocalVariableTypeTable</code> attributes.
+ * Base attribute class for standard {@code LocalVariableTable}
+ * and {@code LocalVariableTypeTable} attributes.
  */
 public abstract class BaseLocalVariables extends BaseAttribute {
-    /** non-null; list of local variable entries */
+    /** {@code non-null;} list of local variable entries */
     private final LocalVariableList localVariables;
 
     /**
      * Constructs an instance.
      * 
-     * @param name non-null; attribute name
-     * @param localVariables non-null; list of local variable entries
+     * @param name {@code non-null;} attribute name
+     * @param localVariables {@code non-null;} list of local variable entries
      */
     public BaseLocalVariables(String name,
             LocalVariableList localVariables) {
@@ -57,7 +57,7 @@ public abstract class BaseLocalVariables extends BaseAttribute {
     /**
      * Gets the list of "local variable" entries associated with this instance.
      * 
-     * @return non-null; the list
+     * @return {@code non-null;} the list
      */
     public final LocalVariableList getLocalVariables() {
         return localVariables;
index a927e3d..1b204b3 100644 (file)
@@ -23,19 +23,19 @@ import com.android.dx.util.MutabilityException;
  * Base class for parameter annotation list attributes.
  */
 public abstract class BaseParameterAnnotations extends BaseAttribute {
-    /** non-null; list of annotations */
+    /** {@code non-null;} list of annotations */
     private final AnnotationsList parameterAnnotations;
 
-    /** &gt;= 0; attribute data length in the original classfile (not
+    /** {@code >= 0;} attribute data length in the original classfile (not
      * including the attribute header) */
     private final int byteLength;
 
     /**
      * Constructs an instance.
      * 
-     * @param attributeName non-null; the name of the attribute
-     * @param parameterAnnotations non-null; the annotations
-     * @param byteLength &gt;= 0; attribute data length in the original
+     * @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
      * classfile (not including the attribute header)
      */
     public BaseParameterAnnotations(String attributeName,
@@ -65,7 +65,7 @@ public abstract class BaseParameterAnnotations extends BaseAttribute {
     /**
      * Gets the list of annotation lists associated with this instance.
      * 
-     * @return non-null; the list
+     * @return {@code non-null;} the list
      */
     public final AnnotationsList getParameterAnnotations() {
         return parameterAnnotations;
index 3585f1d..96e1b60 100644 (file)
@@ -22,7 +22,7 @@ import com.android.dx.util.FixedSizeList;
 
 /**
  * List of "inner class" entries, which are the contents of
- * <code>InnerClasses</code> attributes.
+ * {@code InnerClasses} attributes.
  */
 public final class InnerClassList extends FixedSizeList {
     /**
@@ -37,8 +37,8 @@ public final class InnerClassList extends FixedSizeList {
     /**
      * Gets the indicated item.
      *
-     * @param n &gt;= 0; which item
-     * @return null-ok; the indicated item
+     * @param n {@code >= 0;} which item
+     * @return {@code null-ok;} the indicated item
      */
     public Item get(int n) {
         return (Item) get0(n);
@@ -47,11 +47,11 @@ public final class InnerClassList extends FixedSizeList {
     /**
      * Sets the item at the given index.
      *
-     * @param n &gt;= 0, &lt; size(); which class
-     * @param innerClass non-null; class this item refers to
-     * @param outerClass null-ok; outer class that this class is a
+     * @param n {@code >= 0, < size();} which class
+     * @param innerClass {@code non-null;} class this item refers to
+     * @param outerClass {@code null-ok;} outer class that this class is a
      * member of, if any
-     * @param innerName null-ok; original simple name of this class,
+     * @param innerName {@code null-ok;} original simple name of this class,
      * if not anonymous
      * @param accessFlags original declared access flags
      */
@@ -64,13 +64,13 @@ public final class InnerClassList extends FixedSizeList {
      * Item in an inner classes list.
      */
     public static class Item {
-        /** non-null; class this item refers to */
+        /** {@code non-null;} class this item refers to */
         private final CstType innerClass;
 
-        /** null-ok; outer class that this class is a member of, if any */
+        /** {@code null-ok;} outer class that this class is a member of, if any */
         private final CstType outerClass;
 
-        /** null-ok; original simple name of this class, if not anonymous */
+        /** {@code null-ok;} original simple name of this class, if not anonymous */
         private final CstUtf8 innerName;
 
         /** original declared access flags */
@@ -79,10 +79,10 @@ public final class InnerClassList extends FixedSizeList {
         /**
          * Constructs an instance.
          *
-         * @param innerClass non-null; class this item refers to
-         * @param outerClass null-ok; outer class that this class is a
+         * @param innerClass {@code non-null;} class this item refers to
+         * @param outerClass {@code null-ok;} outer class that this class is a
          * member of, if any
-         * @param innerName null-ok; original simple name of this
+         * @param innerName {@code null-ok;} original simple name of this
          * class, if not anonymous
          * @param accessFlags original declared access flags
          */
@@ -101,7 +101,7 @@ public final class InnerClassList extends FixedSizeList {
         /**
          * Gets the class this item refers to.
          *
-         * @return non-null; the class
+         * @return {@code non-null;} the class
          */
         public CstType getInnerClass() {
             return innerClass;
@@ -110,7 +110,7 @@ public final class InnerClassList extends FixedSizeList {
         /**
          * Gets the outer class that this item's class is a member of, if any.
          *
-         * @return null-ok; the class
+         * @return {@code null-ok;} the class
          */
         public CstType getOuterClass() {
             return outerClass;
@@ -119,7 +119,7 @@ public final class InnerClassList extends FixedSizeList {
         /**
          * Gets the original name of this item's class, if not anonymous.
          *
-         * @return null-ok; the name
+         * @return {@code null-ok;} the name
          */
         public CstUtf8 getInnerName() {
             return innerName;
index b89926d..585e5c5 100644 (file)
@@ -23,11 +23,11 @@ import com.android.dx.util.ByteArray;
  * Raw attribute, for holding onto attributes that are unrecognized.
  */
 public final class RawAttribute extends BaseAttribute {
-    /** non-null; attribute data */
+    /** {@code non-null;} attribute data */
     private final ByteArray data;
 
     /**
-     * null-ok; constant pool to use for resolution of cpis in {@link
+     * {@code null-ok;} constant pool to use for resolution of cpis in {@link
      * #data} 
      */
     private final ConstantPool pool;
@@ -35,9 +35,9 @@ public final class RawAttribute extends BaseAttribute {
     /**
      * Constructs an instance.
      * 
-     * @param name non-null; attribute name
-     * @param data non-null; attribute data
-     * @param pool null-ok; constant pool to use for cpi resolution
+     * @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
      */
     public RawAttribute(String name, ByteArray data, ConstantPool pool) {
         super(name);
@@ -53,11 +53,11 @@ public final class RawAttribute extends BaseAttribute {
     /**
      * Constructs an instance from a sub-array of a {@link ByteArray}.
      * 
-     * @param name non-null; attribute name
-     * @param data non-null; array containing the attribute data
-     * @param offset offset in <code>data</code> to the attribute data
+     * @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
      * @param length length of the attribute data, in bytes
-     * @param pool null-ok; constant pool to use for cpi resolution
+     * @param pool {@code null-ok;} constant pool to use for cpi resolution
      */
     public RawAttribute(String name, ByteArray data, int offset,
                         int length, ConstantPool pool) {
@@ -67,7 +67,7 @@ public final class RawAttribute extends BaseAttribute {
     /**
      * Get the raw data of the attribute.
      * 
-     * @return non-null; the data
+     * @return {@code non-null;} the data
      */
     public ByteArray getData() {
         return data;
@@ -83,7 +83,7 @@ public final class RawAttribute extends BaseAttribute {
      * presumably came from the class file that this attribute came
      * from.
      * 
-     * @return null-ok; the constant pool
+     * @return {@code null-ok;} the constant pool
      */
     public ConstantPool getPool() {
         return pool;
index 430e48b..b7e700d 100644 (file)
@@ -33,44 +33,44 @@ import java.util.ArrayList;
  * TypeBearer}.</p>
  */
 public abstract class BaseMachine implements Machine {
-    /* non-null; the prototype for the associated method */
+    /* {@code non-null;} the prototype for the associated method */
     private final Prototype prototype;
     
-    /** non-null; primary arguments */
+    /** {@code non-null;} primary arguments */
     private TypeBearer[] args;
 
-    /** &gt;= 0; number of primary arguments */
+    /** {@code >= 0;} number of primary arguments */
     private int argCount;
 
-    /** null-ok; type of the operation, if salient */
+    /** {@code null-ok;} type of the operation, if salient */
     private Type auxType;
 
-    /** auxiliary <code>int</code> argument */
+    /** auxiliary {@code int} argument */
     private int auxInt;
 
-    /** null-ok; auxiliary constant argument */
+    /** {@code null-ok;} auxiliary constant argument */
     private Constant auxCst;
 
     /** auxiliary branch target argument */
     private int auxTarget;
 
-    /** null-ok; auxiliary switch cases argument */
+    /** {@code null-ok;} auxiliary switch cases argument */
     private SwitchList auxCases;
 
-    /** null-ok; auxiliary initial value list for newarray */
+    /** {@code null-ok;} auxiliary initial value list for newarray */
     private ArrayList<Constant> auxInitValues;
 
-    /** &gt;= -1; last local accessed */
+    /** {@code >= -1;} last local accessed */
     private int localIndex;
 
-    /** null-ok; local target spec, if salient and calculated */
+    /** {@code null-ok;} local target spec, if salient and calculated */
     private RegisterSpec localTarget;
 
-    /** non-null; results */
+    /** {@code non-null;} results */
     private TypeBearer[] results;
 
     /**
-     * &gt;= -1; count of the results, or <code>-1</code> if no results
+     * {@code >= -1;} count of the results, or {@code -1} if no results
      * have been set
      */
     private int resultCount;
@@ -78,7 +78,7 @@ public abstract class BaseMachine implements Machine {
     /**
      * Constructs an instance.
      * 
-     * @param prototype non-null; the prototype for the associated method
+     * @param prototype {@code non-null;} the prototype for the associated method
      */
     public BaseMachine(Prototype prototype) {
         if (prototype == null) {
@@ -254,7 +254,7 @@ public abstract class BaseMachine implements Machine {
     /**
      * Gets the number of primary arguments.
      * 
-     * @return &gt;= 0; the number of primary arguments
+     * @return {@code >= 0;} the number of primary arguments
      */
     protected final int argCount() {
         return argCount;
@@ -264,7 +264,7 @@ public abstract class BaseMachine implements Machine {
      * Gets the width of the arguments (where a category-2 value counts as
      * two).
      * 
-     * @return &gt;= 0; the argument width
+     * @return {@code >= 0;} the argument width
      */
     protected final int argWidth() {
         int result = 0;
@@ -277,10 +277,10 @@ public abstract class BaseMachine implements Machine {
     }
 
     /**
-     * Gets the <code>n</code>th primary argument.
+     * Gets the {@code n}th primary argument.
      * 
-     * @param n &gt;= 0, &lt; argCount(); which argument
-     * @return non-null; the indicated argument
+     * @param n {@code >= 0, < argCount();} which argument
+     * @return {@code non-null;} the indicated argument
      */
     protected final TypeBearer arg(int n) {
         if (n >= argCount) {
@@ -298,14 +298,14 @@ public abstract class BaseMachine implements Machine {
     /**
      * Gets the type auxiliary argument.
      * 
-     * @return null-ok; the salient type
+     * @return {@code null-ok;} the salient type
      */
     protected final Type getAuxType() {
         return auxType;
     }
 
     /**
-     * Gets the <code>int</code> auxiliary argument.
+     * Gets the {@code int} auxiliary argument.
      * 
      * @return the argument value
      */
@@ -316,7 +316,7 @@ public abstract class BaseMachine implements Machine {
     /**
      * Gets the constant auxiliary argument.
      * 
-     * @return null-ok; the argument value
+     * @return {@code null-ok;} the argument value
      */
     protected final Constant getAuxCst() {
         return auxCst;
@@ -334,7 +334,7 @@ public abstract class BaseMachine implements Machine {
     /**
      * Gets the switch cases auxiliary argument.
      * 
-     * @return null-ok; the argument value
+     * @return {@code null-ok;} the argument value
      */
     protected final SwitchList getAuxCases() {
         return auxCases;
@@ -343,7 +343,7 @@ public abstract class BaseMachine implements Machine {
     /**
      * Gets the init values auxiliary argument.
      *
-     * @return null-ok; the argument value
+     * @return {@code null-ok;} the argument value
      */
     protected final ArrayList<Constant> getInitValues() {
         return auxInitValues;
@@ -351,7 +351,7 @@ public abstract class BaseMachine implements Machine {
     /**
      * Gets the last local index accessed.
      * 
-     * @return &gt;= -1; the salient local index or <code>-1</code> if none
+     * @return {@code >= -1;} the salient local index or {@code -1} if none
      * was set since the last time {@link #clearArgs} was called
      */
     protected final int getLocalIndex() {
@@ -365,7 +365,7 @@ public abstract class BaseMachine implements Machine {
      * should be the sole result set by a call to {@link #setResult} (or
      * the combination {@link #clearResult} then {@link #addResult}.
      * 
-     * @return null-ok; the salient register spec or <code>null</code> if no
+     * @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
      */
@@ -417,7 +417,7 @@ public abstract class BaseMachine implements Machine {
      * <p><b>Note:</b> If there is more than one result value, the
      * others may be added by using {@link #addResult}.</p>
      * 
-     * @param result non-null; result value
+     * @param result {@code non-null;} result value
      */
     protected final void setResult(TypeBearer result) {
         if (result == null) {
@@ -433,7 +433,7 @@ public abstract class BaseMachine implements Machine {
      * 
      * @see #setResult
      * 
-     * @param result non-null; result value
+     * @param result {@code non-null;} result value
      */
     protected final void addResult(TypeBearer result) {
         if (result == null) {
@@ -448,7 +448,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 &gt;= 0; the count
+     * @return {@code >= 0;} the count
      */
     protected final int resultCount() {
         if (resultCount < 0) {
@@ -462,7 +462,7 @@ public abstract class BaseMachine implements Machine {
      * Gets the width of the results (where a category-2 value counts as
      * two).
      * 
-     * @return &gt;= 0; the result width
+     * @return {@code >= 0;} the result width
      */
     protected final int resultWidth() {
         int width = 0;
@@ -475,10 +475,10 @@ public abstract class BaseMachine implements Machine {
     }
 
     /**
-     * Gets the <code>n</code>th result value.
+     * Gets the {@code n}th result value.
      * 
-     * @param n &gt;= 0, &lt; resultCount(); which result
-     * @return non-null; the indicated result value
+     * @param n {@code >= 0, < resultCount();} which result
+     * @return {@code non-null;} the indicated result value
      */
     protected final TypeBearer result(int n) {
         if (n >= resultCount) {
@@ -499,7 +499,7 @@ public abstract class BaseMachine implements Machine {
      * result is stored to that target; otherwise any results are pushed
      * onto the stack.
      * 
-     * @param frame non-null; frame to operate on
+     * @param frame {@code non-null;} frame to operate on
      */
     protected final void storeResults(Frame frame) {
         if (resultCount < 0) {
@@ -529,8 +529,8 @@ public abstract class BaseMachine implements Machine {
      * Throws an exception that indicates a mismatch in local variable
      * types.
      * 
-     * @param found non-null; the encountered type
-     * @param local non-null; the local variable's claimed type
+     * @param found {@code non-null;} the encountered type
+     * @param local {@code non-null;} the local variable's claimed type
      */
     public static void throwLocalMismatch(TypeBearer found,
             TypeBearer local) {
index 82e4a08..a3370d4 100644 (file)
@@ -29,33 +29,33 @@ import java.util.ArrayList;
  * Utility that identifies basic blocks in bytecode.
  */
 public final class BasicBlocker implements BytecodeArray.Visitor {
-    /** non-null; method being converted */
+    /** {@code non-null;} method being converted */
     private final ConcreteMethod method;
 
-    /** non-null; work set; bits indicate offsets in need of examination */
+    /** {@code non-null;} work set; bits indicate offsets in need of examination */
     private final int[] workSet;
 
     /**
-     * non-null; live set; bits indicate potentially-live opcodes; contrawise,
+     * {@code non-null;} live set; bits indicate potentially-live opcodes; contrawise,
      * a bit that isn't on is either in the middle of an instruction or is
      * a definitely-dead opcode 
      */
     private final int[] liveSet;
 
     /**
-     * non-null; block start set; bits indicate the starts of basic blocks,
+     * {@code non-null;} block start set; bits indicate the starts of basic blocks,
      * including the opcodes that start blocks of definitely-dead code 
      */
     private final int[] blockSet;
 
     /**
-     * non-null, sparse; for each instruction offset to a branch of
+     * {@code non-null, sparse;} for each instruction offset to a branch of
      * some sort, the list of targets for that instruction 
      */
     private final IntList[] targetLists;
 
     /**
-     * non-null, sparse; for each instruction offset to a throwing
+     * {@code non-null, sparse;} for each instruction offset to a throwing
      * instruction, the list of exception handlers for that instruction 
      */
     private final ByteCatchList[] catchLists;
@@ -68,8 +68,8 @@ public final class BasicBlocker implements BytecodeArray.Visitor {
      * returning a list of them. The returned list notably omits any
      * definitely-dead code that is identified in the process.
      * 
-     * @param method non-null; method to convert
-     * @return non-null; list of basic blocks
+     * @param method {@code non-null;} method to convert
+     * @return {@code non-null;} list of basic blocks
      */
     public static ByteBlockList identifyBlocks(ConcreteMethod method) {
         BasicBlocker bb = new BasicBlocker(method);
@@ -82,7 +82,7 @@ public final class BasicBlocker implements BytecodeArray.Visitor {
      * Constructs an instance. This class is not publicly instantiable; use
      * {@link #identifyBlocks}.
      * 
-     * @param method non-null; method to convert
+     * @param method {@code non-null;} method to convert
      */
     private BasicBlocker(ConcreteMethod method) {
         if (method == null) {
@@ -262,7 +262,7 @@ public final class BasicBlocker implements BytecodeArray.Visitor {
     /**
      * Extracts the list of basic blocks from the bit sets.
      * 
-     * @return non-null; the list of basic blocks
+     * @return {@code non-null;} the list of basic blocks
      */
     private ByteBlockList getBlockList() {
         ByteCatchList catches = method.getCatches();
@@ -366,7 +366,7 @@ public final class BasicBlocker implements BytecodeArray.Visitor {
      * isn't yet known to be possibly-live.
      * 
      * @param offset offset to the instruction in question
-     * @param blockStart <code>true</code> iff this instruction starts a
+     * @param blockStart {@code true} iff this instruction starts a
      * basic block
      */
     private void addWorkIfNecessary(int offset, boolean blockStart) {
@@ -384,7 +384,7 @@ public final class BasicBlocker implements BytecodeArray.Visitor {
      * 
      * @param offset offset to the instruction
      * @param length length of the instruction, in bytes
-     * @param nextIsLive <code>true</code> iff the instruction after
+     * @param nextIsLive {@code true} iff the instruction after
      * the indicated one is possibly-live (because this one isn't an
      * unconditional branch, a return, or a switch)
      */
@@ -417,7 +417,7 @@ public final class BasicBlocker implements BytecodeArray.Visitor {
      * 
      * @param offset offset to the instruction
      * @param length length of the instruction, in bytes
-     * @param nextIsLive <code>true</code> iff the instruction after
+     * @param nextIsLive {@code true} iff the instruction after
      * the indicated one is possibly-live (because this one isn't an
      * unconditional throw)
      */
index 065c522..40b91c3 100644 (file)
@@ -24,32 +24,32 @@ import com.android.dx.util.LabeledItem;
  * Representation of a basic block in a bytecode array.
  */
 public final class ByteBlock implements LabeledItem {
-    /** &gt;= 0; label for this block */
+    /** {@code >= 0;} label for this block */
     private final int label;
 
-    /** &gt;= 0; bytecode offset (inclusive) of the start of the block */
+    /** {@code >= 0;} bytecode offset (inclusive) of the start of the block */
     private final int start;
 
-    /** &gt; start; bytecode offset (exclusive) of the end of the block */
+    /** {@code > start;} bytecode offset (exclusive) of the end of the block */
     private final int end;
 
-    /** non-null; list of successors that this block may branch to */
+    /** {@code non-null;} list of successors that this block may branch to */
     private final IntList successors;
 
-    /** non-null; list of exceptions caught and their handler targets */
+    /** {@code non-null;} list of exceptions caught and their handler targets */
     private final ByteCatchList catches;
 
     /**
      * Constructs an instance. 
      * 
-     * @param label &gt;= 0; target label for this block
-     * @param start &gt;= 0; bytecode offset (inclusive) of the start
+     * @param label {@code >= 0;} target label for this block
+     * @param start {@code >= 0;} bytecode offset (inclusive) of the start
      * of the block
-     * @param end &gt; start; bytecode offset (exclusive) of the end
+     * @param end {@code > start;} bytecode offset (exclusive) of the end
      * of the block
-     * @param successors non-null; list of successors that this block may
+     * @param successors {@code non-null;} list of successors that this block may
      * branch to
-     * @param catches non-null; list of exceptions caught and their
+     * @param catches {@code non-null;} list of exceptions caught and their
      * handler targets
      */
     public ByteBlock(int label, int start, int end, IntList successors,
@@ -100,7 +100,7 @@ public final class ByteBlock implements LabeledItem {
     /**
      * Gets the label of this block.
      * 
-     * @return &gt;= 0; the label
+     * @return {@code >= 0;} the label
      */
     public int getLabel() {
         return label;
@@ -109,7 +109,7 @@ public final class ByteBlock implements LabeledItem {
     /**
      * Gets the bytecode offset (inclusive) of the start of this block.
      * 
-     * @return &gt;= 0; the start offset
+     * @return {@code >= 0;} the start offset
      */
     public int getStart() {
         return start;
@@ -118,7 +118,7 @@ public final class ByteBlock implements LabeledItem {
     /**
      * Gets the bytecode offset (exclusive) of the end of this block.
      * 
-     * @return &gt; getStart(); the end offset
+     * @return {@code > getStart();} the end offset
      */
     public int getEnd() {
         return end;
@@ -128,7 +128,7 @@ public final class ByteBlock implements LabeledItem {
      * Gets the list of successors that this block may branch to 
      * non-exceptionally.
      * 
-     * @return non-null; the successor list
+     * @return {@code non-null;} the successor list
      */
     public IntList getSuccessors() {
         return successors;
@@ -137,7 +137,7 @@ public final class ByteBlock implements LabeledItem {
     /**
      * Gets the list of exceptions caught and their handler targets.
      * 
-     * @return non-null; the catch list
+     * @return {@code non-null;} the catch list
      */
     public ByteCatchList getCatches() {
         return catches;
index 9d27b7f..412dfc3 100644 (file)
@@ -28,7 +28,7 @@ public final class ByteBlockList extends LabeledList {
     /**
      * Constructs an instance.
      *
-     * @param size &gt;= 0; the number of elements to be in the list
+     * @param size {@code >= 0;} the number of elements to be in the list
      */
     public ByteBlockList(int size) {
         super(size);
@@ -37,10 +37,10 @@ public final class ByteBlockList extends LabeledList {
     /**
      * 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</code>.
+     * will throw {@code NullPointerException}.
      *
-     * @param n &gt;= 0, &lt; size(); which element
-     * @return non-null; the indicated element
+     * @param n {@code >= 0, < size();} which element
+     * @return {@code non-null;} the indicated element
      */
     public ByteBlock get(int n) {
         return (ByteBlock) get0(n);
@@ -50,7 +50,7 @@ public final class ByteBlockList extends LabeledList {
      * Gets the block with the given label.
      *
      * @param label the label to look for
-     * @return non-null; the block with the given label
+     * @return {@code non-null;} the block with the given label
      */
     public ByteBlock labelToBlock(int label) {
         int idx = indexOfLabel(label);
@@ -66,8 +66,8 @@ public final class ByteBlockList extends LabeledList {
     /**
      * Sets the element at the given index.
      *
-     * @param n &gt;= 0, &lt; size(); which element
-     * @param bb null-ok; the value to store
+     * @param n {@code >= 0, < size();} which element
+     * @param bb {@code null-ok;} the value to store
      */
     public void set(int n, ByteBlock bb) {
         super.set(n, bb);
index 375831e..aab2087 100644 (file)
@@ -24,10 +24,10 @@ import com.android.dx.util.IntList;
 
 /**
  * List of catch entries, that is, the elements of an "exception table,"
- * which is part of a standard <code>Code</code> attribute.
+ * which is part of a standard {@code Code} attribute.
  */
 public final class ByteCatchList extends FixedSizeList {
-    /** non-null; convenient zero-entry instance */
+    /** {@code non-null;} convenient zero-entry instance */
     public static final ByteCatchList EMPTY = new ByteCatchList(0);
 
     /**
@@ -41,10 +41,10 @@ public final class ByteCatchList extends FixedSizeList {
 
     /**
      * Gets the total length of this structure in bytes, when included in
-     * a <code>Code</code> attribute. The returned value includes the
-     * two bytes for <code>exception_table_length</code>.
+     * a {@code Code} attribute. The returned value includes the
+     * two bytes for {@code exception_table_length}.
      *
-     * @return &gt;= 2; the total length, in bytes
+     * @return {@code >= 2;} the total length, in bytes
      */
     public int byteLength() {
         return 2 + size() * 8;
@@ -53,8 +53,8 @@ public final class ByteCatchList extends FixedSizeList {
     /**
      * Gets the indicated item.
      *
-     * @param n &gt;= 0; which item
-     * @return null-ok; the indicated item
+     * @param n {@code >= 0;} which item
+     * @return {@code null-ok;} the indicated item
      */
     public Item get(int n) {
         return (Item) get0(n);
@@ -63,8 +63,8 @@ public final class ByteCatchList extends FixedSizeList {
     /**
      * Sets the item at the given index.
      *
-     * @param n &gt;= 0, &lt; size(); which entry to set
-     * @param item non-null; the item
+     * @param n {@code >= 0, < size();} which entry to set
+     * @param item {@code non-null;} the item
      */
     public void set(int n, Item item) {
         if (item == null) {
@@ -77,13 +77,13 @@ public final class ByteCatchList extends FixedSizeList {
     /**
      * Sets the item at the given index.
      *
-     * @param n &gt;= 0, &lt; size(); which entry to set
-     * @param startPc &gt;= 0; the start pc (inclusive) of the handler's range
-     * @param endPc &gt;= startPc; the end pc (exclusive) of the
+     * @param n {@code >= 0, < size();} which entry to set
+     * @param startPc {@code >= 0;} the start pc (inclusive) of the handler's range
+     * @param endPc {@code >= startPc;} the end pc (exclusive) of the
      * handler's range
-     * @param handlerPc &gt;= 0; the pc of the exception handler
-     * @param exceptionClass null-ok; the exception class or
-     * <code>null</code> to catch all exceptions with this handler
+     * @param handlerPc {@code >= 0;} the pc of the exception handler
+     * @param exceptionClass {@code null-ok;} the exception class or
+     * {@code null} to catch all exceptions with this handler
      */
     public void set(int n, int startPc, int endPc, int handlerPc,
             CstType exceptionClass) {
@@ -95,8 +95,8 @@ public final class ByteCatchList extends FixedSizeList {
      * automatically made immutable.
      *
      * @param pc which address
-     * @return non-null; list of exception handlers active at
-     * <code>pc</code>
+     * @return {@code non-null;} list of exception handlers active at
+     * {@code pc}
      */
     public ByteCatchList listFor(int pc) {
         int sz = size();
@@ -128,12 +128,12 @@ public final class ByteCatchList extends FixedSizeList {
      * Helper method for {@link #listFor}, which tells whether a match
      * 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</code> which represents a catch-all.
+     * match or the class {@code Object} which represents a catch-all.
      * 
-     * @param item non-null; item with the exception type to look for
-     * @param arr non-null; array to search in
-     * @param count non-null; maximum number of elements in the array to check
-     * @return <code>true</code> iff the exception type is <i>not</i> found
+     * @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
+     * @return {@code true} iff the exception type is <i>not</i> found
      */
     private static boolean typeNotFound(Item item, Item[] arr, int count) {
         CstType type = item.getExceptionClass();
@@ -151,13 +151,13 @@ public final class ByteCatchList extends FixedSizeList {
     /**
      * Returns a target list corresponding to this instance. The result
      * is a list of all the exception handler addresses, with the given
-     * <code>noException</code> address appended if appropriate. The
+     * {@code noException} address appended if appropriate. The
      * result is automatically made immutable.
      * 
-     * @param noException &gt;= -1; the no-exception address to append, or
-     * <code>-1</code> not to append anything
-     * @return non-null; list of exception targets, with
-     * <code>noException</code> appended if necessary
+     * @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
+     * {@code noException} appended if necessary
      */
     public IntList toTargetList(int noException) {
         if (noException < -1) {
@@ -199,7 +199,7 @@ public final class ByteCatchList extends FixedSizeList {
     /**
      * Returns a rop-style catches list equivalent to this one.
      *
-     * @return non-null; the converted instance
+     * @return {@code non-null;} the converted instance
      */
     public TypeList toRopCatchList() {
         int sz = size();
@@ -221,29 +221,29 @@ public final class ByteCatchList extends FixedSizeList {
      * Item in an exception handler list.
      */
     public static class Item {
-        /** &gt;= 0; the start pc (inclusive) of the handler's range */
+        /** {@code >= 0;} the start pc (inclusive) of the handler's range */
         private final int startPc;
 
-        /** &gt;= startPc; the end pc (exclusive) of the handler's range */
+        /** {@code >= startPc;} the end pc (exclusive) of the handler's range */
         private final int endPc;
 
-        /** &gt;= 0; the pc of the exception handler */
+        /** {@code >= 0;} the pc of the exception handler */
         private final int handlerPc;
 
-        /** null-ok; the exception class or <code>null</code> to catch all
+        /** {@code null-ok;} the exception class or {@code null} to catch all
          * exceptions with this handler */
         private final CstType exceptionClass;
 
         /**
          * Constructs an instance.
          *
-         * @param startPc &gt;= 0; the start pc (inclusive) of the
+         * @param startPc {@code >= 0;} the start pc (inclusive) of the
          * handler's range
-         * @param endPc &gt;= startPc; the end pc (exclusive) of the
+         * @param endPc {@code >= startPc;} the end pc (exclusive) of the
          * handler's range
-         * @param handlerPc &gt;= 0; the pc of the exception handler
-         * @param exceptionClass null-ok; the exception class or
-         * <code>null</code> to catch all exceptions with this handler
+         * @param handlerPc {@code >= 0;} the pc of the exception handler
+         * @param exceptionClass {@code null-ok;} the exception class or
+         * {@code null} to catch all exceptions with this handler
          */
         public Item(int startPc, int endPc, int handlerPc,
                 CstType exceptionClass) {
@@ -268,7 +268,7 @@ public final class ByteCatchList extends FixedSizeList {
         /**
          * Gets the start pc (inclusive) of the handler's range.
          *
-         * @return &gt;= 0; the start pc (inclusive) of the handler's range.
+         * @return {@code >= 0;} the start pc (inclusive) of the handler's range.
          */
         public int getStartPc() {
             return startPc;
@@ -277,7 +277,7 @@ public final class ByteCatchList extends FixedSizeList {
         /**
          * Gets the end pc (exclusive) of the handler's range.
          *
-         * @return &gt;= startPc; the end pc (exclusive) of the
+         * @return {@code >= startPc;} the end pc (exclusive) of the
          * handler's range.
          */
         public int getEndPc() {
@@ -287,7 +287,7 @@ public final class ByteCatchList extends FixedSizeList {
         /**
          * Gets the pc of the exception handler.
          *
-         * @return &gt;= 0; the pc of the exception handler
+         * @return {@code >= 0;} the pc of the exception handler
          */
         public int getHandlerPc() {
             return handlerPc;
@@ -296,7 +296,7 @@ public final class ByteCatchList extends FixedSizeList {
         /**
          * Gets the class of exception handled.
          *
-         * @return non-null; the exception class; {@link CstType#OBJECT}
+         * @return {@code non-null;} the exception class; {@link CstType#OBJECT}
          * if this entry handles all possible exceptions
          */
         public CstType getExceptionClass() {
@@ -308,7 +308,7 @@ public final class ByteCatchList extends FixedSizeList {
          * Returns whether the given address is in the range of this item.
          *
          * @param pc the address
-         * @return <code>true</code> iff this item covers <code>pc</code>
+         * @return {@code true} iff this item covers {@code pc}
          */
         public boolean covers(int pc) {
             return (pc >= startPc) && (pc < endPc);
index 4c420f6..ea7b514 100644 (file)
@@ -242,114 +242,114 @@ public class ByteOps {
     /** invalid */
     public static final int FMT_INVALID = 0;
 
-    /** "-": <code>op</code> */
+    /** "-": {@code op} */
     public static final int FMT_NO_ARGS = 1;
 
-    /** "0": <code>op</code>; implies <code>max_locals &gt;= 1</code> */
+    /** "0": {@code op}; implies {@code max_locals >= 1} */
     public static final int FMT_NO_ARGS_LOCALS_1 = 2;
 
-    /** "1": <code>op</code>; implies <code>max_locals &gt;= 2</code> */
+    /** "1": {@code op}; implies {@code max_locals >= 2} */
     public static final int FMT_NO_ARGS_LOCALS_2 = 3;
 
-    /** "2": <code>op</code>; implies <code>max_locals &gt;= 3</code> */
+    /** "2": {@code op}; implies {@code max_locals >= 3} */
     public static final int FMT_NO_ARGS_LOCALS_3 = 4;
 
-    /** "3": <code>op</code>; implies <code>max_locals &gt;= 4</code> */
+    /** "3": {@code op}; implies {@code max_locals >= 4} */
     public static final int FMT_NO_ARGS_LOCALS_4 = 5;
 
-    /** "4": <code>op</code>; implies <code>max_locals &gt;= 5</code> */
+    /** "4": {@code op}; implies {@code max_locals >= 5} */
     public static final int FMT_NO_ARGS_LOCALS_5 = 6;
 
-    /** "b": <code>op target target</code> */
+    /** "b": {@code op target target} */
     public static final int FMT_BRANCH = 7;
 
-    /** "c": <code>op target target target target</code> */
+    /** "c": {@code op target target target target} */
     public static final int FMT_WIDE_BRANCH = 8;
 
-    /** "p": <code>op #cpi #cpi</code>; constant restricted as specified */
+    /** "p": {@code op #cpi #cpi}; constant restricted as specified */
     public static final int FMT_CPI = 9;
 
     /**
-     * "l": <code>op local</code>; category-1 local; implies
-     * <code>max_locals</code> is at least two more than the given
+     * "l": {@code op local}; category-1 local; implies
+     * {@code max_locals} is at least two more than the given
      * local number 
      */
     public static final int FMT_LOCAL_1 = 10;
 
     /**
-     * "m": <code>op local</code>; category-2 local; implies
-     * <code>max_locals</code> is at least two more than the given
+     * "m": {@code op local}; category-2 local; implies
+     * {@code max_locals} is at least two more than the given
      * local number 
      */
     public static final int FMT_LOCAL_2 = 11;
 
     /**
-     * "y": <code>op #byte</code> (<code>bipush</code> and
-     * <code>newarray</code>
+     * "y": {@code op #byte} ({@code bipush} and
+     * {@code newarray}
      */
     public static final int FMT_LITERAL_BYTE = 12;
 
-    /** "I": <code>invokeinterface cpi cpi count 0</code> */
+    /** "I": {@code invokeinterface cpi cpi count 0} */
     public static final int FMT_INVOKEINTERFACE = 13;
 
-    /** "L": <code>ldc #cpi</code>; constant restricted as specified */
+    /** "L": {@code ldc #cpi}; constant restricted as specified */
     public static final int FMT_LDC = 14;
 
-    /** "S": <code>sipush #byte #byte</code> */
+    /** "S": {@code sipush #byte #byte} */
     public static final int FMT_SIPUSH = 15;
 
-    /** "T": <code>tableswitch ...</code> */
+    /** "T": {@code tableswitch ...} */
     public static final int FMT_TABLESWITCH = 16;
 
-    /** "U": <code>lookupswitch ...</code> */
+    /** "U": {@code lookupswitch ...} */
     public static final int FMT_LOOKUPSWITCH = 17;
 
-    /** "M": <code>multianewarray cpi cpi dims</code> */
+    /** "M": {@code multianewarray cpi cpi dims} */
     public static final int FMT_MULTIANEWARRAY = 18;
 
-    /** "W": <code>wide ...</code> */
+    /** "W": {@code wide ...} */
     public static final int FMT_WIDE = 19;
 
     /** mask for the bits representing the opcode format */
     public static final int FMT_MASK = 0x1f;
 
-    /** "I": flag bit for valid cp type for <code>Integer</code> */
+    /** "I": flag bit for valid cp type for {@code Integer} */
     public static final int CPOK_Integer = 0x20;
 
-    /** "F": flag bit for valid cp type for <code>Float</code> */
+    /** "F": flag bit for valid cp type for {@code Float} */
     public static final int CPOK_Float = 0x40;
 
-    /** "J": flag bit for valid cp type for <code>Long</code> */
+    /** "J": flag bit for valid cp type for {@code Long} */
     public static final int CPOK_Long = 0x80;
 
-    /** "D": flag bit for valid cp type for <code>Double</code> */
+    /** "D": flag bit for valid cp type for {@code Double} */
     public static final int CPOK_Double = 0x100;
 
-    /** "c": flag bit for valid cp type for <code>Class</code> */
+    /** "c": flag bit for valid cp type for {@code Class} */
     public static final int CPOK_Class = 0x200;
 
-    /** "s": flag bit for valid cp type for <code>String</code> */
+    /** "s": flag bit for valid cp type for {@code String} */
     public static final int CPOK_String = 0x400;
 
-    /** "f": flag bit for valid cp type for <code>Fieldref</code> */
+    /** "f": flag bit for valid cp type for {@code Fieldref} */
     public static final int CPOK_Fieldref = 0x800;
 
-    /** "m": flag bit for valid cp type for <code>Methodref</code> */
+    /** "m": flag bit for valid cp type for {@code Methodref} */
     public static final int CPOK_Methodref = 0x1000;
 
-    /** "i": flag bit for valid cp type for <code>InterfaceMethodref</code> */
+    /** "i": flag bit for valid cp type for {@code InterfaceMethodref} */
     public static final int CPOK_InterfaceMethodref = 0x2000;
 
     /**
-     * non-null; map from opcodes to format or'ed with allowed constant
+     * {@code non-null;} map from opcodes to format or'ed with allowed constant
      * pool types 
      */
     private static final int[] OPCODE_INFO = new int[256];
 
-    /** non-null; map from opcodes to their names */
+    /** {@code non-null;} map from opcodes to their names */
     private static final String[] OPCODE_NAMES = new String[256];
 
-    /** non-null; bigass string describing all the opcodes */
+    /** {@code non-null;} bigass string describing all the opcodes */
     private static final String OPCODE_DETAILS =
         "00 - nop;" +
         "01 - aconst_null;" +
@@ -623,8 +623,8 @@ public class ByteOps {
     /**
      * Gets the name of the given opcode.
      * 
-     * @param opcode &gt;= 0, &lt;= 255; the opcode
-     * @return non-null; its name
+     * @param opcode {@code >= 0, <= 255;} the opcode
+     * @return {@code non-null;} its name
      */
     public static String opName(int opcode) {
         String result = OPCODE_NAMES[opcode];
@@ -640,7 +640,7 @@ public class ByteOps {
     /**
      * Gets the format and allowed cp types of the given opcode.
      * 
-     * @param opcode &gt;= 0, &lt;= 255; the opcode
+     * @param opcode {@code >= 0, <= 255;} the opcode
      * @return its format and allowed cp types
      */
     public static int opInfo(int opcode) {
index 71ba029..60f0cee 100644 (file)
@@ -32,23 +32,23 @@ import com.android.dx.util.Hex;
 import java.util.ArrayList;
 
 /**
- * Bytecode array, which is part of a standard <code>Code</code> attribute.
+ * Bytecode array, which is part of a standard {@code Code} attribute.
  */
 public final class BytecodeArray {
     /** convenient no-op implementation of {@link Visitor} */
     public static final Visitor EMPTY_VISITOR = new BaseVisitor();
 
-    /** non-null; underlying bytes */
+    /** {@code non-null;} underlying bytes */
     private final ByteArray bytes;
 
-    /** non-null; constant pool to use when resolving constant pool indices */
+    /** {@code non-null;} constant pool to use when resolving constant pool indices */
     private final ConstantPool pool;
 
     /**
      * Constructs an instance.
      * 
-     * @param bytes non-null; underlying bytes
-     * @param pool non-null; constant pool to use when resolving constant
+     * @param bytes {@code non-null;} underlying bytes
+     * @param pool {@code non-null;} constant pool to use when resolving constant
      * pool indices
      */
     public BytecodeArray(ByteArray bytes, ConstantPool pool) {
@@ -67,7 +67,7 @@ public final class BytecodeArray {
     /**
      * Gets the underlying byte array.
      * 
-     * @return non-null; the byte array
+     * @return {@code non-null;} the byte array
      */
     public ByteArray getBytes() {
         return bytes;
@@ -76,7 +76,7 @@ public final class BytecodeArray {
     /**
      * Gets the size of the bytecode array, per se.
      * 
-     * @return &gt;= 0; the length of the bytecode array
+     * @return {@code >= 0;} the length of the bytecode array
      */
     public int size() {
         return bytes.size();
@@ -84,10 +84,10 @@ public final class BytecodeArray {
 
     /**
      * Gets the total length of this structure in bytes, when included in
-     * a <code>Code</code> attribute. The returned value includes the
-     * array size plus four bytes for <code>code_length</code>.
+     * a {@code Code} attribute. The returned value includes the
+     * array size plus four bytes for {@code code_length}.
      * 
-     * @return &gt;= 4; the total length, in bytes
+     * @return {@code >= 4;} the total length, in bytes
      */
     public int byteLength() {
         return 4 + bytes.size();
@@ -96,7 +96,7 @@ public final class BytecodeArray {
     /**
      * Parses each instruction in the array, in order.
      * 
-     * @param visitor null-ok; visitor to call back to for each instruction
+     * @param visitor {@code null-ok;} visitor to call back to for each instruction
      */
     public void forEach(Visitor visitor) {
         int sz = bytes.size();
@@ -116,7 +116,7 @@ public final class BytecodeArray {
      * result is a bit set with the offset of each opcode-per-se flipped on.
      * 
      * @see Bits
-     * @return non-null; appropriately constructed bit set
+     * @return {@code non-null;} appropriately constructed bit set
      */
     public int[] getInstructionOffsets() {
         int sz = bytes.size();
@@ -139,8 +139,8 @@ public final class BytecodeArray {
      * work set is empty. It is expected that the visitor will regularly
      * set new bits in the work set during the process.
      * 
-     * @param workSet non-null; the work set to process
-     * @param visitor non-null; visitor to call back to for each instruction
+     * @param workSet {@code non-null;} the work set to process
+     * @param visitor {@code non-null;} visitor to call back to for each instruction
      */
     public void processWorkSet(int[] workSet, Visitor visitor) {
         if (visitor == null) {
@@ -170,42 +170,42 @@ public final class BytecodeArray {
      * 
      * <ul>
      * <li>The opcodes to push literal constants of primitive types all become
-     *   <code>ldc</code>.
-     *   E.g., <code>fconst_0</code>, <code>sipush</code>, and 
-     *   <code>lconst_0</code> qualify for this treatment.</li>
-     * <li><code>aconst_null</code> becomes <code>ldc</code> of a
+     *   {@code ldc}.
+     *   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>
      * <li>Shorthand local variable accessors become the corresponding
-     *   longhand. E.g. <code>aload_2</code> becomes <code>aload</code>.</li>
-     * <li><code>goto_w</code> and <code>jsr_w</code> become <code>goto</code>
-     *   and <code>jsr</code> (respectively).</li>
-     * <li><code>ldc_w</code> becomes <code>ldc</code>.</li>
-     * <li><code>tableswitch</code> becomes <code>lookupswitch</code>.
+     *   longhand. E.g. {@code aload_2} becomes {@code aload}.</li>
+     * <li>{@code goto_w} and {@code jsr_w} become {@code goto}
+     *   and {@code jsr} (respectively).</li>
+     * <li>{@code ldc_w} becomes {@code ldc}.</li>
+     * <li>{@code tableswitch} becomes {@code lookupswitch}.
      * <li>Arithmetic, array, and value-returning ops are collapsed
-     *   to the <code>int</code> variant opcode, with the <code>type</code>
+     *   to the {@code int} variant opcode, with the {@code type}
      *   argument set to indicate the actual type. E.g.,
-     *   <code>fadd</code> becomes <code>iadd</code>, but
-     *   <code>type</code> is passed as <code>Type.FLOAT</code> in that
-     *   case. Similarly, <code>areturn</code> becomes
-     *   <code>ireturn</code>. (However, <code>return</code> remains
+     *   {@code fadd} becomes {@code iadd}, but
+     *   {@code type} is passed as {@code Type.FLOAT} in that
+     *   case. Similarly, {@code areturn} becomes
+     *   {@code ireturn}. (However, {@code return} remains
      *   unchanged.</li>
-     * <li>Local variable access ops are collapsed to the <code>int</code>
-     *   variant opcode, with the <code>type</code> argument set to indicate
-     *   the actual type. E.g., <code>aload</code> becomes <code>iload</code>,
-     *   but <code>type</code> is passed as <code>Type.OBJECT</code> in
+     * <li>Local variable access ops are collapsed to the {@code int}
+     *   variant opcode, with the {@code type} argument set to indicate
+     *   the actual type. E.g., {@code aload} becomes {@code iload},
+     *   but {@code type} is passed as {@code Type.OBJECT} in
      *   that case.</li>
-     * <li>Numeric conversion ops (<code>i2l</code>, etc.) are left alone
-     *   to avoid too much confustion, but their <code>type</code> is
-     *   the pushed type. E.g., <code>i2b</code> gets type
-     *   <code>Type.INT</code>, and <code>f2d</code> gets type
-     *   <code>Type.DOUBLE</code>. Other unaltered opcodes also get
-     *   their pushed type. E.g., <code>arraylength</code> gets type
-     *   <code>Type.INT</code>.</li>
+     * <li>Numeric conversion ops ({@code i2l}, etc.) are left alone
+     *   to avoid too much confustion, but their {@code type} is
+     *   the pushed type. E.g., {@code i2b} gets type
+     *   {@code Type.INT}, and {@code f2d} gets type
+     *   {@code Type.DOUBLE}. Other unaltered opcodes also get
+     *   their pushed type. E.g., {@code arraylength} gets type
+     *   {@code Type.INT}.</li>
      * </ul>
      * 
-     * @param offset &gt;= 0, &lt; bytes.size(); offset to the start of the
+     * @param offset {@code >= 0, < bytes.size();} offset to the start of the
      * instruction
-     * @param visitor null-ok; visitor to call back to
+     * @param visitor {@code null-ok;} visitor to call back to
      * @return the length of the instruction, in bytes
      */
     public int parseInstruction(int offset, Visitor visitor) {
@@ -797,10 +797,10 @@ public final class BytecodeArray {
     }
 
     /**
-     * Helper to deal with <code>tableswitch</code>.
+     * Helper to deal with {@code tableswitch}.
      * 
-     * @param offset the offset to the <code>tableswitch</code> opcode itself
-     * @param visitor non-null; visitor to use
+     * @param offset the offset to the {@code tableswitch} opcode itself
+     * @param visitor {@code non-null;} visitor to use
      * @return instruction length, in bytes
      */
     private int parseTableswitch(int offset, Visitor visitor) {
@@ -840,10 +840,10 @@ public final class BytecodeArray {
     }
 
     /**
-     * Helper to deal with <code>lookupswitch</code>.
+     * Helper to deal with {@code lookupswitch}.
      * 
-     * @param offset the offset to the <code>lookupswitch</code> opcode itself
-     * @param visitor non-null; visitor to use
+     * @param offset the offset to the {@code lookupswitch} opcode itself
+     * @param visitor {@code non-null;} visitor to use
      * @return instruction length, in bytes
      */
     private int parseLookupswitch(int offset, Visitor visitor) {
@@ -878,10 +878,10 @@ public final class BytecodeArray {
     }
 
     /**
-     * Helper to deal with <code>newarray</code>.
+     * Helper to deal with {@code newarray}.
      *
-     * @param offset the offset to the <code>newarray</code> opcode itself
-     * @param visitor non-null; visitor to use
+     * @param offset the offset to the {@code newarray} opcode itself
+     * @param visitor {@code non-null;} visitor to use
      * @return instruction length, in bytes
      */
     private int parseNewarray(int offset, Visitor visitor) {
@@ -1061,10 +1061,10 @@ public final class BytecodeArray {
 
     
     /**
-     * Helper to deal with <code>wide</code>.
+     * Helper to deal with {@code wide}.
      * 
-     * @param offset the offset to the <code>wide</code> opcode itself
-     * @param visitor non-null; visitor to use
+     * @param offset the offset to the {@code wide} opcode itself
+     * @param visitor {@code non-null;} visitor to use
      * @return instruction length, in bytes
      */
     private int parseWide(int offset, Visitor visitor) {
@@ -1159,7 +1159,7 @@ public final class BytecodeArray {
          * @param opcode the opcode
          * @param offset offset to the instruction
          * @param length length of the instruction, in bytes
-         * @param type non-null; type the instruction operates on
+         * @param type {@code non-null;} type the instruction operates on
          */
         public void visitNoArgs(int opcode, int offset, int length,
                 Type type);
@@ -1171,9 +1171,9 @@ public final class BytecodeArray {
          * @param offset offset to the instruction
          * @param length length of the instruction, in bytes
          * @param idx the local variable index
-         * @param type non-null; the type of the accessed value
+         * @param type {@code non-null;} the type of the accessed value
          * @param value additional literal integer argument, if salient (i.e.,
-         * for <code>iinc</code>)
+         * for {@code iinc})
          */
         public void visitLocal(int opcode, int offset, int length,
                 int idx, Type type, int value);
@@ -1182,23 +1182,23 @@ public final class BytecodeArray {
          * Visits an instruction which has a (possibly synthetic)
          * constant argument, and possibly also an
          * additional literal integer argument. In the case of
-         * <code>multianewarray</code>, the argument is the count of
-         * dimensions. In the case of <code>invokeinterface</code>,
+         * {@code multianewarray}, the argument is the count of
+         * dimensions. In the case of {@code invokeinterface},
          * the argument is the parameter count or'ed with the
          * should-be-zero value left-shifted by 8. In the case of entries
-         * of type <code>int</code>, the <code>value</code> field always
+         * 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</code> also uses this
-         * form, passing <code>value</code> as the array type code and
-         * <code>cst</code> as a {@link CstType} instance
+         * 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
-         * @param cst non-null; the constant
+         * @param cst {@code non-null;} the constant
          * @param value additional literal integer argument, if salient
          * (ignore if not)
          */
@@ -1222,7 +1222,7 @@ public final class BytecodeArray {
          * @param opcode the opcode
          * @param offset offset to the instruction
          * @param length length of the instruction, in bytes
-         * @param cases non-null; list of (value, target) pairs, plus the
+         * @param cases {@code non-null;} list of (value, target) pairs, plus the
          * default target
          * @param padding the bytes found in the padding area (if any),
          * packed
@@ -1235,8 +1235,8 @@ public final class BytecodeArray {
          *
          * @param offset   offset to the instruction
          * @param length   length of the instruction, in bytes
-         * @param cst non-null; the type of the array
-         * @param initVals non-null; list of bytecode offsets for init values
+         * @param cst {@code non-null;} the type of the array
+         * @param initVals {@code non-null;} list of bytecode offsets for init values
          */
         public void visitNewarray(int offset, int length, CstType type,
                 ArrayList<Constant> initVals);
index 47f698d..70b6b45 100644 (file)
@@ -35,38 +35,38 @@ import com.android.dx.rop.type.Prototype;
  * Container for all the giblets that make up a concrete Java bytecode method.
  * It implements {@link Method}, so it provides all the original access
  * (by delegation), but it also constructs and keeps useful versions of
- * stuff extracted from the method's <code>Code</code> attribute.
+ * stuff extracted from the method's {@code Code} attribute.
  */
 public final class ConcreteMethod implements Method {
-    /** non-null; method being wrapped */
+    /** {@code non-null;} method being wrapped */
     private final Method method;
 
     /**
-     * null-ok; the class's <code>SourceFile</code> attribute value,
+     * {@code null-ok;} the class's {@code SourceFile} attribute value,
      * if any 
      */
     private final CstUtf8 sourceFile;
 
     /**
      * whether the class that this method is part of is defined with
-     * <code>ACC_SUPER</code> 
+     * {@code ACC_SUPER} 
      */
     private final boolean accSuper;
 
-    /** non-null; the code attribute */
+    /** {@code non-null;} the code attribute */
     private final AttCode attCode;
 
-    /** non-null; line number list */
+    /** {@code non-null;} line number list */
     private final LineNumberList lineNumbers;
 
-    /** non-null; local variable list */
+    /** {@code non-null;} local variable list */
     private final LocalVariableList localVariables;
 
     /**
      * Constructs an instance.
      * 
-     * @param method non-null; the method to be based on
-     * @param cf non-null; the class file that contains this method
+     * @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
      * (if any)
      * @param keepLocals whether to keep the local variable
@@ -178,9 +178,9 @@ public final class ConcreteMethod implements Method {
 
     /**
      * Gets whether the class that this method is part of is defined with
-     * <code>ACC_SUPER</code>.
+     * {@code ACC_SUPER}.
      * 
-     * @return the <code>ACC_SUPER</code> value
+     * @return the {@code ACC_SUPER} value
      */
     public boolean getAccSuper() {
         return accSuper;
@@ -189,7 +189,7 @@ public final class ConcreteMethod implements Method {
     /**
      * Gets the maximum stack size.
      * 
-     * @return &gt;= 0; the maximum stack size
+     * @return {@code >= 0;} the maximum stack size
      */
     public int getMaxStack() {
         return attCode.getMaxStack();
@@ -198,7 +198,7 @@ public final class ConcreteMethod implements Method {
     /**
      * Gets the number of locals.
      * 
-     * @return &gt;= 0; the number of locals
+     * @return {@code >= 0;} the number of locals
      */
     public int getMaxLocals() {
         return attCode.getMaxLocals();
@@ -207,7 +207,7 @@ public final class ConcreteMethod implements Method {
     /**
      * Gets the bytecode array.
      * 
-     * @return non-null; the bytecode array
+     * @return {@code non-null;} the bytecode array
      */
     public BytecodeArray getCode() {
         return attCode.getCode();
@@ -216,7 +216,7 @@ public final class ConcreteMethod implements Method {
     /**
      * Gets the exception table.
      * 
-     * @return non-null; the exception table
+     * @return {@code non-null;} the exception table
      */
     public ByteCatchList getCatches() {
         return attCode.getCatches();
@@ -225,7 +225,7 @@ public final class ConcreteMethod implements Method {
     /**
      * Gets the line number list.
      * 
-     * @return non-null; the line number list
+     * @return {@code non-null;} the line number list
      */
     public LineNumberList getLineNumbers() {
         return lineNumbers;
@@ -234,7 +234,7 @@ public final class ConcreteMethod implements Method {
     /**
      * Gets the local variable list.
      * 
-     * @return non-null; the local variable list
+     * @return {@code non-null;} the local variable list
      */
     public LocalVariableList getLocalVariables() {
         return localVariables;
@@ -244,8 +244,8 @@ public final class ConcreteMethod implements Method {
      * Returns a {@link SourcePosition} instance corresponding to the
      * given bytecode offset.
      * 
-     * @param offset &gt;= 0; the bytecode offset
-     * @return non-null; an appropriate instance
+     * @param offset {@code >= 0;} the bytecode offset
+     * @return {@code non-null;} an appropriate instance
      */
     public SourcePosition makeSourcePosistion(int offset) {
         return new SourcePosition(sourceFile, offset,
index 1a2b565..15a9e6c 100644 (file)
@@ -30,11 +30,11 @@ import com.android.dx.util.MutabilityControl;
  * TypeBearer}.</p>
  */
 public final class ExecutionStack extends MutabilityControl {
-    /** non-null; array of stack contents */
+    /** {@code non-null;} array of stack contents */
     private final TypeBearer[] stack;
 
     /**
-     * &gt;= 0; stack pointer (points one past the end) / current stack
+     * {@code >= 0;} stack pointer (points one past the end) / current stack
      * size 
      */
     private int stackPtr;
@@ -42,7 +42,7 @@ public final class ExecutionStack extends MutabilityControl {
     /**
      * Constructs an instance. 
      * 
-     * @param maxStack &gt;= 0; the maximum size of the stack for this
+     * @param maxStack {@code >= 0;} the maximum size of the stack for this
      * instance
      */
     public ExecutionStack(int maxStack) {
@@ -54,7 +54,7 @@ public final class ExecutionStack extends MutabilityControl {
     /**
      * Makes and returns a mutable copy of this instance.
      * 
-     * @return non-null; the copy
+     * @return {@code non-null;} the copy
      */
     public ExecutionStack copy() {
         ExecutionStack result = new ExecutionStack(stack.length);
@@ -69,7 +69,7 @@ public final class ExecutionStack extends MutabilityControl {
      * Annotates (adds context to) the given exception with information
      * about this instance.
      * 
-     * @param ex non-null; the exception to annotate
+     * @param ex {@code non-null;} the exception to annotate
      */
     public void annotate(ExceptionWithContext ex) {
         int limit = stackPtr - 1;
@@ -86,7 +86,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 non-null; type to replace
+     * @param type {@code non-null;} type to replace
      */
     public void makeInitialized(Type type) {
         if (stackPtr == 0) {
@@ -108,7 +108,7 @@ public final class ExecutionStack extends MutabilityControl {
     /**
      * Gets the maximum stack size for this instance.
      * 
-     * @return &gt;= 0; the max stack size
+     * @return {@code >= 0;} the max stack size
      */
     public int getMaxStack() {
         return stack.length;
@@ -117,7 +117,7 @@ public final class ExecutionStack extends MutabilityControl {
     /**
      * Gets the current stack size.
      * 
-     * @return &gt;= 0, &lt; getMaxStack(); the current stack size
+     * @return {@code >= 0, < getMaxStack();} the current stack size
      */
     public int size() {
         return stackPtr;
@@ -139,7 +139,7 @@ public final class ExecutionStack extends MutabilityControl {
     /**
      * Pushes a value of the given type onto the stack.
      * 
-     * @param type non-null; type of the value
+     * @param type {@code non-null;} type of the value
      * @throws SimException thrown if there is insufficient room on the
      * stack for the value
      */
@@ -171,14 +171,14 @@ public final class ExecutionStack extends MutabilityControl {
     }
 
     /**
-     * Peeks at the <code>n</code>th element down from the top of the stack.
-     * <code>n == 0</code> means to peek at the top of the stack. Note that
-     * this will return <code>null</code> if the indicated element is the
+     * Peeks at the {@code n}th element down from the top of the stack.
+     * {@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 &gt;= 0; which element to peek at
-     * @return null-ok; the type of value stored at that element
-     * @throws SimException thrown if <code>n &gt;= size()</code> 
+     * @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()} 
      */
     public TypeBearer peek(int n) {
         if (n < 0) {
@@ -193,10 +193,10 @@ public final class ExecutionStack extends MutabilityControl {
     }
 
     /**
-     * Peeks at the <code>n</code>th element down from the top of the
+     * Peeks at the {@code n}th element down from the top of the
      * 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()</code>.
+     * for {@code peek(n).getType()}.
      * 
      * @see #peek
      */
@@ -207,7 +207,7 @@ public final class ExecutionStack extends MutabilityControl {
     /**
      * Pops the top element off of the stack.
      * 
-     * @return non-null; the type formerly on the top of the stack
+     * @return {@code non-null;} the type formerly on the top of the stack
      * @throws SimException thrown if the stack is empty
      */
     public TypeBearer pop() {
@@ -227,10 +227,10 @@ public final class ExecutionStack extends MutabilityControl {
      * the following restriction on its behavior: You may only replace
      * values with other values of the same category.
      * 
-     * @param n &gt;= 0; which element to change, where <code>0</code> is
+     * @param n {@code >= 0;} which element to change, where {@code 0} is
      * the top element of the stack
-     * @param type non-null; type of the new value
-     * @throws SimException thrown if <code>n &gt;= size()</code> or
+     * @param type {@code non-null;} type of the new value
+     * @throws SimException thrown if {@code n >= size()} or
      * the action is otherwise prohibited
      */
     public void change(int n, TypeBearer type) {
@@ -262,8 +262,8 @@ public final class ExecutionStack extends MutabilityControl {
      * returned.  See {@link Merger#mergeStack(ExecutionStack,ExecutionStack)
      * Merger.mergeStack()}
      *
-     * @param other non-null; a stack to merge with
-     * @return non-null; the result of the merge
+     * @param other {@code non-null;} a stack to merge with
+     * @return {@code non-null;} the result of the merge
      */
     public ExecutionStack merge(ExecutionStack other) {
         try {
@@ -279,11 +279,11 @@ public final class ExecutionStack extends MutabilityControl {
 
     /**
      * Gets the string form for a stack element. This is the same as
-     * <code>toString()</code> except that <code>null</code> is converted
-     * to <code>"&lt;invalid&gt;"</code>.
+     * {@code toString()} except that {@code null} is converted
+     * to {@code "<invalid>"}.
      * 
-     * @param type null-ok; the stack element
-     * @return non-null; the string form
+     * @param type {@code null-ok;} the stack element
+     * @return {@code non-null;} the string form
      */
     private static String stackElementString(TypeBearer type) {
         if (type == null) {
@@ -296,7 +296,7 @@ public final class ExecutionStack extends MutabilityControl {
     /**
      * Throws a properly-formatted exception.
      * 
-     * @param msg non-null; useful message
+     * @param msg {@code non-null;} useful message
      * @return never (keeps compiler happy)
      */
     private static TypeBearer throwSimException(String msg) {
index a74d142..f345335 100644 (file)
@@ -29,20 +29,20 @@ import com.android.dx.util.IntList;
  * results" area.
  */
 public final class Frame {
-    /** non-null; the locals */
+    /** {@code non-null;} the locals */
     private final LocalsArray locals;
 
-    /** non-null; the stack */
+    /** {@code non-null;} the stack */
     private final ExecutionStack stack;
 
-    /** null-ok; stack of labels of subroutines that this block is nested in */
+    /** {@code null-ok;} stack of labels of subroutines that this block is nested in */
     private final IntList subroutines;
 
     /**
      * Constructs an instance.
      *
-     * @param locals non-null; the locals array to use
-     * @param stack non-null; the execution stack to use
+     * @param locals {@code non-null;} the locals array to use
+     * @param stack {@code non-null;} the execution stack to use
      */
     private Frame(LocalsArray locals, ExecutionStack stack) {
         this(locals, stack, IntList.EMPTY);
@@ -51,9 +51,9 @@ public final class Frame {
     /**
      * Constructs an instance.
      *
-     * @param locals non-null; the locals array to use
-     * @param stack non-null; the execution stack to use
-     * @param subroutines non-null; list of subroutine start labels for
+     * @param locals {@code non-null;} the locals array to use
+     * @param stack {@code non-null;} the execution stack to use
+     * @param subroutines {@code non-null;} list of subroutine start labels for
      * subroutines this frame is nested in
      */
     private Frame(LocalsArray locals,
@@ -75,12 +75,12 @@ public final class Frame {
 
     /**
      * Constructs an instance. The locals array initially consists of
-     * all-uninitialized values (represented as <code>null</code>s) and
+     * all-uninitialized values (represented as {@code null}s) and
      * the stack starts out empty.
      *
-     * @param maxLocals &gt;= 0; the maximum number of locals this instance
+     * @param maxLocals {@code >= 0;} the maximum number of locals this instance
      * can refer to
-     * @param maxStack &gt;= 0; the maximum size of the stack for this
+     * @param maxStack {@code >= 0;} the maximum size of the stack for this
      * instance
      */
     public Frame(int maxLocals, int maxStack) {
@@ -92,7 +92,7 @@ public final class Frame {
      * contains copies of the locals and stack (that is, it doesn't
      * share them with the original).
      *
-     * @return non-null; the copy
+     * @return {@code non-null;} the copy
      */
     public Frame copy() {
         return new Frame(locals.copy(), stack.copy(), subroutines);
@@ -111,7 +111,7 @@ public final class Frame {
      * Replaces all the occurrences of the given uninitialized type in
      * this frame with its initialized equivalent.
      *
-     * @param type non-null; type to replace
+     * @param type {@code non-null;} type to replace
      */
     public void makeInitialized(Type type) {
         locals.makeInitialized(type);
@@ -121,7 +121,7 @@ public final class Frame {
     /**
      * Gets the locals array for this instance.
      *
-     * @return non-null; the locals array
+     * @return {@code non-null;} the locals array
      */
     public LocalsArray getLocals() {
         return locals;
@@ -130,7 +130,7 @@ public final class Frame {
     /**
      * Gets the execution stack for this instance.
      *
-     * @return non-null; the execution stack
+     * @return {@code non-null;} the execution stack
      */
     public ExecutionStack getStack() {
         return stack;
@@ -143,7 +143,7 @@ public final class Frame {
      * list is ordered such that the deepest nesting (the actual subroutine
      * this block is in) is the last label in the list.
      *
-     * @return non-null; list as noted above
+     * @return {@code non-null;} list as noted above
      */
     public IntList getSubroutines() {
         return subroutines;
@@ -171,10 +171,10 @@ public final class Frame {
      * be used when returning from a subroutine. The stack state of all
      * subroutine invocations is identical, but the locals state may differ.
      *
-     * @param startLabel &gt;=0; The label of the returning subroutine's
+     * @param startLabel {@code >=0;} The label of the returning subroutine's
      * start block
-     * @param subLabel &gt;=0; A calling label of a subroutine
-     * @return null-ok; an appropriatly-constructed instance, or null
+     * @param subLabel {@code >=0;} A calling label of a subroutine
+     * @return {@code null-ok;} an appropriatly-constructed instance, or null
      * if label is not in the set
      */
     public Frame subFrameForLabel(int startLabel, int subLabel) {
@@ -206,8 +206,8 @@ public final class Frame {
      * Merges two frames. If the merged result is the same as this frame,
      * then this instance is returned.
      *
-     * @param other non-null; another frame
-     * @return non-null; the result of merging the two frames
+     * @param other {@code non-null;} another frame
+     * @return {@code non-null;} the result of merging the two frames
      */
     public Frame mergeWith(Frame other) {
         LocalsArray resultLocals;
@@ -237,7 +237,7 @@ public final class Frame {
      * 
      * @param otherSubroutines label list of subroutine start blocks, from
      * least-nested to most-nested.
-     * @return non-null; merged subroutine nest list as described above
+     * @return {@code non-null;} merged subroutine nest list as described above
      */
     private IntList mergeSubroutineLists(IntList otherSubroutines) {
         if (subroutines.equals(otherSubroutines)) {
@@ -265,10 +265,10 @@ public final class Frame {
      * need to be trimmed of all OneLocalsArray elements that relevent to
      * the subroutine that is returning.
      *
-     * @param locals non-null; LocalsArray from before a merge
-     * @param subroutines non-null; a label list of subroutine start blocks
+     * @param locals {@code non-null;} LocalsArray from before a merge
+     * @param subroutines {@code non-null;} a label list of subroutine start blocks
      * representing the subroutine nesting of the block being merged into.
-     * @return non-null; locals set appropriate for merge
+     * @return {@code non-null;} locals set appropriate for merge
      */
     private static LocalsArray adjustLocalsForSubroutines(
             LocalsArray locals, IntList subroutines) {
@@ -301,13 +301,13 @@ public final class Frame {
 
     /**
      * Merges this frame with the frame of a subroutine caller at
-     * <code>predLabel</code>. Only called on the frame at the first
+     * {@code predLabel}. Only called on the frame at the first
      * block of a subroutine.
      *
-     * @param other non-null; another frame
+     * @param other {@code non-null;} another frame
      * @param subLabel label of subroutine start block
      * @param predLabel label of calling block
-     * @return non-null; the result of merging the two frames
+     * @return {@code non-null;} the result of merging the two frames
      */
     public Frame mergeWithSubroutineCaller(Frame other, int subLabel,
             int predLabel) {
@@ -374,7 +374,7 @@ public final class Frame {
      * subroutine calls return.
      *
      * @param subLabel label of subroutine start block
-     * @param callerLabel &gt;=0 label of the caller block where this frame
+     * @param callerLabel {@code >=0;} label of the caller block where this frame
      * came from.
      * @return a new instance to begin a called subroutine.
      */
@@ -406,7 +406,7 @@ public final class Frame {
      * Annotates (adds context to) the given exception with information
      * about this frame.
      *
-     * @param ex non-null; the exception to annotate
+     * @param ex {@code non-null;} the exception to annotate
      */
     public void annotate(ExceptionWithContext ex) {
         locals.annotate(ex);
index 35875b0..7af3f4e 100644 (file)
@@ -20,19 +20,19 @@ import com.android.dx.util.FixedSizeList;
 
 /**
  * List of "line number" entries, which are the contents of
- * <code>LineNumberTable</code> attributes.
+ * {@code LineNumberTable} attributes.
  */
 public final class LineNumberList extends FixedSizeList {
-    /** non-null; zero-size instance */
+    /** {@code non-null;} zero-size instance */
     public static final LineNumberList EMPTY = new LineNumberList(0);
 
     /**
      * Returns an instance which is the concatenation of the two given
      * instances.
      * 
-     * @param list1 non-null; first instance
-     * @param list2 non-null; second instance
-     * @return non-null; combined instance
+     * @param list1 {@code non-null;} first instance
+     * @param list2 {@code non-null;} second instance
+     * @return {@code non-null;} combined instance
      */
     public static LineNumberList concat(LineNumberList list1,
                                         LineNumberList list2) {
@@ -68,8 +68,8 @@ public final class LineNumberList extends FixedSizeList {
     /**
      * Gets the indicated item.
      * 
-     * @param n &gt;= 0; which item
-     * @return null-ok; the indicated item
+     * @param n {@code >= 0;} which item
+     * @return {@code null-ok;} the indicated item
      */
     public Item get(int n) {
         return (Item) get0(n);
@@ -78,8 +78,8 @@ public final class LineNumberList extends FixedSizeList {
     /**
      * Sets the item at the given index.
      * 
-     * @param n &gt;= 0, &lt; size(); which element
-     * @param item non-null; the item
+     * @param n {@code >= 0, < size();} which element
+     * @param item {@code non-null;} the item
      */
     public void set(int n, Item item) {
         if (item == null) {
@@ -92,9 +92,9 @@ public final class LineNumberList extends FixedSizeList {
     /**
      * Sets the item at the given index.
      * 
-     * @param n &gt;= 0, &lt; size(); which element
-     * @param startPc &gt;= 0; start pc of this item
-     * @param lineNumber &gt;= 0; corresponding line number
+     * @param n {@code >= 0, < size();} which element
+     * @param startPc {@code >= 0;} start pc of this item
+     * @param lineNumber {@code >= 0;} corresponding line number
      */
     public void set(int n, int startPc, int lineNumber) {
         set0(n, new Item(startPc, lineNumber));
@@ -103,8 +103,8 @@ public final class LineNumberList extends FixedSizeList {
     /**
      * Gets the line number associated with the given address.
      * 
-     * @param pc &gt;= 0; the address to look up
-     * @return &gt;= -1; the associated line number, or <code>-1</code> if
+     * @param pc {@code >= 0;} the address to look up
+     * @return {@code >= -1;} the associated line number, or {@code -1} if
      * none is known
      */
     public int pcToLine(int pc) {
@@ -138,17 +138,17 @@ public final class LineNumberList extends FixedSizeList {
      * Item in a line number table.
      */
     public static class Item {
-        /** &gt;= 0; start pc of this item */
+        /** {@code >= 0;} start pc of this item */
         private final int startPc;
 
-        /** &gt;= 0; corresponding line number */
+        /** {@code >= 0;} corresponding line number */
         private final int lineNumber;
 
         /**
          * Constructs an instance.
          * 
-         * @param startPc &gt;= 0; start pc of this item
-         * @param lineNumber &gt;= 0; corresponding line number
+         * @param startPc {@code >= 0;} start pc of this item
+         * @param lineNumber {@code >= 0;} corresponding line number
          */
         public Item(int startPc, int lineNumber) {
             if (startPc < 0) {
index 1087603..9f19528 100644 (file)
@@ -23,20 +23,20 @@ import com.android.dx.util.FixedSizeList;
 
 /**
  * List of "local variable" entries, which are the contents of
- * <code>LocalVariableTable</code> and <code>LocalVariableTypeTable</code>
+ * {@code LocalVariableTable} and {@code LocalVariableTypeTable}
  * attributes, as well as combinations of the two.
  */
 public final class LocalVariableList extends FixedSizeList {
-    /** non-null; zero-size instance */
+    /** {@code non-null;} zero-size instance */
     public static final LocalVariableList EMPTY = new LocalVariableList(0);
 
     /**
      * Returns an instance which is the concatenation of the two given
      * instances. The result is immutable.
      * 
-     * @param list1 non-null; first instance
-     * @param list2 non-null; second instance
-     * @return non-null; combined instance
+     * @param list1 {@code non-null;} first instance
+     * @param list2 {@code non-null;} second instance
+     * @return {@code non-null;} combined instance
      */
     public static LocalVariableList concat(LocalVariableList list1,
                                            LocalVariableList list2) {
@@ -70,9 +70,9 @@ public final class LocalVariableList extends FixedSizeList {
      * element in the signature list gets augmented with the
      * corresponding signature. The result is immutable.
      * 
-     * @param descriptorList non-null; list with descriptors
-     * @param signatureList non-null; list with signatures
-     * @return non-null; the merged result
+     * @param descriptorList {@code non-null;} list with descriptors
+     * @param signatureList {@code non-null;} list with signatures
+     * @return {@code non-null;} the merged result
      */
     public static LocalVariableList mergeDescriptorsAndSignatures(
             LocalVariableList descriptorList,
@@ -107,8 +107,8 @@ public final class LocalVariableList extends FixedSizeList {
     /**
      * Gets the indicated item.
      * 
-     * @param n &gt;= 0; which item
-     * @return null-ok; the indicated item
+     * @param n {@code >= 0;} which item
+     * @return {@code null-ok;} the indicated item
      */
     public Item get(int n) {
         return (Item) get0(n);
@@ -117,8 +117,8 @@ public final class LocalVariableList extends FixedSizeList {
     /**
      * Sets the item at the given index.
      * 
-     * @param n &gt;= 0, &lt; size(); which element
-     * @param item non-null; the item
+     * @param n {@code >= 0, < size();} which element
+     * @param item {@code non-null;} the item
      */
     public void set(int n, Item item) {
         if (item == null) {
@@ -131,17 +131,17 @@ public final class LocalVariableList extends FixedSizeList {
     /**
      * Sets the item at the given index.
      * 
-     * <p><b>Note:</b> At least one of <code>descriptor</code> or
-     * <code>signature</code> must be passed as non-null.</p>
+     * <p><b>Note:</b> At least one of {@code descriptor} or
+     * {@code signature} must be passed as non-null.</p>
      * 
-     * @param n &gt;= 0, &lt; size(); which element
-     * @param startPc &gt;= 0; the start pc of this variable's scope
-     * @param length &gt;= 0; the length (in bytecodes) of this variable's
+     * @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
      * scope
-     * @param name non-null; the variable's name
-     * @param descriptor null-ok; the variable's type descriptor
-     * @param signature null-ok; the variable's type signature
-     * @param index &gt;= 0; the variable's local index
+     * @param name {@code non-null;} the variable's name
+     * @param descriptor {@code null-ok;} the variable's type descriptor
+     * @param signature {@code null-ok;} the variable's type signature
+     * @param index {@code >= 0;} the variable's local index
      */
     public void set(int n, int startPc, int length, CstUtf8 name,
             CstUtf8 descriptor, CstUtf8 signature, int index) {
@@ -153,9 +153,9 @@ public final class LocalVariableList extends FixedSizeList {
      * the given {@link com.android.dx.cf.code.LocalVariableList.Item}
      * in all respects but the type descriptor and signature, if any.
      * 
-     * @param item non-null; local variable information to match
-     * @return null-ok; the corresponding local variable information stored
-     * in this instance, or <code>null</code> if there is no matching
+     * @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
      * information
      */
     public Item itemToLocal(Item item) {
@@ -178,10 +178,10 @@ public final class LocalVariableList extends FixedSizeList {
      * variable's start point is listed as the address of the instruction
      * <i>just past</i> the one that sets the variable.
      * 
-     * @param pc &gt;= 0; the address to look up
-     * @param index &gt;= 0; the local variable index
-     * @return null-ok; the associated local variable information, or
-     * <code>null</code> if none is known
+     * @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
+     * {@code null} if none is known
      */
     public Item pcAndIndexToLocal(int pc, int index) {
         int sz = size();
@@ -201,37 +201,37 @@ public final class LocalVariableList extends FixedSizeList {
      * Item in a local variable table.
      */
     public static class Item {
-        /** &gt;= 0; the start pc of this variable's scope */
+        /** {@code >= 0;} the start pc of this variable's scope */
         private final int startPc;
 
-        /** &gt;= 0; the length (in bytecodes) of this variable's scope */
+        /** {@code >= 0;} the length (in bytecodes) of this variable's scope */
         private final int length;
 
-        /** non-null; the variable's name */
+        /** {@code non-null;} the variable's name */
         private final CstUtf8 name;
 
-        /** null-ok; the variable's type descriptor */
+        /** {@code null-ok;} the variable's type descriptor */
         private final CstUtf8 descriptor;
 
-        /** null-ok; the variable's type signature */
+        /** {@code null-ok;} the variable's type signature */
         private final CstUtf8 signature;
 
-        /** &gt;= 0; the variable's local index */
+        /** {@code >= 0;} the variable's local index */
         private final int index;
 
         /**
          * Constructs an instance.
          * 
-         * <p><b>Note:</b> At least one of <code>descriptor</code> or
-         * <code>signature</code> must be passed as non-null.</p>
+         * <p><b>Note:</b> At least one of {@code descriptor} or
+         * {@code signature} must be passed as non-null.</p>
          * 
-         * @param startPc &gt;= 0; the start pc of this variable's scope
-         * @param length &gt;= 0; the length (in bytecodes) of this variable's
+         * @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
-         * @param name non-null; the variable's name
-         * @param descriptor null-ok; the variable's type descriptor
-         * @param signature null-ok; the variable's type signature
-         * @param index &gt;= 0; the variable's local index
+         * @param name {@code non-null;} the variable's name
+         * @param descriptor {@code null-ok;} the variable's type descriptor
+         * @param signature {@code null-ok;} the variable's type signature
+         * @param index {@code >= 0;} the variable's local index
          */
         public Item(int startPc, int length, CstUtf8 name,
                 CstUtf8 descriptor, CstUtf8 signature, int index) {
@@ -267,7 +267,7 @@ public final class LocalVariableList extends FixedSizeList {
         /**
          * Gets the start pc of this variable's scope.
          * 
-         * @return &gt;= 0; the start pc of this variable's scope
+         * @return {@code >= 0;} the start pc of this variable's scope
          */
         public int getStartPc() {
             return startPc;
@@ -276,7 +276,7 @@ public final class LocalVariableList extends FixedSizeList {
         /**
          * Gets the length (in bytecodes) of this variable's scope.
          * 
-         * @return &gt;= 0; the length (in bytecodes) of this variable's scope
+         * @return {@code >= 0;} the length (in bytecodes) of this variable's scope
          */
         public int getLength() {
             return length;
@@ -285,7 +285,7 @@ public final class LocalVariableList extends FixedSizeList {
         /**
          * Gets the variable's type descriptor.
          *
-         * @return null-ok; the variable's type descriptor
+         * @return {@code null-ok;} the variable's type descriptor
          */
         public CstUtf8 getDescriptor() {
             return descriptor;
@@ -294,7 +294,7 @@ public final class LocalVariableList extends FixedSizeList {
         /**
          * Gets the variable's LocalItem, a (name, signature) tuple
          *
-         * @return null-ok; the variable's type descriptor
+         * @return {@code null-ok;} the variable's type descriptor
          */
         public LocalItem getLocalItem() {
             return LocalItem.make(name, signature);
@@ -304,7 +304,7 @@ public final class LocalVariableList extends FixedSizeList {
          * Gets the variable's type signature. Private because if you need this,
          * you want getLocalItem() instead.
          *
-         * @return null-ok; the variable's type signature
+         * @return {@code null-ok;} the variable's type signature
          */
         private CstUtf8 getSignature() {
             return signature;
@@ -313,7 +313,7 @@ public final class LocalVariableList extends FixedSizeList {
         /**
          * Gets the variable's local index.
          * 
-         * @return &gt;= 0; the variable's local index
+         * @return {@code >= 0;} the variable's local index
          */
         public int getIndex() {
             return index;
@@ -321,9 +321,9 @@ public final class LocalVariableList extends FixedSizeList {
 
         /**
          * Gets the variable's type descriptor. This is a convenient shorthand
-         * for <code>Type.intern(getDescriptor().getString())</code>.
+         * for {@code Type.intern(getDescriptor().getString())}.
          * 
-         * @return non-null; the variable's type
+         * @return {@code non-null;} the variable's type
          */
         public Type getType() {
             return Type.intern(descriptor.getString());
@@ -333,8 +333,8 @@ 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 non-null; the new signature
-         * @return non-null; an appropriately-constructed instance
+         * @param newSignature {@code non-null;} the new signature
+         * @return {@code non-null;} an appropriately-constructed instance
          */
         public Item withSignature(CstUtf8 newSignature) {
             return new Item(startPc, length, name, descriptor, newSignature,
@@ -345,10 +345,10 @@ public final class LocalVariableList extends FixedSizeList {
          * Gets whether this instance matches (describes) the given
          * address and index.
          * 
-         * @param pc &gt;= 0; the address in question
-         * @param index &gt;= 0; the local variable index in question
-         * @return <code>true</code> iff this instance matches <code>pc</code>
-         * and <code>index</code>
+         * @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}
+         * and {@code index}
          */
         public boolean matchesPcAndIndex(int pc, int index) {
             return (index == this.index) &&
@@ -361,8 +361,8 @@ public final class LocalVariableList extends FixedSizeList {
          * other instance exactly in all fields except type descriptor and
          * type signature.
          * 
-         * @param other non-null; the instance to compare to
-         * @return <code>true</code> iff this instance matches
+         * @param other {@code non-null;} the instance to compare to
+         * @return {@code true} iff this instance matches
          */
         public boolean matchesAllButType(Item other) {
             return (startPc == other.startPc)
index 1c324ca..b2c2689 100644 (file)
@@ -36,7 +36,7 @@ public abstract class LocalsArray extends MutabilityControl implements ToHuman {
     /**
      * Constructs an instance, explicitly indicating the mutability.
      *
-     * @param mutable <code>true</code> if this instance is mutable
+     * @param mutable {@code true} if this instance is mutable
      */   
     protected LocalsArray(boolean mutable) {
         super(mutable);
@@ -45,7 +45,7 @@ public abstract class LocalsArray extends MutabilityControl implements ToHuman {
     /**
      * Makes and returns a mutable copy of this instance.
      * 
-     * @return non-null; the copy
+     * @return {@code non-null;} the copy
      */
     public abstract LocalsArray copy();
 
@@ -53,7 +53,7 @@ public abstract class LocalsArray extends MutabilityControl implements ToHuman {
      * Annotates (adds context to) the given exception with information
      * about this instance.
      * 
-     * @param ex non-null; the exception to annotate
+     * @param ex {@code non-null;} the exception to annotate
      */
     public abstract void annotate(ExceptionWithContext ex);
 
@@ -61,7 +61,7 @@ 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 non-null; type to replace
+     * @param type {@code non-null;} type to replace
      */
     public abstract void makeInitialized(Type type);
 
@@ -71,16 +71,17 @@ public abstract class LocalsArray extends MutabilityControl implements ToHuman {
      * @return the max locals
      */
     public abstract int getMaxLocals();
+
     /**
      * Sets the type stored at the given local index. If the given type
      * is category-2, then (a) the index must be at least two less than
-     * <code>getMaxLocals()</code> and (b) the next index gets invalidated
+     * {@link #getMaxLocals} and (b) the next index gets invalidated
      * 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 &gt;= 0, &lt; getMaxLocals(); which local
-     * @param type non-null; new type for the local at <code>idx</code>
+     * @param idx {@code >= 0, < getMaxLocals();} which local
+     * @param type {@code non-null;} new type for the local at {@code idx}
      */
     public abstract void set(int idx, TypeBearer type);
 
@@ -88,25 +89,25 @@ public abstract class LocalsArray extends MutabilityControl implements ToHuman {
      * Sets the type for the local indicated by the given register spec
      * to that register spec (which includes type and optional name
      * information). This is identical to calling
-     * <code>set(spec.getReg(), spec)</code>.
+     * {@code set(spec.getReg(), spec)}.
      * 
-     * @param spec non-null; register spec to use as the basis for the update
+     * @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 &gt;= 0, &lt; getMaxLocals(); which local
+     * @param idx {@code >= 0, < getMaxLocals();} which local
      */
     public abstract void invalidate(int idx);
 
     /**
-     * Gets the type stored at the given local index, or <code>null</code>
+     * Gets the type stored at the given local index, or {@code null}
      * if the given local is uninitialized / invalid.
      * 
-     * @param idx &gt;= 0, &lt; getMaxLocals(); which local
-     * @return null-ok; the type of value stored in that local
+     * @param idx {@code >= 0, < getMaxLocals();} which local
+     * @return {@code null-ok;} the type of value stored in that local
      */
     public abstract TypeBearer getOrNull(int idx);
 
@@ -115,9 +116,9 @@ public abstract class LocalsArray extends MutabilityControl implements ToHuman {
      * the given local contains a valid type (though it is allowed to
      * be an uninitialized instance).
      * 
-     * @param idx &gt;= 0, &lt; getMaxLocals(); which local
-     * @return non-null; the type of value stored in that local
-     * @throws SimException thrown if <code>idx</code> is valid, but
+     * @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
      * the contents are invalid
      */
     public abstract TypeBearer get(int idx);
@@ -126,9 +127,9 @@ 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 &gt;= 0, &lt; getMaxLocals(); which local
-     * @return non-null; the type of value stored in that local
-     * @throws SimException thrown if <code>idx</code> is valid, but
+     * @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
      * one of the following holds: (a) the local is invalid; (b) the local
      * contains an uninitialized instance; (c) the local contains a
      * category-2 value
@@ -139,39 +140,39 @@ 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 &gt;= 0, &lt; getMaxLocals(); which local
-     * @return non-null; the type of value stored in that local
-     * @throws SimException thrown if <code>idx</code> is valid, but
+     * @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
      * one of the following holds: (a) the local is invalid; (b) the local
      * contains a category-1 value
      */
     public abstract TypeBearer getCategory2(int idx);
 
     /**
-     * Merges this instance with <code>other</code>. If the merged result is
+     * Merges this instance with {@code other}. If the merged result is
      * the same as this instance, then this is returned (not a copy).
      *
-     * @param other non-null; another LocalsArray
-     * @return non-null; the merge result, a new instance or this
+     * @param other {@code non-null;} another LocalsArray
+     * @return {@code non-null;} the merge result, a new instance or this
      */
     public abstract LocalsArray merge(LocalsArray other);
 
     /**
-     * Merges this instance with a <code>LocalsSet</code> from a subroutine
+     * Merges this instance with a {@code LocalsSet} from a subroutine
      * caller. To be used when merging in the first block of a subroutine.
      *
-     * @param other other non-null; another LocalsArray. The final locals
+     * @param other {@code other non-null;} another LocalsArray. The final locals
      * state of a subroutine caller.
      * @param predLabel the label of the subroutine caller block.
-     * @return non-null; the merge result, a new instance or this
+     * @return {@code non-null;} the merge result, a new instance or this
      */
     public abstract LocalsArraySet mergeWithSubroutineCaller
             (LocalsArray other, int predLabel);
 
     /**
      * Gets the locals set appropriate for the current execution context.
-     * That is, if this is a <code>OneLocalsArray</code> instance, then return
-     * <code>this</code>, otherwise return <code>LocalsArraySet</code>'s
+     * That is, if this is a {@code OneLocalsArray} instance, then return
+     * {@code this}, otherwise return {@code LocalsArraySet}'s
      * primary.
      *
      * @return locals for this execution context.
index 9e24da9..7161176 100644 (file)
@@ -51,9 +51,9 @@ public class LocalsArraySet extends LocalsArray {
 
     /**
      * Constructs an instance. The locals array initially consists of
-     * all-uninitialized values (represented as <code>null</code>s).
+     * all-uninitialized values (represented as {@code null}s).
      *
-     * @param maxLocals &gt;= 0; the maximum number of locals this instance
+     * @param maxLocals {@code >= 0;} the maximum number of locals this instance
      * can refer to
      */
     public LocalsArraySet(int maxLocals) {
@@ -65,8 +65,8 @@ public class LocalsArraySet extends LocalsArray {
     /**
      * Constructs an instance with the specified primary and secondaries set.
      *
-     * @param primary non-null; primary locals to use
-     * @param secondaries non-null; secondaries set, indexed by subroutine
+     * @param primary {@code non-null;} primary locals to use
+     * @param secondaries {@code non-null;} secondaries set, indexed by subroutine
      * caller label.
      */
     public LocalsArraySet(OneLocalsArray primary,
@@ -80,7 +80,7 @@ public class LocalsArraySet extends LocalsArray {
     /**
      * Constructs an instance which is a copy of another.
      *
-     * @param toCopy non-null; instance to copy.
+     * @param toCopy {@code non-null;} instance to copy.
      */
     private LocalsArraySet(LocalsArraySet toCopy) {
         super(toCopy.getMaxLocals() > 0);
@@ -250,10 +250,10 @@ public class LocalsArraySet extends LocalsArray {
     }
 
     /**
-     * Merges this set with another <code>LocalsArraySet</code> instance.
+     * Merges this set with another {@code LocalsArraySet} instance.
      *
-     * @param other non-null; to merge
-     * @return non-null; this instance if merge was a no-op, or
+     * @param other {@code non-null;} to merge
+     * @return {@code non-null;} this instance if merge was a no-op, or
      * new merged instance.
      */
     private LocalsArraySet mergeWithSet(LocalsArraySet other) {
@@ -301,10 +301,10 @@ public class LocalsArraySet extends LocalsArray {
     }
 
     /**
-     * Merges this set with a <code>OneLocalsArray</code> instance.
+     * Merges this set with a {@code OneLocalsArray} instance.
      *
-     * @param other non-null; to merge
-     * @return non-null; this instance if merge was a no-op, or
+     * @param other {@code non-null;} to merge
+     * @return {@code non-null;} this instance if merge was a no-op, or
      * new merged instance.
      */
     private LocalsArraySet mergeWithOne(OneLocalsArray other) {
@@ -365,11 +365,11 @@ public class LocalsArraySet extends LocalsArray {
     }
 
     /**
-     * Gets the <code>LocalsArray</code> instance for a specified subroutine
+     * Gets the {@code LocalsArray} instance for a specified subroutine
      * caller label, or null if label has no locals associated with it.
      *
-     * @param label &gt;=0 subroutine caller label
-     * @return null-ok; locals if available.
+     * @param label {@code >= 0;} subroutine caller label
+     * @return {@code null-ok;} locals if available.
      */
     private LocalsArray getSecondaryForLabel(int label) {
         if (label >= secondaries.size()) {
@@ -445,8 +445,8 @@ public class LocalsArraySet extends LocalsArray {
      * Returns a LocalsArray instance representing the locals state that should
      * be used when returning to a subroutine caller.
      *
-     * @param subLabel &gt;= 0; A calling label of a subroutine
-     * @return null-ok; an instance for this subroutine, or null if subroutine
+     * @param subLabel {@code >= 0;} A calling label of a subroutine
+     * @return {@code null-ok;} an instance for this subroutine, or null if subroutine
      * is not in this set.
      */
     public LocalsArray subArrayForLabel(int subLabel) {
index 517a10d..aff50b2 100644 (file)
@@ -32,9 +32,9 @@ 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</code> argument for instance methods.
+     * {@code this} argument for instance methods.
      * 
-     * @return non-null; the method prototype
+     * @return {@code non-null;} the method prototype
      */
     public Prototype getPrototype();
     
@@ -48,21 +48,21 @@ public interface Machine {
      * and store them in the arguments area, indicating that there are now
      * that many arguments. Also, clear the auxiliary arguments.
      *
-     * @param frame non-null; frame to operate on
-     * @param count &gt;= 0; number of values to pop
+     * @param frame {@code non-null;} frame to operate on
+     * @param count {@code >= 0;} number of values to pop
      */
     public void popArgs(Frame frame, int count);
 
     /**
      * Pops values from the stack of the types indicated by the given
-     * <code>Prototype</code> (popped in reverse of the argument
+     * {@code Prototype} (popped in reverse of the argument
      * order, so the first prototype argument type is for the deepest
      * element of the stack), and store them in the arguments area,
      * indicating that there are now that many arguments. Also, clear
      * the auxiliary arguments.
      *
-     * @param frame non-null; frame to operate on
-     * @param prototype non-null; prototype indicating arguments to pop
+     * @param frame {@code non-null;} frame to operate on
+     * @param prototype {@code non-null;} prototype indicating arguments to pop
      */
     public void popArgs(Frame frame, Prototype prototype);
 
@@ -71,8 +71,8 @@ public interface Machine {
      * in the arguments area, indicating that there are now that many
      * arguments. Also, clear the auxiliary arguments.
      *
-     * @param frame non-null; frame to operate on
-     * @param type non-null; type of the argument
+     * @param frame {@code non-null;} frame to operate on
+     * @param type {@code non-null;} type of the argument
      */
     public void popArgs(Frame frame, Type type);
 
@@ -83,9 +83,9 @@ public interface Machine {
      * area, indicating that there are now that many arguments. Also,
      * clear the auxiliary arguments.
      *
-     * @param frame non-null; frame to operate on
-     * @param type1 non-null; type of the first argument
-     * @param type2 non-null; type of the second argument
+     * @param frame {@code non-null;} frame to operate on
+     * @param type1 {@code non-null;} type of the first argument
+     * @param type2 {@code non-null;} type of the second argument
      */
     public void popArgs(Frame frame, Type type1, Type type2);
 
@@ -96,10 +96,10 @@ public interface Machine {
      * area, indicating that there are now that many arguments. Also,
      * clear the auxiliary arguments.
      *
-     * @param frame non-null; frame to operate on
-     * @param type1 non-null; type of the first argument
-     * @param type2 non-null; type of the second argument
-     * @param type3 non-null; type of the third argument
+     * @param frame {@code non-null;} frame to operate on
+     * @param type1 {@code non-null;} type of the first argument
+     * @param type2 {@code non-null;} type of the second argument
+     * @param type3 {@code non-null;} type of the third argument
      */
     public void popArgs(Frame frame, Type type1, Type type2, Type type3);
 
@@ -107,8 +107,8 @@ public interface Machine {
      * Loads the local variable with the given index as the sole argument in
      * the arguments area. Also, clear the auxiliary arguments.
      *
-     * @param frame non-null; frame to operate on
-     * @param idx &gt;= 0; the local variable index
+     * @param frame {@code non-null;} frame to operate on
+     * @param idx {@code >= 0;} the local variable index
      */
     public void localArg(Frame frame, int idx);
 
@@ -116,28 +116,28 @@ public interface Machine {
      * Indicates that the salient type of this operation is as
      * given. This differentiates between, for example, the various
      * arithmetic opcodes, which, by the time they hit a
-     * <code>Machine</code> are collapsed to the <code>int</code>
+     * {@code Machine} are collapsed to the {@code int}
      * variant. (See {@link BytecodeArray#parseInstruction} for
      * details.)
      *
-     * @param type non-null; the salient type of the upcoming operation
+     * @param type {@code non-null;} the salient type of the upcoming operation
      */
     public void auxType(Type type);
 
     /**
      * Indicates that there is an auxiliary (inline, not stack)
-     * argument of type <code>int</code>, with the given value.
+     * argument of type {@code int}, with the given value.
      *
      * <p><b>Note:</b> Perhaps unintuitively, the stack manipulation
-     * ops (e.g., <code>dup</code> and <code>swap</code>) use this to
+     * ops (e.g., {@code dup} and {@code swap}) use this to
      * indicate the result stack pattern with a straightforward hex
      * encoding of the push order starting with least-significant
      * nibbles getting pushed first). For example, an all-category-1
-     * <code>dup2_x1</code> sets this to <code>0x12312</code>, and the
+     * {@code dup2_x1} sets this to {@code 0x12312}, and the
      * other form of that op sets this to
-     * <code>0x121</code>.</p>
+     * {@code 0x121}.</p>
      *
-     * <p><b>Also Note:</b> For <code>switch*</code> instructions, this is
+     * <p><b>Also Note:</b> For {@code switch*} instructions, this is
      * used to indicate the padding value (which is only useful for
      * verification).</p>
      *
@@ -149,10 +149,10 @@ public interface Machine {
      * Indicates that there is an auxiliary (inline, not stack) object
      * argument, with the value based on the given constant.
      *
-     * <p><b>Note:</b> Some opcodes use both <code>int</code> and
+     * <p><b>Note:</b> Some opcodes use both {@code int} and
      * constant auxiliary arguments.</p>
      *
-     * @param cst non-null; the constant containing / referencing
+     * @param cst {@code non-null;} the constant containing / referencing
      * the value
      */
     public void auxCstArg(Constant cst);
@@ -167,12 +167,12 @@ public interface Machine {
 
     /**
      * Indicates that there is an auxiliary (inline, not stack) argument
-     * consisting of a <code>switch*</code> table.
+     * consisting of a {@code switch*} table.
      *
      * <p><b>Note:</b> This is generally used in conjunction with
      * {@link #auxIntArg} (which holds the padding).</p>
      *
-     * @param cases non-null; the list of key-target pairs, plus the default
+     * @param cases {@code non-null;} the list of key-target pairs, plus the default
      * target
      */
     public void auxSwitchArg(SwitchList cases);
@@ -181,7 +181,7 @@ public interface Machine {
      * Indicates that there is an auxiliary (inline, not stack) argument
      * consisting of a list of initial values for a newly created array.
      *
-     * @param initValues non-null; the list of constant values to initialize
+     * @param initValues {@code non-null;} the list of constant values to initialize
      * the array
      */
     public void auxInitValues(ArrayList<Constant> initValues);
@@ -189,9 +189,9 @@ public interface Machine {
     /**
      * Indicates that the target of this operation is the given local.
      *
-     * @param idx &gt;= 0; the local variable index
-     * @param type non-null; the type of the local
-     * @param local null-ok; the name and signature of the local, if known
+     * @param idx {@code >= 0;} the local variable index
+     * @param type {@code non-null;} the type of the local
+     * @param local {@code null-ok;} the name and signature of the local, if known
      */
     public void localTarget(int idx, Type type, LocalItem local);
 
@@ -199,10 +199,10 @@ public interface Machine {
      * "Runs" the indicated opcode in an appropriate way, using the arguments
      * area as appropriate, and modifying the given frame in response.
      *
-     * @param frame non-null; frame to operate on
-     * @param offset &gt;= 0; byte offset in the method to the opcode being
+     * @param frame {@code non-null;} frame to operate on
+     * @param offset {@code >= 0;} byte offset in the method to the opcode being
      * run
-     * @param opcode &gt;= 0; the opcode to run
+     * @param opcode {@code >= 0;} the opcode to run
      */
     public void run(Frame frame, int offset, int opcode);
 }
index adeaab2..8da9a18 100644 (file)
@@ -35,9 +35,9 @@ 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 non-null; a locals array
-     * @param locals2 non-null; another locals array
-     * @return non-null; the result of merging the two locals arrays
+     * @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
      */
     public static OneLocalsArray mergeLocals(OneLocalsArray locals1,
                                           OneLocalsArray locals2) {
@@ -87,9 +87,9 @@ 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 non-null; a stack
-     * @param stack2 non-null; another stack
-     * @return non-null; the result of merging the two stacks
+     * @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
      */
     public static ExecutionStack mergeStack(ExecutionStack stack1,
                                             ExecutionStack stack2) {
@@ -144,9 +144,9 @@ public final class Merger {
     /**
      * Merges two frame types.
      * 
-     * @param ft1 non-null; a frame type
-     * @param ft2 non-null; another frame type
-     * @return non-null; the result of merging the two 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
      */
     public static TypeBearer mergeType(TypeBearer ft1, TypeBearer ft2) {
         if ((ft1 == null) || ft1.equals(ft2)) {
@@ -209,12 +209,12 @@ public final class Merger {
      * the given subtype. This takes into account primitiveness,
      * int-likeness, known-nullness, and array dimensions, but does
      * not assume anything about class hierarchy other than that the
-     * type <code>Object</code> is the supertype of all reference
+     * type {@code Object} is the supertype of all reference
      * types and all arrays are assignable to
-     * <code>Serializable</code> and <code>Cloneable</code>.
+     * {@code Serializable} and {@code Cloneable}.
      * 
-     * @param supertypeBearer non-null; the supertype
-     * @param subtypeBearer non-null; the subtype
+     * @param supertypeBearer {@code non-null;} the supertype
+     * @param subtypeBearer {@code non-null;} the subtype
      */
     public static boolean isPossiblyAssignableFrom(TypeBearer supertypeBearer,
             TypeBearer subtypeBearer) {
index 3a590a1..cafd177 100644 (file)
@@ -31,14 +31,14 @@ import com.android.dx.util.MutabilityControl;
  * com.android.dx.rop.type.TypeBearer}.</p>
  */
 public class OneLocalsArray extends LocalsArray {
-    /** non-null; actual array */
+    /** {@code non-null;} actual array */
     private final TypeBearer[] locals;
 
     /**
      * Constructs an instance. The locals array initially consists of
-     * all-uninitialized values (represented as <code>null</code>s).
+     * all-uninitialized values (represented as {@code null}s).
      *
-     * @param maxLocals &gt;= 0; the maximum number of locals this instance
+     * @param maxLocals {@code >= 0;} the maximum number of locals this instance
      * can refer to
      */
     public OneLocalsArray(int maxLocals) {
@@ -237,7 +237,7 @@ public class OneLocalsArray extends LocalsArray {
      * Throws a properly-formatted exception.
      *
      * @param idx the salient local index
-     * @param msg non-null; useful message
+     * @param msg {@code non-null;} useful message
      * @return never (keeps compiler happy)
      */
     private static TypeBearer throwSimException(int idx, String msg) {
index c69253c..47c6071 100644 (file)
@@ -28,13 +28,13 @@ import com.android.dx.util.Hex;
  * what instances of this class hang onto.
  */
 public final class ReturnAddress implements TypeBearer {
-    /** &gt;= 0; the start address of the subroutine being returned from */
+    /** {@code >= 0;} the start address of the subroutine being returned from */
     private final int subroutineAddress;
 
     /**
      * Constructs an instance.
      * 
-     * @param subroutineAddress &gt;= 0; the start address of the
+     * @param subroutineAddress {@code >= 0;} the start address of the
      * subroutine being returned from
      */
     public ReturnAddress(int subroutineAddress) {
@@ -100,7 +100,7 @@ public final class ReturnAddress implements TypeBearer {
     /**
      * Gets the subroutine address.
      * 
-     * @return &gt;= 0; the subroutine address
+     * @return {@code >= 0;} the subroutine address
      */
     public int getSubroutineAddress() {
         return subroutineAddress;
index f3eecab..6ddfb7e 100644 (file)
@@ -66,10 +66,10 @@ public final class Ropper {
     /** number of special label offsets */
     private static final int SPECIAL_LABEL_COUNT = 7;
 
-    /** non-null; method being converted */
+    /** {@code non-null;} method being converted */
     private final ConcreteMethod method;
 
-    /** non-null; original block list */
+    /** {@code non-null;} original block list */
     private final ByteBlockList blocks;
 
     /** max locals of the method */
@@ -78,30 +78,30 @@ public final class Ropper {
     /** max label (exclusive) of any original bytecode block */
     private final int maxLabel;
 
-    /** non-null; simulation machine to use */
+    /** {@code non-null;} simulation machine to use */
     private final RopperMachine machine;
 
-    /** non-null; simulator to use */
+    /** {@code non-null;} simulator to use */
     private final Simulator sim;
 
     /**
-     * non-null; sparse array mapping block labels to initial frame contents,
+     * {@code non-null;} sparse array mapping block labels to initial frame contents,
      * if known 
      */
     private final Frame[] startFrames;
 
-    /** non-null; output block list in-progress */
+    /** {@code non-null;} output block list in-progress */
     private final ArrayList<BasicBlock> result;
 
     /**
-     * non-null; list of subroutine-nest labels
+     * {@code non-null;} list of subroutine-nest labels
      * (See {@link Frame#getSubroutines} associated with each result block.
      * Parallel to {@link Ropper#result}. 
      */
     private final ArrayList<IntList> resultSubroutines;
 
     /**
-     * non-null; for each block (by label) that is used as an exception
+     * {@code non-null;} for each block (by label) that is used as an exception
      * handler, the type of exception it catches 
      */
     private final Type[] catchTypes;
@@ -112,10 +112,10 @@ public final class Ropper {
      */
     private boolean synchNeedsExceptionHandler;
 
-    /** non-null; list of subroutines indexed by label of start address */
+    /** {@code non-null;} list of subroutines indexed by label of start address */
     private final Subroutine subroutines[];
 
-    /** true if <code>subroutines</code> is non-empty */
+    /** true if {@code subroutines} is non-empty */
     private boolean hasSubroutines;
 
     /**
@@ -155,7 +155,7 @@ public final class Ropper {
         }
 
         /**
-         * @return &gt;= 0; the label of the subroutine's start block.
+         * @return {@code >= 0;} the label of the subroutine's start block.
          */
         int getStartBlock() {
             return startBlock;
@@ -212,11 +212,11 @@ public final class Ropper {
 
         /**
          * Merges the specified frame into this subroutine's successors,
-         * setting <code>workSet</code> as appropriate. To be called with
+         * setting {@code workSet} as appropriate. To be called with
          * the frame of a subroutine ret block.
          *
-         * @param frame non-null; frame from ret block to merge
-         * @param workSet non-null; workset to update
+         * @param frame {@code non-null;} frame from ret block to merge
+         * @param workSet {@code non-null;} workset to update
          */
         void mergeToSuccessors(Frame frame, int[] workSet) {
             int sz = callerBlocks.size();
@@ -242,9 +242,9 @@ public final class Ropper {
     /**
      * Converts a {@link ConcreteMethod} to a {@link RopMethod}.
      * 
-     * @param method non-null; method to convert
-     * @param advice non-null; translation advice to use
-     * @return non-null; the converted instance
+     * @param method {@code non-null;} method to convert
+     * @param advice {@code non-null;} translation advice to use
+     * @return {@code non-null;} the converted instance
      */
     public static RopMethod convert(ConcreteMethod method,
             TranslationAdvice advice) {
@@ -263,8 +263,8 @@ public final class Ropper {
      * Constructs an instance. This class is not publicly instantiable; use
      * {@link #convert}.
      * 
-     * @param method non-null; method to convert
-     * @param advice non-null; translation advice to use
+     * @param method {@code non-null;} method to convert
+     * @param advice {@code non-null;} translation advice to use
      */
     private Ropper(ConcreteMethod method, TranslationAdvice advice) {
         if (method == null) {
@@ -307,7 +307,7 @@ public final class Ropper {
      * Gets the first (lowest) register number to use as the temporary
      * area when unwinding stack manipulation ops.
      * 
-     * @return &gt;= 0; the first register to use
+     * @return {@code >= 0;} the first register to use
      */
     /*package*/ int getFirstTempStackReg() {
         /*
@@ -326,8 +326,8 @@ public final class Ropper {
      * Gets the label for the exception handler setup block corresponding
      * to the given label.
      * 
-     * @param label &gt;= 0; the original label
-     * @return &gt;= 0; the corresponding exception handler setup label
+     * @param label {@code >= 0;} the original label
+     * @return {@code >= 0;} the corresponding exception handler setup label
      */
     private int getExceptionSetupLabel(int label) {
         return maxLabel + label;
@@ -337,8 +337,8 @@ public final class Ropper {
      * Gets the label for the given special-purpose block. The given label
      * should be one of the static constants defined by this class.
      * 
-     * @param label &lt; 0; the special label constant
-     * @return &gt;= 0; the actual label value to use
+     * @param label {@code < 0;} the special label constant
+     * @return {@code >= 0;} the actual label value to use
      */
     private int getSpecialLabel(int label) {
         /*
@@ -356,7 +356,7 @@ public final class Ropper {
     /**
      * Gets the minimum label for unreserved use.
      * 
-     * @return &gt;= 0; the minimum label
+     * @return {@code >= 0;} the minimum label
      */
     private int getMinimumUnreservedLabel() {
         /*
@@ -370,7 +370,7 @@ public final class Ropper {
     /**
      * Gets an arbitrary unreserved and available label.
      * 
-     * @return &gt;= 0; the label
+     * @return {@code >= 0;} the label
      */
     private int getAvailableLabel() {
         int candidate = getMinimumUnreservedLabel();
@@ -409,7 +409,7 @@ public final class Ropper {
      * Gets the total number of registers used for "normal" purposes (i.e.,
      * for the straightforward translation from the original Java).
      * 
-     * @return &gt;= 0; the total number of registers used
+     * @return {@code >= 0;} the total number of registers used
      */
     private int getNormalRegCount() {
         return maxLocals + method.getMaxStack();
@@ -419,7 +419,7 @@ public final class Ropper {
      * Gets the register spec to use to hold the object to synchronize on,
      * for a synchronized method.
      * 
-     * @return non-null; the register spec
+     * @return {@code non-null;} the register spec
      */
     private RegisterSpec getSynchReg() {
         /*
@@ -433,11 +433,11 @@ public final class Ropper {
 
     /**
      * Searches {@link #result} for a block with the given label. Return its
-     * index if found, or return <code>-1</code> if there is no such block.
+     * index if found, or return {@code -1} if there is no such block.
      * 
      * @param label the label to look for
-     * @return &gt;= -1; the index for the block with the given label or
-     * <code>-1</code> if there is no such block
+     * @return {@code >= -1;} the index for the block with the given label or
+     * {@code -1} if there is no such block
      */
     private int labelToResultIndex(int label) {
         int sz = result.size();
@@ -456,7 +456,7 @@ public final class Ropper {
      * found, or throw an exception if there is no such block.
      * 
      * @param label the label to look for
-     * @return non-null; the block with the given label
+     * @return {@code non-null;} the block with the given label
      */
     private BasicBlock labelToBlock(int label) {
         int idx = labelToResultIndex(label);
@@ -472,8 +472,8 @@ public final class Ropper {
     /**
      * Adds a block to the output result.
      * 
-     * @param block non-null; the block to add
-     * @param subroutines non-null; subroutine label list as described in
+     * @param block {@code non-null;} the block to add
+     * @param subroutines {@code non-null;} subroutine label list as described in
      * {@link Frame#getSubroutines}
      */
     private void addBlock(BasicBlock block, IntList subroutines) {
@@ -491,11 +491,11 @@ public final class Ropper {
      * replacement, then any extra blocks that got added with the
      * original get removed as a result of calling this method.
      * 
-     * @param block non-null; the block to add or replace
-     * @param subroutines non-null; subroutine label list as described in
+     * @param block {@code non-null;} the block to add or replace
+     * @param subroutines {@code non-null;} subroutine label list as described in
      * {@link Frame#getSubroutines}
-     * @return <code>true</code> if the block was replaced or
-     * <code>false</code> if it was added for the first time
+     * @return {@code true} if the block was replaced or
+     * {@code false} if it was added for the first time
      */
     private boolean addOrReplaceBlock(BasicBlock block, IntList subroutines) {
         if (block == null) {
@@ -529,11 +529,11 @@ public final class Ropper {
      * Adds or replaces a block in the output result. Do not delete
      * any successors.
      *
-     * @param block non-null; the block to add or replace
-     * @param subroutines non-null; subroutine label list as described in
+     * @param block {@code non-null;} the block to add or replace
+     * @param subroutines {@code non-null;} subroutine label list as described in
      * {@link Frame#getSubroutines}
-     * @return <code>true</code> if the block was replaced or
-     * <code>false</code> if it was added for the first time
+     * @return {@code true} if the block was replaced or
+     * {@code false} if it was added for the first time
      */
     private boolean addOrReplaceBlockNoDelete(BasicBlock block,
             IntList subroutines) {
@@ -564,7 +564,7 @@ public final class Ropper {
      * successors of it whose labels indicate that they are not in the
      * normally-translated range.
      * 
-     * @param idx non-null; block to remove (etc.)
+     * @param idx {@code non-null;} block to remove (etc.)
      */
     private void removeBlockAndSpecialSuccessors(int idx) {
         int minLabel = getMinimumUnreservedLabel();
@@ -591,7 +591,7 @@ public final class Ropper {
     /**
      * Extracts the resulting {@link RopMethod} from the instance.
      * 
-     * @return non-null; the method object
+     * @return {@code non-null;} the method object
      */
     private RopMethod getRopMethod() {
 
@@ -663,9 +663,9 @@ public final class Ropper {
     /**
      * Processes the given block.
      * 
-     * @param block non-null; block to process
-     * @param frame non-null; start frame for the block
-     * @param workSet non-null; bits representing work to do, which this
+     * @param block {@code non-null;} block to process
+     * @param frame {@code non-null;} start frame for the block
+     * @param workSet {@code non-null;} bits representing work to do, which this
      * method may add to
      */
     private void processBlock(ByteBlock block, Frame frame, int[] workSet) {
@@ -950,14 +950,14 @@ public final class Ropper {
      * Helper for {@link #processBlock}, which merges frames and
      * adds to the work set, as necessary.
      * 
-     * @param label &gt;= 0; label to work on
-     * @param pred  predecessor label. Must be &gt;= 0 when
-     * <code>label</code> is a subroutine start block and calledSubroutine
+     * @param label {@code >= 0;} label to work on
+     * @param pred  predecessor label; must be {@code >= 0} when
+     * {@code label} is a subroutine start block and calledSubroutine
      * is non-null. Otherwise, may be -1.
-     * @param calledSubroutine null-ok; a Subroutine instance if
-     * <code>label</code> is the first block in a subroutine.
-     * @param frame non-null; new frame for the labelled block
-     * @param workSet non-null; bits representing work to do, which this
+     * @param calledSubroutine {@code null-ok;} a Subroutine instance if
+     * {@code label} is the first block in a subroutine.
+     * @param frame {@code non-null;} new frame for the labelled block
+     * @param workSet {@code non-null;} bits representing work to do, which this
      * method may add to
      */
     private void mergeAndWorkAsNecessary(int label, int pred,
@@ -1078,7 +1078,7 @@ public final class Ropper {
 
     /**
      * Constructs and adds the return block, if necessary. The return
-     * block merely contains an appropriate <code>return</code>
+     * block merely contains an appropriate {@code return}
      * instruction.
      */
     private void addReturnBlock() {
@@ -1217,7 +1217,7 @@ public final class Ropper {
     /**
      * Checks to see if the basic block is a subroutine caller block.
      *
-     * @param bb non-null; the basic block in question
+     * @param bb {@code non-null;} the basic block in question
      * @return true if this block calls a subroutine
      */
     private boolean isSubroutineCaller(BasicBlock bb) {
@@ -1340,7 +1340,7 @@ public final class Ropper {
 
     /**
      * Inlines a subroutine. Start by calling
-     * <code>inlineSubroutineCalledFrom</code>.
+     * {@code inlineSubroutineCalledFrom}.
      */
     private class SubroutineInliner {
         /**
@@ -1502,8 +1502,8 @@ public final class Ropper {
          * Checks to see if a specified label is involved in a specified
          * subroutine.
          *
-         * @param label &gt;=0 a basic block label
-         * @param subroutineStart &gt;=0 a subroutine as identified by the
+         * @param label {@code >= 0;} a basic block label
+         * @param subroutineStart {@code >= 0;} a subroutine as identified by the
          * label of its start block.
          * @return true if the block is dominated by the subroutine call.
          */
@@ -1554,10 +1554,10 @@ public final class Ropper {
     }
 
     /**
-     * Finds a <code>Subroutine<code> that is returned from by a ret in
+     * Finds a {@code Subroutine} that is returned from by a ret in
      * a given block.
      * @param label A block that originally contained a ret instruction
-     * @return null-ok; Subroutine or null if none was found.
+     * @return {@code null-ok;} Subroutine or null if none was found.
      */
     private Subroutine subroutineFromRetBlock(int label) {
         for (int i = subroutines.length - 1 ; i >= 0 ; i--) {
index 6d05b38..887cec9 100644 (file)
@@ -47,13 +47,13 @@ import java.util.ArrayList;
  * Machine implementation for use by {@link Ropper}.
  */
 /*package*/ final class RopperMachine extends ValueAwareMachine {
-    /** non-null; array reflection class */
+    /** {@code non-null;} array reflection class */
     private static final CstType ARRAY_REFLECT_TYPE =
         new CstType(Type.internClassName("java/lang/reflect/Array"));
 
     /**
-     * non-null; method constant for use in converting
-     * <code>multianewarray</code> instructions 
+     * {@code non-null;} method constant for use in converting
+     * {@code multianewarray} instructions 
      */
     private static final CstMethodRef MULTIANEWARRAY_METHOD =
         new CstMethodRef(ARRAY_REFLECT_TYPE,
@@ -61,34 +61,34 @@ import java.util.ArrayList;
                                     new CstUtf8("(Ljava/lang/Class;[I)" +
                                                 "Ljava/lang/Object;")));
 
-    /** non-null; {@link Ropper} controlling this instance */
+    /** {@code non-null;} {@link Ropper} controlling this instance */
     private final Ropper ropper;
 
-    /** non-null; method being converted */
+    /** {@code non-null;} method being converted */
     private final ConcreteMethod method;
 
-    /** non-null; translation advice */
+    /** {@code non-null;} translation advice */
     private final TranslationAdvice advice;
 
     /** max locals of the method */
     private final int maxLocals;
 
-    /** non-null; instructions for the rop basic block in-progress */
+    /** {@code non-null;} instructions for the rop basic block in-progress */
     private final ArrayList<Insn> insns;
 
-    /** non-null; catches for the block currently being processed */
+    /** {@code non-null;} catches for the block currently being processed */
     private TypeList catches;
 
     /** whether the catches have been used in an instruction */
     private boolean catchesUsed;
 
-    /** whether the block contains a <code>return</code> */
+    /** whether the block contains a {@code return} */
     private boolean returns;
 
     /** primary successor index */
     private int primarySuccessorIndex;
 
-    /** &gt;= 0; number of extra basic blocks required */
+    /** {@code >= 0;} number of extra basic blocks required */
     private int extraBlockCount;
 
     /** true if last processed block ends with a jsr or jsr_W*/
@@ -105,13 +105,13 @@ import java.util.ArrayList;
     private ReturnAddress returnAddress;
 
     /**
-     * null-ok; the appropriate <code>return</code> op or <code>null</code>
+     * {@code null-ok;} the appropriate {@code return} op or {@code null}
      * if it is not yet known 
      */
     private Rop returnOp;
 
     /**
-     * null-ok; the source position for the return block or <code>null</code>
+     * {@code null-ok;} the source position for the return block or {@code null}
      * if it is not yet known 
      */
     private SourcePosition returnPosition;
@@ -119,9 +119,9 @@ import java.util.ArrayList;
     /**
      * Constructs an instance.
      * 
-     * @param ropper non-null; ropper controlling this instance
-     * @param method non-null; method being converted
-     * @param advice non-null; translation advice to use
+     * @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
      */
     public RopperMachine(Ropper ropper, ConcreteMethod method,
             TranslationAdvice advice) {
@@ -154,7 +154,7 @@ import java.util.ArrayList;
      * Gets the instructions array. It is shared and gets modified by
      * subsequent calls to this instance.
      * 
-     * @return non-null; the instructions array
+     * @return {@code non-null;} the instructions array
      */
     public ArrayList<Insn> getInsns() {
         return insns;
@@ -163,7 +163,7 @@ import java.util.ArrayList;
     /**
      * Gets the return opcode encountered, if any.
      * 
-     * @return null-ok; the return opcode
+     * @return {@code null-ok;} the return opcode
      */
     public Rop getReturnOp() {
         return returnOp;
@@ -172,7 +172,7 @@ import java.util.ArrayList;
     /**
      * Gets the return position, if known.
      * 
-     * @return null-ok; the return position
+     * @return {@code null-ok;} the return position
      */
     public SourcePosition getReturnPosition() {
         return returnPosition;
@@ -182,7 +182,7 @@ import java.util.ArrayList;
      * Gets ready to start working on a new block. This will clear the
      * {@link #insns} list, set {@link #catches}, reset whether it has
      * been used, reset whether the block contains a
-     * <code>return</code>, and reset {@link #primarySuccessorIndex}.
+     * {@code return}, and reset {@link #primarySuccessorIndex}.
      */
     public void startBlock(TypeList catches) {
         this.catches = catches;
@@ -201,7 +201,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</code> has been used
+     * @return whether {@code catches} has been used
      */
     public boolean wereCatchesUsed() {
         return catchesUsed;
@@ -209,7 +209,7 @@ import java.util.ArrayList;
 
     /**
      * Gets whether the block just processed ended with a
-     * <code>return</code>.
+     * {@code return}.
      * 
      * @return whether the block returns
      */
@@ -220,12 +220,12 @@ import java.util.ArrayList;
     /**
      * Gets the primary successor index. This is the index into the
      * successors list where the primary may be found or
-     * <code>-1</code> if there are successors but no primary
+     * {@code -1} if there are successors but no primary
      * successor. This may return something other than
-     * <code>-1</code> in the case of an instruction with no
+     * {@code -1} in the case of an instruction with no
      * successors at all (primary or otherwise).
      * 
-     * @return &gt;= -1; the primary successor index
+     * @return {@code >= -1;} the primary successor index
      */
     public int getPrimarySuccessorIndex() {
         return primarySuccessorIndex;
@@ -236,7 +236,7 @@ import java.util.ArrayList;
      * block currently being translated. Each extra block should consist
      * of one instruction from the end of the original block.
      * 
-     * @return &gt;= 0; the number of extra blocks needed
+     * @return {@code >= 0;} the number of extra blocks needed
      */
     public int getExtraBlockCount() {
         return extraBlockCount;
@@ -267,7 +267,7 @@ import java.util.ArrayList;
     }
 
     /**
-     * @return null-ok; return address of a ret instruction if encountered
+     * @return {@code null-ok;} return address of a ret instruction if encountered
      * since last call to startBlock(). null if no ret instruction encountered.
      */
     public ReturnAddress getReturnAddress() {
@@ -619,9 +619,9 @@ import java.util.ArrayList;
      * instruction.
      * 
      * @param opcode the opcode being translated
-     * @param stackPointer &gt;= 0; the stack pointer after the instruction's
+     * @param stackPointer {@code >= 0;} the stack pointer after the instruction's
      * arguments have been popped
-     * @return non-null; the sources
+     * @return {@code non-null;} the sources
      */
     private RegisterSpecList getSources(int opcode, int stackPointer) {
         int count = argCount();
@@ -692,8 +692,8 @@ import java.util.ArrayList;
     /**
      * Sets or updates the information about the return block.
      * 
-     * @param op non-null; the opcode to use
-     * @param pos non-null; the position to use
+     * @param op {@code non-null;} the opcode to use
+     * @param pos {@code non-null;} the position to use
      */
     private void updateReturnOp(Rop op, SourcePosition pos) {
         if (op == null) {
@@ -723,9 +723,9 @@ import java.util.ArrayList;
     /**
      * Gets the register opcode for the given Java opcode.
      * 
-     * @param jop &gt;= 0; the Java opcode
-     * @param cst null-ok; the constant argument, if any
-     * @return &gt;= 0; the corresponding register 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
      */
     private int jopToRopOpcode(int jop, Constant cst) {
         switch (jop) {
index 3c90ee5..344759c 100644 (file)
@@ -41,28 +41,28 @@ import java.util.ArrayList;
  * between themselves.</p>
  */
 public class Simulator {
-    /** non-null; canned error message for local variable table mismatches */
+    /** {@code non-null;} canned error message for local variable table mismatches */
     private static final String LOCAL_MISMATCH_ERROR = 
         "This is symptomatic of .class transformation tools that ignore " +
         "local variable information.";
     
-    /** non-null; machine to use when simulating */
+    /** {@code non-null;} machine to use when simulating */
     private final Machine machine;
 
-    /** non-null; array of bytecode */
+    /** {@code non-null;} array of bytecode */
     private final BytecodeArray code;
 
-    /** non-null; local variable information */
+    /** {@code non-null;} local variable information */
     private final LocalVariableList localVariables;
 
-    /** non-null; visitor instance to use */
+    /** {@code non-null;} visitor instance to use */
     private final SimVisitor visitor;
 
     /**
      * Constructs an instance.
      * 
-     * @param machine non-null; machine to use when simulating
-     * @param method non-null; method data to use
+     * @param machine {@code non-null;} machine to use when simulating
+     * @param method {@code non-null;} method data to use
      */
     public Simulator(Machine machine, ConcreteMethod method) {
         if (machine == null) {
@@ -83,8 +83,8 @@ 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 non-null; the basic block
-     * @param frame non-null; frame to operate on
+     * @param bb {@code non-null;} the basic block
+     * @param frame {@code non-null;} frame to operate on
      */
     public void simulate(ByteBlock bb, Frame frame) {
         int end = bb.getEnd();
@@ -107,8 +107,8 @@ public class Simulator {
      * Simulates the effect of the instruction at the given offset, by
      * making appropriate calls on the given frame.
      * 
-     * @param offset &gt;= 0; offset of the instruction to simulate
-     * @param frame non-null; frame to operate on
+     * @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
      */
     public int simulate(int offset, Frame frame) {
@@ -130,13 +130,13 @@ public class Simulator {
      */
     private class SimVisitor implements BytecodeArray.Visitor {
         /**
-         * non-null; machine instance to use (just to avoid excessive
+         * {@code non-null;} machine instance to use (just to avoid excessive
          * cross-object field access) 
          */
         private final Machine machine;
 
         /**
-         * 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;
@@ -155,7 +155,7 @@ public class Simulator {
         /**
          * Sets the frame to act on.
          * 
-         * @param frame non-null; the frame
+         * @param frame {@code non-null;} the frame
          */
         public void setFrame(Frame frame) {
             if (frame == null) {
@@ -456,7 +456,7 @@ public class Simulator {
          * Checks whether the prototype is compatible with returning the
          * given type, and throws if not.
          * 
-         * @param encountered non-null; the encountered return type
+         * @param encountered {@code non-null;} the encountered return type
          */
         private void checkReturnType(Type encountered) {
             Type returnType = machine.getPrototype().getReturnType();
index dc04137..fdd1596 100644 (file)
@@ -21,15 +21,15 @@ import com.android.dx.util.MutabilityControl;
 
 /**
  * List of (value, target) mappings representing the choices of a
- * <code>tableswitch</code> or <code>lookupswitch</code> instruction. It
+ * {@code tableswitch} or {@code lookupswitch} instruction. It
  * also holds the default target for the switch.
  */
 public final class SwitchList extends MutabilityControl {
-    /** non-null; list of test values */
+    /** {@code non-null;} list of test values */
     private final IntList values;
 
     /**
-     * non-null; list of targets corresponding to the test values; there
+     * {@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 
      */
@@ -41,7 +41,7 @@ public final class SwitchList extends MutabilityControl {
     /**
      * Constructs an instance.
      * 
-     * @param size &gt;= 0; the number of elements to be in the table
+     * @param size {@code >= 0;} the number of elements to be in the table
      */
     public SwitchList(int size) {
         super(true);
@@ -61,7 +61,7 @@ public final class SwitchList extends MutabilityControl {
     /**
      * Gets the size of the list.
      * 
-     * @return &gt;= 0; the list size
+     * @return {@code >= 0;} the list size
      */
     public int size() {
         return size;
@@ -70,7 +70,7 @@ public final class SwitchList extends MutabilityControl {
     /**
      * Gets the indicated test value.
      * 
-     * @param n &gt;= 0;, &lt; size(); which index
+     * @param n {@code >= 0;}, &lt; size(); which index
      * @return the test value 
      */
     public int getValue(int n) {
@@ -78,11 +78,11 @@ public final class SwitchList extends MutabilityControl {
     }
 
     /**
-     * Gets the indicated target. Asking for the target at <code>size()</code>
+     * Gets the indicated target. Asking for the target at {@code size()}
      * returns the default target.
      * 
-     * @param n &gt;= 0, &lt;= size(); which index
-     * @return &gt;= 0; the target
+     * @param n {@code >= 0, <= size();} which index
+     * @return {@code >= 0;} the target
      */
     public int getTarget(int n) {
         return targets.get(n);
@@ -90,9 +90,9 @@ public final class SwitchList extends MutabilityControl {
 
     /**
      * Gets the default target. This is just a shorthand for
-     * <code>getTarget(size())</code>.
+     * {@code getTarget(size())}.
      * 
-     * @return &gt;= 0; the default target
+     * @return {@code >= 0;} the default target
      */
     public int getDefaultTarget() {
         return targets.get(size);
@@ -102,7 +102,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 non-null; the target list
+     * @return {@code non-null;} the target list
      */
     public IntList getTargets() {
         return targets;
@@ -111,7 +111,7 @@ public final class SwitchList extends MutabilityControl {
     /**
      * Gets the list of all case values.
      * 
-     * @return non-null; the case value list
+     * @return {@code non-null;} the case value list
      */
     public IntList getValues() {
         return values;
@@ -121,7 +121,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 &gt;= 0; the absolute (not relative) default target
+     * @param target {@code >= 0;} the absolute (not relative) default target
      * address
      */
     public void setDefaultTarget(int target) {
@@ -142,7 +142,7 @@ public final class SwitchList extends MutabilityControl {
      * Adds the given item.
      * 
      * @param value the test value
-     * @param target &gt;= 0; the absolute (not relative) target address
+     * @param target {@code >= 0;} the absolute (not relative) target address
      */
     public void add(int value, int target) {
         throwIfImmutable();
index 4062c3b..b0f993d 100644 (file)
@@ -30,7 +30,7 @@ public class ValueAwareMachine extends BaseMachine {
     /**
      * Constructs an instance.
      * 
-     * @param prototype non-null; the prototype for the associated method
+     * @param prototype {@code non-null;} the prototype for the associated method
      */
     public ValueAwareMachine(Prototype prototype) {
         super(prototype);
index 953981c..7cd9c9b 100644 (file)
@@ -41,29 +41,29 @@ import static com.android.dx.cf.cst.ConstantTags.*;
  * Parser for a constant pool embedded in a class file.
  */
 public final class ConstantPoolParser {
-    /** non-null; the bytes of the constant pool */
+    /** {@code non-null;} the bytes of the constant pool */
     private final ByteArray bytes;
 
-    /** non-null; actual parsed constant pool contents */
+    /** {@code non-null;} actual parsed constant pool contents */
     private final StdConstantPool pool;
 
-    /** non-null; byte offsets to each cst */
+    /** {@code non-null;} byte offsets to each cst */
     private final int[] offsets;
 
     /**
      * -1 || &gt;= 10; the end offset of this constant pool in the
-     * <code>byte[]</code> which it came from or <code>-1</code> if not
+     * {@code byte[]} which it came from or {@code -1} if not
      * yet parsed 
      */
     private int endOffset;
 
-    /** null-ok; parse observer, if any */
+    /** {@code null-ok;} parse observer, if any */
     private ParseObserver observer;
 
     /**
      * Constructs an instance.
      * 
-     * @param bytes non-null; the bytes of the file
+     * @param bytes {@code non-null;} the bytes of the file
      */
     public ConstantPoolParser(ByteArray bytes) {
         int size = bytes.getUnsignedShort(8); // constant_pool_count
@@ -77,17 +77,17 @@ public final class ConstantPoolParser {
     /**
      * Sets the parse observer for this instance.
      * 
-     * @param observer null-ok; the observer
+     * @param observer {@code null-ok;} the observer
      */
     public void setObserver(ParseObserver observer) {
         this.observer = observer;
     }
 
     /**
-     * Gets the end offset of this constant pool in the <code>byte[]</code>
+     * Gets the end offset of this constant pool in the {@code byte[]}
      * which it came from.
      * 
-     * @return &gt;= 10; the end offset
+     * @return {@code >= 10;} the end offset
      */
     public int getEndOffset() {
         parseIfNecessary();
@@ -97,7 +97,7 @@ public final class ConstantPoolParser {
     /**
      * Gets the actual constant pool.
      * 
-     * @return non-null; the constant pool
+     * @return {@code non-null;} the constant pool
      */
     public StdConstantPool getPool() {
         parseIfNecessary();
@@ -215,7 +215,7 @@ public final class ConstantPoolParser {
      * depends on.
      * 
      * @param idx which constant
-     * @return non-null; the parsed constant
+     * @return {@code non-null;} the parsed constant
      */
     private Constant parse0(int idx) {
         Constant cst = pool.getOrNull(idx);
@@ -316,7 +316,7 @@ public final class ConstantPoolParser {
      * Parses a utf8 constant.
      * 
      * @param at offset to the start of the constant (where the tag byte is)
-     * @return non-null; the parsed value
+     * @return {@code non-null;} the parsed value
      */
     private CstUtf8 parseUtf8(int at) {
         int length = bytes.getUnsignedShort(at + 1);
index 64bc8d8..9febbdf 100644 (file)
@@ -20,36 +20,36 @@ package com.android.dx.cf.cst;
  * Tags for constant pool constants.
  */
 public interface ConstantTags {
-    /** tag for a <code>CONSTANT_Utf8_info</code> */
+    /** tag for a {@code CONSTANT_Utf8_info} */
     int CONSTANT_Utf8 = 1;
 
-    /** tag for a <code>CONSTANT_Integer_info</code> */
+    /** tag for a {@code CONSTANT_Integer_info} */
     int CONSTANT_Integer = 3;
 
-    /** tag for a <code>CONSTANT_Float_info</code> */
+    /** tag for a {@code CONSTANT_Float_info} */
     int CONSTANT_Float = 4;
 
-    /** tag for a <code>CONSTANT_Long_info</code> */
+    /** tag for a {@code CONSTANT_Long_info} */
     int CONSTANT_Long = 5;
 
-    /** tag for a <code>CONSTANT_Double_info</code> */
+    /** tag for a {@code CONSTANT_Double_info} */
     int CONSTANT_Double = 6;
 
-    /** tag for a <code>CONSTANT_Class_info</code> */
+    /** tag for a {@code CONSTANT_Class_info} */
     int CONSTANT_Class = 7;
 
-    /** tag for a <code>CONSTANT_String_info</code> */
+    /** tag for a {@code CONSTANT_String_info} */
     int CONSTANT_String = 8;
 
-    /** tag for a <code>CONSTANT_Fieldref_info</code> */
+    /** tag for a {@code CONSTANT_Fieldref_info} */
     int CONSTANT_Fieldref = 9;
 
-    /** tag for a <code>CONSTANT_Methodref_info</code> */
+    /** tag for a {@code CONSTANT_Methodref_info} */
     int CONSTANT_Methodref = 10;
 
-    /** tag for a <code>CONSTANT_InterfaceMethodref_info</code> */
+    /** tag for a {@code CONSTANT_InterfaceMethodref_info} */
     int CONSTANT_InterfaceMethodref = 11;
 
-    /** tag for a <code>CONSTANT_NameAndType_info</code> */
+    /** tag for a {@code CONSTANT_NameAndType_info} */
     int CONSTANT_NameAndType = 12;
 }
index 5d80086..88e4cd2 100644 (file)
@@ -51,23 +51,23 @@ import java.io.IOException;
  * Parser for annotations.
  */
 public final class AnnotationParser {
-    /** non-null; class file being parsed */
+    /** {@code non-null;} class file being parsed */
     private final DirectClassFile cf;
 
-    /** non-null; constant pool to use */
+    /** {@code non-null;} constant pool to use */
     private final ConstantPool pool;
 
-    /** non-null; bytes of the attribute data */
+    /** {@code non-null;} bytes of the attribute data */
     private final ByteArray bytes;
 
-    /** null-ok; parse observer, if any */
+    /** {@code null-ok;} parse observer, if any */
     private final ParseObserver observer;
 
-    /** non-null; input stream to parse from */
+    /** {@code non-null;} input stream to parse from */
     private final ByteArray.MyDataInputStream input;
 
     /**
-     * non-null; cursor for use when informing the observer of what
+     * {@code non-null;} cursor for use when informing the observer of what
      * was parsed
      */
     private int parseCursor;
@@ -75,10 +75,10 @@ public final class AnnotationParser {
     /**
      * Constructs an instance.
      * 
-     * @param cf non-null; class file to parse from
-     * @param offset &gt;= 0; offset into the class file data to parse at
-     * @param length &gt;= 0; number of bytes left in the attribute data
-     * @param observer null-ok; parse observer to notify, if any
+     * @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
+     * @param observer {@code null-ok;} parse observer to notify, if any
      */
     public AnnotationParser(DirectClassFile cf, int offset, int length,
             ParseObserver observer) {
@@ -95,9 +95,9 @@ public final class AnnotationParser {
     }
     
     /**
-     * Parses an annotation value (<code>element_value</code>) attribute.
+     * Parses an annotation value ({@code element_value}) attribute.
      * 
-     * @return non-null; the parsed constant value
+     * @return {@code non-null;} the parsed constant value
      */
     public Constant parseValueAttribute() {
         Constant result;
@@ -119,8 +119,8 @@ public final class AnnotationParser {
     /**
      * Parses a parameter annotation attribute.
      * 
-     * @param visibility non-null; visibility of the parsed annotations
-     * @return non-null; the parsed list of lists of annotations
+     * @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) {
@@ -143,8 +143,8 @@ public final class AnnotationParser {
     /**
      * Parses an annotation attribute, per se.
      * 
-     * @param visibility non-null; visibility of the parsed annotations
-     * @return non-null; the list of annotations read from the attribute
+     * @param visibility {@code non-null;} visibility of the parsed annotations
+     * @return {@code non-null;} the list of annotations read from the attribute
      * data
      */
     public Annotations parseAnnotationAttribute(
@@ -168,8 +168,8 @@ public final class AnnotationParser {
     /**
      * Parses a list of annotation lists.
      * 
-     * @param visibility non-null; visibility of the parsed annotations
-     * @return non-null; the list of annotation lists read from the attribute
+     * @param visibility {@code non-null;} visibility of the parsed annotations
+     * @return {@code non-null;} the list of annotation lists read from the attribute
      * data
      */
     private AnnotationsList parseAnnotationsList(
@@ -203,8 +203,8 @@ public final class AnnotationParser {
     /**
      * Parses an annotation list.
      * 
-     * @param visibility non-null; visibility of the parsed annotations
-     * @return non-null; the list of annotations read from the attribute
+     * @param visibility {@code non-null;} visibility of the parsed annotations
+     * @return {@code non-null;} the list of annotations read from the attribute
      * data
      */
     private Annotations parseAnnotations(AnnotationVisibility visibility)
@@ -238,8 +238,8 @@ public final class AnnotationParser {
     /**
      * Parses a single annotation.
      * 
-     * @param visibility non-null; visibility of the parsed annotation
-     * @return non-null; the parsed annotation
+     * @param visibility {@code non-null;} visibility of the parsed annotation
+     * @return {@code non-null;} the parsed annotation
      */
     private Annotation parseAnnotation(AnnotationVisibility visibility)
             throws IOException {
@@ -278,7 +278,7 @@ public final class AnnotationParser {
     /**
      * Parses a {@link NameValuePair}.
      * 
-     * @return non-null; the parsed element
+     * @return {@code non-null;} the parsed element
      */
     private NameValuePair parseElement() throws IOException {
         requireLength(5);
@@ -304,7 +304,7 @@ public final class AnnotationParser {
     /**
      * Parses an annotation value.
      * 
-     * @return non-null; the parsed value
+     * @return {@code non-null;} the parsed value
      */
     private Constant parseValue() throws IOException {
         int tag = input.readUnsignedByte();
@@ -421,7 +421,7 @@ public final class AnnotationParser {
      * Helper for {@link #parseValue}, which parses a constant reference
      * and returns the referred-to constant value.
      * 
-     * @return non-null; the parsed value
+     * @return {@code non-null;} the parsed value
      */
     private Constant parseConstant() throws IOException {
         int constValueIndex = input.readUnsignedShort();
@@ -454,8 +454,8 @@ public final class AnnotationParser {
      * only be used (for efficiency sake) if the parse is known to be
      * observed.
      * 
-     * @param length &gt;= 0; number of bytes parsed
-     * @param message non-null; associated message
+     * @param length {@code >= 0;} number of bytes parsed
+     * @param message {@code non-null;} associated message
      */
     private void parsed(int length, String message) {
         observer.parsed(bytes, parseCursor, length, message);
@@ -464,7 +464,7 @@ public final class AnnotationParser {
 
     /**
      * Convenience wrapper that simply calls through to
-     * <code>observer.changeIndent()</code>.
+     * {@code observer.changeIndent()}.
      * 
      * @param indent the amount to change the indent by
      */
index 420d741..d00a859 100644 (file)
@@ -58,13 +58,13 @@ public class AttributeFactory {
      * the name, and then does all the setup to call on to {@link #parse0},
      * which does the actual construction.
      * 
-     * @param cf non-null; class file to parse from
-     * @param context context to parse in; one of the <code>CTX_*</code>
+     * @param cf {@code non-null;} class file to parse from
+     * @param context context to parse in; one of the {@code CTX_*}
      * constants
-     * @param offset offset into <code>dcf</code>'s <code>bytes</code>
+     * @param offset offset into {@code dcf}'s {@code bytes}
      * to start parsing at
-     * @param observer null-ok; parse observer to report to, if any
-     * @return non-null; an appropriately-constructed {@link Attribute}
+     * @param observer {@code null-ok;} parse observer to report to, if any
+     * @return {@code non-null;} an appropriately-constructed {@link Attribute}
      */
     public final Attribute parse(DirectClassFile cf, int context, int offset,
                                  ParseObserver observer) {
@@ -108,15 +108,15 @@ public class AttributeFactory {
      * an instance of {@link RawAttribute}. Subclasses are expected to
      * override this to do something better in most cases.
      * 
-     * @param cf non-null; class file to parse from
-     * @param context context to parse in; one of the <code>CTX_*</code>
+     * @param cf {@code non-null;} class file to parse from
+     * @param context context to parse in; one of the {@code CTX_*}
      * constants
-     * @param name non-null; the attribute name
-     * @param offset offset into <code>bytes</code> to start parsing at; this
+     * @param name {@code non-null;} the attribute name
+     * @param offset offset into {@code bytes} to start parsing at; this
      * is the offset to the start of attribute data, not to the header
      * @param length the length of the attribute data
-     * @param observer null-ok; parse observer to report to, if any
-     * @return non-null; an appropriately-constructed {@link Attribute}
+     * @param observer {@code null-ok;} parse observer to report to, if any
+     * @return {@code non-null;} an appropriately-constructed {@link Attribute}
      */
     protected Attribute parse0(DirectClassFile cf, int context, String name,
                                int offset, int length,
index 7652265..2715e6a 100644 (file)
@@ -27,7 +27,7 @@ import com.android.dx.util.Hex;
  * Parser for lists of attributes.
  */
 final /*package*/ class AttributeListParser {
-    /** non-null; the class file to parse from */
+    /** {@code non-null;} the class file to parse from */
     private final DirectClassFile cf;
 
     /** attribute parsing context */
@@ -36,26 +36,26 @@ final /*package*/ class AttributeListParser {
     /** offset in the byte array of the classfile to the start of the list */
     private final int offset;
 
-    /** non-null; attribute factory to use */
+    /** {@code non-null;} attribute factory to use */
     private final AttributeFactory attributeFactory;
 
-    /** non-null; list of parsed attributes */
+    /** {@code non-null;} list of parsed attributes */
     private final StdAttributeList list;
 
-    /** &gt;= -1; the end offset of this list in the byte array of the
-     * classfile, or <code>-1</code> if not yet parsed */
+    /** {@code >= -1;} the end offset of this list in the byte array of the
+     * classfile, or {@code -1} if not yet parsed */
     private int endOffset;
 
-    /** null-ok; parse observer, if any */
+    /** {@code null-ok;} parse observer, if any */
     private ParseObserver observer;
 
     /**
      * Constructs an instance.
      *
-     * @param cf non-null; class file to parse from
+     * @param cf {@code non-null;} class file to parse from
      * @param context attribute parsing context (see {@link AttributeFactory})
-     * @param offset offset in <code>bytes</code> to the start of the list
-     * @param attributeFactory non-null; attribute factory to use
+     * @param offset offset in {@code bytes} to the start of the list
+     * @param attributeFactory {@code non-null;} attribute factory to use
      */
     public AttributeListParser(DirectClassFile cf, int context, int offset,
                                AttributeFactory attributeFactory) {
@@ -80,17 +80,17 @@ final /*package*/ class AttributeListParser {
     /**
      * Sets the parse observer for this instance.
      *
-     * @param observer null-ok; the observer
+     * @param observer {@code null-ok;} the observer
      */
     public void setObserver(ParseObserver observer) {
         this.observer = observer;
     }
 
     /**
-     * Gets the end offset of this constant pool in the <code>byte[]</code>
+     * Gets the end offset of this constant pool in the {@code byte[]}
      * which it came from.
      *
-     * @return &gt;= 0; the end offset
+     * @return {@code >= 0;} the end offset
      */
     public int getEndOffset() {
         parseIfNecessary();
@@ -100,7 +100,7 @@ final /*package*/ class AttributeListParser {
     /**
      * Gets the parsed list.
      *
-     * @return non-null; the list
+     * @return {@code non-null;} the list
      */
     public StdAttributeList getList() {
         parseIfNecessary();
index d302349..fd5546f 100644 (file)
@@ -36,9 +36,9 @@ import java.util.Collections;
  */
 public class ClassPathOpener {
 
-    /** non-null; pathname to start with */
+    /** {@code non-null;} pathname to start with */
     private final String pathname;
-    /** non-null; callback interface */
+    /** {@code non-null;} callback interface */
     private final Consumer consumer;
     /**
      * If true, sort such that classes appear before their inner
@@ -48,20 +48,20 @@ public class ClassPathOpener {
     private final boolean sort;
 
     /**
-     * Callback interface for <code>ClassOpener</code>.
+     * Callback interface for {@code ClassOpener}.
      */
     public interface Consumer {
 
         /**
          * Provides the file name and byte array for a class path element.
          *
-         * @param name non-null; filename of element. May not be a valid
+         * @param name {@code non-null;} filename of element. May not be a valid
          * filesystem path.
          *
-         * @param bytes non-null; file data
+         * @param bytes {@code non-null;} file data
          * @return true on success. Result is or'd with all other results
-         * from <code>processFileBytes</code> and returned to the caller
-         * of <code>process()</code>.
+         * from {@code processFileBytes} and returned to the caller
+         * of {@code process()}.
          */
         boolean processFileBytes(String name, byte[] bytes);
 
@@ -69,14 +69,14 @@ public class ClassPathOpener {
          * Informs consumer that an exception occurred while processing
          * this path element. Processing will continue if possible.
          *
-         * @param ex non-null; exception
+         * @param ex {@code non-null;} exception
          */
         void onException(Exception ex);
 
         /**
          * Informs consumer that processing of an archive file has begun.
          *
-         * @param file non-null; archive file being processed
+         * @param file {@code non-null;} archive file being processed
          */
         void onProcessArchiveStart(File file);
     }
@@ -84,11 +84,11 @@ public class ClassPathOpener {
     /**
      * Constructs an instance.
      *
-     * @param pathname non-null; path element to process
+     * @param pathname {@code non-null;} path element to process
      * @param sort if true, sort such that classes appear before their inner
      * classes and "package-info" occurs before all other classes in that
      * package.
-     * @param consumer non-null; callback interface
+     * @param consumer {@code non-null;} callback interface
      */
     public ClassPathOpener(String pathname, boolean sort, Consumer consumer) {
         this.pathname = pathname;
@@ -100,7 +100,7 @@ public class ClassPathOpener {
      * Processes a path element.
      *
      * @return the OR of all return values
-     * from <code>Consumer.processFileBytes()</code>.
+     * from {@code Consumer.processFileBytes()}.
      */
     public boolean process() {
         File file = new File(pathname);
@@ -111,7 +111,7 @@ public class ClassPathOpener {
     /**
      * Processes one file.
      *
-     * @param file non-null; the file to process
+     * @param file {@code non-null;} the file to process
      * @param topLevel whether this is a top-level file (that is,
      * specified directly on the commandline)
      * @return whether any processing actually happened
@@ -142,9 +142,9 @@ public class ClassPathOpener {
      * Sorts java class names such that outer classes preceed their inner
      * classes and "package-info" preceeds all other classes in its package.
      *
-     * @param a non-null; first class name
-     * @param b non-null; second class name
-     * @return <code>compareTo()</code>-style result
+     * @param a {@code non-null;} first class name
+     * @param b {@code non-null;} second class name
+     * @return {@code compareTo()}-style result
      */
     private static int compareClassNames(String a, String b) {
         // Ensure inner classes sort second
@@ -164,7 +164,7 @@ public class ClassPathOpener {
     /**
      * Processes a directory recursively.
      *
-     * @param dir non-null; file representing the directory
+     * @param dir {@code non-null;} file representing the directory
      * @param topLevel whether this is a top-level directory (that is,
      * specified directly on the commandline)
      * @return whether any processing actually happened
@@ -194,10 +194,10 @@ public class ClassPathOpener {
     }
 
     /**
-     * Processes the contents of an archive (<code>.zip</code>,
-     * <code>.jar</code>, or <code>.apk</code>).
+     * Processes the contents of an archive ({@code .zip},
+     * {@code .jar}, or {@code .apk}).
      *
-     * @param file non-null; archive file to process
+     * @param file {@code non-null;} archive file to process
      * @return whether any processing actually happened
      * @throws IOException on i/o problem
      */
index 950147f..952f1bc 100644 (file)
@@ -39,17 +39,17 @@ import java.util.ArrayList;
  * Bytecode visitor to use when "observing" bytecode getting parsed.
  */
 public class CodeObserver implements BytecodeArray.Visitor {
-    /** non-null; actual array of bytecode */
+    /** {@code non-null;} actual array of bytecode */
     private final ByteArray bytes;
 
-    /** non-null; observer to inform of parsing */
+    /** {@code non-null;} observer to inform of parsing */
     private final ParseObserver observer;
 
     /**
      * Constructs an instance.
      * 
-     * @param bytes non-null; actual array of bytecode
-     * @param observer non-null; observer to inform of parsing
+     * @param bytes {@code non-null;} actual array of bytecode
+     * @param observer {@code non-null;} observer to inform of parsing
      */
     public CodeObserver(ByteArray bytes, ParseObserver observer) {
         if (bytes == null) {
@@ -218,8 +218,8 @@ public class CodeObserver implements BytecodeArray.Visitor {
     }
 
     /**
-     * Helper for {code #visitConstant} where the constant is an
-     * <code>int</code>.
+     * Helper for {@link #visitConstant} where the constant is an
+     * {@code int}.
      * 
      * @param opcode the opcode
      * @param offset offset to the instruction
@@ -245,8 +245,8 @@ public class CodeObserver implements BytecodeArray.Visitor {
     }
 
     /**
-     * Helper for {code #visitConstant} where the constant is a
-     * <code>long</code>.
+     * Helper for {@link #visitConstant} where the constant is a
+     * {@code long}.
      * 
      * @param opcode the opcode
      * @param offset offset to the instruction
@@ -269,8 +269,8 @@ public class CodeObserver implements BytecodeArray.Visitor {
     }
 
     /**
-     * Helper for {code #visitConstant} where the constant is a
-     * <code>float</code>.
+     * Helper for {@link #visitConstant} where the constant is a
+     * {@code float}.
      * 
      * @param opcode the opcode
      * @param offset offset to the instruction
@@ -287,8 +287,8 @@ public class CodeObserver implements BytecodeArray.Visitor {
     }
 
     /**
-     * Helper for {code #visitConstant} where the constant is a
-     * <code>double</code>.
+     * Helper for {@link #visitConstant} where the constant is a
+     * {@code double}.
      * 
      * @param opcode the opcode
      * @param offset offset to the instruction
index e4751a4..ac227fa 100644 (file)
@@ -38,14 +38,14 @@ import com.android.dx.util.ByteArray;
 import com.android.dx.util.Hex;
 
 /**
- * Class file with info taken from a <code>byte[]</code> or slice thereof.
+ * Class file with info taken from a {@code byte[]} or slice thereof.
  */
 public class DirectClassFile implements ClassFile {
     /** the expected value of the ClassFile.magic field */
     private static final int CLASS_FILE_MAGIC = 0xcafebabe;
 
     /**
-     * minimum <code>.class</code> file major version
+     * minimum {@code .class} file major version
      * 
      * The class file definition (vmspec/2nd-edition) says:
      * 
@@ -64,92 +64,92 @@ public class DirectClassFile implements ClassFile {
      */
     private static final int CLASS_FILE_MIN_MAJOR_VERSION = 45;
 
-    /** maximum <code>.class</code> file major version */
+    /** maximum {@code .class} file major version */
     private static final int CLASS_FILE_MAX_MAJOR_VERSION = 50;
 
-    /** maximum <code>.class</code> file minor version */
+    /** maximum {@code .class} file minor version */
     private static final int CLASS_FILE_MAX_MINOR_VERSION = 0;
 
     /**
-     * non-null; the file path for the class, excluding any base directory
+     * {@code non-null;} the file path for the class, excluding any base directory
      * specification 
      */
     private final String filePath;
 
-    /** non-null; the bytes of the file */
+    /** {@code non-null;} the bytes of the file */
     private final ByteArray bytes;
 
     /**
      * whether to be strict about parsing; if
-     * <code>false</code>, this avoids doing checks that only exist
+     * {@code false}, this avoids doing checks that only exist
      * for purposes of verification (such as magic number matching and
      * path-package consistency checking) 
      */
     private final boolean strictParse;
 
     /**
-     * null-ok; the constant pool; only ever <code>null</code>
+     * {@code null-ok;} the constant pool; only ever {@code null}
      * before the constant pool is successfully parsed 
      */
     private StdConstantPool pool;
 
     /**
-     * the class file field <code>access_flags</code>; will be <code>-1</code>
+     * the class file field {@code access_flags}; will be {@code -1}
      * before the file is successfully parsed 
      */
     private int accessFlags;
 
     /**
-     * null-ok; the class file field <code>this_class</code>,
-     * interpreted as a type constant; only ever <code>null</code>
+     * {@code null-ok;} the class file field {@code this_class},
+     * interpreted as a type constant; only ever {@code null}
      * before the file is successfully parsed
      */
     private CstType thisClass;
 
     /**
-     * null-ok; the class file field <code>super_class</code>, interpreted
+     * {@code null-ok;} the class file field {@code super_class}, interpreted
      * as a type constant if non-zero 
      */
     private CstType superClass;
 
     /**
-     * null-ok; the class file field <code>interfaces</code>; only
-     * ever <code>null</code> before the file is successfully
+     * {@code null-ok;} the class file field {@code interfaces}; only
+     * ever {@code null} before the file is successfully
      * parsed 
      */
     private TypeList interfaces;
 
     /**
-     * null-ok; the class file field <code>fields</code>; only ever
-     * <code>null</code> before the file is successfully parsed 
+     * {@code null-ok;} the class file field {@code fields}; only ever
+     * {@code null} before the file is successfully parsed 
      */
     private FieldList fields;
 
     /**
-     * null-ok; the class file field <code>methods</code>; only ever
-     * <code>null</code> before the file is successfully parsed 
+     * {@code null-ok;} the class file field {@code methods}; only ever
+     * {@code null} before the file is successfully parsed 
      */
     private MethodList methods;
 
     /**
-     * null-ok; the class file field <code>attributes</code>; only
-     * ever <code>null</code> before the file is successfully
+     * {@code null-ok;} the class file field {@code attributes}; only
+     * ever {@code null} before the file is successfully
      * parsed 
      */
     private StdAttributeList attributes;
 
-    /** null-ok; attribute factory, if any */
+    /** {@code null-ok;} attribute factory, if any */
     private AttributeFactory attributeFactory;
 
-    /** null-ok; parse observer, if any */
+    /** {@code null-ok;} parse observer, if any */
     private ParseObserver observer;
 
     /**
-     * Returns the string form of an object or <code>"(none)"</code>
-     * (rather than <code>"null"</code>) for <code>null</code>.
+     * Returns the string form of an object or {@code "(none)"}
+     * (rather than {@code "null"}) for {@code null}.
      * 
-     * @param obj null-ok; the object to stringify
-     * @return non-null; the appropriate string form
+     * @param obj {@code null-ok;} the object to stringify
+     * @return {@code non-null;} the appropriate string form
      */
     public static String stringOrNone(Object obj) {
         if (obj == null) {
@@ -162,11 +162,11 @@ public class DirectClassFile implements ClassFile {
     /**
      * Constructs an instance.
      * 
-     * @param bytes non-null; the bytes of the file
-     * @param filePath non-null; the file path for the class,
+     * @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
      * @param strictParse whether to be strict about parsing; if
-     * <code>false</code>, this avoids doing checks that only exist
+     * {@code false}, this avoids doing checks that only exist
      * for purposes of verification (such as magic number matching and
      * path-package consistency checking)
      */
@@ -189,11 +189,11 @@ public class DirectClassFile implements ClassFile {
     /**
      * Constructs an instance.
      * 
-     * @param bytes non-null; the bytes of the file
-     * @param filePath non-null; the file path for the class,
+     * @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
      * @param strictParse whether to be strict about parsing; if
-     * <code>false</code>, this avoids doing checks that only exist
+     * {@code false}, this avoids doing checks that only exist
      * for purposes of verification (such as magic number matching and
      * path-package consistency checking)
      */
@@ -205,7 +205,7 @@ public class DirectClassFile implements ClassFile {
     /**
      * Sets the parse observer for this instance.
      * 
-     * @param observer null-ok; the observer
+     * @param observer {@code null-ok;} the observer
      */
     public void setObserver(ParseObserver observer) {
         this.observer = observer;
@@ -214,7 +214,7 @@ public class DirectClassFile implements ClassFile {
     /**
      * Sets the attribute factory to use.
      * 
-     * @param attributeFactory non-null; the attribute factory
+     * @param attributeFactory {@code non-null;} the attribute factory
      */
     public void setAttributeFactory(AttributeFactory attributeFactory) {
         if (attributeFactory == null) {
@@ -227,7 +227,7 @@ public class DirectClassFile implements ClassFile {
     /**
      * Gets the {@link ByteArray} that this instance's data comes from.
      * 
-     * @return non-null; the bytes
+     * @return {@code non-null;} the bytes
      */
     public ByteArray getBytes() {
         return bytes;
@@ -317,12 +317,12 @@ public class DirectClassFile implements ClassFile {
      * list of constant pool indices for classes, which are in turn
      * 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</code>.
+     * 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)
-     * @return non-null; an appropriately-constructed class list
+     * @return {@code non-null;} an appropriately-constructed class list
      */
     public TypeList makeTypeList(int offset, int size) {
         if (size == 0) {
@@ -337,7 +337,7 @@ public class DirectClassFile implements ClassFile {
     }
 
     /**
-     * Gets the class file field <code>magic</code>, but without doing any
+     * Gets the class file field {@code magic}, but without doing any
      * checks or parsing first.
      * 
      * @return the magic value
@@ -347,7 +347,7 @@ public class DirectClassFile implements ClassFile {
     }
 
     /**
-     * Gets the class file field <code>minor_version</code>, but
+     * Gets the class file field {@code minor_version}, but
      * without doing any checks or parsing first.
      * 
      * @return the minor version
@@ -357,7 +357,7 @@ public class DirectClassFile implements ClassFile {
     }
 
     /**
-     * Gets the class file field <code>major_version</code>, but
+     * Gets the class file field {@code major_version}, but
      * without doing any checks or parsing first.
      * 
      * @return the major version
@@ -554,27 +554,27 @@ public class DirectClassFile implements ClassFile {
      * which are in turn returned as 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</code>.
+     * {@code Class}.
      */
     private static class DcfTypeList implements TypeList {
-        /** non-null; array containing the data */
+        /** {@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;
 
-        /** non-null; the constant pool */
+        /** {@code non-null;} the constant pool */
         private final StdConstantPool pool;
 
         /**
          * Constructs an instance.
          * 
-         * @param bytes non-null; original classfile's bytes
+         * @param bytes {@code non-null;} original classfile's bytes
          * @param offset offset into {@link #bytes} for the start of the
          * data
          * @param size number of elements in the list (not number of bytes)
-         * @param pool non-null; the constant pool to use
-         * @param observer null-ok; parse observer to use, if any
+         * @param pool {@code non-null;} the constant pool to use
+         * @param observer {@code null-ok;} parse observer to use, if any
          */
         public DcfTypeList(ByteArray bytes, int offset, int size,
                 StdConstantPool pool, ParseObserver observer) {
index 06dcc41..24ba7e0 100644 (file)
@@ -28,16 +28,16 @@ import com.android.dx.rop.cst.CstType;
  * Parser for lists of fields in a class file.
  */
 final /*package*/ class FieldListParser extends MemberListParser {
-    /** non-null; list in progress */
+    /** {@code non-null;} list in progress */
     private final StdFieldList fields;
 
     /**
      * Constructs an instance.
      * 
-     * @param cf non-null; the class file to parse from
-     * @param definer non-null; class being defined
-     * @param offset offset in <code>bytes</code> to the start of the list
-     * @param attributeFactory non-null; attribute factory to use
+     * @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
+     * @param attributeFactory {@code non-null;} attribute factory to use
      */
     public FieldListParser(DirectClassFile cf, CstType definer, int offset,
             AttributeFactory attributeFactory) {
@@ -48,7 +48,7 @@ final /*package*/ class FieldListParser extends MemberListParser {
     /**
      * Gets the parsed list.
      * 
-     * @return non-null; the parsed list
+     * @return {@code non-null;} the parsed list
      */
     public StdFieldList getList() {
         parseIfNecessary();
index 3c0bfa8..a0023c6 100644 (file)
@@ -32,32 +32,32 @@ import com.android.dx.util.Hex;
  * Parser for lists of class file members (that is, fields and methods).
  */
 abstract /*package*/ class MemberListParser {
-    /** non-null; the class file to parse from */
+    /** {@code non-null;} the class file to parse from */
     private final DirectClassFile cf;
 
-    /** non-null; class being defined */
+    /** {@code non-null;} class being defined */
     private final CstType definer;
 
     /** offset in the byte array of the classfile to the start of the list */
     private final int offset;
 
-    /** non-null; attribute factory to use */
+    /** {@code non-null;} attribute factory to use */
     private final AttributeFactory attributeFactory;
 
-    /** &gt;= -1; the end offset of this list in the byte array of the
-     * classfile, or <code>-1</code> if not yet parsed */
+    /** {@code >= -1;} the end offset of this list in the byte array of the
+     * classfile, or {@code -1} if not yet parsed */
     private int endOffset;
 
-    /** null-ok; parse observer, if any */
+    /** {@code null-ok;} parse observer, if any */
     private ParseObserver observer;
 
     /**
      * Constructs an instance.
      *
-     * @param cf non-null; the class file to parse from
-     * @param definer non-null; class being defined
-     * @param offset offset in <code>bytes</code> to the start of the list
-     * @param attributeFactory non-null; attribute factory to use
+     * @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
+     * @param attributeFactory {@code non-null;} attribute factory to use
      */
     public MemberListParser(DirectClassFile cf, CstType definer,
             int offset, AttributeFactory attributeFactory) {
@@ -81,10 +81,10 @@ abstract /*package*/ class MemberListParser {
     }
 
     /**
-     * Gets the end offset of this constant pool in the <code>byte[]</code>
+     * Gets the end offset of this constant pool in the {@code byte[]}
      * which it came from.
      *
-     * @return &gt;= 0; the end offset
+     * @return {@code >= 0;} the end offset
      */
     public int getEndOffset() {
         parseIfNecessary();
@@ -94,7 +94,7 @@ abstract /*package*/ class MemberListParser {
     /**
      * Sets the parse observer for this instance.
      *
-     * @param observer null-ok; the observer
+     * @param observer {@code null-ok;} the observer
      */
     public final void setObserver(ParseObserver observer) {
         this.observer = observer;
@@ -122,7 +122,7 @@ abstract /*package*/ class MemberListParser {
     /**
      * Gets the class file being defined.
      *
-     * @return non-null; the class
+     * @return {@code non-null;} the class
      */
     protected final CstType getDefiner() {
         return definer;
@@ -132,7 +132,7 @@ abstract /*package*/ class MemberListParser {
      * Gets the human-oriented name for what this instance is parsing.
      * Subclasses must override this method.
      * 
-     * @return non-null; the human oriented name
+     * @return {@code non-null;} the human oriented name
      */
     protected abstract String humanName();
 
@@ -141,15 +141,15 @@ abstract /*package*/ class MemberListParser {
      * Subclasses must override this method.
      *
      * @param accessFlags the flags
-     * @return non-null; the string form
+     * @return {@code non-null;} the string form
      */
     protected abstract String humanAccessFlags(int accessFlags);
 
     /**
-     * Gets the <code>CTX_*</code> constant to use when parsing attributes.
+     * Gets the {@code CTX_*} constant to use when parsing attributes.
      * Subclasses must override this method.
      * 
-     * @return non-null; the human oriented name
+     * @return {@code non-null;} the human oriented name
      */
     protected abstract int getAttributeContext();
 
@@ -157,11 +157,11 @@ abstract /*package*/ class MemberListParser {
      * Sets an element in the list. Subclasses must override this method.
      *
      * @param n which element
-     * @param accessFlags the <code>access_flags</code>
+     * @param accessFlags the {@code access_flags}
      * @param nat the interpreted name and type (based on the two
-     * <code>*_index</code> fields)
+     * {@code *_index} fields)
      * @param attributes list of parsed attributes
-     * @return non-null; the constructed member
+     * @return {@code non-null;} the constructed member
      */
     protected abstract Member set(int n, int accessFlags, CstNat nat,
             AttributeList attributes);
index 9ca8ba6..6ab1aba 100644 (file)
@@ -28,16 +28,16 @@ import com.android.dx.rop.cst.CstType;
  * Parser for lists of methods in a class file.
  */
 final /*package*/ class MethodListParser extends MemberListParser {
-    /** non-null; list in progress */
+    /** {@code non-null;} list in progress */
     final private StdMethodList methods;
 
     /**
      * Constructs an instance.
      * 
-     * @param cf non-null; the class file to parse from
-     * @param definer non-null; class being defined
-     * @param offset offset in <code>bytes</code> to the start of the list
-     * @param attributeFactory non-null; attribute factory to use
+     * @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
+     * @param attributeFactory {@code non-null;} attribute factory to use
      */
     public MethodListParser(DirectClassFile cf, CstType definer,
             int offset, AttributeFactory attributeFactory) {
@@ -48,7 +48,7 @@ final /*package*/ class MethodListParser extends MemberListParser {
     /**
      * Gets the parsed list.
      * 
-     * @return non-null; the parsed list
+     * @return {@code non-null;} the parsed list
      */
     public StdMethodList getList() {
         parseIfNecessary();
index ab0e2f7..da12a4e 100644 (file)
@@ -65,7 +65,7 @@ import java.io.IOException;
  */
 public class StdAttributeFactory
     extends AttributeFactory {
-    /** non-null; shared instance of this class */
+    /** {@code non-null;} shared instance of this class */
     public static final StdAttributeFactory THE_ONE =
         new StdAttributeFactory();
 
@@ -191,7 +191,7 @@ public class StdAttributeFactory
     }
 
     /**
-     * Parses an <code>AnnotationDefault</code> attribute.
+     * Parses an {@code AnnotationDefault} attribute.
      */
     private Attribute annotationDefault(DirectClassFile cf,
             int offset, int length, ParseObserver observer) {
@@ -207,7 +207,7 @@ public class StdAttributeFactory
     }
 
     /**
-     * Parses a <code>Code</code> attribute.
+     * Parses a {@code Code} attribute.
      */
     private Attribute code(DirectClassFile cf, int offset, int length,
             ParseObserver observer) {
@@ -311,7 +311,7 @@ public class StdAttributeFactory
     }
 
     /**
-     * Parses a <code>ConstantValue</code> attribute.
+     * Parses a {@code ConstantValue} attribute.
      */
     private Attribute constantValue(DirectClassFile cf, int offset, int length,
             ParseObserver observer) {
@@ -333,7 +333,7 @@ public class StdAttributeFactory
     }
 
     /**
-     * Parses a <code>Deprecated</code> attribute.
+     * Parses a {@code Deprecated} attribute.
      */
     private Attribute deprecated(DirectClassFile cf, int offset, int length,
             ParseObserver observer) {
@@ -345,7 +345,7 @@ public class StdAttributeFactory
     }
 
     /**
-     * Parses an <code>EnclosingMethod</code> attribute.
+     * Parses an {@code EnclosingMethod} attribute.
      */
     private Attribute enclosingMethod(DirectClassFile cf, int offset,
             int length, ParseObserver observer) {
@@ -374,7 +374,7 @@ public class StdAttributeFactory
     }
 
     /**
-     * Parses an <code>Exceptions</code> attribute.
+     * Parses an {@code Exceptions} attribute.
      */
     private Attribute exceptions(DirectClassFile cf, int offset, int length,
             ParseObserver observer) {
@@ -402,7 +402,7 @@ public class StdAttributeFactory
     }
 
     /**
-     * Parses an <code>InnerClasses</code> attribute.
+     * Parses an {@code InnerClasses} attribute.
      */
     private Attribute innerClasses(DirectClassFile cf, int offset, int length,
             ParseObserver observer) {
@@ -459,7 +459,7 @@ public class StdAttributeFactory
     }
 
     /**
-     * Parses a <code>LineNumberTable</code> attribute.
+     * Parses a {@code LineNumberTable} attribute.
      */
     private Attribute lineNumberTable(DirectClassFile cf, int offset,
             int length, ParseObserver observer) {
@@ -500,7 +500,7 @@ public class StdAttributeFactory
     }
 
     /**
-     * Parses a <code>LocalVariableTable</code> attribute.
+     * Parses a {@code LocalVariableTable} attribute.
      */
     private Attribute localVariableTable(DirectClassFile cf, int offset,
             int length, ParseObserver observer) {
@@ -523,7 +523,7 @@ public class StdAttributeFactory
     }
 
     /**
-     * Parses a <code>LocalVariableTypeTable</code> attribute.
+     * Parses a {@code LocalVariableTypeTable} attribute.
      */
     private Attribute localVariableTypeTable(DirectClassFile cf, int offset,
             int length, ParseObserver observer) {
@@ -546,15 +546,15 @@ public class StdAttributeFactory
     }
 
     /**
-     * Parse the table part of either a <code>LocalVariableTable</code>
-     * or a <code>LocalVariableTypeTable</code>.
+     * Parse the table part of either a {@code LocalVariableTable}
+     * or a {@code LocalVariableTypeTable}.
      * 
-     * @param bytes non-null; bytes to parse, which should <i>only</i>
+     * @param bytes {@code non-null;} bytes to parse, which should <i>only</i>
      * contain the table data (no header)
-     * @param pool non-null; constant pool to use
-     * @param count &gt;= 0; the number of entries
-     * @param typeTable <code>true</code> iff this is for a type table
-     * @return non-null; the constructed list
+     * @param pool {@code non-null;} constant pool to use
+     * @param count {@code >= 0;} the number of entries
+     * @param typeTable {@code true} iff this is for a type table
+     * @return {@code non-null;} the constructed list
      */
     private LocalVariableList parseLocalVariables(ByteArray bytes,
             ConstantPool pool, ParseObserver observer, int count,
@@ -604,7 +604,7 @@ public class StdAttributeFactory
     }
 
     /**
-     * Parses a <code>RuntimeInvisibleAnnotations</code> attribute.
+     * Parses a {@code RuntimeInvisibleAnnotations} attribute.
      */
     private Attribute runtimeInvisibleAnnotations(DirectClassFile cf,
             int offset, int length, ParseObserver observer) {
@@ -621,7 +621,7 @@ public class StdAttributeFactory
     }
 
     /**
-     * Parses a <code>RuntimeVisibleAnnotations</code> attribute.
+     * Parses a {@code RuntimeVisibleAnnotations} attribute.
      */
     private Attribute runtimeVisibleAnnotations(DirectClassFile cf,
             int offset, int length, ParseObserver observer) {
@@ -638,7 +638,7 @@ public class StdAttributeFactory
     }
 
     /**
-     * Parses a <code>RuntimeInvisibleParameterAnnotations</code> attribute.
+     * Parses a {@code RuntimeInvisibleParameterAnnotations} attribute.
      */
     private Attribute runtimeInvisibleParameterAnnotations(DirectClassFile cf,
             int offset, int length, ParseObserver observer) {
@@ -655,7 +655,7 @@ public class StdAttributeFactory
     }
 
     /**
-     * Parses a <code>RuntimeVisibleParameterAnnotations</code> attribute.
+     * Parses a {@code RuntimeVisibleParameterAnnotations} attribute.
      */
     private Attribute runtimeVisibleParameterAnnotations(DirectClassFile cf,
             int offset, int length, ParseObserver observer) {
@@ -672,7 +672,7 @@ public class StdAttributeFactory
     }
 
     /**
-     * Parses a <code>Signature</code> attribute.
+     * Parses a {@code Signature} attribute.
      */
     private Attribute signature(DirectClassFile cf, int offset, int length,
             ParseObserver observer) {
@@ -694,7 +694,7 @@ public class StdAttributeFactory
     }
 
     /**
-     * Parses a <code>SourceFile</code> attribute.
+     * Parses a {@code SourceFile} attribute.
      */
     private Attribute sourceFile(DirectClassFile cf, int offset, int length,
             ParseObserver observer) {
@@ -716,7 +716,7 @@ public class StdAttributeFactory
     }
 
     /**
-     * Parses a <code>Synthetic</code> attribute.
+     * Parses a {@code Synthetic} attribute.
      */
     private Attribute synthetic(DirectClassFile cf, int offset, int length,
             ParseObserver observer) {
index f28f51e..b075251 100644 (file)
@@ -23,16 +23,16 @@ public interface Attribute {
     /**
      * Get the name of the attribute.
      *
-     * @return non-null; the name
+     * @return {@code non-null;} the name
      */
     public String getName();
 
     /**
      * Get the total length of the attribute in bytes, including the
      * header. Since the header is always six bytes, the result of
-     * this method is always at least <code>6</code>.
+     * this method is always at least {@code 6}.
      *
-     * @return &gt;= 6; the total length, in bytes
+     * @return {@code >= 6;} the total length, in bytes
      */
     public int byteLength();
 }
index a72965a..f7a1d27 100644 (file)
@@ -22,11 +22,11 @@ package com.android.dx.cf.iface;
 public interface AttributeList {
     /**
      * Get whether this instance is mutable. Note that the
-     * <code>AttributeList</code> interface itself doesn't provide any means
+     * {@code AttributeList} interface itself doesn't provide any means
      * of mutation, but that doesn't mean that there isn't a non-interface
      * way of mutating an instance.
      *
-     * @return <code>true</code> iff this instance is somehow mutable
+     * @return {@code true} iff this instance is somehow mutable
      */
     public boolean isMutable();
 
@@ -38,28 +38,28 @@ public interface AttributeList {
     public int size();
 
     /**
-     * Get the <code>n</code>th attribute.
+     * Get the {@code n}th attribute.
      *
-     * @param n <code>n &gt;= 0, n &lt; size()</code>; which attribute
-     * @return non-null; the attribute in question
+     * @param n {@code n >= 0, n < size();} which attribute
+     * @return {@code non-null;} the attribute in question
      */
     public Attribute get(int n);
 
     /**
      * Get the total length of this list in bytes, when part of a
      * class file. The returned value includes the two bytes for the
-     * <code>attributes_count</code> length indicator.
+     * {@code attributes_count} length indicator.
      *
-     * @return &gt;= 2; the total length, in bytes
+     * @return {@code >= 2;} the total length, in bytes
      */
     public int byteLength();
 
     /**
      * Get the first attribute in the list with the given name, if any.
      *
-     * @param name non-null; attribute name
-     * @return null-ok; first attribute in the list with the given name,
-     * or <code>null</code> if there is none
+     * @param name {@code non-null;} attribute name
+     * @return {@code null-ok;} first attribute in the list with the given name,
+     * or {@code null} if there is none
      */
     public Attribute findFirst(String name);
 
@@ -67,9 +67,9 @@ public interface AttributeList {
      * Get the next attribute in the list after the given one, with the same
      * name, if any.
      *
-     * @param attrib non-null; attribute to start looking after
-     * @return null-ok; next attribute after <code>attrib</code> with the
-     * same name as <code>attrib</code>
+     * @param attrib {@code non-null;} attribute to start looking after
+     * @return {@code null-ok;} next attribute after {@code attrib} with the
+     * same name as {@code attrib}
      */
     public Attribute findNext(Attribute attrib);
 }
index 36a5f74..e37fec0 100644 (file)
@@ -26,98 +26,98 @@ import com.android.dx.rop.type.TypeList;
  * facsimiles thereof.
  *
  * <p><b>Note:</b> The fields referred to in this documentation are of the
- * <code>ClassFile</code> structure defined in vmspec-2 sec4.1.
+ * {@code ClassFile} structure defined in vmspec-2 sec4.1.
  */
 public interface ClassFile {
     /**
-     * Gets the field <code>magic</code>.
+     * Gets the field {@code magic}.
      *
      * @return the value in question
      */
     public int getMagic();
 
     /**
-     * Gets the field <code>minor_version</code>.
+     * Gets the field {@code minor_version}.
      *
      * @return the value in question
      */
     public int getMinorVersion();
 
     /**
-     * Gets the field <code>major_version</code>.
+     * Gets the field {@code major_version}.
      *
      * @return the value in question
      */
     public int getMajorVersion();
 
     /**
-     * Gets the field <code>access_flags</code>.
+     * Gets the field {@code access_flags}.
      *
      * @return the value in question
      */
     public int getAccessFlags();
 
     /**
-     * Gets the field <code>this_class</code>, interpreted as a type constant.
+     * Gets the field {@code this_class}, interpreted as a type constant.
      *
-     * @return non-null; the value in question
+     * @return {@code non-null;} the value in question
      */
     public CstType getThisClass();
 
     /**
-     * Gets the field <code>super_class</code>, interpreted as a type constant
+     * Gets the field {@code super_class}, interpreted as a type constant
      * if non-zero.
      *
-     * @return null-ok; the value in question
+     * @return {@code null-ok;} the value in question
      */
     public CstType getSuperclass();
 
     /**
-     * Gets the field <code>constant_pool</code> (along with
-     * <code>constant_pool_count</code>).
+     * Gets the field {@code constant_pool} (along with
+     * {@code constant_pool_count}).
      *
-     * @return non-null; the constant pool
+     * @return {@code non-null;} the constant pool
      */
     public ConstantPool getConstantPool();
 
     /**
-     * Gets the field <code>interfaces<code> (along with 
-     * interfaces_count</code>).
+     * Gets the field {@code interfaces} (along with 
+     * {@code interfaces_count}).
      *
-     * @return non-null; the list of interfaces
+     * @return {@code non-null;} the list of interfaces
      */
     public TypeList getInterfaces();
 
     /**
-     * Gets the field <code>fields</code> (along with
-     * <code>fields_count</code>).
+     * Gets the field {@code fields} (along with
+     * {@code fields_count}).
      *
-     * @return non-null; the list of fields
+     * @return {@code non-null;} the list of fields
      */
     public FieldList getFields();
 
     /**
-     * Gets the field <code>methods</code> (along with
-     * <code>methods_count</code>).
+     * Gets the field {@code methods} (along with
+     * {@code methods_count}).
      *
-     * @return non-null; the list of fields
+     * @return {@code non-null;} the list of fields
      */
     public MethodList getMethods();
 
     /**
-     * Gets the field <code>attributes</code> (along with
-     * <code>attributes_count</code>).
+     * Gets the field {@code attributes} (along with
+     * {@code attributes_count}).
      *
-     * @return non-null; the list of attributes
+     * @return {@code non-null;} the list of attributes
      */
     public AttributeList getAttributes();
 
     /**
-     * Gets the name out of the <code>SourceFile</code> attribute of this
+     * Gets the name out of the {@code SourceFile} attribute of this
      * file, if any. This is a convenient shorthand for scrounging around
      * the class's attributes.
      *
-     * @return non-null; the constant pool
+     * @return {@code non-null;} the constant pool
      */
     public CstUtf8 getSourceFile();
 }
index d1694fc..e3002bc 100644 (file)
@@ -25,10 +25,10 @@ public interface Field
         extends Member {
     /**
      * Get the constant value for this field, if any. This only returns
-     * non-<code>null</code> for a <code>static final</code> field which
-     * includes a <code>ConstantValue</code> attribute.
+     * non-{@code null} for a {@code static final} field which
+     * includes a {@code ConstantValue} attribute.
      *
-     * @return null-ok; the constant value, or <code>null</code> if this
+     * @return {@code null-ok;} the constant value, or {@code null} if this
      * field isn't a constant
      */
     public TypedConstant getConstantValue();
index 80a794f..9cd27a3 100644 (file)
@@ -23,11 +23,11 @@ public interface FieldList
 {
     /**
      * Get whether this instance is mutable. Note that the
-     * <code>FieldList</code> interface itself doesn't provide any means
+     * {@code FieldList} interface itself doesn't provide any means
      * of mutation, but that doesn't mean that there isn't a non-interface
      * way of mutating an instance.
      *
-     * @return <code>true</code> iff this instance is somehow mutable
+     * @return {@code true} iff this instance is somehow mutable
      */
     public boolean isMutable();
 
@@ -39,10 +39,10 @@ public interface FieldList
     public int size();
 
     /**
-     * Get the <code>n</code>th field.
+     * Get the {@code n}th field.
      *
-     * @param n <code>n &gt;= 0, n &lt; size()</code>; which field
-     * @return non-null; the field in question
+     * @param n {@code n >= 0, n < size();} which field
+     * @return {@code non-null;} the field in question
      */
     public Field get(int n);
 }
index b305e09..0453a6f 100644 (file)
@@ -27,48 +27,48 @@ public interface Member {
     /**
      * Get the defining class.
      *
-     * @return non-null; the defining class
+     * @return {@code non-null;} the defining class
      */
     public CstType getDefiningClass();
 
     /**
-     * Get the field <code>access_flags</code>.
+     * Get the field {@code access_flags}.
      *
      * @return the access flags
      */
     public int getAccessFlags();
 
     /**
-     * Get the field <code>name_index</code> of the member. This is
-     * just a convenient shorthand for <code>getNat().getName()</code>.
+     * Get the field {@code name_index} of the member. This is
+     * just a convenient shorthand for {@code getNat().getName()}.
      *
-     * @return non-null; the name
+     * @return {@code non-null;} the name
      */
     public CstUtf8 getName();
 
     /**
-     * Get the field <code>descriptor_index</code> of the member. This is
-     * just a convenient shorthand for <code>getNat().getDescriptor()</code>.
+     * Get the field {@code descriptor_index} of the member. This is
+     * just a convenient shorthand for {@code getNat().getDescriptor()}.
      *
-     * @return non-null; the descriptor
+     * @return {@code non-null;} the descriptor
      */
     public CstUtf8 getDescriptor();
 
     /**
      * Get the name and type associated with this member. This is a
-     * combination of the fields <code>name_index</code> and
-     * <code>descriptor_index</code> in the original classfile, interpreted
+     * combination of the fields {@code name_index} and
+     * {@code descriptor_index} in the original classfile, interpreted
      * via the constant pool.
      *
-     * @return non-null; the name and type
+     * @return {@code non-null;} the name and type
      */
     public CstNat getNat();
 
     /**
-     * Get the field <code>attributes</code> (along with
-     * <code>attributes_count</code>).
+     * Get the field {@code attributes} (along with
+     * {@code attributes_count}).
      *
-     * @return non-null; the constant pool
+     * @return {@code non-null;} the constant pool
      */
     public AttributeList getAttributes();
 }
index 424400a..18b9af6 100644 (file)
@@ -26,9 +26,9 @@ public interface Method
 {
     /**
      * Get the <i>effective</i> method descriptor, which includes, if
-     * necessary, a first <code>this</code> parameter.
+     * necessary, a first {@code this} parameter.
      *
-     * @return non-null; the effective method descriptor
+     * @return {@code non-null;} the effective method descriptor
      */
     public Prototype getEffectiveDescriptor();
 }
index a7a395c..dfa6528 100644 (file)
@@ -22,11 +22,11 @@ package com.android.dx.cf.iface;
 public interface MethodList {
     /**
      * Get whether this instance is mutable. Note that the
-     * <code>MethodList</code> interface itself doesn't provide any means
+     * {@code MethodList} interface itself doesn't provide any means
      * of mutation, but that doesn't mean that there isn't a non-interface
      * way of mutating an instance.
      *
-     * @return <code>true</code> iff this instance is somehow mutable
+     * @return {@code true} iff this instance is somehow mutable
      */
     public boolean isMutable();
 
@@ -38,10 +38,10 @@ public interface MethodList {
     public int size();
 
     /**
-     * Get the <code>n</code>th method.
+     * Get the {@code n}th method.
      *
-     * @param n <code>n &gt;= 0, n &lt; size()</code>; which method
-     * @return non-null; the method in question
+     * @param n {@code n >= 0, n < size();} which method
+     * @return {@code non-null;} the method in question
      */
     public Method get(int n);
 }
index 2ad3493..98d5a75 100644 (file)
@@ -34,11 +34,11 @@ public interface ParseObserver {
     /**
      * Indicate that a particular member is now being parsed.
      *
-     * @param bytes non-null; the source that is being parsed
-     * @param offset offset into <code>bytes</code> for the start of the
+     * @param bytes {@code non-null;} the source that is being parsed
+     * @param offset offset into {@code bytes} for the start of the
      * member
-     * @param name non-null; name of the member
-     * @param descriptor non-null; descriptor of the member
+     * @param name {@code non-null;} name of the member
+     * @param descriptor {@code non-null;} descriptor of the member
      */
     public void startParsingMember(ByteArray bytes, int offset, String name,
                                    String descriptor);
@@ -46,12 +46,12 @@ public interface ParseObserver {
     /**
      * Indicate that a particular member is no longer being parsed.
      *
-     * @param bytes non-null; the source that was parsed
-     * @param offset offset into <code>bytes</code> for the end of the
+     * @param bytes {@code non-null;} the source that was parsed
+     * @param offset offset into {@code bytes} for the end of the
      * member
-     * @param name non-null; name of the member
-     * @param descriptor non-null; descriptor of the member
-     * @param member non-null; the actual member that was parsed
+     * @param name {@code non-null;} name of the member
+     * @param descriptor {@code non-null;} descriptor of the member
+     * @param member {@code non-null;} the actual member that was parsed
      */
     public void endParsingMember(ByteArray bytes, int offset, String name,
                                  String descriptor, Member member);
@@ -59,10 +59,10 @@ public interface ParseObserver {
     /**
      * Indicate that some parsing happened.
      *
-     * @param bytes non-null; the source that was parsed
-     * @param offset offset into <code>bytes</code> for what was parsed
+     * @param bytes {@code non-null;} the source that was parsed
+     * @param offset offset into {@code bytes} for what was parsed
      * @param len number of bytes parsed
-     * @param human non-null; human form for what was parsed
+     * @param human {@code non-null;} human form for what was parsed
      */
     public void parsed(ByteArray bytes, int offset, int len, String human);
 }
index c29bb08..dd5dfd7 100644 (file)
@@ -25,7 +25,7 @@ import com.android.dx.util.FixedSizeList;
 public final class StdAttributeList extends FixedSizeList
         implements AttributeList {
     /**
-     * Constructs an instance. All indices initially contain <code>null</code>.
+     * Constructs an instance. All indices initially contain {@code null}.
      * 
      * @param size the size of the list
      */
@@ -95,8 +95,8 @@ public final class StdAttributeList extends FixedSizeList
     /**
      * Sets the attribute at the given index.
      * 
-     * @param n &gt;= 0, &lt; size(); which attribute
-     * @param attribute null-ok; the attribute object
+     * @param n {@code >= 0, < size();} which attribute
+     * @param attribute {@code null-ok;} the attribute object
      */
     public void set(int n, Attribute attribute) {
         set0(n, attribute);
index 3551aee..c3a4da6 100644 (file)
@@ -29,10 +29,10 @@ public final class StdField extends StdMember implements Field {
     /**
      * Constructs an instance.
      * 
-     * @param definingClass non-null; the defining class
+     * @param definingClass {@code non-null;} the defining class
      * @param accessFlags access flags
-     * @param nat non-null; member name and type (descriptor)
-     * @param attributes non-null; list of associated attributes
+     * @param nat {@code non-null;} member name and type (descriptor)
+     * @param attributes {@code non-null;} list of associated attributes
      */
     public StdField(CstType definingClass, int accessFlags, CstNat nat,
                     AttributeList attributes) {
index 0f8654b..044d6b7 100644 (file)
@@ -24,7 +24,7 @@ import com.android.dx.util.FixedSizeList;
  */
 public final class StdFieldList extends FixedSizeList implements FieldList {
     /**
-     * Constructs an instance. All indices initially contain <code>null</code>.
+     * Constructs an instance. All indices initially contain {@code null}.
      * 
      * @param size the size of the list
      */
@@ -40,8 +40,8 @@ public final class StdFieldList extends FixedSizeList implements FieldList {
     /**
      * Sets the field at the given index.
      * 
-     * @param n &gt;= 0, &lt; size(); which field
-     * @param field null-ok; the field object
+     * @param n {@code >= 0, < size();} which field
+     * @param field {@code null-ok;} the field object
      */
     public void set(int n, Field field) {
         set0(n, field);
index eaf949e..dfe45c3 100644 (file)
@@ -25,25 +25,25 @@ import com.android.dx.rop.cst.CstUtf8;
  * all the associated data.
  */
 public abstract class StdMember implements Member {
-    /** non-null; the defining class */
+    /** {@code non-null;} the defining class */
     private final CstType definingClass;
 
     /** access flags */
     private final int accessFlags;
 
-    /** non-null; member name and type */
+    /** {@code non-null;} member name and type */
     private final CstNat nat;
 
-    /** non-null; list of associated attributes */
+    /** {@code non-null;} list of associated attributes */
     private final AttributeList attributes;
 
     /**
      * Constructs an instance.
      * 
-     * @param definingClass non-null; the defining class
+     * @param definingClass {@code non-null;} the defining class
      * @param accessFlags access flags
-     * @param nat non-null; member name and type (descriptor)
-     * @param attributes non-null; list of associated attributes
+     * @param nat {@code non-null;} member name and type (descriptor)
+     * @param attributes {@code non-null;} list of associated attributes
      */
     public StdMember(CstType definingClass, int accessFlags, CstNat nat,
                      AttributeList attributes) {
index a4acbaa..15fd6e1 100644 (file)
@@ -26,16 +26,16 @@ import com.android.dx.rop.type.Prototype;
  * all the associated data.
  */
 public final class StdMethod extends StdMember implements Method {
-    /** non-null; the effective method descriptor */
+    /** {@code non-null;} the effective method descriptor */
     private final Prototype effectiveDescriptor;
 
     /**
      * Constructs an instance.
      * 
-     * @param definingClass non-null; the defining class
+     * @param definingClass {@code non-null;} the defining class
      * @param accessFlags access flags
-     * @param nat non-null; member name and type (descriptor)
-     * @param attributes non-null; list of associated attributes
+     * @param nat {@code non-null;} member name and type (descriptor)
+     * @param attributes {@code non-null;} list of associated attributes
      */
     public StdMethod(CstType definingClass, int accessFlags, CstNat nat,
             AttributeList attributes) {
index ef0ff31..521021e 100644 (file)
@@ -24,7 +24,7 @@ import com.android.dx.util.FixedSizeList;
  */
 public final class StdMethodList extends FixedSizeList implements MethodList {
     /**
-     * Constructs an instance. All indices initially contain <code>null</code>.
+     * Constructs an instance. All indices initially contain {@code null}.
      * 
      * @param size the size of the list
      */
@@ -40,8 +40,8 @@ public final class StdMethodList extends FixedSizeList implements MethodList {
     /**
      * Sets the method at the given index.
      * 
-     * @param n &gt;= 0, &lt; size(); which method
-     * @param method null-ok; the method object
+     * @param n {@code >= 0, < size();} which method
+     * @param method {@code null-ok;} the method object
      */
     public void set(int n, Method method) {
         set0(n, method);
index 982e659..9ce9836 100644 (file)
@@ -20,18 +20,18 @@ import java.io.PrintStream;
 
 /**
  * Provides standard and error PrintStream object to output information.<br>
- * By default the PrintStream objects link to <code>System.out</code> and
- * <code>System.err</code> but they can be changed to link to other
+ * By default the PrintStream objects link to {@code System.out} and
+ * {@code System.err} but they can be changed to link to other
  * PrintStream.
  */
 public class DxConsole {
     /**
-     * Standard output stream. Links to <code>System.out</code> by default.
+     * Standard output stream. Links to {@code System.out} by default.
      */
     public static PrintStream out = System.out;
 
     /**
-     * Error output stream. Links to <code>System.err</code> by default.
+     * Error output stream. Links to {@code System.err} by default.
      */
     public static PrintStream err = System.err;
 }
index 17f5db3..281a83e 100644 (file)
@@ -43,10 +43,12 @@ public class Main {
         "    options: none, important, lines.\n" +
         "  dx --annotool --annotation=<class> [--element=<element types>]\n" +
         "  [--print=<print types>]\n" +
-        "  dx --dump [--debug] [--strict] [--bytes] [--basic-blocks | " +
-        "--rop-blocks]\n" +
+        "  dx --dump [--debug] [--strict] [--bytes] [--optimize]\n" +
+        "  [--basic-blocks | --rop-blocks | --ssa-blocks | --dot] " +
+        "[--ssa-step=<step>]\n" +
         "  [--width=<n>] [<file>.class | <file>.txt] ...\n" +
-        "    Dump classfiles in a human-oriented format.\n" +
+        "    Dump classfiles, or transformations thereof, in a " +
+        "human-oriented format.\n" +
         "  dx --junit [-wait] <TestClass>\n" +
         "    Run the indicated unit test.\n" + 
         "  dx -J<option> ... <arguments, in one of the above " +
@@ -156,9 +158,9 @@ public class Main {
      * Returns a copy of the given args array, but without the indicated
      * element.
      *
-     * @param orig non-null; original array
+     * @param orig {@code non-null;} original array
      * @param n which element to omit
-     * @return non-null; new array
+     * @return {@code non-null;} new array
      */
     private static String[] without(String[] orig, int n) {
         int len = orig.length - 1;
index 78f5d64..0bd101e 100644 (file)
@@ -34,7 +34,7 @@ import java.util.HashSet;
 /**
  * Greps annotations on a set of class files and prints matching elements
  * to stdout. What counts as a match and what should be printed is controlled
- * by the <code>Main.Arguments</code> instance.
+ * by the {@code Main.Arguments} instance.
  */
 class AnnotationLister {
 
@@ -137,8 +137,8 @@ class AnnotationLister {
     /**
      * Inspects a class annotation.
      *
-     * @param cf non-null; class file
-     * @param ann non-null; annotation
+     * @param cf {@code non-null;} class file
+     * @param ann {@code non-null;} annotation
      */
     private void visitClassAnnotation(DirectClassFile cf,
             BaseAnnotations ann) {
@@ -159,8 +159,8 @@ class AnnotationLister {
     /**
      * Inspects a package annotation
      *
-     * @param cf non-null; class file of "package-info" pseudo-class
-     * @param ann non-null; annotation
+     * @param cf {@code non-null;} class file of "package-info" pseudo-class
+     * @param ann {@code non-null;} annotation
      */
     private void visitPackageAnnotation(
             DirectClassFile cf, BaseAnnotations ann) {
@@ -195,7 +195,7 @@ class AnnotationLister {
      * Prints, or schedules for printing, elements related to a
      * matching package.
      *
-     * @param packageName non-null; name of package
+     * @param packageName {@code non-null;} name of package
      */
     private void printMatchPackage(String packageName) {
         for(Main.PrintType pt: args.printTypes) {
@@ -216,7 +216,7 @@ class AnnotationLister {
      * Prints, or schedules for printing, elements related to a matching
      * class.
      *
-     * @param cf non-null; matching class
+     * @param cf {@code non-null;} matching class
      */
     private void printMatch(DirectClassFile cf) {
         for(Main.PrintType pt: args.printTypes) {
@@ -244,7 +244,7 @@ class AnnotationLister {
      * Checks to see if a specified class name should be considered a match
      * due to previous matches.
      *
-     * @param s non-null; class name
+     * @param s {@code non-null;} class name
      * @return true if this class should be considered a match
      */
     private boolean isMatchingInnerClass(String s) {
@@ -264,7 +264,7 @@ class AnnotationLister {
      * Checks to see if a specified package should be considered a match due
      * to previous matches.
      *
-     * @param s non-null; package name
+     * @param s {@code non-null;} package name
      * @return true if this package should be considered a match
      */
     private boolean isMatchingPackage(String s) {
index 19f67b4..224926e 100644 (file)
@@ -55,26 +55,26 @@ import java.util.jar.Manifest;
  */
 public class Main {
     /**
-     * non-null; name for the <code>.dex</code> file that goes into
-     * <code>.jar</code> files
+     * {@code non-null;} name for the {@code .dex} file that goes into
+     * {@code .jar} files
      */
     private static final String DEX_IN_JAR_NAME = "classes.dex";
 
     /**
-     * non-null; name of the standard manifest file in <code>.jar</code>
+     * {@code non-null;} name of the standard manifest file in {@code .jar}
      * files
      */
     private static final String MANIFEST_NAME = "META-INF/MANIFEST.MF";
 
     /**
-     * non-null; attribute name for the (quasi-standard?)
-     * <code>Created-By</code> attribute
+     * {@code non-null;} attribute name for the (quasi-standard?)
+     * {@code Created-By} attribute
      */
     private static final Attributes.Name CREATED_BY =
         new Attributes.Name("Created-By");
 
     /**
-     * non-null; list of <code>javax</code> subpackages that are considered
+     * {@code non-null;} list of {@code javax} subpackages that are considered
      * to be "core". <b>Note:</b>: This list must be sorted, since it
      * is binary-searched.
      */
@@ -90,15 +90,15 @@ public class Main {
     /** number of errors during processing */
     private static int errors = 0;
 
-    /** non-null; parsed command-line arguments */
+    /** {@code non-null;} parsed command-line arguments */
     private static Arguments args;
 
-    /** non-null; output file in-progress */
+    /** {@code non-null;} output file in-progress */
     private static DexFile outputDex;
 
     /**
-     * null-ok; map of resources to include in the output, or
-     * <code>null</code> if resources are being ignored
+     * {@code null-ok;} map of resources to include in the output, or
+     * {@code null} if resources are being ignored
      */
     private static TreeMap<String, byte[]> outputResources;
 
@@ -215,7 +215,7 @@ public class Main {
     /**
      * Processes one pathname element.
      *
-     * @param pathname non-null; the pathname to process. May be the path of
+     * @param pathname {@code non-null;} the pathname to process. May be the path of
      * a class file, a jar file, or a directory containing class files.
      * @return whether any processing actually happened
      */
@@ -248,8 +248,8 @@ public class Main {
     /**
      * Processes one file, which may be either a class or a resource.
      *
-     * @param name non-null; name of the file
-     * @param bytes non-null; contents of the file
+     * @param name {@code non-null;} name of the file
+     * @param bytes {@code non-null;} contents of the file
      * @return whether processing was successful
      */
     private static boolean processFileBytes(String name, byte[] bytes) {
@@ -283,9 +283,9 @@ public class Main {
     /**
      * Processes one classfile.
      *
-     * @param name non-null; name of the file, clipped such that it
+     * @param name {@code non-null;} name of the file, clipped such that it
      * <i>should</i> correspond to the name of the class it contains
-     * @param bytes non-null; contents of the file
+     * @param bytes {@code non-null;} contents of the file
      * @return whether processing was successful
      */
     private static boolean processClass(String name, byte[] bytes) {
@@ -316,7 +316,7 @@ public class Main {
      * class. If there is a problem, this updates the error count and
      * throws an exception to stop processing.
      * 
-     * @param name non-null; the fully-qualified internal-form class name
+     * @param name {@code non-null;} the fully-qualified internal-form class name
      */
     private static void checkClassName(String name) {
         boolean bogus = false;
@@ -370,11 +370,11 @@ public class Main {
     }
 
     /**
-     * Converts {@link #outputDex} into a <code>byte[]</code>, write
+     * Converts {@link #outputDex} into a {@code byte[]}, write
      * it out to the proper file (if any), and also do whatever human-oriented
      * dumping is required.
      *
-     * @return null-ok; the converted <code>byte[]</code> or <code>null</code>
+     * @return {@code null-ok;} the converted {@code byte[]} or {@code null}
      * if there was a problem
      */
     private static byte[] writeDex() {
@@ -438,8 +438,8 @@ public class Main {
     /**
      * Creates a jar file from the resources and given dex file array.
      *
-     * @param fileName non-null; name of the file
-     * @param dexArray non-null; array containing the dex file to include
+     * @param fileName {@code non-null;} name of the file
+     * @param dexArray {@code non-null;} array containing the dex file to include
      * @return whether the creation was successful
      */
     private static boolean createJar(String fileName, byte[] dexArray) {
@@ -496,7 +496,7 @@ public class Main {
      * Creates and returns the manifest to use for the output. This may
      * modify {@link #outputResources} (removing the pre-existing manifest).
      *
-     * @return non-null; the manifest
+     * @return {@code non-null;} the manifest
      */
     private static Manifest makeManifest() throws IOException {
         byte[] manifestBytes = outputResources.get(MANIFEST_NAME);
@@ -531,8 +531,8 @@ public class Main {
     /**
      * Opens and returns the named file for writing, treating "-" specially.
      *
-     * @param name non-null; the file name
-     * @return non-null; the opened file
+     * @param name {@code non-null;} the file name
+     * @return {@code non-null;} the opened file
      */
     private static OutputStream openOutput(String name) throws IOException {
         if (name.equals("-") ||
@@ -547,9 +547,9 @@ public class Main {
      * Flushes and closes the given output stream, except if it happens to be
      * {@link System#out} in which case this method does the flush but not
      * the close. This method will also silently do nothing if given a
-     * <code>null</code> argument.
+     * {@code null} argument.
      *
-     * @param stream null-ok; what to close
+     * @param stream {@code null-ok;} what to close
      */
     private static void closeOutput(OutputStream stream) throws IOException {
         if (stream == null) {
@@ -565,18 +565,18 @@ public class Main {
 
     /**
      * Returns the "fixed" version of a given file path, suitable for
-     * use as a path within a <code>.jar</code> file and for checking
+     * use as a path within a {@code .jar} file and for checking
      * against a classfile-internal "this class" name. This looks for
-     * the last instance of the substring <code>"/./"</code> within
+     * the last instance of the substring {@code "/./"} within
      * the path, and if it finds it, it takes the portion after to be
      * the fixed path. If that isn't found but the path starts with
-     * <code>"./"</code>, then that prefix is removed and the rest is
+     * {@code "./"}, then that prefix is removed and the rest is
      * return. If neither of these is the case, this method returns
      * its argument.
      *
-     * @param path non-null; the path to "fix"
-     * @return non-null; the fixed version (which might be the same as
-     * the given <code>path</code>)
+     * @param path {@code non-null;} the path to "fix"
+     * @return {@code non-null;} the fixed version (which might be the same as
+     * the given {@code path})
      */
     private static String fixPath(String path) {
         /*
@@ -603,9 +603,9 @@ public class Main {
     /**
      * Dumps any method with the given name in the given file.
      *
-     * @param dex non-null; the dex file
-     * @param fqName non-null; the fully-qualified name of the method(s)
-     * @param out non-null; where to dump to
+     * @param dex {@code non-null;} the dex file
+     * @param fqName {@code non-null;} the fully-qualified name of the method(s)
+     * @param out {@code non-null;} where to dump to
      */
     private static void dumpMethod(DexFile dex, String fqName,
             OutputStreamWriter out) {
@@ -719,36 +719,36 @@ public class Main {
         /** whether we are constructing a core library */
         public boolean coreLibrary = false;
 
-        /** null-ok; particular method to dump */
+        /** {@code null-ok;} particular method to dump */
         public String methodToDump = null;
 
         /** max width for columnar output */
         public int dumpWidth = 0;
 
-        /** null-ok; output file name for binary file */
+        /** {@code null-ok;} output file name for binary file */
         public String outName = null;
 
-        /** null-ok; output file name for human-oriented dump */
+        /** {@code null-ok;} output file name for human-oriented dump */
         public String humanOutName = null;
 
         /** whether strict file-name-vs-class-name checking should be done */
         public boolean strictNameCheck = true;
 
         /**
-         * whether it is okay for there to be no <code>.class</code> files
+         * whether it is okay for there to be no {@code .class} files
          * to process
          */
         public boolean emptyOk = false;
 
         /**
-         * whether the binary output is to be a <code>.jar</code> file
-         * instead of a plain <code>.dex</code>
+         * whether the binary output is to be a {@code .jar} file
+         * instead of a plain {@code .dex}
          */
         public boolean jarOutput = false;
 
         /**
-         * when writing a <code>.jar</code> file, whether to still
-         * keep the <code>.class</code> files
+         * when writing a {@code .jar} file, whether to still
+         * keep the {@code .class} files
          */
         public boolean keepClassesInJar = false;
 
@@ -758,7 +758,7 @@ public class Main {
         /** whether to keep local variable information */
         public boolean localInfo = true;
 
-        /** non-null after {@link #parse}; file name arguments */
+        /** {@code non-null after {@link #parse};} file name arguments */
         public String[] fileNames;
 
         /** whether to do SSA/register optimization */
@@ -779,7 +779,7 @@ public class Main {
         /**
          * Parses the given command-line arguments.
          *
-         * @param args non-null; the arguments
+         * @param args {@code non-null;} the arguments
          */
         public void parse(String[] args) {
             int at = 0;
index f4a8dee..d2c1e13 100644 (file)
@@ -34,21 +34,21 @@ import java.io.StringWriter;
  */
 public abstract class BaseDumper
         implements ParseObserver {
-    /** non-null; array of data being dumped */
+    /** {@code non-null;} array of data being dumped */
     private final byte[] bytes;
 
     /** whether or not to include the raw bytes (in a column on the left) */
     private final boolean rawBytes;
 
-    /** non-null; where to dump to */
+    /** {@code non-null;} where to dump to */
     private final PrintStream out;
 
     /** width of the output in columns */
     private final int width;
 
     /**
-     * non-null; the file path for the class, excluding any base directory
-     * specification 
+     * {@code non-null;} the file path for the class, excluding any base
+     * directory specification 
      */
     private final String filePath;
 
@@ -61,7 +61,7 @@ public abstract class BaseDumper
     /** the current level of indentation */
     private int indent;
 
-    /** non-null; the current column separator string */
+    /** {@code non-null;} the current column separator string */
     private String separator;
 
     /** the offset of the next byte to dump */
@@ -73,10 +73,9 @@ public abstract class BaseDumper
     /**
      * Constructs an instance.
      * 
-     * @param bytes non-null; bytes of the (alleged) class file
+     * @param bytes {@code non-null;} bytes of the (alleged) class file
      * on the left)
-     * @param out non-null; where to dump to
-     * passed in as &lt;= 0
+     * @param out {@code non-null;} where to dump to
      * @param filePath the file path for the class, excluding any base
      * directory specification
      */
@@ -109,7 +108,8 @@ public abstract class BaseDumper
      * @return width in register-units
      */
     static int computeParamWidth(ConcreteMethod meth, boolean isStatic) {
-        return meth.getEffectiveDescriptor().getParameterTypes().getWordCount();
+        return meth.getEffectiveDescriptor().getParameterTypes().
+            getWordCount();
     }
 
     /** {@inheritDoc} */
@@ -158,7 +158,7 @@ public abstract class BaseDumper
      * Gets the current dump cursor (that is, the offset of the expected
      * next byte to dump).
      * 
-     * @return &gt;= 0; the dump cursor
+     * @return {@code >= 0;} the dump cursor
      */
     protected final int getAt() {
         return at;
@@ -167,17 +167,17 @@ public abstract class BaseDumper
     /**
      * Sets the dump cursor to the indicated offset in the given array.
      * 
-     * @param arr non-null; array in question
-     * @param offset &gt;= 0; offset into the array
+     * @param arr {@code non-null;} array in question
+     * @param offset {@code >= 0;} offset into the array
      */
     protected final void setAt(ByteArray arr, int offset) {
         at = arr.underlyingOffset(offset, bytes);
     }
 
     /**
-     * Gets the array of <code>byte</code>s to process.
+     * Gets the array of {@code byte}s to process.
      * 
-     * @return non-null; the bytes
+     * @return {@code non-null;} the bytes
      */
     protected final byte[] getBytes() {
         return bytes;
@@ -186,7 +186,7 @@ public abstract class BaseDumper
     /**
      * Gets the filesystem/jar path of the file being dumped.
      * 
-     * @return non-null; the path
+     * @return {@code non-null;} the path
      */
     protected final String getFilePath() {
         return filePath;
@@ -204,7 +204,7 @@ public abstract class BaseDumper
     /**
      * Prints the given string to this instance's output stream.
      * 
-     * @param s null-ok; string to print
+     * @param s {@code null-ok;} string to print
      */
     protected final void print(String s) {
         out.print(s);
@@ -214,7 +214,7 @@ public abstract class BaseDumper
      * Prints the given string to this instance's output stream, followed
      * by a newline.
      * 
-     * @param s null-ok; string to print
+     * @param s {@code null-ok;} string to print
      */
     protected final void println(String s) {
         out.println(s);
@@ -230,10 +230,10 @@ public abstract class BaseDumper
     }
 
     /**
-     * Gets the width of the first column of output. This is <code>0</code>
+     * Gets the width of the first column of output. This is {@code 0}
      * unless raw bytes are being included in the output.
      * 
-     * @return &gt;= 0; the width of the first column
+     * @return {@code >= 0;} the width of the first column
      */
     protected final int getWidth1() {
         if (rawBytes) {
@@ -246,7 +246,7 @@ public abstract class BaseDumper
     /**
      * Gets the width of the second column of output.
      * 
-     * @return &gt;= 0; the width of the second column
+     * @return {@code >= 0;} the width of the second column
      */
     protected final int getWidth2() {
         int w1 = rawBytes ? (getWidth1() + 1) : 0;
@@ -258,7 +258,7 @@ public abstract class BaseDumper
      * 
      * @param offset offset to start dumping at
      * @param len length to dump
-     * @return non-null; the dump
+     * @return {@code non-null;} the dump
      */
     protected final String hexDump(int offset, int len) {
         return Hex.dump(bytes, offset, len, offset, hexCols, 4);
@@ -268,9 +268,9 @@ 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 non-null; the first column's string
-     * @param s2 non-null; the second column's string
-     * @return non-null; the combined output
+     * @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
      */
     protected final String twoColumns(String s1, String s2) {
         int w1 = getWidth1();
index 0be2fb4..a4b3993 100644 (file)
@@ -54,12 +54,12 @@ public class BlockDumper
     private boolean rop;
 
     /**
-     * null-ok; the class file object being constructed; becomes non-null
-     * during {@link #dump} 
+     * {@code null-ok;} the class file object being constructed;
+     * becomes non-null during {@link #dump} 
      */
     protected DirectClassFile classFile;
 
-    /** null-ok; most recently parsed code attribute */
+    /** {@code null-ok;} most recently parsed code attribute */
     private AttCode codeAtt;
 
     /** whether or not to suppress dumping */
@@ -75,9 +75,8 @@ public class BlockDumper
      * Dumps the given array, interpreting it as a class file and dumping
      * methods with indications of block-level stuff.
      * 
-     * @param bytes non-null; bytes of the (alleged) class file
-     * @param out non-null; where to dump to
-     * passed in as &lt;= 0
+     * @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
      * directory specification
      * @param rop whether or not to registerize (make rop blocks)
@@ -208,7 +207,7 @@ public class BlockDumper
     /**
      * Does a regular basic block dump.
      * 
-     * @param meth non-null; method data to dump
+     * @param meth {@code non-null;} method data to dump
      */
     private void regularDump(ConcreteMethod meth) {
         BytecodeArray code = meth.getCode();
@@ -283,7 +282,7 @@ public class BlockDumper
     /**
      * Does a registerizing dump.
      * 
-     * @param meth non-null; method data to dump
+     * @param meth {@code non-null;} method data to dump
      */
     private void ropDump(ConcreteMethod meth) {
         BytecodeArray code = meth.getCode();
index 10dacf3..e98b6d6 100644 (file)
@@ -30,8 +30,8 @@ public final class ClassDumper
     /**
      * Dumps the given array, interpreting it as a class file.
      *
-     * @param bytes non-null; bytes of the (alleged) class file
-     * @param out non-null; where to dump to
+     * @param bytes {@code non-null;} bytes of the (alleged) class file
+     * @param out {@code non-null;} where to dump to
      * passed in as &lt;= 0
      * @param filePath the file path for the class, excluding any base
      * directory specification
index 87c5298..9de48fc 100644 (file)
@@ -39,16 +39,15 @@ import com.android.dx.util.IntList;
  * with the popular graph utility "dot".
  */
 public class DotDumper implements ParseObserver {
+    private DirectClassFile classFile;
 
-    DirectClassFile classFile;
+    private final byte[] bytes;
+    private final String filePath;
+    private final boolean strictParse;
+    private final boolean optimize;
+    private final Args args;
 
-    byte[] bytes;
-    String filePath;
-    boolean strictParse;
-    boolean optimize;
-    Args args;
-
-    static void dump (byte[] bytes, String filePath, Args args) {
+    static void dump(byte[] bytes, String filePath, Args args) {
         new DotDumper(bytes, filePath, args).run();
     }
 
@@ -60,7 +59,6 @@ public class DotDumper implements ParseObserver {
         this.args = args;
     }
 
-
     private void run() {
         ByteArray ba = new ByteArray(bytes);
 
@@ -89,17 +87,17 @@ public class DotDumper implements ParseObserver {
     }
 
     public void changeIndent(int indentDelta) {
-
+        // This space intentionally left blank.
     }
 
     public void parsed(ByteArray bytes, int offset, int len, String human) {
-        
+        // This space intentionally left blank.
     }
 
     /** {@inheritDoc} */
     public void startParsingMember(ByteArray bytes, int offset, String name,
                                    String descriptor) {
-
+        // This space intentionally left blank.
     }
 
     public void endParsingMember(ByteArray bytes, int offset, String name,
@@ -165,6 +163,5 @@ public class DotDumper implements ParseObserver {
         }
 
         System.out.println("}");
-
     }
 }
index 1ea26bc..d6ba374 100644 (file)
@@ -110,8 +110,8 @@ public class Main {
     /**
      * Processes one file.
      *
-     * @param name non-null; name of the file
-     * @param bytes non-null; contents of the file
+     * @param name {@code non-null;} name of the file
+     * @param bytes {@code non-null;} contents of the file
      */
     private static void processOne(String name, byte[] bytes) {
         if (parsedArgs.dotDump) {
index 95442a1..e3dad46 100644 (file)
@@ -40,29 +40,48 @@ import com.android.dx.util.Hex;
 import com.android.dx.util.IntList;
 
 import java.io.PrintStream;
+import java.util.ArrayList;
 import java.util.BitSet;
+import java.util.Collections;
 import java.util.EnumSet;
 
+/**
+ * Dumper for the SSA-translated blocks of a method.
+ */
 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
+     * directory specification
+     * @param args commandline parsedArgs
+     */
     public static void dump(byte[] bytes, PrintStream out,
             String filePath, Args args) {
-
-        SsaDumper sd =
-            new SsaDumper(bytes, out, filePath, args);
+        SsaDumper sd = new SsaDumper(bytes, out, filePath, args);
         sd.dump();
     }
 
-    SsaDumper(byte[] bytes, PrintStream out, String filePath, Args args) {
-
+    /**
+     * 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
+     * directory specification
+     * @param args commandline parsedArgs
+     */
+    private SsaDumper(byte[] bytes, PrintStream out, String filePath,
+            Args args) {
         super(bytes, out, filePath, true, args);
-
     }
 
     /** {@inheritDoc} */
     @Override
     public void endParsingMember(ByteArray bytes, int offset, String name,
-                                 String descriptor, Member member) {
+            String descriptor, Member member) {
         if (!(member instanceof Method)) {
             return;
         }
@@ -71,17 +90,14 @@ public class SsaDumper extends BlockDumper {
             return;
         }
 
-        ConcreteMethod meth = new ConcreteMethod((Method) member, classFile,
-                                                 true, true);
-
+        ConcreteMethod meth =
+            new ConcreteMethod((Method) member, classFile, true, true);
         TranslationAdvice advice = DexTranslationAdvice.THE_ONE;
-
         RopMethod rmeth = Ropper.convert(meth, advice);
-
         SsaMethod ssaMeth = null;
-
         boolean isStatic = AccessFlags.isStatic(meth.getAccessFlags());
         int paramWidth = computeParamWidth(meth, isStatic);
+
         if (args.ssaStep == null) {
             ssaMeth = Optimizer.debugNoRegisterAllocation(rmeth,
                     paramWidth, isStatic, true, advice,
@@ -106,21 +122,26 @@ public class SsaDumper extends BlockDumper {
         sb.append(Hex.u2(
                 ssaMeth.blockIndexToRopLabel(ssaMeth.getEntryBlockIndex())));
         sb.append('\n');
+
+        ArrayList<SsaBasicBlock> blocks = ssaMeth.getBlocks();
+        ArrayList<SsaBasicBlock> sortedBlocks = 
+            (ArrayList<SsaBasicBlock>) blocks.clone();
+        Collections.sort(sortedBlocks, SsaBasicBlock.LABEL_COMPARATOR);
         
-        for (SsaBasicBlock block : ssaMeth.getBlocks()) {
+        for (SsaBasicBlock block : sortedBlocks) {
             sb.append("block ")
                     .append(Hex.u2(block.getRopLabel())).append('\n');
 
             BitSet preds = block.getPredecessors();
 
             for(int i=preds.nextSetBit(0); i>=0; i=preds.nextSetBit(i+1)) {
-                sb.append ("  pred ");
-                sb.append (Hex.u2(ssaMeth.blockIndexToRopLabel(i)));
+                sb.append("  pred ");
+                sb.append(Hex.u2(ssaMeth.blockIndexToRopLabel(i)));
                 sb.append('\n');
             }
 
-            sb.append ("  live in:" + block.getLiveInRegs());
-            sb.append ("\n");
+            sb.append("  live in:" + block.getLiveInRegs());
+            sb.append("\n");
 
             for (SsaInsn insn: block.getInsns()) {
                 sb.append("  ");
@@ -129,7 +150,7 @@ public class SsaDumper extends BlockDumper {
             }
 
             if (block.getSuccessors().cardinality() == 0) {
-                sb.append ("  returns\n");
+                sb.append("  returns\n");
             } else {
                 int primary = block.getPrimarySuccessorRopLabel();
 
@@ -138,18 +159,18 @@ public class SsaDumper extends BlockDumper {
                 int szSuccLabels = succLabelList.size();
 
                 for (int i = 0; i < szSuccLabels; i++) {
-                    sb.append ("  next ");
-                    sb.append (Hex.u2(succLabelList.get(i)));
+                    sb.append("  next ");
+                    sb.append(Hex.u2(succLabelList.get(i)));
 
                     if (szSuccLabels != 1 && primary == succLabelList.get(i)) {
-                        sb.append (" *");                        
+                        sb.append(" *");                        
                     }
                     sb.append('\n');
                 }
             }
 
-            sb.append ("  live out:" + block.getLiveOutRegs());
-            sb.append ("\n");
+            sb.append("  live out:" + block.getLiveOutRegs());
+            sb.append("\n");
         }
 
         suppressDump = false;
index dab15c9..cdd29d7 100644 (file)
@@ -51,7 +51,7 @@ import java.util.ArrayList;
 
 /**
  * Utility methods that translate various classfile attributes
- * into forms suitable for use in creating <code>dex</code> files.
+ * into forms suitable for use in creating {@code dex} files.
  */
 /*package*/ class AttributeTranslator {
     /**
@@ -64,8 +64,8 @@ import java.util.ArrayList;
     /**
      * Gets the list of thrown exceptions for a given method.
      *
-     * @param method non-null; the method in question
-     * @return non-null; the list of thrown exceptions
+     * @param method {@code non-null;} the method in question
+     * @return {@code non-null;} the list of thrown exceptions
      */
     public static TypeList getExceptions(Method method) {
         AttributeList attribs = method.getAttributes();
@@ -83,10 +83,10 @@ import java.util.ArrayList;
      * Gets the annotations out of a given {@link AttributeList}. This
      * combines both visible and invisible annotations into a single
      * result set and also adds in a system annotation for the
-     * <code>Signature</code> attribute if present.
+     * {@code Signature} attribute if present.
      * 
-     * @param attribs non-null; the attributes list to search in
-     * @return non-null; the set of annotations, which may be empty
+     * @param attribs {@code non-null;} the attributes list to search in
+     * @return {@code non-null;} the set of annotations, which may be empty
      */
     public static Annotations getAnnotations(AttributeList attribs) {
         Annotations result = getAnnotations0(attribs);
@@ -102,15 +102,15 @@ import java.util.ArrayList;
     /**
      * Gets the annotations out of a given class, similar to {@link
      * #getAnnotations}, also including annotations for translations
-     * of class-level attributes <code>EnclosingMethod</code> and
-     * <code>InnerClasses</code>, if present. Additionally, if the
+     * of class-level attributes {@code EnclosingMethod} and
+     * {@code InnerClasses}, if present. Additionally, if the
      * class is an annotation class, then this also includes a
-     * representation of all the <code>AnnotationDefault</code>
+     * representation of all the {@code AnnotationDefault}
      * values.
      * 
-     * @param cf non-null; the class in question
-     * @param args non-null; the high-level options
-     * @return non-null; the set of annotations, which may be empty
+     * @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
      */
     public static Annotations getClassAnnotations(DirectClassFile cf,
             CfOptions args) {
@@ -148,10 +148,10 @@ 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</code>.
+     * of the method-specific attribute {@code Exceptions}.
      * 
-     * @param method non-null; the method in question
-     * @return non-null; the set of annotations, which may be empty
+     * @param method {@code non-null;} the method in question
+     * @return {@code non-null;} the set of annotations, which may be empty
      */
     public static Annotations getMethodAnnotations(Method method) {
         Annotations result = getAnnotations(method.getAttributes());
@@ -170,8 +170,8 @@ import java.util.ArrayList;
      * Helper method for {@link #getAnnotations} which just gets the
      * existing annotations, per se.
      * 
-     * @param attribs non-null; the attributes list to search in
-     * @return non-null; the set of annotations, which may be empty
+     * @param attribs {@code non-null;} the attributes list to search in
+     * @return {@code non-null;} the set of annotations, which may be empty
      */
     private static Annotations getAnnotations0(AttributeList attribs) {
         AttRuntimeVisibleAnnotations visible =
@@ -199,11 +199,11 @@ import java.util.ArrayList;
     }
 
     /**
-     * Gets the <code>Signature</code> attribute out of a given
+     * Gets the {@code Signature} attribute out of a given
      * {@link AttributeList}, if any, translating it to an annotation.
      * 
-     * @param attribs non-null; the attributes list to search in
-     * @return null-ok; the converted <code>Signature</code> 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
      */
     private static Annotation getSignature(AttributeList attribs) {
@@ -218,15 +218,15 @@ import java.util.ArrayList;
     }
 
     /**
-     * Gets the <code>EnclosingMethod</code> attribute out of a given
+     * Gets the {@code EnclosingMethod} attribute out of a given
      * {@link AttributeList}, if any, translating it to an annotation.
      * If the class really has an enclosing method, this returns an
-     * <code>EnclosingMethod</code> annotation; if not, this returns
-     * an <code>EnclosingClass</code> annotation.
+     * {@code EnclosingMethod} annotation; if not, this returns
+     * an {@code EnclosingClass} annotation.
      * 
-     * @param attribs non-null; the attributes list to search in
-     * @return null-ok; the converted <code>EnclosingMethod</code> or
-     * <code>EnclosingClass</code> annotation, if there was an
+     * @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
      * attribute to translate
      */
     private static Annotation translateEnclosingMethod(AttributeList attribs) {
@@ -256,16 +256,16 @@ import java.util.ArrayList;
     }
 
     /**
-     * Gets the <code>InnerClasses</code> attribute out of a given
+     * Gets the {@code InnerClasses} attribute out of a given
      * {@link AttributeList}, if any, translating it to one or more of an
-     * <code>InnerClass</code>, <code>EnclosingClass</code>, or
-     * <code>MemberClasses</code> annotation.
+     * {@code InnerClass}, {@code EnclosingClass}, or
+     * {@code MemberClasses} annotation.
      * 
-     * @param thisClass non-null; type representing the class being processed
-     * @param attribs non-null; the attributes list to search in
+     * @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
-     * <code>EnclosingClass</code> annotation
-     * @return null-ok; the converted list of annotations, if there
+     * {@code EnclosingClass} annotation
+     * @return {@code null-ok;} the converted list of annotations, if there
      * was an attribute to translate
      */
     private static Annotations translateInnerClasses(CstType thisClass,
@@ -342,8 +342,8 @@ import java.util.ArrayList;
      * combines both visible and invisible annotations into a single
      * result set.
      * 
-     * @param method non-null; the method in question
-     * @return non-null; the list of annotation sets, which may be empty
+     * @param method {@code non-null;} the method in question
+     * @return {@code non-null;} the list of annotation sets, which may be empty
      */
     public static AnnotationsList getParameterAnnotations(Method method) {
         AttributeList attribs = method.getAttributes();
@@ -374,14 +374,14 @@ import java.util.ArrayList;
     }
 
     /**
-     * Gets the <code>AnnotationDefault</code> attributes out of a
+     * Gets the {@code AnnotationDefault} attributes out of a
      * given class, if any, reforming them as an
-     * <code>AnnotationDefault</code> annotation.
+     * {@code AnnotationDefault} annotation.
      * 
-     * @param cf non-null; the class in question
-     * @return null-ok; an appropriately-constructed
-     * <code>AnnotationDefault</code> annotation, if there were any
-     * annotation defaults in the class, or <code>null<code> if not
+     * @param cf {@code non-null;} the class in question
+     * @return {@code null-ok;} an appropriately-constructed
+     * {@code AnnotationDefault} annotation, if there were any
+     * annotation defaults in the class, or {@code null} if not
      */
     private static Annotation translateAnnotationDefaults(DirectClassFile cf) {
         CstType thisClass = cf.getThisClass();
index c48be53..8210e90 100644 (file)
@@ -55,11 +55,11 @@ import com.android.dx.ssa.Optimizer;
 import com.android.dx.util.ExceptionWithContext;
 
 /**
- * Static method that turns <code>byte[]</code>s containing Java
+ * Static method that turns {@code byte[]}s containing Java
  * classfiles into {@link ClassDefItem} instances.
  */
 public class CfTranslator {
-    /** set to <code>true</code> to enable development-time debugging code */
+    /** set to {@code true} to enable development-time debugging code */
     private static final boolean DEBUG = false;
 
     /**
@@ -70,14 +70,14 @@ public class CfTranslator {
     }
 
     /**
-     * Takes a <code>byte[]</code>, interprets it as a Java classfile, and
+     * Takes a {@code byte[]}, interprets it as a Java classfile, and
      * translates it into a {@link ClassDefItem}.
      *
-     * @param filePath non-null; the file path for the class,
+     * @param filePath {@code non-null;} the file path for the class,
      * excluding any base directory specification
-     * @param bytes non-null; contents of the file
+     * @param bytes {@code non-null;} contents of the file
      * @param args command-line arguments
-     * @return non-null; the translated class
+     * @return {@code non-null;} the translated class
      */
     public static ClassDefItem translate(String filePath, byte[] bytes,
             CfOptions args) {
@@ -94,11 +94,11 @@ public class CfTranslator {
      * from {@link #translate} just to keep things a bit simpler in
      * terms of exception handling.
      *
-     * @param filePath non-null; the file path for the class,
+     * @param filePath {@code non-null;} the file path for the class,
      * excluding any base directory specification
-     * @param bytes non-null; contents of the file
+     * @param bytes {@code non-null;} contents of the file
      * @param args command-line arguments
-     * @return non-null; the translated class
+     * @return {@code non-null;} the translated class
      */
     private static ClassDefItem translate0(String filePath, byte[] bytes,
             CfOptions args) {
@@ -136,8 +136,8 @@ public class CfTranslator {
     /**
      * Processes the fields of the given class.
      *
-     * @param cf non-null; class being translated
-     * @param out non-null; output class
+     * @param cf {@code non-null;} class being translated
+     * @param out {@code non-null;} output class
      */
     private static void processFields(DirectClassFile cf, ClassDefItem out) {
         CstType thisClass = cf.getThisClass();
@@ -179,8 +179,8 @@ public class CfTranslator {
      * Helper for {@link #processFields}, which translates constants into
      * more specific types if necessary.
      * 
-     * @param constant non-null; the constant in question
-     * @param type non-null; the desired type
+     * @param constant {@code non-null;} the constant in question
+     * @param type {@code non-null;} the desired type
      */
     private static TypedConstant coerceConstant(TypedConstant constant,
             Type type) {
@@ -213,9 +213,9 @@ public class CfTranslator {
     /**
      * Processes the methods of the given class.
      *
-     * @param cf non-null; class being translated
-     * @param args non-null; command-line args
-     * @param out non-null; output class
+     * @param cf {@code non-null;} class being translated
+     * @param args {@code non-null;} command-line args
+     * @param out {@code non-null;} output class
      */
     private static void processMethods(DirectClassFile cf,
             CfOptions args, ClassDefItem out) {
index fa83100..b692d77 100644 (file)
@@ -26,7 +26,7 @@ import java.io.PrintStream;
  * code.
  */
 public final class CodeStatistics {
-    /** set to <code>true</code> to enable development-time debugging code */
+    /** set to {@code true} to enable development-time debugging code */
     private static final boolean DEBUG = false;
 
     /**
@@ -76,7 +76,7 @@ public final class CodeStatistics {
     /**
      * Updates the number of original bytecode bytes processed.
      * 
-     * @param count &gt;= 0; the number of bytes to add
+     * @param count {@code >= 0;} the number of bytes to add
      */
     public static void updateOriginalByteCount(int count) {
         runningOriginalBytes += count;
@@ -146,7 +146,7 @@ public final class CodeStatistics {
     /**
      * Prints out the collected statistics.
      * 
-     * @param out non-null; where to output to
+     * @param out {@code non-null;} where to output to
      */
     public static void dumpStatistics(PrintStream out) {
         out.printf("Optimizer Delta Rop Insns: %d total: %d "
index 1dc3f76..0108a7f 100644 (file)
@@ -31,13 +31,13 @@ import java.util.HashSet;
  */
 public class OptimizerOptions {
     /**
-     * null-ok; hash set of class name + method names that should be optimized.
+     * {@code null-ok;} hash set of class name + method names that should be optimized.
      * null if this constraint was not specified on the command line
      */
     private static HashSet<String> optimizeList;
 
     /**
-     * null-ok; hash set of class name + method names that should NOT
+     * {@code null-ok;} hash set of class name + method names that should NOT
      * be optimized.  null if this constraint was not specified on the
      * command line
      */
@@ -118,12 +118,12 @@ public class OptimizerOptions {
      * Compares the output of the optimizer run normally with a run skipping
      * some optional steps. Results are printed to stderr.
      *
-     * @param nonOptRmeth non-null; origional rop method
-     * @param paramSize &gt;= 0 parameter size of method
+     * @param nonOptRmeth {@code non-null;} origional rop method
+     * @param paramSize {@code >= 0;} parameter size of method
      * @param isStatic true if this method has no 'this' pointer argument.
-     * @param args non-null; translator arguments
-     * @param advice non-null; translation advice
-     * @param rmeth non-null; method with all optimization steps run.
+     * @param args {@code non-null;} translator arguments
+     * @param advice {@code non-null;} translation advice
+     * @param rmeth {@code non-null;} method with all optimization steps run.
      */
     public static void compareOptimizerStep(RopMethod nonOptRmeth,
             int paramSize, boolean isStatic, CfOptions args,
index 8476a03..30baa5a 100644 (file)
@@ -29,12 +29,12 @@ import java.util.ArrayList;
  */
 public final class ArrayData extends VariableSizeInsn {
     /**
-     * non-null; address representing the instruction that uses this
+     * {@code non-null;} address representing the instruction that uses this
      * instance 
      */
     private final CodeAddress user;
 
-    /** non-null; initial values to be filled into an array */
+    /** {@code non-null;} initial values to be filled into an array */
     private final ArrayList<Constant> values;
 
     /** non-null: type of constant that initializes the array */
@@ -48,12 +48,12 @@ public final class ArrayData extends VariableSizeInsn {
 
     /**
      * Constructs an instance. The output address of this instance is initially
-     * unknown (<code>-1</code>).
+     * unknown ({@code -1}).
      * 
-     * @param position non-null; source position
-     * @param user non-null; address representing the instruction that
+     * @param position {@code non-null;} source position
+     * @param user {@code non-null;} address representing the instruction that
      * uses this instance
-     * @param values non-null; initial values to be filled into an array
+     * @param values {@code non-null;} initial values to be filled into an array
      */
     public ArrayData(SourcePosition position, CodeAddress user,
                      ArrayList<Constant> values,
index 9fea66c..e55f893 100644 (file)
@@ -28,15 +28,15 @@ import com.android.dx.rop.code.SourcePosition;
  * start address, end address, and last instruction address.
  */
 public final class BlockAddresses {
-    /** non-null; array containing addresses for the start of each basic
+    /** {@code non-null;} array containing addresses for the start of each basic
      * block (indexed by basic block label) */
     private final CodeAddress[] starts;
 
-    /** non-null; array containing addresses for the final instruction
+    /** {@code non-null;} array containing addresses for the final instruction
      * of each basic block (indexed by basic block label) */
     private final CodeAddress[] lasts;
 
-    /** non-null; array containing addresses for the end (just past the
+    /** {@code non-null;} array containing addresses for the end (just past the
      * final instruction) of each basic block (indexed by basic block
      * label) */
     private final CodeAddress[] ends;
@@ -44,7 +44,7 @@ public final class BlockAddresses {
     /**
      * Constructs an instance.
      *
-     * @param method non-null; the method to have block addresses for
+     * @param method {@code non-null;} the method to have block addresses for
      */
     public BlockAddresses(RopMethod method) {
         BasicBlockList blocks = method.getBlocks();
@@ -60,8 +60,8 @@ public final class BlockAddresses {
     /**
      * Gets the instance for the start of the given block.
      * 
-     * @param block non-null; the block in question
-     * @return non-null; the appropriate instance
+     * @param block {@code non-null;} the block in question
+     * @return {@code non-null;} the appropriate instance
      */
     public CodeAddress getStart(BasicBlock block) {
         return starts[block.getLabel()];
@@ -70,8 +70,8 @@ public final class BlockAddresses {
     /**
      * Gets the instance for the start of the block with the given label.
      * 
-     * @param label non-null; the label of the block in question
-     * @return non-null; the appropriate instance
+     * @param label {@code non-null;} the label of the block in question
+     * @return {@code non-null;} the appropriate instance
      */
     public CodeAddress getStart(int label) {
         return starts[label];
@@ -80,8 +80,8 @@ public final class BlockAddresses {
     /**
      * Gets the instance for the final instruction of the given block.
      * 
-     * @param block non-null; the block in question
-     * @return non-null; the appropriate instance
+     * @param block {@code non-null;} the block in question
+     * @return {@code non-null;} the appropriate instance
      */
     public CodeAddress getLast(BasicBlock block) {
         return lasts[block.getLabel()];
@@ -91,8 +91,8 @@ public final class BlockAddresses {
      * Gets the instance for the final instruction of the block with
      * the given label.
      * 
-     * @param label non-null; the label of the block in question
-     * @return non-null; the appropriate instance
+     * @param label {@code non-null;} the label of the block in question
+     * @return {@code non-null;} the appropriate instance
      */
     public CodeAddress getLast(int label) {
         return lasts[label];
@@ -102,8 +102,8 @@ public final class BlockAddresses {
      * Gets the instance for the end (address after the final instruction)
      * of the given block.
      * 
-     * @param block non-null; the block in question
-     * @return non-null; the appropriate instance
+     * @param block {@code non-null;} the block in question
+     * @return {@code non-null;} the appropriate instance
      */
     public CodeAddress getEnd(BasicBlock block) {
         return ends[block.getLabel()];
@@ -113,8 +113,8 @@ public final class BlockAddresses {
      * Gets the instance for the end (address after the final instruction)
      * of the block with the given label.
      * 
-     * @param label non-null; the label of the block in question
-     * @return non-null; the appropriate instance
+     * @param label {@code non-null;} the label of the block in question
+     * @return {@code non-null;} the appropriate instance
      */
     public CodeAddress getEnd(int label) {
         return ends[label];
index 8bc963b..d2ec3d7 100644 (file)
@@ -27,7 +27,7 @@ public interface CatchBuilder {
     /**
      * Builds and returns the catch table for this instance.
      * 
-     * @return non-null; the constructed table
+     * @return {@code non-null;} the constructed table
      */
     public CatchTable build();
 
@@ -42,7 +42,7 @@ public interface CatchBuilder {
     /**
      * Gets the set of catch types associated with this instance.
      * 
-     * @return non-null; the set of catch types
+     * @return {@code non-null;} the set of catch types
      */
     public HashSet<Type> getCatchTypes();
 }
index 862586c..a8a97be 100644 (file)
@@ -25,13 +25,13 @@ import com.android.dx.util.Hex;
  */
 public final class CatchHandlerList extends FixedSizeList
         implements Comparable<CatchHandlerList> {
-    /** non-null; empty instance */
+    /** {@code non-null;} empty instance */
     public static final CatchHandlerList EMPTY = new CatchHandlerList(0);
 
     /**
-     * Constructs an instance. All indices initially contain <code>null</code>.
+     * Constructs an instance. All indices initially contain {@code null}.
      *
-     * @param size &gt;= 0; the size of the list
+     * @param size {@code >= 0;} the size of the list
      */
     public CatchHandlerList(int size) {
         super(size);
@@ -40,10 +40,10 @@ public final class CatchHandlerList 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</code>.
+     * do that, this will throw {@code NullPointerException}.
      *
-     * @param n &gt;= 0, &lt; size(); which index
-     * @return non-null; element at that index
+     * @param n {@code >= 0, < size();} which index
+     * @return {@code non-null;} element at that index
      */
     public Entry get(int n) {
         return (Entry) get0(n);
@@ -58,10 +58,10 @@ public final class CatchHandlerList extends FixedSizeList
      * Get the human form of this instance, prefixed on each line
      * with the string.
      * 
-     * @param prefix non-null; the prefix for every line
-     * @param header non-null; the header for the first line (after the
+     * @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)
-     * @return non-null; the human form
+     * @return {@code non-null;} the human form
      */
     public String toHuman(String prefix, String header) {
         StringBuilder sb = new StringBuilder(100);
@@ -97,8 +97,8 @@ public final class CatchHandlerList extends FixedSizeList
      * Returns whether or not this instance ends with a "catch-all"
      * handler.
      * 
-     * @return <code>true</code> if this instance ends with a "catch-all"
-     * handler or <code>false</code> if not
+     * @return {@code true} if this instance ends with a "catch-all"
+     * handler or {@code false} if not
      */
     public boolean catchesAll() {
         int size = size();
@@ -114,9 +114,9 @@ public final class CatchHandlerList extends FixedSizeList
     /**
      * Sets the entry at the given index.
      *
-     * @param n &gt;= 0, &lt; size(); which index
-     * @param exceptionType non-null; type of exception handled
-     * @param handler &gt;= 0; exception handler address
+     * @param n {@code >= 0, < size();} which index
+     * @param exceptionType {@code non-null;} type of exception handled
+     * @param handler {@code >= 0;} exception handler address
      */
     public void set(int n, CstType exceptionType, int handler) {
         set0(n, new Entry(exceptionType, handler));
@@ -125,8 +125,8 @@ public final class CatchHandlerList extends FixedSizeList
     /**
      * Sets the entry at the given index.
      *
-     * @param n &gt;= 0, &lt; size(); which index
-     * @param entry non-null; the entry to set at <code>n</code>
+     * @param n {@code >= 0, < size();} which index
+     * @param entry {@code non-null;} the entry to set at {@code n}
      */
     public void set(int n, Entry entry) {
         set0(n, entry);
@@ -165,17 +165,17 @@ public final class CatchHandlerList extends FixedSizeList
      * Entry in the list.
      */
     public static class Entry implements Comparable<Entry> {
-        /** non-null; type of exception handled */
+        /** {@code non-null;} type of exception handled */
         private final CstType exceptionType;
 
-        /** &gt;= 0; exception handler address */
+        /** {@code >= 0;} exception handler address */
         private final int handler;
 
         /**
          * Constructs an instance.
          *
-         * @param exceptionType non-null; type of exception handled
-         * @param handler &gt;= 0; exception handler address
+         * @param exceptionType {@code non-null;} type of exception handled
+         * @param handler {@code >= 0;} exception handler address
          */
         public Entry(CstType exceptionType, int handler) {
             if (handler < 0) {
@@ -220,7 +220,7 @@ public final class CatchHandlerList extends FixedSizeList
         /**
          * Gets the exception type handled.
          * 
-         * @return non-null; the exception type
+         * @return {@code non-null;} the exception type
          */
         public CstType getExceptionType() {
             return exceptionType;
@@ -229,7 +229,7 @@ public final class CatchHandlerList extends FixedSizeList
         /**
          * Gets the handler address.
          * 
-         * @return &gt;= 0; the handler address
+         * @return {@code >= 0;} the handler address
          */
         public int getHandler() {
             return handler;
index 86f9c58..fd8e3a7 100644 (file)
@@ -26,13 +26,13 @@ import com.android.dx.util.FixedSizeList;
  */
 public final class CatchTable extends FixedSizeList
         implements Comparable<CatchTable> {
-    /** non-null; empty instance */
+    /** {@code non-null;} empty instance */
     public static final CatchTable EMPTY = new CatchTable(0);
 
     /**
-     * Constructs an instance. All indices initially contain <code>null</code>.
+     * Constructs an instance. All indices initially contain {@code null}.
      *
-     * @param size &gt;= 0; the size of the table
+     * @param size {@code >= 0;} the size of the table
      */
     public CatchTable(int size) {
         super(size);
@@ -41,10 +41,10 @@ public final class CatchTable 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</code>.
+     * do that, this will throw {@code NullPointerException}.
      *
-     * @param n &gt;= 0, &lt; size(); which index
-     * @return non-null; element at that index
+     * @param n {@code >= 0, < size();} which index
+     * @return {@code non-null;} element at that index
      */
     public Entry get(int n) {
         return (Entry) get0(n);
@@ -53,8 +53,8 @@ public final class CatchTable extends FixedSizeList
     /**
      * Sets the entry at the given index.
      *
-     * @param n &gt;= 0, &lt; size(); which index
-     * @param entry non-null; the entry to set at <code>n</code>
+     * @param n {@code >= 0, < size();} which index
+     * @param entry {@code non-null;} the entry to set at {@code n}
      */
     public void set(int n, Entry entry) {
         set0(n, entry);
@@ -93,21 +93,21 @@ public final class CatchTable extends FixedSizeList
      * Entry in a catch list.
      */
     public static class Entry implements Comparable<Entry> {
-        /** &gt;= 0; start address */
+        /** {@code >= 0;} start address */
         private final int start;
 
-        /** &gt; start; end address (exclusive) */
+        /** {@code > start;} end address (exclusive) */
         private final int end;
 
-        /** non-null; list of catch handlers */
+        /** {@code non-null;} list of catch handlers */
         private final CatchHandlerList handlers;
 
         /**
          * Constructs an instance.
          *
-         * @param start &gt;= 0; start address 
-         * @param end &gt; start; end address (exclusive)
-         * @param handlers non-null; list of catch handlers
+         * @param start {@code >= 0;} start address 
+         * @param end {@code > start;} end address (exclusive)
+         * @param handlers {@code non-null;} list of catch handlers
          */
         public Entry(int start, int end, CatchHandlerList handlers) {
             if (start < 0) {
@@ -165,7 +165,7 @@ public final class CatchTable extends FixedSizeList
         /**
          * Gets the start address.
          * 
-         * @return &gt;= 0; the start address
+         * @return {@code >= 0;} the start address
          */
         public int getStart() {
             return start;
@@ -174,7 +174,7 @@ public final class CatchTable extends FixedSizeList
         /**
          * Gets the end address (exclusive).
          * 
-         * @return &gt; start; the end address (exclusive)
+         * @return {@code > start;} the end address (exclusive)
          */
         public int getEnd() {
             return end;
@@ -183,7 +183,7 @@ public final class CatchTable extends FixedSizeList
         /**
          * Gets the handlers.
          * 
-         * @return non-null; the handlers
+         * @return {@code non-null;} the handlers
          */
         public CatchHandlerList getHandlers() {
             return handlers;
index 9730913..f25718e 100644 (file)
@@ -29,9 +29,9 @@ import com.android.dx.rop.code.SourcePosition;
 public final class CodeAddress extends ZeroSizeInsn {
     /**
      * Constructs an instance. The output address of this instance is initially
-     * unknown (<code>-1</code>).
+     * unknown ({@code -1}).
      * 
-     * @param position non-null; source position
+     * @param position {@code non-null;} source position
      */
     public CodeAddress(SourcePosition position) {
         super(position);
index 1bc9021..a579c5e 100644 (file)
@@ -25,31 +25,31 @@ import com.android.dx.rop.cst.Constant;
  * to all the normal instruction information.
  */
 public final class CstInsn extends FixedSizeInsn {
-    /** non-null; the constant argument for this instruction */
+    /** {@code non-null;} the constant argument for this instruction */
     private final Constant constant;
 
     /**
-     * &gt;= -1; the constant pool index for {@link #constant}, or
-     * <code>-1</code> if not yet set 
+     * {@code >= -1;} the constant pool index for {@link #constant}, or
+     * {@code -1} if not yet set 
      */
     private int index;
 
     /**
-     * &gt;= -1; the constant pool index for the class reference in
-     * {@link #constant} if any, or <code>-1</code> if not yet set 
+     * {@code >= -1;} the constant pool index for the class reference in
+     * {@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</code>) as is the constant pool index.
+     * initially unknown ({@code -1}) as is the constant pool index.
      * 
      * @param opcode the opcode; one of the constants from {@link Dops}
-     * @param position non-null; source position
-     * @param registers non-null; register list, including a
+     * @param position {@code non-null;} source position
+     * @param registers {@code non-null;} register list, including a
      * result register if appropriate (that is, registers may be either
      * ins or outs)
-     * @param constant non-null; constant argument
+     * @param constant {@code non-null;} constant argument
      */
     public CstInsn(Dop opcode, SourcePosition position,
                    RegisterSpecList registers, Constant constant) {
@@ -101,7 +101,7 @@ public final class CstInsn extends FixedSizeInsn {
     /**
      * Gets the constant argument.
      * 
-     * @return non-null; the constant argument
+     * @return {@code non-null;} the constant argument
      */
     public Constant getConstant() {
         return constant;
@@ -111,7 +111,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 &gt;= 0; the constant pool index
+     * @return {@code >= 0;} the constant pool index
      */
     public int getIndex() {
         if (index < 0) {
@@ -126,7 +126,7 @@ public final class CstInsn extends FixedSizeInsn {
      * 
      * @see #setIndex
      * 
-     * @return <code>true</code> iff the index has been set
+     * @return {@code true} iff the index has been set
      */
     public boolean hasIndex() {
         return (index >= 0);
@@ -136,7 +136,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 &gt;= 0; the constant pool index
+     * @param index {@code >= 0;} the constant pool index
      */
     public void setIndex(int index) {
         if (index < 0) {
@@ -154,7 +154,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 &gt;= 0; the constant's class's constant pool index
+     * @return {@code >= 0;} the constant's class's constant pool index
      */
     public int getClassIndex() {
         if (classIndex < 0) {
@@ -170,7 +170,7 @@ public final class CstInsn extends FixedSizeInsn {
      * 
      * @see #setClassIndex
      * 
-     * @return <code>true</code> iff the index has been set
+     * @return {@code true} iff the index has been set
      */
     public boolean hasClassIndex() {
         return (classIndex >= 0);
@@ -183,7 +183,7 @@ public final class CstInsn extends FixedSizeInsn {
      * with reference constants that this method should ever be
      * called. It is only valid to call this method once per instance.
      * 
-     * @param index &gt;= 0; the constant's class's constant pool index
+     * @param index {@code >= 0;} the constant's class's constant pool index
      */
     public void setClassIndex(int index) {
         if (index < 0) {
index cf6af09..f911912 100644 (file)
@@ -23,7 +23,7 @@ import java.util.HashSet;
 
 /**
  * Container for all the pieces of a concrete method. Each instance
- * corresponds to a <code>code</code> structure in a <code>.dex</code> file.
+ * corresponds to a {@code code} structure in a {@code .dex} file.
  */
 public final class DalvCode {
     /**
@@ -33,37 +33,37 @@ public final class DalvCode {
     private final int positionInfo;
 
     /**
-     * null-ok; the instruction list, ready for final processing;
+     * {@code null-ok;} the instruction list, ready for final processing;
      * nulled out in {@link #finishProcessingIfNecessary}
      */
     private OutputFinisher unprocessedInsns;
 
     /**
-     * non-null; unprocessed catch table;
+     * {@code non-null;} unprocessed catch table;
      * nulled out in {@link #finishProcessingIfNecessary}
      */
     private CatchBuilder unprocessedCatches;
 
     /**
-     * null-ok; catch table; set in
+     * {@code null-ok;} catch table; set in
      * {@link #finishProcessingIfNecessary} 
      */
     private CatchTable catches;
 
     /**
-     * null-ok; source positions list; set in
+     * {@code null-ok;} source positions list; set in
      * {@link #finishProcessingIfNecessary} 
      */
     private PositionList positions;
 
     /**
-     * null-ok; local variable list; set in
+     * {@code null-ok;} local variable list; set in
      * {@link #finishProcessingIfNecessary}
      */
     private LocalList locals;
 
     /**
-     * null-ok; the processed instruction list; set in
+     * {@code null-ok;} the processed instruction list; set in
      * {@link #finishProcessingIfNecessary}
      */
     private DalvInsnList insns;
@@ -73,9 +73,9 @@ public final class DalvCode {
      *
      * @param positionInfo how much position info to preserve; one of the
      * static constants in {@link PositionList}
-     * @param unprocessedInsns non-null; the instruction list, ready
+     * @param unprocessedInsns {@code non-null;} the instruction list, ready
      * for final processing
-     * @param unprocessedCatches non-null; unprocessed catch
+     * @param unprocessedCatches {@code non-null;} unprocessed catch
      * (exception handler) table
      */
     public DalvCode(int positionInfo, OutputFinisher unprocessedInsns,
@@ -120,7 +120,7 @@ public final class DalvCode {
      * given callback to perform lookups. This must be called before
      * {@link #getInsns}.
      * 
-     * @param callback non-null; callback object
+     * @param callback {@code non-null;} callback object
      */
     public void assignIndices(AssignIndicesCallback callback) {
         unprocessedInsns.assignIndices(callback);
@@ -129,7 +129,7 @@ public final class DalvCode {
     /**
      * Gets whether this instance has any position data to represent.
      * 
-     * @return <code>true</code> iff this instance has any position
+     * @return {@code true} iff this instance has any position
      * data to represent
      */
     public boolean hasPositions() {
@@ -140,7 +140,7 @@ public final class DalvCode {
     /**
      * Gets whether this instance has any local variable data to represent.
      * 
-     * @return <code>true</code> iff this instance has any local variable
+     * @return {@code true} iff this instance has any local variable
      * data to represent
      */
     public boolean hasLocals() {
@@ -160,7 +160,7 @@ public final class DalvCode {
     /**
      * Gets the set of catch types handled anywhere in the code.
      * 
-     * @return non-null; the set of catch types
+     * @return {@code non-null;} the set of catch types
      */
     public HashSet<Type> getCatchTypes() {
         return unprocessedCatches.getCatchTypes();
@@ -170,7 +170,7 @@ public final class DalvCode {
      * Gets the set of all constants referred to by instructions in
      * the code.
      * 
-     * @return non-null; the set of constants
+     * @return {@code non-null;} the set of constants
      */
     public HashSet<Constant> getInsnConstants() {
         return unprocessedInsns.getAllConstants();
@@ -179,7 +179,7 @@ public final class DalvCode {
     /**
      * Gets the list of instructions.
      * 
-     * @return non-null; the instruction list
+     * @return {@code non-null;} the instruction list
      */
     public DalvInsnList getInsns() {
         finishProcessingIfNecessary();
@@ -189,7 +189,7 @@ public final class DalvCode {
     /**
      * Gets the catch (exception handler) table.
      * 
-     * @return non-null; the catch table
+     * @return {@code non-null;} the catch table
      */
     public CatchTable getCatches() {
         finishProcessingIfNecessary();
@@ -199,7 +199,7 @@ public final class DalvCode {
     /**
      * Gets the source positions list.
      * 
-     * @return non-null; the source positions list
+     * @return {@code non-null;} the source positions list
      */
     public PositionList getPositions() {
         finishProcessingIfNecessary();
@@ -209,7 +209,7 @@ public final class DalvCode {
     /**
      * Gets the source positions list.
      * 
-     * @return non-null; the source positions list
+     * @return {@code non-null;} the source positions list
      */
     public LocalList getLocals() {
         finishProcessingIfNecessary();
@@ -223,8 +223,8 @@ public final class DalvCode {
         /**
          * Gets the index for the given constant.
          * 
-         * @param cst non-null; the constant
-         * @return &gt;= -1; the index or <code>-1</code> if the 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
          */
         public int getIndex(Constant cst);
index d922193..11ee55d 100644 (file)
@@ -29,26 +29,26 @@ import com.android.dx.util.TwoColumnOutput;
 public abstract class DalvInsn {
     /**
      * the actual output address of this instance, if known, or
-     * <code>-1</code> if not 
+     * {@code -1} if not 
      */
     private int address;
 
     /** the opcode; one of the constants from {@link Dops} */
     private final Dop opcode;
 
-    /** non-null; source position */
+    /** {@code non-null;} source position */
     private final SourcePosition position;
 
-    /** non-null; list of register arguments */
+    /** {@code non-null;} list of register arguments */
     private final RegisterSpecList registers;
 
     /**
      * Makes a move instruction, appropriate and ideal for the given arguments.
      * 
-     * @param position non-null; source position information
-     * @param dest non-null; destination register
-     * @param src non-null; source register
-     * @return non-null; an appropriately-constructed instance
+     * @param position {@code non-null;} source position information
+     * @param dest {@code non-null;} destination register
+     * @param src {@code non-null;} source register
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public static SimpleInsn makeMove(SourcePosition position,
             RegisterSpec dest, RegisterSpec src) {
@@ -75,17 +75,17 @@ public abstract class DalvInsn {
 
     /**
      * Constructs an instance. The output address of this instance is initially
-     * unknown (<code>-1</code>).
+     * unknown ({@code -1}).
      * 
      * <p><b>Note:</b> In the unlikely event that an instruction takes
-     * absolutely no registers (e.g., a <code>nop</code> or a
+     * 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 non-null; source position
-     * @param registers non-null; register list, including a
+     * @param position {@code non-null;} source position
+     * @param registers {@code non-null;} register list, including a
      * result register if appropriate (that is, registers may be either
      * ins and outs)
      */
@@ -151,11 +151,11 @@ public abstract class DalvInsn {
 
     /**
      * Gets the output address of this instruction, if it is known. This throws
-     * a <code>RuntimeException</code> if it has not yet been set.
+     * a {@code RuntimeException} if it has not yet been set.
      * 
      * @see #setAddress
      * 
-     * @return &gt;= 0; the output address
+     * @return {@code >= 0;} the output address
      */
     public final int getAddress() {
         if (address < 0) {
@@ -168,7 +168,7 @@ public abstract class DalvInsn {
     /**
      * Gets the opcode.
      * 
-     * @return non-null; the opcode
+     * @return {@code non-null;} the opcode
      */
     public final Dop getOpcode() {
         return opcode;
@@ -177,7 +177,7 @@ public abstract class DalvInsn {
     /**
      * Gets the source position.
      * 
-     * @return non-null; the source position
+     * @return {@code non-null;} the source position
      */
     public final SourcePosition getPosition() {
         return position;
@@ -186,7 +186,7 @@ public abstract class DalvInsn {
     /**
      * Gets the register list for this instruction.
      * 
-     * @return non-null; the registers
+     * @return {@code non-null;} the registers
      */
     public final RegisterSpecList getRegisters() {
         return registers;
@@ -195,9 +195,9 @@ public abstract class DalvInsn {
     /**
      * Returns whether this instance's opcode uses a result register.
      * This method is a convenient shorthand for
-     * <code>getOpcode().hasResult()</code>.
+     * {@code getOpcode().hasResult()}.
      * 
-     * @return <code>true</code> iff this opcode uses a result register
+     * @return {@code true} iff this opcode uses a result register
      */
     public final boolean hasResult() {
         return opcode.hasResult();
@@ -210,7 +210,7 @@ public abstract class DalvInsn {
      * (to be explicit here) category-2 values take up two consecutive
      * registers.
      * 
-     * @return &gt;= 0; the minimum distinct register requirement
+     * @return {@code >= 0;} the minimum distinct register requirement
      */
     public final int getMinimumRegisterRequirement() {
         boolean hasResult = hasResult();
@@ -231,7 +231,7 @@ public abstract class DalvInsn {
      * 
      * @see #hrVersion
      * 
-     * @return null-ok; the prefix, if any
+     * @return {@code null-ok;} the prefix, if any
      */
     public DalvInsn hrPrefix() {
         RegisterSpecList regs = registers;
@@ -255,7 +255,7 @@ public abstract class DalvInsn {
      * 
      * @see #hrVersion
      * 
-     * @return null-ok; the suffix, if any
+     * @return {@code null-ok;} the suffix, if any
      */
     public DalvInsn hrSuffix() {
         if (hasResult()) {
@@ -268,8 +268,8 @@ public abstract class DalvInsn {
 
     /**
      * Gets the instruction that is equivalent to this one, except that
-     * uses sequential registers starting at <code>0</code> (storing
-     * the result, if any, in register <code>0</code> as well). The
+     * uses sequential registers starting at {@code 0} (storing
+     * the result, if any, in register {@code 0} as well). The
      * sequence of instructions from {@link #hrPrefix} and {@link
      * #hrSuffix} (if non-null) surrounding the result of a call to
      * this method are the high register transformation of this
@@ -277,7 +277,7 @@ public abstract class DalvInsn {
      * used will be the number returned by {@link
      * #getMinimumRegisterRequirement}.
      * 
-     * @return non-null; the replacement
+     * @return {@code non-null;} the replacement
      */
     public DalvInsn hrVersion() {
         RegisterSpecList regs = 
@@ -289,7 +289,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 non-null; the identifier
+     * @return {@code non-null;} the identifier
      */
     public final String identifierString() {
         if (address != -1) {
@@ -301,16 +301,16 @@ 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</code>
+     * a human-oriented listing dump. This method will return {@code null}
      * if this instance should not appear in a listing.
      * 
-     * @param prefix non-null; prefix before the address; each follow-on
+     * @param prefix {@code non-null;} prefix before the address; each follow-on
      * line will be indented to match as well
-     * @param width &gt;= 0; the width of the output or <code>0</code> for
+     * @param width {@code >= 0;} the width of the output or {@code 0} for
      * unlimited width
      * @param noteIndices whether to include an explicit notation of
      * constant pool indices
-     * @return null-ok; the string form or <code>null</code> if this
+     * @return {@code null-ok;} the string form or {@code null} if this
      * instance should not appear in a listing
      */
     public final String listingString(String prefix, int width,
@@ -331,7 +331,7 @@ public abstract class DalvInsn {
     /**
      * Sets the output address.
      * 
-     * @param address &gt;= 0; the output address
+     * @param address {@code >= 0;} the output address
      */
     public final void setAddress(int address) {
         if (address < 0) {
@@ -347,7 +347,7 @@ public abstract class DalvInsn {
      * to the address plus the length of the instruction format of this
      * instance's opcode.
      * 
-     * @return &gt;= 0; the next address
+     * @return {@code >= 0;} the next address
      */
     public final int getNextAddress() {
         return getAddress() + codeSize();
@@ -356,7 +356,7 @@ public abstract class DalvInsn {
     /**
      * Gets the size of this instruction, in 16-bit code units.
      * 
-     * @return &gt;= 0; the code size of this instruction
+     * @return {@code >= 0;} the code size of this instruction
      */
     public abstract int codeSize();
 
@@ -364,7 +364,7 @@ public abstract class DalvInsn {
      * Writes this instance to the given output. This method should
      * never annotate the output.
      * 
-     * @param out non-null; where to write to
+     * @param out {@code non-null;} where to write to
      */
     public abstract void writeTo(AnnotatedOutput out);
 
@@ -372,8 +372,8 @@ 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 non-null; the new opcode
-     * @return non-null; an appropriately-constructed instance
+     * @param opcode {@code non-null;} the new opcode
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public abstract DalvInsn withOpcode(Dop opcode);
 
@@ -383,7 +383,7 @@ public abstract class DalvInsn {
      * address is reset.
      * 
      * @param delta the amount to offset register references by
-     * @return non-null; an appropriately-constructed instance
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public abstract DalvInsn withRegisterOffset(int delta);
 
@@ -392,8 +392,8 @@ public abstract class DalvInsn {
      * register list is replaced by the given one, and its address is
      * reset.
      * 
-     * @param registers non-null; new register list
-     * @return non-null; an appropriately-constructed instance
+     * @param registers {@code non-null;} new register list
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public abstract DalvInsn withRegisters(RegisterSpecList registers);
 
@@ -401,8 +401,8 @@ public abstract class DalvInsn {
      * Gets the string form for any arguments to this instance. Subclasses
      * must override this.
      * 
-     * @return null-ok; the string version of any arguments or
-     * <code>null</code> if there are none
+     * @return {@code null-ok;} the string version of any arguments or
+     * {@code null} if there are none
      */
     protected abstract String argString();
 
@@ -411,12 +411,12 @@ public abstract class DalvInsn {
      * form of this instance suitable for inclusion in a
      * human-oriented listing dump, not including the instruction
      * address and without respect for any output formatting. This
-     * method should return <code>null</code> if this instance should
+     * 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 null-ok; the listing string
+     * @return {@code null-ok;} the listing string
      */
     protected abstract String listingString0(boolean noteIndices);
 }
index 2cd15c6..5cf22f2 100644 (file)
@@ -46,10 +46,10 @@ 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 non-null; the list to use for elements
+     * @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.
-     * @return non-null; an appropriately-constructed instance of this
+     * @return {@code non-null;} an appropriately-constructed instance of this
      * class
      */
     public static DalvInsnList makeImmutable(ArrayList<DalvInsn> list,
@@ -66,7 +66,7 @@ public final class DalvInsnList extends FixedSizeList {
     }
     
     /**
-     * Constructs an instance. All indices initially contain <code>null</code>.
+     * Constructs an instance. All indices initially contain {@code null}.
      * 
      * @param size the size of the list
      */
@@ -78,10 +78,10 @@ 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</code>.
+     * do that, this will throw {@code NullPointerException}.
      * 
-     * @param n &gt;= 0, &lt; size(); which index
-     * @return non-null; element at that index
+     * @param n {@code >= 0, < size();} which index
+     * @return {@code non-null;} element at that index
      */
     public DalvInsn get(int n) {
         return (DalvInsn) get0(n);
@@ -90,8 +90,8 @@ public final class DalvInsnList extends FixedSizeList {
     /**
      * Sets the instruction at the given index.
      * 
-     * @param n &gt;= 0, &lt; size(); which index
-     * @param insn non-null; the instruction to set at <code>n</code>
+     * @param n {@code >= 0, < size();} which index
+     * @param insn {@code non-null;} the instruction to set at {@code n}
      */
     public void set(int n, DalvInsn insn) {
         set0(n, insn);
@@ -102,7 +102,7 @@ public final class DalvInsnList extends FixedSizeList {
      * return a meaningful result if the instructions in this instance all
      * have valid addresses.
      * 
-     * @return &gt;= 0; the size
+     * @return {@code >= 0;} the size
      */
     public int codeSize() {
         int sz = size();
@@ -119,7 +119,7 @@ public final class DalvInsnList extends FixedSizeList {
      * Writes all the instructions in this instance to the given output
      * destination.
      * 
-     * @param out non-null; where to write to
+     * @param out {@code non-null;} where to write to
      */
     public void writeTo(AnnotatedOutput out) {
         int startCursor = out.getCursor();
@@ -170,7 +170,7 @@ public final class DalvInsnList extends FixedSizeList {
      * Gets the minimum required register count implied by this
      * instance.  This includes any unused parameters that could
      * potentially be at the top of the register space.
-     * @return &gt;= 0; the required registers size
+     * @return {@code >= 0;} the required registers size
      */
     public int getRegistersSize() {
         return regCount;
@@ -181,7 +181,7 @@ public final class DalvInsnList extends FixedSizeList {
      * method. This is equal to the largest argument word count of any
      * method referred to by this instance.
      * 
-     * @return &gt;= 0; the required outgoing arguments size
+     * @return {@code >= 0;} the required outgoing arguments size
      */
     public int getOutsSize() {
         int sz = size();
@@ -216,8 +216,8 @@ public final class DalvInsnList extends FixedSizeList {
     /**
      * Does a human-friendly dump of this instance.
      * 
-     * @param out non-null; where to dump
-     * @param prefix non-null; prefix to attach to each line of output
+     * @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
      * lines for zero-size instructions and explicit constant pool indices
      */
@@ -250,8 +250,8 @@ public final class DalvInsnList extends FixedSizeList {
     /**
      * Does a human-friendly dump of this instance.
      * 
-     * @param out non-null; where to dump
-     * @param prefix non-null; prefix to attach to each line of output
+     * @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
      * lines for zero-size instructions
      */
index 6914fca..d1f92bf 100644 (file)
@@ -26,25 +26,25 @@ public final class Dop {
     /** DalvOps.MIN_VALUE..DalvOps.MAX_VALUE; the opcode family */
     private final int family;
 
-    /** non-null; the instruction format */
+    /** {@code non-null;} the instruction format */
     private final InsnFormat format;
 
     /** whether this opcode uses a result register */
     private final boolean hasResult;
 
-    /** non-null; the name */
+    /** {@code non-null;} the name */
     private final String name;
 
     /**
      * Constructs an instance.
      * 
-     * @param opcode DalvOps.MIN_VALUE..DalvOps.MAX_VALUE; the opcode
+     * @param opcode {@code DalvOps.MIN_VALUE..DalvOps.MAX_VALUE;} the opcode
      * value itself
-     * @param family DalvOps.MIN_VALUE..DalvOps.MAX_VALUE; the opcode family
-     * @param format non-null; the instruction format
+     * @param family {@code DalvOps.MIN_VALUE..DalvOps.MAX_VALUE;} the opcode family
+     * @param format {@code non-null;} the instruction format
      * @param hasResult whether the opcode has a result register; if so it
      * is always the first register
-     * @param name non-null; the name
+     * @param name {@code non-null;} the name
      */
     public Dop(int opcode, int family, InsnFormat format,
                boolean hasResult, String name) {
@@ -80,7 +80,7 @@ public final class Dop {
     /**
      * Gets the opcode value.
      * 
-     * @return DalvOps.MIN_VALUE..DalvOps.MAX_VALUE; the opcode value
+     * @return {@code DalvOps.MIN_VALUE..DalvOps.MAX_VALUE;} the opcode value
      */
     public int getOpcode() {
         return opcode;
@@ -90,7 +90,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 DalvOps.MIN_VALUE..DalvOps.MAX_VALUE; the opcode family
+     * @return {@code DalvOps.MIN_VALUE..DalvOps.MAX_VALUE;} the opcode family
      */
     public int getFamily() {
         return family;
@@ -99,7 +99,7 @@ public final class Dop {
     /**
      * Gets the instruction format.
      * 
-     * @return non-null; the instruction format
+     * @return {@code non-null;} the instruction format
      */
     public InsnFormat getFormat() {
         return format;
@@ -108,7 +108,7 @@ public final class Dop {
     /**
      * Returns whether this opcode uses a result register.
      * 
-     * @return <code>true</code> iff this opcode uses a result register
+     * @return {@code true} iff this opcode uses a result register
      */
     public boolean hasResult() {
         return hasResult;
@@ -117,7 +117,7 @@ public final class Dop {
     /**
      * Gets the opcode name.
      * 
-     * @return non-null; the opcode name
+     * @return {@code non-null;} the opcode name
      */
     public String getName() {
         return name;
@@ -127,7 +127,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 non-null; the opposite test
+     * @return {@code non-null;} the opposite test
      */
     public Dop getOppositeTest() {
         switch (opcode) {
index 8923c59..dfdaa73 100644 (file)
@@ -47,7 +47,7 @@ import com.android.dx.dex.code.form.SpecialFormat;
  * them.
  */
 public final class Dops {
-    /** non-null; array containing all the standard instances */
+    /** {@code non-null;} array containing all the standard instances */
     private static final Dop[] DOPS;
 
     /**
@@ -1172,8 +1172,8 @@ public final class Dops {
     /**
      * Gets the {@link Dop} for the given opcode value.
      * 
-     * @param opcode DalvOps.MIN_VALUE..DalvOps.MAX_VALUE; the opcode value
-     * @return non-null; the associated opcode instance
+     * @param opcode {@code DalvOps.MIN_VALUE..DalvOps.MAX_VALUE;} the opcode value
+     * @return {@code non-null;} the associated opcode instance
      */
     public static Dop get(int opcode) {
         int idx = opcode - DalvOps.MIN_VALUE;
@@ -1194,9 +1194,9 @@ public final class Dops {
      * Gets the {@link Dop} with the given family/format combination, if
      * any.
      * 
-     * @param family DalvOps.MIN_VALUE..DalvOps.MAX_VALUE; the opcode family
-     * @param format non-null; the opcode's instruction format
-     * @return null-ok; the corresponding opcode, or <code>null</code> if
+     * @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
      * there is none
      */
     public static Dop getOrNull(int family, InsnFormat format) {
@@ -1222,7 +1222,7 @@ public final class Dops {
     /**
      * Puts the given opcode into the table of all ops.
      * 
-     * @param opcode non-null; the opcode
+     * @param opcode {@code non-null;} the opcode
      */
     private static void set(Dop opcode) {
         int idx = opcode.getOpcode() - DalvOps.MIN_VALUE;
index 63c9d24..147937f 100644 (file)
@@ -28,17 +28,17 @@ import com.android.dx.util.AnnotatedOutput;
 public abstract class FixedSizeInsn extends DalvInsn {
     /**
      * Constructs an instance. The output address of this instance is initially
-     * unknown (<code>-1</code>).
+     * unknown ({@code -1}).
      * 
      * <p><b>Note:</b> In the unlikely event that an instruction takes
-     * absolutely no registers (e.g., a <code>nop</code> or a
+     * 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 non-null; source position
-     * @param registers non-null; register list, including a
+     * @param position {@code non-null;} source position
+     * @param registers {@code non-null;} register list, including a
      * result register if appropriate (that is, registers may be either
      * ins or outs)
      */
index 458bc89..9155367 100644 (file)
@@ -24,21 +24,21 @@ import com.android.dx.util.AnnotatedOutput;
 
 /**
  * Combination instruction which turns into a variable number of
- * <code>move*</code> instructions to move a set of registers into
- * registers starting at <code>0</code> sequentially. This is used
+ * {@code move*} instructions to move a set of registers into
+ * registers starting at {@code 0} sequentially. This is used
  * in translating an instruction whose register requirements cannot
  * be met using a straightforward choice of a single opcode.
  */
 public final class HighRegisterPrefix extends VariableSizeInsn {
-    /** null-ok; cached instructions, if constructed */
+    /** {@code null-ok;} cached instructions, if constructed */
     private SimpleInsn[] insns;
     
     /**
      * Constructs an instance. The output address of this instance is initially
-     * unknown (<code>-1</code>).
+     * unknown ({@code -1}).
      * 
-     * @param position non-null; source position
-     * @param registers non-null; source registers
+     * @param position {@code non-null;} source position
+     * @param registers {@code non-null;} source registers
      */
     public HighRegisterPrefix(SourcePosition position,
                               RegisterSpecList registers) {
@@ -135,9 +135,9 @@ public final class HighRegisterPrefix extends VariableSizeInsn {
      * Returns the proper move instruction for the given source spec
      * and destination index.
      *
-     * @param src non-null; the source register spec
-     * @param destIndex &gt;= 0; the destination register index
-     * @return non-null; the appropriate move instruction
+     * @param src {@code non-null;} the source register spec
+     * @param destIndex {@code >= 0;} the destination register index
+     * @return {@code non-null;} the appropriate move instruction
      */
     private static SimpleInsn moveInsnFor(RegisterSpec src, int destIndex) {
         return DalvInsn.makeMove(SourcePosition.NO_INFO,
index ed4137b..ca6688b 100644 (file)
@@ -37,10 +37,10 @@ public abstract class InsnFormat {
      * dump, of the given instruction. The instruction must be of this
      * instance's format for proper operation.
      *
-     * @param insn non-null; the instruction
+     * @param insn {@code non-null;} the instruction
      * @param noteIndices whether to include an explicit notation of
      * constant pool indices
-     * @return non-null; the string form
+     * @return {@code non-null;} the string form
      */
     public final String listingString(DalvInsn insn, boolean noteIndices) {
         String op = insn.getOpcode().getName();
@@ -66,28 +66,28 @@ public abstract class InsnFormat {
     /**
      * Returns the string form of the arguments to the given instruction.
      * The instruction must be of this instance's format. If the instruction
-     * has no arguments, then the result should be <code>""</code>, not
-     * <code>null</code>.
+     * has no arguments, then the result should be {@code ""}, not
+     * {@code null}.
      *
      * <p>Subclasses must override this method.</p>
      *
-     * @param insn non-null; the instruction
-     * @return non-null; the string form
+     * @param insn {@code non-null;} the instruction
+     * @return {@code non-null;} the string form
      */
     public abstract String insnArgString(DalvInsn insn);
 
     /**
      * Returns the associated comment for the given instruction, if any.
      * The instruction must be of this instance's format. If the instruction
-     * has no comment, then the result should be <code>""</code>, not
-     * <code>null</code>.
+     * has no comment, then the result should be {@code ""}, not
+     * {@code null}.
      *
      * <p>Subclasses must override this method.</p>
      *
-     * @param insn non-null; the instruction
+     * @param insn {@code non-null;} the instruction
      * @param noteIndices whether to include an explicit notation of
      * constant pool indices
-     * @return non-null; the string form
+     * @return {@code non-null;} the string form
      */
     public abstract String insnCommentString(DalvInsn insn,
             boolean noteIndices);
@@ -97,7 +97,7 @@ public abstract class InsnFormat {
      * size is a number of 16-bit code units, not bytes. This should
      * throw an exception if this format is of variable size.
      *
-     * @return &gt;= 0; the instruction length in 16-bit code units
+     * @return {@code >= 0;} the instruction length in 16-bit code units
      */
     public abstract int codeSize();
 
@@ -112,24 +112,24 @@ public abstract class InsnFormat {
      *
      * <p>Subclasses must override this method.</p>
      *
-     * @param insn non-null; the instruction to check
-     * @return <code>true</code> iff the instruction's arguments are
-     * appropriate for this instance, or <code>false</code> if not
+     * @param insn {@code non-null;} the instruction to check
+     * @return {@code true} iff the instruction's arguments are
+     * appropriate for this instance, or {@code false} if not
      */
     public abstract boolean isCompatible(DalvInsn insn);
 
     /**
      * Returns whether or not the given instruction's branch offset will
-     * fit in this instance's format. This always returns <code>false</code>
+     * fit in this instance's format. This always returns {@code false}
      * for formats that don't include a branch offset.
      *
      * <p>The default implementation of this method always returns
-     * <code>false</code>. Subclasses must override this method if they
+     * {@code false}. Subclasses must override this method if they
      * include branch offsets.</p>
      *
-     * @param insn non-null; the instruction to check
-     * @return <code>true</code> iff the instruction's branch offset is
-     * appropriate for this instance, or <code>false</code> if not
+     * @param insn {@code non-null;} the instruction to check
+     * @return {@code true} iff the instruction's branch offset is
+     * appropriate for this instance, or {@code false} if not
      */
     public boolean branchFits(TargetInsn insn) {
         return false;
@@ -141,7 +141,7 @@ public abstract class InsnFormat {
      *
      * <p>Subclasses must override this method.</p>
      *
-     * @return null-ok; the next format to try, or <code>null</code> if
+     * @return {@code null-ok;} the next format to try, or {@code null} if
      * there are no suitable alternatives
      */
     public abstract InsnFormat nextUp();
@@ -152,16 +152,16 @@ public abstract class InsnFormat {
      *
      * <p>Subclasses must override this method.</p>
      *
-     * @param out non-null; the output destination to write to
-     * @param insn non-null; the instruction to write
+     * @param out {@code non-null;} the output destination to write to
+     * @param insn {@code non-null;} the instruction to write
      */
     public abstract void writeTo(AnnotatedOutput out, DalvInsn insn);
 
     /**
      * Helper method to return a register list string.
      *
-     * @param list non-null; the list of registers
-     * @return non-null; the string form
+     * @param list {@code non-null;} the list of registers
+     * @return {@code non-null;} the string form
      */
     protected static String regListString(RegisterSpecList list) {
         int sz = list.size();
@@ -185,7 +185,7 @@ public abstract class InsnFormat {
      * Helper method to return a literal bits argument string.
      *
      * @param value the value
-     * @return non-null; the string form
+     * @return {@code non-null;} the string form
      */
     protected static String literalBitsString(CstLiteralBits value) {
         StringBuffer sb = new StringBuffer(100);
@@ -208,8 +208,8 @@ public abstract class InsnFormat {
      *
      * @param value the value
      * @param width the width of the constant, in bits (used for displaying
-     * the uninterpreted bits; one of: <code>4 8 16 32 64</code>
-     * @return non-null; the comment
+     * the uninterpreted bits; one of: {@code 4 8 16 32 64}
+     * @return {@code non-null;} the comment
      */
     protected static String literalBitsComment(CstLiteralBits value,
             int width) {
@@ -242,8 +242,8 @@ public abstract class InsnFormat {
     /**
      * Helper method to return a branch address string.
      *
-     * @param insn non-null; the instruction in question
-     * @return non-null; the string form of the instruction's branch target
+     * @param insn {@code non-null;} the instruction in question
+     * @return {@code non-null;} the string form of the instruction's branch target
      */
     protected static String branchString(DalvInsn insn) {
         TargetInsn ti = (TargetInsn) insn;
@@ -255,8 +255,8 @@ public abstract class InsnFormat {
     /**
      * Helper method to return the comment for a branch.
      *
-     * @param insn non-null; the instruction in question
-     * @return non-null; the comment
+     * @param insn {@code non-null;} the instruction in question
+     * @return {@code non-null;} the comment
      */
     protected static String branchComment(DalvInsn insn) {
         TargetInsn ti = (TargetInsn) insn;
@@ -268,8 +268,8 @@ public abstract class InsnFormat {
     /**
      * Helper method to return a constant string.
      *
-     * @param insn non-null; a constant-bearing instruction
-     * @return non-null; the string form of the contained constant
+     * @param insn {@code non-null;} a constant-bearing instruction
+     * @return {@code non-null;} the string form of the contained constant
      */
     protected static String cstString(DalvInsn insn) {
         CstInsn ci = (CstInsn) insn;
@@ -281,8 +281,8 @@ public abstract class InsnFormat {
     /**
      * Helper method to return an instruction comment for a constant.
      *
-     * @param insn non-null; a constant-bearing instruction
-     * @return non-null; comment string representing the constant
+     * @param insn {@code non-null;} a constant-bearing instruction
+     * @return {@code non-null;} comment string representing the constant
      */
     protected static String cstComment(DalvInsn insn) {
         CstInsn ci = (CstInsn) insn;
@@ -310,7 +310,7 @@ public abstract class InsnFormat {
      * Helper method to determine if a signed int value fits in a nibble.
      *
      * @param value the value in question
-     * @return <code>true</code> iff it's in the range -8..+7
+     * @return {@code true} iff it's in the range -8..+7
      */
     protected static boolean signedFitsInNibble(int value) {
         return (value >= -8) && (value <= 7);
@@ -320,7 +320,7 @@ public abstract class InsnFormat {
      * Helper method to determine if an unsigned int value fits in a nibble.
      *
      * @param value the value in question
-     * @return <code>true</code> iff it's in the range 0..0xf
+     * @return {@code true} iff it's in the range 0..0xf
      */
     protected static boolean unsignedFitsInNibble(int value) {
         return value == (value & 0xf);
@@ -330,7 +330,7 @@ public abstract class InsnFormat {
      * Helper method to determine if a signed int value fits in a byte.
      *
      * @param value the value in question
-     * @return <code>true</code> iff it's in the range -0x80..+0x7f
+     * @return {@code true} iff it's in the range -0x80..+0x7f
      */
     protected static boolean signedFitsInByte(int value) {
         return (byte) value == value;
@@ -340,7 +340,7 @@ public abstract class InsnFormat {
      * Helper method to determine if an unsigned int value fits in a byte.
      *
      * @param value the value in question
-     * @return <code>true</code> iff it's in the range 0..0xff
+     * @return {@code true} iff it's in the range 0..0xff
      */
     protected static boolean unsignedFitsInByte(int value) {
         return value == (value & 0xff);
@@ -350,7 +350,7 @@ public abstract class InsnFormat {
      * Helper method to determine if a signed int value fits in a short.
      *
      * @param value the value in question
-     * @return <code>true</code> iff it's in the range -0x8000..+0x7fff
+     * @return {@code true} iff it's in the range -0x8000..+0x7fff
      */
     protected static boolean signedFitsInShort(int value) {
         return (short) value == value;
@@ -360,7 +360,7 @@ public abstract class InsnFormat {
      * Helper method to determine if an unsigned int value fits in a short.
      *
      * @param value the value in question
-     * @return <code>true</code> iff it's in the range 0..0xffff
+     * @return {@code true} iff it's in the range 0..0xffff
      */
     protected static boolean unsignedFitsInShort(int value) {
         return value == (value & 0xffff);
@@ -370,7 +370,7 @@ public abstract class InsnFormat {
      * Helper method to determine if a signed int value fits in three bytes.
      *
      * @param value the value in question
-     * @return <code>true</code> iff it's in the range -0x800000..+0x7fffff
+     * @return {@code true} iff it's in the range -0x800000..+0x7fffff
      */
     protected static boolean signedFitsIn3Bytes(int value) {
         return value == ((value << 8) >> 8);
@@ -380,8 +380,8 @@ public abstract class InsnFormat {
      * Helper method to extract the callout-argument index from an
      * appropriate instruction.
      *
-     * @param insn non-null; the instruction
-     * @return &gt;= 0; the callout argument index
+     * @param insn {@code non-null;} the instruction
+     * @return {@code >= 0;} the callout argument index
      */
     protected static int argIndex(DalvInsn insn) {
         int arg = ((CstInteger) ((CstInsn) insn).getConstant()).getValue();
@@ -397,8 +397,8 @@ public abstract class InsnFormat {
      * Helper method to combine an opcode and a second byte of data into
      * the appropriate form for emitting into a code buffer.
      *
-     * @param insn non-null; the instruction containing the opcode
-     * @param arg 0..255; arbitrary other byte value
+     * @param insn {@code non-null;} the instruction containing the opcode
+     * @param arg {@code 0..255;} arbitrary other byte value
      * @return combined value
      */
     protected static short opcodeUnit(DalvInsn insn, int arg) {
@@ -418,8 +418,8 @@ public abstract class InsnFormat {
     /**
      * Helper method to combine two bytes into a code unit.
      *
-     * @param low 0..255; low byte
-     * @param high 0..255; high byte
+     * @param low {@code 0..255;} low byte
+     * @param high {@code 0..255;} high byte
      * @return combined value
      */
     protected static short codeUnit(int low, int high) {
@@ -437,10 +437,10 @@ public abstract class InsnFormat {
     /**
      * Helper method to combine four nibbles into a code unit.
      *
-     * @param n0 0..15; low nibble
-     * @param n1 0..15; medium-low nibble
-     * @param n2 0..15; medium-high nibble
-     * @param n3 0..15; high nibble
+     * @param n0 {@code 0..15;} low nibble
+     * @param n1 {@code 0..15;} medium-low nibble
+     * @param n2 {@code 0..15;} medium-high nibble
+     * @param n3 {@code 0..15;} high nibble
      * @return combined value
      */
     protected static short codeUnit(int n0, int n1, int n2, int n3) {
@@ -466,9 +466,9 @@ public abstract class InsnFormat {
     /**
      * Helper method to combine two nibbles into a byte.
      *
-     * @param low 0..15; low nibble
-     * @param high 0..15; high nibble
-     * @return 0..255; combined value
+     * @param low {@code 0..15;} low nibble
+     * @param high {@code 0..15;} high nibble
+     * @return {@code 0..255;} combined value
      */
     protected static int makeByte(int low, int high) {
         if ((low & 0xf) != low) {
@@ -485,7 +485,7 @@ public abstract class InsnFormat {
     /**
      * Writes one code unit to the given output destination.
      * 
-     * @param out non-null; where to write to
+     * @param out {@code non-null;} where to write to
      * @param c0 code unit to write
      */
     protected static void write(AnnotatedOutput out, short c0) {
@@ -495,7 +495,7 @@ public abstract class InsnFormat {
     /**
      * Writes two code units to the given output destination.
      * 
-     * @param out non-null; where to write to
+     * @param out {@code non-null;} where to write to
      * @param c0 code unit to write
      * @param c1 code unit to write
      */
@@ -507,7 +507,7 @@ public abstract class InsnFormat {
     /**
      * Writes three code units to the given output destination.
      * 
-     * @param out non-null; where to write to
+     * @param out {@code non-null;} where to write to
      * @param c0 code unit to write
      * @param c1 code unit to write
      * @param c2 code unit to write
@@ -522,7 +522,7 @@ public abstract class InsnFormat {
     /**
      * Writes four code units to the given output destination.
      * 
-     * @param out non-null; where to write to
+     * @param out {@code non-null;} where to write to
      * @param c0 code unit to write
      * @param c1 code unit to write
      * @param c2 code unit to write
@@ -539,7 +539,7 @@ public abstract class InsnFormat {
     /**
      * Writes five code units to the given output destination.
      * 
-     * @param out non-null; where to write to
+     * @param out {@code non-null;} where to write to
      * @param c0 code unit to write
      * @param c1 code unit to write
      * @param c2 code unit to write
@@ -558,7 +558,7 @@ public abstract class InsnFormat {
     /**
      * Writes six code units to the given output destination.
      * 
-     * @param out non-null; where to write to
+     * @param out {@code non-null;} where to write to
      * @param c0 code unit to write
      * @param c1 code unit to write
      * @param c2 code unit to write
index c19a8dc..360a55c 100644 (file)
@@ -28,7 +28,7 @@ import com.android.dx.rop.code.SourcePosition;
  */
 public final class LocalEnd extends ZeroSizeInsn {
     /**
-     * non-null; register spec representing the local variable ended
+     * {@code non-null;} register spec representing the local variable ended
      * by this instance. <b>Note:</b> Technically, only the register
      * number needs to be recorded here as the rest of the information
      * is implicit in the ambient local variable state, but other code
@@ -38,10 +38,10 @@ public final class LocalEnd extends ZeroSizeInsn {
 
     /**
      * Constructs an instance. The output address of this instance is initially
-     * unknown (<code>-1</code>).
+     * unknown ({@code -1}).
      * 
-     * @param position non-null; source position
-     * @param local non-null; register spec representing the local
+     * @param position {@code non-null;} source position
+     * @param local {@code non-null;} register spec representing the local
      * variable introduced by this instance
      */
     public LocalEnd(SourcePosition position, RegisterSpec local) {
@@ -70,7 +70,7 @@ public final class LocalEnd extends ZeroSizeInsn {
      * Gets the register spec representing the local variable ended
      * by this instance.
      * 
-     * @return non-null; the register spec
+     * @return {@code non-null;} the register spec
      */
     public RegisterSpec getLocal() {
         return local;
index 4614fc4..8f2b6f6 100644 (file)
@@ -33,16 +33,16 @@ import java.util.Arrays;
  * and a type.
  */
 public final class LocalList extends FixedSizeList {
-    /** non-null; empty instance */
+    /** {@code non-null;} empty instance */
     public static final LocalList EMPTY = new LocalList(0);
 
     /** whether to run the self-check code */
     private static final boolean DEBUG = false;
     
     /**
-     * Constructs an instance. All indices initially contain <code>null</code>.
+     * Constructs an instance. All indices initially contain {@code null}.
      * 
-     * @param size &gt;= 0; the size of the list
+     * @param size {@code >= 0;} the size of the list
      */
     public LocalList(int size) {
         super(size);
@@ -51,10 +51,10 @@ public final class LocalList 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</code>.
+     * do that, this will throw {@code NullPointerException}.
      * 
-     * @param n &gt;= 0, &lt; size(); which index
-     * @return non-null; element at that index
+     * @param n {@code >= 0, < size();} which index
+     * @return {@code non-null;} element at that index
      */
     public Entry get(int n) {
         return (Entry) get0(n);
@@ -63,8 +63,8 @@ public final class LocalList extends FixedSizeList {
     /**
      * Sets the entry at the given index.
      * 
-     * @param n &gt;= 0, &lt; size(); which index
-     * @param entry non-null; the entry to set at <code>n</code>
+     * @param n {@code >= 0, < size();} which index
+     * @param entry {@code non-null;} the entry to set at {@code n}
      */
     public void set(int n, Entry entry) {
         set0(n, entry);
@@ -73,8 +73,8 @@ public final class LocalList extends FixedSizeList {
     /**
      * Does a human-friendly dump of this instance.
      * 
-     * @param out non-null; where to dump
-     * @param prefix non-null; prefix to attach to each line of output
+     * @param out {@code non-null;} where to dump
+     * @param prefix {@code non-null;} prefix to attach to each line of output
      */
     public void debugPrint(PrintStream out, String prefix) {
         int sz = size();
@@ -118,24 +118,24 @@ public final class LocalList extends FixedSizeList {
      * Entry in a local list.
      */
     public static class Entry implements Comparable<Entry> {
-        /** &gt;= 0; address */
+        /** {@code >= 0;} address */
         private final int address;
 
-        /** non-null; disposition of the local */
+        /** {@code non-null;} disposition of the local */
         private final Disposition disposition;
 
-        /** non-null; register spec representing the variable */
+        /** {@code non-null;} register spec representing the variable */
         private final RegisterSpec spec;
 
-        /** non-null; variable type (derived from {@code spec}) */
+        /** {@code non-null;} variable type (derived from {@code spec}) */
         private final CstType type;
         
         /**
          * Constructs an instance.
          * 
-         * @param address &gt;= 0; address 
-         * @param disposition non-null; disposition of the local
-         * @param spec non-null; register spec representing the variable
+         * @param address {@code >= 0;} address 
+         * @param disposition {@code non-null;} disposition of the local
+         * @param spec {@code non-null;} register spec representing the variable
          */
         public Entry(int address, Disposition disposition, RegisterSpec spec) {
             if (address < 0) {
@@ -182,8 +182,8 @@ public final class LocalList extends FixedSizeList {
          * disposition (variants of end are all consistered
          * equivalent), and spec.
          * 
-         * @param other non-null; entry to compare to
-         * @return {@code -1..1}; standard result of comparison
+         * @param other {@code non-null;} entry to compare to
+         * @return {@code -1..1;} standard result of comparison
          */
         public int compareTo(Entry other) {
             if (address < other.address) {
@@ -205,7 +205,7 @@ public final class LocalList extends FixedSizeList {
         /**
          * Gets the address.
          * 
-         * @return &gt;= 0; the address
+         * @return {@code >= 0;} the address
          */
         public int getAddress() {
             return address;
@@ -214,7 +214,7 @@ public final class LocalList extends FixedSizeList {
         /**
          * Gets the disposition.
          * 
-         * @return non-null; the disposition
+         * @return {@code non-null;} the disposition
          */
         public Disposition getDisposition() {
             return disposition;
@@ -233,7 +233,7 @@ public final class LocalList extends FixedSizeList {
         /**
          * Gets the variable name.
          * 
-         * @return null-ok; the variable name
+         * @return {@code null-ok;} the variable name
          */
         public CstUtf8 getName() {
             return spec.getLocalItem().getName();
@@ -242,7 +242,7 @@ public final class LocalList extends FixedSizeList {
         /**
          * Gets the variable signature.
          *
-         * @return null-ok; the variable signature
+         * @return {@code null-ok;} the variable signature
          */
         public CstUtf8 getSignature() {
             return spec.getLocalItem().getSignature();
@@ -251,7 +251,7 @@ public final class LocalList extends FixedSizeList {
         /**
          * Gets the variable's type.
          * 
-         * @return non-null; the type
+         * @return {@code non-null;} the type
          */
         public CstType getType() {
             return type;
@@ -260,7 +260,7 @@ public final class LocalList extends FixedSizeList {
         /**
          * Gets the number of the register holding the variable.
          * 
-         * @return &gt;= 0; the number fo the register holding the variable
+         * @return {@code >= 0;} the number fo the register holding the variable
          */
         public int getRegister() {
             return spec.getReg();
@@ -269,7 +269,7 @@ public final class LocalList extends FixedSizeList {
         /**
          * Gets the RegisterSpec of the register holding the variable.
          *
-         * @return non-null; RegisterSpec of the holding register.
+         * @return {@code non-null;} RegisterSpec of the holding register.
          */
         public RegisterSpec getRegisterSpec() {
             return spec;
@@ -278,9 +278,9 @@ public final class LocalList extends FixedSizeList {
         /**
          * Returns whether or not this instance matches the given spec.
          * 
-         * @param spec non-null; the spec in question
-         * @return <code>true</code> iff this instance matches
-         * <code>spec</code>
+         * @param spec {@code non-null;} the spec in question
+         * @return {@code true} iff this instance matches
+         * {@code spec}
          */
         public boolean matches(RegisterSpec otherSpec) {
             return spec.equalsUsingSimpleType(otherSpec);
@@ -290,9 +290,9 @@ public final class LocalList extends FixedSizeList {
          * Returns whether or not this instance matches the spec in
          * the given instance.
          *
-         * @param other non-null; another entry
-         * @return <code>true</code> iff this instance's spec matches
-         * <code>other</code>
+         * @param other {@code non-null;} another entry
+         * @return {@code true} iff this instance's spec matches
+         * {@code other}
          */
         public boolean matches(Entry other) {
             return matches(other.spec);
@@ -302,8 +302,8 @@ public final class LocalList extends FixedSizeList {
          * Returns an instance just like this one but with the disposition
          * set as given
          * 
-         * @param disposition non-null; the new disposition
-         * @return non-null; an appropriately-constructed instance
+         * @param disposition {@code non-null;} the new disposition
+         * @return {@code non-null;} an appropriately-constructed instance
          */
         public Entry withDisposition(Disposition disposition) {
             if (disposition == this.disposition) {
@@ -318,8 +318,8 @@ public final class LocalList extends FixedSizeList {
      * Constructs an instance for the given method, based on the given
      * block order and intermediate local information.
      * 
-     * @param insns non-null; instructions to convert
-     * @return non-null; the constructed list 
+     * @param insns {@code non-null;} instructions to convert
+     * @return {@code non-null;} the constructed list 
      */
     public static LocalList make(DalvInsnList insns) {
         int sz = insns.size();
@@ -453,26 +453,26 @@ public final class LocalList extends FixedSizeList {
      * Intermediate state when constructing a local list.
      */
     public static class MakeState {
-        /** non-null; result being collected */
+        /** {@code non-null;} result being collected */
         private final ArrayList<Entry> result;
 
         /**
-         * &gt;= 0; running count of nulled result entries, to help with
+         * {@code >= 0;} running count of nulled result entries, to help with
          * sizing the final list
          */
         private int nullResultCount;
 
-        /** null-ok; current register mappings */
+        /** {@code null-ok;} current register mappings */
         private RegisterSpecSet regs;
 
-        /** null-ok; result indices where local ends are stored */
+        /** {@code null-ok;} result indices where local ends are stored */
         private int[] endIndices;
 
-        /** &gt;= 0; last address seen */
+        /** {@code >= 0;} last address seen */
         private int lastAddress;
 
         /**
-         * &gt;= 0; result index where the first element for the most
+         * {@code >= 0;} result index where the first element for the most
          * recent address is stored
          */
         private int startIndexForAddress;
@@ -493,8 +493,8 @@ public final class LocalList extends FixedSizeList {
          * Checks the address and other vitals as a prerequisite to
          * further processing.
          *
-         * @param address &gt;= 0; address about to be processed
-         * @param reg &gt;= 0; register number about to be processed
+         * @param address {@code >= 0;} address about to be processed
+         * @param reg {@code >= 0;} register number about to be processed
          */
         private void aboutToProcess(int address, int reg) {
             boolean first = (endIndices == null);
@@ -535,8 +535,8 @@ public final class LocalList extends FixedSizeList {
          * The first call on this instance must be to this method, so that
          * the register state can be properly sized.
          * 
-         * @param address &gt;= 0; the address
-         * @param specs non-null; spec set representing the locals
+         * @param address {@code >= 0;} the address
+         * @param specs {@code non-null;} spec set representing the locals
          */
         public void snapshot(int address, RegisterSpecSet specs) {
             int sz = specs.getMaxSize();
@@ -562,8 +562,8 @@ public final class LocalList extends FixedSizeList {
         /**
          * Starts a local at the given address.
          * 
-         * @param address &gt;= 0; the address
-         * @param startedLocal non-null; spec representing the started local
+         * @param address {@code >= 0;} the address
+         * @param startedLocal {@code non-null;} spec representing the started local
          */
         public void startLocal(int address, RegisterSpec startedLocal) {
             int regNum = startedLocal.getReg();
@@ -679,8 +679,8 @@ public final class LocalList extends FixedSizeList {
         /**
          * Ends a local at the given address.
          *
-         * @param address &gt;= 0; the address
-         * @param endedLocal non-null; spec representing the local being ended
+         * @param address {@code >= 0;} the address
+         * @param endedLocal {@code non-null;} spec representing the local being ended
          */
         public void endLocal(int address, RegisterSpec endedLocal) {
             int regNum = endedLocal.getReg();
@@ -715,8 +715,8 @@ public final class LocalList extends FixedSizeList {
          * if needed update the newly-active end to reflect an altered
          * disposition.
          * 
-         * @param address &gt;= 0; the address
-         * @param endedLocal non-null; spec representing the local being ended
+         * @param address {@code >= 0;} the address
+         * @param endedLocal {@code non-null;} spec representing the local being ended
          * @return {@code true} iff this method found the case in question
          * and adjusted things accordingly
          */
@@ -798,8 +798,8 @@ public final class LocalList extends FixedSizeList {
          * goal of not representing known nulls in a locals list, but
          * it gets the job done.</p>
          * 
-         * @param orig null-ok; the original spec
-         * @return null-ok; an appropriately modified spec, or the
+         * @param orig {@code null-ok;} the original spec
+         * @return {@code null-ok;} an appropriately modified spec, or the
          * original if nothing needs to be done
          */
         private static RegisterSpec filterSpec(RegisterSpec orig) {
@@ -814,9 +814,9 @@ public final class LocalList extends FixedSizeList {
          * Adds an entry to the result, updating the adjunct tables
          * accordingly.
          *
-         * @param address &gt;= 0; the address
-         * @param disposition non-null; the disposition
-         * @param spec non-null; spec representing the local
+         * @param address {@code >= 0;} the address
+         * @param disposition {@code non-null;} the disposition
+         * @param spec {@code non-null;} spec representing the local
          */
         private void add(int address, Disposition disposition,
                 RegisterSpec spec) {
@@ -836,9 +836,9 @@ public final class LocalList extends FixedSizeList {
         /**
          * Adds or updates an end local (changing its disposition).
          * 
-         * @param address &gt;= 0; the address
-         * @param disposition non-null; the disposition
-         * @param spec non-null; spec representing the local
+         * @param address {@code >= 0;} the address
+         * @param disposition {@code non-null;} the disposition
+         * @param spec {@code non-null;} spec representing the local
          */
         private void addOrUpdateEnd(int address, Disposition disposition,
                 RegisterSpec spec) {
@@ -865,7 +865,7 @@ public final class LocalList extends FixedSizeList {
         /**
          * Finishes processing altogether and gets the result.
          * 
-         * @return non-null; the result list
+         * @return {@code non-null;} the result list
          */
         public LocalList finish() {
             aboutToProcess(Integer.MAX_VALUE, 0);
index 19a9baa..409ad15 100644 (file)
@@ -27,15 +27,15 @@ import com.android.dx.rop.code.SourcePosition;
  * the instance in an instruction array.
  */
 public final class LocalSnapshot extends ZeroSizeInsn {
-    /** non-null; local state associated with this instance */
+    /** {@code non-null;} local state associated with this instance */
     private final RegisterSpecSet locals;
 
     /**
      * Constructs an instance. The output address of this instance is initially
-     * unknown (<code>-1</code>).
+     * unknown ({@code -1}).
      * 
-     * @param position non-null; source position
-     * @param locals non-null; associated local variable state
+     * @param position {@code non-null;} source position
+     * @param locals {@code non-null;} associated local variable state
      */
     public LocalSnapshot(SourcePosition position, RegisterSpecSet locals) {
         super(position);
@@ -62,7 +62,7 @@ public final class LocalSnapshot extends ZeroSizeInsn {
     /**
      * Gets the local state associated with this instance.
      * 
-     * @return non-null; the state
+     * @return {@code non-null;} the state
      */
     public RegisterSpecSet getLocals() {
         return locals;
index 22e20f8..ec70e30 100644 (file)
@@ -28,7 +28,7 @@ import com.android.dx.rop.code.SourcePosition;
  */
 public final class LocalStart extends ZeroSizeInsn {
     /**
-     * non-null; register spec representing the local variable introduced
+     * {@code non-null;} register spec representing the local variable introduced
      * by this instance 
      */
     private final RegisterSpec local;
@@ -36,8 +36,8 @@ public final class LocalStart extends ZeroSizeInsn {
     /**
      * Returns the local variable listing string for a single register spec.
      * 
-     * @param spec non-null; the spec to convert
-     * @return non-null; the string form
+     * @param spec {@code non-null;} the spec to convert
+     * @return {@code non-null;} the string form
      */
     public static String localString(RegisterSpec spec) {
         return spec.regString() + ' ' + spec.getLocalItem().toString() + ": " +
@@ -46,10 +46,10 @@ public final class LocalStart extends ZeroSizeInsn {
 
     /**
      * Constructs an instance. The output address of this instance is initially
-     * unknown (<code>-1</code>).
+     * unknown ({@code -1}).
      * 
-     * @param position non-null; source position
-     * @param local non-null; register spec representing the local
+     * @param position {@code non-null;} source position
+     * @param local {@code non-null;} register spec representing the local
      * variable introduced by this instance
      */
     public LocalStart(SourcePosition position, RegisterSpec local) {
@@ -78,7 +78,7 @@ public final class LocalStart extends ZeroSizeInsn {
      * Gets the register spec representing the local variable introduced
      * by this instance.
      * 
-     * @return non-null; the register spec
+     * @return {@code non-null;} the register spec
      */
     public RegisterSpec getLocal() {
         return local;
index f99df36..727def0 100644 (file)
@@ -21,7 +21,7 @@ import com.android.dx.rop.code.SourcePosition;
 import com.android.dx.util.AnnotatedOutput;
 
 /**
- * Pseudo-instruction which either turns into a <code>nop</code> or
+ * Pseudo-instruction which either turns into a {@code nop} or
  * nothingness, in order to make the subsequent instruction have an
  * even address. This is used to align (subsequent) instructions that
  * require it.
@@ -29,9 +29,9 @@ import com.android.dx.util.AnnotatedOutput;
 public final class OddSpacer extends VariableSizeInsn {
     /**
      * Constructs an instance. The output address of this instance is initially
-     * unknown (<code>-1</code>).
+     * unknown ({@code -1}).
      * 
-     * @param position non-null; source position
+     * @param position {@code non-null;} source position
      */
     public OddSpacer(SourcePosition position) {
         super(position, RegisterSpecList.EMPTY);
index 98d8a9c..2643373 100644 (file)
@@ -28,13 +28,13 @@ import java.util.ArrayList;
  */
 public final class OutputCollector {
     /**
-     * non-null; the associated finisher (which holds the instruction
+     * {@code non-null;} the associated finisher (which holds the instruction
      * list in-progress)
      */
     private final OutputFinisher finisher;
 
     /**
-     * null-ok; suffix for the output, or <code>null</code> if the suffix
+     * {@code null-ok;} suffix for the output, or {@code null} if the suffix
      * has been appended to the main output (by {@link #appendSuffixToOutput})
      */
     private ArrayList<DalvInsn> suffix;
@@ -42,10 +42,10 @@ public final class OutputCollector {
     /**
      * Constructs an instance.
      * 
-     * @param initialCapacity &gt;= 0; initial capacity of the output list
-     * @param suffixInitialCapacity &gt;= 0; initial capacity of the output
+     * @param initialCapacity {@code >= 0;} initial capacity of the output list
+     * @param suffixInitialCapacity {@code >= 0;} initial capacity of the output
      * suffix
-     * @param regCount &gt;= 0; register count for the method
+     * @param regCount {@code >= 0;} register count for the method
      */
     public OutputCollector(int initialCapacity, int suffixInitialCapacity,
             int regCount) {
@@ -56,7 +56,7 @@ public final class OutputCollector {
     /**
      * Adds an instruction to the output.
      * 
-     * @param insn non-null; the instruction to add 
+     * @param insn {@code non-null;} the instruction to add 
      */
     public void add(DalvInsn insn) {
         finisher.add(insn);
@@ -68,9 +68,9 @@ public final class OutputCollector {
      * indicated instruction really is a reversible branch.
      * 
      * @param which how many instructions back to find the branch;
-     * <code>0</code> is the most recently added instruction,
-     * <code>1</code> is the instruction before that, etc.
-     * @param newTarget non-null; the new target for the reversed branch
+     * {@code 0} is the most recently added instruction,
+     * {@code 1} is the instruction before that, etc.
+     * @param newTarget {@code non-null;} the new target for the reversed branch
      */
     public void reverseBranch(int which, CodeAddress newTarget) {
         finisher.reverseBranch(which, newTarget);
@@ -79,7 +79,7 @@ public final class OutputCollector {
     /**
      * Adds an instruction to the output suffix.
      * 
-     * @param insn non-null; the instruction to add 
+     * @param insn {@code non-null;} the instruction to add 
      */
     public void addSuffix(DalvInsn insn) {
         suffix.add(insn);
@@ -89,7 +89,7 @@ public final class OutputCollector {
      * Gets the results of all the calls on this instance, in the form of
      * an {@link OutputFinisher}.
      *
-     * @return non-null; the output finisher
+     * @return {@code non-null;} the output finisher
      * @throws UnsupportedOperationException if this method has
      * already been called
      */
index 73eecf8..5b1d533 100644 (file)
@@ -37,12 +37,12 @@ import java.util.HashSet;
  */
 public final class OutputFinisher {
     /**
-     * &gt;= 0; register count for the method, not including any extra
+     * {@code >= 0;} register count for the method, not including any extra
      * "reserved" registers needed to translate "difficult" instructions
      */
     private final int unreservedRegCount;
 
-    /** non-null; the list of instructions, per se */
+    /** {@code non-null;} the list of instructions, per se */
     private ArrayList<DalvInsn> insns;
 
     /** whether any instruction has position info */
@@ -52,7 +52,7 @@ public final class OutputFinisher {
     private boolean hasAnyLocalInfo;
 
     /**
-     * &gt;= 0; the count of reserved registers (low-numbered
+     * {@code >= 0;} the count of reserved registers (low-numbered
      * registers used when expanding instructions that can't be
      * represented simply); becomes valid after a call to {@link
      * #massageInstructions}
@@ -62,8 +62,8 @@ public final class OutputFinisher {
     /**
      * Constructs an instance. It initially contains no instructions.
      * 
-     * @param regCount &gt;= 0; register count for the method
-     * @param initialCapacity &gt;= 0; initial capacity of the instructions
+     * @param regCount {@code >= 0;} register count for the method
+     * @param initialCapacity {@code >= 0;} initial capacity of the instructions
      * list
      */
     public OutputFinisher(int initialCapacity, int regCount) {
@@ -98,8 +98,8 @@ public final class OutputFinisher {
      * Helper for {@link #add} which scrutinizes a single
      * instruction for local variable information.
      * 
-     * @param insn non-null; instruction to scrutinize
-     * @return <code>true</code> iff the instruction refers to any
+     * @param insn {@code non-null;} instruction to scrutinize
+     * @return {@code true} iff the instruction refers to any
      * named locals
      */
     private static boolean hasLocalInfo(DalvInsn insn) {
@@ -125,8 +125,8 @@ public final class OutputFinisher {
      * Helper for {@link #hasAnyLocalInfo} which scrutinizes a single
      * register spec.
      * 
-     * @param spec non-null; spec to scrutinize
-     * @return <code>true</code> iff the spec refers to any
+     * @param spec {@code non-null;} spec to scrutinize
+     * @return {@code true} iff the spec refers to any
      * named locals
      */
     private static boolean hasLocalInfo(RegisterSpec spec) {
@@ -138,7 +138,7 @@ public final class OutputFinisher {
      * Returns the set of all constants referred to by instructions added
      * to this instance.
      * 
-     * @return non-null; the set of constants
+     * @return {@code non-null;} the set of constants
      */
     public HashSet<Constant> getAllConstants() {
         HashSet<Constant> result = new HashSet<Constant>(20);
@@ -154,8 +154,8 @@ public final class OutputFinisher {
      * Helper for {@link #getAllConstants} which adds all the info for
      * a single instruction.
      * 
-     * @param result non-null; result set to add to
-     * @param insn non-null; instruction to scrutinize
+     * @param result {@code non-null;} result set to add to
+     * @param insn {@code non-null;} instruction to scrutinize
      */
     private static void addConstants(HashSet<Constant> result,
             DalvInsn insn) {
@@ -176,10 +176,10 @@ public final class OutputFinisher {
 
     /**
      * Helper for {@link #getAllConstants} which adds all the info for
-     * a single <code>RegisterSpec</code>.
+     * a single {@code RegisterSpec}.
      *
-     * @param result non-null; result set to add to
-     * @param spec null-ok; register spec to add
+     * @param result {@code non-null;} result set to add to
+     * @param spec {@code null-ok;} register spec to add
      */
     private static void addConstants(HashSet<Constant> result,
             RegisterSpec spec) {
@@ -208,7 +208,7 @@ public final class OutputFinisher {
     /**
      * Adds an instruction to the output.
      * 
-     * @param insn non-null; the instruction to add 
+     * @param insn {@code non-null;} the instruction to add 
      */
     public void add(DalvInsn insn) {
         insns.add(insn);
@@ -218,8 +218,8 @@ public final class OutputFinisher {
     /**
      * Inserts an instruction in the output at the given offset.
      * 
-     * @param at &gt;= 0; what index to insert at
-     * @param insn non-null; the instruction to insert
+     * @param at {@code >= 0;} what index to insert at
+     * @param insn {@code non-null;} the instruction to insert
      */
     public void insert(int at, DalvInsn insn) {
         insns.add(at, insn);
@@ -230,7 +230,7 @@ public final class OutputFinisher {
      * Helper for {@link #add} and {@link #insert},
      * which updates the position and local info flags.
      * 
-     * @param insn non-null; an instruction that was just introduced
+     * @param insn {@code non-null;} an instruction that was just introduced
      */
     private void updateInfo(DalvInsn insn) {
         if (! hasAnyPositionInfo) {
@@ -253,9 +253,9 @@ public final class OutputFinisher {
      * indicated instruction really is a reversible branch.
      * 
      * @param which how many instructions back to find the branch;
-     * <code>0</code> is the most recently added instruction,
-     * <code>1</code> is the instruction before that, etc.
-     * @param newTarget non-null; the new target for the reversed branch
+     * {@code 0} is the most recently added instruction,
+     * {@code 1} is the instruction before that, etc.
+     * @param newTarget {@code non-null;} the new target for the reversed branch
      */
     public void reverseBranch(int which, CodeAddress newTarget) {
         int size = insns.size();
@@ -284,7 +284,7 @@ public final class OutputFinisher {
      * given callback to perform lookups. This should be called before
      * calling {@link #finishProcessingAndGetList}.
      * 
-     * @param callback non-null; callback object
+     * @param callback {@code non-null;} callback object
      */
     public void assignIndices(DalvCode.AssignIndicesCallback callback) {
         for (DalvInsn insn : insns) {
@@ -298,8 +298,8 @@ public final class OutputFinisher {
      * Helper for {@link #assignIndices} which does assignment for one
      * instruction.
      * 
-     * @param insn non-null; the instruction
-     * @param callback non-null; the callback
+     * @param insn {@code non-null;} the instruction
+     * @param callback {@code non-null;} the callback
      */
     private static void assignIndices(CstInsn insn,
             DalvCode.AssignIndicesCallback callback) {
@@ -336,7 +336,7 @@ public final class OutputFinisher {
      * <p><b>Note:</b> This method may only be called once per instance
      * of this class.</p>
      *
-     * @return non-null; the output list
+     * @return {@code non-null;} the output list
      * @throws UnsupportedOperationException if this method has
      * already been called
      */
@@ -359,7 +359,7 @@ public final class OutputFinisher {
      * the format out of each instruction into a separate array, to be
      * further manipulated as things progress.
      * 
-     * @return non-null; the array of formats
+     * @return {@code non-null;} the array of formats
      */
     private InsnFormat[] makeFormatsArray() {
         int size = insns.size();
@@ -375,11 +375,11 @@ public final class OutputFinisher {
     /**
      * Helper for {@link #finishProcessingAndGetList}, which figures
      * out how many reserved registers are required and then reserving
-     * them. It also updates the given <code>formats</code> array so
+     * them. It also updates the given {@code formats} array so
      * as to avoid extra work when constructing the massaged
      * instruction list.
      * 
-     * @param formats non-null; array of per-instruction format selections
+     * @param formats {@code non-null;} array of per-instruction format selections
      */
     private void reserveRegisters(InsnFormat[] formats) {
         int oldReservedCount = (reservedCount < 0) ? 0 : reservedCount;
@@ -425,11 +425,11 @@ public final class OutputFinisher {
      * Helper for {@link #reserveRegisters}, which does one
      * pass over the instructions, calculating the number of
      * registers that need to be reserved. It also updates the
-     * <code>formats</code> list to help avoid extra work in future
+     * {@code formats} list to help avoid extra work in future
      * register reservation passes.
      * 
-     * @param formats non-null; array of per-instruction format selections
-     * @return &gt;= 0; the count of reserved registers
+     * @param formats {@code non-null;} array of per-instruction format selections
+     * @return {@code >= 0;} the count of reserved registers
      */
     private int calculateReservedCount(InsnFormat[] formats) {
         int size = insns.size();
@@ -470,16 +470,16 @@ public final class OutputFinisher {
 
     /**
      * Attempts to fit the given instruction into a format, returning
-     * either a format that the instruction fits into or <code>null</code>
+     * either a format that the instruction fits into or {@code null}
      * to indicate that the instruction will need to be expanded. This
      * fitting process starts with the given format as a first "best
      * guess" and then pessimizes from there if necessary.
      *
-     * @param insn non-null; the instruction in question
-     * @param format null-ok; the current guess as to the best instruction
-     * format to use; <code>null</code> means that no simple format fits
-     * @return null-ok; a possibly-different format, which is either a
-     * good fit or <code>null</code> to indicate that no simple format
+     * @param insn {@code non-null;} the instruction in question
+     * @param format {@code null-ok;} the current guess as to the best instruction
+     * format to use; {@code null} means that no simple format fits
+     * @return {@code null-ok;} a possibly-different format, which is either a
+     * good fit or {@code null} to indicate that no simple format
      * fits
      */
     private InsnFormat findFormatForInsn(DalvInsn insn, InsnFormat format) {
@@ -527,7 +527,7 @@ public final class OutputFinisher {
      * final addresses aren't known at the point that this method is
      * called.</p>
      * 
-     * @param formats non-null; array of per-instruction format selections
+     * @param formats {@code non-null;} array of per-instruction format selections
      */
     private void massageInstructions(InsnFormat[] formats) {
         if (reservedCount == 0) {
@@ -566,8 +566,8 @@ public final class OutputFinisher {
      * problems) is expanded into a series of instances that together
      * perform the proper function.
      * 
-     * @param formats non-null; array of per-instruction format selections
-     * @return non-null; the replacement list
+     * @param formats {@code non-null;} array of per-instruction format selections
+     * @return {@code non-null;} the replacement list
      */
     private ArrayList<DalvInsn> performExpansion(InsnFormat[] formats) {
         int size = insns.size();
@@ -651,9 +651,9 @@ public final class OutputFinisher {
      * Helper for {@link #assignAddressesAndFixBranches}, which checks
      * the branch target size requirement of each branch instruction
      * to make sure it fits. For instructions that don't fit, this
-     * rewrites them to use a <code>goto</code> of some sort. In the
+     * rewrites them to use a {@code goto} of some sort. In the
      * case of a conditional branch that doesn't fit, the sense of the
-     * test is reversed in order to branch around a <code>goto</code>
+     * test is reversed in order to branch around a {@code goto}
      * to the original target.
      * 
      * @return whether any branches had to be fixed
index d8f76eb..41e3667 100644 (file)
@@ -24,7 +24,7 @@ import com.android.dx.util.FixedSizeList;
  * method to extract an instance out of a {@link DalvInsnList}.
  */
 public final class PositionList extends FixedSizeList {
-    /** non-null; empty instance */
+    /** {@code non-null;} empty instance */
     public static final PositionList EMPTY = new PositionList(0);
 
     /**
@@ -50,10 +50,10 @@ public final class PositionList extends FixedSizeList {
      * Extracts and returns the source position information out of an
      * instruction list.
      * 
-     * @param insns non-null; instructions to convert
+     * @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
-     * @return non-null; the positions list
+     * @return {@code non-null;} the positions list
      */
     public static PositionList make(DalvInsnList insns, int howMuch) {
         switch (howMuch) {
@@ -112,9 +112,9 @@ public final class PositionList extends FixedSizeList {
     }
 
     /**
-     * Constructs an instance. All indices initially contain <code>null</code>.
+     * Constructs an instance. All indices initially contain {@code null}.
      * 
-     * @param size &gt;= 0; the size of the list
+     * @param size {@code >= 0;} the size of the list
      */
     public PositionList(int size) {
         super(size);
@@ -123,10 +123,10 @@ 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</code>.
+     * do that, this will throw {@code NullPointerException}.
      * 
-     * @param n &gt;= 0, &lt; size(); which index
-     * @return non-null; element at that index
+     * @param n {@code >= 0, < size();} which index
+     * @return {@code non-null;} element at that index
      */
     public Entry get(int n) {
         return (Entry) get0(n);
@@ -135,8 +135,8 @@ public final class PositionList extends FixedSizeList {
     /**
      * Sets the entry at the given index.
      * 
-     * @param n &gt;= 0, &lt; size(); which index
-     * @param entry non-null; the entry to set at <code>n</code>
+     * @param n {@code >= 0, < size();} which index
+     * @param entry {@code non-null;} the entry to set at {@code n}
      */
     public void set(int n, Entry entry) {
         set0(n, entry);
@@ -146,17 +146,17 @@ public final class PositionList extends FixedSizeList {
      * Entry in a position list.
      */
     public static class Entry {
-        /** &gt;= 0; address of this entry */
+        /** {@code >= 0;} address of this entry */
         private final int address;
 
-        /** non-null; corresponding source position information */
+        /** {@code non-null;} corresponding source position information */
         private final SourcePosition position;
 
         /**
          * Constructs an instance.
          * 
-         * @param address &gt;= 0; address of this entry
-         * @param position non-null; corresponding source position information
+         * @param address {@code >= 0;} address of this entry
+         * @param position {@code non-null;} corresponding source position information
          */
         public Entry (int address, SourcePosition position) {
             if (address < 0) {
@@ -174,7 +174,7 @@ public final class PositionList extends FixedSizeList {
         /**
          * Gets the address.
          * 
-         * @return &gt;= 0; the address
+         * @return {@code >= 0;} the address
          */
         public int getAddress() {
             return address;
@@ -183,7 +183,7 @@ public final class PositionList extends FixedSizeList {
         /**
          * Gets the source position information.
          * 
-         * @return non-null; the position information
+         * @return {@code non-null;} the position information
          */
         public SourcePosition getPosition() {
             return position;
index 8ad0e64..0385467 100644 (file)
@@ -35,7 +35,7 @@ import java.util.HashMap;
  * {@link Dop} instances.
  */
 public final class RopToDop {
-    /** non-null; map from all the common rops to dalvik opcodes */
+    /** {@code non-null;} map from all the common rops to dalvik opcodes */
     private static final HashMap<Rop, Dop> MAP;
 
     /**
@@ -278,7 +278,7 @@ public final class RopToDop {
      * Returns the dalvik opcode appropriate for the given register-based
      * instruction.
      * 
-     * @param insn non-null; the original instruction
+     * @param insn {@code non-null;} the original instruction
      * @return the corresponding dalvik opcode; one of the constants in
      * {@link Dops}
      */
index f3dfe0b..9f47b13 100644 (file)
@@ -46,7 +46,7 @@ import java.util.ArrayList;
  * #translate} method is the thing to call on this class.
  */
 public final class RopTranslator {
-    /** non-null; method to translate */
+    /** {@code non-null;} method to translate */
     private final RopMethod method;
 
     /**
@@ -55,22 +55,22 @@ public final class RopTranslator {
      */
     private final int positionInfo;
 
-    /** null-ok; local variable info to use */
+    /** {@code null-ok;} local variable info to use */
     private final LocalVariableInfo locals;
 
-    /** non-null; container for all the address objects for the method */
+    /** {@code non-null;} container for all the address objects for the method */
     private final BlockAddresses addresses;
 
-    /** non-null; list of output instructions in-progress */
+    /** {@code non-null;} list of output instructions in-progress */
     private final OutputCollector output;
 
-    /** non-null; visitor to use during translation */
+    /** {@code non-null;} visitor to use during translation */
     private final TranslationVisitor translationVisitor;
 
-    /** &gt;= 0; register count for the method */
+    /** {@code >= 0;} register count for the method */
     private final int regCount;
 
-    /** null-ok; block output order; becomes non-null in {@link #pickOrder} */
+    /** {@code null-ok;} block output order; becomes non-null in {@link #pickOrder} */
     private int[] order;
 
     /** size, in register units, of all the parameters to this method */
@@ -86,13 +86,13 @@ public final class RopTranslator {
      * Translates a {@link RopMethod}. This may modify the given
      * input.
      * 
-     * @param method non-null; the original method
+     * @param method {@code non-null;} the original method
      * @param positionInfo how much position info to preserve; one of the
      * static constants in {@link PositionList}
-     * @param locals null-ok; local variable information to use
+     * @param locals {@code null-ok;} local variable information to use
      * @param paramSize size, in register units, of all the parameters to
      * this method
-     * @return non-null; the translated version
+     * @return {@code non-null;} the translated version
      */
     public static DalvCode translate(RopMethod method, int positionInfo,
                                      LocalVariableInfo locals, int paramSize) {
@@ -105,10 +105,10 @@ public final class RopTranslator {
     /**
      * Constructs an instance. This method is private. Use {@link #translate}.
      * 
-     * @param method non-null; the original method
+     * @param method {@code non-null;} the original method
      * @param positionInfo how much position info to preserve; one of the
      * static constants in {@link PositionList}
-     * @param locals null-ok; local variable information to use
+     * @param locals {@code null-ok;} local variable information to use
      * @param paramSize size, in register units, of all the parameters to
      * this method
      */
@@ -177,7 +177,7 @@ public final class RopTranslator {
 
         /*
          * We almost could just check the first block here, but the
-         * <code>cf</code> layer will put in a second move-param in a
+         * {@code cf} layer will put in a second move-param in a
          * subsequent block in the case of synchronized methods.
          */
         method.getBlocks().forEachInsn(new Insn.BaseVisitor() {
@@ -199,7 +199,7 @@ public final class RopTranslator {
     /**
      * Does the translation and returns the result.
      * 
-     * @return non-null; the result
+     * @return {@code non-null;} the result
      */
     private DalvCode translateAndGetResult() {
         pickOrder();
@@ -232,9 +232,9 @@ public final class RopTranslator {
      * Helper for {@link #outputInstructions}, which does the processing
      * and output of one block.
      * 
-     * @param block non-null; the block to process and output
-     * @param nextLabel &gt;= -1; the next block that will be processed, or
-     * <code>-1</code> if there is no next 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
      */
     private void outputBlock(BasicBlock block, int nextLabel) {
         // Append the code address for this block.
@@ -440,8 +440,8 @@ public final class RopTranslator {
      * two register sources, and have a source equal to the result,
      * place that source first.
      *
-     * @param insn non-null; instruction in question
-     * @return non-null; the instruction's complete register list
+     * @param insn {@code non-null;} instruction in question
+     * @return {@code non-null;} the instruction's complete register list
      */
     private static RegisterSpecList getRegs(Insn insn) {
         return getRegs(insn, insn.getResult());
@@ -453,9 +453,9 @@ public final class RopTranslator {
      * two register sources, and have a source equal to the result,
      * place that source first.
      *
-     * @param insn non-null; instruction in question
-     * @param resultReg null-ok; the real result to use (ignore the insn's)
-     * @return non-null; the instruction's complete register list
+     * @param insn {@code non-null;} instruction in question
+     * @param resultReg {@code null-ok;} the real result to use (ignore the insn's)
+     * @return {@code non-null;} the instruction's complete register list
      */
     private static RegisterSpecList getRegs(Insn insn,
             RegisterSpec resultReg) {
@@ -486,14 +486,14 @@ public final class RopTranslator {
      * Instruction visitor class for doing the instruction translation per se.
      */
     private class TranslationVisitor implements Insn.Visitor {
-        /** non-null; list of output instructions in-progress */
+        /** {@code non-null;} list of output instructions in-progress */
         private final OutputCollector output;
 
-        /** non-null; basic block being worked on */
+        /** {@code non-null;} basic block being worked on */
         private BasicBlock block;
 
         /**
-         * null-ok; code address for the salient last instruction of the
+         * {@code null-ok;} code address for the salient last instruction of the
          * block (used before switches and throwing instructions) 
          */
         private CodeAddress lastAddress;
@@ -501,7 +501,7 @@ public final class RopTranslator {
         /**
          * Constructs an instance.
          * 
-         * @param output non-null; destination for instruction output
+         * @param output {@code non-null;} destination for instruction output
          */
         public TranslationVisitor(OutputCollector output) {
             this.output = output;
@@ -510,8 +510,8 @@ public final class RopTranslator {
         /**
          * Sets the block currently being worked on.
          * 
-         * @param block non-null; the block
-         * @param lastAddress non-null; code address for the salient
+         * @param block {@code non-null;} the block
+         * @param lastAddress {@code non-null;} code address for the salient
          * last instruction of the block
          */
         public void setBlock(BasicBlock block, CodeAddress lastAddress) {
@@ -654,7 +654,7 @@ public final class RopTranslator {
          * the RegisterSpec of the result of the move-result-pseudo at the
          * top of that block or null if none.
          *
-         * @return null-ok; result of move-result-pseudo at the beginning of
+         * @return {@code null-ok;} result of move-result-pseudo at the beginning of
          * primary successor
          */
         private RegisterSpec getNextMoveResultPseudo()
@@ -783,7 +783,7 @@ public final class RopTranslator {
         /**
          * Adds to the output.
          * 
-         * @param insn non-null; instruction to add
+         * @param insn {@code non-null;} instruction to add
          */
         protected void addOutput(DalvInsn insn) {
             output.add(insn);
@@ -792,7 +792,7 @@ public final class RopTranslator {
         /**
          * Adds to the output suffix.
          * 
-         * @param insn non-null; instruction to add
+         * @param insn {@code non-null;} instruction to add
          */
         protected void addOutputSuffix(DalvInsn insn) {
             output.addSuffix(insn);
@@ -805,14 +805,14 @@ public final class RopTranslator {
      */
     private class LocalVariableAwareTranslationVisitor
             extends TranslationVisitor {
-        /** non-null; local variable info */
+        /** {@code non-null;} local variable info */
         private LocalVariableInfo locals;
 
         /**
          * Constructs an instance.
          * 
-         * @param output non-null; destination for instruction output
-         * @param locals non-null; the local variable info
+         * @param output {@code non-null;} destination for instruction output
+         * @param locals {@code non-null;} the local variable info
          */
         public LocalVariableAwareTranslationVisitor(OutputCollector output,
                                                     LocalVariableInfo locals) {
@@ -859,7 +859,7 @@ public final class RopTranslator {
          * Adds a {@link LocalStart} to the output if the given
          * instruction in fact introduces a local variable.
          * 
-         * @param insn non-null; instruction in question
+         * @param insn {@code non-null;} instruction in question
          */
         public void addIntroductionIfNecessary(Insn insn) {
             RegisterSpec spec = locals.getAssignment(insn);
index ba20409..5e7b259 100644 (file)
@@ -26,11 +26,11 @@ import com.android.dx.rop.code.SourcePosition;
 public final class SimpleInsn extends FixedSizeInsn {
     /**
      * Constructs an instance. The output address of this instance is initially
-     * unknown (<code>-1</code>).
+     * unknown ({@code -1}).
      * 
      * @param opcode the opcode; one of the constants from {@link Dops}
-     * @param position non-null; source position
-     * @param registers non-null; register list, including a
+     * @param position {@code non-null;} source position
+     * @param registers {@code non-null;} register list, including a
      * result register if appropriate (that is, registers may be either
      * ins or outs)
      */
index 1240f3f..23e25aa 100644 (file)
@@ -35,22 +35,22 @@ 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;
     
-    /** non-null; method to build the list for */
+    /** {@code non-null;} method to build the list for */
     private final RopMethod method;
 
-    /** non-null; block output order */
+    /** {@code non-null;} block output order */
     private final int[] order;
 
-    /** non-null; address objects for each block */
+    /** {@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 non-null; method to build the list for
-     * @param order non-null; block output order
-     * @param addresses non-null; address objects for each block
+     * @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
      */
     public StdCatchBuilder(RopMethod method, int[] order,
             BlockAddresses addresses) {
@@ -115,10 +115,10 @@ public final class StdCatchBuilder implements CatchBuilder {
     /**
      * Builds and returns the catch table for a given method.
      * 
-     * @param method non-null; method to build the list for
-     * @param order non-null; block output order
-     * @param addresses non-null; address objects for each block
-     * @return non-null; the constructed table
+     * @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
+     * @return {@code non-null;} the constructed table
      */
     public static CatchTable build(RopMethod method, int[] order,
             BlockAddresses addresses) {
@@ -210,9 +210,9 @@ public final class StdCatchBuilder implements CatchBuilder {
     /**
      * Makes the {@link CatchHandlerList} for the given basic block.
      * 
-     * @param block non-null; block to get entries for
-     * @param addresses non-null; address objects for each block
-     * @return non-null; array of entries
+     * @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
      */
     private static CatchHandlerList handlersFor(BasicBlock block,
             BlockAddresses addresses) {
@@ -267,10 +267,10 @@ public final class StdCatchBuilder implements CatchBuilder {
      * Makes a {@link CatchTable#Entry} for the given block range and
      * handlers.
      *
-     * @param start non-null; the start block for the range (inclusive)
-     * @param end non-null; the start block for the range (also inclusive)
-     * @param handlers non-null; the handlers for the range
-     * @param addresses non-null; address objects for each block
+     * @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 handlers {@code non-null;} the handlers for the range
+     * @param addresses {@code non-null;} address objects for each block
      */
     private static CatchTable.Entry makeEntry(BasicBlock start,
             BasicBlock end, CatchHandlerList handlers,
@@ -293,10 +293,10 @@ public final class StdCatchBuilder implements CatchBuilder {
      * for a catch handler. This is true as long as the covered range is
      * under 65536 code units.
      * 
-     * @param start non-null; the start block for the range (inclusive)
-     * @param end non-null; the start block for the range (also inclusive)
-     * @param addresses non-null; address objects for each block
-     * @return <code>true</code> if the range is valid as a catch range
+     * @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
+     * @return {@code true} if the range is valid as a catch range
      */
     private static boolean rangeIsValid(BasicBlock start, BasicBlock end,
             BlockAddresses addresses) {
index 1aaafa9..e5a8da4 100644 (file)
@@ -29,16 +29,16 @@ import com.android.dx.util.IntList;
  */
 public final class SwitchData extends VariableSizeInsn {
     /**
-     * non-null; address representing the instruction that uses this
+     * {@code non-null;} address representing the instruction that uses this
      * instance 
      */
     private final CodeAddress user;
 
-    /** non-null; sorted list of switch cases (keys) */
+    /** {@code non-null;} sorted list of switch cases (keys) */
     private final IntList cases;
 
     /**
-     * non-null; corresponding list of code addresses; the branch
+     * {@code non-null;} corresponding list of code addresses; the branch
      * target for each case 
      */
     private final CodeAddress[] targets;
@@ -48,13 +48,13 @@ public final class SwitchData extends VariableSizeInsn {
 
     /**
      * Constructs an instance. The output address of this instance is initially
-     * unknown (<code>-1</code>).
+     * unknown ({@code -1}).
      * 
-     * @param position non-null; source position
-     * @param user non-null; address representing the instruction that
+     * @param position {@code non-null;} source position
+     * @param user {@code non-null;} address representing the instruction that
      * uses this instance
-     * @param cases non-null; sorted list of switch cases (keys)
-     * @param targets non-null; corresponding list of code addresses; the
+     * @param cases {@code non-null;} sorted list of switch cases (keys)
+     * @param targets {@code non-null;} corresponding list of code addresses; the
      * branch target for each case
      */
     public SwitchData(SourcePosition position, CodeAddress user,
@@ -151,7 +151,7 @@ public final class SwitchData extends VariableSizeInsn {
     /**
      * Returns whether or not this instance's data will be output as packed.
      * 
-     * @return <code>true</code> iff the data is to be packed
+     * @return {@code true} iff the data is to be packed
      */
     public boolean isPacked() {
         return packed;
@@ -202,8 +202,8 @@ public final class SwitchData extends VariableSizeInsn {
      * Gets the size of a packed table for the given cases, in 16-bit code
      * units.
      * 
-     * @param cases non-null; sorted list of cases
-     * @return &gt;= -1; the packed table size or <code>-1</code> if the
+     * @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
      */
     private static long packedCodeSize(IntList cases) {
@@ -219,8 +219,8 @@ public final class SwitchData extends VariableSizeInsn {
      * Gets the size of a sparse table for the given cases, in 16-bit code
      * units.
      * 
-     * @param cases non-null; sorted list of cases
-     * @return &gt; 0; the sparse table size
+     * @param cases {@code non-null;} sorted list of cases
+     * @return {@code > 0;} the sparse table size
      */
     private static long sparseCodeSize(IntList cases) {
         int sz = cases.size();
@@ -231,8 +231,8 @@ public final class SwitchData extends VariableSizeInsn {
     /**
      * Determines whether the given list of cases warrant being packed.
      * 
-     * @param cases non-null; sorted list of cases
-     * @return <code>true</code> iff the table encoding the cases
+     * @param cases {@code non-null;} sorted list of cases
+     * @return {@code true} iff the table encoding the cases
      * should be packed
      */
     private static boolean shouldPack(IntList cases) {
index 5620795..0faaada 100644 (file)
@@ -23,20 +23,20 @@ import com.android.dx.rop.code.SourcePosition;
  * Instruction which has a single branch target.
  */
 public final class TargetInsn extends FixedSizeInsn {
-    /** non-null; the branch target */
+    /** {@code non-null;} the branch target */
     private CodeAddress target;
 
     /**
      * Constructs an instance. The output address of this instance is initially
-     * unknown (<code>-1</code>), and the target is initially
-     * <code>null</code>.
+     * unknown ({@code -1}), and the target is initially
+     * {@code null}.
      * 
      * @param opcode the opcode; one of the constants from {@link Dops}
-     * @param position non-null; source position
-     * @param registers non-null; register list, including a
+     * @param position {@code non-null;} source position
+     * @param registers {@code non-null;} register list, including a
      * result register if appropriate (that is, registers may be either
      * ins or outs)
-     * @param target non-null; the branch target
+     * @param target {@code non-null;} the branch target
      */
     public TargetInsn(Dop opcode, SourcePosition position,
                       RegisterSpecList registers, CodeAddress target) {
@@ -64,12 +64,12 @@ public final class TargetInsn extends FixedSizeInsn {
     /**
      * Returns an instance that is just like this one, except that its
      * opcode has the opposite sense (as a test; e.g. a
-     * <code>lt</code> test becomes a <code>ge</code>), and its branch
+     * {@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 non-null; the new branch target
-     * @return non-null; an appropriately-constructed instance
+     * @param target {@code non-null;} the new branch target
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public TargetInsn withNewTargetAndReversed(CodeAddress target) {
         Dop opcode = getOpcode().getOppositeTest();
@@ -80,7 +80,7 @@ public final class TargetInsn extends FixedSizeInsn {
     /**
      * Gets the unique branch target of this instruction.
      * 
-     * @return non-null; the branch target
+     * @return {@code non-null;} the branch target
      */
     public CodeAddress getTarget() {
         return target;
@@ -90,9 +90,9 @@ public final class TargetInsn extends FixedSizeInsn {
      * Gets the target address of this instruction. This is only valid
      * to call if the target instruction has been assigned an address,
      * and it is merely a convenient shorthand for
-     * <code>getTarget().getAddress()</code>.
+     * {@code getTarget().getAddress()}.
      * 
-     * @return &gt;= 0; the target address
+     * @return {@code >= 0;} the target address
      */
     public int getTargetAddress() {
         return target.getAddress();
@@ -102,7 +102,7 @@ public final class TargetInsn extends FixedSizeInsn {
      * Gets the branch offset of this instruction. This is only valid to
      * 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()</code>.
+     * {@code getTargetAddress() - getAddress()}.
      * 
      * @return the branch offset
      */
@@ -113,8 +113,8 @@ public final class TargetInsn extends FixedSizeInsn {
     /**
      * Returns whether the target offset is known.
      * 
-     * @return <code>true</code> if the target offset is known or
-     * <code>false</code> if not
+     * @return {@code true} if the target offset is known or
+     * {@code false} if not
      */
     public boolean hasTargetOffset() {
         return hasAddress() && target.hasAddress();
index 7884249..889a50c 100644 (file)
@@ -25,10 +25,10 @@ import com.android.dx.rop.code.SourcePosition;
 public abstract class VariableSizeInsn extends DalvInsn {
     /**
      * Constructs an instance. The output address of this instance is initially
-     * unknown (<code>-1</code>).
+     * unknown ({@code -1}).
      * 
-     * @param position non-null; source position
-     * @param registers non-null; source registers
+     * @param position {@code non-null;} source position
+     * @param registers {@code non-null;} source registers
      */
     public VariableSizeInsn(SourcePosition position,
                             RegisterSpecList registers) {
index 2ddb181..198bebf 100644 (file)
@@ -28,9 +28,9 @@ import com.android.dx.util.AnnotatedOutput;
 public abstract class ZeroSizeInsn extends DalvInsn {
     /**
      * Constructs an instance. The output address of this instance is initially
-     * unknown (<code>-1</code>).
+     * unknown ({@code -1}).
      * 
-     * @param position non-null; source position
+     * @param position {@code non-null;} source position
      */
     public ZeroSizeInsn(SourcePosition position) {
         super(Dops.SPECIAL_FORMAT, position, RegisterSpecList.EMPTY);
index 8551012..82b731d 100644 (file)
@@ -22,11 +22,11 @@ import com.android.dx.dex.code.TargetInsn;
 import com.android.dx.util.AnnotatedOutput;
 
 /**
- * Instruction format <code>10t</code>. See the instruction format spec
+ * Instruction format {@code 10t}. See the instruction format spec
  * for details.
  */
 public final class Form10t extends InsnFormat {
-    /** non-null; unique instance of this class */
+    /** {@code non-null;} unique instance of this class */
     public static final InsnFormat THE_ONE = new Form10t();
 
     /**
index 7dc7c43..c7a22a6 100644 (file)
@@ -22,11 +22,11 @@ import com.android.dx.dex.code.SimpleInsn;
 import com.android.dx.util.AnnotatedOutput;
 
 /**
- * Instruction format <code>10x</code>. See the instruction format spec
+ * Instruction format {@code 10x}. See the instruction format spec
  * for details.
  */
 public final class Form10x extends InsnFormat {
-    /** non-null; unique instance of this class */
+    /** {@code non-null;} unique instance of this class */
     public static final InsnFormat THE_ONE = new Form10x();
 
     /**
index b94038b..d63fc6f 100644 (file)
@@ -25,11 +25,11 @@ import com.android.dx.rop.cst.CstLiteralBits;
 import com.android.dx.util.AnnotatedOutput;
 
 /**
- * Instruction format <code>11n</code>. See the instruction format spec
+ * Instruction format {@code 11n}. See the instruction format spec
  * for details.
  */
 public final class Form11n extends InsnFormat {
-    /** non-null; unique instance of this class */
+    /** {@code non-null;} unique instance of this class */
     public static final InsnFormat THE_ONE = new Form11n();
 
     /**
index d656147..b4acc1a 100644 (file)
@@ -23,11 +23,11 @@ import com.android.dx.rop.code.RegisterSpecList;
 import com.android.dx.util.AnnotatedOutput;
 
 /**
- * Instruction format <code>11x</code>. See the instruction format spec
+ * Instruction format {@code 11x}. See the instruction format spec
  * for details.
  */
 public final class Form11x extends InsnFormat {
-    /** non-null; unique instance of this class */
+    /** {@code non-null;} unique instance of this class */
     public static final InsnFormat THE_ONE = new Form11x();
 
     /**
index 3ed8ce9..c7754be 100644 (file)
@@ -25,11 +25,11 @@ import com.android.dx.rop.code.RegisterSpecList;
 import com.android.dx.util.AnnotatedOutput;
 
 /**
- * Instruction format <code>12x</code>. See the instruction format spec
+ * Instruction format {@code 12x}. See the instruction format spec
  * for details.
  */
 public final class Form12x extends InsnFormat {
-    /** non-null; unique instance of this class */
+    /** {@code non-null;} unique instance of this class */
     public static final InsnFormat THE_ONE = new Form12x();
 
     /**
index 341bef3..0b5a3b2 100644 (file)
@@ -22,11 +22,11 @@ import com.android.dx.dex.code.TargetInsn;
 import com.android.dx.util.AnnotatedOutput;
 
 /**
- * Instruction format <code>20t</code>. See the instruction format spec
+ * Instruction format {@code 20t}. See the instruction format spec
  * for details.
  */
 public final class Form20t extends InsnFormat {
-    /** non-null; unique instance of this class */
+    /** {@code non-null;} unique instance of this class */
     public static final InsnFormat THE_ONE = new Form20t();
 
     /**
index 5695e7a..ed1ec3c 100644 (file)
@@ -28,11 +28,11 @@ import com.android.dx.rop.cst.CstType;
 import com.android.dx.util.AnnotatedOutput;
 
 /**
- * Instruction format <code>21c</code>. See the instruction format spec
+ * Instruction format {@code 21c}. See the instruction format spec
  * for details.
  */
 public final class Form21c extends InsnFormat {
-    /** non-null; unique instance of this class */
+    /** {@code non-null;} unique instance of this class */
     public static final InsnFormat THE_ONE = new Form21c();
 
     /**
index cf4b471..e0bd751 100644 (file)
@@ -25,11 +25,11 @@ import com.android.dx.rop.cst.CstLiteralBits;
 import com.android.dx.util.AnnotatedOutput;
 
 /**
- * Instruction format <code>21h</code>. See the instruction format spec
+ * Instruction format {@code 21h}. See the instruction format spec
  * for details.
  */
 public final class Form21h extends InsnFormat {
-    /** non-null; unique instance of this class */
+    /** {@code non-null;} unique instance of this class */
     public static final InsnFormat THE_ONE = new Form21h();
 
     /**
index df10f80..a03ee43 100644 (file)
@@ -25,11 +25,11 @@ import com.android.dx.rop.cst.CstLiteralBits;
 import com.android.dx.util.AnnotatedOutput;
 
 /**
- * Instruction format <code>21s</code>. See the instruction format spec
+ * Instruction format {@code 21s}. See the instruction format spec
  * for details.
  */
 public final class Form21s extends InsnFormat {
-    /** non-null; unique instance of this class */
+    /** {@code non-null;} unique instance of this class */
     public static final InsnFormat THE_ONE = new Form21s();
 
     /**
index 03f2ddf..f0ce644 100644 (file)
@@ -23,11 +23,11 @@ import com.android.dx.rop.code.RegisterSpecList;
 import com.android.dx.util.AnnotatedOutput;
 
 /**
- * Instruction format <code>21t</code>. See the instruction format spec
+ * Instruction format {@code 21t}. See the instruction format spec
  * for details.
  */
 public final class Form21t extends InsnFormat {
-    /** non-null; unique instance of this class */
+    /** {@code non-null;} unique instance of this class */
     public static final InsnFormat THE_ONE = new Form21t();
 
     /**
index e2a777f..2884fbb 100644 (file)
@@ -25,11 +25,11 @@ import com.android.dx.rop.cst.CstLiteralBits;
 import com.android.dx.util.AnnotatedOutput;
 
 /**
- * Instruction format <code>22b</code>. See the instruction format spec
+ * Instruction format {@code 22b}. See the instruction format spec
  * for details.
  */
 public final class Form22b extends InsnFormat {
-    /** non-null; unique instance of this class */
+    /** {@code non-null;} unique instance of this class */
     public static final InsnFormat THE_ONE = new Form22b();
 
     /**
index 547eea8..e77677f 100644 (file)
@@ -27,11 +27,11 @@ import com.android.dx.rop.cst.CstType;
 import com.android.dx.util.AnnotatedOutput;
 
 /**
- * Instruction format <code>22c</code>. See the instruction format spec
+ * Instruction format {@code 22c}. See the instruction format spec
  * for details.
  */
 public final class Form22c extends InsnFormat {
-    /** non-null; unique instance of this class */
+    /** {@code non-null;} unique instance of this class */
     public static final InsnFormat THE_ONE = new Form22c();
 
     /**
index 3ed173f..5964217 100644 (file)
@@ -25,11 +25,11 @@ import com.android.dx.rop.cst.CstLiteralBits;
 import com.android.dx.util.AnnotatedOutput;
 
 /**
- * Instruction format <code>22s</code>. See the instruction format spec
+ * Instruction format {@code 22s}. See the instruction format spec
  * for details.
  */
 public final class Form22s extends InsnFormat {
-    /** non-null; unique instance of this class */
+    /** {@code non-null;} unique instance of this class */
     public static final InsnFormat THE_ONE = new Form22s();
 
     /**
index 1034b92..1577803 100644 (file)
@@ -23,11 +23,11 @@ import com.android.dx.rop.code.RegisterSpecList;
 import com.android.dx.util.AnnotatedOutput;
 
 /**
- * Instruction format <code>22t</code>. See the instruction format spec
+ * Instruction format {@code 22t}. See the instruction format spec
  * for details.
  */
 public final class Form22t extends InsnFormat {
-    /** non-null; unique instance of this class */
+    /** {@code non-null;} unique instance of this class */
     public static final InsnFormat THE_ONE = new Form22t();
 
     /**
index ee91e85..b7ce4e7 100644 (file)
@@ -23,11 +23,11 @@ import com.android.dx.rop.code.RegisterSpecList;
 import com.android.dx.util.AnnotatedOutput;
 
 /**
- * Instruction format <code>22x</code>. See the instruction format spec
+ * Instruction format {@code 22x}. See the instruction format spec
  * for details.
  */
 public final class Form22x extends InsnFormat {
-    /** non-null; unique instance of this class */
+    /** {@code non-null;} unique instance of this class */
     public static final InsnFormat THE_ONE = new Form22x();
 
     /**
index c0a4482..64dd6b0 100644 (file)
@@ -23,11 +23,11 @@ import com.android.dx.rop.code.RegisterSpecList;
 import com.android.dx.util.AnnotatedOutput;
 
 /**
- * Instruction format <code>23x</code>. See the instruction format spec
+ * Instruction format {@code 23x}. See the instruction format spec
  * for details.
  */
 public final class Form23x extends InsnFormat {
-    /** non-null; unique instance of this class */
+    /** {@code non-null;} unique instance of this class */
     public static final InsnFormat THE_ONE = new Form23x();
 
     /**
index 32e2efa..af0a699 100644 (file)
@@ -22,11 +22,11 @@ import com.android.dx.dex.code.TargetInsn;
 import com.android.dx.util.AnnotatedOutput;
 
 /**
- * Instruction format <code>30t</code>. See the instruction format spec
+ * Instruction format {@code 30t}. See the instruction format spec
  * for details.
  */
 public final class Form30t extends InsnFormat {
-    /** non-null; unique instance of this class */
+    /** {@code non-null;} unique instance of this class */
     public static final InsnFormat THE_ONE = new Form30t();
 
     /**
index 5837009..0c983c5 100644 (file)
@@ -28,11 +28,11 @@ import com.android.dx.rop.cst.CstType;
 import com.android.dx.util.AnnotatedOutput;
 
 /**
- * Instruction format <code>31c</code>. See the instruction format spec
+ * Instruction format {@code 31c}. See the instruction format spec
  * for details.
  */
 public final class Form31c extends InsnFormat {
-    /** non-null; unique instance of this class */
+    /** {@code non-null;} unique instance of this class */
     public static final InsnFormat THE_ONE = new Form31c();
 
     /**
index 2855bcb..c893a12 100644 (file)
@@ -25,11 +25,11 @@ import com.android.dx.rop.cst.CstLiteralBits;
 import com.android.dx.util.AnnotatedOutput;
 
 /**
- * Instruction format <code>31i</code>. See the instruction format spec
+ * Instruction format {@code 31i}. See the instruction format spec
  * for details.
  */
 public final class Form31i extends InsnFormat {
-    /** non-null; unique instance of this class */
+    /** {@code non-null;} unique instance of this class */
     public static final InsnFormat THE_ONE = new Form31i();
 
     /**
index 5472687..682408c 100644 (file)
@@ -23,11 +23,11 @@ import com.android.dx.rop.code.RegisterSpecList;
 import com.android.dx.util.AnnotatedOutput;
 
 /**
- * Instruction format <code>31t</code>. See the instruction format spec
+ * Instruction format {@code 31t}. See the instruction format spec
  * for details.
  */
 public final class Form31t extends InsnFormat {
-    /** non-null; unique instance of this class */
+    /** {@code non-null;} unique instance of this class */
     public static final InsnFormat THE_ONE = new Form31t();
 
     /**
index 9c52d93..4a981ee 100644 (file)
@@ -23,11 +23,11 @@ import com.android.dx.rop.code.RegisterSpecList;
 import com.android.dx.util.AnnotatedOutput;
 
 /**
- * Instruction format <code>32x</code>. See the instruction format spec
+ * Instruction format {@code 32x}. See the instruction format spec
  * for details.
  */
 public final class Form32x extends InsnFormat {
-    /** non-null; unique instance of this class */
+    /** {@code non-null;} unique instance of this class */
     public static final InsnFormat THE_ONE = new Form32x();
 
     /**
index 6be55fc..411e3c3 100644 (file)
@@ -28,11 +28,11 @@ import com.android.dx.rop.type.Type;
 import com.android.dx.util.AnnotatedOutput;
 
 /**
- * Instruction format <code>35c</code>. See the instruction format spec
+ * Instruction format {@code 35c}. See the instruction format spec
  * for details.
  */
 public final class Form35c extends InsnFormat {
-    /** non-null; unique instance of this class */
+    /** {@code non-null;} unique instance of this class */
     public static final InsnFormat THE_ONE = new Form35c();
 
     /** Maximal number of operands */
@@ -120,12 +120,12 @@ public final class Form35c extends InsnFormat {
 
     /**
      * Gets the number of words required for the given register list, where
-     * category-2 values count as two words. Return <code>-1</code> if the
+     * 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 non-null; the register list in question
-     * @return &gt;= -1; the number of words required, or <code>-1</code> 
+     * @param regs {@code non-null;} the register list in question
+     * @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) {
@@ -161,8 +161,8 @@ public final class Form35c extends InsnFormat {
      * entries. This returns the original list if no modification is
      * required
      * 
-     * @param orig non-null; the original list
-     * @return non-null; the list with the described transformation
+     * @param orig {@code non-null;} the original list
+     * @return {@code non-null;} the list with the described transformation
      */
     private static RegisterSpecList explicitize(RegisterSpecList orig) {
         int wordCount = wordCount(orig);
index 0accbc2..2d185cf 100644 (file)
@@ -27,11 +27,11 @@ import com.android.dx.rop.cst.CstType;
 import com.android.dx.util.AnnotatedOutput;
 
 /**
- * Instruction format <code>3rc</code>. See the instruction format spec
+ * Instruction format {@code 3rc}. See the instruction format spec
  * for details.
  */
 public final class Form3rc extends InsnFormat {
-    /** non-null; unique instance of this class */
+    /** {@code non-null;} unique instance of this class */
     public static final InsnFormat THE_ONE = new Form3rc();
 
     /**
index 09a32f6..9e3ab6a 100644 (file)
@@ -26,11 +26,11 @@ import com.android.dx.rop.cst.CstLiteralBits;
 import com.android.dx.util.AnnotatedOutput;
 
 /**
- * Instruction format <code>51l</code>. See the instruction format spec
+ * Instruction format {@code 51l}. See the instruction format spec
  * for details.
  */
 public final class Form51l extends InsnFormat {
-    /** non-null; unique instance of this class */
+    /** {@code non-null;} unique instance of this class */
     public static final InsnFormat THE_ONE = new Form51l();
 
     /**
index 79efd67..8a2e5ed 100644 (file)
@@ -27,10 +27,10 @@ import com.android.dx.util.AnnotatedOutput;
  * lists. Most of the overridden methods on this class end up throwing
  * exceptions, as code should know (implicitly or explicitly) to avoid
  * using this class. The one exception is {@link #isCompatible}, which
- * always returns <code>true</code>.
+ * always returns {@code true}.
  */
 public final class SpecialFormat extends InsnFormat {
-    /** non-null; unique instance of this class */
+    /** {@code non-null;} unique instance of this class */
     public static final InsnFormat THE_ONE = new SpecialFormat();
 
     /**
index 43ac362..08422bc 100644 (file)
@@ -46,20 +46,20 @@ public final class AnnotationItem extends OffsettedItem {
     /** the required alignment for instances of this class */
     private static final int ALIGNMENT = 1;
 
-    /** non-null; unique instance of {@link #TypeIdSorter} */
+    /** {@code non-null;} unique instance of {@link #TypeIdSorter} */
     private static final TypeIdSorter TYPE_ID_SORTER = new TypeIdSorter();
     
-    /** non-null; the annotation to represent */
+    /** {@code non-null;} the annotation to represent */
     private final Annotation annotation;
 
     /**
-     * null-ok; type reference for the annotation type; set during
+     * {@code null-ok;} type reference for the annotation type; set during
      * {@link #addContents}
      */
     private TypeIdItem type;
 
     /**
-     * null-ok; encoded form, ready for writing to a file; set during
+     * {@code null-ok;} encoded form, ready for writing to a file; set during
      * {@link #place0}
      */
     private byte[] encodedForm;
@@ -88,7 +88,7 @@ public final class AnnotationItem extends OffsettedItem {
      * ignoring all other aspects of the elements. This is only valid
      * to use after type id indices are known.
      * 
-     * @param array non-null; array to sort
+     * @param array {@code non-null;} array to sort
      */
     public static void sortByTypeIdIndex(AnnotationItem[] array) {
         Arrays.sort(array, TYPE_ID_SORTER);
@@ -97,7 +97,7 @@ public final class AnnotationItem extends OffsettedItem {
     /**
      * Constructs an instance.
      * 
-     * @param annotation non-null; annotation to represent
+     * @param annotation {@code non-null;} annotation to represent
      */
     public AnnotationItem(Annotation annotation) {
         /*
@@ -167,8 +167,8 @@ public final class AnnotationItem extends OffsettedItem {
      * output, that consumes no bytes of output. This is for annotating
      * a reference to this instance at the point of the reference.
      * 
-     * @param out non-null; where to output to
-     * @param prefix non-null; prefix for each line of output
+     * @param out {@code non-null;} where to output to
+     * @param prefix {@code non-null;} prefix for each line of output
      */
     public void annotateTo(AnnotatedOutput out, String prefix) {
         out.annotate(0, prefix + "visibility: " +
index f03cc08..2ff005a 100644 (file)
@@ -28,14 +28,14 @@ public final class AnnotationSetItem extends OffsettedItem {
     /** the required alignment for instances of this class */
     private static final int ALIGNMENT = 4;
 
-    /** the size of an entry int the set: one <code>uint</code> */
+    /** the size of an entry int the set: one {@code uint} */
     private static final int ENTRY_WRITE_SIZE = 4;
 
-    /** non-null; the set of annotations */
+    /** {@code non-null;} the set of annotations */
     private final Annotations annotations;
     
     /**
-     * non-null; set of annotations as individual items in an array.
+     * {@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
      * writing.
      */
@@ -44,7 +44,7 @@ public final class AnnotationSetItem extends OffsettedItem {
     /**
      * Constructs an instance.
      * 
-     * @param annotations non-null; set of annotations
+     * @param annotations {@code non-null;} set of annotations
      */
     public AnnotationSetItem(Annotations annotations) {
         super(ALIGNMENT, writeSize(annotations));
@@ -62,8 +62,8 @@ public final class AnnotationSetItem extends OffsettedItem {
     /**
      * Gets the write size for the given set.
      * 
-     * @param annotations non-null; the set
-     * @return &gt; 0; the write size
+     * @param annotations {@code non-null;} the set
+     * @return {@code > 0;} the write size
      */
     private static int writeSize(Annotations annotations) {
         // This includes an int size at the start of the list.
@@ -79,7 +79,7 @@ public final class AnnotationSetItem extends OffsettedItem {
     /**
      * Gets the underlying annotations of this instance
      * 
-     * @return non-null; the annotations
+     * @return {@code non-null;} the annotations
      */
     public Annotations getAnnotations() {
         return annotations;
index 422e2f0..1427e6a 100644 (file)
@@ -29,13 +29,13 @@ public final class AnnotationSetRefItem extends OffsettedItem {
     /** write size of this class, in bytes */
     private static final int WRITE_SIZE = 4;
 
-    /** non-null; the annotation set to refer to */
+    /** {@code non-null;} the annotation set to refer to */
     private AnnotationSetItem annotations;
 
     /**
      * Constructs an instance.
      * 
-     * @param annotations non-null; the annotation set to refer to
+     * @param annotations {@code non-null;} the annotation set to refer to
      */
     public AnnotationSetRefItem(AnnotationSetItem annotations) {
         super(ALIGNMENT, WRITE_SIZE);
index c9d7968..8431d35 100644 (file)
@@ -38,41 +38,41 @@ import static com.android.dx.rop.annotation.AnnotationVisibility.*;
  * Utility class for dealing with annotations.
  */
 public final class AnnotationUtils {
-    /** non-null; type for <code>AnnotationDefault</code> annotations */
+    /** {@code non-null;} type for {@code AnnotationDefault} annotations */
     private static final CstType ANNOTATION_DEFAULT_TYPE = 
         CstType.intern(Type.intern("Ldalvik/annotation/AnnotationDefault;"));
 
-    /** non-null; type for <code>EnclosingClass</code> annotations */
+    /** {@code non-null;} type for {@code EnclosingClass} annotations */
     private static final CstType ENCLOSING_CLASS_TYPE = 
         CstType.intern(Type.intern("Ldalvik/annotation/EnclosingClass;"));
 
-    /** non-null; type for <code>EnclosingMethod</code> annotations */
+    /** {@code non-null;} type for {@code EnclosingMethod} annotations */
     private static final CstType ENCLOSING_METHOD_TYPE = 
         CstType.intern(Type.intern("Ldalvik/annotation/EnclosingMethod;"));
 
-    /** non-null; type for <code>InnerClass</code> annotations */
+    /** {@code non-null;} type for {@code InnerClass} annotations */
     private static final CstType INNER_CLASS_TYPE = 
         CstType.intern(Type.intern("Ldalvik/annotation/InnerClass;"));
 
-    /** non-null; type for <code>MemberClasses</code> annotations */
+    /** {@code non-null;} type for {@code MemberClasses} annotations */
     private static final CstType MEMBER_CLASSES_TYPE = 
         CstType.intern(Type.intern("Ldalvik/annotation/MemberClasses;"));
 
-    /** non-null; type for <code>Signature</code> annotations */
+    /** {@code non-null;} type for {@code Signature} annotations */
     private static final CstType SIGNATURE_TYPE = 
         CstType.intern(Type.intern("Ldalvik/annotation/Signature;"));
 
-    /** non-null; type for <code>Throws</code> annotations */
+    /** {@code non-null;} type for {@code Throws} annotations */
     private static final CstType THROWS_TYPE = 
         CstType.intern(Type.intern("Ldalvik/annotation/Throws;"));
 
-    /** non-null; the UTF-8 constant <code>"accessFlags"</code> */
+    /** {@code non-null;} the UTF-8 constant {@code "accessFlags"} */
     private static final CstUtf8 ACCESS_FLAGS_UTF = new CstUtf8("accessFlags");
 
-    /** non-null; the UTF-8 constant <code>"name"</code> */
+    /** {@code non-null;} the UTF-8 constant {@code "name"} */
     private static final CstUtf8 NAME_UTF = new CstUtf8("name");
 
-    /** non-null; the UTF-8 constant <code>"value"</code> */
+    /** {@code non-null;} the UTF-8 constant {@code "value"} */
     private static final CstUtf8 VALUE_UTF = new CstUtf8("value");
 
     /**
@@ -83,10 +83,10 @@ public final class AnnotationUtils {
     }
 
     /**
-     * Constructs a standard <code>AnnotationDefault</code> annotation.
+     * Constructs a standard {@code AnnotationDefault} annotation.
      * 
-     * @param defaults non-null; the defaults, itself as an annotation
-     * @return non-null; the constructed annotation
+     * @param defaults {@code non-null;} the defaults, itself as an annotation
+     * @return {@code non-null;} the constructed annotation
      */
     public static Annotation makeAnnotationDefault(Annotation defaults) {
         Annotation result = new Annotation(ANNOTATION_DEFAULT_TYPE, SYSTEM);
@@ -97,10 +97,10 @@ public final class AnnotationUtils {
     }
 
     /**
-     * Constructs a standard <code>EnclosingClass</code> annotation.
+     * Constructs a standard {@code EnclosingClass} annotation.
      * 
-     * @param clazz non-null; the enclosing class
-     * @return non-null; the annotation
+     * @param clazz {@code non-null;} the enclosing class
+     * @return {@code non-null;} the annotation
      */
     public static Annotation makeEnclosingClass(CstType clazz) {
         Annotation result = new Annotation(ENCLOSING_CLASS_TYPE, SYSTEM);
@@ -111,10 +111,10 @@ public final class AnnotationUtils {
     }
 
     /**
-     * Constructs a standard <code>EnclosingMethod</code> annotation.
+     * Constructs a standard {@code EnclosingMethod} annotation.
      * 
-     * @param method non-null; the enclosing method
-     * @return non-null; the annotation
+     * @param method {@code non-null;} the enclosing method
+     * @return {@code non-null;} the annotation
      */
     public static Annotation makeEnclosingMethod(CstMethodRef method) {
         Annotation result = new Annotation(ENCLOSING_METHOD_TYPE, SYSTEM);
@@ -125,12 +125,12 @@ public final class AnnotationUtils {
     }
 
     /**
-     * Constructs a standard <code>InnerClass</code> annotation.
+     * Constructs a standard {@code InnerClass} annotation.
      * 
-     * @param name null-ok; the original name of the class, or
-     * <code>null</code> to represent an anonymous class
+     * @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
-     * @return non-null; the annotation
+     * @return {@code non-null;} the annotation
      */
     public static Annotation makeInnerClass(CstUtf8 name, int accessFlags) {
         Annotation result = new Annotation(INNER_CLASS_TYPE, SYSTEM);
@@ -145,10 +145,10 @@ public final class AnnotationUtils {
     }
 
     /**
-     * Constructs a standard <code>MemberClasses</code> annotation.
+     * Constructs a standard {@code MemberClasses} annotation.
      * 
-     * @param types non-null; the list of (the types of) the member classes
-     * @return non-null; the annotation
+     * @param types {@code non-null;} the list of (the types of) the member classes
+     * @return {@code non-null;} the annotation
      */
     public static Annotation makeMemberClasses(TypeList types) {
         CstArray array = makeCstArray(types);
@@ -159,10 +159,10 @@ public final class AnnotationUtils {
     }
 
     /**
-     * Constructs a standard <code>Signature</code> annotation.
+     * Constructs a standard {@code Signature} annotation.
      * 
-     * @param signature non-null; the signature string
-     * @return non-null; the annotation
+     * @param signature {@code non-null;} the signature string
+     * @return {@code non-null;} the annotation
      */
     public static Annotation makeSignature(CstUtf8 signature) {
         Annotation result = new Annotation(SIGNATURE_TYPE, SYSTEM);
@@ -221,10 +221,10 @@ public final class AnnotationUtils {
     }
 
     /**
-     * Constructs a standard <code>Throws</code> annotation.
+     * Constructs a standard {@code Throws} annotation.
      * 
-     * @param types non-null; the list of thrown types
-     * @return non-null; the annotation
+     * @param types {@code non-null;} the list of thrown types
+     * @return {@code non-null;} the annotation
      */
     public static Annotation makeThrows(TypeList types) {
         CstArray array = makeCstArray(types);
@@ -237,8 +237,8 @@ public final class AnnotationUtils {
     /**
      * Converts a {@link TypeList} to a {@link CstArray}.
      * 
-     * @param types non-null; the type list
-     * @return non-null; the corresponding array constant
+     * @param types {@code non-null;} the type list
+     * @return {@code non-null;} the corresponding array constant
      */
     private static CstArray makeCstArray(TypeList types) {
         int size = types.size();
index 4521e4c..d55195f 100644 (file)
@@ -40,16 +40,16 @@ public final class AnnotationsDirectoryItem extends OffsettedItem {
     /** write size of a list element, in bytes */
     private static final int ELEMENT_SIZE = 8;
 
-    /** null-ok; the class-level annotations, if any */
+    /** {@code null-ok;} the class-level annotations, if any */
     private AnnotationSetItem classAnnotations;
     
-    /** null-ok; the annotated fields, if any */
+    /** {@code null-ok;} the annotated fields, if any */
     private ArrayList<FieldAnnotationStruct> fieldAnnotations;
 
-    /** null-ok; the annotated methods, if any */
+    /** {@code null-ok;} the annotated methods, if any */
     private ArrayList<MethodAnnotationStruct> methodAnnotations;
 
-    /** null-ok; the annotated parameters, if any */
+    /** {@code null-ok;} the annotated parameters, if any */
     private ArrayList<ParameterAnnotationStruct> parameterAnnotations;
 
     /**
@@ -73,7 +73,7 @@ public final class AnnotationsDirectoryItem extends OffsettedItem {
     /**
      * Returns whether this item is empty (has no contents).
      * 
-     * @return <code>true</code> if this item is empty, or <code>false</code>
+     * @return {@code true} if this item is empty, or {@code false}
      * if not
      */
     public boolean isEmpty() {
@@ -88,8 +88,8 @@ public final class AnnotationsDirectoryItem extends OffsettedItem {
      * interning candidates are ones that <i>only</i> have a non-null
      * set of class annotations, with no other lists.
      *
-     * @return <code>true</code> if this is an interning candidate, or
-     * <code>false</code> if not
+     * @return {@code true} if this is an interning candidate, or
+     * {@code false} if not
      */
     public boolean isInternable() {
         return (classAnnotations != null) &&
@@ -132,7 +132,7 @@ public final class AnnotationsDirectoryItem extends OffsettedItem {
      * 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 non-null; annotations to set for this class
+     * @param annotations {@code non-null;} annotations to set for this class
      */
     public void setClassAnnotations(Annotations annotations) {
         if (annotations == null) {
@@ -150,8 +150,8 @@ public final class AnnotationsDirectoryItem extends OffsettedItem {
     /**
      * Adds a field annotations item to this instance.
      * 
-     * @param field non-null; field in question
-     * @param annotations non-null; associated annotations to add
+     * @param field {@code non-null;} field in question
+     * @param annotations {@code non-null;} associated annotations to add
      */
     public void addFieldAnnotations(CstFieldRef field,
             Annotations annotations) {
@@ -166,8 +166,8 @@ public final class AnnotationsDirectoryItem extends OffsettedItem {
     /**
      * Adds a method annotations item to this instance.
      * 
-     * @param method non-null; method in question
-     * @param annotations non-null; associated annotations to add
+     * @param method {@code non-null;} method in question
+     * @param annotations {@code non-null;} associated annotations to add
      */
     public void addMethodAnnotations(CstMethodRef method,
             Annotations annotations) {
@@ -182,8 +182,8 @@ public final class AnnotationsDirectoryItem extends OffsettedItem {
     /**
      * Adds a parameter annotations item to this instance.
      * 
-     * @param method non-null; method in question
-     * @param list non-null; associated list of annotation sets to add
+     * @param method {@code non-null;} method in question
+     * @param list {@code non-null;} associated list of annotation sets to add
      */
     public void addParameterAnnotations(CstMethodRef method,
             AnnotationsList list) {
@@ -198,8 +198,8 @@ 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 non-null; the method
-     * @return null-ok; the method annotations, if any
+     * @param method {@code non-null;} the method
+     * @return {@code null-ok;} the method annotations, if any
      */
     public Annotations getMethodAnnotations(CstMethodRef method) {
         if (methodAnnotations == null) {
@@ -219,8 +219,8 @@ 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 non-null; the method
-     * @return null-ok; the parameter annotations, if any
+     * @param method {@code non-null;} the method
+     * @return {@code null-ok;} the parameter annotations, if any
      */
     public AnnotationsList getParameterAnnotations(CstMethodRef method) {
         if (parameterAnnotations == null) {
@@ -336,11 +336,11 @@ public final class AnnotationsDirectoryItem extends OffsettedItem {
     }
 
     /**
-     * Gets the list size of the given list, or <code>0</code> if given
-     * <code>null</code>.
+     * Gets the list size of the given list, or {@code 0} if given
+     * {@code null}.
      * 
-     * @param list null-ok; the list in question
-     * @return &gt;= 0; its size
+     * @param list {@code null-ok;} the list in question
+     * @return {@code >= 0;} its size
      */
     private static int listSize(ArrayList<?> list) {
         if (list == null) {
@@ -354,7 +354,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 non-null; where to output to
+     * @param out {@code non-null;} where to output to
      */
     /*package*/ void debugPrint(PrintWriter out) {
         if (classAnnotations != null) {
index b7abc3f..64bf243 100644 (file)
@@ -32,27 +32,27 @@ import java.util.TreeMap;
 /**
  * List of exception handlers (tuples of covered range, catch type,
  * handler address) for a particular piece of code. Instances of this
- * class correspond to a <code>try_item[]</code> and a
- * <code>catch_handler_item[]</code>.
+ * class correspond to a {@code try_item[]} and a
+ * {@code catch_handler_item[]}.
  */
 public final class CatchStructs {
     /**
-     * the size of a <code>try_item</code>: a <code>uint</code>
-     * and two <code>ushort</code>
+     * the size of a {@code try_item}: a {@code uint}
+     * and two {@code ushort}
      */
     private static final int TRY_ITEM_WRITE_SIZE = 4 + (2 * 2);
 
-    /** non-null; code that contains the catches */
+    /** {@code non-null;} code that contains the catches */
     private final DalvCode code;
     
     /**
-     * null-ok; the underlying table; set in
+     * {@code null-ok;} the underlying table; set in
      * {@link #finishProcessingIfNecessary}
      */
     private CatchTable table;
 
     /**
-     * null-ok; the encoded handler list, if calculated; set in
+     * {@code null-ok;} the encoded handler list, if calculated; set in
      * {@link #encode}
      */
     private byte[] encodedHandlers;
@@ -64,7 +64,7 @@ public final class CatchStructs {
     private int encodedHandlerHeaderSize;
 
     /**
-     * null-ok; map from handler lists to byte offsets, if calculated; set in
+     * {@code null-ok;} map from handler lists to byte offsets, if calculated; set in
      * {@link #encode}
      */
     private TreeMap<CatchHandlerList, Integer> handlerOffsets;
@@ -72,7 +72,7 @@ public final class CatchStructs {
     /**
      * Constructs an instance.
      * 
-     * @param code non-null; code that contains the catches
+     * @param code {@code non-null;} code that contains the catches
      */
     public CatchStructs(DalvCode code) {
         this.code = code;
@@ -94,7 +94,7 @@ public final class CatchStructs {
     /**
      * Gets the size of the tries list, in entries.
      * 
-     * @return &gt;= 0; the tries list size
+     * @return {@code >= 0;} the tries list size
      */
     public int triesSize() {
         finishProcessingIfNecessary();
@@ -104,8 +104,8 @@ public final class CatchStructs {
     /**
      * Does a human-friendly dump of this instance.
      * 
-     * @param out non-null; where to dump
-     * @param prefix non-null; prefix to attach to each line of output
+     * @param out {@code non-null;} where to dump
+     * @param prefix {@code non-null;} prefix to attach to each line of output
      */
     public void debugPrint(PrintWriter out, String prefix) {
         annotateEntries(prefix, out, null);
@@ -114,7 +114,7 @@ public final class CatchStructs {
     /**
      * Encodes the handler lists.
      * 
-     * @param file non-null; file this instance is part of
+     * @param file {@code non-null;} file this instance is part of
      */
     public void encode(DexFile file) {
         finishProcessingIfNecessary();
@@ -179,7 +179,7 @@ public final class CatchStructs {
     /**
      * Gets the write size of this instance, in bytes.
      * 
-     * @return &gt;= 0; the write size
+     * @return {@code >= 0;} the write size
      */
     public int writeSize() {
         return (triesSize() * TRY_ITEM_WRITE_SIZE) +
@@ -189,8 +189,8 @@ public final class CatchStructs {
     /**
      * Writes this instance to the given stream.
      * 
-     * @param file non-null; file this instance is part of
-     * @param out non-null; where to write to
+     * @param file {@code non-null;} file this instance is part of
+     * @param out {@code non-null;} where to write to
      */
     public void writeTo(DexFile file, AnnotatedOutput out) {
         finishProcessingIfNecessary();
@@ -225,12 +225,12 @@ public final class CatchStructs {
 
     /**
      * Helper method to annotate or simply print the exception handlers.
-     * Only one of <code>printTo</code> or <code>annotateTo</code> should
+     * Only one of {@code printTo} or {@code annotateTo} should
      * be non-null.
      * 
-     * @param prefix non-null; prefix for each line
-     * @param printTo null-ok; where to print to
-     * @param annotateTo null-ok; where to consume bytes and annotate to
+     * @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
      */
     private void annotateEntries(String prefix, PrintWriter printTo,
             AnnotatedOutput annotateTo) {
@@ -299,12 +299,12 @@ public final class CatchStructs {
      * Helper for {@link #annotateEntries} to annotate a catch handler list
      * while consuming it.
      * 
-     * @param handlers non-null; handlers to annotate
-     * @param offset &gt;= 0; the offset of this handler
-     * @param size &gt;= 1; the number of bytes the handlers consume
-     * @param prefix non-null; prefix for each line
-     * @param printTo null-ok; where to print to
-     * @param annotateTo non-null; where to annotate to
+     * @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
+     * @param prefix {@code non-null;} prefix for each line
+     * @param printTo {@code null-ok;} where to print to
+     * @param annotateTo {@code non-null;} where to annotate to
      */
     private static void annotateAndConsumeHandlers(CatchHandlerList handlers,
             int offset, int size, String prefix, PrintWriter printTo,
index 638daed..f437a3e 100644 (file)
@@ -38,32 +38,32 @@ import java.util.HashMap;
  * Representation of all the parts of a Dalvik class that are generally
  * "inflated" into an in-memory representation at runtime. Instances of
  * this class are represented in a compact streamable form in a
- * <code>dex</code> file, as opposed to a random-access form.
+ * {@code dex} file, as opposed to a random-access form.
  */
 public final class ClassDataItem extends OffsettedItem {
-    /** non-null; what class this data is for, just for listing generation */
+    /** {@code non-null;} what class this data is for, just for listing generation */
     private final CstType thisClass;
     
-    /** non-null; list of static fields */
+    /** {@code non-null;} list of static fields */
     private final ArrayList<EncodedField> staticFields;
 
-    /** non-null; list of initial values for static fields */
+    /** {@code non-null;} list of initial values for static fields */
     private final HashMap<EncodedField, Constant> staticValues;
 
-    /** non-null; list of instance fields */
+    /** {@code non-null;} list of instance fields */
     private final ArrayList<EncodedField> instanceFields;
 
-    /** non-null; list of direct methods */
+    /** {@code non-null;} list of direct methods */
     private final ArrayList<EncodedMethod> directMethods;
 
-    /** non-null; list of virtual methods */
+    /** {@code non-null;} list of virtual methods */
     private final ArrayList<EncodedMethod> virtualMethods;
 
-    /** null-ok; static initializer list; set in {@link #addContents} */
+    /** {@code null-ok;} static initializer list; set in {@link #addContents} */
     private CstArray staticValuesConstant;
 
     /**
-     * null-ok; encoded form, ready for writing to a file; set during
+     * {@code null-ok;} encoded form, ready for writing to a file; set during
      * {@link #place0}
      */
     private byte[] encodedForm;
@@ -72,7 +72,7 @@ public final class ClassDataItem extends OffsettedItem {
      * Constructs an instance. Its sets of members are initially
      * empty.
      * 
-     * @param thisClass non-null; what class this data is for, just
+     * @param thisClass {@code non-null;} what class this data is for, just
      * for listing generation
      */
     public ClassDataItem(CstType thisClass) {
@@ -106,8 +106,8 @@ public final class ClassDataItem extends OffsettedItem {
     /**
      * Returns whether this instance is empty.
      * 
-     * @return <code>true</code> if this instance is empty or
-     * <code>false</code> if at least one element has been added to it
+     * @return {@code true} if this instance is empty or
+     * {@code false} if at least one element has been added to it
      */
     public boolean isEmpty() {
         return staticFields.isEmpty() && instanceFields.isEmpty()
@@ -117,8 +117,8 @@ public final class ClassDataItem extends OffsettedItem {
     /**
      * Adds a static field.
      * 
-     * @param field non-null; the field to add
-     * @param value null-ok; initial value for the field, if any
+     * @param field {@code non-null;} the field to add
+     * @param value {@code null-ok;} initial value for the field, if any
      */
     public void addStaticField(EncodedField field, Constant value) {
         if (field == null) {
@@ -137,7 +137,7 @@ public final class ClassDataItem extends OffsettedItem {
     /**
      * Adds an instance field.
      * 
-     * @param field non-null; the field to add
+     * @param field {@code non-null;} the field to add
      */
     public void addInstanceField(EncodedField field) {
         if (field == null) {
@@ -148,9 +148,9 @@ public final class ClassDataItem extends OffsettedItem {
     }
 
     /**
-     * Adds a direct (<code>static</code> and/or <code>private</code>) method.
+     * Adds a direct ({@code static} and/or {@code private}) method.
      * 
-     * @param method non-null; the method to add
+     * @param method {@code non-null;} the method to add
      */
     public void addDirectMethod(EncodedMethod method) {
         if (method == null) {
@@ -163,7 +163,7 @@ public final class ClassDataItem extends OffsettedItem {
     /**
      * Adds a virtual method.
      * 
-     * @param method non-null; the method to add
+     * @param method {@code non-null;} the method to add
      */
     public void addVirtualMethod(EncodedMethod method) {
         if (method == null) {
@@ -178,7 +178,7 @@ public final class ClassDataItem extends OffsettedItem {
      * in any way to the underlying lists contained in this instance, but
      * the objects contained in the list are shared.
      * 
-     * @return non-null; list of all methods
+     * @return {@code non-null;} list of all methods
      */
     public ArrayList<EncodedMethod> getMethods() {
         int sz = directMethods.size() + virtualMethods.size();
@@ -195,7 +195,7 @@ public final class ClassDataItem extends OffsettedItem {
      * Prints out the contents of this instance, in a debugging-friendly
      * way.
      * 
-     * @param out non-null; where to output to
+     * @param out {@code non-null;} where to output to
      * @param verbose whether to be verbose with the output
      */
     public void debugPrint(Writer out, boolean verbose) {
@@ -258,9 +258,9 @@ public final class ClassDataItem extends OffsettedItem {
 
     /**
      * Gets a {@link CstArray} corresponding to {@link #staticValues} if
-     * it contains any non-zero non-<code>null</code> values.
+     * it contains any non-zero non-{@code null} values.
      * 
-     * @return null-ok; the corresponding constant or <code>null</code> if
+     * @return {@code null-ok;} the corresponding constant or {@code null} if
      * there are no values to encode
      */
     public CstArray getStaticValuesConstant() {
@@ -273,9 +273,9 @@ public final class ClassDataItem extends OffsettedItem {
 
     /**
      * Gets a {@link CstArray} corresponding to {@link #staticValues} if
-     * it contains any non-zero non-<code>null</code> values.
+     * it contains any non-zero non-{@code null} values.
      * 
-     * @return null-ok; the corresponding constant or <code>null</code> if
+     * @return {@code null-ok;} the corresponding constant or {@code null} if
      * there are no values to encode
      */
     private CstArray makeStaticValuesConstant() {
@@ -337,8 +337,8 @@ public final class ClassDataItem extends OffsettedItem {
     /**
      * Writes out the encoded form of this instance.
      * 
-     * @param file non-null; file this instance is part of
-     * @param out non-null; where to write to
+     * @param file {@code non-null;} file this instance is part of
+     * @param out {@code non-null;} where to write to
      */
     private void encodeOutput(DexFile file, AnnotatedOutput out) {
         boolean annotates = out.annotates();
@@ -369,10 +369,10 @@ public final class ClassDataItem extends OffsettedItem {
      * Helper for {@link #encodeOutput}, which writes out the given
      * size value, annotating it as well (if annotations are enabled).
      * 
-     * @param file non-null; file this instance is part of
-     * @param out non-null; where to write to
-     * @param label non-null; the label for the purposes of annotation
-     * @param size &gt;= 0; the size to write
+     * @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
+     * @param size {@code >= 0;} the size to write
      */
     private static void encodeSize(DexFile file, AnnotatedOutput out,
             String label, int size) {
@@ -389,10 +389,10 @@ public final class ClassDataItem extends OffsettedItem {
      * list. It also annotates the items (if any and if annotations
      * are enabled).
      * 
-     * @param file non-null; file this instance is part of
-     * @param out non-null; where to write to
-     * @param label non-null; the label for the purposes of annotation
-     * @param list non-null; the list in question
+     * @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
+     * @param list {@code non-null;} the list in question
      */
     private static void encodeList(DexFile file, AnnotatedOutput out,
             String label, ArrayList<? extends EncodedMember> list) {
index 5a0b27c..acd8cf5 100644 (file)
@@ -45,47 +45,47 @@ public final class ClassDefItem extends IndexedItem {
     /** size of instances when written out to a file, in bytes */
     public static final int WRITE_SIZE = 32;
 
-    /** non-null; type constant for this class */
+    /** {@code non-null;} type constant for this class */
     private final CstType thisClass;
 
     /** access flags */
     private final int accessFlags;
 
     /**
-     * null-ok; superclass or <code>null</code> if this class is a/the
+     * {@code null-ok;} superclass or {@code null} if this class is a/the
      * root class 
      */
     private final CstType superclass;
 
-    /** null-ok; list of implemented interfaces */
+    /** {@code null-ok;} list of implemented interfaces */
     private TypeListItem interfaces;
 
-    /** null-ok; source file name or <code>null</code> if unknown */
+    /** {@code null-ok;} source file name or {@code null} if unknown */
     private final CstUtf8 sourceFile;
 
-    /** non-null; associated class data object */
+    /** {@code non-null;} associated class data object */
     private final ClassDataItem classData;
 
     /**
-     * null-ok; item wrapper for the static values, initialized
+     * {@code null-ok;} item wrapper for the static values, initialized
      * in {@link #addContents}
      */
     private EncodedArrayItem staticValuesItem;
 
-    /** non-null; annotations directory */
+    /** {@code non-null;} annotations directory */
     private AnnotationsDirectoryItem annotationsDirectory;
 
     /**
      * Constructs an instance. Its sets of members and annotations are
      * initially empty.
      * 
-     * @param thisClass non-null; type constant for this class
+     * @param thisClass {@code non-null;} type constant for this class
      * @param accessFlags access flags
-     * @param superclass null-ok; superclass or <code>null</code> if
+     * @param superclass {@code null-ok;} superclass or {@code null} if
      * this class is a/the root class
-     * @param interfaces non-null; list of implemented interfaces
-     * @param sourceFile null-ok; source file name or
-     * <code>null</code> if unknown
+     * @param interfaces {@code non-null;} list of implemented interfaces
+     * @param sourceFile {@code null-ok;} source file name or
+     * {@code null} if unknown
      */
     public ClassDefItem(CstType thisClass, int accessFlags,
             CstType superclass, TypeList interfaces, CstUtf8 sourceFile) {
@@ -223,7 +223,7 @@ public final class ClassDefItem extends IndexedItem {
     /**
      * Gets the constant corresponding to this class.
      * 
-     * @return non-null; the constant
+     * @return {@code non-null;} the constant
      */
     public CstType getThisClass() {
         return thisClass;
@@ -241,7 +241,7 @@ public final class ClassDefItem extends IndexedItem {
     /**
      * Gets the superclass.
      * 
-     * @return null-ok; the superclass or <code>null</code> if
+     * @return {@code null-ok;} the superclass or {@code null} if
      * this class is a/the root class
      */
     public CstType getSuperclass() {
@@ -251,7 +251,7 @@ public final class ClassDefItem extends IndexedItem {
     /**
      * Gets the list of interfaces implemented.
      * 
-     * @return non-null; the interfaces list
+     * @return {@code non-null;} the interfaces list
      */
     public TypeList getInterfaces() {
         if (interfaces == null) {
@@ -264,7 +264,7 @@ public final class ClassDefItem extends IndexedItem {
     /**
      * Gets the source file name.
      * 
-     * @return null-ok; the source file name or <code>null</code> if unknown
+     * @return {@code null-ok;} the source file name or {@code null} if unknown
      */
     public CstUtf8 getSourceFile() {
         return sourceFile;
@@ -273,8 +273,8 @@ public final class ClassDefItem extends IndexedItem {
     /**
      * Adds a static field.
      * 
-     * @param field non-null; the field to add
-     * @param value null-ok; initial value for the field, if any
+     * @param field {@code non-null;} the field to add
+     * @param value {@code null-ok;} initial value for the field, if any
      */
     public void addStaticField(EncodedField field, Constant value) {
         classData.addStaticField(field, value);
@@ -283,16 +283,16 @@ public final class ClassDefItem extends IndexedItem {
     /**
      * Adds an instance field.
      * 
-     * @param field non-null; the field to add
+     * @param field {@code non-null;} the field to add
      */
     public void addInstanceField(EncodedField field) {
         classData.addInstanceField(field);
     }
 
     /**
-     * Adds a direct (<code>static</code> and/or <code>private</code>) method.
+     * Adds a direct ({@code static} and/or {@code private}) method.
      * 
-     * @param method non-null; the method to add
+     * @param method {@code non-null;} the method to add
      */
     public void addDirectMethod(EncodedMethod method) {
         classData.addDirectMethod(method);
@@ -301,7 +301,7 @@ public final class ClassDefItem extends IndexedItem {
     /**
      * Adds a virtual method.
      * 
-     * @param method non-null; the method to add
+     * @param method {@code non-null;} the method to add
      */
     public void addVirtualMethod(EncodedMethod method) {
         classData.addVirtualMethod(method);
@@ -312,7 +312,7 @@ public final class ClassDefItem extends IndexedItem {
      * in any way to the underlying lists contained in this instance, but
      * the objects contained in the list are shared.
      * 
-     * @return non-null; list of all methods
+     * @return {@code non-null;} list of all methods
      */
     public ArrayList<EncodedMethod> getMethods() {
         return classData.getMethods();
@@ -323,7 +323,7 @@ public final class ClassDefItem extends IndexedItem {
      * 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 non-null; annotations to set for this class
+     * @param annotations {@code non-null;} annotations to set for this class
      */
     public void setClassAnnotations(Annotations annotations) {
         annotationsDirectory.setClassAnnotations(annotations);
@@ -332,8 +332,8 @@ public final class ClassDefItem extends IndexedItem {
     /**
      * Adds a field annotations item to this class.
      * 
-     * @param field non-null; field in question
-     * @param annotations non-null; associated annotations to add
+     * @param field {@code non-null;} field in question
+     * @param annotations {@code non-null;} associated annotations to add
      */
     public void addFieldAnnotations(CstFieldRef field,
             Annotations annotations) {
@@ -343,8 +343,8 @@ public final class ClassDefItem extends IndexedItem {
     /**
      * Adds a method annotations item to this class.
      * 
-     * @param method non-null; method in question
-     * @param annotations non-null; associated annotations to add
+     * @param method {@code non-null;} method in question
+     * @param annotations {@code non-null;} associated annotations to add
      */
     public void addMethodAnnotations(CstMethodRef method,
             Annotations annotations) {
@@ -354,8 +354,8 @@ public final class ClassDefItem extends IndexedItem {
     /**
      * Adds a parameter annotations item to this class.
      * 
-     * @param method non-null; method in question
-     * @param list non-null; associated list of annotation sets to add
+     * @param method {@code non-null;} method in question
+     * @param list {@code non-null;} associated list of annotation sets to add
      */
     public void addParameterAnnotations(CstMethodRef method,
             AnnotationsList list) {
@@ -366,8 +366,8 @@ 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 non-null; the method
-     * @return null-ok; the method annotations, if any
+     * @param method {@code non-null;} the method
+     * @return {@code null-ok;} the method annotations, if any
      */
     public Annotations getMethodAnnotations(CstMethodRef method) {
         return annotationsDirectory.getMethodAnnotations(method);
@@ -377,8 +377,8 @@ 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 non-null; the method
-     * @return null-ok; the parameter annotations, if any
+     * @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);
@@ -388,7 +388,7 @@ public final class ClassDefItem extends IndexedItem {
      * Prints out the contents of this instance, in a debugging-friendly
      * way.
      * 
-     * @param out non-null; where to output to
+     * @param out {@code non-null;} where to output to
      * @param verbose whether to be verbose with the output
      */
     public void debugPrint(Writer out, boolean verbose) {
index cf61b47..e8efd57 100644 (file)
@@ -28,22 +28,22 @@ import java.util.Collection;
 import java.util.TreeMap;
 
 /**
- * Class definitions list section of a <code>.dex</code> file.
+ * Class definitions list section of a {@code .dex} file.
  */
 public final class ClassDefsSection extends UniformItemSection {
     /**
-     * non-null; map from type constants for classes to {@link
+     * {@code non-null;} map from type constants for classes to {@link
      * ClassDefItem} instances that define those classes
      */
     private final TreeMap<Type, ClassDefItem> classDefs;
 
-    /** null-ok; ordered list of classes; set in {@link #orderItems} */
+    /** {@code null-ok;} ordered list of classes; set in {@link #orderItems} */
     private ArrayList<ClassDefItem> orderedDefs;
 
     /**
      * Constructs an instance. The file offset is initially unknown.
      * 
-     * @param file non-null; file that this instance is part of
+     * @param file {@code non-null;} file that this instance is part of
      */
     public ClassDefsSection(DexFile file) {
         super("class_defs", file, 4);
@@ -84,7 +84,7 @@ public final class ClassDefsSection extends UniformItemSection {
     /**
      * Writes the portion of the file header that refers to this instance.
      * 
-     * @param out non-null; where to write
+     * @param out {@code non-null;} where to write
      */
     public void writeHeaderPart(AnnotatedOutput out) {
         throwIfNotPrepared();
@@ -105,7 +105,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 non-null; the class def to add
+     * @param clazz {@code non-null;} the class def to add
      */
     public void add(ClassDefItem clazz) {
         Type type;
@@ -149,11 +149,11 @@ public final class ClassDefsSection extends UniformItemSection {
      * Helper for {@link #orderItems}, which recursively assigns indices
      * to classes.
      * 
-     * @param type null-ok; type ref to assign, if any
-     * @param idx &gt;= 0; the next index to assign
+     * @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
      * throw an exception indicating class definition circularity
-     * @return &gt;= 0; the next index to assign
+     * @return {@code >= 0;} the next index to assign
      */
     private int orderItems0(Type type, int idx, int maxDepth) {
         ClassDefItem c = classDefs.get(type);
index dc0bb52..279e6bf 100644 (file)
@@ -39,7 +39,7 @@ import java.util.HashSet;
 
 /**
  * Representation of all the parts needed for concrete methods in a
- * <code>dex</code> file.
+ * {@code dex} file.
  */
 public final class CodeItem extends OffsettedItem {
     /** file alignment of this class, in bytes */
@@ -48,26 +48,26 @@ public final class CodeItem extends OffsettedItem {
     /** write size of the header of this class, in bytes */
     private static final int HEADER_SIZE = 16;
 
-    /** non-null; method that this code implements */
+    /** {@code non-null;} method that this code implements */
     private final CstMethodRef ref;
 
-    /** non-null; the bytecode instructions and associated data */
+    /** {@code non-null;} the bytecode instructions and associated data */
     private final DalvCode code;
 
-    /** null-ok; the catches, if needed; set in {@link #addContents} */
+    /** {@code null-ok;} the catches, if needed; set in {@link #addContents} */
     private CatchStructs catches;
 
-    /** whether this instance is for a <code>static</code> method */
+    /** whether this instance is for a {@code static} method */
     private final boolean isStatic;
 
     /**
-     * non-null; list of possibly-thrown exceptions; just used in
+     * {@code non-null;} list of possibly-thrown exceptions; just used in
      * generating debugging output (listings) 
      */
     private final TypeList throwsList;
 
     /**
-     * null-ok; the debug info or <code>null</code> if there is none;
+     * {@code null-ok;} the debug info or {@code null} if there is none;
      * set in {@link #addContents}
      */
     private DebugInfoItem debugInfo;
@@ -75,11 +75,11 @@ public final class CodeItem extends OffsettedItem {
     /**
      * Constructs an instance.
      * 
-     * @param ref non-null; method that this code implements
-     * @param code non-null; the underlying code
-     * @param isStatic whether this instance is for a <code>static</code>
+     * @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}
      * method
-     * @param throwsList non-null; list of possibly-thrown exceptions,
+     * @param throwsList {@code non-null;} list of possibly-thrown exceptions,
      * just used in generating debugging output (listings)
      */
     public CodeItem(CstMethodRef ref, DalvCode code, boolean isStatic,
@@ -150,7 +150,7 @@ public final class CodeItem extends OffsettedItem {
     /**
      * Gets the reference to the method this instance implements.
      * 
-     * @return non-null; the method reference
+     * @return {@code non-null;} the method reference
      */
     public CstMethodRef getRef() {
         return ref;
@@ -159,8 +159,8 @@ public final class CodeItem extends OffsettedItem {
     /**
      * Does a human-friendly dump of this instance.
      * 
-     * @param out non-null; where to dump
-     * @param prefix non-null; per-line prefix to use
+     * @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
      */
     public void debugPrint(PrintWriter out, String prefix, boolean verbose) {
@@ -292,8 +292,8 @@ public final class CodeItem extends OffsettedItem {
     /**
      * Helper for {@link #writeTo0} which writes out the actual bytecode.
      *
-     * @param file non-null; file we are part of
-     * @param out non-null; where to write to
+     * @param file {@code non-null;} file we are part of
+     * @param out {@code non-null;} where to write to
      */
     private void writeCodes(DexFile file, AnnotatedOutput out) {
         DalvInsnList insns = code.getInsns();
index 010acb4..78b6b04 100644 (file)
@@ -110,8 +110,8 @@ public interface DebugInfoConstants {
      * next position entry that is added should be considered the end of
      * a method prologue (an appropriate place for a method breakpoint).<p>
      *
-     * The prologue_end register is cleared by any special (&gt= OPCODE_BASE)
-     * opcode.
+     * The prologue_end register is cleared by any special
+     * ({@code >= OPCODE_BASE}) opcode.
      */
     static final int DBG_SET_PROLOGUE_END = 0x07;
 
@@ -121,8 +121,8 @@ public interface DebugInfoConstants {
      * a method epilogue (an appropriate place to suspend execution before
      * method exit).<p>
      *
-     * The epilogue_begin register is cleared by any special (&gt= OPCODE_BASE)
-     * opcode.
+     * The epilogue_begin register is cleared by any special
+     * ({@code >= OPCODE_BASE}) opcode.
      */
     static final int DBG_SET_EPILOGUE_BEGIN = 0x08;
 
index 3ffd276..cd20055 100644 (file)
@@ -38,7 +38,7 @@ import static com.android.dx.dex.file.DebugInfoConstants.*;
 /**
  * A decoder for the dex debug info state machine format.
  * This code exists mostly as a reference implementation and test for
- * for the <code>DebugInfoEncoder</code>
+ * for the {@code DebugInfoEncoder}
  */
 public class DebugInfoDecoder {
     /** encoded debug info */
@@ -180,7 +180,7 @@ public class DebugInfoDecoder {
 
     /**
      * Gets the decoded positions list.
-     * Valid after calling <code>decode</code>.
+     * Valid after calling {@code decode}.
      *
      * @return positions list in ascending address order.
      */
@@ -190,7 +190,7 @@ public class DebugInfoDecoder {
 
     /**
      * Gets the decoded locals list, in ascending start-address order.
-     * Valid after calling <code>decode</code>.
+     * Valid after calling {@code decode}.
      *
      * @return locals list in ascending address order.
      */
@@ -227,7 +227,7 @@ public class DebugInfoDecoder {
     /**
      * Gets the register that begins the method's parameter range (including
      * the 'this' parameter for non-static methods). The range continues until
-     * <code>regSize</code>
+     * {@code regSize}
      *
      * @return register as noted above.
      */
@@ -416,9 +416,9 @@ public class DebugInfoDecoder {
      * encoder.
      *
      * @param info encoded debug info
-     * @param file non-null; file to refer to during decoding
-     * @param ref non-null; method whose info is being decoded
-     * @param code non-null; original code object that was encoded
+     * @param file {@code non-null;} file to refer to during decoding
+     * @param ref {@code non-null;} method whose info is being decoded
+     * @param code {@code non-null;} original code object that was encoded
      * @param isStatic whether the method is static
      */
     public static void validateEncode(byte[] info, DexFile file,
index 780e18d..3f722ea 100644 (file)
@@ -46,19 +46,19 @@ import static com.android.dx.dex.file.DebugInfoConstants.*;
  * <li> signed LEB128: initial value for line register.
  * <li> n instances of signed LEB128: string indicies (offset by 1)
  * for each method argument in left-to-right order
- * with <code>this</code> excluded. A value of '0' indicates "no name"
+ * with {@code this} excluded. A value of '0' indicates "no name"
  * <li> A sequence of special or normal opcodes as defined in
- * <code>DebugInfoConstants</code>.
- * <li> A single terminating <code>OP_END_SEQUENCE</code>
+ * {@code DebugInfoConstants}.
+ * <li> A single terminating {@code OP_END_SEQUENCE}
  * </ol>
  */
 public final class DebugInfoEncoder {
     private static final boolean DEBUG = false;
 
-    /** null-ok; positions (line numbers) to encode */
+    /** {@code null-ok;} positions (line numbers) to encode */
     private final PositionList positions;
 
-    /** null-ok; local variables to encode */
+    /** {@code null-ok;} local variables to encode */
     private final LocalList locals;
 
     private final ByteArrayAnnotatedOutput output;
@@ -96,9 +96,9 @@ public final class DebugInfoEncoder {
     /**
      * Creates an instance.
      *
-     * @param pl null-ok; positions (line numbers) to encode
-     * @param ll null-ok; local variables to encode
-     * @param file null-ok; may only be <code>null</code> if simply using
+     * @param pl {@code null-ok;} positions (line numbers) to encode
+     * @param ll {@code null-ok;} local variables to encode
+     * @param file {@code null-ok;} may only be {@code null} if simply using
      * this class to do a debug print
      * @param codeSize
      * @param regSize
@@ -122,7 +122,7 @@ public final class DebugInfoEncoder {
     }
 
     /**
-     * Annotates or writes a message to the <code>debugPrint</code> writer
+     * Annotates or writes a message to the {@code debugPrint} writer
      * if applicable.
      *
      * @param length the number of bytes associated with this message
@@ -146,8 +146,8 @@ public final class DebugInfoEncoder {
      * Converts this (PositionList, LocalList) pair into a state machine
      * sequence.
      *
-     * @return encoded byte sequence without padding and
-     * terminated with a <code>'\00'</code>
+     * @return {@code non-null;} encoded byte sequence without padding and
+     * terminated with a {@code 0x00} byte
      */
     public byte[] convert() {
         try {
@@ -169,15 +169,15 @@ public final class DebugInfoEncoder {
 
     /**
      * Converts and produces annotations on a stream. Does not write
-     * actual bits to the <code>AnnotatedOutput</code>.
+     * actual bits to the {@code AnnotatedOutput}.
      *
-     * @param prefix null-ok; prefix to attach to each line of output
-     * @param debugPrint null-ok; if specified, an alternate output for
+     * @param prefix {@code null-ok;} prefix to attach to each line of output
+     * @param debugPrint {@code null-ok;} if specified, an alternate output for
      * annotations
-     * @param out null-ok; if specified, where annotations should go
+     * @param out {@code null-ok;} if specified, where annotations should go
      * @param consume whether to claim to have consumed output for
-     * <code>out</code>
-     * @return output sequence
+     * {@code out}
+     * @return {@code non-null;} encoded output
      */
     public byte[] convertAndAnnotate(String prefix, PrintWriter debugPrint,
             AnnotatedOutput out, boolean consume) {
@@ -272,7 +272,7 @@ public final class DebugInfoEncoder {
      * address.
      *
      * @param curl Current index in locals
-     * @return new value for <code>curl</code>
+     * @return new value for {@code curl}
      * @throws IOException
      */
     private int emitLocalsAtAddress(int curl)
@@ -338,11 +338,11 @@ public final class DebugInfoEncoder {
     }
 
     /**
-     * Emits all positions that occur at the current <code>address</code>
+     * Emits all positions that occur at the current {@code address}
      *
      * @param curp Current index in sortedPositions
      * @param sortedPositions positions, sorted by ascending address
-     * @return new value for <code>curp</code>
+     * @return new value for {@code curp}
      * @throws IOException
      */
     private int emitPositionsAtAddress(int curp,
@@ -507,7 +507,7 @@ public final class DebugInfoEncoder {
     /**
      * Gets the register that begins the method's parameter range (including
      * the 'this' parameter for non-static methods). The range continues until
-     * <code>regSize</code>
+     * {@code regSize}
      *
      * @return register as noted above
      */
@@ -521,7 +521,7 @@ public final class DebugInfoEncoder {
      * from the input list and sorted by ascending register in the
      * returned list.
      *
-     * @return list of non-<code>this</code> method argument locals,
+     * @return list of non-{@code this} method argument locals,
      * sorted by ascending register
      */
     private ArrayList<LocalList.Entry> extractMethodArguments() {
@@ -566,8 +566,8 @@ public final class DebugInfoEncoder {
      * Returns a string representation of this LocalList entry that is
      * appropriate for emitting as an annotation.
      *
-     * @param e non-null; entry
-     * @return non-null; annotation string
+     * @param e {@code non-null;} entry
+     * @return {@code non-null;} annotation string
      */
     private String entryAnnotationString(LocalList.Entry e) {
         StringBuilder sb = new StringBuilder();
@@ -633,7 +633,7 @@ public final class DebugInfoEncoder {
      * null symbol is used in some cases by the parameter name list
      * at the beginning of the sequence.
      *
-     * @param string null-ok; string to emit
+     * @param string {@code null-ok;} string to emit
      * @throws IOException
      */
     private void emitStringIndex(CstUtf8 string) throws IOException {
@@ -654,7 +654,7 @@ public final class DebugInfoEncoder {
      * Emits a type index as an unsigned LEB128. The actual value written
      * is shifted by 1, so that the '0' value is reserved for "null".
      *
-     * @param type null-ok; type to emit
+     * @param type {@code null-ok;} type to emit
      * @throws IOException
      */
     private void emitTypeIndex(CstType type) throws IOException {
@@ -739,7 +739,7 @@ public final class DebugInfoEncoder {
     /**
      * Emits a {@link DebugInfoConstants#DBG_END_LOCAL DBG_END_LOCAL} sequence.
      *
-     * @param entry entry non-null; entry associated with end.
+     * @param entry {@code entry non-null;} entry associated with end.
      * @throws IOException
      */
     private void emitLocalEnd(LocalList.Entry entry)
@@ -823,10 +823,11 @@ public final class DebugInfoEncoder {
      * Essentially the same as described in "DWARF Debugging Format Version 3"
      * section 6.2.5.1.
      *
-     * @param deltaLines &gt;= DBG_LINE_BASE and &lt;= DBG_LINE_BASE +
-     * DBG_LINE_RANGE, the line change to encode
-     * @param deltaAddress &gt;= 0; the address change to encode
-     * @return &lt;= 0xff if in range, otherwise parameters are out of range
+     * @param deltaLines {@code >= DBG_LINE_BASE, <= DBG_LINE_BASE +
+     * DBG_LINE_RANGE;} the line change to encode
+     * @param deltaAddress {@code >= 0;} the address change to encode
+     * @return {@code <= 0xff} if in range, otherwise parameters are out
+     * of range
      */
     private static int computeOpcode(int deltaLines, int deltaAddress) {
         if (deltaLines < DBG_LINE_BASE
@@ -867,7 +868,7 @@ public final class DebugInfoEncoder {
      * Emits an  {@link DebugInfoConstants#DBG_ADVANCE_PC DBG_ADVANCE_PC} 
      * sequence.
      *
-     * @param deltaAddress &gt;= 0 amount to change program counter by
+     * @param deltaAddress {@code >= 0;} amount to change program counter by
      * @throws IOException
      */
     private void emitAdvancePc(int deltaAddress) throws IOException {
@@ -890,8 +891,9 @@ public final class DebugInfoEncoder {
     /**
      * Emits an unsigned LEB128 value.
      *
-     * @param n &gt= 0 vallue to emit. Note that, although this can represent
-     * integers larger than Integer.MAX_VALUE, we currently don't allow that.
+     * @param n {@code >= 0;} value to emit. Note that, although this can
+     * represent integers larger than Integer.MAX_VALUE, we currently don't
+     * allow that.
      * @throws IOException
      */
     private void emitUnsignedLeb128(int n) throws IOException {
index 0e4329b..1c32bd7 100644 (file)
@@ -34,7 +34,7 @@ public class DebugInfoItem extends OffsettedItem {
 
     private static final boolean ENABLE_ENCODER_SELF_CHECK = false;
 
-    /** non-null; the code this item represents */
+    /** {@code non-null;} the code this item represents */
     private final DalvCode code;
     
     private byte[] encoded;
@@ -93,9 +93,9 @@ public class DebugInfoItem extends OffsettedItem {
      * directly after a code dump (with the real local list actually
      * existing elsewhere in the output).
      *
-     * @param file non-null; the file to use for referencing other sections
-     * @param out non-null; where to annotate to
-     * @param prefix null-ok; prefix to attach to each line of output
+     * @param file {@code non-null;} the file to use for referencing other sections
+     * @param out {@code non-null;} where to annotate to
+     * @param prefix {@code null-ok;} prefix to attach to each line of output
      */
     public void annotateTo(DexFile file, AnnotatedOutput out, String prefix) {
         encode(file, prefix, null, out, false);
@@ -104,8 +104,8 @@ public class DebugInfoItem extends OffsettedItem {
     /**
      * Does a human-friendly dump of this instance.
      *
-     * @param out non-null; where to dump
-     * @param prefix non-null; prefix to attach to each line of output
+     * @param out {@code non-null;} where to dump
+     * @param prefix {@code non-null;} prefix to attach to each line of output
      */
     public void debugPrint(PrintWriter out, String prefix) {
         encode(null, prefix, out, null, false);
@@ -130,14 +130,14 @@ public class DebugInfoItem extends OffsettedItem {
     /**
      * Performs debug info encoding.
      *
-     * @param file null-ok; file to refer to during encoding
-     * @param prefix null-ok; prefix to attach to each line of output
-     * @param debugPrint null-ok; if specified, an alternate output for
+     * @param file {@code null-ok;} file to refer to during encoding
+     * @param prefix {@code null-ok;} prefix to attach to each line of output
+     * @param debugPrint {@code null-ok;} if specified, an alternate output for
      * annotations
-     * @param out null-ok; if specified, where annotations should go
+     * @param out {@code null-ok;} if specified, where annotations should go
      * @param consume whether to claim to have consumed output for
-     * <code>out</code>
-     * @return non-null; the encoded array
+     * {@code out}
+     * @return {@code non-null;} the encoded array
      */
     private byte[] encode(DexFile file, String prefix, PrintWriter debugPrint,
             AnnotatedOutput out, boolean consume) {
@@ -161,14 +161,14 @@ public class DebugInfoItem extends OffsettedItem {
     /**
      * Helper for {@link #encode} to do most of the work.
      *
-     * @param file null-ok; file to refer to during encoding
-     * @param prefix null-ok; prefix to attach to each line of output
-     * @param debugPrint null-ok; if specified, an alternate output for
+     * @param file {@code null-ok;} file to refer to during encoding
+     * @param prefix {@code null-ok;} prefix to attach to each line of output
+     * @param debugPrint {@code null-ok;} if specified, an alternate output for
      * annotations
-     * @param out null-ok; if specified, where annotations should go
+     * @param out {@code null-ok;} if specified, where annotations should go
      * @param consume whether to claim to have consumed output for
-     * <code>out</code>
-     * @return non-null; the encoded array
+     * {@code out}
+     * @return {@code non-null;} the encoded array
      */
     private byte[] encode0(DexFile file, String prefix, PrintWriter debugPrint,
             AnnotatedOutput out, boolean consume) {
index 8a4075d..a829fed 100644 (file)
@@ -38,67 +38,67 @@ import java.util.zip.Adler32;
 import static com.android.dx.dex.file.MixedItemSection.SortType;
 
 /**
- * Representation of an entire <code>.dex</code> (Dalvik EXecutable)
+ * Representation of an entire {@code .dex} (Dalvik EXecutable)
  * file, which itself consists of a set of Dalvik classes.
  */
 public final class DexFile {
-    /** non-null; word data section */
+    /** {@code non-null;} word data section */
     private final MixedItemSection wordData;
 
     /** 
-     * non-null; type lists section. This is word data, but separating
+     * {@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}.
      */
     private final MixedItemSection typeLists;
 
     /**
-     * non-null; map section. The map needs to be in a section by itself
+     * {@code non-null;} map section. The map needs to be in a section by itself
      * for the self-reference mechanics to work in a reasonably
      * straightforward way. See {@link MapItem#addMap} for more detail.
      */
     private final MixedItemSection map;
 
-    /** non-null; string data section */
+    /** {@code non-null;} string data section */
     private final MixedItemSection stringData;
 
-    /** non-null; string identifiers section */
+    /** {@code non-null;} string identifiers section */
     private final StringIdsSection stringIds;
 
-    /** non-null; type identifiers section */
+    /** {@code non-null;} type identifiers section */
     private final TypeIdsSection typeIds;
 
-    /** non-null; prototype identifiers section */
+    /** {@code non-null;} prototype identifiers section */
     private final ProtoIdsSection protoIds;
 
-    /** non-null; field identifiers section */
+    /** {@code non-null;} field identifiers section */
     private final FieldIdsSection fieldIds;
 
-    /** non-null; method identifiers section */
+    /** {@code non-null;} method identifiers section */
     private final MethodIdsSection methodIds;
 
-    /** non-null; class definitions section */
+    /** {@code non-null;} class definitions section */
     private final ClassDefsSection classDefs;
 
-    /** non-null; class data section */
+    /** {@code non-null;} class data section */
     private final MixedItemSection classData;
 
-    /** non-null; byte data section */
+    /** {@code non-null;} byte data section */
     private final MixedItemSection byteData;
 
-    /** non-null; file header */
+    /** {@code non-null;} file header */
     private final HeaderSection header;
 
     /**
-     * non-null; array of sections in the order they will appear in the
+     * {@code non-null;} array of sections in the order they will appear in the
      * final output file
      */
     private final Section[] sections;
 
-    /** &gt;= -1; total file size or <code>-1</code> if unknown */
+    /** {@code >= -1;} total file size or {@code -1} if unknown */
     private int fileSize;
 
-    /** &gt;= 40; maximum width of the file dump */
+    /** {@code >= 40;} maximum width of the file dump */
     private int dumpWidth;
 
     /**
@@ -137,7 +137,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 non-null; the class to add
+     * @param clazz {@code non-null;} the class to add
      */
     public void add(ClassDefItem clazz) {
         classDefs.add(clazz);
@@ -146,8 +146,8 @@ public final class DexFile {
     /**
      * Gets the class definition with the given name, if any.
      * 
-     * @param name non-null; the class name to look for
-     * @return null-ok; the class with the given name, or <code>null</code>
+     * @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
      */
     public ClassDefItem getClassOrNull(String name) {
@@ -164,8 +164,8 @@ public final class DexFile {
      * Writes the contents of this instance as either a binary or a
      * human-readable form, or both.
      * 
-     * @param out null-ok; where to write to
-     * @param humanOut null-ok; where to write human-oriented output to
+     * @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
      */
     public void writeTo(OutputStream out, Writer humanOut, boolean verbose)
@@ -183,12 +183,12 @@ public final class DexFile {
     }
 
     /**
-     * Returns the contents of this instance as a <code>.dex</code> file,
-     * in <code>byte[]</code> form.
+     * Returns the contents of this instance as a {@code .dex} file,
+     * in {@code byte[]} form.
      * 
-     * @param humanOut null-ok; where to write human-oriented output to
+     * @param humanOut {@code null-ok;} where to write human-oriented output to
      * @param verbose whether to be verbose when writing human-oriented output
-     * @return non-null; a <code>.dex</code> file for this instance
+     * @return {@code non-null;} a {@code .dex} file for this instance
      */
     public byte[] toDex(Writer humanOut, boolean verbose) 
         throws IOException {
@@ -205,7 +205,7 @@ public final class DexFile {
     /**
      * Sets the maximum width of the human-oriented dump of the instance.
      * 
-     * @param dumpWidth &gt;= 40; the width
+     * @param dumpWidth {@code >= 40;} the width
      */
     public void setDumpWidth(int dumpWidth) {
         if (dumpWidth < 40) {
@@ -221,7 +221,7 @@ public final class DexFile {
      * <p>This is package-scope in order to allow
      * the {@link HeaderSection} to set itself up properly.</p>
      * 
-     * @return &gt;= 0; the total file size
+     * @return {@code >= 0;} the total file size
      * @throws RuntimeException thrown if the file size is not yet known
      */
     /*package*/ int getFileSize() {
@@ -239,7 +239,7 @@ public final class DexFile {
      * the various {@link Item} instances to add items to the
      * instance.</p>
      * 
-     * @return non-null; the string data section
+     * @return {@code non-null;} the string data section
      */
     /*package*/ MixedItemSection getStringData() {
         return stringData;
@@ -252,7 +252,7 @@ public final class DexFile {
      * the various {@link Item} instances to add items to the
      * instance.</p>
      * 
-     * @return non-null; the word data section
+     * @return {@code non-null;} the word data section
      */
     /*package*/ MixedItemSection getWordData() {
         return wordData;
@@ -265,7 +265,7 @@ public final class DexFile {
      * the various {@link Item} instances to add items to the
      * instance.</p>
      * 
-     * @return non-null; the word data section
+     * @return {@code non-null;} the word data section
      */
     /*package*/ MixedItemSection getTypeLists() {
         return typeLists;
@@ -277,7 +277,7 @@ public final class DexFile {
      * <p>This is package-scope in order to allow the header section
      * to query it.</p>
      * 
-     * @return non-null; the map section
+     * @return {@code non-null;} the map section
      */
     /*package*/ MixedItemSection getMap() {
         return map;
@@ -290,7 +290,7 @@ public final class DexFile {
      * the various {@link Item} instances to add items to the
      * instance.</p>
      * 
-     * @return non-null; the string identifiers section
+     * @return {@code non-null;} the string identifiers section
      */
     /*package*/ StringIdsSection getStringIds() {
         return stringIds;
@@ -303,7 +303,7 @@ public final class DexFile {
      * the various {@link Item} instances to add items to the
      * instance.</p>
      * 
-     * @return non-null; the class definitions section
+     * @return {@code non-null;} the class definitions section
      */
     /*package*/ ClassDefsSection getClassDefs() {
         return classDefs;
@@ -316,7 +316,7 @@ public final class DexFile {
      * the various {@link Item} instances to add items to the
      * instance.</p>
      * 
-     * @return non-null; the class data section
+     * @return {@code non-null;} the class data section
      */
     /*package*/ MixedItemSection getClassData() {
         return classData;
@@ -329,7 +329,7 @@ public final class DexFile {
      * the various {@link Item} instances to add items to the
      * instance.</p>
      * 
-     * @return non-null; the class identifiers section
+     * @return {@code non-null;} the class identifiers section
      */
     /*package*/ TypeIdsSection getTypeIds() {
         return typeIds;
@@ -342,7 +342,7 @@ public final class DexFile {
      * the various {@link Item} instances to add items to the
      * instance.</p>
      * 
-     * @return non-null; the prototype identifiers section
+     * @return {@code non-null;} the prototype identifiers section
      */
     /*package*/ ProtoIdsSection getProtoIds() {
         return protoIds;
@@ -355,7 +355,7 @@ public final class DexFile {
      * the various {@link Item} instances to add items to the
      * instance.</p>
      * 
-     * @return non-null; the field identifiers section
+     * @return {@code non-null;} the field identifiers section
      */
     /*package*/ FieldIdsSection getFieldIds() {
         return fieldIds;
@@ -368,7 +368,7 @@ public final class DexFile {
      * the various {@link Item} instances to add items to the
      * instance.</p>
      * 
-     * @return non-null; the method identifiers section
+     * @return {@code non-null;} the method identifiers section
      */
     /*package*/ MethodIdsSection getMethodIds() {
         return methodIds;
@@ -381,7 +381,7 @@ public final class DexFile {
      * the various {@link Item} instances to add items to the
      * instance.</p>
      *
-     * @return non-null; the byte data section
+     * @return {@code non-null;} the byte data section
      */
     /*package*/ MixedItemSection getByteData() {
         return byteData;
@@ -394,7 +394,7 @@ public final class DexFile {
      * <p>This is package-scope in order to allow the header section
      * to query it.</p>
      * 
-     * @return non-null; the section
+     * @return {@code non-null;} the section
      */
     /*package*/ Section getFirstDataSection() {
         return wordData;
@@ -407,7 +407,7 @@ public final class DexFile {
      * <p>This is package-scope in order to allow the header section
      * to query it.</p>
      * 
-     * @return non-null; the section
+     * @return {@code non-null;} the section
      */
     /*package*/ Section getLastDataSection() {
         return map;
@@ -418,7 +418,7 @@ public final class DexFile {
      * instance, or do nothing if the given constant isn't the sort
      * that should be interned.
      * 
-     * @param cst non-null; constant to possibly intern
+     * @param cst {@code non-null;} constant to possibly intern
      */
     /*package*/ void internIfAppropriate(Constant cst) {
         if (cst instanceof CstString) {
@@ -441,13 +441,13 @@ public final class DexFile {
     /**
      * Gets the {@link IndexedItem} corresponding to the given constant,
      * if it is a constant that has such a correspondence, or return
-     * <code>null</code> if it isn't such a constant. This will throw
+     * {@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 non-null; the constant to look up
-     * @return null-ok; its corresponding item, if it has a corresponding
-     * item, or <code>null</code> if it's not that sort of constant
+     * @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
      */
     /*package*/ IndexedItem findItemOrNull(Constant cst) {
         IndexedItem item;
@@ -466,12 +466,12 @@ public final class DexFile {
     }
 
     /**
-     * Returns the contents of this instance as a <code>.dex</code> file,
+     * 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 non-null; a <code>.dex</code> file for this instance
+     * @return {@code non-null;} a {@code .dex} file for this instance
      */
     private ByteArrayAnnotatedOutput toDex0(boolean annotate,
             boolean verbose) {
@@ -586,7 +586,7 @@ public final class DexFile {
     /**
      * Generates and returns statistics for all the items in the file.
      * 
-     * @return non-null; the statistics
+     * @return {@code non-null;} the statistics
      */
     public Statistics getStatistics() {
         Statistics stats = new Statistics();
@@ -599,10 +599,10 @@ public final class DexFile {
     }
 
     /**
-     * Calculates the signature for the <code>.dex</code> file in the
+     * Calculates the signature for the {@code .dex} file in the
      * given array, and modify the array to contain it.
      * 
-     * @param bytes non-null; the bytes of the file
+     * @param bytes {@code non-null;} the bytes of the file
      */
     private static void calcSignature(byte[] bytes) {
         MessageDigest md;
@@ -627,10 +627,10 @@ public final class DexFile {
     }
 
     /**
-     * Calculates the checksum for the <code>.dex</code> file in the
+     * Calculates the checksum for the {@code .dex} file in the
      * given array, and modify the array to contain it.
      * 
-     * @param bytes non-null; the bytes of the file
+     * @param bytes {@code non-null;} the bytes of the file
      */
     private static void calcChecksum(byte[] bytes) {
         Adler32 a32 = new Adler32();
index 9ec72fa..c55c6f5 100644 (file)
@@ -36,11 +36,11 @@ public final class EncodedArrayItem extends OffsettedItem {
     /** the required alignment for instances of this class */
     private static final int ALIGNMENT = 1;
 
-    /** non-null; the array to represent */
+    /** {@code non-null;} the array to represent */
     private final CstArray array;
 
     /**
-     * null-ok; encoded form, ready for writing to a file; set during
+     * {@code null-ok;} encoded form, ready for writing to a file; set during
      * {@link #place0}
      */
     private byte[] encodedForm;
@@ -48,7 +48,7 @@ public final class EncodedArrayItem extends OffsettedItem {
     /**
      * Constructs an instance.
      * 
-     * @param array non-null; array to represent
+     * @param array {@code non-null;} array to represent
      */
     public EncodedArrayItem(CstArray array) {
         /*
index 62a5789..146a604 100644 (file)
@@ -30,13 +30,13 @@ import java.io.PrintWriter;
  */
 public final class EncodedField extends EncodedMember
         implements Comparable<EncodedField> {
-    /** non-null; constant for the field */
+    /** {@code non-null;} constant for the field */
     private final CstFieldRef field;
 
     /**
      * Constructs an instance.
      * 
-     * @param field non-null; constant for the field
+     * @param field {@code non-null;} constant for the field
      * @param accessFlags access flags
      */
     public EncodedField(CstFieldRef field, int accessFlags) {
@@ -122,7 +122,7 @@ public final class EncodedField extends EncodedMember
     /**
      * Gets the constant for the field.
      * 
-     * @return non-null; the constant
+     * @return {@code non-null;} the constant
      */
     public CstFieldRef getRef() {
         return field;
index 3ae0d09..68119f3 100644 (file)
@@ -51,14 +51,14 @@ public abstract class EncodedMember implements ToHuman {
     /**
      * Gets the name.
      *
-     * @return non-null; the name
+     * @return {@code non-null;} the name
      */
     public abstract CstUtf8 getName();
 
     /**
      * Does a human-friendly dump of this instance.
      *
-     * @param out non-null; where to dump
+     * @param out {@code non-null;} where to dump
      * @param verbose whether to be verbose with the output
      */
     public abstract void debugPrint(PrintWriter out, boolean verbose);
@@ -66,20 +66,20 @@ public abstract class EncodedMember implements ToHuman {
     /**
      * Populates a {@link DexFile} with items from within this instance.
      * 
-     * @param file non-null; the file to populate
+     * @param file {@code non-null;} the file to populate
      */
     public abstract void addContents(DexFile file);
 
     /**
      * Encodes this instance to the given output.
      * 
-     * @param file non-null; file this instance is part of
-     * @param out non-null; where to write to
-     * @param lastIndex &gt;= 0; the previous member index value encoded, or
-     * <code>0</code> if this is the first element to encode
-     * @param dumpSeq &gt;= 0; sequence number of this instance for
+     * @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
+     * {@code 0} if this is the first element to encode
+     * @param dumpSeq {@code >= 0;} sequence number of this instance for
      * annotation purposes
-     * @return &gt;= 0; the member index value that was encoded
+     * @return {@code >= 0;} the member index value that was encoded
      */
     public abstract int encode(DexFile file, AnnotatedOutput out, 
             int lastIndex, int dumpSeq);
index 319fbb7..dff1a07 100644 (file)
@@ -32,23 +32,23 @@ import java.io.PrintWriter;
  */
 public final class EncodedMethod extends EncodedMember 
         implements Comparable<EncodedMethod> {
-    /** non-null; constant for the method */
+    /** {@code non-null;} constant for the method */
     private final CstMethodRef method;
 
     /**
-     * null-ok; code for the method, if the method is neither
-     * <code>abstract</code> nor <code>native</code> 
+     * {@code null-ok;} code for the method, if the method is neither
+     * {@code abstract} nor {@code native} 
      */
     private final CodeItem code;
 
     /**
      * Constructs an instance.
      * 
-     * @param method non-null; constant for the method
+     * @param method {@code non-null;} constant for the method
      * @param accessFlags access flags
-     * @param code null-ok; code for the method, if it is neither
-     * <code>abstract</code> nor <code>native</code>
-     * @param throwsList non-null; list of possibly-thrown exceptions,
+     * @param code {@code null-ok;} code for the method, if it is neither
+     * {@code abstract} nor {@code native}
+     * @param throwsList {@code non-null;} list of possibly-thrown exceptions,
      * just used in generating debugging output (listings)
      */
     public EncodedMethod(CstMethodRef method, int accessFlags,
@@ -148,7 +148,7 @@ public final class EncodedMethod extends EncodedMember
     /**
      * Gets the constant for the method.
      * 
-     * @return non-null; the constant
+     * @return {@code non-null;} the constant
      */
     public final CstMethodRef getRef() {
         return method;
index e6169bd..6a76ca9 100644 (file)
@@ -27,17 +27,17 @@ import com.android.dx.util.ToHuman;
  */
 public final class FieldAnnotationStruct
         implements ToHuman, Comparable<FieldAnnotationStruct> {
-    /** non-null; the field in question */
+    /** {@code non-null;} the field in question */
     private final CstFieldRef field;
 
-    /** non-null; the associated annotations */
+    /** {@code non-null;} the associated annotations */
     private AnnotationSetItem annotations;
 
     /**
      * Constructs an instance.
      * 
-     * @param field non-null; the field in question
-     * @param annotations non-null; the associated annotations
+     * @param field {@code non-null;} the field in question
+     * @param annotations {@code non-null;} the associated annotations
      */
     public FieldAnnotationStruct(CstFieldRef field,
             AnnotationSetItem annotations) {
@@ -105,7 +105,7 @@ public final class FieldAnnotationStruct
     /**
      * Gets the field this item is for.
      * 
-     * @return non-null; the field
+     * @return {@code non-null;} the field
      */
     public CstFieldRef getField() {
         return field;
@@ -114,7 +114,7 @@ public final class FieldAnnotationStruct
     /**
      * Gets the associated annotations.
      * 
-     * @return non-null; the annotations
+     * @return {@code non-null;} the annotations
      */
     public Annotations getAnnotations() {
         return annotations.getAnnotations();
index d098d52..d6d01d5 100644 (file)
@@ -25,7 +25,7 @@ public final class FieldIdItem extends MemberIdItem {
     /**
      * Constructs an instance.
      * 
-     * @param field non-null; the constant for the field
+     * @param field {@code non-null;} the constant for the field
      */
     public FieldIdItem(CstFieldRef field) {
         super(field);
@@ -49,7 +49,7 @@ public final class FieldIdItem extends MemberIdItem {
     /**
      * Gets the field constant.
      * 
-     * @return non-null; the constant
+     * @return {@code non-null;} the constant
      */
     public CstFieldRef getFieldRef() {
         return (CstFieldRef) getRef();
index fddf55f..59ef229 100644 (file)
@@ -25,11 +25,11 @@ import java.util.Collection;
 import java.util.TreeMap;
 
 /**
- * Field refs list section of a <code>.dex</code> file.
+ * Field refs list section of a {@code .dex} file.
  */
 public final class FieldIdsSection extends MemberIdsSection {
     /**
-     * non-null; map from field constants to {@link
+     * {@code non-null;} map from field constants to {@link
      * FieldIdItem} instances 
      */
     private final TreeMap<CstFieldRef, FieldIdItem> fieldIds;
@@ -37,7 +37,7 @@ public final class FieldIdsSection extends MemberIdsSection {
     /**
      * Constructs an instance. The file offset is initially unknown.
      * 
-     * @param file non-null; file that this instance is part of
+     * @param file {@code non-null;} file that this instance is part of
      */
     public FieldIdsSection(DexFile file) {
         super("field_ids", file);
@@ -72,7 +72,7 @@ public final class FieldIdsSection extends MemberIdsSection {
     /**
      * Writes the portion of the file header that refers to this instance.
      * 
-     * @param out non-null; where to write
+     * @param out {@code non-null;} where to write
      */
     public void writeHeaderPart(AnnotatedOutput out) {
         throwIfNotPrepared();
@@ -92,8 +92,8 @@ public final class FieldIdsSection extends MemberIdsSection {
     /**
      * Interns an element into this instance.
      * 
-     * @param field non-null; the reference to intern
-     * @return non-null; the interned reference
+     * @param field {@code non-null;} the reference to intern
+     * @return {@code non-null;} the interned reference
      */
     public FieldIdItem intern(CstFieldRef field) {
         if (field == null) {
@@ -116,8 +116,8 @@ public final class FieldIdsSection extends MemberIdsSection {
      * Gets the index of the given reference, which must have been added
      * to this instance.
      * 
-     * @param ref non-null; the reference to look up
-     * @return &gt;= 0; the reference's index
+     * @param ref {@code non-null;} the reference to look up
+     * @return {@code >= 0;} the reference's index
      */
     public int indexOf(CstFieldRef ref) {
         if (ref == null) {
index 55c1f1c..6593859 100644 (file)
@@ -21,11 +21,11 @@ import com.android.dx.util.AnnotatedOutput;
 import com.android.dx.util.Hex;
 
 /**
- * File header section of a <code>.dex</code> file.
+ * File header section of a {@code .dex} file.
  */
 public final class HeaderItem extends IndexedItem {
     /**
-     * non-null; the file format magic number, represented as the
+     * {@code non-null;} the file format magic number, represented as the
      * low-order bytes of a string
      */
     private static final String MAGIC = "dex\n035\0";
index 9022e0f..5bc6278 100644 (file)
@@ -23,16 +23,16 @@ import java.util.Collections;
 import java.util.List;
 
 /**
- * File header section of a <code>.dex</code> file.
+ * File header section of a {@code .dex} file.
  */
 public final class HeaderSection extends UniformItemSection {
-    /** non-null; the list of the one item in the section */
+    /** {@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 non-null; file that this instance is part of
+     * @param file {@code non-null;} file that this instance is part of
      */
     public HeaderSection(DexFile file) {
         super(null, file, 4);
index 8342514..5d7c9e3 100644 (file)
@@ -23,7 +23,7 @@ import com.android.dx.rop.cst.CstType;
  */
 public abstract class IdItem extends IndexedItem {
     /**
-     * non-null; the type constant for the defining class of
+     * {@code non-null;} the type constant for the defining class of
      * the reference 
      */
     private final CstType type;
@@ -31,7 +31,7 @@ public abstract class IdItem extends IndexedItem {
     /**
      * Constructs an instance.
      * 
-     * @param type non-null; the type constant for the defining
+     * @param type {@code non-null;} the type constant for the defining
      * class of the reference
      */
     public IdItem(CstType type) {
@@ -53,7 +53,7 @@ public abstract class IdItem extends IndexedItem {
      * Gets the type constant for the defining class of the
      * reference.
      * 
-     * @return non-null; the type constant
+     * @return {@code non-null;} the type constant
      */
     public final CstType getDefiningClass() {
         return type;
index 9bf7fd2..32d69ea 100644 (file)
@@ -20,7 +20,7 @@ package com.android.dx.dex.file;
  * An item in a Dalvik file which is referenced by index.
  */
 public abstract class IndexedItem extends Item {
-    /** &gt;= -1; assigned index of the item, or <code>-1</code> if not
+    /** {@code >= -1;} assigned index of the item, or {@code -1} if not
      * yet assigned */
     private int index;
 
@@ -34,7 +34,7 @@ public abstract class IndexedItem extends Item {
     /**
      * Gets whether or not this instance has been assigned an index.
      * 
-     * @return <code>true</code> iff this instance has been assigned an index
+     * @return {@code true} iff this instance has been assigned an index
      */
     public final boolean hasIndex() {
         return (index >= 0);
@@ -43,7 +43,7 @@ public abstract class IndexedItem extends Item {
     /**
      * Gets the item index.
      *
-     * @return &gt;= 0; the index
+     * @return {@code >= 0;} the index
      * @throws RuntimeException thrown if the item index is not yet assigned
      */
     public final int getIndex() {
@@ -56,10 +56,10 @@ public abstract class IndexedItem extends Item {
 
     /**
      * Sets the item index. This method may only ever be called once
-     * per instance, and this will throw a <code>RuntimeException</code> if
+     * per instance, and this will throw a {@code RuntimeException} if
      * called a second (or subsequent) time.
      *
-     * @param index &gt;= 0; the item index
+     * @param index {@code >= 0;} the item index
      */
     public final void setIndex(int index) {
         if (this.index != -1) {
@@ -73,7 +73,7 @@ public abstract class IndexedItem extends Item {
      * Gets the index of this item as a string, suitable for including in
      * annotations.
      * 
-     * @return non-null; the index string
+     * @return {@code non-null;} the index string
      */
     public final String indexString() {
         return '[' + Integer.toHexString(index) + ']';
index 3708d45..057f218 100644 (file)
@@ -33,7 +33,7 @@ public abstract class Item {
     /**
      * Returns the item type for this instance.
      * 
-     * @return non-null; the item type
+     * @return {@code non-null;} the item type
      */
     public abstract ItemType itemType();
     
@@ -41,7 +41,7 @@ public abstract class Item {
      * Returns the human name for the particular type of item this
      * instance is.
      * 
-     * @return non-null; the name
+     * @return {@code non-null;} the name
      */
     public final String typeName() {
         return itemType().toHuman();
@@ -50,7 +50,7 @@ public abstract class Item {
     /**
      * Gets the size of this instance when written, in bytes.
      * 
-     * @return &gt;= 0; the write size
+     * @return {@code >= 0;} the write size
      */
     public abstract int writeSize();
 
@@ -62,7 +62,7 @@ public abstract class Item {
      * <p><b>Note:</b> Subclasses must override this to do something
      * appropriate.</p>
      * 
-     * @param file non-null; the file to populate
+     * @param file {@code non-null;} the file to populate
      */
     public abstract void addContents(DexFile file);
 
@@ -73,8 +73,8 @@ public abstract class Item {
      * note the written offset and will also throw an exception if this
      * instance has already been written.
      * 
-     * @param file non-null; the file to use for reference
-     * @param out non-null; where to write to
+     * @param file {@code non-null;} the file to use for reference
+     * @param out {@code non-null;} where to write to
      */
     public abstract void writeTo(DexFile file, AnnotatedOutput out);
 }
index ffa6573..83843b7 100644 (file)
@@ -48,17 +48,17 @@ public enum ItemType implements ToHuman {
     /** value when represented in a {@link MapItem} */
     private final int mapValue;
 
-    /** non-null; name of the type */
+    /** {@code non-null;} name of the type */
     private final String typeName;
 
-    /** non-null; the short human name */
+    /** {@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 non-null; name of the type
+     * @param typeName {@code non-null;} name of the type
      */
     private ItemType(int mapValue, String typeName) {
         this.mapValue = mapValue;
@@ -84,7 +84,7 @@ public enum ItemType implements ToHuman {
     /**
      * Gets the type name.
      * 
-     * @return non-null; the type name
+     * @return {@code non-null;} the type name
      */
     public String getTypeName() {
         return typeName;
index 5e7465c..c728dd7 100644 (file)
@@ -28,29 +28,29 @@ public final class MapItem extends OffsettedItem {
     /** file alignment of this class, in bytes */
     private static final int ALIGNMENT = 4;
 
-    /** write size of this class, in bytes: three <code>uint</code>s */
+    /** write size of this class, in bytes: three {@code uint}s */
     private static final int WRITE_SIZE = (4 * 3);
 
-    /** non-null; item type this instance covers */
+    /** {@code non-null;} item type this instance covers */
     private final ItemType type;
 
-    /** non-null; section this instance covers */
+    /** {@code non-null;} section this instance covers */
     private final Section section;
 
     /**
-     * null-ok; first item covered or <code>null</code> if this is
+     * {@code null-ok;} first item covered or {@code null} if this is
      * a self-reference
      */
     private final Item firstItem;
 
     /**
-     * null-ok; last item covered or <code>null</code> if this is
+     * {@code null-ok;} last item covered or {@code null} if this is
      * a self-reference
      */
     private final Item lastItem;
 
     /**
-     * &gt; 0; count of items covered; <code>1</code> if this
+     * {@code > 0;} count of items covered; {@code 1} if this
      * is a self-reference
      */
     private final int itemCount;
@@ -60,8 +60,8 @@ public final class MapItem extends OffsettedItem {
      * the contents of the given array of sections, adding it to the
      * given map section.
      *
-     * @param sections non-null; the sections
-     * @param mapSection non-null; the section that the resulting map
+     * @param sections {@code non-null;} the sections
+     * @param mapSection {@code non-null;} the section that the resulting map
      * should be added to; it should be empty on entry to this method
      */
     public static void addMap(Section[] sections,
@@ -115,11 +115,11 @@ public final class MapItem extends OffsettedItem {
     /**
      * Constructs an instance.
      * 
-     * @param type non-null; item type this instance covers
-     * @param section non-null; section this instance covers
-     * @param firstItem non-null; first item covered
-     * @param lastItem non-null; last item covered
-     * @param itemCount &gt; 0; count of items covered
+     * @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
+     * @param lastItem {@code non-null;} last item covered
+     * @param itemCount {@code > 0;} count of items covered
      */
     private MapItem(ItemType type, Section section, Item firstItem,
             Item lastItem, int itemCount) {
@@ -154,9 +154,9 @@ public final class MapItem extends OffsettedItem {
 
     /**
      * Constructs a self-referential instance. This instance is meant to
-     * represent the section containing the <code>map_list</code>.
+     * represent the section containing the {@code map_list}.
      * 
-     * @param section non-null; section this instance covers
+     * @param section {@code non-null;} section this instance covers
      */
     private MapItem(Section section) {
         super(ALIGNMENT, WRITE_SIZE);
index d437152..574d413 100644 (file)
@@ -29,13 +29,13 @@ public abstract class MemberIdItem extends IdItem {
     /** size of instances when written out to a file, in bytes */
     public static final int WRITE_SIZE = 8;
 
-    /** non-null; the constant for the member */
+    /** {@code non-null;} the constant for the member */
     private final CstMemberRef cst;
 
     /**
      * Constructs an instance.
      * 
-     * @param cst non-null; the constant for the member
+     * @param cst {@code non-null;} the constant for the member
      */
     public MemberIdItem(CstMemberRef cst) {
         super(cst.getDefiningClass());
@@ -86,7 +86,7 @@ public abstract class MemberIdItem extends IdItem {
      * 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 non-null; the file being written
+     * @param file {@code non-null;} the file being written
      * @return the index in question
      */
     protected abstract int getTypoidIdx(DexFile file);
@@ -96,14 +96,14 @@ public abstract class MemberIdItem extends IdItem {
      * this item, for listing-generating purposes. Subclasses must override
      * this.
      * 
-     * @return non-null; the name in question
+     * @return {@code non-null;} the name in question
      */
     protected abstract String getTypoidName();
 
     /**
      * Gets the member constant.
      * 
-     * @return non-null; the constant
+     * @return {@code non-null;} the constant
      */
     public final CstMemberRef getRef() {
         return cst;
index 885b559..20b1605 100644 (file)
 package com.android.dx.dex.file;
 
 /**
- * Member (field or method) refs list section of a <code>.dex</code> file.
+ * Member (field or method) refs list section of a {@code .dex} file.
  */
 public abstract class MemberIdsSection extends UniformItemSection {
     /**
      * Constructs an instance. The file offset is initially unknown.
      * 
-     * @param name null-ok; the name of this instance, for annotation
+     * @param name {@code null-ok;} the name of this instance, for annotation
      * purposes
-     * @param file non-null; file that this instance is part of
+     * @param file {@code non-null;} file that this instance is part of
      */
     public MemberIdsSection(String name, DexFile file) {
         super(name, file, 4);
index 175c1d2..3c254a1 100644 (file)
@@ -27,17 +27,17 @@ import com.android.dx.util.ToHuman;
  */
 public final class MethodAnnotationStruct
         implements ToHuman, Comparable<MethodAnnotationStruct> {
-    /** non-null; the method in question */
+    /** {@code non-null;} the method in question */
     private final CstMethodRef method;
 
-    /** non-null; the associated annotations */
+    /** {@code non-null;} the associated annotations */
     private AnnotationSetItem annotations;
 
     /**
      * Constructs an instance.
      * 
-     * @param method non-null; the method in question
-     * @param annotations non-null; the associated annotations
+     * @param method {@code non-null;} the method in question
+     * @param annotations {@code non-null;} the associated annotations
      */
     public MethodAnnotationStruct(CstMethodRef method,
             AnnotationSetItem annotations) {
@@ -105,7 +105,7 @@ public final class MethodAnnotationStruct
     /**
      * Gets the method this item is for.
      * 
-     * @return non-null; the method
+     * @return {@code non-null;} the method
      */
     public CstMethodRef getMethod() {
         return method;
@@ -114,7 +114,7 @@ public final class MethodAnnotationStruct
     /**
      * Gets the associated annotations.
      * 
-     * @return non-null; the annotations
+     * @return {@code non-null;} the annotations
      */
     public Annotations getAnnotations() {
         return annotations.getAnnotations();
index 5d78e96..bbd6c93 100644 (file)
@@ -25,7 +25,7 @@ public final class MethodIdItem extends MemberIdItem {
     /**
      * Constructs an instance.
      * 
-     * @param method non-null; the constant for the method
+     * @param method {@code non-null;} the constant for the method
      */
     public MethodIdItem(CstBaseMethodRef method) {
         super(method);
@@ -49,7 +49,7 @@ public final class MethodIdItem extends MemberIdItem {
     /**
      * Gets the method constant.
      * 
-     * @return non-null; the constant
+     * @return {@code non-null;} the constant
      */
     public CstBaseMethodRef getMethodRef() {
         return (CstBaseMethodRef) getRef();
index 6ba7cac..f3e7dee 100644 (file)
@@ -25,11 +25,11 @@ import java.util.Collection;
 import java.util.TreeMap;
 
 /**
- * Method refs list section of a <code>.dex</code> file.
+ * Method refs list section of a {@code .dex} file.
  */
 public final class MethodIdsSection extends MemberIdsSection {
     /**
-     * non-null; map from method constants to {@link
+     * {@code non-null;} map from method constants to {@link
      * MethodIdItem} instances 
      */
     private final TreeMap<CstBaseMethodRef, MethodIdItem> methodIds;
@@ -37,7 +37,7 @@ public final class MethodIdsSection extends MemberIdsSection {
     /**
      * Constructs an instance. The file offset is initially unknown.
      * 
-     * @param file non-null; file that this instance is part of
+     * @param file {@code non-null;} file that this instance is part of
      */
     public MethodIdsSection(DexFile file) {
         super("method_ids", file);
@@ -72,7 +72,7 @@ public final class MethodIdsSection extends MemberIdsSection {
     /**
      * Writes the portion of the file header that refers to this instance.
      * 
-     * @param out non-null; where to write
+     * @param out {@code non-null;} where to write
      */
     public void writeHeaderPart(AnnotatedOutput out) {
         throwIfNotPrepared();
@@ -92,8 +92,8 @@ public final class MethodIdsSection extends MemberIdsSection {
     /**
      * Interns an element into this instance.
      * 
-     * @param method non-null; the reference to intern
-     * @return non-null; the interned reference
+     * @param method {@code non-null;} the reference to intern
+     * @return {@code non-null;} the interned reference
      */
     public MethodIdItem intern(CstBaseMethodRef method) {
         if (method == null) {
@@ -116,8 +116,8 @@ public final class MethodIdsSection extends MemberIdsSection {
      * Gets the index of the given reference, which must have been added
      * to this instance.
      * 
-     * @param ref non-null; the reference to look up
-     * @return &gt;= 0; the reference's index
+     * @param ref {@code non-null;} the reference to look up
+     * @return {@code >= 0;} the reference's index
      */
     public int indexOf(CstBaseMethodRef ref) {
         if (ref == null) {
index f03a9a3..0929fe7 100644 (file)
@@ -31,7 +31,7 @@ import java.util.NoSuchElementException;
 import java.util.TreeMap;
 
 /**
- * A section of a <code>.dex</code> file which consists of a sequence of
+ * 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.
  * 
@@ -50,7 +50,7 @@ public final class MixedItemSection extends Section {
         INSTANCE;
     };
 
-    /** non-null; sorter which sorts instances by type */
+    /** {@code non-null;} sorter which sorts instances by type */
     private static final Comparator<OffsettedItem> TYPE_SORTER =
         new Comparator<OffsettedItem>() {
         public int compare(OffsettedItem item1, OffsettedItem item2) {
@@ -60,17 +60,17 @@ public final class MixedItemSection extends Section {
         }
     };
     
-    /** non-null; the items in this part */
+    /** {@code non-null;} the items in this part */
     private final ArrayList<OffsettedItem> items;
 
-    /** non-null; items that have been explicitly interned */
+    /** {@code non-null;} items that have been explicitly interned */
     private final HashMap<OffsettedItem, OffsettedItem> interns;
 
-    /** non-null; how to sort the items */
+    /** {@code non-null;} how to sort the items */
     private final SortType sort;
 
     /**
-     * &gt;= -1; the current size of this part, in bytes, or <code>-1</code>
+     * {@code >= -1;} the current size of this part, in bytes, or {@code -1}
      * if not yet calculated
      */
     private int writeSize;
@@ -78,10 +78,10 @@ public final class MixedItemSection extends Section {
     /**
      * Constructs an instance. The file offset is initially unknown.
      * 
-     * @param name null-ok; the name of this instance, for annotation
+     * @param name {@code null-ok;} the name of this instance, for annotation
      * purposes
-     * @param file non-null; file that this instance is part of
-     * @param alignment &gt; 0; alignment requirement for the final output;
+     * @param file {@code non-null;} file that this instance is part of
+     * @param alignment {@code > 0;} alignment requirement for the final output;
      * must be a power of 2
      * @param sort how the items should be sorted in the final output
      */
@@ -118,7 +118,7 @@ public final class MixedItemSection extends Section {
     /**
      * Gets the size of this instance, in items.
      * 
-     * @return &gt;= 0; the size
+     * @return {@code >= 0;} the size
      */
     public int size() {
         return items.size();
@@ -127,7 +127,7 @@ public final class MixedItemSection extends Section {
     /**
      * Writes the portion of the file header that refers to this instance.
      *
-     * @param out non-null; where to write
+     * @param out {@code non-null;} where to write
      */
     public void writeHeaderPart(AnnotatedOutput out) {
         throwIfNotPrepared();
@@ -164,7 +164,7 @@ public final class MixedItemSection extends Section {
      * same item to more than one instance, nor to add the same items
      * multiple times to a single instance.
      * 
-     * @param item non-null; the item to add
+     * @param item {@code non-null;} the item to add
      */
     public void add(OffsettedItem item) {
         throwIfPrepared();
@@ -187,8 +187,8 @@ public final class MixedItemSection extends Section {
      * (which may not be the one passed in). This will add the item if no
      * equal item has been added.
      * 
-     * @param item non-null; the item to intern
-     * @return non-null; the equivalent interned instance
+     * @param item {@code non-null;} the item to intern
+     * @return {@code non-null;} the equivalent interned instance
      */
     public <T extends OffsettedItem> T intern(T item) {
         throwIfPrepared();
@@ -207,8 +207,8 @@ public final class MixedItemSection extends Section {
     /**
      * Gets an item which was previously interned.
      * 
-     * @param item non-null; the item to look for
-     * @return non-null; the equivalent already-interned instance
+     * @param item {@code non-null;} the item to look for
+     * @return {@code non-null;} the equivalent already-interned instance
      */
     public <T extends OffsettedItem> T get(T item) {
         throwIfNotPrepared();
@@ -227,9 +227,9 @@ public final class MixedItemSection extends Section {
      * 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 non-null; where to write to
-     * @param itemType non-null; the item type of interest
-     * @param intro non-null; the introductory string for non-empty indices
+     * @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
      */
     public void writeIndexAnnotation(AnnotatedOutput out, ItemType itemType,
             String intro) {
@@ -285,7 +285,7 @@ public final class MixedItemSection extends Section {
     /**
      * Places all the items in this instance at particular offsets. This
      * will call {@link OffsettedItem#place} on each item. If an item
-     * does not know its write size before the call to <code>place</code>,
+     * does not know its write size before the call to {@code place},
      * it is that call which is responsible for setting the write size.
      * This method may only be called once per instance; subsequent calls
      * will throw an exception.
index 030c370..18bc439 100644 (file)
@@ -24,32 +24,32 @@ import com.android.dx.util.ExceptionWithContext;
  */
 public abstract class OffsettedItem extends Item
         implements Comparable<OffsettedItem> {
-    /** &gt; 0; alignment requirement */
+    /** {@code > 0;} alignment requirement */
     private final int alignment;
 
-    /** &gt;= -1; the size of this instance when written, in bytes, or
-     * <code>-1</code> if not yet known */
+    /** {@code >= -1;} the size of this instance when written, in bytes, or
+     * {@code -1} if not yet known */
     private int writeSize;
 
     /**
-     * null-ok; section the item was added to, or <code>null</code> if
+     * {@code null-ok;} section the item was added to, or {@code null} if
      * not yet added 
      */
     private Section addedTo;
 
     /**
-     * &gt;= -1; assigned offset of the item from the start of its section,
-     * or <code>-1</code> if not yet assigned 
+     * {@code >= -1;} assigned offset of the item from the start of its section,
+     * or {@code -1} if not yet assigned 
      */
     private int offset;
 
     /**
-     * Gets the absolute offset of the given item, returning <code>0</code>
-     * if handed <code>null</code>.
+     * Gets the absolute offset of the given item, returning {@code 0}
+     * if handed {@code null}.
      * 
-     * @param item null-ok; the item in question
-     * @return &gt;= 0; the item's absolute offset, or <code>0</code>
-     * if <code>item == null</code>
+     * @param item {@code null-ok;} the item in question
+     * @return {@code >= 0;} the item's absolute offset, or {@code 0}
+     * if {@code item == null}
      */
     public static int getAbsoluteOffsetOr0(OffsettedItem item) {
         if (item == null) {
@@ -62,10 +62,10 @@ public abstract class OffsettedItem extends Item
     /**
      * Constructs an instance. The offset is initially unassigned.
      * 
-     * @param alignment &gt; 0; output alignment requirement; must be a
+     * @param alignment {@code > 0;} output alignment requirement; must be a
      * power of 2
-     * @param writeSize &gt;= -1; the size of this instance when written,
-     * in bytes, or <code>-1</code> if not immediately known
+     * @param writeSize {@code >= -1;} the size of this instance when written,
+     * in bytes, or {@code -1} if not immediately known
      */
     public OffsettedItem(int alignment, int writeSize) {
         Section.validateAlignment(alignment);
@@ -131,7 +131,7 @@ public abstract class OffsettedItem extends Item
      * per instance, and only if the size was unknown upon instance
      * creation.
      * 
-     * @param writeSize &gt; 0; the write size, in bytes
+     * @param writeSize {@code > 0;} the write size, in bytes
      */
     public final void setWriteSize(int writeSize) {
         if (writeSize < 0) {
@@ -182,7 +182,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 &gt;= 0; the offset
+     * @return {@code >= 0;} the offset
      * @throws RuntimeException thrown if the offset is not yet known
      */
     public final int getRelativeOffset() {
@@ -197,7 +197,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 &gt;= 0; the offset
+     * @return {@code >= 0;} the offset
      * @throws RuntimeException thrown if the offset is not yet known
      */
     public final int getAbsoluteOffset() {
@@ -213,10 +213,10 @@ public abstract class OffsettedItem extends Item
      * the given offset. It is only valid to call this method once per
      * instance.
      * 
-     * @param addedTo non-null; the section this instance has been added to
-     * @param offset &gt;= 0; the desired offset from the start of the
+     * @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
      * section where this instance was placed
-     * @return &gt;= 0; the offset that this instance should be placed at
+     * @return {@code >= 0;} the offset that this instance should be placed at
      * in order to meet its alignment constraint
      */
     public final int place(Section addedTo, int offset) {
@@ -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 &gt; 0; the alignment requirement; must be a power of 2
+     * @return {@code > 0;} the alignment requirement; must be a power of 2
      */
     public final int getAlignment() {
         return alignment;
@@ -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 non-null; the offset string
+     * @return {@code non-null;} the offset string
      */
     public final String offsetString() {
         return '[' + Integer.toHexString(getAbsoluteOffset()) + ']';
@@ -266,7 +266,7 @@ public abstract class OffsettedItem extends Item
     /**
      * Gets a short human-readable string representing this instance.
      * 
-     * @return non-null; the human form
+     * @return {@code non-null;} the human form
      */
     public abstract String toHuman();
 
@@ -277,8 +277,8 @@ public abstract class OffsettedItem extends Item
      * class needs to actually sort, then it should override this
      * method.
      * 
-     * @param other non-null; instance to compare to
-     * @return <code>-1</code>, <code>0</code>, or <code>1</code>, depending
+     * @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
      */
     protected int compareTo0(OffsettedItem other) {
@@ -293,8 +293,8 @@ public abstract class OffsettedItem extends Item
      * know its write size up-front, then this method is responsible
      * for setting it.
      * 
-     * @param addedTo non-null; the section this instance has been added to
-     * @param offset &gt;= 0; the offset from the start of the
+     * @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
      */
     protected void place0(Section addedTo, int offset) {
@@ -306,8 +306,8 @@ public abstract class OffsettedItem extends Item
      * the given data section. This is called by {@link #writeTo},
      * which will have taken care of ensuring alignment.
      * 
-     * @param file non-null; the file to use for reference
-     * @param out non-null; where to write to
+     * @param file {@code non-null;} the file to use for reference
+     * @param out {@code non-null;} where to write to
      */
     protected abstract void writeTo0(DexFile file, AnnotatedOutput out);
 }
index 0c2d286..46d0450 100644 (file)
@@ -30,20 +30,20 @@ import java.util.ArrayList;
  */
 public final class ParameterAnnotationStruct
         implements ToHuman, Comparable<ParameterAnnotationStruct> {
-    /** non-null; the method in question */
+    /** {@code non-null;} the method in question */
     private final CstMethodRef method;
 
-    /** non-null; the associated annotations list */
+    /** {@code non-null;} the associated annotations list */
     private final AnnotationsList annotationsList;
 
-    /** non-null; the associated annotations list, as an item */
+    /** {@code non-null;} the associated annotations list, as an item */
     private final UniformListItem<AnnotationSetRefItem> annotationsItem;
 
     /**
      * Constructs an instance.
      * 
-     * @param method non-null; the method in question
-     * @param annotationsList non-null; the associated annotations list
+     * @param method {@code non-null;} the method in question
+     * @param annotationsList {@code non-null;} the associated annotations list
      */
     public ParameterAnnotationStruct(CstMethodRef method,
             AnnotationsList annotationsList) {
@@ -144,7 +144,7 @@ public final class ParameterAnnotationStruct
     /**
      * Gets the method this item is for.
      * 
-     * @return non-null; the method
+     * @return {@code non-null;} the method
      */
     public CstMethodRef getMethod() {
         return method;
@@ -153,7 +153,7 @@ public final class ParameterAnnotationStruct
     /**
      * Gets the associated annotations list.
      * 
-     * @return non-null; the annotations list
+     * @return {@code non-null;} the annotations list
      */
     public AnnotationsList getAnnotationsList() {
         return annotationsList;
index a144c30..afc227c 100644 (file)
@@ -31,14 +31,14 @@ public final class ProtoIdItem extends IndexedItem {
     /** size of instances when written out to a file, in bytes */
     public static final int WRITE_SIZE = 12;
 
-    /** non-null; the wrapped prototype */
+    /** {@code non-null;} the wrapped prototype */
     private final Prototype prototype;
 
-    /** non-null; the short-form of the prototype */
+    /** {@code non-null;} the short-form of the prototype */
     private final CstUtf8 shortForm;
 
     /**
-     * null-ok; the list of parameter types or <code>null</code> if this
+     * {@code null-ok;} the list of parameter types or {@code null} if this
      * prototype has no parameters
      */
     private TypeListItem parameterTypes;
@@ -46,7 +46,7 @@ public final class ProtoIdItem extends IndexedItem {
     /**
      * Constructs an instance.
      * 
-     * @param prototype non-null; the constant for the prototype
+     * @param prototype {@code non-null;} the constant for the prototype
      */
     public ProtoIdItem(Prototype prototype) {
         if (prototype == null) {
@@ -64,8 +64,8 @@ public final class ProtoIdItem extends IndexedItem {
     /**
      * Creates the short-form of the given prototype.
      * 
-     * @param prototype non-null; the prototype
-     * @return non-null; the short form
+     * @param prototype {@code non-null;} the prototype
+     * @return {@code non-null;} the short form
      */
     private static CstUtf8 makeShortForm(Prototype prototype) {
         StdTypeList parameters = prototype.getParameterTypes();
@@ -84,7 +84,7 @@ public final class ProtoIdItem extends IndexedItem {
     /**
      * Gets the short-form character for the given type.
      * 
-     * @param type non-null; the type
+     * @param type {@code non-null;} the type
      * @return the corresponding short-form character
      */
     private static char shortFormCharFor(Type type) {
index 852ab9d..8a95434 100644 (file)
@@ -26,18 +26,18 @@ import java.util.TreeMap;
 
 /**
  * Proto (method prototype) identifiers list section of a
- * <code>.dex</code> file.
+ * {@code .dex} file.
  */
 public final class ProtoIdsSection extends UniformItemSection {
     /**
-     * non-null; map from method prototypes to {@link ProtoIdItem} instances
+     * {@code non-null;} map from method prototypes to {@link ProtoIdItem} instances
      */
     private final TreeMap<Prototype, ProtoIdItem> protoIds;
 
     /**
      * Constructs an instance. The file offset is initially unknown.
      * 
-     * @param file non-null; file that this instance is part of
+     * @param file {@code non-null;} file that this instance is part of
      */
     public ProtoIdsSection(DexFile file) {
         super("proto_ids", file, 4);
@@ -60,7 +60,7 @@ public final class ProtoIdsSection extends UniformItemSection {
     /**
      * Writes the portion of the file header that refers to this instance.
      * 
-     * @param out non-null; where to write
+     * @param out {@code non-null;} where to write
      */
     public void writeHeaderPart(AnnotatedOutput out) {
         throwIfNotPrepared();
@@ -84,8 +84,8 @@ public final class ProtoIdsSection extends UniformItemSection {
     /**
      * Interns an element into this instance.
      * 
-     * @param prototype non-null; the prototype to intern
-     * @return non-null; the interned reference
+     * @param prototype {@code non-null;} the prototype to intern
+     * @return {@code non-null;} the interned reference
      */
     public ProtoIdItem intern(Prototype prototype) {
         if (prototype == null) {
@@ -108,8 +108,8 @@ public final class ProtoIdsSection extends UniformItemSection {
      * Gets the index of the given prototype, which must have
      * been added to this instance.
      * 
-     * @param prototype non-null; the prototype to look up
-     * @return &gt;= 0; the reference's index
+     * @param prototype {@code non-null;} the prototype to look up
+     * @return {@code >= 0;} the reference's index
      */
     public int indexOf(Prototype prototype) {
         if (prototype == null) {
index 9f7657c..f5b43af 100644 (file)
@@ -21,22 +21,22 @@ import com.android.dx.util.AnnotatedOutput;
 import java.util.Collection;
 
 /**
- * A section of a <code>.dex</code> file. Each section consists of a list
+ * A section of a {@code .dex} file. Each section consists of a list
  * of items of some sort or other.
  */
 public abstract class Section {
-    /** null-ok; name of this part, for annotation purposes */
+    /** {@code null-ok;} name of this part, for annotation purposes */
     private final String name;
 
-    /** non-null; file that this instance is part of */
+    /** {@code non-null;} file that this instance is part of */
     private final DexFile file;
 
-    /** &gt; 0; alignment requirement for the final output;
+    /** {@code > 0;} alignment requirement for the final output;
      * must be a power of 2 */
     private final int alignment;
 
-    /** &gt;= -1; offset from the start of the file to this part, or
-     * <code>-1</code> if not yet known */
+    /** {@code >= -1;} offset from the start of the file to this part, or
+     * {@code -1} if not yet known */
     private int fileOffset;
 
     /** whether {@link #prepare} has been called successfully on this
@@ -47,7 +47,7 @@ public abstract class Section {
      * Validates an alignment.
      * 
      * @param alignment the alignment
-     * @throws IllegalArgumentException thrown if <code>alignment</code>
+     * @throws IllegalArgumentException thrown if {@code alignment}
      * isn't a positive power of 2
      */
     public static void validateAlignment(int alignment) {
@@ -60,10 +60,10 @@ public abstract class Section {
     /**
      * Constructs an instance. The file offset is initially unknown.
      *
-     * @param name null-ok; the name of this instance, for annotation
+     * @param name {@code null-ok;} the name of this instance, for annotation
      * purposes
-     * @param file non-null; file that this instance is part of
-     * @param alignment &gt; 0; alignment requirement for the final output;
+     * @param file {@code non-null;} file that this instance is part of
+     * @param alignment {@code > 0;} alignment requirement for the final output;
      * must be a power of 2
      */
     public Section(String name, DexFile file, int alignment) {
@@ -83,7 +83,7 @@ public abstract class Section {
     /**
      * Gets the file that this instance is part of.
      *
-     * @return non-null; the file
+     * @return {@code non-null;} the file
      */
     public final DexFile getFile() {
         return file;
@@ -92,7 +92,7 @@ public abstract class Section {
     /** 
      * Gets the alignment for this instance's final output.
      * 
-     * @return &gt; 0; the alignment
+     * @return {@code > 0;} the alignment
      */
     public final int getAlignment() {
         return alignment;
@@ -102,7 +102,7 @@ public abstract class Section {
      * Gets the offset from the start of the file to this part. This
      * throws an exception if the offset has not yet been set.
      *
-     * @return &gt;= 0; the file offset
+     * @return {@code >= 0;} the file offset
      */
     public final int getFileOffset() {
         if (fileOffset < 0) {
@@ -116,9 +116,9 @@ public abstract class Section {
      * Sets the file offset. It is only valid to call this method once
      * once per instance.
      *
-     * @param fileOffset &gt;= 0; the desired offset from the start of the
+     * @param fileOffset {@code >= 0;} the desired offset from the start of the
      * file where this for this instance
-     * @return &gt;= 0; the offset that this instance should be placed at
+     * @return {@code >= 0;} the offset that this instance should be placed at
      * in order to meet its alignment constraint
      */
     public final int setFileOffset(int fileOffset) {
@@ -141,7 +141,7 @@ public abstract class Section {
     /**
      * Writes this instance to the given raw data object.
      *
-     * @param out non-null; where to write to
+     * @param out {@code non-null;} where to write to
      */
     public final void writeTo(AnnotatedOutput out) {
         throwIfNotPrepared();        
@@ -174,8 +174,8 @@ public abstract class Section {
      * once this instance has been assigned a file offset (via {@link
      * #setFileOffset}).
      * 
-     * @param relative &gt;= 0; the relative offset
-     * @return &gt;= 0; the corresponding absolute file offset
+     * @param relative {@code >= 0;} the relative offset
+     * @return {@code >= 0;} the corresponding absolute file offset
      */
     public final int getAbsoluteOffset(int relative) {
         if (relative < 0) {
@@ -198,8 +198,8 @@ public abstract class Section {
      * <p><b>Note:</b> Subclasses must implement this as appropriate for
      * their contents.</p>
      * 
-     * @param item non-null; the item in question
-     * @return &gt;= 0; the item's absolute file offset
+     * @param item {@code non-null;} the item in question
+     * @return {@code >= 0;} the item's absolute file offset
      */
     public abstract int getAbsoluteItemOffset(Item item);
 
@@ -219,7 +219,7 @@ public abstract class Section {
      * Gets the collection of all the items in this section.
      * It is not valid to attempt to change the returned list.
      *
-     * @return non-null; the items
+     * @return {@code non-null;} the items
      */
     public abstract Collection<? extends Item> items();
 
@@ -231,7 +231,7 @@ public abstract class Section {
     /**
      * Gets the size of this instance when output, in bytes.
      *
-     * @return &gt;= 0; the size of this instance, in bytes
+     * @return {@code >= 0;} the size of this instance, in bytes
      */
     public abstract int writeSize();
 
@@ -258,7 +258,7 @@ public abstract class Section {
     /**
      * Aligns the output of the given data to the alignment of this instance.
      * 
-     * @param out non-null; the output to align
+     * @param out {@code non-null;} the output to align
      */
     protected final void align(AnnotatedOutput out) {
         out.alignTo(alignment);
@@ -267,19 +267,19 @@ public abstract class Section {
     /**
      * Writes this instance to the given raw data object. This gets
      * called by {@link #writeTo} after aligning the cursor of
-     * <code>out</code> and verifying that either the assigned file
-     * offset matches the actual cursor <code>out</code> or that the
+     * {@code out} and verifying that either the assigned file
+     * 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</code>'s cursor.
+     * assigned to {@code out}'s cursor.
      * 
-     * @param out non-null; where to write to
+     * @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 null-ok; name of this part, for annotation purposes
+     * @return {@code null-ok;} name of this part, for annotation purposes
      */
     protected final String getName() {
         return name;
index b11ab6e..9a2efb3 100644 (file)
@@ -26,7 +26,7 @@ import java.util.TreeMap;
  * Statistics about the contents of a file.
  */
 public final class Statistics {
-    /** non-null; data about each type of item */
+    /** {@code non-null;} data about each type of item */
     private final HashMap<String, Data> dataMap;
 
     /**
@@ -39,7 +39,7 @@ public final class Statistics {
     /**
      * Adds the given item to the statistics.
      * 
-     * @param item non-null; the item to add
+     * @param item {@code non-null;} the item to add
      */
     public void add(Item item) {
         String typeName = item.typeName();
@@ -55,7 +55,7 @@ public final class Statistics {
     /**
      * Adds the given list of items to the statistics.
      * 
-     * @param list non-null; the list of items to add
+     * @param list {@code non-null;} the list of items to add
      */
     public void addAll(Section list) {
         Collection<? extends Item> items = list.items();
@@ -67,7 +67,7 @@ public final class Statistics {
     /**
      * Writes the statistics as an annotation.
      * 
-     * @param out non-null; where to write to
+     * @param out {@code non-null;} where to write to
      */
     public final void writeAnnotation(AnnotatedOutput out) {
         if (dataMap.size() == 0) {
@@ -109,26 +109,26 @@ public final class Statistics {
      * Statistical data about a particular class.
      */
     private static class Data {
-        /** non-null; name to use as a label */
+        /** {@code non-null;} name to use as a label */
         private final String name;
 
-        /** &gt;= 0; number of instances */
+        /** {@code >= 0;} number of instances */
         private int count;
 
-        /** &gt;= 0; total size of instances in bytes */
+        /** {@code >= 0;} total size of instances in bytes */
         private int totalSize;
 
-        /** &gt;= 0; largest size of any individual item */
+        /** {@code >= 0;} largest size of any individual item */
         private int largestSize;
 
-        /** &gt;= 0; smallest size of any individual item */
+        /** {@code >= 0;} smallest size of any individual item */
         private int smallestSize;
 
         /**
          * Constructs an instance for the given item.
          * 
-         * @param item non-null; item in question
-         * @param name non-null; type name to use
+         * @param item {@code non-null;} item in question
+         * @param name {@code non-null;} type name to use
          */
         public Data(Item item, String name) {
             int size = item.writeSize();
@@ -143,7 +143,7 @@ public final class Statistics {
         /**
          * Incorporates a new item. This assumes the type name matches.
          * 
-         * @param item non-null; item to incorporate
+         * @param item {@code non-null;} item to incorporate
          */
         public void add(Item item) {
             int size = item.writeSize();
@@ -163,7 +163,7 @@ public final class Statistics {
         /**
          * Writes this instance as an annotation.
          * 
-         * @param out non-null; where to write to
+         * @param out {@code non-null;} where to write to
          */
         public void writeAnnotation(AnnotatedOutput out) {
             out.annotate(toHuman());
index 49eea57..b9eeb9b 100644 (file)
@@ -26,13 +26,13 @@ import com.android.dx.util.Leb128Utils;
  * Representation of string data for a particular string, in a Dalvik file.
  */
 public final class StringDataItem extends OffsettedItem {
-    /** non-null; the string value */
+    /** {@code non-null;} the string value */
     private final CstUtf8 value;
 
     /**
      * Constructs an instance.
      * 
-     * @param value non-null; the string value
+     * @param value {@code non-null;} the string value
      */
     public StringDataItem(CstUtf8 value) {
         super(1, writeSize(value));
@@ -43,8 +43,8 @@ public final class StringDataItem extends OffsettedItem {
     /**
      * Gets the write size for a given value.
      * 
-     * @param value non-null; the string value
-     * @return &gt;= 2 the write size, in bytes
+     * @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();
index e80a7f8..401a0be 100644 (file)
@@ -28,16 +28,16 @@ public final class StringIdItem
     /** size of instances when written out to a file, in bytes */
     public static final int WRITE_SIZE = 4;
 
-    /** non-null; the string value */
+    /** {@code non-null;} the string value */
     private final CstUtf8 value;
 
-    /** null-ok; associated string data object, if known */
+    /** {@code null-ok;} associated string data object, if known */
     private StringDataItem data;
 
     /**
      * Constructs an instance.
      * 
-     * @param value non-null; the string value
+     * @param value {@code non-null;} the string value
      */
     public StringIdItem(CstUtf8 value) {
         if (value == null) {
@@ -110,7 +110,7 @@ public final class StringIdItem
     /**
      * Gets the string value.
      * 
-     * @return non-null; the value
+     * @return {@code non-null;} the value
      */
     public CstUtf8 getValue() {
         return value;
@@ -119,7 +119,7 @@ public final class StringIdItem
     /**
      * Gets the associated data object for this instance, if known.
      * 
-     * @return null-ok; the associated data object or <code>null</code>
+     * @return {@code null-ok;} the associated data object or {@code null}
      * if not yet known
      */
     public StringDataItem getData() {
index 17fbb57..b2e8683 100644 (file)
@@ -27,12 +27,12 @@ import java.util.Collection;
 import java.util.TreeMap;
 
 /**
- * Strings list section of a <code>.dex</code> file.
+ * Strings list section of a {@code .dex} file.
  */
 public final class StringIdsSection
         extends UniformItemSection {
     /**
-     * non-null; map from string constants to {@link
+     * {@code non-null;} map from string constants to {@link
      * StringIdItem} instances 
      */
     private final TreeMap<CstUtf8, StringIdItem> strings;
@@ -40,7 +40,7 @@ public final class StringIdsSection
     /**
      * Constructs an instance. The file offset is initially unknown.
      * 
-     * @param file non-null; file that this instance is part of
+     * @param file {@code non-null;} file that this instance is part of
      */
     public StringIdsSection(DexFile file) {
         super("string_ids", file, 4);
@@ -79,7 +79,7 @@ public final class StringIdsSection
     /**
      * Writes the portion of the file header that refers to this instance.
      * 
-     * @param out non-null; where to write
+     * @param out {@code non-null;} where to write
      */
     public void writeHeaderPart(AnnotatedOutput out) {
         throwIfNotPrepared();
@@ -99,9 +99,9 @@ public final class StringIdsSection
     /**
      * Interns an element into this instance.
      * 
-     * @param string non-null; the string to intern, as a regular Java
-     * <code>String</code>
-     * @return non-null; the interned string
+     * @param string {@code non-null;} the string to intern, as a regular Java
+     * {@code String}
+     * @return {@code non-null;} the interned string
      */
     public StringIdItem intern(String string) {
         CstUtf8 utf8 = new CstUtf8(string);
@@ -111,8 +111,8 @@ public final class StringIdsSection
     /**
      * Interns an element into this instance.
      * 
-     * @param string non-null; the string to intern, as a {@link CstString}
-     * @return non-null; the interned string
+     * @param string {@code non-null;} the string to intern, as a {@link CstString}
+     * @return {@code non-null;} the interned string
      */
     public StringIdItem intern(CstString string) {
         CstUtf8 utf8 = string.getString();
@@ -122,8 +122,8 @@ public final class StringIdsSection
     /**
      * Interns an element into this instance.
      * 
-     * @param string non-null; the string to intern, as a constant
-     * @return non-null; the interned string
+     * @param string {@code non-null;} the string to intern, as a constant
+     * @return {@code non-null;} the interned string
      */
     public StringIdItem intern(CstUtf8 string) {
         return intern(new StringIdItem(string));
@@ -132,8 +132,8 @@ public final class StringIdsSection
     /**
      * Interns an element into this instance.
      * 
-     * @param string non-null; the string to intern
-     * @return non-null; the interned string
+     * @param string {@code non-null;} the string to intern
+     * @return {@code non-null;} the interned string
      */
     public StringIdItem intern(StringIdItem string) {
         if (string == null) {
@@ -156,7 +156,7 @@ public final class StringIdsSection
     /**
      * Interns the components of a name-and-type into this instance.
      * 
-     * @param nat non-null; the name-and-type
+     * @param nat {@code non-null;} the name-and-type
      */
     public void intern(CstNat nat) {
         intern(nat.getName());
@@ -167,8 +167,8 @@ public final class StringIdsSection
      * Gets the index of the given string, which must have been added
      * to this instance.
      * 
-     * @param string non-null; the string to look up
-     * @return &gt;= 0; the string's index
+     * @param string {@code non-null;} the string to look up
+     * @return {@code >= 0;} the string's index
      */
     public int indexOf(CstUtf8 string) {
         if (string == null) {
@@ -190,8 +190,8 @@ public final class StringIdsSection
      * Gets the index of the given string, which must have been added
      * to this instance.
      * 
-     * @param string non-null; the string to look up
-     * @return &gt;= 0; the string's index
+     * @param string {@code non-null;} the string to look up
+     * @return {@code >= 0;} the string's index
      */
     public int indexOf(CstString string) {
         return indexOf(string.getString());
index f3402e6..01b1417 100644 (file)
@@ -31,7 +31,7 @@ public final class TypeIdItem extends IdItem {
     /**
      * Constructs an instance.
      * 
-     * @param type non-null; the constant for the type
+     * @param type {@code non-null;} the constant for the type
      */
     public TypeIdItem(CstType type) {
         super(type);
index 296263f..b1b9c58 100644 (file)
@@ -26,18 +26,18 @@ import java.util.Collection;
 import java.util.TreeMap;
 
 /**
- * Type identifiers list section of a <code>.dex</code> file.
+ * Type identifiers list section of a {@code .dex} file.
  */
 public final class TypeIdsSection extends UniformItemSection {
     /**
-     * non-null; map from types to {@link TypeIdItem} instances
+     * {@code non-null;} map from types to {@link TypeIdItem} instances
      */
     private final TreeMap<Type, TypeIdItem> typeIds;
 
     /**
      * Constructs an instance. The file offset is initially unknown.
      * 
-     * @param file non-null; file that this instance is part of
+     * @param file {@code non-null;} file that this instance is part of
      */
     public TypeIdsSection(DexFile file) {
         super("type_ids", file, 4);
@@ -73,7 +73,7 @@ public final class TypeIdsSection extends UniformItemSection {
     /**
      * Writes the portion of the file header that refers to this instance.
      * 
-     * @param out non-null; where to write
+     * @param out {@code non-null;} where to write
      */
     public void writeHeaderPart(AnnotatedOutput out) {
         throwIfNotPrepared();
@@ -97,8 +97,8 @@ public final class TypeIdsSection extends UniformItemSection {
     /**
      * Interns an element into this instance.
      * 
-     * @param type non-null; the type to intern
-     * @return non-null; the interned reference
+     * @param type {@code non-null;} the type to intern
+     * @return {@code non-null;} the interned reference
      */
     public TypeIdItem intern(Type type) {
         if (type == null) {
@@ -120,8 +120,8 @@ public final class TypeIdsSection extends UniformItemSection {
     /**
      * Interns an element into this instance.
      * 
-     * @param type non-null; the type to intern
-     * @return non-null; the interned reference
+     * @param type {@code non-null;} the type to intern
+     * @return {@code non-null;} the interned reference
      */
     public TypeIdItem intern(CstType type) {
         if (type == null) {
@@ -145,8 +145,8 @@ public final class TypeIdsSection extends UniformItemSection {
      * Gets the index of the given type, which must have
      * been added to this instance.
      * 
-     * @param type non-null; the type to look up
-     * @return &gt;= 0; the reference's index
+     * @param type {@code non-null;} the type to look up
+     * @return {@code >= 0;} the reference's index
      */
     public int indexOf(Type type) {
         if (type == null) {
@@ -168,8 +168,8 @@ public final class TypeIdsSection extends UniformItemSection {
      * Gets the index of the given type, which must have
      * been added to this instance.
      * 
-     * @param type non-null; the type to look up
-     * @return &gt;= 0; the reference's index
+     * @param type {@code non-null;} the type to look up
+     * @return {@code >= 0;} the reference's index
      */
     public int indexOf(CstType type) {
         if (type == null) {
index 6557ca4..3278aef 100644 (file)
@@ -36,13 +36,13 @@ public final class TypeListItem extends OffsettedItem {
     /** header size in bytes */
     private static final int HEADER_SIZE = 4;
 
-    /** non-null; the actual list */
+    /** {@code non-null;} the actual list */
     private final TypeList list;
 
     /**
      * Constructs an instance.
      * 
-     * @param list non-null; the actual list
+     * @param list {@code non-null;} the actual list
      */
     public TypeListItem(TypeList list) {
         super(ALIGNMENT, (list.size() * ELEMENT_SIZE) + HEADER_SIZE);
@@ -81,7 +81,7 @@ public final class TypeListItem extends OffsettedItem {
     /**
      * Gets the underlying list.
      * 
-     * @return non-null; the list
+     * @return {@code non-null;} the list
      */
     public TypeList getList() {
         return list;
index 602bc2d..e182438 100644 (file)
@@ -22,7 +22,7 @@ import com.android.dx.util.AnnotatedOutput;
 import java.util.Collection;
 
 /**
- * A section of a <code>.dex</code> file which consists of a sequence of
+ * A section of a {@code .dex} file which consists of a sequence of
  * {@link Item} objects. Each of the items must have the same size in
  * the output.
  */
@@ -30,10 +30,10 @@ public abstract class UniformItemSection extends Section {
     /**
      * Constructs an instance. The file offset is initially unknown.
      * 
-     * @param name null-ok; the name of this instance, for annotation
+     * @param name {@code null-ok;} the name of this instance, for annotation
      * purposes
-     * @param file non-null; file that this instance is part of
-     * @param alignment &gt; 0; alignment requirement for the final output;
+     * @param file {@code non-null;} file that this instance is part of
+     * @param alignment {@code > 0;} alignment requirement for the final output;
      * must be a power of 2
      */
     public UniformItemSection(String name, DexFile file, int alignment) {
@@ -60,8 +60,8 @@ public abstract class UniformItemSection extends Section {
      * if this instance isn't the sort that maps constants to {@link
      * IndexedItem} instances.
      * 
-     * @param cst non-null; constant to look for
-     * @return non-null; the corresponding item found in this instance
+     * @param cst {@code non-null;} constant to look for
+     * @return {@code non-null;} the corresponding item found in this instance
      */
     public abstract IndexedItem get(Constant cst);
 
index 3af3942..3c1f4d3 100644 (file)
@@ -28,8 +28,8 @@ import java.util.List;
  * alignment.
  * 
  * <p>This class inherits its alignment from its items, bumped up to
- * <code>4</code> if the items have a looser alignment requirement. If
- * it is more than <code>4</code>, then there will be a gap after the
+ * {@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
@@ -39,18 +39,18 @@ public final class UniformListItem<T extends OffsettedItem>
     /** the size of the list header */
     private static final int HEADER_SIZE = 4;
 
-    /** non-null; the item type */
+    /** {@code non-null;} the item type */
     private final ItemType itemType;
     
-    /** non-null; the contents */
+    /** {@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 non-null; the type of the item
-     * @param items non-null and non-empty; list of items to represent
+     * @param itemType {@code non-null;} the type of the item
+     * @param items {@code non-null and non-empty;} list of items to represent
      */
     public UniformListItem(ItemType itemType, List<T> items) {
         super(getAlignment(items), writeSize(items));
@@ -68,8 +68,8 @@ public final class UniformListItem<T extends OffsettedItem>
      * requirement implied by the given list. See the header comment for
      * more details.
      * 
-     * @param items non-null; list of items being represented
-     * @return &gt;= 4; the alignment requirement
+     * @param items {@code non-null;} list of items being represented
+     * @return {@code >= 4;} the alignment requirement
      */
     private static int getAlignment(List<? extends OffsettedItem> items) {
         try {
@@ -87,8 +87,8 @@ public final class UniformListItem<T extends OffsettedItem>
     /**
      * Calculates the write size for the given list.
      * 
-     * @param items non-null; the list in question
-     * @return &gt;= 0; the write size
+     * @param items {@code non-null;} the list in question
+     * @return {@code >= 0;} the write size
      */
     private static int writeSize(List<? extends OffsettedItem> items) {
         /*
@@ -148,7 +148,7 @@ public final class UniformListItem<T extends OffsettedItem>
     /**
      * Gets the underlying list of items.
      * 
-     * @return non-null; the list
+     * @return {@code non-null;} the list
      */
     public final List<T> getItems() {
         return items;
@@ -204,7 +204,7 @@ public final class UniformListItem<T extends OffsettedItem>
     /**
      * Get the size of the header of this list.
      * 
-     * @return &gt;= 0; the header size
+     * @return {@code >= 0;} the header size
      */
     private int headerSize() {
         /*
index 02a3419..66cd1a5 100644 (file)
@@ -43,69 +43,69 @@ import com.android.dx.util.Hex;
 import java.util.Collection;
 
 /**
- * Handler for writing out <code>encoded_values</code> and parts
+ * Handler for writing out {@code encoded_values} and parts
  * thereof.
  */
 public final class ValueEncoder {
-    /** annotation value type constant: <code>byte</code> */
+    /** annotation value type constant: {@code byte} */
     private static final int VALUE_BYTE = 0x00;
 
-    /** annotation value type constant: <code>short</code> */
+    /** annotation value type constant: {@code short} */
     private static final int VALUE_SHORT = 0x02;
 
-    /** annotation value type constant: <code>char</code> */
+    /** annotation value type constant: {@code char} */
     private static final int VALUE_CHAR = 0x03;
 
-    /** annotation value type constant: <code>int</code> */
+    /** annotation value type constant: {@code int} */
     private static final int VALUE_INT = 0x04;
 
-    /** annotation value type constant: <code>long</code> */
+    /** annotation value type constant: {@code long} */
     private static final int VALUE_LONG = 0x06;
 
-    /** annotation value type constant: <code>float</code> */
+    /** annotation value type constant: {@code float} */
     private static final int VALUE_FLOAT = 0x10;
 
-    /** annotation value type constant: <code>double</code> */
+    /** annotation value type constant: {@code double} */
     private static final int VALUE_DOUBLE = 0x11;
 
-    /** annotation value type constant: <code>string</code> */
+    /** annotation value type constant: {@code string} */
     private static final int VALUE_STRING = 0x17;
 
-    /** annotation value type constant: <code>type</code> */
+    /** annotation value type constant: {@code type} */
     private static final int VALUE_TYPE = 0x18;
 
-    /** annotation value type constant: <code>field</code> */
+    /** annotation value type constant: {@code field} */
     private static final int VALUE_FIELD = 0x19;
 
-    /** annotation value type constant: <code>method</code> */
+    /** annotation value type constant: {@code method} */
     private static final int VALUE_METHOD = 0x1a;
 
-    /** annotation value type constant: <code>enum</code> */
+    /** annotation value type constant: {@code enum} */
     private static final int VALUE_ENUM = 0x1b;
 
-    /** annotation value type constant: <code>array</code> */
+    /** annotation value type constant: {@code array} */
     private static final int VALUE_ARRAY = 0x1c;
 
-    /** annotation value type constant: <code>annotation</code> */
+    /** annotation value type constant: {@code annotation} */
     private static final int VALUE_ANNOTATION = 0x1d;
 
-    /** annotation value type constant: <code>null</code> */
+    /** annotation value type constant: {@code null} */
     private static final int VALUE_NULL = 0x1e;
 
-    /** annotation value type constant: <code>boolean</code> */
+    /** annotation value type constant: {@code boolean} */
     private static final int VALUE_BOOLEAN = 0x1f;
 
-    /** non-null; file being written */
+    /** {@code non-null;} file being written */
     private final DexFile file;
 
-    /** non-null; output stream to write to */
+    /** {@code non-null;} output stream to write to */
     private final AnnotatedOutput out;
     
     /**
      * Construct an instance.
      * 
-     * @param file non-null; file being written
-     * @param out non-null; output stream to write to
+     * @param file {@code non-null;} file being written
+     * @param out {@code non-null;} output stream to write to
      */
     public ValueEncoder(DexFile file, AnnotatedOutput out) {
         if (file == null) {
@@ -123,7 +123,7 @@ public final class ValueEncoder {
     /**
      * Writes out the encoded form of the given constant.
      * 
-     * @param cst non-null; the constant to write
+     * @param cst {@code non-null;} the constant to write
      */
     public void writeConstant(Constant cst) {
         int type = constantToValueType(cst);
@@ -209,8 +209,8 @@ public final class ValueEncoder {
     /**
      * Gets the value type for the given constant.
      * 
-     * @param cst non-null; the constant
-     * @return the value type; one of the <code>VALUE_*</code> constants
+     * @param cst {@code non-null;} the constant
+     * @return the value type; one of the {@code VALUE_*} constants
      * defined by this class
      */
     private static int constantToValueType(Constant cst) {
@@ -257,15 +257,15 @@ public final class ValueEncoder {
 
     /**
      * Writes out the encoded form of the given array, that is, as
-     * an <code>encoded_array</code> and not including a
-     * <code>value_type</code> prefix. If the output stream keeps
-     * (debugging) annotations and <code>topLevel</code> is
-     * <code>true</code>, then this method will write (debugging)
+     * an {@code encoded_array} and not including a
+     * {@code value_type} prefix. If the output stream keeps
+     * (debugging) annotations and {@code topLevel} is
+     * {@code true}, then this method will write (debugging)
      * annotations.
      *
-     * @param array non-null; array instance to write
-     * @param topLevel <code>true</code> iff the given annotation is the
-     * top-level annotation or <code>false</code> if it is a sub-annotation
+     * @param array {@code non-null;} array 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
      * of some other annotation
      */
     public void writeArray(CstArray array, boolean topLevel) {
@@ -295,15 +295,15 @@ public final class ValueEncoder {
 
     /**
      * Writes out the encoded form of the given annotation, that is,
-     * as an <code>encoded_annotation</code> and not including a
-     * <code>value_type</code> prefix. If the output stream keeps
-     * (debugging) annotations and <code>topLevel</code> is
-     * <code>true</code>, then this method will write (debugging)
+     * as an {@code encoded_annotation} and not including a
+     * {@code value_type} prefix. If the output stream keeps
+     * (debugging) annotations and {@code topLevel} is
+     * {@code true}, then this method will write (debugging)
      * annotations.
      * 
-     * @param annotation non-null; annotation instance to write
-     * @param topLevel <code>true</code> iff the given annotation is the
-     * top-level annotation or <code>false</code> if it is a sub-annotation
+     * @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
      * of some other annotation
      */
     public void writeAnnotation(Annotation annotation, boolean topLevel) {
@@ -361,8 +361,8 @@ public final class ValueEncoder {
      * Gets the colloquial type name and human form of the type of the
      * given constant, when used as an encoded value.
      * 
-     * @param cst non-null; the constant
-     * @return non-null; its type name and human form
+     * @param cst {@code non-null;} the constant
+     * @return {@code non-null;} its type name and human form
      */
     public static String constantToHuman(Constant cst) {
         int type = constantToValueType(cst);
@@ -385,7 +385,7 @@ public final class ValueEncoder {
      * for any signed integral type.
      * 
      * @param type the type constant
-     * @param value <code>long</code> bits of the value
+     * @param value {@code long} bits of the value
      */
     private void writeSignedIntegralValue(int type, long value) {
         /*
@@ -422,7 +422,7 @@ public final class ValueEncoder {
      * for any unsigned integral type.
      * 
      * @param type the type constant
-     * @param value <code>long</code> bits of the value
+     * @param value {@code long} bits of the value
      */
     private void writeUnsignedIntegralValue(int type, long value) {
         // Figure out how many bits are needed to represent the value.
@@ -453,7 +453,7 @@ public final class ValueEncoder {
      * right-zero-extended value.
      * 
      * @param type the type constant
-     * @param value <code>long</code> bits of the value
+     * @param value {@code long} bits of the value
      */
     private void writeRightZeroExtendedValue(int type, long value) {
         // Figure out how many bits are needed to represent the value.
@@ -484,12 +484,12 @@ public final class ValueEncoder {
 
 
     /**
-     * Helper for <code>addContents()</code> methods, which adds
+     * Helper for {@code addContents()} methods, which adds
      * contents for a particular {@link Annotation}, calling itself
      * recursively should it encounter a nested annotation.
      *
-     * @param file non-null; the file to add to 
-     * @param annotation non-null; the annotation to add contents for
+     * @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) {
         TypeIdsSection typeIds = file.getTypeIds();
@@ -504,14 +504,14 @@ public final class ValueEncoder {
     }
 
     /**
-     * Helper for <code>addContents()</code> methods, which adds
+     * Helper for {@code addContents()} methods, which adds
      * contents for a particular constant, calling itself recursively
      * should it encounter a {@link CstArray} and calling {@link
      * #addContents(DexFile,Annotation)} recursively should it
      * encounter a {@link CstAnnotation}.
      * 
-     * @param file non-null; the file to add to 
-     * @param cst non-null; the constant to add contents for
+     * @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) {
         TypeIdsSection typeIds = file.getTypeIds();
index b7cf164..6154c61 100644 (file)
@@ -41,20 +41,20 @@ import java.util.TreeMap;
  */
 public final class Annotation extends MutabilityControl 
         implements Comparable<Annotation>, ToHuman {
-    /** non-null; type of the annotation */
+    /** {@code non-null;} type of the annotation */
     private final CstType type;
 
-    /** non-null; the visibility of the annotation */
+    /** {@code non-null;} the visibility of the annotation */
     private final AnnotationVisibility visibility;
 
-    /** non-null; map from names to {@link NameValuePair} instances */
+    /** {@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 non-null; type of the annotation
-     * @param visibility non-null; the visibility of the annotation
+     * @param type {@code non-null;} type of the annotation
+     * @param visibility {@code non-null;} the visibility of the annotation
      */
     public Annotation(CstType type, AnnotationVisibility visibility) {
         if (type == null) {
@@ -165,7 +165,7 @@ public final class Annotation extends MutabilityControl
     /**
      * Gets the type of this instance.
      * 
-     * @return non-null; the type
+     * @return {@code non-null;} the type
      */
     public CstType getType() {
         return type;
@@ -174,7 +174,7 @@ public final class Annotation extends MutabilityControl
     /**
      * Gets the visibility of this instance.
      * 
-     * @return non-null; the visibility
+     * @return {@code non-null;} the visibility
      */
     public AnnotationVisibility getVisibility() {
         return visibility;
@@ -185,7 +185,7 @@ public final class Annotation extends MutabilityControl
      * If there is a preexisting element with the same name, it will be
      * replaced by this method.
      * 
-     * @param pair non-null; the (name, value) pair to place into this instance
+     * @param pair {@code non-null;} the (name, value) pair to place into this instance
      */
     public void put(NameValuePair pair) {
         throwIfImmutable();
@@ -202,7 +202,7 @@ public final class Annotation extends MutabilityControl
      * It is an error to call this method if there is a preexisting element
      * with the same name.
      * 
-     * @param pair non-null; the (name, value) pair to add to this instance
+     * @param pair {@code non-null;} the (name, value) pair to add to this instance
      */
     public void add(NameValuePair pair) {
         throwIfImmutable();
@@ -224,7 +224,7 @@ public final class Annotation extends MutabilityControl
      * Gets the set of name-value pairs contained in this instance. The
      * result is always unmodifiable.
      * 
-     * @return non-null; the set of name-value pairs
+     * @return {@code non-null;} the set of name-value pairs
      */
     public Collection<NameValuePair> getNameValuePairs() {
         return Collections.unmodifiableCollection(elements.values());
index c53fcd8..26246bb 100644 (file)
@@ -27,13 +27,13 @@ public enum AnnotationVisibility implements ToHuman {
     SYSTEM("system"),
     EMBEDDED("embedded");
 
-    /** non-null; the human-oriented string representation */
+    /** {@code non-null;} the human-oriented string representation */
     private final String human;
 
     /**
      * Constructs an instance.
      * 
-     * @param human non-null; the human-oriented string representation
+     * @param human {@code non-null;} the human-oriented string representation
      */
     private AnnotationVisibility(String human) {
         this.human = human;
index c1da883..dcb74a1 100644 (file)
@@ -29,14 +29,14 @@ import java.util.TreeMap;
  */
 public final class Annotations extends MutabilityControl 
         implements Comparable<Annotations> {
-    /** non-null; immutable empty instance */
+    /** {@code non-null;} immutable empty instance */
     public static final Annotations EMPTY = new Annotations();
 
     static {
         EMPTY.setImmutable();
     }
     
-    /** non-null; map from types to annotations */
+    /** {@code non-null;} map from types to annotations */
     private final TreeMap<CstType, Annotation> annotations;
 
     /**
@@ -44,9 +44,9 @@ public final class Annotations extends MutabilityControl
      * two given instances. The two instances must contain disjoint sets
      * of types.
      * 
-     * @param a1 non-null; an instance
-     * @param a2 non-null; the other instance
-     * @return non-null; the combination
+     * @param a1 {@code non-null;} an instance
+     * @param a2 {@code non-null;} the other instance
+     * @return {@code non-null;} the combination
      * @throws IllegalArgumentException thrown if there is a duplicate type
      */
     public static Annotations combine(Annotations a1, Annotations a2) {
@@ -64,9 +64,9 @@ public final class Annotations extends MutabilityControl
      * given instance with the given additional annotation. The latter's
      * type must not already appear in the former.
      * 
-     * @param annotations non-null; the instance to augment
-     * @param annotation non-null; the additional annotation
-     * @return non-null; the combination
+     * @param annotations {@code non-null;} the instance to augment
+     * @param annotation {@code non-null;} the additional annotation
+     * @return {@code non-null;} the combination
      * @throws IllegalArgumentException thrown if there is a duplicate type
      */
     public static Annotations combine(Annotations annotations,
@@ -152,7 +152,7 @@ public final class Annotations extends MutabilityControl
     /**
      * Gets the number of elements in this instance.
      * 
-     * @return &gt;= 0; the size
+     * @return {@code >= 0;} the size
      */
     public int size() {
         return annotations.size();
@@ -162,7 +162,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 non-null; the element to add
+     * @param annotation {@code non-null;} the element to add
      * @throws IllegalArgumentException thrown if there is a duplicate type
      */
     public void add(Annotation annotation) {
@@ -186,7 +186,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 non-null; the annotations to add
+     * @param toAdd {@code non-null;} the annotations to add
      * @throws IllegalArgumentException thrown if there is a duplicate type
      */
     public void addAll(Annotations toAdd) {
@@ -205,7 +205,7 @@ public final class Annotations extends MutabilityControl
      * Gets the set of annotations contained in this instance. The
      * result is always unmodifiable.
      * 
-     * @return non-null; the set of annotations
+     * @return {@code non-null;} the set of annotations
      */
     public Collection<Annotation> getAnnotations() {
         return Collections.unmodifiableCollection(annotations.values());
index 43a07ba..0f4207b 100644 (file)
@@ -23,7 +23,7 @@ import com.android.dx.util.FixedSizeList;
  */
 public final class AnnotationsList
         extends FixedSizeList {
-    /** non-null; immutable empty instance */
+    /** {@code non-null;} immutable empty instance */
     public static final AnnotationsList EMPTY = new AnnotationsList(0);
     
     /**
@@ -32,9 +32,9 @@ public final class AnnotationsList
      * same number of elements, and each pair of elements must contain
      * disjoint sets of types.
      * 
-     * @param list1 non-null; an instance
-     * @param list2 non-null; the other instance
-     * @return non-null; the combination
+     * @param list1 {@code non-null;} an instance
+     * @param list2 {@code non-null;} the other instance
+     * @return {@code non-null;} the combination
      */
     public static AnnotationsList combine(AnnotationsList list1,
             AnnotationsList list2) {
@@ -57,7 +57,7 @@ public final class AnnotationsList
     }
 
     /**
-     * Constructs an instance. All indices initially contain <code>null</code>.
+     * Constructs an instance. All indices initially contain {@code null}.
      * 
      * @param size the size of the list
      */
@@ -68,10 +68,10 @@ 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</code>.
+     * do that, this will throw {@code NullPointerException}.
      * 
-     * @param n &gt;= 0, &lt; size(); which index
-     * @return non-null; element at that index
+     * @param n {@code >= 0, < size();} which index
+     * @return {@code non-null;} element at that index
      */
     public Annotations get(int n) {
         return (Annotations) get0(n);
@@ -81,8 +81,8 @@ public final class AnnotationsList
      * Sets the element at the given index. The given element must be
      * immutable.
      * 
-     * @param n &gt;= 0, &lt; size(); which index
-     * @param a null-ok; the element to set at <code>n</code>
+     * @param n {@code >= 0, < size();} which index
+     * @param a {@code null-ok;} the element to set at {@code n}
      */
     public void set(int n, Annotations a) {
         a.throwIfMutable();
index dadabaa..7137a60 100644 (file)
@@ -24,17 +24,17 @@ import com.android.dx.rop.cst.CstUtf8;
  * A (name, value) pair. These are used as the contents of an annotation.
  */
 public final class NameValuePair implements Comparable<NameValuePair> {
-    /** non-null; the name */
+    /** {@code non-null;} the name */
     private final CstUtf8 name;
 
-    /** non-null; the value */
+    /** {@code non-null;} the value */
     private final Constant value;
     
     /**
      * Construct an instance.
      * 
-     * @param name non-null; the name
-     * @param value non-null; the value
+     * @param name {@code non-null;} the name
+     * @param value {@code non-null;} the value
      */
     public NameValuePair(CstUtf8 name, Constant value) {
         if (name == null) {
@@ -95,7 +95,7 @@ public final class NameValuePair implements Comparable<NameValuePair> {
     /**
      * Gets the name.
      * 
-     * @return non-null; the name
+     * @return {@code non-null;} the name
      */
     public CstUtf8 getName() {
         return name;
@@ -104,7 +104,7 @@ public final class NameValuePair implements Comparable<NameValuePair> {
     /**
      * Gets the value.
      * 
-     * @return non-null; the valute
+     * @return {@code non-null;} the value
      */
     public Constant getValue() {
         return value;
index 265cfa6..b76b610 100644 (file)
@@ -23,8 +23,8 @@ import com.android.dx.util.Hex;
  * related utilities. Although, at the rop layer, flags are generally
  * ignored, this is the layer of communication, and as such, this
  * package is where these definitions belong. The flag definitions are
- * identical to Java access flags, but <code>ACC_SUPER</code> isn't
- * used at all in translated code, and <code>ACC_SYNCHRONIZED</code>
+ * identical to Java access flags, but {@code ACC_SUPER} isn't
+ * used at all in translated code, and {@code ACC_SYNCHRONIZED}
  * is only used in a very limited way.
  */
 public final class AccessFlags {
@@ -44,13 +44,13 @@ public final class AccessFlags {
     public static final int ACC_FINAL = 0x0010;
 
     /**
-     * synchronized method; only valid in dex files for <code>native</code>
+     * synchronized method; only valid in dex files for {@code native}
      * methods
      */
     public static final int ACC_SYNCHRONIZED = 0x0020;
 
     /**
-     * class with new-style <code>invokespecial</code> for superclass
+     * class with new-style {@code invokespecial} for superclass
      * method access 
      */
     public static final int ACC_SUPER = 0x0020;
@@ -77,7 +77,7 @@ public final class AccessFlags {
     public static final int ACC_ABSTRACT = 0x0400;
 
     /**
-     * method with strict floating point (<code>strictfp</code>)
+     * method with strict floating point ({@code strictfp})
      * behavior 
      */
     public static final int ACC_STRICT = 0x0800;
@@ -98,7 +98,7 @@ public final class AccessFlags {
     public static final int ACC_CONSTRUCTOR = 0x10000;
 
     /**
-     * method was declared <code>synchronized</code>; has no effect on
+     * method was declared {@code synchronized}; has no effect on
      * execution (other than inspecting this flag, per se)
      */
     public static final int ACC_DECLARED_SYNCHRONIZED = 0x20000;
@@ -147,7 +147,7 @@ public final class AccessFlags {
      * as defined on classes (not fields or methods).
      * 
      * @param flags the flags
-     * @return non-null; human-oriented string
+     * @return {@code non-null;} human-oriented string
      */
     public static String classString(int flags) {
         return humanHelper(flags, CLASS_FLAGS, CONV_CLASS);
@@ -158,7 +158,7 @@ public final class AccessFlags {
      * as defined on inner classes.
      * 
      * @param flags the flags
-     * @return non-null; human-oriented string
+     * @return {@code non-null;} human-oriented string
      */
     public static String innerClassString(int flags) {
         return humanHelper(flags, INNER_CLASS_FLAGS, CONV_CLASS);
@@ -169,7 +169,7 @@ public final class AccessFlags {
      * as defined on fields (not classes or methods).
      * 
      * @param flags the flags
-     * @return non-null; human-oriented string
+     * @return {@code non-null;} human-oriented string
      */
     public static String fieldString(int flags) {
         return humanHelper(flags, FIELD_FLAGS, CONV_FIELD);
@@ -180,106 +180,106 @@ public final class AccessFlags {
      * as defined on methods (not classes or fields).
      * 
      * @param flags the flags
-     * @return non-null; human-oriented string
+     * @return {@code non-null;} human-oriented string
      */
     public static String methodString(int flags) {
         return humanHelper(flags, METHOD_FLAGS, CONV_METHOD);
     }
 
     /**
-     * Returns whether the flag <code>ACC_PUBLIC</code> is on in the given
+     * 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</code> flag
+     * @return the value of the {@code ACC_PUBLIC} flag
      */
     public static boolean isPublic(int flags) {
         return (flags & ACC_PUBLIC) != 0;
     }
 
     /**
-     * Returns whether the flag <code>ACC_PROTECTED</code> is on in the given
+     * 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</code> flag
+     * @return the value of the {@code ACC_PROTECTED} flag
      */
     public static boolean isProtected(int flags) {
         return (flags & ACC_PROTECTED) != 0;
     }
 
     /**
-     * Returns whether the flag <code>ACC_PRIVATE</code> is on in the given
+     * 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</code> flag
+     * @return the value of the {@code ACC_PRIVATE} flag
      */
     public static boolean isPrivate(int flags) {
         return (flags & ACC_PRIVATE) != 0;
     }
 
     /**
-     * Returns whether the flag <code>ACC_STATIC</code> is on in the given
+     * 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</code> flag
+     * @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</code> is on in
+     * 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</code> flag
+     * @return the value of the {@code ACC_SYNCHRONIZED} flag
      */
     public static boolean isSynchronized(int flags) {
         return (flags & ACC_SYNCHRONIZED) != 0;
     }
 
     /**
-     * Returns whether the flag <code>ACC_ABSTRACT</code> is on in the given
+     * 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</code> flag
+     * @return the value of the {@code ACC_ABSTRACT} flag
      */
     public static boolean isAbstract(int flags) {
         return (flags & ACC_ABSTRACT) != 0;
     }
 
     /**
-     * Returns whether the flag <code>ACC_NATIVE</code> is on in the given
+     * 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</code> flag
+     * @return the value of the {@code ACC_NATIVE} flag
      */
     public static boolean isNative(int flags) {
         return (flags & ACC_NATIVE) != 0;
     }
 
     /**
-     * Returns whether the flag <code>ACC_ANNOTATION</code> is on in the given
+     * 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</code> flag
+     * @return the value of the {@code ACC_ANNOTATION} flag
      */
     public static boolean isAnnotation(int flags) {
         return (flags & ACC_ANNOTATION) != 0;
     }
 
     /**
-     * Returns whether the flag <code>ACC_DECLARED_SYNCHRONIZED</code> is
+     * 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</code> flag
+     * @return the value of the {@code ACC_DECLARED_SYNCHRONIZED} flag
      */
     public static boolean isDeclaredSynchronized(int flags) {
         return (flags & ACC_DECLARED_SYNCHRONIZED) != 0;
@@ -291,8 +291,8 @@ public final class AccessFlags {
      * 
      * @param flags the defined flags
      * @param mask mask for the "defined" bits
-     * @param what what the flags represent (one of <code>CONV_*</code>)
-     * @return non-null; human-oriented string
+     * @param what what the flags represent (one of {@code CONV_*})
+     * @return {@code non-null;} human-oriented string
      */
     private static String humanHelper(int flags, int mask, int what) {
         StringBuffer sb = new StringBuffer(80);
index 66db5aa..7bb2d9b 100644 (file)
@@ -25,34 +25,34 @@ import com.android.dx.util.LabeledItem;
  * Basic block of register-based instructions.
  */
 public final class BasicBlock implements LabeledItem {
-    /** &gt;= 0; target label for this block */
+    /** {@code >= 0;} target label for this block */
     private final int label;
 
-    /** non-null; list of instructions in this block */
+    /** {@code non-null;} list of instructions in this block */
     private final InsnList insns;
 
     /**
-     * non-null; full list of successors that this block may
+     * {@code non-null;} full list of successors that this block may
      * branch to 
      */
     private final IntList successors;
 
     /**
-     * &gt;= -1; the primary / standard-flow / "default" successor, or
-     * <code>-1</code> if this block has no successors (that is, it
+     * {@code >= -1;} the primary / standard-flow / "default" successor, or
+     * {@code -1} if this block has no successors (that is, it
      * exits the function/method) 
      */
     private final int primarySuccessor;
 
     /**
-     * Constructs an instance. The predecessor set is set to <code>null</code>.
+     * Constructs an instance. The predecessor set is set to {@code null}.
      * 
-     * @param label &gt;= 0; target label for this block
-     * @param insns non-null; list of instructions in this block
-     * @param successors non-null; full list of successors that this
+     * @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
      * block may branch to
-     * @param primarySuccessor &gt;= -1; the primary / standard-flow /
-     * "default" successor, or <code>-1</code> if this block has no
+     * @param primarySuccessor {@code >= -1;} the primary / standard-flow /
+     * "default" successor, or {@code -1} if this block has no
      * successors (that is, it exits the function/method or is an
      * unconditional throw)
      */
@@ -116,7 +116,7 @@ public final class BasicBlock implements LabeledItem {
      * {@inheritDoc}
      * 
      * Instances of this class compare by identity. That is,
-     * <code>x.equals(y)</code> is only true if <code>x == y</code>.
+     * {@code x.equals(y)} is only true if {@code x == y}.
      */
     @Override
     public boolean equals(Object other) {
@@ -137,7 +137,7 @@ public final class BasicBlock implements LabeledItem {
     /**
      * Gets the target label of this block.
      * 
-     * @return &gt;= 0; the label
+     * @return {@code >= 0;} the label
      */
     public int getLabel() {
         return label;
@@ -146,7 +146,7 @@ public final class BasicBlock implements LabeledItem {
     /**
      * Gets the list of instructions inside this block.
      * 
-     * @return non-null; the instruction list
+     * @return {@code non-null;} the instruction list
      */
     public InsnList getInsns() {
         return insns;
@@ -155,7 +155,7 @@ public final class BasicBlock implements LabeledItem {
     /**
      * Gets the list of successors that this block may branch to.
      * 
-     * @return non-null; the successors list
+     * @return {@code non-null;} the successors list
      */
     public IntList getSuccessors() {
         return successors;
@@ -164,7 +164,7 @@ public final class BasicBlock implements LabeledItem {
     /**
      * Gets the primary successor of this block.
      * 
-     * @return &gt;= -1; the primary successor, or <code>-1</code> if this
+     * @return {@code >= -1;} the primary successor, or {@code -1} if this
      * block has no successors at all
      */
     public int getPrimarySuccessor() {
@@ -175,7 +175,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 &gt;= 0; the secondary successor
+     * @return {@code >= 0;} the secondary successor
      */
     public int getSecondarySuccessor() {
         if (successors.size() != 2) {
@@ -193,9 +193,9 @@ public final class BasicBlock implements LabeledItem {
 
     /**
      * Gets the first instruction of this block. This is just a
-     * convenient shorthand for <code>getInsns().get(0)</code>.
+     * convenient shorthand for {@code getInsns().get(0)}.
      * 
-     * @return non-null; the first instruction
+     * @return {@code non-null;} the first instruction
      */
     public Insn getFirstInsn() {
         return insns.get(0);
@@ -203,9 +203,9 @@ public final class BasicBlock implements LabeledItem {
 
     /**
      * Gets the last instruction of this block. This is just a
-     * convenient shorthand for <code>getInsns().getLast()</code>.
+     * convenient shorthand for {@code getInsns().getLast()}.
      * 
-     * @return non-null; the last instruction
+     * @return {@code non-null;} the last instruction
      */
     public Insn getLastInsn() {
         return insns.getLast();
@@ -213,9 +213,9 @@ public final class BasicBlock implements LabeledItem {
 
     /**
      * Returns whether this block might throw an exception. This is
-     * just a convenient shorthand for <code>getLastInsn().canThrow()</code>.
+     * just a convenient shorthand for {@code getLastInsn().canThrow()}.
      * 
-     * @return <code>true</code> iff this block might throw an
+     * @return {@code true} iff this block might throw an
      * exception
      */
     public boolean canThrow() {
@@ -228,7 +228,7 @@ public final class BasicBlock implements LabeledItem {
      * the block to see if it could throw, and if so, whether it in fact
      * has any associated handlers.
      * 
-     * @return <code>true</code> iff this block has any associated
+     * @return {@code true} iff this block has any associated
      * exception handlers
      */
     public boolean hasExceptionHandlers() {
@@ -241,9 +241,9 @@ public final class BasicBlock implements LabeledItem {
      * if any. This is just a shorthand for inspecting the last
      * instruction in the block to see if it could throw, and if so,
      * grabbing the catch list out of it. If not, this returns an
-     * empty list (not <code>null</code>).
+     * empty list (not {@code null}).
      *
-     * @return non-null; the exception handler types associated with
+     * @return {@code non-null;} the exception handler types associated with
      * this block
      */
     public TypeList getExceptionHandlerTypes() {
@@ -257,7 +257,7 @@ public final class BasicBlock implements LabeledItem {
      * amount.
      * 
      * @param delta the amount to offset register numbers by
-     * @return non-null; an appropriately-constructed instance
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public BasicBlock withRegisterOffset(int delta) {
         return new BasicBlock(label, insns.withRegisterOffset(delta),
index 6564318..0627425 100644 (file)
@@ -27,14 +27,14 @@ import com.android.dx.util.LabeledList;
  */
 public final class BasicBlockList extends LabeledList {
     /**
-     * &gt;= -1; the count of registers required by this method or
-     * <code>-1</code> if not yet calculated 
+     * {@code >= -1;} the count of registers required by this method or
+     * {@code -1} if not yet calculated 
      */
     private int regCount;
 
     /**
-     * Constructs an instance. All indices initially contain <code>null</code>,
-     * and the first-block label is initially <code>-1</code>.
+     * 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
      */
@@ -45,7 +45,7 @@ public final class BasicBlockList extends LabeledList {
     }
 
     /**
-     * Constructs a mutable copy for <code>getMutableCopy()</code>.
+     * Constructs a mutable copy for {@code getMutableCopy()}.
      * 
      * @param old block to copy
      */
@@ -58,10 +58,10 @@ 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</code>.
+     * do that, this will throw {@code NullPointerException}.
      * 
-     * @param n &gt;= 0, &lt; size(); which index
-     * @return non-null; element at that index
+     * @param n {@code >= 0, < size();} which index
+     * @return {@code non-null;} element at that index
      */
     public BasicBlock get(int n) {
         return (BasicBlock) get0(n);
@@ -70,8 +70,8 @@ public final class BasicBlockList extends LabeledList {
     /**
      * Sets the basic block at the given index.
      * 
-     * @param n &gt;= 0, &lt; size(); which index
-     * @param bb null-ok; the element to set at <code>n</code>
+     * @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);
@@ -86,7 +86,7 @@ public final class BasicBlockList extends LabeledList {
      * instance's instructions (indirectly through {@link BasicBlock}
      * instances).
      * 
-     * @return &gt;= 0; the register count
+     * @return {@code >= 0;} the register count
      */
     public int getRegCount() {
         if (regCount == -1) {
@@ -102,7 +102,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 &gt;= 0; the total instruction count
+     * @return {@code >= 0;} the total instruction count
      */
     public int getInstructionCount() {
         int sz = size();
@@ -122,7 +122,7 @@ public final class BasicBlockList extends LabeledList {
      * Gets the total instruction count for this instance, ignoring
      * mark-local instructions which are not actually emitted.
      *
-     * @return &gt;= 0; the total instruction count
+     * @return {@code >= 0;} the total instruction count
      */
     public int getEffectiveInstructionCount() {
         int sz = size();
@@ -151,8 +151,8 @@ public final class BasicBlockList extends LabeledList {
     /**
      * Gets the first block in the list with the given label, if any.
      *
-     * @param label &gt;= 0; the label to look for
-     * @return non-null; the so-labelled block
+     * @param label {@code >= 0;} the label to look for
+     * @return {@code non-null;} the so-labelled block
      * @throws IllegalArgumentException thrown if the label isn't found
      */
     public BasicBlock labelToBlock(int label) {
@@ -169,7 +169,7 @@ public final class BasicBlockList extends LabeledList {
     /**
      * Visits each instruction of each block in the list, in order.
      * 
-     * @param visitor non-null; visitor to use
+     * @param visitor {@code non-null;} visitor to use
      */
     public void forEachInsn(Insn.Visitor visitor) {
         int sz = size();
@@ -188,7 +188,7 @@ public final class BasicBlockList extends LabeledList {
      * original.
      * 
      * @param delta the amount to offset register numbers by
-     * @return non-null; an appropriately-constructed instance
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public BasicBlockList withRegisterOffset(int delta) {
         int sz = size();
@@ -211,7 +211,7 @@ public final class BasicBlockList extends LabeledList {
     /**
      * Returns a mutable copy of this list.
      *
-     * @return non-null; an appropriately-constructed instance
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public BasicBlockList getMutableCopy() {
         return new BasicBlockList(this);
@@ -222,10 +222,10 @@ public final class BasicBlockList extends LabeledList {
      * only has one successor, then that is the preferred successor.
      * 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</code>.
+     * this returns {@code null}.
      * 
-     * @param block non-null; the block in question
-     * @return null-ok; the preferred successor, if any
+     * @param block {@code non-null;} the block in question
+     * @return {@code null-ok;} the preferred successor, if any
      */
     public BasicBlock preferredSuccessorOf(BasicBlock block) {
         int primarySuccessor = block.getPrimarySuccessor();
@@ -252,9 +252,9 @@ 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 non-null; one block to compare
-     * @param block2 non-null; the other block to compare
-     * @return <code>true</code> if the two blocks' non-primary successors
+     * @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
      * are identical
      */
     public boolean catchesEqual(BasicBlock block1,
@@ -313,7 +313,7 @@ public final class BasicBlockList extends LabeledList {
      */
     private static class RegCountVisitor
             implements Insn.Visitor {
-        /** &gt;= 0; register count in-progress */
+        /** {@code >= 0;} register count in-progress */
         private int regCount;
 
         /**
@@ -326,7 +326,7 @@ public final class BasicBlockList extends LabeledList {
         /**
          * Gets the register count.
          * 
-         * @return &gt;= 0; the count
+         * @return {@code >= 0;} the count
          */
         public int getRegCount() {
             return regCount;
@@ -363,9 +363,9 @@ public final class BasicBlockList extends LabeledList {
         }
 
         /**
-         * Helper for all the <code>visit*</code> methods.
+         * Helper for all the {@code visit*} methods.
          * 
-         * @param insn non-null; instruction being visited
+         * @param insn {@code non-null;} instruction being visited
          */
         private void visit(Insn insn) {
             RegisterSpec result = insn.getResult();
@@ -385,7 +385,7 @@ public final class BasicBlockList extends LabeledList {
         /**
          * Processes the given register spec.
          * 
-         * @param spec non-null; the register spec
+         * @param spec {@code non-null;} the register spec
          */
         private void processReg(RegisterSpec spec) {
             int reg = spec.getNextReg();
index a9da109..1ecf02c 100644 (file)
@@ -18,11 +18,11 @@ package com.android.dx.rop.code;
 
 /**
  * Implementation of {@link TranslationAdvice} which conservatively answers
- * <code>false</code> to all methods.
+ * {@code false} to all methods.
  */
 public final class ConservativeTranslationAdvice
         implements TranslationAdvice {
-    /** non-null; standard instance of this class */
+    /** {@code non-null;} standard instance of this class */
     public static final ConservativeTranslationAdvice THE_ONE =
         new ConservativeTranslationAdvice();
 
index d1cf523..26df1a9 100644 (file)
@@ -23,17 +23,17 @@ import com.android.dx.rop.cst.Constant;
  */
 public abstract class CstInsn
         extends Insn {
-    /** non-null; the constant */
+    /** {@code non-null;} the constant */
     private final Constant cst;
 
     /**
      * Constructs an instance.
      * 
-     * @param opcode non-null; the opcode
-     * @param position non-null; source position
-     * @param result null-ok; spec for the result, if any
-     * @param sources non-null; specs for all the sources
-     * @param cst non-null; constant
+     * @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
+     * @param sources {@code non-null;} specs for all the sources
+     * @param cst {@code non-null;} constant
      */
     public CstInsn(Rop opcode, SourcePosition position, RegisterSpec result,
                    RegisterSpecList sources, Constant cst) {
@@ -55,7 +55,7 @@ public abstract class CstInsn
     /**
      * Gets the constant.
      * 
-     * @return non-null; the constant
+     * @return {@code non-null;} the constant
      */
     public Constant getConstant() {
         return cst;
index 1c23824..8dbc00b 100644 (file)
@@ -25,7 +25,7 @@ import com.android.dx.rop.type.Type;
  */
 public final class DexTranslationAdvice
         implements TranslationAdvice {
-    /** non-null; standard instance of this class */
+    /** {@code non-null;} standard instance of this class */
     public static final DexTranslationAdvice THE_ONE =
         new DexTranslationAdvice();
 
@@ -98,8 +98,8 @@ public final class DexTranslationAdvice
     /**
      * Calculates the total rop width of the list of SSA registers
      *
-     * @param sources non-null; list of SSA registers
-     * @return &gt;= 0 rop-form width in register units
+     * @param sources {@code non-null;} list of SSA registers
+     * @return {@code >= 0;} rop-form width in register units
      */
     private int totalRopWidth(RegisterSpecList sources) {
         int sz = sources.size();
index 3ef4879..f99a760 100644 (file)
@@ -23,78 +23,78 @@ import com.android.dx.rop.type.Type;
  * Common exception types.
  */
 public final class Exceptions {
-    /** non-null; the type <code>java.lang.ArithmeticException</code> */
+    /** {@code non-null;} the type {@code java.lang.ArithmeticException} */
     public static final Type TYPE_ArithmeticException =
         Type.intern("Ljava/lang/ArithmeticException;");
 
     /**
-     * non-null; the type
-     * <code>java.lang.ArrayIndexOutOfBoundsException</code> 
+     * {@code non-null;} the type
+     * {@code java.lang.ArrayIndexOutOfBoundsException} 
      */
     public static final Type TYPE_ArrayIndexOutOfBoundsException =
         Type.intern("Ljava/lang/ArrayIndexOutOfBoundsException;");
 
-    /** non-null; the type <code>java.lang.ArrayStoreException</code> */
+    /** {@code non-null;} the type {@code java.lang.ArrayStoreException} */
     public static final Type TYPE_ArrayStoreException =
         Type.intern("Ljava/lang/ArrayStoreException;");
 
-    /** non-null; the type <code>java.lang.ClassCastException</code> */
+    /** {@code non-null;} the type {@code java.lang.ClassCastException} */
     public static final Type TYPE_ClassCastException =
         Type.intern("Ljava/lang/ClassCastException;");
 
-    /** non-null; the type <code>java.lang.Error</code> */
+    /** {@code non-null;} the type {@code java.lang.Error} */
     public static final Type TYPE_Error = Type.intern("Ljava/lang/Error;");
 
     /**
-     * non-null; the type
-     * <code>java.lang.IllegalMonitorStateException</code> 
+     * {@code non-null;} the type
+     * {@code java.lang.IllegalMonitorStateException} 
      */
     public static final Type TYPE_IllegalMonitorStateException =
         Type.intern("Ljava/lang/IllegalMonitorStateException;");
 
-    /** non-null; the type <code>java.lang.NegativeArraySizeException</code> */
+    /** {@code non-null;} the type {@code java.lang.NegativeArraySizeException} */
     public static final Type TYPE_NegativeArraySizeException =
         Type.intern("Ljava/lang/NegativeArraySizeException;");
 
-    /** non-null; the type <code>java.lang.NullPointerException</code> */
+    /** {@code non-null;} the type {@code java.lang.NullPointerException} */
     public static final Type TYPE_NullPointerException =
         Type.intern("Ljava/lang/NullPointerException;");
 
-    /** non-null; the list <code>[java.lang.Error]</code> */
+    /** {@code non-null;} the list {@code [java.lang.Error]} */
     public static final StdTypeList LIST_Error = StdTypeList.make(TYPE_Error);
 
     /**
-     * non-null; the list <code>[java.lang.Error,
-     * java.lang.ArithmeticException]</code> 
+     * {@code non-null;} the list {@code[java.lang.Error,
+     * java.lang.ArithmeticException]}
      */
     public static final StdTypeList LIST_Error_ArithmeticException =
         StdTypeList.make(TYPE_Error, TYPE_ArithmeticException);
 
     /**
-     * non-null; the list <code>[java.lang.Error,
-     * java.lang.ClassCastException]</code> 
+     * {@code non-null;} the list {@code[java.lang.Error,
+     * java.lang.ClassCastException]}
      */
     public static final StdTypeList LIST_Error_ClassCastException =
         StdTypeList.make(TYPE_Error, TYPE_ClassCastException);
 
     /**
-     * non-null; the list <code>[java.lang.Error,
-     * java.lang.NegativeArraySizeException]</code> 
+     * {@code non-null;} the list {@code [java.lang.Error,
+     * java.lang.NegativeArraySizeException]} 
      */
     public static final StdTypeList LIST_Error_NegativeArraySizeException =
         StdTypeList.make(TYPE_Error, TYPE_NegativeArraySizeException);
 
     /**
-     * non-null; the list <code>[java.lang.Error,
-     * java.lang.NullPointerException]</code> 
+     * {@code non-null;} the list {@code [java.lang.Error,
+     * java.lang.NullPointerException]}
      */
     public static final StdTypeList LIST_Error_NullPointerException =
         StdTypeList.make(TYPE_Error, TYPE_NullPointerException);
 
     /**
-     * non-null; the list <code>[java.lang.Error,
+     * {@code non-null;} the list {@code [java.lang.Error,
      * java.lang.NullPointerException,
-     * java.lang.ArrayIndexOutOfBoundsException]</code> 
+     * java.lang.ArrayIndexOutOfBoundsException]}
      */
     public static final StdTypeList LIST_Error_Null_ArrayIndexOutOfBounds =
         StdTypeList.make(TYPE_Error,
@@ -102,10 +102,10 @@ public final class Exceptions {
                       TYPE_ArrayIndexOutOfBoundsException);
 
     /**
-     * non-null; the list <code>[java.lang.Error,
+     * {@code non-null;} the list {@code [java.lang.Error,
      * java.lang.NullPointerException,
      * java.lang.ArrayIndexOutOfBoundsException,
-     * java.lang.ArrayStoreException]</code> 
+     * java.lang.ArrayStoreException]}
      */
     public static final StdTypeList LIST_Error_Null_ArrayIndex_ArrayStore =
         StdTypeList.make(TYPE_Error,
@@ -114,9 +114,9 @@ public final class Exceptions {
                       TYPE_ArrayStoreException);
 
     /**
-     * non-null; the list <code>[java.lang.Error,
+     * {@code non-null;} the list {@code [java.lang.Error,
      * java.lang.NullPointerException,
-     * java.lang.IllegalMonitorStateException]</code> 
+     * java.lang.IllegalMonitorStateException]}
      */
     public static final StdTypeList
         LIST_Error_Null_IllegalMonitorStateException =
index 3798afb..0fc7d2b 100644 (file)
@@ -42,11 +42,11 @@ public final class FillArrayDataInsn
     /**
      * Constructs an instance.
      * 
-     * @param opcode non-null; the opcode
-     * @param position non-null; source position
-     * @param sources non-null; specs for all the sources
-     * @param initValues non-null; list of initial values to fill the array
-     * @param cst non-null; type of the new array
+     * @param opcode {@code non-null;} the opcode
+     * @param position {@code non-null;} source position
+     * @param sources {@code non-null;} specs for all the sources
+     * @param initValues {@code non-null;} list of initial values to fill the array
+     * @param cst {@code non-null;} type of the new array
      */
     public FillArrayDataInsn(Rop opcode, SourcePosition position,
                              RegisterSpecList sources,
@@ -71,7 +71,7 @@ public final class FillArrayDataInsn
 
     /**
      * Return the list of init values
-     * @return non-null; list of init values
+     * @return {@code non-null;} list of init values
      */
     public ArrayList<Constant> getInitValues() {
         return initValues;
@@ -79,7 +79,7 @@ public final class FillArrayDataInsn
 
     /**
      * Return the type of the newly created array
-     * @return non-null; array type
+     * @return {@code non-null;} array type
      */
     public Constant getConstant() {
         return arrayType;
index b1ad0ad..77ab9c0 100644 (file)
@@ -30,25 +30,25 @@ import com.android.dx.util.ToHuman;
  * information.
  */
 public abstract class Insn implements ToHuman {
-    /** non-null; opcode */
+    /** {@code non-null;} opcode */
     private final Rop opcode;
 
-    /** non-null; source position */
+    /** {@code non-null;} source position */
     private final SourcePosition position;
 
-    /** null-ok; spec for the result of this instruction, if any */
+    /** {@code null-ok;} spec for the result of this instruction, if any */
     private final RegisterSpec result;
 
-    /** non-null; specs for all the sources of this instruction */
+    /** {@code non-null;} specs for all the sources of this instruction */
     private final RegisterSpecList sources;
 
     /**
      * Constructs an instance.
      * 
-     * @param opcode non-null; the opcode
-     * @param position non-null; source position
-     * @param result null-ok; spec for the result, if any
-     * @param sources non-null; specs for all the sources
+     * @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
+     * @param sources {@code non-null;} specs for all the sources
      */
     public Insn(Rop opcode, SourcePosition position, RegisterSpec result,
                 RegisterSpecList sources) {
@@ -74,7 +74,7 @@ public abstract class Insn implements ToHuman {
      * {@inheritDoc}
      * 
      * Instances of this class compare by identity. That is,
-     * <code>x.equals(y)</code> is only true if <code>x == y</code>.
+     * {@code x.equals(y)} is only true if {@code x == y}.
      */
     @Override
     public final boolean equals(Object other) {
@@ -102,7 +102,7 @@ public abstract class Insn implements ToHuman {
     /**
      * Gets a human-oriented (and slightly lossy) string for this instance.
      * 
-     * @return non-null; the human string form
+     * @return {@code non-null;} the human string form
      */
     public String toHuman() {
         return toHumanWithInline(getInlineString());
@@ -112,7 +112,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 null-ok; if non-null, the inline text for toHuman()
+     * @return {@code null-ok;} if non-null, the inline text for toHuman()
      */
     public String getInlineString() {
         return null;
@@ -121,7 +121,7 @@ public abstract class Insn implements ToHuman {
     /**
      * Gets the opcode.
      * 
-     * @return non-null; the opcode
+     * @return {@code non-null;} the opcode
      */
     public final Rop getOpcode() {
         return opcode;
@@ -130,17 +130,17 @@ public abstract class Insn implements ToHuman {
     /**
      * Gets the source position.
      * 
-     * @return non-null; the source position
+     * @return {@code non-null;} the source position
      */
     public final SourcePosition getPosition() {
         return position;
     }
 
     /**
-     * Gets the result spec, if any. A return value of <code>null</code>
+     * Gets the result spec, if any. A return value of {@code null}
      * means this instruction returns nothing.
      * 
-     * @return null-ok; the result spec, if any
+     * @return {@code null-ok;} the result spec, if any
      */
     public final RegisterSpec getResult() {
         return result;
@@ -149,10 +149,10 @@ public abstract class Insn implements ToHuman {
     /**
      * Gets the spec of a local variable assignment that occurs at this
      * instruction, or null if no local variable assignment occurs. This
-     * may be the result register, or for <code>mark-local</code> insns
+     * may be the result register, or for {@code mark-local} insns
      * it may be the source.
      * 
-     * @return null-ok; a named register spec or null
+     * @return {@code null-ok;} a named register spec or null
      */
     public final RegisterSpec getLocalAssignment() {
         RegisterSpec assignment;
@@ -178,7 +178,7 @@ public abstract class Insn implements ToHuman {
     /**
      * Gets the source specs.
      * 
-     * @return non-null; the source specs
+     * @return {@code non-null;} the source specs
      */
     public final RegisterSpecList getSources() {
         return sources;
@@ -186,9 +186,9 @@ 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()</code>.
+     * is just a convenient wrapper for {@code getOpcode().canThrow()}.
      * 
-     * @return <code>true</code> iff this instruction can possibly throw
+     * @return {@code true} iff this instruction can possibly throw
      */
     public final boolean canThrow() {
         return opcode.canThrow();
@@ -202,7 +202,7 @@ public abstract class Insn implements ToHuman {
      * exceptions. To determine whether this instruction can throw,
      * use {@link #canThrow}.
      * 
-     * @return non-null; the catches list
+     * @return {@code non-null;} the catches list
      */
     public abstract TypeList getCatches();
 
@@ -210,7 +210,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 non-null; the visitor to call on
+     * @param visitor {@code non-null;} the visitor to call on
      */
     public abstract void accept(Visitor visitor);
 
@@ -221,8 +221,8 @@ public abstract class Insn implements ToHuman {
      * throw. To determine whether this instruction can throw, use
      * {@link #canThrow}.
      * 
-     * @param type non-null; type to append to the catch list
-     * @return non-null; an appropriately-constructed instance
+     * @param type {@code non-null;} type to append to the catch list
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public abstract Insn withAddedCatch(Type type);
 
@@ -231,7 +231,7 @@ public abstract class Insn implements ToHuman {
      * register references have been offset by the given delta.
      * 
      * @param delta the amount to offset register references by
-     * @return non-null; an appropriately-constructed instance
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public abstract Insn withRegisterOffset(int delta);
 
@@ -239,10 +239,10 @@ public abstract class Insn implements ToHuman {
      * Returns an instance that is just like this one, except that, if
      * possible, the insn is converted into a version in which the last
      * source (if it is a constant) is represented directly rather than
-     * as a register reference. <code>this</code> is returned in cases where
+     * as a register reference. {@code this} is returned in cases where
      * the translation is not possible.
      * 
-     * @return non-null; an appropriately-constructed instance
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public Insn withLastSourceLiteral() {
         return this;
@@ -251,7 +251,7 @@ public abstract class Insn implements ToHuman {
     /**
      * Returns an exact copy of this Insn
      *
-     * @return non-null; an appropriately-constructed instance
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public Insn copy() {
         return withRegisterOffset(0);
@@ -270,8 +270,8 @@ public abstract class Insn implements ToHuman {
     }
 
     /**
-     * Compares Insn contents, since <code>Insn.equals()</code> is defined
-     * to be an identity compare. Insn's are <code>contentEquals()</code>
+     * Compares Insn contents, since {@code Insn.equals()} is defined
+     * to be an identity compare. Insn's are {@code contentEquals()}
      * if they have the same opcode, registers, source position, and other
      * metadata.
      * 
@@ -290,9 +290,9 @@ public abstract class Insn implements ToHuman {
      * Returns an instance that is just like this one, except
      * with new result and source registers.
      *
-     * @param result null-ok; new result register
-     * @param sources non-null; new sources registers
-     * @return non-null; an appropriately-constructed instance
+     * @param result {@code null-ok;} new result register
+     * @param sources {@code non-null;} new sources registers
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public abstract Insn withNewRegisters(RegisterSpec result,
             RegisterSpecList sources);
@@ -301,8 +301,8 @@ 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 null-ok; the inline argument string
-     * @return non-null; the string form
+     * @param extra {@code null-ok;} the inline argument string
+     * @return {@code non-null;} the string form
      */
     protected final String toStringWithInline(String extra) {
         StringBuffer sb = new StringBuffer(80);
@@ -334,8 +334,8 @@ 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 null-ok; the inline argument string
-     * @return non-null; the human string form
+     * @param extra {@code null-ok;} the inline argument string
+     * @return {@code non-null;} the human string form
      */
     protected final String toHumanWithInline(String extra) {
         StringBuffer sb = new StringBuffer(80);
@@ -380,42 +380,42 @@ public abstract class Insn implements ToHuman {
         /**
          * Visits a {@link PlainInsn}.
          * 
-         * @param insn non-null; the instruction to visit
+         * @param insn {@code non-null;} the instruction to visit
          */
         public void visitPlainInsn(PlainInsn insn);
 
         /**
          * Visits a {@link PlainCstInsn}.
          * 
-         * @param insn non-null; the instruction to visit
+         * @param insn {@code non-null;} the instruction to visit
          */
         public void visitPlainCstInsn(PlainCstInsn insn);
 
         /**
          * Visits a {@link SwitchInsn}.
          * 
-         * @param insn non-null; the instruction to visit
+         * @param insn {@code non-null;} the instruction to visit
          */
         public void visitSwitchInsn(SwitchInsn insn);
 
         /**
          * Visits a {@link ThrowingCstInsn}.
          * 
-         * @param insn non-null; the instruction to visit
+         * @param insn {@code non-null;} the instruction to visit
          */
         public void visitThrowingCstInsn(ThrowingCstInsn insn);
 
         /**
          * Visits a {@link ThrowingInsn}.
          * 
-         * @param insn non-null; the instruction to visit
+         * @param insn {@code non-null;} the instruction to visit
          */
         public void visitThrowingInsn(ThrowingInsn insn);
 
         /**
          * Visits a {@link FillArrayDataInsn}.
          *
-         * @param insn non-null; the instruction to visit
+         * @param insn {@code non-null;} the instruction to visit
          */
         public void visitFillArrayDataInsn(FillArrayDataInsn insn);
     }
index 34f124c..493f7fc 100644 (file)
@@ -24,7 +24,7 @@ import com.android.dx.util.FixedSizeList;
 public final class InsnList
         extends FixedSizeList {
     /**
-     * Constructs an instance. All indices initially contain <code>null</code>.
+     * Constructs an instance. All indices initially contain {@code null}.
      *
      * @param size the size of the list
      */
@@ -35,10 +35,10 @@ public final class InsnList
     /**
      * 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</code>.
+     * do that, this will throw {@code NullPointerException}.
      *
-     * @param n &gt;= 0, &lt; size(); which index
-     * @return non-null; element at that index
+     * @param n {@code >= 0, < size();} which index
+     * @return {@code non-null;} element at that index
      */
     public Insn get(int n) {
         return (Insn) get0(n);
@@ -47,8 +47,8 @@ public final class InsnList
     /**
      * Sets the instruction at the given index.
      *
-     * @param n &gt;= 0, &lt; size(); which index
-     * @param insn non-null; the instruction to set at <code>n</code>
+     * @param n {@code >= 0, < size();} which index
+     * @param insn {@code non-null;} the instruction to set at {@code n}
      */
     public void set(int n, Insn insn) {
         set0(n, insn);
@@ -56,9 +56,9 @@ public final class InsnList
 
     /**
      * Gets the last instruction. This is just a convenient shorthand for
-     * <code>get(size() - 1)</code>.
+     * {@code get(size() - 1)}.
      * 
-     * @return non-null; the last instruction
+     * @return {@code non-null;} the last instruction
      */
     public Insn getLast() {
         return get(size() - 1);
@@ -67,7 +67,7 @@ public final class InsnList
     /**
      * Visits each instruction in the list, in order.
      *
-     * @param visitor non-null; visitor to use
+     * @param visitor {@code non-null;} visitor to use
      */
     public void forEach(Insn.Visitor visitor) {
         int sz = size();
@@ -78,9 +78,9 @@ public final class InsnList
     }
 
     /**
-     * Compares the contents of this <code>InsnList</code> with another.
+     * Compares the contents of this {@code InsnList} with another.
      * The blocks must have the same number of insns, and each Insn must
-     * also return true to <code>Insn.contentEquals()</code>.
+     * also return true to {@code Insn.contentEquals()}.
      *
      * @param b to compare
      * @return true in the case described above.
@@ -108,7 +108,7 @@ public final class InsnList
      * original.
      * 
      * @param delta the amount to offset register numbers by
-     * @return non-null; an appropriately-constructed instance
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public InsnList withRegisterOffset(int delta) {
         int sz = size();
index bac6ce2..7d6bebe 100644 (file)
@@ -22,10 +22,10 @@ import com.android.dx.rop.cst.CstUtf8;
  * A local variable item: either a name or a signature or both.
  */
 public class LocalItem implements Comparable<LocalItem> {
-    /** null-ok; local variable name */
+    /** {@code null-ok;} local variable name */
     private final CstUtf8 name;
 
-    /** null-ok; local variable signature */
+    /** {@code null-ok;} local variable signature */
     private final CstUtf8 signature;
 
     /**
@@ -33,9 +33,9 @@ public class LocalItem implements Comparable<LocalItem> {
      *
      * TODO: intern these
      *
-     * @param name null-ok; local variable name
-     * @param signature null-ok; local variable signature
-     * @return non-null; appropriate instance.
+     * @param name {@code null-ok;} local variable name
+     * @param signature {@code null-ok;} local variable signature
+     * @return {@code non-null;} appropriate instance.
      */
     public static LocalItem make(CstUtf8 name, CstUtf8 signature) {
         if (name == null && signature == null) {
@@ -48,8 +48,8 @@ public class LocalItem implements Comparable<LocalItem> {
     /**
      * Constructs instance.
      *
-     * @param name null-ok; local variable name
-     * @param signature null-ok; local variable signature
+     * @param name {@code null-ok;} local variable name
+     * @param signature {@code null-ok;} local variable signature
      */
     private LocalItem(CstUtf8 name, CstUtf8 signature) {
         this.name = name;
@@ -126,7 +126,7 @@ public class LocalItem implements Comparable<LocalItem> {
     /**
      * Gets name.
      *
-     * @return null-ok; name
+     * @return {@code null-ok;} name
      */
     public CstUtf8 getName() {
         return name;
@@ -135,7 +135,7 @@ public class LocalItem implements Comparable<LocalItem> {
     /**
      * Gets signature.
      *
-     * @return null-ok; signature
+     * @return {@code null-ok;} signature
      */
     public CstUtf8 getSignature() {
         return signature;
index 2d4cbce..14ebbc4 100644 (file)
@@ -24,23 +24,23 @@ import com.android.dx.util.IntList;
  * a method.
  */
 public final class LocalVariableExtractor {
-    /** non-null; method being extracted from */
+    /** {@code non-null;} method being extracted from */
     private final RopMethod method;
 
-    /** non-null; block list for the method */
+    /** {@code non-null;} block list for the method */
     private final BasicBlockList blocks;
 
-    /** non-null; result in-progress */
+    /** {@code non-null;} result in-progress */
     private final LocalVariableInfo resultInfo;
 
-    /** non-null; work set indicating blocks needing to be processed */
+    /** {@code non-null;} work set indicating blocks needing to be processed */
     private final int[] workSet;
 
     /**
      * Extracts out all the local variable information from the given method.
      * 
-     * @param method non-null; the method to extract from
-     * @return non-null; the extracted information
+     * @param method {@code non-null;} the method to extract from
+     * @return {@code non-null;} the extracted information
      */
     public static LocalVariableInfo extract(RopMethod method) {
         LocalVariableExtractor lve = new LocalVariableExtractor(method);
@@ -50,7 +50,7 @@ public final class LocalVariableExtractor {
     /**
      * Constructs an instance. This method is private. Use {@link #extract}.
      * 
-     * @param method non-null; the method to extract from
+     * @param method {@code non-null;} the method to extract from
      */
     private LocalVariableExtractor(RopMethod method) {
         if (method == null) {
@@ -69,7 +69,7 @@ public final class LocalVariableExtractor {
     /**
      * Does the extraction.
      * 
-     * @return non-null; the extracted information
+     * @return {@code non-null;} the extracted information
      */
     private LocalVariableInfo doit() {
         for (int label = method.getFirstLabel();
@@ -86,7 +86,7 @@ public final class LocalVariableExtractor {
     /**
      * Processes a single block.
      * 
-     * @param label &gt;= 0; label of the block to process
+     * @param label {@code >= 0;} label of the block to process
      */
     private void processBlock(int label) {
         RegisterSpecSet primaryState = resultInfo.mutableCopyOfStarts(label);
index 29c239b..fa5e7cc 100644 (file)
@@ -27,30 +27,30 @@ import java.util.HashMap;
  */
 public final class LocalVariableInfo
         extends MutabilityControl {
-    /** &gt;= 0; the register count for the method */
+    /** {@code >= 0;} the register count for the method */
     private final int regCount;
 
     /**
-     * non-null; {@link RegisterSpecSet} to use when indicating a block
+     * {@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 
      */
     private final RegisterSpecSet emptySet;
 
     /**
-     * non-null; array consisting of register sets representing the
+     * {@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 
      */
     private final RegisterSpecSet[] blockStarts;
 
-    /** non-null; map from instructions to the variable each assigns */
+    /** {@code non-null;} map from instructions to the variable each assigns */
     private final HashMap<Insn, RegisterSpec> insnAssignments;
 
     /**
      * Constructs an instance.
      * 
-     * @param method non-null; the method being represented by this instance
+     * @param method {@code non-null;} the method being represented by this instance
      */
     public LocalVariableInfo(RopMethod method) {
         if (method == null) {
@@ -73,8 +73,8 @@ public final class LocalVariableInfo
      * Sets the register set associated with the start of the block with
      * the given label.
      * 
-     * @param label &gt;= 0; the block label
-     * @param specs non-null; the register set to associate with the block
+     * @param label {@code >= 0;} the block label
+     * @param specs {@code non-null;} the register set to associate with the block
      */
     public void setStarts(int label, RegisterSpecSet specs) {
         throwIfImmutable();
@@ -98,12 +98,12 @@ public final class LocalVariableInfo
      * merge the two sets and call {@link #setStarts} on the result of the
      * merge.
      * 
-     * @param label &gt;= 0; the block label
-     * @param specs non-null; the register set to merge into the start set
+     * @param label {@code >= 0;} the block label
+     * @param specs {@code non-null;} the register set to merge into the start set
      * for the block
-     * @return <code>true</code> if the merge resulted in an actual change
+     * @return {@code true} if the merge resulted in an actual change
      * to the associated set (including storing one for the first time) or
-     * <code>false</code> if there was no change
+     * {@code false} if there was no change
      */
     public boolean mergeStarts(int label, RegisterSpecSet specs) {
         RegisterSpecSet start = getStarts0(label);
@@ -132,8 +132,8 @@ public final class LocalVariableInfo
      * 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 &gt;= 0; the block label
-     * @return non-null; the associated register set
+     * @param label {@code >= 0;} the block label
+     * @return {@code non-null;} the associated register set
      */
     public RegisterSpecSet getStarts(int label) {
         RegisterSpecSet result = getStarts0(label);
@@ -144,10 +144,10 @@ 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())</code>.
+     * {@code getStarts(block.getLabel())}.
      * 
-     * @param block non-null; the block in question
-     * @return non-null; the associated register set
+     * @param block {@code non-null;} the block in question
+     * @return {@code non-null;} the associated register set
      */
     public RegisterSpecSet getStarts(BasicBlock block) {
         return getStarts(block.getLabel());
@@ -159,8 +159,8 @@ public final class LocalVariableInfo
      * newly-allocated empty {@link RegisterSpecSet} of appropriate
      * max size if there is not yet any set associated with the block.
      * 
-     * @param label &gt;= 0; the block label
-     * @return non-null; the associated register set
+     * @param label {@code >= 0;} the block label
+     * @return {@code non-null;} the associated register set
      */
     public RegisterSpecSet mutableCopyOfStarts(int label) {
         RegisterSpecSet result = getStarts0(label);
@@ -180,8 +180,8 @@ public final class LocalVariableInfo
      * simple type and the one in the instruction can be an arbitrary
      * {@link TypeBearer} (such as a constant value).
      * 
-     * @param insn non-null; the instruction in question
-     * @param spec non-null; the associated register spec
+     * @param insn {@code non-null;} the instruction in question
+     * @param spec {@code non-null;} the associated register spec
      */
     public void addAssignment(Insn insn, RegisterSpec spec) {
         throwIfImmutable();
@@ -201,8 +201,8 @@ public final class LocalVariableInfo
      * Gets the named register being assigned by the given instruction, if
      * previously stored in this instance.
      * 
-     * @param insn non-null; instruction in question
-     * @return null-ok; the named register being assigned, if any
+     * @param insn {@code non-null;} instruction in question
+     * @return {@code null-ok;} the named register being assigned, if any
      */
     public RegisterSpec getAssignment(Insn insn) {
         return insnAssignments.get(insn);
@@ -211,7 +211,7 @@ public final class LocalVariableInfo
     /**
      * Gets the number of assignments recorded by this instance.
      * 
-     * @return &gt;= 0; the number of assignments
+     * @return {@code >= 0;} the number of assignments
      */
     public int getAssignmentCount() {
         return insnAssignments.size();
@@ -235,8 +235,8 @@ public final class LocalVariableInfo
      * Helper method, to get the starts for a label, throwing the
      * right exception for range problems.
      * 
-     * @param label &gt;= 0; the block label
-     * @return null-ok; associated register set or <code>null</code> if there
+     * @param label {@code >= 0;} the block label
+     * @return {@code null-ok;} associated register set or {@code null} if there
      * is none
      */
     private RegisterSpecSet getStarts0(int label) {
index 908b3cb..7a3ac38 100644 (file)
@@ -30,11 +30,11 @@ public final class PlainCstInsn
     /**
      * Constructs an instance.
      * 
-     * @param opcode non-null; the opcode
-     * @param position non-null; source position
-     * @param result null-ok; spec for the result, if any
-     * @param sources non-null; specs for all the sources
-     * @param cst non-null; the constant
+     * @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
+     * @param sources {@code non-null;} specs for all the sources
+     * @param cst {@code non-null;} the constant
      */
     public PlainCstInsn(Rop opcode, SourcePosition position,
                         RegisterSpec result, RegisterSpecList sources,
index 4c5c9b7..d1db646 100644 (file)
@@ -31,10 +31,10 @@ public final class PlainInsn
     /**
      * Constructs an instance.
      * 
-     * @param opcode non-null; the opcode
-     * @param position non-null; source position
-     * @param result null-ok; spec for the result, if any
-     * @param sources non-null; specs for all the sources
+     * @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
+     * @param sources {@code non-null;} specs for all the sources
      */
     public PlainInsn(Rop opcode, SourcePosition position,
                      RegisterSpec result, RegisterSpecList sources) {
@@ -57,10 +57,10 @@ public final class PlainInsn
     /**
      * Constructs a single-source instance.
      * 
-     * @param opcode non-null; the opcode
-     * @param position non-null; source position
-     * @param result null-ok; spec for the result, if any
-     * @param source non-null; spec for the source
+     * @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
+     * @param source {@code non-null;} spec for the source
      */
     public PlainInsn(Rop opcode, SourcePosition position, RegisterSpec result,
                      RegisterSpec source) {
index f201f68..2084a69 100644 (file)
@@ -21,283 +21,279 @@ 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</code>
- * is the result register, <code>x</code> is the first argument,
- * <code>y</code> is the second argument, and <code>z</code> is the
+ * <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
  * third argument. The expression which describes
  * the operation uses Java-ish syntax but is preceded by type indicators for
  * each of the values.
  */
 public final class RegOps {
-    /** <code>nop()</code> */
+    /** {@code nop()} */
     public static final int NOP = 1;
 
-    /** <code>T: any type; r,x: T :: r = x;</code> */
+    /** {@code T: any type; r,x: T :: r = x;} */
     public static final int MOVE = 2;
 
-    /** <code>T: any type; r,param(x): T :: r = param(x)</code> */
+    /** {@code T: any type; r,param(x): T :: r = param(x)} */
     public static final int MOVE_PARAM = 3;
 
     /**
-     * <code>T: Throwable; r: T :: r = caught_exception</code>.
+     * {@code T: Throwable; r: T :: r = caught_exception}.
      * <b>Note:</b> This opcode should only ever be used in the
      * first instruction of a block, and such blocks must be
      * the start of an exception handler.
      */
     public static final int MOVE_EXCEPTION = 4;
 
-    /** <code>T: any type; r, literal: T :: r = literal;</code> */
+    /** {@code T: any type; r, literal: T :: r = literal;} */
     public static final int CONST = 5;
 
-    /** <code>goto <i>label</i></code> */
+    /** {@code goto label} */
     public static final int GOTO = 6;
 
     /**
-     * <code>T: int or Object; x,y: T :: if (x == y) goto
-     * <i>label</i></code> 
+     * {@code T: int or Object; x,y: T :: if (x == y) goto
+     * label}
      */
     public static final int IF_EQ = 7;
 
     /**
-     * <code>T: int or Object; x,y: T :: if (x != y) goto
-     * <i>label</i></code> 
+     * {@code T: int or Object; x,y: T :: if (x != y) goto
+     * label}
      */
     public static final int IF_NE = 8;
 
-    /** <code>x,y: int :: if (x &lt; y) goto <i>label</i></code> */
+    /** {@code x,y: int :: if (x < y) goto label} */
     public static final int IF_LT = 9;
 
-    /** <code>x,y: int :: if (x &gt;= y) goto <i>label</i></code> */
+    /** {@code x,y: int :: if (x >= y) goto label} */
     public static final int IF_GE = 10;
 
-    /** <code>x,y: int :: if (x &lt;= y) goto <i>label</i></code> */
+    /** {@code x,y: int :: if (x <= y) goto label} */
     public static final int IF_LE = 11;
 
-    /** <code>x,y: int :: if (x &gt; y) goto <i>label</i></code> */
+    /** {@code x,y: int :: if (x > y) goto label} */
     public static final int IF_GT = 12;
 
-    /** <code>x: int :: goto <i>table[x]</i></code> */
+    /** {@code x: int :: goto table[x]} */
     public static final int SWITCH = 13;
 
-    /** <code>T: any numeric type; r,x,y: T :: r = x + y</code> */
+    /** {@code T: any numeric type; r,x,y: T :: r = x + y} */
     public static final int ADD = 14;
 
-    /** <code>T: any numeric type; r,x,y: T :: r = x - y</code> */
+    /** {@code T: any numeric type; r,x,y: T :: r = x - y} */
     public static final int SUB = 15;
 
-    /** <code>T: any numeric type; r,x,y: T :: r = x * y</code> */
+    /** {@code T: any numeric type; r,x,y: T :: r = x * y} */
     public static final int MUL = 16;
 
-    /** <code>T: any numeric type; r,x,y: T :: r = x / y</code> */
+    /** {@code T: any numeric type; r,x,y: T :: r = x / y} */
     public static final int DIV = 17;
 
     /**
-     * <code>T: any numeric type; r,x,y: T :: r = x % y</code>
+     * {@code T: any numeric type; r,x,y: T :: r = x % y}
      * (Java-style remainder) 
      */
     public static final int REM = 18;
 
-    /** <code>T: any numeric type; r,x: T :: r = -x</code> */
+    /** {@code T: any numeric type; r,x: T :: r = -x} */
     public static final int NEG = 19;
 
-    /** <code>T: any integral type; r,x,y: T :: r = x &amp; y</code> */
+    /** {@code T: any integral type; r,x,y: T :: r = x & y} */
     public static final int AND = 20;
 
-    /** <code>T: any integral type; r,x,y: T :: r = x | y</code> */
+    /** {@code T: any integral type; r,x,y: T :: r = x | y} */
     public static final int OR = 21;
 
-    /** <code>T: any integral type; r,x,y: T :: r = x ^ y</code> */
+    /** {@code T: any integral type; r,x,y: T :: r = x ^ y} */
     public static final int XOR = 22;
 
     /**
-     * <code>T: any integral type; r,x: T; y: int :: r = x &lt;&lt;
-     * y</code> 
+     * {@code T: any integral type; r,x: T; y: int :: r = x << y}
      */
     public static final int SHL = 23;
 
     /**
-     * <code>T: any integral type; r,x: T; y: int :: r = x &gt;&gt;
-     * y</code> (signed right-shift) 
+     * {@code T: any integral type; r,x: T; y: int :: r = x >> y}
+     * (signed right-shift) 
      */
     public static final int SHR = 24;
 
     /**
-     * <code>T: any integral type; r,x: T; y: int :: r = x
-     * &gt;&gt;&gt; y</code> (unsigned right-shift) 
+     * {@code T: any integral type; r,x: T; y: int :: r = x >>> y}
+     * (unsigned right-shift) 
      */
     public static final int USHR = 25;
 
-    /** <code>T: any integral type; r,x: T :: r = ~x</code> */
+    /** {@code T: any integral type; r,x: T :: r = ~x} */
     public static final int NOT = 26;
 
     /**
-     * <code>T: any numeric type; r: int; x,y: T :: r = (x == y) ? 0
-     * : (x &gt; y) ? 1 : -1</code> (Java-style "cmpl" where a NaN is
+     * {@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) 
      */
     public static final int CMPL = 27;
 
     /**
-     * <code>T: any floating point type; r: int; x,y: T :: r = (x == y) ? 0
-     * : (x &lt; y) ? -1 : 1</code> (Java-style "cmpg" where a NaN is
+     * {@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) 
      */
     public static final int CMPG = 28;
 
     /**
-     * <code>T: any numeric type; U: any numeric type; r: T; x: U ::
-     * r = (T) x</code> (numeric type conversion between the four
+     * {@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) 
      */
     public static final int CONV = 29;
 
     /**
-     * <code>r,x: int :: r = (x &lt;&lt; 24) &gt;&gt; 24</code> (Java-style
+     * {@code r,x: int :: r = (x << 24) >> 24} (Java-style
      * convert int to byte) 
      */
     public static final int TO_BYTE = 30;
 
     /**
-     * <code>r,x: int :: r = x &amp; 0xffff</code> (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 &lt;&lt; 16) &gt;&gt; 16</code> (Java-style
+     * {@code r,x: int :: r = (x << 16) >> 16} (Java-style
      * convert int to short) 
      */
     public static final int TO_SHORT = 32;
 
-    /** <code>T: return type for the method; x: T; return x</code> */
+    /** {@code T: return type for the method; x: T; return x} */
     public static final int RETURN = 33;
 
-    /** <code>T: any type; r: int; x: T[]; :: r = x.length</code> */
+    /** {@code T: any type; r: int; x: T[]; :: r = x.length} */
     public static final int ARRAY_LENGTH = 34;
 
-    /** <code>x: Throwable :: throw(x)</code> */
+    /** {@code x: Throwable :: throw(x)} */
     public static final int THROW = 35;
 
-    /** <code>x: Object :: monitorenter(x)</code> */
+    /** {@code x: Object :: monitorenter(x)} */
     public static final int MONITOR_ENTER = 36;
 
-    /** <code>x: Object :: monitorexit(x)</code> */
+    /** {@code x: Object :: monitorexit(x)} */
     public static final int MONITOR_EXIT = 37;
 
-    /** <code>T: any type; r: T; x: T[]; y: int :: r = x[y]</code> */
+    /** {@code T: any type; r: T; x: T[]; y: int :: r = x[y]} */
     public static final int AGET = 38;
 
-    /** <code>T: any type; x: T; y: T[]; z: int :: x[y] = z</code> */
+    /** {@code T: any type; x: T; y: T[]; z: int :: x[y] = z} */
     public static final int APUT = 39;
 
     /**
-     * <code>T: any non-array object type :: r =
-     * alloc(T)</code> (allocate heap space for an object) 
+     * {@code T: any non-array object type :: r =
+     * alloc(T)} (allocate heap space for an object) 
      */
     public static final int NEW_INSTANCE = 40;
 
-    /** <code>T: any array type; r: T; x: int :: r = new T[x]</code> */
+    /** {@code T: any array type; r: T; x: int :: r = new T[x]} */
     public static final int NEW_ARRAY = 41;
 
     /**
-     * <code>T: any array type; r: T; x: int; v0..vx: T :: r = new T[x]
-     * {v0, ..., vx}</code> 
+     * {@code T: any array type; r: T; x: int; v0..vx: T :: r = new T[x]
+     * {v0, ..., vx}}
      */
     public static final int FILLED_NEW_ARRAY = 42;
 
     /**
-     * <code>T: any object type; x: Object :: (T) x</code> (can
-     * throw <code>ClassCastException</code>
+     * {@code T: any object type; x: Object :: (T) x} (can
+     * throw {@code ClassCastException}
      */
     public static final int CHECK_CAST = 43;
 
     /**
-     * <code>T: any object type; x: Object :: x instanceof
-     * T</code> 
+     * {@code T: any object type; x: Object :: x instanceof T}
      */
     public static final int INSTANCE_OF = 44;
 
     /**
-     * <code>T: any type; r: T; x: Object; f: instance field spec of
-     * type T :: r = x.f</code> 
+     * {@code T: any type; r: T; x: Object; f: instance field spec of
+     * type T :: r = x.f}
      */
     public static final int GET_FIELD = 45;
 
     /**
-     * <code>T: any type; r: T; f: static field spec of type T :: r =
-     * f</code> 
+     * {@code T: any type; r: T; f: static field spec of type T :: r =
+     * 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</code> 
+     * {@code T: any type; x: T; y: Object; f: instance field spec of type
+     * T :: y.f = x} 
      */
     public static final int PUT_FIELD = 47;
 
     /**
-     * <code>T: any type; f: static field spec of type T; x: T :: f =
-     * x</code>
+     * {@code T: any type; f: static field spec of type T; x: T :: f = x}
      */
     public static final int PUT_STATIC = 48;
 
     /**
-     * <code>Tr, T0, T1...: any types; r: Tr; m: static method spec;
-     * y0: T0; y1: T1 ... :: r = m(y0, y1, ...)</code> (call static
+     * {@code Tr, T0, T1...: any types; r: Tr; m: static method spec;
+     * y0: T0; y1: T1 ... :: r = m(y0, y1, ...)} (call static
      * 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, ...)</code> (call normal
+     * {@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) 
      */
     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, ...)</code> (call
+     * {@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) 
      */
     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, ...)</code> (call
+     * {@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) 
      */
     public static final int INVOKE_DIRECT = 52;
 
     /**
-     * <code>Tr, T0, T1...: any types; r: Tr; x: Object; m: interface
+     * {@code Tr, T0, T1...: any types; r: Tr; x: Object; m: interface
      * (instance) method spec; y0: T0; y1: T1 ... :: r = x.m(y0, y1,
-     * ...)</code> (call interface method) 
+     * ...)} (call interface method) 
      */
     public static final int INVOKE_INTERFACE = 53;
 
     /**
-     * <code> T0: any type; </code> (mark beginning or end of local variable
-     * name
+     * {@code T0: any type; name: local variable name  :: mark(name,T0)}
+     * (mark beginning or end of local variable name)
      */
     public static final int MARK_LOCAL = 54;
 
     /**
-     * <code>T: Any type; r: T :: r = return_type</code>.
+     * {@code T: Any type; r: T :: r = return_type}.
      * <b>Note:</b> This opcode should only ever be used in the
      * first instruction of a block following an invoke-*.
      */
     public static final int MOVE_RESULT = 55;
 
     /**
-     * <code>T: Any type; r: T :: r = return_type</code>.
+     * {@code T: Any type; r: T :: r = return_type}.
      * <b>Note:</b> This opcode should only ever be used in the
      * first instruction of a block following a non-invoke throwing insn
      */
     public static final int MOVE_RESULT_PSEUDO = 56;
 
-    /** <code>T: Any primitive type; v0..vx: T :: {v0, ..., vx}</code> */
+    /** {@code T: Any primitive type; v0..vx: T :: {v0, ..., vx}} */
     public static final int FILL_ARRAY_DATA = 57;
 
     /**
@@ -310,8 +306,8 @@ public final class RegOps {
     /**
      * Gets the name of the given opcode.
      * 
-     * @param opcode &gt;= 0, &lt;= 255; the opcode
-     * @return non-null; its name
+     * @param opcode {@code >= 0, <= 255;} the opcode
+     * @return {@code non-null;} its name
      */
     public static String opName(int opcode) {
         switch (opcode) {
index 73af91f..8e819bf 100644 (file)
@@ -30,33 +30,33 @@ import java.util.HashMap;
  */
 public final class RegisterSpec
         implements TypeBearer, ToHuman, Comparable<RegisterSpec> {
-    /** non-null; string to prefix register numbers with */
+    /** {@code non-null;} string to prefix register numbers with */
     public static final String PREFIX = "v";
 
-    /** non-null; intern table for instances */
+    /** {@code non-null;} intern table for instances */
     private static final HashMap<Object, RegisterSpec> theInterns =
         new HashMap<Object, RegisterSpec>(1000);
 
-    /** non-null; common comparison instance used while interning */
+    /** {@code non-null;} common comparison instance used while interning */
     private static final ForComparison theInterningItem = new ForComparison();
 
-    /** &gt;= 0; register number */
+    /** {@code >= 0;} register number */
     private final int reg;
 
-    /** non-null; type loaded or stored */
+    /** {@code non-null;} type loaded or stored */
     private final TypeBearer type;
 
-    /** null-ok; local variable info associated with this register, if any */
+    /** {@code null-ok;} local variable info associated with this register, if any */
     private final LocalItem local;
 
     /**
      * Intern the given triple as an instance of this class.
      *
-     * @param reg &gt;= 0; the register number
-     * @param type non-null; the type (or possibly actual value) which
+     * @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
-     * @param local null-ok; the associated local variable, if any
-     * @return non-null; an appropriately-constructed instance
+     * @param local {@code null-ok;} the associated local variable, if any
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     private static RegisterSpec intern(int reg, TypeBearer type,
             LocalItem local) {
@@ -77,10 +77,10 @@ public final class RegisterSpec
      * no variable info. This method is allowed to return shared
      * instances (but doesn't necessarily do so).
      * 
-     * @param reg &gt;= 0; the register number
-     * @param type non-null; the type (or possibly actual value) which
+     * @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
-     * @return non-null; an appropriately-constructed instance
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public static RegisterSpec make(int reg, TypeBearer type) {
         return intern(reg, type, null);
@@ -91,11 +91,11 @@ public final class RegisterSpec
      * variable info. This method is allowed to return shared
      * instances (but doesn't necessarily do so).
      *
-     * @param reg &gt;= 0; the register number
-     * @param type non-null; the type (or possibly actual value) which
+     * @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
-     * @param local non-null; the associated local variable
-     * @return non-null; an appropriately-constructed instance
+     * @param local {@code non-null;} the associated local variable
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public static RegisterSpec make(int reg, TypeBearer type,
             LocalItem local) {
@@ -111,12 +111,12 @@ public final class RegisterSpec
      * variable info. This method is allowed to return shared
      * instances (but doesn't necessarily do so).
      *
-     * @param reg &gt;= 0; the register number
-     * @param type non-null; the type (or possibly actual value) which
+     * @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
-     * @param local null-ok; the associated variable info or null for
+     * @param local {@code null-ok;} the associated variable info or null for
      * none
-     * @return non-null; an appropriately-constructed instance
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public static RegisterSpec makeLocalOptional(
             int reg, TypeBearer type, LocalItem local) {
@@ -127,8 +127,8 @@ public final class RegisterSpec
     /**
      * Gets the string form for the given register number.
      * 
-     * @param reg &gt= 0; the register number
-     * @return non-null; the string form
+     * @param reg {@code >= 0;} the register number
+     * @return {@code non-null;} the string form
      */
     public static String regString(int reg) {
         return PREFIX + reg;
@@ -138,10 +138,10 @@ public final class RegisterSpec
      * Constructs an instance. This constructor is private. Use
      * {@link #make}.
      * 
-     * @param reg &gt;= 0; the register number
-     * @param type non-null; the type (or possibly actual value) which
+     * @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
-     * @param local null-ok; the associated local variable, if any
+     * @param local {@code null-ok;} the associated local variable, if any
      */
     private RegisterSpec(int reg, TypeBearer type, LocalItem local) {
         if (reg < 0) {
@@ -178,7 +178,7 @@ public final class RegisterSpec
      * to ignore whatever arbitrary extra stuff might be carried around
      * by an outer {@link TypeBearer}.
      * 
-     * @param other null-ok; spec to compare to
+     * @param other {@code null-ok;} spec to compare to
      * @return {@code true} iff {@code this} and {@code other} are equal
      * in the stated way
      */
@@ -195,7 +195,7 @@ public final class RegisterSpec
      * This is useful to determine if two instances refer to the "same"
      * local variable.
      * 
-     * @param other null-ok; spec to compare to
+     * @param other {@code null-ok;} spec to compare to
      * @return {@code true} iff {@code this} and {@code other} are equal
      * in the stated way
      */
@@ -230,8 +230,8 @@ 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 non-null; spec to compare to
-     * @return {@code -1..1}; standard result of comparison
+     * @param other {@code non-null;} spec to compare to
+     * @return {@code -1..1;} standard result of comparison
      */
     public int compareTo(RegisterSpec other) {
         if (this.reg < other.reg) {
@@ -316,7 +316,7 @@ public final class RegisterSpec
     /**
      * Gets the register number.
      * 
-     * @return &gt;= 0; the register number
+     * @return {@code >= 0;} the register number
      */
     public int getReg() {
         return reg;
@@ -326,7 +326,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 non-null; the type
+     * @return {@code non-null;} the type
      */
     public TypeBearer getTypeBearer() {
         return type;
@@ -335,7 +335,7 @@ public final class RegisterSpec
     /**
      * Gets the variable info associated with this instance, if any.
      *
-     * @return null-ok; the variable info, or <code>null</code> if this
+     * @return {@code null-ok;} the variable info, or {@code null} if this
      * instance has none
      */
     public LocalItem getLocalItem() {
@@ -349,7 +349,7 @@ public final class RegisterSpec
      * be used to determine the minimum required register count
      * implied by this instance.
      * 
-     * @return &gt;= 0; the required registers size
+     * @return {@code >= 0;} the required registers size
      */
     public int getNextReg() {
         return reg + getCategory();
@@ -357,11 +357,11 @@ public final class RegisterSpec
 
     /**
      * Gets the category of this instance's type. This is just a convenient
-     * shorthand for <code>getType().getCategory()</code>.
+     * shorthand for {@code getType().getCategory()}.
      * 
      * @see #isCategory1
      * @see #isCategory2
-     * @return 1..2; the category of this instance's type
+     * @return {@code 1..2;} the category of this instance's type
      */
     public int getCategory() {
         return type.getType().getCategory();
@@ -369,7 +369,7 @@ public final class RegisterSpec
 
     /**
      * Gets whether this instance's type is category 1. This is just a
-     * convenient shorthand for <code>getType().isCategory1()</code>.
+     * convenient shorthand for {@code getType().isCategory1()}.
      * 
      * @see #getCategory
      * @see #isCategory2
@@ -381,7 +381,7 @@ public final class RegisterSpec
 
     /**
      * Gets whether this instance's type is category 2. This is just a
-     * convenient shorthand for <code>getType().isCategory2()</code>.
+     * convenient shorthand for {@code getType().isCategory2()}.
      * 
      * @see #getCategory
      * @see #isCategory1
@@ -394,7 +394,7 @@ public final class RegisterSpec
     /**
      * Gets the string form for just the register number of this instance.
      * 
-     * @return non-null; the register string form
+     * @return {@code non-null;} the register string form
      */
     public String regString() {
         return regString(reg);
@@ -405,28 +405,28 @@ public final class RegisterSpec
      * and the given one, if any. The intersection is defined as follows:
      * 
      * <ul>
-     *   <li>If <code>other</code> is <code>null</code>, then the result
-     *     is <code>null</code>.
+     *   <li>If {@code other} is {@code null}, then the result
+     *     is {@code null}.
      *   <li>If the register numbers don't match, then the intersection
-     *     is <code>null</code>. Otherwise, the register number of the
+     *     is {@code null}. Otherwise, the register number of the
      *     intersection is the same as the one in the two instances.</li>
-     *   <li>If the types returned by <code>getType()</code> are not
-     *     <code>equals()</code>, then the intersection is null.</li>
-     *   <li>If the type bearers returned by <code>getTypeBearer()</code>
-     *     are <code>equals()</code>, then the intersection's type bearer
+     *   <li>If the types returned by {@code getType()} are not
+     *     {@code equals()}, then the intersection is null.</li>
+     *   <li>If the type bearers returned by {@code getTypeBearer()}
+     *     are {@code equals()}, then the intersection's type bearer
      *     is the one from this instance. Otherwise, the intersection's
-     *     type bearer is the <code>getType()</code> of this instance.</li>
-     *   <li>If the locals are <code>equals()</code>, then the local info
+     *     type bearer is the {@code getType()} of this instance.</li>
+     *   <li>If the locals are {@code equals()}, then the local info
      *     of the intersection is the local info of this instance. Otherwise,
-     *     the local info of the intersection is <code>null</code>.</li>
+     *     the local info of the intersection is {@code null}.</li>
      * </ul>
      * 
-     * @param other null-ok; instance to intersect with (or <code>null</code>)
+     * @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</code>, then the only non-null
+     * intersection; if {@code true}, then the only non-null
      * results occur when registers being intersected have equal local
-     * infos (or both have <code>null</code> local infos)
-     * @return null-ok; the intersection
+     * infos (or both have {@code null} local infos)
+     * @return {@code null-ok;} the intersection
      */
     public RegisterSpec intersect(RegisterSpec other, boolean localPrimary) {
         if (this == other) {
@@ -471,8 +471,8 @@ 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 &gt;= 0; the new register number
-     * @return non-null; an appropriately-constructed instance
+     * @param newReg {@code >= 0;} the new register number
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public RegisterSpec withReg(int newReg) {
         if (reg == newReg) {
@@ -486,8 +486,8 @@ public final class RegisterSpec
      * Returns an instance that is identical to this one, except that
      * the type is replaced by the given one.
      *
-     * @param newType non-null; the new type
-     * @return non-null; an appropriately-constructed instance
+     * @param newType {@code non-null;} the new type
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public RegisterSpec withType(TypeBearer newType) {
         return makeLocalOptional(reg, newType, local);
@@ -498,7 +498,7 @@ public final class RegisterSpec
      * register number is offset by the given amount.
      * 
      * @param delta the amount to offset the register number by
-     * @return non-null; an appropriately-constructed instance
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public RegisterSpec withOffset(int delta) {
         if (delta == 0) {
@@ -514,7 +514,7 @@ public final class RegisterSpec
      * (thereby stripping off non-type information) with any
      * initialization information stripped away as well.
      * 
-     * @return non-null; an appropriately-constructed instance
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public RegisterSpec withSimpleType() {
         TypeBearer orig = type;
@@ -541,7 +541,7 @@ public final class RegisterSpec
      * Returns an instance that is identical to this one except that the
      * local variable is as specified in the parameter.
      *
-     * @param local null-ok; the local item or null for none
+     * @param local {@code null-ok;} the local item or null for none
      * @return an appropriate instance
      */
     public RegisterSpec withLocalItem(LocalItem local) {
@@ -559,7 +559,7 @@ public final class RegisterSpec
      * Helper for {@link #toString} and {@link #toHuman}.
      * 
      * @param human whether to be human-oriented
-     * @return non-null; the string form
+     * @return {@code non-null;} the string form
      */
     private String toString0(boolean human) {
         StringBuffer sb = new StringBuffer(40);
@@ -588,27 +588,27 @@ public final class RegisterSpec
 
     /**
      * Holder of register spec data for the purposes of comparison (so that
-     * <code>RegisterSpec</code> itself can still keep <code>final</code>
+     * {@code RegisterSpec} itself can still keep {@code final}
      * instance variables.
      */
     private static class ForComparison {
-        /** &gt;= 0; register number */
+        /** {@code >= 0;} register number */
         private int reg;
         
-        /** non-null; type loaded or stored */
+        /** {@code non-null;} type loaded or stored */
         private TypeBearer type;
 
-        /** null-ok; local variable associated with this register, if any */
+        /** {@code null-ok;} local variable associated with this register, if any */
         private LocalItem local;
 
         /**
          * Set all the instance variables.
          * 
-         * @param reg &gt;= 0; the register number
-         * @param type non-null; the type (or possibly actual value) which
+         * @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
-         * @param local null-ok; the associated local variable, if any
-         * @return non-null; an appropriately-constructed instance
+         * @param local {@code null-ok;} the associated local variable, if any
+         * @return {@code non-null;} an appropriately-constructed instance
          */
         public void set(int reg, TypeBearer type, LocalItem local) {
             this.reg = reg;
@@ -617,10 +617,10 @@ public final class RegisterSpec
         }
 
         /**
-         * Construct a <code>RegisterSpec</code> of this instance's
+         * Construct a {@code RegisterSpec} of this instance's
          * contents.
          * 
-         * @return non-null; an appropriately-constructed instance
+         * @return {@code non-null;} an appropriately-constructed instance
          */
         public RegisterSpec toRegisterSpec() {
             return new RegisterSpec(reg, type, local);
index 28657a1..5a02a8d 100644 (file)
@@ -25,14 +25,14 @@ import com.android.dx.util.FixedSizeList;
  */
 public final class RegisterSpecList
         extends FixedSizeList implements TypeList {
-    /** non-null; no-element instance */
+    /** {@code non-null;} no-element instance */
     public static final RegisterSpecList EMPTY = new RegisterSpecList(0);
 
     /**
      * Makes a single-element instance.
      * 
-     * @param spec non-null; the element
-     * @return non-null; an appropriately-constructed instance
+     * @param spec {@code non-null;} the element
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public static RegisterSpecList make(RegisterSpec spec) {
         RegisterSpecList result = new RegisterSpecList(1);
@@ -43,9 +43,9 @@ public final class RegisterSpecList
     /**
      * Makes a two-element instance.
      * 
-     * @param spec0 non-null; the first element
-     * @param spec1 non-null; the second element
-     * @return non-null; an appropriately-constructed 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
      */
     public static RegisterSpecList make(RegisterSpec spec0,
                                         RegisterSpec spec1) {
@@ -58,10 +58,10 @@ public final class RegisterSpecList
     /**
      * Makes a three-element instance.
      * 
-     * @param spec0 non-null; the first element
-     * @param spec1 non-null; the second element
-     * @param spec2 non-null; the third element
-     * @return non-null; an appropriately-constructed 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
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public static RegisterSpecList make(RegisterSpec spec0, RegisterSpec spec1,
                                         RegisterSpec spec2) {
@@ -75,11 +75,11 @@ public final class RegisterSpecList
     /**
      * Makes a four-element instance.
      * 
-     * @param spec0 non-null; the first element
-     * @param spec1 non-null; the second element
-     * @param spec2 non-null; the third element
-     * @param spec3 non-null; the fourth element
-     * @return non-null; an appropriately-constructed 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
+     * @param spec3 {@code non-null;} the fourth element
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public static RegisterSpecList make(RegisterSpec spec0, RegisterSpec spec1,
                                         RegisterSpec spec2,
@@ -93,7 +93,7 @@ public final class RegisterSpecList
     }
 
     /**
-     * Constructs an instance. All indices initially contain <code>null</code>.
+     * Constructs an instance. All indices initially contain {@code null}.
      * 
      * @param size the size of the list
      */
@@ -126,10 +126,10 @@ public final class RegisterSpecList
     /**
      * 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</code>.
+     * will throw {@code NullPointerException}.
      * 
-     * @param n &gt;= 0, &lt; size(); which element
-     * @return non-null; the indicated element
+     * @param n {@code >= 0, < size();} which element
+     * @return {@code non-null;} the indicated element
      */
     public RegisterSpec get(int n) {
         return (RegisterSpec) get0(n);
@@ -180,8 +180,8 @@ public final class RegisterSpecList
     /**
      * Sets the element at the given index.
      * 
-     * @param n &gt;= 0, &lt; size(); which element
-     * @param spec non-null; the value to store
+     * @param n {@code >= 0, < size();} which element
+     * @param spec {@code non-null;} the value to store
      */
     public void set(int n, RegisterSpec spec) {
         set0(n, spec);
@@ -193,7 +193,7 @@ public final class RegisterSpecList
      * to plus the widest width (largest category) of the type used in
      * that register.
      * 
-     * @return &gt;= 0; the required registers size
+     * @return {@code >= 0;} the required registers size
      */
     public int getRegistersSize() {
         int sz = size();
@@ -217,8 +217,8 @@ public final class RegisterSpecList
      * except that it has an additional element prepended to the original.
      * Mutability of the result is inherited from the original.
      * 
-     * @param spec non-null; the new first spec (to prepend)
-     * @return non-null; an appropriately-constructed instance
+     * @param spec {@code non-null;} the new first spec (to prepend)
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public RegisterSpecList withFirst(RegisterSpec spec) {
         int sz = size();
@@ -241,7 +241,7 @@ public final class RegisterSpecList
      * except that its first element is removed. Mutability of the
      * result is inherited from the original.
      * 
-     * @return non-null; an appropriately-constructed instance
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public RegisterSpecList withoutFirst() {
         int newSize = size() - 1;
@@ -268,7 +268,7 @@ public final class RegisterSpecList
      * except that its last element is removed. Mutability of the
      * result is inherited from the original.
      * 
-     * @return non-null; an appropriately-constructed instance
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public RegisterSpecList withoutLast() {
         int newSize = size() - 1;
@@ -296,7 +296,7 @@ public final class RegisterSpecList
      * of the result is inherited from the original.
      * 
      * @param delta the amount to offset the register numbers by
-     * @return non-null; an appropriately-constructed instance
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public RegisterSpecList withOffset(int delta) {
         int sz = size();
@@ -329,7 +329,7 @@ public final class RegisterSpecList
      * 
      * @param base the base register number
      * @param duplicateFirst whether to duplicate the first number
-     * @return non-null; an appropriately-constructed instance
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public RegisterSpecList withSequentialRegisters(int base,
                                                     boolean duplicateFirst) {
index adc77c3..68009d9 100644 (file)
@@ -25,23 +25,23 @@ import com.android.dx.rop.cst.CstUtf8;
  */
 public final class RegisterSpecSet
         extends MutabilityControl {
-    /** non-null; no-element instance */
+    /** {@code non-null;} no-element instance */
     public static final RegisterSpecSet EMPTY = new RegisterSpecSet(0);
 
     /**
-     * non-null; array of register specs, where each element is
-     * <code>null</code> or is an instance whose <code>reg</code>
+     * {@code non-null;} array of register specs, where each element is
+     * {@code null} or is an instance whose {@code reg}
      * matches the array index 
      */
     private final RegisterSpec[] specs;
 
-    /** &gt;= -1; size of the set or <code>-1</code> if not yet calculated */
+    /** {@code >= -1;} size of the set or {@code -1} if not yet calculated */
     private int size;
 
     /**
      * Constructs an instance. The instance is initially empty.
      * 
-     * @param maxSize &gt;= 0; the maximum register number (exclusive) that
+     * @param maxSize {@code >= 0;} the maximum register number (exclusive) that
      * may be represented in this instance
      */
     public RegisterSpecSet(int maxSize) {
@@ -127,7 +127,7 @@ public final class RegisterSpecSet
      * is also the maximum-plus-one of register numbers that may be
      * represented.
      * 
-     * @return &gt;= 0; the maximum size
+     * @return {@code >= 0;} the maximum size
      */
     public int getMaxSize() {
         return specs.length;
@@ -136,7 +136,7 @@ public final class RegisterSpecSet
     /**
      * Gets the current size of this instance.
      * 
-     * @return &gt;= 0; the size
+     * @return {@code >= 0;} the size
      */
     public int size() {
         int result = size;
@@ -160,9 +160,9 @@ public final class RegisterSpecSet
     /**
      * Gets the element with the given register number, if any.
      * 
-     * @param reg &gt;= 0; the desired register number
-     * @return null-ok; the element with the given register number or
-     * <code>null</code> if there is none
+     * @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
      */
     public RegisterSpec get(int reg) {
         try {
@@ -176,11 +176,11 @@ 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())</code>.
+     * {@code get(spec.getReg())}.
      * 
-     * @param spec non-null; spec with the desired register number
-     * @return null-ok; the element with the matching register number or
-     * <code>null</code> if there is none
+     * @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
      */
     public RegisterSpec get(RegisterSpec spec) {
         return get(spec.getReg());
@@ -192,8 +192,8 @@ public final class RegisterSpecSet
      * none. This ignores the register number of the given spec but
      * matches on everything else.
      * 
-     * @param spec non-null; local to look for
-     * @return null-ok; first register found that matches, if any
+     * @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;
@@ -217,8 +217,8 @@ public final class RegisterSpecSet
      * Returns the spec in this set that's currently associated with a given
      * local (name and signature), or {@code null} if there is none.
      *
-     * @param local non-null; local item to search for
-     * @return null-ok; first register found with matching name and signature
+     * @param local {@code non-null;} local item to search for
+     * @return {@code null-ok;} first register found with matching name and signature
      */
     public RegisterSpec localItemToSpec(LocalItem local) {
         int length = specs.length;
@@ -238,7 +238,7 @@ public final class RegisterSpecSet
      * Removes a spec from the set. Only the register number
      * of the parameter is significant.
      *
-     * @param toRemove non-null; register to remove.
+     * @param toRemove {@code non-null;} register to remove.
      */
     public void remove(RegisterSpec toRemove) {
         try {
@@ -258,7 +258,7 @@ public final class RegisterSpecSet
      * a category-2 register, then the immediately subsequent element
      * is nullified.
      * 
-     * @param spec non-null; the register spec to put in the instance
+     * @param spec {@code non-null;} the register spec to put in the instance
      */
     public void put(RegisterSpec spec) {
         throwIfImmutable();
@@ -293,7 +293,7 @@ public final class RegisterSpecSet
     /**
      * Put the entire contents of the given set into this one.
      * 
-     * @param set non-null; the set to put into this instance
+     * @param set {@code non-null;} the set to put into this instance
      */
     public void putAll(RegisterSpecSet set) {
         int max = set.getMaxSize();
@@ -312,11 +312,11 @@ public final class RegisterSpecSet
      * {@link RegisterSpec#intersect} of corresponding elements from
      * this instance and the given one where both are non-null.
      * 
-     * @param other non-null; set to intersect with
+     * @param other {@code non-null;} set to intersect with
      * @param localPrimary whether local variables are primary to
-     * the intersection; if <code>true</code>, then the only non-null
+     * the intersection; if {@code true}, then the only non-null
      * result elements occur when registers being intersected have
-     * equal names (or both have <code>null</code> names)
+     * equal names (or both have {@code null} names)
      */
     public void intersect(RegisterSpecSet other, boolean localPrimary) {
         throwIfImmutable();
@@ -352,7 +352,7 @@ public final class RegisterSpecSet
      * of the result is inherited from the original.
      * 
      * @param delta the amount to offset the register numbers by
-     * @return non-null; an appropriately-constructed instance
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public RegisterSpecSet withOffset(int delta) {
         int len = specs.length;
@@ -377,7 +377,7 @@ public final class RegisterSpecSet
     /**
      * Makes and return a mutable copy of this instance.
      * 
-     * @return non-null; the mutable copy
+     * @return {@code non-null;} the mutable copy
      */
     public RegisterSpecSet mutableCopy() {
         int len = specs.length;
index f918e12..fbd9a16 100644 (file)
@@ -25,7 +25,7 @@ import com.android.dx.util.Hex;
  * Class that describes all the immutable parts of register-based operations.
  */
 public final class Rop {
-    /** minimum <code>BRANCH_*</code> value */
+    /** minimum {@code BRANCH_*} value */
     public static final int BRANCH_MIN = 1;
 
     /** indicates a non-branching op */
@@ -46,26 +46,26 @@ public final class Rop {
     /** indicates a throw-style branch (both always-throws and may-throw) */
     public static final int BRANCH_THROW = 6;
 
-    /** maximum <code>BRANCH_*</code> value */
+    /** maximum {@code BRANCH_*} value */
     public static final int BRANCH_MAX = 6;
 
     /** the opcode; one of the constants in {@link RegOps} */
     private final int opcode;
 
     /**
-     * non-null; result type of this operation; {@link Type#VOID} for
+     * {@code non-null;} result type of this operation; {@link Type#VOID} for
      * no-result operations 
      */
     private final Type result;
 
-    /** non-null; types of all the sources of this operation */
+    /** {@code non-null;} types of all the sources of this operation */
     private final TypeList sources;
 
-    /** non-null; list of possible types thrown by this operation */
+    /** {@code non-null;} list of possible types thrown by this operation */
     private final TypeList exceptions;
 
     /**
-     * the branchingness of this op; one of the <code>BRANCH_*</code>
+     * the branchingness of this op; one of the {@code BRANCH_*}
      * constants in this class 
      */
     private final int branchingness;
@@ -73,7 +73,7 @@ public final class Rop {
     /** whether this is a function/method call op or similar */
     private final boolean isCallLike;
 
-    /** null-ok; nickname, if specified (used for debugging) */
+    /** {@code null-ok;} nickname, if specified (used for debugging) */
     private final String nickname;
 
     /**
@@ -81,15 +81,15 @@ public final class Rop {
      * public constructors.
      * 
      * @param opcode the opcode; one of the constants in {@link RegOps}
-     * @param result non-null; result type of this operation; {@link
+     * @param result {@code non-null;} result type of this operation; {@link
      * Type#VOID} for no-result operations
-     * @param sources non-null; types of all the sources of this operation
-     * @param exceptions non-null; list of possible types thrown by this
+     * @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
      * operation
      * @param branchingness the branchingness of this op; one of the
-     * <code>BRANCH_*</code> constants
+     * {@code BRANCH_*} constants
      * @param isCallLike whether the op is a function/method call or similar
-     * @param nickname null-ok; optional nickname (used for debugging)
+     * @param nickname {@code null-ok;} optional nickname (used for debugging)
      */
     public Rop(int opcode, Type result, TypeList sources,
                TypeList exceptions, int branchingness, boolean isCallLike,
@@ -129,14 +129,14 @@ public final class Rop {
      * call-like op (see {@link #isCallLike}).
      * 
      * @param opcode the opcode; one of the constants in {@link RegOps}
-     * @param result non-null; result type of this operation; {@link
+     * @param result {@code non-null;} result type of this operation; {@link
      * Type#VOID} for no-result operations
-     * @param sources non-null; types of all the sources of this operation
-     * @param exceptions non-null; list of possible types thrown by this
+     * @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
      * operation
      * @param branchingness the branchingness of this op; one of the
-     * <code>BRANCH_*</code> constants
-     * @param nickname null-ok; optional nickname (used for debugging)
+     * {@code BRANCH_*} constants
+     * @param nickname {@code null-ok;} optional nickname (used for debugging)
      */
     public Rop(int opcode, Type result, TypeList sources,
                TypeList exceptions, int branchingness, String nickname) {
@@ -149,12 +149,12 @@ public final class Rop {
      * call-like op (see {@link #isCallLike}).
      * 
      * @param opcode the opcode; one of the constants in {@link RegOps}
-     * @param result non-null; result type of this operation; {@link
+     * @param result {@code non-null;} result type of this operation; {@link
      * Type#VOID} for no-result operations
-     * @param sources non-null; types of all the sources of this operation
+     * @param sources {@code non-null;} types of all the sources of this operation
      * @param branchingness the branchingness of this op; one of the
-     * <code>BRANCH_*</code> constants
-     * @param nickname null-ok; optional nickname (used for debugging)
+     * {@code BRANCH_*} constants
+     * @param nickname {@code null-ok;} optional nickname (used for debugging)
      */
     public Rop(int opcode, Type result, TypeList sources, int branchingness,
                String nickname) {
@@ -164,14 +164,14 @@ public final class Rop {
 
     /**
      * Constructs a non-branching no-exception instance. The
-     * <code>branchingness</code> is always <code>BRANCH_NONE</code>,
+     * {@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 non-null; result type of this operation; {@link
+     * @param result {@code non-null;} result type of this operation; {@link
      * Type#VOID} for no-result operations
-     * @param sources non-null; types of all the sources of this operation
-     * @param nickname null-ok; optional nickname (used for debugging)
+     * @param sources {@code non-null;} types of all the sources of this operation
+     * @param nickname {@code null-ok;} optional nickname (used for debugging)
      */
     public Rop(int opcode, Type result, TypeList sources, String nickname) {
         this(opcode, result, sources, StdTypeList.EMPTY, Rop.BRANCH_NONE,
@@ -180,16 +180,16 @@ public final class Rop {
 
     /**
      * Constructs a non-empty exceptions instance. Its
-     * <code>branchingness</code> is always <code>BRANCH_THROW</code>,
+     * {@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 non-null; result type of this operation; {@link
+     * @param result {@code non-null;} result type of this operation; {@link
      * Type#VOID} for no-result operations
-     * @param sources non-null; types of all the sources of this operation
-     * @param exceptions non-null; list of possible types thrown by this
+     * @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
      * operation
-     * @param nickname null-ok; optional nickname (used for debugging)
+     * @param nickname {@code null-ok;} optional nickname (used for debugging)
      */
     public Rop(int opcode, Type result, TypeList sources, TypeList exceptions,
                String nickname) {
@@ -200,11 +200,11 @@ 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</code> is always <code>BRANCH_THROW</code>.
+     * {@code branchingness} is always {@code BRANCH_THROW}.
      * 
      * @param opcode the opcode; one of the constants in {@link RegOps}
-     * @param sources non-null; types of all the sources of this operation
-     * @param exceptions non-null; list of possible types thrown by this
+     * @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
      * operation
      */
     public Rop(int opcode, TypeList sources, TypeList exceptions) {
@@ -317,7 +317,7 @@ public final class Rop {
      * Gets the result type. A return value of {@link Type#VOID}
      * means this operation returns nothing.
      * 
-     * @return null-ok; the result spec
+     * @return {@code null-ok;} the result spec
      */
     public Type getResult() {
         return result;
@@ -326,7 +326,7 @@ public final class Rop {
     /**
      * Gets the source types.
      * 
-     * @return non-null; the source types
+     * @return {@code non-null;} the source types
      */
     public TypeList getSources() {
         return sources;
@@ -335,7 +335,7 @@ public final class Rop {
     /**
      * Gets the list of exception types that might be thrown.
      * 
-     * @return non-null; the list of exception types
+     * @return {@code non-null;} the list of exception types
      */
     public TypeList getExceptions() {
         return exceptions;
@@ -353,7 +353,7 @@ public final class Rop {
     /**
      * Gets whether this opcode is a function/method call or similar.
      * 
-     * @return <code>true</code> iff this opcode is call-like
+     * @return {@code true} iff this opcode is call-like
      */
     public boolean isCallLike() {
         return isCallLike;
@@ -384,7 +384,7 @@ public final class Rop {
      * Gets the nickname. If this instance has no nickname, this returns
      * the result of calling {@link #toString}.
      * 
-     * @return non-null; the nickname
+     * @return {@code non-null;} the nickname
      */
     public String getNickname() {
         if (nickname != null) {
@@ -397,9 +397,9 @@ public final class Rop {
     /**
      * Gets whether this operation can possibly throw an exception. This
      * is just a convenient wrapper for
-     * <code>getExceptions().size() != 0</code>.
+     * {@code getExceptions().size() != 0}.
      * 
-     * @return <code>true</code> iff this operation can possibly throw
+     * @return {@code true} iff this operation can possibly throw
      */
     public final boolean canThrow() {
         return (exceptions.size() != 0);
index 0c0d8f1..3957532 100644 (file)
@@ -24,20 +24,20 @@ import com.android.dx.util.IntList;
  * All of the parts that make up a method at the rop layer.
  */
 public final class RopMethod {
-    /** non-null; basic block list of the method */
+    /** {@code non-null;} basic block list of the method */
     private final BasicBlockList blocks;
 
-    /** &gt;= 0; label for the block which starts the method */
+    /** {@code >= 0;} label for the block which starts the method */
     private final int firstLabel;
 
     /**
-     * null-ok; array of predecessors for each block, indexed by block
+     * {@code null-ok;} array of predecessors for each block, indexed by block
      * label 
      */
     private IntList[] predecessors;
 
     /**
-     * null-ok; the predecessors for the implicit "exit" block, that is
+     * {@code null-ok;} the predecessors for the implicit "exit" block, that is
      * the labels for the blocks that return, if calculated 
      */
     private IntList exitPredecessors;
@@ -45,8 +45,8 @@ public final class RopMethod {
     /**
      * Constructs an instance.
      * 
-     * @param blocks non-null; basic block list of the method
-     * @param firstLabel &gt;= 0; the label of the first block to execute
+     * @param blocks {@code non-null;} basic block list of the method
+     * @param firstLabel {@code >= 0;} the label of the first block to execute
      */
     public RopMethod(BasicBlockList blocks, int firstLabel) {
         if (blocks == null) {
@@ -67,7 +67,7 @@ public final class RopMethod {
     /**
      * Gets the basic block list for this method.
      * 
-     * @return non-null; the list
+     * @return {@code non-null;} the list
      */
     public BasicBlockList getBlocks() {
         return blocks;
@@ -77,7 +77,7 @@ public final class RopMethod {
      * Gets the label for the first block in the method that this list
      * represents.
      * 
-     * @return &gt;= 0; the first-block label
+     * @return {@code >= 0;} the first-block label
      */
     public int getFirstLabel() {
         return firstLabel;
@@ -87,8 +87,8 @@ 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 &gt;= 0; the label of the block in question
-     * @return non-null; the predecessors of that block
+     * @param label {@code >= 0;} the label of the block in question
+     * @return {@code non-null;} the predecessors of that block
      */
     public IntList labelToPredecessors(int label) {
         if (exitPredecessors == null) {
@@ -107,7 +107,7 @@ public final class RopMethod {
     /**
      * Gets the exit predecessors for this instance.
      * 
-     * @return non-null; the exit predecessors
+     * @return {@code non-null;} the exit predecessors
      */
     public IntList getExitPredecessors() {
         if (exitPredecessors == null) {
@@ -124,7 +124,7 @@ public final class RopMethod {
      * amount.
      * 
      * @param delta the amount to offset register numbers by
-     * @return non-null; an appropriately-constructed instance
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public RopMethod withRegisterOffset(int delta) {
         RopMethod result = new RopMethod(blocks.withRegisterOffset(delta),
index b662656..472212a 100644 (file)
@@ -30,32 +30,32 @@ import com.android.dx.rop.type.TypeList;
  * Standard instances of {@link Rop}.
  */
 public final class Rops {
-    /** <code>nop()</code> */
+    /** {@code nop()} */
     public static final Rop NOP =
         new Rop(RegOps.NOP, Type.VOID, StdTypeList.EMPTY, "nop");
 
-    /** <code>r,x: int :: r = x;</code> */
+    /** {@code r,x: int :: r = x;} */
     public static final Rop MOVE_INT =
         new Rop(RegOps.MOVE, Type.INT, StdTypeList.INT, "move-int");
 
-    /** <code>r,x: long :: r = x;</code> */
+    /** {@code r,x: long :: r = x;} */
     public static final Rop MOVE_LONG =
         new Rop(RegOps.MOVE, Type.LONG, StdTypeList.LONG, "move-long");
 
-    /** <code>r,x: float :: r = x;</code> */
+    /** {@code r,x: float :: r = x;} */
     public static final Rop MOVE_FLOAT =
         new Rop(RegOps.MOVE, Type.FLOAT, StdTypeList.FLOAT, "move-float");
 
-    /** <code>r,x: double :: r = x;</code> */
+    /** {@code r,x: double :: r = x;} */
     public static final Rop MOVE_DOUBLE =
         new Rop(RegOps.MOVE, Type.DOUBLE, StdTypeList.DOUBLE, "move-double");
 
-    /** <code>r,x: Object :: r = x;</code> */
+    /** {@code r,x: Object :: r = x;} */
     public static final Rop MOVE_OBJECT =
         new Rop(RegOps.MOVE, Type.OBJECT, StdTypeList.OBJECT, "move-object");
 
     /**
-     * <code>r,x: ReturnAddress :: r = x;</code>
+     * {@code r,x: ReturnAddress :: r = x;}
      *
      * Note that this rop-form instruction has no dex-form equivilent and
      * must be removed before the dex conversion.
@@ -64,756 +64,756 @@ public final class Rops {
         new Rop(RegOps.MOVE, Type.RETURN_ADDRESS,
                 StdTypeList.RETURN_ADDRESS, "move-return-address");
 
-    /** <code>r,param(x): int :: r = param(x);</code> */
+    /** {@code r,param(x): int :: r = param(x);} */
     public static final Rop MOVE_PARAM_INT =
         new Rop(RegOps.MOVE_PARAM, Type.INT, StdTypeList.EMPTY,
                 "move-param-int");
 
-    /** <code>r,param(x): long :: r = param(x);</code> */
+    /** {@code r,param(x): long :: r = param(x);} */
     public static final Rop MOVE_PARAM_LONG =
         new Rop(RegOps.MOVE_PARAM, Type.LONG, StdTypeList.EMPTY,
                 "move-param-long");
 
-    /** <code>r,param(x): float :: r = param(x);</code> */
+    /** {@code r,param(x): float :: r = param(x);} */
     public static final Rop MOVE_PARAM_FLOAT =
         new Rop(RegOps.MOVE_PARAM, Type.FLOAT, StdTypeList.EMPTY,
                 "move-param-float");
 
-    /** <code>r,param(x): double :: r = param(x);</code> */
+    /** {@code r,param(x): double :: r = param(x);} */
     public static final Rop MOVE_PARAM_DOUBLE =
         new Rop(RegOps.MOVE_PARAM, Type.DOUBLE, StdTypeList.EMPTY,
                 "move-param-double");
 
-    /** <code>r,param(x): Object :: r = param(x);</code> */
+    /** {@code r,param(x): Object :: r = param(x);} */
     public static final Rop MOVE_PARAM_OBJECT =
         new Rop(RegOps.MOVE_PARAM, Type.OBJECT, StdTypeList.EMPTY,
                 "move-param-object");
 
-    /** <code>r, literal: int :: r = literal;</code> */
+    /** {@code r, literal: int :: r = literal;} */
     public static final Rop CONST_INT =
         new Rop(RegOps.CONST, Type.INT, StdTypeList.EMPTY, "const-int");
 
-    /** <code>r, literal: long :: r = literal;</code> */
+    /** {@code r, literal: long :: r = literal;} */
     public static final Rop CONST_LONG =
         new Rop(RegOps.CONST, Type.LONG, StdTypeList.EMPTY, "const-long");
 
-    /** <code>r, literal: float :: r = literal;</code> */
+    /** {@code r, literal: float :: r = literal;} */
     public static final Rop CONST_FLOAT =
         new Rop(RegOps.CONST, Type.FLOAT, StdTypeList.EMPTY, "const-float");
 
-    /** <code>r, literal: double :: r = literal;</code> */
+    /** {@code r, literal: double :: r = literal;} */
     public static final Rop CONST_DOUBLE =
         new Rop(RegOps.CONST, Type.DOUBLE, StdTypeList.EMPTY, "const-double");
 
-    /** <code>r, literal: Object :: r = literal;</code> */
+    /** {@code r, literal: Object :: r = literal;} */
     public static final Rop CONST_OBJECT =
         new Rop(RegOps.CONST, Type.OBJECT, StdTypeList.EMPTY,
                 Exceptions.LIST_Error, "const-object");
 
-    /** <code>r, literal: Object :: r = literal;</code> */
+    /** {@code r, literal: Object :: r = literal;} */
     public static final Rop CONST_OBJECT_NOTHROW =
         new Rop(RegOps.CONST, Type.OBJECT, StdTypeList.EMPTY,
                 "const-object-nothrow");
 
-    /** <code>goto <i>label</i></code> */
+    /** {@code goto label} */
     public static final Rop GOTO =
         new Rop(RegOps.GOTO, Type.VOID, StdTypeList.EMPTY, Rop.BRANCH_GOTO,
                 "goto");
 
-    /** <code>x: int :: if (x == 0) goto <i>label</i></code> */
+    /** {@code x: int :: if (x == 0) goto label} */
     public static final Rop IF_EQZ_INT =
         new Rop(RegOps.IF_EQ, Type.VOID, StdTypeList.INT, Rop.BRANCH_IF,
                 "if-eqz-int");
 
-    /** <code>x: int :: if (x != 0) goto <i>label</i></code> */
+    /** {@code x: int :: if (x != 0) goto label} */
     public static final Rop IF_NEZ_INT =
         new Rop(RegOps.IF_NE, Type.VOID, StdTypeList.INT, Rop.BRANCH_IF,
                 "if-nez-int");
 
-    /** <code>x: int :: if (x &lt; 0) goto <i>label</i></code> */
+    /** {@code x: int :: if (x < 0) goto label} */
     public static final Rop IF_LTZ_INT =
         new Rop(RegOps.IF_LT, Type.VOID, StdTypeList.INT, Rop.BRANCH_IF,
                 "if-ltz-int");
 
-    /** <code>x: int :: if (x &gt;= 0) goto <i>label</i></code> */
+    /** {@code x: int :: if (x >= 0) goto label} */
     public static final Rop IF_GEZ_INT =
         new Rop(RegOps.IF_GE, Type.VOID, StdTypeList.INT, Rop.BRANCH_IF,
                 "if-gez-int");
 
-    /** <code>x: int :: if (x &lt;= 0) goto <i>label</i></code> */
+    /** {@code x: int :: if (x <= 0) goto label} */
     public static final Rop IF_LEZ_INT =
         new Rop(RegOps.IF_LE, Type.VOID, StdTypeList.INT, Rop.BRANCH_IF,
                 "if-lez-int");
 
-    /** <code>x: int :: if (x &gt; 0) goto <i>label</i></code> */
+    /** {@code x: int :: if (x > 0) goto label} */
     public static final Rop IF_GTZ_INT =
         new Rop(RegOps.IF_GT, Type.VOID, StdTypeList.INT, Rop.BRANCH_IF,
                 "if-gtz-int");
 
-    /** <code>x: Object :: if (x == null) goto <i>label</i></code> */
+    /** {@code x: Object :: if (x == null) goto label} */
     public static final Rop IF_EQZ_OBJECT =
         new Rop(RegOps.IF_EQ, Type.VOID, StdTypeList.OBJECT, Rop.BRANCH_IF,
                 "if-eqz-object");
 
-    /** <code>x: Object :: if (x != null) goto <i>label</i></code> */
+    /** {@code x: Object :: if (x != null) goto label} */
     public static final Rop IF_NEZ_OBJECT =
         new Rop(RegOps.IF_NE, Type.VOID, StdTypeList.OBJECT, Rop.BRANCH_IF,
                 "if-nez-object");
 
-    /** <code>x,y: int :: if (x == y) goto <i>label</i></code> */
+    /** {@code x,y: int :: if (x == y) goto label} */
     public static final Rop IF_EQ_INT =
         new Rop(RegOps.IF_EQ, Type.VOID, StdTypeList.INT_INT, Rop.BRANCH_IF,
                 "if-eq-int");
 
-    /** <code>x,y: int :: if (x != y) goto <i>label</i></code> */
+    /** {@code x,y: int :: if (x != y) goto label} */
     public static final Rop IF_NE_INT =
         new Rop(RegOps.IF_NE, Type.VOID, StdTypeList.INT_INT, Rop.BRANCH_IF,
                 "if-ne-int");
 
-    /** <code>x,y: int :: if (x &lt; y) goto <i>label</i></code> */
+    /** {@code x,y: int :: if (x < y) goto label} */
     public static final Rop IF_LT_INT =
         new Rop(RegOps.IF_LT, Type.VOID, StdTypeList.INT_INT, Rop.BRANCH_IF,
                 "if-lt-int");
 
-    /** <code>x,y: int :: if (x &gt;= y) goto <i>label</i></code> */
+    /** {@code x,y: int :: if (x >= y) goto label} */
     public static final Rop IF_GE_INT =
         new Rop(RegOps.IF_GE, Type.VOID, StdTypeList.INT_INT, Rop.BRANCH_IF,
                 "if-ge-int");
 
-    /** <code>x,y: int :: if (x &lt;= y) goto <i>label</i></code> */
+    /** {@code x,y: int :: if (x <= y) goto label} */
     public static final Rop IF_LE_INT =
         new Rop(RegOps.IF_LE, Type.VOID, StdTypeList.INT_INT, Rop.BRANCH_IF,
                 "if-le-int");
 
-    /** <code>x,y: int :: if (x &gt; y) goto <i>label</i></code> */
+    /** {@code x,y: int :: if (x > y) goto label} */
     public static final Rop IF_GT_INT =
         new Rop(RegOps.IF_GT, Type.VOID, StdTypeList.INT_INT, Rop.BRANCH_IF,
                 "if-gt-int");
 
-    /** <code>x,y: Object :: if (x == y) goto <i>label</i></code> */
+    /** {@code x,y: Object :: if (x == y) goto label} */
     public static final Rop IF_EQ_OBJECT =
         new Rop(RegOps.IF_EQ, Type.VOID, StdTypeList.OBJECT_OBJECT,
                 Rop.BRANCH_IF, "if-eq-object");
 
-    /** <code>x,y: Object :: if (x != y) goto <i>label</i></code> */
+    /** {@code x,y: Object :: if (x != y) goto label} */
     public static final Rop IF_NE_OBJECT =
         new Rop(RegOps.IF_NE, Type.VOID, StdTypeList.OBJECT_OBJECT,
                 Rop.BRANCH_IF, "if-ne-object");
 
-    /** <code>x: int :: goto switchtable[x]</code> */
+    /** {@code x: int :: goto switchtable[x]} */
     public static final Rop SWITCH = 
         new Rop(RegOps.SWITCH, Type.VOID, StdTypeList.INT, Rop.BRANCH_SWITCH,
                 "switch");
 
-    /** <code>r,x,y: int :: r = x + y;</code> */
+    /** {@code r,x,y: int :: r = x + y;} */
     public static final Rop ADD_INT =
         new Rop(RegOps.ADD, Type.INT, StdTypeList.INT_INT, "add-int");
 
-    /** <code>r,x,y: long :: r = x + y;</code> */
+    /** {@code r,x,y: long :: r = x + y;} */
     public static final Rop ADD_LONG =
         new Rop(RegOps.ADD, Type.LONG, StdTypeList.LONG_LONG, "add-long");
 
-    /** <code>r,x,y: float :: r = x + y;</code> */
+    /** {@code r,x,y: float :: r = x + y;} */
     public static final Rop ADD_FLOAT =
         new Rop(RegOps.ADD, Type.FLOAT, StdTypeList.FLOAT_FLOAT, "add-float");
 
-    /** <code>r,x,y: double :: r = x + y;</code> */
+    /** {@code r,x,y: double :: r = x + y;} */
     public static final Rop ADD_DOUBLE =
         new Rop(RegOps.ADD, Type.DOUBLE, StdTypeList.DOUBLE_DOUBLE,
                 Rop.BRANCH_NONE, "add-double");
 
-    /** <code>r,x,y: int :: r = x - y;</code> */
+    /** {@code r,x,y: int :: r = x - y;} */
     public static final Rop SUB_INT =
         new Rop(RegOps.SUB, Type.INT, StdTypeList.INT_INT, "sub-int");
 
-    /** <code>r,x,y: long :: r = x - y;</code> */
+    /** {@code r,x,y: long :: r = x - y;} */
     public static final Rop SUB_LONG =
         new Rop(RegOps.SUB, Type.LONG, StdTypeList.LONG_LONG, "sub-long");
 
-    /** <code>r,x,y: float :: r = x - y;</code> */
+    /** {@code r,x,y: float :: r = x - y;} */
     public static final Rop SUB_FLOAT =
         new Rop(RegOps.SUB, Type.FLOAT, StdTypeList.FLOAT_FLOAT, "sub-float");
 
-    /** <code>r,x,y: double :: r = x - y;</code> */
+    /** {@code r,x,y: double :: r = x - y;} */
     public static final Rop SUB_DOUBLE =
         new Rop(RegOps.SUB, Type.DOUBLE, StdTypeList.DOUBLE_DOUBLE,
                 Rop.BRANCH_NONE, "sub-double");
 
-    /** <code>r,x,y: int :: r = x * y;</code> */
+    /** {@code r,x,y: int :: r = x * y;} */
     public static final Rop MUL_INT =
         new Rop(RegOps.MUL, Type.INT, StdTypeList.INT_INT, "mul-int");
 
-    /** <code>r,x,y: long :: r = x * y;</code> */
+    /** {@code r,x,y: long :: r = x * y;} */
     public static final Rop MUL_LONG =
         new Rop(RegOps.MUL, Type.LONG, StdTypeList.LONG_LONG, "mul-long");
 
-    /** <code>r,x,y: float :: r = x * y;</code> */
+    /** {@code r,x,y: float :: r = x * y;} */
     public static final Rop MUL_FLOAT =
         new Rop(RegOps.MUL, Type.FLOAT, StdTypeList.FLOAT_FLOAT, "mul-float");
 
-    /** <code>r,x,y: double :: r = x * y;</code> */
+    /** {@code r,x,y: double :: r = x * y;} */
     public static final Rop MUL_DOUBLE =
         new Rop(RegOps.MUL, Type.DOUBLE, StdTypeList.DOUBLE_DOUBLE,
                 Rop.BRANCH_NONE, "mul-double");
 
-    /** <code>r,x,y: int :: r = x / y;</code> */
+    /** {@code r,x,y: int :: r = x / y;} */
     public static final Rop DIV_INT =
         new Rop(RegOps.DIV, Type.INT, StdTypeList.INT_INT,
                 Exceptions.LIST_Error_ArithmeticException, "div-int");
 
-    /** <code>r,x,y: long :: r = x / y;</code> */
+    /** {@code r,x,y: long :: r = x / y;} */
     public static final Rop DIV_LONG =
         new Rop(RegOps.DIV, Type.LONG, StdTypeList.LONG_LONG,
                 Exceptions.LIST_Error_ArithmeticException, "div-long");
 
-    /** <code>r,x,y: float :: r = x / y;</code> */
+    /** {@code r,x,y: float :: r = x / y;} */
     public static final Rop DIV_FLOAT =
         new Rop(RegOps.DIV, Type.FLOAT, StdTypeList.FLOAT_FLOAT, "div-float");
 
-    /** <code>r,x,y: double :: r = x / y;</code> */
+    /** {@code r,x,y: double :: r = x / y;} */
     public static final Rop DIV_DOUBLE =
         new Rop(RegOps.DIV, Type.DOUBLE, StdTypeList.DOUBLE_DOUBLE,
                 "div-double");
 
-    /** <code>r,x,y: int :: r = x % y;</code> */
+    /** {@code r,x,y: int :: r = x % y;} */
     public static final Rop REM_INT =
         new Rop(RegOps.REM, Type.INT, StdTypeList.INT_INT,
                 Exceptions.LIST_Error_ArithmeticException, "rem-int");
 
-    /** <code>r,x,y: long :: r = x % y;</code> */
+    /** {@code r,x,y: long :: r = x % y;} */
     public static final Rop REM_LONG =
         new Rop(RegOps.REM, Type.LONG, StdTypeList.LONG_LONG,
                 Exceptions.LIST_Error_ArithmeticException, "rem-long");
 
-    /** <code>r,x,y: float :: r = x % y;</code> */
+    /** {@code r,x,y: float :: r = x % y;} */
     public static final Rop REM_FLOAT =
         new Rop(RegOps.REM, Type.FLOAT, StdTypeList.FLOAT_FLOAT, "rem-float");
 
-    /** <code>r,x,y: double :: r = x % y;</code> */
+    /** {@code r,x,y: double :: r = x % y;} */
     public static final Rop REM_DOUBLE =
         new Rop(RegOps.REM, Type.DOUBLE, StdTypeList.DOUBLE_DOUBLE,
                 "rem-double");
 
-    /** <code>r,x: int :: r = -x;</code> */
+    /** {@code r,x: int :: r = -x;} */
     public static final Rop NEG_INT =
         new Rop(RegOps.NEG, Type.INT, StdTypeList.INT, "neg-int");
 
-    /** <code>r,x: long :: r = -x;</code> */
+    /** {@code r,x: long :: r = -x;} */
     public static final Rop NEG_LONG =
         new Rop(RegOps.NEG, Type.LONG, StdTypeList.LONG, "neg-long");
 
-    /** <code>r,x: float :: r = -x;</code> */
+    /** {@code r,x: float :: r = -x;} */
     public static final Rop NEG_FLOAT =
         new Rop(RegOps.NEG, Type.FLOAT, StdTypeList.FLOAT, "neg-float");
 
-    /** <code>r,x: double :: r = -x;</code> */
+    /** {@code r,x: double :: r = -x;} */
     public static final Rop NEG_DOUBLE =
         new Rop(RegOps.NEG, Type.DOUBLE, StdTypeList.DOUBLE, "neg-double");
 
-    /** <code>r,x,y: int :: r = x &amp; y;</code> */
+    /** {@code r,x,y: int :: r = x & y;} */
     public static final Rop AND_INT =
         new Rop(RegOps.AND, Type.INT, StdTypeList.INT_INT, "and-int");
 
-    /** <code>r,x,y: long :: r = x &amp; y;</code> */
+    /** {@code r,x,y: long :: r = x & y;} */
     public static final Rop AND_LONG =
         new Rop(RegOps.AND, Type.LONG, StdTypeList.LONG_LONG, "and-long");
 
-    /** <code>r,x,y: int :: r = x | y;</code> */
+    /** {@code r,x,y: int :: r = x | y;} */
     public static final Rop OR_INT =
         new Rop(RegOps.OR, Type.INT, StdTypeList.INT_INT, "or-int");
 
-    /** <code>r,x,y: long :: r = x | y;</code> */
+    /** {@code r,x,y: long :: r = x | y;} */
     public static final Rop OR_LONG =
         new Rop(RegOps.OR, Type.LONG, StdTypeList.LONG_LONG, "or-long");
 
-    /** <code>r,x,y: int :: r = x ^ y;</code> */
+    /** {@code r,x,y: int :: r = x ^ y;} */
     public static final Rop XOR_INT =
         new Rop(RegOps.XOR, Type.INT, StdTypeList.INT_INT, "xor-int");
 
-    /** <code>r,x,y: long :: r = x ^ y;</code> */
+    /** {@code r,x,y: long :: r = x ^ y;} */
     public static final Rop XOR_LONG =
         new Rop(RegOps.XOR, Type.LONG, StdTypeList.LONG_LONG, "xor-long");
 
-    /** <code>r,x,y: int :: r = x &lt;&lt; y;</code> */
+    /** {@code r,x,y: int :: r = x << y;} */
     public static final Rop SHL_INT =
         new Rop(RegOps.SHL, Type.INT, StdTypeList.INT_INT, "shl-int");
 
-    /** <code>r,x: long; y: int :: r = x &lt;&lt; y;</code> */
+    /** {@code r,x: long; y: int :: r = x << y;} */
     public static final Rop SHL_LONG =
         new Rop(RegOps.SHL, Type.LONG, StdTypeList.LONG_INT, "shl-long");
 
-    /** <code>r,x,y: int :: r = x &gt;&gt; y;</code> */
+    /** {@code r,x,y: int :: r = x >> y;} */
     public static final Rop SHR_INT =
         new Rop(RegOps.SHR, Type.INT, StdTypeList.INT_INT, "shr-int");
 
-    /** <code>r,x: long; y: int :: r = x &gt;&gt; y;</code> */
+    /** {@code r,x: long; y: int :: r = x >> y;} */
     public static final Rop SHR_LONG =
         new Rop(RegOps.SHR, Type.LONG, StdTypeList.LONG_INT, "shr-long");
 
-    /** <code>r,x,y: int :: r = x &gt;&gt;&gt; y;</code> */
+    /** {@code r,x,y: int :: r = x >>> y;} */
     public static final Rop USHR_INT =
         new Rop(RegOps.USHR, Type.INT, StdTypeList.INT_INT, "ushr-int");
 
-    /** <code>r,x: long; y: int :: r = x &gt;&gt;&gt; y;</code> */
+    /** {@code r,x: long; y: int :: r = x >>> y;} */
     public static final Rop USHR_LONG =
         new Rop(RegOps.USHR, Type.LONG, StdTypeList.LONG_INT, "ushr-long");
 
-    /** <code>r,x: int :: r = ~x;</code> */
+    /** {@code r,x: int :: r = ~x;} */
     public static final Rop NOT_INT =
         new Rop(RegOps.NOT, Type.INT, StdTypeList.INT, "not-int");
 
-    /** <code>r,x: long :: r = ~x;</code> */
+    /** {@code r,x: long :: r = ~x;} */
     public static final Rop NOT_LONG =
         new Rop(RegOps.NOT, Type.LONG, StdTypeList.LONG, "not-long");
 
-    /** <code>r,x,c: int :: r = x + c;</code> */
+    /** {@code r,x,c: int :: r = x + c;} */
     public static final Rop ADD_CONST_INT =
         new Rop(RegOps.ADD, Type.INT, StdTypeList.INT, "add-const-int");
 
-    /** <code>r,x,c: long :: r = x + c;</code> */
+    /** {@code r,x,c: long :: r = x + c;} */
     public static final Rop ADD_CONST_LONG =
         new Rop(RegOps.ADD, Type.LONG, StdTypeList.LONG, "add-const-long");
 
-    /** <code>r,x,c: float :: r = x + c;</code> */
+    /** {@code r,x,c: float :: r = x + c;} */
     public static final Rop ADD_CONST_FLOAT =
         new Rop(RegOps.ADD, Type.FLOAT, StdTypeList.FLOAT, "add-const-float");
 
-    /** <code>r,x,c: double :: r = x + c;</code> */
+    /** {@code r,x,c: double :: r = x + c;} */
     public static final Rop ADD_CONST_DOUBLE =
         new Rop(RegOps.ADD, Type.DOUBLE, StdTypeList.DOUBLE,
                 "add-const-double");
 
-    /** <code>r,x,c: int :: r = x - c;</code> */
+    /** {@code r,x,c: int :: r = x - c;} */
     public static final Rop SUB_CONST_INT =
         new Rop(RegOps.SUB, Type.INT, StdTypeList.INT, "sub-const-int");
 
-    /** <code>r,x,c: long :: r = x - c;</code> */
+    /** {@code r,x,c: long :: r = x - c;} */
     public static final Rop SUB_CONST_LONG =
         new Rop(RegOps.SUB, Type.LONG, StdTypeList.LONG, "sub-const-long");
 
-    /** <code>r,x,c: float :: r = x - c;</code> */
+    /** {@code r,x,c: float :: r = x - c;} */
     public static final Rop SUB_CONST_FLOAT =
         new Rop(RegOps.SUB, Type.FLOAT, StdTypeList.FLOAT, "sub-const-float");
 
-    /** <code>r,x,c: double :: r = x - c;</code> */
+    /** {@code r,x,c: double :: r = x - c;} */
     public static final Rop SUB_CONST_DOUBLE =
         new Rop(RegOps.SUB, Type.DOUBLE, StdTypeList.DOUBLE,
                 "sub-const-double");
 
-    /** <code>r,x,c: int :: r = x * c;</code> */
+    /** {@code r,x,c: int :: r = x * c;} */
     public static final Rop MUL_CONST_INT =
         new Rop(RegOps.MUL, Type.INT, StdTypeList.INT, "mul-const-int");
 
-    /** <code>r,x,c: long :: r = x * c;</code> */
+    /** {@code r,x,c: long :: r = x * c;} */
     public static final Rop MUL_CONST_LONG =
         new Rop(RegOps.MUL, Type.LONG, StdTypeList.LONG, "mul-const-long");
 
-    /** <code>r,x,c: float :: r = x * c;</code> */
+    /** {@code r,x,c: float :: r = x * c;} */
     public static final Rop MUL_CONST_FLOAT =
         new Rop(RegOps.MUL, Type.FLOAT, StdTypeList.FLOAT, "mul-const-float");
 
-    /** <code>r,x,c: double :: r = x * c;</code> */
+    /** {@code r,x,c: double :: r = x * c;} */
     public static final Rop MUL_CONST_DOUBLE =
         new Rop(RegOps.MUL, Type.DOUBLE, StdTypeList.DOUBLE,
                 "mul-const-double");
 
-    /** <code>r,x,c: int :: r = x / c;</code> */
+    /** {@code r,x,c: int :: r = x / c;} */
     public static final Rop DIV_CONST_INT =
         new Rop(RegOps.DIV, Type.INT, StdTypeList.INT,
                 Exceptions.LIST_Error_ArithmeticException, "div-const-int");
 
-    /** <code>r,x,c: long :: r = x / c;</code> */
+    /** {@code r,x,c: long :: r = x / c;} */
     public static final Rop DIV_CONST_LONG =
         new Rop(RegOps.DIV, Type.LONG, StdTypeList.LONG,
                 Exceptions.LIST_Error_ArithmeticException, "div-const-long");
 
-    /** <code>r,x,c: float :: r = x / c;</code> */
+    /** {@code r,x,c: float :: r = x / c;} */
     public static final Rop DIV_CONST_FLOAT =
         new Rop(RegOps.DIV, Type.FLOAT, StdTypeList.FLOAT, "div-const-float");
 
-    /** <code>r,x,c: double :: r = x / c;</code> */
+    /** {@code r,x,c: double :: r = x / c;} */
     public static final Rop DIV_CONST_DOUBLE =
         new Rop(RegOps.DIV, Type.DOUBLE, StdTypeList.DOUBLE,
                 "div-const-double");
 
-    /** <code>r,x,c: int :: r = x % c;</code> */
+    /** {@code r,x,c: int :: r = x % c;} */
     public static final Rop REM_CONST_INT =
         new Rop(RegOps.REM, Type.INT, StdTypeList.INT,
                 Exceptions.LIST_Error_ArithmeticException, "rem-const-int");
 
-    /** <code>r,x,c: long :: r = x % c;</code> */
+    /** {@code r,x,c: long :: r = x % c;} */
     public static final Rop REM_CONST_LONG =
         new Rop(RegOps.REM, Type.LONG, StdTypeList.LONG,
                 Exceptions.LIST_Error_ArithmeticException, "rem-const-long");
 
-    /** <code>r,x,c: float :: r = x % c;</code> */
+    /** {@code r,x,c: float :: r = x % c;} */
     public static final Rop REM_CONST_FLOAT =
         new Rop(RegOps.REM, Type.FLOAT, StdTypeList.FLOAT, "rem-const-float");
 
-    /** <code>r,x,c: double :: r = x % c;</code> */
+    /** {@code r,x,c: double :: r = x % c;} */
     public static final Rop REM_CONST_DOUBLE =
         new Rop(RegOps.REM, Type.DOUBLE, StdTypeList.DOUBLE,
                 "rem-const-double");
 
-    /** <code>r,x,c: int :: r = x &amp; c;</code> */
+    /** {@code r,x,c: int :: r = x & c;} */
     public static final Rop AND_CONST_INT =
         new Rop(RegOps.AND, Type.INT, StdTypeList.INT, "and-const-int");
 
-    /** <code>r,x,c: long :: r = x &amp; c;</code> */
+    /** {@code r,x,c: long :: r = x & c;} */
     public static final Rop AND_CONST_LONG =
         new Rop(RegOps.AND, Type.LONG, StdTypeList.LONG, "and-const-long");
 
-    /** <code>r,x,c: int :: r = x | c;</code> */
+    /** {@code r,x,c: int :: r = x | c;} */
     public static final Rop OR_CONST_INT =
         new Rop(RegOps.OR, Type.INT, StdTypeList.INT, "or-const-int");
 
-    /** <code>r,x,c: long :: r = x | c;</code> */
+    /** {@code r,x,c: long :: r = x | c;} */
     public static final Rop OR_CONST_LONG =
         new Rop(RegOps.OR, Type.LONG, StdTypeList.LONG, "or-const-long");
 
-    /** <code>r,x,c: int :: r = x ^ c;</code> */
+    /** {@code r,x,c: int :: r = x ^ c;} */
     public static final Rop XOR_CONST_INT =
         new Rop(RegOps.XOR, Type.INT, StdTypeList.INT, "xor-const-int");
 
-    /** <code>r,x,c: long :: r = x ^ c;</code> */
+    /** {@code r,x,c: long :: r = x ^ c;} */
     public static final Rop XOR_CONST_LONG =
         new Rop(RegOps.XOR, Type.LONG, StdTypeList.LONG, "xor-const-long");
 
-    /** <code>r,x,c: int :: r = x &lt;&lt; c;</code> */
+    /** {@code r,x,c: int :: r = x << c;} */
     public static final Rop SHL_CONST_INT =
         new Rop(RegOps.SHL, Type.INT, StdTypeList.INT, "shl-const-int");
 
-    /** <code>r,x: long; c: int :: r = x &lt;&lt; c;</code> */
+    /** {@code r,x: long; c: int :: r = x << c;} */
     public static final Rop SHL_CONST_LONG =
         new Rop(RegOps.SHL, Type.LONG, StdTypeList.INT, "shl-const-long");
 
-    /** <code>r,x,c: int :: r = x &gt;&gt; c;</code> */
+    /** {@code r,x,c: int :: r = x >> c;} */
     public static final Rop SHR_CONST_INT =
         new Rop(RegOps.SHR, Type.INT, StdTypeList.INT, "shr-const-int");
 
-    /** <code>r,x: long; c: int :: r = x &gt;&gt; c;</code> */
+    /** {@code r,x: long; c: int :: r = x >> c;} */
     public static final Rop SHR_CONST_LONG =
         new Rop(RegOps.SHR, Type.LONG, StdTypeList.INT, "shr-const-long");
 
-    /** <code>r,x,c: int :: r = x &gt;&gt;&gt; c;</code> */
+    /** {@code r,x,c: int :: r = x >>> c;} */
     public static final Rop USHR_CONST_INT =
         new Rop(RegOps.USHR, Type.INT, StdTypeList.INT, "ushr-const-int");
 
-    /** <code>r,x: long; c: int :: r = x &gt;&gt;&gt; c;</code> */
+    /** {@code r,x: long; c: int :: r = x >>> c;} */
     public static final Rop USHR_CONST_LONG =
         new Rop(RegOps.USHR, Type.LONG, StdTypeList.INT, "ushr-const-long");
 
-    /** <code>r: int; x,y: long :: r = cmp(x, y);</code> */
+    /** {@code r: int; x,y: long :: r = cmp(x, y);} */
     public static final Rop CMPL_LONG =
         new Rop(RegOps.CMPL, Type.INT, StdTypeList.LONG_LONG, "cmpl-long");
 
-    /** <code>r: int; x,y: float :: r = cmpl(x, y);</code> */
+    /** {@code r: int; x,y: float :: r = cmpl(x, y);} */
     public static final Rop CMPL_FLOAT =
         new Rop(RegOps.CMPL, Type.INT, StdTypeList.FLOAT_FLOAT, "cmpl-float");
 
-    /** <code>r: int; x,y: double :: r = cmpl(x, y);</code> */
+    /** {@code r: int; x,y: double :: r = cmpl(x, y);} */
     public static final Rop CMPL_DOUBLE =
         new Rop(RegOps.CMPL, Type.INT, StdTypeList.DOUBLE_DOUBLE,
                 "cmpl-double");
 
-    /** <code>r: int; x,y: float :: r = cmpg(x, y);</code> */
+    /** {@code r: int; x,y: float :: r = cmpg(x, y);} */
     public static final Rop CMPG_FLOAT =
         new Rop(RegOps.CMPG, Type.INT, StdTypeList.FLOAT_FLOAT, "cmpg-float");
 
-    /** <code>r: int; x,y: double :: r = cmpg(x, y);</code> */
+    /** {@code r: int; x,y: double :: r = cmpg(x, y);} */
     public static final Rop CMPG_DOUBLE =
         new Rop(RegOps.CMPG, Type.INT, StdTypeList.DOUBLE_DOUBLE,
                 "cmpg-double");
 
-    /** <code>r: int; x: long :: r = (int) x</code> */
+    /** {@code r: int; x: long :: r = (int) x} */
     public static final Rop CONV_L2I =
         new Rop(RegOps.CONV, Type.INT, StdTypeList.LONG, "conv-l2i");
 
-    /** <code>r: int; x: float :: r = (int) x</code> */
+    /** {@code r: int; x: float :: r = (int) x} */
     public static final Rop CONV_F2I =
         new Rop(RegOps.CONV, Type.INT, StdTypeList.FLOAT, "conv-f2i");
 
-    /** <code>r: int; x: double :: r = (int) x</code> */
+    /** {@code r: int; x: double :: r = (int) x} */
     public static final Rop CONV_D2I =
         new Rop(RegOps.CONV, Type.INT, StdTypeList.DOUBLE, "conv-d2i");
 
-    /** <code>r: long; x: int :: r = (long) x</code> */
+    /** {@code r: long; x: int :: r = (long) x} */
     public static final Rop CONV_I2L =
         new Rop(RegOps.CONV, Type.LONG, StdTypeList.INT, "conv-i2l");
 
-    /** <code>r: long; x: float :: r = (long) x</code> */
+    /** {@code r: long; x: float :: r = (long) x} */
     public static final Rop CONV_F2L =
         new Rop(RegOps.CONV, Type.LONG, StdTypeList.FLOAT, "conv-f2l");
 
-    /** <code>r: long; x: double :: r = (long) x</code> */
+    /** {@code r: long; x: double :: r = (long) x} */
     public static final Rop CONV_D2L =
         new Rop(RegOps.CONV, Type.LONG, StdTypeList.DOUBLE, "conv-d2l");
 
-    /** <code>r: float; x: int :: r = (float) x</code> */
+    /** {@code r: float; x: int :: r = (float) x} */
     public static final Rop CONV_I2F =
         new Rop(RegOps.CONV, Type.FLOAT, StdTypeList.INT, "conv-i2f");
 
-    /** <code>r: float; x: long :: r = (float) x</code> */
+    /** {@code r: float; x: long :: r = (float) x} */
     public static final Rop CONV_L2F =
         new Rop(RegOps.CONV, Type.FLOAT, StdTypeList.LONG, "conv-l2f");
 
-    /** <code>r: float; x: double :: r = (float) x</code> */
+    /** {@code r: float; x: double :: r = (float) x} */
     public static final Rop CONV_D2F =
         new Rop(RegOps.CONV, Type.FLOAT, StdTypeList.DOUBLE, "conv-d2f");
 
-    /** <code>r: double; x: int :: r = (double) x</code> */
+    /** {@code r: double; x: int :: r = (double) x} */
     public static final Rop CONV_I2D =
         new Rop(RegOps.CONV, Type.DOUBLE, StdTypeList.INT, "conv-i2d");
 
-    /** <code>r: double; x: long :: r = (double) x</code> */
+    /** {@code r: double; x: long :: r = (double) x} */
     public static final Rop CONV_L2D =
         new Rop(RegOps.CONV, Type.DOUBLE, StdTypeList.LONG, "conv-l2d");
 
-    /** <code>r: double; x: float :: r = (double) x</code> */
+    /** {@code r: double; x: float :: r = (double) x} */
     public static final Rop CONV_F2D =
         new Rop(RegOps.CONV, Type.DOUBLE, StdTypeList.FLOAT, "conv-f2d");
 
     /**
-     * <code>r,x: int :: r = (x &lt;&lt; 24) &gt;&gt; 24</code> (Java-style
+     * {@code r,x: int :: r = (x << 24) >> 24} (Java-style
      * convert int 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 &amp; 0xffff</code> (Java-style
+     * {@code r,x: int :: r = x & 0xffff} (Java-style
      * 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 &lt;&lt; 16) &gt;&gt; 16</code> (Java-style
+     * {@code r,x: int :: r = (x << 16) >> 16} (Java-style
      * convert int to short) 
      */
     public static final Rop TO_SHORT =
         new Rop(RegOps.TO_SHORT, Type.INT, StdTypeList.INT, "to-short");
 
-    /** <code>return void</code> */
+    /** {@code return void} */
     public static final Rop RETURN_VOID =
         new Rop(RegOps.RETURN, Type.VOID, StdTypeList.EMPTY, Rop.BRANCH_RETURN,
                 "return-void");
 
-    /** <code>x: int; return x</code> */
+    /** {@code x: int; return x} */
     public static final Rop RETURN_INT =
         new Rop(RegOps.RETURN, Type.VOID, StdTypeList.INT, Rop.BRANCH_RETURN,
                 "return-int");
 
-    /** <code>x: long; return x</code> */
+    /** {@code x: long; return x} */
     public static final Rop RETURN_LONG =
         new Rop(RegOps.RETURN, Type.VOID, StdTypeList.LONG, Rop.BRANCH_RETURN,
                 "return-long");
 
-    /** <code>x: float; return x</code> */
+    /** {@code x: float; return x} */
     public static final Rop RETURN_FLOAT =
         new Rop(RegOps.RETURN, Type.VOID, StdTypeList.FLOAT, Rop.BRANCH_RETURN,
                 "return-float");
 
-    /** <code>x: double; return x</code> */
+    /** {@code x: double; return x} */
     public static final Rop RETURN_DOUBLE =
         new Rop(RegOps.RETURN, Type.VOID, StdTypeList.DOUBLE,
                 Rop.BRANCH_RETURN, "return-double");
 
-    /** <code>x: Object; return x</code> */
+    /** {@code x: Object; return x} */
     public static final Rop RETURN_OBJECT =
         new Rop(RegOps.RETURN, Type.VOID, StdTypeList.OBJECT,
                 Rop.BRANCH_RETURN, "return-object");
 
-    /** <code>T: any type; r: int; x: T[]; :: r = x.length</code> */
+    /** {@code T: any type; r: int; x: T[]; :: r = x.length} */
     public static final Rop ARRAY_LENGTH =
         new Rop(RegOps.ARRAY_LENGTH, Type.INT, StdTypeList.OBJECT,
                 Exceptions.LIST_Error_NullPointerException, "array-length");
 
-    /** <code>x: Throwable :: throw(x)</code> */
+    /** {@code x: Throwable :: throw(x)} */
     public static final Rop THROW =
         new Rop(RegOps.THROW, Type.VOID, StdTypeList.THROWABLE,
                 StdTypeList.THROWABLE, "throw");
 
-    /** <code>x: Object :: monitorenter(x)</code> */
+    /** {@code x: Object :: monitorenter(x)} */
     public static final Rop MONITOR_ENTER =
         new Rop(RegOps.MONITOR_ENTER, Type.VOID, StdTypeList.OBJECT,
                 Exceptions.LIST_Error_NullPointerException, "monitor-enter");
 
-    /** <code>x: Object :: monitorexit(x)</code> */
+    /** {@code x: Object :: monitorexit(x)} */
     public static final Rop MONITOR_EXIT =
         new Rop(RegOps.MONITOR_EXIT, Type.VOID, StdTypeList.OBJECT,
                 Exceptions.LIST_Error_Null_IllegalMonitorStateException,
                 "monitor-exit");
 
-    /** <code>r,y: int; x: int[] :: r = x[y]</code> */
+    /** {@code r,y: int; x: int[] :: r = x[y]} */
     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]</code> */
+    /** {@code r: long; x: long[]; y: int :: r = x[y]} */
     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]</code> */
+    /** {@code r: float; x: float[]; y: int :: r = x[y]} */
     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]</code> */
+    /** {@code r: double; x: double[]; y: int :: r = x[y]} */
     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]</code> */
+    /** {@code r: Object; x: Object[]; y: int :: r = x[y]} */
     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]</code> */
+    /** {@code r: boolean; x: boolean[]; y: int :: r = x[y]} */
     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]</code> */
+    /** {@code r: byte; x: byte[]; y: int :: r = x[y]} */
     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]</code> */
+    /** {@code r: char; x: char[]; y: int :: r = x[y]} */
     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]</code> */
+    /** {@code r: short; x: short[]; y: int :: r = x[y]} */
     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</code> */
+    /** {@code x,z: int; y: int[] :: y[z] = x} */
     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</code> */
+    /** {@code x: long; y: long[]; z: int :: y[z] = x} */
     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</code> */
+    /** {@code x: float; y: float[]; z: int :: y[z] = x} */
     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</code> */
+    /** {@code x: double; y: double[]; z: int :: y[z] = x} */
     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</code> */
+    /** {@code x: Object; y: Object[]; z: int :: y[z] = x} */
     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</code> */
+    /** {@code x: boolean; y: boolean[]; z: int :: y[z] = x} */
     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</code> */
+    /** {@code x: byte; y: byte[]; z: int :: y[z] = x} */
     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</code> */
+    /** {@code x: char; y: char[]; z: int :: y[z] = x} */
     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</code> */
+    /** {@code x: short; y: short[]; z: int :: y[z] = x} */
     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)</code> (allocate heap space for an object) 
+     * {@code T: any non-array object type :: r =
+     * alloc(T)} (allocate heap space for an object) 
      */
     public static final Rop NEW_INSTANCE =
         new Rop(RegOps.NEW_INSTANCE, Type.OBJECT, StdTypeList.EMPTY,
                 Exceptions.LIST_Error, "new-instance");
 
-    /** <code>r: int[]; x: int :: r = new int[x]</code> */
+    /** {@code r: int[]; x: int :: r = new int[x]} */
     public static final Rop NEW_ARRAY_INT =
         new Rop(RegOps.NEW_ARRAY, Type.INT_ARRAY, StdTypeList.INT,
                 Exceptions.LIST_Error_NegativeArraySizeException,
                 "new-array-int");
 
-    /** <code>r: long[]; x: int :: r = new long[x]</code> */
+    /** {@code r: long[]; x: int :: r = new long[x]} */
     public static final Rop NEW_ARRAY_LONG =
         new Rop(RegOps.NEW_ARRAY, Type.LONG_ARRAY, StdTypeList.INT,
                 Exceptions.LIST_Error_NegativeArraySizeException,
                 "new-array-long");
 
-    /** <code>r: float[]; x: int :: r = new float[x]</code> */
+    /** {@code r: float[]; x: int :: r = new float[x]} */
     public static final Rop NEW_ARRAY_FLOAT =
         new Rop(RegOps.NEW_ARRAY, Type.FLOAT_ARRAY, StdTypeList.INT,
                 Exceptions.LIST_Error_NegativeArraySizeException,
                 "new-array-float");
 
-    /** <code>r: double[]; x: int :: r = new double[x]</code> */
+    /** {@code r: double[]; x: int :: r = new double[x]} */
     public static final Rop NEW_ARRAY_DOUBLE =
         new Rop(RegOps.NEW_ARRAY, Type.DOUBLE_ARRAY, StdTypeList.INT,
                 Exceptions.LIST_Error_NegativeArraySizeException,
                 "new-array-double");
 
-    /** <code>r: boolean[]; x: int :: r = new boolean[x]</code> */
+    /** {@code r: boolean[]; x: int :: r = new boolean[x]} */
     public static final Rop NEW_ARRAY_BOOLEAN =
         new Rop(RegOps.NEW_ARRAY, Type.BOOLEAN_ARRAY, StdTypeList.INT,
                 Exceptions.LIST_Error_NegativeArraySizeException,
                 "new-array-boolean");
 
-    /** <code>r: byte[]; x: int :: r = new byte[x]</code> */
+    /** {@code r: byte[]; x: int :: r = new byte[x]} */
     public static final Rop NEW_ARRAY_BYTE =
         new Rop(RegOps.NEW_ARRAY, Type.BYTE_ARRAY, StdTypeList.INT,
                 Exceptions.LIST_Error_NegativeArraySizeException,
                 "new-array-byte");
 
-    /** <code>r: char[]; x: int :: r = new char[x]</code> */
+    /** {@code r: char[]; x: int :: r = new char[x]} */
     public static final Rop NEW_ARRAY_CHAR =
         new Rop(RegOps.NEW_ARRAY, Type.CHAR_ARRAY, StdTypeList.INT,
                 Exceptions.LIST_Error_NegativeArraySizeException,
                 "new-array-char");
 
-    /** <code>r: short[]; x: int :: r = new short[x]</code> */
+    /** {@code r: short[]; x: int :: r = new short[x]} */
     public static final Rop NEW_ARRAY_SHORT =
         new Rop(RegOps.NEW_ARRAY, Type.SHORT_ARRAY, StdTypeList.INT,
                 Exceptions.LIST_Error_NegativeArraySizeException,
                 "new-array-short");
 
     /**
-     * <code>T: any non-array object type; x: Object :: (T) x</code> (can
-     * throw <code>ClassCastException</code>
+     * {@code T: any non-array object type; x: Object :: (T) x} (can
+     * throw {@code ClassCastException}
      */
     public static final Rop CHECK_CAST = 
         new Rop(RegOps.CHECK_CAST, Type.VOID, StdTypeList.OBJECT,
                 Exceptions.LIST_Error_ClassCastException, "check-cast");
 
     /**
-     * <code>T: any non-array object type; x: Object :: x instanceof
-     * T</code>. Note: This is listed as throwing <code>Error</code>
+     * {@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. 
      */
@@ -822,24 +822,24 @@ public final class Rops {
                 Exceptions.LIST_Error, "instance-of");
 
     /**
-     * <code>r: int; x: Object; f: instance field spec of
-     * type int :: r = x.f</code> 
+     * {@code r: int; x: Object; f: instance field spec of
+     * type int :: r = x.f} 
      */
     public static final Rop GET_FIELD_INT =
         new Rop(RegOps.GET_FIELD, Type.INT, StdTypeList.OBJECT,
                 Exceptions.LIST_Error_NullPointerException, "get-field-int");
 
     /**
-     * <code>r: long; x: Object; f: instance field spec of
-     * type long :: r = x.f</code> 
+     * {@code r: long; x: Object; f: instance field spec of
+     * type long :: r = x.f} 
      */
     public static final Rop GET_FIELD_LONG =
         new Rop(RegOps.GET_FIELD, Type.LONG, StdTypeList.OBJECT,
                 Exceptions.LIST_Error_NullPointerException, "get-field-long");
 
     /**
-     * <code>r: float; x: Object; f: instance field spec of
-     * type float :: r = x.f</code> 
+     * {@code r: float; x: Object; f: instance field spec of
+     * type float :: r = x.f} 
      */
     public static final Rop GET_FIELD_FLOAT =
         new Rop(RegOps.GET_FIELD, Type.FLOAT, StdTypeList.OBJECT,
@@ -847,8 +847,8 @@ public final class Rops {
                 "get-field-float");
 
     /**
-     * <code>r: double; x: Object; f: instance field spec of
-     * type double :: r = x.f</code> 
+     * {@code r: double; x: Object; f: instance field spec of
+     * type double :: r = x.f} 
      */
     public static final Rop GET_FIELD_DOUBLE =
         new Rop(RegOps.GET_FIELD, Type.DOUBLE, StdTypeList.OBJECT,
@@ -856,8 +856,8 @@ public final class Rops {
                 "get-field-double");
 
     /**
-     * <code>r: Object; x: Object; f: instance field spec of
-     * type Object :: r = x.f</code> 
+     * {@code r: Object; x: Object; f: instance field spec of
+     * type Object :: r = x.f} 
      */
     public static final Rop GET_FIELD_OBJECT =
         new Rop(RegOps.GET_FIELD, Type.OBJECT, StdTypeList.OBJECT,
@@ -865,8 +865,8 @@ public final class Rops {
                 "get-field-object");
 
     /**
-     * <code>r: boolean; x: Object; f: instance field spec of
-     * type boolean :: r = x.f</code> 
+     * {@code r: boolean; x: Object; f: instance field spec of
+     * type boolean :: r = x.f} 
      */
     public static final Rop GET_FIELD_BOOLEAN =
         new Rop(RegOps.GET_FIELD, Type.INT, StdTypeList.OBJECT,
@@ -874,8 +874,8 @@ public final class Rops {
                 "get-field-boolean");
 
     /**
-     * <code>r: byte; x: Object; f: instance field spec of
-     * type byte :: r = x.f</code> 
+     * {@code r: byte; x: Object; f: instance field spec of
+     * type byte :: r = x.f} 
      */
     public static final Rop GET_FIELD_BYTE =
         new Rop(RegOps.GET_FIELD, Type.INT, StdTypeList.OBJECT,
@@ -883,8 +883,8 @@ public final class Rops {
                 "get-field-byte");
 
     /**
-     * <code>r: char; x: Object; f: instance field spec of
-     * type char :: r = x.f</code> 
+     * {@code r: char; x: Object; f: instance field spec of
+     * type char :: r = x.f} 
      */
     public static final Rop GET_FIELD_CHAR =
         new Rop(RegOps.GET_FIELD, Type.INT, StdTypeList.OBJECT,
@@ -892,105 +892,78 @@ public final class Rops {
                 "get-field-char");
 
     /**
-     * <code>r: short; x: Object; f: instance field spec of
-     * type short :: r = x.f</code> 
+     * {@code r: short; x: Object; f: instance field spec of
+     * type short :: r = x.f} 
      */
     public static final Rop GET_FIELD_SHORT =
         new Rop(RegOps.GET_FIELD, Type.INT, StdTypeList.OBJECT,
                 Exceptions.LIST_Error_NullPointerException,
                 "get-field-short");
 
-    /**
-     * <code>r: int; f: static field spec of type int :: r =
-     * f</code> 
-     */
+    /** {@code r: int; f: static field spec of type int :: r = f} */
     public static final Rop GET_STATIC_INT =
         new Rop(RegOps.GET_STATIC, Type.INT, StdTypeList.EMPTY,
                 Exceptions.LIST_Error, "get-static-int");
 
-    /**
-     * <code>r: long; f: static field spec of type long :: r =
-     * f</code> 
-     */
+    /** {@code r: long; f: static field spec of type long :: r = f} */
     public static final Rop GET_STATIC_LONG =
         new Rop(RegOps.GET_STATIC, Type.LONG, StdTypeList.EMPTY,
                 Exceptions.LIST_Error, "get-static-long");
 
-    /**
-     * <code>r: float; f: static field spec of type float :: r =
-     * f</code> 
-     */
+    /** {@code r: float; f: static field spec of type float :: r = f} */
     public static final Rop GET_STATIC_FLOAT =
         new Rop(RegOps.GET_STATIC, Type.FLOAT, StdTypeList.EMPTY,
                 Exceptions.LIST_Error, "get-static-float");
 
-    /**
-     * <code>r: double; f: static field spec of type double :: r =
-     * f</code> 
-     */
+    /** {@code r: double; f: static field spec of type double :: r = f} */
     public static final Rop GET_STATIC_DOUBLE =
         new Rop(RegOps.GET_STATIC, Type.DOUBLE, StdTypeList.EMPTY,
                 Exceptions.LIST_Error, "get-static-double");
 
-    /**
-     * <code>r: Object; f: static field spec of type Object :: r =
-     * f</code> 
-     */
+    /** {@code r: Object; f: static field spec of type Object :: r = f} */
     public static final Rop GET_STATIC_OBJECT =
         new Rop(RegOps.GET_STATIC, Type.OBJECT, StdTypeList.EMPTY,
                 Exceptions.LIST_Error, "get-static-object");
 
-    /**
-     * <code>r: boolean; f: static field spec of type boolean :: r =
-     * f</code> 
-     */
+    /** {@code r: boolean; f: static field spec of type boolean :: r = f} */
     public static final Rop GET_STATIC_BOOLEAN =
         new Rop(RegOps.GET_STATIC, Type.INT, StdTypeList.EMPTY,
                 Exceptions.LIST_Error, "get-field-boolean");
 
-    /**
-     * <code>r: byte; f: static field spec of type byte :: r =
-     * f</code> 
-     */
+    /** {@code r: byte; f: static field spec of type byte :: r = f} */
     public static final Rop GET_STATIC_BYTE =
         new Rop(RegOps.GET_STATIC, Type.INT, StdTypeList.EMPTY,
                 Exceptions.LIST_Error, "get-field-byte");
 
-    /**
-     * <code>r: char; f: static field spec of type char :: r =
-     * f</code> 
-     */
+    /** {@code r: char; f: static field spec of type char :: r = f} */
     public static final Rop GET_STATIC_CHAR =
         new Rop(RegOps.GET_STATIC, Type.INT, StdTypeList.EMPTY,
                 Exceptions.LIST_Error, "get-field-char");
 
-    /**
-     * <code>r: short; f: static field spec of type short :: r =
-     * f</code> 
-     */
+    /** {@code r: short; f: static field spec of type short :: r = f} */
     public static final Rop GET_STATIC_SHORT =
         new Rop(RegOps.GET_STATIC, Type.INT, StdTypeList.EMPTY,
                 Exceptions.LIST_Error, "get-field-short");
 
     /**
-     * <code>x: int; y: Object; f: instance field spec of type
-     * int :: y.f = x</code> 
+     * {@code x: int; y: Object; f: instance field spec of type
+     * int :: y.f = x} 
      */
     public static final Rop PUT_FIELD_INT =
         new Rop(RegOps.PUT_FIELD, Type.VOID, StdTypeList.INT_OBJECT,
                 Exceptions.LIST_Error_NullPointerException, "put-field-int");
 
     /**
-     * <code>x: long; y: Object; f: instance field spec of type
-     * long :: y.f = x</code> 
+     * {@code x: long; y: Object; f: instance field spec of type
+     * long :: y.f = x} 
      */
     public static final Rop PUT_FIELD_LONG =
         new Rop(RegOps.PUT_FIELD, Type.VOID, StdTypeList.LONG_OBJECT,
                 Exceptions.LIST_Error_NullPointerException, "put-field-long");
 
     /**
-     * <code>x: float; y: Object; f: instance field spec of type
-     * float :: y.f = x</code> 
+     * {@code x: float; y: Object; f: instance field spec of type
+     * float :: y.f = x} 
      */
     public static final Rop PUT_FIELD_FLOAT =
         new Rop(RegOps.PUT_FIELD, Type.VOID, StdTypeList.FLOAT_OBJECT,
@@ -998,8 +971,8 @@ public final class Rops {
                 "put-field-float");
 
     /**
-     * <code>x: double; y: Object; f: instance field spec of type
-     * double :: y.f = x</code> 
+     * {@code x: double; y: Object; f: instance field spec of type
+     * double :: y.f = x} 
      */
     public static final Rop PUT_FIELD_DOUBLE =
         new Rop(RegOps.PUT_FIELD, Type.VOID, StdTypeList.DOUBLE_OBJECT,
@@ -1007,8 +980,8 @@ public final class Rops {
                 "put-field-double");
 
     /**
-     * <code>x: Object; y: Object; f: instance field spec of type
-     * Object :: y.f = x</code> 
+     * {@code x: Object; y: Object; f: instance field spec of type
+     * Object :: y.f = x} 
      */
     public static final Rop PUT_FIELD_OBJECT =
         new Rop(RegOps.PUT_FIELD, Type.VOID, StdTypeList.OBJECT_OBJECT,
@@ -1016,8 +989,8 @@ public final class Rops {
                 "put-field-object");
 
     /**
-     * <code>x: int; y: Object; f: instance field spec of type
-     * boolean :: y.f = x</code> 
+     * {@code x: int; y: Object; f: instance field spec of type
+     * boolean :: y.f = x} 
      */
     public static final Rop PUT_FIELD_BOOLEAN =
         new Rop(RegOps.PUT_FIELD, Type.VOID, StdTypeList.INT_OBJECT,
@@ -1025,8 +998,8 @@ public final class Rops {
                 "put-field-boolean");
 
     /**
-     * <code>x: int; y: Object; f: instance field spec of type
-     * byte :: y.f = x</code> 
+     * {@code x: int; y: Object; f: instance field spec of type
+     * byte :: y.f = x} 
      */
     public static final Rop PUT_FIELD_BYTE =
         new Rop(RegOps.PUT_FIELD, Type.VOID, StdTypeList.INT_OBJECT,
@@ -1034,8 +1007,8 @@ public final class Rops {
                 "put-field-byte");
 
     /**
-     * <code>x: int; y: Object; f: instance field spec of type
-     * char :: y.f = x</code> 
+     * {@code x: int; y: Object; f: instance field spec of type
+     * char :: y.f = x} 
      */
     public static final Rop PUT_FIELD_CHAR =
         new Rop(RegOps.PUT_FIELD, Type.VOID, StdTypeList.INT_OBJECT,
@@ -1043,112 +1016,88 @@ public final class Rops {
                 "put-field-char");
 
     /**
-     * <code>x: int; y: Object; f: instance field spec of type
-     * short :: y.f = x</code> 
+     * {@code x: int; y: Object; f: instance field spec of type
+     * short :: y.f = x} 
      */
     public static final Rop PUT_FIELD_SHORT =
         new Rop(RegOps.PUT_FIELD, Type.VOID, StdTypeList.INT_OBJECT,
                 Exceptions.LIST_Error_NullPointerException,
                 "put-field-short");
 
-    /**
-     * <code>f: static field spec of type int; x: int :: f =
-     * x</code>
-     */
+    /** {@code f: static field spec of type int; x: int :: f = x} */
     public static final Rop PUT_STATIC_INT =
         new Rop(RegOps.PUT_STATIC, Type.VOID, StdTypeList.INT,
                 Exceptions.LIST_Error, "put-static-int");
 
-    /**
-     * <code>f: static field spec of type long; x: long :: f =
-     * x</code>
-     */
+    /** {@code f: static field spec of type long; x: long :: f = x} */
     public static final Rop PUT_STATIC_LONG =
         new Rop(RegOps.PUT_STATIC, Type.VOID, StdTypeList.LONG,
                 Exceptions.LIST_Error, "put-static-long");
 
-    /**
-     * <code>f: static field spec of type float; x: float :: f =
-     * x</code>
-     */
+    /** {@code f: static field spec of type float; x: float :: f = x} */
     public static final Rop PUT_STATIC_FLOAT =
         new Rop(RegOps.PUT_STATIC, Type.VOID, StdTypeList.FLOAT,
                 Exceptions.LIST_Error, "put-static-float");
 
-    /**
-     * <code>f: static field spec of type double; x: double :: f =
-     * x</code>
-     */
+    /** {@code f: static field spec of type double; x: double :: f = x} */
     public static final Rop PUT_STATIC_DOUBLE =
         new Rop(RegOps.PUT_STATIC, Type.VOID, StdTypeList.DOUBLE,
                 Exceptions.LIST_Error, "put-static-double");
 
-    /**
-     * <code>f: static field spec of type Object; x: Object :: f =
-     * x</code>
-     */
+    /** {@code f: static field spec of type Object; x: Object :: f = x} */
     public static final Rop PUT_STATIC_OBJECT =
         new Rop(RegOps.PUT_STATIC, Type.VOID, StdTypeList.OBJECT,
                 Exceptions.LIST_Error, "put-static-object");
 
     /**
-     * <code>f: static field spec of type boolean; x: boolean :: f =
-     * x</code>
+     * {@code f: static field spec of type boolean; x: boolean :: f =
+     * x}
      */
     public static final Rop PUT_STATIC_BOOLEAN =
         new Rop(RegOps.PUT_STATIC, Type.VOID, StdTypeList.INT,
                 Exceptions.LIST_Error, "put-static-boolean");
 
-    /**
-     * <code>f: static field spec of type byte; x: byte :: f =
-     * x</code>
-     */
+    /** {@code f: static field spec of type byte; x: byte :: f = x} */
     public static final Rop PUT_STATIC_BYTE =
         new Rop(RegOps.PUT_STATIC, Type.VOID, StdTypeList.INT,
                 Exceptions.LIST_Error, "put-static-byte");
 
-    /**
-     * <code>f: static field spec of type char; x: char :: f =
-     * x</code>
-     */
+    /** {@code f: static field spec of type char; x: char :: f = x} */
     public static final Rop PUT_STATIC_CHAR =
         new Rop(RegOps.PUT_STATIC, Type.VOID, StdTypeList.INT,
                 Exceptions.LIST_Error, "put-static-char");
 
-    /**
-     * <code>f: static field spec of type short; x: short :: f =
-     * x</code>
-     */
+    /** {@code f: static field spec of type short; x: short :: f = x} */
     public static final Rop PUT_STATIC_SHORT =
         new Rop(RegOps.PUT_STATIC, Type.VOID, StdTypeList.INT,
                 Exceptions.LIST_Error, "put-static-short");
 
-    /** <code>x: Int :: local variable begins in x */
+    /** {@code x: Int :: local variable begins in x} */
     public static final Rop MARK_LOCAL_INT =
             new Rop (RegOps.MARK_LOCAL, Type.VOID,
                     StdTypeList.INT, "mark-local-int");
 
-    /** <code>x: Long :: local variable begins in x */
+    /** {@code x: Long :: local variable begins in x} */
     public static final Rop MARK_LOCAL_LONG =
             new Rop (RegOps.MARK_LOCAL, Type.VOID,
                     StdTypeList.LONG, "mark-local-long");
 
-    /** <code>x: Float :: local variable begins in x */
+    /** {@code x: Float :: local variable begins in x} */
     public static final Rop MARK_LOCAL_FLOAT =
             new Rop (RegOps.MARK_LOCAL, Type.VOID,
                     StdTypeList.FLOAT, "mark-local-float");
 
-    /** <code>x: Double :: local variable begins in x */
+    /** {@code x: Double :: local variable begins in x} */
     public static final Rop MARK_LOCAL_DOUBLE =
             new Rop (RegOps.MARK_LOCAL, Type.VOID,
                     StdTypeList.DOUBLE, "mark-local-double");
 
-    /** <code>x: Object :: local variable begins in x */
+    /** {@code x: Object :: local variable begins in x} */
     public static final Rop MARK_LOCAL_OBJECT =
             new Rop (RegOps.MARK_LOCAL, Type.VOID,
                     StdTypeList.OBJECT, "mark-local-object");
 
-    /** <code>T: Any primitive type; v0..vx: T :: {v0, ..., vx}</code> */
+    /** {@code T: Any primitive type; v0..vx: T :: {v0, ..., vx}} */
     public static final Rop FILL_ARRAY_DATA =
         new Rop(RegOps.FILL_ARRAY_DATA, Type.VOID, StdTypeList.EMPTY,
                 "fill-array-data");
@@ -1164,10 +1113,10 @@ public final class Rops {
      * match what is returned. TODO: Revisit this issue.</p>
      * 
      * @param opcode the opcode
-     * @param dest non-null; destination type, or {@link Type#VOID} if none
-     * @param sources non-null; list of source types
-     * @param cst null-ok; associated constant, if any
-     * @return non-null; an appropriate instance
+     * @param dest {@code non-null;} destination type, or {@link Type#VOID} if none
+     * @param sources {@code non-null;} list of source types
+     * @param cst {@code null-ok;} associated constant, if any
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop ropFor(int opcode, TypeBearer dest, TypeList sources,
                              Constant cst) {
@@ -1275,11 +1224,11 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>move</code> rop for the given type. The
+     * Returns the appropriate {@code move} rop for the given type. The
      * result is a shared instance.
      * 
-     * @param type non-null; type of value being moved
-     * @return non-null; an appropriate instance
+     * @param type {@code non-null;} type of value being moved
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opMove(TypeBearer type) {
         switch (type.getBasicFrameType()) {
@@ -1295,11 +1244,11 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>move-param</code> rop for the
+     * Returns the appropriate {@code move-param} rop for the
      * given type. The result is a shared instance.
      * 
-     * @param type non-null; type of value being moved
-     * @return non-null; an appropriate instance
+     * @param type {@code non-null;} type of value being moved
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opMoveParam(TypeBearer type) {
         switch (type.getBasicFrameType()) {
@@ -1314,11 +1263,11 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>move-exception</code> rop for the
+     * Returns the appropriate {@code move-exception} rop for the
      * given type. The result may be a shared instance.
      * 
-     * @param type non-null; type of the exception
-     * @return non-null; an appropriate instance
+     * @param type {@code non-null;} type of the exception
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opMoveException(TypeBearer type) {
         return new Rop(RegOps.MOVE_EXCEPTION, type.getType(),
@@ -1326,11 +1275,11 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>move-result</code> rop for the
+     * Returns the appropriate {@code move-result} rop for the
      * given type. The result may be a shared instance.
      *
-     * @param type non-null; type of the parameter
-     * @return non-null; an appropriate instance
+     * @param type {@code non-null;} type of the parameter
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opMoveResult(TypeBearer type) {
         return new Rop(RegOps.MOVE_RESULT, type.getType(),
@@ -1338,11 +1287,11 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>move-result-pseudo</code> rop for the
+     * Returns the appropriate {@code move-result-pseudo} rop for the
      * given type. The result may be a shared instance.
      *
-     * @param type non-null; type of the parameter
-     * @return non-null; an appropriate instance
+     * @param type {@code non-null;} type of the parameter
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opMoveResultPseudo(TypeBearer type) {
         return new Rop(RegOps.MOVE_RESULT_PSEUDO, type.getType(),
@@ -1350,11 +1299,11 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>const</code> rop for the given
+     * Returns the appropriate {@code const} rop for the given
      * type. The result is a shared instance.
      * 
-     * @param type non-null; type of the constant
-     * @return non-null; an appropriate instance
+     * @param type {@code non-null;} type of the constant
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opConst(TypeBearer type) {
         if (type.getType() == Type.KNOWN_NULL) {
@@ -1373,11 +1322,11 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>if-eq</code> rop for the given
+     * Returns the appropriate {@code if-eq} rop for the given
      * sources. The result is a shared instance.
      * 
-     * @param types non-null; source types
-     * @return non-null; an appropriate instance
+     * @param types {@code non-null;} source types
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opIfEq(TypeList types) {
         return pickIf(types, IF_EQZ_INT, IF_EQZ_OBJECT,
@@ -1385,11 +1334,11 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>if-ne</code> rop for the given
+     * Returns the appropriate {@code if-ne} rop for the given
      * sources. The result is a shared instance.
      * 
-     * @param types non-null; source types
-     * @return non-null; an appropriate instance
+     * @param types {@code non-null;} source types
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opIfNe(TypeList types) {
         return pickIf(types, IF_NEZ_INT, IF_NEZ_OBJECT,
@@ -1397,60 +1346,60 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>if-lt</code> rop for the given
+     * Returns the appropriate {@code if-lt} rop for the given
      * sources. The result is a shared instance.
      * 
-     * @param types non-null; source types
-     * @return non-null; an appropriate instance
+     * @param types {@code non-null;} source types
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opIfLt(TypeList types) {
         return pickIf(types, IF_LTZ_INT, null, IF_LT_INT, null);
     }
 
     /**
-     * Returns the appropriate <code>if-ge</code> rop for the given
+     * Returns the appropriate {@code if-ge} rop for the given
      * sources. The result is a shared instance.
      * 
-     * @param types non-null; source types
-     * @return non-null; an appropriate instance
+     * @param types {@code non-null;} source types
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opIfGe(TypeList types) {
         return pickIf(types, IF_GEZ_INT, null, IF_GE_INT, null);
     }
 
     /**
-     * Returns the appropriate <code>if-gt</code> rop for the given
+     * Returns the appropriate {@code if-gt} rop for the given
      * sources. The result is a shared instance.
      * 
-     * @param types non-null; source types
-     * @return non-null; an appropriate instance
+     * @param types {@code non-null;} source types
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opIfGt(TypeList types) {
         return pickIf(types, IF_GTZ_INT, null, IF_GT_INT, null);
     }
 
     /**
-     * Returns the appropriate <code>if-le</code> rop for the given
+     * Returns the appropriate {@code if-le} rop for the given
      * sources. The result is a shared instance.
      * 
-     * @param types non-null; source types
-     * @return non-null; an appropriate instance
+     * @param types {@code non-null;} source types
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opIfLe(TypeList types) {
         return pickIf(types, IF_LEZ_INT, null, IF_LE_INT, null);
     }
 
     /**
-     * Helper for all the <code>if*</code>-related methods, which
+     * 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 non-null; the types
-     * @param intZ non-null; the int-to-0 comparison
-     * @param objZ null-ok; the object-to-null comparison
-     * @param intInt non-null; the int-to-int comparison
-     * @param objObj non-null; the object-to-object comparison
-     * @return non-null; the appropriate instance
+     * @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
+     * @param intInt {@code non-null;} the int-to-int comparison
+     * @param objObj {@code non-null;} the object-to-object comparison
+     * @return {@code non-null;} the appropriate instance
      */
     private static Rop pickIf(TypeList types, Rop intZ, Rop objZ, Rop intInt,
                               Rop objObj) {
@@ -1490,11 +1439,11 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>add</code> rop for the given
+     * Returns the appropriate {@code add} rop for the given
      * types. The result is a shared instance.
      * 
-     * @param types non-null; types of the sources
-     * @return non-null; an appropriate instance
+     * @param types {@code non-null;} types of the sources
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opAdd(TypeList types) {
         return pickBinaryOp(types, ADD_CONST_INT, ADD_CONST_LONG,
@@ -1503,11 +1452,11 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>sub</code> rop for the given
+     * Returns the appropriate {@code sub} rop for the given
      * types. The result is a shared instance.
      * 
-     * @param types non-null; types of the sources
-     * @return non-null; an appropriate instance
+     * @param types {@code non-null;} types of the sources
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opSub(TypeList types) {
         return pickBinaryOp(types, SUB_CONST_INT, SUB_CONST_LONG,
@@ -1516,11 +1465,11 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>mul</code> rop for the given
+     * Returns the appropriate {@code mul} rop for the given
      * types. The result is a shared instance.
      * 
-     * @param types non-null; types of the sources
-     * @return non-null; an appropriate instance
+     * @param types {@code non-null;} types of the sources
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opMul(TypeList types) {
         return pickBinaryOp(types, MUL_CONST_INT, MUL_CONST_LONG,
@@ -1529,11 +1478,11 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>div</code> rop for the given
+     * Returns the appropriate {@code div} rop for the given
      * types. The result is a shared instance.
      * 
-     * @param types non-null; types of the sources
-     * @return non-null; an appropriate instance
+     * @param types {@code non-null;} types of the sources
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opDiv(TypeList types) {
         return pickBinaryOp(types, DIV_CONST_INT, DIV_CONST_LONG,
@@ -1542,11 +1491,11 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>rem</code> rop for the given
+     * Returns the appropriate {@code rem} rop for the given
      * types. The result is a shared instance.
      * 
-     * @param types non-null; types of the sources
-     * @return non-null; an appropriate instance
+     * @param types {@code non-null;} types of the sources
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opRem(TypeList types) {
         return pickBinaryOp(types, REM_CONST_INT, REM_CONST_LONG,
@@ -1555,11 +1504,11 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>and</code> rop for the given
+     * Returns the appropriate {@code and} rop for the given
      * types. The result is a shared instance.
      * 
-     * @param types non-null; types of the sources
-     * @return non-null; an appropriate instance
+     * @param types {@code non-null;} types of the sources
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opAnd(TypeList types) {
         return pickBinaryOp(types, AND_CONST_INT, AND_CONST_LONG, null, null,
@@ -1567,11 +1516,11 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>or</code> rop for the given
+     * Returns the appropriate {@code or} rop for the given
      * types. The result is a shared instance.
      * 
-     * @param types non-null; types of the sources
-     * @return non-null; an appropriate instance
+     * @param types {@code non-null;} types of the sources
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opOr(TypeList types) {
         return pickBinaryOp(types, OR_CONST_INT, OR_CONST_LONG, null, null,
@@ -1579,11 +1528,11 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>xor</code> rop for the given
+     * Returns the appropriate {@code xor} rop for the given
      * types. The result is a shared instance.
      * 
-     * @param types non-null; types of the sources
-     * @return non-null; an appropriate instance
+     * @param types {@code non-null;} types of the sources
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opXor(TypeList types) {
         return pickBinaryOp(types, XOR_CONST_INT, XOR_CONST_LONG, null, null,
@@ -1591,11 +1540,11 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>shl</code> rop for the given
+     * Returns the appropriate {@code shl} rop for the given
      * types. The result is a shared instance.
      * 
-     * @param types non-null; types of the sources
-     * @return non-null; an appropriate instance
+     * @param types {@code non-null;} types of the sources
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opShl(TypeList types) {
         return pickBinaryOp(types, SHL_CONST_INT, SHL_CONST_LONG, null, null,
@@ -1603,11 +1552,11 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>shr</code> rop for the given
+     * Returns the appropriate {@code shr} rop for the given
      * types. The result is a shared instance.
      * 
-     * @param types non-null; types of the sources
-     * @return non-null; an appropriate instance
+     * @param types {@code non-null;} types of the sources
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opShr(TypeList types) {
         return pickBinaryOp(types, SHR_CONST_INT, SHR_CONST_LONG, null, null,
@@ -1615,11 +1564,11 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>ushr</code> rop for the given
+     * Returns the appropriate {@code ushr} rop for the given
      * types. The result is a shared instance.
      * 
-     * @param types non-null; types of the sources
-     * @return non-null; an appropriate instance
+     * @param types {@code non-null;} types of the sources
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opUshr(TypeList types) {
         return pickBinaryOp(types, USHR_CONST_INT, USHR_CONST_LONG, null, null,
@@ -1630,16 +1579,16 @@ public final class Rops {
      * Returns the appropriate binary arithmetic rop for the given type
      * and arguments. The result is a shared instance.
      * 
-     * @param types non-null; sources of the operation
-     * @param int1 non-null; the int-to-constant rop
-     * @param long1 non-null; the long-to-constant rop
-     * @param float1 null-ok; the float-to-constant rop, if any
-     * @param double1 null-ok; the double-to-constant rop, if any
-     * @param int2 non-null; the int-to-int rop
-     * @param long2 non-null; the long-to-long or long-to-int rop
-     * @param float2 null-ok; the float-to-float rop, if any
-     * @param double2 null-ok; the double-to-double rop, if any
-     * @return non-null; an appropriate 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
+     * @param float1 {@code null-ok;} the float-to-constant rop, if any
+     * @param double1 {@code null-ok;} the double-to-constant rop, if any
+     * @param int2 {@code non-null;} the int-to-int rop
+     * @param long2 {@code non-null;} the long-to-long or long-to-int rop
+     * @param float2 {@code null-ok;} the float-to-float rop, if any
+     * @param double2 {@code null-ok;} the double-to-double rop, if any
+     * @return {@code non-null;} an appropriate instance
      */
     private static Rop pickBinaryOp(TypeList types, Rop int1, Rop long1,
                                     Rop float1, Rop double1, Rop int2,
@@ -1676,11 +1625,11 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>neg</code> rop for the given type. The
+     * Returns the appropriate {@code neg} rop for the given type. The
      * result is a shared instance.
      * 
-     * @param type non-null; type of value being operated on
-     * @return non-null; an appropriate instance
+     * @param type {@code non-null;} type of value being operated on
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opNeg(TypeBearer type) {
         switch (type.getBasicFrameType()) {
@@ -1694,11 +1643,11 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>not</code> rop for the given type. The
+     * Returns the appropriate {@code not} rop for the given type. The
      * result is a shared instance.
      * 
-     * @param type non-null; type of value being operated on
-     * @return non-null; an appropriate instance
+     * @param type {@code non-null;} type of value being operated on
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opNot(TypeBearer type) {
         switch (type.getBasicFrameType()) {
@@ -1710,11 +1659,11 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>cmpl</code> rop for the given type. The
+     * Returns the appropriate {@code cmpl} rop for the given type. The
      * result is a shared instance.
      * 
-     * @param type non-null; type of value being compared
-     * @return non-null; an appropriate instance
+     * @param type {@code non-null;} type of value being compared
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opCmpl(TypeBearer type) {
         switch (type.getBasicType()) {
@@ -1727,11 +1676,11 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>cmpg</code> rop for the given type. The
+     * Returns the appropriate {@code cmpg} rop for the given type. The
      * result is a shared instance.
      * 
-     * @param type non-null; type of value being compared
-     * @return non-null; an appropriate instance
+     * @param type {@code non-null;} type of value being compared
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opCmpg(TypeBearer type) {
         switch (type.getBasicType()) {
@@ -1743,12 +1692,12 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>conv</code> rop for the given types. The
+     * Returns the appropriate {@code conv} rop for the given types. The
      * result is a shared instance.
      * 
-     * @param dest non-null; target value type
-     * @param source non-null; source value type
-     * @return non-null; an appropriate instance
+     * @param dest {@code non-null;} target value type
+     * @param source {@code non-null;} source value type
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opConv(TypeBearer dest, TypeBearer source) {
         int dbt = dest.getBasicFrameType();
@@ -1788,11 +1737,11 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>return</code> rop for the given type. The
+     * Returns the appropriate {@code return} rop for the given type. The
      * result is a shared instance.
      * 
-     * @param type non-null; type of value being returned
-     * @return non-null; an appropriate instance
+     * @param type {@code non-null;} type of value being returned
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opReturn(TypeBearer type) {
         switch (type.getBasicFrameType()) {
@@ -1808,11 +1757,11 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>aget</code> rop for the given type. The
+     * Returns the appropriate {@code aget} rop for the given type. The
      * result is a shared instance.
      * 
-     * @param type non-null; element type of array being accessed
-     * @return non-null; an appropriate instance
+     * @param type {@code non-null;} element type of array being accessed
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opAget(TypeBearer type) {
         switch (type.getBasicType()) {
@@ -1831,11 +1780,11 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>aput</code> rop for the given type. The
+     * Returns the appropriate {@code aput} rop for the given type. The
      * result is a shared instance.
      * 
-     * @param type non-null; element type of array being accessed
-     * @return non-null; an appropriate instance
+     * @param type {@code non-null;} element type of array being accessed
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opAput(TypeBearer type) {
         switch (type.getBasicType()) {
@@ -1854,11 +1803,11 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>new-array</code> rop for the given
+     * Returns the appropriate {@code new-array} rop for the given
      * type. The result is a shared instance.
      * 
-     * @param arrayType non-null; array type of array being created
-     * @return non-null; an appropriate instance
+     * @param arrayType {@code non-null;} array type of array being created
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opNewArray(TypeBearer arrayType) {
         Type type = arrayType.getType();
@@ -1884,12 +1833,12 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>filled-new-array</code> rop for the given
+     * Returns the appropriate {@code filled-new-array} rop for the given
      * type. The result may be a shared instance.
      * 
-     * @param arrayType non-null; type of array being created
-     * @param count &gt;= 0; number of elements that the array should have
-     * @return non-null; an appropriate 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
      */
     public static Rop opFilledNewArray(TypeBearer arrayType, int count) {
         Type type = arrayType.getType();
@@ -1916,11 +1865,11 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>get-field</code> rop for the given
+     * Returns the appropriate {@code get-field} rop for the given
      * type. The result is a shared instance.
      * 
-     * @param type non-null; type of the field in question
-     * @return non-null; an appropriate instance
+     * @param type {@code non-null;} type of the field in question
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opGetField(TypeBearer type) {
         switch (type.getBasicType()) {
@@ -1939,11 +1888,11 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>put-field</code> rop for the given
+     * Returns the appropriate {@code put-field} rop for the given
      * type. The result is a shared instance.
      * 
-     * @param type non-null; type of the field in question
-     * @return non-null; an appropriate instance
+     * @param type {@code non-null;} type of the field in question
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opPutField(TypeBearer type) {
         switch (type.getBasicType()) {
@@ -1962,11 +1911,11 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>get-static</code> rop for the given
+     * Returns the appropriate {@code get-static} rop for the given
      * type. The result is a shared instance.
      * 
-     * @param type non-null; type of the field in question
-     * @return non-null; an appropriate instance
+     * @param type {@code non-null;} type of the field in question
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opGetStatic(TypeBearer type) {
         switch (type.getBasicType()) {
@@ -1985,11 +1934,11 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>put-static</code> rop for the given
+     * Returns the appropriate {@code put-static} rop for the given
      * type. The result is a shared instance.
      * 
-     * @param type non-null; type of the field in question
-     * @return non-null; an appropriate instance
+     * @param type {@code non-null;} type of the field in question
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opPutStatic(TypeBearer type) {
         switch (type.getBasicType()) {
@@ -2008,11 +1957,11 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>invoke-static</code> rop for the
+     * Returns the appropriate {@code invoke-static} rop for the
      * given type. The result is typically a newly-allocated instance.
      * 
-     * @param meth non-null; descriptor of the method
-     * @return non-null; an appropriate instance
+     * @param meth {@code non-null;} descriptor of the method
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opInvokeStatic(Prototype meth) {
         return new Rop(RegOps.INVOKE_STATIC,
@@ -2021,12 +1970,12 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>invoke-virtual</code> rop for the
+     * Returns the appropriate {@code invoke-virtual} rop for the
      * given type. The result is typically a newly-allocated instance.
      * 
-     * @param meth non-null; descriptor of the method, including the
-     * <code>this</code> parameter
-     * @return non-null; an appropriate instance
+     * @param meth {@code non-null;} descriptor of the method, including the
+     * {@code this} parameter
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opInvokeVirtual(Prototype meth) {
         return new Rop(RegOps.INVOKE_VIRTUAL,
@@ -2035,12 +1984,12 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>invoke-super</code> rop for the
+     * Returns the appropriate {@code invoke-super} rop for the
      * given type. The result is typically a newly-allocated instance.
      * 
-     * @param meth non-null; descriptor of the method, including the
-     * <code>this</code> parameter
-     * @return non-null; an appropriate instance
+     * @param meth {@code non-null;} descriptor of the method, including the
+     * {@code this} parameter
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opInvokeSuper(Prototype meth) {
         return new Rop(RegOps.INVOKE_SUPER,
@@ -2049,12 +1998,12 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>invoke-direct</code> rop for the
+     * Returns the appropriate {@code invoke-direct} rop for the
      * given type. The result is typically a newly-allocated instance.
      * 
-     * @param meth non-null; descriptor of the method, including the
-     * <code>this</code> parameter
-     * @return non-null; an appropriate instance
+     * @param meth {@code non-null;} descriptor of the method, including the
+     * {@code this} parameter
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opInvokeDirect(Prototype meth) {
         return new Rop(RegOps.INVOKE_DIRECT,
@@ -2063,12 +2012,12 @@ public final class Rops {
     }
 
     /**
-     * Returns the appropriate <code>invoke-interface</code> rop for the
+     * Returns the appropriate {@code invoke-interface} rop for the
      * given type. The result is typically a newly-allocated instance.
      * 
-     * @param meth non-null; descriptor of the method, including the
-     * <code>this</code> parameter
-     * @return non-null; an appropriate instance
+     * @param meth {@code non-null;} descriptor of the method, including the
+     * {@code this} parameter
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opInvokeInterface(Prototype meth) {
         return new Rop(RegOps.INVOKE_INTERFACE,
@@ -2077,11 +2026,11 @@ public final class Rops {
     }
     
     /**
-     * Returns the appropriate <code>mark-local</code> rop for the given type.
+     * Returns the appropriate {@code mark-local} rop for the given type.
      * The result is a shared instance.
      *
-     * @param type non-null; type of value being marked
-     * @return non-null; an appropriate instance
+     * @param type {@code non-null;} type of value being marked
+     * @return {@code non-null;} an appropriate instance
      */
     public static Rop opMarkLocal(TypeBearer type) {
         switch (type.getBasicFrameType()) {
@@ -2105,7 +2054,7 @@ public final class Rops {
     /**
      * Throws the right exception to complain about a bogus type.
      * 
-     * @param type non-null; the bad type
+     * @param type {@code non-null;} the bad type
      * @return never
      */
     private static Rop throwBadType(TypeBearer type) {
@@ -2115,7 +2064,7 @@ public final class Rops {
     /**
      * Throws the right exception to complain about a bogus list of types.
      * 
-     * @param types non-null; the bad types
+     * @param types {@code non-null;} the bad types
      * @return never
      */
     private static Rop throwBadTypes(TypeList types) {
index da66c7d..f32caa1 100644 (file)
@@ -24,21 +24,21 @@ import com.android.dx.util.Hex;
  * line number and original bytecode address.
  */
 public final class SourcePosition {
-    /** non-null; convenient "no information known" instance */
+    /** {@code non-null;} convenient "no information known" instance */
     public static final SourcePosition NO_INFO =
         new SourcePosition(null, -1, -1);
 
-    /** null-ok; name of the file of origin or <code>null</code> if unknown */
+    /** {@code null-ok;} name of the file of origin or {@code null} if unknown */
     private final CstUtf8 sourceFile;
 
     /**
-     * &gt;= -1; the bytecode address, or <code>-1</code> if that
+     * {@code >= -1;} the bytecode address, or {@code -1} if that
      * information is unknown 
      */
     private final int address;
 
     /**
-     * &gt;= -1; the line number, or <code>-1</code> if that
+     * {@code >= -1;} the line number, or {@code -1} if that
      * information is unknown 
      */
     private final int line;
@@ -46,11 +46,11 @@ public final class SourcePosition {
     /**
      * Constructs an instance.
      * 
-     * @param sourceFile null-ok; name of the file of origin or
-     * <code>null</code> if unknown
-     * @param address &gt;= -1; original bytecode address or <code>-1</code>
+     * @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}
      * if unknown
-     * @param line &gt;= -1; original line number or <code>-1</code> if
+     * @param line {@code >= -1;} original line number or {@code -1} if
      * unknown
      */
     public SourcePosition(CstUtf8 sourceFile, int address, int line) {
@@ -118,8 +118,8 @@ public final class SourcePosition {
      * Returns whether the lines match between this instance and
      * the one given.
      * 
-     * @param other non-null; the instance to compare to
-     * @return <code>true</code> iff the lines match
+     * @param other {@code non-null;} the instance to compare to
+     * @return {@code true} iff the lines match
      */
     public boolean sameLine(SourcePosition other) {
         return (line == other.line);
@@ -129,8 +129,8 @@ public final class SourcePosition {
      * Returns whether the lines and files match between this instance and
      * the one given.
      * 
-     * @param other non-null; the instance to compare to
-     * @return <code>true</code> iff the lines and files match
+     * @param other {@code non-null;} the instance to compare to
+     * @return {@code true} iff the lines and files match
      */
     public boolean sameLineAndFile(SourcePosition other) {
         return (line == other.line) &&
@@ -141,7 +141,7 @@ public final class SourcePosition {
     /**
      * Gets the source file, if known.
      * 
-     * @return null-ok; the source file or <code>null</code> if unknown
+     * @return {@code null-ok;} the source file or {@code null} if unknown
      */
     public CstUtf8 getSourceFile() {
         return sourceFile;
@@ -150,7 +150,7 @@ public final class SourcePosition {
     /**
      * Gets the original bytecode address.
      * 
-     * @return &gt;= -1; the address or <code>-1</code> if unknown
+     * @return {@code >= -1;} the address or {@code -1} if unknown
      */
     public int getAddress() {
         return address;
@@ -159,7 +159,7 @@ public final class SourcePosition {
     /**
      * Gets the original line number.
      * 
-     * @return &gt;= -1; the original line number or <code>-1</code> if
+     * @return {@code >= -1;} the original line number or {@code -1} if
      * unknown
      */
     public int getLine() {
index fdf1a46..586205b 100644 (file)
@@ -26,17 +26,17 @@ import com.android.dx.util.IntList;
  */
 public final class SwitchInsn
         extends Insn {
-    /** non-null; list of switch cases */
+    /** {@code non-null;} list of switch cases */
     private final IntList cases;
 
     /**
      * Constructs an instance.
      * 
-     * @param opcode non-null; the opcode
-     * @param position non-null; source position
-     * @param result null-ok; spec for the result, if any
-     * @param sources non-null; specs for all the sources
-     * @param cases non-null; list of switch cases
+     * @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
+     * @param sources {@code non-null;} specs for all the sources
+     * @param cases {@code non-null;} list of switch cases
      */
     public SwitchInsn(Rop opcode, SourcePosition position, RegisterSpec result,
                       RegisterSpecList sources, IntList cases) {
@@ -90,7 +90,7 @@ public final class SwitchInsn
      * {@inheritDoc}
      *
      * <p> SwitchInsn always compares false. The current use for this method
-     * never encounters <code>SwitchInsn</code>s
+     * never encounters {@code SwitchInsn}s
      */
     @Override
     public boolean contentEquals(Insn b) {
@@ -111,7 +111,7 @@ public final class SwitchInsn
     /**
      * Gets the list of switch cases.
      * 
-     * @return non-null; the case list
+     * @return {@code non-null;} the case list
      */
     public IntList getCases() {
         return cases;
index 49ebc91..b14e758 100644 (file)
@@ -26,17 +26,17 @@ import com.android.dx.rop.type.TypeList;
  */
 public final class ThrowingCstInsn
         extends CstInsn {
-    /** non-null; list of exceptions caught */
+    /** {@code non-null;} list of exceptions caught */
     private final TypeList catches;
 
     /**
      * Constructs an instance.
      * 
-     * @param opcode non-null; the opcode
-     * @param position non-null; source position
-     * @param sources non-null; specs for all the sources
-     * @param catches non-null; list of exceptions caught
-     * @param cst non-null; the constant
+     * @param opcode {@code non-null;} the opcode
+     * @param position {@code non-null;} source position
+     * @param sources {@code non-null;} specs for all the sources
+     * @param catches {@code non-null;} list of exceptions caught
+     * @param cst {@code non-null;} the constant
      */
     public ThrowingCstInsn(Rop opcode, SourcePosition position,
                            RegisterSpecList sources,
index 24a5bed..78dc874 100644 (file)
@@ -20,22 +20,22 @@ import com.android.dx.rop.type.Type;
 import com.android.dx.rop.type.TypeList;
 
 /**
- * Instruction which possibly throws. The <code>successors</code> list in the
+ * Instruction which possibly throws. The {@code successors} list in the
  * basic block an instance of this class is inside corresponds in-order to
  * the list of exceptions handled by this instruction, with the
  * no-exception case appended as the final target.
  */
 public final class ThrowingInsn
         extends Insn {
-    /** non-null; list of exceptions caught */
+    /** {@code non-null;} list of exceptions caught */
     private final TypeList catches;
 
     /**
      * Gets the string form of a register spec list to be used as a catches
      * list.
      * 
-     * @param catches non-null; the catches list
-     * @return non-null; the string form
+     * @param catches {@code non-null;} the catches list
+     * @return {@code non-null;} the string form
      */
     public static String toCatchString(TypeList catches) {
         StringBuffer sb = new StringBuffer(100);
@@ -54,10 +54,10 @@ public final class ThrowingInsn
     /**
      * Constructs an instance.
      * 
-     * @param opcode non-null; the opcode
-     * @param position non-null; source position
-     * @param sources non-null; specs for all the sources
-     * @param catches non-null; list of exceptions caught
+     * @param opcode {@code non-null;} the opcode
+     * @param position {@code non-null;} source position
+     * @param sources {@code non-null;} specs for all the sources
+     * @param catches {@code non-null;} list of exceptions caught
      */
     public ThrowingInsn(Rop opcode, SourcePosition position,
                         RegisterSpecList sources,
index 8c2cde9..832d84d 100644 (file)
@@ -30,10 +30,10 @@ public interface TranslationAdvice {
      * last argument must have a type which indicates it is a known constant.)
      * The instruction associated must have exactly two sources.
      *
-     * @param opcode non-null; the opcode
-     * @param sourceA non-null; the first source
-     * @param sourceB non-null; the second source
-     * @return <code>true</code> iff the target can represent the operation
+     * @param opcode {@code non-null;} the opcode
+     * @param sourceA {@code non-null;} the first source
+     * @param sourceB {@code non-null;} the second source
+     * @return {@code true} iff the target can represent the operation
      * using a constant for the last argument
      */
     public boolean hasConstantOperation(Rop opcode,
@@ -43,9 +43,9 @@ public interface TranslationAdvice {
      * Returns true if the translation target requires the sources of the
      * specified opcode to be in order and contiguous (eg, for an invoke-range)
      *
-     * @param opcode non-null; opcode
-     * @param sources non-null; source list
-     * @return <code>true</code> iff the target requires the sources to be
+     * @param opcode {@code non-null;} opcode
+     * @param sources {@code non-null;} source list
+     * @return {@code true} iff the target requires the sources to be
      * in order and contiguous.
      */
     public boolean requiresSourcesInOrder(Rop opcode, RegisterSpecList sources);
index 0f44010..64231d3 100644 (file)
@@ -24,11 +24,11 @@ import com.android.dx.util.ToHuman;
 public abstract class Constant
         implements ToHuman, Comparable<Constant> {
     /**
-     * Returns <code>true</code> if this instance is a category-2 constant,
+     * Returns {@code true} if this instance is a category-2 constant,
      * meaning it takes up two slots in the constant pool, or
-     * <code>false</code> if this instance is category-1.
+     * {@code false} if this instance is category-1.
      *
-     * @return <code>true</code> iff this instance is category-2
+     * @return {@code true} iff this instance is category-2
      */
     public abstract boolean isCategory2();
 
@@ -36,7 +36,7 @@ public abstract class Constant
      * Returns the human name for the particular type of constant
      * this instance is.
      *
-     * @return non-null; the name
+     * @return {@code non-null;} the name
      */
     public abstract String typeName();
 
@@ -60,8 +60,8 @@ 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 non-null; the instance to compare to
-     * @return <code>-1</code>, <code>0</code>, or <code>1</code>, as usual
+     * @param other {@code non-null;} the instance to compare to
+     * @return {@code -1}, {@code 0}, or {@code 1}, as usual
      * for a comparison
      */
     protected abstract int compareTo0(Constant other);
index 9a64a2a..efc394d 100644 (file)
@@ -23,47 +23,47 @@ package com.android.dx.rop.cst;
 public interface ConstantPool {
     /**
      * Get the "size" of the constant pool. This corresponds to the
-     * class file field <code>constant_pool_count</code>, and is in fact
+     * class file field {@code constant_pool_count}, and is in fact
      * always at least one more than the actual size of the constant pool,
-     * as element <code>0</code> is always invalid.
+     * as element {@code 0} is always invalid.
      *
-     * @return <code>&gt;= 1</code>; the size
+     * @return {@code >= 1;} the size
      */
     public int size();
 
     /**
-     * Get the <code>n</code>th entry in the constant pool, which must
+     * Get the {@code n}th entry in the constant pool, which must
      * be valid.
      *
-     * @param n <code>n &gt;= 0, n &lt; size()</code>; the constant pool index
-     * @return non-null; the corresponding entry
-     * @throws IllegalArgumentException thrown if <code>n</code> is
+     * @param n {@code n >= 0, n < size();} the constant pool index
+     * @return {@code non-null;} the corresponding entry
+     * @throws IllegalArgumentException thrown if {@code n} is
      * in-range but invalid
      */
     public Constant get(int n);
 
     /**
-     * Get the <code>n</code>th entry in the constant pool, which must
-     * be valid unless <code>n == 0</code>, in which case <code>null</code>
+     * Get the {@code n}th entry in the constant pool, which must
+     * be valid unless {@code n == 0}, in which case {@code null}
      * is returned.
      *
-     * @param n <code>n &gt;= 0, n &lt; size()</code>; the constant pool index
-     * @return null-ok; the corresponding entry, if <code>n != 0</code>
-     * @throws IllegalArgumentException thrown if <code>n</code> is
+     * @param n {@code n >= 0, n < size();} the constant pool index
+     * @return {@code null-ok;} the corresponding entry, if {@code n != 0}
+     * @throws IllegalArgumentException thrown if {@code n} is
      * in-range and non-zero but invalid
      */
     public Constant get0Ok(int n);
 
     /**
-     * Get the <code>n</code>th entry in the constant pool, or
-     * <code>null</code> if the index is in-range but invalid. In
-     * particular, <code>null</code> is returned for index <code>0</code>
+     * Get the {@code n}th entry in the constant pool, or
+     * {@code null} if the index is in-range but invalid. In
+     * particular, {@code null} is returned for index {@code 0}
      * as well as the index after any entry which is defined to take up
-     * two slots (that is, <code>Long</code> and <code>Double</code>
+     * two slots (that is, {@code Long} and {@code Double}
      * entries).
      *
-     * @param n <code>n &gt;= 0, n &lt; size()</code>; the constant pool index
-     * @return null-ok; the corresponding entry, or <code>null</code> if
+     * @param n {@code n >= 0, n < size();} the constant pool index
+     * @return {@code null-ok;} the corresponding entry, or {@code null} if
      * the index is in-range but invalid
      */
     public Constant getOrNull(int n);
index d6dc1f2..1385798 100644 (file)
@@ -22,13 +22,13 @@ import com.android.dx.rop.annotation.Annotation;
  * Constant type that represents an annotation.
  */
 public final class CstAnnotation extends Constant {
-    /** non-null; the actual annotation */
+    /** {@code non-null;} the actual annotation */
     private final Annotation annotation;
     
     /**
      * Constructs an instance.
      *
-     * @param annotation non-null; the annotation to hold
+     * @param annotation {@code non-null;} the annotation to hold
      */
     public CstAnnotation(Annotation annotation) {
         if (annotation == null) {
@@ -88,7 +88,7 @@ public final class CstAnnotation extends Constant {
     /**
      * Get the underlying annotation.
      * 
-     * @return non-null; the annotation
+     * @return {@code non-null;} the annotation
      */
     public Annotation getAnnotation() {
         return annotation;
index 69c0aef..8b521bd 100644 (file)
@@ -24,13 +24,13 @@ import com.android.dx.util.FixedSizeList;
  * may be of any type <i>other</i> than {@link CstUtf8}.
  */
 public final class CstArray extends Constant {
-    /** non-null; the actual list of contents */
+    /** {@code non-null;} the actual list of contents */
     private final List list;
     
     /**
      * Constructs an instance.
      *
-     * @param list non-null; the actual list of contents
+     * @param list {@code non-null;} the actual list of contents
      */
     public CstArray(List list) {
         if (list == null) {
@@ -90,7 +90,7 @@ public final class CstArray extends Constant {
     /**
      * Get the underlying list.
      * 
-     * @return non-null; the list
+     * @return {@code non-null;} the list
      */
     public List getList() {
         return list;
@@ -103,7 +103,7 @@ public final class CstArray extends Constant {
             extends FixedSizeList implements Comparable<List> {
         /**
          * Constructs an instance. All indices initially contain
-         * <code>null</code>.
+         * {@code null}.
          * 
          * @param size the size of the list
          */
@@ -138,10 +138,10 @@ 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</code>.
+         * do that, this will throw {@code NullPointerException}.
          * 
-         * @param n &gt;= 0, &lt; size(); which index
-         * @return non-null; element at that index
+         * @param n {@code >= 0, < size();} which index
+         * @return {@code non-null;} element at that index
          */
         public Constant get(int n) {
             return (Constant) get0(n);
@@ -150,8 +150,8 @@ public final class CstArray extends Constant {
         /**
          * Sets the element at the given index.
          * 
-         * @param n &gt;= 0, &lt; size(); which index
-         * @param a null-ok; the element to set at <code>n</code>
+         * @param n {@code >= 0, < size();} which index
+         * @param a {@code null-ok;} the element to set at {@code n}
          */
         public void set(int n, Constant a) {
             if (a instanceof CstUtf8) {
index c885601..039d7ed 100644 (file)
@@ -28,20 +28,20 @@ import com.android.dx.rop.type.TypeBearer;
  */
 public abstract class CstBaseMethodRef
         extends CstMemberRef {
-    /** non-null; the raw prototype for this method */
+    /** {@code non-null;} the raw prototype for this method */
     private final Prototype prototype;
 
     /**
-     * null-ok; the prototype for this method taken to be an instance
-     * method, or <code>null</code> if not yet calculated
+     * {@code null-ok;} the prototype for this method taken to be an instance
+     * method, or {@code null} if not yet calculated
      */
     private Prototype instancePrototype;
 
     /**
      * Constructs an instance.
      *
-     * @param definingClass non-null; the type of the defining class
-     * @param nat non-null; the name-and-type
+     * @param definingClass {@code non-null;} the type of the defining class
+     * @param nat {@code non-null;} the name-and-type
      */
     /*package*/ CstBaseMethodRef(CstType definingClass, CstNat nat) {
         super(definingClass, nat);
@@ -53,9 +53,9 @@ public abstract class CstBaseMethodRef
 
     /**
      * Gets the raw prototype of this method. This doesn't include a
-     * <code>this</code> argument.
+     * {@code this} argument.
      *
-     * @return non-null; the method prototype
+     * @return {@code non-null;} the method prototype
      */
     public final Prototype getPrototype() {
         return prototype;
@@ -63,14 +63,14 @@ public abstract class CstBaseMethodRef
 
     /**
      * Gets the prototype of this method as either a
-     * <code>static</code> or instance method. In the case of a
-     * <code>static</code> method, this is the same as the raw
+     * {@code static} or instance method. In the case of a
+     * {@code static} method, this is the same as the raw
      * prototype. In the case of an instance method, this has an
-     * appropriately-typed <code>this</code> argument as the first
+     * appropriately-typed {@code this} argument as the first
      * one.
      *
      * @param isStatic whether the method should be considered static
-     * @return non-null; the method prototype
+     * @return {@code non-null;} the method prototype
      */
     public final Prototype getPrototype(boolean isStatic) {
         if (isStatic) {
@@ -102,7 +102,7 @@ public abstract class CstBaseMethodRef
      * 
      * In this case, this method returns the <i>return type</i> of this method.
      *
-     * @return non-null; the method's return type
+     * @return {@code non-null;} the method's return type
      */
     public final Type getType() {
         return prototype.getReturnType();
@@ -111,15 +111,15 @@ public abstract class CstBaseMethodRef
     /**
      * Gets the number of words of parameters required by this
      * method's descriptor. Since instances of this class have no way
-     * to know if they will be used in a <code>static</code> or
+     * to know if they will be used in a {@code static} or
      * instance context, one has to indicate this explicitly as an
      * argument. This method is just a convenient shorthand for
-     * <code>getPrototype().getParameterTypes().getWordCount()</code>,
-     * plus <code>1</code> if the method is to be treated as an
+     * {@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 &gt;= 0; the argument word count
+     * @return {@code >= 0;} the argument word count
      */
     public final int getParameterWordCount(boolean isStatic) {
         return getPrototype(isStatic).getParameterTypes().getWordCount();
@@ -128,9 +128,9 @@ public abstract class CstBaseMethodRef
     /**
      * Gets whether this is a reference to an instance initialization
      * method. This is just a convenient shorthand for
-     * <code>getNat().isInstanceInit()</code>.
+     * {@code getNat().isInstanceInit()}.
      *
-     * @return <code>true</code> iff this is a reference to an
+     * @return {@code true} iff this is a reference to an
      * instance initialization method
      */
     public final boolean isInstanceInit() {
@@ -140,9 +140,9 @@ public abstract class CstBaseMethodRef
     /**
      * Gets whether this is a reference to a class initialization
      * method. This is just a convenient shorthand for
-     * <code>getNat().isClassInit()</code>.
+     * {@code getNat().isClassInit()}.
      *
-     * @return <code>true</code> iff this is a reference to an
+     * @return {@code true} iff this is a reference to an
      * instance initialization method
      */
     public final boolean isClassInit() {
index ab25d5b..8c290ef 100644 (file)
@@ -19,33 +19,33 @@ package com.android.dx.rop.cst;
 import com.android.dx.rop.type.Type;
 
 /**
- * Constants of type <code>boolean</code>.
+ * Constants of type {@code boolean}.
  */
 public final class CstBoolean
         extends CstLiteral32 {
-    /** non-null; instance representing <code>false</code> */
+    /** {@code non-null;} instance representing {@code false} */
     public static final CstBoolean VALUE_FALSE = new CstBoolean(false);
 
-    /** non-null; instance representing <code>true</code> */
+    /** {@code non-null;} instance representing {@code true} */
     public static final CstBoolean VALUE_TRUE = new CstBoolean(true);
 
     /**
      * Makes an instance for the given value. This will return an
      * already-allocated instance.
      * 
-     * @param value the <code>boolean</code> value
-     * @return non-null; the appropriate instance
+     * @param value the {@code boolean} value
+     * @return {@code non-null;} the appropriate instance
      */
     public static CstBoolean make(boolean value) {
         return value ? VALUE_TRUE : VALUE_FALSE;
     }
 
     /**
-     * Makes an instance for the given <code>int</code> value. This
+     * Makes an instance for the given {@code int} value. This
      * will return an already-allocated instance.
      * 
-     * @param value must be either <code>0</code> or <code>1</code>
-     * @return non-null; the appropriate instance
+     * @param value must be either {@code 0} or {@code 1}
+     * @return {@code non-null;} the appropriate instance
      */
     public static CstBoolean make(int value) {
         if (value == 0) {
@@ -60,7 +60,7 @@ public final class CstBoolean
     /**
      * Constructs an instance. This constructor is private; use {@link #make}.
      * 
-     * @param value the <code>boolean</code> value
+     * @param value the {@code boolean} value
      */
     private CstBoolean(boolean value) {
         super(value ? 1 : 0);
@@ -89,7 +89,7 @@ public final class CstBoolean
     }
 
     /**
-     * Gets the <code>boolean</code> value.
+     * Gets the {@code boolean} value.
      * 
      * @return the value
      */
index ffc3206..a8af9f7 100644 (file)
@@ -20,30 +20,30 @@ import com.android.dx.rop.type.Type;
 import com.android.dx.util.Hex;
 
 /**
- * Constants of type <code>byte</code>.
+ * Constants of type {@code byte}.
  */
 public final class CstByte
         extends CstLiteral32 {
-    /** non-null; the value <code>0</code> as an instance of this class */
+    /** {@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</code> value
+     * @param value the {@code byte} value
      */
     public static CstByte make(byte value) {
         return new CstByte(value);
     }
 
     /**
-     * Makes an instance for the given <code>int</code> value. This
+     * 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</code>
-     * @return non-null; the appropriate instance
+     * @param value the value, which must be in range for a {@code byte}
+     * @return {@code non-null;} the appropriate instance
      */
     public static CstByte make(int value) {
         byte cast = (byte) value;
@@ -59,7 +59,7 @@ public final class CstByte
     /**
      * Constructs an instance. This constructor is private; use {@link #make}.
      * 
-     * @param value the <code>byte</code> value
+     * @param value the {@code byte} value
      */
     private CstByte(byte value) {
         super(value);
@@ -89,7 +89,7 @@ public final class CstByte
     }
 
     /**
-     * Gets the <code>byte</code> value.
+     * Gets the {@code byte} value.
      * 
      * @return the value
      */
index a31bd7f..0a87cbc 100644 (file)
@@ -20,30 +20,30 @@ import com.android.dx.rop.type.Type;
 import com.android.dx.util.Hex;
 
 /**
- * Constants of type <code>char</code>.
+ * Constants of type {@code char}.
  */
 public final class CstChar
         extends CstLiteral32 {
-    /** non-null; the value <code>0</code> as an instance of this class */
+    /** {@code non-null;} the value {@code 0} as an instance of this class */
     public static final CstChar VALUE_0 = make((char) 0);
 
     /**
      * Makes an instance for the given value. This may (but does not
      * necessarily) return an already-allocated instance.
      * 
-     * @param value the <code>char</code> value
+     * @param value the {@code char} value
      */
     public static CstChar make(char value) {
         return new CstChar(value);
     }
 
     /**
-     * Makes an instance for the given <code>int</code> value. This
+     * 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</code>
-     * @return non-null; the appropriate instance
+     * @param value the value, which must be in range for a {@code char}
+     * @return {@code non-null;} the appropriate instance
      */
     public static CstChar make(int value) {
         char cast = (char) value;
@@ -59,7 +59,7 @@ public final class CstChar
     /**
      * Constructs an instance. This constructor is private; use {@link #make}.
      * 
-     * @param value the <code>char</code> value
+     * @param value the {@code char} value
      */
     private CstChar(char value) {
         super(value);
@@ -89,7 +89,7 @@ public final class CstChar
     }
 
     /**
-     * Gets the <code>char</code> value.
+     * Gets the {@code char} value.
      * 
      * @return the value
      */
index 4516667..df4a2cf 100644 (file)
@@ -20,15 +20,15 @@ import com.android.dx.rop.type.Type;
 import com.android.dx.util.Hex;
 
 /**
- * Constants of type <code>CONSTANT_Double_info</code>.
+ * Constants of type {@code CONSTANT_Double_info}.
  */
 public final class CstDouble
         extends CstLiteral64 {
-    /** non-null; instance representing <code>0</code> */
+    /** {@code non-null;} instance representing {@code 0} */
     public static final CstDouble VALUE_0 =
         new CstDouble(Double.doubleToLongBits(0.0));
 
-    /** non-null; instance representing <code>1</code> */
+    /** {@code non-null;} instance representing {@code 1} */
     public static final CstDouble VALUE_1 =
         new CstDouble(Double.doubleToLongBits(1.0));
 
@@ -36,7 +36,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</code> value as <code>long</code> bits
+     * @param bits the {@code double} value as {@code long} bits
      */
     public static CstDouble make(long bits) {
         /*
@@ -49,7 +49,7 @@ public final class CstDouble
     /**
      * Constructs an instance. This constructor is private; use {@link #make}.
      * 
-     * @param bits the <code>double</code> value as <code>long</code> bits
+     * @param bits the {@code double} value as {@code long} bits
      */
     private CstDouble(long bits) {
         super(bits);
@@ -80,7 +80,7 @@ public final class CstDouble
     }
 
     /**
-     * Gets the <code>double</code> value.
+     * Gets the {@code double} value.
      * 
      * @return the value
      */
index f5aec05..78cab9d 100644 (file)
@@ -23,13 +23,13 @@ import com.android.dx.rop.type.Type;
  * value of an enumerated type.
  */
 public final class CstEnumRef extends CstMemberRef {
-    /** null-ok; the corresponding field ref, lazily initialized */
+    /** {@code null-ok;} the corresponding field ref, lazily initialized */
     private CstFieldRef fieldRef;
     
     /**
      * Constructs an instance.
      *
-     * @param nat non-null; the name-and-type; the defining class is derived
+     * @param nat {@code non-null;} the name-and-type; the defining class is derived
      * from this
      */
     public CstEnumRef(CstNat nat) {
@@ -56,7 +56,7 @@ public final class CstEnumRef extends CstMemberRef {
     /**
      * Get a {@link CstFieldRef} that corresponds with this instance.
      * 
-     * @return non-null; the corresponding field reference
+     * @return {@code non-null;} the corresponding field reference
      */
     public CstFieldRef getFieldRef() {
         if (fieldRef == null) {
index 306eca9..497531f 100644 (file)
@@ -19,7 +19,7 @@ package com.android.dx.rop.cst;
 import com.android.dx.rop.type.Type;
 
 /**
- * Constants of type <code>CONSTANT_Fieldref_info</code>.
+ * Constants of type {@code CONSTANT_Fieldref_info}.
  */
 public final class CstFieldRef extends CstMemberRef {
     /**
@@ -27,10 +27,10 @@ public final class CstFieldRef extends CstMemberRef {
      * field which should hold the class corresponding to a given
      * primitive type. For example, if given {@link Type#INT}, this
      * method returns an instance corresponding to the field
-     * <code>java.lang.Integer.TYPE</code>.
+     * {@code java.lang.Integer.TYPE}.
      * 
-     * @param primitiveType non-null; the primitive type
-     * @return non-null; the corresponding static field
+     * @param primitiveType {@code non-null;} the primitive type
+     * @return {@code non-null;} the corresponding static field
      */
     public static CstFieldRef forPrimitiveType(Type primitiveType) {
         return new CstFieldRef(CstType.forBoxedPrimitiveType(primitiveType),
@@ -40,8 +40,8 @@ public final class CstFieldRef extends CstMemberRef {
     /**
      * Constructs an instance.
      * 
-     * @param definingClass non-null; the type of the defining class
-     * @param nat non-null; the name-and-type
+     * @param definingClass {@code non-null;} the type of the defining class
+     * @param nat {@code non-null;} the name-and-type
      */
     public CstFieldRef(CstType definingClass, CstNat nat) {
         super(definingClass, nat);
@@ -56,7 +56,7 @@ public final class CstFieldRef extends CstMemberRef {
     /**
      * Returns the type of this field.
      * 
-     * @return non-null; the field's type
+     * @return {@code non-null;} the field's type
      */
     public Type getType() {
         return getNat().getFieldType();
index 08b7f76..531a20d 100644 (file)
@@ -20,24 +20,24 @@ import com.android.dx.rop.type.Type;
 import com.android.dx.util.Hex;
 
 /**
- * Constants of type <code>CONSTANT_Float_info</code>.
+ * Constants of type {@code CONSTANT_Float_info}.
  */
 public final class CstFloat
         extends CstLiteral32 {
-    /** non-null; instance representing <code>0</code> */
+    /** {@code non-null;} instance representing {@code 0} */
     public static final CstFloat VALUE_0 = make(Float.floatToIntBits(0.0f));
 
-    /** non-null; instance representing <code>1</code> */
+    /** {@code non-null;} instance representing {@code 1} */
     public static final CstFloat VALUE_1 = make(Float.floatToIntBits(1.0f));
 
-    /** non-null; instance representing <code>2</code> */
+    /** {@code non-null;} instance representing {@code 2} */
     public static final CstFloat VALUE_2 = make(Float.floatToIntBits(2.0f));
 
     /**
      * Makes an instance for the given value. This may (but does not
      * necessarily) return an already-allocated instance.
      * 
-     * @param bits the <code>float</code> value as <code>int</code> bits
+     * @param bits the {@code float} value as {@code int} bits
      */
     public static CstFloat make(int bits) {
         /*
@@ -50,7 +50,7 @@ public final class CstFloat
     /**
      * Constructs an instance. This constructor is private; use {@link #make}.
      * 
-     * @param bits the <code>float</code> value as <code>int</code> bits
+     * @param bits the {@code float} value as {@code int} bits
      */
     private CstFloat(int bits) {
         super(bits);
@@ -81,7 +81,7 @@ public final class CstFloat
     }
 
     /**
-     * Gets the <code>float</code> value.
+     * Gets the {@code float} value.
      * 
      * @return the value
      */
index d3fafcc..8fae4fa 100644 (file)
@@ -20,40 +20,40 @@ import com.android.dx.rop.type.Type;
 import com.android.dx.util.Hex;
 
 /**
- * Constants of type <code>CONSTANT_Integer_info</code>.
+ * Constants of type {@code CONSTANT_Integer_info}.
  */
 public final class CstInteger
         extends CstLiteral32 {
-    /** non-null; array of cached instances */
+    /** {@code non-null;} array of cached instances */
     private static final CstInteger[] cache = new CstInteger[511];
 
-    /** non-null; instance representing <code>-1</code> */
+    /** {@code non-null;} instance representing {@code -1} */
     public static final CstInteger VALUE_M1 = make(-1);
 
-    /** non-null; instance representing <code>0</code> */
+    /** {@code non-null;} instance representing {@code 0} */
     public static final CstInteger VALUE_0 = make(0);
 
-    /** non-null; instance representing <code>1</code> */
+    /** {@code non-null;} instance representing {@code 1} */
     public static final CstInteger VALUE_1 = make(1);
 
-    /** non-null; instance representing <code>2</code> */
+    /** {@code non-null;} instance representing {@code 2} */
     public static final CstInteger VALUE_2 = make(2);
 
-    /** non-null; instance representing <code>3</code> */
+    /** {@code non-null;} instance representing {@code 3} */
     public static final CstInteger VALUE_3 = make(3);
 
-    /** non-null; instance representing <code>4</code> */
+    /** {@code non-null;} instance representing {@code 4} */
     public static final CstInteger VALUE_4 = make(4);
 
-    /** non-null; instance representing <code>5</code> */
+    /** {@code non-null;} instance representing {@code 5} */
     public static final CstInteger VALUE_5 = make(5);
 
     /**
      * Makes an instance for the given value. This may (but does not
      * necessarily) return an already-allocated instance.
      * 
-     * @param value the <code>int</code> value
-     * @return non-null; the appropriate instance
+     * @param value the {@code int} value
+     * @return {@code non-null;} the appropriate instance
      */
     public static CstInteger make(int value) {
         /*
@@ -76,7 +76,7 @@ public final class CstInteger
     /**
      * Constructs an instance. This constructor is private; use {@link #make}.
      * 
-     * @param value the <code>int</code> value
+     * @param value the {@code int} value
      */
     private CstInteger(int value) {
         super(value);
@@ -106,7 +106,7 @@ public final class CstInteger
     }
 
     /**
-     * Gets the <code>int</code> value.
+     * Gets the {@code int} value.
      * 
      * @return the value
      */
index f169ec9..55a7599 100644 (file)
 package com.android.dx.rop.cst;
 
 /**
- * Constants of type <code>CONSTANT_InterfaceMethodref_info</code>.
+ * Constants of type {@code CONSTANT_InterfaceMethodref_info}.
  */
 public final class CstInterfaceMethodRef
         extends CstBaseMethodRef {
     /**
-     * null-ok; normal {@link CstMethodRef} that corresponds to this
+     * {@code null-ok;} normal {@link CstMethodRef} that corresponds to this
      * instance, if calculated 
      */
     private CstMethodRef methodRef;
@@ -30,8 +30,8 @@ public final class CstInterfaceMethodRef
     /**
      * Constructs an instance.
      * 
-     * @param definingClass non-null; the type of the defining class
-     * @param nat non-null; the name-and-type
+     * @param definingClass {@code non-null;} the type of the defining class
+     * @param nat {@code non-null;} the name-and-type
      */
     public CstInterfaceMethodRef(CstType definingClass, CstNat nat) {
         super(definingClass, nat);
@@ -48,7 +48,7 @@ public final class CstInterfaceMethodRef
      * Gets a normal (non-interface) {@link CstMethodRef} that corresponds to
      * this instance.
      * 
-     * @return non-null; an appropriate instance
+     * @return {@code non-null;} an appropriate instance
      */
     public CstMethodRef toMethodRef() {
         if (methodRef == null) {
index 853e57e..09dde1b 100644 (file)
@@ -19,10 +19,10 @@ package com.android.dx.rop.cst;
 import com.android.dx.rop.type.Type;
 
 /**
- * Constant type to represent a known-<code>null</code> value.
+ * Constant type to represent a known-{@code null} value.
  */
 public final class CstKnownNull extends CstLiteralBits {
-    /** non-null; unique instance of this class */
+    /** {@code non-null;} unique instance of this class */
     public static final CstKnownNull THE_ONE = new CstKnownNull();
 
     /**
index 31e96dd..c6e3021 100644 (file)
@@ -21,13 +21,13 @@ package com.android.dx.rop.cst;
  */
 public abstract class CstLiteral32
         extends CstLiteralBits {
-    /** the value as <code>int</code> bits */
+    /** the value as {@code int} bits */
     private final int bits;
 
     /**
      * Constructs an instance.
      * 
-     * @param bits the value as <code>int</code> bits
+     * @param bits the value as {@code int} bits
      */
     /*package*/ CstLiteral32(int bits) {
         this.bits = bits;
index dd7d24d..d0b27d2 100644 (file)
@@ -21,13 +21,13 @@ package com.android.dx.rop.cst;
  */
 public abstract class CstLiteral64
         extends CstLiteralBits {
-    /** the value as <code>long</code> bits */
+    /** the value as {@code long} bits */
     private final long bits;
 
     /**
      * Constructs an instance.
      * 
-     * @param bits the value as <code>long</code> bits
+     * @param bits the value as {@code long} bits
      */
     /*package*/ CstLiteral64(long bits) {
         this.bits = bits;
index 98a3f0e..6415487 100644 (file)
@@ -23,18 +23,18 @@ public abstract class CstLiteralBits
         extends TypedConstant {
     /**
      * Returns whether or not this instance's value may be accurately
-     * represented as an <code>int</code>. The rule is that if there
-     * is an <code>int</code> which may be sign-extended to yield this
-     * instance's value, then this method returns <code>true</code>.
-     * Otherwise, it returns <code>false</code>.
+     * represented as an {@code int}. The rule is that if there
+     * is an {@code int} which may be sign-extended to yield this
+     * instance's value, then this method returns {@code true}.
+     * Otherwise, it returns {@code false}.
      *
-     * @return <code>true</code> iff this instance fits in an <code>int</code>
+     * @return {@code true} iff this instance fits in an {@code int}
      */
     public abstract boolean fitsInInt();
 
     /**
-     * Gets the value as <code>int</code> bits. If this instance contains
-     * more bits than fit in an <code>int</code>, then this returns only
+     * Gets the value as {@code int} bits. If this instance contains
+     * more bits than fit in an {@code int}, then this returns only
      * the low-order bits.
      *
      * @return the bits
@@ -42,8 +42,8 @@ public abstract class CstLiteralBits
     public abstract int getIntBits();
 
     /**
-     * Gets the value as <code>long</code> bits. If this instance contains
-     * fewer bits than fit in a <code>long</code>, then the result of this
+     * 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
index 377eb93..c89a339 100644 (file)
@@ -20,21 +20,21 @@ import com.android.dx.rop.type.Type;
 import com.android.dx.util.Hex;
 
 /**
- * Constants of type <code>CONSTANT_Long_info</code>.
+ * Constants of type {@code CONSTANT_Long_info}.
  */
 public final class CstLong
         extends CstLiteral64 {
-    /** non-null; instance representing <code>0</code> */
+    /** {@code non-null;} instance representing {@code 0} */
     public static final CstLong VALUE_0 = make(0);
 
-    /** non-null; instance representing <code>1</code> */
+    /** {@code non-null;} instance representing {@code 1} */
     public static final CstLong VALUE_1 = make(1);
 
     /**
      * Makes an instance for the given value. This may (but does not
      * necessarily) return an already-allocated instance.
      * 
-     * @param value the <code>long</code> value
+     * @param value the {@code long} value
      */
     public static CstLong make(long value) {
         /*
@@ -47,7 +47,7 @@ public final class CstLong
     /**
      * Constructs an instance. This constructor is private; use {@link #make}.
      * 
-     * @param value the <code>long</code> value
+     * @param value the {@code long} value
      */
     private CstLong(long value) {
         super(value);
@@ -77,7 +77,7 @@ public final class CstLong
     }
 
     /**
-     * Gets the <code>long</code> value.
+     * Gets the {@code long} value.
      * 
      * @return the value
      */
index dbaad47..bae47c2 100644 (file)
 package com.android.dx.rop.cst;
 
 /**
- * Constants of type <code>CONSTANT_*ref_info</code>.
+ * Constants of type {@code CONSTANT_*ref_info}.
  */
 public abstract class CstMemberRef extends TypedConstant {
-    /** non-null; the type of the defining class */
+    /** {@code non-null;} the type of the defining class */
     private final CstType definingClass;
 
-    /** non-null; the name-and-type */
+    /** {@code non-null;} the name-and-type */
     private final CstNat nat;
 
     /**
      * Constructs an instance.
      * 
-     * @param definingClass non-null; the type of the defining class
-     * @param nat non-null; the name-and-type
+     * @param definingClass {@code non-null;} the type of the defining class
+     * @param nat {@code non-null;} the name-and-type
      */
     /*package*/ CstMemberRef(CstType definingClass, CstNat nat) {
         if (definingClass == null) {
@@ -68,7 +68,7 @@ public abstract class CstMemberRef extends TypedConstant {
      *
      * <p><b>Note:</b> This implementation just compares the defining
      * class and name, and it is up to subclasses to compare the rest
-     * after calling <code>super.compareTo0()</code>.</p>
+     * after calling {@code super.compareTo0()}.</p>
      */
     @Override
     protected int compareTo0(Constant other) {
@@ -105,7 +105,7 @@ public abstract class CstMemberRef extends TypedConstant {
     /**
      * Gets the type of the defining class.
      * 
-     * @return non-null; the type of defining class
+     * @return {@code non-null;} the type of defining class
      */
     public final CstType getDefiningClass() {
         return definingClass;
@@ -114,7 +114,7 @@ public abstract class CstMemberRef extends TypedConstant {
     /**
      * Gets the defining name-and-type.
      * 
-     * @return non-null; the name-and-type
+     * @return {@code non-null;} the name-and-type
      */
     public final CstNat getNat() {
         return nat;
index 766c9bf..77c97e9 100644 (file)
 package com.android.dx.rop.cst;
 
 /**
- * Constants of type <code>CONSTANT_Methodref_info</code>.
+ * Constants of type {@code CONSTANT_Methodref_info}.
  */
 public final class CstMethodRef
         extends CstBaseMethodRef {
     /**
      * Constructs an instance.
      * 
-     * @param definingClass non-null; the type of the defining class
-     * @param nat non-null; the name-and-type
+     * @param definingClass {@code non-null;} the type of the defining class
+     * @param nat {@code non-null;} the name-and-type
      */
     public CstMethodRef(CstType definingClass, CstNat nat) {
         super(definingClass, nat);
index 106b599..5270fd2 100644 (file)
@@ -19,29 +19,29 @@ package com.android.dx.rop.cst;
 import com.android.dx.rop.type.Type;
 
 /**
- * Constants of type <code>CONSTANT_NameAndType_info</code>.
+ * Constants of type {@code CONSTANT_NameAndType_info}.
  */
 public final class CstNat extends Constant {
     /**
-     * non-null; the instance for name <code>TYPE</code> and descriptor
-     * <code>java.lang.Class</code>, which is useful when dealing with
+     * {@code non-null;} the instance for name {@code TYPE} and descriptor
+     * {@code java.lang.Class}, which is useful when dealing with
      * wrapped primitives 
      */
     public static final CstNat PRIMITIVE_TYPE_NAT =
         new CstNat(new CstUtf8("TYPE"),
                    new CstUtf8("Ljava/lang/Class;"));
 
-    /** non-null; the name */
+    /** {@code non-null;} the name */
     private final CstUtf8 name;
 
-    /** non-null; the descriptor (type) */
+    /** {@code non-null;} the descriptor (type) */
     private final CstUtf8 descriptor;
 
     /**
      * Constructs an instance.
      * 
-     * @param name non-null; the name
-     * @param descriptor non-null; the descriptor
+     * @param name {@code non-null;} the name
+     * @param descriptor {@code non-null;} the descriptor
      */
     public CstNat(CstUtf8 name, CstUtf8 descriptor) {
         if (name == null) {
@@ -108,7 +108,7 @@ public final class CstNat extends Constant {
     /**
      * Gets the name.
      * 
-     * @return non-null; the name
+     * @return {@code non-null;} the name
      */
     public CstUtf8 getName() {
         return name;
@@ -117,7 +117,7 @@ public final class CstNat extends Constant {
     /**
      * Gets the descriptor.
      * 
-     * @return non-null; the descriptor
+     * @return {@code non-null;} the descriptor
      */
     public CstUtf8 getDescriptor() {
         return descriptor;
@@ -127,7 +127,7 @@ public final class CstNat extends Constant {
      * Returns an unadorned but human-readable version of the name-and-type
      * value.
      * 
-     * @return non-null; the human form
+     * @return {@code non-null;} the human form
      */
     public String toHuman() {
         return name.toHuman() + ':' + descriptor.toHuman();
@@ -138,7 +138,7 @@ public final class CstNat extends Constant {
      * This method is only valid to call if the descriptor in fact describes
      * a field (and not a method).
      * 
-     * @return non-null; the field type
+     * @return {@code non-null;} the field type
      */
     public Type getFieldType() {
         return Type.intern(descriptor.getString());
@@ -147,9 +147,9 @@ 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("&lt;init&gt;")</code>.
+     * {@code getName().getString().equals("<init>")}.
      * 
-     * @return <code>true</code> iff this is a reference to an
+     * @return {@code true} iff this is a reference to an
      * instance initialization method
      */
     public final boolean isInstanceInit() {
@@ -159,9 +159,9 @@ 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("&lt;clinit&gt;")</code>.
+     * {@code getName().getString().equals("<clinit>")}.
      * 
-     * @return <code>true</code> iff this is a reference to an
+     * @return {@code true} iff this is a reference to an
      * instance initialization method
      */
     public final boolean isClassInit() {
index 3804254..4ac2f68 100644 (file)
@@ -20,31 +20,31 @@ import com.android.dx.rop.type.Type;
 import com.android.dx.util.Hex;
 
 /**
- * Constants of type <code>short</code>.
+ * Constants of type {@code short}.
  */
 public final class CstShort
         extends CstLiteral32 {
-    /** non-null; the value <code>0</code> as an instance of this class */
+    /** {@code non-null;} the value {@code 0} as an instance of this class */
     public static final CstShort VALUE_0 = make((short) 0);
 
     /**
      * Makes an instance for the given value. This may (but does not
      * necessarily) return an already-allocated instance.
      * 
-     * @param value the <code>short</code> value
-     * @return non-null; the appropriate instance
+     * @param value the {@code short} value
+     * @return {@code non-null;} the appropriate instance
      */
     public static CstShort make(short value) {
         return new CstShort(value);
     }
 
     /**
-     * Makes an instance for the given <code>int</code> value. This
+     * 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</code>
-     * @return non-null; the appropriate instance
+     * @param value the value, which must be in range for a {@code short}
+     * @return {@code non-null;} the appropriate instance
      */
     public static CstShort make(int value) {
         short cast = (short) value;
@@ -60,7 +60,7 @@ public final class CstShort
     /**
      * Constructs an instance. This constructor is private; use {@link #make}.
      * 
-     * @param value the <code>short</code> value
+     * @param value the {@code short} value
      */
     private CstShort(short value) {
         super(value);
@@ -90,7 +90,7 @@ public final class CstShort
     }
 
     /**
-     * Gets the <code>short</code> value.
+     * Gets the {@code short} value.
      * 
      * @return the value
      */
index 89a4c8b..ce00f52 100644 (file)
@@ -19,17 +19,17 @@ package com.android.dx.rop.cst;
 import com.android.dx.rop.type.Type;
 
 /**
- * Constants of type <code>CONSTANT_String_info</code>.
+ * Constants of type {@code CONSTANT_String_info}.
  */
 public final class CstString
         extends TypedConstant {
-    /** non-null; the string value */
+    /** {@code non-null;} the string value */
     private final CstUtf8 string;
 
     /**
      * Constructs an instance.
      * 
-     * @param string non-null; the string value
+     * @param string {@code non-null;} the string value
      */
     public CstString(CstUtf8 string) {
         if (string == null) {
@@ -42,7 +42,7 @@ public final class CstString
     /**
      * Constructs an instance.
      * 
-     * @param string non-null; the string value
+     * @param string {@code non-null;} the string value
      */
     public CstString(String string) {
         this(new CstUtf8(string));
@@ -101,7 +101,7 @@ public final class CstString
     /**
      * Gets the string value.
      * 
-     * @return non-null; the string value
+     * @return {@code non-null;} the string value
      */
     public CstUtf8 getString() {
         return string;
index 02df28d..6dc9867 100644 (file)
@@ -24,69 +24,69 @@ import java.util.HashMap;
  * Constants that represent an arbitrary type (reference or primitive).
  */
 public final class CstType extends TypedConstant {
-    /** non-null; map of interned types */
+    /** {@code non-null;} map of interned types */
     private static final HashMap<Type, CstType> interns =
         new HashMap<Type, CstType>(100);
 
-    /** non-null; instance corresponding to the class <code>Object</code> */
+    /** {@code non-null;} instance corresponding to the class {@code Object} */
     public static final CstType OBJECT = intern(Type.OBJECT);
 
-    /** non-null; instance corresponding to the class <code>Boolean</code> */
+    /** {@code non-null;} instance corresponding to the class {@code Boolean} */
     public static final CstType BOOLEAN = intern(Type.BOOLEAN_CLASS);
 
-    /** non-null; instance corresponding to the class <code>Byte</code> */
+    /** {@code non-null;} instance corresponding to the class {@code Byte} */
     public static final CstType BYTE = intern(Type.BYTE_CLASS);
 
-    /** non-null; instance corresponding to the class <code>Character</code> */
+    /** {@code non-null;} instance corresponding to the class {@code Character} */
     public static final CstType CHARACTER = intern(Type.CHARACTER_CLASS);
 
-    /** non-null; instance corresponding to the class <code>Double</code> */
+    /** {@code non-null;} instance corresponding to the class {@code Double} */
     public static final CstType DOUBLE = intern(Type.DOUBLE_CLASS);
 
-    /** non-null; instance corresponding to the class <code>Float</code> */
+    /** {@code non-null;} instance corresponding to the class {@code Float} */
     public static final CstType FLOAT = intern(Type.FLOAT_CLASS);
 
-    /** non-null; instance corresponding to the class <code>Long</code> */
+    /** {@code non-null;} instance corresponding to the class {@code Long} */
     public static final CstType LONG = intern(Type.LONG_CLASS);
 
-    /** non-null; instance corresponding to the class <code>Integer</code> */
+    /** {@code non-null;} instance corresponding to the class {@code Integer} */
     public static final CstType INTEGER = intern(Type.INTEGER_CLASS);
 
-    /** non-null; instance corresponding to the class <code>Short</code> */
+    /** {@code non-null;} instance corresponding to the class {@code Short} */
     public static final CstType SHORT = intern(Type.SHORT_CLASS);
 
-    /** non-null; instance corresponding to the class <code>Void</code> */
+    /** {@code non-null;} instance corresponding to the class {@code Void} */
     public static final CstType VOID = intern(Type.VOID_CLASS);
 
-    /** non-null; instance corresponding to the type <code>boolean[]</code> */
+    /** {@code non-null;} instance corresponding to the type {@code boolean[]} */
     public static final CstType BOOLEAN_ARRAY = intern(Type.BOOLEAN_ARRAY);
 
-    /** non-null; instance corresponding to the type <code>byte[]</code> */
+    /** {@code non-null;} instance corresponding to the type {@code byte[]} */
     public static final CstType BYTE_ARRAY = intern(Type.BYTE_ARRAY);
 
-    /** non-null; instance corresponding to the type <code>char[]</code> */
+    /** {@code non-null;} instance corresponding to the type {@code char[]} */
     public static final CstType CHAR_ARRAY = intern(Type.CHAR_ARRAY);
 
-    /** non-null; instance corresponding to the type <code>double[]</code> */
+    /** {@code non-null;} instance corresponding to the type {@code double[]} */
     public static final CstType DOUBLE_ARRAY = intern(Type.DOUBLE_ARRAY);
 
-    /** non-null; instance corresponding to the type <code>float[]</code> */
+    /** {@code non-null;} instance corresponding to the type {@code float[]} */
     public static final CstType FLOAT_ARRAY = intern(Type.FLOAT_ARRAY);
 
-    /** non-null; instance corresponding to the type <code>long[]</code> */
+    /** {@code non-null;} instance corresponding to the type {@code long[]} */
     public static final CstType LONG_ARRAY = intern(Type.LONG_ARRAY);
 
-    /** non-null; instance corresponding to the type <code>int[]</code> */
+    /** {@code non-null;} instance corresponding to the type {@code int[]} */
     public static final CstType INT_ARRAY = intern(Type.INT_ARRAY);
 
-    /** non-null; instance corresponding to the type <code>short[]</code> */
+    /** {@code non-null;} instance corresponding to the type {@code short[]} */
     public static final CstType SHORT_ARRAY = intern(Type.SHORT_ARRAY);
 
-    /** non-null; the underlying type */
+    /** {@code non-null;} the underlying type */
     private final Type type;
 
     /**
-     * null-ok; the type descriptor corresponding to this instance, if
+     * {@code null-ok;} the type descriptor corresponding to this instance, if
      * calculated
      */
     private CstUtf8 descriptor;
@@ -95,10 +95,10 @@ public final class CstType extends TypedConstant {
      * Returns an instance of this class that represents the wrapper
      * class corresponding to a given primitive type. For example, if
      * given {@link Type#INT}, this method returns the class reference
-     * <code>java.lang.Integer</code>.
+     * {@code java.lang.Integer}.
      * 
-     * @param primitiveType non-null; the primitive type
-     * @return non-null; the corresponding wrapper class
+     * @param primitiveType {@code non-null;} the primitive type
+     * @return {@code non-null;} the corresponding wrapper class
      */
     public static CstType forBoxedPrimitiveType(Type primitiveType) {
         switch (primitiveType.getBasicType()) {
@@ -119,8 +119,8 @@ public final class CstType extends TypedConstant {
     /**
      * Returns an interned instance of this class for the given type.
      * 
-     * @param type non-null; the underlying type
-     * @return non-null; an appropriately-constructed instance
+     * @param type {@code non-null;} the underlying type
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public static CstType intern(Type type) {
         CstType cst = interns.get(type);
@@ -136,7 +136,7 @@ public final class CstType extends TypedConstant {
     /**
      * Constructs an instance.
      * 
-     * @param type non-null; the underlying type
+     * @param type {@code non-null;} the underlying type
      */
     public CstType(Type type) {
         if (type == null) {
@@ -207,9 +207,9 @@ 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</code>).
+     * {@code Class}).
      * 
-     * @return non-null; the type corresponding to the name
+     * @return {@code non-null;} the type corresponding to the name
      */
     public Type getClassType() {
         return type;
@@ -218,7 +218,7 @@ public final class CstType extends TypedConstant {
     /**
      * Gets the type descriptor for this instance.
      * 
-     * @return non-null; the descriptor
+     * @return {@code non-null;} the descriptor
      */
     public CstUtf8 getDescriptor() {
         if (descriptor == null) {
index f0ca5f5..2c7a1df 100644 (file)
@@ -20,19 +20,19 @@ import com.android.dx.util.ByteArray;
 import com.android.dx.util.Hex;
 
 /**
- * Constants of type <code>CONSTANT_Utf8_info</code>.
+ * Constants of type {@code CONSTANT_Utf8_info}.
  */
 public final class CstUtf8 extends Constant {
     /** 
-     * non-null; instance representing <code>""</code>, that is, the
+     * {@code non-null;} instance representing {@code ""}, that is, the
      * empty string 
      */
     public static final CstUtf8 EMPTY_STRING = new CstUtf8("");
     
-    /** non-null; the UTF-8 value as a string */
+    /** {@code non-null;} the UTF-8 value as a string */
     private final String string;
 
-    /** non-null; the UTF-8 value as bytes */
+    /** {@code non-null;} the UTF-8 value as bytes */
     private final ByteArray bytes;
 
     /**
@@ -40,8 +40,8 @@ public final class CstUtf8 extends Constant {
      * differs from normal UTF-8 in the handling of character '\0' and
      * surrogate pairs.
      * 
-     * @param string non-null; the string to convert
-     * @return non-null; the UTF-8 bytes for it
+     * @param string {@code non-null;} the string to convert
+     * @return {@code non-null;} the UTF-8 bytes for it
      */
     public static byte[] stringToUtf8Bytes(String string) {
         int len = string.length();
@@ -73,8 +73,8 @@ public final class CstUtf8 extends Constant {
     /**
      * Converts an array of UTF-8 bytes into a string.
      * 
-     * @param bytes non-null; the bytes to convert
-     * @return non-null; the converted string
+     * @param bytes {@code non-null;} the bytes to convert
+     * @return {@code non-null;} the converted string
      */
     public static String utf8BytesToString(ByteArray bytes) {
         int length = bytes.size();
@@ -173,9 +173,9 @@ public final class CstUtf8 extends Constant {
     }
 
     /**
-     * Constructs an instance from a <code>String</code>.
+     * Constructs an instance from a {@code String}.
      * 
-     * @param string non-null; the UTF-8 value as a string
+     * @param string {@code non-null;} the UTF-8 value as a string
      */
     public CstUtf8(String string) {
         if (string == null) {
@@ -189,7 +189,7 @@ public final class CstUtf8 extends Constant {
     /**
      * Constructs an instance from some UTF-8 bytes.
      * 
-     * @param bytes non-null; array of the UTF-8 bytes
+     * @param bytes {@code non-null;} array of the UTF-8 bytes
      */
     public CstUtf8(ByteArray bytes) {
         if (bytes == null) {
@@ -299,7 +299,7 @@ public final class CstUtf8 extends Constant {
      * Gets the value as a human-oriented string, surrounded by double
      * quotes.
      * 
-     * @return non-null; the quoted string
+     * @return {@code non-null;} the quoted string
      */
     public String toQuoted() {
         return '\"' + toHuman() + '\"';
@@ -310,8 +310,8 @@ public final class CstUtf8 extends Constant {
      * quotes, but ellipsizes the result if it is longer than the given
      * maximum length
      * 
-     * @param maxLength &gt;= 5; the maximum length of the string to return
-     * @return non-null; the quoted string
+     * @param maxLength {@code >= 5;} the maximum length of the string to return
+     * @return {@code non-null;} the quoted string
      */
     public String toQuoted(int maxLength) {
         String string = toHuman();
@@ -332,7 +332,7 @@ public final class CstUtf8 extends Constant {
      * Gets the UTF-8 value as a string.
      * The returned string is always already interned.
      * 
-     * @return non-null; the UTF-8 value as a string
+     * @return {@code non-null;} the UTF-8 value as a string
      */
     public String getString() {
         return string;
@@ -341,7 +341,7 @@ public final class CstUtf8 extends Constant {
     /**
      * Gets the UTF-8 value as UTF-8 encoded bytes.
      * 
-     * @return non-null; an array of the UTF-8 bytes
+     * @return {@code non-null;} an array of the UTF-8 bytes
      */
     public ByteArray getBytes() {
         return bytes;
@@ -351,7 +351,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 &gt;= 0; the UTF-8 size
+     * @return {@code >= 0;} the UTF-8 size
      */
     public int getUtf8Size() {
         return bytes.size();
@@ -360,10 +360,10 @@ public final class CstUtf8 extends Constant {
     /**
      * Gets the size of this instance as UTF-16 code points. That is,
      * get the number of 16-bit chars in the UTF-16 encoding of this
-     * instance. This is the same as the <code>length</code> of the
-     * Java <code>String</code> representation of this instance.
+     * instance. This is the same as the {@code length} of the
+     * Java {@code String} representation of this instance.
      * 
-     * @return &gt;= 0; the UTF-16 size
+     * @return {@code >= 0;} the UTF-16 size
      */
     public int getUtf16Size() {
         return string.length();
index 6979102..82c3ab7 100644 (file)
@@ -26,16 +26,16 @@ import com.android.dx.util.MutabilityControl;
  */
 public final class StdConstantPool
         extends MutabilityControl implements ConstantPool {
-    /** non-null; array of entries */
+    /** {@code non-null;} array of entries */
     private final Constant[] entries;
 
     /**
-     * Constructs an instance. All indices initially contain <code>null</code>.
+     * 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</code>, and is in fact
+     * class file field {@code constant_pool_count}, and is in fact
      * always at least one more than the actual size of the constant pool,
-     * as element <code>0</code> is always invalid.
+     * as element {@code 0} is always invalid.
      */
     public StdConstantPool(int size) {
         super(size > 1);
@@ -90,8 +90,8 @@ public final class StdConstantPool
     /**
      * Sets the entry at the given index.
      * 
-     * @param n &gt;= 1, &lt; size(); which entry
-     * @param cst null-ok; the constant to store
+     * @param n {@code >= 1, < size();} which entry
+     * @param cst {@code null-ok;} the constant to store
      */
     public void set(int n, Constant cst) {
         throwIfImmutable();
index 54472b0..823d9c4 100644 (file)
@@ -26,7 +26,7 @@ public abstract class TypedConstant
     /**
      * {@inheritDoc}
      * 
-     * This implentation always returns <code>this</code>.
+     * This implentation always returns {@code this}.
      */
     public final TypeBearer getFrameType() {
         return this;
index 3379b6c..8bed657 100644 (file)
@@ -30,10 +30,10 @@ public final class Zeroes {
     }
      
     /**
-     * Gets the "zero" (or <code>null</code>) value for the given type.
+     * Gets the "zero" (or {@code null}) value for the given type.
      * 
-     * @param type non-null; the type in question
-     * @return non-null; its "zero" value
+     * @param type {@code non-null;} the type in question
+     * @return {@code non-null;} its "zero" value
      */
     public static Constant zeroFor(Type type) {
         switch (type.getBasicType()) {
index 97fe9de..aaf21ee 100644 (file)
@@ -19,7 +19,7 @@ package com.android.dx.rop;
 /**
  * <h1>An Introduction to Rop Form</h1>
  *
- * This package contains classes associated with dx's <code>Rop</code>
+ * This package contains classes associated with dx's {@code Rop}
  * intermediate form.<p>
  *
  * The Rop form is intended to represent the instructions and the control-flow
@@ -33,16 +33,16 @@ package com.android.dx.rop;
  * <li> {@link BasicBlock} and its per-method container, {@link BasicBlockList},
  * the representation of control flow elements.
  * <li> {@link Insn} and its subclasses along with its per-basic block
- * container {@link InsnList}. <code>Insn</code> instances represent
+ * container {@link InsnList}. {@code Insn} instances represent
  * individual instructions in the abstract register machine.
  * <li> {@link RegisterSpec} and its container {@link RegisterSpecList}. A
  * register spec encodes register number, register width, type information,
  * and potentially local variable information as well for instruction sources
  * and results.
  * <li> {@link Rop} instances represent opcodes in the abstract machine. Many
- * <code>Rop</code> instances are singletons defined in static fields in
+ * {@code Rop} instances are singletons defined in static fields in
  * {@link Rops}. The rest are constructed dynamically using static methods
- * in <code>Rops</code>
+ * in {@code Rops}
  * <li> {@link RegOps} lists numeric constants for the opcodes
  * <li> {@link Constant} and its subclasses represent constant data values
  * that opcodes may refer to.
@@ -62,8 +62,8 @@ package com.android.dx.rop;
  * bytecode. Blocks that don't originate directly from source bytecode have
  * labels generated for them in a mostly arbitrary order.<p>
  *
- * Blocks are referred to by their label, for the most part, because <code>
- * BasicBlock</code> instances are immutable and thus any modification to
+ * Blocks are referred to by their label, for the most part, because
+ * {@code BasicBlock} instances are immutable and thus any modification to
  * the control flow graph or the instruction list results in replacement
  * instances (with identical labels) being created.<p>
  *
@@ -105,7 +105,7 @@ package com.android.dx.rop;
  * instruction where a catch block exists inside the current method for that
  * exception class. Since the only possible path is the exception path, only
  * the exception path (which cannot be a primary successor) is a successor.
- * An example of this is shown in <code>dx/tests/092-ssa-cfg-edge-cases</code>.
+ * An example of this is shown in {@code dx/tests/092-ssa-cfg-edge-cases}.
  *
  * <h2>Rop Instructions</h2>
  *
@@ -123,18 +123,18 @@ package com.android.dx.rop;
  * Rops#MOVE_RESULT move-result} or {@link Rops#MOVE_RESULT_PSEUDO
  * move-result-pseudo} instructions at the top of the primary successor block.
  *
- * Only a single <code>move-result</code> or <code>move-result-pseudo</code>
+ * Only a single {@code move-result} or {@code move-result-pseudo}
  * may exist in any block and it must be exactly the first instruction in the
  * block.
  *
- * A <code>move-result</code> instruction is used for the results of call-like
- * instructions. If the value produced by a <code>move-result</code> is not
+ * A {@code move-result} instruction is used for the results of call-like
+ * instructions. If the value produced by a {@code move-result} is not
  * used by the method, it may be eliminated as dead code.
  *
- * A <code>move-result-pseudo</code> instruction is used for the results of
+ * A {@code move-result-pseudo} instruction is used for the results of
  * non-call-like throwing instructions. It may never be considered dead code
  * since the final dex instruction will always indicate a result register.
- * If a required <code>move-result-pseudo</code> instruction is not found
+ * If a required {@code move-result-pseudo} instruction is not found
  * during conversion to dex bytecode, an exception will be thrown.
  *
  * <h3>move-exception</h3>
@@ -148,25 +148,25 @@ package com.android.dx.rop;
  * <h3>move-param</h3>
  *
  * A {@link RegOps.MOVE_PARAM move-param} instruction represents a method
- * parameter. Every <code>move-param</code> instruction is a
+ * parameter. Every {@code move-param} instruction is a
  * {@link PlainCstInsn}. The index of the method parameter they refer to is
  * carried as the {@link CstInteger integer constant} associated with the
  * instruction.
  *
- * Any number of <code>move-param</code> instructions referring to the same
+ * Any number of {@code move-param} instructions referring to the same
  * parameter index may be included in a method's instruction lists. They
  * have no restrictions on placement beyond those of any other
  * {@link Rop.BRANCH_NONE} instruction. Note that the SSA optimizer arranges the
  * parameter assignments to align with the dex bytecode calling conventions.
  * With parameter assignments so arranged, the
- * {@link com.android.dx.dex.code.RopTranslator} sees Rop <code>move-param</code>
+ * {@link com.android.dx.dex.code.RopTranslator} sees Rop {@code move-param}
  * instructions as unnecessary in dex form and eliminates them.
  *
  * <h3>mark-local</h3>
  *
  * A {@link RegOps.MARK_LOCAL mark-local} instruction indicates that a local
  * variable becomes live in a specified register specified register for the
- * purposes of debug information. A <code>mark-local</code> instruction has
+ * purposes of debug information. A {@code mark-local} instruction has
  * a single source (the register which will now be considered a local variable)
  * and no results. The instruction has no side effect.<p>
  *
@@ -179,23 +179,22 @@ package com.android.dx.rop;
  * an assignment occurring. A common example of this is occurs in the Rop
  * representation of the following code:<p>
  *
- * <code>
+ * <pre>
  * try {
  *     Object foo = null;
  *     foo = new Object();
- * } catch (Throwable ex) {
- * }
- * </code>
- *
- * An object's initialization occurs in two steps. First, a <code>new-instance
- * </code> instruction is executed, whose result is stored in a register.
- * However, that register can not yet be considered to contain "foo". That's
- * because the instance's constructor method must be called via an
- * <code>invoke</code> instruction. The constructor method, however, may
+ * } catch (Throwable ex) { }
+ * </pre>
+ *
+ * An object's initialization occurs in two steps. First, a
+ * {@code new-instance} instruction is executed, whose result is stored in a
+ * register. However, that register can not yet be considered to contain
+ * "foo". That's because the instance's constructor method must be called
+ * via an {@code invoke} instruction. The constructor method, however, may
  * throw an exception. And if an exception occurs, then "foo" should remain
- * null. So "foo" becomes the value of the result of the <code>new-instance
- * </code> instruction after the (void) constructor method is invoked and
- * returns successfully. In such a case, a <code>mark-local</code> will
+ * null. So "foo" becomes the value of the result of the {@code new-instance}
+ * instruction after the (void) constructor method is invoked and
+ * returns successfully. In such a case, a {@code mark-local} will
  * typically occur at the beginning of the primary successor block following
  * the invocation to the constructor.
  */
index a6ee742..7e6ab59 100644 (file)
@@ -21,23 +21,23 @@ import java.util.HashMap;
 /**
  * Representation of a method decriptor. Instances of this class are
  * generally interned and may be usefully compared with each other
- * using <code>==</code>.
+ * using {@code ==}.
  */
 public final class Prototype implements Comparable<Prototype> {
-    /** non-null; intern table mapping string descriptors to instances */
+    /** {@code non-null;} intern table mapping string descriptors to instances */
     private static final HashMap<String, Prototype> internTable =
         new HashMap<String, Prototype>(500);
 
-    /** non-null; method descriptor */
+    /** {@code non-null;} method descriptor */
     private final String descriptor;
 
-    /** non-null; return type */
+    /** {@code non-null;} return type */
     private final Type returnType;
 
-    /** non-null; list of parameter types */
+    /** {@code non-null;} list of parameter types */
     private final StdTypeList parameterTypes;
 
-    /** null-ok; list of parameter frame types, if calculated */
+    /** {@code null-ok;} list of parameter frame types, if calculated */
     private StdTypeList parameterFrameTypes;
 
     /**
@@ -45,8 +45,8 @@ public final class Prototype implements Comparable<Prototype> {
      * given method descriptor. See vmspec-2 sec4.3.3 for details on the
      * field descriptor syntax.
      * 
-     * @param descriptor non-null; the descriptor
-     * @return non-null; the corresponding instance
+     * @param descriptor {@code non-null;} the descriptor
+     * @return {@code non-null;} the corresponding instance
      * @throws IllegalArgumentException thrown if the descriptor has
      * invalid syntax
      */
@@ -111,8 +111,8 @@ public final class Prototype implements Comparable<Prototype> {
      * that there is a '(' at the start of the descriptor and a
      * single ')' somewhere before the end.
      * 
-     * @param descriptor non-null; the descriptor string
-     * @return non-null; array large enough to hold all parsed parameter
+     * @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
      */
     private static Type[] makeParameterArray(String descriptor) {
@@ -153,14 +153,14 @@ public final class Prototype implements Comparable<Prototype> {
     /**
      * Interns an instance, adding to the descriptor as necessary based
      * on the given definer, name, and flags. For example, an init
-     * method has an uninitialized object of type <code>definer</code>
+     * method has an uninitialized object of type {@code definer}
      * as its first argument.
      * 
-     * @param descriptor non-null; the descriptor string
-     * @param definer non-null; class the method is defined on
+     * @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
      * @param isInit whether this is an init method
-     * @return non-null; the interned instance
+     * @return {@code non-null;} the interned instance
      */
     public static Prototype intern(String descriptor, Type definer,
             boolean isStatic, boolean isInit) {
@@ -179,11 +179,11 @@ public final class Prototype implements Comparable<Prototype> {
 
     /**
      * Interns an instance which consists of the given number of
-     * <code>int</code>s along with the given return type
+     * {@code int}s along with the given return type
      * 
-     * @param returnType non-null; the return type
-     * @param count &gt; 0; the number of elements in the prototype
-     * @return non-null; the interned instance
+     * @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
      */
     public static Prototype internInts(Type returnType, int count) {
         // Make the descriptor...
@@ -207,7 +207,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 non-null; the descriptor string
+     * @param descriptor {@code non-null;} the descriptor string
      */
     private Prototype(String descriptor, Type returnType,
             StdTypeList parameterTypes) {
@@ -304,7 +304,7 @@ public final class Prototype implements Comparable<Prototype> {
     /**
      * Gets the descriptor string.
      * 
-     * @return non-null; the descriptor
+     * @return {@code non-null;} the descriptor
      */
     public String getDescriptor() {
         return descriptor;
@@ -313,7 +313,7 @@ public final class Prototype implements Comparable<Prototype> {
     /**
      * Gets the return type.
      * 
-     * @return non-null; the return type
+     * @return {@code non-null;} the return type
      */
     public Type getReturnType() {
         return returnType;
@@ -322,7 +322,7 @@ public final class Prototype implements Comparable<Prototype> {
     /**
      * Gets the list of parameter types.
      * 
-     * @return non-null; the list of parameter types
+     * @return {@code non-null;} the list of parameter types
      */
     public StdTypeList getParameterTypes() {
         return parameterTypes;
@@ -334,7 +334,7 @@ public final class Prototype implements Comparable<Prototype> {
      * "intlike" types (see {@link Type#isIntlike}) are replaced by
      * {@link Type#INT}.
      * 
-     * @return non-null; the list of parameter frame types
+     * @return {@code non-null;} the list of parameter frame types
      */
     public StdTypeList getParameterFrameTypes() {
         if (parameterFrameTypes == null) {
@@ -360,8 +360,8 @@ public final class Prototype implements Comparable<Prototype> {
      * except that it has an additional parameter prepended to the original's
      * argument list.
      * 
-     * @param param non-null; the new first parameter
-     * @return non-null; an appropriately-constructed instance
+     * @param param {@code non-null;} the new first parameter
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public Prototype withFirstParameter(Type param) {
         String newDesc = "(" + param.getDescriptor() + descriptor.substring(1);
@@ -380,8 +380,8 @@ public final class Prototype implements Comparable<Prototype> {
      * there. If a conflicting value is already in the table, then leave it.
      * Return the interned value.
      * 
-     * @param desc non-null; instance to make interned
-     * @return non-null; the actual interned object
+     * @param desc {@code non-null;} instance to make interned
+     * @return {@code non-null;} the actual interned object
      */
     private static Prototype putIntern(Prototype desc) {
         synchronized (internTable) {
index a4c2d44..a023812 100644 (file)
@@ -23,149 +23,149 @@ import com.android.dx.util.FixedSizeList;
  */
 public final class StdTypeList
         extends FixedSizeList implements TypeList {
-    /** non-null; no-element instance */
+    /** {@code non-null;} no-element instance */
     public static final StdTypeList EMPTY = new StdTypeList(0);
 
-    /** non-null; the list <code>[int]</code> */
+    /** {@code non-null;} the list {@code [int]} */
     public static final StdTypeList INT = StdTypeList.make(Type.INT);
 
-    /** non-null; the list <code>[long]</code> */
+    /** {@code non-null;} the list {@code [long]} */
     public static final StdTypeList LONG = StdTypeList.make(Type.LONG);
 
-    /** non-null; the list <code>[float]</code> */
+    /** {@code non-null;} the list {@code [float]} */
     public static final StdTypeList FLOAT = StdTypeList.make(Type.FLOAT);
 
-    /** non-null; the list <code>[double]</code> */
+    /** {@code non-null;} the list {@code [double]} */
     public static final StdTypeList DOUBLE = StdTypeList.make(Type.DOUBLE);
 
-    /** non-null; the list <code>[Object]</code> */
+    /** {@code non-null;} the list {@code [Object]} */
     public static final StdTypeList OBJECT = StdTypeList.make(Type.OBJECT);
 
-    /** non-null; the list <code>[ReturnAddress]</code> */
+    /** {@code non-null;} the list {@code [ReturnAddress]} */
     public static final StdTypeList RETURN_ADDRESS
             = StdTypeList.make(Type.RETURN_ADDRESS);
 
-    /** non-null; the list <code>[Throwable]</code> */
+    /** {@code non-null;} the list {@code [Throwable]} */
     public static final StdTypeList THROWABLE =
         StdTypeList.make(Type.THROWABLE);
 
-    /** non-null; the list <code>[int, int]</code> */
+    /** {@code non-null;} the list {@code [int, int]} */
     public static final StdTypeList INT_INT =
         StdTypeList.make(Type.INT, Type.INT);
 
-    /** non-null; the list <code>[long, long]</code> */
+    /** {@code non-null;} the list {@code [long, long]} */
     public static final StdTypeList LONG_LONG =
         StdTypeList.make(Type.LONG, Type.LONG);
 
-    /** non-null; the list <code>[float, float]</code> */
+    /** {@code non-null;} the list {@code [float, float]} */
     public static final StdTypeList FLOAT_FLOAT =
         StdTypeList.make(Type.FLOAT, Type.FLOAT);
 
-    /** non-null; the list <code>[double, double]</code> */
+    /** {@code non-null;} the list {@code [double, double]} */
     public static final StdTypeList DOUBLE_DOUBLE =
         StdTypeList.make(Type.DOUBLE, Type.DOUBLE);
 
-    /** non-null; the list <code>[Object, Object]</code> */
+    /** {@code non-null;} the list {@code [Object, Object]} */
     public static final StdTypeList OBJECT_OBJECT =
         StdTypeList.make(Type.OBJECT, Type.OBJECT);
 
-    /** non-null; the list <code>[int, Object]</code> */
+    /** {@code non-null;} the list {@code [int, Object]} */
     public static final StdTypeList INT_OBJECT =
         StdTypeList.make(Type.INT, Type.OBJECT);
 
-    /** non-null; the list <code>[long, Object]</code> */
+    /** {@code non-null;} the list {@code [long, Object]} */
     public static final StdTypeList LONG_OBJECT =
         StdTypeList.make(Type.LONG, Type.OBJECT);
 
-    /** non-null; the list <code>[float, Object]</code> */
+    /** {@code non-null;} the list {@code [float, Object]} */
     public static final StdTypeList FLOAT_OBJECT =
         StdTypeList.make(Type.FLOAT, Type.OBJECT);
 
-    /** non-null; the list <code>[double, Object]</code> */
+    /** {@code non-null;} the list {@code [double, Object]} */
     public static final StdTypeList DOUBLE_OBJECT =
         StdTypeList.make(Type.DOUBLE, Type.OBJECT);
 
-    /** non-null; the list <code>[long, int]</code> */
+    /** {@code non-null;} the list {@code [long, int]} */
     public static final StdTypeList LONG_INT =
         StdTypeList.make(Type.LONG, Type.INT);
 
-    /** non-null; the list <code>[int[], int]</code> */
+    /** {@code non-null;} the list {@code [int[], int]} */
     public static final StdTypeList INTARR_INT =
         StdTypeList.make(Type.INT_ARRAY, Type.INT);
 
-    /** non-null; the list <code>[long[], int]</code> */
+    /** {@code non-null;} the list {@code [long[], int]} */
     public static final StdTypeList LONGARR_INT =
         StdTypeList.make(Type.LONG_ARRAY, Type.INT);
 
-    /** non-null; the list <code>[float[], int]</code> */
+    /** {@code non-null;} the list {@code [float[], int]} */
     public static final StdTypeList FLOATARR_INT =
         StdTypeList.make(Type.FLOAT_ARRAY, Type.INT);
 
-    /** non-null; the list <code>[double[], int]</code> */
+    /** {@code non-null;} the list {@code [double[], int]} */
     public static final StdTypeList DOUBLEARR_INT =
         StdTypeList.make(Type.DOUBLE_ARRAY, Type.INT);
 
-    /** non-null; the list <code>[Object[], int]</code> */
+    /** {@code non-null;} the list {@code [Object[], int]} */
     public static final StdTypeList OBJECTARR_INT =
         StdTypeList.make(Type.OBJECT_ARRAY, Type.INT);
 
-    /** non-null; the list <code>[boolean[], int]</code> */
+    /** {@code non-null;} the list {@code [boolean[], int]} */
     public static final StdTypeList BOOLEANARR_INT =
         StdTypeList.make(Type.BOOLEAN_ARRAY, Type.INT);
 
-    /** non-null; the list <code>[byte[], int]</code> */
+    /** {@code non-null;} the list {@code [byte[], int]} */
     public static final StdTypeList BYTEARR_INT =
         StdTypeList.make(Type.BYTE_ARRAY, Type.INT);
 
-    /** non-null; the list <code>[char[], int]</code> */
+    /** {@code non-null;} the list {@code [char[], int]} */
     public static final StdTypeList CHARARR_INT =
         StdTypeList.make(Type.CHAR_ARRAY, Type.INT);
 
-    /** non-null; the list <code>[short[], int]</code> */
+    /** {@code non-null;} the list {@code [short[], int]} */
     public static final StdTypeList SHORTARR_INT =
         StdTypeList.make(Type.SHORT_ARRAY, Type.INT);
 
-    /** non-null; the list <code>[int, int[], int]</code> */
+    /** {@code non-null;} the list {@code [int, int[], int]} */
     public static final StdTypeList INT_INTARR_INT =
         StdTypeList.make(Type.INT, Type.INT_ARRAY, Type.INT);
 
-    /** non-null; the list <code>[long, long[], int]</code> */
+    /** {@code non-null;} the list {@code [long, long[], int]} */
     public static final StdTypeList LONG_LONGARR_INT =
         StdTypeList.make(Type.LONG, Type.LONG_ARRAY, Type.INT);
 
-    /** non-null; the list <code>[float, float[], int]</code> */
+    /** {@code non-null;} the list {@code [float, float[], int]} */
     public static final StdTypeList FLOAT_FLOATARR_INT =
         StdTypeList.make(Type.FLOAT, Type.FLOAT_ARRAY, Type.INT);
 
-    /** non-null; the list <code>[double, double[], int]</code> */
+    /** {@code non-null;} the list {@code [double, double[], int]} */
     public static final StdTypeList DOUBLE_DOUBLEARR_INT =
         StdTypeList.make(Type.DOUBLE, Type.DOUBLE_ARRAY, Type.INT);
 
-    /** non-null; the list <code>[Object, Object[], int]</code> */
+    /** {@code non-null;} the list {@code [Object, Object[], int]} */
     public static final StdTypeList OBJECT_OBJECTARR_INT =
         StdTypeList.make(Type.OBJECT, Type.OBJECT_ARRAY, Type.INT);
 
-    /** non-null; the list <code>[int, boolean[], int]</code> */
+    /** {@code non-null;} the list {@code [int, boolean[], int]} */
     public static final StdTypeList INT_BOOLEANARR_INT =
         StdTypeList.make(Type.INT, Type.BOOLEAN_ARRAY, Type.INT);
 
-    /** non-null; the list <code>[int, byte[], int]</code> */
+    /** {@code non-null;} the list {@code [int, byte[], int]} */
     public static final StdTypeList INT_BYTEARR_INT =
         StdTypeList.make(Type.INT, Type.BYTE_ARRAY, Type.INT);
 
-    /** non-null; the list <code>[int, char[], int]</code> */
+    /** {@code non-null;} the list {@code [int, char[], int]} */
     public static final StdTypeList INT_CHARARR_INT =
         StdTypeList.make(Type.INT, Type.CHAR_ARRAY, Type.INT);
 
-    /** non-null; the list <code>[int, short[], int]</code> */
+    /** {@code non-null;} the list {@code [int, short[], int]} */
     public static final StdTypeList INT_SHORTARR_INT =
         StdTypeList.make(Type.INT, Type.SHORT_ARRAY, Type.INT);
 
     /**
      * Makes a single-element instance.
      * 
-     * @param type non-null; the element
-     * @return non-null; an appropriately-constructed instance
+     * @param type {@code non-null;} the element
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public static StdTypeList make(Type type) {
         StdTypeList result = new StdTypeList(1);
@@ -176,9 +176,9 @@ public final class StdTypeList
     /**
      * Makes a two-element instance.
      * 
-     * @param type0 non-null; the first element
-     * @param type1 non-null; the second element
-     * @return non-null; an appropriately-constructed 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
      */
     public static StdTypeList make(Type type0, Type type1) {
         StdTypeList result = new StdTypeList(2);
@@ -190,10 +190,10 @@ public final class StdTypeList
     /**
      * Makes a three-element instance.
      * 
-     * @param type0 non-null; the first element
-     * @param type1 non-null; the second element
-     * @param type2 non-null; the third element
-     * @return non-null; an appropriately-constructed 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
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public static StdTypeList make(Type type0, Type type1, Type type2) {
         StdTypeList result = new StdTypeList(3);
@@ -206,11 +206,11 @@ public final class StdTypeList
     /**
      * Makes a four-element instance.
      * 
-     * @param type0 non-null; the first element
-     * @param type1 non-null; the second element
-     * @param type2 non-null; the third element
-     * @param type3 non-null; the fourth element
-     * @return non-null; an appropriately-constructed 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
+     * @param type3 {@code non-null;} the fourth element
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public static StdTypeList make(Type type0, Type type1, Type type2,
                                    Type type3) {
@@ -227,8 +227,8 @@ public final class StdTypeList
      * is a static method so as to work on arbitrary {@link TypeList}
      * instances.
      * 
-     * @param list non-null; the list to convert
-     * @return non-null; the human form
+     * @param list {@code non-null;} the list to convert
+     * @return {@code non-null;} the human form
      */
     public static String toHuman(TypeList list) {
         int size = list.size();
@@ -254,8 +254,8 @@ public final class StdTypeList
      * is a static method so as to work on arbitrary {@link TypeList}
      * instances.
      * 
-     * @param list non-null; the list to inspect
-     * @return non-null; the hash code
+     * @param list {@code non-null;} the list to inspect
+     * @return {@code non-null;} the hash code
      */
     public static int hashContents(TypeList list) {
         int size = list.size();
@@ -273,8 +273,8 @@ public final class StdTypeList
      * is a static method so as to work on arbitrary {@link TypeList}
      * instances.
      * 
-     * @param list1 non-null; one list to compare
-     * @param list2 non-null; another list to compare
+     * @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
      */
     public static boolean equalContents(TypeList list1, TypeList list2) {
@@ -298,8 +298,8 @@ public final class StdTypeList
      * is a static method so as to work on arbitrary {@link TypeList}
      * instances.
      * 
-     * @param list1 non-null; one list to compare
-     * @param list2 non-null; another list to compare
+     * @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
      */
     public static int compareContents(TypeList list1, TypeList list2) {
@@ -324,7 +324,7 @@ public final class StdTypeList
     }
     
     /**
-     * Constructs an instance. All indices initially contain <code>null</code>.
+     * Constructs an instance. All indices initially contain {@code null}.
      * 
      * @param size the size of the list
      */
@@ -366,10 +366,10 @@ 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</code>.
+     * will throw {@code NullPointerException}.
      * 
-     * @param n &gt;= 0, &lt; size(); which element
-     * @return non-null; the indicated element
+     * @param n {@code >= 0, < size();} which element
+     * @return {@code non-null;} the indicated element
      */
     public Type get(int n) {
         return (Type) get0(n);
@@ -378,8 +378,8 @@ public final class StdTypeList
     /**
      * Sets the type at the given index.
      * 
-     * @param n &gt;= 0, &lt; size(); which element
-     * @param type non-null; the type to store
+     * @param n {@code >= 0, < size();} which element
+     * @param type {@code non-null;} the type to store
      */
     public void set(int n, Type type) {
         set0(n, type);
@@ -390,8 +390,8 @@ public final class StdTypeList
      * except that it has an additional type prepended to the
      * original.
      * 
-     * @param type non-null; the new first element
-     * @return non-null; an appropriately-constructed instance
+     * @param type {@code non-null;} the new first element
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public StdTypeList withFirst(Type type) {
         int sz = size();
index 09ea2e2..64c3c30 100644 (file)
@@ -24,41 +24,41 @@ import java.util.HashMap;
  * Representation of a value type, such as may appear in a field, in a
  * local, on a stack, or in a method descriptor. Instances of this
  * class are generally interned and may be usefully compared with each
- * other using <code>==</code>.
+ * other using {@code ==}.
  */
 public final class Type implements TypeBearer, Comparable<Type> {
-    /** non-null; intern table mapping string descriptors to instances */
+    /** {@code non-null;} intern table mapping string descriptors to instances */
     private static final HashMap<String, Type> internTable = 
         new HashMap<String, Type>(500);
 
-    /** basic type constant for <code>void</code> */
+    /** basic type constant for {@code void} */
     public static final int BT_VOID = 0;
 
-    /** basic type constant for <code>boolean</code> */
+    /** basic type constant for {@code boolean} */
     public static final int BT_BOOLEAN = 1;
 
-    /** basic type constant for <code>byte</code> */
+    /** basic type constant for {@code byte} */
     public static final int BT_BYTE = 2;
 
-    /** basic type constant for <code>char</code> */
+    /** basic type constant for {@code char} */
     public static final int BT_CHAR = 3;
 
-    /** basic type constant for <code>double</code> */
+    /** basic type constant for {@code double} */
     public static final int BT_DOUBLE = 4;
 
-    /** basic type constant for <code>float</code> */
+    /** basic type constant for {@code float} */
     public static final int BT_FLOAT = 5;
 
-    /** basic type constant for <code>int</code> */
+    /** basic type constant for {@code int} */
     public static final int BT_INT = 6;
 
-    /** basic type constant for <code>long</code> */
+    /** basic type constant for {@code long} */
     public static final int BT_LONG = 7;
 
-    /** basic type constant for <code>short</code> */
+    /** basic type constant for {@code short} */
     public static final int BT_SHORT = 8;
 
-    /** basic type constant for <code>Object</code> */
+    /** basic type constant for {@code Object} */
     public static final int BT_OBJECT = 9;
 
     /** basic type constant for a return address */
@@ -67,37 +67,37 @@ public final class Type implements TypeBearer, Comparable<Type> {
     /** count of basic type constants */
     public static final int BT_COUNT = 11;
 
-    /** non-null; instance representing <code>boolean</code> */
+    /** {@code non-null;} instance representing {@code boolean} */
     public static final Type BOOLEAN = new Type("Z", BT_BOOLEAN);
 
-    /** non-null; instance representing <code>byte</code> */
+    /** {@code non-null;} instance representing {@code byte} */
     public static final Type BYTE = new Type("B", BT_BYTE);
 
-    /** non-null; instance representing <code>char</code> */
+    /** {@code non-null;} instance representing {@code char} */
     public static final Type CHAR = new Type("C", BT_CHAR);
 
-    /** non-null; instance representing <code>double</code> */
+    /** {@code non-null;} instance representing {@code double} */
     public static final Type DOUBLE = new Type("D", BT_DOUBLE);
 
-    /** non-null; instance representing <code>float</code> */
+    /** {@code non-null;} instance representing {@code float} */
     public static final Type FLOAT = new Type("F", BT_FLOAT);
 
-    /** non-null; instance representing <code>int</code> */
+    /** {@code non-null;} instance representing {@code int} */
     public static final Type INT = new Type("I", BT_INT);
 
-    /** non-null; instance representing <code>long</code> */
+    /** {@code non-null;} instance representing {@code long} */
     public static final Type LONG = new Type("J", BT_LONG);
 
-    /** non-null; instance representing <code>short</code> */
+    /** {@code non-null;} instance representing {@code short} */
     public static final Type SHORT = new Type("S", BT_SHORT);
 
-    /** non-null; instance representing <code>void</code> */
+    /** {@code non-null;} instance representing {@code void} */
     public static final Type VOID = new Type("V", BT_VOID);
 
-    /** non-null; instance representing a known-<code>null</code> */
+    /** {@code non-null;} instance representing a known-{@code null} */
     public static final Type KNOWN_NULL = new Type("<null>", BT_OBJECT);
 
-    /** non-null; instance representing a subroutine return address */
+    /** {@code non-null;} instance representing a subroutine return address */
     public static final Type RETURN_ADDRESS = new Type("<addr>", BT_ADDR);
 
     static {
@@ -120,158 +120,158 @@ public final class Type implements TypeBearer, Comparable<Type> {
     }
 
     /**
-     * non-null; instance representing
-     * <code>java.lang.annotation.Annotation</code>
+     * {@code non-null;} instance representing
+     * {@code java.lang.annotation.Annotation}
      */
     public static final Type ANNOTATION =
         intern("Ljava/lang/annotation/Annotation;");
 
-    /** non-null; instance representing <code>java.lang.Class</code> */
+    /** {@code non-null;} instance representing {@code java.lang.Class} */
     public static final Type CLASS = intern("Ljava/lang/Class;");
 
-    /** non-null; instance representing <code>java.lang.Cloneable</code> */
+    /** {@code non-null;} instance representing {@code java.lang.Cloneable} */
     public static final Type CLONEABLE = intern("Ljava/lang/Cloneable;");
 
-    /** non-null; instance representing <code>java.lang.Object</code> */
+    /** {@code non-null;} instance representing {@code java.lang.Object} */
     public static final Type OBJECT = intern("Ljava/lang/Object;");
 
-    /** non-null; instance representing <code>java.io.Serializable</code> */
+    /** {@code non-null;} instance representing {@code java.io.Serializable} */
     public static final Type SERIALIZABLE = intern("Ljava/io/Serializable;");
 
-    /** non-null; instance representing <code>java.lang.String</code> */
+    /** {@code non-null;} instance representing {@code java.lang.String} */
     public static final Type STRING = intern("Ljava/lang/String;");
 
-    /** non-null; instance representing <code>java.lang.Throwable</code> */
+    /** {@code non-null;} instance representing {@code java.lang.Throwable} */
     public static final Type THROWABLE = intern("Ljava/lang/Throwable;");
 
     /**
-     * non-null; instance representing <code>java.lang.Boolean</code>; the
+     * {@code non-null;} instance representing {@code java.lang.Boolean}; the
      * suffix on the name helps disambiguate this from the instance
      * representing a primitive type 
      */
     public static final Type BOOLEAN_CLASS = intern("Ljava/lang/Boolean;");
 
     /**
-     * non-null; instance representing <code>java.lang.Byte</code>; the
+     * {@code non-null;} instance representing {@code java.lang.Byte}; the
      * suffix on the name helps disambiguate this from the instance
      * representing a primitive type 
      */
     public static final Type BYTE_CLASS = intern("Ljava/lang/Byte;");
 
     /**
-     * non-null; instance representing <code>java.lang.Character</code>; the
+     * {@code non-null;} instance representing {@code java.lang.Character}; the
      * suffix on the name helps disambiguate this from the instance
      * representing a primitive type 
      */
     public static final Type CHARACTER_CLASS = intern("Ljava/lang/Character;");
 
     /**
-     * non-null; instance representing <code>java.lang.Double</code>; the
+     * {@code non-null;} instance representing {@code java.lang.Double}; the
      * suffix on the name helps disambiguate this from the instance
      * representing a primitive type 
      */
     public static final Type DOUBLE_CLASS = intern("Ljava/lang/Double;");
 
     /**
-     * non-null; instance representing <code>java.lang.Float</code>; the
+     * {@code non-null;} instance representing {@code java.lang.Float}; the
      * suffix on the name helps disambiguate this from the instance
      * representing a primitive type 
      */
     public static final Type FLOAT_CLASS = intern("Ljava/lang/Float;");
 
     /**
-     * non-null; instance representing <code>java.lang.Integer</code>; the
+     * {@code non-null;} instance representing {@code java.lang.Integer}; the
      * suffix on the name helps disambiguate this from the instance
      * representing a primitive type 
      */
     public static final Type INTEGER_CLASS = intern("Ljava/lang/Integer;");
 
     /**
-     * non-null; instance representing <code>java.lang.Long</code>; the
+     * {@code non-null;} instance representing {@code java.lang.Long}; the
      * suffix on the name helps disambiguate this from the instance
      * representing a primitive type 
      */
     public static final Type LONG_CLASS = intern("Ljava/lang/Long;");
 
     /**
-     * non-null; instance representing <code>java.lang.Short</code>; the
+     * {@code non-null;} instance representing {@code java.lang.Short}; the
      * suffix on the name helps disambiguate this from the instance
      * representing a primitive type 
      */
     public static final Type SHORT_CLASS = intern("Ljava/lang/Short;");
 
     /**
-     * non-null; instance representing <code>java.lang.Void</code>; the
+     * {@code non-null;} instance representing {@code java.lang.Void}; the
      * suffix on the name helps disambiguate this from the instance
      * representing a primitive type 
      */
     public static final Type VOID_CLASS = intern("Ljava/lang/Void;");
 
-    /** non-null; instance representing <code>boolean[]</code> */
+    /** {@code non-null;} instance representing {@code boolean[]} */
     public static final Type BOOLEAN_ARRAY = BOOLEAN.getArrayType();
 
-    /** non-null; instance representing <code>byte[]</code> */
+    /** {@code non-null;} instance representing {@code byte[]} */
     public static final Type BYTE_ARRAY = BYTE.getArrayType();
 
-    /** non-null; instance representing <code>char[]</code> */
+    /** {@code non-null;} instance representing {@code char[]} */
     public static final Type CHAR_ARRAY = CHAR.getArrayType();
 
-    /** non-null; instance representing <code>double[]</code> */
+    /** {@code non-null;} instance representing {@code double[]} */
     public static final Type DOUBLE_ARRAY = DOUBLE.getArrayType();
 
-    /** non-null; instance representing <code>float[]</code> */
+    /** {@code non-null;} instance representing {@code float[]} */
     public static final Type FLOAT_ARRAY = FLOAT.getArrayType();
 
-    /** non-null; instance representing <code>int[]</code> */
+    /** {@code non-null;} instance representing {@code int[]} */
     public static final Type INT_ARRAY = INT.getArrayType();
 
-    /** non-null; instance representing <code>long[]</code> */
+    /** {@code non-null;} instance representing {@code long[]} */
     public static final Type LONG_ARRAY = LONG.getArrayType();
 
-    /** non-null; instance representing <code>Object[]</code> */
+    /** {@code non-null;} instance representing {@code Object[]} */
     public static final Type OBJECT_ARRAY = OBJECT.getArrayType();
 
-    /** non-null; instance representing <code>short[]</code> */
+    /** {@code non-null;} instance representing {@code short[]} */
     public static final Type SHORT_ARRAY = SHORT.getArrayType();
 
-    /** non-null; field descriptor for the type */
+    /** {@code non-null;} field descriptor for the type */
     private final String descriptor;
 
     /**
      * basic type corresponding to this type; one of the
-     * <code>BT_*</code> constants 
+     * {@code BT_*} constants 
      */
     private final int basicType;
 
     /**
-     * &gt;= -1; for an uninitialized type, bytecode index that this
-     * instance was allocated at; <code>Integer.MAX_VALUE</code> if it
-     * was an incoming uninitialized instance; <code>-1</code> if this
+     * {@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 
      */
     private final int newAt;
 
     /**
-     * null-ok; the internal-form class name corresponding to this type, if
-     * calculated; only valid if <code>this</code> is a reference type and
+     * {@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 
      */
     private String className;
 
     /**
-     * null-ok; the type corresponding to an array of this type, if
+     * {@code null-ok;} the type corresponding to an array of this type, if
      * calculated 
      */
     private Type arrayType;
 
     /**
-     * null-ok; the type corresponding to elements of this type, if
-     * calculated; only valid if <code>this</code> is an array type 
+     * {@code null-ok;} the type corresponding to elements of this type, if
+     * calculated; only valid if {@code this} is an array type 
      */
     private Type componentType;
 
     /**
-     * null-ok; the type corresponding to the initialized version of
+     * {@code null-ok;} the type corresponding to the initialized version of
      * this type, if this instance is in fact an uninitialized type 
      */
     private Type initializedType;
@@ -280,11 +280,11 @@ public final class Type implements TypeBearer, Comparable<Type> {
      * Returns the unique instance corresponding to the type with the
      * given descriptor. See vmspec-2 sec4.3.2 for details on the
      * field descriptor syntax. This method does <i>not</i> allow
-     * <code>"V"</code> (that is, type <code>void</code>) as a valid
+     * {@code "V"} (that is, type {@code void}) as a valid
      * descriptor.
      * 
-     * @param descriptor non-null; the descriptor
-     * @return non-null; the corresponding instance
+     * @param descriptor {@code non-null;} the descriptor
+     * @return {@code non-null;} the corresponding instance
      * @throws IllegalArgumentException thrown if the descriptor has
      * invalid syntax
      */
@@ -362,12 +362,12 @@ public final class Type implements TypeBearer, Comparable<Type> {
 
     /**
      * Returns the unique instance corresponding to the type with the
-     * given descriptor, allowing <code>"V"</code> to return the type
-     * for <code>void</code>. Other than that one caveat, this method
+     * 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 non-null; the descriptor
-     * @return non-null; the corresponding instance
+     * @param descriptor {@code non-null;} the descriptor
+     * @return {@code non-null;} the corresponding instance
      * @throws IllegalArgumentException thrown if the descriptor has
      * invalid syntax
      */
@@ -388,12 +388,12 @@ public final class Type implements TypeBearer, Comparable<Type> {
     /**
      * Returns the unique instance corresponding to the type of the
      * class with the given name. Calling this method is equivalent to
-     * calling <code>intern(name)</code> if <code>name</code> begins
-     * with <code>"["</code> and calling <code>intern("L" + name + ";")</code>
+     * calling {@code intern(name)} if {@code name} begins
+     * with {@code "["} and calling {@code intern("L" + name + ";")}
      * in all other cases.
      * 
-     * @param name non-null; the name of the class whose type is desired
-     * @return non-null; the corresponding type
+     * @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
      * invalid syntax
      */
@@ -414,10 +414,10 @@ public final class Type implements TypeBearer, Comparable<Type> {
      * This is a private constructor; use one of the public static
      * methods to get instances.
      * 
-     * @param descriptor non-null; the field descriptor for the type
+     * @param descriptor {@code non-null;} the field descriptor for the type
      * @param basicType basic type corresponding to this type; one of the
-     * <code>BT_*</code> constants
-     * @param newAt &gt;= -1 allocation bytecode index
+     * {@code BT_*} constants
+     * @param newAt {@code >= -1;} allocation bytecode index
      */
     private Type(String descriptor, int basicType, int newAt) {
         if (descriptor == null) {
@@ -445,9 +445,9 @@ public final class Type implements TypeBearer, Comparable<Type> {
      * This is a private constructor; use one of the public static
      * methods to get instances.
      * 
-     * @param descriptor non-null; the field descriptor for the type
+     * @param descriptor {@code non-null;} the field descriptor for the type
      * @param basicType basic type corresponding to this type; one of the
-     * <code>BT_*</code> constants
+     * {@code BT_*} constants
      */
     private Type(String descriptor, int basicType) {
         this(descriptor, basicType, -1);
@@ -560,7 +560,7 @@ public final class Type implements TypeBearer, Comparable<Type> {
     /**
      * Gets the descriptor.
      * 
-     * @return non-null; the descriptor
+     * @return {@code non-null;} the descriptor
      */
     public String getDescriptor() {
         return descriptor;
@@ -572,7 +572,7 @@ public final class Type implements TypeBearer, Comparable<Type> {
      * normal reference type (that is, a reference type and
      * additionally not a return address).
      * 
-     * @return non-null; the internal-form class name
+     * @return {@code non-null;} the internal-form class name
      */
     public String getClassName() {
         if (className == null) {
@@ -592,8 +592,8 @@ public final class Type implements TypeBearer, Comparable<Type> {
     }
 
     /**
-     * Gets the category. Most instances are category 1. <code>long</code>
-     * and <code>double</code> are the only category 2 types.
+     * Gets the category. Most instances are category 1. {@code long}
+     * and {@code double} are the only category 2 types.
      * 
      * @see #isCategory1
      * @see #isCategory2
@@ -649,7 +649,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</code>.
+     * {@code int}.
      * 
      * @return whether this type is "intlike"
      */
@@ -695,7 +695,7 @@ public final class Type implements TypeBearer, Comparable<Type> {
      * Gets whether this type is a normal reference type. A normal
      * reference type is a reference type that is not a return
      * address. This method is just convenient shorthand for
-     * <code>getBasicType() == Type.BT_OBJECT</code>.
+     * {@code getBasicType() == Type.BT_OBJECT}.
      * 
      * @return whether this type is a normal reference type
      */
@@ -705,7 +705,7 @@ public final class Type implements TypeBearer, Comparable<Type> {
 
     /**
      * Gets whether this type is an array type. If this method returns
-     * <code>true</code>, then it is safe to use {@link #getComponentType}
+     * {@code true}, then it is safe to use {@link #getComponentType}
      * to determine the component type.
      * 
      * @return whether this type is an array type
@@ -726,7 +726,7 @@ public final class Type implements TypeBearer, Comparable<Type> {
 
     /**
      * Gets whether this type represents an uninitialized instance. An
-     * uninitialized instance is what one gets back from the <code>new</code>
+     * uninitialized instance is what one gets back from the {@code new}
      * opcode, and remains uninitialized until a valid constructor is
      * invoked on it.
      * 
@@ -738,12 +738,12 @@ public final class Type implements TypeBearer, Comparable<Type> {
 
     /**
      * Gets the bytecode index at which this uninitialized type was
-     * allocated.  This returns <code>Integer.MAX_VALUE</code> if this
+     * allocated.  This returns {@code Integer.MAX_VALUE} if this
      * type is an uninitialized incoming parameter (i.e., the
-     * <code>this</code> of an <code>&lt;init&gt;</code> method) or
-     * <code>-1</code> if this type is in fact <i>initialized</i>.
+     * {@code this} of an {@code <init>} method) or
+     * {@code -1} if this type is in fact <i>initialized</i>.
      * 
-     * @return &gt;= -1; the allocation bytecode index
+     * @return {@code >= -1;} the allocation bytecode index
      */
     public int getNewAt() {
         return newAt;
@@ -753,7 +753,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 non-null; the initialized type
+     * @return {@code non-null;} the initialized type
      */
     public Type getInitializedType() {
         if (initializedType == null) {
@@ -767,7 +767,7 @@ public final class Type implements TypeBearer, Comparable<Type> {
     /**
      * Gets the type corresponding to an array of this type.
      * 
-     * @return non-null; the array type
+     * @return {@code non-null;} the array type
      */
     public Type getArrayType() {
         if (arrayType == null) {
@@ -781,7 +781,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 non-null; the component type
+     * @return {@code non-null;} the component type
      */
     public Type getComponentType() {
         if (componentType == null) {
@@ -800,8 +800,8 @@ public final class Type implements TypeBearer, Comparable<Type> {
      * it is indicated as uninitialized and allocated at the given bytecode
      * index. This instance must be an initialized object type.
      * 
-     * @param newAt &gt;= 0; the allocation bytecode index
-     * @return non-null; an appropriately-constructed instance
+     * @param newAt {@code >= 0;} the allocation bytecode index
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public Type asUninitialized(int newAt) {
         if (newAt < 0) {
@@ -838,8 +838,8 @@ public final class Type implements TypeBearer, Comparable<Type> {
      * there. If a conflicting value is already in the table, then leave it.
      * Return the interned value.
      * 
-     * @param type non-null; instance to make interned
-     * @return non-null; the actual interned object
+     * @param type {@code non-null;} instance to make interned
+     * @return {@code non-null;} the actual interned object
      */
     private static Type putIntern(Type type) {
         synchronized (internTable) {
index b9e4ea5..2f2f274 100644 (file)
@@ -26,40 +26,40 @@ public interface TypeBearer
     /**
      * Gets the type associated with this instance.
      *
-     * @return non-null; the type
+     * @return {@code non-null;} the type
      */
     public Type getType();
 
     /**
      * Gets the frame type corresponding to this type. This method returns
-     * <code>this</code>, except if {@link Type#isIntlike} on the underlying
-     * type returns <code>true</code> but the underlying type is not in
+     * {@code this}, except if {@link Type#isIntlike} on the underlying
+     * type returns {@code true} but the underlying type is not in
      * fact {@link Type#INT}, in which case this method returns an instance
-     * whose underlying type <i>is</i> <code>INT</code>.
+     * whose underlying type <i>is</i> {@code INT}.
      *
-     * @return non-null; the frame type for this instance
+     * @return {@code non-null;} the frame type for this instance
      */
     public TypeBearer getFrameType();
 
     /**
      * Gets the basic type corresponding to this instance.
      *
-     * @return the basic type; one of the <code>BT_*</code> constants
+     * @return the basic type; one of the {@code BT_*} constants
      * defined by {@link Type}
      */
     public int getBasicType();
 
     /**
      * Gets the basic type corresponding to this instance's frame type. This
-     * is equivalent to <code>getFrameType().getBasicType()</code>, and
-     * is the same as calling <code>getFrameType()</code> unless this
+     * is equivalent to {@code getFrameType().getBasicType()}, and
+     * is the same as calling {@code getFrameType()} unless this
      * instance is an int-like type, in which case this method returns
-     * <code>BT_INT</code>.
+     * {@code BT_INT}.
      * 
      * @see #getBasicType
      * @see #getFrameType
      * 
-     * @return the basic frame type; one of the <code>BT_*</code> constants
+     * @return the basic frame type; one of the {@code BT_*} constants
      * defined by {@link Type}
      */
     public int getBasicFrameType();
@@ -67,8 +67,8 @@ public interface TypeBearer
     /**
      * Returns whether this instance represents a constant value.
      * 
-     * @return <code>true</code> if this instance represents a constant value
-     * and <code>false</code> if not
+     * @return {@code true} if this instance represents a constant value
+     * and {@code false} if not
      */
     public boolean isConstant();
 }
index 0944fe2..e82cca7 100644 (file)
@@ -22,29 +22,29 @@ package com.android.dx.rop.type;
 public interface TypeList {
     /**
      * Returns whether this instance is mutable. Note that the
-     * <code>TypeList</code> interface itself doesn't provide any
+     * {@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</code> if this instance is mutable or
-     * <code>false</code> if it is immutable
+     * @return {@code true} if this instance is mutable or
+     * {@code false} if it is immutable
      */
     public boolean isMutable();
     
     /**
      * Gets the size of this list.
      *
-     * @return &gt;= 0; the size
+     * @return {@code >= 0;} the size
      */
     public int size();
 
     /**
      * 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</code>.
+     * will throw {@code NullPointerException}.
      *
-     * @param n &gt;= 0, &lt; size(); which element
-     * @return non-null; the indicated element
+     * @param n {@code >= 0, < size();} which element
+     * @return {@code non-null;} the indicated element
      */
     public Type getType(int n);
 
@@ -53,7 +53,7 @@ public interface TypeList {
      * all the elements of this list. This is a sum of the widths (categories)
      * of all the elements.
      * 
-     * @return &gt;= 0; the required number of words
+     * @return {@code >= 0;} the required number of words
      */
     public int getWordCount();
 
@@ -62,8 +62,8 @@ public interface TypeList {
      * the given item is appended to the end and it is guaranteed to be
      * immutable.
      * 
-     * @param type non-null; item to append
-     * @return non-null; an appropriately-constructed instance
+     * @param type {@code non-null;} item to append
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public TypeList withAddedType(Type type);
 }
index 86fcf81..fdabaab 100644 (file)
@@ -24,17 +24,16 @@ import com.android.dx.util.IntList;
  * This class maps one register space into another, with
  * each mapping built up individually and added via addMapping()
  */
-public class BasicRegisterMapper
-        extends RegisterMapper {
-
+public class BasicRegisterMapper extends RegisterMapper {
     /** indexed by old register, containing new name */
     private IntList oldToNew;
 
-    /** Running count of used registers in new namespace */
+    /** running count of used registers in new namespace */
     private int runningCountNewRegisters;
 
     /**
-     * Creates a new OneToOneRegisterMapper
+     * Creates a new OneToOneRegisterMapper.
+     * 
      * @param countOldRegisters the number of registers in the old name space
      */
     public BasicRegisterMapper(int countOldRegisters) {
@@ -70,15 +69,16 @@ public class BasicRegisterMapper
 
     /**
      * Returns the new-namespace mapping for the specified
-     * old-namespace register, or -1 if one exists
+     * old-namespace register, or -1 if one exists.
      *
-     * @param oldReg &gt;=0; old-namespace register
-     * @return new-namespace register or -1 if none.
+     * @param oldReg {@code >= 0;} old-namespace register
+     * @return new-namespace register or -1 if none
      */
     public int oldToNew(int oldReg) {
-        if(oldReg >= oldToNew.size()) {
+        if (oldReg >= oldToNew.size()) {
             return -1;
         }
+
         return oldToNew.get(oldReg);
     }
 
@@ -88,7 +88,8 @@ public class BasicRegisterMapper
 
         sb.append("Old\tNew\n");
         int sz = oldToNew.size();
-        for(int i = 0; i < sz; i++) {
+
+        for (int i = 0; i < sz; i++) {
             sb.append(i);
             sb.append('\t');
             sb.append(oldToNew.get(i));
@@ -104,12 +105,12 @@ public class BasicRegisterMapper
     }
 
     /**
-     * adds a mapping to the mapper. If oldReg has already been mapped,
+     * Adds a mapping to the mapper. If oldReg has already been mapped,
      * overwrites previous mapping with new mapping.
      *
-     * @param oldReg >=0
-     * @param newReg >=0
-     * @param category width of reg (1 or 2)
+     * @param oldReg {@code >= 0;} old register
+     * @param newReg {@code >= 0;} new register
+     * @param category {@code 1..2;} width of reg
      */
     public void addMapping(int oldReg, int newReg, int category) {
         if (oldReg >= oldToNew.size()) {
@@ -118,6 +119,7 @@ public class BasicRegisterMapper
                 oldToNew.add(-1);
             }
         }
+
         oldToNew.set(oldReg, newReg);
 
         if (runningCountNewRegisters < (newReg + category)) {
index afdede7..62f6426 100644 (file)
@@ -37,7 +37,6 @@ import java.util.HashSet;
  * insn size by about 3%.
  */
 public class ConstCollector {
-
     /** Maximum constants to collect per method. Puts cap on reg use */
     private static final int MAX_COLLECTED_CONSTANTS = 5;
 
@@ -60,18 +59,20 @@ public class ConstCollector {
     private final SsaMethod ssaMeth;
 
     /**
-     * Process a method.
+     * Processes a method.
      *
-     * @param ssaMethod non-null; method to process
+     * @param ssaMethod {@code non-null;} method to process
      */
     public static void process(SsaMethod ssaMethod) {
-        ConstCollector dc;
-
-        dc = new ConstCollector(ssaMethod);
-            
-        dc.run();
+        ConstCollector cc = new ConstCollector(ssaMethod);
+        cc.run();
     }
 
+    /**
+     * Constructs an instance.
+     * 
+     * @param ssaMethod {@code non-null;} method to process
+     */
     private ConstCollector(SsaMethod ssaMethod) {
         this.ssaMeth = ssaMethod;
     }
@@ -111,9 +112,7 @@ public class ConstCollector {
                 SsaBasicBlock successorBlock
                         = entryBlock.getPrimarySuccessor();
 
-                /*
-                 * Insert a block containing the const insn
-                 */
+                // Insert a block containing the const insn.
                 SsaBasicBlock constBlock
                         = entryBlock.insertNewSuccessor(successorBlock);
 
@@ -122,18 +121,17 @@ public class ConstCollector {
                                 RegisterSpecList.EMPTY,
                                 StdTypeList.EMPTY, cst));
 
-                /*
-                 * Insert a block containing the move-result-pseudo insn
-                 */
+                // Insert a block containing the move-result-pseudo insn.
 
                 SsaBasicBlock resultBlock
                         = constBlock.insertNewSuccessor(successorBlock);
+                PlainInsn insn 
+                    = new PlainInsn(
+                            Rops.opMoveResultPseudo(result.getTypeBearer()),
+                            SourcePosition.NO_INFO,
+                            result, RegisterSpecList.EMPTY);
 
-                resultBlock.addInsnToHead(
-                        new PlainInsn(
-                                Rops.opMoveResultPseudo(result.getTypeBearer()),
-                                SourcePosition.NO_INFO,
-                                result, RegisterSpecList.EMPTY));
+                resultBlock.addInsnToHead(insn);
             }
 
             newRegs.put(cst, result);
@@ -147,7 +145,7 @@ public class ConstCollector {
      * sorted by most used first. Skips non-collectable consts, such as
      * non-string object constants
      *
-     * @return non-null; list of constants in most-to-least used order
+     * @return {@code non-null;} list of constants in most-to-least used order
      */
     private ArrayList<TypedConstant> getConstsSortedByCountUse() {
         int regSz = ssaMeth.getRegCount();
@@ -155,12 +153,14 @@ public class ConstCollector {
         final HashMap<TypedConstant, Integer> countUses
                 = new HashMap<TypedConstant, Integer>();
 
-        // Each collected constant can be used by just one local
-        // (used only if COLLECT_ONE_LOCAL is true)
+        /*
+         * Each collected constant can be used by just one local
+         * (used only if COLLECT_ONE_LOCAL is true).
+         */
         final HashSet<TypedConstant> usedByLocal
                 = new HashSet<TypedConstant>();
 
-        // Count how many times each const value is used
+        // Count how many times each const value is used.
         for (int i = 0; i < regSz; i++) {
             SsaInsn insn = ssaMeth.getDefinitionForRegister(i);
 
@@ -177,28 +177,30 @@ public class ConstCollector {
             if (insn.canThrow()) {
                 /*
                  * Don't move anything other than strings -- the risk
-                 * of changing where an exception is thrown is too high.                
+                 * of changing where an exception is thrown is too high.
                  */
                 if (!(cst instanceof CstString) || !COLLECT_STRINGS) {
                     continue;
                 }
                 /*
-                 * We can't move any throwable const whose throw will be caught,
-                 * so don't count them.                 
+                 * We can't move any throwable const whose throw will be
+                 * caught, so don't count them.                 
                  */
                 if (insn.getBlock().getSuccessors().cardinality() > 1) {
                     continue;
                 }
             }
 
-            // TODO might be nice to try and figure out which local wins most
-            // when collected
+            /*
+             * TODO: Might be nice to try and figure out which local
+             * wins most when collected.
+             */
             if (ssaMeth.isRegALocal(result)) {
                 if (!COLLECT_ONE_LOCAL) {
                     continue;
                 } else {
                     if (usedByLocal.contains(cst)) {
-                        // Count one local usage only
+                        // Count one local usage only.
                         continue;
                     } else {
                         usedByLocal.add(cst);
@@ -214,7 +216,7 @@ public class ConstCollector {
             }
         }
 
-        // Collect constants that have been reused
+        // Collect constants that have been reused.
         Iterator<TypedConstant> it = countUses.keySet().iterator();
         ArrayList<TypedConstant> constantList = new ArrayList<TypedConstant>();
         while (it.hasNext()) {
@@ -225,7 +227,7 @@ public class ConstCollector {
             }
         }
 
-        // Sort by use, with most used at the beginning of the list
+        // Sort by use, with most used at the beginning of the list.
         Collections.sort(constantList, new Comparator<Constant>() {
             public int compare(Constant a, Constant b) {
                 int ret;
@@ -245,43 +247,43 @@ public class ConstCollector {
                 return obj == this;
             }
         });
+
         return constantList;
     }
 
     /**
      * Inserts mark-locals if necessary when changing a register. If
-     * the definition of <code>origReg</code> is associated with a local
-     * variable, then insert a mark-local for <code>newReg</code> just below
-     * it. We expect the definition of  <code>origReg</code> to ultimately
+     * the definition of {@code origReg} is associated with a local
+     * 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 non-null; original register
-     * @param newReg non-null; new register that will replace
-     * <code>origReg</code>
+     * @param origReg {@code non-null;} original register
+     * @param newReg {@code non-null;} new register that will replace
+     * {@code origReg}
      */
-    private void fixLocalAssignment(RegisterSpec origReg, RegisterSpec newReg) {
-        for (SsaInsn use: ssaMeth.getUseListForRegister(origReg.getReg())) {
+    private void fixLocalAssignment(RegisterSpec origReg,
+            RegisterSpec newReg) {
+        for (SsaInsn use : ssaMeth.getUseListForRegister(origReg.getReg())) {
             RegisterSpec localAssignment = use.getLocalAssignment();
             if (localAssignment == null) {
                 continue;
             }
 
             if (use.getResult() == null) {
-                // this is a mark-local. it will be updated when all uses
-                // are updated
+                /*
+                 * This is a mark-local. it will be updated when all uses
+                 * are updated.
+                 */
                 continue;
             }
 
             LocalItem local = localAssignment.getLocalItem();
 
-            /*
-             * un-associate original use
-             */
+            // Un-associate original use.
             use.setResultLocal(null);
 
-            /*
-             * now add a mark-local to the new reg immediately after
-             */                       
+            // Now add a mark-local to the new reg immediately after.
             newReg = newReg.withLocalItem(local);
 
             SsaInsn newInsn
@@ -301,15 +303,17 @@ public class ConstCollector {
      * Updates all uses of various consts to use the values in the newly
      * assigned registers.
      *
-     * @param newRegs non-null; mapping between constant and new reg
-     * @param origRegCount &gt;=0; original SSA reg count, not including
+     * @param newRegs {@code non-null;} mapping between constant and new reg
+     * @param origRegCount {@code >=0;} original SSA reg count, not including
      * newly added constant regs
      */
     private void updateConstUses(HashMap<TypedConstant, RegisterSpec> newRegs,
             int origRegCount) {
 
-        // Set of constants associated with a local variable
-        // Used only if COLLECT_ONE_LOCAL is true
+        /*
+         * set of constants associated with a local variable; used
+         * only if COLLECT_ONE_LOCAL is true.
+         */
         final HashSet<TypedConstant> usedByLocal
                 = new HashSet<TypedConstant>();
 
@@ -338,8 +342,11 @@ public class ConstCollector {
                 if (!COLLECT_ONE_LOCAL) {
                     continue;                    
                 } else {
-                    // TODO if the same local gets the same cst multiple times,
-                    // it would be nice to reuse the register
+                    /*
+                     * TODO: If the same local gets the same cst
+                     * multiple times, it would be nice to reuse the
+                     * register.
+                     */
                     if (usedByLocal.contains(cst)) {
                         continue;
                     } else {
@@ -349,7 +356,7 @@ public class ConstCollector {
                 }
             }
 
-            // Maps an original const register to the new collected register
+            // maps an original const register to the new collected register
             RegisterMapper mapper = new RegisterMapper() {
                 @Override
                 public int getNewRegisterCount() {
@@ -359,14 +366,15 @@ public class ConstCollector {
                 @Override
                 public RegisterSpec map(RegisterSpec registerSpec) {
                     if (registerSpec.getReg() == origReg.getReg()) {
-                        return newReg.withLocalItem(registerSpec.getLocalItem());
+                        return newReg.withLocalItem(
+                                registerSpec.getLocalItem());
                     }
 
                     return registerSpec;
                 }
             };
 
-            for (SsaInsn use: useList[origReg.getReg()]) {
+            for (SsaInsn use : useList[origReg.getReg()]) {
                 if (use.canThrow()
                         && use.getBlock().getSuccessors().cardinality() > 1) {
                     continue;
index 4fded44..4ee0367 100644 (file)
@@ -36,55 +36,55 @@ import java.util.HashSet;
  * block to entry block.
  */
 public class DeadCodeRemover {
-
     /** method we're processing */
-    private SsaMethod ssaMeth;
+    private final SsaMethod ssaMeth;
+
     /** ssaMeth.getRegCount() */
-    private int regCount;
+    private final int regCount;
 
     /**
      * indexed by register: whether reg should be examined
      * (does it correspond to a no-side-effect insn?)
      */
-    private BitSet worklist;
+    private final BitSet worklist;
 
     /** use list indexed by register; modified during operation */
-    private ArrayList<SsaInsn>[] useList;
+    private final ArrayList<SsaInsn>[] useList;
 
     /**
      * Process a method with the dead-code remver
+     * 
      * @param ssaMethod method to process
      */
     public static void process(SsaMethod ssaMethod) {
-        DeadCodeRemover dc;
-
-        dc = new DeadCodeRemover(ssaMethod);
-            
+        DeadCodeRemover dc = new DeadCodeRemover(ssaMethod);
         dc.run();
     }
 
+    /**
+     * Constructs an instance.
+     * 
+     * @param ssaMethod method to process
+     */
     private DeadCodeRemover(SsaMethod ssaMethod) {
         this.ssaMeth = ssaMethod;
 
         regCount = ssaMethod.getRegCount();
-
         worklist = new BitSet(regCount);
-
         useList = ssaMeth.getUseListCopy();
     }
 
     /**
-     * Run the dead code remover
+     * Runs the dead code remover.
      */
     private void run() {
-
         HashSet<SsaInsn> deletedInsns = (HashSet<SsaInsn>) new HashSet();
 
         ssaMeth.forEachInsn(new NoSideEffectVisitor(worklist));
 
         int regV;
 
-        while ( 0 <=  (regV = worklist.nextSetBit(0)) ) {
+        while ( 0 <= (regV = worklist.nextSetBit(0)) ) {
             worklist.clear(regV);
 
             if (useList[regV].size() == 0
@@ -92,7 +92,7 @@ public class DeadCodeRemover {
 
                 SsaInsn insnS = ssaMeth.getDefinitionForRegister(regV);
 
-                // This insn has already been deleted
+                // This insn has already been deleted.
                 if (deletedInsns.contains(insnS)) {
                     continue;
                 }
@@ -102,7 +102,7 @@ public class DeadCodeRemover {
                 int sz = sources.size();
                 for (int i = 0; i < sz; i++) {
 
-                    // Delete this insn from all usage lists
+                    // Delete this insn from all usage lists.
                     RegisterSpec source = sources.get(i);
                     useList[source.getReg()].remove(insnS);
 
@@ -110,14 +110,14 @@ public class DeadCodeRemover {
                             ssaMeth.getDefinitionForRegister(
                                     source.getReg()))) {
                         /*
-                         * Only registers who's definition has no side effect
-                         * should be added back to the worklist
+                         * Only registers whose definition has no side effect
+                         * should be added back to the worklist.
                          */
                         worklist.set(source.getReg());
                     }
                 }
 
-                // Schedule this insn for later deletion
+                // Schedule this insn for later deletion.
                 deletedInsns.add(insnS);
             }
         }
@@ -127,7 +127,8 @@ public class DeadCodeRemover {
 
     /**
      * Returns true if the only uses of this register form a circle of
-     * operations with no side effects
+     * 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
@@ -139,7 +140,7 @@ public class DeadCodeRemover {
             return true;
         }
 
-        for (SsaInsn use: useList[regV]) {
+        for (SsaInsn use : useList[regV]) {
             if (hasSideEffect(use)) {
                 return false;
             }
@@ -167,13 +168,14 @@ public class DeadCodeRemover {
     /**
      * Returns true if this insn has a side-effect. Returns true
      * if the insn is null for reasons stated in the code block.
-     * @param insn null-ok; instruction in question
+     *
+     * @param insn {@code null-ok;} instruction in question
      * @return true if it has a side-effect
      */
     private static boolean hasSideEffect(SsaInsn insn) {
         if (insn == null) {
-            /* while false would seem to make more sense here, true
-             * prevents us from adding this back to a worklist unnecessarally
+            /* While false would seem to make more sense here, true
+             * prevents us from adding this back to a worklist unnecessarally.
              */
             return true;
         }
@@ -185,7 +187,7 @@ public class DeadCodeRemover {
      * A callback class used to build up the initial worklist of
      * registers defined by an instruction with no side effect.
      */
-    static class NoSideEffectVisitor implements SsaInsn.Visitor {
+    static private class NoSideEffectVisitor implements SsaInsn.Visitor {
         BitSet noSideEffectRegs;
 
         /**
@@ -195,13 +197,13 @@ public class DeadCodeRemover {
          * @param noSideEffectRegs to-build bitset of regs that are
          * results of regs with no side effects
          */
-        NoSideEffectVisitor(BitSet noSideEffectRegs) {
+        public NoSideEffectVisitor(BitSet noSideEffectRegs) {
             this.noSideEffectRegs = noSideEffectRegs;
         }
 
         /** {@inheritDoc} */
         public void visitMoveInsn (NormalSsaInsn insn) {
-            // If we're tracking local vars, some moves have side effects
+            // If we're tracking local vars, some moves have side effects.
             if (!hasSideEffect(insn)) {
                 noSideEffectRegs.set(insn.getResult().getReg());
             }
@@ -209,7 +211,7 @@ public class DeadCodeRemover {
 
         /** {@inheritDoc} */
         public void visitPhiInsn (PhiInsn phi) {
-            // If we're tracking local vars, then some phis have side effects
+            // If we're tracking local vars, then some phis have side effects.
             if (!hasSideEffect(phi)) {
                 noSideEffectRegs.set(phi.getResult().getReg());
             }
index ea089ec..3b42184 100644 (file)
@@ -30,27 +30,37 @@ import java.util.BitSet;
  * Harvey, and Kennedy; transliterated to Java.
  */
 public class DomFront {
+    /** local debug flag */
     private static boolean DEBUG = false;
 
+    /** {@code non-null;} method being processed */
     private final SsaMethod meth;
+
     private final ArrayList<SsaBasicBlock> nodes;
+    
     private final DomInfo[] domInfos;
 
     /**
      * Dominance-frontier information for a single basic block.
      */
     public static class DomInfo {
-        /** non-null; the dominance frontier set indexed by block index */
-        IntSet dominanceFrontiers;
-        /** &gt= 0 after run(); the index of the immediate dominator */
-        int idom = -1;
+        /**
+         * {@code null-ok;} the dominance frontier set indexed by
+         * block index
+         */
+        public IntSet dominanceFrontiers;
+
+        /** {@code >= 0 after run();} the index of the immediate dominator */
+        public int idom = -1;
+
         /** depth-first traversal index */
-        int traversalIndex;
+        public int traversalIndex;
     }
 
     /**
      * Constructs instance. Call {@link DomFront#run} to process. 
-     * @param meth
+     * 
+     * @param meth {@code non-null;} method to process
      */
     public DomFront(SsaMethod meth) {
         this.meth = meth;
@@ -67,7 +77,7 @@ public class DomFront {
     /**
      * Calculates the dominance frontier information for the method.
      *
-     * @return non-null; an array of DomInfo structures
+     * @return {@code non-null;} an array of DomInfo structures
      */
     public DomInfo[] run() {
         int szNodes = nodes.size();
@@ -80,8 +90,7 @@ public class DomFront {
             }
         }
 
-        Dominators methDom = new Dominators(domInfos, false);
-        methDom.run(meth);
+        Dominators methDom = Dominators.make(meth, domInfos, false);
 
         if (DEBUG) {
             for (int i = 0; i < szNodes; i++) {
@@ -164,20 +173,25 @@ public class DomFront {
             SsaBasicBlock nb = nodes.get(b);
             DomInfo nbInfo = domInfos[b];
             BitSet pred = nb.getPredecessors();
+
             if (pred.cardinality() > 1) {
                 for (int i = pred.nextSetBit(0); i >= 0;
                      i = pred.nextSetBit(i + 1)) {
 
-                    for(int runnerIndex = i
-                            ; runnerIndex != nbInfo.idom
-                            ;) {
-                        // We can stop if we hit a block we already
-                        // added label to, since we must be at a part
-                        // of the dom tree we have seen before.
+                    for (int runnerIndex = i;
+                         runnerIndex != nbInfo.idom; /* empty */) {
+                        /*
+                         * We can stop if we hit a block we already
+                         * added label to, since we must be at a part
+                         * of the dom tree we have seen before.
+                         */
                         DomInfo runnerInfo = domInfos[runnerIndex];
-                        if (runnerInfo.dominanceFrontiers.has(b))
+
+                        if (runnerInfo.dominanceFrontiers.has(b)) {
                             break;
-                        // "add b to runner's dominance frontier set"
+                        }
+
+                        // Add b to runner's dominance frontier set.
                         runnerInfo.dominanceFrontiers.add(b);
                         runnerIndex = runnerInfo.idom;
                     }
index 1af2cbc..f7d7da6 100644 (file)
@@ -41,31 +41,55 @@ import java.util.HashSet;
  * rank to keep the union-find tree balanced.
  */
 public final class Dominators {
-    /* postdom is true if we want post dominators. */
-    private boolean postdom;
+    /* postdom is true if we want post dominators */
+    private final boolean postdom;
+
+    /* {@code non-null;} method being processed */
+    private final SsaMethod meth;
+
     /* Method's basic blocks. */
-    private ArrayList<SsaBasicBlock> blocks;
+    private final ArrayList<SsaBasicBlock> blocks;
 
-    private static final class DFSInfo {
-        int semidom;
-        SsaBasicBlock parent;
-        // rep(resentative) is known as "label" in the paper. It is the node
-        // that our block's DFS info has been unioned to.
-        SsaBasicBlock rep;
-        SsaBasicBlock ancestor;
-        ArrayList<SsaBasicBlock> bucket;
+    /** indexed by basic block index */
+    private final DFSInfo[] info;
 
-        public DFSInfo() {
-            bucket = new ArrayList<SsaBasicBlock>();
-        }
+    private final ArrayList<SsaBasicBlock> vertex;
+
+    /** {@code non-null;} the raw dominator info */
+    private final DomFront.DomInfo domInfos[];
 
+    /**
+     * 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
+     */
+    private Dominators(SsaMethod meth, DomFront.DomInfo[] domInfos,
+            boolean postdom) {
+        this.meth = meth;
+        this.domInfos = domInfos;
+        this.postdom = postdom;
+        this.blocks = meth.getBlocks();
+        this.info = new DFSInfo[blocks.size() + 2];
+        this.vertex = new ArrayList<SsaBasicBlock>();
     }
 
-    /** Indexed by basic block index */
-    private DFSInfo[] info;
-    private ArrayList<SsaBasicBlock> vertex;
+    /**
+     * 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
+     */
+    public static Dominators make(SsaMethod meth, DomFront.DomInfo[] domInfos,
+            boolean postdom) {
+        Dominators result = new Dominators(meth, domInfos, postdom);
 
-    private DomFront.DomInfo domInfos[];
+        result.run();
+        return result;
+    }
 
     private BitSet getSuccs(SsaBasicBlock block) {
         if (postdom) {
@@ -85,6 +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) {
@@ -110,7 +135,7 @@ public final class Dominators {
                 }
                 worklist.remove(wsize - 1);
 
-                // Update based on ancestor info
+                // Update based on ancestor info.
                 if (vabbInfo.ancestor == null) {
                     continue;
                 }
@@ -124,42 +149,25 @@ public final class Dominators {
             }
         }
     }
+
     private SsaBasicBlock eval(SsaBasicBlock v) {
         DFSInfo bbInfo = info[v.getIndex()];
+
         if (bbInfo.ancestor == null) {
             return v;
         }
+
         compress(v);
         return bbInfo.rep;
     }
 
     /**
-     * Callback for depth-first walk through control flow graph (either
-     * from the entry block or the exit block). Records the traversal order
-     * in the <code>info</code>list.
-     */
-    private class DfsWalker implements SsaBasicBlock.Visitor {
-        int dfsNum = 0;
-
-        public void visitBlock (SsaBasicBlock v, SsaBasicBlock parent) {
-            DFSInfo bbInfo = new DFSInfo();
-            bbInfo.semidom = ++dfsNum;
-            bbInfo.rep = v;
-            bbInfo.parent = parent;
-            vertex.add(v);
-            info[v.getIndex()] = bbInfo;
-        }
-    }
-
-    /**
-     * Performs dominator/post-dominator calculation for the control flow graph.
-     * @param meth Method to analyze
+     * Performs dominator/post-dominator calculation for the control
+     * flow graph.
+     * 
+     * @param meth {@code non-null;} method to analyze
      */
-    public void run(SsaMethod meth) {
-
-        this.blocks = meth.getBlocks();
-        this.info = new DFSInfo[blocks.size() + 2];
-        this.vertex = new ArrayList<SsaBasicBlock>();
+    private void run() {
         SsaBasicBlock root = postdom
                 ? meth.getExitBlock() : meth.getEntryBlock();
 
@@ -168,8 +176,10 @@ public final class Dominators {
             domInfos[root.getIndex()].idom = root.getIndex();
         }
         
-        // First we perform a DFS numbering of the blocks, by numbering the dfs
-        // tree roots
+        /*
+         * First we perform a DFS numbering of the blocks, by
+         * numbering the dfs tree roots.
+         */
 
         DfsWalker walker = new DfsWalker();
         meth.forEachBlockDepthFirst(postdom, walker);
@@ -184,12 +194,15 @@ public final class Dominators {
 
             BitSet preds = getPreds(w);
             for (int j = preds.nextSetBit(0);
-                    j >= 0;
-                    j = preds.nextSetBit(j + 1)) {
+                 j >= 0;
+                 j = preds.nextSetBit(j + 1)) {
                 SsaBasicBlock predBlock = blocks.get(j);
                 DFSInfo predInfo = info[predBlock.getIndex()];
-                // PredInfo may not exist in case the predecessor is not
-                // reachable
+
+                /*
+                 * PredInfo may not exist in case the predecessor is
+                 * not reachable.
+                 */
                 if (predInfo != null) {
                     int predSemidom = info[eval(predBlock).getIndex()].semidom;
                     if (predSemidom < wInfo.semidom) {
@@ -199,11 +212,14 @@ public final class Dominators {
             }
             info[vertex.get(wInfo.semidom).getIndex()].bucket.add(w);
 
-            // Normally we would call link here, but in our  m log n
-            // implementation this is equivalent to the following single line
+            /*
+             * Normally we would call link here, but in our O(m log n)
+             * implementation this is equivalent to the following
+             * single line.
+             */
             wInfo.ancestor = wInfo.parent;
 
-            // Implicity define idom for each vertex
+            // Implicity define idom for each vertex.
             ArrayList<SsaBasicBlock> wParentBucket;
             wParentBucket = info[wInfo.parent.getIndex()].bucket;
 
@@ -219,6 +235,7 @@ public final class Dominators {
                 }
             }
         }
+
         // Now explicitly define the immediate dominator of each vertex
         for (int i =  2; i <= dfsMax; ++i) {
             SsaBasicBlock w = vertex.get(i);
@@ -231,10 +248,38 @@ public final class Dominators {
     }
 
     /**
-     * @param postdom true for postdom information, false for normal dom info
+     * Callback for depth-first walk through control flow graph (either
+     * from the entry block or the exit block). Records the traversal order
+     * in the {@code info}list.
      */
-    public Dominators(DomFront.DomInfo[] domInfos, boolean postdom) {
-        this.domInfos = domInfos;
-        this.postdom = postdom;
+    private class DfsWalker implements SsaBasicBlock.Visitor {
+        private int dfsNum = 0;
+
+        public void visitBlock(SsaBasicBlock v, SsaBasicBlock parent) {
+            DFSInfo bbInfo = new DFSInfo();
+            bbInfo.semidom = ++dfsNum;
+            bbInfo.rep = v;
+            bbInfo.parent = parent;
+            vertex.add(v);
+            info[v.getIndex()] = bbInfo;
+        }
+    }
+
+    private static final class DFSInfo {
+        public int semidom;
+        public SsaBasicBlock parent;
+
+        /**
+         * rep(resentative) is known as "label" in the paper. It is the node
+         * that our block's DFS info has been unioned to.
+         */
+        public SsaBasicBlock rep;
+
+        public SsaBasicBlock ancestor;
+        public ArrayList<SsaBasicBlock> bucket;
+
+        public DFSInfo() {
+            bucket = new ArrayList<SsaBasicBlock>();
+        }
     }
 }
index be678dd..392579d 100644 (file)
@@ -33,7 +33,6 @@ import java.util.BitSet;
  * have variable register widths/categories, and the new namespace does.
  */
 public class InterferenceRegisterMapper extends BasicRegisterMapper {
-
     /**
      * Array of interference sets. ArrayList is indexed by new namespace
      * and BitIntSet's are indexed by old namespace.  The list expands
@@ -45,16 +44,15 @@ public class InterferenceRegisterMapper extends BasicRegisterMapper {
      */
     private final ArrayList<BitIntSet> newRegInterference;
 
-    /**
-     * The interference graph for the old namespace
-     */
+    /** the interference graph for the old namespace */
     private final InterferenceGraph oldRegInterference;
 
     /**
-     * @param countOldRegisters number of registers in old namespace.
+     * Constructs an instance
+     * 
+     * @param countOldRegisters number of registers in old namespace
      */
-    public InterferenceRegisterMapper(
-            InterferenceGraph oldRegInterference,
+    public InterferenceRegisterMapper(InterferenceGraph oldRegInterference,
             int countOldRegisters) {
         super(countOldRegisters);
 
@@ -75,8 +73,8 @@ public class InterferenceRegisterMapper extends BasicRegisterMapper {
     }
 
     /**
-     * Checks to see if old namespace reg <code>oldReg</code> interferes
-     * with what currently maps to <code>newReg</code>.
+     * Checks to see if old namespace reg {@code oldReg} interferes
+     * with what currently maps to {@code newReg}.
      *
      * @param oldReg old namespace register
      * @param newReg new namespace register
@@ -101,10 +99,10 @@ public class InterferenceRegisterMapper extends BasicRegisterMapper {
     }
 
     /**
-     * Checks to see if old namespace reg <code>oldReg</code> interferes
-     * with what currently maps to <code>newReg</code>.
+     * Checks to see if old namespace reg {@code oldReg} interferes
+     * with what currently maps to {@code newReg}.
      *
-     * @param oldSpec non-null; old namespace register
+     * @param oldSpec {@code non-null;} old namespace register
      * @param newReg new namespace register
      * @return true if oldReg will interfere with newReg
      */
@@ -115,6 +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
      */
@@ -134,17 +133,17 @@ public class InterferenceRegisterMapper extends BasicRegisterMapper {
      * pinned to the specified new-namespace reg + category. Takes into
      * account the category of the old-namespace registers.
      *
-     * @param oldSpecs non-null; set of old-namespace regs
-     * @param newReg &gt;= 0 new-namespace register
-     * @param targetCategory 1 or 2; the number of adjacent new-namespace
+     * @param oldSpecs {@code non-null;} set of old-namespace regs
+     * @param newReg {@code >= 0;} new-namespace register
+     * @param targetCategory {@code 1..2;} the number of adjacent new-namespace
      * registers (starting at ropReg) to consider
      * @return true if any of the old-namespace register have been mapped
      * to the new-namespace register + category
      */
     public boolean areAnyPinned(RegisterSpecList oldSpecs,
             int newReg, int targetCategory) {
-
         int sz = oldSpecs.size();
+
         for (int i = 0; i < sz; i++) {
             RegisterSpec oldSpec = oldSpecs.get(i);
             int r = oldToNew(oldSpec.getReg());
@@ -159,6 +158,7 @@ public class InterferenceRegisterMapper extends BasicRegisterMapper {
                 return true;
             }
         }
+        
         return false;
     }
 }
index ad10cd7..a70b5bb 100644 (file)
@@ -42,7 +42,7 @@ public class LiteralOpUpgrader {
     /**
      * Process a method.
      *
-     * @param ssaMethod non-null; method to process
+     * @param ssaMethod {@code non-null;} method to process
      */
     public static void process(SsaMethod ssaMethod) {
         LiteralOpUpgrader dc;
@@ -135,8 +135,8 @@ public class LiteralOpUpgrader {
      *
      * TODO move this somewhere else.
      *
-     * @param insn non-null; an SsaInsn containing a PlainInsn
-     * @param newSources non-null; new sources list for new insn
+     * @param insn {@code non-null;} an SsaInsn containing a PlainInsn
+     * @param newSources {@code non-null;} new sources list for new insn
      * @param newOpcode A RegOp from {@link RegOps}
      */
     private void replacePlainInsn(NormalSsaInsn insn,
index 21c306b..11d53cf 100644 (file)
@@ -33,23 +33,23 @@ import java.util.List;
  * converted, and adapted through edge-splitting.
  */
 public class LocalVariableExtractor {
-    /** non-null; method being extracted from */
+    /** {@code non-null;} method being extracted from */
     private final SsaMethod method;
 
-    /** non-null; block list for the method */
+    /** {@code non-null;} block list for the method */
     private final ArrayList<SsaBasicBlock> blocks;
 
-    /** non-null; result in-progress */
+    /** {@code non-null;} result in-progress */
     private final LocalVariableInfo resultInfo;
 
-    /** non-null; work set indicating blocks needing to be processed */
+    /** {@code non-null;} work set indicating blocks needing to be processed */
     private final BitSet workSet;
 
     /**
      * Extracts out all the local variable information from the given method.
      *
-     * @param method non-null; the method to extract from
-     * @return non-null; the extracted information
+     * @param method {@code non-null;} the method to extract from
+     * @return {@code non-null;} the extracted information
      */
     public static LocalVariableInfo extract(SsaMethod method) {
         LocalVariableExtractor lve = new LocalVariableExtractor(method);
@@ -59,7 +59,7 @@ public class LocalVariableExtractor {
     /**
      * Constructs an instance. This method is private. Use {@link #extract}.
      *
-     * @param method non-null; the method to extract from
+     * @param method {@code non-null;} the method to extract from
      */
     private LocalVariableExtractor(SsaMethod method) {
         if (method == null) {
@@ -77,7 +77,7 @@ public class LocalVariableExtractor {
     /**
      * Does the extraction.
      *
-     * @return non-null; the extracted information
+     * @return {@code non-null;} the extracted information
      */
     private LocalVariableInfo doit() {
 
@@ -98,7 +98,7 @@ public class LocalVariableExtractor {
     /**
      * Processes a single block.
      *
-     * @param blockIndex &gt;= 0; block index of the block to process
+     * @param blockIndex {@code >= 0;} block index of the block to process
      */
     private void processBlock(int blockIndex) {
         RegisterSpecSet primaryState
index f7c37d2..8845270 100644 (file)
@@ -29,30 +29,30 @@ import java.util.List;
  * Stolen from {@link com.android.dx.rop.code.LocalVariableInfo}.
  */
 public class LocalVariableInfo         extends MutabilityControl {
-    /** &gt;= 0; the register count for the method */
+    /** {@code >= 0;} the register count for the method */
     private final int regCount;
 
     /**
-     * non-null; {@link com.android.dx.rop.code.RegisterSpecSet} to use when indicating a block
+     * {@code non-null;} {@link com.android.dx.rop.code.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
      */
     private final RegisterSpecSet emptySet;
 
     /**
-     * non-null; array consisting of register sets representing the
+     * {@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 indices
      */
     private final RegisterSpecSet[] blockStarts;
 
-    /** non-null; map from instructions to the variable each assigns */
+    /** {@code non-null;} map from instructions to the variable each assigns */
     private final HashMap<SsaInsn, RegisterSpec> insnAssignments;
 
     /**
      * Constructs an instance.
      *
-     * @param method non-null; the method being represented by this instance
+     * @param method {@code non-null;} the method being represented by this instance
      */
     public LocalVariableInfo(SsaMethod method) {
         if (method == null) {
@@ -74,8 +74,8 @@ public class LocalVariableInfo         extends MutabilityControl {
      * Sets the register set associated with the start of the block with
      * the given index.
      *
-     * @param index &gt;= 0; the block index
-     * @param specs non-null; the register set to associate with the block
+     * @param index {@code >= 0;} the block index
+     * @param specs {@code non-null;} the register set to associate with the block
      */
     public void setStarts(int index, RegisterSpecSet specs) {
         throwIfImmutable();
@@ -99,12 +99,12 @@ public class LocalVariableInfo         extends MutabilityControl {
      * merge the two sets and call {@link #setStarts} on the result of the
      * merge.
      *
-     * @param index &gt;= 0; the block index
-     * @param specs non-null; the register set to merge into the start set
+     * @param index {@code >= 0;} the block index
+     * @param specs {@code non-null;} the register set to merge into the start set
      * for the block
-     * @return <code>true</code> if the merge resulted in an actual change
+     * @return {@code true} if the merge resulted in an actual change
      * to the associated set (including storing one for the first time) or
-     * <code>false</code> if there was no change
+     * {@code false} if there was no change
      */
     public boolean mergeStarts(int index, RegisterSpecSet specs) {
         RegisterSpecSet start = getStarts0(index);
@@ -133,8 +133,8 @@ public class LocalVariableInfo         extends MutabilityControl {
      * with the given index. This returns an empty set with the appropriate
      * max size if no set was associated with the block in question.
      *
-     * @param index &gt;= 0; the block index
-     * @return non-null; the associated register set
+     * @param index {@code >= 0;} the block index
+     * @return {@code non-null;} the associated register set
      */
     public RegisterSpecSet getStarts(int index) {
         RegisterSpecSet result = getStarts0(index);
@@ -145,10 +145,10 @@ public class LocalVariableInfo         extends MutabilityControl {
     /**
      * Gets the register set associated with the start of the given
      * block. This is just convenient shorthand for
-     * <code>getStarts(block.getLabel())</code>.
+     * {@code getStarts(block.getLabel())}.
      *
-     * @param block non-null; the block in question
-     * @return non-null; the associated register set
+     * @param block {@code non-null;} the block in question
+     * @return {@code non-null;} the associated register set
      */
     public RegisterSpecSet getStarts(SsaBasicBlock block) {
         return getStarts(block.getIndex());
@@ -160,8 +160,8 @@ public class LocalVariableInfo         extends MutabilityControl {
      * newly-allocated empty {@link RegisterSpecSet} of appropriate
      * max size if there is not yet any set associated with the block.
      *
-     * @param index &gt;= 0; the block index
-     * @return non-null; the associated register set
+     * @param index {@code >= 0;} the block index
+     * @return {@code non-null;} the associated register set
      */
     public RegisterSpecSet mutableCopyOfStarts(int index) {
         RegisterSpecSet result = getStarts0(index);
@@ -181,8 +181,8 @@ public class LocalVariableInfo         extends MutabilityControl {
      * simple type and the one in the instruction can be an arbitrary
      * {@link com.android.dx.rop.type.TypeBearer} (such as a constant value).
      *
-     * @param insn non-null; the instruction in question
-     * @param spec non-null; the associated register spec
+     * @param insn {@code non-null;} the instruction in question
+     * @param spec {@code non-null;} the associated register spec
      */
     public void addAssignment(SsaInsn insn, RegisterSpec spec) {
         throwIfImmutable();
@@ -202,8 +202,8 @@ public class LocalVariableInfo         extends MutabilityControl {
      * Gets the named register being assigned by the given instruction, if
      * previously stored in this instance.
      *
-     * @param insn non-null; instruction in question
-     * @return null-ok; the named register being assigned, if any
+     * @param insn {@code non-null;} instruction in question
+     * @return {@code null-ok;} the named register being assigned, if any
      */
     public RegisterSpec getAssignment(SsaInsn insn) {
         return insnAssignments.get(insn);
@@ -212,7 +212,7 @@ public class LocalVariableInfo         extends MutabilityControl {
     /**
      * Gets the number of assignments recorded by this instance.
      *
-     * @return &gt;= 0; the number of assignments
+     * @return {@code >= 0;} the number of assignments
      */
     public int getAssignmentCount() {
         return insnAssignments.size();
@@ -236,8 +236,8 @@ public class LocalVariableInfo         extends MutabilityControl {
      * Helper method, to get the starts for a index, throwing the
      * right exception for range problems.
      *
-     * @param index &gt;= 0; the block index
-     * @return null-ok; associated register set or <code>null</code> if there
+     * @param index {@code >= 0;} the block index
+     * @return {@code null-ok;} associated register set or {@code null} if there
      * is none
      */
     private RegisterSpecSet getStarts0(int index) {
index a27aec5..352e3e6 100644 (file)
@@ -143,8 +143,8 @@ public class MoveParamCombiner {
      * Returns the parameter index associated with a move-param insn. Does
      * not verify that the insn is a move-param insn.
      *
-     * @param insn non-null; a move-param insn
-     * @return &gt;=0 parameter index
+     * @param insn {@code non-null;} a move-param insn
+     * @return {@code >=0;} parameter index
      */
     private int getParamIndex(NormalSsaInsn insn) {
         CstInsn cstInsn = (CstInsn)(insn.getOriginalRopInsn());
index ad9315a..d3392ca 100644 (file)
@@ -19,13 +19,10 @@ package com.android.dx.ssa;
 import com.android.dx.rop.code.*;
 
 /**
- * A "normal" (non-phi) instruction in SSA form. Always wraps a ROP insn.
+ * A "normal" (non-phi) instruction in SSA form. Always wraps a rop insn.
  */
 public final class NormalSsaInsn extends SsaInsn implements Cloneable {
-
-    /**
-     * ROP insn that we're wrapping
-     */
+    /** {@code non-null;} rop insn that we're wrapping */
     private Insn insn;
 
     /**
@@ -35,21 +32,19 @@ public final class NormalSsaInsn extends SsaInsn implements Cloneable {
      * @param block block that contains this insn
      */
     NormalSsaInsn(final Insn insn, final SsaBasicBlock block) {
-        super(block);
+        super(insn.getResult(), block);
         this.insn = insn;
-        this.result = insn.getResult();
     }
 
     /** {@inheritDoc} */
     @Override
     public final void mapSourceRegisters(RegisterMapper mapper) {
-
         RegisterSpecList oldSources = insn.getSources();
         RegisterSpecList newSources = mapper.map(oldSources);
 
         if (newSources != oldSources) {
-            insn = insn.withNewRegisters(result, newSources);
-            block.getParent().onSourcesChanged(this, oldSources);
+            insn = insn.withNewRegisters(getResult(), newSources);
+            getBlock().getParent().onSourcesChanged(this, oldSources);
         }
     }
 
@@ -57,7 +52,7 @@ public final class NormalSsaInsn extends SsaInsn implements Cloneable {
      * Changes one of the insn's sources. New source should be of same type
      * and category.
      *
-     * @param index &gt;=0; index of source to change
+     * @param index {@code >=0;} index of source to change
      * @param newSpec spec for new source
      */
     public final void changeOneSource(int index, RegisterSpec newSpec) {
@@ -68,6 +63,7 @@ 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);
@@ -76,10 +72,10 @@ public final class NormalSsaInsn extends SsaInsn implements Cloneable {
              * If the register remains unchanged, we're only changing 
              * the type or local var name so don't update use list
              */
-            block.getParent().onSourceChanged(this, origSpec, newSpec);
+            getBlock().getParent().onSourceChanged(this, origSpec, newSpec);
         }
 
-        insn = insn.withNewRegisters(result, newSources);
+        insn = insn.withNewRegisters(getResult(), newSources);
     }
 
     /**
@@ -90,22 +86,24 @@ public final class NormalSsaInsn extends SsaInsn implements Cloneable {
      */
     public final void setNewSources (RegisterSpecList newSources) {
         RegisterSpecList origSources = insn.getSources();
+
         if (origSources.size() != newSources.size()) {
             throw new RuntimeException("Sources counts don't match");
         }
 
-        insn = insn.withNewRegisters(result, newSources);
+        insn = insn.withNewRegisters(getResult(), newSources);
     }
 
     /** {@inheritDoc} */
     @Override
     public NormalSsaInsn clone() {
-        return (NormalSsaInsn)super.clone();
+        return (NormalSsaInsn) super.clone();
     }
 
     /**
-     * Like rop.Insn.getSources()
-     * @return null-ok; sources list
+     * Like rop.Insn.getSources().
+     * 
+     * @return {@code null-ok;} sources list
      */
     public RegisterSpecList getSources() {
         return insn.getSources();
@@ -119,7 +117,7 @@ public final class NormalSsaInsn extends SsaInsn implements Cloneable {
     /** {@inheritDoc} */
     @Override
     public Insn toRopInsn() {
-        return insn.withNewRegisters(result,insn.getSources());
+        return insn.withNewRegisters(getResult(), insn.getSources());
     }
 
     /**
@@ -143,7 +141,7 @@ public final class NormalSsaInsn extends SsaInsn implements Cloneable {
         if (insn.getOpcode().getOpcode() == RegOps.MARK_LOCAL) {
             assignment = insn.getSources().get(0);
         } else {
-            assignment = result;
+            assignment = getResult();
         }
 
         if (assignment == null) {
@@ -167,8 +165,9 @@ public final class NormalSsaInsn extends SsaInsn implements Cloneable {
      */
     public void upgradeToLiteral() {
         RegisterSpecList oldSources = insn.getSources();
+
         insn = insn.withLastSourceLiteral();
-        block.getParent().onSourcesChanged(this, oldSources);
+        getBlock().getParent().onSourcesChanged(this, oldSources);
     }
 
     /**
@@ -210,7 +209,7 @@ public final class NormalSsaInsn extends SsaInsn implements Cloneable {
     /**
      * {@inheritDoc}
      *
-     * TODO increase the scope of this.
+     * TODO: Increase the scope of this.
      */
     @Override
     public boolean hasSideEffect() {
@@ -221,7 +220,7 @@ public final class NormalSsaInsn extends SsaInsn implements Cloneable {
         }
 
         boolean hasLocalSideEffect
-                = Optimizer.getPreserveLocals() && getLocalAssignment() != null;
+            = Optimizer.getPreserveLocals() && getLocalAssignment() != null;
 
         switch (opcode.getOpcode()) {
             case RegOps.MOVE_RESULT:
index cee6d7b..c5f6dc9 100644 (file)
@@ -48,7 +48,7 @@ public class Optimizer {
     }
 
     /**
-     * @return non-null; translation advice
+     * @return {@code non-null;} translation advice
      */
     public static TranslationAdvice getAdvice() {
         return advice;
@@ -64,7 +64,7 @@ public class Optimizer {
      * @param isStatic true if this method has no 'this' pointer argument.
      * @param inPreserveLocals true if local variable info should be preserved,
      * at the cost of some registers and insns
-     * @param inAdvice non-null; translation advice
+     * @param inAdvice {@code non-null;} translation advice
      * @return optimized method
      */
     public static RopMethod optimize(RopMethod rmeth, int paramWidth,
@@ -85,7 +85,7 @@ public class Optimizer {
      * @param isStatic true if this method has no 'this' pointer argument.
      * @param inPreserveLocals true if local variable info should be preserved,
      * at the cost of some registers and insns
-     * @param inAdvice non-null; translation advice
+     * @param inAdvice {@code non-null;} translation advice
      * @param steps set of optional optimization steps to run
      * @return optimized method
      */
index 1829133..b3a99eb 100644 (file)
@@ -30,67 +30,53 @@ import java.util.List;
  * conversion back to ROP form.
  */
 public final class PhiInsn extends SsaInsn {
-
     /**
-     * the original result register of the phi insn is needed during the
-     * renaming process after the new result register has already been chosen.
+     * result register. The original result register of the phi insn
+     * is needed during the renaming process after the new result
+     * register has already been chosen.
      */
-    private int ropResultReg;
-    private ArrayList<Operand> operands = new ArrayList<Operand>();
-    private RegisterSpecList sources;
+    private final int ropResultReg;
 
     /**
-     * A single phi operand, consiting of source register and block index
-     * for move.
+     * {@code non-null;} operands of the instruction; built up by
+     * {@link #addPhiOperand}
      */
-    class Operand {
-        RegisterSpec regSpec;
-        int blockIndex;
-        int ropLabel;       //mostly for debugging
+    private final ArrayList<Operand> operands = new ArrayList<Operand>();
 
-        Operand (final RegisterSpec regSpec, final int blockIndex,
-                final int ropLabel){
-            this.regSpec = regSpec;
-            this.blockIndex = blockIndex;
-            this.ropLabel = ropLabel;
-        }
-    }
-
-    public static interface Visitor {
-        public void visitPhiInsn(PhiInsn insn);
-    }
-
-    public PhiInsn clone() {
-        throw new UnsupportedOperationException("can't clone phi");
-    }
+    /** {@code null-ok;} source registers; constructed lazily */
+    private RegisterSpecList sources;
 
     /**
      * Constructs a new phi insn with no operands.
+     * 
      * @param resultReg the result reg for this phi insn
      * @param block block containing this insn.
      */
-    PhiInsn(final RegisterSpec resultReg, final SsaBasicBlock block) {
-        super(block);
-        this.result = resultReg;
+    public PhiInsn(RegisterSpec resultReg, SsaBasicBlock block) {
+        super(resultReg, block);
         ropResultReg = resultReg.getReg();
     }
 
     /**
      * Makes a phi insn with a void result type.
+     * 
      * @param resultReg the result register for this phi insn.
      * @param block block containing this insn.
      */
-    PhiInsn(final int resultReg, final SsaBasicBlock block) {
-        super(block);
-
+    public PhiInsn(final int resultReg, final SsaBasicBlock block) {
         /*
-         * The type here is bogus: the type depends on the operand and
-         * will be derived later.
+         * The result type here is bogus: The type depends on the
+         * operand and will be derived later.
          */
-        this.result = RegisterSpec.make(resultReg, Type.VOID);
+        super(RegisterSpec.make(resultReg, Type.VOID), block);
         ropResultReg = resultReg;
     }
 
+    /** {@inheritDoc} */
+    public PhiInsn clone() {
+        throw new UnsupportedOperationException("can't clone phi");
+    }
+
     /**
      * Updates the TypeBearers of all the sources (phi operands) to be
      * the current TypeBearer of the register-defining instruction's result.
@@ -100,9 +86,8 @@ public final class PhiInsn extends SsaInsn {
      *
      * @param ssaMeth method that contains this insn
      */
-    void updateSourcesToDefinitions(SsaMethod ssaMeth) {
-
-        for (Operand o: operands) {
+    public void updateSourcesToDefinitions(SsaMethod ssaMeth) {
+        for (Operand o : operands) {
             RegisterSpec def 
                 = ssaMeth.getDefinitionForRegister(
                     o.regSpec.getReg()).getResult();
@@ -116,37 +101,42 @@ public final class PhiInsn extends SsaInsn {
     /**
      * Changes the result type. Used during phi type resolution
      *
-     * @param type non-null; new TypeBearer
-     * @param local null-ok; new local info, if available
+     * @param type {@code non-null;} new TypeBearer
+     * @param local {@code null-ok;} new local info, if available
      */
-    void changeResultType(TypeBearer type, LocalItem local) {
-        result = RegisterSpec.makeLocalOptional(result.getReg(), type, local);
+    public void changeResultType(TypeBearer type, LocalItem local) {
+        setResult(RegisterSpec.makeLocalOptional(
+                          getResult().getReg(), type, local));
     }
 
     /**
-     * @return the original rop-form result reg. Useful during renaming.
+     * Gets the original rop-form result reg. This is useful during renaming.
+     * 
+     * @return the original rop-form result reg
      */
-    int getRopResultReg() {
+    public int getRopResultReg() {
         return ropResultReg;
     }
 
     /**
-     * Add an operand to this phi instruction
+     * 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
+     * @param predBlock predecessor block to be associated with this operand
      */
     public void addPhiOperand(RegisterSpec registerSpec,
             SsaBasicBlock predBlock) {
         operands.add(new Operand(registerSpec, predBlock.getIndex(),
                 predBlock.getRopLabel()));
         
-        // in case someone has already called getSources()
+        // Un-cache sources, in case someone has already called getSources().
         sources = null;
     }
 
     /**
      * 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
      */
@@ -157,7 +147,7 @@ public final class PhiInsn extends SsaInsn {
     /**
      * {@inheritDoc}
      *
-     * Always returns null for <code>PhiInsn</code>s
+     * Always returns null for {@code PhiInsn}s.
      */
     @Override
     public Rop getOpcode() {
@@ -167,18 +157,17 @@ public final class PhiInsn extends SsaInsn {
     /**
      * {@inheritDoc}
      *
-     * Always returns null for <code>PhiInsn</code>s
+     * Always returns null for {@code PhiInsn}s.
      */
     @Override
     public Insn getOriginalRopInsn() {
         return null;
     }
 
-
     /**
      * {@inheritDoc}
      *
-     * Always returns false for <code>PhiInsn</code>s
+     * Always returns false for {@code PhiInsn}s.
      */
     @Override
     public boolean canThrow() {
@@ -188,10 +177,10 @@ public final class PhiInsn extends SsaInsn {
     /**
      * Gets sources. Constructed lazily from phi operand data structures and
      * then cached.
-     * @return sources list
+     * 
+     * @return {@code non-null;} sources list
      */
     public RegisterSpecList getSources() {
-
         if (sources != null) {
             return sources;
         }
@@ -219,10 +208,10 @@ public final class PhiInsn extends SsaInsn {
     public boolean isRegASource(int reg) {
         /*
          * Avoid creating a sources list in case it has not already been
-         * created
+         * created.
          */
 
-        for (Operand o: operands) {
+        for (Operand o : operands) {
             if (o.regSpec.getReg() == reg) {
                 return true;
             }
@@ -236,12 +225,12 @@ public final class PhiInsn extends SsaInsn {
      */
     public boolean areAllOperandsEqual() {
         if (operands.size() == 0 ) {
-            // this should never happen
+            // This should never happen.
             return true;
         }
 
         int firstReg = operands.get(0).regSpec.getReg();
-        for (Operand o: operands) {
+        for (Operand o : operands) {
             if (firstReg != o.regSpec.getReg()) {
                 return false;
             }
@@ -253,19 +242,20 @@ public final class PhiInsn extends SsaInsn {
     /** {@inheritDoc} */
     @Override
     public final void mapSourceRegisters(RegisterMapper mapper) {
-        for (Operand o: operands) {
+        for (Operand o : operands) {
             RegisterSpec old = o.regSpec;
             o.regSpec = mapper.map(old);
             if (old != o.regSpec) {
-                block.getParent().onSourceChanged(this, old, o.regSpec);
+                getBlock().getParent().onSourceChanged(this, old, o.regSpec);
             }
         }
         sources = null;
     }
 
     /**
-     * Always throws an exeption, since
-     * a phi insn may not be converted back to rop form
+     * Always throws an exeption, since a phi insn may not be
+     * converted back to rop form.
+     * 
      * @return always throws exception
      */
     @Override
@@ -276,17 +266,16 @@ public final class PhiInsn extends SsaInsn {
 
     /**
      * Returns the list of predecessor blocks associated with all operands
-     * that have <code>reg</code> as an operand register.
+     * that have {@code reg} as an operand register.
      *
      * @param reg register to look up
      * @param ssaMeth method we're operating on
-     * @return List of predecessor blocks, empty if none
+     * @return list of predecessor blocks, empty if none
      */
-    public List<SsaBasicBlock> predBlocksForReg (int reg, SsaMethod ssaMeth) {
-        ArrayList<SsaBasicBlock> ret 
-            = (ArrayList<SsaBasicBlock>)new ArrayList();
+    public List<SsaBasicBlock> predBlocksForReg(int reg, SsaMethod ssaMeth) {
+        ArrayList<SsaBasicBlock> ret = new ArrayList<SsaBasicBlock>();
 
-        for (Operand o: operands) {
+        for (Operand o : operands) {
             if (o.regSpec.getReg() == reg) {
                 ret.add(ssaMeth.getBlocks().get(o.blockIndex));
             }
@@ -297,12 +286,13 @@ public final class PhiInsn extends SsaInsn {
 
     /** {@inheritDoc} */
     @Override
-    public  boolean isPhiOrMove() {
+    public boolean isPhiOrMove() {
         return true;    
     }
 
     /** {@inheritDoc} */
-    @Override public boolean hasSideEffect() {
+    @Override
+    public boolean hasSideEffect() {
         return Optimizer.getPreserveLocals() && getLocalAssignment() != null;
     }
 
@@ -312,25 +302,23 @@ public final class PhiInsn extends SsaInsn {
         v.visitPhiInsn(this);
     }
 
-    /**
-     * @return human-readable string for listing dumps
-     */
+    /** {@inheritDoc} */
     public String toHuman() {
         return toHumanWithInline(null);
     }
 
     /**
-     * Returns human-readable string for listing dumps.
-     * Allows sub-classes to specify extra text
-     * @param extra null-ok; the argument to print after the opcode
+     * 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
      */
     protected final String toHumanWithInline(String extra) {
         StringBuffer sb = new StringBuffer(80);
 
         sb.append(SourcePosition.NO_INFO);
-        sb.append(": ");
-        sb.append("phi");       
+        sb.append(": phi");       
 
         if (extra != null) {
             sb.append("(");
@@ -338,6 +326,8 @@ public final class PhiInsn extends SsaInsn {
             sb.append(")");
         }
 
+        RegisterSpec result = getResult();
+        
         if (result == null) {
             sb.append(" .");
         } else {
@@ -361,4 +351,28 @@ public final class PhiInsn extends SsaInsn {
 
         return sb.toString();
     }
+
+    /**
+     * A single phi operand, consiting of source register and block index
+     * for move.
+     */
+    private static class Operand {
+        public RegisterSpec regSpec;
+        public final int blockIndex;
+        public final int ropLabel;       // only used for debugging
+
+        public Operand(final RegisterSpec regSpec, final int blockIndex,
+                final int ropLabel) {
+            this.regSpec = regSpec;
+            this.blockIndex = blockIndex;
+            this.ropLabel = ropLabel;
+        }
+    }
+
+    /**
+     * Visitor interface for instances of this (outer) class.
+     */
+    public static interface Visitor {
+        public void visitPhiInsn(PhiInsn insn);
+    }
 }
index 98503e2..1f45b42 100644 (file)
@@ -21,13 +21,12 @@ import com.android.dx.rop.code.RegisterSpecList;
 import com.android.dx.util.ToHuman;
 
 /**
- * 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.
+ * 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.
  */
 public abstract class RegisterMapper {
-
     /**
      * Gets the count of registers (really, the total register width, since
      * category width is counted) in the new namespace.
@@ -47,17 +46,16 @@ public abstract class RegisterMapper {
      * @return new mapped register list, or old if nothing has changed.
      */
     public final RegisterSpecList map(RegisterSpecList sources) {
-        RegisterSpecList newSources;
-
-        newSources = new RegisterSpecList(sources.size());
-
         int sz = sources.size();
+        RegisterSpecList newSources = new RegisterSpecList(sz);
+
         for (int i = 0; i < sz; i++) {
             newSources.set(i, map(sources.get(i)));
         }
 
         newSources.setImmutable();
-        // Return the old sources if nothing has changed
-        return newSources.equals(sources)? sources: newSources;
+
+        // Return the old sources if nothing has changed.
+        return newSources.equals(sources) ? sources : newSources;
     }
 }
index f34d08d..92e965f 100644 (file)
@@ -59,8 +59,8 @@ public final class SetFactory {
     /**
      * Make IntSet for the dominance-frontier sets.
      *
-     * @param szBlocks &gt;=0; count of basic blocks in method
-     * @return non-null; appropriate set
+     * @param szBlocks {@code >=0;} count of basic blocks in method
+     * @return {@code non-null;} appropriate set
      */
     /*package*/ static IntSet makeDomFrontSet(int szBlocks) {
         return szBlocks <= DOMFRONT_SET_THRESHOLD_SIZE
@@ -72,8 +72,8 @@ public final class SetFactory {
      * Make IntSet for the interference graph sets. Public because
      * InterferenceGraph is in another package.
      *
-     * @param countRegs &gt;=0; count of SSA registers used in method
-     * @return non-null; appropriate set
+     * @param countRegs {@code >=0;} count of SSA registers used in method
+     * @return {@code non-null;} appropriate set
      */
     public static IntSet makeInterferenceSet(int countRegs) {
         return countRegs <= INTERFERENCE_SET_THRESHOLD_SIZE
@@ -84,8 +84,8 @@ public final class SetFactory {
     /**
      * Make IntSet for register live in/out sets.
      *
-     * @param countRegs &gt;=0; count of SSA registers used in method
-     * @return non-null; appropriate set
+     * @param countRegs {@code >=0;} count of SSA registers used in method
+     * @return {@code non-null;} appropriate set
      */
     /*package*/ static IntSet makeLivenessSet(int countRegs) {
         return countRegs <= LIVENESS_SET_THRESHOLD_SIZE
index 99ada7e..6b768e8 100644 (file)
@@ -36,32 +36,50 @@ import com.android.dx.util.ListIntSet;
 import java.util.ArrayList;
 import java.util.BitSet;
 import java.util.Collections;
+import java.util.Comparator;
 import java.util.List;
 
 /**
  * An SSA representation of a basic block.
  */
 public final class SsaBasicBlock {
-
-    /** non-null; insn list associated with this instance */
+    /**
+     * {@code non-null;} comparator for instances of this class that
+     * just compares block labels
+     */
+    public static final Comparator<SsaBasicBlock> LABEL_COMPARATOR =
+        new LabelComparator();
+    
+    /** {@code non-null;} insn list associated with this instance */
     private ArrayList<SsaInsn> insns;
-    /** non-null; predecessor set (by block list index) */
+
+    /** {@code non-null;} predecessor set (by block list index) */
     private BitSet predecessors;
-    /** non-null; successor set (by block list index) */
+
+    /** {@code non-null;} successor set (by block list index) */
     private BitSet successors;
+
     /**
-     * non-null; ordered successor list
+     * {@code non-null;} ordered successor list
      * (same block may be listed more than once)
      */
     private IntList successorList;
-    /** block list index of primary successor, or -1 for no primary successor */
+
+    /**
+     * block list index of primary successor, or {@code -1} for no primary
+     * successor
+     */
     private int primarySuccessor = -1;
+
     /** label of block in rop form */
     private int ropLabel;
-    /** non-null; method we belong to */
+
+    /** {@code non-null;} method we belong to */
     private SsaMethod parent;
+
     /** our index into parent.getBlock() */
     private int index;
+
     /** list of dom children */
     private final ArrayList<SsaBasicBlock> domChildren;
 
@@ -70,19 +88,28 @@ public final class SsaBasicBlock {
      * phi-removal process. Retained for subsequent move scheduling.
      */
     private int movesFromPhisAtEnd = 0;
+
     /** 
      * The number of moves added to the beginning of the block during the
      * phi-removal process. Retained for subsequent move scheduling.
      */
     private int movesFromPhisAtBeginning = 0;
 
-    /** null-ok; indexed by reg: the regs that are live-in at this block */
+    /**
+     * {@code null-ok;} indexed by reg: the regs that are live-in at
+     * this block
+     */
     private IntSet liveIn;
-    /** null-ok; indexed by reg: the regs that are live-out at this block */
+
+    /**
+     * {@code null-ok;} indexed by reg: the regs that are live-out at
+     * this block
+     */
     private IntSet liveOut;
 
     /**
-     * Create a new empty basic block
+     * Creates a new empty basic block.
+     * 
      * @param basicBlockIndex index this block will have
      * @param ropLabel original rop-form label
      * @param parent method of this block
@@ -112,20 +139,14 @@ public final class SsaBasicBlock {
      */
     public static SsaBasicBlock newFromRop(RopMethod rmeth,
             int basicBlockIndex, final SsaMethod parent) {
-
-        BasicBlockList ropBlocks;
-        SsaBasicBlock result;
-        InsnList ropInsns;
-        BasicBlock bb;
-
-        ropBlocks = rmeth.getBlocks();
-        bb = ropBlocks.get(basicBlockIndex);
-
-        result = new SsaBasicBlock(basicBlockIndex, bb.getLabel(), parent);
-
-        ropInsns = bb.getInsns();
+        BasicBlockList ropBlocks = rmeth.getBlocks();
+        BasicBlock bb = ropBlocks.get(basicBlockIndex);
+        SsaBasicBlock result =
+            new SsaBasicBlock(basicBlockIndex, bb.getLabel(), parent);
+        InsnList ropInsns = bb.getInsns();
 
         result.insns.ensureCapacity(ropInsns.size());
+
         for (int i = 0, sz = ropInsns.size() ; i < sz ; i++) {
             result.insns.add(new NormalSsaInsn (ropInsns.get(i), result));
         }
@@ -141,7 +162,6 @@ public final class SsaBasicBlock {
                 = SsaMethod.indexListFromLabelList(ropBlocks,
                     bb.getSuccessors());
 
-
         if (result.successorList.size() != 0) {
             int primarySuccessor = bb.getPrimarySuccessor();
 
@@ -156,7 +176,7 @@ public final class SsaBasicBlock {
      * Adds a basic block as a dom child for this block. Used when constructing
      * the dom tree.
      *
-     * @param child non-null; new dom child
+     * @param child {@code non-null;} new dom child
      */
     void addDomChild(SsaBasicBlock child) {
         domChildren.add(child);
@@ -165,7 +185,7 @@ public final class SsaBasicBlock {
     /**
      * Gets the dom children for this node. Don't modify this list.
      *
-     * @return non-null; list of dom children
+     * @return {@code non-null;} list of dom children
      */
     ArrayList<SsaBasicBlock> getDomChildren() {
         return domChildren;
@@ -175,7 +195,7 @@ public final class SsaBasicBlock {
      * Adds a phi insn to the beginning of this block. The result type of
      * the phi will be set to void, to indicate that it's currently unknown.
      *
-     * @param reg &gt;=0 result reg
+     * @param reg {@code >=0;} result reg
      */
     void addPhiInsnForReg(int reg) {
         insns.add(0, new PhiInsn(reg, this));
@@ -186,7 +206,7 @@ public final class SsaBasicBlock {
      * when the result type or local-association can be determined at phi
      * insert time.
      *
-     * @param resultSpec non-null; reg
+     * @param resultSpec {@code non-null;} reg
      */
     void addPhiInsnForReg(RegisterSpec resultSpec) {
         insns.add(0, new PhiInsn(resultSpec, this));
@@ -196,7 +216,7 @@ public final class SsaBasicBlock {
      * Adds an insn to the head of this basic block, just after any phi
      * insns.
      *
-     * @param insn non-null; rop-form insn to add
+     * @param insn {@code non-null;} rop-form insn to add
      */
     void addInsnToHead(Insn insn) {
         SsaInsn newInsn = SsaInsn.makeFromRop(insn, this);
@@ -208,7 +228,7 @@ public final class SsaBasicBlock {
      * Replaces the last insn in this block. The provided insn must have
      * some branchingness.
      *
-     * @param insn non-null; rop-form insn to add, which must branch.
+     * @param insn {@code non-null;} rop-form insn to add, which must branch.
      */
     void replaceLastInsn(Insn insn) {
         if (insn.getOpcode().getBranchingness() == Rop.BRANCH_NONE) {
@@ -225,8 +245,9 @@ public final class SsaBasicBlock {
     }
 
     /**
-     * Visits each phi insn
-     * @param v callback
+     * Visits each phi insn.
+     * 
+     * @param v {@code non-null;} the callback
      */
     public void forEachPhiInsn(PhiInsn.Visitor v) {
 
@@ -276,7 +297,7 @@ public final class SsaBasicBlock {
     }
 
     /**
-     * @return non-null;the (mutable) instruction list for this block,
+     * @return {@code non-null;} the (mutable) instruction list for this block,
      * with phi insns at the beginning.
      */
     public ArrayList<SsaInsn> getInsns() {
@@ -284,7 +305,7 @@ public final class SsaBasicBlock {
     }
 
     /**
-     * @return non-null; the (mutable) list of phi insns for this block
+     * @return {@code non-null;} the (mutable) list of phi insns for this block
      */
     public List<SsaInsn> getPhiInsns() {
         return insns.subList(0, getCountPhiInsns());
@@ -312,29 +333,30 @@ public final class SsaBasicBlock {
     }
 
     /**
-     * @return non-null;predecessors set, indexed by block index
+     * @return {@code non-null;} predecessors set, indexed by block index
      */
     public BitSet getPredecessors() {
         return predecessors;
     }
 
     /**
-     * @return non-null;successors set, indexed by block index
+     * @return {@code non-null;} successors set, indexed by block index
      */
     public BitSet getSuccessors() {
         return successors;
     }
 
     /**
-     * @return non-null;ordered successor list, containing block indicies
+     * @return {@code non-null;} ordered successor list, containing block
+     * indicies
      */
     public IntList getSuccessorList() {
         return successorList;
     }
 
     /**
-     * @return &gt;= -1; block index of primary successor or -1 if no
-     * primary successor.
+     * @return {@code >= -1;} block index of primary successor or
+     * {@code -1} if no primary successor.
      */
     public int getPrimarySuccessorIndex() {
         return primarySuccessor;
@@ -348,7 +370,8 @@ public final class SsaBasicBlock {
     }
 
     /**
-     * @return null-ok; the primary successor block or null if there is none.
+     * @return {@code null-ok;} the primary successor block or {@code null}
+     * if there is none
      */
     public SsaBasicBlock getPrimarySuccessor() {
         if (primarySuccessor < 0) {
@@ -373,7 +396,7 @@ public final class SsaBasicBlock {
     }
 
     /**
-     * @return non-null; method that contains this block
+     * @return {@code non-null;} method that contains this block
      */
     public SsaMethod getParent() {
         return parent;
@@ -383,7 +406,7 @@ public final class SsaBasicBlock {
      * Inserts a new empty GOTO block as a predecessor to this block.
      * All previous predecessors will be predecessors to the new block.
      *
-     * @return non-null; an appropriately-constructed instance
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public SsaBasicBlock insertNewPredecessor() {
         SsaBasicBlock newPred = parent.makeNewGotoBlock();
@@ -412,15 +435,15 @@ public final class SsaBasicBlock {
     }
 
     /**
-     * Constructs and inserts a new empty GOTO block <code>Z</code> between
-     * this block (<code>A</code>) and a current successor block
-     * (<code>B</code>). The new block will replace B as A's successor and
+     * Constructs and inserts a new empty GOTO block {@code Z} between
+     * this block ({@code A}) and a current successor block
+     * ({@code B}). The new block will replace B as A's successor and
      * A as B's predecessor. A and B will no longer be directly connected.
      * If B is listed as a successor multiple times, all references
      * are replaced.
      *
      * @param other current successor (B)
-     * @return non-null; an appropriately-constructed instance
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public SsaBasicBlock insertNewSuccessor(SsaBasicBlock other) {
         SsaBasicBlock newSucc = parent.makeNewGotoBlock();
@@ -457,8 +480,9 @@ public final class SsaBasicBlock {
     }
 
     /**
-     * Replace an old successor with a new successor.
-     * Throws RuntimeException if oldIndex was not a successor.
+     * Replaces an old successor with a new successor. This will throw
+     * RuntimeException if {@code oldIndex} was not a successor.
+     * 
      * @param oldIndex index of old successor block
      * @param newIndex index of new successor block.
      */
@@ -467,7 +491,7 @@ public final class SsaBasicBlock {
             return;
         }
 
-        // Update us
+        // Update us.
         successors.set(newIndex);
 
         if (primarySuccessor == oldIndex) {
@@ -482,10 +506,10 @@ public final class SsaBasicBlock {
 
         successors.clear(oldIndex);
 
-        // Update new successor
+        // Update new successor.
         parent.getBlocks().get(newIndex).predecessors.set(index);
 
-        // Update old successor
+        // Update old successor.
         parent.getBlocks().get(oldIndex).predecessors.clear(index);
     }
 
@@ -495,7 +519,7 @@ public final class SsaBasicBlock {
      * is not an exit predecessor or is the exit block, this block does
      * nothing. For use by {@link com.android.dx.ssa.SsaMethod#makeExitBlock}
      *
-     * @param exitBlock non-null; exit block
+     * @param exitBlock {@code non-null;} exit block
      */
     public void exitBlockFixup(SsaBasicBlock exitBlock) {
         if (this == exitBlock) {
@@ -519,6 +543,7 @@ public final class SsaBasicBlock {
      * before the last instruction. If the result of the final instruction
      * is the source in question, then the move is placed at the beginning of
      * the primary successor block. This is for unversioned registers.
+     * 
      * @param result move destination
      * @param source move source
      */
@@ -568,8 +593,8 @@ public final class SsaBasicBlock {
             NormalSsaInsn toAdd;
 
             toAdd = new NormalSsaInsn(
-                        new PlainInsn(Rops.opMove(result.getType()),
-                                SourcePosition.NO_INFO, result, sources), this);
+                    new PlainInsn(Rops.opMove(result.getType()),
+                            SourcePosition.NO_INFO, result, sources), this);
 
             insns.add(insns.size() - 1, toAdd);
 
@@ -578,12 +603,12 @@ public final class SsaBasicBlock {
     }
 
     /**
-     * Add a move instruction after the phi insn block.
+     * Adds a move instruction after the phi insn block.
+     * 
      * @param result move destination
      * @param source move source
      */
     public void addMoveToBeginning (RegisterSpec result, RegisterSpec source) {
-               
         if (result.getReg() == source.getReg()) {
             // Sometimes we end up with no-op moves. Ignore them here.
             return;
@@ -638,9 +663,10 @@ public final class SsaBasicBlock {
      * reads of any register happen before writes to that register.
      * NOTE: caller is expected to returnSpareRegisters()!
      *
-     * TODO See Briggs, et al "Practical Improvements to the Construction and
+     * TODO: See Briggs, et al "Practical Improvements to the Construction and
      * Destruction of Static Single Assignment Form" section 5. a) This can
      * be done in three passes.
+     * 
      * @param toSchedule List of instructions. Must consist only of moves.
      */
     private void scheduleUseBeforeAssigned(List<SsaInsn> toSchedule) {
@@ -740,12 +766,12 @@ public final class SsaBasicBlock {
     }
 
     /**
-     * Adds regV to the live-out list for this block.
-     * Called by the liveness analyzer.
+     * Adds {@code regV} to the live-out list for this block. This is called
+     * by the liveness analyzer.
+     * 
      * @param regV register that is live-out for this block.
      */
-    public void
-    addLiveOut (int regV) {
+    public void addLiveOut (int regV) {
         if (liveOut == null) {
             liveOut = SetFactory.makeLivenessSet(parent.getRegCount());
         }
@@ -754,12 +780,12 @@ public final class SsaBasicBlock {
     }
 
     /**
-     * Adds regV to the live-in list for this block.
-     * Called by the liveness analyzer.
+     * Adds {@code regV} to the live-in list for this block. This is
+     * called by the liveness analyzer.
+     * 
      * @param regV register that is live-in for this block.
      */
-    public void
-    addLiveIn (int regV) {
+    public void addLiveIn (int regV) {
         if (liveIn == null) {
             liveIn = SetFactory.makeLivenessSet(parent.getRegCount());
         }
@@ -771,7 +797,7 @@ public final class SsaBasicBlock {
      * Returns the set of live-in registers. Valid after register
      * interference graph has been generated, otherwise empty.
      *
-     * @return non-null; live-in register set.
+     * @return {@code non-null;} live-in register set.
      */
     public IntSet getLiveInRegs() {
         if (liveIn == null) {
@@ -784,7 +810,7 @@ public final class SsaBasicBlock {
      * Returns the set of live-out registers. Valid after register
      * interference graph has been generated, otherwise empty.
      * 
-     * @return non-null; live-out register set.
+     * @return {@code non-null;} live-out register set.
      */
     public IntSet getLiveOutRegs() {
         if (liveOut == null) {
@@ -814,7 +840,7 @@ public final class SsaBasicBlock {
     }
         
     /**
-     * Sorts move instructions added via <code>addMoveToEnd</code> during
+     * Sorts move instructions added via {@code addMoveToEnd} during
      * phi removal so that results don't overwrite sources that are used.
      * For use after all phis have been removed and all calls to
      * addMoveToEnd() have been made.<p>
@@ -825,7 +851,6 @@ public final class SsaBasicBlock {
      * refers value before any other phis have executed.
      */
     public void scheduleMovesFromPhis() {
-
         if (movesFromPhisAtBeginning > 1) {
             List<SsaInsn> toSchedule;
 
@@ -869,12 +894,12 @@ public final class SsaBasicBlock {
                     }
 
                     if (!moveExceptionInterferes) {
-                        // The easy case
+                        // This is the easy case.
                         insns.remove(movesFromPhisAtBeginning);
                         insns.add(0, firstNonPhiMoveInsn);
                     } else {
-                        // We need to move the result to a spare reg and move it
-                        // back.
+                        // We need to move the result to a spare reg
+                        // and move it back.
 
                         int spareRegister;
                         RegisterSpec originalResultSpec;
@@ -883,9 +908,10 @@ public final class SsaBasicBlock {
                         spareRegister = parent.borrowSpareRegister(
                                 originalResultSpec.getCategory());
 
-                        // We now move it to a spare register
+                        // We now move it to a spare register.
                         firstNonPhiMoveInsn.changeResultReg(spareRegister);
-                        RegisterSpec tempSpec = firstNonPhiMoveInsn.getResult();
+                        RegisterSpec tempSpec =
+                            firstNonPhiMoveInsn.getResult();
 
                         insns.add(0, firstNonPhiMoveInsn);
 
@@ -915,14 +941,15 @@ public final class SsaBasicBlock {
                                 insns.size() - 1));
         }
 
-        // Return registers borrowed here and in scheduleUseBeforeAssigned()
+        // Return registers borrowed here and in scheduleUseBeforeAssigned().
         parent.returnSpareRegisters();
 
     }
 
     /**
-     * Visit all insns in this block
-     * @param visitor callback interface
+     * Visit all insns in this block.
+     * 
+     * @param visitor {@code non-null;} callback interface
      */
     public void forEachInsn(SsaInsn.Visitor visitor) {
         for (SsaInsn insn: insns) {
@@ -930,20 +957,41 @@ public final class SsaBasicBlock {
         }
     }
 
+    /** {@inheritDoc} */
     public String toString() {
         return "{" + index + ":" + Hex.u2(ropLabel) + '}';
     }
 
     /**
-     * Visitor interface for basic blocks
+     * Visitor interface for basic blocks.
      */
     public interface Visitor {
-
         /**
          * Indicates a block has been visited by an iterator method.
-         * @param v non-null; block visited
-         * @param parent null-ok; parent node if applicable.
+         * 
+         * @param v {@code non-null;} block visited
+         * @param parent {@code null-ok;} parent node if applicable
          */
         void visitBlock (SsaBasicBlock v, SsaBasicBlock parent);
     }
+
+    /**
+     * Label comparator.
+     */
+    public static final class LabelComparator
+            implements Comparator<SsaBasicBlock> {
+        /** {@inheritDoc} */
+        public int compare(SsaBasicBlock b1, SsaBasicBlock b2) {
+            int label1 = b1.ropLabel;
+            int label2 = b2.ropLabel;
+
+            if (label1 < label2) {
+                return -1;
+            } else if (label1 > label2) {
+                return 1;
+            } else {
+                return 0;
+            }
+        }
+    }
 }
index a731fcb..8d31eef 100644 (file)
@@ -122,7 +122,7 @@ public class SsaConverter {
     /**
      * Inserts Z nodes as new predecessors for every node that has multiple
      * successors and multiple predecessors.
-     * @param result non-null; method to process
+     * @param result {@code non-null;} method to process
      */
     private static void edgeSplitPredecessors(SsaMethod result) {
         ArrayList<SsaBasicBlock> blocks = result.getBlocks();
@@ -138,7 +138,7 @@ public class SsaConverter {
     }
 
     /**
-     * @param block non-null; block in question
+     * @param block {@code non-null;} block in question
      * @return true if this node needs to have a unique predecessor created for
      * it.
      */
@@ -200,7 +200,7 @@ public class SsaConverter {
     /**
      * Inserts Z nodes for every node that needs a new 
      * successor.
-     * @param result non-null; method to process
+     * @param result {@code non-null;} method to process
      */
     private static void edgeSplitSuccessors(SsaMethod result) {
         ArrayList<SsaBasicBlock> blocks = result.getBlocks();
@@ -248,8 +248,8 @@ public class SsaConverter {
      * See Appel algorithm 19.6
      * Place Phi functions in appropriate locations.
      *
-     * @param ssaMeth non-null; method to process. Modifications made in-place
-     * @param localInfo non-null; Local variable info, used when placing phis
+     * @param ssaMeth {@code non-null;} method to process. Modifications made in-place
+     * @param localInfo {@code non-null;} Local variable info, used when placing phis
      */
     private static void placePhiFunctions (SsaMethod ssaMeth,
             LocalVariableInfo localInfo) {
index d9e33a0..815f82d 100644 (file)
@@ -23,24 +23,34 @@ import com.android.dx.util.ToHuman;
  * An instruction in SSA form
  */
 public abstract class SsaInsn implements ToHuman, Cloneable {
+    /** {@code non-null;} the block that contains this instance */
+    private final SsaBasicBlock block;
 
-    protected RegisterSpec result;
-    protected final SsaBasicBlock block;
+    /** {@code null-ok;} result register */
+    private RegisterSpec result;
 
     /**
-     * Constructs an instance
-     * @param block block containing this insn. Can never change.
+     * 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.
      */
-    protected SsaInsn(final SsaBasicBlock block) {
+    protected SsaInsn(RegisterSpec result, SsaBasicBlock block) {
+        if (block == null) {
+            throw new NullPointerException("block == null");
+        }
+
         this.block = block;
+        this.result = result;
     }
 
     /**
-     * Makes a new SSA insn form a ROP insn
+     * Makes a new SSA insn form a rop insn.
      *
-     * @param insn non-null; rop insn
-     * @param block non-null; owning block
-     * @return non-null; an appropriately constructed instance
+     * @param insn {@code non-null;} rop insn
+     * @param block {@code non-null;} owning block
+     * @return {@code non-null;} an appropriately constructed instance
      */
     public static SsaInsn makeFromRop(Insn insn, SsaBasicBlock block) {
         return new NormalSsaInsn(insn, block);
@@ -58,6 +68,7 @@ public abstract class SsaInsn implements ToHuman, Cloneable {
 
     /**
      * Like {@link com.android.dx.rop.code.Insn getResult()}.
+     * 
      * @return result register
      */
     public RegisterSpec getResult() {
@@ -65,8 +76,22 @@ 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) {
+        if (result == null) {
+            throw new NullPointerException("result == null");
+        }
+
+        this.result = result;
+    }
+
+    /**
      * Like {@link com.android.dx.rop.code.Insn getSources()}.
-     * @return non-null; sources list
+     * 
+     * @return {@code non-null;} sources list
      */
     abstract public RegisterSpecList getSources();
 
@@ -80,7 +105,8 @@ public abstract class SsaInsn implements ToHuman, Cloneable {
     }
 
     /**
-     * is the specified reg the result reg?
+     * 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
@@ -91,9 +117,10 @@ public abstract class SsaInsn implements ToHuman, Cloneable {
 
 
     /**
-     * Changes the result register if this insn has a result.
-     * Used during renaming.
-     * @param reg new result register.
+     * 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) {
         if (result != null) {
@@ -102,10 +129,10 @@ public abstract class SsaInsn implements ToHuman, Cloneable {
     }
 
     /**
-     * Sets the local association for the result of this insn.
-     * This is sometimes updated during the SsaRenamer process.
+     * Sets the local association for the result of this insn. This is
+     * sometimes updated during the SsaRenamer process.
      *
-     * @param local null-ok; New debug/local variable info.
+     * @param local {@code null-ok;} new debug/local variable info
      */
     public final void setResultLocal(LocalItem local) {
         LocalItem oldItem = result.getLocalItem();
@@ -120,10 +147,11 @@ public abstract class SsaInsn implements ToHuman, Cloneable {
     /**
      * Map registers after register allocation.
      *
-     * @param mapper
+     * @param mapper {@code non-null;} mapping from old to new registers
      */
     public final void mapRegisters(RegisterMapper mapper) {
         RegisterSpec oldResult = result;
+
         result = mapper.map(result);
         block.getParent().updateOneDefinition(this, oldResult);
         mapSourceRegisters(mapper);        
@@ -136,13 +164,12 @@ public abstract class SsaInsn implements ToHuman, Cloneable {
      */
     abstract public void mapSourceRegisters(RegisterMapper mapper);
 
-
     /**
-     * Returns the Rop opcode for this insn, or null if this is a phi insn
+     * Returns the Rop opcode for this insn, or null if this is a phi insn.
      *
-     * TODO move this up into NormalSsaInsn
+     * TODO: Move this up into NormalSsaInsn.
      *
-     * @return null-ok; Rop opcode if there is one.
+     * @return {@code null-ok;} Rop opcode if there is one.
      */
     abstract public Rop getOpcode();
 
@@ -150,20 +177,21 @@ 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
+     * TODO: Move this up into NormalSsaInsn.
      *
-     * @return null-ok; Rop insn if there is one.
+     * @return {@code null-ok;} Rop insn if there is one.
      */
     abstract public Insn getOriginalRopInsn();
 
     /**
      * Gets the spec of a local variable assignment that occurs at this
      * instruction, or null if no local variable assignment occurs. This
-     * may be the result register, or for <code>mark-local</code> insns
+     * may be the result register, or for {@code mark-local} insns
      * it may be the source.
      *
-     * @return null-ok; a local-associated register spec or null
      * @see com.android.dx.rop.code.Insn#getLocalAssignment() 
+     * 
+     * @return {@code null-ok;} a local-associated register spec or null
      */
     public RegisterSpec getLocalAssignment() {
         if (result != null && result.getLocalItem() != null) {
@@ -176,7 +204,8 @@ 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
+     * 
+     * @param reg the register in question
      * @return true if the reg is a source
      */
     public boolean isRegASource(int reg) {
@@ -186,9 +215,9 @@ public abstract class SsaInsn implements ToHuman, Cloneable {
     /**
      * Transform back to ROP form.
      *
-     * TODO move this up into NormalSsaInsn
+     * TODO: Move this up into NormalSsaInsn.
      *
-     * @return non-null; a ROP representation of this instruction, with
+     * @return {@code non-null;} a ROP representation of this instruction, with
      * updated registers.
      */
     public abstract Insn toRopInsn();
@@ -208,8 +237,8 @@ public abstract class SsaInsn implements ToHuman, Cloneable {
     public abstract boolean hasSideEffect();
 
     /**
-     * @return true if this is a move (but not a move-operand or move-exception)
-     * instruction
+     * @return true if this is a move (but not a move-operand or
+     * move-exception) instruction
      */
     public boolean isNormalMoveInsn() {
         return false;
@@ -229,8 +258,9 @@ public abstract class SsaInsn implements ToHuman, Cloneable {
     abstract public boolean canThrow();
 
     /**
-     * accepts a visitor
-     * @param v visitor
+     * Accepts a visitor.
+     * 
+     * @param v {@code non-null} the visitor
      */
     public abstract void accept(Visitor v);
 
@@ -238,22 +268,21 @@ public abstract class SsaInsn implements ToHuman, Cloneable {
      * Visitor interface for this class.
      */
     public static interface Visitor {
-
         /**
          * Any non-phi move instruction
-         * @param insn non-null; the instruction to visit
+         * @param insn {@code non-null;} the instruction to visit
          */
         public void visitMoveInsn(NormalSsaInsn insn);
 
         /**
          * Any phi insn
-         * @param insn non-null; the instruction to visit
+         * @param insn {@code non-null;} the instruction to visit
          */
         public void visitPhiInsn(PhiInsn insn);
 
         /**
          * Any insn that isn't a move or a phi (which is also a move).
-         * @param insn non-null; the instruction to visit
+         * @param insn {@code non-null;} the instruction to visit
          */
         public void visitNonMoveInsn(NormalSsaInsn insn);
     }
index 49f8ea5..4e815fb 100644 (file)
@@ -235,7 +235,7 @@ public final class SsaMethod {
     
     /**
      * Makes a new basic block for this method,
-     * which is empty besides a single <code>GOTO</code>. Successors and
+     * which is empty besides a single {@code GOTO}. Successors and
      * predecessors are not yet set.
      *
      * @return new block
@@ -272,7 +272,7 @@ public final class SsaMethod {
     }
 
     /**
-     * @return null-ok; block of exit block or null if there is none
+     * @return {@code null-ok;} block of exit block or null if there is none
      */
     public SsaBasicBlock getExitBlock() {
         return exitBlockIndex < 0 ? null : blocks.get(exitBlockIndex);
@@ -339,7 +339,7 @@ public final class SsaMethod {
     }
 
     /**
-     * @return non-null; basic block list, do not modify.
+     * @return {@code non-null;} basic block list, do not modify.
      */
     public ArrayList<SsaBasicBlock> getBlocks() {
         return blocks;
@@ -349,7 +349,7 @@ public final class SsaMethod {
      * Returns the count of reachable blocks in this method: blocks that have
      * predecessors (or are the start block)
      *
-     * @return &gt;= 0; number of reachable basic blocks
+     * @return {@code >= 0;} number of reachable basic blocks
      */
     public int getCountReachableBlocks() {
         int ret = 0;
@@ -444,7 +444,7 @@ public final class SsaMethod {
             }
             /**
              * Adds specified insn to the uses list for all of its sources.
-             * @param insn non-null; insn to process
+             * @param insn {@code non-null;} insn to process
              */
             private void addToUses(SsaInsn insn) {
                 RegisterSpecList rl = insn.getSources();
@@ -466,9 +466,9 @@ public final class SsaMethod {
     /**
      * Updates the use list for a single change in source register.
      *
-     * @param insn non-null; insn being changed
-     * @param oldSource null-ok; The source that was used, if applicable
-     * @param newSource non-null; the new source being used
+     * @param insn {@code non-null;} insn being changed
+     * @param oldSource {@code null-ok;} The source that was used, if applicable
+     * @param newSource {@code non-null;} the new source being used
      */
     void onSourceChanged(SsaInsn insn,
             RegisterSpec oldSource, RegisterSpec newSource) {
@@ -491,9 +491,9 @@ public final class SsaMethod {
     /**
      * Updates the use list for a source list change.
      *
-     * @param insn insn non-null; insn being changed. insn.getSources()
+     * @param insn {@code insn non-null;} insn being changed. insn.getSources()
      * must return the new source list.
-     * @param oldSources null-ok; list of sources that were previously used.
+     * @param oldSources {@code null-ok;} list of sources that were previously used.
      */
     void onSourcesChanged(SsaInsn insn, RegisterSpecList oldSources) {
         if (useList == null) return;
@@ -512,12 +512,12 @@ public final class SsaMethod {
     }
 
     /**
-     * Removes a given <code>insn</code> from the use lists for the given
-     * <code>oldSources</code> (rather than the sources currently
+     * Removes a given {@code insn} from the use lists for the given
+     * {@code oldSources} (rather than the sources currently
      * returned by insn.getSources()).
      *
-     * @param insn non-null; insn in question
-     * @param oldSources null-ok; registers whose use lists <code>insn</code>
+     * @param insn {@code non-null;} insn in question
+     * @param oldSources {@code null-ok;} registers whose use lists {@code insn}
      * should be removed form.
      */
     private void removeFromUseList(SsaInsn insn, RegisterSpecList oldSources) {
@@ -536,7 +536,7 @@ public final class SsaMethod {
      * Adds an insn to both the use and def lists. For use when adding
      * a new insn to the method.
      *
-     * @param insn non-null; insn to add
+     * @param insn {@code non-null;} insn to add
      */
     void onInsnAdded(SsaInsn insn) {
         onSourcesChanged(insn, null);
@@ -547,7 +547,7 @@ public final class SsaMethod {
       * Removes an instruction from use and def lists. For use during
       * instruction removal.
       *
-      * @param insn non-null; insn to remove.
+      * @param insn {@code non-null;} insn to remove.
       */
      void onInsnRemoved(SsaInsn insn) {
          if (useList != null) {
@@ -579,9 +579,9 @@ public final class SsaMethod {
     /**
      * Updates a single definition.
      *
-     * @param insn non-null; insn who's result should be recorded as
+     * @param insn {@code non-null;} insn who's result should be recorded as
      * a definition
-     * @param oldResult null-ok; a previous result that should be no longer
+     * @param oldResult {@code null-ok;} a previous result that should be no longer
      * considered a definition by this insn
      */
     void updateOneDefinition(SsaInsn insn, RegisterSpec oldResult) {
@@ -641,7 +641,7 @@ public final class SsaMethod {
      * local variable. Each SSA reg may be associated with at most one
      * local var.
      *
-     * @param spec non-null; ssa reg
+     * @param spec {@code non-null;} ssa reg
      * @return true if reg is ever associated with a local
      */
     public boolean isRegALocal(RegisterSpec spec) {
@@ -681,7 +681,7 @@ public final class SsaMethod {
     /**
      * Makes a new SSA register. For use after renaming has completed.
      *
-     * @return &gt;=0 new SSA register.
+     * @return {@code >=0;} new SSA register.
      */
     public int makeNewSsaReg() {
         int reg = registerCount++;
@@ -692,7 +692,7 @@ public final class SsaMethod {
 
     /**
      * Visit all insns in this method
-     * @param visitor non-null; callback interface
+     * @param visitor {@code non-null;} callback interface
      */
     public void forEachInsn(SsaInsn.Visitor visitor) {
         for (SsaBasicBlock block: blocks) {
@@ -702,7 +702,7 @@ public final class SsaMethod {
 
     /**
      * Visits each phi insn in this method
-     * @param v non-null; callback
+     * @param v {@code non-null;} callback
      */
     public void forEachPhiInsn(PhiInsn.Visitor v) {
         for (SsaBasicBlock block: blocks) {
@@ -716,7 +716,7 @@ public final class SsaMethod {
      * method once for every block. This depth-first walk may be run forward
      * from the method entry point or backwards from the method exit points.
      * @param reverse true if this should walk backwards from the exit points
-     * @param v non-null; callback interface. <code>parent</code>is set
+     * @param v {@code non-null;} callback interface. {@code parent}is set
      * unless this is the root node
      */
     public void forEachBlockDepthFirst(boolean reverse,
@@ -755,10 +755,10 @@ public final class SsaMethod {
 
     /**
      * Visits blocks in dom-tree order, starting at the current node.
-     * The <code>parent</code> parameter of the Visitor.visitBlock callback
+     * The {@code parent} parameter of the Visitor.visitBlock callback
      * is currently always set to null.
      *
-     * @param v non-null; callback interface
+     * @param v {@code non-null;} callback interface
      */
     public void forEachBlockDepthFirstDom(SsaBasicBlock.Visitor v) {
         BitSet visited = new BitSet(getBlocks().size());
@@ -785,7 +785,7 @@ public final class SsaMethod {
     /**
      * Deletes all insns in the set from this method
      *
-     * @param deletedInsns non-null; insns to delete
+     * @param deletedInsns {@code non-null;} insns to delete
      */
     public void deleteInsns(Set<SsaInsn> deletedInsns) {
         for (SsaBasicBlock block: getBlocks()) {
index 64bad2c..9a9af3b 100644 (file)
@@ -71,7 +71,7 @@ class SsaRenamer implements Runnable {
      * Indexed by block index; register version state for each block start.
      * This list is updated by each dom parent for its children. The only
      * sub-arrays that exist at any one time are the start states for blocks
-     * yet to be processed by a <code>BlockRenamer</code> instance.
+     * yet to be processed by a {@code BlockRenamer} instance.
      */
     private final RegisterSpec[][] startsForBlocks;
 
@@ -87,7 +87,7 @@ class SsaRenamer implements Runnable {
     /**
      * Constructs an instance of the renamer
      *
-     * @param ssaMeth non-null; un-renamed SSA method that will
+     * @param ssaMeth {@code non-null;} un-renamed SSA method that will
      * be renamed.
      */
     SsaRenamer (final SsaMethod ssaMeth) {
@@ -168,8 +168,8 @@ class SsaRenamer implements Runnable {
 
     /**
      * Duplicates a RegisterSpec array
-     * @param orig non-null; array to duplicate
-     * @return non-null; new instance
+     * @param orig {@code non-null;} array to duplicate
+     * @return {@code non-null;} new instance
      */
     private static  RegisterSpec[] dupArray(RegisterSpec[] orig) {
         RegisterSpec[] copy = new RegisterSpec[orig.length];
@@ -183,7 +183,7 @@ class SsaRenamer implements Runnable {
      * Gets a local variable item for a specified register.
      *
      * @param ssaReg register in SSA name space
-     * @return null-ok; Local variable name or null if none
+     * @return {@code null-ok;} Local variable name or null if none
      */
     private LocalItem getLocalForNewReg(int ssaReg) {
         if (ssaReg < ssaRegToLocalItems.size()) {
@@ -238,11 +238,11 @@ class SsaRenamer implements Runnable {
      * as appropriate.
      */
     private class BlockRenamer implements SsaInsn.Visitor{
-        /** non-null; block we're processing. */
+        /** {@code non-null;} block we're processing. */
         private final SsaBasicBlock block;
 
         /**
-         * non-null; indexed by old register name. The current top of the
+         * {@code non-null;} indexed by old register name. The current top of the
          * version stack as seen by this block. It's initialized from
          * the ending state of its dom parent, updated as the block's
          * instructions are processed, and then copied to each one of its
@@ -265,10 +265,10 @@ class SsaRenamer implements Runnable {
         private final RenamingMapper mapper;
 
         /**
-         * Constructs a block renamer instance. Call <code>process</code>
+         * Constructs a block renamer instance. Call {@code process}
          * to process.
          *
-         * @param block non-null; block to process
+         * @param block {@code non-null;} block to process
          */
         BlockRenamer(final SsaBasicBlock block) {
             this.block = block;
@@ -388,13 +388,13 @@ class SsaRenamer implements Runnable {
          * local.
          * <li> ensures that only one SSA register
          * at a time is considered to be associated with a local variable. When
-         * <code>currentMapping</code> is updated and the newly added element
+         * {@code currentMapping} is updated and the newly added element
          * is named, strip that name from any other SSA registers.
          * </ol>
          *
-         * @param ropReg &gt;= 0 Rop register number
-         * @param ssaReg non-null; An SSA register that has just
-         * been added to <code>currentMapping</code>
+         * @param ropReg {@code >= 0;} rop register number
+         * @param ssaReg {@code non-null;} an SSA register that has just
+         * been added to {@code currentMapping}
          */
         private void addMapping(int ropReg, RegisterSpec ssaReg) {
             int ssaRegNum = ssaReg.getReg();
index 997da21..3d891c9 100644 (file)
@@ -19,7 +19,7 @@ package com.android.dx.ssa._tests;
 import junit.framework.TestCase;
 
 /**
- * Test the class <code>com.android.dx.ssa.DomFront</code>.
+ * Test the class {@code com.android.dx.ssa.DomFront}.
  */
 public class _DomFront
         extends TestCase {
index d3ff7c7..6416e84 100644 (file)
@@ -106,7 +106,6 @@ public class FirstFitAllocator extends RegisterAllocator {
             }
 
             for (int j = i + 1; j < oldRegCount; j++) {
-
                 if (mapped.get(j) || isDefinitionMoveParam(j)) {
                     continue;
                 }
index 14eac90..e759fe6 100644 (file)
@@ -40,9 +40,10 @@ import java.util.TreeMap;
  * kept together if possible.
  */
 public class FirstFitLocalCombiningAllocator extends RegisterAllocator {
+    /** local debug flag */
     private static final boolean DEBUG = false;
 
-    /** maps local variable to a list of associated SSA registers*/
+    /** maps local variable to a list of associated SSA registers */
     private final Map<LocalItem, ArrayList<RegisterSpec>> localVariables;
 
     /** list of move-result-pesudo instructions seen in this method */
@@ -69,17 +70,16 @@ public class FirstFitLocalCombiningAllocator extends RegisterAllocator {
     /** true if converter should take steps to minimize rop-form registers*/
     private final boolean minimizeRegisters;
 
-
     /**
      * Constructs instance.
      *
-     * @param ssaMeth non-null; method to process
+     * @param ssaMeth {@code non-null;} method to process
      * @param interference non-null interference graph for SSA registers
      * @param minimizeRegisters true if converter should take steps to
      * minimize rop-form registers
      */
     public FirstFitLocalCombiningAllocator(
-            final SsaMethod ssaMeth, InterferenceGraph interference,
+            SsaMethod ssaMeth, InterferenceGraph interference,
             boolean minimizeRegisters) {
         super(ssaMeth, interference);
 
@@ -122,22 +122,24 @@ public class FirstFitLocalCombiningAllocator extends RegisterAllocator {
             printLocalVars();
         }
 
-        if(DEBUG) System.out.println("--->Mapping local-associated params");
+        if (DEBUG) System.out.println("--->Mapping local-associated params");
         handleLocalAssociatedParams();
 
-        if(DEBUG) System.out.println("--->Mapping other params");
+        if (DEBUG) System.out.println("--->Mapping other params");
         handleUnassociatedParameters();
 
-        if(DEBUG) System.out.println("--->Mapping invoke-range");
+        if (DEBUG) System.out.println("--->Mapping invoke-range");
         handleInvokeRangeInsns();
         
-        if(DEBUG) System.out.println("--->Mapping local-associated non-params");
+        if (DEBUG) {
+            System.out.println("--->Mapping local-associated non-params");
+        }
         handleLocalAssociatedOther();
 
-        if(DEBUG) System.out.println("--->Mapping check-cast results");
+        if (DEBUG) System.out.println("--->Mapping check-cast results");
         handleCheckCastResults();
 
-        if(DEBUG) System.out.println("--->Mapping others");
+        if (DEBUG) System.out.println("--->Mapping others");
         handleNormalUnassociated();
 
         return mapper;
@@ -168,13 +170,13 @@ public class FirstFitLocalCombiningAllocator extends RegisterAllocator {
      * Maps all local-associated parameters to Rop registers.
      */
     private void handleLocalAssociatedParams() {
-        for (ArrayList<RegisterSpec> ssaRegs: localVariables.values()) {
+        for (ArrayList<RegisterSpec> ssaRegs : localVariables.values()) {
             int sz = ssaRegs.size();
             int paramIndex = -1;
             int paramCategory = 0;
 
             // First, find out if this local variable is a parameter
-            for (int i = 0 ; i < sz ; i++) {
+            for (int i = 0; i < sz; i++) {
                 RegisterSpec ssaSpec = ssaRegs.get(i);
                 int ssaReg = ssaSpec.getReg();
 
@@ -201,7 +203,7 @@ public class FirstFitLocalCombiningAllocator extends RegisterAllocator {
      * Gets the parameter index for SSA registers that are method parameters.
      * -1 is returned for non-parameter registers.
      *
-     * @param ssaReg &gt;=0 SSA register to look up
+     * @param ssaReg {@code >=0;} SSA register to look up
      * @return parameter index or -1 if not a parameter
      */
     private int getParameterIndexForReg(int ssaReg) {
@@ -222,13 +224,14 @@ public class FirstFitLocalCombiningAllocator extends RegisterAllocator {
     }
 
     /**
-     * Maps all local-associated registers that are not parameters. Tries to
-     * find an unreserved range that's wide enough for all of the SSA registers,
-     * and then tries to map them all to that range. If not all fit,
-     * a new range is tried until all registers have been fit.
+     * Maps all local-associated registers that are not parameters. 
+     * Tries to find an unreserved range that's wide enough for all of
+     * the SSA registers, and then tries to map them all to that
+     * range. If not all fit, a new range is tried until all registers
+     * have been fit.
      */
     private void handleLocalAssociatedOther() {
-        for (ArrayList<RegisterSpec> specs: localVariables.values()) {
+        for (ArrayList<RegisterSpec> specs : localVariables.values()) {
             int ropReg = 0;
 
             boolean done;
@@ -261,8 +264,8 @@ public class FirstFitLocalCombiningAllocator extends RegisterAllocator {
      * used rop space as reserved. SSA registers that don't fit are left
      * unmapped.
      *
-     * @param specs non-null; SSA registers to attempt to map
-     * @param ropReg &gt;=0 rop register to map to
+     * @param specs {@code non-null;} SSA registers to attempt to map
+     * @param ropReg {@code >=0;} rop register to map to
      * @param maxAllowedCategory 1 or 2, maximum category allowed in mapping.
      * @param markReserved do so if true
      * @return true if all registers wew mapped, false if some remain unmapped.
@@ -271,7 +274,7 @@ public class FirstFitLocalCombiningAllocator extends RegisterAllocator {
             ArrayList<RegisterSpec> specs, int ropReg,
             int maxAllowedCategory, boolean markReserved) {
         boolean remaining = false;
-        for(RegisterSpec spec: specs) {
+        for (RegisterSpec spec : specs) {
             if (ssaRegsMapped.get(spec.getReg())) {
                 continue;
             }
@@ -291,8 +294,8 @@ public class FirstFitLocalCombiningAllocator extends RegisterAllocator {
     /**
      * Tries to map an SSA register to a rop register.
      *
-     * @param ssaSpec non-null; SSA register
-     * @param ropReg &gt;=0 rop register
+     * @param ssaSpec {@code non-null;} SSA register
+     * @param ropReg {@code >=0;} rop register
      * @param maxAllowedCategory 1 or 2, the maximum category that the SSA
      * register is allowed to be.
      * @return true if map succeeded, false if not.
@@ -312,8 +315,8 @@ public class FirstFitLocalCombiningAllocator extends RegisterAllocator {
     /**
      * Marks a range of Rop registers as "reserved for a local variable"
      *
-     * @param ropReg &gt;= 0 rop register to reserve
-     * @param category &gt; 0 width to reserve
+     * @param ropReg {@code >= 0;} rop register to reserve
+     * @param category {@code > 0;} width to reserve
      */
     private void markReserved(int ropReg, int category) {
         reservedRopRegs.set(ropReg, ropReg + category, true);
@@ -323,8 +326,8 @@ public class FirstFitLocalCombiningAllocator extends RegisterAllocator {
      * Checks to see if any Rop registers in the specified range are reserved
      * for local variables or parameters
      *
-     * @param ropRangeStart &gt;= 0 lowest Rop register
-     * @param width &gt; 0 number of Rop registers in range.
+     * @param ropRangeStart {@code >= 0;} lowest Rop register
+     * @param width {@code > 0;} number of Rop registers in range.
      * @return true if any register in range is marked reserved
      */
     private boolean rangeContainsReserved(int ropRangeStart, int width) {
@@ -351,9 +354,9 @@ public class FirstFitLocalCombiningAllocator extends RegisterAllocator {
     /**
      * Finds a range of unreserved Rop registers.
      *
-     * @param startReg &gt;= 0; a Rop register to start the search at
-     * @param width &gt; 0; the width, in registers, required.
-     * @return &gt;= 0; start of available register range.
+     * @param startReg {@code >= 0;} a Rop register to start the search at
+     * @param width {@code > 0;} the width, in registers, required.
+     * @return {@code >= 0;} start of available register range.
      */
     private int findNextUnreservedRopReg(int startReg, int width) {
         if (minimizeRegisters && !isThisPointerReg(startReg)) {
@@ -381,12 +384,12 @@ public class FirstFitLocalCombiningAllocator extends RegisterAllocator {
 
     /**
      * Finds a range of rop regs that can be used for local variables.
-     * If <code>MIX_LOCALS_AND_OTHER</code> is false, this means any
+     * If {@code MIX_LOCALS_AND_OTHER} is false, this means any
      * rop register that has not yet been used.
      *
-     * @param startReg &gt;= 0; a Rop register to start the search at
-     * @param width &gt; 0; the width, in registers, required.
-     * @return &gt;= 0; start of available register range.
+     * @param startReg {@code >= 0;} a Rop register to start the search at
+     * @param width {@code > 0;} the width, in registers, required.
+     * @return {@code >= 0;} start of available register range.
      */
     private int findRopRegForLocal(int startReg, int width) {
         if (minimizeRegisters && !isThisPointerReg(startReg)) {
@@ -418,6 +421,7 @@ public class FirstFitLocalCombiningAllocator extends RegisterAllocator {
      */
     private void handleUnassociatedParameters() {
         int szSsaRegs = ssaMeth.getRegCount();
+
         for (int ssaReg = 0; ssaReg < szSsaRegs; ssaReg++) {
             if (ssaRegsMapped.get(ssaReg)) {
                 // We already did this one above
@@ -437,7 +441,7 @@ public class FirstFitLocalCombiningAllocator extends RegisterAllocator {
      * Handles all insns that want a register range for their sources.
      */
     private void handleInvokeRangeInsns() {
-        for(NormalSsaInsn insn: invokeRangeInsns) {
+        for(NormalSsaInsn insn : invokeRangeInsns) {
             adjustAndMapSourceRangeRange(insn);
         }
     }
@@ -503,6 +507,7 @@ public class FirstFitLocalCombiningAllocator extends RegisterAllocator {
      */
     private void handleNormalUnassociated() {
         int szSsaRegs = ssaMeth.getRegCount();
+
         for (int ssaReg = 0; ssaReg < szSsaRegs; ssaReg++) {
             if (ssaRegsMapped.get(ssaReg)) {
                 // We already did this one
@@ -525,11 +530,11 @@ public class FirstFitLocalCombiningAllocator extends RegisterAllocator {
     }
 
     /**
-     * Checks to see if <code>ssaSpec</code> can be mapped to
-     * <code>ropReg</code>. Checks interference graph and ensures
+     * Checks to see if {@code ssaSpec} can be mapped to
+     * {@code ropReg}. Checks interference graph and ensures
      * the range does not cross the parameter range.
      *
-     * @param ssaSpec non-null; SSA spec
+     * @param ssaSpec {@code non-null;} SSA spec
      * @param ropReg prosepctive new-namespace reg
      * @return true if mapping is possible
      */
@@ -541,7 +546,7 @@ public class FirstFitLocalCombiningAllocator extends RegisterAllocator {
  
     /**
      * Returns true if the specified Rop register + category
-     * will cross the boundry between the lower <code>paramWidth</code>
+     * will cross the boundry between the lower {@code paramWidth}
      * registers reserved for method params and the upper registers. We cannot
      * allocate a register that spans the param block and the normal block,
      * because we will be moving the param block to high registers later.
@@ -561,7 +566,6 @@ public class FirstFitLocalCombiningAllocator extends RegisterAllocator {
      */
     private void analyzeInstructions() {
         ssaMeth.forEachInsn(new SsaInsn.Visitor() {
-
             /** {@inheritDoc} */
             public void visitMoveInsn(NormalSsaInsn insn) {
                 processInsn(insn);
@@ -580,14 +584,14 @@ public class FirstFitLocalCombiningAllocator extends RegisterAllocator {
             /**
              * This method collects three types of instructions:
              * 1) Adds a local variable assignment to the
-             *    <code>localVariables</code> map.
+             *    {@code localVariables} map.
              * 2) Add move-result-pseudo to the
-             *    <code>moveResultPseudoInsns</code> list.
+             *    {@code moveResultPseudoInsns} list.
              * 3) Add invoke-range to the
-             *    <code>invokeRangeInsns</code> list.
+             *    {@code invokeRangeInsns} list.
              *
-             * @param insn non-null; insn that may represent a local variable
-             * assignment.
+             * @param insn {@code non-null;} insn that may represent a
+             * local variable assignment
              */
             private void processInsn(SsaInsn insn) {
                 RegisterSpec assignment;
@@ -596,7 +600,8 @@ public class FirstFitLocalCombiningAllocator extends RegisterAllocator {
                 if (assignment != null) {
                     LocalItem local = assignment.getLocalItem();
 
-                    ArrayList<RegisterSpec> regList = localVariables.get(local);
+                    ArrayList<RegisterSpec> regList
+                        = localVariables.get(local);
 
                     if (regList == null) {
                         regList = new ArrayList<RegisterSpec>();
@@ -622,11 +627,11 @@ public class FirstFitLocalCombiningAllocator extends RegisterAllocator {
     }
 
     /**
-     * Adds a mapping from an SSA register to a Rop register. <code>
-     * canMapReg</code> should have already been called.
+     * Adds a mapping from an SSA register to a Rop register.
+     * {@link #canMapReg} should have already been called.
      *
-     * @param ssaSpec non-null; SSA register to map from
-     * @param ropReg &gt;=0; Rop register to map to
+     * @param ssaSpec {@code non-null;} SSA register to map from
+     * @param ropReg {@code >=0;} Rop register to map to
      */
     private void addMapping(RegisterSpec ssaSpec, int ropReg) {
         int ssaReg = ssaSpec.getReg();
@@ -639,8 +644,7 @@ public class FirstFitLocalCombiningAllocator extends RegisterAllocator {
 
         if (DEBUG) {
             System.out.printf("Add mapping s%d -> v%d c:%d\n",
-                    ssaSpec.getReg(), ropReg, ssaSpec.getCategory());               
-
+                    ssaSpec.getReg(), ropReg, ssaSpec.getCategory());
         }
 
         int category = ssaSpec.getCategory();
@@ -655,16 +659,15 @@ public class FirstFitLocalCombiningAllocator extends RegisterAllocator {
      * will fall in a contiguous range in Rop form. Moves are inserted as
      * necessary to allow the range to be allocated.
      *
-     * @param insn non-null; insn whos sources to process
+     * @param insn {@code non-null;} insn whos sources to process
      */
     private void adjustAndMapSourceRangeRange(NormalSsaInsn insn) {
-        int newRegStart;
-
-        newRegStart = findRangeAndAdjust(insn);
+        int newRegStart = findRangeAndAdjust(insn);
 
         RegisterSpecList sources = insn.getSources();
         int szSources = sources.size();
         int nextRopReg = newRegStart;
+
         for (int i = 0; i < szSources; i++) {
             RegisterSpec source = sources.get(i);
             int sourceReg = source.getReg();
@@ -708,10 +711,10 @@ public class FirstFitLocalCombiningAllocator extends RegisterAllocator {
      * instruction's sources. First, try to center the range around
      * sources that have already been mapped to Rop registers. If that fails,
      * just find a new contiguous range that doesn't interfere.
-
-     * @param insn non-null; the insn whose sources need to fit. Must be
-     * last insn in basic block.
-     * @return &gt;= 0 rop register of start of range
+     * 
+     * @param insn {@code non-null;} the insn whose sources need to
+     * fit. Must be last insn in basic block.
+     * @return {@code >= 0;} rop register of start of range
      */
     private int findRangeAndAdjust(NormalSsaInsn insn) {
         RegisterSpecList sources = insn.getSources();
@@ -811,11 +814,11 @@ public class FirstFitLocalCombiningAllocator extends RegisterAllocator {
      * specified instruction. Does not bother trying to center the range
      * around an already-mapped source register;
      *
-     * @param insn non-null; insn to build range for
-     * @param rangeLength &gt;=0 length required in register units.
-     * @param categoriesForIndex non-null; indexed by source index;
+     * @param insn {@code non-null;} insn to build range for
+     * @param rangeLength {@code >=0;} length required in register units.
+     * @param categoriesForIndex {@code non-null;} indexed by source index;
      * the category for each source.
-     * @param outMovesRequired non-null; an output parameter indexed by
+     * @param outMovesRequired {@code non-null;} an output parameter indexed by
      * source index that will contain the set of sources which need
      * moves inserted.
      * @return the rop register that starts the fitting range.
@@ -842,11 +845,11 @@ public class FirstFitLocalCombiningAllocator extends RegisterAllocator {
      * Attempts to build a plan for fitting a range of sources into rop
      * registers.
      *
-     * @param ropReg &gt;=0 rop reg that begins range
-     * @param insn non-null; insn to plan range for
-     * @param categoriesForIndex non-null; indexed by source index;
+     * @param ropReg {@code >= 0;} rop reg that begins range
+     * @param insn {@code non-null;} insn to plan range for
+     * @param categoriesForIndex {@code non-null;} indexed by source index;
      * the category for each source.
-     * @param outMovesRequired non-null; an output parameter indexed by
+     * @param outMovesRequired {@code non-null;} an output parameter indexed by
      * source index that will contain the set of sources which need
      * moves inserted.
      * @return the width of the fit that that does not involve added moves or
@@ -912,7 +915,7 @@ public class FirstFitLocalCombiningAllocator extends RegisterAllocator {
      * Converts a bit set of SSA registers into a RegisterSpecList containing
      * the definition specs of all the registers.
      *
-     * @param ssaSet non-null; set of SSA registers
+     * @param ssaSet {@code non-null;} set of SSA registers
      * @return list of RegisterSpecs as noted above
      */
     RegisterSpecList ssaSetToSpecs(IntSet ssaSet) {
@@ -931,14 +934,14 @@ public class FirstFitLocalCombiningAllocator extends RegisterAllocator {
     /**
      * Gets a local item associated with an ssa register, if one exists
      *
-     * @param ssaReg &gt;= 0 SSA register
-     * @return null-ok; associated local item or null
+     * @param ssaReg {@code >= 0;} SSA register
+     * @return {@code null-ok;} associated local item or null
      */
     private LocalItem getLocalItemForReg(int ssaReg) {
         for(Map.Entry<LocalItem, ArrayList<RegisterSpec>> entry:
                 localVariables.entrySet()) {
 
-            for (RegisterSpec spec: entry.getValue()) {
+            for (RegisterSpec spec : entry.getValue()) {
                 if (spec.getReg() == ssaReg) {
                     return entry.getKey();
                 }
index abc5fca..a639af5 100644 (file)
@@ -34,14 +34,14 @@ import java.util.BitSet;
  * frequently are created when catch blocks are edge-split.
  */
 public class IdenticalBlockCombiner {
-
-    private RopMethod ropMethod;
-    private BasicBlockList blocks;
-    private BasicBlockList newBlocks;
+    private final RopMethod ropMethod;
+    private final BasicBlockList blocks;
+    private final BasicBlockList newBlocks;
 
     /**
-     * Constructs instance. Call <code>process()</code> to run.
-     * @param rm instance to process
+     * Constructs instance. Call {@code process()} to run.
+     * 
+     * @param rm {@code non-null;} instance to process
      */
     public IdenticalBlockCombiner(RopMethod rm) {
         ropMethod = rm;
@@ -50,10 +50,11 @@ public class IdenticalBlockCombiner {
     }
 
     /**
-     * Runs algorithm.  TODO: this is n^2, and could be made linear-ish with
-     * a hash.
+     * Runs algorithm. TODO: This is n^2, and could be made linear-ish with
+     * a hash. In particular, hash the contents of each block and only
+     * compare blocks with the same hash.
      *
-     * @return new method that has been processed
+     * @return {@code non-null;} new method that has been processed
      */
     public RopMethod process() {
         int szBlocks = blocks.size();
@@ -78,14 +79,15 @@ public class IdenticalBlockCombiner {
 
                 BasicBlock iBlock = blocks.labelToBlock(iLabel);
 
-                if (toDelete.get(iLabel) || iBlock.getSuccessors().size() > 1) {
+                if (toDelete.get(iLabel)
+                        || iBlock.getSuccessors().size() > 1) {
                     continue;
                 }
 
                 IntList toCombine = new IntList();
 
                 // ...and see if they can be combined with any other preds...
-                for (int j = i + 1; j <szPreds; j++) {
+                for (int j = i + 1; j < szPreds; j++) {
                     int jLabel = preds.get(j);
                     BasicBlock jBlock = blocks.labelToBlock(jLabel);
 
@@ -101,7 +103,7 @@ public class IdenticalBlockCombiner {
             }
         }
 
-        for (int i = szBlocks - 1; i > 0; i--) {
+        for (int i = szBlocks - 1; i >= 0; i--) {
             if (toDelete.get(newBlocks.get(i).getLabel())) {
                 newBlocks.set(i, null);
             }
@@ -113,7 +115,14 @@ public class IdenticalBlockCombiner {
         return new RopMethod(newBlocks, ropMethod.getFirstLabel());
     }
 
-    private boolean compareInsns(BasicBlock a, BasicBlock b) {
+    /**
+     * 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
+     */
+    private static boolean compareInsns(BasicBlock a, BasicBlock b) {
         return a.getInsns().contentEquals(b.getInsns());
     }
 
@@ -131,11 +140,7 @@ public class IdenticalBlockCombiner {
         for (int i = 0; i < szBetas; i++) {
             int betaLabel = betaLabels.get(i);
             BasicBlock bb = blocks.labelToBlock(betaLabel);
-
-            IntList preds;
-
-            preds = ropMethod.labelToPredecessors(bb.getLabel());
-
+            IntList preds = ropMethod.labelToPredecessors(bb.getLabel());
             int szPreds = preds.size();
 
             for (int j = 0; j < szPreds; j++) {
@@ -147,19 +152,19 @@ public class IdenticalBlockCombiner {
 
     /**
      * Replaces one of a block's successors with a different label. Constructs
-     * an updated BasicBlock instance and places it in <code>newBlocks</code>.
+     * an updated BasicBlock instance and places it in {@code newBlocks}.
      *
      * @param block block to replace
      * @param oldLabel label of successor to replace
      * @param newLabel label of new successor
      */
     private void replaceSucc(BasicBlock block, int oldLabel, int newLabel) {
-
         IntList newSuccessors = block.getSuccessors().mutableCopy();
         int newPrimarySuccessor;
 
         newSuccessors.set(newSuccessors.indexOf(oldLabel), newLabel);
         newPrimarySuccessor = block.getPrimarySuccessor();
+
         if (newPrimarySuccessor == oldLabel) {
             newPrimarySuccessor = newLabel;
         }
index 282420b..e6cde62 100644 (file)
@@ -34,14 +34,17 @@ import java.util.ArrayList;
  * A register interference graph
  */
 public class InterferenceGraph {
-    /** interference graph, indexed by register in both dimensions  */
+    /**
+     * {@code non-null;} interference graph, indexed by register in
+     * both dimensions
+     */
     private final ArrayList<IntSet> interference;
 
     /**
      * Creates a new graph.
      *
-     * @param countRegs &gt;=0 the start count of registers in the namespace.
-     * New registers can be added subsequently.
+     * @param countRegs {@code >= 0;} the start count of registers in
+     * the namespace. New registers can be added subsequently.
      */
     public InterferenceGraph(int countRegs) {
         interference = new ArrayList<IntSet>(countRegs);
@@ -83,9 +86,9 @@ public class InterferenceGraph {
     /**
      * Merges the interference set for a register into a given bit set
      *
-     * @param reg &gt;=0 register
-     * @param set non-null; interference set; will be merged with set for
-     * given register
+     * @param reg {@code >= 0;} register
+     * @param set {@code non-null;} interference set; will be merged
+     * with set for given register
      */
     public void mergeInterferenceSet(int reg, IntSet set) {
         if (reg < interference.size()) {
@@ -100,8 +103,10 @@ public class InterferenceGraph {
      */
     private void ensureCapacity(int size) {
         int countRegs = interference.size();
+
         interference.ensureCapacity(size);
-        for (int i = countRegs ; i < size; i++) {
+
+        for (int i = countRegs; i < size; i++) {
             interference.add(SetFactory.makeInterferenceSet(size));
         }
     }
index 5ae6e07..6d60651 100644 (file)
@@ -28,28 +28,27 @@ import java.util.ArrayList;
 
 /**
  * From Appel "Modern Compiler Implementation in Java" algorithm 19.17
- * Calculate the live ranges for register <code>reg</code>.<p>
+ * Calculate the live ranges for register {@code reg}.<p>
  *
  * v = regV <p>
  * s = insn <p>
  * M = visitedBlocks <p>
  */
 public class LivenessAnalyzer {
-
     /**
-     * non-null; index by basic block indexed set of basic blocks
+     * {@code non-null;} index by basic block indexed set of basic blocks
      * that have already been visited. "M" as written in the original Appel
      * algorithm.
      */
     private final BitSet visitedBlocks;
 
     /**
-     * non-null; set of blocks remaing to visit as "live out as block"
+     * {@code non-null;} set of blocks remaing to visit as "live out as block"
      */
     private final BitSet liveOutBlocks;
 
     /**
-     * &gt;=0; SSA register currently being analyzed.
+     * {@code >=0;} SSA register currently being analyzed.
      * "v" in the original Appel algorithm.
      */
     private final int regV;
@@ -63,7 +62,7 @@ public class LivenessAnalyzer {
     /** block "n" in Appel 19.17 */
     SsaBasicBlock blockN;
 
-    /** index of statement <code>s</code> in <code>blockN</code>*/
+    /** index of statement {@code s} in {@code blockN}*/
     private int statementIndex;
 
     /** the next function to call. one of the four constants below */
@@ -77,12 +76,12 @@ public class LivenessAnalyzer {
 
     /**
      * Runs register liveness algorithm for a method, updating the
-     * live in/out information in <code>SsaBasicBlock</code> instances and
+     * live in/out information in {@code SsaBasicBlock} instances and
      * returning an interference graph.
      *
-     * @param ssaMeth non-null; Method to process.
-     * @return non-null; interference graph indexed by SSA registers in both
-     * directions.
+     * @param ssaMeth {@code non-null;} Method to process.
+     * @return {@code non-null;} interference graph indexed by SSA
+     * registers in both directions.
      */
     public static InterferenceGraph constructInterferenceGraph(
             SsaMethod ssaMeth) {
@@ -102,13 +101,13 @@ public class LivenessAnalyzer {
     /**
      * Makes liveness analyzer instance for specific register.
      *
-     * @param ssaMeth non-null; method to process
+     * @param ssaMeth {@code non-null;} method to process
      * @param reg register whose liveness to analyze
-     * @param interference non-null; indexed by SSA reg in both dimensions;
-     * graph to update
+     * @param interference {@code non-null;} indexed by SSA reg in
+     * both dimensions; graph to update
      *
      */
-    private LivenessAnalyzer(final SsaMethod ssaMeth, final int reg,
+    private LivenessAnalyzer(SsaMethod ssaMeth, int reg,
             InterferenceGraph interference) {
         this.ssaMeth = ssaMeth;
         this.regV = reg;
@@ -118,10 +117,9 @@ public class LivenessAnalyzer {
     }
 
     /**
-     * The algorithm in Appel is presented in
-     * partial tail-recursion form. Obviously, that's not
-     * efficient in java, so this function serves
-     * as the dispatcher instead.
+     * The algorithm in Appel is presented in partial tail-recursion
+     * form. Obviously, that's not efficient in java, so this function
+     * serves as the dispatcher instead.
      */
     private void handleTailRecursion() {
         while (nextFunction != DONE) {
@@ -152,7 +150,7 @@ public class LivenessAnalyzer {
     public void run() {
         List<SsaInsn> useList = ssaMeth.getUseListForRegister(regV);
 
-        for (SsaInsn insn: useList) {
+        for (SsaInsn insn : useList) {
             nextFunction = DONE;
 
             if (insn instanceof PhiInsn) {
@@ -212,7 +210,6 @@ public class LivenessAnalyzer {
      * "v is live-in at s"
      */
     private void liveInAtStatement() {
-
         // if s is the first statement in block N
         if (statementIndex == 0) {
             // v is live-in at n
@@ -232,7 +229,6 @@ public class LivenessAnalyzer {
      * "v is live-out at s"
      */
     private void liveOutAtStatement() {
-
         SsaInsn statement = blockN.getInsns().get(statementIndex);
         RegisterSpec rs = statement.getResult();
 
@@ -253,12 +249,12 @@ public class LivenessAnalyzer {
      * as the result of another phi, and the phi removal move scheduler may
      * generate moves that over-write the live result.
      *
-     * @param ssaMeth non-null; method to pricess
-     * @param interference non-null; interference graph
+     * @param ssaMeth {@code non-null;} method to pricess
+     * @param interference {@code non-null;} interference graph
      */
     private static void coInterferePhis(SsaMethod ssaMeth,
             InterferenceGraph interference) {
-        for (SsaBasicBlock b: ssaMeth.getBlocks()) {
+        for (SsaBasicBlock b : ssaMeth.getBlocks()) {
             List<SsaInsn> phis = b.getPhiInsns();
 
             int szPhis = phis.size();
index cd3b2f1..f6dc961 100644 (file)
@@ -29,11 +29,9 @@ import java.util.ArrayList;
  * about normal or wide categories. Used for debugging.
  */
 public class NullRegisterAllocator extends RegisterAllocator {
-
     /** {@inheritDoc} */
-    public NullRegisterAllocator(
-            final SsaMethod ssaMeth, final InterferenceGraph interference) {
-
+    public NullRegisterAllocator(SsaMethod ssaMeth,
+            InterferenceGraph interference) {
         super(ssaMeth, interference);
     }
 
@@ -49,8 +47,7 @@ public class NullRegisterAllocator extends RegisterAllocator {
     public RegisterMapper allocateRegisters() {
         int oldRegCount = ssaMeth.getRegCount();
 
-        BasicRegisterMapper mapper
-                = new BasicRegisterMapper(oldRegCount);
+        BasicRegisterMapper mapper = new BasicRegisterMapper(oldRegCount);
 
         for (int i = 0; i < oldRegCount; i++) {
             mapper.addMapping(i, i*2, 2);
index 764b03a..127fc83 100644 (file)
@@ -37,7 +37,6 @@ import java.util.ArrayList;
  * Base class of all register allocators
  */
 public abstract class RegisterAllocator {
-
     /** method being processed */
     protected final SsaMethod ssaMeth;
 
@@ -45,13 +44,13 @@ public abstract class RegisterAllocator {
     protected final InterferenceGraph interference;
 
     /**
-     * Creates an instance. Call <code>allocateRegisters</code> to run.
+     * Creates an instance. Call {@code allocateRegisters} to run.
      * @param ssaMeth method to process.
      * @param interference Interference graph, indexed by register in both
      * dimensions.
      */
-    public RegisterAllocator(
-            final SsaMethod ssaMeth, final InterferenceGraph interference) {
+    public RegisterAllocator(SsaMethod ssaMeth,
+            InterferenceGraph interference) {
         this.ssaMeth = ssaMeth;
         this.interference = interference;
     }
@@ -61,24 +60,25 @@ public abstract class RegisterAllocator {
      * of the namespace, and thus should be moved up to the top of the
      * namespace after phi removal.
      *
-     * @return true if params should be moved from low to high.
+     * @return {@code true} if params should be moved from low to high
      */
     public abstract boolean wantsParamsMovedHigh();
 
     /**
      * Runs the algorithm.
-     * @return a register mapper to apply to the <code>SsaMethod</code>
+     * 
+     * @return a register mapper to apply to the {@code SsaMethod}
      */
     public abstract RegisterMapper allocateRegisters();
 
     /**
      * Returns the category (width) of the definition site of the register.
-     * Returns 1 for undefined registers.
+     * Returns {@code 1} for undefined registers.
      *
      * @param reg register
-     * @return 1 or 2
+     * @return {@code 1..2}
      */
-    protected int getCategoryForSsaReg(int reg) {
+    protected final int getCategoryForSsaReg(int reg) {
         SsaInsn definition;
         definition = ssaMeth.getDefinitionForRegister(reg);
 
@@ -93,25 +93,26 @@ public abstract class RegisterAllocator {
     /**
      * Returns the RegisterSpec of the definition of the register.
      *
-     * @param reg &gt;= 0 SSA register
+     * @param reg {@code >= 0;} SSA register
      * @return definition spec of the register or null if it is never defined
-     * (for the case of "version 0" SSA registers).
+     * (for the case of "version 0" SSA registers)
      */
-    protected RegisterSpec getDefinitionSpecForSsaReg(int reg) {
-        SsaInsn definition;
-        definition = ssaMeth.getDefinitionForRegister(reg);
+    protected final RegisterSpec getDefinitionSpecForSsaReg(int reg) {
+        SsaInsn definition = ssaMeth.getDefinitionForRegister(reg);
 
         return definition == null ? null : definition.getResult();
     }
 
     /**
      * Returns true if the definition site of this register is a
-     * move-param (ie, this is a method parameter)
+     * move-param (ie, this is a method parameter).
+     * 
      * @param reg register in question
      * @return true if this is a method parameter
      */
     protected boolean isDefinitionMoveParam(int reg) {
         SsaInsn defInsn = ssaMeth.getDefinitionForRegister(reg);
+
         if (defInsn instanceof NormalSsaInsn) {
             NormalSsaInsn ndefInsn = (NormalSsaInsn) defInsn;
 
@@ -127,10 +128,10 @@ public abstract class RegisterAllocator {
      * interference graph in the process. The insn currently must be the
      * last insn in a block.
      *
-     * @param insn non-null; insn to insert move before, must be last insn
-     * in block.
-     * @param reg non-null; SSA register to duplicate
-     * @return non-null; spec of new SSA register created by move
+     * @param insn {@code non-null;} insn to insert move before, must
+     * be last insn in block
+     * @param reg {@code non-null;} SSA register to duplicate
+     * @return {@code non-null;} spec of new SSA register created by move
      */
     protected final RegisterSpec insertMoveBefore(SsaInsn insn,
             RegisterSpec reg) {
@@ -155,19 +156,17 @@ public abstract class RegisterAllocator {
         }
 
         /*
-         * Get new register and make new move instruction
+         * Get new register and make new move instruction.
          */
 
-        // new result must not have associated local variable
+        // The new result must not have an associated local variable.
         RegisterSpec newRegSpec = RegisterSpec.make(ssaMeth.makeNewSsaReg(),
                 reg.getTypeBearer());
 
-        SsaInsn toAdd;
-
-        toAdd = SsaInsn.makeFromRop(
-                    new PlainInsn(Rops.opMove(newRegSpec.getType()),
-                            SourcePosition.NO_INFO, newRegSpec,
-                            RegisterSpecList.make(reg)), block);
+        SsaInsn toAdd = SsaInsn.makeFromRop(
+                new PlainInsn(Rops.opMove(newRegSpec.getType()),
+                        SourcePosition.NO_INFO, newRegSpec,
+                        RegisterSpecList.make(reg)), block);
 
         insns.add(insnIndex, toAdd);
 
index 1c59549..9201bcb 100644 (file)
@@ -38,7 +38,9 @@ import com.android.dx.util.IntList;
 import com.android.dx.util.Hex;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.BitSet;
+import java.util.Comparator;
 import java.util.HashMap;
 import java.util.List;
 
@@ -46,55 +48,67 @@ import java.util.List;
  * Converts a method in SSA form to ROP form.
  */
 public class SsaToRop {
-
+    /** local debug flag */
     private static final boolean DEBUG = false;
 
-    /** non-null; method to process */
+    /** {@code non-null;} method to process */
     private final SsaMethod ssaMeth;
 
     /**
-     * true if the converter should attempt to minimize
+     * {@code true} if the converter should attempt to minimize
      * the rop-form register count
      */
     private final boolean minimizeRegisters;
 
-    /** interference graph */
-    private InterferenceGraph interference;
+    /** {@code non-null;} interference graph */
+    private final InterferenceGraph interference;
 
     /**
      * Converts a method in SSA form to ROP form.
-     * @param ssaMeth input
-     * @return non-null; rop-form output
+     * 
+     * @param ssaMeth {@code non-null;} method to process
+     * @param minimizeRegisters {@code true} if the converter should
+     * attempt to minimize the rop-form register count
+     * @return {@code non-null;} rop-form output
      */
     public static RopMethod convertToRopMethod(SsaMethod ssaMeth,
             boolean minimizeRegisters) {
         return new SsaToRop(ssaMeth, minimizeRegisters).convert();
     }
 
-    private SsaToRop(final SsaMethod ssaMethod, boolean minimizeRegisters) {
+    /**
+     * 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
+     */
+    private SsaToRop(SsaMethod ssaMethod, boolean minimizeRegisters) {
         this.minimizeRegisters = minimizeRegisters;
         this.ssaMeth = ssaMethod;
+        this.interference =
+            LivenessAnalyzer.constructInterferenceGraph(ssaMethod);
     }
 
+    /**
+     * Performs the conversion.
+     * 
+     * @return {@code non-null;} rop-form output
+     */
     private RopMethod convert() {
-        interference = LivenessAnalyzer.constructInterferenceGraph(ssaMeth);
-
         if (DEBUG) {
             interference.dumpToStdout();
         }
 
-        RegisterAllocator allocator;
-        RegisterMapper mapper;
-
-        // These are other allocators for debugging or historical comparison
-
-        //allocator = new NullRegisterAllocator(ssaMeth, interference);
-        //allocator = new FirstFitAllocator(ssaMeth, interference);
+        // These are other allocators for debugging or historical comparison:
+        // allocator = new NullRegisterAllocator(ssaMeth, interference);
+        // allocator = new FirstFitAllocator(ssaMeth, interference);
 
-        allocator = new FirstFitLocalCombiningAllocator(ssaMeth, interference,
-                minimizeRegisters);
+        RegisterAllocator allocator =
+            new FirstFitLocalCombiningAllocator(ssaMeth, interference,
+                    minimizeRegisters);
 
-        mapper = allocator.allocateRegisters();
+        RegisterMapper mapper = allocator.allocateRegisters();
 
         if (DEBUG) {
             System.out.println("Printing reg map");
@@ -113,22 +127,20 @@ public class SsaToRop {
 
         removeEmptyGotos();
 
-        RopMethod ropMethod;
-
-        ropMethod = convertToRop();
-
+        RopMethod ropMethod = new RopMethod(convertBasicBlocks(),
+                ssaMeth.blockIndexToRopLabel(ssaMeth.getEntryBlockIndex()));
         ropMethod = new IdenticalBlockCombiner(ropMethod).process();
 
         return ropMethod;
     }
 
-
     /**
-     * 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 blocks containing the real return or
-     * throw statements must be removed.
+     * 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
+     * blocks containing the real return or throw statements must be
+     * removed.
      */
     private void removeEmptyGotos() {
         final ArrayList<SsaBasicBlock> blocks = ssaMeth.getBlocks();
@@ -139,8 +151,7 @@ public class SsaToRop {
 
                 if ((insns.size() == 1)
                         && (insns.get(0).getOpcode() == Rops.GOTO)) {
-
-                    BitSet preds = (BitSet)b.getPredecessors().clone();
+                    BitSet preds = (BitSet) b.getPredecessors().clone();
 
                     for (int i = preds.nextSetBit(0); i >= 0;
                             i = preds.nextSetBit(i + 1)) {
@@ -154,89 +165,47 @@ public class SsaToRop {
     }
 
     /**
-     * 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.
-     */
-    public int[] getRegistersByFrequency() {
-        int regCount = ssaMeth.getRegCount();
-        Integer[] ret = new Integer[ssaMeth.getRegCount()];
-
-        for (int i = 0; i < regCount; i++) {
-            ret[i] = i;
-        }
-
-        java.util.Arrays.sort(ret, new java.util.Comparator<Integer>() {
-            public int compare (Integer o1, Integer o2) {
-                return ssaMeth.getUseListForRegister(o2).size()
-                        - ssaMeth.getUseListForRegister(o1).size();
-            }
-
-            public boolean equals(Object o) {
-                return o == this;
-            }
-        });
-
-        int result[] = new int[regCount];
-
-        for (int i = 0; i < regCount; i++) {
-            result[i] = ret[i];
-        }
-
-        return result;
-    }
-
-    /**
-     * See Appel 19.6
-     * To remove the phi instructions in an edge-split SSA representation
-     * we know we can always insert a move in a predecessor block
+     * See Appel 19.6. To remove the phi instructions in an edge-split
+     * SSA representation we know we can always insert a move in a
+     * predecessor block.
      */
     private void removePhiFunctions() {
-        for (SsaBasicBlock block: ssaMeth.getBlocks()) {
-            // Add moves in all the pred blocks for each phi insn`
+        for (SsaBasicBlock block : ssaMeth.getBlocks()) {
+            // Add moves in all the pred blocks for each phi insn.
             block.forEachPhiInsn(new PhiVisitor(block));
-            // Delete the phi insns
+            // Delete the phi insns.
             block.removeAllPhiInsns();
         }
 
         /*
          * After all move insns have been added: sort them so they don't
-         * destructively interfere
+         * destructively interfere.
          */
-        for (SsaBasicBlock block: ssaMeth.getBlocks()) {
+        for (SsaBasicBlock block : ssaMeth.getBlocks()) {
             block.scheduleMovesFromPhis();
         }
     }
 
     /**
-     * PhiSuccessorUpdater for adding move instructions to predecessors based
-     * on phi insns.
+     * Helper for {@link #removePhiFunctions}: PhiSuccessorUpdater for
+     * adding move instructions to predecessors based on phi insns.
      */
     private class PhiVisitor implements PhiInsn.Visitor {
-        SsaBasicBlock block;
+        private final SsaBasicBlock block;
 
-        PhiVisitor (final SsaBasicBlock block) {
+        PhiVisitor(SsaBasicBlock block) {
             this.block = block;
         }
 
-        public void visitPhiInsn (PhiInsn insn) {
-            RegisterSpecList sources;
-            RegisterSpec result;
+        public void visitPhiInsn(PhiInsn insn) {
             ArrayList<SsaBasicBlock> blocks = ssaMeth.getBlocks();
-
-            sources = insn.getSources();
-            result = insn.getResult();
-
+            RegisterSpecList sources = insn.getSources();
+            RegisterSpec result = insn.getResult();
             int sz = sources.size();
 
-            for (int i = 0; i <sz; i++) {
-                RegisterSpec source;
-
-                source = sources.get(i);
-
-                SsaBasicBlock predBlock;
-
-                predBlock = blocks.get(
+            for (int i = 0; i < sz; i++) {
+                RegisterSpec source = sources.get(i);
+                SsaBasicBlock predBlock = blocks.get(
                         insn.predBlockIndexForSourcesIndex(i));
 
                 predBlock.addMoveToEnd(result, source);
@@ -250,9 +219,7 @@ public class SsaToRop {
      * Dalvik calling convention.
      */
     private void moveParametersToHighRegisters() {
-
         int paramWidth = ssaMeth.getParamWidth();
-
         BasicRegisterMapper mapper
                 = new BasicRegisterMapper(ssaMeth.getRegCount());
         int regCount = ssaMeth.getRegCount();
@@ -273,11 +240,6 @@ public class SsaToRop {
         ssaMeth.mapRegisters(mapper);
     }
 
-    private RopMethod convertToRop() {
-        return new RopMethod(convertBasicBlocks(),
-                ssaMeth.blockIndexToRopLabel(ssaMeth.getEntryBlockIndex()));
-    }
-
     /**
      * @return rop-form basic block list
      */
@@ -314,7 +276,7 @@ public class SsaToRop {
      * Validates that a basic block is a valid end predecessor. It must
      * end in a RETURN or a THROW. Throws a runtime exception on error.
      *
-     * @param b non-null; block to validate
+     * @param b {@code non-null;} block to validate
      * @throws RuntimeException on error
      */
     private void verifyValidExitPredecessor(SsaBasicBlock b) {
@@ -337,14 +299,13 @@ public class SsaToRop {
      * @return ROP block
      */
     private BasicBlock convertBasicBlock(SsaBasicBlock block) {
-        BasicBlock result;
         IntList successorList = block.getRopLabelSuccessorList();
         int primarySuccessorLabel = block.getPrimarySuccessorRopLabel();
-        // Filter out any reference to the SSA form's exit block
 
-        // exit block may be null
-        SsaBasicBlock exitBlock = ssaMeth.getExitBlock();
+        // Filter out any reference to the SSA form's exit block.
 
+        // Exit block may be null.
+        SsaBasicBlock exitBlock = ssaMeth.getExitBlock();
         int exitRopLabel = (exitBlock == null) ? -1 : exitBlock.getRopLabel();
 
         if (successorList.contains(exitRopLabel)) {
@@ -362,7 +323,7 @@ public class SsaToRop {
 
         successorList.setImmutable();
 
-        result = new BasicBlock(
+        BasicBlock result = new BasicBlock(
                 block.getRopLabel(), convertInsns(block.getInsns()),
                 successorList,
                 primarySuccessorLabel);
@@ -371,16 +332,14 @@ public class SsaToRop {
     }
 
     /**
-     * Converts an insn list to rop form
-     * @param ssaInsns non-null;old instructions
-     * @return non-null; immutable instruction list
+     * Converts an insn list to rop form.
+     * 
+     * @param ssaInsns {@code non-null;} old instructions
+     * @return {@code non-null;} immutable instruction list
      */
     private InsnList convertInsns(ArrayList<SsaInsn> ssaInsns) {
-        InsnList result;
-        int insnCount;
-
-        insnCount = ssaInsns.size();
-        result = new InsnList (insnCount);
+        int insnCount = ssaInsns.size();
+        InsnList result = new InsnList(insnCount);
 
         for (int i = 0; i < insnCount; i++) {
             result.set(i, ssaInsns.get(i).toRopInsn());
@@ -390,4 +349,35 @@ public class SsaToRop {
 
         return result;
     }
+
+    /**
+     * 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.
+     */
+    public int[] getRegistersByFrequency() {
+        int regCount = ssaMeth.getRegCount();
+        Integer[] ret = new Integer[regCount];
+
+        for (int i = 0; i < regCount; i++) {
+            ret[i] = i;
+        }
+
+        Arrays.sort(ret, new Comparator<Integer>() {
+            public int compare(Integer o1, Integer o2) {
+                return ssaMeth.getUseListForRegister(o2).size()
+                        - ssaMeth.getUseListForRegister(o1).size();
+            }
+        });
+
+        int result[] = new int[regCount];
+
+        for (int i = 0; i < regCount; i++) {
+            result[i] = ret[i];
+        }
+
+        return result;
+    }    
 }
index 45d9ad6..582a327 100644 (file)
@@ -19,7 +19,7 @@ package com.android.dx.ssa;
 /**
  * <h1>An introduction to SSA Form</h1>
  *
- * This package contains classes associated with dx's <code>SSA</code>
+ * This package contains classes associated with dx's {@code SSA}
  * intermediate form. This form is a static-single-assignment representation of
  * Rop-form a method with Rop-form-like instructions (with the addition of a
  * {@link PhiInsn phi instriction}. This form is intended to make it easy to
@@ -47,7 +47,7 @@ package com.android.dx.ssa;
  * <li> {@link PhiInsn} instances represent "phi" operators defined in SSA
  * literature. They must be the first N instructions in a basic block.
  * <li> {@link NormalSsaInsn} instances represent instructions that directly
- * correspond to <code>Rop</code> form.
+ * correspond to {@code Rop} form.
  * </ul>
  *
  * <h3>Classes related to optimization steps</h3>
@@ -74,14 +74,14 @@ package com.android.dx.ssa;
  *
  * <h3>Conversion into SSA Form</h3>
  *
- * {@link SsaConverter#convertToSsaMethod} takes a <code>RopMethod</code> and
- * returns a fully-converted <code>SsaMethod</code>. The conversion process
+ * {@link SsaConverter#convertToSsaMethod} takes a {@code RopMethod} and
+ * returns a fully-converted {@code SsaMethod}. The conversion process
  * is roughly as follows:
  *
  * <ol>
  * <li> The Rop-form method, its blocks and their instructions are directly
- * wrapped in <code>SsaMethod</code>, <code>SsaBasicBlock</code> and
- * <code>SsaInsn</code> instances. Nothing else changes.
+ * wrapped in {@code SsaMethod}, {@code SsaBasicBlock} and
+ * {@code SsaInsn} instances. Nothing else changes.
  * <li> Critical control-flow graph edges are {@link SsaConverter#edgeSplit
  * split} and new basic blocks inserted as required to meet the constraints
  * necessary for the ultimate SSA representation.
@@ -89,7 +89,7 @@ package com.android.dx.ssa;
  * Rop registers to local variables necessary during phi placement. This
  * step could also be done in Rop form and then updated through the preceding
  * steps.
- * <li> <code>Phi</code> instructions are {link SsaConverter#placePhiFunctions}
+ * <li> {@code Phi} instructions are {link SsaConverter#placePhiFunctions}
  * placed in a semi-pruned fashion, which requires computation of {@link
  * Dominators dominance graph} and each node's {@link DomFront
  * dominance-frontier set}.
index 0d95041..9b69a36 100644 (file)
@@ -25,7 +25,7 @@ public interface AnnotatedOutput
     /**
      * Get whether this instance will actually keep annotations.
      * 
-     * @return <code>true</code> iff annotations are being kept
+     * @return {@code true} iff annotations are being kept
      */
     public boolean annotates();
 
@@ -34,7 +34,7 @@ public interface AnnotatedOutput
      * Annotators may use the result of calling this method to inform their
      * annotation activity.
      * 
-     * @return <code>true</code> iff annotations are to be verbose
+     * @return {@code true} iff annotations are to be verbose
      */
     public boolean isVerbose();
 
@@ -44,7 +44,7 @@ public interface AnnotatedOutput
      * annotation marks all subsequent output until another annotation
      * call.
      * 
-     * @param msg non-null; the annotation message
+     * @param msg {@code non-null;} the annotation message
      */
     public void annotate(String msg);
 
@@ -55,9 +55,9 @@ public interface AnnotatedOutput
      * previous calls to this method, the new call "consumes" output
      * after all the output covered by the previous calls.
      * 
-     * @param amt &gt;= 0; the amount of output for this annotation to
+     * @param amt {@code >= 0;} the amount of output for this annotation to
      * cover
-     * @param msg non-null; the annotation message
+     * @param msg {@code non-null;} the annotation message
      */
     public void annotate(int amt, String msg);
 
@@ -73,7 +73,7 @@ public interface AnnotatedOutput
      * output, but annotaters are encouraged to attempt to avoid exceeding
      * the indicated width.
      * 
-     * @return &gt;= 1; the maximum width
+     * @return {@code >= 1;} the maximum width
      */
     public int getAnnotationWidth();
 }
index c8588f8..9baae6d 100644 (file)
@@ -44,7 +44,7 @@ public class BitIntSet implements IntSet {
     /**
      * Ensures that the bit set has the capacity to represent the given value.
      *
-     * @param value &gt;= 0 value to represent
+     * @param value {@code >= 0;} value to represent
      */
     private void ensureCapacity(int value) {
         if (value >= Bits.getMax(bits)) {
index 0bc124c..1f45bd3 100644 (file)
@@ -17,7 +17,7 @@
 package com.android.dx.util;
 
 /**
- * Utilities for treating <code>int[]</code>s as bit sets.
+ * Utilities for treating {@code int[]}s as bit sets.
  */
 public final class Bits {
     /**
@@ -30,8 +30,8 @@ public final class Bits {
     /**
      * Constructs a bit set to contain bits up to the given index (exclusive).
      * 
-     * @param max &gt;= 0; the maximum bit index (exclusive)
-     * @return non-null; an appropriately-constructed instance
+     * @param max {@code >= 0;} the maximum bit index (exclusive)
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public static int[] makeBitSet(int max) {
         int size = (max + 0x1f) >> 5;
@@ -41,8 +41,8 @@ public final class Bits {
     /**
      * Gets the maximum index (exclusive) for the given bit set.
      * 
-     * @param bits non-null; bit set in question
-     * @return &gt;= 0; the maximum index (exclusive) that may be set
+     * @param bits {@code non-null;} bit set in question
+     * @return {@code >= 0;} the maximum index (exclusive) that may be set
      */
     public static int getMax(int[] bits) {
         return bits.length * 0x20;
@@ -51,8 +51,8 @@ public final class Bits {
     /**
      * Gets the value of the bit at the given index.
      * 
-     * @param bits non-null; bit set to operate on
-     * @param idx &gt;= 0, &lt; getMax(set); which bit
+     * @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
      */
     public static boolean get(int[] bits, int idx) {
@@ -64,8 +64,8 @@ public final class Bits {
     /**
      * Sets the given bit to the given value.
      * 
-     * @param bits non-null; bit set to operate on
-     * @param idx &gt;= 0, &lt; getMax(set); which bit
+     * @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
      */
     public static void set(int[] bits, int idx, boolean value) {
@@ -80,10 +80,10 @@ public final class Bits {
     }
 
     /**
-     * Sets the given bit to <code>true</code>.
+     * Sets the given bit to {@code true}.
      * 
-     * @param bits non-null; bit set to operate on
-     * @param idx &gt;= 0, &lt; getMax(set); which bit
+     * @param bits {@code non-null;} bit set to operate on
+     * @param idx {@code >= 0, < getMax(set);} which bit
      */
     public static void set(int[] bits, int idx) {
         int arrayIdx = idx >> 5;
@@ -92,10 +92,10 @@ public final class Bits {
     }
 
     /**
-     * Sets the given bit to <code>false</code>.
+     * Sets the given bit to {@code false}.
      * 
-     * @param bits non-null; bit set to operate on
-     * @param idx &gt;= 0, &lt; getMax(set); which bit
+     * @param bits {@code non-null;} bit set to operate on
+     * @param idx {@code >= 0, < getMax(set);} which bit
      */
     public static void clear(int[] bits, int idx) {
         int arrayIdx = idx >> 5;
@@ -105,10 +105,10 @@ public final class Bits {
 
     /**
      * Returns whether or not the given bit set is empty, that is, whether
-     * no bit is set to <code>true</code>.
+     * no bit is set to {@code true}.
      * 
-     * @param bits non-null; bit set to operate on
-     * @return <code>true</code> iff all bits are <code>false</code>
+     * @param bits {@code non-null;} bit set to operate on
+     * @return {@code true} iff all bits are {@code false}
      */
     public static boolean isEmpty(int[] bits) {
         int len = bits.length;
@@ -123,10 +123,10 @@ public final class Bits {
     }
 
     /**
-     * Gets the number of bits set to <code>true</code> in the given bit set.
+     * Gets the number of bits set to {@code true} in the given bit set.
      * 
-     * @param bits non-null; bit set to operate on
-     * @return &gt;= 0; the bit count (aka population count) of the set
+     * @param bits {@code non-null;} bit set to operate on
+     * @return {@code >= 0;} the bit count (aka population count) of the set
      */
     public static int bitCount(int[] bits) {
         int len = bits.length;
@@ -140,13 +140,13 @@ public final class Bits {
     }
 
     /**
-     * Returns whether any bits are set to <code>true</code> in the
+     * Returns whether any bits are set to {@code true} in the
      * specified range.
      * 
-     * @param bits non-null; bit set to operate on
-     * @param start &gt;= 0; index of the first bit in the range (inclusive)
-     * @param end &gt;= 0; index of the last bit in the range (exclusive)
-     * @return <code>true</code> if any bit is set to <code>true</code> in
+     * @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)
+     * @return {@code true} if any bit is set to {@code true} in
      * the indicated range
      */
     public static boolean anyInRange(int[] bits, int start, int end) {
@@ -158,10 +158,10 @@ public final class Bits {
      * Finds the lowest-order bit set at or after the given index in the
      * given bit set.
      * 
-     * @param bits non-null; bit set to operate on
-     * @param idx &gt;= 0; minimum index to return
-     * @return &gt;= -1; lowest-order bit set at or after <code>idx</code>,
-     * or <code>-1</code> if there is no appropriate bit index to return
+     * @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},
+     * or {@code -1} if there is no appropriate bit index to return
      */
     public static int findFirst(int[] bits, int idx) {
         int len = bits.length;
@@ -183,12 +183,12 @@ public final class Bits {
 
     /**
      * Finds the lowest-order bit set at or after the given index in the
-     * given <code>int</code>.
+     * given {@code int}.
      * 
      * @param value the value in question
      * @param idx 0..31 the minimum bit index to return
-     * @return &gt;= -1; lowest-order bit set at or after <code>idx</code>,
-     * or <code>-1</code> if there is no appropriate bit index to return
+     * @return {@code >= -1;} lowest-order bit set at or after {@code idx},
+     * or {@code -1} if there is no appropriate bit index to return
      */
     public static int findFirst(int value, int idx) {
         value &= ~((1 << idx) - 1); // Mask off too-low bits.
@@ -197,13 +197,13 @@ public final class Bits {
     }
 
     /**
-     * Ors bit array <code>b</code> into bit array <code>a</code>.
-     * <code>a.length</code> must be greater than or equal to
-     * <code>b.length</code>.
+     * Ors bit array {@code b} into bit array {@code a}.
+     * {@code a.length} must be greater than or equal to
+     * {@code b.length}.
      *
-     * @param a non-null; int array to be ored with other argument. This
+     * @param a {@code non-null;} int array to be ored with other argument. This
      * argument is modified.
-     * @param b non-null; int array to be ored into <code>a</code>. This
+     * @param b {@code non-null;} int array to be ored into {@code a}. This
      * argument is not modified.
      */
     public static void or(int[] a, int[] b) {
index 3fcf293..9bc43a7 100644 (file)
@@ -21,28 +21,28 @@ import java.io.IOException;
 import java.io.InputStream;
 
 /**
- * Wrapper for a <code>byte[]</code>, which provides read-only access and
+ * Wrapper for a {@code byte[]}, which provides read-only access and
  * can "reveal" a partial slice of the underlying array.
  *
  * <b>Note:</b> Multibyte accessors all use big-endian order.
  */
 public final class ByteArray {
-    /** non-null; underlying array */
+    /** {@code non-null;} underlying array */
     private final byte[] bytes;
 
-    /** <code>&gt;= 0</code>; start index of the slice (inclusive) */
+    /** {@code >= 0}; start index of the slice (inclusive) */
     private final int start;
 
-    /** <code>&gt;= 0, &lt;= bytes.length</code>; size computed as
-     * <code>end - start</code> (in the constructor) */
+    /** {@code >= 0, <= bytes.length}; size computed as
+     * {@code end - start} (in the constructor) */
     private final int size;
 
     /**
      * Constructs an instance.
      *
-     * @param bytes non-null; the underlying array
-     * @param start <code>&gt;= 0</code>; start index of the slice (inclusive)
-     * @param end <code>&gt;= start, &lt;= bytes.length</code>; end index of
+     * @param bytes {@code non-null;} the underlying array
+     * @param start {@code >= 0;} start index of the slice (inclusive)
+     * @param end {@code >= start, <= bytes.length;} end index of
      * the slice (exclusive)
      */
     public ByteArray(byte[] bytes, int start, int end) {
@@ -68,9 +68,9 @@ public final class ByteArray {
     }
 
     /**
-     * Constructs an instance from an entire <code>byte[]</code>.
+     * Constructs an instance from an entire {@code byte[]}.
      *
-     * @param bytes non-null; the underlying array
+     * @param bytes {@code non-null;} the underlying array
      */
     public ByteArray(byte[] bytes) {
         this(bytes, 0, bytes.length);
@@ -79,7 +79,7 @@ public final class ByteArray {
     /**
      * Gets the size of the array, in bytes.
      *
-     * @return &gt;= 0; the size
+     * @return {@code >= 0;} the size
      */
     public int size() {
         return size;
@@ -88,10 +88,10 @@ public final class ByteArray {
     /**
      * Returns a slice (that is, a sub-array) of this instance.
      *
-     * @param start <code>&gt;= 0</code>; start index of the slice (inclusive)
-     * @param end <code>&gt;= start, &lt;= size()</code>; end index of
+     * @param start {@code >= 0;} start index of the slice (inclusive)
+     * @param end {@code >= start, <= size();} end index of
      * the slice (exclusive)
-     * @return non-null; the slice
+     * @return {@code non-null;} the slice
      */
     public ByteArray slice(int start, int end) {
         checkOffsets(start, end);
@@ -103,9 +103,9 @@ public final class ByteArray {
      * offset into this instance.
      *
      * @param offset offset into this instance
-     * @param bytes non-null; (alleged) underlying array
-     * @return corresponding offset into <code>bytes</code>
-     * @throws IllegalArgumentException thrown if <code>bytes</code> is
+     * @param bytes {@code non-null;} (alleged) underlying array
+     * @return corresponding offset into {@code bytes}
+     * @throws IllegalArgumentException thrown if {@code bytes} is
      * not the underlying array of this instance
      */
     public int underlyingOffset(int offset, byte[] bytes) {
@@ -117,10 +117,10 @@ public final class ByteArray {
     }
 
     /**
-     * Gets the <code>signed byte</code> value at a particular offset.
+     * Gets the {@code signed byte} value at a particular offset.
      *
-     * @param off <code>&gt;= 0, &lt; size(); offset to fetch
-     * @return <code>signed byte</code> at that offset
+     * @param off {@code >= 0, < size();} offset to fetch
+     * @return {@code signed byte} at that offset
      */
     public int getByte(int off) {
         checkOffsets(off, off + 1);
@@ -128,10 +128,10 @@ public final class ByteArray {
     }
 
     /**
-     * Gets the <code>signed short</code> value at a particular offset.
+     * Gets the {@code signed short} value at a particular offset.
      *
-     * @param off <code>&gt;= 0, &lt; (size() - 1); offset to fetch
-     * @return <code>signed short</code> at that offset
+     * @param off {@code >= 0, < (size() - 1);} offset to fetch
+     * @return {@code signed short} at that offset
      */
     public int getShort(int off) {
         checkOffsets(off, off + 2);
@@ -139,10 +139,10 @@ public final class ByteArray {
     }
 
     /**
-     * Gets the <code>signed int</code> value at a particular offset.
+     * Gets the {@code signed int} value at a particular offset.
      *
-     * @param off <code>&gt;= 0, &lt; (size() - 3); offset to fetch
-     * @return <code>signed int</code> at that offset
+     * @param off {@code >= 0, < (size() - 3);} offset to fetch
+     * @return {@code signed int} at that offset
      */
     public int getInt(int off) {
         checkOffsets(off, off + 4);
@@ -153,10 +153,10 @@ public final class ByteArray {
     }
 
     /**
-     * Gets the <code>signed long</code> value at a particular offset.
+     * Gets the {@code signed long} value at a particular offset.
      *
-     * @param off <code>&gt;= 0, &lt; (size() - 7); offset to fetch
-     * @return <code>signed int</code> at that offset
+     * @param off {@code >= 0, < (size() - 7);} offset to fetch
+     * @return {@code signed int} at that offset
      */
     public long getLong(int off) {
         checkOffsets(off, off + 8);
@@ -173,10 +173,10 @@ public final class ByteArray {
     }
 
     /**
-     * Gets the <code>unsigned byte</code> value at a particular offset.
+     * Gets the {@code unsigned byte} value at a particular offset.
      *
-     * @param off <code>&gt;= 0, &lt; size(); offset to fetch
-     * @return <code>unsigned byte</code> at that offset
+     * @param off {@code >= 0, < size();} offset to fetch
+     * @return {@code unsigned byte} at that offset
      */
     public int getUnsignedByte(int off) {
         checkOffsets(off, off + 1);
@@ -184,10 +184,10 @@ public final class ByteArray {
     }
 
     /**
-     * Gets the <code>unsigned short</code> value at a particular offset.
+     * Gets the {@code unsigned short} value at a particular offset.
      *
-     * @param off <code>&gt;= 0, &lt; (size() - 1); offset to fetch
-     * @return <code>unsigned short</code> at that offset
+     * @param off {@code >= 0, < (size() - 1);} offset to fetch
+     * @return {@code unsigned short} at that offset
      */
     public int getUnsignedShort(int off) {
         checkOffsets(off, off + 2);
@@ -196,11 +196,11 @@ public final class ByteArray {
 
     /**
      * Copies the contents of this instance into the given raw
-     * <code>byte[]</code> at the given offset. The given array must be
+     * {@code byte[]} at the given offset. The given array must be
      * large enough.
      * 
-     * @param out non-null; array to hold the output
-     * @param offset non-null; index into <code>out</code> for the first
+     * @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
      */
     public void getBytes(byte[] out, int offset) {
@@ -226,7 +226,7 @@ public final class ByteArray {
     }
 
     /**
-     * Gets the <code>signed byte</code> value at the given offset,
+     * Gets the {@code signed byte} value at the given offset,
      * without doing any argument checking.
      *
      * @param off offset to fetch
@@ -237,7 +237,7 @@ public final class ByteArray {
     }
 
     /**
-     * Gets the <code>unsigned byte</code> value at the given offset,
+     * Gets the {@code unsigned byte} value at the given offset,
      * without doing any argument checking.
      *
      * @param off offset to fetch
@@ -248,26 +248,26 @@ public final class ByteArray {
     }
 
     /**
-     * Gets a <code>DataInputStream</code> that reads from this instance,
+     * Gets a {@code DataInputStream} that reads from this instance,
      * 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 non-null; an appropriately-constructed
-     * <code>DataInputStream</code> instance
+     * @return {@code non-null;} an appropriately-constructed
+     * {@code DataInputStream} instance
      */
     public MyDataInputStream makeDataInputStream() {
         return new MyDataInputStream(makeInputStream());
     }
 
     /**
-     * Gets a <code>InputStream</code> that reads from this instance,
+     * Gets a {@code InputStream} that reads from this instance,
      * 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 non-null; an appropriately-constructed
-     * <code>InputStream</code> instancex
+     * @return {@code non-null;} an appropriately-constructed
+     * {@code InputStream} instancex
      */
     public MyInputStream makeInputStream() {
         return new MyInputStream();
@@ -280,7 +280,7 @@ public final class ByteArray {
         /**
          * Gets the current cursor.
          * 
-         * @return 0..size(); the cursor
+         * @return {@code 0..size();} the cursor
          */
         public int getCursor();
     }
@@ -345,7 +345,7 @@ public final class ByteArray {
         /**
          * Gets the current cursor.
          * 
-         * @return 0..size(); the cursor
+         * @return {@code 0..size();} the cursor
          */
         public int getCursor() {
             return cursor;
@@ -358,7 +358,7 @@ public final class ByteArray {
      * instance may be easily determined.
      */
     public class MyDataInputStream extends DataInputStream {
-        /** non-null; the underlying {@link #MyInputStream} */
+        /** {@code non-null;} the underlying {@link #MyInputStream} */
         private final MyInputStream wrapped;
         
         public MyDataInputStream(MyInputStream wrapped) {
@@ -370,7 +370,7 @@ public final class ByteArray {
         /**
          * Gets the current cursor.
          * 
-         * @return 0..size(); the cursor
+         * @return {@code 0..size();} the cursor
          */
         public int getCursor() {
             return wrapped.getCursor();
index 457a603..5fcf5d8 100644 (file)
@@ -22,7 +22,7 @@ import java.util.ArrayList;
 
 /**
  * Implementation of {@link AnnotatedOutput} which stores the written data
- * into a <code>byte[]</code>.
+ * into a {@code byte[]}.
  * 
  * <p><b>Note:</b> As per the {@link Output} interface, multi-byte
  * writes all use little-endian order.</p>
@@ -38,26 +38,26 @@ public final class ByteArrayAnnotatedOutput
      */
     private final boolean stretchy;
 
-    /** non-null; the data itself */
+    /** {@code non-null;} the data itself */
     private byte[] data;
 
-    /** &gt;= 0; current output cursor */
+    /** {@code >= 0;} current output cursor */
     private int cursor;
 
     /** whether annotations are to be verbose */
     private boolean verbose;
 
     /**
-     * null-ok; list of annotations, or <code>null</code> if this instance
+     * {@code null-ok;} list of annotations, or {@code null} if this instance
      * isn't keeping them 
      */
     private ArrayList<Annotation> annotations;
 
-    /** &gt;= 40 (if used); the desired maximum annotation width */
+    /** {@code >= 40 (if used);} the desired maximum annotation width */
     private int annotationWidth;
 
     /**
-     * &gt;= 8 (if used); the number of bytes of hex output to use
+     * {@code >= 8 (if used);} the number of bytes of hex output to use
      * in annotations 
      */
     private int hexCols;
@@ -69,7 +69,7 @@ public final class ByteArrayAnnotatedOutput
      * capacity of the resulting instance. Also, the constructed
      * instance does not keep annotations by default.
      * 
-     * @param data non-null; data array to use for output
+     * @param data {@code non-null;} data array to use for output
      */
     public ByteArrayAnnotatedOutput(byte[] data) {
         this(data, false);
@@ -87,7 +87,7 @@ public final class ByteArrayAnnotatedOutput
     /**
      * Internal constructor.
      * 
-     * @param data non-null; data array to use for output
+     * @param data {@code non-null;} data array to use for output
      * @param stretchy whether the instance is to be stretchy
      */
     private ByteArrayAnnotatedOutput(byte[] data, boolean stretchy) {
@@ -105,25 +105,25 @@ public final class ByteArrayAnnotatedOutput
     }
 
     /**
-     * Gets the underlying <code>byte[]</code> of this instance, which
+     * Gets the underlying {@code byte[]} of this instance, which
      * may be larger than the number of bytes written
      * 
      * @see #toByteArray
      * 
-     * @return non-null; the <code>byte[]</code>
+     * @return {@code non-null;} the {@code byte[]}
      */
     public byte[] getArray() {
         return data;
     }
 
     /**
-     * Constructs and returns a new <code>byte[]</code> that contains
+     * 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 non-null; an appropriately-constructed array
+     * @return {@code non-null;} an appropriately-constructed array
      */
     public byte[] toByteArray() {
         byte[] result = new byte[cursor];
@@ -419,7 +419,7 @@ public final class ByteArrayAnnotatedOutput
      * be called only once per instance, and only before any data has been
      * written to the it.
      * 
-     * @param annotationWidth &gt;= 40; the desired maximum annotation width
+     * @param annotationWidth {@code >= 40;} the desired maximum annotation width
      * @param verbose whether or not to indicate verbose annotations
      */
     public void enableAnnotations(int annotationWidth, boolean verbose) {
@@ -474,7 +474,7 @@ public final class ByteArrayAnnotatedOutput
     /**
      * Writes the annotated content of this instance to the given writer.
      * 
-     * @param out non-null; where to write to
+     * @param out {@code non-null;} where to write to
      */
     public void writeAnnotationsTo(Writer out) throws IOException {
         int width2 = getAnnotationWidth();
@@ -538,7 +538,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 &gt;= 0; the desired minimum total size of the array
+     * @param desiredSize {@code >= 0;} the desired minimum total size of the array
      */
     private void ensureCapacity(int desiredSize) {
         if (data.length < desiredSize) {
@@ -552,25 +552,25 @@ public final class ByteArrayAnnotatedOutput
      * Annotation on output.
      */
     private static class Annotation {
-        /** &gt;= 0; start of annotated range (inclusive) */
+        /** {@code >= 0;} start of annotated range (inclusive) */
         private final int start;
 
         /**
-         * &gt;= 0; end of annotated range (exclusive);
-         * <code>Integer.MAX_VALUE</code> if unclosed 
+         * {@code >= 0;} end of annotated range (exclusive);
+         * {@code Integer.MAX_VALUE} if unclosed 
          */
         private int end;
 
-        /** non-null; annotation text */
+        /** {@code non-null;} annotation text */
         private final String text;
 
         /**
          * Constructs an instance.
          * 
-         * @param start &gt;= 0; start of annotated range
-         * @param end &gt;= start; end of annotated range (exclusive) or
-         * <code>Integer.MAX_VALUE</code> if unclosed
-         * @param text non-null; annotation text
+         * @param start {@code >= 0;} start of annotated range
+         * @param end {@code >= start;} end of annotated range (exclusive) or
+         * {@code Integer.MAX_VALUE} if unclosed
+         * @param text {@code non-null;} annotation text
          */
         public Annotation(int start, int end, String text) {
             this.start = start;
@@ -581,8 +581,8 @@ public final class ByteArrayAnnotatedOutput
         /**
          * Constructs an instance. It is initally unclosed.
          * 
-         * @param start &gt;= 0; start of annotated range
-         * @param text non-null; annotation text
+         * @param start {@code >= 0;} start of annotated range
+         * @param text {@code non-null;} annotation text
          */
         public Annotation(int start, String text) {
             this(start, Integer.MAX_VALUE, text);
@@ -592,7 +592,7 @@ public final class ByteArrayAnnotatedOutput
          * Sets the end as given, but only if the instance is unclosed;
          * otherwise, do nothing.
          * 
-         * @param end &gt;= start; the end
+         * @param end {@code >= start;} the end
          */
         public void setEndIfUnset(int end) {
             if (this.end == Integer.MAX_VALUE) {
@@ -603,7 +603,7 @@ public final class ByteArrayAnnotatedOutput
         /**
          * Sets the end as given.
          * 
-         * @param end &gt;= start; the end
+         * @param end {@code >= start;} the end
          */
         public void setEnd(int end) {
             this.end = end;
@@ -630,7 +630,7 @@ public final class ByteArrayAnnotatedOutput
         /**
          * Gets the text.
          * 
-         * @return non-null; the text
+         * @return {@code non-null;} the text
          */
         public String getText() {
             return text;
index 035546e..7f8523c 100644 (file)
@@ -24,7 +24,7 @@ import java.io.PrintWriter;
  */
 public class ExceptionWithContext
         extends RuntimeException {
-    /** non-null; human-oriented context of the exception */
+    /** {@code non-null;} human-oriented context of the exception */
     private StringBuffer context;
 
     /**
@@ -33,9 +33,9 @@ public class ExceptionWithContext
      * {@link ExceptionWithContext}, or a newly-constructed exception if it
      * was not.
      *
-     * @param ex non-null; the exception to augment
-     * @param str non-null; context to add
-     * @return non-null; an appropriate instance
+     * @param ex {@code non-null;} the exception to augment
+     * @param str {@code non-null;} context to add
+     * @return {@code non-null;} an appropriate instance
      */
     public static ExceptionWithContext withContext(Throwable ex, String str) {
         ExceptionWithContext ewc;
@@ -62,7 +62,7 @@ public class ExceptionWithContext
     /**
      * Constructs an instance.
      *
-     * @param cause null-ok; exception that caused this one
+     * @param cause {@code null-ok;} exception that caused this one
      */
     public ExceptionWithContext(Throwable cause) {
         this(null, cause);
@@ -72,7 +72,7 @@ public class ExceptionWithContext
      * Constructs an instance.
      *
      * @param message human-oriented message
-     * @param cause null-ok; exception that caused this one
+     * @param cause {@code null-ok;} exception that caused this one
      */
     public ExceptionWithContext(String message, Throwable cause) {
         super((message != null) ? message :
@@ -105,7 +105,7 @@ public class ExceptionWithContext
     /**
      * Adds a line of context to this instance.
      *
-     * @param str non-null; new context
+     * @param str {@code non-null;} new context
      */
     public void addContext(String str) {
         if (str == null) {
@@ -121,7 +121,7 @@ public class ExceptionWithContext
     /**
      * Gets the context.
      *
-     * @return non-null; the context
+     * @return {@code non-null;} the context
      */
     public String getContext() {
         return context.toString();
@@ -130,7 +130,7 @@ public class ExceptionWithContext
     /**
      * Prints the message and context.
      *
-     * @param out non-null; where to print to
+     * @param out {@code non-null;} where to print to
      */
     public void printContext(PrintStream out) {
         out.println(getMessage());
@@ -140,7 +140,7 @@ public class ExceptionWithContext
     /**
      * Prints the message and context.
      *
-     * @param out non-null; where to print to
+     * @param out {@code non-null;} where to print to
      */
     public void printContext(PrintWriter out) {
         out.println(getMessage());
index 07a7c7e..3f51207 100644 (file)
@@ -35,8 +35,8 @@ public final class FileUtils {
      * Reads the named file, translating {@link IOException} to a
      * {@link RuntimeException} of some sort.
      * 
-     * @param fileName non-null; name of the file to read
-     * @return non-null; contents of the file
+     * @param fileName {@code non-null;} name of the file to read
+     * @return {@code non-null;} contents of the file
      */
     public static byte[] readFile(String fileName) {
         File file = new File(fileName);
@@ -47,8 +47,8 @@ public final class FileUtils {
      * Reads the given file, translating {@link IOException} to a
      * {@link RuntimeException} of some sort.
      * 
-     * @param file non-null; the file to read
-     * @return non-null; contents of the file
+     * @param file {@code non-null;} the file to read
+     * @return {@code non-null;} contents of the file
      */
     public static byte[] readFile(File file) {
         if (!file.exists()) {
index 7b7d325..17d773c 100644 (file)
@@ -23,11 +23,11 @@ import java.util.Arrays;
  */
 public class FixedSizeList
         extends MutabilityControl implements ToHuman {
-    /** non-null; array of elements */
+    /** {@code non-null;} array of elements */
     private Object[] arr;
 
     /**
-     * Constructs an instance. All indices initially contain <code>null</code>.
+     * Constructs an instance. All indices initially contain {@code null}.
      * 
      * @param size the size of the list
      */
@@ -94,10 +94,10 @@ public class FixedSizeList
     /**
      * Gets a customized string form for this instance.
      * 
-     * @param prefix null-ok; prefix for the start of the result
-     * @param separator null-ok; separator to insert between each item
-     * @param suffix null-ok; suffix for the end of the result
-     * @return non-null; the custom string
+     * @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
+     * @return {@code non-null;} the custom string
      */
     public String toString(String prefix, String separator, String suffix) {
         return toString0(prefix, separator, suffix, false);
@@ -108,10 +108,10 @@ public class FixedSizeList
      * only work if every element of the list implements {@link
      * ToHuman}.
      * 
-     * @param prefix null-ok; prefix for the start of the result
-     * @param separator null-ok; separator to insert between each item
-     * @param suffix null-ok; suffix for the end of the result
-     * @return non-null; the custom string
+     * @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
+     * @return {@code non-null;} the custom string
      */
     public String toHuman(String prefix, String separator, String suffix) {
         return toString0(prefix, separator, suffix, true);
@@ -126,7 +126,7 @@ public class FixedSizeList
 
     /**
      * Shrinks this instance to fit, by removing any unset
-     * (<code>null</code>) elements, leaving the remaining elements in
+     * ({@code null}) elements, leaving the remaining elements in
      * their original order.
      */
     public void shrinkToFit() {
@@ -165,12 +165,12 @@ public class FixedSizeList
     /**
      * 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</code>. This method is
+     * will throw {@code NullPointerException}. This method is
      * protected so that subclasses may offer a safe type-checked
      * public interface to their clients.
      * 
-     * @param n &gt;= 0, &lt; size(); which element
-     * @return non-null; the indicated element
+     * @param n {@code >= 0, < size();} which element
+     * @return {@code non-null;} the indicated element
      */
     protected final Object get0(int n) {
         try {
@@ -188,13 +188,13 @@ public class FixedSizeList
     }
 
     /**
-     * Gets the indicated element, allowing <code>null</code>s to be
+     * Gets the indicated element, allowing {@code null}s to be
      * returned. This method is protected so that subclasses may
      * (optionally) offer a safe type-checked public interface to
      * their clients.
      * 
-     * @param n &gt;= 0, &lt; size(); which element
-     * @return null-ok; the indicated element
+     * @param n {@code >= 0, < size();} which element
+     * @return {@code null-ok;} the indicated element
      */
     protected final Object getOrNull0(int n) {
         return arr[n];
@@ -206,8 +206,8 @@ public class FixedSizeList
      * subclasses may offer a safe type-checked public interface to
      * their clients.
      * 
-     * @param n &gt;= 0, &lt; size(); which element
-     * @param obj null-ok; the value to store
+     * @param n {@code >= 0, < size();} which element
+     * @param obj {@code null-ok;} the value to store
      */
     protected final void set0(int n, Object obj) {
         throwIfImmutable();
@@ -239,11 +239,11 @@ public class FixedSizeList
      * Helper for {@link #toString} and {@link #toHuman}, which both of
      * those call to pretty much do everything.
      * 
-     * @param prefix null-ok; prefix for the start of the result
-     * @param separator null-ok; separator to insert between each item
-     * @param suffix null-ok; suffix for the end of the result
+     * @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 
-     * @return non-null; the custom string
+     * @return {@code non-null;} the custom string
      */
     private String toString0(String prefix, String separator, String suffix,
                              boolean human) {
index cf4c130..cb71e5e 100644 (file)
@@ -28,10 +28,10 @@ public final class Hex {
     }
 
     /**
-     * Formats a <code>long</code> as an 8-byte unsigned hex value.
+     * Formats a {@code long} as an 8-byte unsigned hex value.
      * 
      * @param v value to format
-     * @return non-null; formatted form
+     * @return {@code non-null;} formatted form
      */
     public static String u8(long v) {
         char[] result = new char[16];
@@ -44,10 +44,10 @@ public final class Hex {
     }
 
     /**
-     * Formats an <code>int</code> as a 4-byte unsigned hex value.
+     * Formats an {@code int} as a 4-byte unsigned hex value.
      * 
      * @param v value to format
-     * @return non-null; formatted form
+     * @return {@code non-null;} formatted form
      */
     public static String u4(int v) {
         char[] result = new char[8];
@@ -60,10 +60,10 @@ public final class Hex {
     }
 
     /**
-     * Formats an <code>int</code> as a 3-byte unsigned hex value.
+     * Formats an {@code int} as a 3-byte unsigned hex value.
      * 
      * @param v value to format
-     * @return non-null; formatted form
+     * @return {@code non-null;} formatted form
      */
     public static String u3(int v) {
         char[] result = new char[6];
@@ -76,10 +76,10 @@ public final class Hex {
     }
 
     /**
-     * Formats an <code>int</code> as a 2-byte unsigned hex value.
+     * Formats an {@code int} as a 2-byte unsigned hex value.
      * 
      * @param v value to format
-     * @return non-null; formatted form
+     * @return {@code non-null;} formatted form
      */
     public static String u2(int v) {
         char[] result = new char[4];
@@ -92,12 +92,12 @@ public final class Hex {
     }
 
     /**
-     * Formats an <code>int</code> as either a 2-byte unsigned hex value
+     * 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 non-null; formatted form
+     * @return {@code non-null;} formatted form
      */
     public static String u2or4(int v) {
         if (v == (char) v) {
@@ -108,10 +108,10 @@ public final class Hex {
     }
 
     /**
-     * Formats an <code>int</code> as a 1-byte unsigned hex value.
+     * Formats an {@code int} as a 1-byte unsigned hex value.
      * 
      * @param v value to format
-     * @return non-null; formatted form
+     * @return {@code non-null;} formatted form
      */
     public static String u1(int v) {
         char[] result = new char[2];
@@ -124,10 +124,10 @@ public final class Hex {
     }
 
     /**
-     * Formats an <code>int</code> as a 4-bit unsigned hex nibble.
+     * Formats an {@code int} as a 4-bit unsigned hex nibble.
      * 
      * @param v value to format
-     * @return non-null; formatted form
+     * @return {@code non-null;} formatted form
      */
     public static String uNibble(int v) {
         char[] result = new char[1];
@@ -137,10 +137,10 @@ public final class Hex {
     }
 
     /**
-     * Formats a <code>long</code> as an 8-byte signed hex value.
+     * Formats a {@code long} as an 8-byte signed hex value.
      * 
      * @param v value to format
-     * @return non-null; formatted form
+     * @return {@code non-null;} formatted form
      */
     public static String s8(long v) {
         char[] result = new char[17];
@@ -161,10 +161,10 @@ public final class Hex {
     }
 
     /**
-     * Formats an <code>int</code> as a 4-byte signed hex value.
+     * Formats an {@code int} as a 4-byte signed hex value.
      * 
      * @param v value to format
-     * @return non-null; formatted form
+     * @return {@code non-null;} formatted form
      */
     public static String s4(int v) {
         char[] result = new char[9];
@@ -185,10 +185,10 @@ public final class Hex {
     }
 
     /**
-     * Formats an <code>int</code> as a 2-byte signed hex value.
+     * Formats an {@code int} as a 2-byte signed hex value.
      * 
      * @param v value to format
-     * @return non-null; formatted form
+     * @return {@code non-null;} formatted form
      */
     public static String s2(int v) {
         char[] result = new char[5];
@@ -209,10 +209,10 @@ public final class Hex {
     }
 
     /**
-     * Formats an <code>int</code> as a 1-byte signed hex value.
+     * Formats an {@code int} as a 1-byte signed hex value.
      * 
      * @param v value to format
-     * @return non-null; formatted form
+     * @return {@code non-null;} formatted form
      */
     public static String s1(int v) {
         char[] result = new char[3];
@@ -233,18 +233,18 @@ public final class Hex {
     }
 
     /**
-     * Formats a hex dump of a portion of a <code>byte[]</code>. The result
+     * 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>""</code>).
+     * in which case the result is always the empty string ({@code ""}).
      * 
-     * @param arr non-null; array to format
-     * @param offset &gt;= 0; offset to the part to dump
-     * @param length &gt;= 0; number of bytes to dump
-     * @param outOffset &gt;= 0; first output offset to print
-     * @param bpl &gt;= 0; number of bytes of output per line
-     * @param addressLength {2,4,6,8}; number of characters for each address
+     * @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
+     * @param outOffset {@code >= 0;} first output offset to print
+     * @param bpl {@code >= 0;} number of bytes of output per line
+     * @param addressLength {@code {2,4,6,8};} number of characters for each address
      * header
-     * @return non-null; a string of the dump
+     * @return {@code non-null;} a string of the dump
      */
     public static String dump(byte[] arr, int offset, int length,
                               int outOffset, int bpl, int addressLength) {
index 4b6b7b2..3d0c992 100644 (file)
@@ -28,7 +28,7 @@ public final class HexParser {
     }
 
     /**
-     * Parses the given text as hex, returning a <code>byte[]</code>
+     * Parses the given text as hex, returning a {@code byte[]}
      * corresponding to the text. The format is simple: Each line may
      * start with a hex offset followed by a colon (which is verified
      * and presumably used just as a comment), and then consists of
@@ -38,8 +38,8 @@ public final class HexParser {
      * of the subsequent characters is used, until the next double
      * quote. Quoted strings may not span multiple lines.
      * 
-     * @param src non-null; the source string
-     * @return non-null; the parsed form
+     * @param src {@code non-null;} the source string
+     * @return {@code non-null;} the parsed form
      */
     public static byte[] parse(String src) {
         int len = src.length();
index db4e0a2..92f0b55 100644 (file)
@@ -27,31 +27,31 @@ import java.io.Writer;
  * line.
  */
 public final class IndentingWriter extends FilterWriter {
-    /** null-ok; optional prefix for every line */
+    /** {@code null-ok;} optional prefix for every line */
     private final String prefix;
 
-    /** &gt; 0; the maximum output width */
+    /** {@code > 0;} the maximum output width */
     private final int width;
 
-    /** &gt; 0; the maximum indent */
+    /** {@code > 0;} the maximum indent */
     private final int maxIndent;
 
-    /** &gt;= 0; current output column (zero-based) */
+    /** {@code >= 0;} current output column (zero-based) */
     private int column;
 
     /** whether indent spaces are currently being collected */
     private boolean collectingIndent;
 
-    /** &gt;= 0; current indent amount */
+    /** {@code >= 0;} current indent amount */
     private int indent;
 
     /**
      * Constructs an instance.
      * 
-     * @param out non-null; writer to send final output to
-     * @param width &gt;= 0; the maximum output width (not including
-     * <code>prefix</code>), or <code>0</code> for no maximum
-     * @param prefix non-null; the prefix for each line
+     * @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
+     * @param prefix {@code non-null;} the prefix for each line
      */
     public IndentingWriter(Writer out, int width, String prefix) {
         super(out);
@@ -78,9 +78,9 @@ public final class IndentingWriter extends FilterWriter {
     /**
      * Constructs a no-prefix instance.
      * 
-     * @param out non-null; writer to send final output to
-     * @param width &gt;= 0; the maximum output width (not including
-     * <code>prefix</code>), or <code>0</code> for no maximum
+     * @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
      */
     public IndentingWriter(Writer out, int width) {
         this(out, width, "");
index f60bbb5..c51c028 100644 (file)
@@ -19,16 +19,16 @@ package com.android.dx.util;
 import java.util.Arrays;
 
 /**
- * Simple list of <code>int</code>s.
+ * Simple list of {@code int}s.
  */
 public final class IntList extends MutabilityControl {
-    /** non-null; immutable, no-element instance */
+    /** {@code non-null;} immutable, no-element instance */
     public static final IntList EMPTY = new IntList(0);
 
-    /** non-null; array of elements */
+    /** {@code non-null;} array of elements */
     private int[] values;
 
-    /** &gt;= 0; current size of the list */
+    /** {@code >= 0;} current size of the list */
     private int size;
 
     /** whether the values are currently sorted */
@@ -78,7 +78,7 @@ public final class IntList extends MutabilityControl {
     /**
      * Constructs an empty instance.
      * 
-     * @param initialCapacity &gt;= 0; initial capacity of the list
+     * @param initialCapacity {@code >= 0;} initial capacity of the list
      */
     public IntList(int initialCapacity) {
         super(true);
@@ -165,7 +165,7 @@ public final class IntList extends MutabilityControl {
     /**
      * Gets the indicated value.
      * 
-     * @param n &gt;= 0, &lt; size(); which element
+     * @param n {@code >= 0, < size();} which element
      * @return the indicated element's value
      */
     public int get(int n) {
@@ -184,7 +184,7 @@ public final class IntList extends MutabilityControl {
     /**
      * Sets the value at the given index.
      * 
-     * @param n &gt;= 0, &lt; size(); which element
+     * @param n {@code >= 0, < size();} which element
      * @param value value to store
      */
     public void set(int n, int value) {
@@ -229,7 +229,7 @@ public final class IntList extends MutabilityControl {
      * current size (that is, insertion as a last element is legal but
      * no further).
      *
-     * @param n &gt=0 &lt=size(); index of where to insert
+     * @param n {@code >= 0, <=size();} index of where to insert
      * @param value value to insert
      */
     public void insert(int n, int value) {
@@ -252,7 +252,7 @@ public final class IntList extends MutabilityControl {
      * Removes an element at a given index, shifting elements at greater
      * indicies down one.
      *
-     * @param n  &gt=0 &lt size(); index of element to remove
+     * @param n  {@code >=0, < size();} index of element to remove
      */
     public void removeIndex(int n) {
         if (n >= size) {
@@ -307,7 +307,7 @@ public final class IntList extends MutabilityControl {
     /**
      * Pops N elements off the end of the list and decreasing the size by N.
      *
-     * @param n &gt;= 0; number of elements to remove from end.
+     * @param n {@code >= 0;} number of elements to remove from end.
      * @exception IndexOutOfBoundsException if stack is smaller than N
      */
     public void pop(int n) {
@@ -319,7 +319,7 @@ public final class IntList extends MutabilityControl {
     /**
      * Shrinks the size of the list.
      * 
-     * @param newSize &gt;= 0; the new size
+     * @param newSize {@code >= 0;} the new size
      */
     public void shrink(int newSize) {
         if (newSize < 0) {
@@ -338,7 +338,7 @@ public final class IntList extends MutabilityControl {
     /**
      * Makes and returns a mutable copy of the list.
      * 
-     * @return non-null; an appropriately-constructed instance
+     * @return {@code non-null;} an appropriately-constructed instance
      */
     public IntList mutableCopy() {
         int sz = size;
@@ -380,12 +380,12 @@ public final class IntList extends MutabilityControl {
     /**
      * Performs a binary search on a sorted list, returning the index of
      * the given value if it is present or
-     * <code>(-(insertion point) - 1)</code> if the value is not present.
+     * {@code (-(insertion point) - 1)} if the value is not present.
      * If the list is not sorted, then reverts to linear search and returns
-     * <code>-size()</code> if the element is not found.
+     * {@code -size()} if the element is not found.
      *
      * @param value value to find
-     * @return index of value or <code>(-(insertion point) - 1)</code> if the
+     * @return index of value or {@code (-(insertion point) - 1)} if the
      * value is not present
      */
     public int binarysearch(int value) {
index 10b6ee0..33b6bdd 100644 (file)
@@ -44,24 +44,24 @@ public interface IntSet {
     boolean has(int value);
 
     /**
-     * Merges <code>other</code> into this set, so this set becomes the
+     * Merges {@code other} into this set, so this set becomes the
      * union of the two.
      *
-     * @param other non-null; other set to merge with.
+     * @param other {@code non-null;} other set to merge with.
      */
     void merge(IntSet other);
 
     /**
      * Returns the count of unique elements in this set.
      *
-     * @return &gt; = 0; count of unique elements
+     * @return {@code > = 0;} count of unique elements
      */
     int elements();
 
     /**
      * Iterates the set
      *
-     * @return non-null; a set iterator
+     * @return {@code non-null;} a set iterator
      */
     IntIterator iterator();
 }
index cc6a0d2..b4856cf 100644 (file)
@@ -24,7 +24,7 @@ public interface LabeledItem {
     /*
      * Gets the label of this block.
      *
-     * @return &gt;= 0; the label
+     * @return {@code >= 0;} the label
      */
     public int getLabel();
 }
index 3168a38..28a148b 100644 (file)
@@ -58,7 +58,7 @@ public class LabeledList extends FixedSizeList {
     /**
      * Gets the maximum label (exclusive) of any block added to this instance.
      *
-     * @return &gt;= 0; the maximum label
+     * @return {@code >= 0;} the maximum label
      */
     public int getMaxLabel() {
         int sz = labelToIndex.size();
@@ -102,8 +102,8 @@ public class LabeledList extends FixedSizeList {
      * Gets the index of the first item in the list with the given
      * label, if any.
      *
-     * @param label &gt;= 0; the label to look for
-     * @return &gt;= -1; the index of the so-labelled item, or <code>-1</code>
+     * @param label {@code >= 0;} the label to look for
+     * @return {@code >= -1;} the index of the so-labelled item, or {@code -1}
      * if none is found
      */
     public int indexOfLabel(int label) {
@@ -142,8 +142,8 @@ public class LabeledList extends FixedSizeList {
     /**
      * Sets the element at the given index.
      *
-     * @param n &gt;= 0, &lt; size(); which element
-     * @param item null-ok; the value to store
+     * @param n {@code >= 0, < size();} which element
+     * @param item {@code null-ok;} the value to store
      */
     protected void set(int n, LabeledItem item) {
         LabeledItem old = (LabeledItem) getOrNull0(n);
index 8b3383b..14e0f2e 100644 (file)
@@ -36,7 +36,7 @@ public class MutabilityControl {
     /**
      * Constructs an instance, explicitly indicating the mutability.
      *
-     * @param mutable <code>true</code> iff this instance is mutable
+     * @param mutable {@code true} iff this instance is mutable
      */
     public MutabilityControl(boolean mutable) {
         this.mutable = mutable;
@@ -51,9 +51,9 @@ public class MutabilityControl {
 
     /**
      * Checks to see whether or not this instance is immutable. This is the
-     * same as calling <code>!isMutable()</code>.
+     * same as calling {@code !isMutable()}.
      *
-     * @return <code>true</code> iff this instance is immutable
+     * @return {@code true} iff this instance is immutable
      */
     public final boolean isImmutable() {
         return !mutable;
@@ -62,7 +62,7 @@ public class MutabilityControl {
     /**
      * Checks to see whether or not this instance is mutable.
      *
-     * @return <code>true</code> iff this instance is mutable
+     * @return {@code true} iff this instance is mutable
      */
     public final boolean isMutable() {
         return mutable;
index b3c3747..5e737ae 100644 (file)
@@ -18,7 +18,7 @@ package com.android.dx.util;
 
 /**
  * Interface for a sink for binary output. This is similar to 
- * <code>java.util.DataOutput</code>, but no <code>IOExceptions</code>
+ * {@code java.util.DataOutput}, but no {@code IOExceptions}
  * are declared, and multibyte output is defined to be little-endian.
  */
 public interface Output {
@@ -26,7 +26,7 @@ public interface Output {
      * Gets the current cursor position. This is the same as the number of
      * bytes written to this instance.
      * 
-     * @return &gt;= 0; the cursor position
+     * @return {@code >= 0;} the cursor position
      */
     public int getCursor();
 
@@ -34,34 +34,34 @@ public interface Output {
      * Asserts that the cursor is the given value.
      * 
      * @param expectedCursor the expected cursor value
-     * @throws RuntimeException thrown if <code>getCursor() !=
-     * expectedCursor</code>
+     * @throws RuntimeException thrown if {@code getCursor() !=
+     * expectedCursor}
      */
     public void assertCursor(int expectedCursor);
  
     /**
-     * Writes a <code>byte</code> to this instance.
+     * 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</code> to this instance.
+     * 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</code> to this instance.
+     * Writes an {@code int} to this instance.
      * 
      * @param value the value to write
      */
     public void writeInt(int value);
 
     /**
-     * Writes a <code>long</code> to this instance.
+     * Writes a {@code long} to this instance.
      * 
      * @param value the value to write
      */
@@ -73,7 +73,7 @@ public interface Output {
      * 7.6.
      *
      * @param value value to write, treated as an unsigned value
-     * @return 1..5; the number of bytes actually written
+     * @return {@code 1..5;} the number of bytes actually written
      */
     public int writeUnsignedLeb128(int value);
 
@@ -83,47 +83,47 @@ public interface Output {
      * 7.6.
      *
      * @param value value to write
-     * @return 1..5; the number of bytes actually written
+     * @return {@code 1..5;} the number of bytes actually written
      */
     public int writeSignedLeb128(int value);
 
     /**
      * Writes a {@link ByteArray} to this instance.
      * 
-     * @param bytes non-null; the array to write
+     * @param bytes {@code non-null;} the array to write
      */
     public void write(ByteArray bytes);
 
     /**
-     * Writes a portion of a <code>byte[]</code> to this instance.
+     * Writes a portion of a {@code byte[]} to this instance.
      * 
-     * @param bytes non-null; the array to write
-     * @param offset &gt;= 0; offset into <code>bytes</code> for the first
+     * @param bytes {@code non-null;} the array to write
+     * @param offset {@code >= 0;} offset into {@code bytes} for the first
      * byte to write
-     * @param length &gt;= 0; number of bytes to write
+     * @param length {@code >= 0;} number of bytes to write
      */
     public void write(byte[] bytes, int offset, int length);
 
     /**
-     * Writes a <code>byte[]</code> to this instance. This is just
-     * a convenient shorthand for <code>write(bytes, 0, bytes.length)</code>.
+     * Writes a {@code byte[]} to this instance. This is just
+     * a convenient shorthand for {@code write(bytes, 0, bytes.length)}.
      * 
-     * @param bytes non-null; the array to write
+     * @param bytes {@code non-null;} the array to write
      */
     public void write(byte[] bytes);
 
     /** 
-     * Writes the given number of <code>0</code> bytes.
+     * Writes the given number of {@code 0} bytes.
      * 
-     * @param count &gt;= 0; the number of zeroes to write
+     * @param count {@code >= 0;} the number of zeroes to write
      */
     public void writeZeroes(int count);
 
     /** 
-     * Adds extra bytes if necessary (with value <code>0</code>) to
+     * Adds extra bytes if necessary (with value {@code 0}) to
      * force alignment of the output cursor as given.
      * 
-     * @param alignment &gt; 0; the alignment; must be a power of two
+     * @param alignment {@code > 0;} the alignment; must be a power of two
      */
     public void alignTo(int alignment);
 }
index 89bf4f7..b3a31a5 100644 (file)
@@ -23,9 +23,9 @@ package com.android.dx.util;
 public interface ToHuman {
     /**
      * Return the "human" string form of this instance.  This is
-     * generally less "debuggy" than <code>toString()</code>.
+     * generally less "debuggy" than {@code toString()}.
      *
-     * @return non-null; the human string form
+     * @return {@code non-null;} the human string form
      */
     public String toHuman();
 }
index cc9f7d4..a155c15 100644 (file)
@@ -28,34 +28,34 @@ import java.io.Writer;
  * one which goes on the right.
  */
 public final class TwoColumnOutput {
-    /** non-null; underlying writer for final output */
+    /** {@code non-null;} underlying writer for final output */
     private final Writer out;
 
-    /** &gt; 0; the left column width */
+    /** {@code > 0;} the left column width */
     private final int leftWidth;
 
-    /** non-null; pending left column output */
+    /** {@code non-null;} pending left column output */
     private final StringBuffer leftBuf;
 
-    /** non-null; pending right column output */
+    /** {@code non-null;} pending right column output */
     private final StringBuffer rightBuf;
 
-    /** non-null; left column writer */
+    /** {@code non-null;} left column writer */
     private final IndentingWriter leftColumn;
 
-    /** non-null; right column writer */
+    /** {@code non-null;} right column writer */
     private final IndentingWriter rightColumn;
 
     /**
      * Turns the given two strings (with widths) and spacer into a formatted
      * two-column string.
      * 
-     * @param s1 non-null; first string
-     * @param width1 &gt; 0; width of the first column
-     * @param spacer non-null; spacer string
-     * @param s2 non-null; second string
-     * @param width2 &gt; 0; width of the second column
-     * @return non-null; an appropriately-formatted string
+     * @param s1 {@code non-null;} first string
+     * @param width1 {@code > 0;} width of the first column
+     * @param spacer {@code non-null;} spacer string
+     * @param s2 {@code non-null;} second string
+     * @param width2 {@code > 0;} width of the second column
+     * @return {@code non-null;} an appropriately-formatted string
      */
     public static String toString(String s1, int width1, String spacer,
                                   String s2, int width2) {
@@ -80,10 +80,10 @@ public final class TwoColumnOutput {
     /**
      * Constructs an instance.
      * 
-     * @param out non-null; writer to send final output to
-     * @param leftWidth &gt; 0; width of the left column, in characters
-     * @param rightWidth &gt; 0; width of the right column, in characters
-     * @param spacer non-null; spacer string to sit between the two columns
+     * @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
+     * @param spacer {@code non-null;} spacer string to sit between the two columns
      */
     public TwoColumnOutput(Writer out, int leftWidth, int rightWidth,
                            String spacer) {
@@ -118,10 +118,10 @@ public final class TwoColumnOutput {
     /**
      * Constructs an instance.
      * 
-     * @param out non-null; stream to send final output to
-     * @param leftWidth &gt;= 1; width of the left column, in characters
-     * @param rightWidth &gt;= 1; width of the right column, in characters
-     * @param spacer non-null; spacer string to sit between the two columns
+     * @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
+     * @param spacer {@code non-null;} spacer string to sit between the two columns
      */
     public TwoColumnOutput(OutputStream out, int leftWidth, int rightWidth,
                            String spacer) {
@@ -131,7 +131,7 @@ public final class TwoColumnOutput {
     /**
      * Gets the writer to use to write to the left column.
      * 
-     * @return non-null; the left column writer
+     * @return {@code non-null;} the left column writer
      */
     public Writer getLeft() {
         return leftColumn;
@@ -140,7 +140,7 @@ public final class TwoColumnOutput {
     /**
      * Gets the writer to use to write to the right column.
      * 
-     * @return non-null; the right column writer
+     * @return {@code non-null;} the right column writer
      */
     public Writer getRight() {
         return rightColumn;
@@ -226,8 +226,8 @@ 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 non-null; the buffer in question
-     * @param out non-null; the writer to use
+     * @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) 
@@ -242,8 +242,8 @@ public final class TwoColumnOutput {
     /**
      * Writes the given number of spaces to the given writer.
      * 
-     * @param out non-null; where to write
-     * @param amt &gt;= 0; the number of spaces to write
+     * @param out {@code non-null;} where to write
+     * @param amt {@code >= 0;} the number of spaces to write
      */
     private static void writeSpaces(Writer out, int amt) throws IOException {
         while (amt > 0) {
index f10e400..632b082 100644 (file)
@@ -20,7 +20,7 @@ import java.io.PrintWriter;
 import java.io.Writer;
 
 /**
- * Utilities for dealing with <code>Writer</code>s.
+ * Utilities for dealing with {@code Writer}s.
  */
 public final class Writers {
     /**
@@ -31,12 +31,12 @@ public final class Writers {
     }
 
     /**
-     * Makes a <code>PrintWriter</code> for the given <code>Writer</code>,
+     * Makes a {@code PrintWriter} for the given {@code Writer},
      * returning the given writer if it already happens to be the right
      * class.
      * 
-     * @param writer non-null; writer to (possibly) wrap
-     * @return non-null; an appropriate instance
+     * @param writer {@code non-null;} writer to (possibly) wrap
+     * @return {@code non-null;} an appropriate instance
      */
     public static PrintWriter printWriterFor(Writer writer) {
         if (writer instanceof PrintWriter) {
index e529b50..a95fc14 100644 (file)
@@ -21,7 +21,7 @@ import com.android.dx.util.Bits;
 import junit.framework.TestCase;
 
 /**
- * Test the class <code>com.android.dx.util.Bits</code>.
+ * Test the class {@code com.android.dx.util.Bits}.
  */
 public class _Bits
         extends TestCase {
index 241e8be..dadbd54 100644 (file)
@@ -21,7 +21,7 @@ import com.android.dx.util.IntList;
 import junit.framework.TestCase;
 
 /**
- * Test the class <code>com.android.dx.util.IntList</code>.
+ * Test the class {@code com.android.dx.util.IntList}.
  */
 public class _IntList
     extends TestCase {
index c80aef8..55e61a9 100644 (file)
@@ -56,8 +56,8 @@ public class PathClassLoader extends ClassLoader {
     /**
      * Creates a {@code PathClassLoader} that operates on a given list of files
      * and directories. This method is equivalent to calling
-     * {@link #PathClassLoader(String, String, ClassLoader) with a {@code null}
-     * value for the second argument (see description there).
+     * {@link #PathClassLoader(String, String, ClassLoader)} with a
+     * {@code null} value for the second argument (see description there).
      * 
      * @param path
      *            the list of files and directories
index 023cd6a..ee0847d 100644 (file)
@@ -153,6 +153,12 @@ public final class VMDebug {
         int bufferSize, int flags);
 
     /**
+     * Determine whether method tracing is currently active.
+     * @hide
+     */
+    public static native boolean isMethodTracingActive();
+
+    /**
      * Stops method tracing.
      */
     public static native void stopMethodTracing();
index de01295..348041e 100755 (executable)
@@ -1379,7 +1379,7 @@ static jint osNetworkSystem_readSocketDirectImpl(JNIEnv* env, jclass clazz,
     // LOGD("ENTER readSocketDirectImpl");
 
     int handle;
-    jbyte *message = (jbyte *)address;
+    jbyte *message = (jbyte *)address + offset;
     int result, ret, localCount;
 
     handle = jniGetFDFromFileDescriptor(env, fileDescriptor);
@@ -1437,7 +1437,7 @@ static jint osNetworkSystem_readSocketImpl(JNIEnv* env, jclass clazz,
     }
 
     result = osNetworkSystem_readSocketDirectImpl(env, clazz, fileDescriptor,
-            (jint) message, offset, count, timeout);
+            (jint) message, 0, localCount, timeout);
 
     if (result > 0) {
         env->SetByteArrayRegion(data, offset, result, (jbyte *)message);
@@ -1455,7 +1455,7 @@ static jint osNetworkSystem_writeSocketDirectImpl(JNIEnv* env, jclass clazz,
     // LOGD("ENTER writeSocketDirectImpl");
 
     int handle;
-    jbyte *message = (jbyte *)address;
+    jbyte *message = (jbyte *)address + offset;
     int result = 0, sent = 0;
 
     if (count <= 0) {
@@ -1499,7 +1499,7 @@ static jint osNetworkSystem_writeSocketDirectImpl(JNIEnv* env, jclass clazz,
             if (!socketExConstructor) {
                 return 0;
             }
-            socketEx = env->NewObject(socketExClass, socketExConstructor, errorMessageString); 
+            socketEx = env->NewObject(socketExClass, socketExConstructor, errorMessageString);
             socketExCauseMethod = env->GetMethodID(socketExClass,"initCause","(Ljava/lang/Throwable;)Ljava/lang/Throwable;");
             env->CallObjectMethod(socketEx,socketExCauseMethod,errorCodeEx);
             env->Throw((jthrowable)socketEx);
@@ -1539,13 +1539,13 @@ static jint osNetworkSystem_writeSocketImpl(JNIEnv* env, jclass clazz,
     env->GetByteArrayRegion(data, offset, count, message);
 
     result = osNetworkSystem_writeSocketDirectImpl(env, clazz, fileDescriptor,
-            (jint) message, offset, count);
+            (jint) message, 0, count);
 
     if (( jbyte *)message != internalBuffer) {
-      free(( jbyte *)message);
+        free(( jbyte *)message);
     }
 #undef INTERNAL_SEND_BUFFER_MAX
-   return result;
+    return result;
 }
 
 static void osNetworkSystem_setNonBlockingImpl(JNIEnv* env, jclass clazz,
@@ -2256,7 +2256,7 @@ static jint osNetworkSystem_receiveDatagramImpl(JNIEnv* env, jclass clazz,
     }
 
     int actualLength = osNetworkSystem_receiveDatagramDirectImpl(env, clazz, fd,
-            packet, (jint)bytes, offset, localLength, receiveTimeout, peek);
+            packet, (jint)bytes, 0, localLength, receiveTimeout, peek);
 
     if (actualLength > 0) {
         env->SetByteArrayRegion(data, offset, actualLength, bytes);
@@ -2315,7 +2315,7 @@ static jint osNetworkSystem_recvConnectedDatagramImpl(JNIEnv* env, jclass clazz,
     }
 
     int actualLength = osNetworkSystem_recvConnectedDatagramDirectImpl(env,
-            clazz, fd, packet, (jint)bytes, offset, localLength,
+            clazz, fd, packet, (jint)bytes, 0, localLength,
             receiveTimeout, peek);
 
     if (actualLength > 0) {
@@ -2757,10 +2757,10 @@ static jint osNetworkSystem_selectImpl(JNIEnv* env, jclass clazz,
     }
 
     if (0 < result) {
-       /*output the result to a int array*/
-       flagArray = env->GetIntArrayElements(outFlags, &isCopy);
+        /*output the result to a int array*/
+        flagArray = env->GetIntArrayElements(outFlags, &isCopy);
 
-       for (val=0; val<countReadC; val++) {
+        for (val=0; val<countReadC; val++) {
             gotFD = env->GetObjectArrayElement(readFDArray,val);
 
             handle = jniGetFDFromFileDescriptor(env, gotFD);
@@ -3056,7 +3056,7 @@ static void osNetworkSystem_setSocketOptionImpl(JNIEnv* env, jclass clazz,
             break;
         }
 
-      case JAVASOCKOPT_MCAST_TTL: {
+        case JAVASOCKOPT_MCAST_TTL: {
             if ((anOption >> 16) & BROKEN_MULTICAST_TTL) {
                 return;
             }
@@ -3071,13 +3071,13 @@ static void osNetworkSystem_setSocketOptionImpl(JNIEnv* env, jclass clazz,
         case JAVASOCKOPT_MCAST_ADD_MEMBERSHIP: {
             mcastAddDropMembership(env, handle, optVal,
                     (anOption >> 16) & BROKEN_MULTICAST_IF, IP_ADD_MEMBERSHIP);
-            return;
+            break;
         }
 
         case JAVASOCKOPT_MCAST_DROP_MEMBERSHIP: {
             mcastAddDropMembership(env, handle, optVal,
                     (anOption >> 16) & BROKEN_MULTICAST_IF, IP_DROP_MEMBERSHIP);
-            return;
+            break;
         }
 
         case JAVASOCKOPT_MCAST_INTERFACE: {
index e1f5e86..015a1d0 100755 (executable)
@@ -28,6 +28,8 @@ import java.io.InputStream;
 import java.io.OutputStream;
 import java.net.BindException;
 import java.net.ConnectException;
+import java.net.Inet4Address;
+import java.net.InetAddress;
 import java.net.InetSocketAddress;
 import java.net.ServerSocket;
 import java.net.Socket;
@@ -4112,6 +4114,95 @@ public class SocketChannelTest extends TestCase {
         }
     }
 
+    /**
+     * @throws IOException 
+     * @tests java.nio.channels.SocketChannel#read(ByteBuffer)
+     */
+    @TestTargetNew(
+        level = TestLevel.PARTIAL_COMPLETE,
+        notes = "",
+        method = "read",
+        args = {java.nio.ByteBuffer[].class}
+    ) 
+    public void test_socketChannel_read_DirectByteBuffer() throws InterruptedException, IOException {
+
+        ServerThread server = new ServerThread();
+        server.start();
+        Thread.currentThread().sleep(1000);
+
+        InetSocketAddress address = new InetSocketAddress(InetAddress
+                .getByName("localhost"), port);
+
+        // First test with array based byte buffer
+        SocketChannel sc = SocketChannel.open();
+        sc.connect(address);
+
+        ByteBuffer buf = ByteBuffer.allocate(data.length);
+        buf.limit(data.length / 2);
+        sc.read(buf);
+
+        buf.limit(buf.capacity());
+        sc.read(buf);
+        sc.close();
+
+        // Make sure the buffer is filled correctly
+        buf.rewind();
+        assertSameContent(data, buf);
+
+        // Now test with direct byte buffer
+        sc = SocketChannel.open();
+        sc.connect(address);
+
+        buf = ByteBuffer.allocateDirect(data.length);
+        buf.limit(data.length / 2);
+        sc.read(buf);
+
+        buf.limit(buf.capacity());
+        sc.read(buf);
+        sc.close();
+
+        // Make sure the buffer is filled correctly
+        buf.rewind();
+        assertSameContent(data, buf);
+    }
+
+    private void assertSameContent(byte[] data, ByteBuffer buf) {
+        for (byte b : data) {
+            if (b != buf.get()) {
+                int pos = buf.position() - 1;
+                fail("Content not equal. Buffer position: " +
+                        (pos) + " expected: " + b + " was: " + buf.get(pos));
+            }
+        }
+    }
+
+    public static boolean done = false;
+    public static int port = Support_PortManager.getNextPort();
+    public static byte[] data = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
+
+    static class ServerThread extends Thread {
+        @Override
+        public void run() {
+            try {
+                ServerSocketChannel ssc = ServerSocketChannel.open();
+                InetSocketAddress addr = new InetSocketAddress(InetAddress
+                        .getByAddress(new byte[] {0, 0, 0, 0}), port);
+                ssc.socket().bind(addr, 0);
+
+                ByteBuffer buf = ByteBuffer.allocate(10);
+                buf.put(data);
+
+                while (!done) {
+                    SocketChannel sc = ssc.accept();
+                    buf.rewind();
+                    sc.write(buf);
+                }
+            } catch (Exception e) {
+                // ignore
+            }
+        }
+    }
+
     class MockSocketChannel extends SocketChannel {
 
         private boolean isWriteCalled = false;
index b7a0c70..719c89a 100644 (file)
@@ -1006,15 +1006,11 @@ public abstract class Preferences {
     
     //parse node's absolute path from class instance
     private static String getNodeName(Class<?> c){
-        // ??? PREFS TODO change back to harmony code once getPackage
-        // delivers the correct results
-        // Package p = c.getPackage();
-        // if(null == p){
-        //     return "/<unnamed>"; //$NON-NLS-1$
-        // }
-        // return "/"+p.getName().replace('.', '/'); //$NON-NLS-1$
-        int dotIndex = c.getName().lastIndexOf(".");
-        return "/" + c.getName().substring(0, dotIndex).replace(".", "/");
+        Package p = c.getPackage();
+        if(null == p){
+            return "/<unnamed>"; //$NON-NLS-1$
+        }
+        return "/"+p.getName().replace('.', '/'); //$NON-NLS-1$
     }
 
     /**
index 41a51e2..6418962 100644 (file)
@@ -390,7 +390,7 @@ public class RuleBasedCollator extends Collator {
 
     /**
      * Returns the collation rules of this collator. These {@code rules} can be
-     * fed into the {@link #RuleBasedCollator(String)} constructor.
+     * fed into the {@code RuleBasedCollator(String)} constructor.
      * <p>
      * Note that the {@code rules} are actually interpreted as a delta to the
      * standard Unicode Collation Algorithm (UCA). Hence, an empty {@code rules}
index 2639d7b..a8b5345 100644 (file)
@@ -643,6 +643,10 @@ static bool parseAuxData(const u1* data, DexFile* pDexFile)
             }
             indexMapType = *pAux;
             break;
+        case kDexChunkRegisterMaps:
+            LOGV("+++ found register maps, size=%u\n", size);
+            pDexFile->pRegisterMapPool = data;
+            break;
         default:
             LOGI("Unknown chunk 0x%08x (%c%c%c%c), size=%d in aux data area\n",
                 *pAux,
index d1ea5eb..4d8d151 100644 (file)
@@ -163,6 +163,7 @@ enum {
 /* auxillary data section chunk codes */
 enum {
     kDexChunkClassLookup            = 0x434c4b50,   /* CLKP */
+    kDexChunkRegisterMaps           = 0x524d4150,   /* RMAP */
 
     kDexChunkReducingIndexMap       = 0x5249584d,   /* RIXM */
     kDexChunkExpandingIndexMap      = 0x4549584d,   /* EIXM */
@@ -514,11 +515,13 @@ typedef struct DexFile {
     const DexClassDef*  pClassDefs;
     const DexLink*      pLinkData;
 
-    /* mapped in "auxillary" section */
+    /*
+     * These are mapped out of the "auxillary" section, and may not be
+     * included in the file.
+     */
     const DexClassLookup* pClassLookup;
-
-    /* mapped in "auxillary" section */
     DexIndexMap         indexMap;
+    const void*         pRegisterMapPool;       // RegisterMapClassPool
 
     /* points to start of DEX file data */
     const u1*           baseAddr;
@@ -672,6 +675,15 @@ DEX_INLINE const DexClassDef* dexGetClassDef(const DexFile* pDexFile, u4 idx) {
     return &pDexFile->pClassDefs[idx];
 }
 
+/* given a ClassDef pointer, recover its index */
+DEX_INLINE u4 dexGetIndexForClassDef(const DexFile* pDexFile,
+    const DexClassDef* pClassDef)
+{
+    assert(pClassDef >= pDexFile->pClassDefs &&
+           pClassDef < pDexFile->pClassDefs + pDexFile->pHeader->classDefsSize);
+    return pClassDef - pDexFile->pClassDefs;
+}
+
 /* get the interface list for a DexClass */
 DEX_INLINE const DexTypeList* dexGetInterfacesList(const DexFile* pDexFile,
     const DexClassDef* pClassDef)
index 530ac2e..bf1be88 100644 (file)
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 /*
  * System utilities.
  */
@@ -64,6 +65,25 @@ static void* sysCreateAnonShmem(size_t length)
 #endif
 }
 
+/*
+ * Create a private anonymous storage area.
+ */
+int sysCreatePrivateMap(size_t length, MemMapping* pMap)
+{
+    void* memPtr;
+
+    memPtr = sysCreateAnonShmem(length);
+    if (memPtr == NULL)
+        return -1;
+
+    pMap->addr = pMap->baseAddr = memPtr;
+    pMap->length = pMap->baseLength = length;
+    return 0;
+}
+
+/*
+ * Determine the current offset and remaining length of the open file.
+ */
 static int getFileStartAndLength(int fd, off_t *start_, size_t *length_)
 {
     off_t start, end;
index 8d85efa..8b80503 100644 (file)
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 /*
  * System utilities.
  */
@@ -63,6 +64,13 @@ int sysMapFileSegmentInShmem(int fd, off_t start, long length,
     MemMapping* pMap);
 
 /*
+ * Create a private anonymous mapping, useful for large allocations.
+ *
+ * On success, "pMap" is filled in, and zero is returned.
+ */
+int sysCreatePrivateMap(size_t length, MemMapping* pMap);
+
+/*
  * Release the pages associated with a shared memory segment.
  *
  * This does not free "pMap"; it just releases the memory.
index 25a03fd..1c3a052 100644 (file)
@@ -52,9 +52,11 @@ endif
 # - assert()  (NDEBUG is handled in the build system)
 #
 ifeq ($(TARGET_BUILD_TYPE),debug)
-LOCAL_CFLAGS += -DWITH_INSTR_CHECKS -DWITH_EXTRA_OBJECT_VALIDATION
+LOCAL_CFLAGS += -DWITH_INSTR_CHECKS
+LOCAL_CFLAGS += -DWITH_EXTRA_OBJECT_VALIDATION
 LOCAL_CFLAGS += -DWITH_TRACKREF_CHECKS
 LOCAL_CFLAGS += -DWITH_ALLOC_LIMITS
+LOCAL_CFLAGS += -DWITH_EXTRA_GC_CHECKS=1
 #LOCAL_CFLAGS += -DCHECK_MUTEX
 #LOCAL_CFLAGS += -DPROFILE_FIELD_ACCESS
 LOCAL_CFLAGS += -DDVM_SHOW_EXCEPTION=3
@@ -73,6 +75,8 @@ ifeq ($(TARGET_BUILD_TYPE),release)
 #LOCAL_CFLAGS += -DNDEBUG -DLOG_NDEBUG=1
 # "-O2" is redundant for device (release) but useful for sim (debug)
 #LOCAL_CFLAGS += -O2 -Winline
+#LOCAL_CFLAGS += -DWITH_EXTRA_OBJECT_VALIDATION
+LOCAL_CFLAGS += -DWITH_EXTRA_GC_CHECKS=1
 LOCAL_CFLAGS += -DDVM_SHOW_EXCEPTION=1
 # if you want to try with assertions on the device, add:
 #LOCAL_CFLAGS += -UNDEBUG -DDEBUG=1 -DLOG_NDEBUG=1 -DWITH_DALVIK_ASSERT
@@ -173,6 +177,7 @@ LOCAL_SRC_FILES := \
        reflect/Annotation.c \
        reflect/Proxy.c \
        reflect/Reflect.c \
+       test/AtomicSpeed.c \
        test/TestHash.c
 
 WITH_HPROF := $(strip $(WITH_HPROF))
index 2c7bd7c..29abc2c 100644 (file)
@@ -67,6 +67,7 @@
 #include "LinearAlloc.h"
 #include "analysis/DexVerify.h"
 #include "analysis/DexOptimize.h"
+#include "analysis/RegisterMap.h"
 #include "Init.h"
 #include "libdex/OpCode.h"
 #include "libdex/InstrUtils.h"
index c667893..3affa97 100644 (file)
@@ -2697,10 +2697,10 @@ JdwpError dvmDbgInvokeMethod(ObjectId threadId, ObjectId objectId,
     dvmUnlockThreadList();
 
     /*
-     * We change our thread status (which should be THREAD_RUNNING) so the
-     * VM can suspend for a GC if the invoke request causes us to run out
-     * of memory.  It's also a good idea to change it before locking the
-     * invokeReq mutex, although that should never be held for long.
+     * We change our (JDWP thread) status, which should be THREAD_RUNNING,
+     * so the VM can suspend for a GC if the invoke request causes us to
+     * run out of memory.  It's also a good idea to change it before locking
+     * the invokeReq mutex, although that should never be held for long.
      */
     Thread* self = dvmThreadSelf();
     int oldStatus = dvmChangeStatus(self, THREAD_VMWAIT);
@@ -2774,18 +2774,25 @@ static u1 resultTagFromSignature(const Method* method)
 
 /*
  * Execute the method described by "*pReq".
+ *
+ * We're currently in VMWAIT, because we're stopped on a breakpoint.  We
+ * want to switch to RUNNING while we execute.
  */
 void dvmDbgExecuteMethod(DebugInvokeReq* pReq)
 {
     Thread* self = dvmThreadSelf();
     const Method* meth;
     Object* oldExcept;
+    int oldStatus;
 
     /*
      * We can be called while an exception is pending in the VM.  We need
      * to preserve that across the method invocation.
      */
     oldExcept = dvmGetException(self);
+    dvmClearException(self);
+
+    oldStatus = dvmChangeStatus(self, THREAD_RUNNING);
 
     /*
      * Translate the method through the vtable, unless we're calling a
@@ -2832,6 +2839,7 @@ void dvmDbgExecuteMethod(DebugInvokeReq* pReq)
 
     if (oldExcept != NULL)
         dvmSetException(self, oldExcept);
+    dvmChangeStatus(self, oldStatus);
 }
 
 // for dvmAddressSetForLine
index f68e45d..0678ea2 100644 (file)
@@ -99,6 +99,7 @@ struct DvmGlobals {
 
     DexOptimizerMode    dexOptMode;
     DexClassVerifyMode  classVerifyMode;
+    bool        preciseGc;
     bool        generateRegisterMaps;
 
     int         assertionCtrlCount;
@@ -462,10 +463,13 @@ struct DvmGlobals {
     /*
      * Compute some stats on loaded classes.
      */
-    int             numLoadedClasses;
-    int             numDeclaredMethods;
-    int             numDeclaredInstFields;
-    int             numDeclaredStaticFields;
+    int         numLoadedClasses;
+    int         numDeclaredMethods;
+    int         numDeclaredInstFields;
+    int         numDeclaredStaticFields;
+
+    /* when using a native debugger, set this to suppress watchdog timers */
+    bool        nativeDebuggerActive;
 
     /*
      * JDWP debugger support.
@@ -594,6 +598,9 @@ struct DvmGlobals {
 #ifdef COUNT_PRECISE_METHODS
     PointerSet* preciseMethods;
 #endif
+
+    /* some RegisterMap statistics, useful during development */
+    void*       registerMapStats;
 };
 
 extern struct DvmGlobals gDvm;
index 176910c..4ba10b7 100644 (file)
--- a/vm/Init.c
+++ b/vm/Init.c
@@ -95,6 +95,7 @@ static void dvmUsage(const char* progName)
     dvmFprintf(stderr, "  -Xjniopts:{warnonly,forcecopy}\n");
     dvmFprintf(stderr, "  -Xdeadlockpredict:{off,warn,err,abort}\n");
     dvmFprintf(stderr, "  -Xstacktracefile:<filename>\n");
+    dvmFprintf(stderr, "  -Xgc:[no]precise\n");
     dvmFprintf(stderr, "  -Xgenregmap\n");
     dvmFprintf(stderr, "  -Xcheckdexsum\n");
     dvmFprintf(stderr, "\n");
@@ -132,6 +133,9 @@ static void dvmUsage(const char* progName)
 #ifdef WITH_EXTRA_OBJECT_VALIDATION
         " extra_object_validation"
 #endif
+#ifdef WITH_EXTRA_GC_CHECKS
+        " extra_gc_checks"
+#endif
 #ifdef WITH_DALVIK_ASSERT
         " dalvik_assert"
 #endif
@@ -788,6 +792,18 @@ static int dvmProcessOptions(int argc, const char* const argv[],
 
         } else if (strcmp(argv[i], "-Xgenregmap") == 0) {
             gDvm.generateRegisterMaps = true;
+            LOGD("Register maps will be generated during verification\n");
+
+        } else if (strncmp(argv[i], "-Xgc:", 5) == 0) {
+            if (strcmp(argv[i] + 5, "precise") == 0)
+                gDvm.preciseGc = true;
+            else if (strcmp(argv[i] + 5, "noprecise") == 0)
+                gDvm.preciseGc = false;
+            else {
+                dvmFprintf(stderr, "Bad value for -Xgc");
+                return -1;
+            }
+            LOGD("Precise GC configured %s\n", gDvm.preciseGc ? "ON" : "OFF");
 
         } else if (strcmp(argv[i], "-Xcheckdexsum") == 0) {
             gDvm.verifyDexChecksum = true;
@@ -810,6 +826,8 @@ static int dvmProcessOptions(int argc, const char* const argv[],
 
 /*
  * Set defaults for fields altered or modified by arguments.
+ *
+ * Globals are initialized to 0 (a/k/a NULL or false).
  */
 static void setCommandLineDefaults()
 {
@@ -936,6 +954,14 @@ int dvmStartup(int argc, const char* const argv[], bool ignoreUnrecognized,
         goto fail;
     }
 
+#if WITH_EXTRA_GC_CHECKS > 1
+    /* only "portable" interp has the extra goodies */
+    if (gDvm.executionMode != kExecutionModeInterpPortable) {
+        LOGI("Switching to 'portable' interpreter for GC checks\n");
+        gDvm.executionMode = kExecutionModeInterpPortable;
+    }
+#endif
+
     /* configure signal handling */
     if (!gDvm.reduceSignals)
         blockSignals();
@@ -957,6 +983,8 @@ int dvmStartup(int argc, const char* const argv[], bool ignoreUnrecognized,
         goto fail;
     if (!dvmVerificationStartup())
         goto fail;
+    if (!dvmRegisterMapStartup())
+        goto fail;
     if (!dvmInstanceofStartup())
         goto fail;
     if (!dvmClassStartup())
@@ -1290,6 +1318,8 @@ int dvmPrepForDexOpt(const char* bootClassPath, DexOptimizerMode dexOptMode,
         goto fail;
     if (!dvmVerificationStartup())
         goto fail;
+    if (!dvmRegisterMapStartup())
+        goto fail;
     if (!dvmInstanceofStartup())
         goto fail;
     if (!dvmClassStartup())
@@ -1370,6 +1400,7 @@ void dvmShutdown(void)
     dvmThreadShutdown();
     dvmClassShutdown();
     dvmVerificationShutdown();
+    dvmRegisterMapShutdown();
     dvmInstanceofShutdown();
     dvmInlineNativeShutdown();
     dvmGcShutdown();
index 8549338..63051a2 100644 (file)
--- a/vm/Init.h
+++ b/vm/Init.h
@@ -41,9 +41,14 @@ int dvmPrepForDexOpt(const char* bootClassPath, DexOptimizerMode dexOptMode,
     DexClassVerifyMode verifyMode, int dexoptFlags);
 
 /*
- * Unconditionally abort the entire VM.  Try not to use this.
+ * Replacement for fprintf() when we want to send a message to the console.
+ * This defaults to fprintf(), but will use the JNI fprintf callback if
+ * one was provided.
  */
-int dvmFprintf(FILE* fp, const char* format, ...);
-void dvmAbort(void);
+int dvmFprintf(FILE* fp, const char* format, ...)
+#if defined(__GNUC__)
+    __attribute__ ((format(printf, 2, 3)))
+#endif
+    ;
 
 #endif /*_DALVIK_INIT*/
index f7a21ff..cb1821f 100644 (file)
--- a/vm/Jni.c
+++ b/vm/Jni.c
@@ -2653,7 +2653,7 @@ static jobjectRefType GetObjectRefType(JNIEnv* env, jobject obj)
 {
     JNI_ENTER();
     jobjectRefType type;
-    
+
     if (obj == NULL)
         type = JNIInvalidRefType;
     else
@@ -2677,45 +2677,55 @@ static jobjectRefType GetObjectRefType(JNIEnv* env, jobject obj)
 static jobject NewDirectByteBuffer(JNIEnv * env, void* address, jlong capacity)
 {
     jmethodID newBufferMethod;
-    jclass directBufferClass;
-    jclass platformaddressClass;
-    jobject platformaddress;
+    jclass directBufferClass = NULL;
+    jclass platformaddressClass = NULL;
+    jobject platformaddress = NULL;
     jmethodID onMethod;
+    jobject result = NULL;
 
     directBufferClass = (*env)->FindClass(env, 
             "java/nio/ReadWriteDirectByteBuffer");
 
     if(!directBufferClass)
     {
-        return NULL;
+        goto bail;
     }
 
     newBufferMethod = (*env)->GetMethodID(env, directBufferClass, "<init>",
             "(Lorg/apache/harmony/luni/platform/PlatformAddress;II)V");
     if(!newBufferMethod)
     {
-        return NULL;
+        goto bail;
     }
 
     platformaddressClass = (*env)->FindClass(env, 
             "org/apache/harmony/luni/platform/PlatformAddressFactory");
     if(!platformaddressClass)
     {
-        return NULL;
+        goto bail;
     }
 
     onMethod = (*env)->GetStaticMethodID(env, platformaddressClass, "on",
             "(I)Lorg/apache/harmony/luni/platform/PlatformAddress;");
     if(!onMethod)
     {
-        return NULL;
+        goto bail;
     }
 
-    platformaddress = (*env)->CallStaticObjectMethod(env, platformaddressClass, 
+    platformaddress = (*env)->CallStaticObjectMethod(env, platformaddressClass,
             onMethod, (jint)address);
 
-    return (*env)->NewObject(env, directBufferClass, newBufferMethod, 
+    result = (*env)->NewObject(env, directBufferClass, newBufferMethod, 
             platformaddress, (jint)capacity, (jint)0);
+
+bail:
+    if (directBufferClass != NULL)
+        (*env)->DeleteLocalRef(env, directBufferClass);
+    if (platformaddressClass != NULL)
+        (*env)->DeleteLocalRef(env, platformaddressClass);
+    if (platformaddress != NULL)
+        (*env)->DeleteLocalRef(env, platformaddress);
+    return result;
 }
 
 /*
@@ -2730,43 +2740,53 @@ static jobject NewDirectByteBuffer(JNIEnv * env, void* address, jlong capacity)
 static void* GetDirectBufferAddress(JNIEnv * env, jobject buf)
 {
     jmethodID tempMethod;
-    jclass tempClass;
-    jobject platformAddr;
-    jclass platformAddrClass;
+    jclass tempClass = NULL;
+    jobject platformAddr = NULL;
+    jclass platformAddrClass = NULL;
     jmethodID toLongMethod;
+    void* result = NULL;
 
     tempClass = (*env)->FindClass(env, 
             "org/apache/harmony/nio/internal/DirectBuffer");
     if(!tempClass)
     {
-        return 0;
+        goto bail;
     }
 
     if(JNI_FALSE == (*env)->IsInstanceOf(env, buf, tempClass))
     {
-        return 0;
+        goto bail;
     }
 
     tempMethod = (*env)->GetMethodID(env, tempClass, "getBaseAddress",
-             "()Lorg/apache/harmony/luni/platform/PlatformAddress;");        
+             "()Lorg/apache/harmony/luni/platform/PlatformAddress;");
     if(!tempMethod){
-        return 0;
-    }    
+        goto bail;
+    }
     platformAddr = (*env)->CallObjectMethod(env, buf, tempMethod);
     platformAddrClass = (*env)->FindClass (env, 
             "org/apache/harmony/luni/platform/PlatformAddress");
     if(!platformAddrClass)
     {
-        return 0;
+        goto bail;
 
     }
     toLongMethod = (*env)->GetMethodID(env, platformAddrClass, "toLong", "()J");
     if (!toLongMethod)
     {
-        return 0;
+        goto bail;
     }
 
-    return (void*)(u4)(*env)->CallLongMethod(env, platformAddr, toLongMethod);    
+    result = (void*)(u4)(*env)->CallLongMethod(env, platformAddr, toLongMethod);
+
+bail:
+    if (tempClass != NULL)
+        (*env)->DeleteLocalRef(env, tempClass);
+    if (platformAddr != NULL)
+        (*env)->DeleteLocalRef(env, platformAddr);
+    if (platformAddrClass != NULL)
+        (*env)->DeleteLocalRef(env, platformAddrClass);
+    return result;
 }
 
 /*
@@ -2781,34 +2801,42 @@ static void* GetDirectBufferAddress(JNIEnv * env, jobject buf)
 static jlong GetDirectBufferCapacity(JNIEnv * env, jobject buf)
 {
     jfieldID fieldCapacity;
-    jclass directBufferClass;
-    jclass bufferClass;
+    jclass directBufferClass = NULL;
+    jclass bufferClass = NULL;
+    jlong result = -1;
 
     directBufferClass = (*env)->FindClass(env,
             "org/apache/harmony/nio/internal/DirectBuffer");
     if (!directBufferClass)
     {
-        return -1;
+        goto bail;
     }
 
     if (JNI_FALSE == (*env)->IsInstanceOf(env, buf, directBufferClass))
     {
-        return -1;
+        goto bail;
     }
 
     bufferClass = (*env)->FindClass(env, "java/nio/Buffer");
     if (!bufferClass)
     {
-        return -1;
+        goto bail;
     }
 
     fieldCapacity = (*env)->GetFieldID(env, bufferClass, "capacity", "I");
     if (!fieldCapacity)
     {
-        return -1;
+        goto bail;
     }
 
-    return (*env)->GetIntField(env, buf, fieldCapacity);
+    result = (*env)->GetIntField(env, buf, fieldCapacity);
+
+bail:
+    if (directBufferClass != NULL)
+        (*env)->DeleteLocalRef(env, directBufferClass);
+    if (bufferClass != NULL)
+        (*env)->DeleteLocalRef(env, bufferClass);
+    return result;
 }
 
 
index 5f3af7b..bd6fece 100644 (file)
--- a/vm/Misc.h
+++ b/vm/Misc.h
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 /*
  * Miscellaneous utility functions.
  */
@@ -143,7 +144,11 @@ void dvmCreateFileOutputTarget(DebugOutputTarget* target, FILE* fp);
  * Print a debug message.
  */
 void dvmPrintDebugMessage(const DebugOutputTarget* target, const char* format,
-    ...);
+    ...)
+#if defined(__GNUC__)
+    __attribute__ ((format(printf, 2, 3)))
+#endif
+    ;
 
 
 /*
@@ -277,6 +282,15 @@ bool dvmIterativeSleep(int iteration, int maxTotalSleep, u8 relStartTime);
  */
 bool dvmSetCloseOnExec(int fd);
 
+/*
+ * Unconditionally abort the entire VM.  Try not to use this.
+ */
+void dvmAbort(void)
+#if defined(__GNUC__)
+    __attribute__ ((noreturn))
+#endif
+    ;
+
 #if (!HAVE_STRLCPY)
 /* Implementation of strlcpy() for platforms that don't already have it. */
 size_t strlcpy(char *dst, const char *src, size_t size);
index 7a153d6..4fb9795 100644 (file)
@@ -411,19 +411,25 @@ bool dvmLoadNativeCode(const char* pathName, Object* classLoader)
      * doesn't have to search through LD_LIBRARY_PATH.  (It may do so to
      * resolve this library's dependencies though.)
      *
-     * Failures here are expected when java.library.path has several entries.
+     * Failures here are expected when java.library.path has several entries
+     * and we have to hunt for the lib.
      *
      * The current android-arm dynamic linker implementation tends to
      * return "Cannot find library" from dlerror() regardless of the actual
-     * problem.  A more useful diagnostic may be sent to stdout/stderr,
-     * but often that's not visible.  Some things to try:
+     * problem.  A more useful diagnostic may be sent to stdout/stderr if
+     * linker diagnostics are enabled, but that's not usually visible in
+     * Android apps.  Some things to try:
      *   - make sure the library exists on the device
      *   - verify that the right path is being opened (the debug log message
      *     above can help with that)
-     *   - check to see if the library is valid
+     *   - check to see if the library is valid (e.g. not zero bytes long)
      *   - check config/prelink-linux-arm.map to ensure that the library
      *     is listed and is not being overrun by the previous entry (if
-     *     loading suddenly stops working, this is a good one to check)
+     *     loading suddenly stops working on a prelinked library, this is
+     *     a good one to check)
+     *   - write a trivial app that calls sleep() then dlopen(), attach
+     *     to it with "strace -p <pid>" while it sleeps, and watch for
+     *     attempts to open nonexistent dependent shared libs
      */
     handle = dlopen(pathName, RTLD_LAZY);
     if (handle == NULL) {
index 9b47885..f7e6c17 100644 (file)
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 /*
  * Android's method call profiling goodies.
  */
@@ -388,6 +389,7 @@ void dvmMethodTraceStart(const char* traceFileName, int bufferSize, int flags)
     return;
 
 fail:
+    updateActiveProfilers(-1);
     if (state->traceFile != NULL) {
         fclose(state->traceFile);
         state->traceFile = NULL;
@@ -448,6 +450,15 @@ static u4 getClockOverhead(void)
 }
 
 /*
+ * Returns "true" if method tracing is currently active.
+ */
+bool dvmIsMethodTraceActive(void)
+{
+    const MethodTraceState* state = &gDvm.methodTrace;
+    return state->traceEnabled;
+}
+
+/*
  * Stop method tracing.  We write the buffer to disk and generate a key
  * file so we can interpret it.
  */
@@ -464,6 +475,7 @@ void dvmMethodTraceStop(void)
 
     if (!state->traceEnabled) {
         /* somebody already stopped it, or it was never started */
+        LOGD("TRACE stop requested, but not running\n");
         dvmUnlockMutex(&state->startStopLock);
         return;
     } else {
index f762974..cdaf027 100644 (file)
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 /*
  * Android's method call profiling goodies.
  */
@@ -96,6 +97,7 @@ typedef struct AllocProfState {
  * Start/stop method tracing.
  */
 void dvmMethodTraceStart(const char* traceFileName, int bufferSize, int flags);
+bool dvmIsMethodTraceActive(void);
 void dvmMethodTraceStop(void);
 
 /*
index 42b527e..497abaa 100644 (file)
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 /*
  * Thread support.
  */
@@ -478,6 +479,20 @@ void dvmUnlockThreadList(void)
     assert(cc == 0);
 }
 
+/*
+ * Convert SuspendCause to a string.
+ */
+static const char* getSuspendCauseStr(SuspendCause why)
+{
+    switch (why) {
+    case SUSPEND_NOT:               return "NOT?";
+    case SUSPEND_FOR_GC:            return "gc";
+    case SUSPEND_FOR_DEBUG:         return "debug";
+    case SUSPEND_FOR_DEBUG_EVENT:   return "debug-event";
+    case SUSPEND_FOR_STACK_DUMP:    return "stack-dump";
+    default:                        return "UNKNOWN";
+    }
+}
 
 /*
  * Grab the "thread suspend" lock.  This is required to prevent the
@@ -489,7 +504,6 @@ void dvmUnlockThreadList(void)
  */
 static void lockThreadSuspend(const char* who, SuspendCause why)
 {
-    const int kMaxRetries = 10;
     const int kSpinSleepTime = 3*1000*1000;        /* 3s */
     u8 startWhen = 0;       // init req'd to placate gcc
     int sleepIter = 0;
@@ -500,23 +514,30 @@ static void lockThreadSuspend(const char* who, SuspendCause why)
         if (cc != 0) {
             if (!dvmCheckSuspendPending(NULL)) {
                 /*
-                 * Could be unusual JNI-attach thing, could be we hit
-                 * the window as the suspend or resume was started.  Could
-                 * also be the debugger telling us to resume at roughly
+                 * Could be we hit the window as the suspend or resume
+                 * was started (i.e. the lock has been grabbed but the
+                 * other thread hasn't yet set our "please suspend" flag).
+                 *
+                 * Could be an unusual JNI thread-attach thing.
+                 *
+                 * Could be the debugger telling us to resume at roughly
                  * the same time we're posting an event.
                  */
-                LOGI("threadid=%d ODD: thread-suspend lock held (%s:%d)"
-                     " but suspend not pending\n",
-                    dvmThreadSelf()->threadId, who, why);
+                LOGI("threadid=%d ODD: want thread-suspend lock (%s:%s),"
+                     " it's held, no suspend pending\n",
+                    dvmThreadSelf()->threadId, who, getSuspendCauseStr(why));
+            } else {
+                /* we suspended; reset timeout */
+                sleepIter = 0;
             }
 
             /* give the lock-holder a chance to do some work */
             if (sleepIter == 0)
                 startWhen = dvmGetRelativeTimeUsec();
             if (!dvmIterativeSleep(sleepIter++, kSpinSleepTime, startWhen)) {
-                LOGE("threadid=%d: couldn't get thread-suspend lock (%s:%d),"
+                LOGE("threadid=%d: couldn't get thread-suspend lock (%s:%s),"
                      " bailing\n",
-                    dvmThreadSelf()->threadId, who, why);
+                    dvmThreadSelf()->threadId, who, getSuspendCauseStr(why));
                 dvmDumpAllThreads(false);
                 dvmAbort();
             }
@@ -2179,8 +2200,15 @@ void dvmSuspendSelf(bool jdwpActivity)
                 &gDvm.threadSuspendCountLock);
         assert(cc == 0);
         if (self->suspendCount != 0) {
-            LOGD("threadid=%d: still suspended after undo (s=%d d=%d)\n",
-                self->threadId, self->suspendCount, self->dbgSuspendCount);
+            /*
+             * The condition was signaled but we're still suspended.  This
+             * can happen if the debugger lets go while a SIGQUIT thread
+             * dump event is pending (assuming SignalCatcher was resumed for
+             * just long enough to try to grab the thread-suspend lock).
+             */
+            LOGD("threadid=%d: still suspended after undo (sc=%d dc=%d s=%c)\n",
+                self->threadId, self->suspendCount, self->dbgSuspendCount,
+                self->isSuspended ? 'Y' : 'N');
         }
     }
     assert(self->suspendCount == 0 && self->dbgSuspendCount == 0);
@@ -2898,9 +2926,9 @@ void dvmDumpThreadEx(const DebugOutputTarget* target, Thread* thread,
         threadName, isDaemon ? " daemon" : "",
         priority, thread->threadId, kStatusNames[thread->status]);
     dvmPrintDebugMessage(target,
-        "  | group=\"%s\" sCount=%d dsCount=%d s=%d obj=%p\n",
+        "  | group=\"%s\" sCount=%d dsCount=%d s=%c obj=%p\n",
         groupName, thread->suspendCount, thread->dbgSuspendCount,
-        thread->isSuspended, thread->threadObj);
+        thread->isSuspended ? 'Y' : 'N', thread->threadObj);
     dvmPrintDebugMessage(target,
         "  | sysTid=%d nice=%d sched=%d/%d handle=%d\n",
         thread->systemTid, getpriority(PRIO_PROCESS, thread->systemTid),
@@ -3127,9 +3155,15 @@ LockedObjectData* dvmFindInMonitorList(const Thread* self, const Object* obj)
  * GC helper functions
  */
 
+/*
+ * Add the contents of the registers from the interpreted call stack.
+ */
 static void gcScanInterpStackReferences(Thread *thread)
 {
     const u4 *framePtr;
+#if WITH_EXTRA_GC_CHECKS > 1
+    bool first = true;
+#endif
 
     framePtr = (const u4 *)thread->curFrame;
     while (framePtr != NULL) {
@@ -3138,27 +3172,184 @@ static void gcScanInterpStackReferences(Thread *thread)
 
         saveArea = SAVEAREA_FROM_FP(framePtr);
         method = saveArea->method;
-        if (method != NULL) {
+        if (method != NULL && !dvmIsNativeMethod(method)) {
 #ifdef COUNT_PRECISE_METHODS
             /* the GC is running, so no lock required */
-            if (!dvmIsNativeMethod(method)) {
-                if (dvmPointerSetAddEntry(gDvm.preciseMethods, method))
-                    LOGI("Added %s.%s %p\n",
-                        method->clazz->descriptor, method->name, method);
+            if (dvmPointerSetAddEntry(gDvm.preciseMethods, method))
+                LOGI("PGC: added %s.%s %p\n",
+                    method->clazz->descriptor, method->name, method);
+#endif
+#if WITH_EXTRA_GC_CHECKS > 1
+            /*
+             * May also want to enable the memset() in the "invokeMethod"
+             * goto target in the portable interpreter.  That sets the stack
+             * to a pattern that makes referring to uninitialized data
+             * very obvious.
+             */
+
+            if (first) {
+                /*
+                 * First frame, isn't native, check the "alternate" saved PC
+                 * as a sanity check.
+                 *
+                 * It seems like we could check the second frame if the first
+                 * is native, since the PCs should be the same.  It turns out
+                 * this doesn't always work.  The problem is that we could
+                 * have calls in the sequence:
+                 *   interp method #2
+                 *   native method
+                 *   interp method #1
+                 *
+                 * and then GC while in the native method after returning
+                 * from interp method #2.  The currentPc on the stack is
+                 * for interp method #1, but thread->currentPc2 is still
+                 * set for the last thing interp method #2 did.
+                 *
+                 * This can also happen in normal execution:
+                 * - sget-object on not-yet-loaded class
+                 * - class init updates currentPc2
+                 * - static field init is handled by parsing annotations;
+                 *   static String init requires creation of a String object,
+                 *   which can cause a GC
+                 *
+                 * Essentially, any pattern that involves executing
+                 * interpreted code and then causes an allocation without
+                 * executing instructions in the original method will hit
+                 * this.  These are rare enough that the test still has
+                 * some value.
+                 */
+                if (saveArea->xtra.currentPc != thread->currentPc2) {
+                    LOGW("PGC: savedPC(%p) != current PC(%p), %s.%s ins=%p\n",
+                        saveArea->xtra.currentPc, thread->currentPc2,
+                        method->clazz->descriptor, method->name, method->insns);
+                    if (saveArea->xtra.currentPc != NULL)
+                        LOGE("  pc inst = 0x%04x\n", *saveArea->xtra.currentPc);
+                    if (thread->currentPc2 != NULL)
+                        LOGE("  pc2 inst = 0x%04x\n", *thread->currentPc2);
+                    dvmDumpThread(thread, false);
+                }
+            } else {
+                /*
+                 * It's unusual, but not impossible, for a non-first frame
+                 * to be at something other than a method invocation.  For
+                 * example, if we do a new-instance on a nonexistent class,
+                 * we'll have a lot of class loader activity on the stack
+                 * above the frame with the "new" operation.  Could also
+                 * happen while we initialize a Throwable when an instruction
+                 * fails.
+                 *
+                 * So there's not much we can do here to verify the PC,
+                 * except to verify that it's a GC point.
+                 */
             }
+            assert(saveArea->xtra.currentPc != NULL);
 #endif
+
+            const RegisterMap* pMap;
+            const u1* regVector;
             int i;
-            for (i = method->registersSize - 1; i >= 0; i--) {
-                u4 rval = *framePtr++;
-//TODO: wrap markifobject in a macro that does pointer checks
-                if (rval != 0 && (rval & 0x3) == 0) {
-                    dvmMarkIfObject((Object *)rval);
+
+            pMap = method->registerMap;
+            if (pMap != NULL) {
+                /* found map, get registers for this address */
+                int addr = saveArea->xtra.currentPc - method->insns;
+                regVector = dvmGetRegisterMapLine(pMap, addr);
+                if (regVector == NULL) {
+                    LOGW("PGC: map but no entry for %s.%s addr=0x%04x\n",
+                        method->clazz->descriptor, method->name, addr);
+                } else {
+                    LOGV("PGC: found map for %s.%s 0x%04x (t=%d)\n",
+                        method->clazz->descriptor, method->name, addr,
+                        thread->threadId);
                 }
+            } else {
+                /*
+                 * No map found.  If precise GC is disabled this is
+                 * expected -- we don't create pointers to the map data even
+                 * if it's present -- but if it's enabled it means we're
+                 * unexpectedly falling back on a conservative scan, so it's
+                 * worth yelling a little.
+                 *
+                 * TODO: we should be able to remove this for production --
+                 * no need to keep banging on the global.
+                 */
+                if (gDvm.preciseGc) {
+                    LOGI("PGC: no map for %s.%s\n",
+                        method->clazz->descriptor, method->name);
+                }
+                regVector = NULL;
+            }
+
+            if (regVector == NULL) {
+                /* conservative scan */
+                for (i = method->registersSize - 1; i >= 0; i--) {
+                    u4 rval = *framePtr++;
+                    if (rval != 0 && (rval & 0x3) == 0) {
+                        dvmMarkIfObject((Object *)rval);
+                    }
+                }
+            } else {
+                /*
+                 * Precise scan.  v0 is at the lowest address on the
+                 * interpreted stack, and is the first bit in the register
+                 * vector, so we can walk through the register map and
+                 * memory in the same direction.
+                 *
+                 * A '1' bit indicates a live reference.
+                 */
+                u2 bits = 1 << 1;
+                for (i = method->registersSize - 1; i >= 0; i--) {
+                    u4 rval = *framePtr++;
+
+                    bits >>= 1;
+                    if (bits == 1) {
+                        /* set bit 9 so we can tell when we're empty */
+                        bits = *regVector++ | 0x0100;
+                        LOGVV("loaded bits: 0x%02x\n", bits & 0xff);
+                    }
+
+                    if (rval != 0 && (bits & 0x01) != 0) {
+                        /*
+                         * Non-null, register marked as live reference.  This
+                         * should always be a valid object.
+                         */
+#if WITH_EXTRA_GC_CHECKS > 0
+                        if ((rval & 0x3) != 0 ||
+                            !dvmIsValidObject((Object*) rval))
+                        {
+                            /* this is very bad */
+                            LOGE("PGC: invalid ref in reg %d: 0x%08x\n",
+                                method->registersSize-1 - i, rval);
+                        } else
+#endif
+                        {
+                            dvmMarkObjectNonNull((Object *)rval);
+                        }
+                    } else {
+                        /*
+                         * Null or non-reference, do nothing at all.
+                         */
+#if WITH_EXTRA_GC_CHECKS > 1
+                        if (dvmIsValidObject((Object*) rval)) {
+                            /* this is normal, but we feel chatty */
+                            LOGD("PGC: ignoring valid ref in reg %d: 0x%08x\n",
+                                method->registersSize-1 - i, rval);
+                        }
+#endif
+                    }
+                }
+                dvmReleaseRegisterMapLine(pMap, regVector);
             }
         }
-        /* else this is a break frame; nothing to mark.
+        /* else this is a break frame and there is nothing to mark, or
+         * this is a native method and the registers are just the "ins",
+         * copied from various registers in the caller's set.
          */
 
+#if WITH_EXTRA_GC_CHECKS > 1
+        first = false;
+#endif
+
         /* Don't fall into an infinite loop if things get corrupted.
          */
         assert((uintptr_t)saveArea->prevFrame > (uintptr_t)framePtr ||
index b64f9b7..f0b5541 100644 (file)
@@ -203,6 +203,11 @@ typedef struct Thread {
 #ifdef WITH_JNI_STACK_CHECK
     u4          stackCrc;
 #endif
+
+#if WITH_EXTRA_GC_CHECKS > 1
+    /* PC, saved on every instruction; redundant with StackSaveArea */
+    const u2*   currentPc2;
+#endif
 } Thread;
 
 /* start point for an internal thread; mimics pthread args */
@@ -277,12 +282,11 @@ void dvmWaitForSuspend(Thread* thread);
 bool dvmCheckSuspendPending(Thread* self);
 
 /*
- * Fast test for use in the interpreter.  If our suspend count is nonzero,
- * do a more rigorous evaluation.
+ * Fast test for use in the interpreter.  Returns "true" if our suspend
+ * count is nonzero.
  */
-INLINE void dvmCheckSuspendQuick(Thread* self) {
-    if (self->suspendCount != 0)
-        dvmCheckSuspendPending(self);
+INLINE bool dvmCheckSuspendQuick(Thread* self) {
+    return (self->suspendCount != 0);
 }
 
 /*
index 0489db7..8bf4520 100644 (file)
@@ -133,7 +133,7 @@ INLINE int dvmValidateObject(Object* obj)
     }
 #ifdef WITH_EXTRA_OBJECT_VALIDATION
     if (!dvmIsValidObject(obj)) {
-        //abort();
+        //dvmAbort();
         dvmThrowException("Ljava/lang/InternalError;",
             "VM detected invalid object ptr");
         return false;
@@ -142,7 +142,7 @@ INLINE int dvmValidateObject(Object* obj)
 #ifndef NDEBUG
     /* check for heap corruption */
     if (obj->clazz == NULL || ((u4) obj->clazz) <= 65536) {
-        abort();
+        dvmAbort();
         dvmThrowException("Ljava/lang/InternalError;",
             "VM detected invalid object class ptr");
         return false;
index 9ddc8be..6f3c7c1 100644 (file)
@@ -174,6 +174,7 @@ bool dvmLockHeap()
         if (self != NULL) {
             oldStatus = dvmChangeStatus(self, THREAD_VMWAIT);
         } else {
+            LOGI("ODD: waiting on heap lock, no self\n");
             oldStatus = -1; // shut up gcc
         }
 
@@ -831,6 +832,8 @@ void dvmCollectGarbageInternal(bool collectSoftReferences)
     if (gcHeap->hprofDumpOnGc) {
         char nameBuf[128];
 
+        gcHeap->hprofResult = -1;
+
         if (gcHeap->hprofFileName == NULL) {
             /* no filename was provided; invent one */
             sprintf(nameBuf, "/data/misc/heap-dump-tm%d-pid%d.hprof",
@@ -860,7 +863,10 @@ void dvmCollectGarbageInternal(bool collectSoftReferences)
 
     /* Set up the marking context.
      */
-    dvmHeapBeginMarkStep();
+    if (!dvmHeapBeginMarkStep()) {
+        LOGE_HEAP("dvmHeapBeginMarkStep failed; aborting\n");
+        dvmAbort();
+    }
 
     /* Mark the set of objects that are strongly reachable from the roots.
      */
@@ -982,7 +988,8 @@ void dvmCollectGarbageInternal(bool collectSoftReferences)
     if (gcHeap->hprofContext != NULL) {
         hprofFinishHeapDump(gcHeap->hprofContext);
 //TODO: write a HEAP_SUMMARY record
-        hprofShutdown(gcHeap->hprofContext);
+        if (hprofShutdown(gcHeap->hprofContext))
+            gcHeap->hprofResult = 0;    /* indicate success */
         gcHeap->hprofContext = NULL;
     }
 #endif
@@ -1046,16 +1053,23 @@ void dvmCollectGarbageInternal(bool collectSoftReferences)
  * Perform garbage collection, writing heap information to the specified file.
  *
  * If "fileName" is NULL, a suitable name will be generated automatically.
+ *
+ * Returns 0 on success, or an error code on failure.
  */
-void hprofDumpHeap(const char* fileName)
+int hprofDumpHeap(const char* fileName)
 {
+    int result;
+
     dvmLockMutex(&gDvm.gcHeapLock);
 
     gDvm.gcHeap->hprofDumpOnGc = true;
     gDvm.gcHeap->hprofFileName = fileName;
     dvmCollectGarbageInternal(false);
+    result = gDvm.gcHeap->hprofResult;
 
     dvmUnlockMutex(&gDvm.gcHeapLock);
+
+    return result;
 }
 
 void dvmHeapSetHprofGcScanState(hprof_heap_tag_t state, u4 threadSerialNumber)
index 7851983..fafb87a 100644 (file)
@@ -189,6 +189,7 @@ struct GcHeap {
     bool            hprofDumpOnGc;
     const char*     hprofFileName;
     hprof_context_t *hprofContext;
+    int             hprofResult;
 #endif
 };
 
index 0244cca..b4a2d0e 100644 (file)
@@ -111,7 +111,7 @@ void dvmHeapWorkerShutdown(void)
 }
 
 /* Make sure that the HeapWorker thread hasn't spent an inordinate
- * amount of time inside interpreted a finalizer.
+ * amount of time inside a finalizer.
  *
  * Aborts the VM if the thread appears to be wedged.
  *
@@ -132,12 +132,16 @@ void dvmAssertHeapWorkerThreadRunning()
         u8 nowCpu = dvmGetOtherThreadCpuTimeUsec(gDvm.heapWorkerHandle);
         u8 deltaCpu = nowCpu - heapWorkerInterpCpuStartTime;
 
-        if (delta > HEAP_WORKER_WATCHDOG_TIMEOUT && gDvm.debuggerActive) {
+        if (delta > HEAP_WORKER_WATCHDOG_TIMEOUT &&
+            (gDvm.debuggerActive || gDvm.nativeDebuggerActive))
+        {
             /*
              * Debugger suspension can block the thread indefinitely.  For
              * best results we should reset this explicitly whenever the
-             * HeapWorker thread is resumed.  Ignoring the yelp isn't
-             * quite right but will do for a quick fix.
+             * HeapWorker thread is resumed.  Unfortunately this is also
+             * affected by native debuggers, and we have no visibility
+             * into how they're manipulating us.  So, we ignore the
+             * watchdog and just reset the timer.
              */
             LOGI("Debugger is attached -- suppressing HeapWorker watchdog\n");
             heapWorkerInterpStartTime = now;        /* reset timer */
index a0601d7..0905bce 100644 (file)
@@ -22,6 +22,7 @@
 #include <limits.h>     // for ULONG_MAX
 #include <sys/mman.h>   // for madvise(), mmap()
 #include <cutils/ashmem.h>
+#include <errno.h>
 
 #define GC_DEBUG_PARANOID   2
 #define GC_DEBUG_BASIC      1
@@ -92,7 +93,7 @@ createMarkStack(GcMarkStack *stack)
 {
     const Object **limit;
     size_t size;
-    int fd;
+    int fd, err;
 
     /* Create a stack big enough for the worst possible case,
      * where the heap is perfectly full of the smallest object.
@@ -104,14 +105,17 @@ createMarkStack(GcMarkStack *stack)
     size = ALIGN_UP_TO_PAGE_SIZE(size);
     fd = ashmem_create_region("dalvik-heap-markstack", size);
     if (fd < 0) {
-        LOGE_GC("Could not create %d-byte ashmem mark stack\n", size);
+        LOGE_GC("Could not create %d-byte ashmem mark stack: %s\n",
+            size, strerror(errno));
         return false;
     }
     limit = (const Object **)mmap(NULL, size, PROT_READ | PROT_WRITE,
             MAP_PRIVATE, fd, 0);
+    err = errno;
     close(fd);
     if (limit == MAP_FAILED) {
-        LOGE_GC("Could not mmap %d-byte ashmem mark stack\n", size);
+        LOGE_GC("Could not mmap %d-byte ashmem mark stack: %s\n",
+            size, strerror(err));
         return false;
     }
 
index 65aa833..ed132e2 100644 (file)
@@ -72,9 +72,9 @@ int gDvm__gcSimpleData = 0;
 static inline bool doVerboseLogging(const Method* meth) {
     return false;       /* COMMENT OUT to enable verbose debugging */
 
-    const char* cd = "Lop_lshr;";
-    const char* mn = "test";
-    const char* sg = "(II)J";
+    const char* cd = "Landroid/net/http/Request;";
+    const char* mn = "readResponse";
+    const char* sg = "(Landroid/net/http/AndroidHttpClientConnection;)V";
     return (strcmp(meth->clazz->descriptor, cd) == 0 &&
             dvmCompareNameDescriptorAndMethod(mn, sg, meth) == 0);
 }
@@ -327,7 +327,7 @@ static bool checkFieldArrayStore1nr(RegType instrType, RegType targetType)
  */
 static RegType primitiveTypeToRegType(PrimitiveType primType)
 {
-    struct {
+    static const struct {
         RegType         regType;        /* type equivalent */
         PrimitiveType   primType;       /* verification */
     } convTab[] = {
@@ -5173,13 +5173,11 @@ sput_1nr_common:
             updateRegisters(meth, insnFlags, regTable, insnIdx+insnWidth,
                 workRegs);
         } else {
-            /* if not yet visited, or regs were updated, set "changed" */
-            if (!dvmInsnIsVisited(insnFlags, insnIdx+insnWidth) ||
-                compareRegisters(workRegs, entryRegs,
-                    insnRegCount + kExtraRegs) != 0)
-            {
-                dvmInsnSetChanged(insnFlags, insnIdx+insnWidth, true);
-            }
+            /*
+             * We didn't record register data for the next entry, so we have
+             * to assume that something has changed and re-evaluate it.
+             */
+            dvmInsnSetChanged(insnFlags, insnIdx+insnWidth, true);
         }
     }
 
@@ -5209,6 +5207,7 @@ sput_1nr_common:
         if (!checkMoveException(meth, insnIdx+branchTarget, "branch"))
             goto bail;
 
+        /* update branch target, set "changed" if appropriate */
         updateRegisters(meth, insnFlags, regTable, insnIdx+branchTarget,
             workRegs);
     }
index 0cd4638..55fe41c 100644 (file)
@@ -198,10 +198,10 @@ INLINE bool dvmInsnIsGcPoint(const InsnFlags* insnFlags, int addr) {
     return (insnFlags[addr] & kInsnFlagGcPoint) != 0;
 }
 INLINE void dvmInsnSetGcPoint(InsnFlags* insnFlags, int addr,
-    bool isBranch)
+    bool isGcPoint)
 {
-    assert(isBranch);
-    //if (isBranch)
+    assert(isGcPoint);
+    //if (isGcPoint)
         insnFlags[addr] |= kInsnFlagGcPoint;
     //else
     //    insnFlags[addr] &= ~kInsnFlagGcPoint;
index d086b99..70b3278 100644 (file)
@@ -25,6 +25,7 @@
 #include "Dalvik.h"
 #include "libdex/InstrUtils.h"
 #include "libdex/OptInvocation.h"
+#include "analysis/RegisterMap.h"
 
 #include <zlib.h>
 
@@ -50,7 +51,7 @@ typedef struct InlineSub {
 /* fwd */
 static int writeDependencies(int fd, u4 modWhen, u4 crc);
 static bool writeAuxData(int fd, const DexClassLookup* pClassLookup,\
-    const IndexMapSet* pIndexMapSet);
+    const IndexMapSet* pIndexMapSet, const RegisterMapBuilder* pRegMapBuilder);
 static void logFailedWrite(size_t expected, ssize_t actual, const char* msg,
     int err);
 
@@ -506,6 +507,7 @@ bool dvmContinueOptimization(int fd, off_t dexOffset, long dexLength,
 {
     DexClassLookup* pClassLookup = NULL;
     IndexMapSet* pIndexMapSet = NULL;
+    RegisterMapBuilder* pRegMapBuilder = NULL;
     bool doVerify, doOpt;
     u4 headerFlags = 0;
 
@@ -566,6 +568,13 @@ bool dvmContinueOptimization(int fd, off_t dexOffset, long dexLength,
          * Rewrite the file.  Byte reordering, structure realigning,
          * class verification, and bytecode optimization are all performed
          * here.
+         *
+         * In theory the file could change size and bits could shift around.
+         * In practice this would be annoying to deal with, so the file
+         * layout is designed so that it can always be rewritten in place.
+         *
+         * This sets "headerFlags" and creates the class lookup table as
+         * part of doing the processing.
          */
         success = rewriteDex(((u1*) mapAddr) + dexOffset, dexLength,
                     doVerify, doOpt, &headerFlags, &pClassLookup);
@@ -576,6 +585,7 @@ bool dvmContinueOptimization(int fd, off_t dexOffset, long dexLength,
 
             if (dvmDexFileOpenPartial(dexAddr, dexLength, &pDvmDex) != 0) {
                 LOGE("Unable to create DexFile\n");
+                success = false;
             } else {
                 /*
                  * If configured to do so, scan the instructions, looking
@@ -586,6 +596,18 @@ bool dvmContinueOptimization(int fd, off_t dexOffset, long dexLength,
                  */
                 pIndexMapSet = dvmRewriteConstants(pDvmDex);
 
+                /*
+                 * If configured to do so, generate a full set of register
+                 * maps for all verified classes.
+                 */
+                if (gDvm.generateRegisterMaps) {
+                    pRegMapBuilder = dvmGenerateRegisterMaps(pDvmDex);
+                    if (pRegMapBuilder == NULL) {
+                        LOGE("Failed generating register maps\n");
+                        success = false;
+                    }
+                }
+
                 updateChecksum(dexAddr, dexLength,
                     (DexHeader*) pDvmDex->pHeader);
 
@@ -640,8 +662,7 @@ bool dvmContinueOptimization(int fd, off_t dexOffset, long dexLength,
         goto bail;
     }
 
-
-    /* compute deps length, and adjust aux start for 64-bit alignment */
+    /* compute deps length, then adjust aux start for 64-bit alignment */
     auxOffset = lseek(fd, 0, SEEK_END);
     depsLength = auxOffset - depsOffset;
 
@@ -656,7 +677,7 @@ bool dvmContinueOptimization(int fd, off_t dexOffset, long dexLength,
     /*
      * Append any auxillary pre-computed data structures.
      */
-    if (!writeAuxData(fd, pClassLookup, pIndexMapSet)) {
+    if (!writeAuxData(fd, pClassLookup, pIndexMapSet, pRegMapBuilder)) {
         LOGW("Failed writing aux data\n");
         goto bail;
     }
@@ -692,8 +713,11 @@ bool dvmContinueOptimization(int fd, off_t dexOffset, long dexLength,
     LOGV("Successfully wrote DEX header\n");
     result = true;
 
+    //dvmRegisterMapDumpStats();
+
 bail:
     dvmFreeIndexMapSet(pIndexMapSet);
+    dvmFreeRegisterMapBuilder(pRegMapBuilder);
     free(pClassLookup);
     return result;
 }
@@ -1085,19 +1109,28 @@ static bool writeChunk(int fd, u4 type, const void* data, size_t size)
  * so it can be used directly when the file is mapped for reading.
  */
 static bool writeAuxData(int fd, const DexClassLookup* pClassLookup,
-    const IndexMapSet* pIndexMapSet)
+    const IndexMapSet* pIndexMapSet, const RegisterMapBuilder* pRegMapBuilder)
 {
     /* pre-computed class lookup hash table */
-    if (!writeChunk(fd, (u4) kDexChunkClassLookup, pClassLookup,
-            pClassLookup->size))
+    if (!writeChunk(fd, (u4) kDexChunkClassLookup,
+            pClassLookup, pClassLookup->size))
     {
         return false;
     }
 
     /* remapped constants (optional) */
     if (pIndexMapSet != NULL) {
-        if (!writeChunk(fd, pIndexMapSet->chunkType, pIndexMapSet->chunkData,
-                pIndexMapSet->chunkDataLen))
+        if (!writeChunk(fd, pIndexMapSet->chunkType,
+                pIndexMapSet->chunkData, pIndexMapSet->chunkDataLen))
+        {
+            return false;
+        }
+    }
+
+    /* register maps (optional) */
+    if (pRegMapBuilder != NULL) {
+        if (!writeChunk(fd, (u4) kDexChunkRegisterMaps,
+                pRegMapBuilder->data, pRegMapBuilder->size))
         {
             return false;
         }
index 01aa828..4b6ab6b 100644 (file)
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 /*
  * DEX optimization declarations.
  */
index 354d68f..84f34c8 100644 (file)
@@ -533,15 +533,36 @@ static bool verifyInstructions(const Method* meth, InsnFlags* insnFlags,
     dvmInsnSetBranchTarget(insnFlags, 0, true);
 
     for (i = 0; i < insnCount; /**/) {
-        static int gcMask = kInstrCanBranch | kInstrCanSwitch |
+        /*
+         * These types of instructions can be GC points.  To support precise
+         * GC, all such instructions must export the PC in the interpreter,
+         * or the GC won't be able to identify the current PC for the thread.
+         */
+        static const int gcMask = kInstrCanBranch | kInstrCanSwitch |
             kInstrCanThrow | kInstrCanReturn;
+
         int width = dvmInsnGetWidth(insnFlags, i);
         OpCode opcode = *insns & 0xff;
         InstructionFlags opFlags = dexGetInstrFlags(gDvm.instrFlags, opcode);
         int offset, absOffset;
 
-        if ((opFlags & gcMask) != 0)
-            dvmInsnSetGcPoint(insnFlags, i, true);
+        if ((opFlags & gcMask) != 0) {
+            /*
+             * This instruction is probably a GC point.  Branch instructions
+             * only qualify if they go backward, so we need to check the
+             * offset.
+             */
+            int offset = -1;
+            bool unused;
+            if (dvmGetBranchTarget(meth, insnFlags, i, &offset, &unused)) {
+                if (offset < 0) {
+                    dvmInsnSetGcPoint(insnFlags, i, true);
+                }
+            } else {
+                /* not a branch target */
+                dvmInsnSetGcPoint(insnFlags, i, true);
+            }
+        }
 
         switch (opcode) {
         case OP_NOP:
index b02874a..f783f88 100644 (file)
@@ -14,8 +14,6 @@
  * limitations under the License.
  */
 
-// ** UNDER CONSTRUCTION **
-
 /*
  * This code generate "register maps" for Dalvik bytecode.  In a stack-based
  * VM we might call these "stack maps".  They are used to increase the
@@ -32,7 +30,7 @@
 
 
 /*
-Notes on just-in-time RegisterMap generation
+Notes on just-in-time RegisterMap generation [not supported]
 
 Generating RegisterMap tables as part of verification is convenient because
 we generate most of what we need to know as part of doing the verify.
@@ -85,6 +83,127 @@ an effort should be made to minimize memory use.
 // fwd
 static void outputTypeVector(const RegType* regs, int insnRegCount, u1* data);
 static bool verifyMap(VerifierData* vdata, const RegisterMap* pMap);
+static void computeMapStats(RegisterMap* pMap, const Method* method);
+
+
+//#define REGISTER_MAP_STATS
+#ifdef REGISTER_MAP_STATS
+/*
+ * Generate some statistics on the register maps we generate.
+ */
+#define kMaxGcPointGap      50
+#define kUpdatePosnMinRegs  24
+#define kNumUpdatePosns     8
+#define kMaxDiffBits        20
+typedef struct MapStats {
+    /*
+     * Buckets measuring the distance between GC points.  This tells us how
+     * many bits we need to encode the advancing program counter.  We ignore
+     * some of the "long tail" entries.
+     */
+    int gcPointGap[kMaxGcPointGap];
+
+    /*
+     * Number of gaps.  Equal to (number of gcPoints - number of methods),
+     * since the computation isn't including the initial gap.
+     */
+    int gcGapCount;
+
+    /*
+     * Number of gaps.
+     */
+    int totalGcPointCount;
+
+    /*
+     * For larger methods (>= 24 registers), measure in which octant register
+     * updates occur.  This should help us understand whether register
+     * changes tend to cluster in the low regs even for large methods.
+     */
+    int updatePosn[kNumUpdatePosns];
+
+    /*
+     * For all methods, count up the number of changes to registers < 16
+     * and >= 16.
+     */
+    int updateLT16;
+    int updateGE16;
+
+    /*
+     * Histogram of the number of bits that differ between adjacent entries.
+     */
+    int numDiffBits[kMaxDiffBits];
+} MapStats;
+#endif
+
+/*
+ * Prepare some things.
+ */
+bool dvmRegisterMapStartup(void)
+{
+#ifdef REGISTER_MAP_STATS
+    MapStats* pStats = calloc(1, sizeof(MapStats));
+    gDvm.registerMapStats = pStats;
+#endif
+    return true;
+}
+
+/*
+ * Clean up.
+ */
+void dvmRegisterMapShutdown(void)
+{
+#ifdef REGISTER_MAP_STATS
+    free(gDvm.registerMapStats);
+#endif
+}
+
+/*
+ * Write stats to log file.
+ */
+void dvmRegisterMapDumpStats(void)
+{
+#ifdef REGISTER_MAP_STATS
+    MapStats* pStats = (MapStats*) gDvm.registerMapStats;
+    int i, end;
+
+    for (end = kMaxGcPointGap-1; end >= 0; end--) {
+        if (pStats->gcPointGap[end] != 0)
+            break;
+    }
+
+    LOGI("Register Map gcPointGap stats (diff count=%d, total=%d):\n",
+        pStats->gcGapCount, pStats->totalGcPointCount);
+    assert(pStats->gcPointGap[0] == 0);
+    for (i = 1; i <= end; i++) {
+        LOGI(" %2d %d\n", i, pStats->gcPointGap[i]);
+    }
+
+
+    for (end = kMaxDiffBits-1; end >= 0; end--) {
+        if (pStats->numDiffBits[end] != 0)
+            break;
+    }
+
+    LOGI("Register Map bit difference stats:\n");
+    for (i = 0; i <= end; i++) {
+        LOGI(" %2d %d\n", i, pStats->numDiffBits[i]);
+    }
+
+
+    LOGI("Register Map update position stats (lt16=%d ge16=%d):\n",
+        pStats->updateLT16, pStats->updateGE16);
+    for (i = 0; i < kNumUpdatePosns; i++) {
+        LOGI(" %2d %d\n", i, pStats->updatePosn[i]);
+    }
+#endif
+}
+
+
+/*
+ * ===========================================================================
+ *      Map generation
+ * ===========================================================================
+ */
 
 /*
  * Generate the register map for a method that has just been verified
@@ -105,12 +224,18 @@ RegisterMap* dvmGenerateRegisterMapV(VerifierData* vdata)
     int i, bytesForAddr, gcPointCount;
     int bufSize;
 
+    if (vdata->method->registersSize >= 2048) {
+        LOGE("ERROR: register map can't handle %d registers\n",
+            vdata->method->registersSize);
+        goto bail;
+    }
     regWidth = (vdata->method->registersSize + 7) / 8;
+
     if (vdata->insnsSize < 256) {
-        format = kFormatCompact8;
+        format = kRegMapFormatCompact8;
         bytesForAddr = 1;
     } else {
-        format = kFormatCompact16;
+        format = kRegMapFormatCompact16;
         bytesForAddr = 2;
     }
 
@@ -138,14 +263,14 @@ RegisterMap* dvmGenerateRegisterMapV(VerifierData* vdata)
     bufSize = offsetof(RegisterMap, data);
     bufSize += gcPointCount * (bytesForAddr + regWidth);
 
-    LOGD("+++ grm: %s.%s (adr=%d gpc=%d rwd=%d bsz=%d)\n",
+    LOGV("+++ grm: %s.%s (adr=%d gpc=%d rwd=%d bsz=%d)\n",
         vdata->method->clazz->descriptor, vdata->method->name,
         bytesForAddr, gcPointCount, regWidth, bufSize);
 
     pMap = (RegisterMap*) malloc(bufSize);
-    pMap->format = format;
+    pMap->format = format | kRegMapFormatOnHeap;
     pMap->regWidth = regWidth;
-    pMap->numEntries = gcPointCount;
+    dvmRegisterMapSetNumEntries(pMap, gcPointCount);
 
     /*
      * Populate it.
@@ -154,9 +279,9 @@ RegisterMap* dvmGenerateRegisterMapV(VerifierData* vdata)
     for (i = 0; i < vdata->insnsSize; i++) {
         if (dvmInsnIsGcPoint(vdata->insnFlags, i)) {
             assert(vdata->addrRegs[i] != NULL);
-            if (format == kFormatCompact8) {
+            if (format == kRegMapFormatCompact8) {
                 *mapData++ = i;
-            } else /*kFormatCompact16*/ {
+            } else /*kRegMapFormatCompact16*/ {
                 *mapData++ = i & 0xff;
                 *mapData++ = i >> 8;
             }
@@ -165,13 +290,16 @@ RegisterMap* dvmGenerateRegisterMapV(VerifierData* vdata)
         }
     }
 
-    LOGI("mapData=%p pMap=%p bufSize=%d\n", mapData, pMap, bufSize);
+    LOGV("mapData=%p pMap=%p bufSize=%d\n", mapData, pMap, bufSize);
     assert(mapData - (const u1*) pMap == bufSize);
 
 #if 1
     if (!verifyMap(vdata, pMap))
         goto bail;
 #endif
+#ifdef REGISTER_MAP_STATS
+    computeMapStats(pMap, vdata->method);
+#endif
 
     pResult = pMap;
 
@@ -187,6 +315,7 @@ void dvmFreeRegisterMap(RegisterMap* pMap)
     if (pMap == NULL)
         return;
 
+    assert(dvmGetRegisterMapOnHeap(pMap));
     free(pMap);
 }
 
@@ -235,36 +364,64 @@ static void outputTypeVector(const RegType* regs, int insnRegCount, u1* data)
  * Double-check the map.
  *
  * We run through all of the data in the map, and compare it to the original.
+ * Only works on uncompressed data.
  */
 static bool verifyMap(VerifierData* vdata, const RegisterMap* pMap)
 {
-    const u1* data = pMap->data;
+    const u1* rawMap = pMap->data;
+    const u1 format = dvmGetRegisterMapFormat(pMap);
+    const u2 numEntries = dvmRegisterMapGetNumEntries(pMap);
     int ent;
+    bool dumpMap = false;
+
+    if (false) {
+        const char* cd = "Landroid/net/http/Request;";
+        const char* mn = "readResponse";
+        const char* sg = "(Landroid/net/http/AndroidHttpClientConnection;)V";
+        if (strcmp(vdata->method->clazz->descriptor, cd) == 0 &&
+            strcmp(vdata->method->name, mn) == 0)
+        {
+            char* desc;
+            desc = dexProtoCopyMethodDescriptor(&vdata->method->prototype);
+            LOGI("Map for %s.%s %s\n", vdata->method->clazz->descriptor,
+                vdata->method->name, desc);
+            free(desc);
+
+            dumpMap = true;
+        }
+    }
+
+    if ((vdata->method->registersSize + 7) / 8 != pMap->regWidth) {
+        LOGE("GLITCH: registersSize=%d, regWidth=%d\n",
+            vdata->method->registersSize, pMap->regWidth);
+        return false;
+    }
 
-    for (ent = 0; ent < pMap->numEntries; ent++) {
+    for (ent = 0; ent < numEntries; ent++) {
         int addr;
 
-        switch (pMap->format) {
-        case kFormatCompact8:
-            addr = *data++;
+        switch (format) {
+        case kRegMapFormatCompact8:
+            addr = *rawMap++;
             break;
-        case kFormatCompact16:
-            addr = *data++;
-            addr |= (*data++) << 8;
+        case kRegMapFormatCompact16:
+            addr = *rawMap++;
+            addr |= (*rawMap++) << 8;
             break;
         default:
             /* shouldn't happen */
-            LOGE("GLITCH: bad format (%d)", pMap->format);
+            LOGE("GLITCH: bad format (%d)", format);
             dvmAbort();
         }
 
+        const u1* dataStart = rawMap;
         const RegType* regs = vdata->addrRegs[addr];
         if (regs == NULL) {
             LOGE("GLITCH: addr %d has no data\n", addr);
             return false;
         }
 
-        u1 val;
+        u1 val = 0;
         int i;
 
         for (i = 0; i < vdata->method->registersSize; i++) {
@@ -273,7 +430,7 @@ static bool verifyMap(VerifierData* vdata, const RegisterMap* pMap)
             val >>= 1;
             if ((i & 0x07) == 0) {
                 /* load next byte of data */
-                val = *data++;
+                val = *rawMap++;
             }
 
             bitIsRef = val & 0x01;
@@ -288,9 +445,12 @@ static bool verifyMap(VerifierData* vdata, const RegisterMap* pMap)
             }
         }
 
+        /* rawMap now points to the address field of the next entry */
+
         /* print the map as a binary string */
-        if (false) {
+        if (dumpMap) {
             char outBuf[vdata->method->registersSize +1];
+            char hexBuf[((vdata->method->registersSize + 7) / 8) * 3 +1];
             for (i = 0; i < vdata->method->registersSize; i++) {
                 if (isReferenceType(regs[i])) {
                     outBuf[i] = '1';
@@ -299,7 +459,15 @@ static bool verifyMap(VerifierData* vdata, const RegisterMap* pMap)
                 }
             }
             outBuf[i] = '\0';
-            LOGD("  %04d %s\n", addr, outBuf);
+
+            char* cp = hexBuf;
+            const u1* altData = dataStart;
+            for (i = 0; i < (vdata->method->registersSize + 7) / 8; i++) {
+                sprintf(cp, " %02x", *altData++);
+                cp += 3;
+            }
+            hexBuf[i * 3] = '\0';
+            LOGD("  %04x %s %s\n", addr, outBuf, hexBuf);
         }
     }
 
@@ -309,6 +477,655 @@ static bool verifyMap(VerifierData* vdata, const RegisterMap* pMap)
 
 /*
  * ===========================================================================
+ *      DEX generation & parsing
+ * ===========================================================================
+ */
+
+/*
+ * Advance "ptr" to ensure 32-bit alignment.
+ */
+static inline u1* align32(u1* ptr)
+{
+    return (u1*) (((int) ptr + 3) & ~0x03);
+}
+
+/*
+ * Compute the size, in bytes, of a register map.
+ */
+static size_t computeRegisterMapSize(const RegisterMap* pMap)
+{
+    static const int kHeaderSize = offsetof(RegisterMap, data);
+    u1 format = dvmGetRegisterMapFormat(pMap);
+    u2 numEntries = dvmRegisterMapGetNumEntries(pMap);
+
+    assert(pMap != NULL);
+
+    switch (format) {
+    case kRegMapFormatNone:
+        return 1;
+    case kRegMapFormatCompact8:
+        return kHeaderSize + (1 + pMap->regWidth) * numEntries;
+    case kRegMapFormatCompact16:
+        return kHeaderSize + (2 + pMap->regWidth) * numEntries;
+    default:
+        LOGE("Bad register map format %d\n", format);
+        dvmAbort();
+        return 0;
+    }
+}
+
+/*
+ * Output the map for a single method, if it has one.
+ *
+ * Abstract and native methods have no map.  All others are expected to
+ * have one, since we know the class verified successfully.
+ *
+ * This strips the "allocated on heap" flag from the format byte, so that
+ * direct-mapped maps are correctly identified as such.
+ */
+static bool writeMapForMethod(const Method* meth, u1** pPtr)
+{
+    if (meth->registerMap == NULL) {
+        if (!dvmIsAbstractMethod(meth) && !dvmIsNativeMethod(meth)) {
+            LOGW("Warning: no map available for %s.%s\n",
+                meth->clazz->descriptor, meth->name);
+            /* weird, but keep going */
+        }
+        *(*pPtr)++ = kRegMapFormatNone;
+        return true;
+    }
+
+    /* serialize map into the buffer */
+    size_t mapSize = computeRegisterMapSize(meth->registerMap);
+    memcpy(*pPtr, meth->registerMap, mapSize);
+
+    /* strip the "on heap" flag out of the format byte, which is always first */
+    assert(**pPtr == meth->registerMap->format);
+    **pPtr &= ~(kRegMapFormatOnHeap);
+
+    *pPtr += mapSize;
+
+    return true;
+}
+
+/*
+ * Write maps for all methods in the specified class to the buffer, which
+ * can hold at most "length" bytes.  "*pPtr" will be advanced past the end
+ * of the data we write.
+ */
+static bool writeMapsAllMethods(DvmDex* pDvmDex, const ClassObject* clazz,
+    u1** pPtr, size_t length)
+{
+    RegisterMapMethodPool* pMethodPool;
+    u1* ptr = *pPtr;
+    int i, methodCount;
+
+    /* artificial limit */
+    if (clazz->virtualMethodCount + clazz->directMethodCount >= 65536) {
+        LOGE("Too many methods in %s\n", clazz->descriptor);
+        return false;
+    }
+
+    pMethodPool = (RegisterMapMethodPool*) ptr;
+    ptr += offsetof(RegisterMapMethodPool, methodData);
+    methodCount = 0;
+
+    /*
+     * Run through all methods, direct then virtual.  The class loader will
+     * traverse them in the same order.  (We could split them into two
+     * distinct pieces, but there doesn't appear to be any value in doing
+     * so other than that it makes class loading slightly less fragile.)
+     *
+     * The class loader won't know about miranda methods at the point
+     * where it parses this, so we omit those.
+     *
+     * TODO: consider omitting all native/abstract definitions.  Should be
+     * safe, though we lose the ability to sanity-check against the
+     * method counts in the DEX file.
+     */
+    for (i = 0; i < clazz->directMethodCount; i++) {
+        const Method* meth = &clazz->directMethods[i];
+        if (dvmIsMirandaMethod(meth))
+            continue;
+        if (!writeMapForMethod(&clazz->directMethods[i], &ptr)) {
+            return false;
+        }
+        methodCount++;
+        //ptr = align32(ptr);
+    }
+
+    for (i = 0; i < clazz->virtualMethodCount; i++) {
+        const Method* meth = &clazz->virtualMethods[i];
+        if (dvmIsMirandaMethod(meth))
+            continue;
+        if (!writeMapForMethod(&clazz->virtualMethods[i], &ptr)) {
+            return false;
+        }
+        methodCount++;
+        //ptr = align32(ptr);
+    }
+
+    pMethodPool->methodCount = methodCount;
+
+    *pPtr = ptr;
+    return true;
+}
+
+/*
+ * Write maps for all classes to the specified buffer, which can hold at
+ * most "length" bytes.
+ *
+ * Returns the actual length used, or 0 on failure.
+ */
+static size_t writeMapsAllClasses(DvmDex* pDvmDex, u1* basePtr, size_t length)
+{
+    DexFile* pDexFile = pDvmDex->pDexFile;
+    u4 count = pDexFile->pHeader->classDefsSize;
+    RegisterMapClassPool* pClassPool;
+    u4* offsetTable;
+    u1* ptr = basePtr;
+    u4 idx;
+
+    assert(gDvm.optimizing);
+
+    pClassPool = (RegisterMapClassPool*) ptr;
+    ptr += offsetof(RegisterMapClassPool, classDataOffset);
+    offsetTable = (u4*) ptr;
+    ptr += count * sizeof(u4);
+
+    pClassPool->numClasses = count;
+
+    /*
+     * We want an entry for every class, loaded or not.
+     */
+    for (idx = 0; idx < count; idx++) {
+        const DexClassDef* pClassDef;
+        const char* classDescriptor;
+        ClassObject* clazz;
+
+        pClassDef = dexGetClassDef(pDexFile, idx);
+        classDescriptor = dexStringByTypeIdx(pDexFile, pClassDef->classIdx);
+
+        /*
+         * All classes have been loaded into the bootstrap class loader.
+         * If we can find it, and it was successfully pre-verified, we
+         * run through its methods and add the register maps.
+         *
+         * If it wasn't pre-verified then we know it can't have any
+         * register maps.  Classes that can't be loaded or failed
+         * verification get an empty slot in the index.
+         */
+        clazz = NULL;
+        if ((pClassDef->accessFlags & CLASS_ISPREVERIFIED) != 0)
+            clazz = dvmLookupClass(classDescriptor, NULL, false);
+
+        if (clazz != NULL) {
+            offsetTable[idx] = ptr - basePtr;
+            LOGVV("%d -> offset %d (%p-%p)\n",
+                idx, offsetTable[idx], ptr, basePtr);
+
+            if (!writeMapsAllMethods(pDvmDex, clazz, &ptr,
+                    length - (ptr - basePtr)))
+            {
+                return 0;
+            }
+
+            ptr = align32(ptr);
+            LOGVV("Size %s (%d+%d methods): %d\n", clazz->descriptor,
+                clazz->directMethodCount, clazz->virtualMethodCount,
+                (ptr - basePtr) - offsetTable[idx]);
+        } else {
+            LOGV("%4d NOT mapadding '%s'\n", idx, classDescriptor);
+            assert(offsetTable[idx] == 0);
+        }
+    }
+
+    if (ptr - basePtr >= (int)length) {
+        /* a bit late */
+        LOGE("Buffer overrun\n");
+        dvmAbort();
+    }
+
+    return ptr - basePtr;
+}
+
+/*
+ * Generate a register map set for all verified classes in "pDvmDex".
+ */
+RegisterMapBuilder* dvmGenerateRegisterMaps(DvmDex* pDvmDex)
+{
+    RegisterMapBuilder* pBuilder;
+
+    pBuilder = (RegisterMapBuilder*) calloc(1, sizeof(RegisterMapBuilder));
+    if (pBuilder == NULL)
+        return NULL;
+
+    /*
+     * We have a couple of options here:
+     *  (1) Compute the size of the output, and malloc a buffer.
+     *  (2) Create a "large-enough" anonymous mmap region.
+     *
+     * The nice thing about option #2 is that we don't have to traverse
+     * all of the classes and methods twice.  The risk is that we might
+     * not make the region large enough.  Since the pages aren't mapped
+     * until used we can allocate a semi-absurd amount of memory without
+     * worrying about the effect on the rest of the system.
+     *
+     * The basic encoding on the largest jar file requires about 1MB of
+     * storage.  We map out 4MB here.  (TODO: guarantee that the last
+     * page of the mapping is marked invalid, so we reliably fail if
+     * we overrun.)
+     */
+    if (sysCreatePrivateMap(4 * 1024 * 1024, &pBuilder->memMap) != 0) {
+        free(pBuilder);
+        return NULL;
+    }
+
+    /*
+     * Create the maps.
+     */
+    size_t actual = writeMapsAllClasses(pDvmDex, (u1*)pBuilder->memMap.addr,
+                                        pBuilder->memMap.length);
+    if (actual == 0) {
+        dvmFreeRegisterMapBuilder(pBuilder);
+        return NULL;
+    }
+
+    LOGI("TOTAL size of register maps: %d\n", actual);
+
+    pBuilder->data = pBuilder->memMap.addr;
+    pBuilder->size = actual;
+    return pBuilder;
+}
+
+/*
+ * Free the builder.
+ */
+void dvmFreeRegisterMapBuilder(RegisterMapBuilder* pBuilder)
+{
+    if (pBuilder == NULL)
+        return;
+
+    sysReleaseShmem(&pBuilder->memMap);
+    free(pBuilder);
+}
+
+
+/*
+ * Find the data for the specified class.
+ *
+ * If there's no register map data, or none for this class, we return NULL.
+ */
+const void* dvmGetRegisterMapClassData(const DexFile* pDexFile, u4 classIdx,
+    u4* pNumMaps)
+{
+    const RegisterMapClassPool* pClassPool;
+    const RegisterMapMethodPool* pMethodPool;
+
+    pClassPool = (const RegisterMapClassPool*) pDexFile->pRegisterMapPool;
+    if (pClassPool == NULL)
+        return NULL;
+
+    if (classIdx >= pClassPool->numClasses) {
+        LOGE("bad class index (%d vs %d)\n", classIdx, pClassPool->numClasses);
+        dvmAbort();
+    }
+
+    u4 classOffset = pClassPool->classDataOffset[classIdx];
+    if (classOffset == 0) {
+        LOGV("+++ no map for classIdx=%d\n", classIdx);
+        return NULL;
+    }
+
+    pMethodPool =
+        (const RegisterMapMethodPool*) (((u1*) pClassPool) + classOffset);
+    if (pNumMaps != NULL)
+        *pNumMaps = pMethodPool->methodCount;
+    return pMethodPool->methodData;
+}
+
+/*
+ * This advances "*pPtr" and returns its original value.
+ */
+const RegisterMap* dvmGetNextRegisterMap(const void** pPtr)
+{
+    const RegisterMap* pMap = *pPtr;
+
+    *pPtr = /*align32*/(((u1*) pMap) + computeRegisterMapSize(pMap));
+    LOGVV("getNext: %p -> %p (f=0x%x w=%d e=%d)\n",
+        pMap, *pPtr, pMap->format, pMap->regWidth,
+        dvmRegisterMapGetNumEntries(pMap));
+    return pMap;
+}
+
+
+/*
+ * ===========================================================================
+ *      Utility functions
+ * ===========================================================================
+ */
+
+/*
+ * Return the data for the specified address, or NULL if not found.
+ *
+ * The result must be released with dvmReleaseRegisterMapLine().
+ */
+const u1* dvmGetRegisterMapLine(const RegisterMap* pMap, int addr)
+{
+    int addrWidth, lineWidth;
+    u1 format = dvmGetRegisterMapFormat(pMap);
+    u2 numEntries = dvmRegisterMapGetNumEntries(pMap);
+
+    assert(numEntries > 0);
+
+    switch (format) {
+    case kRegMapFormatNone:
+        return NULL;
+    case kRegMapFormatCompact8:
+        addrWidth = 1;
+        break;
+    case kRegMapFormatCompact16:
+        addrWidth = 2;
+        break;
+    default:
+        LOGE("Unknown format %d\n", format);
+        dvmAbort();
+        return NULL;
+    }
+
+    lineWidth = addrWidth + pMap->regWidth;
+
+    /*
+     * Find the appropriate entry.  Many maps are very small, some are very
+     * large.
+     */
+    static const int kSearchThreshold = 8;
+    const u1* data;
+    int lineAddr;
+
+    if (numEntries < kSearchThreshold) {
+        int i;
+        data = pMap->data;
+        for (i = numEntries; i > 0; i--) {
+            lineAddr = data[0];
+            if (addrWidth > 1)
+                lineAddr |= data[1] << 8;
+            if (lineAddr == addr)
+                return data + addrWidth;
+
+            data += lineWidth;
+        }
+    } else {
+        int hi, lo, mid;
+
+        lo = 0;
+        hi = numEntries -1;
+
+        while (hi >= lo) {
+            mid = (hi + lo) / 2;
+            data = pMap->data + lineWidth * mid;
+
+            lineAddr = data[0];
+            if (addrWidth > 1)
+                lineAddr |= data[1] << 8;
+
+            if (addr > lineAddr) {
+                lo = mid + 1;
+            } else if (addr < lineAddr) {
+                hi = mid - 1;
+            } else {
+                return data + addrWidth;
+            }
+        }
+    }
+
+    assert(data == pMap->data + lineWidth * numEntries);
+    return NULL;
+}
+
+
+/*
+ * ===========================================================================
+ *      Map compression
+ * ===========================================================================
+ */
+
+/*
+Notes on map compression
+
+The idea is to create a compressed form that will be uncompressed before
+use, with the output possibly saved in a cache.  This means we can use an
+approach that is unsuited for random access if we choose.
+
+In the event that a map simply does not work with our compression scheme,
+it's reasonable to store the map without compression.  In the future we
+may want to have more than one compression scheme, and try each in turn,
+retaining the best.  (We certainly want to keep the uncompressed form if it
+turns out to be smaller or even slightly larger than the compressed form.)
+
+Each entry consists of an address and a bit vector.  Adjacent entries are
+strongly correlated, suggesting differential encoding.
+
+
+Ideally we would avoid outputting adjacent entries with identical
+bit vectors.  However, the register values at a given address do not
+imply anything about the set of valid registers at subsequent addresses.
+We therefore cannot omit an entry.
+
+  If the thread stack has a PC at an address without a corresponding
+  entry in the register map, we must conservatively scan the registers in
+  that thread.  This can happen when single-stepping in the debugger,
+  because the debugger is allowed to invoke arbitrary methods when
+  a thread is stopped at a breakpoint.  If we can guarantee that a GC
+  thread scan will never happen while the debugger has that thread stopped,
+  then we can lift this restriction and simply omit entries that don't
+  change the bit vector from its previous state.
+
+Each entry advances the address value by at least 1 (measured in 16-bit
+"code units").  Looking at the bootclasspath entries, advancing by 2 units
+is most common.  Advances by 1 unit are far less common than advances by
+2 units, but more common than 5, and things fall off rapidly.  Gaps of
+up to 220 code units appear in some computationally intensive bits of code,
+but are exceedingly rare.
+
+If we sum up the number of transitions in a couple of ranges in framework.jar:
+  [1,4]: 188998 of 218922 gaps (86.3%)
+  [1,7]: 211647 of 218922 gaps (96.7%)
+Using a 3-bit delta, with one value reserved as an escape code, should
+yield good results for the address.
+
+These results would change dramatically if we reduced the set of GC
+points by e.g. removing instructions like integer divide that are only
+present because they can throw and cause an allocation.
+
+We also need to include an "initial gap", because the first few instructions
+in a method may not be GC points.
+
+
+By observation, many entries simply repeat the previous bit vector, or
+change only one or two bits.  (This is with type-precise information;
+the rate of change of bits will be different if live-precise information
+is factored in).
+
+Looking again at adjacent entries in framework.jar:
+  0 bits changed: 63.0%
+  1 bit changed: 32.2%
+After that it falls off rapidly, e.g. the number of entries with 2 bits
+changed is usually less than 1/10th of the number of entries with 1 bit
+changed.  A solution that allows us to encode 0- or 1- bit changes
+efficiently will do well.
+
+We still need to handle cases where a large number of bits change.  We
+probably want a way to drop in a full copy of the bit vector when it's
+smaller than the representation of multiple bit changes.
+
+
+The bit-change information can be encoded as an index that tells the
+decoder to toggle the state.  We want to encode the index in as few bits
+as possible, but we need to allow for fairly wide vectors (e.g. we have a
+method with 175 registers).  We can deal with this in a couple of ways:
+(1) use an encoding that assumes few registers and has an escape code
+for larger numbers of registers; or (2) use different encodings based
+on how many total registers the method has.  The choice depends to some
+extent on whether methods with large numbers of registers tend to modify
+the first 16 regs more often than the others.
+
+The last N registers hold method arguments.  If the bytecode is expected
+to be examined in a debugger, "dx" ensures that the contents of these
+registers won't change.  Depending upon the encoding format, we may be
+able to take advantage of this.  We still have to encode the initial
+state, but we know we'll never have to output a bit change for the last
+N registers.
+
+Considering only methods with 16 or more registers, the "target octant"
+for register changes looks like this:
+  [ 43.1%, 16.4%, 6.5%, 6.2%, 7.4%, 8.8%, 9.7%, 1.8% ]
+As expected, there are fewer changes at the end of the list where the
+arguments are kept, and more changes at the start of the list because
+register values smaller than 16 can be used in compact Dalvik instructions
+and hence are favored for frequently-used values.  In general, the first
+octant is considerably more active than later entries, the last octant
+is much less active, and the rest are all about the same.
+
+Looking at all bit changes in all methods, 94% are to registers 0-15.  The
+encoding will benefit greatly by favoring the low-numbered registers.
+
+
+Some of the smaller methods have identical maps, and space could be
+saved by simply including a pointer to an earlier definition.  This would
+be best accomplished by specifying a "pointer" format value, followed by
+a 3-byte (or ULEB128) offset.  Implementing this would probably involve
+generating a hash value for each register map and maintaining a hash table.
+
+In some cases there are repeating patterns in the bit vector that aren't
+adjacent.  These could benefit from a dictionary encoding.  This doesn't
+really become useful until the methods reach a certain size though,
+and managing the dictionary may incur more overhead than we want.
+*/
+
+/*
+ * Compute some stats on the register map.
+ */
+static void computeMapStats(RegisterMap* pMap, const Method* method)
+{
+#ifdef REGISTER_MAP_STATS
+    MapStats* pStats = (MapStats*) gDvm.registerMapStats;
+    const u1 format = dvmGetRegisterMapFormat(pMap);
+    const u2 numEntries = dvmRegisterMapGetNumEntries(pMap);
+    const u1* rawMap = pMap->data;
+    const u1* prevData = NULL;
+    int ent, addr, prevAddr = -1;
+
+    for (ent = 0; ent < numEntries; ent++) {
+        switch (format) {
+        case kRegMapFormatCompact8:
+            addr = *rawMap++;
+            break;
+        case kRegMapFormatCompact16:
+            addr = *rawMap++;
+            addr |= (*rawMap++) << 8;
+            break;
+        default:
+            /* shouldn't happen */
+            LOGE("GLITCH: bad format (%d)", format);
+            dvmAbort();
+        }
+
+        const u1* dataStart = rawMap;
+
+        pStats->totalGcPointCount++;
+
+        /*
+         * Gather "gap size" stats, i.e. the difference in addresses between
+         * successive GC points.
+         */
+        if (prevData != NULL) {
+            assert(prevAddr >= 0);
+            int addrDiff = addr - prevAddr;
+
+            if (addrDiff < 0) {
+                LOGE("GLITCH: address went backward (0x%04x->0x%04x, %s.%s)\n",
+                    prevAddr, addr, method->clazz->descriptor, method->name);
+            } else if (addrDiff > kMaxGcPointGap) {
+                LOGI("ARGH: addrDiff is %d, max %d (0x%04x->0x%04x, %s.%s)\n",
+                    addrDiff, kMaxGcPointGap, prevAddr, addr,
+                    method->clazz->descriptor, method->name);
+                /* skip this one */
+            } else {
+                pStats->gcPointGap[addrDiff]++;
+            }
+            pStats->gcGapCount++;
+
+
+            /*
+             * Compare bit vectors in adjacent entries.  We want to count
+             * up the number of bits that differ (to see if we frequently
+             * change 0 or 1 bits) and get a sense for which part of the
+             * vector changes the most often (near the start, middle, end).
+             *
+             * We only do the vector position quantization if we have at
+             * least 16 registers in the method.
+             */
+            int numDiff = 0;
+            float div = (float) kNumUpdatePosns / method->registersSize;
+            int regByte;
+            for (regByte = 0; regByte < pMap->regWidth; regByte++) {
+                int prev, cur, bit;
+
+                prev = prevData[regByte];
+                cur = dataStart[regByte];
+
+                for (bit = 0; bit < 8; bit++) {
+                    if (((prev >> bit) & 1) != ((cur >> bit) & 1)) {
+                        numDiff++;
+
+                        int bitNum = regByte * 8 + bit;
+
+                        if (bitNum < 16)
+                            pStats->updateLT16++;
+                        else
+                            pStats->updateGE16++;
+
+                        if (method->registersSize < 16)
+                            continue;
+
+                        if (bitNum >= method->registersSize) {
+                            /* stuff off the end should be zero in both */
+                            LOGE("WEIRD: bit=%d (%d/%d), prev=%02x cur=%02x\n",
+                                bit, regByte, method->registersSize,
+                                prev, cur);
+                            assert(false);
+                        }
+                        int idx = (int) (bitNum * div);
+                        if (!(idx >= 0 && idx < kNumUpdatePosns)) {
+                            LOGE("FAIL: bitNum=%d (of %d) div=%.3f idx=%d\n",
+                                bitNum, method->registersSize, div, idx);
+                            assert(false);
+                        }
+                        pStats->updatePosn[idx]++;
+                    }
+                }
+            }
+
+            if (numDiff > kMaxDiffBits) {
+                LOGW("ARGH: numDiff is %d, max %d\n", numDiff, kMaxDiffBits);
+            } else {
+                pStats->numDiffBits[numDiff]++;
+            }
+        }
+
+        /* advance to start of next line */
+        rawMap += pMap->regWidth;
+
+        prevAddr = addr;
+        prevData = dataStart;
+    }
+#endif
+}
+
+
+/*
+ * ===========================================================================
  *      Just-in-time generation
  * ===========================================================================
  */
index 2a890e7..1009def 100644 (file)
  * limitations under the License.
  */
 
-// ** UNDER CONSTRUCTION **
-
 /*
  * Declaration of register map data structure and related functions.
+ *
+ * These structures should be treated as opaque through most of the VM.
  */
 #ifndef _DALVIK_REGISTERMAP
 #define _DALVIK_REGISTERMAP
 
+#include "analysis/VerifySubs.h"
+#include "analysis/CodeVerify.h"
+
 /*
  * Format enumeration for RegisterMap data area.
  */
 typedef enum RegisterMapFormat {
-    kFormatUnknown = 0,
-    kFormatCompact8,        /* compact layout, 8-bit addresses */
-    kFormatCompact16,       /* compact layout, 16-bit addresses */
+    kRegMapFormatUnknown = 0,
+    kRegMapFormatNone,          /* indicates no map data follows */
+    kRegMapFormatCompact8,      /* compact layout, 8-bit addresses */
+    kRegMapFormatCompact16,     /* compact layout, 16-bit addresses */
     // TODO: compressed stream
+
+    kRegMapFormatOnHeap = 0x80, /* bit flag, indicates allocation on heap */
 } RegisterMapFormat;
 
 /*
  * This is a single variable-size structure.  It may be allocated on the
  * heap or mapped out of a (post-dexopt) DEX file.
+ *
+ * 32-bit alignment of the structure is NOT guaranteed.  This makes it a
+ * little awkward to deal with as a structure; to avoid accidents we use
+ * only byte types.  Multi-byte values are little-endian.
+ *
+ * Size of (format==FormatNone): 1 byte
+ * Size of (format==FormatCompact8): 4 + (1 + regWidth) * numEntries
+ * Size of (format==FormatCompact16): 4 + (2 + regWidth) * numEntries
  */
 struct RegisterMap {
     /* header */
-    u1      format;         /* enum RegisterMapFormat */
+    u1      format;         /* enum RegisterMapFormat; MUST be first entry */
     u1      regWidth;       /* bytes per register line, 1+ */
-    u2      numEntries;     /* number of entries */
+    u1      numEntries[2];  /* number of entries */
 
-    /* data starts here; no alignment guarantees made */
+    /* raw data starts here; need not be aligned */
     u1      data[1];
 };
 
+bool dvmRegisterMapStartup(void);
+void dvmRegisterMapShutdown(void);
+
+/*
+ * Get the format.
+ */
+INLINE u1 dvmGetRegisterMapFormat(const RegisterMap* pMap) {
+    return pMap->format & ~(kRegMapFormatOnHeap);
+}
+
+/*
+ * Get the "on heap" flag.
+ */
+INLINE bool dvmGetRegisterMapOnHeap(const RegisterMap* pMap) {
+    return (pMap->format & kRegMapFormatOnHeap) != 0;
+}
+
+/*
+ * Set the "on heap" flag.
+ */
+INLINE void dvmSetRegisterMapOnHeap(RegisterMap* pMap, bool val) {
+    if (val)
+        pMap->format |= kRegMapFormatOnHeap;
+    else
+        pMap->format &= ~(kRegMapFormatOnHeap);
+}
+
+/*
+ * Get the number of entries in this map.
+ */
+INLINE u2 dvmRegisterMapGetNumEntries(const RegisterMap* pMap) {
+    return pMap->numEntries[0] | (pMap->numEntries[1] << 8);
+}
+
+/*
+ * Set the number of entries in this map.
+ */
+INLINE void dvmRegisterMapSetNumEntries(RegisterMap* pMap, u2 numEntries) {
+    pMap->numEntries[0] = (u1) numEntries;
+    pMap->numEntries[1] = numEntries >> 8;
+}
+
+/*
+ * Retrieve the bit vector for the specified address.  This is a pointer
+ * to the bit data from an uncompressed map, or to a temporary copy of
+ * data from a compressed map.
+ *
+ * The caller must call dvmReleaseRegisterMapLine() with the result.
+ *
+ * Returns NULL if not found.
+ */
+const u1* dvmGetRegisterMapLine(const RegisterMap* pMap, int addr);
+
+/*
+ * Release "data".
+ *
+ * If "pMap" points to a compressed map, this will free "data"; otherwise,
+ * it does nothing.
+ */
+INLINE void dvmReleaseRegisterMapLine(const RegisterMap* pMap, const u1* data)
+{}
+
+
+/*
+ * A pool of register maps for methods associated with a single class.
+ *
+ * Each entry is a 4-byte method index followed by the 32-bit-aligned
+ * RegisterMap.  The size of the RegisterMap is determined by parsing
+ * the map.  The lack of an index reduces random access speed, but we
+ * should be doing that rarely (during class load) and it saves space.
+ *
+ * These structures are 32-bit aligned.
+ */
+typedef struct RegisterMapMethodPool {
+    u2      methodCount;            /* chiefly used as a sanity check */
+
+    /* stream of per-method data starts here */
+    u4      methodData[1];
+} RegisterMapMethodPool;
+
+/*
+ * Header for the memory-mapped RegisterMap pool in the DEX file.
+ *
+ * The classDataOffset table provides offsets from the start of the
+ * RegisterMapPool structure.  There is one entry per class (including
+ * interfaces, which can have static initializers).
+ *
+ * The offset points to a RegisterMapMethodPool.
+ *
+ * These structures are 32-bit aligned.
+ */
+typedef struct RegisterMapClassPool {
+    u4      numClasses;
+
+    /* offset table starts here, 32-bit aligned; offset==0 means no data */
+    u4      classDataOffset[1];
+} RegisterMapClassPool;
+
+/*
+ * Find the register maps for this class.  (Used during class loading.)
+ * If "pNumMaps" is non-NULL, it will return the number of maps in the set.
+ *
+ * Returns NULL if none is available.
+ */
+const void* dvmGetRegisterMapClassData(const DexFile* pDexFile, u4 classIdx,
+    u4* pNumMaps);
+
+/*
+ * Get the register map for the next method.  "*pPtr" will be advanced past
+ * the end of the map.  (Used during class loading.)
+ *
+ * This should initially be called with the result from
+ * dvmGetRegisterMapClassData().
+ */
+const RegisterMap* dvmGetNextRegisterMap(const void** pPtr);
+
+/*
+ * This holds some meta-data while we construct the set of register maps
+ * for a DEX file.
+ *
+ * In particular, it keeps track of our temporary mmap region so we can
+ * free it later.
+ */
+typedef struct RegisterMapBuilder {
+    /* public */
+    void*       data;
+    size_t      size;
+
+    /* private */
+    MemMapping  memMap;
+} RegisterMapBuilder;
+
+/*
+ * Generate a register map set for all verified classes in "pDvmDex".
+ */
+RegisterMapBuilder* dvmGenerateRegisterMaps(DvmDex* pDvmDex);
+
+/*
+ * Free the builder.
+ */
+void dvmFreeRegisterMapBuilder(RegisterMapBuilder* pBuilder);
+
+
 /*
  * Generate the register map for a previously-verified method.
  *
@@ -97,4 +254,7 @@ typedef struct VerifierData {
  */
 RegisterMap* dvmGenerateRegisterMapV(VerifierData* vdata);
 
+/* dump stats gathered during register map creation process */
+void dvmRegisterMapDumpStats(void);
+
 #endif /*_DALVIK_REGISTERMAP*/
index 4d5b57c..a87c6f1 100644 (file)
@@ -57,7 +57,11 @@ bool dvmCheckBranchTarget(const Method* meth, InsnFlags* insnFlags,
 #define LOG_VFY_METH(_meth, ...)    dvmLogVerifyFailure(_meth, __VA_ARGS__)
 
 /* log verification failure with optional method info */
-void dvmLogVerifyFailure(const Method* meth, const char* format, ...);
+void dvmLogVerifyFailure(const Method* meth, const char* format, ...)
+#if defined(__GNUC__)
+    __attribute__ ((format(printf, 2, 3)))
+#endif
+    ;
 
 /* log verification failure due to resolution trouble */
 void dvmLogUnableToResolveClass(const char* missingClassDescr,
index 66b46f4..2e6f7c9 100644 (file)
@@ -111,7 +111,10 @@ copyFileToFile(FILE *dstFp, FILE *srcFp)
     }
 }
 
-void
+/*
+ * Finish up the hprof dump.  Returns true on success.
+ */
+bool
 hprofShutdown(hprof_context_t *ctx)
 {
     FILE *tempFp = ctx->fp;
@@ -131,7 +134,7 @@ hprofShutdown(hprof_context_t *ctx)
         fclose(tempFp);
         free(ctx->fileName);
         free(ctx);
-        return;
+        return false;
     }
     hprofContextInit(ctx, ctx->fileName, fp, true);
 
@@ -179,4 +182,5 @@ hprofShutdown(hprof_context_t *ctx)
 
     /* throw out a log message for the benefit of "runhat" */
     LOGI("hprof: heap dump completed, temp file removed\n");
+    return true;
 }
index e0e2d4b..696b0a7 100644 (file)
@@ -235,7 +235,7 @@ int hprofShutdown_StackFrame(void);
  */
 
 hprof_context_t *hprofStartup(const char *outputFileName);
-void hprofShutdown(hprof_context_t *ctx);
+bool hprofShutdown(hprof_context_t *ctx);
 
 /*
  * Heap.c functions
@@ -244,7 +244,7 @@ void hprofShutdown(hprof_context_t *ctx);
  * the heap implementation; these functions require heap knowledge,
  * so they are implemented in Heap.c.
  */
-void hprofDumpHeap(const char* fileName);
+int hprofDumpHeap(const char* fileName);
 void dvmHeapSetHprofGcScanState(hprof_heap_tag_t state, u4 threadSerialNumber);
 
 #endif  // _DALVIK_HPROF_HPROF
index 103d2b4..730b1a8 100644 (file)
@@ -76,9 +76,10 @@ static bool dvmPushInterpFrame(Thread* self, const Method* method)
 
     if (stackPtr - stackReq < self->interpStackEnd) {
         /* not enough space */
-        LOGW("Stack overflow on call to interp (top=%p cur=%p size=%d %s.%s)\n",
-            self->interpStackStart, self->curFrame, self->interpStackSize,
-            method->clazz->descriptor, method->name);
+        LOGW("Stack overflow on call to interp "
+             "(req=%d top=%p cur=%p size=%d %s.%s)\n",
+            stackReq, self->interpStackStart, self->curFrame,
+            self->interpStackSize, method->clazz->descriptor, method->name);
         dvmHandleStackOverflow(self);
         assert(dvmCheckException(self));
         return false;
@@ -148,9 +149,10 @@ bool dvmPushJNIFrame(Thread* self, const Method* method)
 
     if (stackPtr - stackReq < self->interpStackEnd) {
         /* not enough space */
-        LOGW("Stack overflow on call to native (top=%p cur=%p size=%d '%s')\n",
-            self->interpStackStart, self->curFrame, self->interpStackSize,
-            method->name);
+        LOGW("Stack overflow on call to native "
+             "(req=%d top=%p cur=%p size=%d '%s')\n",
+            stackReq, self->interpStackStart, self->curFrame,
+            self->interpStackSize, method->name);
         dvmHandleStackOverflow(self);
         assert(dvmCheckException(self));
         return false;
@@ -217,9 +219,10 @@ bool dvmPushLocalFrame(Thread* self, const Method* method)
 
     if (stackPtr - stackReq < self->interpStackEnd) {
         /* not enough space; let JNI throw the exception */
-        LOGW("Stack overflow on PushLocal (top=%p cur=%p size=%d '%s')\n",
-            self->interpStackStart, self->curFrame, self->interpStackSize,
-            method->name);
+        LOGW("Stack overflow on PushLocal "
+             "(req=%d top=%p cur=%p size=%d '%s')\n",
+            stackReq, self->interpStackStart, self->curFrame,
+            self->interpStackSize, method->name);
         dvmHandleStackOverflow(self);
         assert(dvmCheckException(self));
         return false;
@@ -351,7 +354,8 @@ static ClassObject* callPrep(Thread* self, const Method* method, Object* obj,
 
 #ifndef NDEBUG
     if (self->status != THREAD_RUNNING) {
-        LOGW("Status=%d on call to %s.%s -\n", self->status,
+        LOGW("threadid=%d: status=%d on call to %s.%s -\n",
+            self->threadId, self->status,
             method->clazz->descriptor, method->name);
     }
 #endif
@@ -504,11 +508,17 @@ void dvmCallMethodV(Thread* self, const Method* method, Object* obj,
     //dvmDumpThreadStack(dvmThreadSelf());
 
     if (dvmIsNativeMethod(method)) {
+#ifdef WITH_PROFILER
+        TRACE_METHOD_ENTER(self, method);
+#endif
         /*
          * Because we leave no space for local variables, "curFrame" points
          * directly at the method arguments.
          */
         (*method->nativeFunc)(self->curFrame, pResult, method, self);
+#ifdef WITH_PROFILER
+        TRACE_METHOD_EXIT(self, method);
+#endif
     } else {
         dvmInterpret(self, method, pResult);
     }
@@ -608,11 +618,17 @@ void dvmCallMethodA(Thread* self, const Method* method, Object* obj,
 #endif
 
     if (dvmIsNativeMethod(method)) {
+#ifdef WITH_PROFILER
+        TRACE_METHOD_ENTER(self, method);
+#endif
         /*
          * Because we leave no space for local variables, "curFrame" points
          * directly at the method arguments.
          */
         (*method->nativeFunc)(self->curFrame, pResult, method, self);
+#ifdef WITH_PROFILER
+        TRACE_METHOD_EXIT(self, method);
+#endif
     } else {
         dvmInterpret(self, method, pResult);
     }
@@ -712,11 +728,17 @@ Object* dvmInvokeMethod(Object* obj, const Method* method,
     //dvmDumpThreadStack(dvmThreadSelf());
 
     if (dvmIsNativeMethod(method)) {
+#ifdef WITH_PROFILER
+        TRACE_METHOD_ENTER(self, method);
+#endif
         /*
          * Because we leave no space for local variables, "curFrame" points
          * directly at the method arguments.
          */
         (*method->nativeFunc)(self->curFrame, &retval, method, self);
+#ifdef WITH_PROFILER
+        TRACE_METHOD_EXIT(self, method);
+#endif
     } else {
         dvmInterpret(self, method, &retval);
     }
index 6d4c2d8..524621a 100644 (file)
@@ -8,9 +8,7 @@
     GET_VREG(r1, r2)                    @ r1<- vAA (object)
     ldr     r0, [rGLUE, #offGlue_self]  @ r0<- glue->self
     cmp     r1, #0                      @ null object?
-#ifdef WITH_MONITOR_TRACKING
-    EXPORT_PC()                         @ export PC so we can grab stack trace
-#endif
+    EXPORT_PC()                         @ need for precise GC, MONITOR_TRACKING
     beq     common_errNullObject        @ null object, throw an exception
     FETCH_ADVANCE_INST(1)               @ advance rPC, load rINST
     bl      dvmLockObject               @ call(self, obj)
index 8f7cc41..0e5898b 100644 (file)
@@ -54,7 +54,7 @@ common_periodicChecks:
 #endif
 
     cmp     r3, #0                      @ suspend pending?
-    bne     2f                          @ yes, check suspend
+    bne     2f                          @ yes, do full suspension check
 
 #if defined(WITH_DEBUGGER) || defined(WITH_PROFILER)
 # if defined(WITH_DEBUGGER) && defined(WITH_PROFILER)
@@ -72,6 +72,7 @@ common_periodicChecks:
 
 2:  @ check suspend
     ldr     r0, [rGLUE, #offGlue_self]  @ r0<- glue->self
+    EXPORT_PC()                         @ need for precise GC
     b       dvmCheckSuspendPending      @ suspend if necessary, then return
 
 3:  @ debugger/profiler enabled, bail out
index 4d70da7..c9d8999 100644 (file)
@@ -9,9 +9,7 @@ HANDLE_OPCODE(OP_MONITOR_ENTER /*vAA*/)
         if (!checkForNullExportPC(obj, fp, pc))
             GOTO_exceptionThrown();
         ILOGV("+ locking %p %s\n", obj, obj->clazz->descriptor);
-#ifdef WITH_MONITOR_TRACKING
-        EXPORT_PC();        /* need for stack trace */
-#endif
+        EXPORT_PC();    /* need for precise GC, also WITH_MONITOR_TRACKING */
         dvmLockObject(self, obj);
 #ifdef WITH_DEADLOCK_PREDICTION
         if (dvmCheckException(self))
index e35ded4..d2fca9c 100644 (file)
@@ -46,7 +46,7 @@
  */
 #define THREADED_INTERP             /* threaded vs. while-loop interpreter */
 
-#ifdef WITH_INSTR_CHECKS            /* instruction-level paranoia */
+#ifdef WITH_INSTR_CHECKS            /* instruction-level paranoia (slow!) */
 # define CHECK_BRANCH_OFFSETS
 # define CHECK_REGISTER_INDICES
 #endif
 #endif
 
 /*
+ * Export another copy of the PC on every instruction; this is largely
+ * redundant with EXPORT_PC and the debugger code.  This value can be
+ * compared against what we have stored on the stack with EXPORT_PC to
+ * help ensure that we aren't missing any export calls.
+ */
+#if WITH_EXTRA_GC_CHECKS > 1
+# define EXPORT_EXTRA_PC() (self->currentPc2 = pc)
+#else
+# define EXPORT_EXTRA_PC()
+#endif
+
+/*
  * Adjust the program counter.  "_offset" is a signed int, in 16-bit units.
  *
  * Assumes the existence of "const u2* pc" and "const u2* curMethod->insns".
             dvmAbort();                                                     \
         }                                                                   \
         pc += myoff;                                                        \
+        EXPORT_EXTRA_PC();                                                  \
     } while (false)
 #else
-# define ADJUST_PC(_offset) (pc += _offset)
+# define ADJUST_PC(_offset) do {                                            \
+        pc += _offset;                                                      \
+        EXPORT_EXTRA_PC();                                                  \
+    } while (false)
 #endif
 
 /*
@@ -296,6 +312,8 @@ static inline void putDoubleToArray(u4* ptr, int idx, double dval)
  * within the current method won't be shown correctly.  See the notes
  * in Exception.c.
  *
+ * This is also used to determine the address for precise GC.
+ *
  * Assumes existence of "u4* fp" and "const u2* pc".
  */
 #define EXPORT_PC()         (SAVEAREA_FROM_FP(fp)->xtra.currentPc = pc)
index 1de6f0e..d4162c8 100644 (file)
  * started.  If so, switch to a different "goto" table.
  */
 #define PERIODIC_CHECKS(_entryPoint, _pcadj) {                              \
-        dvmCheckSuspendQuick(self);                                         \
+        if (dvmCheckSuspendQuick(self)) {                                   \
+            EXPORT_PC();  /* need for precise GC */                         \
+            dvmCheckSuspendPending(self);                                   \
+        }                                                                   \
         if (NEED_INTERP_SWITCH(INTERP_TYPE)) {                              \
             ADJUST_PC(_pcadj);                                              \
             glue->entryPoint = _entryPoint;                                 \
index 3de7aea..f183814 100644 (file)
@@ -818,9 +818,7 @@ dalvik_inst:
     GET_VREG(r1, r2)                    @ r1<- vAA (object)
     ldr     r0, [rGLUE, #offGlue_self]  @ r0<- glue->self
     cmp     r1, #0                      @ null object?
-#ifdef WITH_MONITOR_TRACKING
-    EXPORT_PC()                         @ export PC so we can grab stack trace
-#endif
+    EXPORT_PC()                         @ need for precise GC, MONITOR_TRACKING
     beq     common_errNullObject        @ null object, throw an exception
     FETCH_ADVANCE_INST(1)               @ advance rPC, load rINST
     bl      dvmLockObject               @ call(self, obj)
@@ -9342,7 +9340,7 @@ common_periodicChecks:
 #endif
 
     cmp     r3, #0                      @ suspend pending?
-    bne     2f                          @ yes, check suspend
+    bne     2f                          @ yes, do full suspension check
 
 #if defined(WITH_DEBUGGER) || defined(WITH_PROFILER)
 # if defined(WITH_DEBUGGER) && defined(WITH_PROFILER)
@@ -9360,6 +9358,7 @@ common_periodicChecks:
 
 2:  @ check suspend
     ldr     r0, [rGLUE, #offGlue_self]  @ r0<- glue->self
+    EXPORT_PC()                         @ need for precise GC
     b       dvmCheckSuspendPending      @ suspend if necessary, then return
 
 3:  @ debugger/profiler enabled, bail out
index 9987ff5..26c8860 100644 (file)
@@ -818,9 +818,7 @@ dalvik_inst:
     GET_VREG(r1, r2)                    @ r1<- vAA (object)
     ldr     r0, [rGLUE, #offGlue_self]  @ r0<- glue->self
     cmp     r1, #0                      @ null object?
-#ifdef WITH_MONITOR_TRACKING
-    EXPORT_PC()                         @ export PC so we can grab stack trace
-#endif
+    EXPORT_PC()                         @ need for precise GC, MONITOR_TRACKING
     beq     common_errNullObject        @ null object, throw an exception
     FETCH_ADVANCE_INST(1)               @ advance rPC, load rINST
     bl      dvmLockObject               @ call(self, obj)
@@ -9336,7 +9334,7 @@ common_periodicChecks:
 #endif
 
     cmp     r3, #0                      @ suspend pending?
-    bne     2f                          @ yes, check suspend
+    bne     2f                          @ yes, do full suspension check
 
 #if defined(WITH_DEBUGGER) || defined(WITH_PROFILER)
 # if defined(WITH_DEBUGGER) && defined(WITH_PROFILER)
@@ -9354,6 +9352,7 @@ common_periodicChecks:
 
 2:  @ check suspend
     ldr     r0, [rGLUE, #offGlue_self]  @ r0<- glue->self
+    EXPORT_PC()                         @ need for precise GC
     b       dvmCheckSuspendPending      @ suspend if necessary, then return
 
 3:  @ debugger/profiler enabled, bail out
index a80e59e..0fd3e42 100644 (file)
@@ -682,9 +682,7 @@ dvmAsmInstructionStart = .L_OP_NOP
     movl    offGlue_self(%ecx),%ecx     # ecx<- glue->self
     FETCH_INST_WORD(1)
     testl   %eax,%eax                   # null object?
-#ifdef WITH_MONITOR_TRACKING
-    EXPORT_PC()
-#endif
+    EXPORT_PC()                         # need for precise GC, MONITOR_TRACKING
     jne     .LOP_MONITOR_ENTER_continue
     jmp     common_errNullObject
 
@@ -8618,6 +8616,7 @@ common_periodicChecks:
      *      bool dvmCheckSuspendPending(Thread* self)
      *  Because we reached here via a call, go ahead and build a new frame.
      */
+    EXPORT_PC()                         # need for precise GC
     movl    offGlue_self(%ecx),%eax      # eax<- glue->self
     SPILL(rPC)                      # save edx
     push    %ebp
index 635a873..cde7b27 100644 (file)
@@ -53,7 +53,7 @@
  */
 #define THREADED_INTERP             /* threaded vs. while-loop interpreter */
 
-#ifdef WITH_INSTR_CHECKS            /* instruction-level paranoia */
+#ifdef WITH_INSTR_CHECKS            /* instruction-level paranoia (slow!) */
 # define CHECK_BRANCH_OFFSETS
 # define CHECK_REGISTER_INDICES
 #endif
 #endif
 
 /*
+ * Export another copy of the PC on every instruction; this is largely
+ * redundant with EXPORT_PC and the debugger code.  This value can be
+ * compared against what we have stored on the stack with EXPORT_PC to
+ * help ensure that we aren't missing any export calls.
+ */
+#if WITH_EXTRA_GC_CHECKS > 1
+# define EXPORT_EXTRA_PC() (self->currentPc2 = pc)
+#else
+# define EXPORT_EXTRA_PC()
+#endif
+
+/*
  * Adjust the program counter.  "_offset" is a signed int, in 16-bit units.
  *
  * Assumes the existence of "const u2* pc" and "const u2* curMethod->insns".
             dvmAbort();                                                     \
         }                                                                   \
         pc += myoff;                                                        \
+        EXPORT_EXTRA_PC();                                                  \
     } while (false)
 #else
-# define ADJUST_PC(_offset) (pc += _offset)
+# define ADJUST_PC(_offset) do {                                            \
+        pc += _offset;                                                      \
+        EXPORT_EXTRA_PC();                                                  \
+    } while (false)
 #endif
 
 /*
@@ -303,6 +319,8 @@ static inline void putDoubleToArray(u4* ptr, int idx, double dval)
  * within the current method won't be shown correctly.  See the notes
  * in Exception.c.
  *
+ * This is also used to determine the address for precise GC.
+ *
  * Assumes existence of "u4* fp" and "const u2* pc".
  */
 #define EXPORT_PC()         (SAVEAREA_FROM_FP(fp)->xtra.currentPc = pc)
@@ -513,7 +531,10 @@ static inline bool checkForNullExportPC(Object* obj, u4* fp, const u2* pc)
  * started.  If so, switch to a different "goto" table.
  */
 #define PERIODIC_CHECKS(_entryPoint, _pcadj) {                              \
-        dvmCheckSuspendQuick(self);                                         \
+        if (dvmCheckSuspendQuick(self)) {                                   \
+            EXPORT_PC();  /* need for precise GC */                         \
+            dvmCheckSuspendPending(self);                                   \
+        }                                                                   \
         if (NEED_INTERP_SWITCH(INTERP_TYPE)) {                              \
             ADJUST_PC(_pcadj);                                              \
             glue->entryPoint = _entryPoint;                                 \
@@ -1525,9 +1546,7 @@ HANDLE_OPCODE(OP_MONITOR_ENTER /*vAA*/)
         if (!checkForNullExportPC(obj, fp, pc))
             GOTO_exceptionThrown();
         ILOGV("+ locking %p %s\n", obj, obj->clazz->descriptor);
-#ifdef WITH_MONITOR_TRACKING
-        EXPORT_PC();        /* need for stack trace */
-#endif
+        EXPORT_PC();    /* need for precise GC, also WITH_MONITOR_TRACKING */
         dvmLockObject(self, obj);
 #ifdef WITH_DEADLOCK_PREDICTION
         if (dvmCheckException(self))
index 2fcdcab..11acb39 100644 (file)
@@ -53,7 +53,7 @@
  */
 #define THREADED_INTERP             /* threaded vs. while-loop interpreter */
 
-#ifdef WITH_INSTR_CHECKS            /* instruction-level paranoia */
+#ifdef WITH_INSTR_CHECKS            /* instruction-level paranoia (slow!) */
 # define CHECK_BRANCH_OFFSETS
 # define CHECK_REGISTER_INDICES
 #endif
 #endif
 
 /*
+ * Export another copy of the PC on every instruction; this is largely
+ * redundant with EXPORT_PC and the debugger code.  This value can be
+ * compared against what we have stored on the stack with EXPORT_PC to
+ * help ensure that we aren't missing any export calls.
+ */
+#if WITH_EXTRA_GC_CHECKS > 1
+# define EXPORT_EXTRA_PC() (self->currentPc2 = pc)
+#else
+# define EXPORT_EXTRA_PC()
+#endif
+
+/*
  * Adjust the program counter.  "_offset" is a signed int, in 16-bit units.
  *
  * Assumes the existence of "const u2* pc" and "const u2* curMethod->insns".
             dvmAbort();                                                     \
         }                                                                   \
         pc += myoff;                                                        \
+        EXPORT_EXTRA_PC();                                                  \
     } while (false)
 #else
-# define ADJUST_PC(_offset) (pc += _offset)
+# define ADJUST_PC(_offset) do {                                            \
+        pc += _offset;                                                      \
+        EXPORT_EXTRA_PC();                                                  \
+    } while (false)
 #endif
 
 /*
@@ -303,6 +319,8 @@ static inline void putDoubleToArray(u4* ptr, int idx, double dval)
  * within the current method won't be shown correctly.  See the notes
  * in Exception.c.
  *
+ * This is also used to determine the address for precise GC.
+ *
  * Assumes existence of "u4* fp" and "const u2* pc".
  */
 #define EXPORT_PC()         (SAVEAREA_FROM_FP(fp)->xtra.currentPc = pc)
@@ -513,7 +531,10 @@ static inline bool checkForNullExportPC(Object* obj, u4* fp, const u2* pc)
  * started.  If so, switch to a different "goto" table.
  */
 #define PERIODIC_CHECKS(_entryPoint, _pcadj) {                              \
-        dvmCheckSuspendQuick(self);                                         \
+        if (dvmCheckSuspendQuick(self)) {                                   \
+            EXPORT_PC();  /* need for precise GC */                         \
+            dvmCheckSuspendPending(self);                                   \
+        }                                                                   \
         if (NEED_INTERP_SWITCH(INTERP_TYPE)) {                              \
             ADJUST_PC(_pcadj);                                              \
             glue->entryPoint = _entryPoint;                                 \
index 47c8709..c8f4ced 100644 (file)
@@ -53,7 +53,7 @@
  */
 #define THREADED_INTERP             /* threaded vs. while-loop interpreter */
 
-#ifdef WITH_INSTR_CHECKS            /* instruction-level paranoia */
+#ifdef WITH_INSTR_CHECKS            /* instruction-level paranoia (slow!) */
 # define CHECK_BRANCH_OFFSETS
 # define CHECK_REGISTER_INDICES
 #endif
 #endif
 
 /*
+ * Export another copy of the PC on every instruction; this is largely
+ * redundant with EXPORT_PC and the debugger code.  This value can be
+ * compared against what we have stored on the stack with EXPORT_PC to
+ * help ensure that we aren't missing any export calls.
+ */
+#if WITH_EXTRA_GC_CHECKS > 1
+# define EXPORT_EXTRA_PC() (self->currentPc2 = pc)
+#else
+# define EXPORT_EXTRA_PC()
+#endif
+
+/*
  * Adjust the program counter.  "_offset" is a signed int, in 16-bit units.
  *
  * Assumes the existence of "const u2* pc" and "const u2* curMethod->insns".
             dvmAbort();                                                     \
         }                                                                   \
         pc += myoff;                                                        \
+        EXPORT_EXTRA_PC();                                                  \
     } while (false)
 #else
-# define ADJUST_PC(_offset) (pc += _offset)
+# define ADJUST_PC(_offset) do {                                            \
+        pc += _offset;                                                      \
+        EXPORT_EXTRA_PC();                                                  \
+    } while (false)
 #endif
 
 /*
@@ -303,6 +319,8 @@ static inline void putDoubleToArray(u4* ptr, int idx, double dval)
  * within the current method won't be shown correctly.  See the notes
  * in Exception.c.
  *
+ * This is also used to determine the address for precise GC.
+ *
  * Assumes existence of "u4* fp" and "const u2* pc".
  */
 #define EXPORT_PC()         (SAVEAREA_FROM_FP(fp)->xtra.currentPc = pc)
@@ -513,7 +531,10 @@ static inline bool checkForNullExportPC(Object* obj, u4* fp, const u2* pc)
  * started.  If so, switch to a different "goto" table.
  */
 #define PERIODIC_CHECKS(_entryPoint, _pcadj) {                              \
-        dvmCheckSuspendQuick(self);                                         \
+        if (dvmCheckSuspendQuick(self)) {                                   \
+            EXPORT_PC();  /* need for precise GC */                         \
+            dvmCheckSuspendPending(self);                                   \
+        }                                                                   \
         if (NEED_INTERP_SWITCH(INTERP_TYPE)) {                              \
             ADJUST_PC(_pcadj);                                              \
             glue->entryPoint = _entryPoint;                                 \
index d527cc0..7f7dd8a 100644 (file)
@@ -53,7 +53,7 @@
  */
 #define THREADED_INTERP             /* threaded vs. while-loop interpreter */
 
-#ifdef WITH_INSTR_CHECKS            /* instruction-level paranoia */
+#ifdef WITH_INSTR_CHECKS            /* instruction-level paranoia (slow!) */
 # define CHECK_BRANCH_OFFSETS
 # define CHECK_REGISTER_INDICES
 #endif
 #endif
 
 /*
+ * Export another copy of the PC on every instruction; this is largely
+ * redundant with EXPORT_PC and the debugger code.  This value can be
+ * compared against what we have stored on the stack with EXPORT_PC to
+ * help ensure that we aren't missing any export calls.
+ */
+#if WITH_EXTRA_GC_CHECKS > 1
+# define EXPORT_EXTRA_PC() (self->currentPc2 = pc)
+#else
+# define EXPORT_EXTRA_PC()
+#endif
+
+/*
  * Adjust the program counter.  "_offset" is a signed int, in 16-bit units.
  *
  * Assumes the existence of "const u2* pc" and "const u2* curMethod->insns".
             dvmAbort();                                                     \
         }                                                                   \
         pc += myoff;                                                        \
+        EXPORT_EXTRA_PC();                                                  \
     } while (false)
 #else
-# define ADJUST_PC(_offset) (pc += _offset)
+# define ADJUST_PC(_offset) do {                                            \
+        pc += _offset;                                                      \
+        EXPORT_EXTRA_PC();                                                  \
+    } while (false)
 #endif
 
 /*
@@ -303,6 +319,8 @@ static inline void putDoubleToArray(u4* ptr, int idx, double dval)
  * within the current method won't be shown correctly.  See the notes
  * in Exception.c.
  *
+ * This is also used to determine the address for precise GC.
+ *
  * Assumes existence of "u4* fp" and "const u2* pc".
  */
 #define EXPORT_PC()         (SAVEAREA_FROM_FP(fp)->xtra.currentPc = pc)
@@ -486,7 +504,10 @@ static inline bool checkForNullExportPC(Object* obj, u4* fp, const u2* pc)
  * started.  If so, switch to a different "goto" table.
  */
 #define PERIODIC_CHECKS(_entryPoint, _pcadj) {                              \
-        dvmCheckSuspendQuick(self);                                         \
+        if (dvmCheckSuspendQuick(self)) {                                   \
+            EXPORT_PC();  /* need for precise GC */                         \
+            dvmCheckSuspendPending(self);                                   \
+        }                                                                   \
         if (NEED_INTERP_SWITCH(INTERP_TYPE)) {                              \
             ADJUST_PC(_pcadj);                                              \
             interpState->entryPoint = _entryPoint;                          \
@@ -1869,9 +1890,7 @@ HANDLE_OPCODE(OP_MONITOR_ENTER /*vAA*/)
         if (!checkForNullExportPC(obj, fp, pc))
             GOTO_exceptionThrown();
         ILOGV("+ locking %p %s\n", obj, obj->clazz->descriptor);
-#ifdef WITH_MONITOR_TRACKING
-        EXPORT_PC();        /* need for stack trace */
-#endif
+        EXPORT_PC();    /* need for precise GC, also WITH_MONITOR_TRACKING */
         dvmLockObject(self, obj);
 #ifdef WITH_DEADLOCK_PREDICTION
         if (dvmCheckException(self))
index 64e5ccd..367332c 100644 (file)
@@ -53,7 +53,7 @@
  */
 #define THREADED_INTERP             /* threaded vs. while-loop interpreter */
 
-#ifdef WITH_INSTR_CHECKS            /* instruction-level paranoia */
+#ifdef WITH_INSTR_CHECKS            /* instruction-level paranoia (slow!) */
 # define CHECK_BRANCH_OFFSETS
 # define CHECK_REGISTER_INDICES
 #endif
 #endif
 
 /*
+ * Export another copy of the PC on every instruction; this is largely
+ * redundant with EXPORT_PC and the debugger code.  This value can be
+ * compared against what we have stored on the stack with EXPORT_PC to
+ * help ensure that we aren't missing any export calls.
+ */
+#if WITH_EXTRA_GC_CHECKS > 1
+# define EXPORT_EXTRA_PC() (self->currentPc2 = pc)
+#else
+# define EXPORT_EXTRA_PC()
+#endif
+
+/*
  * Adjust the program counter.  "_offset" is a signed int, in 16-bit units.
  *
  * Assumes the existence of "const u2* pc" and "const u2* curMethod->insns".
             dvmAbort();                                                     \
         }                                                                   \
         pc += myoff;                                                        \
+        EXPORT_EXTRA_PC();                                                  \
     } while (false)
 #else
-# define ADJUST_PC(_offset) (pc += _offset)
+# define ADJUST_PC(_offset) do {                                            \
+        pc += _offset;                                                      \
+        EXPORT_EXTRA_PC();                                                  \
+    } while (false)
 #endif
 
 /*
@@ -303,6 +319,8 @@ static inline void putDoubleToArray(u4* ptr, int idx, double dval)
  * within the current method won't be shown correctly.  See the notes
  * in Exception.c.
  *
+ * This is also used to determine the address for precise GC.
+ *
  * Assumes existence of "u4* fp" and "const u2* pc".
  */
 #define EXPORT_PC()         (SAVEAREA_FROM_FP(fp)->xtra.currentPc = pc)
@@ -485,7 +503,10 @@ static inline bool checkForNullExportPC(Object* obj, u4* fp, const u2* pc)
  * started.  If so, switch to a different "goto" table.
  */
 #define PERIODIC_CHECKS(_entryPoint, _pcadj) {                              \
-        dvmCheckSuspendQuick(self);                                         \
+        if (dvmCheckSuspendQuick(self)) {                                   \
+            EXPORT_PC();  /* need for precise GC */                         \
+            dvmCheckSuspendPending(self);                                   \
+        }                                                                   \
         if (NEED_INTERP_SWITCH(INTERP_TYPE)) {                              \
             ADJUST_PC(_pcadj);                                              \
             interpState->entryPoint = _entryPoint;                          \
@@ -1589,9 +1610,7 @@ HANDLE_OPCODE(OP_MONITOR_ENTER /*vAA*/)
         if (!checkForNullExportPC(obj, fp, pc))
             GOTO_exceptionThrown();
         ILOGV("+ locking %p %s\n", obj, obj->clazz->descriptor);
-#ifdef WITH_MONITOR_TRACKING
-        EXPORT_PC();        /* need for stack trace */
-#endif
+        EXPORT_PC();    /* need for precise GC, also WITH_MONITOR_TRACKING */
         dvmLockObject(self, obj);
 #ifdef WITH_DEADLOCK_PREDICTION
         if (dvmCheckException(self))
index cd5fe95..ac524f4 100644 (file)
@@ -53,7 +53,7 @@
  */
 #define THREADED_INTERP             /* threaded vs. while-loop interpreter */
 
-#ifdef WITH_INSTR_CHECKS            /* instruction-level paranoia */
+#ifdef WITH_INSTR_CHECKS            /* instruction-level paranoia (slow!) */
 # define CHECK_BRANCH_OFFSETS
 # define CHECK_REGISTER_INDICES
 #endif
 #endif
 
 /*
+ * Export another copy of the PC on every instruction; this is largely
+ * redundant with EXPORT_PC and the debugger code.  This value can be
+ * compared against what we have stored on the stack with EXPORT_PC to
+ * help ensure that we aren't missing any export calls.
+ */
+#if WITH_EXTRA_GC_CHECKS > 1
+# define EXPORT_EXTRA_PC() (self->currentPc2 = pc)
+#else
+# define EXPORT_EXTRA_PC()
+#endif
+
+/*
  * Adjust the program counter.  "_offset" is a signed int, in 16-bit units.
  *
  * Assumes the existence of "const u2* pc" and "const u2* curMethod->insns".
             dvmAbort();                                                     \
         }                                                                   \
         pc += myoff;                                                        \
+        EXPORT_EXTRA_PC();                                                  \
     } while (false)
 #else
-# define ADJUST_PC(_offset) (pc += _offset)
+# define ADJUST_PC(_offset) do {                                            \
+        pc += _offset;                                                      \
+        EXPORT_EXTRA_PC();                                                  \
+    } while (false)
 #endif
 
 /*
@@ -303,6 +319,8 @@ static inline void putDoubleToArray(u4* ptr, int idx, double dval)
  * within the current method won't be shown correctly.  See the notes
  * in Exception.c.
  *
+ * This is also used to determine the address for precise GC.
+ *
  * Assumes existence of "u4* fp" and "const u2* pc".
  */
 #define EXPORT_PC()         (SAVEAREA_FROM_FP(fp)->xtra.currentPc = pc)
@@ -513,7 +531,10 @@ static inline bool checkForNullExportPC(Object* obj, u4* fp, const u2* pc)
  * started.  If so, switch to a different "goto" table.
  */
 #define PERIODIC_CHECKS(_entryPoint, _pcadj) {                              \
-        dvmCheckSuspendQuick(self);                                         \
+        if (dvmCheckSuspendQuick(self)) {                                   \
+            EXPORT_PC();  /* need for precise GC */                         \
+            dvmCheckSuspendPending(self);                                   \
+        }                                                                   \
         if (NEED_INTERP_SWITCH(INTERP_TYPE)) {                              \
             ADJUST_PC(_pcadj);                                              \
             glue->entryPoint = _entryPoint;                                 \
index 0ea563c..b809caf 100644 (file)
  * started.  If so, switch to a different "goto" table.
  */
 #define PERIODIC_CHECKS(_entryPoint, _pcadj) {                              \
-        dvmCheckSuspendQuick(self);                                         \
+        if (dvmCheckSuspendQuick(self)) {                                   \
+            EXPORT_PC();  /* need for precise GC */                         \
+            dvmCheckSuspendPending(self);                                   \
+        }                                                                   \
         if (NEED_INTERP_SWITCH(INTERP_TYPE)) {                              \
             ADJUST_PC(_pcadj);                                              \
             interpState->entryPoint = _entryPoint;                          \
index 18425f4..548f71f 100644 (file)
@@ -10,9 +10,7 @@
     movl    offGlue_self(%ecx),%ecx     # ecx<- glue->self
     FETCH_INST_WORD(1)
     testl   %eax,%eax                   # null object?
-#ifdef WITH_MONITOR_TRACKING
-    EXPORT_PC()
-#endif
+    EXPORT_PC()                         # need for precise GC, MONITOR_TRACKING
     jne     .L${opcode}_continue
     jmp     common_errNullObject
 %break
index 50634dd..a3efc0e 100644 (file)
@@ -106,6 +106,7 @@ common_periodicChecks:
      *      bool dvmCheckSuspendPending(Thread* self)
      *  Because we reached here via a call, go ahead and build a new frame.
      */
+    EXPORT_PC()                         # need for precise GC
     movl    offGlue_self(%ecx),%eax      # eax<- glue->self
     SPILL(rPC)                      # save edx
     push    %ebp
index 9eccb76..ec6d92e 100644 (file)
@@ -244,6 +244,23 @@ static void Dalvik_dalvik_system_VMDebug_startMethodTracing(const u4* args,
 }
 
 /*
+ * static boolean isMethodTracingActive()
+ *
+ * Determine whether method tracing is currently active.
+ */
+static void Dalvik_dalvik_system_VMDebug_isMethodTracingActive(const u4* args,
+    JValue* pResult)
+{
+    UNUSED_PARAMETER(args);
+
+#ifdef WITH_PROFILER
+    RETURN_BOOLEAN(dvmIsMethodTraceActive());
+#else
+    RETURN_BOOLEAN(false);
+#endif
+}
+
+/*
  * static void stopMethodTracing()
  *
  * Stop method tracing.
@@ -527,6 +544,7 @@ static void Dalvik_dalvik_system_VMDebug_dumpHprofData(const u4* args,
 #ifdef WITH_HPROF
     StringObject* fileNameStr = (StringObject*) args[0];
     char* fileName;
+    int result;
 
     if (fileNameStr == NULL) {
         dvmThrowException("Ljava/lang/NullPointerException;", NULL);
@@ -540,8 +558,15 @@ static void Dalvik_dalvik_system_VMDebug_dumpHprofData(const u4* args,
         RETURN_VOID();
     }
 
-    hprofDumpHeap(fileName);
+    result = hprofDumpHeap(fileName);
     free(fileName);
+
+    if (result != 0) {
+        /* ideally we'd throw something more specific based on actual failure */
+        dvmThrowException("Ljava/lang/RuntimeException;",
+            "Failure during heap dump -- check log output for details");
+        RETURN_VOID();
+    }
 #else
     dvmThrowException("Ljava/lang/UnsupportedOperationException;", NULL);
 #endif
@@ -562,6 +587,8 @@ const DalvikNativeMethod dvm_dalvik_system_VMDebug[] = {
         Dalvik_dalvik_system_VMDebug_stopAllocCounting },
     { "startMethodTracing",         "(Ljava/lang/String;II)V",
         Dalvik_dalvik_system_VMDebug_startMethodTracing },
+    { "isMethodTracingActive",      "()Z",
+        Dalvik_dalvik_system_VMDebug_isMethodTracingActive },
     { "stopMethodTracing",          "()V",
         Dalvik_dalvik_system_VMDebug_stopMethodTracing },
     { "startEmulatorTracing",       "()V",
index c7ab763..6dd2e8c 100644 (file)
@@ -1721,7 +1721,39 @@ static ClassObject* loadClassFromDex0(DvmDex* pDvmDex,
         dvmLinearReadOnly(classLoader, newClass->ifields);
     }
 
-    /* load method definitions */
+    /*
+     * Load method definitions.  We do this in two batches, direct then
+     * virtual.
+     *
+     * If register maps have already been generated for this class, and
+     * precise GC is enabled, we pull out pointers to them.  We know that
+     * they were streamed to the DEX file in the same order in which the
+     * methods appear.
+     *
+     * If the class wasn't pre-verified, the maps will be generated when
+     * the class is verified during class initialization.
+     */
+    u4 classDefIdx = dexGetIndexForClassDef(pDexFile, pClassDef);
+    const void* classMapData;
+    u4 numMethods;
+
+    if (gDvm.preciseGc) {
+        classMapData =
+            dvmGetRegisterMapClassData(pDexFile, classDefIdx, &numMethods);
+
+        /* sanity check */
+        if (classMapData != NULL &&
+            pHeader->directMethodsSize + pHeader->virtualMethodsSize != numMethods)
+        {
+            LOGE("ERROR: in %s, direct=%d virtual=%d, maps have %d\n",
+                newClass->descriptor, pHeader->directMethodsSize,
+                pHeader->virtualMethodsSize, numMethods);
+            assert(false);
+            classMapData = NULL;        /* abandon */
+        }
+    } else {
+        classMapData = NULL;
+    }
 
     if (pHeader->directMethodsSize != 0) {
         int count = (int) pHeader->directMethodsSize;
@@ -1734,6 +1766,15 @@ static ClassObject* loadClassFromDex0(DvmDex* pDvmDex,
         for (i = 0; i < count; i++) {
             dexReadClassDataMethod(&pEncodedData, &method, &lastIndex);
             loadMethodFromDex(newClass, &method, &newClass->directMethods[i]);
+            if (classMapData != NULL) {
+                const RegisterMap* pMap = dvmGetNextRegisterMap(&classMapData);
+                if (dvmGetRegisterMapFormat(pMap) != kRegMapFormatNone) {
+                    newClass->directMethods[i].registerMap = pMap;
+                    /* TODO: add rigorous checks */
+                    assert((newClass->directMethods[i].registersSize+7) / 8 ==
+                        newClass->directMethods[i].registerMap->regWidth);
+                }
+            }
         }
         dvmLinearReadOnly(classLoader, newClass->directMethods);
     }
@@ -1749,6 +1790,15 @@ static ClassObject* loadClassFromDex0(DvmDex* pDvmDex,
         for (i = 0; i < count; i++) {
             dexReadClassDataMethod(&pEncodedData, &method, &lastIndex);
             loadMethodFromDex(newClass, &method, &newClass->virtualMethods[i]);
+            if (classMapData != NULL) {
+                const RegisterMap* pMap = dvmGetNextRegisterMap(&classMapData);
+                if (dvmGetRegisterMapFormat(pMap) != kRegMapFormatNone) {
+                    newClass->virtualMethods[i].registerMap = pMap;
+                    /* TODO: add rigorous checks */
+                    assert((newClass->virtualMethods[i].registersSize+7) / 8 ==
+                        newClass->virtualMethods[i].registerMap->regWidth);
+                }
+            }
         }
         dvmLinearReadOnly(classLoader, newClass->virtualMethods);
     }
@@ -1913,6 +1963,8 @@ void dvmFreeClassInnards(ClassObject* clazz)
 
 /*
  * Free anything in a Method that was allocated on the system heap.
+ *
+ * The containing class is largely torn down by this point.
  */
 static void freeMethodInnards(Method* meth)
 {
@@ -1920,26 +1972,31 @@ static void freeMethodInnards(Method* meth)
     free(meth->exceptions);
     free(meth->lines);
     free(meth->locals);
-#else
-    // TODO: call dvmFreeRegisterMap() if meth->registerMap was allocated
-    //       on the system heap
-    UNUSED_PARAMETER(meth);
 #endif
+
+    /*
+     * Some register maps are allocated on the heap, either because of late
+     * verification or because we're caching an uncompressed form.
+     */
+    const RegisterMap* pMap = meth->registerMap;
+    if (pMap != NULL && dvmGetRegisterMapOnHeap(pMap)) {
+        dvmFreeRegisterMap((RegisterMap*) pMap);
+        meth->registerMap = NULL;
+    }
 }
 
 /*
  * Clone a Method, making new copies of anything that will be freed up
- * by freeMethodInnards().
+ * by freeMethodInnards().  This is used for "miranda" methods.
  */
 static void cloneMethod(Method* dst, const Method* src)
 {
+    if (src->registerMap != NULL) {
+        LOGE("GLITCH: only expected abstract methods here\n");
+        LOGE("        cloning %s.%s\n", src->clazz->descriptor, src->name);
+        dvmAbort();
+    }
     memcpy(dst, src, sizeof(Method));
-#if 0
-    /* for current usage, these are never set, so no need to implement copy */
-    assert(dst->exceptions == NULL);
-    assert(dst->lines == NULL);
-    assert(dst->locals == NULL);
-#endif
 }
 
 /*
@@ -4270,9 +4327,9 @@ void dvmSetNativeFunc(const Method* method, DalvikBridgeFunc func,
 
 /*
  * Add a RegisterMap to a Method.  This is done when we verify the class
- * and compute the register maps at class initialization time, which means
- * that "pMap" is on the heap and should be freed when the Method is
- * discarded.
+ * and compute the register maps at class initialization time (i.e. when
+ * we don't have a pre-generated map).  This means "pMap" is on the heap
+ * and should be freed when the Method is discarded.
  */
 void dvmSetRegisterMap(Method* method, const RegisterMap* pMap)
 {
@@ -4283,6 +4340,7 @@ void dvmSetRegisterMap(Method* method, const RegisterMap* pMap)
             method->clazz->descriptor, method->name);
         /* keep going */
     }
+    assert(!dvmIsNativeMethod(method) && !dvmIsAbstractMethod(method));
 
     /* might be virtual or direct */
     dvmLinearReadWrite(clazz->classLoader, clazz->virtualMethods);
diff --git a/vm/test/AtomicSpeed.c b/vm/test/AtomicSpeed.c
new file mode 100644 (file)
index 0000000..e2ffbef
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * Copyright (C) 2009 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
+ *
+ *      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
+ * limitations under the License.
+ */
+
+/*
+ * Atomic operation performance test.
+ */
+#include "Dalvik.h"
+
+//#define TRIVIAL_COMPARE     /* do something simple instead of an atomic op */
+
+/*
+ * Perform operation.  Returns elapsed time.
+ */
+u8 dvmTestAtomicSpeedSub(int repeatCount)
+{
+    static int value = 7;
+    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;
+#endif
+
+    assert((repeatCount % 10) == 0);
+
+    start = dvmGetRelativeTimeNsec();
+
+    for (i = repeatCount / 10; i != 0; i--) {
+#ifdef TRIVIAL_COMPARE
+        // integer add (Dream: 3.4ns -- THUMB has 10 adds, ARM condenses)
+        j += i; j += i; j += i; j += i; j += i;
+        j += i; j += i; j += i; j += i; j += i;
+#else
+        // succeed 10x (Dream: 155.9ns)
+        ATOMIC_CMP_SWAP(valuePtr, 7, 7);
+        ATOMIC_CMP_SWAP(valuePtr, 7, 7);
+        ATOMIC_CMP_SWAP(valuePtr, 7, 7);
+        ATOMIC_CMP_SWAP(valuePtr, 7, 7);
+        ATOMIC_CMP_SWAP(valuePtr, 7, 7);
+        ATOMIC_CMP_SWAP(valuePtr, 7, 7);
+        ATOMIC_CMP_SWAP(valuePtr, 7, 7);
+        ATOMIC_CMP_SWAP(valuePtr, 7, 7);
+        ATOMIC_CMP_SWAP(valuePtr, 7, 7);
+        ATOMIC_CMP_SWAP(valuePtr, 7, 7);
+
+        // fail 10x (Dream: 158.5ns)
+        /*
+        ATOMIC_CMP_SWAP(valuePtr, 6, 7);
+        ATOMIC_CMP_SWAP(valuePtr, 6, 7);
+        ATOMIC_CMP_SWAP(valuePtr, 6, 7);
+        ATOMIC_CMP_SWAP(valuePtr, 6, 7);
+        ATOMIC_CMP_SWAP(valuePtr, 6, 7);
+        ATOMIC_CMP_SWAP(valuePtr, 6, 7);
+        ATOMIC_CMP_SWAP(valuePtr, 6, 7);
+        ATOMIC_CMP_SWAP(valuePtr, 6, 7);
+        ATOMIC_CMP_SWAP(valuePtr, 6, 7);
+        ATOMIC_CMP_SWAP(valuePtr, 6, 7);
+        */
+#endif
+    }
+
+    end = dvmGetRelativeTimeNsec();
+
+#ifdef TRIVIAL_COMPARE
+    /* use value so compiler can't eliminate it */
+    dvmFprintf(stdout, "%d\n", j);
+#else
+    dvmFprintf(stdout, ".");
+    fflush(stdout);     // not quite right if they intercepted fprintf
+#endif
+    return end - start;
+}
+
+/*
+ * Control loop.
+ */
+bool dvmTestAtomicSpeed(void)
+{
+    static const int kIterations = 10;
+    static const int kRepeatCount = 5 * 1000 * 1000;
+    static const int kDelay = 500 * 1000;
+    u8 results[kIterations];
+    int i;
+
+    for (i = 0; i < kIterations; i++) {
+        results[i] = dvmTestAtomicSpeedSub(kRepeatCount);
+        usleep(kDelay);
+    }
+
+    dvmFprintf(stdout, "\n");
+    dvmFprintf(stdout, "Atomic speed test results (%d per iteration):\n",
+        kRepeatCount);
+    for (i = 0; i < kIterations; i++) {
+        dvmFprintf(stdout,
+            " %2d: %.3fns\n", i, (double) results[i] / kRepeatCount);
+    }
+
+    return true;
+}
+
index a6b54a5..ce47aae 100644 (file)
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 /*
  * Internal unit tests.
  */
@@ -20,5 +21,6 @@
 #define _DALVIK_TEST_TEST
 
 bool dvmTestHash(void);
+bool dvmTestAtomicSpeed(void);
 
 #endif /*_DALVIK_TEST_TEST*/