dana-i2cat/opennaas — pull request #10 by gbehrmann (2012-01-19 16:40:16+00:00)
Title: Feature/typesafe properties

Hi,

While debugging some other problems, I stumbled over the following filter in the log:

01-19@16:23:00 [Blueprint Extender: 3]DEBUG org.opennaas.core.persistence.GenericOSGiJpaRepository - Looking up Service from registry with properties: (&(objectClass=javax.persistence.EntityManagerFactory)(isDynamicFactory=null)(persistenceUnit=ResourceCore))

Notice (isDynamicFactory=null) when is should have been (isDynamicFactory=true). The problem is that the code puts a non-string value into a Properties instance.

I fixed this problem and also updated the code to use the type-safe setProperty(), getProperty() and stringPropertynames().

No unit tests, but I recompiled everything and Mantychore was able to create, persist and load a resource.

I have a similar patch for Mantychore itself. Once the OpenNaaS changes have been merged I will send the rest as a patch per email.