-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Large request problem #6359
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
base: master
Are you sure you want to change the base?
Large request problem #6359
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,6 +34,7 @@ | |
| import org.apache.jorphan.gui.JFactory; | ||
| import org.apache.jorphan.gui.JMeterUIDefaults; | ||
| import org.apache.jorphan.gui.ui.TextComponentUI; | ||
| import org.apache.jorphan.util.StringWrap; | ||
| import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; | ||
| import org.fife.ui.rsyntaxtextarea.SyntaxConstants; | ||
| import org.fife.ui.rsyntaxtextarea.Theme; | ||
|
|
@@ -294,6 +295,30 @@ protected RUndoManager createUndoManager() { | |
| return undoManager; | ||
| } | ||
|
|
||
| // Default limited to 110K | ||
| private static final int MAX_LINE_SIZE = | ||
| JMeterUtils.getPropDefault("view.results.tree.max_line_size", 110_000); // $NON-NLS-1$ | ||
|
|
||
| // Limit the soft wrap to 100K (hard limit divided by 1.1) | ||
| private static final int SOFT_WRAP_LINE_SIZE = | ||
| JMeterUtils.getPropDefault("view.results.tree.soft_wrap_line_size", (int) (MAX_LINE_SIZE / 1.1f)); // $NON-NLS-1$ | ||
|
|
||
| private static String wrapLongLines(String input) { | ||
| if (input == null || input.isEmpty()) { | ||
| return input; | ||
| } | ||
| if (SOFT_WRAP_LINE_SIZE > 0 && MAX_LINE_SIZE > 0) { | ||
| StringWrap stringWrap = new StringWrap(SOFT_WRAP_LINE_SIZE, MAX_LINE_SIZE); | ||
| return stringWrap.wrap(input, "\n"); | ||
| } | ||
| return input; | ||
| } | ||
|
|
||
| @Override | ||
| public void setText(String t) { | ||
| super.setText(wrapLongLines(t)); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WDYT of |
||
| } | ||
|
|
||
| /** | ||
| * Sets initial text resetting undo history | ||
| * | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -126,7 +126,7 @@ public String wrap(String input, String delimiter) { | |
| } | ||
| // Try adding the next line if it does not exceed maxWrap | ||
| int next = nextLineSeparator; | ||
| if (next != -1 && pos - next <= maxWrap) { | ||
| if (next != -1 && next - pos <= maxWrap) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we have a test to cover the change? |
||
| // The existing lines do not exceed maxWrap, just reuse them | ||
| next++; // include newline | ||
| sb.append(input, pos, next); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why duplicating the properties? I guess those properties are not needed here