Skip to content
This repository was archived by the owner on Oct 21, 2020. It is now read-only.

Commit b0ca17d

Browse files
committed
Applying style checks
1 parent 47013fa commit b0ca17d

26 files changed

+212
-207
lines changed

Diff for: nb-configuration.xml

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project-shared-configuration>
3-
<!--
4-
This file contains additional configuration written by modules in the NetBeans IDE.
5-
The configuration is intended to be shared among all the users of project and
6-
therefore it is assumed to be part of version control checkout.
7-
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
8-
-->
9-
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
10-
<!--
11-
Properties that influence various parts of the IDE, especially code formatting and the like.
12-
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
13-
That way multiple projects can share the same settings (useful for formatting rules for example).
14-
Any value defined here will override the pom.xml file value but is only applicable to the current project.
15-
-->
16-
<netbeans.compile.on.save>none</netbeans.compile.on.save>
17-
<com-junichi11-netbeans-changelf.enable>false</com-junichi11-netbeans-changelf.enable>
18-
<com-junichi11-netbeans-changelf.use-project>true</com-junichi11-netbeans-changelf.use-project>
19-
<com-junichi11-netbeans-changelf.lf-kind>LF</com-junichi11-netbeans-changelf.lf-kind>
20-
<com-junichi11-netbeans-changelf.use-global>false</com-junichi11-netbeans-changelf.use-global>
21-
</properties>
3+
<!--
4+
This file contains additional configuration written by modules in the NetBeans IDE.
5+
The configuration is intended to be shared among all the users of project and
6+
therefore it is assumed to be part of version control checkout.
7+
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
8+
-->
9+
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
10+
<!--
11+
Properties that influence various parts of the IDE, especially code formatting and the like.
12+
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
13+
That way multiple projects can share the same settings (useful for formatting rules for example).
14+
Any value defined here will override the pom.xml file value but is only applicable to the current project.
15+
-->
16+
<netbeans.compile.on.save>none</netbeans.compile.on.save>
17+
<com-junichi11-netbeans-changelf.enable>false</com-junichi11-netbeans-changelf.enable>
18+
<com-junichi11-netbeans-changelf.use-project>true</com-junichi11-netbeans-changelf.use-project>
19+
<com-junichi11-netbeans-changelf.lf-kind>LF</com-junichi11-netbeans-changelf.lf-kind>
20+
<com-junichi11-netbeans-changelf.use-global>false</com-junichi11-netbeans-changelf.use-global>
21+
</properties>
2222
</project-shared-configuration>

Diff for: pom.xml

+102-100
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,40 @@
1-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
1+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
23
<modelVersion>4.0.0</modelVersion>
34
<groupId>com.github.java-diff-utils</groupId>
45
<artifactId>diffutils</artifactId>
56
<packaging>jar</packaging>
67
<version>2.2-SNAPSHOT</version>
78

89
<name>java-diff-utils</name>
9-
<description>The DiffUtils library for computing diffs, applying patches, generationg side-by-side view in Java.</description>
10+
<description>The DiffUtils library for computing diffs, applying patches, generationg side-by-side view in Java.
11+
</description>
1012
<url>https://github.com/wumpz/java-diff-utils</url>
1113
<inceptionYear>2009</inceptionYear>
12-
<!--
13-
to make a local release
14+
<!--
15+
to make a local release
1416
<parent>
1517
<groupId>org.sonatype.oss</groupId>
1618
<artifactId>oss-parent</artifactId>
1719
<version>9</version>
1820
</parent>
19-
-->
21+
-->
2022
<scm>
2123
<connection>scm:git:https://github.com/wumpz/java-diff-utils.git</connection>
2224
<developerConnection>scm:git:ssh://[email protected]:wumpz/java-diff-utils.git</developerConnection>
2325
<url>https://github.com/wumpz/java-diff-utils.git</url>
2426
<tag>diffutils-2.2</tag>
25-
</scm>
26-
27+
</scm>
28+
2729
<issueManagement>
2830
<system>GitHub Issues</system>
2931
<url>https://github.com/wumpz/java-diff-utils/issues</url>
3032
</issueManagement>
31-
33+
3234
<organization>
3335
<name>java-diff-utils</name>
3436
</organization>
35-
37+
3638
<developers>
3739
<developer>
3840
<name>Christopher Sontag</name>
@@ -51,7 +53,7 @@
5153
<email>[email protected]</email>
5254
</developer>
5355
</developers>
54-
56+
5557
<licenses>
5658
<license>
5759
<name>The Apache Software License, Version 2.0</name>
@@ -108,7 +110,7 @@
108110

