First iteration of making integrations typesafe

This commit is contained in:
yueh
2015-08-06 16:01:56 +02:00
parent 0df445c6a8
commit f303c17ae0
44 changed files with 282 additions and 147 deletions
@@ -24,6 +24,8 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import appeng.integration.IntegrationType;
public @interface Integration
{
@@ -40,13 +42,13 @@ public @interface Integration
{
String iface();
String iname();
IntegrationType iname();
}
@Retention( RetentionPolicy.RUNTIME )
@Target( ElementType.METHOD )
@interface Method
{
String iname();
IntegrationType iname();
}
}
@@ -184,11 +184,11 @@ public final class ASMIntegration implements IClassTransformer
if( an.values.get( 0 ).equals( "iname" ) )
{
iName = (String) an.values.get( 1 );
iName = ( (String[]) an.values.get( 1 ) )[1];
}
else if( an.values.get( 2 ).equals( "iname" ) )
{
iName = (String) an.values.get( 3 );
iName = ( (String[]) an.values.get( 3 ) )[1];
}
if( iName != null && iFace != null )
@@ -224,7 +224,7 @@ public final class ASMIntegration implements IClassTransformer
if( an.values.get( 0 ).equals( "iname" ) )
{
iName = (String) an.values.get( 1 );
iName = ( (String[]) an.values.get( 1 ) )[1];
}
if( iName != null )