Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (6)
Silence coverity unguarded read warning
· 1c962b55
hpi1
authored
Feb 23, 2019
1c962b55
Fix using default encoding
· a05d9b5e
hpi1
authored
Feb 23, 2019
a05d9b5e
Fix type before cast
· 1b9c2401
hpi1
authored
Feb 23, 2019
1b9c2401
Simplify
· fc1e71de
hpi1
authored
Feb 23, 2019
fc1e71de
Use doPrivileged when creating class loader
· 2fb71f4e
hpi1
authored
Feb 23, 2019
2fb71f4e
Make implementation class package private
· f1a41a90
hpi1
authored
Feb 23, 2019
f1a41a90
Hide whitespace changes
Inline
Side-by-side
src/libbluray/bdj/java-j2se/java/awt/BDToolkit.java
View file @
f1a41a90
...
...
@@ -88,7 +88,11 @@ public class BDToolkit extends BDToolkitBase
throw
new
Error
(
"Not implemented"
);
}
public
java
.
awt
.
peer
.
FramePeer
createFrame
(
Frame
target
)
{
return
new
BDFramePeer
(
target
,
(
BDRootWindow
)
target
);
if
(!(
target
instanceof
BDRootWindow
))
{
logger
.
error
(
"createFrame(): not BDRootWindow"
);
throw
new
Error
(
"Not implemented"
);
}
return
new
BDFramePeer
((
BDRootWindow
)
target
);
}
public
java
.
awt
.
peer
.
ButtonPeer
createButton
(
Button
target
)
{
...
...
src/libbluray/bdj/java-j2se/java/awt/peer/BDFramePeer.java
View file @
f1a41a90
...
...
@@ -30,8 +30,8 @@ import org.videolan.Logger;
public
class
BDFramePeer
extends
BDComponentPeer
implements
FramePeer
{
public
BDFramePeer
(
Frame
frame
,
BDRootWindow
rootWindow
)
{
super
(
frame
.
getToolkit
(),
frame
);
public
BDFramePeer
(
BDRootWindow
rootWindow
)
{
super
(
rootWindow
.
getToolkit
(),
rootWindow
);
this
.
rootWindow
=
rootWindow
;
}
...
...
src/libbluray/bdj/java-j2se/java/io/FileInputStream.java
View file @
f1a41a90
...
...
@@ -177,8 +177,8 @@ public class FileInputStream extends InputStream
if
(
logger
==
null
)
{
logger
=
Logger
.
getLogger
(
FileInputStream
.
class
.
getName
());
}
return
logger
;
}
return
logger
;
}
private
static
native
void
initIDs
();
...
...
src/libbluray/bdj/java/org/dvb/lang/DVBClassLoader.java
View file @
f1a41a90
...
...
@@ -26,28 +26,51 @@ import java.security.PermissionCollection;
import
java.util.Enumeration
;
import
java.util.jar.Manifest
;
import
java.security.AccessController
;
import
java.security.PrivilegedAction
;
public
abstract
class
DVBClassLoader
extends
java
.
security
.
SecureClassLoader
{
public
static
DVBClassLoader
newInstance
(
URL
[]
urls
)
{
return
new
DVBClassLoaderImpl
(
urls
);
public
static
DVBClassLoader
newInstance
(
final
URL
[]
urls
)
{
return
(
DVBClassLoader
)
AccessController
.
doPrivileged
(
new
PrivilegedAction
()
{
public
Object
run
()
{
return
new
DVBClassLoaderImpl
(
urls
);
}
});
}
public
static
DVBClassLoader
newInstance
(
URL
[]
urls
,
ClassLoader
parent
)
{
return
new
DVBClassLoaderImpl
(
urls
,
parent
);
public
static
DVBClassLoader
newInstance
(
final
URL
[]
urls
,
final
ClassLoader
parent
)
{
return
(
DVBClassLoader
)
AccessController
.
doPrivileged
(
new
PrivilegedAction
()
{
public
Object
run
()
{
return
new
DVBClassLoaderImpl
(
urls
,
parent
);
}
});
}
public
DVBClassLoader
(
URL
[]
urls
)
{
public
DVBClassLoader
(
final
URL
[]
urls
)
{
SecurityManager
sm
=
System
.
getSecurityManager
();
if
(
sm
!=
null
)
sm
.
checkCreateClassLoader
();
loader
=
new
DVBURLClassLoader
(
urls
);
loader
=
(
DVBURLClassLoader
)
AccessController
.
doPrivileged
(
new
PrivilegedAction
()
{
public
Object
run
()
{
return
new
DVBURLClassLoader
(
urls
);
}
});
}
public
DVBClassLoader
(
URL
[]
urls
,
ClassLoader
parent
)
{
public
DVBClassLoader
(
final
URL
[]
urls
,
final
ClassLoader
parent
)
{
super
(
parent
);
SecurityManager
sm
=
System
.
getSecurityManager
();
if
(
sm
!=
null
)
sm
.
checkCreateClassLoader
();
loader
=
new
DVBURLClassLoader
(
urls
,
parent
);
loader
=
(
DVBURLClassLoader
)
AccessController
.
doPrivileged
(
new
PrivilegedAction
()
{
public
Object
run
()
{
return
new
DVBURLClassLoader
(
urls
,
parent
);
}
});
}
public
Class
findClass
(
String
name
)
throws
ClassNotFoundException
{
...
...
src/libbluray/bdj/java/org/dvb/lang/DVBClassLoaderImpl.java
View file @
f1a41a90
...
...
@@ -21,7 +21,7 @@ package org.dvb.lang;
import
java.net.URL
;
public
class
DVBClassLoaderImpl
extends
DVBClassLoader
{
class
DVBClassLoaderImpl
extends
DVBClassLoader
{
public
DVBClassLoaderImpl
(
URL
[]
urls
)
{
super
(
urls
);
}
...
...
src/libbluray/bdj/java/org/videolan/BDJClassLoader.java
View file @
f1a41a90
...
...
@@ -31,12 +31,15 @@ import java.util.ArrayList;
import
java.util.Enumeration
;
import
java.util.Map
;
import
java.security.AccessController
;
import
java.security.PrivilegedAction
;
import
javax.tv.xlet.Xlet
;
import
org.videolan.bdjo.AppCache
;
public
class
BDJClassLoader
extends
URLClassLoader
{
public
static
BDJClassLoader
newInstance
(
AppCache
[]
appCaches
,
String
basePath
,
String
classPathExt
,
String
xletClass
)
{
public
static
BDJClassLoader
newInstance
(
AppCache
[]
appCaches
,
String
basePath
,
String
classPathExt
,
final
String
xletClass
)
{
ArrayList
classPath
=
new
ArrayList
();
URL
url
=
translateClassPath
(
appCaches
,
basePath
,
null
);
if
(
url
!=
null
)
...
...
@@ -47,7 +50,14 @@ public class BDJClassLoader extends URLClassLoader {
if
((
url
!=
null
)
&&
(
classPath
.
indexOf
(
url
)
<
0
))
classPath
.
add
(
url
);
}
return
new
BDJClassLoader
((
URL
[])
classPath
.
toArray
(
new
URL
[
classPath
.
size
()])
,
xletClass
);
final
URL
[]
urls
=
(
URL
[])
classPath
.
toArray
(
new
URL
[
classPath
.
size
()]);
return
(
BDJClassLoader
)
AccessController
.
doPrivileged
(
new
PrivilegedAction
()
{
public
Object
run
()
{
return
new
BDJClassLoader
(
urls
,
xletClass
);
}
});
}
private
static
URL
translateClassPath
(
AppCache
[]
appCaches
,
String
basePath
,
String
classPath
)
{
...
...
src/libbluray/bdj/java/org/videolan/mmbd/LoaderAdapter.java
View file @
f1a41a90
...
...
@@ -60,17 +60,22 @@ public class LoaderAdapter implements BDJLoaderAdapter {
if
(
title
!=
65535
)
return
in
;
try
{
for
(
i1
=
0
;
i1
<
in
.
length
;
i1
++)
{
if
(
in
[
i1
].
getParams
()
!=
null
&&
in
[
i1
].
getParams
().
length
==
1
&&
in
[
i1
].
getControlCode
()
==
AppEntry
.
AUTOSTART
&&
match
(
in
[
i1
].
getInitialClass
().
getBytes
(),
0
,
0
)
==
0
&&
match
(
in
[
i1
].
getParams
()[
0
].
substring
(
0
,
9
).
getBytes
(),
1
,
0
)
==
0
)
{
match
(
in
[
i1
].
getInitialClass
().
getBytes
(
"UTF-8"
),
0
,
0
)
==
0
&&
match
(
in
[
i1
].
getParams
()[
0
].
substring
(
0
,
9
).
getBytes
(
"UTF-8"
),
1
,
0
)
==
0
)
{
break
;
}
}
if
(
i1
==
in
.
length
)
return
in
;
}
catch
(
java
.
io
.
UnsupportedEncodingException
uee
)
{
logger
.
error
(
""
+
uee
);
return
in
;
}
xlet
=
"."
+
StrUtil
.
split
(
in
[
i1
].
getParams
()[
0
],
':'
)[
1
];
for
(
i2
=
0
;
i2
<
in
.
length
;
i2
++)
{
...
...