Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
73e6821d
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看板
提交
73e6821d
编写于
6月 12, 2009
作者:
A
asaha
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
aad4557e
a75686cf
变更
29
显示空白变更内容
内联
并排
Showing
29 changed file
with
241 addition
and
75 deletion
+241
-75
make/sun/net/FILES_java.gmk
make/sun/net/FILES_java.gmk
+1
-0
src/share/classes/com/sun/imageio/plugins/bmp/BMPImageReaderSpi.java
...lasses/com/sun/imageio/plugins/bmp/BMPImageReaderSpi.java
+1
-1
src/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriterSpi.java
...lasses/com/sun/imageio/plugins/bmp/BMPImageWriterSpi.java
+2
-1
src/share/classes/com/sun/imageio/plugins/gif/GIFImageReaderSpi.java
...lasses/com/sun/imageio/plugins/gif/GIFImageReaderSpi.java
+1
-1
src/share/classes/com/sun/imageio/plugins/gif/GIFImageWriterSpi.java
...lasses/com/sun/imageio/plugins/gif/GIFImageWriterSpi.java
+2
-1
src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReaderSpi.java
...sses/com/sun/imageio/plugins/jpeg/JPEGImageReaderSpi.java
+1
-1
src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriterSpi.java
...sses/com/sun/imageio/plugins/jpeg/JPEGImageWriterSpi.java
+2
-1
src/share/classes/com/sun/imageio/plugins/png/PNGImageReaderSpi.java
...lasses/com/sun/imageio/plugins/png/PNGImageReaderSpi.java
+1
-1
src/share/classes/com/sun/imageio/plugins/png/PNGImageWriterSpi.java
...lasses/com/sun/imageio/plugins/png/PNGImageWriterSpi.java
+2
-1
src/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageReaderSpi.java
...sses/com/sun/imageio/plugins/wbmp/WBMPImageReaderSpi.java
+1
-1
src/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageWriterSpi.java
...sses/com/sun/imageio/plugins/wbmp/WBMPImageWriterSpi.java
+2
-1
src/share/classes/com/sun/imageio/stream/StreamCloser.java
src/share/classes/com/sun/imageio/stream/StreamCloser.java
+31
-13
src/share/classes/com/sun/media/sound/JDK13Services.java
src/share/classes/com/sun/media/sound/JDK13Services.java
+20
-1
src/share/classes/com/sun/media/sound/JSSecurityManager.java
src/share/classes/com/sun/media/sound/JSSecurityManager.java
+32
-23
src/share/classes/com/sun/media/sound/StandardMidiFileWriter.java
...e/classes/com/sun/media/sound/StandardMidiFileWriter.java
+2
-2
src/share/classes/java/net/Socket.java
src/share/classes/java/net/Socket.java
+1
-1
src/share/classes/java/net/SocksSocketImpl.java
src/share/classes/java/net/SocksSocketImpl.java
+19
-6
src/share/classes/java/net/URL.java
src/share/classes/java/net/URL.java
+1
-1
src/share/classes/javax/imageio/plugins/bmp/BMPImageWriteParam.java
...classes/javax/imageio/plugins/bmp/BMPImageWriteParam.java
+1
-1
src/share/classes/javax/imageio/spi/ImageReaderSpi.java
src/share/classes/javax/imageio/spi/ImageReaderSpi.java
+8
-1
src/share/classes/javax/imageio/spi/ImageWriterSpi.java
src/share/classes/javax/imageio/spi/ImageWriterSpi.java
+10
-3
src/share/classes/javax/imageio/stream/FileCacheImageInputStream.java
...asses/javax/imageio/stream/FileCacheImageInputStream.java
+8
-2
src/share/classes/javax/imageio/stream/FileCacheImageOutputStream.java
...sses/javax/imageio/stream/FileCacheImageOutputStream.java
+8
-2
src/share/classes/sun/net/ApplicationProxy.java
src/share/classes/sun/net/ApplicationProxy.java
+43
-0
src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java
.../classes/sun/net/www/protocol/http/HttpURLConnection.java
+13
-5
src/share/lib/security/java.security
src/share/lib/security/java.security
+1
-1
src/share/lib/security/java.security-solaris
src/share/lib/security/java.security-solaris
+1
-1
src/share/lib/security/java.security-windows
src/share/lib/security/java.security-windows
+1
-1
src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c
src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c
+25
-1
未找到文件。
make/sun/net/FILES_java.gmk
浏览文件 @
73e6821d
...
...
@@ -24,6 +24,7 @@
#
FILES_java = \
sun/net/ApplicationProxy.java \
sun/net/InetAddressCachePolicy.java \
sun/net/URLCanonicalizer.java \
sun/net/NetworkClient.java \
...
...
src/share/classes/com/sun/imageio/plugins/bmp/BMPImageReaderSpi.java
浏览文件 @
73e6821d
...
...
@@ -51,7 +51,7 @@ public class BMPImageReaderSpi extends ImageReaderSpi {
entensions
,
mimeType
,
"com.sun.imageio.plugins.bmp.BMPImageReader"
,
STANDARD_INPUT_TYPE
,
new
Class
[]
{
ImageInputStream
.
class
}
,
writerSpiNames
,
false
,
null
,
null
,
null
,
null
,
...
...
src/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriterSpi.java
浏览文件 @
73e6821d
...
...
@@ -32,6 +32,7 @@ import java.awt.image.SinglePixelPackedSampleModel;
import
javax.imageio.spi.ImageWriterSpi
;
import
javax.imageio.spi.ServiceRegistry
;
import
javax.imageio.spi.IIORegistry
;
import
javax.imageio.stream.ImageOutputStream
;
import
javax.imageio.ImageWriter
;
import
javax.imageio.ImageTypeSpecifier
;
import
javax.imageio.IIOException
;
...
...
@@ -55,7 +56,7 @@ public class BMPImageWriterSpi extends ImageWriterSpi {
entensions
,
mimeType
,
"com.sun.imageio.plugins.bmp.BMPImageWriter"
,
STANDARD_OUTPUT_TYPE
,
new
Class
[]
{
ImageOutputStream
.
class
}
,
readerSpiNames
,
false
,
null
,
null
,
null
,
null
,
...
...
src/share/classes/com/sun/imageio/plugins/gif/GIFImageReaderSpi.java
浏览文件 @
73e6821d
...
...
@@ -60,7 +60,7 @@ public class GIFImageReaderSpi extends ImageReaderSpi {
suffixes
,
MIMETypes
,
readerClassName
,
STANDARD_INPUT_TYPE
,
new
Class
[]
{
ImageInputStream
.
class
}
,
writerSpiNames
,
true
,
GIFStreamMetadata
.
nativeMetadataFormatName
,
...
...
src/share/classes/com/sun/imageio/plugins/gif/GIFImageWriterSpi.java
浏览文件 @
73e6821d
...
...
@@ -31,6 +31,7 @@ import java.util.Locale;
import
javax.imageio.ImageTypeSpecifier
;
import
javax.imageio.ImageWriter
;
import
javax.imageio.spi.ImageWriterSpi
;
import
javax.imageio.stream.ImageOutputStream
;
import
com.sun.imageio.plugins.common.PaletteBuilder
;
public
class
GIFImageWriterSpi
extends
ImageWriterSpi
{
...
...
@@ -59,7 +60,7 @@ public class GIFImageWriterSpi extends ImageWriterSpi {
suffixes
,
MIMETypes
,
writerClassName
,
STANDARD_OUTPUT_TYPE
,
new
Class
[]
{
ImageOutputStream
.
class
}
,
readerSpiNames
,
true
,
GIFWritableStreamMetadata
.
NATIVE_FORMAT_NAME
,
...
...
src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReaderSpi.java
浏览文件 @
73e6821d
...
...
@@ -46,7 +46,7 @@ public class JPEGImageReaderSpi extends ImageReaderSpi {
JPEG
.
suffixes
,
JPEG
.
MIMETypes
,
"com.sun.imageio.plugins.jpeg.JPEGImageReader"
,
STANDARD_INPUT_TYPE
,
new
Class
[]
{
ImageInputStream
.
class
}
,
writerSpiNames
,
true
,
JPEG
.
nativeStreamMetadataFormatName
,
...
...
src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriterSpi.java
浏览文件 @
73e6821d
...
...
@@ -28,6 +28,7 @@ package com.sun.imageio.plugins.jpeg;
import
javax.imageio.spi.ImageWriterSpi
;
import
javax.imageio.spi.ServiceRegistry
;
import
javax.imageio.spi.IIORegistry
;
import
javax.imageio.stream.ImageOutputStream
;
import
javax.imageio.ImageWriter
;
import
javax.imageio.ImageTypeSpecifier
;
import
javax.imageio.IIOException
;
...
...
@@ -49,7 +50,7 @@ public class JPEGImageWriterSpi extends ImageWriterSpi {
JPEG
.
suffixes
,
JPEG
.
MIMETypes
,
"com.sun.imageio.plugins.jpeg.JPEGImageWriter"
,
STANDARD_OUTPUT_TYPE
,
new
Class
[]
{
ImageOutputStream
.
class
}
,
readerSpiNames
,
true
,
JPEG
.
nativeStreamMetadataFormatName
,
...
...
src/share/classes/com/sun/imageio/plugins/png/PNGImageReaderSpi.java
浏览文件 @
73e6821d
...
...
@@ -60,7 +60,7 @@ public class PNGImageReaderSpi extends ImageReaderSpi {
suffixes
,
MIMETypes
,
readerClassName
,
STANDARD_INPUT_TYPE
,
new
Class
[]
{
ImageInputStream
.
class
}
,
writerSpiNames
,
false
,
null
,
null
,
...
...
src/share/classes/com/sun/imageio/plugins/png/PNGImageWriterSpi.java
浏览文件 @
73e6821d
...
...
@@ -34,6 +34,7 @@ import javax.imageio.ImageTypeSpecifier;
import
javax.imageio.metadata.IIOMetadataFormat
;
import
javax.imageio.metadata.IIOMetadataFormatImpl
;
import
javax.imageio.spi.ImageWriterSpi
;
import
javax.imageio.stream.ImageOutputStream
;
public
class
PNGImageWriterSpi
extends
ImageWriterSpi
{
...
...
@@ -61,7 +62,7 @@ public class PNGImageWriterSpi extends ImageWriterSpi {
suffixes
,
MIMETypes
,
writerClassName
,
STANDARD_OUTPUT_TYPE
,
new
Class
[]
{
ImageOutputStream
.
class
}
,
readerSpiNames
,
false
,
null
,
null
,
...
...
src/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageReaderSpi.java
浏览文件 @
73e6821d
...
...
@@ -51,7 +51,7 @@ public class WBMPImageReaderSpi extends ImageReaderSpi {
entensions
,
mimeType
,
"com.sun.imageio.plugins.wbmp.WBMPImageReader"
,
STANDARD_INPUT_TYPE
,
new
Class
[]
{
ImageInputStream
.
class
}
,
writerSpiNames
,
true
,
null
,
null
,
null
,
null
,
...
...
src/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageWriterSpi.java
浏览文件 @
73e6821d
...
...
@@ -28,6 +28,7 @@ package com.sun.imageio.plugins.wbmp;
import
javax.imageio.spi.ImageWriterSpi
;
import
javax.imageio.spi.ServiceRegistry
;
import
javax.imageio.spi.IIORegistry
;
import
javax.imageio.stream.ImageOutputStream
;
import
javax.imageio.ImageWriter
;
import
javax.imageio.ImageTypeSpecifier
;
import
javax.imageio.IIOException
;
...
...
@@ -54,7 +55,7 @@ public class WBMPImageWriterSpi extends ImageWriterSpi {
entensions
,
mimeType
,
"com.sun.imageio.plugins.wbmp.WBMPImageWriter"
,
STANDARD_OUTPUT_TYPE
,
new
Class
[]
{
ImageOutputStream
.
class
}
,
readerSpiNames
,
true
,
null
,
null
,
null
,
null
,
...
...
src/share/classes/com/sun/imageio/stream/StreamCloser.java
浏览文件 @
73e6821d
...
...
@@ -43,35 +43,35 @@ import javax.imageio.stream.ImageInputStream;
*/
public
class
StreamCloser
{
private
static
WeakHashMap
<
ImageInputStream
,
Object
>
toCloseQueue
;
private
static
WeakHashMap
<
CloseAction
,
Object
>
toCloseQueue
;
private
static
Thread
streamCloser
;
public
static
void
addToQueue
(
ImageInputStream
iis
)
{
public
static
void
addToQueue
(
CloseAction
ca
)
{
synchronized
(
StreamCloser
.
class
)
{
if
(
toCloseQueue
==
null
)
{
toCloseQueue
=
new
WeakHashMap
<
ImageInputStream
,
Object
>();
new
WeakHashMap
<
CloseAction
,
Object
>();
}
toCloseQueue
.
put
(
iis
,
null
);
toCloseQueue
.
put
(
ca
,
null
);
if
(
streamCloser
==
null
)
{
final
Runnable
streamCloserRunnable
=
new
Runnable
()
{
public
void
run
()
{
if
(
toCloseQueue
!=
null
)
{
synchronized
(
StreamCloser
.
class
)
{
Set
<
ImageInputStream
>
set
=
Set
<
CloseAction
>
set
=
toCloseQueue
.
keySet
();
// Make a copy of the set in order to avoid
// concurrent modification (the is.close()
// will in turn call removeFromQueue())
ImageInputStream
[]
stream
s
=
new
ImageInputStream
[
set
.
size
()];
streams
=
set
.
toArray
(
stream
s
);
for
(
ImageInputStream
is
:
stream
s
)
{
if
(
is
!=
null
)
{
CloseAction
[]
action
s
=
new
CloseAction
[
set
.
size
()];
actions
=
set
.
toArray
(
action
s
);
for
(
CloseAction
ca
:
action
s
)
{
if
(
ca
!=
null
)
{
try
{
is
.
close
();
ca
.
performAction
();
}
catch
(
IOException
e
)
{
}
}
...
...
@@ -106,10 +106,28 @@ public class StreamCloser {
}
}
public
static
void
removeFromQueue
(
ImageInputStream
iis
)
{
public
static
void
removeFromQueue
(
CloseAction
ca
)
{
synchronized
(
StreamCloser
.
class
)
{
if
(
toCloseQueue
!=
null
)
{
toCloseQueue
.
remove
(
iis
);
toCloseQueue
.
remove
(
ca
);
}
}
}
public
static
CloseAction
createCloseAction
(
ImageInputStream
iis
)
{
return
new
CloseAction
(
iis
);
}
public
static
final
class
CloseAction
{
private
ImageInputStream
iis
;
private
CloseAction
(
ImageInputStream
iis
)
{
this
.
iis
=
iis
;
}
public
void
performAction
()
throws
IOException
{
if
(
iis
!=
null
)
{
iis
.
close
();
}
}
}
...
...
src/share/classes/com/sun/media/sound/JDK13Services.java
浏览文件 @
73e6821d
/*
* Copyright 1999-200
7
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 1999-200
9
Sun Microsystems, Inc. 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
...
...
@@ -41,6 +41,15 @@ import javax.sound.midi.spi.MidiFileWriter;
import
javax.sound.midi.spi.SoundbankReader
;
import
javax.sound.midi.spi.MidiDeviceProvider
;
import
javax.sound.midi.Receiver
;
import
javax.sound.midi.Sequencer
;
import
javax.sound.midi.Synthesizer
;
import
javax.sound.midi.Transmitter
;
import
javax.sound.sampled.Clip
;
import
javax.sound.sampled.Port
;
import
javax.sound.sampled.SourceDataLine
;
import
javax.sound.sampled.TargetDataLine
;
/**
* JDK13Services uses the Service class in JDK 1.3
...
...
@@ -186,6 +195,16 @@ public class JDK13Services {
If the property is not set, null is returned.
*/
private
static
synchronized
String
getDefaultProvider
(
Class
typeClass
)
{
if
(!
SourceDataLine
.
class
.
equals
(
typeClass
)
&&
!
TargetDataLine
.
class
.
equals
(
typeClass
)
&&
!
Clip
.
class
.
equals
(
typeClass
)
&&
!
Port
.
class
.
equals
(
typeClass
)
&&
!
Receiver
.
class
.
equals
(
typeClass
)
&&
!
Transmitter
.
class
.
equals
(
typeClass
)
&&
!
Synthesizer
.
class
.
equals
(
typeClass
)
&&
!
Sequencer
.
class
.
equals
(
typeClass
))
{
return
null
;
}
String
value
;
String
propertyName
=
typeClass
.
getName
();
value
=
JSSecurityManager
.
getProperty
(
propertyName
);
...
...
src/share/classes/com/sun/media/sound/JSSecurityManager.java
浏览文件 @
73e6821d
/*
* Copyright 1999-200
7
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 1999-200
9
Sun Microsystems, Inc. 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
...
...
@@ -283,12 +283,24 @@ class JSSecurityManager {
static
List
getProviders
(
final
Class
providerClass
)
{
PrivilegedAction
action
=
new
PrivilegedAction
()
{
public
Object
run
()
{
List
p
=
new
ArrayList
();
Iterator
ps
=
Service
.
providers
(
providerClass
);
while
(
ps
.
hasNext
())
{
// Service.providers(Class) just creates "lazy" iterator instance,
// so it doesn't require do be called from privileged section
final
Iterator
ps
=
Service
.
providers
(
providerClass
);
// the iterator's hasNext() method looks through classpath for
// the provider class names, so it requires read permissions
PrivilegedAction
<
Boolean
>
hasNextAction
=
new
PrivilegedAction
<
Boolean
>()
{
public
Boolean
run
()
{
return
ps
.
hasNext
();
}
};
while
(
AccessController
.
doPrivileged
(
hasNextAction
))
{
try
{
// the iterator's next() method creates instances of the
// providers and it should be called in the current security
// context
Object
provider
=
ps
.
next
();
if
(
providerClass
.
isInstance
(
provider
))
{
// $$mp 2003-08-22
...
...
@@ -300,11 +312,8 @@ class JSSecurityManager {
}
catch
(
Throwable
t
)
{
//$$fb 2002-11-07: do not fail on SPI not found
if
(
Printer
.
err
)
t
.
printStackTrace
();
}
}
return
p
;
}
};
List
providers
=
(
List
)
AccessController
.
doPrivileged
(
action
);
return
providers
;
}
return
p
;
}
}
src/share/classes/com/sun/media/sound/StandardMidiFileWriter.java
浏览文件 @
73e6821d
/*
* Copyright 1999-200
7
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 1999-200
9
Sun Microsystems, Inc. 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
...
...
@@ -82,7 +82,7 @@ public class StandardMidiFileWriter extends MidiFileWriter {
/**
* MIDI parser types
*/
p
ublic
static
final
int
types
[]
=
{
p
rivate
static
final
int
types
[]
=
{
MIDI_TYPE_0
,
MIDI_TYPE_1
};
...
...
src/share/classes/java/net/Socket.java
浏览文件 @
73e6821d
...
...
@@ -118,7 +118,7 @@ class Socket implements java.io.Closeable {
if
(
proxy
==
null
)
{
throw
new
IllegalArgumentException
(
"Invalid Proxy"
);
}
Proxy
p
=
proxy
==
Proxy
.
NO_PROXY
?
Proxy
.
NO_PROXY
:
new
Proxy
(
proxy
.
type
(),
proxy
.
address
()
);
Proxy
p
=
proxy
==
Proxy
.
NO_PROXY
?
Proxy
.
NO_PROXY
:
sun
.
net
.
ApplicationProxy
.
create
(
proxy
);
if
(
p
.
type
()
==
Proxy
.
Type
.
SOCKS
)
{
SecurityManager
security
=
System
.
getSecurityManager
();
InetSocketAddress
epoint
=
(
InetSocketAddress
)
p
.
address
();
...
...
src/share/classes/java/net/SocksSocketImpl.java
浏览文件 @
73e6821d
...
...
@@ -47,6 +47,9 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
private
Socket
cmdsock
=
null
;
private
InputStream
cmdIn
=
null
;
private
OutputStream
cmdOut
=
null
;
/* true if the Proxy has been set programatically */
private
boolean
applicationSetProxy
;
/* false */
SocksSocketImpl
()
{
// Nothing needed
...
...
@@ -64,6 +67,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
// Use getHostString() to avoid reverse lookups
server
=
ad
.
getHostString
();
port
=
ad
.
getPort
();
applicationSetProxy
=
true
;
}
}
...
...
@@ -165,8 +169,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
throw
(
IOException
)
pae
.
getException
();
}
}
else
{
userName
=
java
.
security
.
AccessController
.
doPrivileged
(
new
sun
.
security
.
action
.
GetPropertyAction
(
"user.name"
));
userName
=
getUserName
();
}
}
if
(
userName
==
null
)
...
...
@@ -267,8 +270,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
out
.
write
((
endpoint
.
getPort
()
>>
8
)
&
0xff
);
out
.
write
((
endpoint
.
getPort
()
>>
0
)
&
0xff
);
out
.
write
(
endpoint
.
getAddress
().
getAddress
());
String
userName
=
java
.
security
.
AccessController
.
doPrivileged
(
new
sun
.
security
.
action
.
GetPropertyAction
(
"user.name"
));
String
userName
=
getUserName
();
try
{
out
.
write
(
userName
.
getBytes
(
"ISO-8859-1"
));
}
catch
(
java
.
io
.
UnsupportedEncodingException
uee
)
{
...
...
@@ -588,8 +590,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
out
.
write
((
super
.
getLocalPort
()
>>
8
)
&
0xff
);
out
.
write
((
super
.
getLocalPort
()
>>
0
)
&
0xff
);
out
.
write
(
addr1
);
String
userName
=
java
.
security
.
AccessController
.
doPrivileged
(
new
sun
.
security
.
action
.
GetPropertyAction
(
"user.name"
));
String
userName
=
getUserName
();
try
{
out
.
write
(
userName
.
getBytes
(
"ISO-8859-1"
));
}
catch
(
java
.
io
.
UnsupportedEncodingException
uee
)
{
...
...
@@ -1052,4 +1053,16 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
super
.
close
();
}
private
String
getUserName
()
{
String
userName
=
""
;
if
(
applicationSetProxy
)
{
try
{
userName
=
System
.
getProperty
(
"user.name"
);
}
catch
(
SecurityException
se
)
{
/* swallow Exception */
}
}
else
{
userName
=
java
.
security
.
AccessController
.
doPrivileged
(
new
sun
.
security
.
action
.
GetPropertyAction
(
"user.name"
));
}
return
userName
;
}
}
src/share/classes/java/net/URL.java
浏览文件 @
73e6821d
...
...
@@ -1005,7 +1005,7 @@ public final class URL implements java.io.Serializable {
}
// Create a copy of Proxy as a security measure
Proxy
p
=
proxy
==
Proxy
.
NO_PROXY
?
Proxy
.
NO_PROXY
:
new
Proxy
(
proxy
.
type
(),
proxy
.
address
()
);
Proxy
p
=
proxy
==
Proxy
.
NO_PROXY
?
Proxy
.
NO_PROXY
:
sun
.
net
.
ApplicationProxy
.
create
(
proxy
);
SecurityManager
sm
=
System
.
getSecurityManager
();
if
(
p
.
type
()
!=
Proxy
.
Type
.
DIRECT
&&
sm
!=
null
)
{
InetSocketAddress
epoint
=
(
InetSocketAddress
)
p
.
address
();
...
...
src/share/classes/javax/imageio/plugins/bmp/BMPImageWriteParam.java
浏览文件 @
73e6821d
...
...
@@ -78,7 +78,7 @@ public class BMPImageWriteParam extends ImageWriteParam {
super
(
locale
);
// Set compression types ("BI_RGB" denotes uncompressed).
compressionTypes
=
BMPConstants
.
compressionTypeNames
;
compressionTypes
=
BMPConstants
.
compressionTypeNames
.
clone
()
;
// Set compression flag.
canWriteCompressed
=
true
;
...
...
src/share/classes/javax/imageio/spi/ImageReaderSpi.java
浏览文件 @
73e6821d
...
...
@@ -77,7 +77,10 @@ public abstract class ImageReaderSpi extends ImageReaderWriterSpi {
* A single-element array, initially containing
* <code>ImageInputStream.class</code>, to be returned from
* <code>getInputTypes</code>.
* @deprecated Instead of using this field, directly create
* the equivalent array <code>{ ImageInputStream.class }<code>.
*/
@Deprecated
public
static
final
Class
[]
STANDARD_INPUT_TYPE
=
{
ImageInputStream
.
class
};
...
...
@@ -227,7 +230,11 @@ public abstract class ImageReaderSpi extends ImageReaderWriterSpi {
throw
new
IllegalArgumentException
(
"inputTypes.length == 0!"
);
}
this
.
inputTypes
=
(
Class
[])
inputTypes
.
clone
();
this
.
inputTypes
=
(
inputTypes
==
STANDARD_INPUT_TYPE
)
?
new
Class
<?>[]
{
ImageInputStream
.
class
}
:
inputTypes
.
clone
();
// If length == 0, leave it null
if
(
writerSpiNames
!=
null
&&
writerSpiNames
.
length
>
0
)
{
this
.
writerSpiNames
=
(
String
[])
writerSpiNames
.
clone
();
...
...
src/share/classes/javax/imageio/spi/ImageWriterSpi.java
浏览文件 @
73e6821d
...
...
@@ -77,9 +77,12 @@ public abstract class ImageWriterSpi extends ImageReaderWriterSpi {
/**
* A single-element array, initially containing
* <code>ImageInputStream.class</code>, to be returned from
* <code>getInputTypes</code>.
* <code>ImageOutputStream.class</code>, to be returned from
* <code>getOutputTypes</code>.
* @deprecated Instead of using this field, directly create
* the equivalent array <code>{ ImageOutputStream.class }<code>.
*/
@Deprecated
public
static
final
Class
[]
STANDARD_OUTPUT_TYPE
=
{
ImageOutputStream
.
class
};
...
...
@@ -228,7 +231,11 @@ public abstract class ImageWriterSpi extends ImageReaderWriterSpi {
throw
new
IllegalArgumentException
(
"outputTypes.length == 0!"
);
}
this
.
outputTypes
=
(
Class
[])
outputTypes
.
clone
();
this
.
outputTypes
=
(
outputTypes
==
STANDARD_OUTPUT_TYPE
)
?
new
Class
<?>[]
{
ImageOutputStream
.
class
}
:
outputTypes
.
clone
();
// If length == 0, leave it null
if
(
readerSpiNames
!=
null
&&
readerSpiNames
.
length
>
0
)
{
this
.
readerSpiNames
=
(
String
[])
readerSpiNames
.
clone
();
...
...
src/share/classes/javax/imageio/stream/FileCacheImageInputStream.java
浏览文件 @
73e6821d
...
...
@@ -62,6 +62,10 @@ public class FileCacheImageInputStream extends ImageInputStreamImpl {
/** The DisposerRecord that closes the underlying cache. */
private
final
DisposerRecord
disposerRecord
;
/** The CloseAction that closes the stream in
* the StreamCloser's shutdown hook */
private
final
StreamCloser
.
CloseAction
closeAction
;
/**
* Constructs a <code>FileCacheImageInputStream</code> that will read
* from a given <code>InputStream</code>.
...
...
@@ -96,7 +100,9 @@ public class FileCacheImageInputStream extends ImageInputStreamImpl {
this
.
cacheFile
=
File
.
createTempFile
(
"imageio"
,
".tmp"
,
cacheDir
);
this
.
cache
=
new
RandomAccessFile
(
cacheFile
,
"rw"
);
StreamCloser
.
addToQueue
(
this
);
this
.
closeAction
=
StreamCloser
.
createCloseAction
(
this
);
StreamCloser
.
addToQueue
(
closeAction
);
disposerRecord
=
new
StreamDisposerRecord
(
cacheFile
,
cache
);
if
(
getClass
()
==
FileCacheImageInputStream
.
class
)
{
...
...
@@ -242,7 +248,7 @@ public class FileCacheImageInputStream extends ImageInputStreamImpl {
stream
=
null
;
cache
=
null
;
cacheFile
=
null
;
StreamCloser
.
removeFromQueue
(
this
);
StreamCloser
.
removeFromQueue
(
closeAction
);
}
/**
...
...
src/share/classes/javax/imageio/stream/FileCacheImageOutputStream.java
浏览文件 @
73e6821d
...
...
@@ -48,6 +48,10 @@ public class FileCacheImageOutputStream extends ImageOutputStreamImpl {
// Pos after last (rightmost) byte written
private
long
maxStreamPos
=
0L
;
/** The CloseAction that closes the stream in
* the StreamCloser's shutdown hook */
private
final
StreamCloser
.
CloseAction
closeAction
;
/**
* Constructs a <code>FileCacheImageOutputStream</code> that will write
* to a given <code>outputStream</code>.
...
...
@@ -82,7 +86,9 @@ public class FileCacheImageOutputStream extends ImageOutputStreamImpl {
this
.
cacheFile
=
File
.
createTempFile
(
"imageio"
,
".tmp"
,
cacheDir
);
this
.
cache
=
new
RandomAccessFile
(
cacheFile
,
"rw"
);
StreamCloser
.
addToQueue
(
this
);
this
.
closeAction
=
StreamCloser
.
createCloseAction
(
this
);
StreamCloser
.
addToQueue
(
closeAction
);
}
public
int
read
()
throws
IOException
{
...
...
@@ -227,7 +233,7 @@ public class FileCacheImageOutputStream extends ImageOutputStreamImpl {
cacheFile
=
null
;
stream
.
flush
();
stream
=
null
;
StreamCloser
.
removeFromQueue
(
this
);
StreamCloser
.
removeFromQueue
(
closeAction
);
}
public
void
flushBefore
(
long
pos
)
throws
IOException
{
...
...
src/share/classes/sun/net/ApplicationProxy.java
0 → 100644
浏览文件 @
73e6821d
/*
* Copyright 2009 Sun Microsystems, Inc. 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. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package
sun.net
;
import
java.net.Proxy
;
import
java.net.SocketAddress
;
/**
* Proxy wrapper class so that we can determine application set
* proxies by type.
*/
public
final
class
ApplicationProxy
extends
Proxy
{
private
ApplicationProxy
(
Proxy
proxy
)
{
super
(
proxy
.
type
(),
proxy
.
address
());
}
public
static
ApplicationProxy
create
(
Proxy
proxy
)
{
return
new
ApplicationProxy
(
proxy
);
}
}
src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java
浏览文件 @
73e6821d
...
...
@@ -575,12 +575,20 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
responses
=
new
MessageHeader
();
this
.
handler
=
handler
;
instProxy
=
p
;
if
(
instProxy
instanceof
sun
.
net
.
ApplicationProxy
)
{
/* Application set Proxies should not have access to cookies
* in a secure environment unless explicitly allowed. */
try
{
cookieHandler
=
CookieHandler
.
getDefault
();
}
catch
(
SecurityException
se
)
{
/* swallow exception */
}
}
else
{
cookieHandler
=
java
.
security
.
AccessController
.
doPrivileged
(
new
java
.
security
.
PrivilegedAction
<
CookieHandler
>()
{
public
CookieHandler
run
()
{
return
CookieHandler
.
getDefault
();
}
});
}
cacheHandler
=
java
.
security
.
AccessController
.
doPrivileged
(
new
java
.
security
.
PrivilegedAction
<
ResponseCache
>()
{
public
ResponseCache
run
()
{
...
...
src/share/lib/security/java.security
浏览文件 @
73e6821d
...
...
@@ -127,7 +127,7 @@ system.scope=sun.security.provider.IdentityDatabase
# passed to checkPackageAccess unless the
# corresponding RuntimePermission ("accessClassInPackage."+package) has
# been granted.
package.access=sun.
package.access=sun.
,com.sun.imageio.
#
# List of comma-separated packages that start with or equal this string
...
...
src/share/lib/security/java.security-solaris
浏览文件 @
73e6821d
...
...
@@ -128,7 +128,7 @@ system.scope=sun.security.provider.IdentityDatabase
# passed to checkPackageAccess unless the
# corresponding RuntimePermission ("accessClassInPackage."+package) has
# been granted.
package.access=sun.
package.access=sun.
,com.sun.imageio.
#
# List of comma-separated packages that start with or equal this string
...
...
src/share/lib/security/java.security-windows
浏览文件 @
73e6821d
...
...
@@ -128,7 +128,7 @@ system.scope=sun.security.provider.IdentityDatabase
# passed to checkPackageAccess unless the
# corresponding RuntimePermission ("accessClassInPackage."+package) has
# been granted.
package.access=sun.
package.access=sun.
,com.sun.imageio.
#
# List of comma-separated packages that start with or equal this string
...
...
src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c
浏览文件 @
73e6821d
...
...
@@ -139,21 +139,45 @@ SplashDecodeJpeg(Splash * splash, struct jpeg_decompress_struct *cinfo)
splash
->
width
=
cinfo
->
output_width
;
splash
->
height
=
cinfo
->
output_height
;
if
(
!
SAFE_TO_ALLOC
(
splash
->
imageFormat
.
depthBytes
,
splash
->
width
))
{
return
0
;
}
stride
=
splash
->
width
*
splash
->
imageFormat
.
depthBytes
;
if
(
!
SAFE_TO_ALLOC
(
stride
,
splash
->
height
))
{
return
0
;
}
if
(
!
SAFE_TO_ALLOC
(
cinfo
->
output_width
,
cinfo
->
output_components
))
{
return
0
;
}
splash
->
frameCount
=
1
;
splash
->
frames
=
(
SplashImage
*
)
malloc
(
sizeof
(
SplashImage
)
*
splash
->
frameCount
);
if
(
splash
->
frames
==
NULL
)
{
return
0
;
}
memset
(
splash
->
frames
,
0
,
sizeof
(
SplashImage
)
*
splash
->
frameCount
);
splash
->
loopCount
=
1
;
splash
->
frames
[
0
].
bitmapBits
=
malloc
(
stride
*
splash
->
height
);
splash
->
frames
[
0
].
delay
=
0
;
splash
->
frames
[
0
].
bitmapBits
=
malloc
(
stride
*
splash
->
height
);
if
(
splash
->
frames
[
0
].
bitmapBits
==
NULL
)
{
free
(
splash
->
frames
);
return
0
;
}
rowStride
=
cinfo
->
output_width
*
cinfo
->
output_components
;
buffer
=
(
*
cinfo
->
mem
->
alloc_sarray
)
((
j_common_ptr
)
cinfo
,
JPOOL_IMAGE
,
rowStride
,
1
);
if
(
buffer
==
NULL
)
{
free
(
splash
->
frames
[
0
].
bitmapBits
);
free
(
splash
->
frames
);
return
0
;
}
initFormat
(
&
srcFormat
,
0x00FF0000
,
0x0000FF00
,
0x000000FF
,
0x00000000
);
srcFormat
.
byteOrder
=
BYTE_ORDER_LSBFIRST
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录