Closed WolfgangFahl closed 6 years ago
Please find below the fix by increasing the buffer size and which is more important making it configurable ...
public class JMDiff
{
+ public static int BUFFER_SIZE=100000;
// Class variables:
// Allocate a charBuffer once for performance. The charbuffer is used to
// store a 'line' without it's ignored characters.
- static final private CharBuffer inputLine = CharBuffer.allocate(10000);
- static final private CharBuffer outputLine = CharBuffer.allocate(10000);
+ static final private CharBuffer inputLine = CharBuffer.allocate(BUFFER_SIZE);
+ static final private CharBuffer outputLine = CharBuffer.allocate(BUFFER_SIZE)
Would you please release a new version to maven to make this fix available ...
Thanks for working on these. This bug is really a stopper to use jmeld.
Can you provide a PR so I can merge?
Hi albfan - i am having trouble getting my old fork in sync - when I tried to push it tried to do it against the master where I do not have access. Since it's ownly three lines of code I'd appreciate if you use the diff above.
Sure, no problem
Fixed on 44cd1ca
java.nio.BufferOverflowException at java.nio.CharBuffer.put(CharBuffer.java:922) at java.nio.CharBuffer.put(CharBuffer.java:950) at org.jmeld.diff.JMDiff.filter(JMDiff.java:249) at org.jmeld.diff.JMDiff.diff(JMDiff.java:110) at org.jmeld.util.node.JMDiffNode.diff(JMDiffNode.java:294) at org.jmeld.ui.FileComparison.doInBackground(FileComparison.java:94) at org.jmeld.ui.FileComparison.doInBackground(FileComparison.java:17)