Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
1f711967
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看板
提交
1f711967
编写于
4月 06, 2011
作者:
A
amenkov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6992523: FindBugs scan - Malicious code vulnerability Warnings in com.sun.media.sound.*
Reviewed-by: alexp
上级
4a345228
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
26 addition
and
15 deletion
+26
-15
src/share/classes/com/sun/media/sound/DLSInstrument.java
src/share/classes/com/sun/media/sound/DLSInstrument.java
+3
-2
src/share/classes/com/sun/media/sound/DLSSample.java
src/share/classes/com/sun/media/sound/DLSSample.java
+3
-2
src/share/classes/com/sun/media/sound/ModelConnectionBlock.java
...are/classes/com/sun/media/sound/ModelConnectionBlock.java
+5
-5
src/share/classes/com/sun/media/sound/SoftChannel.java
src/share/classes/com/sun/media/sound/SoftChannel.java
+3
-3
src/share/classes/com/sun/media/sound/SoftInstrument.java
src/share/classes/com/sun/media/sound/SoftInstrument.java
+5
-0
src/share/classes/com/sun/media/sound/SoftMixingDataLine.java
...share/classes/com/sun/media/sound/SoftMixingDataLine.java
+1
-1
src/share/classes/com/sun/media/sound/SoftProvider.java
src/share/classes/com/sun/media/sound/SoftProvider.java
+2
-1
src/share/classes/com/sun/media/sound/SoftTuning.java
src/share/classes/com/sun/media/sound/SoftTuning.java
+4
-1
未找到文件。
src/share/classes/com/sun/media/sound/DLSInstrument.java
浏览文件 @
1f711967
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
package
com.sun.media.sound
;
package
com.sun.media.sound
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -439,10 +440,10 @@ public class DLSInstrument extends ModelInstrument {
...
@@ -439,10 +440,10 @@ public class DLSInstrument extends ModelInstrument {
}
}
public
byte
[]
getGuid
()
{
public
byte
[]
getGuid
()
{
return
guid
;
return
guid
==
null
?
null
:
Arrays
.
copyOf
(
guid
,
guid
.
length
)
;
}
}
public
void
setGuid
(
byte
[]
guid
)
{
public
void
setGuid
(
byte
[]
guid
)
{
this
.
guid
=
guid
;
this
.
guid
=
guid
==
null
?
null
:
Arrays
.
copyOf
(
guid
,
guid
.
length
)
;
}
}
}
}
src/share/classes/com/sun/media/sound/DLSSample.java
浏览文件 @
1f711967
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
package
com.sun.media.sound
;
package
com.sun.media.sound
;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.util.Arrays
;
import
javax.sound.midi.Soundbank
;
import
javax.sound.midi.Soundbank
;
import
javax.sound.midi.SoundbankResource
;
import
javax.sound.midi.SoundbankResource
;
import
javax.sound.sampled.AudioFormat
;
import
javax.sound.sampled.AudioFormat
;
...
@@ -113,10 +114,10 @@ public class DLSSample extends SoundbankResource {
...
@@ -113,10 +114,10 @@ public class DLSSample extends SoundbankResource {
}
}
public
byte
[]
getGuid
()
{
public
byte
[]
getGuid
()
{
return
guid
;
return
guid
==
null
?
null
:
Arrays
.
copyOf
(
guid
,
guid
.
length
)
;
}
}
public
void
setGuid
(
byte
[]
guid
)
{
public
void
setGuid
(
byte
[]
guid
)
{
this
.
guid
=
guid
;
this
.
guid
=
guid
==
null
?
null
:
Arrays
.
copyOf
(
guid
,
guid
.
length
)
;
}
}
}
}
src/share/classes/com/sun/media/sound/ModelConnectionBlock.java
浏览文件 @
1f711967
...
@@ -24,6 +24,8 @@
...
@@ -24,6 +24,8 @@
*/
*/
package
com.sun.media.sound
;
package
com.sun.media.sound
;
import
java.util.Arrays
;
/**
/**
* Connection blocks are used to connect source variable
* Connection blocks are used to connect source variable
* to a destination variable.
* to a destination variable.
...
@@ -117,19 +119,17 @@ public class ModelConnectionBlock {
...
@@ -117,19 +119,17 @@ public class ModelConnectionBlock {
}
}
public
ModelSource
[]
getSources
()
{
public
ModelSource
[]
getSources
()
{
return
sources
;
return
Arrays
.
copyOf
(
sources
,
sources
.
length
)
;
}
}
public
void
setSources
(
ModelSource
[]
source
)
{
public
void
setSources
(
ModelSource
[]
source
)
{
this
.
sources
=
source
;
this
.
sources
=
source
==
null
?
no_sources
:
Arrays
.
copyOf
(
source
,
source
.
length
)
;
}
}
public
void
addSource
(
ModelSource
source
)
{
public
void
addSource
(
ModelSource
source
)
{
ModelSource
[]
oldsources
=
sources
;
ModelSource
[]
oldsources
=
sources
;
sources
=
new
ModelSource
[
oldsources
.
length
+
1
];
sources
=
new
ModelSource
[
oldsources
.
length
+
1
];
for
(
int
i
=
0
;
i
<
oldsources
.
length
;
i
++)
{
System
.
arraycopy
(
oldsources
,
0
,
sources
,
0
,
oldsources
.
length
);
sources
[
i
]
=
oldsources
[
i
];
}
sources
[
sources
.
length
-
1
]
=
source
;
sources
[
sources
.
length
-
1
]
=
source
;
}
}
}
}
src/share/classes/com/sun/media/sound/SoftChannel.java
浏览文件 @
1f711967
...
@@ -503,7 +503,7 @@ public class SoftChannel implements MidiChannel, ModelDirectedPlayer {
...
@@ -503,7 +503,7 @@ public class SoftChannel implements MidiChannel, ModelDirectedPlayer {
firstVoice
=
true
;
firstVoice
=
true
;
voiceNo
=
0
;
voiceNo
=
0
;
int
tunedKey
=
(
int
)(
Math
.
round
(
tuning
.
getTuning
(
)[
noteNumber
]
/
100.0
));
int
tunedKey
=
(
int
)(
Math
.
round
(
tuning
.
getTuning
(
noteNumber
)
/
100.0
));
play_noteNumber
=
noteNumber
;
play_noteNumber
=
noteNumber
;
play_velocity
=
velocity
;
play_velocity
=
velocity
;
play_delay
=
delay
;
play_delay
=
delay
;
...
@@ -607,7 +607,7 @@ public class SoftChannel implements MidiChannel, ModelDirectedPlayer {
...
@@ -607,7 +607,7 @@ public class SoftChannel implements MidiChannel, ModelDirectedPlayer {
firstVoice
=
true
;
firstVoice
=
true
;
voiceNo
=
0
;
voiceNo
=
0
;
int
tunedKey
=
(
int
)(
Math
.
round
(
tuning
.
getTuning
(
)[
noteNumber
]
/
100.0
));
int
tunedKey
=
(
int
)(
Math
.
round
(
tuning
.
getTuning
(
noteNumber
)
/
100.0
));
play_noteNumber
=
noteNumber
;
play_noteNumber
=
noteNumber
;
play_velocity
=
lastVelocity
[
noteNumber
];
play_velocity
=
lastVelocity
[
noteNumber
];
play_releasetriggered
=
true
;
play_releasetriggered
=
true
;
...
@@ -632,7 +632,7 @@ public class SoftChannel implements MidiChannel, ModelDirectedPlayer {
...
@@ -632,7 +632,7 @@ public class SoftChannel implements MidiChannel, ModelDirectedPlayer {
int
delay
=
play_delay
;
int
delay
=
play_delay
;
boolean
releasetriggered
=
play_releasetriggered
;
boolean
releasetriggered
=
play_releasetriggered
;
SoftPerformer
p
=
current_instrument
.
getPerformer
s
()[
performerIndex
]
;
SoftPerformer
p
=
current_instrument
.
getPerformer
(
performerIndex
)
;
if
(
firstVoice
)
{
if
(
firstVoice
)
{
firstVoice
=
false
;
firstVoice
=
false
;
...
...
src/share/classes/com/sun/media/sound/SoftInstrument.java
浏览文件 @
1f711967
...
@@ -76,7 +76,12 @@ public class SoftInstrument extends Instrument {
...
@@ -76,7 +76,12 @@ public class SoftInstrument extends Instrument {
return
data
;
return
data
;
}
}
/* am: currently getPerformers() is not used (replaced with getPerformer(int))
public SoftPerformer[] getPerformers() {
public SoftPerformer[] getPerformers() {
return performers;
return performers;
}
}
*/
public
SoftPerformer
getPerformer
(
int
index
)
{
return
performers
[
index
];
}
}
}
src/share/classes/com/sun/media/sound/SoftMixingDataLine.java
浏览文件 @
1f711967
...
@@ -505,7 +505,7 @@ public abstract class SoftMixingDataLine implements DataLine {
...
@@ -505,7 +505,7 @@ public abstract class SoftMixingDataLine implements DataLine {
}
}
public
Control
[]
getControls
()
{
public
Control
[]
getControls
()
{
return
controls
;
return
Arrays
.
copyOf
(
controls
,
controls
.
length
)
;
}
}
public
boolean
isControlSupported
(
Type
control
)
{
public
boolean
isControlSupported
(
Type
control
)
{
...
...
src/share/classes/com/sun/media/sound/SoftProvider.java
浏览文件 @
1f711967
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
*/
*/
package
com.sun.media.sound
;
package
com.sun.media.sound
;
import
java.util.Arrays
;
import
javax.sound.midi.MidiDevice
;
import
javax.sound.midi.MidiDevice
;
import
javax.sound.midi.MidiDevice.Info
;
import
javax.sound.midi.MidiDevice.Info
;
import
javax.sound.midi.spi.MidiDeviceProvider
;
import
javax.sound.midi.spi.MidiDeviceProvider
;
...
@@ -39,7 +40,7 @@ public class SoftProvider extends MidiDeviceProvider {
...
@@ -39,7 +40,7 @@ public class SoftProvider extends MidiDeviceProvider {
private
static
Info
[]
softinfos
=
{
softinfo
};
private
static
Info
[]
softinfos
=
{
softinfo
};
public
MidiDevice
.
Info
[]
getDeviceInfo
()
{
public
MidiDevice
.
Info
[]
getDeviceInfo
()
{
return
softinfos
;
return
Arrays
.
copyOf
(
softinfos
,
softinfos
.
length
)
;
}
}
public
MidiDevice
getDevice
(
MidiDevice
.
Info
info
)
{
public
MidiDevice
getDevice
(
MidiDevice
.
Info
info
)
{
...
...
src/share/classes/com/sun/media/sound/SoftTuning.java
浏览文件 @
1f711967
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
package
com.sun.media.sound
;
package
com.sun.media.sound
;
import
java.io.UnsupportedEncodingException
;
import
java.io.UnsupportedEncodingException
;
import
java.util.Arrays
;
import
javax.sound.midi.Patch
;
import
javax.sound.midi.Patch
;
...
@@ -234,8 +235,10 @@ public class SoftTuning {
...
@@ -234,8 +235,10 @@ public class SoftTuning {
}
}
}
}
// am: getTuning(int) is more effective.
// currently getTuning() is used only by tests
public
double
[]
getTuning
()
{
public
double
[]
getTuning
()
{
return
tuning
;
return
Arrays
.
copyOf
(
tuning
,
tuning
.
length
)
;
}
}
public
double
getTuning
(
int
noteNumber
)
{
public
double
getTuning
(
int
noteNumber
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录