《深刻理解Java7核心技術與最佳實踐》讀書筆記(1.1)---Project Coin介紹

  OpenJDK中的Coin項目(Project Coin)的目的就是爲了收集對Java語言的語法進行加強的建議。在Coin項目開始之初,曾經普遍地向社區徵求提議。在短短的一個月時間內就收到將近70條提議。最後又9條提議被列入考慮之中。在這9條提議中,有6條成爲Java7的一部分,剩下的2條提議會在Java8中從新考慮,還有1條提議被移到其它項目中實現。這6條被採納提議的語法新特性涉及switch語句中使用字符串整數字面量的改進異常處理的優化泛型建立簡化try-with-resources語句優化變長參數的方法調用等。php

  和其餘對Java平臺作的修改同樣,Coin項目所建議的修改也須要經過JCP來完成。這些改動以JSR 334(Small Enhancements to the Java Programming Language)的形式提交到JCP。html

 

看完書中一些基本內容後,帶着疑問作了一些事,記錄下來與你們分享。java

1、Coin項目

官方網址 http://openjdk.java.net/projects/coin/ 程序員

Project Coin

The goal of Project Coin is to determine what set of small language changes should be added to JDK 7. That list is:shell

  • Strings in switch
  • Binary integral literals and underscores in numeric literals
  • Multi-catch and more precise rethrow
  • Improved type inference(推斷) for generic instance creation (diamond)   
  • try-with-resources statement
  • Simplified varargs method invocation

The previously selected features of collections support and unsigned literals have been deferred and will be reconsidered in JDK 8.   編程

 

Coin(項目代號,因爲不清楚翻譯成"硬幣"是否合理,所以暫時保留成英文)項目的目標是決定哪些語言特性的小範圍變動將被添加到JDK 7中。變動列表以下:緩存

  • switch語句能用String,即switch(String)
  • 二進制整數字面量以及數字字面量加下劃線
  • 多catch子句以及更精準的throw拋出
  • 加強泛型實例建立時的類型推斷(*)
  • try-with-resources語句
  • 簡化的變長參數方法調用

後面的這段話對我沒有任何意義,這裏不翻譯。併發


History

An open call for proposals period ran from February 27, 2009 through March 30, 2009. The nearly 70 proposal forms that were submitted received extensive discussion on the Project Coin mailing list, coin-dev.oracle

After due consideration, five or so proposals were selected for inclusion in JDK 7; the list of selected proposals was subsequently updated. Discussion of the selected proposals continues on the coin-dev list.框架

This Project is sponsored by the Compiler Group.

 

公開的徵求建議階段在2009年2月27日---2009年3月30日(譯者注:說明成富書中說的"短短1個月時間內"其實不許確,用一個月左右比較合適)。將近70份(由社區人員)提交的建議表單(被項目組收到後)在Coin項目郵件列表coin-dev中被普遍地討論。

(在項目組成員)如期周全地考慮以後,5個左右的建議被選中加入到JDK 7中;選中的建議列表被順序地更新。選中建議的套路繼續在coin-dev列表中。

這個項目是由Compiler Group倡導發起的。


Community

就在我寫這篇文章以前,我查了一下關於JDK 9的相關內容,有興趣的同窗能夠看看官方的這篇文章。

JDK 9

The goal of this Project is to produce an open-source reference implementation of the Java SE 9 Platform, to be defined by a forthcoming JSR in the Java Community Process.

The schedule and features of this release are proposed and tracked via the JEP Process, as amended by the JEP 2.0 proposal.

Schedule

2016/05/26   Feature Complete
2016/12/22   Feature Extension Complete
2017/01/05   Rampdown Start
2017/02/09   All Tests Run
2017/02/16   Zero Bug Bounce
2017/03/16   Rampdown Phase 2
2017/07/06   Final Release Candidate
2017/07/27   General Availability

The milestone(里程碑) definitions are the same as those for JDK 8, with the addition of:

  • Feature Extension Complete — The date by which JEPs and small enhancements that have been granted extensions via the FC extension-request process must be integrated into the master forest.

