Skip to content
This repository has been archived by the owner on Jul 4, 2020. It is now read-only.

Make User and Group Serializable #145

Merged
merged 1 commit into from
Aug 24, 2015
Merged

Make User and Group Serializable #145

merged 1 commit into from
Aug 24, 2015

Conversation

fwilhe
Copy link
Contributor

@fwilhe fwilhe commented Aug 13, 2015

Fixes #129

The classes implement the interface Serializable and have a
serialVersionUID field.

A test for each of the classes tests that no exception is thrown when
serializing and deserializing the object, and that the deserialized is
equal to the original.

@tkrille
Copy link
Member

tkrille commented Aug 13, 2015

You have to make all components @Serializable, not just User and Group.

@tkrille
Copy link
Member

tkrille commented Aug 13, 2015

LGTM, but we have to wait until the discussion in #129 is finished.

@tkrille tkrille self-assigned this Aug 13, 2015
@tkrille tkrille added this to the v1.5 milestone Aug 13, 2015
@wallner
Copy link
Member

wallner commented Aug 17, 2015

Looks good to me, although I would like to see tests that try to serialize and deserialize at least a little more complicated object graph. I would suggest one where you (de-)serialize a user with an email address and a multivalued attribute?

@fwilhe
Copy link
Contributor Author

fwilhe commented Aug 18, 2015

@wallner Thanks for your comment. I updated my PR.

User user = new User.Builder("UserName")
.addEmail(new Email.Builder().setValue('[email protected]').setType(Email.Type.WORK).build())
.addPhoneNumber(new PhoneNumber.Builder().setDisplay("phone").setType(PhoneNumber.Type.FAX).build())
.setActive(true).build()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add an extension too, please?

@fwilhe
Copy link
Contributor Author

fwilhe commented Aug 21, 2015

In case anyone has the time to review this, please do so :)

@tkrille @wallner @dacrome


private void readObject(ObjectInputStream objectInputStream) throws ClassNotFoundException, IOException {
objectInputStream.defaultReadObject();

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this empty line

@dacrome
Copy link
Member

dacrome commented Aug 21, 2015

Thanks!

@wallner
Copy link
Member

wallner commented Aug 21, 2015

Please add a CHANGELOG.md entry for this.

@fwilhe
Copy link
Contributor Author

fwilhe commented Aug 22, 2015

Please add a CHANGELOG.md entry for this.

Done. I assume this is a change. If anyone disagrees, please tell me.

@wallner
Copy link
Member

wallner commented Aug 22, 2015

Looks good from my side.

@@ -199,6 +206,8 @@ public MemberRef build() {
* Represents an Member reference type.
*/
public static class Type extends MultiValuedAttributeType {
private static final long serialVersionUID = 5163337803191562964L;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be removed, because this sub-class does not define any additional fields.

Fixes #129

The classes `User` and `Group` implement the interface `Serializable` and have a
`serialVersionUID` field. This is also true for the classes that are
used for fields of `User` and `Group`.

A test for each of the classes tests that no exception is thrown when
serializing and deserializing the object, and that the deserialized is
equal to the original.
tkrille added a commit that referenced this pull request Aug 24, 2015
@tkrille tkrille merged commit a343c7a into osiam:master Aug 24, 2015
@tkrille
Copy link
Member

tkrille commented Aug 24, 2015

Thank you

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants