/hg/icedtea7-forest/langtools: 4 new changesets

andrew at icedtea.classpath.org andrew at icedtea.classpath.org
Thu Jul 27 15:49:16 UTC 2017


changeset 853798299f7a in /hg/icedtea7-forest/langtools
details: http://icedtea.classpath.org/hg/icedtea7-forest/langtools?cmd=changeset;node=853798299f7a
author: andrew
date: Thu Apr 27 02:45:33 2017 +0100

	Added tag jdk7u141-b00 for changeset b1802aa8be3a


changeset ba8ba083c439 in /hg/icedtea7-forest/langtools
details: http://icedtea.classpath.org/hg/icedtea7-forest/langtools?cmd=changeset;node=ba8ba083c439
author: andrew
date: Thu Apr 27 06:11:41 2017 +0100

	Added tag jdk7u141-b01 for changeset 853798299f7a


changeset aca9535e921d in /hg/icedtea7-forest/langtools
details: http://icedtea.classpath.org/hg/icedtea7-forest/langtools?cmd=changeset;node=aca9535e921d
author: andrew
date: Fri Jul 14 00:56:17 2017 +0100

	Merge jdk7u141-b02


changeset a4036f67fb21 in /hg/icedtea7-forest/langtools
details: http://icedtea.classpath.org/hg/icedtea7-forest/langtools?cmd=changeset;node=a4036f67fb21
author: andrew
date: Thu Jul 27 16:57:31 2017 +0100

	Added tag icedtea-2.7.0pre12 for changeset aca9535e921d


diffstat:

 .hgtags                                                             |   55 +
 .jcheck/conf                                                        |    2 -
 make/Makefile                                                       |    4 +
 make/build.properties                                               |    3 +-
 make/build.xml                                                      |    2 +-
 src/share/classes/com/sun/tools/javac/parser/JavacParser.java       |   33 +-
 src/share/classes/com/sun/tools/javac/resources/compiler.properties |    4 +
 test/tools/javac/T5090006/broken.jar                                |  Bin 
 test/tools/javac/diags/examples/ForeachBadInitialization.java       |   31 +
 test/tools/javac/enum/8069181/T8069181.java                         |   45 +
 test/tools/javac/parser/JavacParserTest.java                        |  886 ++++++++++
 test/tools/javac/parser/netbeans/JavacParserTest.java               |  716 --------
 12 files changed, 1049 insertions(+), 732 deletions(-)

diffs (truncated from 1982 to 500 lines):

diff -r b1802aa8be3a -r a4036f67fb21 .hgtags
--- a/.hgtags	Tue Feb 07 01:26:22 2017 +0000
+++ b/.hgtags	Thu Jul 27 16:57:31 2017 +0100
@@ -50,6 +50,7 @@
 9596dff460935f09684c11d156ce591f92584f0d jdk7-b73
 1a66b08deed0459054b5b1bea3dfbead30d258fa jdk7-b74
 2485f5641ed0829205aaaeb31ad711c2c2ef0de3 jdk7-b75
+83367f01297bf255f511f5291bbbbaa24a9c8459 icedtea7-1.12
 8fb9b4be3cb1574302acde90549a4d333ef51e93 jdk7-b76
 0398ae15b90ac76d87ee21844453e95ff8613e43 jdk7-b77
 acc1e40a5874ebf32bebcb6ada565b3b40b7461c jdk7-b78
@@ -63,6 +64,7 @@
 ef07347428f2198ae6b8144ac0b9086bbe39fd16 jdk7-b86
 409db93d19c002333980df5b797c6b965150c7a0 jdk7-b87
 f9b5d4867a26f8c4b90ad37fe2c345b721e93d6b jdk7-b88
+681f1f51926faf4c73d8905a429ff4ead6e9d622 icedtea7-1.13
 6cea9a143208bc1185ced046942c0f4e45dbeba5 jdk7-b89
 71c2c23a7c35b2896c87004023b9743b6d1b7758 jdk7-b90
 97b6fa97b8ddb3a49394011c2a0ec5d6535e594c jdk7-b91
