Java Code Examples for proguard.classfile.constant.RefConstant#referencedMemberAccept()

The following examples show how to use proguard.classfile.constant.RefConstant#referencedMemberAccept() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UsageMarker.java    From java-n-IDE-for-Android with Apache License 2.0 6 votes vote down vote up
public void visitAnyRefConstant(Clazz clazz, RefConstant refConstant)
{
    if (shouldBeMarkedAsUsed(refConstant))
    {
        markAsUsed(refConstant);

        markConstant(clazz, refConstant.u2classIndex);
        markConstant(clazz, refConstant.u2nameAndTypeIndex);

        // When compiled with "-target 1.2" or higher, the class or
        // interface actually containing the referenced class member may
        // be higher up the hierarchy. Make sure it's marked, in case it
        // isn't used elsewhere.
        refConstant.referencedClassAccept(this);

        // Mark the referenced class member itself.
        refConstant.referencedMemberAccept(this);
    }
}
 
Example 2
Source File: BasicInvocationUnit.java    From java-n-IDE-for-Android with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the class though which the specified field is accessed.
 */
protected Value getFieldClassValue(Clazz       clazz,
                                   RefConstant refConstant,
                                   String      type)
{
    // Try to figure out the class of the return type.
    returnTypeClass = null;
    refConstant.referencedMemberAccept(this);

    return valueFactory.createValue(type,
                                    returnTypeClass,
                                    true);
}
 
Example 3
Source File: BasicInvocationUnit.java    From java-n-IDE-for-Android with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the value of the specified field.
 */
protected Value getFieldValue(Clazz       clazz,
                              RefConstant refConstant,
                              String      type)
{
    // Try to figure out the class of the return type.
    returnTypeClass = null;
    refConstant.referencedMemberAccept(this);

    return valueFactory.createValue(type,
                                    returnTypeClass,
                                    true);
}
 
Example 4
Source File: BasicInvocationUnit.java    From java-n-IDE-for-Android with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the return value of the specified method.
 */
protected Value getMethodReturnValue(Clazz       clazz,
                                     RefConstant refConstant,
                                     String      type)
{
    // Try to figure out the class of the return type.
    returnTypeClass = null;
    refConstant.referencedMemberAccept(this);

    return valueFactory.createValue(type,
                                    returnTypeClass,
                                    true);
}
 
Example 5
Source File: AccessFixer.java    From java-n-IDE-for-Android with Apache License 2.0 5 votes vote down vote up
public void visitAnyRefConstant(Clazz clazz, RefConstant refConstant)
{
    referencingClass = clazz;

    // Remember the specified class, since it might be different from
    // the referenced class that actually contains the class member.
    clazz.constantPoolEntryAccept(refConstant.u2classIndex, referencedClassFinder);

    // Make sure the access flags of the referenced class member are
    // acceptable.
    refConstant.referencedMemberAccept(this);
}
 
Example 6
Source File: AccessMethodMarker.java    From java-n-IDE-for-Android with Apache License 2.0 5 votes vote down vote up
public void visitAnyRefConstant(Clazz clazz, RefConstant refConstant)
{
    // Check the referenced class.
    clazz.constantPoolEntryAccept(refConstant.u2classIndex, this);

    // Check the referenced class member itself.
    refConstant.referencedClassAccept(this);
    refConstant.referencedMemberAccept(this);
}
 
Example 7
Source File: PackageVisibleMemberInvokingClassMarker.java    From java-n-IDE-for-Android with Apache License 2.0 5 votes vote down vote up
public void visitAnyRefConstant(Clazz clazz, RefConstant refConstant)
{
    // Check the referenced class and class member.
    if (refConstant.referencedClass != clazz)
    {
        referencingClass = clazz;

        refConstant.referencedClassAccept(this);
        refConstant.referencedMemberAccept(this);
    }
}
 
Example 8
Source File: SideEffectInstructionChecker.java    From java-n-IDE-for-Android with Apache License 2.0 5 votes vote down vote up
public void visitAnyMethodrefConstant(Clazz clazz, RefConstant refConstant)
{
    // Pass the referencing class.
    referencingClass = clazz;

    // We'll have to assume invoking an unknown method has side effects.
    hasSideEffects = true;

    // Check the referenced method, if known.
    refConstant.referencedMemberAccept(this);
}
 
Example 9
Source File: NonPrivateMemberMarker.java    From java-n-IDE-for-Android with Apache License 2.0 5 votes vote down vote up
public void visitAnyRefConstant(Clazz clazz, RefConstant refConstant)
{
    Clazz referencedClass = refConstant.referencedClass;

    // Is it referring to a class member in another class?
    // The class member might be in another class, or
    // it may be referenced through another class.
    if (referencedClass != null &&
        !referencedClass.equals(clazz) ||
        !refConstant.getClassName(clazz).equals(clazz.getName()))
    {
        // The referenced class member can never be made private.
        refConstant.referencedMemberAccept(this);
    }
}
 
Example 10
Source File: EvaluationShrinker.java    From proguard with GNU General Public License v2.0 4 votes vote down vote up
public void visitAnyRefConstant(Clazz clazz, RefConstant refConstant)
{
    refConstant.referencedMemberAccept(this);
}
 
Example 11
Source File: ReferencedMemberVisitor.java    From java-n-IDE-for-Android with Apache License 2.0 4 votes vote down vote up
public void visitAnyRefConstant(Clazz clazz, RefConstant refConstant)
{
    refConstant.referencedMemberAccept(memberVisitor);
}
 
Example 12
Source File: MethodInvocationMarker.java    From java-n-IDE-for-Android with Apache License 2.0 4 votes vote down vote up
public void visitAnyMethodrefConstant(Clazz clazz, RefConstant refConstant)
{
    // Mark the referenced method.
    refConstant.referencedMemberAccept(this);
}
 
Example 13
Source File: EvaluationShrinker.java    From java-n-IDE-for-Android with Apache License 2.0 4 votes vote down vote up
public void visitAnyRefConstant(Clazz clazz, RefConstant refConstant)
{
    refConstant.referencedMemberAccept(this);
}
 
Example 14
Source File: EvaluationShrinker.java    From proguard with GNU General Public License v2.0 4 votes vote down vote up
public void visitAnyRefConstant(Clazz clazz, RefConstant refConstant)
{
    refConstant.referencedMemberAccept(this);
}
 
Example 15
Source File: EvaluationShrinker.java    From bazel with Apache License 2.0 4 votes vote down vote up
public void visitAnyRefConstant(Clazz clazz, RefConstant refConstant)
{
    refConstant.referencedMemberAccept(this);
}