Commit 25108594 authored by Lionel Seinturier's avatar Lionel Seinturier
Browse files

Improve typing.

parent a079b303
......@@ -44,6 +44,7 @@ public class Juliac extends org.objectweb.fractal.juliac.runtime.Juliac {
/**
* Return the reference of the bootstrap component.
*/
@Override
public Component newFcInstance(
Type type, Object controllerDesc, Object contentDesc ) {
......
......@@ -62,6 +62,7 @@ implements MembraneFactory {
* @param controllerDesc the component controller descriptor
* @param contentDesc the component content descriptor
*/
@Override
public Component newFcInstance(
Type type, Object controllerDesc, Object contentDesc )
throws InstantiationException {
......@@ -85,17 +86,19 @@ implements MembraneFactory {
// -----------------------------------------------------------------
/** The map <Object,String> of membrane adls. */
private Map membranes = new HashMap();
private Map<Object,String> membranes = new HashMap<>();
@Override
public String getFcMembraneADL( Object controllerDesc ) {
String adl = (String) membranes.get(controllerDesc);
return adl;
}
@Override
public Component newFcMembrane( Object controllerDesc )
throws InstantiationException {
Class cl = null;
Class<?> cl = null;
try {
String adl = Juliac.JULIAC_GENERATED+'.'+controllerDesc;
cl = loadClassIE(adl);
......@@ -106,7 +109,7 @@ implements MembraneFactory {
* Check whether a custom ADL has been registered for this membrane.
*/
if( ! membranes.containsKey(controllerDesc) ) {
String msg = "Unknown controller descriptor: "+controllerDesc;
final String msg = "Unknown controller descriptor: "+controllerDesc;
throw new InstantiationException(msg);
}
String adl = (String) membranes.get(controllerDesc);
......@@ -119,12 +122,13 @@ implements MembraneFactory {
return c;
}
@Override
public void registerFcNewMembraneDef( String controllerDesc, String adl )
throws InstantiationException {
Class cl = loadClassIE(adl);
Class<?> cl = loadClassIE(adl);
if( ! Factory.class.isAssignableFrom(cl) ) {
String msg = adl+" should implement "+Factory.class.getName();
final String msg = adl+" should implement "+Factory.class.getName();
throw new InstantiationException(msg);
}
membranes.put(controllerDesc, adl);
......@@ -135,6 +139,7 @@ implements MembraneFactory {
// Implementation of the Component interface
// -----------------------------------------------------------------
@Override
public Object[] getFcInterfaces() {
if( interfaces == null ) {
interfaces =
......@@ -148,6 +153,7 @@ implements MembraneFactory {
return interfaces;
}
@Override
public Type getFcType() {
if( type == null ) {
try {
......
......@@ -78,7 +78,7 @@ public class UltraCompUtils {
sb.append('_');
String sub = str.substring(i,i+1);
byte[] bytes = sub.getBytes();
int integer = new Byte(bytes[0]).intValue();
int integer = Byte.valueOf(bytes[0]).intValue();
String s = Integer.toHexString(integer);
sb.append(s);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment