harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ilya Okomin (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-1751) Classlib test org.apache.harmony.prefs.tests.java.util.prefs.PreferencesTest.testSystemNodeForPackage() fails
Date Tue, 28 Nov 2006 10:57:24 GMT
    [ http://issues.apache.org/jira/browse/HARMONY-1751?page=comments#action_12453874 ] 
            
Ilya Okomin commented on HARMONY-1751:
--------------------------------------

Stepan, let me add my 0,02$.
I've checked the example you'd suggested...behavior of RI and Harmony really differs.

Concerning your note about fixes in native code...please revise it again. I'm not sure there
is something wong there.
IMO algorithm steps are following:
- invoke openRegKey("root", "path") where "root" == HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE
depending on the arguments. This method in turn tries to open registry key "path" and if it
fails to open the key it creates it, if SUCCESS - "hKey" variable for "path" is initiated.
- checks error code returned by openRegKey("root", "path") and if err!=ERROR_SUCCESS returns,
 
- the next step to invoke RegCreateKeyEx again but with another parameters ("hKey", "name")
and returns dwDisposition==REG_CREATED_NEW_KEY value that is false in the case, when "name"
key couldn't have been created for "hKey" handle.
Everything looks fine for me.

If I understand right, if spec. for AbstractPreferences says that "putSpi, removeSpi and childSpi
should throw an exception: if the caller lacks sufficient privileges...While implementations
are not required to throw an exception under these circumstances, they are encouraged to do
so. A SecurityException would be appropriate." we can follow the spec and treat this case
as non-bug difference.  Stepan, Elena, what do you think about this conclusion?

Thanks,
Ilya.

> Classlib test org.apache.harmony.prefs.tests.java.util.prefs.PreferencesTest.testSystemNodeForPackage()
fails
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1751
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1751
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Elena Semukhina
>         Assigned To: Stepan Mishura
>         Attachments: H-1751_PreferencesTest_updated.patch, Harmony-1751.patch, PreferencesTest.patch,
TestPref.java
>
>
> The test fails for me on Windows on both j9 and drlvm with the following assertion:
> ant -Dbuild.module=prefs -Dtest.case=PreferencesTest test
> testSystemNodeForPackage Error N/A
> (J9)
> java.lang.SecurityException at java.util.prefs.RegistryPreferencesImpl.childSpi(RegistryPreferencesImpl.java:116)
at java.util.prefs.AbstractPreferences.getNodeFromBackend(AbstractPreferences.java:645) at
java.util.prefs.AbstractPreferences.nodeImpl(AbstractPreferences.java:626) at java.util.prefs.AbstractPreferences.node(AbstractPreferences.java:597)
at java.util.prefs.Preferences.systemNodeForPackage(Preferences.java:767) at org.apache.harmony.prefs.tests.java.util.prefs.PreferencesTest.testSystemNodeForPackage(PreferencesTest.java:62)
at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25) 
> (drlvm)
> java.lang.SecurityException at java.util.prefs.RegistryPreferencesImpl.childSpi(RegistryPreferencesImpl.java:116)
at java.util.prefs.AbstractPreferences.getNodeFromBackend(AbstractPreferences.java:644) at
java.util.prefs.AbstractPreferences.nodeImpl(AbstractPreferences.java:625) at java.util.prefs.AbstractPreferences.node(AbstractPreferences.java:595)
at java.util.prefs.Preferences.systemNodeForPackage(Preferences.java:767) at org.apache.harmony.prefs.tests.java.util.prefs.PreferencesTest.testSystemNodeForPackage(PreferencesTest.java:62)
at java.lang.reflect.VMReflection.invokeMethod(Native Method)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message