@@ -111,6 +113,7 @@
 3d7acdbb72cab55deedfd35f60d4732abc9d6ac4 jdk7-b134
 9d0a61ac567b983da7cc8f4a7030f2245bb6dbab jdk7-b135
 ed0f7f1f9511db4f9615b1426d22f8b961629275 jdk7-b136
+8e26c4aee63c04ee129bf9068f5eea47cc385177 icedtea-1.14
 a15c9b058ae007d4ccb7e35ce44e4dfa977f090b jdk7-b137
 53f212bed4f4304dce7f0bf0fa01c998c65bacd6 jdk7-b138
 853b6bb99f9b58eb7cf8211c67d3b6e4f1228a3e jdk7-b139
@@ -123,6 +126,7 @@
 9425dd4f53d5bfcd992d9aecea0eb7d8b2d4f62b jdk7-b146
 d34578643d1c6c752d4a6b5e79c6ab1b60850b4a jdk7u1-b01
 58bc532d63418ac3c9b42460d89cdaf595c6f3e1 jdk7-b147
+fb7fb3071b642334520e5b9f4a87ce28717af61c icedtea-2.0-branchpoint
 cd2cc8b5edb045b950aed46d159b4fb8fc2fd1df jdk7u1-b02
 82820a30201dbf4b80f1916f3d0f4a92ad21b61a jdk7u1-b03
 baa2c13c70fea3d6e259a34f0903197fdceb64b5 jdk7u1-b04
@@ -141,6 +145,7 @@
 f0802d8a0909f66ce19d3d44b33ddf4943aee076 jdk7u2-b12
 f474527e77e4797d78bd6c3b31923fddcfd9d5c6 jdk7u2-b13
 fc0769df8cd03fffc38c7a1ab6b2e2e7cc2506a8 jdk7u2-b21
+58f6a950cd726220e81eddb126ca5c57e3b368f2 icedtea-2.1-branchpoint
 fc0769df8cd03fffc38c7a1ab6b2e2e7cc2506a8 jdk7u3-b02
 0ffc4995457773085f61c39f6d33edc242b41bcf jdk7u3-b03
 f6de36b195cd315646213c7affd2cc15702edbfb jdk7u3-b04
@@ -157,6 +162,7 @@
 8919b2b02fcba65f833c68374f3bfdd9bc3ba814 jdk7u4-b10
 4672e092f0968d503dc37f860b15ae7e2653f8d7 jdk7u4-b11
 a4bf6a1aff54a98e9ff2b3fb53c719f658bec677 jdk7u4-b12
+e3537a4f75c7fcca16c349c3175bb0cdc2fbc29c icedtea-2.2-branchpoint
 56eb9150d9ffdb71c47d72871e8ecc98b5f402de jdk7u4-b13
 0e55881c2ee2984048c179d1e031cefb56a36bec jdk7u4-b14
 0bea057f7ce1577e1b0306f2027c057e35394398 jdk7u5-b01
@@ -186,11 +192,15 @@
 21d2313dfeac8c52a04b837d13958c86346a4b12 jdk7u6-b10
 13d3c624291615593b4299a273085441b1dd2f03 jdk7u6-b11
 f0be10a26af08c33d9afe8fe51df29572d431bac jdk7u6-b12
+e3eeee75b861baf378d41adcd29ae70ed047eae7 ppc-aix-port-b01
+e3eeee75b861baf378d41adcd29ae70ed047eae7 ppc-aix-port-b02
+e3eeee75b861baf378d41adcd29ae70ed047eae7 ppc-aix-port-b03
 fcebf337f5c1d342973573d9c6f758443c8aefcf jdk7u6-b13
 35b2699c6243e9fb33648c2c25e97ec91d0e3553 jdk7u6-b14
 47ae28da508861d77ee6dd408d822acf507b28ec jdk7u6-b15
 5c7763489f4d2727c6d9de11f4114fb8ed839042 jdk7u6-b16
 66c671f28cb2840ceec5b44c44bac073fc0b4256 jdk7u6-b17
+cee31ee38a190f77b1e21c0515bb28802dcd9678 icedtea-2.3-branchpoint
 6aa859ef42876c51bb1b1d7fb4db32a916a7dcaa jdk7u6-b18
 474a52eeeafb1feccffda68b96f651e65415c01d jdk7u6-b19
 32acb67a79531daf678577c7ef1bde1867da807d jdk7u6-b20
@@ -258,11 +268,13 @@
 382bab6d9682eefa2185a1643dfa32d65b6c20e5 jdk7u12-b07
 7c0c3aeb2c603baba2cabba9adc5a0a49afb4f47 jdk7u12-b08
 96c4f3ec63552a87a825baabd7f0dfafec299483 jdk7u12-b09
+85fb9d7ce4af53f0a47d2b73d983c96239f9ff33 icedtea-2.4-branchpoint
 e5b1403fa68abe3ac7174c031f19e6ecf77624a0 jdk7u14-b10
 db94066df63468172e074d59e71d82dc874ed7cb jdk7u14-b11
 f9a326e92fafc4724f0af550c2cba82fea202a31 jdk7u14-b12
 5a52c6cc8db94b68eaacb42a9b4df30a40b09d82 jdk7u14-b13
 5febc4e479fad801424cdcce90a0d463a2ef9223 jdk7u14-b14
+d52538e72925a1da7b1fcff051b591beeb2452b4 ppc-aix-port-b04
 5fdb509d1f1a0533b14c61c92d77ff21e0ce2488 jdk7u14-b15
 1298307076c2f0c2a4acd3a2a132cbe98d399009 jdk7u15-b01
 8db0105f00ce9fe6899ece52d46d78995111c456 jdk7u15-b02
@@ -382,6 +394,7 @@
 ba3ff27d4082f2cf0d06e635b2b6e01f80e78589 jdk7u45-b18
 164cf7491ba2f371354ba343a604eee4c61c529d jdk7u45-b30
 7f5cfaedb25c2c2774d6839810d6ae543557ca01 jdk7u45-b31
+849b17bc6e9a08fa41e0ef631e51366a09842e64 jdk7u60-b00
 ef7bdbe7f1fa42fd58723e541d9cdedcacb2649a jdk7u45-b33
 bcb3e939d046d75436c7c8511600b6edce42e6da jdk7u45-b34
 efbda7abd821f280ec3a3aa6819ad62d45595e55 jdk7u45-b35
@@ -430,8 +443,11 @@
 849b17bc6e9a08fa41e0ef631e51366a09842e64 jdk7u60-b00
 b19e375d9829daf207b1bdc7f908a3e1d548462c jdk7u60-b01
 954e1616449af74f68aed57261cbeb62403377f1 jdk7u60-b02
+0d89cc5766d72e870eaf16696ec9b7b1ca4901fd icedtea-2.5pre01
+f75a642c2913e1ecbd22fc46812cffa2e7739169 icedtea-2.5pre02
 4170784840d510b4e8ae7ae250b92279aaf5eb25 jdk7u60-b03
 772aad4e9681828b8ee193b9ed971cbfe6c7f347 jdk7u60-b04
+702454ac1a074e81890fb07da06ebf00370e42ed icedtea-2.6pre01
 744287fccf3b2c4fba2abf105863f0a44c3bd4da jdk7u60-b05
 8f6db72756f3e4c3cca8731d20e978fb741846d2 jdk7u60-b06
 02f050bc5569fb058ace44ed705bbb0f9022a6fe jdk7u60-b07
@@ -441,7 +457,11 @@
 3cc64ba8cf85942929b15c5ef21360f96db3b99c jdk7u60-b11
 b79b8b1dc88faa73229b2bce04e979ff5ec854f5 jdk7u60-b12
 3dc3e59e9580dfdf95dac57c54fe1a4209401125 jdk7u60-b13
+2040d4afc89815f6bf54a597ff58a70798b68e3d icedtea-2.6pre02
+2950924c2b80dc4d3933a8ab15a0ebb39522da5a icedtea-2.6pre03
 a8b9c1929e50a9f3ae9ae1a23c06fa73a57afce3 jdk7u60-b14
+fa084876cf02f2f9996ad8a0ab353254f92c5564 icedtea-2.6pre04
+5f917c4b87a952a8bf79de08f3e2dd3e56c41657 icedtea-2.6pre05
 7568ebdada118da1d1a6addcf6316ffda21801fd jdk7u60-b15
 057caf9e0774e7c530c5710127f70c8d5f46deab jdk7u60-b16
 b7cc00c573c294b144317d44803758a291b3deda jdk7u60-b17
@@ -581,10 +601,27 @@
 e5e807700ff84f7bd9159ebc828891ae3ddb859c jdk7u79-b15
 772aad4e9681828b8ee193b9ed971cbfe6c7f347 jdk7u80-b00
 6c307a0b7a94e002d8a2532ffd8146d6c53f42d3 jdk7u80-b01
+3eab691bd9ac5222c11dbabb7b5fbc8463c62df6 icedtea-2.6pre07
+f43a81252f827395020fe71099bfa62f2ca0de50 icedtea-2.6pre06
+cdf407c97754412b02ebfdda111319dbd3cb9ca9 icedtea-2.6pre08
 5bd6f3adf690dc2de8881b6f9f48336db4af7865 jdk7u80-b02
+55486a406d9f111eea8996fdf6144befefd86aff icedtea-2.6pre09
+cf836e0ed10de1179ec398a7db323e702b60ca35 icedtea-2.6pre10
+510234036e06ec8d7ed2a39ee11faf1b9a4257b0 icedtea-2.6pre11
 bcbd241df6cd0a643480c8de183c541a662dd506 jdk7u80-b03
+987d772301e91c896178f47f39d82d87e9da1e39 icedtea-2.6pre12
+a072de9f83ed85a6a86d052d13488009230d7d4b icedtea-2.6pre13
+ecf2ec173dd2c19b63d7cf543db23ec7d4f4732a icedtea-2.6pre14
+029dd486cd1a8f6d7684b1633aae41c613055dd2 icedtea-2.6pre15
+c802d4cdd4cbfa8116e4f612cf536de32d67221a icedtea-2.6pre16
+e1dd8fea9abd3663838008063715b4b7ab5a58a4 icedtea-2.6pre17
 04b56f4312b62d8bdf4eb1159132de8437994d34 jdk7u80-b04
 f40fb76025c798cab4fb0e1966be1bceb8234527 jdk7u80-b05
+bb9d09219d3e74954b46ad53cb99dc307e39e120 icedtea-2.6pre18
+4c600e18a7e415702f6a62073c8c60f6b2cbfc11 icedtea-2.6pre19
+1a60fa408f57762abe32f19e4f3d681fb9c4960b icedtea-2.6pre20
+5331b041c88950058f8bd8e9669b9763be6ee03f icedtea-2.6pre21
+a322987c412f5f8584b15fab0a4505b94c016c22 icedtea-2.6pre22
 335ee524dc68a42863f3fa3f081b781586e7ba2d jdk7u80-b06
 6f7b359c4e9f82cbd399edc93c3275c3e668d2ea jdk7u80-b07
 e6db2a97b3696fb5e7786b23f77af346a935a370 jdk7u80-b08
@@ -597,9 +634,19 @@
 d0cc1c8ace99283d7b2354d2c0e5cd58787163c8 jdk7u80-b30
 f2b4d5e42318ed93d35006ff7d1b3b0313b5a71f jdk7u80-b15
 f1ffea3bd4a4df0f74ce0c127aeacf6bd11ee612 jdk7u80-b32
+403eeedf70f4b0e3c88f094d324e5c85959610e2 icedtea-2.6pre23
+bc95d2472055d96a712db09ecd8ab42e52058481 icedtea-2.6pre24
+bc95d2472055d96a712db09ecd8ab42e52058481 icedtea-2.6.0
 1b20ca77fa98bb29d1f5601f027b3055e9eb28ee jdk7u85-b00
 dce5a828bdd56d228724f1e9c6253920f613cec5 jdk7u85-b01
+bc95d2472055d96a712db09ecd8ab42e52058481 icedtea-2.6-branchpoint
+9c6e1de67d7d26809d02c8ce3d6629503cb67d19 icedtea-2.7.0pre01
+b9a7cf56b4de072a3fec512687c8923d5f207692 icedtea-2.7.0pre02
 b22cdae823bac193338d928e86319cd3741ab5fd jdk7u85-b02
