Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
8cfd77bd
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看板
提交
8cfd77bd
编写于
9月 30, 2010
作者:
A
alanb
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
497c660b
d18be228
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
268 addition
and
80 deletion
+268
-80
src/share/classes/java/sql/Statement.java
src/share/classes/java/sql/Statement.java
+2
-2
src/share/classes/javax/sql/rowset/RowSetProvider.java
src/share/classes/javax/sql/rowset/RowSetProvider.java
+2
-2
src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java
.../classes/sun/net/www/protocol/http/HttpURLConnection.java
+32
-0
src/share/classes/sun/security/tools/KeyTool.java
src/share/classes/sun/security/tools/KeyTool.java
+1
-1
src/share/classes/sun/security/util/Resources.java
src/share/classes/sun/security/util/Resources.java
+4
-13
src/windows/native/sun/net/spi/DefaultProxySelector.c
src/windows/native/sun/net/spi/DefaultProxySelector.c
+4
-0
test/sun/net/www/http/ChunkedInputStream/ChunkedCharEncoding.sh
...un/net/www/http/ChunkedInputStream/ChunkedCharEncoding.sh
+0
-62
test/sun/net/www/protocol/http/6550798/TestCache.java
test/sun/net/www/protocol/http/6550798/TestCache.java
+133
-0
test/sun/net/www/protocol/http/6550798/test.java
test/sun/net/www/protocol/http/6550798/test.java
+90
-0
未找到文件。
src/share/classes/java/sql/Statement.java
浏览文件 @
8cfd77bd
...
@@ -1051,9 +1051,9 @@ public interface Statement extends Wrapper, AutoCloseable {
...
@@ -1051,9 +1051,9 @@ public interface Statement extends Wrapper, AutoCloseable {
/**
/**
* Returns a value indicating whether this {@code Statement} will be
* Returns a value indicating whether this {@code Statement} will be
* closed when all
dependent objects such as result
sets are closed.
* closed when all
its dependent result
sets are closed.
* @return {@code true} if the {@code Statement} will be closed when all
* @return {@code true} if the {@code Statement} will be closed when all
* of its dependent
objec
ts are closed; {@code false} otherwise
* of its dependent
result se
ts are closed; {@code false} otherwise
* @throws SQLException if this method is called on a closed
* @throws SQLException if this method is called on a closed
* {@code Statement}
* {@code Statement}
* @since 1.7
* @since 1.7
...
...
src/share/classes/javax/sql/rowset/RowSetProvider.java
浏览文件 @
8cfd77bd
...
@@ -88,8 +88,8 @@ public class RowSetProvider {
...
@@ -88,8 +88,8 @@ public class RowSetProvider {
* </li>
* </li>
* </ul>
* </ul>
* <li>
* <li>
* The
ServiceLocator API. The ServiceLocator
API will look
* The
{@link ServiceLoader} API. The {@code ServiceLoader}
API will look
* for a classname in the file
* for a class
name in the file
* {@code META-INF/services/javax.sql.rowset.RowSetFactory}
* {@code META-INF/services/javax.sql.rowset.RowSetFactory}
* in jars available to the runtime. For example, to have the the RowSetFactory
* in jars available to the runtime. For example, to have the the RowSetFactory
* implementation {@code com.sun.rowset.RowSetFactoryImpl } loaded, the
* implementation {@code com.sun.rowset.RowSetFactoryImpl } loaded, the
...
...
src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java
浏览文件 @
8cfd77bd
...
@@ -2825,6 +2825,38 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
...
@@ -2825,6 +2825,38 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
}
}
}
}
/* skip() calls read() in order to ensure that entire response gets
* cached. same implementation as InputStream.skip */
private
byte
[]
skipBuffer
;
private
static
final
int
SKIP_BUFFER_SIZE
=
8096
;
@Override
public
long
skip
(
long
n
)
throws
IOException
{
long
remaining
=
n
;
int
nr
;
if
(
skipBuffer
==
null
)
skipBuffer
=
new
byte
[
SKIP_BUFFER_SIZE
];
byte
[]
localSkipBuffer
=
skipBuffer
;
if
(
n
<=
0
)
{
return
0
;
}
while
(
remaining
>
0
)
{
nr
=
read
(
localSkipBuffer
,
0
,
(
int
)
Math
.
min
(
SKIP_BUFFER_SIZE
,
remaining
));
if
(
nr
<
0
)
{
break
;
}
remaining
-=
nr
;
}
return
n
-
remaining
;
}
@Override
@Override
public
void
close
()
throws
IOException
{
public
void
close
()
throws
IOException
{
try
{
try
{
...
...
src/share/classes/sun/security/tools/KeyTool.java
浏览文件 @
8cfd77bd
...
@@ -281,7 +281,7 @@ public final class KeyTool {
...
@@ -281,7 +281,7 @@ public final class KeyTool {
RFC
(
"rfc"
,
null
,
"output in RFC style"
),
RFC
(
"rfc"
,
null
,
"output in RFC style"
),
SIGALG
(
"sigalg"
,
"<sigalg>"
,
"signature algorithm name"
),
SIGALG
(
"sigalg"
,
"<sigalg>"
,
"signature algorithm name"
),
SRCALIAS
(
"srcalias"
,
"<srcalias>"
,
"source alias"
),
SRCALIAS
(
"srcalias"
,
"<srcalias>"
,
"source alias"
),
SRCKEYPASS
(
"srckeypass"
,
"<arg>"
,
"source key
store
password"
),
SRCKEYPASS
(
"srckeypass"
,
"<arg>"
,
"source key password"
),
SRCKEYSTORE
(
"srckeystore"
,
"<srckeystore>"
,
"source keystore name"
),
SRCKEYSTORE
(
"srckeystore"
,
"<srckeystore>"
,
"source keystore name"
),
SRCPROTECTED
(
"srcprotected"
,
null
,
"source keystore password protected"
),
SRCPROTECTED
(
"srcprotected"
,
null
,
"source keystore password protected"
),
SRCPROVIDERNAME
(
"srcprovidername"
,
"<srcprovidername>"
,
"source keystore provider name"
),
SRCPROVIDERNAME
(
"srcprovidername"
,
"<srcprovidername>"
,
"source keystore provider name"
),
...
...
src/share/classes/sun/security/util/Resources.java
浏览文件 @
8cfd77bd
...
@@ -116,11 +116,9 @@ public class Resources extends java.util.ListResourceBundle {
...
@@ -116,11 +116,9 @@ public class Resources extends java.util.ListResourceBundle {
{
"X.509 extension"
,
{
"X.509 extension"
,
"X.509 extension"
},
//-ext
"X.509 extension"
},
//-ext
{
"output file name"
,
{
"output file name"
,
"output file name"
},
//-file
"output file name"
},
//-file
and -outfile
{
"input file name"
,
{
"input file name"
,
"input file name"
},
//-file
"input file name"
},
//-file and -infile
{
"input file name"
,
"input file name"
},
//-infile
{
"key algorithm name"
,
{
"key algorithm name"
,
"key algorithm name"
},
//-keyalg
"key algorithm name"
},
//-keyalg
{
"key password"
,
{
"key password"
,
...
@@ -133,8 +131,6 @@ public class Resources extends java.util.ListResourceBundle {
...
@@ -133,8 +131,6 @@ public class Resources extends java.util.ListResourceBundle {
"new password"
},
//-new
"new password"
},
//-new
{
"do not prompt"
,
{
"do not prompt"
,
"do not prompt"
},
//-noprompt
"do not prompt"
},
//-noprompt
{
"output file name"
,
"output file name"
},
//-outfile
{
"password through protected mechanism"
,
{
"password through protected mechanism"
,
"password through protected mechanism"
},
//-protected
"password through protected mechanism"
},
//-protected
{
"provider argument"
,
{
"provider argument"
,
...
@@ -151,8 +147,8 @@ public class Resources extends java.util.ListResourceBundle {
...
@@ -151,8 +147,8 @@ public class Resources extends java.util.ListResourceBundle {
"signature algorithm name"
},
//-sigalg
"signature algorithm name"
},
//-sigalg
{
"source alias"
,
{
"source alias"
,
"source alias"
},
//-srcalias
"source alias"
},
//-srcalias
{
"source key
store
password"
,
{
"source key password"
,
"source key
store
password"
},
//-srckeypass
"source key password"
},
//-srckeypass
{
"source keystore name"
,
{
"source keystore name"
,
"source keystore name"
},
//-srckeystore
"source keystore name"
},
//-srckeystore
{
"source keystore password protected"
,
{
"source keystore password protected"
,
...
@@ -276,8 +272,6 @@ public class Resources extends java.util.ListResourceBundle {
...
@@ -276,8 +272,6 @@ public class Resources extends java.util.ListResourceBundle {
"Alias <{0}> has no certificate"
},
"Alias <{0}> has no certificate"
},
{
"Key pair not generated, alias <alias> already exists"
,
{
"Key pair not generated, alias <alias> already exists"
,
"Key pair not generated, alias <{0}> already exists"
},
"Key pair not generated, alias <{0}> already exists"
},
{
"Cannot derive signature algorithm"
,
"Cannot derive signature algorithm"
},
{
"Generating keysize bit keyAlgName key pair and self-signed certificate (sigAlgName) with a validity of validality days\n\tfor: x500Name"
,
{
"Generating keysize bit keyAlgName key pair and self-signed certificate (sigAlgName) with a validity of validality days\n\tfor: x500Name"
,
"Generating {0} bit {1} key pair and self-signed certificate ({2}) with a validity of {3} days\n\tfor: {4}"
},
"Generating {0} bit {1} key pair and self-signed certificate ({2}) with a validity of {3} days\n\tfor: {4}"
},
{
"Enter key password for <alias>"
,
"Enter key password for <{0}>"
},
{
"Enter key password for <alias>"
,
"Enter key password for <{0}>"
},
...
@@ -321,8 +315,6 @@ public class Resources extends java.util.ListResourceBundle {
...
@@ -321,8 +315,6 @@ public class Resources extends java.util.ListResourceBundle {
{
"Failed to parse input"
,
"Failed to parse input"
},
{
"Failed to parse input"
,
"Failed to parse input"
},
{
"Empty input"
,
"Empty input"
},
{
"Empty input"
,
"Empty input"
},
{
"Not X.509 certificate"
,
"Not X.509 certificate"
},
{
"Not X.509 certificate"
,
"Not X.509 certificate"
},
{
"Cannot derive signature algorithm"
,
"Cannot derive signature algorithm"
},
{
"alias has no public key"
,
"{0} has no public key"
},
{
"alias has no public key"
,
"{0} has no public key"
},
{
"alias has no X.509 certificate"
,
"{0} has no X.509 certificate"
},
{
"alias has no X.509 certificate"
,
"{0} has no X.509 certificate"
},
{
"New certificate (self-signed):"
,
"New certificate (self-signed):"
},
{
"New certificate (self-signed):"
,
"New certificate (self-signed):"
},
...
@@ -552,7 +544,6 @@ public class Resources extends java.util.ListResourceBundle {
...
@@ -552,7 +544,6 @@ public class Resources extends java.util.ListResourceBundle {
{
"package name"
,
"package name"
},
{
"package name"
,
"package name"
},
{
"policy type"
,
"policy type"
},
{
"policy type"
,
"policy type"
},
{
"property name"
,
"property name"
},
{
"property name"
,
"property name"
},
{
"provider name"
,
"provider name"
},
{
"Principal List"
,
"Principal List"
},
{
"Principal List"
,
"Principal List"
},
{
"Permission List"
,
"Permission List"
},
{
"Permission List"
,
"Permission List"
},
{
"Code Base"
,
"Code Base"
},
{
"Code Base"
,
"Code Base"
},
...
...
src/windows/native/sun/net/spi/DefaultProxySelector.c
浏览文件 @
8cfd77bd
...
@@ -250,6 +250,10 @@ Java_sun_net_spi_DefaultProxySelector_getSystemProxy(JNIEnv *env,
...
@@ -250,6 +250,10 @@ Java_sun_net_spi_DefaultProxySelector_getSystemProxy(JNIEnv *env,
return
proxy
;
return
proxy
;
}
}
}
}
}
else
{
/* ProxyEnable == 0 or Query failed */
/* close the handle to the registry key */
RegCloseKey
(
hKey
);
}
}
}
}
...
...
test/sun/net/www/http/ChunkedInputStream/ChunkedCharEncoding.sh
已删除
100644 → 0
浏览文件 @
497c660b
#
# Copyright (c) 2006, 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.
#
# 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.
#
# @test
# @bug 6502503
# @run shell/timeout=140 ChunkedCharEncoding.sh
# @summary Http URL connection don't work when default encoding is Cp037: HTTP Transfer-Encoding:chunked
OS
=
`
uname
-s
`
case
"
$OS
"
in
SunOS
|
Linux
)
PS
=
":"
FS
=
"/"
;;
CYGWIN
*
)
PS
=
";"
FS
=
"/"
;;
Windows
*
)
PS
=
";"
FS
=
"
\\
"
;;
*
)
echo
"Unrecognized system!"
exit
1
;
;;
esac
# compile
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
-d
.
${
TESTSRC
}${
FS
}
TestAvailable.java
# run with CP037 encoding specified.
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java
-Dfile
.encoding
=
Cp037 TestAvailable 2>&1
result
=
$?
if
[
"
$result
"
-ne
"0"
]
;
then
exit
1
fi
# no failures, exit.
exit
0
test/sun/net/www/protocol/http/6550798/TestCache.java
0 → 100644
浏览文件 @
8cfd77bd
/*
* Copyright (c) 2010, 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.
*
* 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.
*/
import
java.net.*
;
import
java.io.*
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.OutputStream
;
import
java.io.FileInputStream
;
import
java.io.FileOutputStream
;
import
java.io.BufferedInputStream
;
import
java.io.ByteArrayInputStream
;
import
java.io.PrintStream
;
import
java.io.InputStream
;
import
java.io.File
;
import
java.net.CacheRequest
;
import
java.net.CacheResponse
;
import
java.net.ResponseCache
;
import
java.net.URI
;
import
java.net.URL
;
import
java.net.URLConnection
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.List
;
import
java.util.Iterator
;
import
java.util.StringTokenizer
;
import
java.util.jar.JarInputStream
;
import
java.util.jar.JarFile
;
import
java.security.AccessController
;
import
java.security.PrivilegedAction
;
import
java.security.PrivilegedExceptionAction
;
import
java.security.PrivilegedActionException
;
import
java.security.Principal
;
import
java.security.cert.Certificate
;
import
javax.net.ssl.SSLPeerUnverifiedException
;
public
class
TestCache
extends
java
.
net
.
ResponseCache
{
private
boolean
inCacheHandler
=
false
;
private
boolean
_downloading
=
false
;
public
static
volatile
boolean
fail
=
false
;
public
static
void
reset
()
{
// Set system wide cache handler
System
.
out
.
println
(
"install deploy cache handler"
);
ResponseCache
.
setDefault
(
new
TestCache
());
}
public
synchronized
CacheResponse
get
(
final
URI
uri
,
String
rqstMethod
,
Map
requestHeaders
)
throws
IOException
{
System
.
out
.
println
(
"get: "
+
uri
);
Thread
.
currentThread
().
dumpStack
();
return
null
;
}
public
synchronized
CacheRequest
put
(
URI
uri
,
URLConnection
conn
)
throws
IOException
{
System
.
out
.
println
(
"put: "
+
uri
);
Thread
.
currentThread
().
dumpStack
();
URL
url
=
uri
.
toURL
();
return
new
DeployCacheRequest
(
url
,
conn
);
}
}
class
DeployByteArrayOutputStream
extends
java
.
io
.
ByteArrayOutputStream
{
private
URL
_url
;
private
URLConnection
_conn
;
DeployByteArrayOutputStream
(
URL
url
,
URLConnection
conn
)
{
_url
=
url
;
_conn
=
conn
;
}
public
void
close
()
throws
IOException
{
System
.
out
.
println
(
"contentLength: "
+
_conn
.
getContentLength
());
System
.
out
.
println
(
"byte array size: "
+
size
());
if
(
_conn
.
getContentLength
()
==
size
())
{
System
.
out
.
println
(
"correct content length"
);
}
else
{
System
.
out
.
println
(
"wrong content length"
);
System
.
out
.
println
(
"TEST FAILED"
);
TestCache
.
fail
=
true
;
}
super
.
close
();
}
}
class
DeployCacheRequest
extends
java
.
net
.
CacheRequest
{
private
URL
_url
;
private
URLConnection
_conn
;
private
boolean
_downloading
=
false
;
DeployCacheRequest
(
URL
url
,
URLConnection
conn
)
{
System
.
out
.
println
(
"DeployCacheRequest ctor for: "
+
url
);
_url
=
url
;
_conn
=
conn
;
}
public
void
abort
()
{
System
.
out
.
println
(
"abort called"
);
}
public
OutputStream
getBody
()
throws
IOException
{
System
.
out
.
println
(
"getBody called"
);
return
new
DeployByteArrayOutputStream
(
_url
,
_conn
);
}
}
test/sun/net/www/protocol/http/6550798/test.java
0 → 100644
浏览文件 @
8cfd77bd
/*
* Copyright (c) 2010, 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.
*
* 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.
*/
/**
* @test
* @bug 6550798
* @summary Using InputStream.skip with ResponseCache will cause partial data to be cached
* @run main/othervm test
*/
import
java.net.*
;
import
com.sun.net.httpserver.*
;
import
java.io.*
;
public
class
test
{
final
static
int
LEN
=
16
*
1024
;
public
static
void
main
(
String
[]
args
)
throws
Exception
{
TestCache
.
reset
();
HttpServer
s
=
HttpServer
.
create
(
new
InetSocketAddress
(
0
),
10
);
s
.
createContext
(
"/"
,
new
HttpHandler
()
{
public
void
handle
(
HttpExchange
e
)
{
try
{
byte
[]
buf
=
new
byte
[
LEN
];
OutputStream
o
=
e
.
getResponseBody
();
e
.
sendResponseHeaders
(
200
,
LEN
);
o
.
write
(
buf
);
e
.
close
();
}
catch
(
IOException
ex
)
{
ex
.
printStackTrace
();
TestCache
.
fail
=
true
;
}
}
});
s
.
start
();
System
.
out
.
println
(
"http request with cache hander"
);
URL
u
=
new
URL
(
"http://127.0.0.1:"
+
s
.
getAddress
().
getPort
()+
"/f"
);
URLConnection
conn
=
u
.
openConnection
();
InputStream
is
=
null
;
try
{
// this calls into TestCache.get
byte
[]
buf
=
new
byte
[
8192
];
is
=
new
BufferedInputStream
(
conn
.
getInputStream
());
is
.
skip
(
1000
);
while
(
is
.
read
(
buf
)
!=
-
1
)
{
}
}
finally
{
if
(
is
!=
null
)
{
// this calls into TestCache.put
// TestCache.put will check if the resource
// should be cached
is
.
close
();
}
s
.
stop
(
0
);
}
if
(
TestCache
.
fail
)
{
System
.
out
.
println
(
"TEST FAILED"
);
throw
new
RuntimeException
();
}
else
{
System
.
out
.
println
(
"TEST OK"
);
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录