Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
2e5f4127
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2e5f4127
编写于
4月 15, 2009
作者:
A
alanb
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6795561: (bf) CharBuffer.subSequence() uses wrong capacity value for new buffer
Reviewed-by: sherman, iris
上级
178d7fa4
变更
13
显示空白变更内容
内联
并排
Showing
13 changed file
with
67 addition
and
18 deletion
+67
-18
src/share/classes/java/nio/ByteBufferAs-X-Buffer.java
src/share/classes/java/nio/ByteBufferAs-X-Buffer.java
+6
-4
src/share/classes/java/nio/Direct-X-Buffer.java
src/share/classes/java/nio/Direct-X-Buffer.java
+6
-4
src/share/classes/java/nio/Heap-X-Buffer.java
src/share/classes/java/nio/Heap-X-Buffer.java
+6
-3
src/share/classes/java/nio/StringCharBuffer.java
src/share/classes/java/nio/StringCharBuffer.java
+4
-2
test/java/nio/Buffer/Basic-X.java
test/java/nio/Buffer/Basic-X.java
+7
-2
test/java/nio/Buffer/Basic.java
test/java/nio/Buffer/Basic.java
+1
-1
test/java/nio/Buffer/BasicByte.java
test/java/nio/Buffer/BasicByte.java
+5
-0
test/java/nio/Buffer/BasicChar.java
test/java/nio/Buffer/BasicChar.java
+7
-2
test/java/nio/Buffer/BasicDouble.java
test/java/nio/Buffer/BasicDouble.java
+5
-0
test/java/nio/Buffer/BasicFloat.java
test/java/nio/Buffer/BasicFloat.java
+5
-0
test/java/nio/Buffer/BasicInt.java
test/java/nio/Buffer/BasicInt.java
+5
-0
test/java/nio/Buffer/BasicLong.java
test/java/nio/Buffer/BasicLong.java
+5
-0
test/java/nio/Buffer/BasicShort.java
test/java/nio/Buffer/BasicShort.java
+5
-0
未找到文件。
src/share/classes/java/nio/ByteBufferAs-X-Buffer.java
浏览文件 @
2e5f4127
...
@@ -196,10 +196,12 @@ class ByteBufferAs$Type$Buffer$RW$$BO$ // package-private
...
@@ -196,10 +196,12 @@ class ByteBufferAs$Type$Buffer$RW$$BO$ // package-private
if
((
start
<
0
)
||
(
end
>
len
)
||
(
start
>
end
))
if
((
start
<
0
)
||
(
end
>
len
)
||
(
start
>
end
))
throw
new
IndexOutOfBoundsException
();
throw
new
IndexOutOfBoundsException
();
int
sublen
=
end
-
start
;
return
new
ByteBufferAsCharBuffer
$RW
$
$BO
$
(
bb
,
int
off
=
offset
+
((
pos
+
start
)
<<
$LG_BYTES_PER_VALUE
$
);
-
1
,
assert
(
off
>=
0
);
pos
+
start
,
return
new
ByteBufferAsCharBuffer
$RW
$
$BO
$
(
bb
,
-
1
,
0
,
sublen
,
sublen
,
off
);
pos
+
end
,
capacity
(),
offset
);
}
}
#
end
[
char
]
#
end
[
char
]
...
...
src/share/classes/java/nio/Direct-X-Buffer.java
浏览文件 @
2e5f4127
...
@@ -412,10 +412,12 @@ class Direct$Type$Buffer$RW$$BO$
...
@@ -412,10 +412,12 @@ class Direct$Type$Buffer$RW$$BO$
if
((
start
<
0
)
||
(
end
>
len
)
||
(
start
>
end
))
if
((
start
<
0
)
||
(
end
>
len
)
||
(
start
>
end
))
throw
new
IndexOutOfBoundsException
();
throw
new
IndexOutOfBoundsException
();
int
sublen
=
end
-
start
;
return
new
DirectCharBuffer
$RW
$
$BO
$
(
this
,
int
off
=
(
pos
+
start
)
<<
$LG_BYTES_PER_VALUE
$
;
-
1
,
assert
(
off
>=
0
);
pos
+
start
,
return
new
DirectCharBuffer
$RW
$
$BO
$
(
this
,
-
1
,
0
,
sublen
,
sublen
,
off
);
pos
+
end
,
capacity
(),
offset
);
}
}
#
end
[
char
]
#
end
[
char
]
...
...
src/share/classes/java/nio/Heap-X-Buffer.java
浏览文件 @
2e5f4127
...
@@ -572,10 +572,13 @@ class Heap$Type$Buffer$RW$
...
@@ -572,10 +572,13 @@ class Heap$Type$Buffer$RW$
||
(
end
>
length
())
||
(
end
>
length
())
||
(
start
>
end
))
||
(
start
>
end
))
throw
new
IndexOutOfBoundsException
();
throw
new
IndexOutOfBoundsException
();
int
len
=
end
-
start
;
int
pos
=
position
()
;
return
new
HeapCharBuffer
$RW
$
(
hb
,
return
new
HeapCharBuffer
$RW
$
(
hb
,
-
1
,
0
,
len
,
len
,
-
1
,
offset
+
position
()
+
start
);
pos
+
start
,
pos
+
end
,
capacity
(),
offset
);
}
}
#
end
[
char
]
#
end
[
char
]
...
...
src/share/classes/java/nio/StringCharBuffer.java
浏览文件 @
2e5f4127
...
@@ -102,10 +102,12 @@ class StringCharBuffer // package-private
...
@@ -102,10 +102,12 @@ class StringCharBuffer // package-private
public
final
CharBuffer
subSequence
(
int
start
,
int
end
)
{
public
final
CharBuffer
subSequence
(
int
start
,
int
end
)
{
try
{
try
{
int
pos
=
position
();
int
pos
=
position
();
return
new
StringCharBuffer
(
str
,
-
1
,
return
new
StringCharBuffer
(
str
,
-
1
,
pos
+
checkIndex
(
start
,
pos
),
pos
+
checkIndex
(
start
,
pos
),
pos
+
checkIndex
(
end
,
pos
),
pos
+
checkIndex
(
end
,
pos
),
remaining
(),
offset
);
capacity
(),
offset
);
}
catch
(
IllegalArgumentException
x
)
{
}
catch
(
IllegalArgumentException
x
)
{
throw
new
IndexOutOfBoundsException
();
throw
new
IndexOutOfBoundsException
();
}
}
...
...
test/java/nio/Buffer/Basic-X.java
浏览文件 @
2e5f4127
...
@@ -365,8 +365,11 @@ public class Basic$Type$
...
@@ -365,8 +365,11 @@ public class Basic$Type$
b
.
position
(
2
);
b
.
position
(
2
);
ck
(
b
,
b
.
charAt
(
1
),
'd'
);
ck
(
b
,
b
.
charAt
(
1
),
'd'
);
CharBuffer
c
=
(
CharBuffer
)
b
.
subSequence
(
1
,
4
);
CharBuffer
c
=
b
.
subSequence
(
1
,
4
);
ck
(
b
,
b
.
subSequence
(
1
,
4
).
toString
().
equals
(
"def"
));
ck
(
c
,
c
.
capacity
(),
b
.
capacity
());
ck
(
c
,
c
.
position
(),
b
.
position
()+
1
);
ck
(
c
,
c
.
limit
(),
b
.
position
()+
4
);
ck
(
c
,
b
.
subSequence
(
1
,
4
).
toString
().
equals
(
"def"
));
// 4938424
// 4938424
b
.
position
(
4
);
b
.
position
(
4
);
...
@@ -722,6 +725,8 @@ public class Basic$Type$
...
@@ -722,6 +725,8 @@ public class Basic$Type$
ck
(
b
,
start
,
b
.
position
());
ck
(
b
,
start
,
b
.
position
());
ck
(
b
,
end
,
b
.
limit
());
ck
(
b
,
end
,
b
.
limit
());
ck
(
b
,
s
.
length
(),
b
.
capacity
());
ck
(
b
,
s
.
length
(),
b
.
capacity
());
b
.
position
(
6
);
ck
(
b
,
b
.
subSequence
(
0
,
3
).
toString
().
equals
(
"ghi"
));
// The index, relative to the position, must be non-negative and
// The index, relative to the position, must be non-negative and
// smaller than remaining().
// smaller than remaining().
...
...
test/java/nio/Buffer/Basic.java
浏览文件 @
2e5f4127
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
* @summary Unit test for buffers
* @summary Unit test for buffers
* @bug 4413135 4414911 4416536 4416562 4418782 4471053 4472779 4490253 4523725
* @bug 4413135 4414911 4416536 4416562 4418782 4471053 4472779 4490253 4523725
* 4526177 4463011 4660660 4661219 4663521 4782970 4804304 4938424 6231529
* 4526177 4463011 4660660 4661219 4663521 4782970 4804304 4938424 6231529
* 6221101 6234263 6535542 6591971 6593946
* 6221101 6234263 6535542 6591971 6593946
6795561
* @author Mark Reinhold
* @author Mark Reinhold
*/
*/
...
...
test/java/nio/Buffer/BasicByte.java
浏览文件 @
2e5f4127
...
@@ -371,6 +371,9 @@ public class BasicByte
...
@@ -371,6 +371,9 @@ public class BasicByte
...
@@ -783,6 +786,8 @@ public class BasicByte
...
@@ -783,6 +786,8 @@ public class BasicByte
...
...
test/java/nio/Buffer/BasicChar.java
浏览文件 @
2e5f4127
...
@@ -365,8 +365,11 @@ public class BasicChar
...
@@ -365,8 +365,11 @@ public class BasicChar
b
.
position
(
2
);
b
.
position
(
2
);
ck
(
b
,
b
.
charAt
(
1
),
'd'
);
ck
(
b
,
b
.
charAt
(
1
),
'd'
);
CharBuffer
c
=
(
CharBuffer
)
b
.
subSequence
(
1
,
4
);
CharBuffer
c
=
b
.
subSequence
(
1
,
4
);
ck
(
b
,
b
.
subSequence
(
1
,
4
).
toString
().
equals
(
"def"
));
ck
(
c
,
c
.
capacity
(),
b
.
capacity
());
ck
(
c
,
c
.
position
(),
b
.
position
()+
1
);
ck
(
c
,
c
.
limit
(),
b
.
position
()+
4
);
ck
(
c
,
b
.
subSequence
(
1
,
4
).
toString
().
equals
(
"def"
));
// 4938424
// 4938424
b
.
position
(
4
);
b
.
position
(
4
);
...
@@ -722,6 +725,8 @@ public class BasicChar
...
@@ -722,6 +725,8 @@ public class BasicChar
ck
(
b
,
start
,
b
.
position
());
ck
(
b
,
start
,
b
.
position
());
ck
(
b
,
end
,
b
.
limit
());
ck
(
b
,
end
,
b
.
limit
());
ck
(
b
,
s
.
length
(),
b
.
capacity
());
ck
(
b
,
s
.
length
(),
b
.
capacity
());
b
.
position
(
6
);
ck
(
b
,
b
.
subSequence
(
0
,
3
).
toString
().
equals
(
"ghi"
));
// The index, relative to the position, must be non-negative and
// The index, relative to the position, must be non-negative and
// smaller than remaining().
// smaller than remaining().
...
...
test/java/nio/Buffer/BasicDouble.java
浏览文件 @
2e5f4127
...
@@ -371,6 +371,9 @@ public class BasicDouble
...
@@ -371,6 +371,9 @@ public class BasicDouble
...
@@ -783,6 +786,8 @@ public class BasicDouble
...
@@ -783,6 +786,8 @@ public class BasicDouble
...
...
test/java/nio/Buffer/BasicFloat.java
浏览文件 @
2e5f4127
...
@@ -371,6 +371,9 @@ public class BasicFloat
...
@@ -371,6 +371,9 @@ public class BasicFloat
...
@@ -783,6 +786,8 @@ public class BasicFloat
...
@@ -783,6 +786,8 @@ public class BasicFloat
...
...
test/java/nio/Buffer/BasicInt.java
浏览文件 @
2e5f4127
...
@@ -371,6 +371,9 @@ public class BasicInt
...
@@ -371,6 +371,9 @@ public class BasicInt
...
@@ -783,6 +786,8 @@ public class BasicInt
...
@@ -783,6 +786,8 @@ public class BasicInt
...
...
test/java/nio/Buffer/BasicLong.java
浏览文件 @
2e5f4127
...
@@ -371,6 +371,9 @@ public class BasicLong
...
@@ -371,6 +371,9 @@ public class BasicLong
...
@@ -783,6 +786,8 @@ public class BasicLong
...
@@ -783,6 +786,8 @@ public class BasicLong
...
...
test/java/nio/Buffer/BasicShort.java
浏览文件 @
2e5f4127
...
@@ -371,6 +371,9 @@ public class BasicShort
...
@@ -371,6 +371,9 @@ public class BasicShort
...
@@ -783,6 +786,8 @@ public class BasicShort
...
@@ -783,6 +786,8 @@ public class BasicShort
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录