109111
<build>
110112
<plugins>
111-
113+
112114
<plugin>
113115
<groupId>org.apache.maven.plugins</groupId>
114116
<artifactId>maven-compiler-plugin</artifactId>
@@ -119,7 +121,7 @@
119121
<encoding>UTF-8</encoding>
120122
</configuration>
121123
</plugin>
122-
124+
123125
<!-- Make this JAR OSGi ready -->
124126
<!-- We want to keep packaging type as jar. Therefore we need to customize the MANIFEST.MF.
125127
See http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html
@@ -181,96 +183,96 @@
181183
<localCheckout>true</localCheckout>
182184
<pushChanges>false</pushChanges>
183185
<mavenExecutorId>forked-path</mavenExecutorId>
184-
<goals>install</goals>
185-
</configuration>
186-
</plugin>
187-
<plugin>
188-
<groupId>org.apache.maven.plugins</groupId>
189-
<artifactId>maven-checkstyle-plugin</artifactId>
190-
<version>2.17</version>
191-
<executions>
192-
<execution>
193-
<id>verify-style</id>
194-
<phase>process-classes</phase>
195-
<goals>
196-
<goal>check</goal>
197-
</goals>
198-
</execution>
199-
</executions>
200-
<configuration>
201-
<logViolationsToConsole>true</logViolationsToConsole>
202-
<includeTestSourceDirectory>true</includeTestSourceDirectory>
203-
<sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
204-
<checkstyleRules>
205-
<module name="Checker">
206-
<module name="SuppressWarningsFilter" />
207-
<module name="FileTabCharacter" />
208-
<!-- git checkout may change linefeeds on the fly
209-
<module name="RegexpMultiline">
210-
<property name="format" value="(?s:(\r\n|\r).*)" />
211-
<property name="message" value="CRLF and CR line endings are prohibited, but this file uses them." />
212-
</module>
213-
-->
214-
<module name="TreeWalker">
215-
<module name="AvoidNestedBlocks" />
216-
<module name="ConstantName" />
217-
<module name="EmptyCatchBlock" />
218-
<module name="EmptyStatement" />
219-
<module name="MissingOverride" />
220-
<module name="MultipleVariableDeclarations" />
221-
<module name="ParameterAssignment" />
222-
<module name="StringLiteralEquality" />
223-
<module name="RedundantImport" />
224-
<module name="UnusedImports" />
186+
<goals>install</goals>
187+
</configuration>
188+
</plugin>
189+
<plugin>
190+
<groupId>org.apache.maven.plugins</groupId>
191+
<artifactId>maven-checkstyle-plugin</artifactId>
192+
<version>2.17</version>
193+
<executions>
194+
<execution>
195+
<id>verify-style</id>
196+
<phase>process-classes</phase>
197+
<goals>
198+
<goal>check</goal>
199+
</goals>
200+
</execution>
201+
</executions>
202+
<configuration>
203+
<logViolationsToConsole>true</logViolationsToConsole>
204+
<includeTestSourceDirectory>true</includeTestSourceDirectory>
205+
<sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
206+
<checkstyleRules>
207+
<module name="Checker">
208+
<module name="SuppressWarningsFilter"/>
209+
<module name="FileTabCharacter"/>
210+
<!-- git checkout may change linefeeds on the fly
211+
<module name="RegexpMultiline">
212+
<property name="format" value="(?s:(\r\n|\r).*)" />
213+
<property name="message" value="CRLF and CR line endings are prohibited, but this file uses them." />
214+
</module>
215+
-->
216+
<module name="TreeWalker">
217+
<module name="AvoidNestedBlocks"/>
218+
<module name="ConstantName"/>
219+
<module name="EmptyCatchBlock"/>
220+
<module name="EmptyStatement"/>
221+
<module name="MissingOverride"/>
222+
<module name="MultipleVariableDeclarations"/>
223+
<module name="ParameterAssignment"/>
224+
<module name="StringLiteralEquality"/>
225+
<module name="RedundantImport"/>
226+
<module name="UnusedImports"/>
225227