+e5daf5b722d5b388363e0851dab31a9e2896784a icedtea-2.7.0pre03
+e15dd34800b580c84cc6587dcc1b62510a443afd icedtea-2.7.0pre04
+caa50dd46a142ddf99c5c08d76ce8242f943f471 icedtea-2.7.0pre05
+bd3480b6d64ab1f76ffb0a074aaf12d08b47f17f icedtea-2.7.0pre06
 2741575d96f3985d41de8ebe1ba7fae8afbb0fde jdk7u91-b00
 1a9e2dcc91dc3d0c103b09c478b3ac31ac45733f jdk7u91-b01
 08e99c45e470ce8b87875c1cbe78ac2f341555a3 jdk7u91-b02
@@ -608,5 +655,13 @@
 5713b8d2db3f1fc0c9802fdaf30ca802cddf8f65 jdk7u101-b00
 e65eb66727550af75293996fc42e2c49c2002659 jdk7u111-b00
 a5002845bff276d1a8e4bdb4a0dcb972509f7d07 jdk7u111-b01
+e5b9f24eecf6abb83bcf7aabb284bbe841cec9fe icedtea-2.7.0pre07
+5f91109e88344f8f86072f5350abbe2b31f20617 icedtea-2.7.0pre08
+03fc0f1fced1ebfb36d33a6fed748dc494fa9d90 icedtea-2.7.0pre09
 3715f0221fd743e878ae5198dbaebe61ebd4fa97 jdk7u121-b00
 240ca8086e7151b5c516b5b46d84201e4e8f5806 jdk7u131-b00
+f6551a412274db580398e1f3ca26a0cda3ae3d7d icedtea-2.7.0pre10
+e5e327d32e652fe85a7f285ccc1b65917a835829 icedtea-2.7.0pre11
+b1802aa8be3a49d2a5c07160f2406165e309efde jdk7u141-b00
+853798299f7a4f38745632dc256219fbf75f861e jdk7u141-b01
+aca9535e921d64914e5288699c20e422e726df9a icedtea-2.7.0pre12
diff -r b1802aa8be3a -r a4036f67fb21 .jcheck/conf
--- a/.jcheck/conf	Tue Feb 07 01:26:22 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-project=jdk7
-bugids=dup
diff -r b1802aa8be3a -r a4036f67fb21 make/Makefile
--- a/make/Makefile	Tue Feb 07 01:26:22 2017 +0000
+++ b/make/Makefile	Thu Jul 27 16:57:31 2017 +0100
@@ -111,6 +111,10 @@
   ANT_OPTIONS += -Ddebug.classfiles=true
 endif
 
+ifeq ($(JAVAC_WARNINGS_FATAL), false)
+  ANT_OPTIONS += -Djavac.warnings.fatal=
+endif
+
 # Note: jdk/make/common/Defs.gmk uses LANGUAGE_VERSION (-source NN)
 # and the somewhat misnamed CLASS_VERSION (-target NN)
 ifdef TARGET_CLASS_VERSION
diff -r b1802aa8be3a -r a4036f67fb21 make/build.properties
--- a/make/build.properties	Tue Feb 07 01:26:22 2017 +0000
+++ b/make/build.properties	Thu Jul 27 16:57:31 2017 +0100
@@ -68,7 +68,8 @@
 # set the following to -version to verify the versions of javac being used
 javac.version.opt =
 # in time, there should be no exceptions to -Xlint:all
-javac.lint.opts = -Xlint:all,-deprecation -Werror
+javac.warnings.fatal = -Werror
+javac.lint.opts = -Xlint:all,-deprecation ${javac.warnings.fatal}
 
 # options for the <javadoc> task for javac
 #javadoc.jls3.url=http://java.sun.com/docs/books/jls/
diff -r b1802aa8be3a -r a4036f67fb21 make/build.xml
--- a/make/build.xml	Tue Feb 07 01:26:22 2017 +0000
+++ b/make/build.xml	Thu Jul 27 16:57:31 2017 +0100
@@ -877,7 +877,7 @@
         </javac>
         <taskdef name="genstubs"
                  classname="GenStubs$$Ant"
-                 classpath="${build.toolclasses.dir}/"/>
+                 classpath="${build.toolclasses.dir}:${build.bootstrap.dir}/classes:${ant.home}/lib/ant.jar"/>
     </target>
 
     <target name="-def-javadoc-tool" depends="-check-target.java.home">
