Skip to content

Commit

Permalink
[all] Upgrade to JavaSE 1.8
Browse files Browse the repository at this point in the history
see #296

Signed-off-by: Stéphane Galland <galland@arakhne.org>
  • Loading branch information
gallandarakhneorg committed Nov 5, 2015
1 parent be8d574 commit f9095c7
Show file tree
Hide file tree
Showing 100 changed files with 742 additions and 785 deletions.
Expand Up @@ -1146,15 +1146,15 @@ public <T> T to(String expression, Class<T> resultType) throws Exception {
}
Object value = result.getResult();
if (value == null) {
return null;
return resultType.cast(null);
}
if (resultType.isInstance(value)) {
return resultType.cast(value);
}
fail("Invalid type. Expected: " //$NON-NLS-1$
+ resultType.getName() + ", but was: " //$NON-NLS-1$
+ value.getClass().getName());
return null;
return resultType.cast(null);
}

/** Evaluate a byte expression and reply the result.
Expand Down
Expand Up @@ -40,7 +40,7 @@ public class SARLSpecCreator extends AbstractSpecCreator {

private Injector injector;

private final SARLInjectorProvider injectorProvider = new SARLInjectorProvider();
private final IInjectorProvider injectorProvider = new SARLInjectorProvider();

@Override
protected <T> T create(Class<T> klass) {
Expand Down
Expand Up @@ -198,7 +198,7 @@ private static boolean isResourceLink(String url, Object source) {
URL fileURL;
try {
fileURL = new URL(url);
} catch (Throwable _) {
} catch (Throwable exception) {
fileURL = new URL("file:" + url); //$NON-NLS-1$
}
if ("file".equalsIgnoreCase(fileURL.getProtocol())) { //$NON-NLS-1$
Expand All @@ -211,7 +211,7 @@ private static boolean isResourceLink(String url, Object source) {
return true;
}
}
} catch (Throwable _) {
} catch (Throwable exception) {
//
}
return false;
Expand Down Expand Up @@ -268,15 +268,15 @@ private static boolean isJnarioLink(String url, Object source) {
try {
source.getClass().getMethod(operationNameStr);
return true;
} catch (Throwable _) {
} catch (Throwable exception) {
// Failure
}
}

return false;
}
return true;
} catch (Throwable _) {
} catch (Throwable exception) {
return false;
}
}
Expand All @@ -299,7 +299,7 @@ private static boolean isJnarioSpec(Class<?> callingSpecification, String refere
try {
ReflectionUtil.forName(resolvedPath);
return true;
} catch (Throwable _) {
} catch (Throwable exception) {
return false;
}
}
Expand Down Expand Up @@ -413,7 +413,7 @@ public static boolean should_beDate(String actual, String dateFormat) {
format = new SimpleDateFormat(dateFormat);
}
return format.parse(actual) != null;
} catch (Throwable _) {
} catch (Throwable exception) {
//
}
return false;
Expand Down Expand Up @@ -462,13 +462,13 @@ public static boolean should_beURL(String actual, String requiredSchemes) {
if (isValidURL(u, requiredSchemes)) {
try (InputStream is = u.openStream()) {
is.read();
} catch (Throwable _) {
} catch (Throwable exception) {
Logger.getLogger(SpecificationTools.class.getName()).warning("Unable to connect to: " //$NON-NLS-1$
+ u);
}
return true;
}
} catch (Throwable _) {
} catch (Throwable exception) {
//
}
return false;
Expand All @@ -494,7 +494,7 @@ public static boolean should_beNumber(String actual, String numberFormat) {
format = new DecimalFormat(numberFormat);
}
return format.parse(actual) != null;
} catch (Throwable _) {
} catch (Throwable exception) {
//
}
return false;
Expand Down Expand Up @@ -552,7 +552,7 @@ public static boolean _should_be(XBooleanLiteral actual, Object expected) {
} else {
try {
b = new Boolean(expected.toString());
} catch (Throwable _) {
} catch (Throwable exception) {
return false;
}
}
Expand All @@ -575,7 +575,7 @@ public static boolean _should_be(XNumberLiteral actual, Object expected) {
} else {
try {
number = NumberFormat.getInstance().parse(expected.toString());
} catch (Throwable _) {
} catch (Throwable exception) {
return false;
}
}
Expand Down Expand Up @@ -691,13 +691,13 @@ public static boolean should_haveMethod(Class<?> type, String name) {
String paramText;
try {
paramText = matcher.group(2).trim();
} catch (Throwable _) {
} catch (Throwable exception) {
paramText = ""; //$NON-NLS-1$
}
String returnText;
try {
returnText = matcher.group(3).trim();
} catch (Throwable _) {
} catch (Throwable exception) {
returnText = ""; //$NON-NLS-1$
}
String[] params;
Expand Down Expand Up @@ -749,7 +749,7 @@ public static boolean should_haveField(Class<?> type, String name) {
String fieldType;
try {
fieldType = matcher.group(2).trim();
} catch (Throwable _) {
} catch (Throwable exception) {
fieldType = ""; //$NON-NLS-1$
}
Field field = type.getDeclaredField(fieldName);
Expand Down Expand Up @@ -837,7 +837,7 @@ private static Version parseJavaVersion(String version, Version defaultVersion)
if (group != null && !group.isEmpty()) {
try {
minor = Integer.parseInt(group);
} catch (Exception _) {
} catch (Exception exception) {
//
}
}
Expand All @@ -846,7 +846,7 @@ private static Version parseJavaVersion(String version, Version defaultVersion)
if (group != null && !group.isEmpty()) {
try {
micro = Integer.parseInt(group);
} catch (Exception _) {
} catch (Exception exception) {
//
}
}
Expand All @@ -859,7 +859,7 @@ private static Version parseJavaVersion(String version, Version defaultVersion)
return v;
}
}
} catch (Exception _) {
} catch (Exception exception) {
//
}
return defaultVersion;
Expand Down Expand Up @@ -962,7 +962,7 @@ public static boolean should_haveProperty(URL propertyFile, String propertyName)
String value = props.getProperty(propertyName, null);
return value != null;
}
} catch (Throwable _) {
} catch (Throwable exception) {
//
}
return false;
Expand All @@ -983,7 +983,7 @@ public static boolean should_haveProperty(URL propertyFile, Pair<String, String>
String value = props.getProperty(property.getKey(), null);
return (Objects.equals(value, property.getValue()));
}
} catch (Throwable _) {
} catch (Throwable exception) {
//
}
}
Expand All @@ -1007,7 +1007,7 @@ public static URL getBundlePropertyURL(String bundleName, String filename) {
return FileSystem.toJarURL(url, filename);
}
}
} catch (Throwable _) {
} catch (Throwable exception) {
//
}
return null;
Expand Down Expand Up @@ -1041,7 +1041,7 @@ private void searchNext() {
try {
this.obj = Array.get(this.array, this.index);
++this.index;
} catch (Throwable _) {
} catch (Throwable exception) {
this.obj = null;
}
}
Expand Down
24 changes: 11 additions & 13 deletions features/io.sarl.lang.sdk/feature.xml
Expand Up @@ -224,25 +224,23 @@ integrated tools for the Eclipse IDE.

<requires>
<import plugin="io.sarl.lang.core" version="1.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.equinox.common" version="3.7.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.emf.mwe2.launch" version="2.8.1" match="greaterOrEqual"/>
<import plugin="org.eclipse.osgi" version="3.10.100" match="greaterOrEqual"/>
<import plugin="org.eclipse.xtend.core" version="2.8.4" match="greaterOrEqual"/>
<import plugin="org.eclipse.xtext.generator" version="2.8.4" match="greaterOrEqual"/>
<import plugin="org.apache.log4j"/>
<import plugin="org.eclipse.osgi" version="3.10.101" match="greaterOrEqual"/>
<import plugin="org.eclipse.equinox.common" version="3.7.0" match="greaterOrEqual"/>
<import plugin="io.sarl.lang" version="1.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.core" version="3.11.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.ui" version="3.11.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.compare" version="3.5.600" match="greaterOrEqual"/>
<import plugin="org.eclipse.xtend.ide" version="2.8.4" match="greaterOrEqual"/>
<import plugin="org.eclipse.xtext.builder" version="2.8.4" match="greaterOrEqual"/>
<import plugin="org.eclipse.xtext.common.types.ui" version="2.8.4" match="greaterOrEqual"/>
<import plugin="org.eclipse.xtext.ui" version="2.8.4" match="greaterOrEqual"/>
<import plugin="org.eclipse.xtext.ui.codetemplates.ui" version="2.8.4" match="greaterOrEqual"/>
<import plugin="org.eclipse.xtext.ui.shared" version="2.8.4" match="greaterOrEqual"/>
<import plugin="org.eclipse.xtext.ui.codetemplates.ui" version="2.8.4" match="greaterOrEqual"/>
<import plugin="org.eclipse.xtext.xbase.ui" version="2.8.4" match="greaterOrEqual"/>
<import plugin="org.eclipse.xtext.builder" version="2.8.4" match="greaterOrEqual"/>
<import plugin="org.eclipse.xtend.ide" version="2.8.4" match="greaterOrEqual"/>
<import plugin="org.eclipse.xtext.common.types.ui" version="2.8.4" match="greaterOrEqual"/>
<import plugin="org.apache.log4j" version="1.2.15" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.core" version="3.11.1" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.ui" version="3.11.1" match="greaterOrEqual"/>
<import plugin="org.eclipse.compare" version="3.5.600" match="greaterOrEqual"/>
<import plugin="org.eclipse.xtext.xbase.lib" version="2.8.4" match="greaterOrEqual"/>
<import plugin="javax.inject"/>
<import plugin="javax.inject" version="1.0.0" match="greaterOrEqual"/>
</requires>

<plugin
Expand Down
28 changes: 15 additions & 13 deletions features/io.sarl.sdk/feature.xml
Expand Up @@ -223,24 +223,26 @@

<requires>
<import plugin="io.sarl.lang.ui" version="1.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.xtend.core" version="2.8.4" match="greaterOrEqual"/>
<import plugin="org.eclipse.xtext.ui" version="2.8.4" match="greaterOrEqual"/>
<import plugin="org.eclipse.ui.ide" version="3.11.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.core.filesystem" version="1.5.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.core.variables" version="3.2.800" match="greaterOrEqual"/>
<import plugin="org.eclipse.equinox.bidi" version="0.10.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.emf.codegen.ecore" version="2.11.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.core" version="3.11.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.debug.ui" version="3.7.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.launching" version="3.8.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.ui" version="3.11.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.ui.ide" version="3.11.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.core.variables" version="3.2.800" match="greaterOrEqual"/>
<import plugin="org.eclipse.debug.ui" version="3.11.100" match="greaterOrEqual"/>
<import plugin="org.eclipse.ui.navigator" version="3.6.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.xtend.core" version="2.8.4" match="greaterOrEqual"/>
<import plugin="org.eclipse.xtext.builder" version="2.8.4" match="greaterOrEqual"/>
<import plugin="org.eclipse.xtext.ui" version="2.8.4" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.core" version="3.11.1" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.ui" version="3.11.1" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.launching" version="3.8.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.debug.ui" version="3.7.0" match="greaterOrEqual"/>
<import plugin="io.sarl.lang.core" version="1.0.0" match="greaterOrEqual"/>
<import plugin="io.sarl.eclipse" version="1.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.m2e.core" version="1.6.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.m2e.maven.runtime" version="1.6.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.m2e.jdt" version="1.6.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.core.runtime" version="3.11.1" match="greaterOrEqual"/>
<import plugin="org.eclipse.core.resources" version="3.10.1" match="greaterOrEqual"/>
<import plugin="org.eclipse.ui" version="3.107.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.m2e.maven.runtime" version="1.6.2" match="greaterOrEqual"/>
<import plugin="org.eclipse.m2e.jdt" version="1.6.2" match="greaterOrEqual"/>
<import plugin="org.eclipse.m2e.core" version="1.6.2" match="greaterOrEqual"/>
</requires>

<plugin
Expand Down
Expand Up @@ -50,7 +50,7 @@ public class CompileMojo extends AbstractSarlMojo {

/** Version of the Java specification used for the source files.
*/
@Parameter(defaultValue = "1.7", required = false)
@Parameter(defaultValue = "1.8", required = false)
protected String source;

/** Version of the Java specification used for the output files.
Expand Down
2 changes: 1 addition & 1 deletion plugins/io.sarl.core/META-INF/MANIFEST.MF
Expand Up @@ -4,6 +4,6 @@ Bundle-SymbolicName: io.sarl.core
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: %Bundle-Vendor
Bundle-Name: %Bundle-Name
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: io.sarl.lang.core;bundle-version="1.0.0";visibility:=reexport
Export-Package: io.sarl.core
2 changes: 1 addition & 1 deletion plugins/io.sarl.core/build.properties
Expand Up @@ -4,4 +4,4 @@ source.. = src/main/java/,\
bin.includes = META-INF/,\
.,\
OSGI-INF/
jre.compilation.profile = JavaSE-1.7
jre.compilation.profile = JavaSE-1.8
44 changes: 12 additions & 32 deletions plugins/io.sarl.eclipse/META-INF/MANIFEST.MF
Expand Up @@ -4,44 +4,24 @@ Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor
Bundle-Version: 1.0.0.qualifier
Bundle-SymbolicName: io.sarl.eclipse;singleton:=true
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Require-Bundle: io.sarl.lang.ui;bundle-version="1.0.0";visibility:=reexport,
org.eclipse.xtend.core;bundle-version="2.8.4",
org.eclipse.xtext.ui;bundle-version="2.8.4",
org.eclipse.ui.ide;bundle-version="3.11.0",
org.eclipse.core.filesystem;bundle-version="1.5.0",
org.eclipse.core.variables;bundle-version="3.2.800",
org.eclipse.equinox.bidi;bundle-version="0.10.0",
org.eclipse.emf.codegen.ecore;bundle-version="2.11.0",
org.eclipse.jdt.core;bundle-version="3.11.0",
org.eclipse.jdt.debug.ui;bundle-version="3.7.0",
org.eclipse.jdt.launching;bundle-version="3.8.0",
org.eclipse.jdt.ui;bundle-version="3.11.0",
org.eclipse.ui.ide;bundle-version="3.11.0",
org.eclipse.core.variables;bundle-version="3.2.800",
org.eclipse.debug.ui;bundle-version="3.11.100",
org.eclipse.ui.navigator;bundle-version="3.6.0",
org.eclipse.xtend.core;bundle-version="2.8.4",
org.eclipse.xtext.builder;bundle-version="2.8.4",
org.eclipse.xtext.ui;bundle-version="2.8.4"
org.eclipse.jdt.core;bundle-version="3.11.1",
org.eclipse.jdt.ui;bundle-version="3.11.1",
org.eclipse.jdt.launching;bundle-version="3.8.0",
org.eclipse.jdt.debug.ui;bundle-version="3.7.0"
Bundle-Activator: io.sarl.eclipse.SARLEclipsePlugin
Export-Package: io.sarl.eclipse,
io.sarl.eclipse.buildpath,
io.sarl.eclipse.dialog,
io.sarl.eclipse.launching.dialog,
io.sarl.eclipse.launching.runner,
io.sarl.eclipse.launching.sreproviding,
io.sarl.eclipse.natures,
io.sarl.eclipse.navigator,
io.sarl.eclipse.navigator.node,
io.sarl.eclipse.perspectives,
io.sarl.eclipse.preferences,
io.sarl.eclipse.properties,
io.sarl.eclipse.runtime,
io.sarl.eclipse.util,
io.sarl.eclipse.wizards.elements,
io.sarl.eclipse.wizards.elements.aop.newagent,
io.sarl.eclipse.wizards.elements.aop.newbehavior,
io.sarl.eclipse.wizards.elements.aop.newcapacity,
io.sarl.eclipse.wizards.elements.aop.newevent,
io.sarl.eclipse.wizards.elements.aop.newskill,
io.sarl.eclipse.wizards.newfile,
io.sarl.eclipse.wizards.newproject,
io.sarl.eclipse.wizards.sreinstall
Bundle-Activator: io.sarl.eclipse.SARLEclipsePlugin
io.sarl.eclipse.util

4 changes: 1 addition & 3 deletions plugins/io.sarl.eclipse/build.properties
Expand Up @@ -10,6 +10,4 @@ bin.includes = META-INF/,\
schema/,\
about.mappings,\
plugin_customization.ini
additional.bundles = io.sarl.util,\
com.google.guava
jre.compilation.profile = JavaSE-1.7
jre.compilation.profile = JavaSE-1.8
Expand Up @@ -116,7 +116,7 @@ public final class SARLEclipseConfig {

/** Minimal version of the JRE supported by the SARL launch application.
*/
public static final String MINIMAL_JRE_VERSION = "1.7"; //$NON-NLS-1$
public static final String MINIMAL_JRE_VERSION = "1.8"; //$NON-NLS-1$

/** Filename of the image that may be used at
* the top of the wizard dialog when creating new SARL project.
Expand Down
Expand Up @@ -549,7 +549,7 @@ public void run(IProgressMonitor pm) throws InvocationTargetException {
}
});
return res[0];
} catch (Exception _) {
} catch (Exception exception) {
//
}
}
Expand Down

0 comments on commit f9095c7

Please sign in to comment.