Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell11
提交
ed4e701d
D
dragonwell11
项目概览
openanolis
/
dragonwell11
通知
7
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell11
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ed4e701d
编写于
6月 02, 2016
作者:
S
sherman
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8158482: regex UNICODE_CHARACTER_CLASS flag cannot be disabled with an embedded flag expression
Reviewed-by: bpb
上级
6a27171f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
21 addition
and
1 deletion
+21
-1
jdk/src/java.base/share/classes/java/util/regex/Pattern.java
jdk/src/java.base/share/classes/java/util/regex/Pattern.java
+1
-0
jdk/test/java/util/regex/RegExTest.java
jdk/test/java/util/regex/RegExTest.java
+20
-1
未找到文件。
jdk/src/java.base/share/classes/java/util/regex/Pattern.java
浏览文件 @
ed4e701d
...
...
@@ -3194,6 +3194,7 @@ loop: for(int x=0, offset=0; x<nCodePoints; x++, offset+=len) {
break
;
case
'U'
:
flags
&=
~(
UNICODE_CHARACTER_CLASS
|
UNICODE_CASE
);
break
;
default
:
return
;
}
...
...
jdk/test/java/util/regex/RegExTest.java
浏览文件 @
ed4e701d
...
...
@@ -34,7 +34,7 @@
* 7067045 7014640 7189363 8007395 8013252 8013254 8012646 8023647 6559590
* 8027645 8035076 8039124 8035975 8074678 6854417 8143854 8147531 7071819
* 8151481 4867170 7080302 6728861 6995635 6736245 4916384
* 6328855 6192895 6345469 6988218 6693451 7006761 8140212 8143282
* 6328855 6192895 6345469 6988218 6693451 7006761 8140212 8143282
8158482
*
* @library /lib/testlibrary
* @build jdk.testlibrary.*
...
...
@@ -164,6 +164,7 @@ public class RegExTest {
groupCurlyBackoffTest
();
patternAsPredicate
();
invalidFlags
();
embeddedFlags
();
grapheme
();
expoBacktracking
();
...
...
@@ -4675,6 +4676,24 @@ public class RegExTest {
report
(
"Invalid compile flags"
);
}
// This test is for 8158482
private
static
void
embeddedFlags
()
throws
Exception
{
try
{
Pattern
.
compile
(
"(?i).(?-i)."
);
Pattern
.
compile
(
"(?m).(?-m)."
);
Pattern
.
compile
(
"(?s).(?-s)."
);
Pattern
.
compile
(
"(?d).(?-d)."
);
Pattern
.
compile
(
"(?u).(?-u)."
);
Pattern
.
compile
(
"(?c).(?-c)."
);
Pattern
.
compile
(
"(?x).(?-x)."
);
Pattern
.
compile
(
"(?U).(?-U)."
);
Pattern
.
compile
(
"(?imsducxU).(?-imsducxU)."
);
}
catch
(
PatternSyntaxException
x
)
{
failCount
++;
}
report
(
"Embedded flags"
);
}
private
static
void
grapheme
()
throws
Exception
{
Files
.
lines
(
Paths
.
get
(
System
.
getProperty
(
"test.src"
,
"."
),
"GraphemeBreakTest.txt"
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录