diff options
author | mikaelpeltier <mikaelpeltier@google.com> | 2014-04-18 07:24:25 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-04-18 07:24:25 +0000 |
commit | 0b7c2e2210325a10d83de6c926c76d2530571c22 (patch) | |
tree | cb0c2ee742104842e384e84539c52e3651618e71 /dx/src | |
parent | 1c450ffbba55dc23f3971ae42292943ff9a68ae6 (diff) | |
parent | ef3644eadcdb00435fedad8ca2f81c08851d9649 (diff) | |
download | toolchain_jack-0b7c2e2210325a10d83de6c926c76d2530571c22.tar.gz toolchain_jack-0b7c2e2210325a10d83de6c926c76d2530571c22.tar.bz2 toolchain_jack-0b7c2e2210325a10d83de6c926c76d2530571c22.zip |
Merge "Suppress warnings in package com/android/jack/dx/dex/" into jack-wip-dev
Diffstat (limited to 'dx/src')
12 files changed, 18 insertions, 49 deletions
diff --git a/dx/src/com/android/jack/dx/dex/TableOfContents.java b/dx/src/com/android/jack/dx/dex/TableOfContents.java index 40f6e986..408dd298 100644 --- a/dx/src/com/android/jack/dx/dex/TableOfContents.java +++ b/dx/src/com/android/jack/dx/dex/TableOfContents.java @@ -20,7 +20,6 @@ import com.android.jack.dx.io.DexBuffer; import com.android.jack.dx.util.DexException; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.util.Arrays; /** @@ -81,13 +80,13 @@ public final class TableOfContents { signature = new byte[20]; } - public void readFrom(DexBuffer buffer) throws IOException { + public void readFrom(DexBuffer buffer) { readHeader(buffer.open(0)); readMap(buffer.open(mapList.off)); computeSizesFromOffsets(); } - private void readHeader(DexBuffer.Section headerIn) throws UnsupportedEncodingException { + private void readHeader(DexBuffer.Section headerIn) { byte[] magic = headerIn.readByteArray(8); int apiTarget = DexFormat.magicToApi(magic); @@ -128,7 +127,7 @@ public final class TableOfContents { dataOff = headerIn.readInt(); } - private void readMap(DexBuffer.Section in) throws IOException { + private void readMap(DexBuffer.Section in) { int mapSize = in.readInt(); Section previous = null; for (int i = 0; i < mapSize; i++) { @@ -205,7 +204,7 @@ public final class TableOfContents { out.writeInt(dataOff); } - public void writeMap(DexBuffer.Section out) throws IOException { + public void writeMap(DexBuffer.Section out) { int count = 0; for (Section section : sections) { if (section.exists()) { diff --git a/dx/src/com/android/jack/dx/dex/code/PositionList.java b/dx/src/com/android/jack/dx/dex/code/PositionList.java index 9b4eedb0..3869b6e5 100644 --- a/dx/src/com/android/jack/dx/dex/code/PositionList.java +++ b/dx/src/com/android/jack/dx/dex/code/PositionList.java @@ -81,7 +81,7 @@ public final class PositionList extends FixedSizeList { DalvInsn insn = insns.get(i); if (insn instanceof CodeAddress) { - lastWasTarget = true;; + lastWasTarget = true; continue; } diff --git a/dx/src/com/android/jack/dx/dex/code/RopTranslator.java b/dx/src/com/android/jack/dx/dex/code/RopTranslator.java index 93991175..435cbf53 100644 --- a/dx/src/com/android/jack/dx/dex/code/RopTranslator.java +++ b/dx/src/com/android/jack/dx/dex/code/RopTranslator.java @@ -155,9 +155,9 @@ public final class RopTranslator { this.output = new OutputCollector(dexOptions, maxInsns, bsz * 3, regCount, paramSize); if (locals != null) { - this.translationVisitor = new LocalVariableAwareTranslationVisitor(output, locals); + this.translationVisitor = new LocalVariableAwareTranslationVisitor(); } else { - this.translationVisitor = new TranslationVisitor(output); + this.translationVisitor = new TranslationVisitor(); } } @@ -475,9 +475,6 @@ regs = RegisterSpecList.make(regs.get(1), regs.get(0)); * Instruction visitor class for doing the instruction translation per se. */ private class TranslationVisitor implements Insn.Visitor { - /** {@code non-null;} list of output instructions in-progress */ - private final OutputCollector output; - /** {@code non-null;} basic block being worked on */ private BasicBlock block; @@ -488,15 +485,6 @@ regs = RegisterSpecList.make(regs.get(1), regs.get(0)); private CodeAddress lastAddress; /** - * Constructs an instance. - * - * @param output {@code non-null;} destination for instruction output - */ - public TranslationVisitor(OutputCollector output) { - this.output = output; - } - - /** * Sets the block currently being worked on. * * @param block {@code non-null;} the block @@ -782,19 +770,6 @@ RegisterSpec dest = insn.getResult(); * local variable tracking */ private class LocalVariableAwareTranslationVisitor extends TranslationVisitor { - /** {@code non-null;} local variable info */ - private LocalVariableInfo locals; - - /** - * Constructs an instance. - * - * @param output {@code non-null;} destination for instruction output - * @param locals {@code non-null;} the local variable info - */ - public LocalVariableAwareTranslationVisitor(OutputCollector output, LocalVariableInfo locals) { - super(output); - this.locals = locals; - } /** {@inheritDoc} */ @Override diff --git a/dx/src/com/android/jack/dx/dex/code/StdCatchBuilder.java b/dx/src/com/android/jack/dx/dex/code/StdCatchBuilder.java index 04c6e0b3..07c63c37 100644 --- a/dx/src/com/android/jack/dx/dex/code/StdCatchBuilder.java +++ b/dx/src/com/android/jack/dx/dex/code/StdCatchBuilder.java @@ -256,7 +256,7 @@ public final class StdCatchBuilder implements CatchBuilder { } /** - * Makes a {@link CatchTable#Entry} for the given block range and + * Makes a {@link CatchTable.Entry} for the given block range and * handlers. * * @param start {@code non-null;} the start block for the range (inclusive) diff --git a/dx/src/com/android/jack/dx/dex/file/AnnotationItem.java b/dx/src/com/android/jack/dx/dex/file/AnnotationItem.java index c7394c91..e11264cb 100644 --- a/dx/src/com/android/jack/dx/dex/file/AnnotationItem.java +++ b/dx/src/com/android/jack/dx/dex/file/AnnotationItem.java @@ -44,7 +44,7 @@ public final class AnnotationItem extends OffsettedItem { /** the required alignment for instances of this class */ private static final int ALIGNMENT = 1; - /** {@code non-null;} unique instance of {@link #TypeIdSorter} */ + /** {@code non-null;} unique instance of {@link TypeIdSorter} */ private static final TypeIdSorter TYPE_ID_SORTER = new TypeIdSorter(); /** {@code non-null;} the annotation to represent */ diff --git a/dx/src/com/android/jack/dx/dex/file/FieldAnnotationStruct.java b/dx/src/com/android/jack/dx/dex/file/FieldAnnotationStruct.java index afe4c56a..23fb729b 100644 --- a/dx/src/com/android/jack/dx/dex/file/FieldAnnotationStruct.java +++ b/dx/src/com/android/jack/dx/dex/file/FieldAnnotationStruct.java @@ -73,7 +73,6 @@ public final class FieldAnnotationStruct implements ToHuman, Comparable<FieldAnn return field.compareTo(other.field); } - /** {@inheritDoc} */ public void addContents(DexFile file) { FieldIdsSection fieldIds = file.getFieldIds(); MixedItemSection wordData = file.getWordData(); @@ -82,7 +81,6 @@ public final class FieldAnnotationStruct implements ToHuman, Comparable<FieldAnn annotations = wordData.intern(annotations); } - /** {@inheritDoc} */ public void writeTo(DexFile file, AnnotatedOutput out) { int fieldIdx = file.getFieldIds().indexOf(field); int annotationsOff = annotations.getAbsoluteOffset(); diff --git a/dx/src/com/android/jack/dx/dex/file/ImportedCodeItem.java b/dx/src/com/android/jack/dx/dex/file/ImportedCodeItem.java index 09d368b7..caf79f53 100644 --- a/dx/src/com/android/jack/dx/dex/file/ImportedCodeItem.java +++ b/dx/src/com/android/jack/dx/dex/file/ImportedCodeItem.java @@ -23,6 +23,7 @@ import com.android.jack.dx.io.CodeReader; import com.android.jack.dx.io.Opcodes; import com.android.jack.dx.io.instructions.DecodedInstruction; import com.android.jack.dx.io.instructions.ShortArrayCodeOutput; +import com.android.jack.dx.rop.cst.Constant; import com.android.jack.dx.rop.cst.CstIndexMap; import com.android.jack.dx.rop.cst.CstMethodRef; import com.android.jack.dx.util.AnnotatedOutput; @@ -327,7 +328,7 @@ public final class ImportedCodeItem extends OffsettedItem implements } /** - * {@link CodeReader.Visitor} remapping instructions using string index. + * {@link com.android.jack.dx.io.CodeReader.Visitor} remapping instructions using string index. */ private class StringRemapper implements CodeReader.Visitor { @@ -351,7 +352,7 @@ public final class ImportedCodeItem extends OffsettedItem implements } /** - * {@link CodeReader.Visitor} remapping instructions using field index. + * {@link com.android.jack.dx.io.CodeReader.Visitor} remapping instructions using field index. */ private class FieldRemapper implements CodeReader.Visitor { @@ -369,7 +370,7 @@ public final class ImportedCodeItem extends OffsettedItem implements } /** - * {@link CodeReader.Visitor} remapping instructions using type index. + * {@link com.android.jack.dx.io.CodeReader.Visitor} remapping instructions using type index. */ private class TypeRemapper implements CodeReader.Visitor { @@ -387,7 +388,7 @@ public final class ImportedCodeItem extends OffsettedItem implements } /** - * {@link CodeReader.Visitor} remapping instructions using method index. + * {@link com.android.jack.dx.io.CodeReader.Visitor} remapping instructions using method index. */ private class MethodRemapper implements CodeReader.Visitor { diff --git a/dx/src/com/android/jack/dx/dex/file/ImportedDebugInfoItem.java b/dx/src/com/android/jack/dx/dex/file/ImportedDebugInfoItem.java index 4219ebbd..d787c852 100644 --- a/dx/src/com/android/jack/dx/dex/file/ImportedDebugInfoItem.java +++ b/dx/src/com/android/jack/dx/dex/file/ImportedDebugInfoItem.java @@ -28,6 +28,7 @@ import static com.android.jack.dx.dex.file.DebugInfoConstants.DBG_START_LOCAL; import static com.android.jack.dx.dex.file.DebugInfoConstants.DBG_START_LOCAL_EXTENDED; import com.android.jack.dx.io.DexBuffer; +import com.android.jack.dx.rop.cst.Constant; import com.android.jack.dx.rop.cst.CstIndexMap; import com.android.jack.dx.util.AnnotatedOutput; diff --git a/dx/src/com/android/jack/dx/dex/file/MethodAnnotationStruct.java b/dx/src/com/android/jack/dx/dex/file/MethodAnnotationStruct.java index a12fa0f1..a01882f5 100644 --- a/dx/src/com/android/jack/dx/dex/file/MethodAnnotationStruct.java +++ b/dx/src/com/android/jack/dx/dex/file/MethodAnnotationStruct.java @@ -73,7 +73,6 @@ public final class MethodAnnotationStruct implements ToHuman, Comparable<MethodA return method.compareTo(other.method); } - /** {@inheritDoc} */ public void addContents(DexFile file) { MethodIdsSection methodIds = file.getMethodIds(); MixedItemSection wordData = file.getWordData(); @@ -82,7 +81,6 @@ public final class MethodAnnotationStruct implements ToHuman, Comparable<MethodA annotations = wordData.intern(annotations); } - /** {@inheritDoc} */ public void writeTo(DexFile file, AnnotatedOutput out) { int methodIdx = file.getMethodIds().indexOf(method); int annotationsOff = annotations.getAbsoluteOffset(); diff --git a/dx/src/com/android/jack/dx/dex/file/MixedItemSection.java b/dx/src/com/android/jack/dx/dex/file/MixedItemSection.java index ad45a50f..68909b14 100644 --- a/dx/src/com/android/jack/dx/dex/file/MixedItemSection.java +++ b/dx/src/com/android/jack/dx/dex/file/MixedItemSection.java @@ -47,8 +47,8 @@ public final class MixedItemSection extends Section { TYPE, /** sort in class-major order, with instances sorted per-class */ - INSTANCE; - }; + INSTANCE + } /** {@code non-null;} sorter which sorts instances by type */ private static final Comparator<OffsettedItem> TYPE_SORTER = new Comparator<OffsettedItem>() { diff --git a/dx/src/com/android/jack/dx/dex/file/ParameterAnnotationStruct.java b/dx/src/com/android/jack/dx/dex/file/ParameterAnnotationStruct.java index c8ad2289..da4ebc9a 100644 --- a/dx/src/com/android/jack/dx/dex/file/ParameterAnnotationStruct.java +++ b/dx/src/com/android/jack/dx/dex/file/ParameterAnnotationStruct.java @@ -97,7 +97,6 @@ int size = annotationsList.size(); return method.compareTo(other.method); } - /** {@inheritDoc} */ public void addContents(DexFile file) { MethodIdsSection methodIds = file.getMethodIds(); MixedItemSection wordData = file.getWordData(); @@ -106,7 +105,6 @@ int size = annotationsList.size(); wordData.add(annotationsItem); } - /** {@inheritDoc} */ public void writeTo(DexFile file, AnnotatedOutput out) { int methodIdx = file.getMethodIds().indexOf(method); int annotationsOff = annotationsItem.getAbsoluteOffset(); diff --git a/dx/src/com/android/jack/dx/dex/file/StringIdItem.java b/dx/src/com/android/jack/dx/dex/file/StringIdItem.java index 5d2e74a4..c42f2645 100644 --- a/dx/src/com/android/jack/dx/dex/file/StringIdItem.java +++ b/dx/src/com/android/jack/dx/dex/file/StringIdItem.java @@ -65,8 +65,7 @@ public final class StringIdItem extends IndexedItem implements Comparable<String /** {@inheritDoc} */ @Override public int compareTo(StringIdItem other) { - StringIdItem otherString = (StringIdItem) other; - return value.compareTo(otherString.value); + return value.compareTo(other.value); } /** {@inheritDoc} */ |