
■ Contents
xvi
■Chapter 18: Streams API Updates ��������������������������������������������������������������������� 429
New Stream Operations ����������������������������������������������������������������������������������������������� 429
New Collectors ������������������������������������������������������������������������������������������������������������� 433
Summary ���������������������������������������������������������������������������������������������������������������������� 439
■Chapter 19: Platform and JVM Logging ������������������������������������������������������������� 441
Platform Logging API ���������������������������������������������������������������������������������������������������� 441
Setting up Log4j Libraries �������������������������������������������������������������������������������������������������������������������442
Setting Up a NetBeans Project ����������������������������������������������������������������������������������������������������������� 442
Defining a Module ������������������������������������������������������������������������������������������������������������������������������� 443
Adding a Log4j Configuration File �������������������������������������������������������������������������������������������������������444
Creating a System Logger ������������������������������������������������������������������������������������������������������������������445
Creating a Logger Finder �������������������������������������������������������������������������������������������������������������������� 447
Testing the Platform Logger ��������������������������������������������������������������������������������������������������������������� 448
Unified JVM Logging ���������������������������������������������������������������������������������������������������� 452
Message Tags ������������������������������������������������������������������������������������������������������������������������������������� 453
Message Levels ���������������������������������������������������������������������������������������������������������������������������������� 454
Message Decorations �������������������������������������������������������������������������������������������������������������������������454
Message Output Destination �������������������������������������������������������������������������������������������������������������� 455
The -Xlog Syntax �������������������������������������������������������������������������������������������������������������������������������� 455
Summary ���������������������������������������������������������������������������������������������������������������������� 459
■Chapter 20: Other Changes in JDK 9 ����������������������������������������������������������������� 461
The Underscore Is a Keyword ��������������������������������������������������������������������������������������� 462
Improved try-with-resources Blocks ���������������������������������������������������������������������������� 463
Diamond Operator in Anonymous Classes ������������������������������������������������������������������� 468
Private Methods in Interfaces �������������������������������������������������������������������������������������� 470
@SafeVarargs on Private Methods ������������������������������������������������������������������������������� 472
Discarding Process Outputs ����������������������������������������������������������������������������������������� 474
New Methods in the StrictMath Class �������������������������������������������������������������������������� 475
Changes to the ClassLoader Class ������������������������������������������������������������������������������� 478