4666 if (!"abc1c".matches("(\\w)+1\\1") || 4667 "abc11".matches("(\\w)+1\\1")) { 4668 failCount++; 4669 } 4670 report("GroupCurly backoff"); 4671 } 4672 4673 // This test is for 8012646 4674 private static void patternAsPredicate() throws Exception { 4675 Predicate<String> p = Pattern.compile("[a-z]+").asPredicate(); 4676 4677 if (p.test("")) { 4678 failCount++; 4679 } 4680 if (!p.test("word")) { 4681 failCount++; 4682 } 4683 if (p.test("1234")) { 4684 failCount++; 4685 } 4686 report("Pattern.asPredicate"); 4687 } 4688 4689 // This test is for 8035975 4690 private static void invalidFlags() throws Exception { 4691 for (int flag = 1; flag != 0; flag <<= 1) { 4692 switch (flag) { 4693 case Pattern.CASE_INSENSITIVE: 4694 case Pattern.MULTILINE: 4695 case Pattern.DOTALL: 4696 case Pattern.UNICODE_CASE: 4697 case Pattern.CANON_EQ: 4698 case Pattern.UNIX_LINES: 4699 case Pattern.LITERAL: 4700 case Pattern.UNICODE_CHARACTER_CLASS: 4701 case Pattern.COMMENTS: 4702 // valid flag, continue 4703 break; 4704 default: 4705 try { | 4666 if (!"abc1c".matches("(\\w)+1\\1") || 4667 "abc11".matches("(\\w)+1\\1")) { 4668 failCount++; 4669 } 4670 report("GroupCurly backoff"); 4671 } 4672 4673 // This test is for 8012646 4674 private static void patternAsPredicate() throws Exception { 4675 Predicate<String> p = Pattern.compile("[a-z]+").asPredicate(); 4676 4677 if (p.test("")) { 4678 failCount++; 4679 } 4680 if (!p.test("word")) { 4681 failCount++; 4682 } 4683 if (p.test("1234")) { 4684 failCount++; 4685 } 4686 if (!p.test("word1234")) { 4687 failCount++; 4688 } 4689 report("Pattern.asPredicate"); 4690 } 4691 4692 // This test is for 8035975 4693 private static void invalidFlags() throws Exception { 4694 for (int flag = 1; flag != 0; flag <<= 1) { 4695 switch (flag) { 4696 case Pattern.CASE_INSENSITIVE: 4697 case Pattern.MULTILINE: 4698 case Pattern.DOTALL: 4699 case Pattern.UNICODE_CASE: 4700 case Pattern.CANON_EQ: 4701 case Pattern.UNIX_LINES: 4702 case Pattern.LITERAL: 4703 case Pattern.UNICODE_CHARACTER_CLASS: 4704 case Pattern.COMMENTS: 4705 // valid flag, continue 4706 break; 4707 default: 4708 try { |