[releng] Fix deprecation warnings and reflective access warnings for
Java 11.
diff --git a/plugins/org.eclipse.xsd/XSD.setup b/plugins/org.eclipse.xsd/XSD.setup
index 3404d1e..1e8e954 100644
--- a/plugins/org.eclipse.xsd/XSD.setup
+++ b/plugins/org.eclipse.xsd/XSD.setup
@@ -27,8 +27,8 @@
</annotation>
<setupTask
xsi:type="jdt:JRETask"
- version="JavaSE-1.8"
- location="${jre.location-1.8}"/>
+ version="JavaSE-11"
+ location="${jre.location-11}"/>
<setupTask
xsi:type="setup:EclipseIniTask"
option="-Xmx"
@@ -45,9 +45,22 @@
<setupTask
xsi:type="setup:ResourceCreationTask"
excludedTriggers="STARTUP MANUAL"
- content="<?xml version="1.0" encoding="UTF-8"?>
<section name="Workbench">
	<section name="org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart">
		<item value="true" key="group_libraries"/>
		<item value="false" key="linkWithEditor"/>
		<item value="2" key="layout"/>
		<item value="2" key="rootMode"/>
		<item value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#x0D;&#x0A;&lt;packageExplorer configured=&quot;true&quot; group_libraries=&quot;1&quot; layout=&quot;2&quot; linkWithEditor=&quot;0&quot; rootMode=&quot;2&quot; sortWorkingSets=&quot;false&quot; workingSetName=&quot;&quot;&gt;&#x0D;&#x0A;&lt;localWorkingSetManager&gt;&#x0D;&#x0A;&lt;workingSet editPageId=&quot;org.eclipse.jdt.internal.ui.OthersWorkingSet&quot; factoryID=&quot;org.eclipse.ui.internal.WorkingSetFactory&quot; id=&quot;1382792884467_1&quot; label=&quot;Other Projects&quot; name=&quot;Other Projects&quot;/&gt;&#x0D;&#x0A;&lt;/localWorkingSetManager&gt;&#x0D;&#x0A;&lt;activeWorkingSet workingSetName=&quot;Other Projects&quot;/&gt;&#x0D;&#x0A;&lt;allWorkingSets workingSetName=&quot;Other Projects&quot;/&gt;&#x0D;&#x0A;&lt;/packageExplorer&gt;" key="memento"/>
	</section>
</section>
"
targetURL="${workspace.location|uri}/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml"
- encoding="UTF-8"/>
+ encoding="UTF-8">
+ <content>
+ <?xml version="1.0" encoding="UTF-8"?>
+ <section name="Workbench">
+ <section name="org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart">
+ <item value="true" key="group_libraries"/>
+ <item value="false" key="linkWithEditor"/>
+ <item value="2" key="layout"/>
+ <item value="2" key="rootMode"/>
+ <item value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#x0D;&#x0A;&lt;packageExplorer configured=&quot;true&quot; group_libraries=&quot;1&quot; layout=&quot;2&quot; linkWithEditor=&quot;0&quot; rootMode=&quot;2&quot; sortWorkingSets=&quot;false&quot; workingSetName=&quot;&quot;&gt;&#x0D;&#x0A;&lt;localWorkingSetManager&gt;&#x0D;&#x0A;&lt;workingSet editPageId=&quot;org.eclipse.jdt.internal.ui.OthersWorkingSet&quot; factoryID=&quot;org.eclipse.ui.internal.WorkingSetFactory&quot; id=&quot;1382792884467_1&quot; label=&quot;Other Projects&quot; name=&quot;Other Projects&quot;/&gt;&#x0D;&#x0A;&lt;/localWorkingSetManager&gt;&#x0D;&#x0A;&lt;activeWorkingSet workingSetName=&quot;Other Projects&quot;/&gt;&#x0D;&#x0A;&lt;allWorkingSets workingSetName=&quot;Other Projects&quot;/&gt;&#x0D;&#x0A;&lt;/packageExplorer&gt;" key="memento"/>
+ </section>
+ </section>
+
+ </content>
+ </setupTask>
<setupTask
xsi:type="setup.p2:P2Task"
label="PDE/JDT">
diff --git a/plugins/org.eclipse.xsd/src/org/eclipse/xsd/ecore/XSDEcoreBuilder.java b/plugins/org.eclipse.xsd/src/org/eclipse/xsd/ecore/XSDEcoreBuilder.java
index a66c98b..9d04909 100644
--- a/plugins/org.eclipse.xsd/src/org/eclipse/xsd/ecore/XSDEcoreBuilder.java
+++ b/plugins/org.eclipse.xsd/src/org/eclipse/xsd/ecore/XSDEcoreBuilder.java
@@ -2763,7 +2763,7 @@
{
try
{
- extensionToFactoryMap.put("ecore", ecoreResourceFactoryImplClass.newInstance());
+ extensionToFactoryMap.put("ecore", ecoreResourceFactoryImplClass.getDeclaredConstructor().newInstance());
}
catch (Exception exception)
{
diff --git a/plugins/org.eclipse.xsd/src/org/eclipse/xsd/impl/type/XSDDoubleType.java b/plugins/org.eclipse.xsd/src/org/eclipse/xsd/impl/type/XSDDoubleType.java
index 9c3a7c5..b541687 100644
--- a/plugins/org.eclipse.xsd/src/org/eclipse/xsd/impl/type/XSDDoubleType.java
+++ b/plugins/org.eclipse.xsd/src/org/eclipse/xsd/impl/type/XSDDoubleType.java
@@ -41,7 +41,7 @@
}
else
{
- return new Double(literal);
+ return Double.valueOf(literal);
}
}
catch (NumberFormatException e)
diff --git a/plugins/org.eclipse.xsd/src/org/eclipse/xsd/impl/type/XSDFloatType.java b/plugins/org.eclipse.xsd/src/org/eclipse/xsd/impl/type/XSDFloatType.java
index 174610f..7941435 100644
--- a/plugins/org.eclipse.xsd/src/org/eclipse/xsd/impl/type/XSDFloatType.java
+++ b/plugins/org.eclipse.xsd/src/org/eclipse/xsd/impl/type/XSDFloatType.java
@@ -41,7 +41,7 @@
}
else
{
- return new Float(literal);
+ return Float.valueOf(literal);
}
}
catch (NumberFormatException e)
diff --git a/plugins/org.eclipse.xsd/src/org/eclipse/xsd/util/XSDParser.java b/plugins/org.eclipse.xsd/src/org/eclipse/xsd/util/XSDParser.java
index 3158258..162cc9f 100644
--- a/plugins/org.eclipse.xsd/src/org/eclipse/xsd/util/XSDParser.java
+++ b/plugins/org.eclipse.xsd/src/org/eclipse/xsd/util/XSDParser.java
@@ -14,7 +14,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
-import java.lang.reflect.Method;
import java.util.AbstractMap;
import java.util.ArrayList;
import java.util.Collection;
@@ -44,6 +43,7 @@
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.xml.sax.ext.LexicalHandler;
+import org.xml.sax.ext.Locator2;
import org.xml.sax.helpers.DefaultHandler;
import org.eclipse.xsd.XSDDiagnostic;
@@ -510,20 +510,9 @@
public String getEncoding()
{
- if (locator != null)
+ if (locator instanceof Locator2)
{
- try
- {
- Method getEncodingMethod = locator.getClass().getMethod("getEncoding", new Class[]{});
- if (getEncodingMethod != null)
- {
- encoding = (String)getEncodingMethod.invoke(locator);
- }
- }
- catch (Exception e)
- {
- // If we can't find it, there's nothing we can do...
- }
+ encoding = ((Locator2)locator).getEncoding();
}
return encoding;