-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore (deps) : Directly rely on upstream zjsonpatch repository instea…
…d of fabric8io fork + Add a new module zjsonpatch that would directly include `com.flipkart.zjsonpatch:zjsonpatch` dependency excluding `org.apache.commons:commons-collections4`. + Port required method `ListUtils.longestCommonSubsequence` and related classes inside zjsonpatch module Signed-off-by: Rohan Kumar <[email protected]>
- Loading branch information
1 parent
81b1fea
commit 848e90f
Showing
15 changed files
with
1,393 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (C) 2015 Red Hat, Inc. | ||
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. | ||
--> | ||
<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/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>io.fabric8</groupId> | ||
<artifactId>kubernetes-client-project</artifactId> | ||
<version>7.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<packaging>bundle</packaging> | ||
<artifactId>zjsonpatch</artifactId> | ||
|
||
<properties> | ||
<osgi.import> | ||
* | ||
</osgi.import> | ||
<osgi.export> | ||
io.fabric8.zjsonpatch*, | ||
com.flipkart.zjsonpatch, | ||
</osgi.export> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.flipkart.zjsonpatch</groupId> | ||
<artifactId>zjsonpatch</artifactId> | ||
<version>${zjsonpatch.version}</version> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>org.apache.commons</groupId> | ||
<artifactId>commons-collections4</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter-engine</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.assertj</groupId> | ||
<artifactId>assertj-core</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.felix</groupId> | ||
<artifactId>maven-bundle-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>bundle</id> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>bundle</goal> | ||
</goals> | ||
<configuration> | ||
<instructions> | ||
<Bundle-Name>${project.name}</Bundle-Name> | ||
<Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName> | ||
<Export-Package>${osgi.export}</Export-Package> | ||
<Import-Package>${osgi.import}</Import-Package> | ||
<DynamicImport-Package>${osgi.dynamic.import}</DynamicImport-Package> | ||
<Private-Package>${osgi.private}</Private-Package> | ||
<Require-Bundle>${osgi.bundles}</Require-Bundle> | ||
<Bundle-Activator>${osgi.activator}</Bundle-Activator> | ||
<Export-Service>${osgi.export.service}</Export-Service> | ||
</instructions> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/* | ||
* Copyright (C) 2015 Red Hat, Inc. | ||
* | ||
* 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. | ||
*/ | ||
package io.fabric8.zjsonpatch; | ||
|
||
import com.fasterxml.jackson.databind.JsonNode; | ||
import com.flipkart.zjsonpatch.Operation; | ||
|
||
/** | ||
* This class is ported from <a href= | ||
* "https://github.com/flipkart-incubator/zjsonpatch/blob/a446bf598231c06006d4e3df69b846cdb16d8889/src/main/java/com/flipkart/zjsonpatch/Diff.java#L25">FlipKart | ||
* JSONPatch repository</a> | ||
*/ | ||
class Diff { | ||
private final Operation operation; | ||
private final JsonPointer path; | ||
private final JsonNode value; | ||
private JsonPointer toPath; //only to be used in move operation | ||
private final JsonNode srcValue; // only used in replace operation | ||
|
||
Diff(Operation operation, JsonPointer path, JsonNode value) { | ||
this.operation = operation; | ||
this.path = path; | ||
this.value = value; | ||
this.srcValue = null; | ||
} | ||
|
||
Diff(Operation operation, JsonPointer fromPath, JsonPointer toPath) { | ||
this.operation = operation; | ||
this.path = fromPath; | ||
this.toPath = toPath; | ||
this.value = null; | ||
this.srcValue = null; | ||
} | ||
|
||
Diff(Operation operation, JsonPointer path, JsonNode srcValue, JsonNode value) { | ||
this.operation = operation; | ||
this.path = path; | ||
this.value = value; | ||
this.srcValue = srcValue; | ||
} | ||
|
||
public Operation getOperation() { | ||
return operation; | ||
} | ||
|
||
public JsonPointer getPath() { | ||
return path; | ||
} | ||
|
||
public JsonNode getValue() { | ||
return value; | ||
} | ||
|
||
public static Diff generateDiff(Operation replace, JsonPointer path, JsonNode target) { | ||
return new Diff(replace, path, target); | ||
} | ||
|
||
public static Diff generateDiff(Operation replace, JsonPointer path, JsonNode source, JsonNode target) { | ||
return new Diff(replace, path, source, target); | ||
} | ||
|
||
JsonPointer getToPath() { | ||
return toPath; | ||
} | ||
|
||
public JsonNode getSrcValue() { | ||
return srcValue; | ||
} | ||
} |
Oops, something went wrong.