Skip to content

Files

Latest commit

 

History

History
23 lines (16 loc) · 618 Bytes

JenkinsForbiddenCallInCpsMethod.md

File metadata and controls

23 lines (16 loc) · 618 Bytes

Pattern: Forbidden call in CPS method

Issue: -

Description

Some methods from the standard library cannot be CPS transformed and therefore must not be called with CPS transformed closure arguments.

Examples

void cpsMethod() {
    List l = [4,1,3]
    l.sort { a, b -> a > b } // Violation
    l.toSorted { a, b -> a > b } // Violation
    "hello".eachLine { l, n -> println(l) } // Violation
    "hello".eachLine(2) { l, n -> println(l) } // Violation
}

Further Reading