Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2787a2d

Browse files
authored
Merge pull request#30 from skitt/cleanups
Cleanups
2 parents5dd05c4 +e8c015a commit2787a2d

File tree

15 files changed

+28
-42
lines changed

15 files changed

+28
-42
lines changed

‎src/main/java/com/github/difflib/DiffUtils.java‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
importjava.util.List;
2929
importjava.util.Objects;
3030
importjava.util.function.BiPredicate;
31-
importstaticjava.util.stream.Collectors.joining;
3231

3332
/**
3433
* Implements the difference and patching engine
@@ -143,7 +142,7 @@ private static List<String> compressLines(List<String> lines, String delimiter)
143142
if (lines.isEmpty()) {
144143
returnCollections.emptyList();
145144
}
146-
returnCollections.singletonList(lines.stream().collect(joining(delimiter)));
145+
returnCollections.singletonList(String.join(delimiter,lines));
147146
}
148147

149148
/**

‎src/main/java/com/github/difflib/algorithm/DifferentiationFailedException.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
/**
1919
* Thrown whenever the differencing engine cannot produce the differences between two revisions of ta text.
2020
*
21-
* @see MyersDiff
22-
* @seedifflib.DiffAlgorithm
21+
* @seecom.github.difflib.algorithm.myers.MyersDiff
22+
* @seeDiffAlgorithmI
2323
*/
2424
publicclassDifferentiationFailedExceptionextendsDiffException {
2525

‎src/main/java/com/github/difflib/algorithm/jgit/HistogramDiff.java‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
importcom.github.difflib.algorithm.Change;
1919
importcom.github.difflib.algorithm.DiffAlgorithmI;
2020
importcom.github.difflib.algorithm.DiffAlgorithmListener;
21-
importcom.github.difflib.algorithm.DiffException;
2221
importcom.github.difflib.patch.DeltaType;
2322
importjava.util.ArrayList;
2423
importjava.util.List;
@@ -37,7 +36,7 @@
3736
publicclassHistogramDiff<T>implementsDiffAlgorithmI<T> {
3837

3938
@Override
40-
publicList<Change>computeDiff(List<T>source,List<T>target,DiffAlgorithmListenerprogress)throwsDiffException{
39+
publicList<Change>computeDiff(List<T>source,List<T>target,DiffAlgorithmListenerprogress) {
4140
Objects.requireNonNull(source,"source list must not be null");
4241
Objects.requireNonNull(target,"target list must not be null");
4342
if (progress !=null) {

‎src/main/java/com/github/difflib/algorithm/myers/MyersDiff.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ private PathNode buildPath(final List<T> orig, final List<T> rev, DiffAlgorithmL
138138
/**
139139
* Constructs a {@link Patch} from a difference path.
140140
*
141-
* @parampath The path.
141+
* @paramactualPath The path.
142142
* @param orig The original sequence.
143143
* @param rev The revised sequence.
144144
* @return A {@link Patch} script corresponding to the path.

‎src/main/java/com/github/difflib/algorithm/myers/PathNode.java‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@
1919
* A node in a diffpath.
2020
*
2121
* @author <a href="mailto:juanco@suigeneris.org">Juanco Anez</a>
22-
*
23-
* @see DiffNode
24-
* @see Snake
25-
*
2622
*/
2723
publicfinalclassPathNode {
2824

@@ -78,10 +74,10 @@ public boolean isBootstrap() {
7874
}
7975

8076
/**
81-
* Skips sequences of {@linkDiffNode DiffNodes} until a{@link Snake} or bootstrap node is found, or the end of the
77+
* Skips sequences of {@linkPathNode PathNodes} until asnake or bootstrap node is found, or the end of the
8278
* path is reached.
8379
*
84-
* @return The next first {@linkSnake} or bootstrap node in the path, or <code>null</code> if none found.
80+
* @return The next first {@linkPathNode} or bootstrap node in the path, or <code>null</code> if none found.
8581
*/
8682
publicfinalPathNodepreviousSnake() {
8783
if (isBootstrap()) {
@@ -102,9 +98,9 @@ public String toString() {
10298
PathNodenode =this;
10399
while (node !=null) {
104100
buf.append("(");
105-
buf.append(Integer.toString(node.i));
101+
buf.append(node.i);
106102
buf.append(",");
107-
buf.append(Integer.toString(node.j));
103+
buf.append(node.j);
108104
buf.append(")");
109105
node =node.prev;
110106
}

‎src/main/java/com/github/difflib/patch/ChangeDelta.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* Describes the change-delta between original and revised texts.
2323
*
2424
* @author <a href="dm.naumenko@gmail.com">Dmitry Naumenko</a>
25-
* @paramT The type of the compared elements in the data 'lines'.
25+
* @param<T> The type of the compared elements in the data 'lines'.
2626
*/
2727
publicfinalclassChangeDelta<T>extendsAbstractDelta<T> {
2828

‎src/main/java/com/github/difflib/patch/Chunk.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* </p>
3030
*
3131
* @author <a href="dm.naumenko@gmail.com>Dmitry Naumenko</a>
32-
* @paramT The type of the compared elements in the 'lines'.
32+
* @param<T> The type of the compared elements in the 'lines'.
3333
*/
3434
publicfinalclassChunk<T> {
3535

‎src/main/java/com/github/difflib/patch/DeleteDelta.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* Describes the delete-delta between original and revised texts.
2222
*
2323
* @author <a href="dm.naumenko@gmail.com">Dmitry Naumenko</a>
24-
* @paramT The type of the compared elements in the 'lines'.
24+
* @param<T> The type of the compared elements in the 'lines'.
2525
*/
2626
publicfinalclassDeleteDelta<T>extendsAbstractDelta<T> {
2727

‎src/main/java/com/github/difflib/patch/InsertDelta.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* Describes the add-delta between original and revised texts.
2222
*
2323
* @author <a href="dm.naumenko@gmail.com">Dmitry Naumenko</a>
24-
* @paramT The type of the compared elements in the 'lines'.
24+
* @param<T> The type of the compared elements in the 'lines'.
2525
*/
2626
publicfinalclassInsertDelta<T>extendsAbstractDelta<T> {
2727

‎src/main/java/com/github/difflib/patch/Patch.java‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,17 @@
1919
*/
2020
packagecom.github.difflib.patch;
2121

22+
importstaticjava.util.Comparator.comparing;
2223
importcom.github.difflib.algorithm.Change;
23-
importstaticcom.github.difflib.patch.DeltaType.DELETE;
24-
importstaticcom.github.difflib.patch.DeltaType.INSERT;
2524
importjava.util.ArrayList;
26-
importjava.util.Collections;
27-
importstaticjava.util.Comparator.comparing;
2825
importjava.util.List;
2926
importjava.util.ListIterator;
3027

3128
/**
3229
* Describes the patch holding all deltas between the original and revised texts.
3330
*
3431
* @author <a href="dm.naumenko@gmail.com">Dmitry Naumenko</a>
35-
* @paramT The type of the compared elements in the 'lines'.
32+
* @param<T> The type of the compared elements in the 'lines'.
3633
*/
3734
publicfinalclassPatch<T> {
3835

@@ -93,7 +90,7 @@ public void addDelta(AbstractDelta<T> delta) {
9390
* @return the deltas
9491
*/
9592
publicList<AbstractDelta<T>>getDeltas() {
96-
Collections.sort(deltas,comparing(d ->d.getSource().getPosition()));
93+
deltas.sort(comparing(d ->d.getSource().getPosition()));
9794
returndeltas;
9895
}
9996

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp