changeset 47405:fad77d011e0c patterns

Fixing handling of matches matches matches.
author jlahoda
date Wed, 11 Oct 2017 15:01:14 +0200
parents 228c2e1ccb6b
children ed6b1ad2cb86
files src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java test/langtools/tools/javac/patterns/MatchesToken.java
diffstat 2 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java	Thu Oct 05 22:05:38 2017 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java	Wed Oct 11 15:01:14 2017 +0200
@@ -1040,6 +1040,8 @@
                 case DOT:
                 case EQ:
                     return false;
+                case MATCHES:
+                    return true;
                 default: return optag(tk) == Tag.NO_TAG;
             }
         };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/langtools/tools/javac/patterns/MatchesToken.java	Wed Oct 11 15:01:14 2017 +0200
@@ -0,0 +1,13 @@
+/**
+ * @test
+ * @compile MatchesToken.java
+ */
+public class MatchesToken {
+    public void test(Object o) {
+        final int __matches = 1;
+        boolean b1 = __matches __matches __matches;
+        boolean b2 = o __matches __matches;
+        boolean b3 = __matches __matches Integer i;
+    }
+}
+