Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 1.59 KB

limitations.md

File metadata and controls

39 lines (28 loc) · 1.59 KB

Decycle

Decycle

Limitations

Decycle works on the compiled classes by inspecting the bytecode using ASM. This results in a few limitations:

Dependencies on constants for simple types are not reported

Constants (public static final attributes) that are declared and initialized with a value of a primitive type or a String are not reported as dependency. This happens since the compiler is inlining those values, so the dependency is not present in the bytecode anymore.

In theory this could be prevented by assigning the constants in a static initializer block, or by computing the constant value from a method call - however, this would result in rather ugly and unnecessarily complicated source code.

// usages will be inlined by the compiler
public static final String X = "inlined constant";
// usages of Y and Z will not be inlined by the compiler
public static final String Y;

static {
    Y = "assigned constant";
}

public static final String Z = "computed constant".toString();

Dependencies on annotations with retention policy SOURCE are not reported

Annotations with @Retention(RetentionPolicy.SOURCE) will be discarded by the compiler, so they are not visible to ASM and Decycle. Moreover, annotations on local variables or lambda parameters will never be retained in the bytecode. See Retention in the Java Language Specification.