Mantis - Resin
|
|||||
Viewing Issue Advanced Details | |||||
|
|||||
ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
134 | minor | always | 05-04-05 00:00 | 02-03-06 09:54 | |
|
|||||
Reporter: | user154 | Platform: | |||
Assigned To: | ferg | OS: | |||
Priority: | normal | OS Version: | |||
Status: | closed | Product Version: | |||
Product Build: | 3.0.12 | Resolution: | fixed | ||
Projection: | none | ||||
ETA: | none | Fixed in Version: | 3.0.18 | ||
|
|||||
Summary: | 0000134: Hessian Deserializer and constructors | ||||
Description: |
RSN-125 Hi, it seems that the deserializer of hessian chooses the constructor undeterminsticily. We have a class with a private default constructor (it's not allowed to call it despite hessian) and a constructor with a pointer argument. On some systems hessian chooses the correct default constructor and on others the wrong constructor with argument. On the faulty systems it helped, if we change the visibility to public, why ever. I don't understand the code in "com.caucho.hessian.io.JavaDeserializer.java". There I can find: Constructor []constructors = cl.getDeclaredConstructors(); int bestLength = Integer.MAX_VALUE; [...] for (int i = 0; i < constructors.length; i++) { if (constructors[i].getParameterTypes().length < bestLength) { _constructor = constructors[i]; bestLength = _constructor.getParameterTypes().length; } } [...] This is not deterministic (a new constructor with fewer args will always be choosen), and the constructor arguments are only guessed afterwards (with null). Why doesn't hessian use "__type.newInstance()" all the time? Ciao, Marc Ewert |
||||
Steps To Reproduce: | |||||
Additional Information: | JDK 1.4.2 | ||||
Relationships | |||||
Attached Files: |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|