[java] move "$Lambda$" string to Config.ml

Summary: Simple cleanup.

Reviewed By: ngorogiannis

Differential Revision: D19973284

fbshipit-source-id: b71503285
master
Jules Villard 5 years ago committed by Facebook Github Bot
parent 2047f4c535
commit 0abc85c352

@ -104,7 +104,7 @@ module InlineJavaSyntheticMethods = struct
let process pdesc =
let is_generated_for_lambda proc_name =
String.is_substring ~substring:"$Lambda$" (Procname.get_method proc_name)
String.is_substring ~substring:Config.java_lambda_marker_infix (Procname.get_method proc_name)
in
let should_inline proc_name =
(not (is_generated_for_lambda proc_name))

@ -198,6 +198,8 @@ let infer_py_argparse_error_exit_code = 22
let ivar_attributes = "ivar_attributes"
let java_lambda_marker_infix = "$Lambda$"
let lint_dotty_dir_name = "lint_dotty"
let lint_issues_dir_name = "lint_issues"

@ -99,6 +99,9 @@ val initial_analysis_time : float
val ivar_attributes : string
val java_lambda_marker_infix : string
(** marker to recognize methods generated by javalib to eliminate lambdas *)
val lib_dir : string
val lint_dotty_dir_name : string

@ -255,12 +255,9 @@ let get_classpath_channel program = program.classpath.channel
let get_models program = program.models
(* this string should characterize the methods we generate for lambda rewriting *)
let lambda_str = "$Lambda$"
let add_class cn jclass program =
(* [prefix] must be a fresh class name *)
let prefix = JBasics.cn_name cn ^ lambda_str in
let prefix = JBasics.cn_name cn ^ Config.java_lambda_marker_infix in
(* we rewrite each class to replace invokedynamic (closure construction)
with equivalent old-style Java code that implements a suitable Java interface *)
let rewritten_jclass, new_classes = Javalib.remove_invokedynamics jclass ~prefix in

Loading…
Cancel
Save