You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2018/10/09 14:37:24 UTC

[GitHub] dawidwys closed pull request #6801: [FLINK-10227] Remove javax.xml.bind.DatatypeConverter

dawidwys closed pull request #6801: [FLINK-10227] Remove javax.xml.bind.DatatypeConverter
URL: https://github.com/apache/flink/pull/6801
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/flink-core/src/main/java/org/apache/flink/api/common/JobID.java b/flink-core/src/main/java/org/apache/flink/api/common/JobID.java
index 36df17a7e15..01abd766b89 100644
--- a/flink-core/src/main/java/org/apache/flink/api/common/JobID.java
+++ b/flink-core/src/main/java/org/apache/flink/api/common/JobID.java
@@ -20,8 +20,7 @@
 
 import org.apache.flink.annotation.Public;
 import org.apache.flink.util.AbstractID;
-
-import javax.xml.bind.DatatypeConverter;
+import org.apache.flink.util.StringUtils;
 
 import java.nio.ByteBuffer;
 
@@ -107,7 +106,7 @@ public static JobID fromByteBuffer(ByteBuffer buf) {
 	 */
 	public static JobID fromHexString(String hexString) {
 		try {
-			return new JobID(DatatypeConverter.parseHexBinary(hexString));
+			return new JobID(StringUtils.hexStringToByte(hexString));
 		} catch (Exception e) {
 			throw new IllegalArgumentException("Cannot parse JobID from \"" + hexString + "\".", e);
 		}
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/JobVertexID.java b/flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/JobVertexID.java
index 1f78b211e66..6c570e96575 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/JobVertexID.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/JobVertexID.java
@@ -19,8 +19,7 @@
 package org.apache.flink.runtime.jobgraph;
 
 import org.apache.flink.util.AbstractID;
-
-import javax.xml.bind.DatatypeConverter;
+import org.apache.flink.util.StringUtils;
 
 /**
  * A class for statistically unique job vertex IDs.
@@ -41,6 +40,6 @@ public JobVertexID(long lowerPart, long upperPart) {
 	}
 
 	public static JobVertexID fromHexString(String hexString) {
-		return new JobVertexID(DatatypeConverter.parseHexBinary(hexString));
+		return new JobVertexID(StringUtils.hexStringToByte(hexString));
 	}
 }
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/TriggerId.java b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/TriggerId.java
index ca8774cd5e1..ff60e0c9b6f 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/TriggerId.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/TriggerId.java
@@ -19,6 +19,7 @@
 package org.apache.flink.runtime.rest.messages;
 
 import org.apache.flink.util.AbstractID;
+import org.apache.flink.util.StringUtils;
 
 import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.JsonGenerator;
 import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.JsonParser;
@@ -29,8 +30,6 @@
 import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.deser.std.StdDeserializer;
 import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.ser.std.StdSerializer;
 
-import javax.xml.bind.DatatypeConverter;
-
 import java.io.IOException;
 
 /**
@@ -50,7 +49,7 @@ private TriggerId(final byte[] bytes) {
 	}
 
 	public static TriggerId fromHexString(String hexString) {
-		return new TriggerId(DatatypeConverter.parseHexBinary(hexString));
+		return new TriggerId(StringUtils.hexStringToByte(hexString));
 	}
 
 	/**


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services