226-
<module name="WhitespaceAfter" />
228+
<module name="WhitespaceAfter"/>
227229

228-
<module name="NeedBraces" />
229-
<module name="UnnecessaryParentheses" />
230-
<module name="LeftCurly" />
231-
<module name="RightCurly" />
230+
<module name="NeedBraces"/>
231+
<module name="UnnecessaryParentheses"/>
232+
<module name="LeftCurly"/>
233+
<module name="RightCurly"/>
232234

233-
<module name="SuppressWarningsHolder" />
234-
</module>
235-
</module>
236-
</checkstyleRules>
237-
</configuration>
238-
<dependencies>
239-
<dependency>
240-
<groupId>com.puppycrawl.tools</groupId>
241-
<artifactId>checkstyle</artifactId>
242-
<version>6.19</version>
243-
</dependency>
244-
</dependencies>
245-
</plugin>
246-
</plugins>
247-
</build>
248-
<profiles>
249-
<profile>
250-
<id>doclint-java8-disable</id>
251-
<activation>
252-
<jdk>[1.8,)</jdk>
253-
</activation>
254-
<properties>
255-
<javadoc.opts>-Xdoclint:none</javadoc.opts>
256-
</properties>
257-
</profile>
258-
<profile>
259-
<id>long-running-tests</id>
260-
<build>
261-
<plugins>
262-
<plugin>
263-
<groupId>org.apache.maven.plugins</groupId>
264-
<artifactId>maven-surefire-plugin</artifactId>
265-
<configuration>
266-
<excludes>
267-
<exclude>xxx</exclude>
268-
</excludes>
269-
</configuration>
270-
</plugin>
271-
</plugins>
272-
</build>
273-
</profile>
274-
</profiles>
235+
<module name="SuppressWarningsHolder"/>
236+
</module>
237+
</module>
238+
</checkstyleRules>
239+
</configuration>
240+
<dependencies>
241+
<dependency>
242+
<groupId>com.puppycrawl.tools</groupId>
243+
<artifactId>checkstyle</artifactId>
244+
<version>6.19</version>
245+
</dependency>
246+
</dependencies>
247+
</plugin>
248+
</plugins>
249+
</build>
250+
<profiles>
251+
<profile>
252+
<id>doclint-java8-disable</id>
253+
<activation>
254+
<jdk>[1.8,)</jdk>
255+
</activation>
256+
<properties>
257+
<javadoc.opts>-Xdoclint:none</javadoc.opts>
258+
</properties>
259+
</profile>
260+
<profile>
261+
<id>long-running-tests</id>
262+
<build>
263+
<plugins>
264+
<plugin>
265+
<groupId>org.apache.maven.plugins</groupId>
266+
<artifactId>maven-surefire-plugin</artifactId>
267+
<configuration>
268+
<excludes>
269+
<exclude>xxx</exclude>
270+
</excludes>
271+
</configuration>
272+
</plugin>
273+
</plugins>
274+
</build>
275+
</profile>
276+
</profiles>
275277
</project>
276278

Diff for: src/main/java/com/github/difflib/DiffUtils.java

+16-17
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ public final class DiffUtils {
4343
/**
4444
* Computes the difference between the original and revised list of elements with default diff algorithm
4545
*
46-
* @param original The original text. Must not be {@code null}.
47-
* @param revised The revised text. Must not be {@code null}.
46+
* @param original The original text. Must not be {@code null}.
47+
* @param revised The revised text. Must not be {@code null}.
4848
* @param linesBeforeAfter - Amount of lines for before and after chunk content
4949
* @return The patch describing the difference between the original and revised sequences. Never {@code null}.
5050
*/
@@ -62,16 +62,15 @@ public static Patch<String> diff(String originalText, String revisedText, int li
6262
/**
6363
* Computes the difference between the original and revised list of elements with default diff algorithm
6464
*
65-
* @param original The original text. Must not be {@code null}.
66-
* @param revised The revised text. Must not be {@code null}.
67-
*
68-
* @param equalizer the equalizer object to replace the default compare algorithm (Object.equals). If {@code null}
69-
* the default equalizer of the default algorithm is used..
65+
* @param original The original text. Must not be {@code null}.
66+
* @param revised The revised text. Must not be {@code null}.
67+
* @param equalizer the equalizer object to replace the default compare algorithm (Object.equals). If {@code null}
68+
* the default equalizer of the default algorithm is used..
7069
* @param linesBeforeAfter - Amount of lines for before and after chunk content
7170
* @return The patch describing the difference between the original and revised sequences. Never {@code null}.
7271
*/
7372
public static <T> Patch<T> diff(List<T> original, List<T> revised,
74-
BiPredicate<T, T> equalizer, int linesBeforeAfter) throws DiffException {
73+
BiPredicate<T, T> equalizer, int linesBeforeAfter) throws DiffException {
7574
if (equalizer != null) {
7675
return DiffUtils.diff(original, revised,
7776
new MyersDiff<>(equalizer), linesBeforeAfter);
@@ -82,17 +81,17 @@ public static <T> Patch<T> diff(List<T> original, List<T> revised,
8281
/**
8382
* Computes the difference between the original and revised list of elements with default diff algorithm
8483
*
85-
* @param original The original text. Must not be {@code null}.
86-
* @param revised The revised text. Must not be {@code null}.
87-
* @param algorithm The diff algorithm. Must not be {@code null}.
84+
* @param original The original text. Must not be {@code null}.
85+
* @param revised The revised text. Must not be {@code null}.
86+
* @param algorithm The diff algorithm. Must not be {@code null}.
8887
* @param linesBeforeAfter - Amount of lines for before and after chunk content
8988
* @return The patch describing the difference between the original and revised sequences. Never {@code null}.
9089
*/
9190
public static <T> Patch<T> diff(List<T> original, List<T> revised,
92-
DiffAlgorithm<T> algorithm, int linesBeforeAfter) throws DiffException {
93-
Objects.requireNonNull(original,"original must not be null");
94-
Objects.requireNonNull(revised,"revised must not be null");
95-
Objects.requireNonNull(algorithm,"algorithm must not be null");
91+
DiffAlgorithm<T> algorithm, int linesBeforeAfter) throws DiffException {
92+
Objects.requireNonNull(original, "original must not be null");
93+
Objects.requireNonNull(revised, "revised must not be null");
94+
Objects.requireNonNull(algorithm, "algorithm must not be null");
9695

9796
return Patch.generate(original, revised, algorithm.diff(original, revised), linesBeforeAfter);
9897
}
@@ -134,7 +133,7 @@ private static List<String> compressLines(List<String> lines, String delimiter)
134133
* Patch the original text with given patch
135134
*
136135
* @param original the original text
137-
* @param patch the given patch
136+
* @param patch the given patch
138137
* @return the revised text
139138
* @throws PatchFailedException if can't apply patch
140139
*/
@@ -147,7 +146,7 @@ public static <T> List<T> patch(List<T> original, Patch<T> patch)
147146
* Unpatch the revised text for a given patch
148147
*
149148
* @param revised the revised text
150-
* @param patch the given patch
149+
* @param patch the given patch
151150
* @return the original text
152151
*/
153152
public static <T> List<T> unpatch(List<T> revised, Patch<T> patch) {

0 commit comments

Comments
 (0)