fieldAnnotations++; tempBuffer.putInt(fieldSection.getFieldIndex(field)); tempBuffer.putInt(annotationSetSection.getItemOffset(fieldAnnotationsKey)); methodAnnotations++; tempBuffer.putInt(methodSection.getMethodIndex(method)); tempBuffer.putInt(annotationSetSection.getItemOffset(methodAnnotationsKey));
for (AnnotationSetKey annotationSetKey: parameterAnnotations) { if (annotationSetSection.getAnnotations(annotationSetKey).size() > 0) { writer.writeInt(annotationSetSection.getItemOffset(annotationSetKey)); } else if (shouldCreateEmptyAnnotationSet()) { writer.writeInt(annotationSetSectionOffset);
fieldAnnotations++; tempBuffer.putInt(fieldSection.getFieldIndex(field)); tempBuffer.putInt(annotationSetSection.getItemOffset(fieldAnnotationsKey)); methodAnnotations++; tempBuffer.putInt(methodSection.getMethodIndex(method)); tempBuffer.putInt(annotationSetSection.getItemOffset(methodAnnotationsKey));
fieldAnnotations++; tempBuffer.putInt(fieldSection.getFieldIndex(field)); tempBuffer.putInt(annotationSetSection.getItemOffset(fieldAnnotationsKey)); methodAnnotations++; tempBuffer.putInt(methodSection.getMethodIndex(method)); tempBuffer.putInt(annotationSetSection.getItemOffset(methodAnnotationsKey));
private void writeAnnotationSetRefs(@Nonnull DexDataWriter writer) throws IOException { writer.align(); annotationSetRefSectionOffset = writer.getPosition(); HashMap<List<? extends AnnotationSetKey>, Integer> internedItems = Maps.newHashMap(); for (ClassKey classKey: classSection.getSortedClasses()) { for (MethodKey methodKey: classSection.getSortedMethods(classKey)) { List<? extends AnnotationSetKey> parameterAnnotations = classSection.getParameterAnnotations(methodKey); if (parameterAnnotations != null) { Integer prev = internedItems.get(parameterAnnotations); if (prev != null) { classSection.setAnnotationSetRefListOffset(methodKey, prev); } else { writer.align(); int position = writer.getPosition(); classSection.setAnnotationSetRefListOffset(methodKey, position); internedItems.put(parameterAnnotations, position); numAnnotationSetRefItems++; writer.writeInt(parameterAnnotations.size()); for (AnnotationSetKey annotationSetKey: parameterAnnotations) { if (annotationSetSection.getAnnotations(annotationSetKey).size() > 0) { writer.writeInt(annotationSetSection.getItemOffset(annotationSetKey)); } else { writer.writeInt(NO_OFFSET); } } } } } } }
for (AnnotationSetKey annotationSetKey: parameterAnnotations) { if (annotationSetSection.getAnnotations(annotationSetKey).size() > 0) { writer.writeInt(annotationSetSection.getItemOffset(annotationSetKey)); } else if (shouldCreateEmptyAnnotationSet()) { writer.writeInt(annotationSetSectionOffset);