Converts java detector to C++