You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Alexey Varlamov (JIRA)" <ji...@apache.org> on 2006/12/05 08:15:20 UTC
[jira] Created: (HARMONY-2453) [luni] Environment provides
inconsistent map on Windows
[luni] Environment provides inconsistent map on Windows
-------------------------------------------------------
Key: HARMONY-2453
URL: http://issues.apache.org/jira/browse/HARMONY-2453
Project: Harmony
Issue Type: Bug
Components: Classlib
Environment: WinXP, Win2003 Server
Reporter: Alexey Varlamov
The following test fails often on WIndows:
public void testGetenv() {
Map<String, String> env = System.getenv();
for (String key : env.keySet()) {
assertEquals("Value of " + key, env.get(key), System.getenv(key));
}
}
junit.framework.ComparisonFailure: Value of expected:<G:=G:\avarlamo\harmony\2commit> but was:<null>
at junit.framework.Assert.assertEquals(Assert.java:81)
at java.lang.SystemTest.testGetenv(SystemTest.java:49)
--
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
[jira] Commented: (HARMONY-2453) [luni] Environment provides
inconsistent map on Windows
Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-2453?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12483636 ]
Alexey Petrenko commented on HARMONY-2453:
------------------------------------------
Elena,
I would say that it will be better to change the following expression
!envStrings[i].startsWith("=") to env.Strings[i].charAt(0) != '='
This should be better from the performance point of view.
What do you think?
> [luni] Environment provides inconsistent map on Windows
> -------------------------------------------------------
>
> Key: HARMONY-2453
> URL: https://issues.apache.org/jira/browse/HARMONY-2453
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: WinXP, Win2003 Server
> Reporter: Alexey Varlamov
> Assigned To: Alexey Petrenko
> Priority: Minor
> Attachments: H-2453.patch, H-2453_remove_SystemTest_from_excluded.patch
>
>
> The following test fails often on WIndows:
> public void testGetenv() {
> Map<String, String> env = System.getenv();
> for (String key : env.keySet()) {
> assertEquals("Value of " + key, env.get(key), System.getenv(key));
> }
> }
> junit.framework.ComparisonFailure: Value of expected:<G:=G:\avarlamo\harmony\2commit> but was:<null>
> at junit.framework.Assert.assertEquals(Assert.java:81)
> at java.lang.SystemTest.testGetenv(SystemTest.java:49)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (HARMONY-2453) [luni] Environment provides
inconsistent map on Windows
Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-2453?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexey Petrenko reassigned HARMONY-2453:
----------------------------------------
Assignee: Alexey Petrenko
> [luni] Environment provides inconsistent map on Windows
> -------------------------------------------------------
>
> Key: HARMONY-2453
> URL: https://issues.apache.org/jira/browse/HARMONY-2453
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: WinXP, Win2003 Server
> Reporter: Alexey Varlamov
> Assigned To: Alexey Petrenko
> Priority: Minor
> Attachments: H-2453.patch, H-2453_remove_SystemTest_from_excluded.patch
>
>
> The following test fails often on WIndows:
> public void testGetenv() {
> Map<String, String> env = System.getenv();
> for (String key : env.keySet()) {
> assertEquals("Value of " + key, env.get(key), System.getenv(key));
> }
> }
> junit.framework.ComparisonFailure: Value of expected:<G:=G:\avarlamo\harmony\2commit> but was:<null>
> at junit.framework.Assert.assertEquals(Assert.java:81)
> at java.lang.SystemTest.testGetenv(SystemTest.java:49)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HARMONY-2453) [classlib][luni] Environment
provides inconsistent map on Windows
Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-2453?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexey Petrenko updated HARMONY-2453:
-------------------------------------
Summary: [classlib][luni] Environment provides inconsistent map on Windows (was: [luni] Environment provides inconsistent map on Windows)
> [classlib][luni] Environment provides inconsistent map on Windows
> -----------------------------------------------------------------
>
> Key: HARMONY-2453
> URL: https://issues.apache.org/jira/browse/HARMONY-2453
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: WinXP, Win2003 Server
> Reporter: Alexey Varlamov
> Assigned To: Alexey Petrenko
> Priority: Minor
> Attachments: H-2453.patch, H-2453_remove_SystemTest_from_excluded.patch
>
>
> The following test fails often on WIndows:
> public void testGetenv() {
> Map<String, String> env = System.getenv();
> for (String key : env.keySet()) {
> assertEquals("Value of " + key, env.get(key), System.getenv(key));
> }
> }
> junit.framework.ComparisonFailure: Value of expected:<G:=G:\avarlamo\harmony\2commit> but was:<null>
> at junit.framework.Assert.assertEquals(Assert.java:81)
> at java.lang.SystemTest.testGetenv(SystemTest.java:49)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-2453) [luni] Environment provides
inconsistent map on Windows
Posted by "Tony Wu (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-2453?page=comments#action_12455841 ]
Tony Wu commented on HARMONY-2453:
----------------------------------
very weird...
Where the 4 vars comes from? They are all start with "=", I tried to set these vars on my laptop but failed on "The syntax of the command is incorrect".
Can anyone explain the vars? especially the =::=::\
> [luni] Environment provides inconsistent map on Windows
> -------------------------------------------------------
>
> Key: HARMONY-2453
> URL: http://issues.apache.org/jira/browse/HARMONY-2453
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: WinXP, Win2003 Server
> Reporter: Alexey Varlamov
>
> The following test fails often on WIndows:
> public void testGetenv() {
> Map<String, String> env = System.getenv();
> for (String key : env.keySet()) {
> assertEquals("Value of " + key, env.get(key), System.getenv(key));
> }
> }
> junit.framework.ComparisonFailure: Value of expected:<G:=G:\avarlamo\harmony\2commit> but was:<null>
> at junit.framework.Assert.assertEquals(Assert.java:81)
> at java.lang.SystemTest.testGetenv(SystemTest.java:49)
--
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
[jira] Commented: (HARMONY-2453) [luni] Environment provides
inconsistent map on Windows
Posted by "Tony Wu (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-2453?page=comments#action_12455543 ]
Tony Wu commented on HARMONY-2453:
----------------------------------
would you please tell me the exact env key which fails on? Thanks a lot!
> [luni] Environment provides inconsistent map on Windows
> -------------------------------------------------------
>
> Key: HARMONY-2453
> URL: http://issues.apache.org/jira/browse/HARMONY-2453
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: WinXP, Win2003 Server
> Reporter: Alexey Varlamov
>
> The following test fails often on WIndows:
> public void testGetenv() {
> Map<String, String> env = System.getenv();
> for (String key : env.keySet()) {
> assertEquals("Value of " + key, env.get(key), System.getenv(key));
> }
> }
> junit.framework.ComparisonFailure: Value of expected:<G:=G:\avarlamo\harmony\2commit> but was:<null>
> at junit.framework.Assert.assertEquals(Assert.java:81)
> at java.lang.SystemTest.testGetenv(SystemTest.java:49)
--
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
[jira] Commented: (HARMONY-2453) [classlib][luni] Environment
provides inconsistent map on Windows
Posted by "Gregory Shimansky (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-2453?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12515664 ]
Gregory Shimansky commented on HARMONY-2453:
--------------------------------------------
I checked that SystemTest works in all modes on both windows architectures and so removed it from all exclude lists. This change was done in 559806.
> [classlib][luni] Environment provides inconsistent map on Windows
> -----------------------------------------------------------------
>
> Key: HARMONY-2453
> URL: https://issues.apache.org/jira/browse/HARMONY-2453
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: WinXP, Win2003 Server
> Reporter: Alexey Varlamov
> Assignee: Alexey Petrenko
> Priority: Minor
> Attachments: H-2453.patch, H-2453_remove_SystemTest_from_excluded.patch
>
>
> The following test fails often on WIndows:
> public void testGetenv() {
> Map<String, String> env = System.getenv();
> for (String key : env.keySet()) {
> assertEquals("Value of " + key, env.get(key), System.getenv(key));
> }
> }
> junit.framework.ComparisonFailure: Value of expected:<G:=G:\avarlamo\harmony\2commit> but was:<null>
> at junit.framework.Assert.assertEquals(Assert.java:81)
> at java.lang.SystemTest.testGetenv(SystemTest.java:49)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HARMONY-2453) [luni] Environment provides
inconsistent map on Windows
Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-2453?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexey Varlamov updated HARMONY-2453:
-------------------------------------
Priority: Minor (was: Major)
Patch Info: [Patch Available]
> [luni] Environment provides inconsistent map on Windows
> -------------------------------------------------------
>
> Key: HARMONY-2453
> URL: https://issues.apache.org/jira/browse/HARMONY-2453
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: WinXP, Win2003 Server
> Reporter: Alexey Varlamov
> Priority: Minor
> Attachments: H-2453.patch, H-2453_remove_SystemTest_from_excluded.patch
>
>
> The following test fails often on WIndows:
> public void testGetenv() {
> Map<String, String> env = System.getenv();
> for (String key : env.keySet()) {
> assertEquals("Value of " + key, env.get(key), System.getenv(key));
> }
> }
> junit.framework.ComparisonFailure: Value of expected:<G:=G:\avarlamo\harmony\2commit> but was:<null>
> at junit.framework.Assert.assertEquals(Assert.java:81)
> at java.lang.SystemTest.testGetenv(SystemTest.java:49)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-2453) [classlib][luni] Environment
provides inconsistent map on Windows
Posted by "Gregory Shimansky (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-2453?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12515302 ]
Gregory Shimansky commented on HARMONY-2453:
--------------------------------------------
I saw that SystemTest is still excluded for all windows x86_64 modes and for win32 it is excluded for srv and opt modes. Do you think that the test should be unexcluded?
> [classlib][luni] Environment provides inconsistent map on Windows
> -----------------------------------------------------------------
>
> Key: HARMONY-2453
> URL: https://issues.apache.org/jira/browse/HARMONY-2453
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: WinXP, Win2003 Server
> Reporter: Alexey Varlamov
> Assignee: Alexey Petrenko
> Priority: Minor
> Attachments: H-2453.patch, H-2453_remove_SystemTest_from_excluded.patch
>
>
> The following test fails often on WIndows:
> public void testGetenv() {
> Map<String, String> env = System.getenv();
> for (String key : env.keySet()) {
> assertEquals("Value of " + key, env.get(key), System.getenv(key));
> }
> }
> junit.framework.ComparisonFailure: Value of expected:<G:=G:\avarlamo\harmony\2commit> but was:<null>
> at junit.framework.Assert.assertEquals(Assert.java:81)
> at java.lang.SystemTest.testGetenv(SystemTest.java:49)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-2453) [luni] Environment provides
inconsistent map on Windows
Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-2453?page=comments#action_12455564 ]
Alexey Varlamov commented on HARMONY-2453:
------------------------------------------
Added printf() as:
while(*lpszVars){
fprintf(stderr, "Next var=%s\n", lpszVars);
len += strlen(lpszVars)+1;
lpszVars += strlen(lpszVars)+1;
}
It gave the following log, see 4 weird vars in the beginning:
[junit] Next var==::=::\
[junit] Next var==C:=C:\.usr\varlax\harmony\trunk\working_vm\build
[junit] Next var==ExitCode=00000000
[junit] Next var==G:=G:\avarlamo\harmony
[junit] Next var=ALLUSERSPROFILE=C:\Documents and Settings\All Users
[junit] Next var=ANT_CMD_LINE_ARGS=-f make/build.xml -Djava.debug.option on -DBUILD_CFG debug kernel.test -Dtest.case java.lang.SystemTest
[junit] Next var=ANT_COMMAND=C:\apache-ant-1.6.5\bin\ant.bat
[junit] Next var=ANT_HOME=C:\apache-ant-1.6.5
...
> [luni] Environment provides inconsistent map on Windows
> -------------------------------------------------------
>
> Key: HARMONY-2453
> URL: http://issues.apache.org/jira/browse/HARMONY-2453
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: WinXP, Win2003 Server
> Reporter: Alexey Varlamov
>
> The following test fails often on WIndows:
> public void testGetenv() {
> Map<String, String> env = System.getenv();
> for (String key : env.keySet()) {
> assertEquals("Value of " + key, env.get(key), System.getenv(key));
> }
> }
> junit.framework.ComparisonFailure: Value of expected:<G:=G:\avarlamo\harmony\2commit> but was:<null>
> at junit.framework.Assert.assertEquals(Assert.java:81)
> at java.lang.SystemTest.testGetenv(SystemTest.java:49)
--
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
[jira] Commented: (HARMONY-2453) [luni] Environment provides
inconsistent map on Windows
Posted by "Elena Semukhina (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-2453?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12484083 ]
Elena Semukhina commented on HARMONY-2453:
------------------------------------------
Alexey,
of course your solution is preferable because it takes performance into account.
Fell free to change the patch in this way!
Elena
> [luni] Environment provides inconsistent map on Windows
> -------------------------------------------------------
>
> Key: HARMONY-2453
> URL: https://issues.apache.org/jira/browse/HARMONY-2453
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: WinXP, Win2003 Server
> Reporter: Alexey Varlamov
> Assigned To: Alexey Petrenko
> Priority: Minor
> Attachments: H-2453.patch, H-2453_remove_SystemTest_from_excluded.patch
>
>
> The following test fails often on WIndows:
> public void testGetenv() {
> Map<String, String> env = System.getenv();
> for (String key : env.keySet()) {
> assertEquals("Value of " + key, env.get(key), System.getenv(key));
> }
> }
> junit.framework.ComparisonFailure: Value of expected:<G:=G:\avarlamo\harmony\2commit> but was:<null>
> at junit.framework.Assert.assertEquals(Assert.java:81)
> at java.lang.SystemTest.testGetenv(SystemTest.java:49)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (HARMONY-2453) [classlib][luni] Environment
provides inconsistent map on Windows
Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-2453?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexey Petrenko resolved HARMONY-2453.
--------------------------------------
Resolution: Fixed
Elena,
I thought again! :)
I think that we can simplify the patch to the follwoing expression:
=== cut ===
int separator = envStrings[i].indexOf("=", 1);
=== cut ===
The variable always has a name. So we can search the "=" character from the second place in the string.
Am I right?
Alexey, please verify that you are happy with the patch.
> [classlib][luni] Environment provides inconsistent map on Windows
> -----------------------------------------------------------------
>
> Key: HARMONY-2453
> URL: https://issues.apache.org/jira/browse/HARMONY-2453
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: WinXP, Win2003 Server
> Reporter: Alexey Varlamov
> Assigned To: Alexey Petrenko
> Priority: Minor
> Attachments: H-2453.patch, H-2453_remove_SystemTest_from_excluded.patch
>
>
> The following test fails often on WIndows:
> public void testGetenv() {
> Map<String, String> env = System.getenv();
> for (String key : env.keySet()) {
> assertEquals("Value of " + key, env.get(key), System.getenv(key));
> }
> }
> junit.framework.ComparisonFailure: Value of expected:<G:=G:\avarlamo\harmony\2commit> but was:<null>
> at junit.framework.Assert.assertEquals(Assert.java:81)
> at java.lang.SystemTest.testGetenv(SystemTest.java:49)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HARMONY-2453) [luni] Environment provides
inconsistent map on Windows
Posted by "Elena Semukhina (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-2453?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Elena Semukhina updated HARMONY-2453:
-------------------------------------
Attachment: H-2453.patch
H-2453_remove_SystemTest_from_excluded.patch
It seems that there are some "hidden" variables on Windows which names start with "=".
For example, =C: is evidently set to the current dir, =ExitCode is also obvious. I have no guess what =:: could be but asking all these variables with System.getenv(String) returns the correct results:
System.getenv("=C:") returns C:\users\esemukhi\test\thread
I attached a patch fixing this issue. SystemTest failed on my machine because of =C: and =ExitCode presence and it now passes. I checked this fix on linux as well.
I also attached the patch to remove the test from excluded lists.
> [luni] Environment provides inconsistent map on Windows
> -------------------------------------------------------
>
> Key: HARMONY-2453
> URL: https://issues.apache.org/jira/browse/HARMONY-2453
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: WinXP, Win2003 Server
> Reporter: Alexey Varlamov
> Attachments: H-2453.patch, H-2453_remove_SystemTest_from_excluded.patch
>
>
> The following test fails often on WIndows:
> public void testGetenv() {
> Map<String, String> env = System.getenv();
> for (String key : env.keySet()) {
> assertEquals("Value of " + key, env.get(key), System.getenv(key));
> }
> }
> junit.framework.ComparisonFailure: Value of expected:<G:=G:\avarlamo\harmony\2commit> but was:<null>
> at junit.framework.Assert.assertEquals(Assert.java:81)
> at java.lang.SystemTest.testGetenv(SystemTest.java:49)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.