[TRUNK-3974] i am not sure

0 views
Skip to first unread message

Arek Pień

unread,
Apr 25, 2013, 7:43:39 AM4/25/13
to d...@openmrs.org
Hi, I want to resolve TRUNK-3974 [0] ticket and i need to be sure in my thinking way. I have to fix copy constructor of ConceptNumeric class to be able make deep copy. In comments is attached link to "proper implementation" [1] and i looked up on it and i start wondering if i have to make deep copy only related collections(like it take place in ConceptNumericBuilder [1]) or collections and objects in collections too?? Sorry for that stupid question but i wanna be sure.


cheers



Rafal Korytkowski

unread,
Apr 25, 2013, 8:04:15 AM4/25/13
to Developers List
Arek, I should have called it a converter constructor and not a copy
constructor.

The general rule is that types implementing OpenmrsMetadata (e.g.
ConceptClass, ConceptDatatype) are reusable and you must not create
deep copies of them. If you consider ConceptName, ConceptAnswer,
ConceptSet, ConceptDescription, ConceptMap they only belong to one
specific concept so you just need to change the parent object for
them.

ConceptNumericBuilder does not make deep copies of contained objects.
It only copies collections, because they may be backed by Hibernate.
If you just reference such collections from a different object, it
will break them.

-Rafał
> --
> OpenMRS Developers: http://go.openmrs.org/dev
> Post: d...@openmrs.org
> Unsubscribe: dev+uns...@openmrs.org
> Manage your OpenMRS subscriptions at https://id.openmrs.org/
>
>

Arek Pień

unread,
Apr 25, 2013, 9:45:54 AM4/25/13
to d...@openmrs.org
Thanks for reply. After your explanation it's pretty clear.

Robert

unread,
Apr 25, 2013, 10:33:07 AM4/25/13
to d...@openmrs.org
Hello,

I believe I have refactored all of the code to <openmrs:message />
instead of hard code. I have a few questions 1st being is what is the
easiest way to get to the crash report so I can test. 2 looking at the
messages.properties there doesn't seem to be a coherent naming
convention, is there a preferred format?

Thanks have a good day,

Robert

Lluis Martinez

unread,
Apr 25, 2013, 11:42:21 AM4/25/13
to d...@openmrs.org
Put a debug stop on any class (controller, service, dao), debug and
set any variable that cannot be null to null => NullPointerException

Robert

unread,
Apr 25, 2013, 3:40:18 PM4/25/13
to d...@openmrs.org
Changing the dao just causes an internal server error page to load not
the the crash report page.

Lluis Martinez

unread,
Apr 25, 2013, 5:30:35 PM4/25/13
to d...@openmrs.org
Is there any difference between them? Perhaps the improvement means
just this, to show as much info about the crash as possible. Not only
the java stack, but also JVM/Database/OS version, request parameters,
available memory etc.

Robert

unread,
Apr 26, 2013, 3:55:10 PM4/26/13
to d...@openmrs.org
How I take it is that all the information is there and displayed
correctly but hard coded into the page. (Which it is) I have fixed that
by using the <openmrs:message> tag. Now all I need to do is test to make
sure the page is correct but I can't seem to figure out how to get to
the uncaught exception page.

Darius Jazayeri

unread,
Apr 26, 2013, 4:04:40 PM4/26/13
to dev
Robert,

You should be able to create a new controller or edit an existing one, and have it just throw new RuntimeException("testing").

-Darius
Reply all
Reply to author
Forward
0 new messages