Closed Bug 348732 Opened 14 years ago Closed 14 years ago

getGREPathWithProperties() fails if temp path has spaces

Categories

(Core Graveyard :: Java to XPCOM Bridge, defect)

1.8 Branch
x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jhpedemonte, Assigned: jhpedemonte)

Details

(Keywords: fixed1.8.1)

Attachments

(1 file)

If the temporary path has spaces, the "regedit" call in getGREPathFromRegKey() will fail.  The solution is to add quotes around the temp path.
glue\standalone\nsXPCOMGlue.cpp already provide GRE_GetGREPathWithProperties API, why you need write it in Java? Beside, SWT for Windows provide some API for ready register information, use "regedit" call really kind unprofessional...
(In reply to comment #1)
> glue\standalone\nsXPCOMGlue.cpp already provide GRE_GetGREPathWithProperties

Using this would require the Java app that is embedding Mozilla to link against the XPCOMGlue shared library.  That would mean that the Java app would depend on native code, and wouldn't be cross platform.

The solution to this was to recreate some of the XPCOMGlue code in Java, so that a Java app only needs to link in MozillaInterfaces.jar (no native libraries).

> Beside, SWT for Windows provide some API
> for ready register information, use "regedit" call really kind
> unprofessional...

JavaXPCOM does not depend on SWT.  It is a generic Java library.  So those APIs are not useful.  I spent some time searching for a way to do this in standard Java, but the only thing I found was this 'regedit' code.  Yes, it is hacky, but there doesn't seem to be any way to do it in pure Java code.
Attached patch patchSplinter Review
This is the patch suggested by Dominik on the ATF newsgroup.  I tested it and it works well.
Attachment #233854 - Flags: review+
(In reply to comment #2)
> Using this would require the Java app that is embedding Mozilla to link against
> the XPCOMGlue shared library.  That would mean that the Java app would depend
> on native code, and wouldn't be cross platform.

Without Mozilla, JavaXPCOM is useless. So I really don't understand what means
"That would mean that the Java app would depend on native code,
and wouldn't be cross platform.", you want embedding Mozilla but don't want your
Java app depend on native code? or menas GRE_GetGREPathWithProperties not works
on some platform like mozilla does?

GRE_GetGREPathWithProperties is in glue/standalone folder, which means it can
build as static link library, no other dll dependencies, Is it necessary that
JavaXPCOM must be in "pure" Java?
Checked in to trunk. ->FIXED
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Comment on attachment 233854 [details] [diff] [review]
patch

Asking for 1.8.1 approval.  This patch is low risk, and XULRunner only.
Attachment #233854 - Flags: approval1.8.1?
Comment on attachment 233854 [details] [diff] [review]
patch

a=schrep for drivers - non-blocker but doesn't affect main build
Attachment #233854 - Flags: approval1.8.1? → approval1.8.1+
Keywords: fixed1.8.1
Checked in to MOZILLA_1_8_BRANCH.
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.