diff --git a/README.md b/README.md index df31d84b..e62f0e5c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # java-diff-utils ## Status ## -[![Build Status](https://travis-ci.org/wumpz/java-diff-utils.svg?branch=master)](https://travis-ci.org/wumpz/java-diff-utils) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/7eba77f10bed4c2a8d08ac8dc8da4a86)](https://www.codacy.com/app/wumpz/java-diff-utils?utm_source=github.com&utm_medium=referral&utm_content=wumpz/java-diff-utils&utm_campaign=Badge_Grade) +[![Build Status](https://travis-ci.org/wumpz/java-diff-utils.svg?branch=master)](https://travis-ci.org/java-diff-utils/java-diff-utils) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/7eba77f10bed4c2a8d08ac8dc8da4a86)](https://www.codacy.com/app/wumpz/java-diff-utils?utm_source=github.com&utm_medium=referral&utm_content=java-diff-utils/java-diff-utils&utm_campaign=Badge_Grade) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.wumpz/diffutils/badge.svg)](http://maven-badges.herokuapp.com/maven-central/com.github.wumpz/diffutils) @@ -52,7 +52,10 @@ This is a test ~senctence~**for diffutils**. But it can easily replaced by any other which is better for handing your texts. I have plan to add implementation of some in future. ### Changelog ### - * Version 3.0-SNAPSHOT + * Version 4.0-SNAPSHOT + * moved to organisation **java-diff-utils** + * changed groupid to **io.github.java-diff-utils** and artifact id to **java-diff-utils** + * Version 3.0 * changed generation of inline diffes, if there are different linefeeds within one diff, then these are excluded from the diff block. * Due to licensing issues Delta.java and DiffAlgorithm.java were removed. @@ -108,9 +111,20 @@ Just add the code below to your maven dependencies: com.github.wumpz diffutils -    2.2 +    3.0 ``` + +Attention. We changed groupid and artifactid. Starting with version 4 you have to use: + +``` + + io.github.java-diff-utils + java-diff-utils + 4.0-SNAPSHOT + +``` + or using gradle: ``` // https://mvnrepository.com/artifact/com.github.wumpz/diffutils diff --git a/pom.xml b/pom.xml index 081b7949..5a85f49f 100644 --- a/pom.xml +++ b/pom.xml @@ -1,253 +1,255 @@ - 4.0.0 - com.github.wumpz - diffutils - jar - 3.0 - java-diff-utils - The DiffUtils library for computing diffs, applying patches, generationg side-by-side view in Java. - https://github.com/wumpz/java-diff-utils - 2009 + 4.0.0 + io.github.java-diff-utils + java-diff-utils + jar + 4.0 + java-diff-utils + The DiffUtils library for computing diffs, applying patches, generationg side-by-side view in Java. + https://github.com/java-diff-utils/java-diff-utils + 2009 - - - sonatype-nexus-staging - https://oss.sonatype.org/service/local/staging/deploy/maven2 - - - sonatype-nexus-snapshots - https://oss.sonatype.org/content/repositories/snapshots - - + + + sonatype-nexus-staging + https://oss.sonatype.org/service/local/staging/deploy/maven2 + + + sonatype-nexus-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + - - scm:git:https://github.com/wumpz/java-diff-utils.git - scm:git:ssh://git@github.com:wumpz/java-diff-utils.git - https://github.com/wumpz/java-diff-utils.git - diffutils-3.0 - + + scm:git:https://github.com/java-diff-utils/java-diff-utils.git + scm:git:ssh://git@github.com:java-diff-utils/java-diff-utils.git + https://github.com/java-diff-utils/java-diff-utils.git + java-diff-utils-4.0 + - - GitHub Issues - https://github.com/wumpz/java-diff-utils/issues - + + GitHub Issues + https://github.com/java-diff-utils/java-diff-utils/issues + - - java-diff-utils - + + java-diff-utils + - - - Tobias Warneke - t.warneke@gmx.net - - - Dmitry Naumenko - dm.naumenko@gmail.com - - - Juanco Anez - juanco@suigeneris.org - - + + + Tobias Warneke + t.warneke@gmx.net + + + - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - A business-friendly OSS license - - + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + A business-friendly OSS license + + - - UTF-8 - + + UTF-8 + - - - junit - junit - 4.12 - jar - test - - - org.eclipse.jgit - org.eclipse.jgit - 4.4.1.201607150455-r - - - com.googlecode.javaewah - JavaEWAH - - - commons-codec - commons-codec - - - commons-logging - commons-logging - - - org.apache.httpcomponents - httpclient - - - com.jcraft - jsch - - - org.slf4j - slf4j-api - - - - + + + junit + junit + 4.12 + jar + test + + + org.eclipse.jgit + org.eclipse.jgit + 4.4.1.201607150455-r + + + com.googlecode.javaewah + JavaEWAH + + + commons-codec + commons-codec + + + commons-logging + commons-logging + + + org.apache.httpcomponents + httpclient + + + com.jcraft + jsch + + + org.slf4j + slf4j-api + + + + - - + + - - org.apache.maven.plugins - maven-compiler-plugin - 3.6.1 - - 1.8 - 1.8 - UTF-8 - - + + org.apache.maven.plugins + maven-compiler-plugin + 3.6.1 + + 1.8 + 1.8 + UTF-8 + + - - - - maven-jar-plugin - 3.0.2 - - - ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + maven-jar-plugin + 3.0.2 + + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF com.github.wumpz.diffutils - - - - - org.apache.felix - maven-bundle-plugin - 3.3.0 - - - bundle-manifest - process-classes - - manifest - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.4 - - ${javadoc.opts} - - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.19.1 - - - **/LR*.java - - - - - org.apache.maven.plugins - maven-release-plugin - 2.5.3 - - true - false - forked-path - - - - org.apache.maven.plugins - maven-checkstyle-plugin - 2.17 - - - verify-style - process-classes - - check - - - - - true - true - ${project.build.sourceDirectory} - - - - - - - - - - - - - - - - + + + + + org.apache.felix + maven-bundle-plugin + 3.3.0 + + + bundle-manifest + process-classes + + manifest + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + ${javadoc.opts} + + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.19.1 + + + **/LR*.java + + + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + true + false + forked-path + + + + org.apache.maven.plugins + maven-checkstyle-plugin + 2.17 + + + verify-style + process-classes + + check + + + + + true + true + ${project.build.sourceDirectory} + + + + + + + + + + + + + + + + - + - - - - + + + + - - - - - - - - com.puppycrawl.tools - checkstyle - 6.19 - - - - - - + + + + + + + + com.puppycrawl.tools + checkstyle + 6.19 + + + + + + sign-release-artifacts @@ -278,31 +280,31 @@ - - doclint-java8-disable - - [1.8,) - - - -Xdoclint:none - - - - long-running-tests - - - - org.apache.maven.plugins - maven-surefire-plugin - - - xxx - - - - - - - + + doclint-java8-disable + + [1.8,) + + + -Xdoclint:none + + + + long-running-tests + + + + org.apache.maven.plugins + maven-surefire-plugin + + + xxx + + + + + + + diff --git a/src/main/java/com/github/difflib/DiffUtils.java b/src/main/java/com/github/difflib/DiffUtils.java index f2c8eb19..8b144642 100644 --- a/src/main/java/com/github/difflib/DiffUtils.java +++ b/src/main/java/com/github/difflib/DiffUtils.java @@ -1,21 +1,17 @@ -/*- - * #%L - * java-diff-utils - * %% - * Copyright (C) 2009 - 2017 java-diff-utils - * %% +/* + * Copyright 2009-2017 java-diff-utils. + * * Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - * #L% + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.github.difflib; diff --git a/src/main/java/com/github/difflib/algorithm/DiffException.java b/src/main/java/com/github/difflib/algorithm/DiffException.java index 491bf38c..d36d16fb 100644 --- a/src/main/java/com/github/difflib/algorithm/DiffException.java +++ b/src/main/java/com/github/difflib/algorithm/DiffException.java @@ -1,21 +1,17 @@ -/*- - * #%L - * java-diff-utils - * %% - * Copyright (C) 2009 - 2017 java-diff-utils - * %% +/* + * Copyright 2009-2017 java-diff-utils. + * * Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - * #L% + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.github.difflib.algorithm; diff --git a/src/main/java/com/github/difflib/algorithm/DifferentiationFailedException.java b/src/main/java/com/github/difflib/algorithm/DifferentiationFailedException.java index 80c881e5..682a9b48 100644 --- a/src/main/java/com/github/difflib/algorithm/DifferentiationFailedException.java +++ b/src/main/java/com/github/difflib/algorithm/DifferentiationFailedException.java @@ -1,21 +1,17 @@ -/*- - * #%L - * java-diff-utils - * %% - * Copyright (C) 2009 - 2017 java-diff-utils - * %% +/* + * Copyright 2009-2017 java-diff-utils. + * * Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - * #L% + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.github.difflib.algorithm; diff --git a/src/main/java/com/github/difflib/algorithm/myers/MyersDiff.java b/src/main/java/com/github/difflib/algorithm/myers/MyersDiff.java index 00d22359..8c183411 100644 --- a/src/main/java/com/github/difflib/algorithm/myers/MyersDiff.java +++ b/src/main/java/com/github/difflib/algorithm/myers/MyersDiff.java @@ -1,21 +1,17 @@ -/*- - * #%L - * java-diff-utils - * %% - * Copyright (C) 2009 - 2017 java-diff-utils - * %% +/* + * Copyright 2009-2017 java-diff-utils. + * * Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - * #L% + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.github.difflib.algorithm.myers; diff --git a/src/main/java/com/github/difflib/algorithm/myers/PathNode.java b/src/main/java/com/github/difflib/algorithm/myers/PathNode.java index 01d669f7..a3f2070c 100644 --- a/src/main/java/com/github/difflib/algorithm/myers/PathNode.java +++ b/src/main/java/com/github/difflib/algorithm/myers/PathNode.java @@ -1,21 +1,17 @@ -/*- - * #%L - * java-diff-utils - * %% - * Copyright (C) 2009 - 2017 java-diff-utils - * %% +/* + * Copyright 2009-2017 java-diff-utils. + * * Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - * #L% + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.github.difflib.algorithm.myers; diff --git a/src/main/java/com/github/difflib/patch/AbstractDelta.java b/src/main/java/com/github/difflib/patch/AbstractDelta.java index 30de287c..9f1fb451 100644 --- a/src/main/java/com/github/difflib/patch/AbstractDelta.java +++ b/src/main/java/com/github/difflib/patch/AbstractDelta.java @@ -63,11 +63,7 @@ protected void verifyChunk(List target) throws PatchFailedException { @Override public int hashCode() { - int hash = 3; - hash = 61 * hash + Objects.hashCode(this.source); - hash = 61 * hash + Objects.hashCode(this.target); - hash = 61 * hash + Objects.hashCode(this.type); - return hash; + return Objects.hash(this.source, this.target, this.type); } @Override diff --git a/src/main/java/com/github/difflib/patch/ChangeDelta.java b/src/main/java/com/github/difflib/patch/ChangeDelta.java index eb67606b..43f68b35 100644 --- a/src/main/java/com/github/difflib/patch/ChangeDelta.java +++ b/src/main/java/com/github/difflib/patch/ChangeDelta.java @@ -1,21 +1,17 @@ -/*- - * #%L - * java-diff-utils - * %% - * Copyright (C) 2009 - 2017 java-diff-utils - * %% +/* + * Copyright 2009-2017 java-diff-utils. + * * Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - * #L% + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.github.difflib.patch; diff --git a/src/main/java/com/github/difflib/patch/Chunk.java b/src/main/java/com/github/difflib/patch/Chunk.java index 3812be09..ed70e20d 100644 --- a/src/main/java/com/github/difflib/patch/Chunk.java +++ b/src/main/java/com/github/difflib/patch/Chunk.java @@ -1,26 +1,23 @@ -/*- - * #%L - * java-diff-utils - * %% - * Copyright (C) 2009 - 2017 java-diff-utils - * %% +/* + * Copyright 2009-2017 java-diff-utils. + * * Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - * #L% + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.github.difflib.patch; import java.util.Arrays; import java.util.List; +import java.util.Objects; /** * Holds the information about the part of text involved in the diff process @@ -108,26 +105,11 @@ public int last() { return getPosition() + size() - 1; } - /* - * (non-Javadoc) - * - * @see java.lang.Object#hashCode() - */ @Override public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((lines == null) ? 0 : lines.hashCode()); - result = prime * result + position; - result = prime * result + size(); - return result; + return Objects.hash(lines, position, size()); } - /* - * (non-Javadoc) - * - * @see java.lang.Object#equals(java.lang.Object) - */ @Override public boolean equals(Object obj) { if (this == obj) { diff --git a/src/main/java/com/github/difflib/patch/DeleteDelta.java b/src/main/java/com/github/difflib/patch/DeleteDelta.java index d7417246..66a928ca 100644 --- a/src/main/java/com/github/difflib/patch/DeleteDelta.java +++ b/src/main/java/com/github/difflib/patch/DeleteDelta.java @@ -1,21 +1,17 @@ -/*- - * #%L - * java-diff-utils - * %% - * Copyright (C) 2009 - 2017 java-diff-utils - * %% +/* + * Copyright 2009-2017 java-diff-utils. + * * Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - * #L% + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.github.difflib.patch; diff --git a/src/main/java/com/github/difflib/patch/DiffException.java b/src/main/java/com/github/difflib/patch/DiffException.java index 9b8b53b4..da01d621 100644 --- a/src/main/java/com/github/difflib/patch/DiffException.java +++ b/src/main/java/com/github/difflib/patch/DiffException.java @@ -1,21 +1,17 @@ -/*- - * #%L - * java-diff-utils - * %% - * Copyright (C) 2009 - 2017 java-diff-utils - * %% +/* + * Copyright 2009-2017 java-diff-utils. + * * Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - * #L% + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.github.difflib.patch; diff --git a/src/main/java/com/github/difflib/patch/InsertDelta.java b/src/main/java/com/github/difflib/patch/InsertDelta.java index 3cb40dde..08de5f1f 100644 --- a/src/main/java/com/github/difflib/patch/InsertDelta.java +++ b/src/main/java/com/github/difflib/patch/InsertDelta.java @@ -1,21 +1,17 @@ -/*- - * #%L - * java-diff-utils - * %% - * Copyright (C) 2009 - 2017 java-diff-utils - * %% +/* + * Copyright 2009-2017 java-diff-utils. + * * Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - * #L% + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.github.difflib.patch; diff --git a/src/main/java/com/github/difflib/patch/PatchFailedException.java b/src/main/java/com/github/difflib/patch/PatchFailedException.java index fa8bf8e0..7521c892 100644 --- a/src/main/java/com/github/difflib/patch/PatchFailedException.java +++ b/src/main/java/com/github/difflib/patch/PatchFailedException.java @@ -1,21 +1,17 @@ -/*- - * #%L - * java-diff-utils - * %% - * Copyright (C) 2009 - 2017 java-diff-utils - * %% +/* + * Copyright 2009-2017 java-diff-utils. + * * Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - * #L% + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.github.difflib.patch; diff --git a/src/main/java/com/github/difflib/text/DiffRow.java b/src/main/java/com/github/difflib/text/DiffRow.java index dd8cd9d6..95908393 100644 --- a/src/main/java/com/github/difflib/text/DiffRow.java +++ b/src/main/java/com/github/difflib/text/DiffRow.java @@ -1,25 +1,22 @@ -/*- - * #%L - * java-diff-utils - * %% - * Copyright (C) 2009 - 2017 java-diff-utils - * %% +/* + * Copyright 2009-2017 java-diff-utils. + * * Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - * #L% + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.github.difflib.text; import java.io.Serializable; +import java.util.Objects; /** * Describes the diff row in form [tag, oldLine, newLine) for showing the difference between two texts @@ -70,26 +67,11 @@ public String getNewLine() { return newLine; } - /* - * (non-Javadoc) - * - * @see java.lang.Object#hashCode() - */ @Override public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((newLine == null) ? 0 : newLine.hashCode()); - result = prime * result + ((oldLine == null) ? 0 : oldLine.hashCode()); - result = prime * result + ((tag == null) ? 0 : tag.hashCode()); - return result; + return Objects.hash(newLine, oldLine, tag); } - /* - * (non-Javadoc) - * - * @see java.lang.Object#equals(java.lang.Object) - */ @Override public boolean equals(Object obj) { if (this == obj) { diff --git a/src/main/java/com/github/difflib/text/DiffRowGenerator.java b/src/main/java/com/github/difflib/text/DiffRowGenerator.java index 8ded4253..2ed2662e 100644 --- a/src/main/java/com/github/difflib/text/DiffRowGenerator.java +++ b/src/main/java/com/github/difflib/text/DiffRowGenerator.java @@ -1,21 +1,17 @@ -/*- - * #%L - * java-diff-utils - * %% - * Copyright (C) 2009 - 2017 java-diff-utils - * %% +/* + * Copyright 2009-2017 java-diff-utils. + * * Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - * #L% + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.github.difflib.text; diff --git a/src/main/java/com/github/difflib/text/StringUtils.java b/src/main/java/com/github/difflib/text/StringUtils.java index 4166b311..3a2dab05 100644 --- a/src/main/java/com/github/difflib/text/StringUtils.java +++ b/src/main/java/com/github/difflib/text/StringUtils.java @@ -1,21 +1,17 @@ -/*- - * #%L - * java-diff-utils - * %% - * Copyright (C) 2009 - 2017 java-diff-utils - * %% +/* + * Copyright 2009-2017 java-diff-utils. + * * Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - * #L% + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.github.difflib.text;