Hi Martin,
No need for assertions IMO. With the original code, Eugene recreated by reverting Tobias commit, the (TCF) command will fail with a JsonSyntaxException.
Problem is that invalid TCF services which forgot to add the trailing \0 in their response break whole workflows. We have a defect against the invalid TCF service
response, but we did not received a new service version so far.
Nevermind. Not sure if it will be worth to try to handle this case more gracefully on higher level, at the end, it is the service that must be fixed.
Just my 2 cents,
Best regards, Uwe
J
From: tcf-dev-bounces@xxxxxxxxxxx [mailto:tcf-dev-bounces@xxxxxxxxxxx]
On Behalf Of Oberhuber, Martin
Sent: Freitag, 08. November 2013 08:10
To: TCF Development; Schwarz, Tobias
Subject: Re: [tcf-dev] Invalid/unacceptable changes in org.eclipse.tcf.core
I agree that “fail fast” is a good design approach, we shouldn’t allow incorrect data into the system.
Do we have assertions in place that fail in case of such incorrect data early ?
Thanks,
Martin
--
Martin Oberhuber, SMTS / Product Architect – Development Tools,
Wind River
direct +43.662.457915.85 fax +43.662.457915.6
Hi Tobias,
Compatibility is high priority goal. Code that does not terminate JSON with \0 is not compatible with existing TCF implementations. Your changes would allow such invalid
code to go undetected, eventually leading to compatibility problems down the road.
Regards,
Eugene
Hi eugene,
This change was more for safety reason if just the ending \0 is missing.
If the \0 at the end is missing, JSON throws an IOException.
If the format is still invalid, even after adding the \0, JSON will throw an exception.
Feel free to revert the commit if it breaks any spec, otherwise I think it would not lead to wrong data because if there was an error
in data transfer, normally more than the \0 is missing and so JSON generates an error. But it would add a little bit of safety if a service does not send the leading \0.
Regards
tobias
I’m going to revert a recent commit in TCF Core that violates TCF protocol specs. Please, let me know if there is a good reason to keep the changes. The commit is:
Revision: f83749b307e0feedb9f1db263a96469de47ef654
Author: Tobias Schwarz <tobias.schwarz@xxxxxxxxxxxxx>
Date: 06.11.2013 01:01:31
Message:
Target Explorer: add \0 char at the end of result data if missing
----
Modified: plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/core/Command.java
Regards,
Eugene
This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy,
or forward this email message or any attachments. Delete this email message and any attachments immediately.
This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy,
or forward this email message or any attachments. Delete this email message and any attachments immediately.
|