Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
36cde02e
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看板
提交
36cde02e
编写于
4月 06, 2011
作者:
A
alanb
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7034155: (ch) NullPointerException in sun.io.ch.IOUtil when OOM is thrown
Reviewed-by: forax
上级
fa996007
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
6 addition
and
10 deletion
+6
-10
src/share/classes/sun/nio/ch/DatagramChannelImpl.java
src/share/classes/sun/nio/ch/DatagramChannelImpl.java
+4
-6
src/share/classes/sun/nio/ch/IOUtil.java
src/share/classes/sun/nio/ch/IOUtil.java
+2
-4
未找到文件。
src/share/classes/sun/nio/ch/DatagramChannelImpl.java
浏览文件 @
36cde02e
...
@@ -388,9 +388,8 @@ class DatagramChannelImpl
...
@@ -388,9 +388,8 @@ class DatagramChannelImpl
// we must instead use a nonempty buffer, otherwise the call
// we must instead use a nonempty buffer, otherwise the call
// will not block waiting for a datagram on some platforms.
// will not block waiting for a datagram on some platforms.
int
newSize
=
Math
.
max
(
rem
,
1
);
int
newSize
=
Math
.
max
(
rem
,
1
);
ByteBuffer
bb
=
null
;
ByteBuffer
bb
=
Util
.
getTemporaryDirectBuffer
(
newSize
)
;
try
{
try
{
bb
=
Util
.
getTemporaryDirectBuffer
(
newSize
);
int
n
=
receiveIntoNativeBuffer
(
fd
,
bb
,
newSize
,
0
);
int
n
=
receiveIntoNativeBuffer
(
fd
,
bb
,
newSize
,
0
);
bb
.
flip
();
bb
.
flip
();
if
(
n
>
0
&&
rem
>
0
)
if
(
n
>
0
&&
rem
>
0
)
...
@@ -482,9 +481,8 @@ class DatagramChannelImpl
...
@@ -482,9 +481,8 @@ class DatagramChannelImpl
assert
(
pos
<=
lim
);
assert
(
pos
<=
lim
);
int
rem
=
(
pos
<=
lim
?
lim
-
pos
:
0
);
int
rem
=
(
pos
<=
lim
?
lim
-
pos
:
0
);
ByteBuffer
bb
=
null
;
ByteBuffer
bb
=
Util
.
getTemporaryDirectBuffer
(
rem
)
;
try
{
try
{
bb
=
Util
.
getTemporaryDirectBuffer
(
rem
);
bb
.
put
(
src
);
bb
.
put
(
src
);
bb
.
flip
();
bb
.
flip
();
// Do not update src until we see how many bytes were written
// Do not update src until we see how many bytes were written
...
@@ -766,10 +764,10 @@ class DatagramChannelImpl
...
@@ -766,10 +764,10 @@ class DatagramChannelImpl
// check multicast address is compatible with this socket
// check multicast address is compatible with this socket
if
(
group
instanceof
Inet4Address
)
{
if
(
group
instanceof
Inet4Address
)
{
if
(
family
==
StandardProtocolFamily
.
INET6
&&
!
Net
.
canIPv6SocketJoinIPv4Group
())
if
(
family
==
StandardProtocolFamily
.
INET6
&&
!
Net
.
canIPv6SocketJoinIPv4Group
())
throw
new
IllegalArgumentException
(
"
Group is not IPv4 multicast address
"
);
throw
new
IllegalArgumentException
(
"
IPv6 socket cannot join IPv4 multicast group
"
);
}
else
if
(
group
instanceof
Inet6Address
)
{
}
else
if
(
group
instanceof
Inet6Address
)
{
if
(
family
!=
StandardProtocolFamily
.
INET6
)
if
(
family
!=
StandardProtocolFamily
.
INET6
)
throw
new
IllegalArgumentException
(
"
Group is not IPv6 multicast address
"
);
throw
new
IllegalArgumentException
(
"
Only IPv6 sockets can join IPv6 multicast group
"
);
}
else
{
}
else
{
throw
new
IllegalArgumentException
(
"Address type not supported"
);
throw
new
IllegalArgumentException
(
"Address type not supported"
);
}
}
...
...
src/share/classes/sun/nio/ch/IOUtil.java
浏览文件 @
36cde02e
...
@@ -50,9 +50,8 @@ class IOUtil {
...
@@ -50,9 +50,8 @@ class IOUtil {
int
lim
=
src
.
limit
();
int
lim
=
src
.
limit
();
assert
(
pos
<=
lim
);
assert
(
pos
<=
lim
);
int
rem
=
(
pos
<=
lim
?
lim
-
pos
:
0
);
int
rem
=
(
pos
<=
lim
?
lim
-
pos
:
0
);
ByteBuffer
bb
=
null
;
ByteBuffer
bb
=
Util
.
getTemporaryDirectBuffer
(
rem
)
;
try
{
try
{
bb
=
Util
.
getTemporaryDirectBuffer
(
rem
);
bb
.
put
(
src
);
bb
.
put
(
src
);
bb
.
flip
();
bb
.
flip
();
// Do not update src until we see how many bytes were written
// Do not update src until we see how many bytes were written
...
@@ -187,9 +186,8 @@ class IOUtil {
...
@@ -187,9 +186,8 @@ class IOUtil {
return
readIntoNativeBuffer
(
fd
,
dst
,
position
,
nd
,
lock
);
return
readIntoNativeBuffer
(
fd
,
dst
,
position
,
nd
,
lock
);
// Substitute a native buffer
// Substitute a native buffer
ByteBuffer
bb
=
null
;
ByteBuffer
bb
=
Util
.
getTemporaryDirectBuffer
(
dst
.
remaining
())
;
try
{
try
{
bb
=
Util
.
getTemporaryDirectBuffer
(
dst
.
remaining
());
int
n
=
readIntoNativeBuffer
(
fd
,
bb
,
position
,
nd
,
lock
);
int
n
=
readIntoNativeBuffer
(
fd
,
bb
,
position
,
nd
,
lock
);
bb
.
flip
();
bb
.
flip
();
if
(
n
>
0
)
if
(
n
>
0
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录