You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by ni...@apache.org on 2019/12/20 07:28:43 UTC
[servicecomb-pack] branch master updated: SCB-1668 Replace
sun.misc.BASE64* with java.util.Base64
This is an automated email from the ASF dual-hosted git repository.
ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-pack.git
The following commit(s) were added to refs/heads/master by this push:
new 41504a1 SCB-1668 Replace sun.misc.BASE64* with java.util.Base64
41504a1 is described below
commit 41504a11c51deb34a6c2c60e80ac5669b92bc695
Author: Lei Zhang <zh...@apache.org>
AuthorDate: Thu Dec 19 20:53:31 2019 +0800
SCB-1668 Replace sun.misc.BASE64* with java.util.Base64
---
.../pack/alpha/ui/controller/TransactionController.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/alpha/alpha-ui/src/main/java/org/apache/servicecomb/pack/alpha/ui/controller/TransactionController.java b/alpha/alpha-ui/src/main/java/org/apache/servicecomb/pack/alpha/ui/controller/TransactionController.java
index 9d429bd..32e2d1b 100644
--- a/alpha/alpha-ui/src/main/java/org/apache/servicecomb/pack/alpha/ui/controller/TransactionController.java
+++ b/alpha/alpha-ui/src/main/java/org/apache/servicecomb/pack/alpha/ui/controller/TransactionController.java
@@ -20,6 +20,7 @@ package org.apache.servicecomb.pack.alpha.ui.controller;
import java.io.IOException;
import java.lang.invoke.MethodHandles;
import java.util.ArrayList;
+import java.util.Base64;
import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -48,7 +49,7 @@ import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;
-import sun.misc.BASE64Decoder;
+import java.util.Base64.Decoder;
@Controller
@EnableScheduling
@@ -172,10 +173,10 @@ public class TransactionController {
.equals("SagaAbortedEvent")) {
// TxAbortedEvent properties
if (event.containsKey("payloads")) {
- BASE64Decoder decoder = new BASE64Decoder();
+ Decoder decoder = Base64.getDecoder();
String exception;
try {
- exception = new String(decoder.decodeBuffer(event.get("payloads").toString()), "UTF-8");
+ exception = new String(decoder.decode(event.get("payloads").toString()), "UTF-8");
} catch (IOException e) {
exception = "BASE64Decoder error";
LOG.error(e.getMessage(), e);