This week's book giveaway is in the Features new in Java 9 forum.
We're giving away four copies of Java 9 Revealed and have Kishori Sharan on-line!
See this thread for details.
Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

UB: Instantiation of Data class, automatic tests  RSS feed

 
Kalle Tjarnlund
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I'm just wrapping up my project and started to think (seemed like a good time to start thinking ;-).
In my solution there should only be one Data class which all threads should access and it is instantiated with the path to the db-file. If there are multiple instances of the data class which have the same path to the database there is a risk that data may be coruppted.
I have stated this in the documentation but do you think that the code should be changed to take care of this situation. I cant really decide how to do, it doesnt require too much code to fix this but still the code becomes more complex. Also, it feels a bit strange to write code that is not needed in my solution.

What worries me is that in my database code I am in control of how the data class is instantiated but when Sun runs the automatic tests they may have a different approach to how things are instantiated.

Best Regards,
Kalle
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!