JAVA-18131 Upgrade core-java-modules to JDK 11 (#13462)
* JAVA-18131 Upgrade core-java-modules to JDK 11 * JAVA-18131 Fixed pom conflicts * JAVA-18131 Upgraded ASM and updated expected test results * JAVA-18131 Fixed FormatNumberUnitTest and removed core-java-security from upgrading to 17 * JAVA-18131 Removed core-java-sun from upgrading * JAVA-18131 Removed core-java-jvm-2, fixed number test * JAVA-18131 Removed core-java-sun from upgrading to 11 * JAVA-18131 Removed all edited submodules from pre-jdk9 * JAVA-18131 removed pre-jpms from pre-jdk9 * JAVA-18131 Removed core-java-numbers-3 from pre-jdk9 profiles * JAVA-18131 Cleanup * JAVA-18131 Cleanup 2 - Removed upgraded submodules from core-java-modules * JAVA-18131 Cleanup completed * JAVA-18131 Replaced core-java-modules submodules in main pom with core-java-modules * JAVA-18131 Replaced core-java-modules submodules in main pom, continued * JAVA-18131 Core-java-nio-2, core-java-serialization back to pre-jdk9 * JAVA-18131 Try removing math-3 from core-java-modules and explicitly refer in parent pom * JAVA-18131 Removed -lang, -nio, -streams-2, -math-3, -conversions-2 from jdk9 profiles * JAVA-18131 Corrected conversions-2 module * JAVA-18131 Review fixes * JAVA-18131 Fixed -nio, re-upgraded -lang * JAVA-18131 Adapted -nio for JDK 11, returned -lang to JDK 8 * JAVA-18131 Final corrections
This commit is contained in:
committed by
GitHub
parent
4d9f26ebe3
commit
11f740192c
@@ -1,19 +1,18 @@
|
||||
package com.baeldung.prejpms;
|
||||
|
||||
import java.io.StringWriter;
|
||||
import java.lang.StackWalker.Option;
|
||||
import java.lang.StackWalker.StackFrame;
|
||||
import com.sun.crypto.provider.SunJCE;
|
||||
import java.util.Base64;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.JAXBException;
|
||||
import javax.xml.bind.Marshaller;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.sun.crypto.provider.SunJCE;
|
||||
|
||||
import sun.misc.BASE64Encoder;
|
||||
import sun.reflect.Reflection;
|
||||
|
||||
public class App {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(App.class);
|
||||
@@ -37,14 +36,14 @@ public class App {
|
||||
private static void getCallStackClassNames() {
|
||||
try {
|
||||
StringBuffer sbStack = new StringBuffer();
|
||||
int i = 0;
|
||||
Class<?> caller = Reflection.getCallerClass(i++);
|
||||
do {
|
||||
sbStack.append(i + ".")
|
||||
.append(caller.getName())
|
||||
.append("\n");
|
||||
caller = Reflection.getCallerClass(i++);
|
||||
} while (caller != null);
|
||||
AtomicInteger i = new AtomicInteger(0);
|
||||
StackWalker.getInstance((Option.RETAIN_CLASS_REFERENCE))
|
||||
.walk(s -> s.map(StackFrame::getDeclaringClass)
|
||||
.map(e -> {
|
||||
i.getAndIncrement();
|
||||
return e.getName();
|
||||
}))
|
||||
.forEach(name -> sbStack.append(String.format("%d. %s \n", i.get(), name)));
|
||||
LOGGER.info("2. Call Stack:\n{}", sbStack);
|
||||
} catch (Throwable e) {
|
||||
LOGGER.error(e.toString());
|
||||
@@ -54,7 +53,7 @@ public class App {
|
||||
private static void getXmlFromObject(Book book) {
|
||||
try {
|
||||
Marshaller marshallerObj = JAXBContext.newInstance(Book.class)
|
||||
.createMarshaller();
|
||||
.createMarshaller();
|
||||
marshallerObj.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
|
||||
|
||||
StringWriter sw = new StringWriter();
|
||||
@@ -68,7 +67,8 @@ public class App {
|
||||
|
||||
private static void getBase64EncodedString(String inputString) {
|
||||
try {
|
||||
String encodedString = new BASE64Encoder().encode(inputString.getBytes());
|
||||
String encodedString = new String(Base64.getEncoder()
|
||||
.encode(inputString.getBytes()));
|
||||
LOGGER.info("4. Base Encoded String: {}", encodedString);
|
||||
} catch (Throwable e) {
|
||||
LOGGER.error(e.toString());
|
||||
|
||||
Reference in New Issue
Block a user