[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cp-patches] [generics] Fix getenv() to work correctly.
From: |
Andrew John Hughes |
Subject: |
[cp-patches] [generics] Fix getenv() to work correctly. |
Date: |
Mon, 4 Apr 2005 01:23:52 +0100 |
User-agent: |
Mutt/1.5.6+20040907i |
Finally getting to test the getenv() method showed that it was
methodically buggy. I'm committing the attached patch to fix this.
This makes the returned map a special sub-type of HashMap, wrapped
by Collections.unmodifiableMap. This is required, so that queries
with null or non-String values result in an exception being thrown
(as specified in the documentation of this method). The former method
manually created the unmodifiable map, and then fell into trouble
trying to initialise it...
Changelog:
2005-04-02 Andrew John Hughes <address@hidden>
* java/lang/System.java:
(getenv()): Use Collections.unmodifiableMap to wrap an
EnvironmentMap.
(EnvironmentCollection): Reduced to just String check changes.
(EnvironmentSet): Likewise.
(EnvironmentMap): Likewise.
(EnvironmentIterator): Removed.
--
Andrew :-)
Please avoid sending me Microsoft Office (e.g. Word, PowerPoint) attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html
No software patents in Europe -- http://nosoftwarepatents.com
"Value your freedom, or you will lose it, teaches history.
`Don't bother us with politics' respond those who don't want to learn."
-- Richard Stallman
Escape the Java Trap with GNU Classpath!
http://www.gnu.org/philosophy/java-trap.html
public class gcj extends Freedom implements Java { ... }
getenv.diff
Description: Text document
signature.asc
Description: Digital signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [cp-patches] [generics] Fix getenv() to work correctly.,
Andrew John Hughes <=