+14
-0
lines changedFilter options
+14
-0
lines changed Original file line number Diff line number Diff line change
@@ -727,6 +727,12 @@ private class PropertyMapAssetLoader : AssetLoader<PropertyMap>(
727
727
PropertyMap::class.java,
728
728
ASSETS_DIR
729
729
) {
730
+
override fun cast(obj: Any): PropertyMap {
731
+
val map = obj as PropertyMap
732
+
733
+
return map.copy()
734
+
}
735
+
730
736
override fun load(url: URL): PropertyMap {
731
737
val lines = url.openStream().bufferedReader().readLines()
732
738
Original file line number Diff line number Diff line change
@@ -261,6 +261,14 @@ class AssetLoaderServiceTest {
261
261
assertThat(map, `is`(notNullValue()))
262
262
assertThat(map.getString("testKey"), `is`("testValue"))
263
263
264
+
val map2 = assetLoader.loadPropertyMap("properties/test.properties")
265
+
val map3 = assetLoader.loadPropertyMap("properties/test.properties")
266
+
267
+
// must not be same object
268
+
assertFalse(map === map2)
269
+
assertFalse(map === map3)
270
+
assertFalse(map2 === map3)
271
+
264
272
map = assetLoader.loadPropertyMap("bla-bla")
265
273
assertThat(map, `is`(notNullValue()))
266
274
assertThat(map.keys().size, `is`(0))
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4