Status

We are past the Feature Complete milestone, but that does not mean that the feature set is frozen. If you own a JEP or a small enhancement that is not yet complete then you can request an extension via the FC extension-request process.

Features

JEPs targeted to JDK 9, so far

102:  Process API Updates    更新Process(進程)相關的APIs
110:  HTTP 2 Client    HTTP 2客戶端  譯者注:HTTP 2在2013年通過首測,只支持https://
143:  Improve Contended Locking
158:  Unified JVM Logging  統一的JVM日誌
165:  Compiler Control
193:  Variable Handles
197:  Segmented Code Cache  分段代碼緩存
199:  Smart Java Compilation, Phase Two
200:  The Modular JDK
201:  Modular Source Code
211:  Elide Deprecation Warnings on Import Statements
212:  Resolve Lint and Doclint Warnings
213:  Milling Project Coin
214:  Remove GC Combinations Deprecated in JDK 8
215:  Tiered Attribution for javac
216:  Process Import Statements Correctly
217:  Annotations Pipeline 2.0
219:  Datagram Transport Layer Security (DTLS)
220:  Modular Run-Time Images
221:  Simplified Doclet API    簡化DocletAPIs   譯者注:第一次據說Doclet,竟然早就有了,慚愧
222:  jshell: The Java Shell (Read-Eval-Print Loop)    jshell,the java shell(REPL,讀-算-打印 循環)   譯者注:相比是逆天功能  
223:  New Version-String Scheme  
224:  HTML5 Javadoc   HTML5 Javadoc   譯者注:Javadoc生成的HTML支持HTML 5是歷史潮流,不得不從
225:  Javadoc Search
226:  UTF-8 Property Files
227:  Unicode 7.0
228:  Add More Diagnostic Commands
229:  Create PKCS12 Keystores by Default
231:  Remove Launch-Time JRE Version Selection
232:  Improve Secure Application Performance
233:  Generate Run-Time Compiler Tests Automatically
235:  Test Class-File Attributes Generated by javac
236:  Parser API for Nashorn
237:  Linux/AArch64 Port
238:  Multi-Release JAR Files
240:  Remove the JVM TI hprof Agent
241:  Remove the jhat Tool    溢出jhat工具   譯者注:雖然我沒有用過jhat,不明覺厲
243:  Java-Level JVM Compiler Interface   
244:  TLS Application-Layer Protocol Negotiation Extension
245:  Validate JVM Command-Line Flag Arguments
246:  Leverage CPU Instructions for GHASH and RSA
247:  Compile for Older Platform Versions
248:  Make G1 the Default Garbage Collector
249:  OCSP Stapling for TLS
250:  Store Interned Strings in CDS Archives
251:  Multi-Resolution Images
252:  Use CLDR Locale Data by Default
253:  Prepare JavaFX UI Controls & CSS APIs for Modularization
254:  Compact Strings
255:  Merge Selected Xerces 2.11.0 Updates into JAXP
256:  BeanInfo Annotations
257:  Update JavaFX/Media to Newer Version of GStreamer
258:  HarfBuzz Font-Layout Engine
259:  Stack-Walking API
260:  Encapsulate Most Internal APIs
261:  Module System    
262:  TIFF Image I/O   TIFF圖像I/O
263:  HiDPI Graphics on Windows and Linux
264:  Platform Logging API and Service   
265:  Marlin Graphics Renderer
266:  More Concurrency Updates    更多的併發編程內容更新
267:  Unicode 8.0
268:  XML Catalogs
269:  Convenience Factory Methods for Collections
270:  Reserved Stack Areas for Critical Sections
271:  Unified GC Logging
272:  Platform-Specific Desktop Features
273:  DRBG-Based SecureRandom Implementations
274:  Enhanced Method Handles
275:  Modular Java Application Packaging
276:  Dynamic Linking of Language-Defined Object Models
277:  Enhanced Deprecation
278:  Additional Tests for Humongous Objects in G1
279:  Improve Test-Failure Troubleshooting
280:  Indify String Concatenation
281:  HotSpot C++ Unit-Test Framework  HotSpot C++單元測試框架
282:  jlink: The Java Linker
283:  Enable GTK 3 on Linux
284:  New HotSpot Build System
285:  Spin-Wait Hints
287:  SHA-3 Hash Algorithms
288:  Disable SHA-1 Certificates
289:  Deprecate the Applet API  Applet APIs將會被標記爲過期,Applet將正式告別曾經輝煌的歷史舞臺,被扔進歷史的垃圾桶
290:  Filter Incoming Serialization Data
292:  Implement Selected ECMAScript 6 Features in Nashorn
294:  Linux/s390x Port
295:  Ahead-of-Time Compilation

