71 |
@param b the data representing the classfile, in classfile format. |
@param b the data representing the classfile, in classfile format. |
72 |
@param off the offset into the data where the classfile starts. |
@param off the offset into the data where the classfile starts. |
73 |
@param len the length of the classfile data in the array. |
@param len the length of the classfile data in the array. |
74 |
@param cs the CodeSource for the class |
@param cs the CodeSource for the class or null when unknown. |
75 |
|
|
76 |
@return the class that was defined and optional CodeSource. |
@return the class that was defined and optional CodeSource. |
77 |
|
|
81 |
CodeSource cs) |
CodeSource cs) |
82 |
{ |
{ |
83 |
// FIXME: Need to cache ProtectionDomains according to 1.3 docs. |
// FIXME: Need to cache ProtectionDomains according to 1.3 docs. |
84 |
ProtectionDomain protectionDomain = |
if (cs != null) |
|
new ProtectionDomain(cs, getPermissions(cs)); |
|
|
try |
|
85 |
{ |
{ |
86 |
|
ProtectionDomain protectionDomain |
87 |
|
= new ProtectionDomain(cs, getPermissions(cs)); |
88 |
return super.defineClass(name, b, off, len, protectionDomain); |
return super.defineClass(name, b, off, len, protectionDomain); |
89 |
} |
} |
90 |
catch (ClassFormatError cfe) |
else |
91 |
{ |
return super.defineClass(name, b, off, len); |
|
return null; |
|
|
} |
|
92 |
} |
} |
93 |
|
|
94 |
/** |
/** |