Examples of FieldReference


Examples of org.jf.dexlib2.iface.reference.FieldReference

        TypeProto objectRegisterTypeProto = objectRegisterType.type;
        assert objectRegisterTypeProto != null;

        TypeProto classTypeProto = classPath.getClass(objectRegisterTypeProto.getType());
        FieldReference resolvedField = classTypeProto.getFieldByOffset(fieldOffset);

        if (resolvedField == null) {
            throw new AnalysisException("Could not resolve the field in class %s at offset %d",
                    objectRegisterType.type.getType(), fieldOffset);
        }

        ClassDef thisClass = classPath.getClassDef(method.getDefiningClass());

        if (!canAccessClass(thisClass, classPath.getClassDef(resolvedField.getDefiningClass()))) {

            // the class is not accessible. So we start looking at objectRegisterTypeProto (which may be different
            // than resolvedField.getDefiningClass()), and walk up the class hierarchy.
            ClassDef fieldClass = classPath.getClassDef(objectRegisterTypeProto.getType());
            while (!canAccessClass(thisClass, fieldClass)) {
                String superclass = fieldClass.getSuperclass();
                if (superclass == null) {
                    throw new ExceptionWithContext("Couldn't find accessible class while resolving field %s",
                            ReferenceUtil.getShortFieldDescriptor(resolvedField));
                }

                fieldClass = classPath.getClassDef(superclass);
            }

            // fieldClass is now the first accessible class found. Now. we need to make sure that the field is
            // actually valid for this class
            resolvedField = classPath.getClass(fieldClass.getType()).getFieldByOffset(fieldOffset);
            if (resolvedField == null) {
                throw new ExceptionWithContext("Couldn't find accessible class while resolving field %s",
                        ReferenceUtil.getShortFieldDescriptor(resolvedField));
            }
            resolvedField = new ImmutableFieldReference(fieldClass.getType(), resolvedField.getName(),
                    resolvedField.getType());
        }

        String fieldType = resolvedField.getType();

        Opcode opcode = OdexedFieldInstructionMapper.getAndCheckDeodexedOpcodeForOdexedOpcode(fieldType,
                instruction.getOpcode());

        Instruction22c deodexedInstruction = new ImmutableInstruction22c(opcode, (byte)instruction.getRegisterA(),
View Full Code Here

Examples of org.jf.dexlib2.iface.reference.FieldReference

    private boolean analyzePutGetVolatile(@Nonnull AnalyzedInstruction analyzedInstruction) {
        return analyzePutGetVolatile(analyzedInstruction, true);
    }

    private boolean analyzePutGetVolatile(@Nonnull AnalyzedInstruction analyzedInstruction, boolean analyzeResult) {
        FieldReference field = (FieldReference)((ReferenceInstruction)analyzedInstruction.instruction).getReference();
        String fieldType = field.getType();

        Opcode originalOpcode = analyzedInstruction.instruction.getOpcode();

        Opcode opcode = OdexedFieldInstructionMapper.getAndCheckDeodexedOpcodeForOdexedOpcode(fieldType,
                originalOpcode);
View Full Code Here

Examples of org.springframework.data.mongodb.core.aggregation.ExposedFields.FieldReference

    BasicDBObject object = new BasicDBObject();

    for (Order order : sort) {

      // Check reference
      FieldReference reference = context.getReference(order.getProperty());
      object.put(reference.getRaw(), order.isAscending() ? 1 : -1);
    }

    return new BasicDBObject("$sort", object);
  }
View Full Code Here

Examples of org.teavm.model.FieldReference

            case "currentTimeMillis":
                generateCurrentTimeMillis(writer);
                break;
            case "setOut":
                writer.appendClass("java.lang.System").append('.')
                        .appendField(new FieldReference("java.lang.System", "out"))
                        .ws().append('=').ws().append(context.getParameterName(1)).append(";").softNewLine();
                break;
            case "setErr":
                writer.appendClass("java.lang.System").append('.')
                        .appendField(new FieldReference("java.lang.System", "err"))
                        .ws().append('=').ws().append(context.getParameterName(1)).append(";").softNewLine();
                break;
            case "identityHashCode":
                writer.append("return ").append(context.getParameterName(1)).append(".$id;").softNewLine();
                break;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.