code: replace `is cached` by `is lazy`
[nit.git] / lib / android / shared_preferences / shared_preferences_api10.nit
index 404aaea..6b6edde 100644 (file)
@@ -205,15 +205,14 @@ class SharedPreferences
        #
        # User has to manage local stack deallocation himself
        #
-       # Example :
-       # ~~~
+       # ~~~nitish
        # var foo = new HashMap[JavaString, JavaObject]
        # # ...
        # for key, value in foo do
        #      key.delete_local_ref
        #      value.delete_local_ref
        # end
-       # ~~~
+       # ~~~
        # *You should use Nit getters instead and get each value one by one* 
        fun all: nullable HashMap[JavaString, JavaObject]
        do 
@@ -380,7 +379,7 @@ class SharedPreferences
        # Store `value` as a serialized Json string
        fun []=(key: String, value: nullable Serializable)
        do
-               var serialized_string = new StringOStream
+               var serialized_string = new StringWriter
                var serializer = new JsonSerializer(serialized_string)
                serializer.serialize(value)
 
@@ -405,7 +404,7 @@ class SharedPreferences
 end
 
 redef class App
-       fun shared_preferences: SharedPreferences is cached do 
+       var shared_preferences: SharedPreferences is lazy do
                return new SharedPreferences.privately(self, "")
        end
 end