Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell11
提交
7871cb7c
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,发现更多精彩内容 >>
提交
7871cb7c
编写于
3月 28, 2018
作者:
M
martin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8200124: Various cleanups in jar/zip
Reviewed-by: sherman, ulfzibis
上级
a56e9c5d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
8 addition
and
11 deletion
+8
-11
src/java.base/share/classes/java/util/jar/Manifest.java
src/java.base/share/classes/java/util/jar/Manifest.java
+1
-1
src/java.base/share/classes/java/util/zip/ZipCoder.java
src/java.base/share/classes/java/util/zip/ZipCoder.java
+1
-2
src/java.base/share/classes/java/util/zip/ZipFile.java
src/java.base/share/classes/java/util/zip/ZipFile.java
+6
-7
src/jdk.jartool/share/classes/sun/tools/jar/Manifest.java
src/jdk.jartool/share/classes/sun/tools/jar/Manifest.java
+0
-1
未找到文件。
src/java.base/share/classes/java/util/jar/Manifest.java
浏览文件 @
7871cb7c
...
...
@@ -148,7 +148,7 @@ public class Manifest implements Cloneable {
DataOutputStream
dos
=
new
DataOutputStream
(
out
);
// Write out the main attributes for the manifest
attr
.
writeMain
(
dos
);
// Now write out the p
re
-entry attributes
// Now write out the p
er
-entry attributes
for
(
Map
.
Entry
<
String
,
Attributes
>
e
:
entries
.
entrySet
())
{
StringBuffer
buffer
=
new
StringBuffer
(
"Name: "
);
String
value
=
e
.
getKey
();
...
...
src/java.base/share/classes/java/util/zip/ZipCoder.java
浏览文件 @
7871cb7c
...
...
@@ -77,8 +77,7 @@ class ZipCoder {
String
toString
(
byte
[]
ba
,
int
off
,
int
length
)
{
try
{
return
decoder
().
decode
(
ByteBuffer
.
wrap
(
ba
,
off
,
length
)).
toString
();
return
decoder
().
decode
(
ByteBuffer
.
wrap
(
ba
,
off
,
length
)).
toString
();
}
catch
(
CharacterCodingException
x
)
{
throw
new
IllegalArgumentException
(
x
);
}
...
...
src/java.base/share/classes/java/util/zip/ZipFile.java
浏览文件 @
7871cb7c
...
...
@@ -64,6 +64,7 @@ import jdk.internal.misc.SharedSecrets;
import
jdk.internal.misc.VM
;
import
jdk.internal.perf.PerfCounter
;
import
jdk.internal.ref.CleanerFactory
;
import
jdk.internal.vm.annotation.Stable
;
import
static
java
.
util
.
zip
.
ZipConstants64
.*;
import
static
java
.
util
.
zip
.
ZipUtils
.*;
...
...
@@ -98,14 +99,14 @@ class ZipFile implements ZipConstants, Closeable {
private
final
String
name
;
// zip file name
private
volatile
boolean
closeRequested
;
private
ZipCoder
zc
;
private
final
@Stable
ZipCoder
zc
;
// The "resource" used by this zip file that needs to be
// cleaned after use.
// a) the input streams that need to be closed
// b) the list of cached Inflater objects
// c) the "native" source of this zip file.
private
final
CleanableResource
res
;
private
final
@Stable
CleanableResource
res
;
private
static
final
int
STORED
=
ZipEntry
.
STORED
;
private
static
final
int
DEFLATED
=
ZipEntry
.
DEFLATED
;
...
...
@@ -369,7 +370,7 @@ class ZipFile implements ZipConstants, Closeable {
public
InputStream
getInputStream
(
ZipEntry
entry
)
throws
IOException
{
Objects
.
requireNonNull
(
entry
,
"entry"
);
int
pos
=
-
1
;
ZipFileInputStream
in
=
null
;
ZipFileInputStream
in
;
Source
zsrc
=
res
.
zsrc
;
Set
<
InputStream
>
istreams
=
res
.
istreams
;
synchronized
(
this
)
{
...
...
@@ -604,9 +605,7 @@ class ZipFile implements ZipConstants, Closeable {
private
String
getEntryName
(
int
pos
)
{
byte
[]
cen
=
res
.
zsrc
.
cen
;
int
nlen
=
CENNAM
(
cen
,
pos
);
int
clen
=
CENCOM
(
cen
,
pos
);
int
flag
=
CENFLG
(
cen
,
pos
);
if
(!
zc
.
isUTF8
()
&&
(
flag
&
EFS
)
!=
0
)
{
if
(!
zc
.
isUTF8
()
&&
(
CENFLG
(
cen
,
pos
)
&
EFS
)
!=
0
)
{
return
zc
.
toStringUTF8
(
cen
,
pos
+
CENHDR
,
nlen
);
}
else
{
return
zc
.
toString
(
cen
,
pos
+
CENHDR
,
nlen
);
...
...
@@ -1218,7 +1217,7 @@ class ZipFile implements ZipConstants, Closeable {
static
Source
get
(
File
file
,
boolean
toDelete
)
throws
IOException
{
Key
key
=
new
Key
(
file
,
Files
.
readAttributes
(
file
.
toPath
(),
BasicFileAttributes
.
class
));
Source
src
=
null
;
Source
src
;
synchronized
(
files
)
{
src
=
files
.
get
(
key
);
if
(
src
!=
null
)
{
...
...
src/jdk.jartool/share/classes/sun/tools/jar/Manifest.java
浏览文件 @
7871cb7c
...
...
@@ -52,7 +52,6 @@ public class Manifest {
private
Hashtable
<
String
,
MessageHeader
>
tableEntries
=
new
Hashtable
<>();
static
final
String
[]
hashes
=
{
"SHA"
};
static
final
byte
[]
EOL
=
{(
byte
)
'\r'
,
(
byte
)
'\n'
};
static
final
boolean
debug
=
false
;
static
final
String
VERSION
=
"1.0"
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录