blob: 7a6b9a4e23981ad2f612f0c776909951acb9dd76 [file] [log] [blame] [edit]
diff -ur srcs/javax/xml/bind/JAXB.java srcs-patched/javax/xml/bind/JAXB.java
--- srcs/javax/xml/bind/JAXB.java 2018-09-12 06:26:24.000000000 +0200
+++ srcs-patched/javax/xml/bind/JAXB.java 2019-04-16 17:17:25.118768524 +0200
@@ -46,7 +46,6 @@
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
-import java.beans.Introspector;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
@@ -593,7 +592,30 @@
}
private static String inferName(Class clazz) {
- return Introspector.decapitalize(clazz.getSimpleName());
+ String name = clazz.getSimpleName();
+ try {
+ if (!Character.isUpperCase(name.charAt(0))) {
+ return name;
+ } else {
+ try {
+ if(Character.isUpperCase(name.charAt(1))) {
+ return name;
+ } else {
+ char[] c = name.toCharArray();
+ c[0] = Character.toLowerCase(c[0]);
+ return new String(c);
+ }
+ } catch(StringIndexOutOfBoundsException E) {
+ char[] c = new char[1];
+ c[0] = Character.toLowerCase(name.charAt(0));
+ return new String(c);
+ }
+ }
+ } catch(StringIndexOutOfBoundsException E) {
+ return name;
+ } catch(NullPointerException E) {
+ return null;
+ }
}
/**
diff -ur srcs/module-info.java srcs-patched/module-info.java
--- srcs/module-info.java 2018-09-12 06:26:24.000000000 +0200
+++ srcs-patched/module-info.java 2019-04-16 17:17:16.038792433 +0200
@@ -42,7 +42,6 @@
requires transitive java.activation;
requires transitive java.xml;
requires java.logging;
- requires java.desktop;
exports javax.xml.bind;
exports javax.xml.bind.annotation;