diff -r b1802aa8be3a -r a4036f67fb21 src/share/classes/com/sun/tools/javac/parser/JavacParser.java
--- a/src/share/classes/com/sun/tools/javac/parser/JavacParser.java	Tue Feb 07 01:26:22 2017 +0000
+++ b/src/share/classes/com/sun/tools/javac/parser/JavacParser.java	Thu Jul 27 16:57:31 2017 +0100
@@ -1962,10 +1962,15 @@
         } else {
             JCExpression t = term(EXPR | TYPE);
             if ((lastmode & TYPE) != 0 &&
-                (S.token() == IDENTIFIER || S.token() == ASSERT || S.token() == ENUM))
-                return variableDeclarators(modifiersOpt(), t, stats).toList();
-            else
+                (S.token() == IDENTIFIER || S.token() == ASSERT ||
+                 S.token() == ENUM)) {
+                return variableDeclarators(mods(pos, 0, List.<JCAnnotation>nil()), t, stats).toList();
+            } else if ((lastmode & TYPE) != 0 && S.token() == COLON) {
+                error(pos, "bad.initializer", "for-loop");
+                return List.of((JCStatement)F.at(pos).VarDef(null, null, t, null));
+            } else {
                 return moreStatementExpressions(pos, t, stats).toList();
+            }
         }
     }
 
@@ -2057,16 +2062,20 @@
         default: break;
         }
 
