langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Operators.java
changeset 42827 36468b5fa7f4
parent 39920 4923274643f2
equal deleted inserted replaced
42826:563b42fc70ba 42827:36468b5fa7f4
   294          * This routine performs lazy instantiation of the operator symbols supported by this helper.
   294          * This routine performs lazy instantiation of the operator symbols supported by this helper.
   295          * After initialization is done, the suppliers are cleared, to free up memory.
   295          * After initialization is done, the suppliers are cleared, to free up memory.
   296          */
   296          */
   297         private OperatorSymbol[] initOperators() {
   297         private OperatorSymbol[] initOperators() {
   298             OperatorSymbol[] operators = operatorSuppliers.stream()
   298             OperatorSymbol[] operators = operatorSuppliers.stream()
   299                     .map(op -> op.get())
   299                     .map(Supplier::get)
   300                     .toArray(OperatorSymbol[]::new);
   300                     .toArray(OperatorSymbol[]::new);
   301             alternatives = Optional.of(operators);
   301             alternatives = Optional.of(operators);
   302             operatorSuppliers = null; //let GC do its work
   302             operatorSuppliers = null; //let GC do its work
   303             return operators;
   303             return operators;
   304         }
   304         }