å€ãã®äººã ã¯ãJavaã«äœããæ¬ ããŠããããã°ãããããŸãã¯é ããšäžå¹³ãèšã£ãŠããŸãã è¯ããã¥ãŒã¹ïŒæå¥ãèšãã®ã§ã¯ãªããèªåã§Javaãæ¹åããæ©äŒããããŸãã Javaã¯OpenJDKãããžã§ã¯ããšããŠã»ãŒå®å šã«ãªãŒãã³ã§ãã ãã®ãããžã§ã¯ãã«ã¯ç¬èªã®ç¹åŸŽããããŸãããäžè¬ã«ãåé¡ãèªåã§å ±åããããä¿®æ£ããããæ°ããæ©èœãéçºãããããããšã劚ãããã®ã¯äœããããŸããã ãã®èšäºã§ã¯ãåå¿è åãã«ãããè¡ãæ¹æ³ãå°ã説æããŸãã
ãã°ãå ±åããã«ã¯ïŒ
OpenJDKãããžã§ã¯ãã«ã¯ãã°ãã©ãã«ãŒJIRAããããŸãã ããã§ãåé¡ãæ¢ç¥ãæ°ããããæ€çŽ¢ããŠç¢ºèªã§ããŸãã ãã ããéãã®äººã¯ããã«ç»é²ããŠæžã蟌ãããšã¯ã§ããŸããã Javaã®åé¡ãå ±åããïŒãŸãã¯æ¹åãææ¡ããïŒå ¬åŒã®æ¹æ³ã¯ã Java Bug Reportãã©ãŒã ã䜿çšããããšã§ãã ãã®ãã©ãŒã ã¯ãJIãã¬ãã£ãã¯ã¹ã䜿çšããŠJIRAã«ãã±ãããäœæããŸãïŒJavaã®åé¡ããã±ããçªå·ã¯æå®ããé»åã¡ãŒã«ã«éä¿¡ãããŸãïŒã äºå調æŽã®æç¹ã§ã¯ããã±ããã¯pr玢奜ããªç®ããé ãããŠããŸãã äºåã¢ãã¬ãŒã·ã§ã³ãæåãããšãåé¡ã¯ãããªãã¯ãããžã§ã¯ãïŒããšãã°ãJDKãã¬ãã£ãã¯ã¹ä»ãïŒã«ç§»è¡ãã誰ã§ãèŠãããšãã§ããŸãã ãã®ãã©ãŒã ã®å©ç¹ã¯ãæ¯èŒçåçŽã§ãããç»é²ãäžè¬ã«å人ããŒã¿ãå¿ èŠãšããªãããšã§ãã æ¬ ç¹ã¯ããããã®ãã©ãŒã ãJavaéçºè ã«ãã£ãŠçŽæ¥è¡šç€ºãããã®ã§ã¯ãªããç¹å¥ãªwebbugã°ã«ãŒãããŒã ã«ãã£ãŠè¡šç€ºãããããšã§ãã ïŒéçºè ã®èŠ³ç¹ããã¯éèŠã§ãããšããŠãïŒã¡ãã»ãŒãžãé·æé調æ»ãããã«ãã³ã°ãããªã¹ã¯ããããŸãã ãã®ãã±ããã¯ãOracleã®è¯ãå人ã«äººã ãæºãã¶ãããã«é ŒããŸã§ãç§ã®ãã±ããã¯1ãæã»ã©åãã調æŽãããŠããŸããã å¶ç¶ã«ããããšãã°ããã«ããç§ã®ååãšåãããã«ããã±ãããå®å šã«æåŠãããããšãããããŸã ã ãã®åé¡ã¯OpenJDKã§ã®ã¿çŸããŸããããOracleJDKã§ã¯çŸããŸããã§ãããwebbugã°ã«ãŒãã¯ãã®åé¡ã¯æ³šç®ã«å€ããªããšèããŸããã ç¹°ãè¿ããŸãããç§ã¯èŠªåã®ãããã§ãããç解ããããšãã§ããŸããã
ãŸãããã±ãããäºå調æŽãæ£åžžã«ééãããããªãã¯ãããžã§ã¯ãã«åå ããããšããããŸãããããã«ã€ããŠã¯éç¥ãããŸããã§ããã ãããã£ãŠã https://bugs.openjdk.java.net/browse/JI-xxxxxxx
ã®åœ¢åŒã®URLããšãã©ã確èªããæåŸã«ããJIçªå·ã«çœ²åããããšãã§ããŸãã äºå調æŽãå®äºãããšããããªãã¯ãã±ããã«ãªãã€ã¬ã¯ããããŸããããã§ãªãå Žåã¯ããšã©ãŒã¡ãã»ãŒãžã衚瀺ãããŸãã
ãããã«ããŠããåé¡ãæ確ã«èª¬æãããããåçŸããæå°éã®äŸãæããŠãã ããã ãããåçŽã§ããã»ã©ã圌ãã¯ããã«æ³šæãæãå¯èœæ§ãé«ããªããŸãã
ãã£ãšè¯ãæ¹æ³ã¯ãããŸããïŒ
ã芧ã®ãšããããã®ãã©ãŒã ã«ã¯åé¡ããããŸãã å€ãã®å Žåãåé¡ãé©åãªã¡ãŒãªã³ã°ãªã¹ãã«å ±åããæ¹ãé©åã§ãã OpenJDKã¯å€ãã®ã¡ãŒãªã³ã°ãªã¹ãããµããŒãããŠããã®ã§ãé¢å¿ã®ããåéã®ãªã¹ããééããªã賌èªããå¿ èŠããããŸãã ãªã¹ãã¢ãŒã«ã€ããåç §ããŠãããããæ»ãã§ãããã©ããã確èªããŸãã ããšãã°ã ã©ã ãã«äœããã®åé¡ãããå Žåãã©ã ããããžã§ã¯ããJava-8ã§å®äºãããªã¹ããéã¢ã¯ãã£ãã§ãããããã©ã ãéçºã«æžã蟌ã䟡å€ã¯ã»ãšãã©ãããŸããã éåžžãlambdaã®åé¡ã¯Javaã³ã³ãã€ã©ã®åé¡ã§ãããããã»ãšãã©ã®compiler-devãé©ããŠããŸãã
誰ã§ããªã¹ãã«ãµãã¹ã¯ã©ã€ãããŠæžã蟌ãããšãã§ããŸããåé¡ã¯ãããŸããã æ·»ä»ãã¡ã€ã«ã«æ³šæããŠãã ããïŒã»ãšãã©ã®ãã¡ã€ã«ã¿ã€ãã¯ã«ãããããŸãã ä¿¡é Œæ§ã®ããã«ã *.txt
以å€ã¯éä¿¡ãããã¡ãã»ãŒãžãå®éã«ãªã¹ãã«å
¥ã£ããã©ãããã¢ãŒã«ã€ããã確èªããŸãïŒéåžžã®ç¶æ³ã§ã¯ãéä¿¡çŽåŸã«ã¢ãŒã«ã€ãã«è¡šç€ºãããŸãïŒã ãããã®ãªã¹ãã¯å®éã®éçºè
ã«ãã£ãŠèªã¿åããããããèå³æ·±ãåé¡ãçºçããå Žåãããã解決ããããã®ãã¹ã¯çããªããŸãã
ãããŠãã£ãšãšããŸããã¯ãªæ¹æ³ã¯ïŒ
代æ¿æ¡ã¯ãããªãã®æèŠã§ã¯ãããªãã®åé¡ã«èå³ãããã ããJavaéçºè ãžã®å人çãªæçŽãããããŸããã å€ãã®éçºè ã®ã¡ãŒã«ã¢ãã¬ã¹ã¯ãåãã¡ãŒãªã³ã°ãªã¹ãã®ã¢ãŒã«ã€ãã§ç°¡åã«èŠã€ããããšãã§ããŸããããã¡ãããã®æ¹æ³ã¯å±éºã§ãããã¿ã¯ãæãå¿ èŠã§ãã ããªãã®æçŽã¯ç°¡åã«ç¡èŠã§ããŸãã ãã ãã JMHããŒã«ã«ç°¡åãªæ©èœèŠæ±ãæäŸããããšãã§ããŸããã
ãããšããŸããã¯ãªãªãã·ã§ã³ã¯ã StackOverflowã®åé¡ã«ã€ããŠæå¥ãèšãããšã§ãã OpenJDKã®éçºè ã¯ãã¡ãããOracleã®åŸæ¥å¡ãããŸããããã¡ããã圌ãã¯ãã¹ãŠãèªãã§ããããã§ã¯ãªããããªãã®ã¡ãã»ãŒãžã«æ°ä»ããªãå¯èœæ§ããããŸãã ãããŠã圌ããæ°ã¥ããå Žåã圌ãã¯ãããããããªãã§ãããã ããã¯ç§ã®ããã«äžåºŠã ãããããŠå ±å¥šéã®å®£èšã®åŸã§ã ãåããã Brian Goetzãç§ã«çããç§ã®åé¡ããã°ãšããŠèªèããŸããã éçºè èªèº«ããã±ãããäœæããŠä¿®æ£ããŸããã ãã¡ããããã®å Žåã®æåã«äŸåããããšã¯äŸ¡å€ããããŸããã
ããã«ãšããŸããã¯ãªãªãã·ã§ã³ã¯ãJavaã«ã³ãã¡ã¬ã³ã¹ã§åé¡ã«ã€ããŠäžå¹³ãèšãããšã§ãã ååã®JPointã§ã chereminã¯ãšã¹ã±ãŒãåæã«ã€ããŠè©±ãã Arrays.asListãå£ããèå³æ·±ãäºäŸã®äŸã瀺ããŸããïŒ ãã¬ãŒã³ããŒã·ã§ã³ ãã¹ã©ã€ã69以äžïŒã 圌ã®å ±åãèããåŸãç§ã¯ãã®åé¡ãä¿®æ£ããã®ãé¢åã§ã¯ãããŸããã§ããã ãã¡ããããã®å Žåã§ã誰ãæåãä¿èšŒããŸããã
ãããããã°ãä¿®æ£ããæ¹æ³ã¯ïŒ
ããã§ããã°ãå ±åããå€ãã®æ¹æ³ããããŸãã ããããã³ãŒããæžãããã«æããããå Žåã¯ã©ãã§ããããïŒ ãŸããã€ã³ãã©ã¹ãã©ã¯ãã£ã«å¯ŸåŠããå¿ èŠããããŸãã
ãã¹ãŠã®OpenJDKãããžã§ã¯ãã¯ã ãã¡ãããå
¥æå¯èœãªMercurialãªããžããªã«ä¿åãããŸã ã Jdk9ã¯çŸåšéçºäžã§ãããéåžžã¯devãªããžããªãå¿
èŠã§ãã jdk ïŒã¯ã©ã¹ã©ã€ãã©ãªïŒã hotspot ïŒä»®æ³ãã·ã³ïŒãªã©ã®ããã€ãã®åå¥ã®ãªããžããªããããã«éžæã§ããŸããJavaã®çŸåšã®ããŒãžã§ã³ïŒjava8ãªã©ïŒã§åé¡ãæ€åºãããjava9ã«æ®ã£ãŠããå Žåã¯ãæåã«ä¿®æ£ãããŸãjava9ã次ã«java8ã®æŽæ°ã«ç§»æ€ããŸãïŒç§»æ€ã®æå³ããå©ç¹ãå€æŽãè¡ããªã¹ã¯ãäžåãå ŽåïŒã 8ã€ã®åé¡ã®ã»ãšãã©ã¯ãŸã 9ã€ã ãã§ä¿®æ£ãããŠããŸããã8ã€ã«è»¢éããããšã¯ã§ããŸããã å¿
èŠãªãªããžããªãããŠã³ããŒããããã®ããã€ã¹ã®èª¿æ»ã«æéãè²»ãããŠãã ããã ã¯ã©ã¹ã©ã€ãã©ãªãä¿®æ£ããå Žåã¯ã jdk9/dev/jdk
/src/<jigsaw-module>/share/classes/
ãªã©ã®ãã¹ãå¿
èŠjdk9/dev/jdk
ã
ã³ãŒããä¿®æ£ããå Žåãããããæ£åžžã«æ©èœããããšã確èªããŠãã ããã ç§ã¯æ£çŽã«ãOpenJDKããŒãããé©åã«ã¢ã»ã³ãã«ããæ¹æ³ãç解ããŠããŸããã§ããã 代ããã«ã Kenaiãããžã§ã¯ãããJava-9ã®ææ°ãã«ããã€ã³ã¹ããŒã«ããŸãã å€æŽããjavaãã¡ã€ã«ã®ã¿ãå¥ã®ãã£ã¬ã¯ããªã«ã³ããŒãã次ã®ããã«ã³ã³ãã€ã«ããŸãïŒ java.base
ã¢ãžã¥ãŒã«ã®java/util
å€æŽäŸïŒïŒ
$ javac -Xmodule:java.base -d out/java.base src/java/util/*.java
ãããŠã次ã®ã³ãã³ãã䜿çšããŠãã¹ãã¢ããªã±ãŒã·ã§ã³ãèµ·åããŸãã
$ java -Xpatch:out MyTest.java
-Xmodule
ããã³-Xpatch
ã¯ãJigsawãããžã§ã¯ãã«ç»å ŽããŸãã ã ããã«å
ç«ã¡ã -Xbootclasspath/p:
ã¯æ©èœããŸããããJava-9ã§ã¯ãã®ãªãã·ã§ã³ã¯æ©èœããŸããã
ãããŠããã¹ãã®æžãæ¹ã¯ïŒ
ãã ãããªããžããªå ã§éåžžã®åäœãã¹ããäœæããããšããå§ãããŸãã OpenJDKã¯ãç¹å¥ãªjtregããŒã«ã䜿çšããŠãã¹ããå®è¡ããŸãã æ®å¿µãªããã å®æãããã«ãã¯å幎éæŽæ°ãããŠããããJigsawã«é¢é£ããå€æŽãjtregã®å€ãããŒãžã§ã³ã§åé¡ãåŒãèµ·ãããããããã¯éèŠã§ãã ãããã£ãŠãjtregãèªåã§æ§ç¯ããæ¹æ³ãç解ããå¿ èŠããããŸãã
äžè¬çã«ããã¹ãèªäœã¯éåžžTestNGã䜿çšããŠèšè¿°ãããŠããŸããã main
ã¡ãœããã§ã¯ã©ã¹ãå®è¡ããã ãã§junitãšå€ãã®å€ããã¹ãããããäŸå€ã§å€±æããããšã¯ãããŸããã jtregããŒã«ã䜿çšãããšãåç©åå
šäœãæœè±¡åã§ããå€ãã®äŸ¿å©ãªèšå®ãå«ãŸããŠããŸãã
ãããã®æºåãã§ããŸããïŒ ã©ãã«éãïŒ
åŒãç¶ãJavaã«è²¢ç®ããããšã«æ±ºããå ŽåãOpenJDKéå±€ã®äžçªäžã«ããŸãã éåžžã«ç°¡åãªããããéä¿¡ã§ããŸãïŒããšãã°ãããã¥ã¡ã³ãã®äºçŽ°ãªã¿ã€ããã¹ïŒã ãããè¡ãã«ã¯ãããããã¡ã€ã«ãåéãïŒããšãã°ã hg diff -g
ã䜿çšïŒã件åã«[PATCH]
ãšããåèªãå«ãé©åãªã¡ãŒãªã³ã°ãªã¹ãã«éä¿¡ããŸãã å°ããªãããã¯ã説æãšäžç·ã«ã¬ã¿ãŒã®æ¬æã«çŽæ¥éä¿¡ããã®ãæé©ã§ãã ãããã®JIRAã«ãã±ãããããå Žåã¯ã件åè¡ã«ããã±ããçªå·ã瀺ãå¿
èŠããããŸãã 次ã«ãéçºè
ã®1人ããããã®ã¹ãã³ãµãŒã«åæãããŸã§åŸ
ã¡ãŸãã ãŸã£ããåçããªãå Žåã¯ãæ°é±éã«1床ãäžå¯§ã«çžæã蹎ãããšãã§ããŸãã ã¡ãŒãªã³ã°ãªã¹ãã§ééãããããããããŸããããå®éã«ã¯ããããå®éã«ã©ãã«è»¢éããã¹ãããéç¥ãããŸãã
ããããå®å šã«èªæã§ãªãå Žåãåãæ¹æ³ã§å¯Ÿå¿ã§ããŸããã Oracle Contributor Agreementã«çœ²åãããŸã§ããããã¯ã³ãããã§ããŸããã åœç¶ã倧äŒæ¥ããããžã§ã¯ãã®èåŸã«ãããããæ³çåé¡ã¯äžå¯æ¬ ã§ãã ããªãã¯ãããªãã®å人çãªèè ã®ã³ãŒããéä¿¡ãããããOracleã®å ±åææè ã«è²æž¡ããããšã«åæããŸãïŒãããåæã«ããã®æš©å©ã«å¯Ÿããããªãã®æš©å©ã倱ãããšã¯ãããŸããã å¥çŽæžãå°å·ãããããèªãã§ïŒããŸããããŸããïŒã眲åããã¹ãã£ã³ããŠãæå®ããé»åã¡ãŒã«ã«éä¿¡ããŸãã åŠçã«ã¯å°ãªããšã1é±éãããããšã«æ³šæããŠãã ããã æåãããšãé»åã¡ãŒã«ã§éç¥ãããååãé·ããªã¹ãã«è¡šç€ºãããŸã ã ãã®æç¹ã§ãOpenJDK Contributorã®ã¹ããŒã¿ã¹ãååŸããããããåŸæŽã§ããŸãã
ã¬ãã«8ã®ãšã«ãã«ãªãã«ã¯ïŒ
2-3åã®éèŠãªããããæ£åžžã«ããã·ã¥ããããOpenJDK Authorã®ã¹ããŒã¿ã¹ãèŠæ±ã§ããŸãã ãããè¡ãã«ã¯ããããžã§ã¯ããªãŒããŒã«æçŽãæžãïŒjdk9ã§ã¯Mark ReinholdïŒãã³ããããžã®ãªã³ã¯ãå«ããããããªã¹ãããŸãã æåããã°ãæ°ããæ©äŒãããªãã«éãããŸãã ãŸãããµãŒããŒcr.openjdk.java.netïŒSShå ¬ééµãå¿ èŠã§ãïŒãžã®sftpã¢ã¯ã»ã¹ãã³ãŒãã¬ãã¥ãŒã®ãªã¯ãšã¹ããçºè¡ã§ããŸãã 次ã«ãæçµçã«JIRAã¢ã«ãŠã³ããååŸããŸãã ããã§ãèšäºã®ååãåãã§å¿ããããšãã§ããŸããããããéä¿¡ããã³ã³ããŒãã³ãã ãã§ãªããèªåã§ãã°ãé©åã«å ±åã§ããŸãã ãã°ã«æ祚ããããéç¥ã賌èªãããããããšãã§ããŸãã ãããããããªãã®ååããã®ãªã¹ãã«è¡šç€ºãããŸã ã ããã§ã¯ãããŸããŸãªãããžã§ã¯ãã®äººã ã®ã¹ããŒã¿ã¹ãèŠãããšãã§ããŸãã
ãã ããOpenJDK Authorã¬ãã«ã§ã¯ããŸã ãããã®ã¹ãã³ãµãŒãå¿ èŠã§ãã ããããã¡ãŒãªã³ã°ãªã¹ãã«éä¿¡ããå¿ èŠã¯ãããŸãããã webrevããŒã«ã䜿çšããŠç¹å¥ãªHTML-e-csã®ã»ãããçæããå¿ èŠããããŸãïŒããã¯kshã¹ã¯ãªããã§ãããWindowsã®å Žåã¯Ubuntuããä»®æ³ãã·ã³ãã€ã³ã¹ããŒã«ããå¿ èŠããããŸãããWindowsã§ã¯ãã³çãã§ããŸããã§ããïŒã ãããªæãã§ãã webrevãçæããããšã«ãããã³ãŒãã¬ãã¥ãŒã¡ãŒãªã³ã°ãªã¹ãã«ãªã³ã¯ãéä¿¡ããã³ã¡ã³ãã®æºåãããŸãã 誰ããã³ãŒããã³ãããããããšã«åæããå¿ èŠããããŸãããããªãèªèº«ãã³ãããã®äœæè ã«ãªããŸãã
次ã®ã¬ãã«ã¯OpenJDKã³ããã¿ãŒã§ãã 1ã€ã«ãªãã«ã¯ããããžã§ã¯ãã®ã¡ã€ã³ãªã¹ãã®ã³ããã¿ãŒ ïŒããšãã°jdk9-dev ïŒã«ãã£ãŠãã®ã¿ã€ãã«ã«ããããŒããããå¿ èŠããããŸãã ãã®ãããååãšããŠããããžã§ã¯ãã«å°ãªããšã8ã€ã®éèŠãªå€æŽãå¿ èŠã§ãã æ祚ã¯éåžžã«ç°¡åã§ã-å察ããã¹ãã§ã¯ãããŸããã ãã®ã¿ã€ãã«ã䜿çšãããšãã¹ãã³ãµãŒã¯äžèŠã«ãªããŸãã èªåã§å€æŽãã³ãããããä»ã®äººãåŸæŽããããšãã§ããŸãã ãããããã¡ãããããã¯ã³ãŒãã¬ãã¥ãŒããã£ã³ã»ã«ããŸããã
æåŸã«ãOpenJDK Reviewerã®ã¬ãã«ã«å°éã§ããŸãã ããã§ã¯ãã»ãŒåãããšã§ã-æåãæ祚ã§ãããèŠä»¶ã¯ãã§ã«å³ãããªã£ãŠããŸãã ã¬ãã¥ã¢ãŒã®ã¿ãæåããŠæ祚ã§ããŸããå察祚ããªãå Žåãæäœ3祚ã®è³æãå¿ èŠã§ãã ãã®ã¹ããŒã¿ã¹ã«ãããä»ã®äººã®å€æŽãæ£åŒã«ç¢ºèªã§ããŸãã ã¹ããŒã¿ã¹ãšãã®ååŸæé ã«ã€ããŠã¯ã ãã¡ããã芧ãã ãã ã
ãããã«
Javaã®ãã°ãä¿®æ£ããããšã¯ããã¹ãŠã«å¯ŸåŠããã®ã«ååãªå¿èãšå¿èã瀺ããã°ãååãšããŠããã»ã©é£ãããããŸããã ãããªãã¯APIãå€æŽããæ°æ©èœã宣äŒããããšã¯ã¯ããã«å°é£ã§ãã ããã§çŽ æŽãããã¢ã€ãã¢ãç°¡åã«ãŸãšããããšãã§ããŸãã ããéãèŠããããã«ããããã«ãæ©èœããå§ããã®ã§ã¯ãªããããã€ãã®åçŽãªãã°ã®å°ãªããšãèè ã«ãªãããšããå§ãããŸãã JIRAã§ãªãŒãã³ãã±ãããæãäžããŠãç°¡åãªãã®ãèŠã€ããããšãã§ããŸãã ããã¯éåžžã«å€ããããäžçŽéçºè ã¯åžžã«å°ããªããšãããéããæéãããããã§ã¯ãããŸããã ããã§ãæ©èœãæäŸããå Žåã¯ãåé¡ã®å±¥æŽã調ã¹ãããã«æ tooã«ãªããªãã§ãã ãããã¡ãŒãªã³ã°ãªã¹ãã®ã¢ãŒã«ã€ãã確èªããŠãã ããã ããããè°è«ãããäœããã®çç±ã§ãããããªãããšã«æ±ºããŸããã æ°ããçç±ããããã©ãããèããŠãã ããã
åãã§ããã°ã©ã ããJavaãæ¹åããŸãããïŒ