Narayanan <[EMAIL PROTECTED]> writes:

> Daniel John Debrunner wrote:
>>
>> Sealing does not hide packages from other code, does it? I thought
>> it only prevented other code from inserting classes into the same
>> package.
>>
>> Dan.
> From Derby-2071 I can see that accessing classes from
> "org.apache.derby.iapi.services.io" in another jar can cause you a
> sealing violation.

I think that's because accessing classes from another jar will cause
Derby's build system to include those classes in that other jar as well,
unless it's explicitly told not to do so. See the findDependencies()
method in org.apache.derbyBuild.classlister.

> Also I found
>
> "If you try to load a class in a sealed package from another source
> other than the JAR file in which the sealed package lives, the JVM
> will throw a |SecurityException|."
> here http://www.ibm.com/developerworks/library/j-jar/#N101D6 as the
> last line in the Package sealing sub-header.

By "load a class ... from another source" I think he means that the
loaded class is located in another source, not that the code that causes
the class to be loaded is in another source.

-- 
Knut Anders

Reply via email to