Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # This patch file was generated by NetBeans IDE
- # This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
- # It uses platform neutral UTF-8 encoding.
- # Above lines and this line are ignored by the patching process.
- 41a42,45
- > import org.objenesis.Objenesis;
- > import org.objenesis.ObjenesisException;
- > import org.objenesis.ObjenesisStd;
- > import org.objenesis.instantiator.ObjectInstantiator;
- 49a54,55
- > private static Map<Class, ObjectInstantiator> instantiators = new HashMap<Class, ObjectInstantiator>();
- > private static Objenesis objenesis = new ObjenesisStd();
- 52a59,64
- > try {
- > ObjectInstantiator instantiator = objenesis.getInstantiatorOf(clazz);
- > clazz.cast(instantiator.newInstance());
- > instantiators.put(clazz, instantiator);
- > } catch (ObjenesisException e) {
- > //Logger.getLogger(this.getClass()).log(Level.OFF, "Registration error: Objenesis failed. Falling back to no-argument constructor.", e);
- 56,57c68,69
- < } catch( NoSuchMethodException e ) {
- < throw new RuntimeException( "Registration error: no-argument constructor not found on:" + clazz );
- ---
- > } catch (NoSuchMethodException ex) {
- > throw new RuntimeException("Registration error: no-argument constructor not found on:" + clazz);
- 59a72
- > }
- 123a137,139
- > object = c.cast(instantiators.get(c));
- > }catch(NullPointerException ex){
- > try {
- 126c142
- < throw new SerializerException( "Error creating object of type:" + c, e );
- ---
- > throw new SerializerException("Error creating object of type:" + c, e);
- 127a144
- > }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement