Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trnk 4140 : Substitute deprecated method call in HibernateContextDAO #788

Closed
wants to merge 3 commits into from

Conversation

sashrika
Copy link
Contributor

removed "ConfigHelper.getResourceAsStream" deprecatede method.

added junit test "should_mergeDefaultRuntimeProperties()" in ContextDAOTest.java class.
But when testing it throws java.util.ConcurrentModificationException.
as i read in http://docs.oracle.com/javase/6/docs/api/java/util/ConcurrentModificationException.html and http://stackoverflow.com/questions/1931180/how-do-i-synchronize-to-prevent-a-java-util-concurrentmodificationexception , the reason is , we change a element in a java Collection while we iterate through it .

One possible solution would be using ConcurrentHashMap. But here we use java.util.Property.

The other possible solution would be instead of changing the values while iterating through a collection, cache the changes and then copy them to the Collection.

I have used the latter approach here.

@dkayiwa
Copy link
Member

dkayiwa commented Mar 19, 2014

@sashrika can you squash these commits into one? You can look for instructions at: https://wiki.openmrs.org/display/docs/Using+Git

@dkayiwa
Copy link
Member

dkayiwa commented Mar 25, 2014

@sashrika i can reopen this when you are done with the above.

@dkayiwa dkayiwa closed this Mar 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants