JDK8新特性
JDK8共更新55个新特性。部分重要特性会在后续的文章中单独介绍。特性列表如下
--/--
126 Lambda Expressions & Virtual Extension Methods
Add lambda expressions (closures) and supporting features, including method references, enhanced type inference, and virtual extension methods, to the Java programming language and platform.
126 Lambda 表达式和虚拟扩展方法
添加Lambda表达式(闭包)和一些新特性到 Java 编程语言和平台, 包括方法引用、增强类型推理和虚拟扩展方法。
138 Autoconf-Based Build System
Introduce autoconf (./configure
-style) build setup, refactor the Makefiles to remove recursion, and leverage JEP 139: Enhance javac to Improve Build Speed.
138 基于 Autoconf 的构建系统
引入 autoconf( ./configure
-style)构建设置,重构 Makefile 以删除递归,并利用 JEP 139:增强 javac 以提高构建速度。
160 Lambda-Form Representation for Method Handles
Improve the implementation of method handles by replacing assembly language paths with an optimizable intermediate representation and then refactoring the implementation so that more work is done in portable Java code than is hardwired into the JVM.
160 方法句柄的 Lambda 形式表示
通过将汇编语言路径替换为可优化的中间表示形式,然后重构实现,从而改进方法句柄的实现,以便在可移植的 Java 代码中完成比硬连线到 JVM 中更多的工作。
161 Compact Profiles
Define a few subset Profiles of the Java SE Platform Specification so that applications that do not require the entire Platform can be deployed and run on small devices.
JEP 161: 紧凑型配置文件
定义Java SE平台规范的几个子集配置文件,以便不需要整个平台的应用程序能够在小型设备上部署和运行。
162 Prepare for Modularization
Undertake changes to smooth the eventual transition to modules in a future release, provide new tools to help developers prepare for the modular platform, and deprecate certain APIs that are a significant impediment to modularization.
JEP 162: 为模块化做准备
进行更改以平滑未来版本向模块的过渡,提供新工具以帮助开发人员为模块化平台做好准备,并弃用某些对模块化构成重大障碍的API。
164 Leverage CPU Instructions for AES Cryptography
Improve the out-of-box AES Crypto performance by using x86 AES instructions when available, and by avoiding unnecessary re-expansion of the AES key.
JEP 164: 利用CPU指令进行AES加密
通过在可用时使用x86 AES指令,并避免不必要的AES密钥重新扩展,来提高开箱即用的AES加密性能。
174 Nashorn JavaScript Engine
Design and implement a new lightweight, high-performance implementation of JavaScript, and integrate it into the JDK. The new engine will be made available to Java applications via the existing javax.script
API, and also more generally via a new command-line tool.
JEP 174: Nashorn JavaScript引擎
设计并实现一个新的轻量级、高性能的JavaScript实现,并将其集成到JDK中。新的引擎将通过现有的javax.script
API提供给Java应用程序,并通过一个新的命令行工具更广泛地提供。
176 Mechanical Checking of Caller-Sensitive Methods
Improve the security of the JDK’s method-handle implementation by replacing the existing hand-maintained list of caller-sensitive methods with a mechanism that accurately identifies such methods and allows their callers to be discovered reliably.
JEP 176: 调用者敏感方法的机械检查
通过用一种机制替换现有的手动维护的调用者敏感方法列表,来提高JDK方法句柄实现的安全性,该机制能够准确识别此类方法,并可靠地发现它们的调用者。
179 Document JDK API Support and Stability
There is a long-standing shortcoming in the JDK in terms of clearly specifying the support and stability usage contract for com.sun.*
types and other types shipped with the JDK that are outside of the Java SE specification. These contracts and potential evolution policies should be clearly captured both in the source code of the types and in the resulting class files. This information can be modeled with JDK-specific annotation types.
JEP 179: 文档化JDK API支持和稳定性
JDK在明确指定com.sun.*
类型及其他与Java SE规范无关的JDK内置类型的支持和稳定性使用合同方面存在长期的不足。这些合同和潜在的演变政策应在类型的源代码和生成的类文件中清晰地记录。此信息可以通过JDK特定的注解类型进行建模。
vm/--
142 Reduce Cache Contention on Specified Fields
Define a way to specify that one or more fields in an object are likely to be highly contended across processor cores so that the VM can arrange for them not to share cache lines with other fields, or other objects, that are likely to be independently accessed.
JEP 142: 减少指定字段的缓存争用
定义一种方式来指定对象中的一个或多个字段可能在处理器核心之间高度争用,以便虚拟机可以安排这些字段不与其他字段或其他对象共享缓存行,这些字段或对象可能会被独立访问。
vm/gc
122 Remove the Permanent Generation
Remove the permanent generation from the Hotspot JVM and thus the need to tune the size of the permanent generation.
JEP 122: 移除永久代
从Hotspot JVM中移除永久代,从而不再需要调整永久代的大小。
173 Retire Some Rarely-Used GC Combinations
Remove three rarely-used combinations of garbage collectors in order to reduce ongoing development, maintenance, and testing costs.
JEP 173: 淘汰一些不常用的GC组合
为了减少持续的开发、维护和测试成本,移除三种不常用的垃圾收集器组合。
vm/rt
136 Enhanced Verification Errors
Provide additional contextual information about bytecode-verification errors to ease diagnosis of bytecode or stackmap deficiencies in the field.
JEP 136: 增强的验证错误
提供关于字节码验证错误的额外上下文信息,以便于在实际应用中诊断字节码或栈映射的缺陷。
147 Reduce Class Metadata Footprint
Reduce HotSpot’s class metadata memory footprint in order to improve performance on small devices.
JEP 147: 减少类元数据占用
减少HotSpot的类元数据内存占用,以提高小型设备上的性能。
148 Small VM
Support the creation of a small VM that is no larger than 3MB.
JEP 148: 小型虚拟机
支持创建一个不超过3MB的小型虚拟机。
171 Fence Intrinsics
Add three memory-ordering intrinsics to the sun.misc.Unsafe
class.
JEP 171: Fence Intrinsics
向 sun.misc.Unsafe
类添加三个内存排序原语。
core/--
153 Launch JavaFX Applications
Enhance the java
command-line launcher to launch JavaFX applications.
JEP 153: 启动JavaFX应用程序
增强 java
命令行启动器以启动JavaFX应用程序。
core/lang
101 Generalized Target-Type Inference
Smoothly expand the scope of method type-inference to support (i) inference in method context and (ii) inference in chained calls.
JEP 101: 泛化目标类型推断
顺利扩展方法类型推断的范围,以支持 (i) 方法上下文中的推断和 (ii) 链式调用中的推断。
104 Annotations on Java Types
Extend the set of annotatable locations in the syntax of the Java programming language to include names which indicate the use of a type as well as (per Java SE 5.0) the declaration of a type.
JEP 104: 类型注解
扩展Java编程语言语法中可注解位置的集合,包括指示使用类型的名称以及(根据Java SE 5.0)类型的声明。
105 DocTree API
Extend the Compiler Tree API to provide structured access to the content of javadoc comments.
JEP 105: DocTree API
扩展编译器树 API,以提供对 javadoc 注释内容的结构化访问。
106 Add Javadoc to javax.tools
Extend the javax.tools
API to provide access to javadoc.
JEP 106: 为javax.tools添加Javadoc
扩展 javax.tools
API,以提供对javadoc的访问。
117 Remove the Annotation-Processing Tool (apt)
Remove the apt
tool, associated API, and documentation from the JDK.
JEP 117: 移除注解处理工具 (apt)
从JDK中移除apt
工具、相关API和文档。
118 Access to Parameter Names at Runtime
Provide a mechanism to easily and reliably retrieve the parameter names of methods and constructors at runtime via core reflection.
JEP 118: 运行时访问参数名称
提供一种机制,通过核心反射轻松可靠地在运行时检索方法和构造函数的参数名称。
120 Repeating Annotations
Change the Java programming language to allow multiple application of annotations with the same type to a single program element.
JEP 120: 重复注解
修改Java编程语言,以允许对单个程序元素应用多个相同类型的注解。
139 Enhance javac to Improve Build Speed
Reduce the time required to build the JDK and enable incremental builds by modifying the Java compiler to run on all available cores in a single persistent process, track package and class dependences between builds, automatically generate header files for native methods, and clean up class and header files that are no longer needed.
JEP 139: 增强javac以提高构建速度
通过修改Java编译器,使其在单一持久进程中运行所有可用核心,跟踪构建之间的包和类依赖关系,自动生成本地方法的头文件,并清理不再需要的类和头文件,从而减少构建JDK所需的时间并启用增量构建。
172 DocLint
Provide a means to detect errors in Javadoc comments early in the development cycle and in a way that is easily linked back to the source code.
JEP 172: DocLint
提供一种手段,以便在开发周期的早期检测Javadoc注释中的错误,并且能够轻松地与源代码关联。
core/libs
103 Parallel Array Sorting
Add additional utility methods to java.util.Arrays
that use the JSR 166 Fork/Join parallelism common pool to provide sorting of arrays in parallel.
JEP 103: 并行数组排序
向 java.util.Arrays
添加额外的实用方法,利用 JSR 166 Fork/Join 并行性公共池提供数组的并行排序。
107 Bulk Data Operations for Collections
Add functionality to the Java Collections Framework for bulk operations upon data. This is commonly referenced as “filter/map/reduce for Java.” The bulk data operations include both serial (on the calling thread) and parallel (using many threads) versions of the operations. Operations upon data are generally expressed as lambda functions.
JEP 107: 集合的批量数据操作
为Java集合框架添加批量数据操作的功能。这通常被称为“Java的过滤/映射/归约”。批量数据操作包括串行(在调用线程上)和并行(使用多个线程)版本的操作。对数据的操作通常以lambda函数的形式表达。
109 Enhance Core Libraries with Lambda
Enhance the Java core library APIs using the new lambda language feature to improve the usability and convenience of the library.
JEP 109: 使用Lambda增强核心库
通过使用新的Lambda语言特性增强Java核心库API,以提高库的可用性和便利性。
112 Charset Implementation Improvements
Improve the maintainability and performance of the standard and extended charset implementations.
JEP 112: 字符集实现改进
提高标准和扩展字符集实现的可维护性和性能。
119 javax.lang.model Implementation Backed by Core Reflection
Provide an implementation of the javax.lang.model.*
API backed by core reflection rather than by javac
. In other words, provide an alternate API to access and process the reflective information about loaded classes provided by core reflection.
JEP 119: 基于核心反射的javax.lang.model实现
提供一个基于核心反射而非javac
的javax.lang.model.*
API实现。换句话说,提供一个替代API来访问和处理核心反射提供的已加载类的反射信息。
135 Base64 Encoding & Decoding
Define a standard API for Base64 encoding and decoding.
JEP 135: Base64编码与解码
定义一个用于Base64编码和解码的标准API。
149 Reduce Core-Library Memory Usage
Reduce the dynamic memory used by core-library classes without adversely impacting performance.
JEP 149: 减少核心库内存使用
在不影响性能的情况下,减少核心库类使用的动态内存。
150 Date & Time API
Define a new date, time, and calendar API for the Java SE platform.
JEP 150: 日期与时间API
为Java SE平台定义一个新的日期、时间和日历API。
155 Concurrency Updates
Scalable updatable variables, cache-oriented enhancements to the ConcurrentHashMap
API, ForkJoinPool
improvements, and additional Lock
and Future
classes.
JEP 155: 并发更新
可扩展的可更新变量、面向缓存的 ConcurrentHashMap
API 增强、ForkJoinPool
改进,以及额外的 Lock
和 Future
类。
170 JDBC 4.2
Minor enhancements to JDBC to improve usability and portability
JEP 170: JDBC 4.2
对JDBC进行小幅增强,以提高可用性和可移植性。
177 Optimize java.text.DecimalFormat.format
Optimize java.text.DecimalFormat.format
by taking advantage of numerical properties of integer and floating-point arithmetic to accelerate cases with two or three digits after the decimal point.
JEP 177: 优化java.text.DecimalFormat.format
通过利用整数和浮点数算术的数值特性来优化java.text.DecimalFormat.format
,加速小数点后有两位或三位数字的情况。
178 Statically-Linked JNI Libraries
Enhance the JNI specification to support statically linked native libraries.
JEP 178: 静态链接JNI库
增强JNI规范以支持静态链接的本地库。
180 Handle Frequent HashMap Collisions with Balanced Trees
Improve the performance of java.util.HashMap
under high hash-collision conditions by using balanced trees rather than linked lists to store map entries. Implement the same improvement in the LinkedHashMap
class.
JEP 180: 使用平衡树处理频繁的HashMap冲突
通过使用平衡树而不是链表来存储映射条目,改善在高哈希冲突条件下java.util.HashMap
的性能。在LinkedHashMap
类中实现相同的改进。
core/i18n
127 Improve Locale Data Packaging and Adopt Unicode CLDR Data
Create a tool to convert LDML (Locale Data Markup Language) files into a format usable directly by the runtime library, define a way to package the results into modules, and then use these to incorporate the de-facto standard locale data published by the Unicode Consortium’s CLDR project into the JDK.
JEP 127: 改进区域数据打包并采用Unicode CLDR数据
创建一个工具,将LDML(区域数据标记语言)文件转换为可直接由运行时库使用的格式,定义将结果打包为模块的方式,然后使用这些模块将Unicode联盟的CLDR项目发布的事实标准区域数据纳入JDK中。
128 BCP 47 Locale Matching
Define APIs so that applications that use BCP 47 language tags (see RFC 5646) can match them to a user’s language preferences in a way that conforms to RFC 4647.
133 Unicode 6.2
Extend existing platform APIs to support version 6.2 of the Unicode Standard.
JEP 133: Unicode 6.2
扩展现有平台API以支持Unicode标准的6.2版本。
core/net
184 HTTP URL Permissions
Define a new type of network permission which grants access in terms of URLs rather than low-level IP addresses.
JEP 184: HTTP URL权限
定义一种新的网络权限类型,该权限根据URL而不是低级IP地址授予访问权限。
core/sec
113 MS-SFU Kerberos 5 Extensions
Add the MS-SFU extensions to the JDK’s Kerberos 5 implementation.
JEP 113: MS-SFU Kerberos 5 扩展
将 MS-SFU 扩展 添加到 JDK 的 Kerberos 5 实现中。
114 TLS Server Name Indication (SNI) Extension
Add support for the TLS Server Name Indication (SNI) Extension to allow more flexible secure virtual hosting and virtual-machine infrastructure based on SSL/TLS protocols.
JEP 114: TLS服务器名称指示(SNI)扩展
添加对TLS服务器名称指示(SNI)扩展的支持,以允许基于SSL/TLS协议的更灵活的安全虚拟托管和虚拟机基础设施。
115 AEAD CipherSuites
Support the AEAD/GCM cipher suites defined by SP-800-380D, RFC 5116, RFC 5246, RFC 5288, RFC 5289 and RFC 5430.
JEP 115: AEAD密码套件
支持由SP-800-380D、RFC 5116、RFC 5246、RFC 5288、RFC 5289和RFC 5430定义的AEAD/GCM密码套件。
121 Stronger Algorithms for Password-Based Encryption
Provide stronger Password-Based-Encryption (PBE) algorithm implementations in the SunJCE provider.
JEP 121: 更强的基于密码的加密算法
在SunJCE提供程序中提供更强的基于密码的加密(PBE)算法实现。
123 Configurable Secure Random-Number Generation
Enhance the API for secure random-number generation so that it can be configured to operate within specified quality and responsiveness constraints.
JEP 123: 可配置的安全随机数生成
增强安全随机数生成的API,使其能够在指定的质量和响应性约束内进行配置。
124 Enhance the Certificate Revocation-Checking API
Improve the certificate revocation-checking API to support best-effort checking, end-entity certificate checking, and mechanism-specific options and parameters.
JEP 124: 增强证书撤销检查API
改进证书撤销检查API,以支持尽力而为的检查、终端实体证书检查以及机制特定的选项和参数。
129 NSA Suite B Cryptographic Algorithms
Provide implementations of the cryptographic algorithms required by NSA Suite B.
JEP 129: NSA Suite B 加密算法
提供 NSA Suite B 所需的加密算法的实现。
130 SHA-224 Message Digests
Implement the SHA-224 message-digest algorithm and related algorithms.
JEP 130: SHA-224 消息摘要
实现SHA-224消息摘要算法及相关算法。
131 PKCS#11 Crypto Provider for 64-bit Windows
Include the SunPKCS11 provider in the JDK for 64-bit Windows.
JEP 131: 64位Windows的PKCS#11加密提供者
在JDK中为64位Windows包含SunPKCS11提供者。
140 Limited doPrivileged
Enable code to assert a subset of its privileges without otherwise preventing the full access-control stack walk to check for other permissions.
JEP 140: 有限的doPrivileged
允许代码声明其特权的一个子集,而不会阻止完整的访问控制栈遍历以检查其他权限。
166 Overhaul JKS-JCEKS-PKCS12 Keystores
Facilitate migrating data from JKS and JCEKS keystores by adding equivalent support to the PKCS#12 keystore. Enhance the KeyStore API to support new features such as entry metadata and logical views spanning several keystores. Enable the strong crypto algorithms introduced in JEP-121 to be used to protect keystore entries.
JEP 166: 重新设计JKS-JCEKS-PKCS12密钥库
通过为PKCS#12密钥库添加等效支持,简化从JKS和JCEKS密钥库迁移数据的过程。增强KeyStore API,以支持新特性,如条目元数据和跨多个密钥库的逻辑视图。启用在JEP-121中引入的强加密算法用于保护密钥库条目。
web/jaxp
185 Restrict Fetching of External XML Resources
Enhance the JAXP APIs to add the ability to restrict the set of network protocols that may be used to fetch external resources.
Process finished with exit code 0
JEP 185: 限制外部XML资源的获取
增强JAXP API,增加限制可用于获取外部资源的网络协议集的能力。