@Nullable public MapItem getMapItemForSection(int itemType) { for (MapItem mapItem: getMapItems()) { if (mapItem.getType() == itemType) { return mapItem; } } return null; }
public void writeAnnotations(Writer out) throws IOException { List<MapItem> mapItems = dexFile.getMapItems(); // sort the map items based on the order defined by sectionAnnotationOrder Ordering<MapItem> ordering = Ordering.from(new Comparator<MapItem>() { @Override public int compare(MapItem o1, MapItem o2) { return Ints.compare(sectionAnnotationOrder.get(o1.getType()), sectionAnnotationOrder.get(o2.getType())); } }); mapItems = ordering.immutableSortedCopy(mapItems); try { for (MapItem mapItem: mapItems) { SectionAnnotator annotator = annotators.get(mapItem.getType()); annotator.annotateSection(this); } } finally { dexFile.writeAnnotations(out, this); } }
public void writeAnnotations(Writer out) throws IOException { List<MapItem> mapItems = dexFile.getMapItems(); // sort the map items based on the order defined by sectionAnnotationOrder Ordering<MapItem> ordering = Ordering.from(new Comparator<MapItem>() { @Override public int compare(MapItem o1, MapItem o2) { return Ints.compare(sectionAnnotationOrder.get(o1.getType()), sectionAnnotationOrder.get(o2.getType())); } }); mapItems = ordering.immutableSortedCopy(mapItems); try { for (MapItem mapItem: mapItems) { SectionAnnotator annotator = annotators.get(mapItem.getType()); annotator.annotateSection(this); } } finally { dexFile.writeAnnotations(out, this); } }
public void writeAnnotations(Writer out) throws IOException { List<MapItem> mapItems = dexFile.getMapItems(); // sort the map items based on the order defined by sectionAnnotationOrder Ordering<MapItem> ordering = Ordering.from(new Comparator<MapItem>() { @Override public int compare(MapItem o1, MapItem o2) { return Ints.compare(sectionAnnotationOrder.get(o1.getType()), sectionAnnotationOrder.get(o2.getType())); } }); mapItems = ordering.immutableSortedCopy(mapItems); try { for (MapItem mapItem: mapItems) { SectionAnnotator annotator = annotators.get(mapItem.getType()); annotator.annotateSection(this); } } finally { dexFile.writeAnnotations(out, this); } }
for (MapItem mapItem: dexFile.getMapItems()) { switch (mapItem.getType()) { case ItemType.HEADER_ITEM:
for (MapItem mapItem: dexFile.getMapItems()) { switch (mapItem.getType()) { case ItemType.HEADER_ITEM:
for (MapItem mapItem: dexFile.getMapItems()) { switch (mapItem.getType()) { case ItemType.HEADER_ITEM:
List<MapItem> mapItems1 = dexFile1.getMapItems(); List<MapItem> mapItems2 = dexFile2.getMapItems(); for (int i=0; i<mapItems1.size(); i++) { Assert.assertEquals(mapItems1.get(i).getType(), mapItems2.get(i).getType());