這麼多更新。。。眼花繚亂吶,之後又有的忙咯。。。

 

2、JCP組織

官網地址:https://www.jcp.org/en/home/index

Welcome to the Java Community Process!
Welcome to jcp.org, home of the Java Community ProcessSM (JCPSM) Program. The JCP is the mechanism for developing standard technical specifications for Java technology. Anyone can register for the site and participate in reviewing and providing feedback for the Java Specification Requests (JSRs), and anyone can sign up to become a JCP Member and then participate on the Expert Group of a JSR or even submit their own JSR Proposals. 
 
To get the most out of the site, register now.

For more information about the JCP Program, refer to our overview page.

JCP(Java Community Process)的定義以下:

The JCP is the mechanism for developing standard technical specifications for Java technology。

JCP是爲Java技術發展標準技術規範而成立的這麼一個組織。

 

3、OpenJDK與OracleJDK區分

若是讀者平時使用Linux系統寫代碼,我想應該會知道OpenJDK。由於Linux系統通常都是默認預裝OpenJDK的,即便在shell中下載依賴,也是隻有OpenJDK選項的。

有了這種體驗,其實就會產生疑惑:OpenJDK和OracleJDK這兩個JDK有什麼區別?

維基百科中關於OpenJDK內容:

OpenJDK原是Sun Microsystems公司爲Java平臺構建的Java開發環境(JDK)的開源版本,徹底自由,開放源碼。Sun Microsystems公司在2006年的JavaOne大會上稱將對Java開放源代碼,於2009年4月15日正式發佈OpenJDK。甲骨文在2010年收購Sun Microsystem以後接管了這個項目。

2008年5月,Fedora 9及Ubuntu 8.04於發行版中發佈OpenJDK,完整地基於自由開放源代碼的OpenJDK。

2008年6月,IcedTea 6(Fedora 9上的一個包版本的OpenJDK)宣佈已經過Technology Compatibility Kit測試,能夠稱得上是一個徹底兼容的Java 6的運行環境。

2008年7月12日,Debian接受了OpenJDK-6的不穩定版本,但目前狀況已經穩定。OpenJDK也能夠在openSUSERed Hat Enterprise Linux及其派生系統,如CentOS中找到。

自2008年7月,OpenJDK 7能夠運行在Mac OS X和其餘的BSD發行版。

2009年7月,Ubuntu 9.04中的二進制版本OpenJDK在Java SE 6 JCK中經過了全部的兼容性測試。

2015年12月,Google公司證明將於將來的新版Android以OpenJDK替換專屬版權的JDK

這裏所謂的開源並非說sun將全部的JDK看家內容都給開源了。OpenJDK主要用爲幫助高手瞭解JDK實現機制,代碼實現的,還有一部分商業閉源的內容做爲公司的私貨沒有和我們這羣屌絲程序員分享,哦不,好像這裏只有我是屌絲程序員。

形象點說呢,OpenJDK就是OracleJDK的私生子(bastard,美劇Game of Thrones中John Snow總是被外人這麼無情地嘲諷,心疼雪諾3秒鐘)。

相關文章
相關標籤/搜索