-        /* A modifiers tree with no modifier tokens or annotations
-         * has no text position. */
-        if ((flags & (Flags.ModifierFlags | Flags.ANNOTATION)) == 0 && annotations.isEmpty())
-            pos = Position.NOPOS;
+        return mods(pos, flags, annotations.toList());
+    }
+    //where
+        JCModifiers mods(int pos, long flags, List<JCAnnotation> annotations) {
+            /* A modifiers tree with no modifier tokens or annotations
+             * has no text position. */
+            if ((flags & (Flags.ModifierFlags | Flags.ANNOTATION)) == 0 && annotations.isEmpty())
+                pos = Position.NOPOS;
 
-        JCModifiers mods = F.at(pos).Modifiers(flags, annotations.toList());
-        if (pos != Position.NOPOS)
-            storeEnd(mods, S.prevEndPos());
-        return mods;
-    }
+            JCModifiers mods = F.at(pos).Modifiers(flags, annotations);
+            if (pos != Position.NOPOS)
+                storeEnd(mods, S.prevEndPos());
+            return mods;
+        }
 
     /** Annotation              = "@" Qualident [ "(" AnnotationFieldValues ")" ]
      * @param pos position of "@" token
diff -r b1802aa8be3a -r a4036f67fb21 src/share/classes/com/sun/tools/javac/resources/compiler.properties
--- a/src/share/classes/com/sun/tools/javac/resources/compiler.properties	Tue Feb 07 01:26:22 2017 +0000
+++ b/src/share/classes/com/sun/tools/javac/resources/compiler.properties	Thu Jul 27 16:57:31 2017 +0100
@@ -143,6 +143,10 @@
 compiler.err.attribute.value.must.be.constant=\
     attribute value must be constant
 
+# 0: statement type
+compiler.err.bad.initializer=\
+    bad initializer for {0}
+
 compiler.err.break.outside.switch.loop=\
     break outside switch or loop
 
diff -r b1802aa8be3a -r a4036f67fb21 test/tools/javac/T5090006/broken.jar
Binary file test/tools/javac/T5090006/broken.jar has changed
diff -r b1802aa8be3a -r a4036f67fb21 test/tools/javac/diags/examples/ForeachBadInitialization.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/ForeachBadInitialization.java	Thu Jul 27 16:57:31 2017 +0100
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+// key: compiler.err.bad.initializer
+import java.util.List;
+class ForeachBadInitialization {
+    void m() {
+        List<String> s = null;
+        for (a : s) {}
+    }
+}
diff -r b1802aa8be3a -r a4036f67fb21 test/tools/javac/enum/8069181/T8069181.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/enum/8069181/T8069181.java	Thu Jul 27 16:57:31 2017 +0100
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8069181
+ * @summary java.lang.AssertionError when compiling JDK 1.4 code in JDK 8
+ *
+ * @compile -source 1.4 T8069181.java
+ */
+import java.util.Enumeration;
+import java.util.Hashtable;
+class T8069181 {
+    void test() {
+        Hashtable hTable = new Hashtable();
+        hTable.put("hello", "value");
+        for (Enumeration enum = hTable.keys();;){
+            if(!enum.hasMoreElements())
+                break;
+            enum.nextElement();
+        }
+    }
+}
diff -r b1802aa8be3a -r a4036f67fb21 test/tools/javac/parser/JavacParserTest.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/parser/JavacParserTest.java	Thu Jul 27 16:57:31 2017 +0100
@@ -0,0 +1,886 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 7073631 7159445
+ * @summary tests error and diagnostics positions
+ * @author  Jan Lahoda
+ */
+
+import com.sun.source.tree.BinaryTree;
+import com.sun.source.tree.BlockTree;
+import com.sun.source.tree.ClassTree;
+import com.sun.source.tree.CompilationUnitTree;
+import com.sun.source.tree.ErroneousTree;
+import com.sun.source.tree.ExpressionStatementTree;
+import com.sun.source.tree.ExpressionTree;
+import com.sun.source.tree.MethodInvocationTree;
+import com.sun.source.tree.MethodTree;
+import com.sun.source.tree.ModifiersTree;
+import com.sun.source.tree.StatementTree;
+import com.sun.source.tree.Tree;
+import com.sun.source.tree.Tree.Kind;
+import com.sun.source.tree.VariableTree;
+import com.sun.source.tree.WhileLoopTree;
+import com.sun.source.util.SourcePositions;
+import com.sun.source.util.TreeScanner;
+import com.sun.source.util.Trees;
+import com.sun.tools.javac.api.JavacTaskImpl;
+import com.sun.tools.javac.tree.JCTree;
+import java.io.IOException;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.LinkedList;
+import java.util.List;
+import javax.tools.Diagnostic;
+import javax.tools.DiagnosticCollector;
+import javax.tools.DiagnosticListener;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.SimpleJavaFileObject;
+import javax.tools.ToolProvider;
+
+public class JavacParserTest extends TestCase {
+    final JavaCompiler tool;
+    public JavacParserTest(String testName) {
+        tool = ToolProvider.getSystemJavaCompiler();
+        System.out.println("java.home=" + System.getProperty("java.home"));
+    }
+
+    static class MyFileObject extends SimpleJavaFileObject {
+
+        private String text;
+
+        public MyFileObject(String text) {
+            super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
+            this.text = text;
+        }
+
+        @Override
+        public CharSequence getCharContent(boolean ignoreEncodingErrors) {
+            return text;
+        }
+    }
+    /*
+     * converts Windows to Unix style LFs for comparing strings
+     */
+    private String normalize(String in) {
+        return in.replace(System.getProperty("line.separator"), "\n");
+    }
+
+    public CompilationUnitTree getCompilationUnitTree(String code) throws IOException {
+
+        JavacTaskImpl ct = (JavacTaskImpl) tool.getTask(null, null, null, null,
+                null, Arrays.asList(new MyFileObject(code)));
+        CompilationUnitTree cut = ct.parse().iterator().next();
+        return cut;
+    }
+
+    public List<String> getErroneousTreeValues(ErroneousTree node) {
+
+        List<String> values = new ArrayList<>();
+        if (node.getErrorTrees() != null) {
+            for (Tree t : node.getErrorTrees()) {
+                values.add(t.toString());
+            }
+        } else {
+            throw new RuntimeException("ERROR: No Erroneous tree "
+                    + "has been created.");
+        }
+        return values;
+    }
+
+    public void testPositionForSuperConstructorCalls() throws IOException {
+        assert tool != null;
+
+        String code = "package test; public class Test {public Test() {super();}}";
+
+        JavacTaskImpl ct = (JavacTaskImpl) tool.getTask(null, null, null, null,
+                null, Arrays.asList(new MyFileObject(code)));
+        CompilationUnitTree cut = ct.parse().iterator().next();
+        SourcePositions pos = Trees.instance(ct).getSourcePositions();
+


More information about the distro-pkg-dev mailing list