Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 483334
Collapse All | Expand All

(-)a/org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyCommand.java (-4 / +4 lines)
Lines 196-205 private void apply(File f, FileHeader fh) Link Here
196
			oldLines.add(rt.getString(i));
196
			oldLines.add(rt.getString(i));
197
		List<String> newLines = new ArrayList<String>(oldLines);
197
		List<String> newLines = new ArrayList<String>(oldLines);
198
		for (HunkHeader hh : fh.getHunks()) {
198
		for (HunkHeader hh : fh.getHunks()) {
199
			StringBuilder hunk = new StringBuilder();
199
			byte[] b = new byte[hh.getEndOffset() - hh.getStartOffset()];
200
			for (int j = hh.getStartOffset(); j < hh.getEndOffset(); j++)
200
			System.arraycopy(hh.getBuffer(), hh.getStartOffset(), b, 0,
201
				hunk.append((char) hh.getBuffer()[j]);
201
					b.length);
202
			RawText hrt = new RawText(hunk.toString().getBytes());
202
			RawText hrt = new RawText(b);
203
			List<String> hunkLines = new ArrayList<String>(hrt.size());
203
			List<String> hunkLines = new ArrayList<String>(hrt.size());
204
			for (int i = 0; i < hrt.size(); i++)
204
			for (int i = 0; i < hrt.size(); i++)
205
				hunkLines.add(hrt.getString(i));
205
				hunkLines.add(hrt.getString(i));

Return to bug 483334