On 8/30/06, Andrew Zhang wrote:
<SNIP>
> > > If I understoond correctly, new FileHandler() creates temporary file
> for
> > > logging (its name is defined by default configuration properties).
> That
> > is
> > > true for Harmony and RI. Right?
> >
> >
> > Stepan, you missed something here. :)
> > Both Harmony and RI creates a file (not temporary) for logging, and RI
> > created one more file(temporary) for locking.
> > RI tries to delete the temporary .lck file when fileHandler.close() is
> > invoked. Harmony has nothing to be deleted. :)
>
>
> IOW, Harmony uses different locking approach for log-files and the test
> above demonstrate side-effect of different approaches. Right?
Yes, exatcly.
IMO, we should add a note to the documentation: why we chose different
> locking approach.
Rather than adding a note to source code, I think it's more helpful to
document the difference on the test.
Yes, documenting our implementation design is helpful, but I think there's
no need to document the design differences between Harmony and RI.
We don't care the design and implementation of RI, do we? So I suggest
document some words on the test case, like "RI fails here because ....".
Comments/objections? Thanks!
BTW, if two VMs tries to open the same file for logging how this conflict is
resolved by Harmony if there is not lock file?
Thanks,
Stepan
>
> > RI tries to delete the created file if FileHandler.close() is invoked.
> And
> > > Harmony doesn't. Why?
> > >
> > > Thanks,
> > > Stepan.
> > >
> > > If we revise the MockSecurityManager a little, to allow .lck file
> > > > permission,
> > > >
> > > > public void checkPermission(Permission perm) {
> > > > if (perm instanceof FilePermission) {
> > > > if (perm.getName().indexOf(".lck") == -1) {
> > > > System.out.println("check " + perm.getName());
> > > > throw new SecurityException();
> > > > }
> > > > }
> > > > }
> > > >
> > > > The test will pass both against RI and Harmony.
> > > >
> > > > So I'd suggest to leave it as "non-bug difference from RI".
> > > >
> > > > Any comments? Thank you!
> > > >
> > > >
> > > >
> > > > --
> > > > Andrew Zhang
> > > > China Software Development Lab, IBM
------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]