Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
cdbe4005
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看板
提交
cdbe4005
编写于
1月 25, 2013
作者:
A
amurillo
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
66e53263
b7331121
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
94 addition
and
30 deletion
+94
-30
src/share/classes/sun/misc/Contended.java
src/share/classes/sun/misc/Contended.java
+45
-0
src/share/classes/sun/nio/cs/ISO_8859_1.java
src/share/classes/sun/nio/cs/ISO_8859_1.java
+49
-30
未找到文件。
src/share/classes/sun/misc/Contended.java
0 → 100644
浏览文件 @
cdbe4005
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package
sun.misc
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.Target
;
/**
* This annotation marks classes and fields as considered to be contended.
* @since 1.8
*/
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Target
({
ElementType
.
FIELD
,
ElementType
.
TYPE
})
public
@interface
Contended
{
/**
Defines the contention group tag.
*/
String
value
()
default
""
;
}
src/share/classes/sun/nio/cs/ISO_8859_1.java
浏览文件 @
cdbe4005
/*
* Copyright (c) 2000, 20
04
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 20
13
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -147,37 +147,53 @@ class ISO_8859_1
private
final
Surrogate
.
Parser
sgp
=
new
Surrogate
.
Parser
();
// JVM may replace this method with intrinsic code.
private
static
int
encodeISOArray
(
char
[]
sa
,
int
sp
,
byte
[]
da
,
int
dp
,
int
len
)
{
int
i
=
0
;
for
(;
i
<
len
;
i
++)
{
char
c
=
sa
[
sp
++];
if
(
c
>
'\
u00FF
'
)
break
;
da
[
dp
++]
=
(
byte
)
c
;
}
return
i
;
}
private
CoderResult
encodeArrayLoop
(
CharBuffer
src
,
ByteBuffer
dst
)
{
char
[]
sa
=
src
.
array
();
int
sp
=
src
.
arrayOffset
()
+
src
.
position
();
int
sl
=
src
.
arrayOffset
()
+
src
.
limit
();
int
soff
=
src
.
arrayOffset
();
int
sp
=
soff
+
src
.
position
();
int
sl
=
soff
+
src
.
limit
();
assert
(
sp
<=
sl
);
sp
=
(
sp
<=
sl
?
sp
:
sl
);
byte
[]
da
=
dst
.
array
();
int
dp
=
dst
.
arrayOffset
()
+
dst
.
position
();
int
dl
=
dst
.
arrayOffset
()
+
dst
.
limit
();
int
doff
=
dst
.
arrayOffset
();
int
dp
=
doff
+
dst
.
position
();
int
dl
=
doff
+
dst
.
limit
();
assert
(
dp
<=
dl
);
dp
=
(
dp
<=
dl
?
dp
:
dl
);
int
dlen
=
dl
-
dp
;
int
slen
=
sl
-
sp
;
int
len
=
(
dlen
<
slen
)
?
dlen
:
slen
;
try
{
while
(
sp
<
sl
)
{
char
c
=
sa
[
sp
];
if
(
c
<=
'\
u00FF
'
)
{
if
(
dp
>=
dl
)
return
CoderResult
.
OVERFLOW
;
da
[
dp
++]
=
(
byte
)
c
;
sp
++;
continue
;
}
if
(
sgp
.
parse
(
c
,
sa
,
sp
,
sl
)
<
0
)
int
ret
=
encodeISOArray
(
sa
,
sp
,
da
,
dp
,
len
);
sp
=
sp
+
ret
;
dp
=
dp
+
ret
;
if
(
ret
!=
len
)
{
if
(
sgp
.
parse
(
sa
[
sp
],
sa
,
sp
,
sl
)
<
0
)
return
sgp
.
error
();
return
sgp
.
unmappableResult
();
}
if
(
len
<
slen
)
return
CoderResult
.
OVERFLOW
;
return
CoderResult
.
UNDERFLOW
;
}
finally
{
src
.
position
(
sp
-
s
rc
.
arrayOffset
()
);
dst
.
position
(
dp
-
d
st
.
arrayOffset
()
);
src
.
position
(
sp
-
s
off
);
dst
.
position
(
dp
-
d
off
);
}
}
...
...
@@ -221,22 +237,25 @@ class ISO_8859_1
public
int
encode
(
char
[]
src
,
int
sp
,
int
len
,
byte
[]
dst
)
{
int
dp
=
0
;
int
sl
=
sp
+
Math
.
min
(
len
,
dst
.
length
);
int
slen
=
Math
.
min
(
len
,
dst
.
length
);
int
sl
=
sp
+
slen
;
while
(
sp
<
sl
)
{
char
c
=
src
[
sp
++];
if
(
c
<=
'\
u00FF
'
)
{
dst
[
dp
++]
=
(
byte
)
c
;
continue
;
}
if
(
Character
.
isHighSurrogate
(
c
)
&&
sp
<
sl
&&
Character
.
isLowSurrogate
(
src
[
sp
]))
{
if
(
len
>
dst
.
length
)
{
sl
++;
len
--;
int
ret
=
encodeISOArray
(
src
,
sp
,
dst
,
dp
,
slen
);
sp
=
sp
+
ret
;
dp
=
dp
+
ret
;
if
(
ret
!=
slen
)
{
char
c
=
src
[
sp
++];
if
(
Character
.
isHighSurrogate
(
c
)
&&
sp
<
sl
&&
Character
.
isLowSurrogate
(
src
[
sp
]))
{
if
(
len
>
dst
.
length
)
{
sl
++;
len
--;
}
sp
++;
}
sp
++;
dst
[
dp
++]
=
repl
;
slen
=
Math
.
min
((
sl
-
sp
),
(
dst
.
length
-
dp
));
}
dst
[
dp
++]
=
repl
;
}
return
dp
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录