xor at freenetproject.org a ?crit :
> Author: xor
> Date: 2008-09-23 11:10:49 +0000 (Tue, 23 Sep 2008)
> New Revision: 22761
> 
> Modified:
>    trunk/plugins/WoT/Config.java
>    trunk/plugins/WoT/WoT.java
> Log:
> Change the Config class so that it does not store a reference to a db4o 
> ObjectContainer. This is not its job.
> 
> Modified: trunk/plugins/WoT/Config.java
> ===================================================================
> --- trunk/plugins/WoT/Config.java     2008-09-23 11:10:42 UTC (rev 22760)
> +++ trunk/plugins/WoT/Config.java     2008-09-23 11:10:49 UTC (rev 22761)
> @@ -19,19 +19,14 @@
>   */
>  public class Config {
>  
> -     private ObjectContainer db;
>       private HashMap<String, String> params = null;
>       
>       /**
>        * 
>        * @param db The database where the configuration is stored.
>        */
> -     public Config(ObjectContainer db) {
> +     public Config() {
>               
> -             // TODO Refactor this : the database shouldn't try to store its 
> own reference
> -             // The ObjectContainer should be passed to set/get/... methodes
> -             
> -             this.db = db;
>               if(params == null) {
>                       params = new HashMap<String, String>();
>                       initDefault(false);
> @@ -46,7 +41,6 @@
>        */
>       public synchronized void set(String key, String value) {
>               params.put(key, value);
> -             db.store(params);
>       }

Did you test this ? Last time I tried this, db4o wasn't storing inner
complex objects and I had to manually store them.

See contexts and properties in Identity.java.
If this really isn't necessary, you can remove it from there too.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20080924/0261b7a2/attachment.pgp>

Reply via email to