Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a reset() method in Message #182

Merged
merged 2 commits into from
Mar 29, 2018
Merged

Conversation

chrjohn
Copy link
Member

@chrjohn chrjohn commented Mar 29, 2018

Contains commits from #40
Just created a new PR to have a Travis build and be able to push changes to the PR.

The clear() method is public but its purpose is not explained.
It does not allow to reuse a message because it removes the header & trailers of a message.
This reset() method can be used to reuse a message.
The clear() method is public but its purpose is not explained.
It does not allows to reuse a message because it removes the header & trailers content of a message.
This reset() method can be used to reuse a message.
@chrjohn chrjohn added this to the QFJ 2.1.0 milestone Mar 29, 2018
@chrjohn chrjohn merged commit a487f41 into quickfix-j:master Mar 29, 2018
@MartyIX
Copy link
Contributor

MartyIX commented Mar 30, 2018

@chrjohn A bit off topic question: Why is there no way to get field value without catching an exception?

try {   
	if (msg.isSetField(Text.FIELD)) {
		String text = msg.getString(Text.FIELD);

		// ...
	}
} catch (FieldNotFound e) {
	logger.error("FieldNotFound:", e);
}

Either:

Optional<String> text = msg.getStringOpt(Text.FIELD);

or:

@Nullable Optional<String> text = msg.getStringOrNull(Text.FIELD);

would be much easier to use.

Thank you and sorry for offtopic question.

@chrjohn
Copy link
Member Author

chrjohn commented Mar 30, 2018

Hi @MartyIX ,
what about #162 ? ;)
Would that suit your needs? If you'd like something to be added just open another PR.

Thanks and Happy Easter!
Cheers,
Chris.

@MartyIX
Copy link
Contributor

MartyIX commented Mar 30, 2018

Hi Chris,

That's great! I haven't noticed it had been added. Great!

Happy Easter to you too!

Regards,
Martin

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

Successfully merging this pull request may close these issues.

3 participants