All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.netflix.nebula.lint.rule.dependency.MethodReference.groovy Maven / Gradle / Ivy

Go to download

Pluggable and configurable linter tool for identifying and reporting on patterns of misuse or deprecations in Gradle scripts

There is a newer version: 20.5.5
Show newest version
package com.netflix.nebula.lint.rule.dependency

import groovy.transform.CompileStatic


@CompileStatic
class MethodReference {
    String methodName
    String owner
    String methodDesc
    int line
    boolean isInterface
    OpCode opCode
    Collection artifacts

    MethodReference(String methodName, String owner, String methodDesc, int line, boolean isInterface, int code, Collection artifacts) {
        this.methodName = methodName
        this.owner = owner
        this.methodDesc = methodDesc
        this.line = line
        this.isInterface = isInterface
        this.opCode = OpCode.findByCode(code)
        this.artifacts = artifacts
    }

    @Override
    String toString() {
        return "methodName: $methodName - owner: $owner - methodDesc: $methodDesc - line: $line - isInterface: $isInterface - opCode: ${opCode.name()}"
    }

    enum OpCode {
        INVOKEVIRTUAL(182),
        INVOKESPECIAL(183),
        INVOKESTATIC(184),
        INVOKEINTERFACE(185),
        INVOKEDYNAMIC(186)

        int code

        OpCode(int code) {
            this.code = code
        }

        static OpCode findByCode(int code) {
            values().find { it.code == code }
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy