| Summary: | org.eclipse.tm.tcf.core.Command.toError reports only part of the command | ||
|---|---|---|---|
| Product: | [Tools] TCF | Reporter: | Michael Scharf <eclipse> |
| Component: | Core | Assignee: | Project Inbox <tcf.core-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | Eugene Tarassov <eugene> |
| Severity: | normal | ||
| Priority: | P3 | CC: | cdtdoug, daniel.thomas |
| Version: | 1.0 | ||
| Target Milestone: | 0.4.0 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
TCF command can arbitrary long, for example, FileSystem.write command can easily have megabytes of data in it. If such long message will end up in, for example, Eclipse error log, it will certainly cause problems. So removing the limit is not really an option. One way to resolve this would be to extend IErrorReport interface to allow clients to get the original command if they need it. Sure a multi-megabyte of data is big, but 120 bytes as cut-off is a bit short. If the limit is changed to let's say 100kb then most text commands should be covered. For example, a StackOverflowError can easily add a few 100kb to the eclispe log. So, I think we should not be too much concerned about the size of the log. Adding the command to the IErrorReport would be an option, but I guess the command would not show up in the log unless the receiver of the error would get it form the IErrorReport interface.... Therefore my preference would be to increase the limit. Another option would be a java System property to specify the limit. Then one could increase the limit if needed. I have changed the code to apply the limit to individual command arguments instead of the whole command - I believe this will provide much better balance between usefulness and size of error reports. Also the code now checks system property org.eclipse.tcf.core.errmsg_size_limit, so one can increase the limit if needed. Changing status to FIXED. thank you! this seems a better solution :-) *** Bug 357046 has been marked as a duplicate of this bug. *** |
org.eclipse.tm.tcf.core.Command.toError arbitary chops off the command after 120 characters before reporting the error: String cmd = getCommandString(); if (cmd.length() > 120) cmd = cmd.substring(0, 120) + "..."; This means, when some error occurs it is very hard to get to the command that caused the problem, because only part of the command is reported. What is the reason to arbitrarily cut the command? Proposal: remove the line if (cmd.length() > 120) cmd = cmd.substring(0, 120) + "...";